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ICAgICAgICAgICAgICAgIG1EYXRhQ2IoMCksCisgICAgICAgICAgICAgICAgICAgIG1EYXRhQ2JUaW1lc3RhbXAoMCksCisgICAgICAgICAgICAgICAgICAgIG1DYWxsYmFja0Nvb2tpZSgwKSwKKyAgICAgICAgICAgICAgICAgICAgbU1zZ0VuYWJsZWQoMCksCiAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50UHJldmlld0ZyYW1lKDApCiB7CiAgICAgaW5pdERlZmF1bHRQYXJhbWV0ZXJzKCk7CkBAIC0xMTIsNiArMTEwLDM2IEBACiAgICAgcmV0dXJuIG1SYXdIZWFwOwogfQogCit2b2lkIENhbWVyYUhhcmR3YXJlU3R1Yjo6c2V0Q2FsbGJhY2tzKG5vdGlmeV9jYWxsYmFjayBub3RpZnlfY2IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfY2FsbGJhY2sgZGF0YV9jYiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9jYWxsYmFja190aW1lc3RhbXAgZGF0YV9jYl90aW1lc3RhbXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXIpCit7CisgICAgTXV0ZXg6OkF1dG9sb2NrIGxvY2sobUxvY2spOworICAgIG1Ob3RpZnlDYiA9IG5vdGlmeV9jYjsKKyAgICBtRGF0YUNiID0gZGF0YV9jYjsKKyAgICBtRGF0YUNiVGltZXN0YW1wID0gZGF0YV9jYl90aW1lc3RhbXA7CisgICAgbUNhbGxiYWNrQ29va2llID0gdXNlcjsKK30KKwordm9pZCBDYW1lcmFIYXJkd2FyZVN0dWI6OmVuYWJsZU1zZ1R5cGUoaW50MzJfdCBtc2dUeXBlKQoreworICAgIE11dGV4OjpBdXRvbG9jayBsb2NrKG1Mb2NrKTsKKyAgICBtTXNnRW5hYmxlZCB8PSBtc2dUeXBlOworfQorCit2b2lkIENhbWVyYUhhcmR3YXJlU3R1Yj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dGhyb3VnaCB0aGUgYmluZGVyLgorICAgICAgICAgICAgVGhyZWFkKHRydWUpLAorI2Vsc2UKKyAgICAgICAgICAgIFRocmVhZChmYWxzZSksCisjZW5kaWYKKyAgICAgICAgICAgICAgbUhhcmR3YXJlKGh3KSB7IH0KICAgICAgICAgdmlydHVhbCB2b2lkIG9uRmlyc3RSZWYoKSB7CiAgICAgICAgICAgICBydW4oIkNhbWVyYVByZXZpZXdUaHJlYWQiLCBQUklPUklUWV9VUkdFTlRfRElTUExBWSk7CiAgICAgICAgIH0KQEAgLTEwMiwxOCArMTEzLDE1IEBACiAgICAgYm9vbCAgICAgICAgICAgICAgICBtUHJldmlld1J1bm5pbmc7CiAgICAgaW50ICAgICAgICAgICAgICAgICBtUHJldmlld0ZyYW1lU2l6ZTsKIAotICAgIHNodXR0ZXJfY2FsbGJhY2sgICAgbVNodXR0ZXJDYWxsYmFjazsKLSAgICByYXdfY2FsbGJhY2sgICAgICAgIG1SYXdQaWN0dXJlQ2FsbGJhY2s7Ci0gICAganBlZ19jYWxsYmFjayAgICAgICBtSnBlZ1BpY3R1cmVDYWxsYmFjazsKLSAgICB2b2lkICAgICAgICAgICAgICAgICptUGljdHVyZUNhbGxiYWNrQ29va2llOwotCiAgICAgLy8gcHJvdGVjdGVkIGJ5IG1Mb2NrCiAgICAgc3A8UHJldmlld1RocmVhZD4gICBtUHJldmlld1RocmVhZDsKLSAgICBwcmV2aWV3X2NhbGxiYWNrICAgIG1QcmV2aWV3Q2FsbGJhY2s7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICAqbVByZXZpZXdDYWxsYmFja0Nvb2tpZTsKIAotICAgIGF1dG9mb2N1c19jYWxsYmFjayAgbUF1dG9Gb2N1c0NhbGxiYWNrOwotICAgIHZvaWQgICAgICAgICAgICAgICAgKm1BdXRvRm9jdXNDYWxsYmFja0Nvb2tpZTsKKyAgICBub3RpZnlfY2FsbGJhY2sgICAgbU5vdGlmeUNiOworICAgIGRhdGFfY2FsbGJhY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wLT5zZXRBdWRpb1N0cmVhbVR5cGUoQXVkaW9TeXN0ZW06OkVORk9SQ0VEX0FVRElCTEUpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbXAtPnNldEF1ZGlvU3RyZWFtVHlwZShBdWRpb1N5c3RlbTo6U1lTVEVNKTsgICAgICAgICAgICAKLSAgICAgICAgfQorICAgICAgICBtcC0+c2V0QXVkaW9TdHJlYW1UeXBlKEF1ZGlvU3lzdGVtOjpFTkZPUkNFRF9BVURJQkxFKTsKICAgICAgICAgbXAtPnByZXBhcmUoKTsKICAgICB9IGVsc2UgewogICAgICAgICBtcC5jbGVhcigpOwpAQCAtMjI1LDggKzIxOSwyMCBAQAogICAgIG1IYXJkd2FyZSA9IG9wZW5DYW1lcmFIYXJkd2FyZSgpOwogICAgIG1Vc2VPdmVybGF5ID0gbUhhcmR3YXJlLT51c2VPdmVybGF5KCk7CiAKKyAgICBtSGFyZHdhcmUtPnNldENhbGxiYWNrcyhub3RpZnlDYWxsYmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhQ2FsbGJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUNhbGxiYWNrVGltZXN0YW1wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DYW1lcmFTZXJ2aWNlLmdldCgpKTsKKworICAgIC8vIEVuYWJsZSB6b29tLCBlcnJvciwgYW5kIGZvY3VzIG1lc3NhZ2VzIGJ5IGRlZmF1bHQKKyAgICBtSGFyZHdhcmUtPmVuYWJsZU1zZ1R5cGUoQ0FNRVJBX01TR19FUlJPUiB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENBTUVSQV9NU0dfWk9PTSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENBTUVSQV9NU0dfRk9DVVMpOworCiAgICAgbU1lZGlhUGxheWVyQ2xpY2sgPSBuZXdNZWRpYVBsYXllcigiL3N5c3RlbS9tZWRpYS9hdWRpby91aS9jYW1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zZXRPdmVybGF5KG5ldyBPdmVybGF5KHJlZikpOworICAgICAgICBpZiAobU92ZXJsYXlSZWYuZ2V0KCkgPT0gTlVMTCkgeworICAgICAgICAgICAgbU92ZXJsYXlSZWYgPSBtU3VyZmFjZS0+Y3JlYXRlT3ZlcmxheSh3LCBoLCBmbXQpOworICAgICAgICAgICAgaWYgKCBtT3ZlcmxheVJlZi5nZXQoKSA9PSBOVUxMICkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJPdmVybGF5IENyZWF0aW9uIEZhaWxlZCEiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldCA9IG1IYXJkd2FyZS0+c2V0T3ZlcmxheShuZXcgT3ZlcmxheShtT3ZlcmxheVJlZikpOworICAgICAgICB9CiAgICAgfSBlbHNlIHsKICAgICAgICAgcmV0ID0gbUhhcmR3YXJlLT5zZXRPdmVybGF5KE5VTEwpOwogICAgIH0KICAgICBpZiAocmV0ICE9IE5PX0VSUk9SKSB7CiAgICAgICAgIExPR0UoIm1IYXJkd2FyZS0+c2V0T3ZlcmxheSgpIGZhaWxlZCB3aXRoIHN0YXR1cyAlZFxuIiwgcmV0KTsKICAgICB9CisKKyAgICBtT3ZlcmxheVcgPSB3OworICAgIG1PdmVybGF5SCA9IGg7CisKICAgICByZXR1cm4gcmV0OwogfQogCkBAIC01ODgsMTAgKzY0MSwxMCBAQAogICAgICAgICAgICAgcmV0ID0gc2V0T3ZlcmxheSgpOwogICAgICAgICB9CiAgICAgICAgIGlmIChyZXQgIT0gTk9fRVJST1IpIHJldHVybiByZXQ7Ci0gICAgICAgIHJldCA9IG1IYXJkd2FyZS0+c3RhcnRQcmV2aWV3KE5VTEwsIG1DYW1lcmFTZXJ2aWNlLmdldCgpKTsKKyAgICAgICAgcmV0ID0gbUhhcmR3YXJlLT5zdGFydFByZXZpZXcoKTsKICAgICB9IGVsc2UgewotICAg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ICs4NDAsMzYgQEAKICAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwogICAgIH0KIAotICAgIHJldHVybiBtSGFyZHdhcmUtPnRha2VQaWN0dXJlKHNodXR0ZXJDYWxsYmFjaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5dXZQaWN0dXJlQ2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganBlZ1BpY3R1cmVDYWxsYmFjaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ2FtZXJhU2VydmljZS5nZXQoKSk7CisgICAgbUhhcmR3YXJlLT5lbmFibGVNc2dUeXBlKENBTUVSQV9NU0dfU0hVVFRFUiB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENBTUVSQV9NU0dfUE9TVFZJRVdfRlJBTUUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDQU1FUkFfTVNHX1JBV19JTUFHRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENBTUVSQV9NU0dfQ09NUFJFU1NFRF9JTUFHRSk7CisKKyAgICByZXR1cm4gbUhhcmR3YXJlLT50YWtlUGljdHVyZSgpOwogfQogCi0vLyBwaWN0dXJlIGNhbGxiYWNrIC0gc25hcHNob3QgdGFrZW4KLXZvaWQgQ2FtZXJhU2VydmljZTo6Q2xpZW50OjpzaHV0dGVyQ2FsbGJhY2sodm9pZCAqdXNlcikKKy8vIHNuYXBzaG90IHRha2VuCit2b2lkIENhbWVyYVNlcnZpY2U6OkNsaWVudDo6aGFuZGxlU2h1dHRlcigpCiB7Ci0gICAgc3A8Q2xpZW50PiBjbGllbnQgPSBnZXRDbGllbnRGcm9tQ29va2llKHVzZXIpOwotICAgIGlmIChjbGllbnQgPT0gMCkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotCiAgICAgLy8gUGxheSBzaHV0dGVyIHNvdW5kLgotICAgIGlmIChjbGllbnQtPm1NZWRpYVBsYX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VE9fRklMRQorICAgIHsKKyAgICAgICAgaWYgKGRlYnVnX2ZyYW1lX2NudCsrID09IERFQlVHX0RVTVBfUFJFVklFV19GUkFNRV9UT19GSUxFKSB7CisgICAgICAgICAgICBkdW1wX3RvX2ZpbGUoIi9kYXRhL3ByZXZpZXcueXV2IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAodWludDhfdCAqKWhlYXAtPmJhc2UoKSArIG9mZnNldCwgc2l6ZSk7CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKKworICAgIGlmICghbVVzZU92ZXJsYXkpCisgICAgeworICAgICAgICBNdXRleDo6QXV0b2xvY2sgc3VyZmFjZUxvY2sobVN1cmZhY2VMb2NrKTsKKyAgICAgICAgaWYgKG1TdXJmYWNlICE9IE5VTEwpIHsKKyAgICAgICAgICAgIG1TdXJmYWNlLT5wb3N0QnVmZmVyKG9mZnNldCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBJcyB0aGUgY2FsbGJhY2sgZW5hYmxlZCBvciBub3Q/CisgICAgaWYgKCEobVByZXZpZXdDYWxsYmFja0ZsYWcgJiBGUkFNRV9DQUxMQkFDS19GTEFHX0VOQUJMRV9NQVNLKSkgeworICAgICAgICAvLyBJZiB0aGUgZW5hYmxlIGJpdCBpcyBvZmYsIHRoZSBjb3B5LW91dCBhbmQgb25lLXNob3QgYml0cyBhcmUgaWdub3JlZAorICAgICAgICBMT0dWKCJmcmFtZSBjYWxsYmFjayBpcyBkaWFibGVkIik7CiAgICAgICAgIHJldHVybjsKICAgICB9CiAKKyAgICAvLyBJcyB0aGUgcmVjZWl2ZWQgZnJhbWUgY29waWVkIG91dCBvciBub3Q/CisgICAgaWYgKG1QcmV2aWV3Q2FsbGJhY2tGbGFnICYgRlJBTUVfQ0FMTEJBQ0tfRkxBR19DT1BZX09VVF9NQVNLKSB7CisgICAgICAgIExPR1YoImZyYW1lIGlzIGNvcGllZCBvdXQiKTsKKyAgICAgICAgY29weUZyYW1lQW5kUG9zd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ub3RpZnlDYWxsYmFjayhDQU1FUkFfTVNHX0VSUk9SLCBVTktOT1dOX0VSUk9SLCAwKTsKKyAgICAgICAgY2xpZW50LT5tQ2FtZXJhQ2xpZW50LT5kYXRhQ2FsbGJhY2sobXNnVHlwZSwgTlVMTCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBzd2l0Y2ggKG1zZ1R5cGUpIHsKKyAgICAgICAgY2FzZSBDQU1FUkFfTVNHX1BSRVZJRVdfRlJBTUU6CisgICAgICAgICAgICBjbGllbnQtPmhhbmRsZVByZXZpZXdEYXRhKGRhdGFQdHIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ0FNRVJBX01TR19QT1NUVklFV19GUkFNRToKKyAgICAgICAgICAgIGNsaWVudC0+aGFuZGxlUG9zdHZpZXcoZGF0YVB0cik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBDQU1FUkFfTVNHX1JBV19JTUFHRToKKyAgICAgICAgICAgIGNsaWVudC0+aGFuZGxlUmF3UGljdHVyZShkYXRhUHRyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENBTUVSQV9NU0dfQ09NUFJFU1NFRF9JTUFHRToKKyAgICAgICAgICAgIGNsaWVudC0+aGFuZGxlQ29tcHJlc3NlZFBpY3R1cmUoZGF0YVB0cik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGNsaWVudC0+bUNhbWVyYUNsaWVudC0+ZGF0YUNhbGxiYWNrKG1zZ1R5cGUsIGRhdGFQdHIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisjaWYgREVCVUdfQ0xJRU5UX1JFRkVSRU5DRVMKKyAgICBpZiAoY2xpZW50LT5nZXRTdHJvbmdDb3VudCgpID09IDEpIHsKKyAgICAgICAgTE9HRSgiKysrKysrKysrKysrKysrKyAoREFUQSBDQUxMQkFDSykgVEhJUyBXSUxMIENBVV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W0sIHZvaWQqIHVzZXIpOwotICAgICAgICBzdGF0aWMgICAgICB2b2lkICAgICAgICBqcGVnUGljdHVyZUNhbGxiYWNrKGNvbnN0IHNwPElNZW1vcnk+JiBtZW0sIHZvaWQqIHVzZXIpOwotICAgICAgICBzdGF0aWMgICAgICB2b2lkICAgICAgICBhdXRvRm9jdXNDYWxsYmFjayhib29sIGZvY3VzZWQsIHZvaWQqIHVzZXIpOworICAgICAgICBzdGF0aWMgICAgICB2b2lkICAgICAgICBub3RpZnlDYWxsYmFjayhpbnQzMl90IG1zZ1R5cGUsIGludDMyX3QgZXh0MSwgaW50MzJfdCBleHQyLCB2b2lkKiB1c2VyKTsKKyAgICAgICAgc3RhdGljICAgICAgdm9pZCAgICAgICAgZGF0YUNhbGxiYWNrKGludDMyX3QgbXNnVHlwZSwgY29uc3Qgc3A8SU1lbW9yeT4mIGRhdGFQdHIsIHZvaWQqIHVzZXIpOworICAgICAgICBzdGF0aWMgICAgICB2b2lkICAgICAgICBkYXRhQ2FsbGJhY2tUaW1lc3RhbXAobnNlY3NfdCB0aW1lc3RhbXAsIGludDMyX3QgbXNnVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBkYXRhUHRyLCB2b2lkKiB1c2VyKTsKKwogICAgICAgICBzdGF0aWMgICAgICBzcDxDbGllbnQ+ICBnZXRDbGllbnRGcm9tQ29va2llKHZvaWQqIHVzZXIpOwogCi0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHBvc3RTaHV0dGVyKCk7Ci0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHBvc3RSYXcoY29uc3Qgc3A8SU1lbW9yeT4mIG1lbSk7Ci0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHBvc3RKcGVnKGNvbnN0IHNwPElNZW1vcnk+JiBtZW0pOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBwb3N0UHJldmlld0ZyYW1lKGNvbnN0IHNwPElNZW1vcnk+JiBtZW0pOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBwb3N0UmVjb3JkaW5nRnJhbWUobnNlY3NfdCB0aW1lc3RhbXAsIGNvbnN0IHNwPElNZW1vcnk+JiBmcmFtZSk7CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGhhbmRsZVByZXZpZXdEYXRhKGNvbnN0IHNwPElNZW1vcnk+Jik7CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGhhbmRsZVNodXR0ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgaGFuZGxlUG9zdHZpZXcoY29uc3Qgc3A8SU1lbW9yeT4mKTsKKyAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgaGFuZGxlUmF3UGljdHVyZShjb25zdCBzcDxJTWVtb3J5PiYpOworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBoYW5kbGVDb21wcmVzc2VkUGljdHVyZShjb25zdCBzcDxJTWVtb3J5PiYpOworCiAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGNvcHlGcmFtZUFuZFBvc3RDb3BpZWRGcmFtZShzcDxJTWVtb3J5SGVhcD4gaGVhcCwgc2l6ZV90IG9mZnNldCwgc2l6ZV90IHNpemUpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBwb3N0RXJyb3Ioc3RhdHVzX3QgZXJyb3IpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBwb3N0QXV0b0ZvY3VzKGJvb2wgZm9jdXNlZCk7CiAKICAgICAgICAgLy8gY2FtZXJhIG9wZXJhdGlvbiBtb2RlCiAgICAgICAgIGVudW0gY2FtZXJhX21vZGUgewpAQCAtMTg5LDYgKzE4NywxMCBAQAogICAgICAgICAgICAgICAgICAgICBzcDxDYW1lcmFIYXJkd2FyZUludGVyZmFjZT4gbUhhcmR3YXJlOwogICAgICAgICAgICAgICAgICAgICBwaWRfdCAgICAgICAgICAgICAgICAgICAgICAgbUNsaWVudFBpZDsKICAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgIG1Vc2VPdmVybGF5OworCisgICAgICAgICAgICAgICAgICAgIHNwPE92ZXJsYXlSZWY+ICAgICAgICAgICAgICBtT3ZlcmxheVJlZjsKKyAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIG1PdmVybGF5VzsKKyAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIG1PdmVybGF5SDsKICAgICB9OwogCiAvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCmRpZmYgLS1naXQgYS9jbWRzL2FtL3NyYy9jb20vYW5kcm9pZC9jb21tYW5kcy9hbS9BbS5qYXZhIGIvY21kcy9hbS9zcmMvY29tL2FuZHJvaWQvY29tbWFuZHMvYW0vQW0uamF2YQppbmRleCAzNzgyMTM2Li4wYjRmMjVlIDEwMDY0NAotLS0gYS9jbWRzL2FtL3NyYy9jb20vYW5kcm9pZC9jb21tYW5kcy9hbS9BbS5qYXZhCisrKyBiL2NtZHMvYW0vc3JjL2NvbS9hbmRyb2lkL2NvbW1hbmRzL2FtL0FtLmphdmEKQEAgLTIzLDE2ICsyMywxOSBAQAogaW1wb3J0IGFuZHJvaWQuYXBwLklJbnN0cnVtZW50YXRpb25XYXRjaGVyOwogaW1wb3J0IGFuZHJvaWQuYXBwLkluc3RydW1lbnRhdGlvbjsKIGltcG9ydCBhbmRyb2lkLmNvbnRlbnQuQ29tcG9uZW50TmFtZTsKK2ltcG9ydCBhbmRyb2lkLmNvbnRlbnQuSUludGVudFJlY2VpdmVyOwogaW1wb3J0IGFuZHJvaWQuY29udGVudC5JbnRl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hcmdzIFRoZSBjb21tYW5kLWxpbmUgYXJndW1lbnRzCiAgICAgICovCiAgICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewotICAgICAgICAobmV3IEFtKCkpLnJ1bihhcmdzKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIChuZXcgQW0oKSkucnVuKGFyZ3MpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgc2hvd1VzYWdlKCk7CisgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIkVycm9yOiAiICsgZS5nZXRNZXNzYWdlKCkpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKGUudG9TdHJpbmcoKSk7CisgICAgICAgICAgICBTeXN0ZW0uZXhpdCgxKTsKKyAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBydW4oU3RyaW5nW10gYXJncykgeworICAgIHByaXZhdGUgdm9pZCBydW4oU3RyaW5nW10gYXJncykgdGhyb3dzIEV4Y2VwdGlvbiB7CiAgICAgICAgIGlmIChhcmdzLmxlbmd0aCA8IDEpIHsKICAgICAgICAgICAgIHNob3dVc2FnZSgpOwogICAgICAgICAgICAgcmV0dXJuOwpAQCAtNjIsMTYgKzc4LDE0IEBACiAKICAgICAgICAgbUFtID0gQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmdldERlZmF1bHQoKTsKICAgICAgICAgaWYgKG1BbSA9PSBudWxsKSB7Ci0gICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIkVycm9yIHR5cGUgMiIpOwotICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogVW5hYmxlIHRvIGNvbm5lY3QgdG8gYWN0aXZpdHkgbWFuYWdlcjsgaXMgdGhlIHN5c3RlbSBydW5uaW5nPyIpOwotICAgICAgICAgICAgc2hvd1VzYWdlKCk7Ci0gICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oTk9fU1lTVEVNX0VSUk9SX0NPREUpOworICAgICAgICAgICAgdGhyb3cgbmV3IEFuZHJvaWRFeGNlcHRpb24oIkNhbid0IGNvbm5lY3QgdG8gYWN0aXZpdHkgbWFuYWdlcjsgaXMgdGhlIHN5c3RlbSBydW5uaW5nPyIpOwogICAgICAgICB9CiAKICAgICAgICAgbUFyZ3MgPSBhcmdzOwotCiAgICAgICAgIFN0cmluZyBvcCA9IGFyZ3NbMF07CiAgICAgICAgIG1OZXh0QXJnID0gMTsKKwogICAgICAgICBpZiAob3AuZXF1YWxzKCJzdGFydCIpKSB7CiAgICAgICAgICAgICBydW5TdGFydCgpOwogICAgICAgICB9IGVsc2UgaWYgKG9wLmVxdWFscygiaW5zdHJ1bWVudCIpKSB7CkBAIC04MSwxMyArOTUsMTEgQEAKICAgICAgICAgfSBlbHNlIGlmIChvcC5lcXVhbHMoInByb2ZpbGUiKSkgewogICAgICAgICAgICAgcnVuUHJvZmlsZSgpOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogVW5rbm93biBjb21tYW5kOiAiICsgb3ApOwotICAgICAgICAgICAgc2hvd1VzYWdlKCk7Ci0gICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGNvbW1hbmQ6ICIgKyBvcCk7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIEludGVudCBtYWtlSW50ZW50KCkgeworICAgIHByaXZhdGUgSW50ZW50IG1ha2VJbnRlbnQoKSB0aHJvd3MgVVJJU3ludGF4RXhjZXB0aW9uIHsKICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoKTsKICAgICAgICAgYm9vbGVhbiBoYXNJbnRlbnRJbmZvID0gZmFsc2U7CiAKQEAgLTk1LDE4NiArMTA3LDE0NiBAQAogICAgICAgICBVcmkgZGF0YSA9IG51bGw7CiAgICAgICAgIFN0cmluZyB0eXBlID0gbnVsbDsKIAotICAgICAgICB0cnkgewotICAgICAgICAgICAgU3RyaW5nIG9wdDsKLSAgICAgICAgICAgIHdoaWxlICgob3B0PW5leHRPcHRpb24oKSkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChvcHQuZXF1YWxzKCItYSIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludGVudC5zZXRBY3Rpb24obmV4dE9wdGlvbkRhdGEoKSk7Ci0gICAgICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLWQiKSkgewotICAgICAgICAgICAgICAgICAgICBkYXRhID0gVXJpLnBhcnNlKG5leHRPcHRpb25EYXRhKCkpOwotICAgICAgICAgICAgICAgICAgICBoYXNJbnRlbnRJbmZvID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi10IikpIHsKLSAgICAgICAgICAgICAgICAgICAgdHlwZSA9IG5leHRPcHRpb25EYXRhKCk7Ci0gICAgICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLWMiKSkgewotICAgICAgICAgICAgICAgICAgICBpbnRlbnQuYWRkQ2F0ZWdvcnkobmV4dE9wdGlvbkRhdGEoKSk7Ci0gICAgICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLWUiKSB8fCBvcHQuZXF1YWxzKCItLWVzIikpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG5leHRPcHRpb25EYXRhKCk7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IG5leHRPcHRpb25EYXRhKCk7Ci0gICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShrZXksIHZhbHVlKTsKLSAgICAgICAgICAgICAgICAgICAgaGFzSW50ZW50SW5mbyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItLWVpIikpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG5leHRPcHRpb25EYXRhKCk7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IG5leHRPcHRpb25EYXRhKCk7Ci0gICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShrZXksIEludGVnZXIudmFsdWVPZih2YWx1ZSkpOwotICAgICAgICAgICAgICAgICAgICBoYXNJbnRlbnRJbmZvID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi0tZXoiKSkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcga2V5ID0gbmV4dE9wdGlvbkRhdGEoKTsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHZhbHVlID0gbmV4dE9wdGlvbkRhdGEoKTsKLSAgICAgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKGtleSwgQm9vbGVhbi52YWx1ZU9mKHZhbHVlKSk7Ci0gICAgICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLW4iKSkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc3RyID0gbmV4dE9wdGlvbkRhdGEoKTsKLSAgICAgICAgICAgICAgICAgICAgQ29tcG9uZW50TmFtZSBjbiA9IENvbXBvbmVudE5hbWUudW5mbGF0dGVuRnJvbVN0cmluZyhzdHIpOwotICAgICAgICAgICAgICAgICAgICBpZiAoY24gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogQmFkIGNvbXBvbmVudCBuYW1lOiAiICsgc3RyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNob3dVc2FnZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChjbik7Ci0gICAgICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLWYiKSkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc3RyID0gbmV4dE9wdGlvbkRhdGEoKTsKLSAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldEZsYWdzKEludGVnZXIuZGVjb2RlKHN0cikuaW50VmFsdWUoKSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItRCIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EZWJ1Z09wdGlvbiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogVW5rbm93biBvcHRpb246ICIgKyBvcHQpOwotICAgICAgICAgICAgICAgICAgICBzaG93VXNhZ2UoKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBTdHJpbmcgb3B0OworICAgICAgICB3aGlsZSAoKG9wdD1uZXh0T3B0aW9uKCkpICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChvcHQuZXF1YWxzKCItYSIpKSB7CisgICAgICAgICAgICAgICAgaW50ZW50LnNldEFjdGlvbihuZXh0QXJnUmVxdWlyZWQoKSk7CisgICAgICAgICAgICAgICAgaGFzSW50ZW50SW5mbyA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi1kIikpIHsKKyAgICAgICAgICAgICAgICBkYXRhID0gVXJpLnBhcnNlKG5leHRBcmdSZXF1aXJlZCgpKTsKKyAgICAgICAgICAgICAgICBoYXNJbnRlbnRJbmZvID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLXQiKSkgeworICAgICAgICAgICAgICAgIHR5cGUgPSBuZXh0QXJnUmVxdWlyZWQoKTsKKyAgICAgICAgICAgICAgICBoYXNJbnRlbnRJbmZvID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLWMiKSkgeworICAgICAgICAgICAgICAgIGludGVudC5hZGRDYXRlZ29yeShuZXh0QXJnUmVxdWlyZWQoKSk7CisgICAgICAgICAgICAgICAgaGFzSW50ZW50SW5mbyA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi1lIikgfHwgb3B0LmVxdWFscygiLS1lcyIpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShrZXksIHZhbHVlKTsKKyAgICAgICAgICAgICAgICBoYXNJbnRlbnRJbmZvID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLS1laSIpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShrZXksIEludGVnZXIudmFsdWVPZih2YWx1ZSkpOworICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItLWV6IikpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcga2V5ID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgICAgICAgICAgU3RyaW5nIHZhbHVlID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKGtleSwgQm9vbGVhbi52YWx1ZU9mKHZhbHVlKSk7CisgICAgICAgICAgICAgICAgaGFzSW50ZW50SW5mbyA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi1uIikpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgc3RyID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgICAgICAgICAgQ29tcG9uZW50TmFtZSBjbiA9IENvbXBvbmVudE5hbWUudW5mbGF0dGVuRnJvbVN0cmluZyhzdHIpOworICAgICAgICAgICAgICAgIGlmIChjbiA9PSBudWxsKSB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJCYWQgY29tcG9uZW50IG5hbWU6ICIgKyBzdHIpOworICAgICAgICAgICAgICAgIGludGVudC5zZXRDb21wb25lbnQoY24pOworICAgICAgICAgICAgICAgIGhhc0ludGVudEluZm8gPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItZiIpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIHN0ciA9IG5leHRBcmdSZXF1aXJlZCgpOworICAgICAgICAgICAgICAgIGludGVudC5zZXRGbGFncyhJbnRlZ2VyLmRlY29kZShzdHIpLmludFZhbHVlKCkpOworICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItRCIpKSB7CisgICAgICAgICAgICAgICAgbURlYnVnT3B0aW9uID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogVW5rbm93biBvcHRpb246ICIgKyBvcHQpOworICAgICAgICAgICAgICAgIHNob3dVc2FnZSgpOworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQotICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIkVycm9yOiAiICsgZXgudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICBzaG93VXNhZ2UoKTsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAgICAgICAgIGludGVudC5zZXREYXRhQW5kVHlwZShkYXRhLCB0eXBlKTsKIAogICAgICAgICBTdHJpbmcgdXJpID0gbmV4dEFyZygpOwogICAgICAgICBpZiAodXJpICE9IG51bGwpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgSW50ZW50IG9sZEludGVudCA9IGludGVudDsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBpbnRlbnQgPSBJbnRlbnQuZ2V0SW50ZW50KHVyaSk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoamF2YS5uZXQuVVJJU3ludGF4RXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiQmFkIFVSSTogIiArIHVyaSk7Ci0gICAgICAgICAgICAgICAgICAgIHNob3dVc2FnZSgpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG9sZEludGVudC5nZXRBY3Rpb24oKSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludGVudC5zZXRBY3Rpb24ob2xkSW50ZW50LmdldEFjdGlvbigpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG9sZEludGVudC5nZXREYXRhKCkgIT0gbnVsbCB8fCBvbGRJbnRlbnQuZ2V0VHlwZSgpICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldERhdGFBbmRUeXBlKG9sZEludGVudC5nZXREYXRhKCksIG9sZEludGVudC5nZXRUeXBlKCkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBTZXQgY2F0cyA9IG9sZEludGVudC5nZXRDYXRlZ29yaWVzKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGNhdHMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBJdGVyYXRvciBpdCA9IGNhdHMuaXRlcmF0b3IoKTsKLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGl0Lmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LmFkZENhdGVnb3J5KChTdHJpbmcpaXQubmV4dCgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIkVycm9yIGNyZWF0aW5nIGZyb20gVVJJOiAiICsgZXgudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgc2hvd1VzYWdlKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICBJbnRlbnQgb2xkSW50ZW50ID0gaW50ZW50OworICAgICAgICAgICAgaW50ZW50ID0gSW50ZW50LmdldEludGVudCh1cmkpOworICAgICAgICAgICAgaWYgKG9sZEludGVudC5nZXRBY3Rpb24oKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW50ZW50LnNldEFjdGlvbihvbGRJbnRlbnQuZ2V0QWN0aW9uKCkpOwogICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKCFoYXNJbnRlbnRJbmZvKSB7Ci0gICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIkVycm9yOiBObyBpbnRlbnQgc3VwcGxpZWQiKTsKLSAgICAgICAgICAgIHNob3dVc2FnZSgpOwotICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICBpZiAob2xkSW50ZW50LmdldERhdGEoKSAhPSBudWxsIHx8IG9sZEludGVudC5nZXRUeXBlKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGludGVudC5zZXREYXRhQW5kVHlwZShvbGRJbnRlbnQuZ2V0RGF0YSgpLCBvbGRJbnRlbnQuZ2V0VHlwZSgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFNldCBjYXRzID0gb2xkSW50ZW50LmdldENhdGVnb3JpZXMoKTsKKyAgICAgICAgICAgIGlmIChjYXRzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBJdGVyYXRvciBpdCA9IGNhdHMuaXRlcmF0b3IoKTsKKyAgICAgICAgICAgICAgICB3aGlsZSAoaXQuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgIGludGVudC5hZGRDYXRlZ29yeSgoU3RyaW5nKWl0Lm5leHQoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaGFzSW50ZW50SW5mbyA9IHRydWU7CiAgICAgICAgIH0KIAorICAgICAgICBpZiAoIWhhc0ludGVudEluZm8pIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk5vIGludGVudCBzdXBwbGllZCIpOwogICAgICAgICByZXR1cm4gaW50ZW50OwogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBydW5TdGFydCgpIHsKKyAgICBwcml2YXRlIHZvaWQgcnVuU3RhcnQoKSB0aHJvd3MgRXhjZXB0aW9uIHsKICAgICAgICAgSW50ZW50IGludGVudCA9IG1ha2VJbnRlbnQoKTsKLSAgICAgICAgCi0gICAgICAgIGlmIChpbnRlbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJTdGFydGluZzogIiArIGludGVudCk7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSyk7Ci0gICAgICAgICAgICAgICAgLy8gWFhYIHNob3VsZCBkbyBzb21ldGhpbmcgdG8gZGV0ZXJtaW5lIHRoZSBNSU1FIHR5cGUuCi0gICAgICAgICAgICAgICAgaW50IHJlcyA9IG1BbS5zdGFydEFjdGl2aXR5KG51bGwsIGludGVudCwgaW50ZW50LmdldFR5cGUoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIDAsIG51bGwsIG51bGwsIDAsIGZhbHNlLCBtRGVidWdPcHRpb24pOwotICAgICAgICAgICAgICAgIHN3aXRjaCAocmVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgSUFjdGl2aXR5TWFuYWdlci5TVEFSVF9TVUNDRVNTOgotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgSUFjdGl2aXR5TWFuYWdlci5TVEFSVF9TV0lUQ0hFU19DQU5DRUxFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldhcm5pbmc6IEFjdGl2aXR5IG5vdCBzdGFydGVkIGJlY2F1c2UgdGhlICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGN1cnJlbnQgYWN0aXZpdHkgaXMgYmVpbmcga2VwdCBmb3IgdGhlIHVzZXIuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX0RFTElWRVJFRF9UT19UT1A6Ci0gICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXYXJuaW5nOiBBY3Rpdml0eSBub3Qgc3RhcnRlZCwgaW50ZW50IGhhcyAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgImJlZW4gZGVsaXZlcmVkIHRvIGN1cnJlbnRseSBydW5uaW5nICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAidG9wLW1vc3QgaW5zdGFuY2UuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX1JFVFVSTl9JTlRFTlRfVE9fQ0FMTEVSOgotICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiV2FybmluZzogQWN0aXZpdHkgbm90IHN0YXJ0ZWQgYmVjYXVzZSBpbnRlbnQgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJzaG91bGQgYmUgaGFuZGxlZCBieSB0aGUgY2FsbGVyIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX1RBU0tfVE9fRlJPTlQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJXYXJuaW5nOiBBY3Rpdml0eSBub3Qgc3RhcnRlZCwgaXRzIGN1cnJlbnQgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0YXNrIGhhcyBiZWVuIGJyb3VnaHQgdG8gdGhlIGZyb250Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX0lOVEVOVF9OT1RfUkVTT0xWRUQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJFcnJvcjogQWN0aXZpdHkgbm90IHN0YXJ0ZWQsIHVuYWJsZSB0byAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgInJlc29sdmUgIiArIGludGVudC50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIElBY3Rpdml0eU1hbmFnZXIuU1RBUlRfQ0xBU1NfTk9UX0ZPVU5EOgotICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvciB0eXBlIDMiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiRXJyb3I6IEFjdGl2aXR5IGNsYXNzICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnQuZ2V0Q29tcG9uZW50KCkudG9TaG9ydFN0cmluZygpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBleGlzdC4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIElBY3Rpdml0eU1hbmFnZXIuU1RBUlRfRk9SV0FSRF9BTkRfUkVRVUVTVF9DT05GTElDVDoKLSAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVycm9yOiBBY3Rpdml0eSBub3Qgc3RhcnRlZCwgeW91IHJlcXVlc3RlZCB0byAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgImJvdGggZm9yd2FyZCBhbmQgcmVjZWl2ZSBpdHMgcmVzdWx0Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX1BFUk1JU1NJT05fREVOSUVEOgotICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRXJyb3I6IEFjdGl2aXR5IG5vdCBzdGFydGVkLCB5b3UgZG8gbm90ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiaGF2ZSBwZXJtaXNzaW9uIHRvIGFjY2VzcyBpdC4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRXJyb3I6IEFjdGl2aXR5IG5vdCBzdGFydGVkLCB1bmtub3duIGVycm9yICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiY29kZSAiICsgcmVzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvciB0eXBlIDEiKTsKKyAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJTdGFydGluZzogIiArIGludGVudCk7CisgICAgICAgIGludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19BQ1RJVklUWV9ORVdfVEFTSyk7CisgICAgICAgIC8vIFhYWCBzaG91bGQgZG8gc29tZXRoaW5nIHRvIGRldGVybWluZSB0aGUgTUlNRSB0eXBlLgorICAgICAgICBpbnQgcmVzID0gbUFtLnN0YXJ0QWN0aXZpdHkobnVsbCwgaW50ZW50LCBpbnRlbnQuZ2V0VHlwZSgpLAorICAgICAgICAgICAgICAgIG51bGwsIDAsIG51bGwsIG51bGwsIDAsIGZhbHNlLCBtRGVidWdPcHRpb24pOworICAgICAgICBzd2l0Y2ggKHJlcykgeworICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX1NVQ0NFU1M6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIElBY3Rpdml0eU1hbmFnZXIuU1RBUlRfU1dJVENIRVNfQ0FOQ0VMRUQ6CisgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKAorICAgICAgICAgICAgICAgICAgICAgICAgIldhcm5pbmc6IEFjdGl2aXR5IG5vdCBzdGFydGVkIGJlY2F1c2UgdGhlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBjdXJyZW50IGFjdGl2aXR5IGlzIGJlaW5nIGtlcHQgZm9yIHRoZSB1c2VyLiIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX0RFTElWRVJFRF9UT19UT1A6CisgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKAorICAgICAgICAgICAgICAgICAgICAgICAgIldhcm5pbmc6IEFjdGl2aXR5IG5vdCBzdGFydGVkLCBpbnRlbnQgaGFzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgImJlZW4gZGVsaXZlcmVkIHRvIGN1cnJlbnRseSBydW5uaW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgInRvcC1tb3N0IGluc3RhbmNlLiIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX1JFVFVSTl9JTlRFTlRfVE9fQ0FMTEVSOgorICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJXYXJuaW5nOiBBY3Rpdml0eSBub3Qgc3RhcnRlZCBiZWNhdXNlIGludGVudCAiCisgICAgICAgICAgICAgICAgICAgICAgICArICJzaG91bGQgYmUgaGFuZGxlZCBieSB0aGUgY2FsbGVyIik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIElBY3Rpdml0eU1hbmFnZXIuU1RBUlRfVEFTS19UT19GUk9OVDoKKyAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oCisgICAgICAgICAgICAgICAgICAgICAgICAiV2FybmluZzogQWN0aXZpdHkgbm90IHN0YXJ0ZWQsIGl0cyBjdXJyZW50ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgInRhc2sgaGFzIGJlZW4gYnJvdWdodCB0byB0aGUgZnJvbnQiKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgSUFjdGl2aXR5TWFuYWdlci5TVEFSVF9JTlRFTlRfTk9UX1JFU09MVkVEOgogICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigKICAgICAgICAgICAgICAgICAgICAgICAgICJFcnJvcjogQWN0aXZpdHkgbm90IHN0YXJ0ZWQsIHVuYWJsZSB0byAiCi0gICAgICAgICAgICAgICAgICAgICAgICArICJjYWxsIG9uIHRvIGFjdGl2aXR5IG1hbmFnZXIgc2VydmljZSIpOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgKyAicmVzb2x2ZSAiICsgaW50ZW50LnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBJQWN0aXZpdHlNYW5hZ2VyLlNUQVJUX0NMQVNTX05PVF9GT1VORDoKKyAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oTk9fQ0xBU1NfRVJST1JfQ09ERSk7CisgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogQWN0aXZpdHkgY2xhc3MgIiArCisgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnQuZ2V0Q29tcG9uZW50KCkudG9TaG9ydFN0cmluZygpCisgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgZXhpc3QuIik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIElBY3Rpdml0eU1hbmFnZXIuU1RBUlRfRk9SV0FSRF9BTkRfUkVRVUVTVF9DT05GTElDVDoKKyAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oCisgICAgICAgICAgICAgICAgICAgICAgICAiRXJyb3I6IEFjdGl2aXR5IG5vdCBzdGFydGVkLCB5b3UgcmVxdWVzdGVkIHRvICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgImJvdGggZm9yd2FyZCBhbmQgcmVjZWl2ZSBpdHMgcmVzdWx0Iik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIElBY3Rpdml0eU1hbmFnZXIuU1RBUlRfUEVSTUlTU0lPTl9ERU5JRUQ6CisgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKAorICAgICAgICAgICAgICAgICAgICAgICAgIkVycm9yOiBBY3Rpdml0eSBub3Qgc3RhcnRlZCwgeW91IGRvIG5vdCAiCisgICAgICAgICAgICAgICAgICAgICAgICArICJoYXZlIHBlcm1pc3Npb24gdG8gYWNjZXNzIGl0LiIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oCisgICAgICAgICAgICAgICAgICAgICAgICAiRXJyb3I6IEFjdGl2aXR5IG5vdCBzdGFydGVkLCB1bmtub3duIGVycm9yIGNvZGUgIiArIHJlcyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgc2VuZEJyb2FkY2FzdCgpIHsKKyAgICBwcml2YXRlIHZvaWQgc2VuZEJyb2FkY2FzdCgpIHRocm93cyBFeGNlcHRpb24gewogICAgICAgICBJbnRlbnQgaW50ZW50ID0gbWFrZUludGVudCgpOwotICAgICAgICAKLSAgICAgICAgaWYgKGludGVudCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkJyb2FkY2FzdGluZzogIiArIGludGVudCk7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1BbS5icm9hZGNhc3RJbnRlbnQobnVsbCwgaW50ZW50LCBudWxsLCBudWxsLCAwLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgdHJ1ZSwgZmFsc2UpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQorICAgICAgICBJbnRlbnRSZWNlaXZlciByZWNlaXZlciA9IG5ldyBJbnRlbnRSZWNlaXZlcigpOworICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkJyb2FkY2FzdGluZzogIiArIGludGVudCk7CisgICAgICAgIG1BbS5icm9hZGNhc3RJbnRlbnQobnVsbCwgaW50ZW50LCBudWxsLCByZWNlaXZlciwgMCwgbnVsbCwgbnVsbCwgbnVsbCwgdHJ1ZSwgZmFsc2UpOworICAgICAgICByZWNlaXZlci53YWl0Rm9yRmluaXNoKCk7CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIHJ1bkluc3RydW1lbnQoKSB7CisgICAgcHJpdmF0ZSB2b2lkIHJ1bkluc3RydW1lbnQoKSB0aHJvd3MgRXhjZXB0aW9uIHsKICAgICAgICAgU3RyaW5nIHByb2ZpbGVGaWxlID0gbnVsbDsKICAgICAgICAgYm9vbGVhbiB3YWl0ID0gZmFsc2U7CiAgICAgICAgIGJvb2xlYW4gcmF3TW9kZSA9IGZhbHNlOwpAQCAtMjgzLDQ2ICsyNTUsMzAgQEAKICAgICAgICAgU3RyaW5nIGFyZ0tleSA9IG51bGwsIGFyZ1ZhbHVlID0gbnVsbDsKICAgICAgICAgSVdpbmRvd01hbmFnZXIgd20gPSBJV2luZG93TWFuYWdlci5TdHViLmFzSW50ZXJmYWNlKFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoIndpbmRvdyIpKTsKIAotICAgICAgICB0cnkgewotICAgICAgICAgICAgU3RyaW5nIG9wdDsKLSAgICAgICAgICAgIHdoaWxlICgob3B0PW5leHRPcHRpb24oKSkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChvcHQuZXF1YWxzKCItcCIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHByb2ZpbGVGaWxlID0gbmV4dE9wdGlvbkRhdGEoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi13IikpIHsKLSAgICAgICAgICAgICAgICAgICAgd2FpdCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItciIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJhd01vZGUgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLWUiKSkgewotICAgICAgICAgICAgICAgICAgICBhcmdLZXkgPSBuZXh0T3B0aW9uRGF0YSgpOwotICAgICAgICAgICAgICAgICAgICBhcmdWYWx1ZSA9IG5leHRPcHRpb25EYXRhKCk7Ci0gICAgICAgICAgICAgICAgICAgIGFyZ3MucHV0U3RyaW5nKGFyZ0tleSwgYXJnVmFsdWUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLS1ub193aW5kb3dfYW5pbWF0aW9uIikpIHsKLSAgICAgICAgICAgICAgICAgICAgbm9fd2luZG93X2FuaW1hdGlvbiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogVW5rbm93biBvcHRpb246ICIgKyBvcHQpOwotICAgICAgICAgICAgICAgICAgICBzaG93VXNhZ2UoKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIG9wdDsKKyAgICAgICAgd2hpbGUgKChvcHQ9bmV4dE9wdGlvbigpKSAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAob3B0LmVxdWFscygiLXAiKSkgeworICAgICAgICAgICAgICAgIHByb2ZpbGVGaWxlID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5lcXVhbHMoIi13IikpIHsKKyAgICAgICAgICAgICAgICB3YWl0ID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLXIiKSkgeworICAgICAgICAgICAgICAgIHJhd01vZGUgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChvcHQuZXF1YWxzKCItZSIpKSB7CisgICAgICAgICAgICAgICAgYXJnS2V5ID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgICAgICAgICAgYXJnVmFsdWUgPSBuZXh0QXJnUmVxdWlyZWQoKTsKKyAgICAgICAgICAgICAgICBhcmdzLnB1dFN0cmluZyhhcmdLZXksIGFyZ1ZhbHVlKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmVxdWFscygiLS1ub193aW5kb3dfYW5pbWF0aW9uIikpIHsKKyAgICAgICAgICAgICAgICBub193aW5kb3dfYW5pbWF0aW9uID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogVW5rbm93biBvcHRpb246ICIgKyBvcHQpOworICAgICAgICAgICAgICAgIHNob3dVc2FnZSgpOworICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KLSAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogIiArIGV4LnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgc2hvd1VzYWdlKCk7Ci0gICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIAotICAgICAgICBTdHJpbmcgY25BcmcgPSBuZXh0QXJnKCk7Ci0gICAgICAgIGlmIChjbkFyZyA9PSBudWxsKSB7Ci0gICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIkVycm9yOiBObyBpbnN0cnVtZW50YXRpb24gY29tcG9uZW50IHN1cHBsaWVkIik7Ci0gICAgICAgICAgICBzaG93VXNhZ2UoKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICAKKyAgICAgICAgU3RyaW5nIGNuQXJnID0gbmV4dEFyZ1JlcXVpcmVkKCk7CiAgICAgICAgIENvbXBvbmVudE5hbWUgY24gPSBDb21wb25lbnROYW1lLnVuZmxhdHRlbkZyb21TdHJpbmcoY25BcmcpOwotICAgICAgICBpZiAoY24gPT0gbnVsbCkgewotICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogQmFkIGNvbXBvbmVudCBuYW1lOiAiICsgY25BcmcpOwotICAgICAgICAgICAgc2hvd1VzYWdlKCk7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KKyAgICAgICAgaWYgKGNuID09IG51bGwpIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkJhZCBjb21wb25lbnQgbmFtZTogIiArIGNuQXJnKTsKIAogICAgICAgICBJbnN0cnVtZW50YXRpb25XYXRjaGVyIHdhdGNoZXIgPSBudWxsOwogICAgICAgICBpZiAod2FpdCkgewpAQCAtMzMxLDIyICsyODcsMTMgQEAKICAgICAgICAgfQogICAgICAgICBmbG9hdFtdIG9sZEFuaW1zID0gbnVsbDsKICAgICAgICAgaWYgKG5vX3dpbmRvd19hbmltYXRpb24pIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgb2xkQW5pbXMgPSB3bS5nZXRBbmltYXRpb25TY2FsZXMoKTsKLSAgICAgICAgICAgICAgICB3bS5zZXRBbmltYXRpb25TY2FsZSgwLCAwLjBmKTsKLSAgICAgICAgICAgICAgICB3bS5zZXRBbmltYXRpb25TY2FsZSgxLCAwLjBmKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBvbGRBbmltcyA9IHdtLmdldEFuaW1hdGlvblNjYWxlcygpOworICAgICAgICAgICAgd20uc2V0QW5pbWF0aW9uU2NhbGUoMCwgMC4wZik7CisgICAgICAgICAgICB3bS5zZXRBbmltYXRpb25TY2FsZSgxLCAwLjBmKTsKICAgICAgICAgfQogCi0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBpZiAoIW1BbS5zdGFydEluc3RydW1lbnRhdGlvbihjbiwgcHJvZmlsZUZpbGUsIDAsIGFyZ3MsIHdhdGNoZXIpKSB7Ci0gICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJJTlNUUlVNRU5UQVRJT05fRkFJTEVEOiAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNuLmZsYXR0ZW5Ub1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICBzaG93VXNhZ2UoKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgIGlmICghbUFtLnN0YXJ0SW5zdHJ1bWVudGF0aW9uKGNuLCBwcm9maWxlRmlsZSwgMCwgYXJncywgd2F0Y2hlcikpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBBbmRyb2lkRXhjZXB0aW9uKCJJTlNUUlVNRU5UQVRJT05fRkFJTEVEOiAiICsgY24uZmxhdHRlblRvU3RyaW5nKCkpOwogICAgICAgICB9CiAKICAgICAgICAgaWYgKHdhdGNoZXIgIT0gbnVsbCkgewpAQCAtMzU2LDkgKzMwMyw1NyBAQAogICAgICAgICB9CiAKICAgICAgICAgaWYgKG9sZEFuaW1zICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdtLnNldEFuaW1hdGlvblNjYWxlcyhvbGRBbmltcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcnVuUHJvZmlsZSgpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBTdHJpbmcgcHJvZmlsZUZpbGUgPSBudWxsOworICAgICAgICBib29sZWFuIHN0YXJ0ID0gZmFsc2U7CisgICAgICAgIFN0cmluZyBwcm9jZXNzID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0gbnVsbDsKKworICAgICAgICBTdHJpbmcgY21kID0gbmV4dEFyZ1JlcXVpcmVkKCk7CisgICAgICAgIGlmICgic3RhcnQiLmVxdWFscyhjbWQpKSB7CisgICAgICAgICAgICBzdGFydCA9IHRydWU7CisgICAgICAgICAgICBwcm9maWxlRmlsZSA9IG5leHRBcmdSZXF1aXJlZCgpOwogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICB3bS5zZXRBbmltYXRpb25TY2FsZXMob2xkQW5pbXMpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBmZCA9IFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4oCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgRmlsZShwcm9maWxlRmlsZSksCisgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX0NSRUFURSB8CisgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX1RSVU5DQVRFIHwKKyAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfUkVBRF9XUklURSk7CisgICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiRXJyb3I6IFVuYWJsZSB0byBvcGVuIGZpbGU6ICIgKyBwcm9maWxlRmlsZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKCEic3RvcCIuZXF1YWxzKGNtZCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlByb2ZpbGUgY29tbWFuZCAiICsgY21kICsgIiBub3QgdmFsaWQiKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghbUFtLnByb2ZpbGVDb250cm9sKHByb2Nlc3MsIHN0YXJ0LCBwcm9maWxlRmlsZSwgZmQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgQW5kcm9pZEV4Y2VwdGlvbigiUFJPRklMRSBGQUlMRUQgb24gcHJvY2VzcyAiICsgcHJvY2Vzcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIEludGVudFJlY2VpdmVyIGV4dGVuZHMgSUludGVudFJlY2VpdmVyLlN0dWIgeworICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUZpbmlzaGVkID0gZmFsc2U7CisKKyAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHBlcmZvcm1SZWNlaXZlKAorICAgICAgICAgICAgICAgIEludGVudCBpbnRlbnQsIGludCByYywgU3RyaW5nIGRhdGEsIEJ1bmRsZSBleHQsIGJvb2xlYW4gb3JkKSB7CisgICAgICAgICAgICBTdHJpbmcgbGluZSA9ICJCcm9hZGNhc3QgY29tcGxldGVkOiByZXN1bHQ9IiArIHJjOworICAgICAgICAgICAgaWYgKGRhdGEgIT0gbnVsbCkgbGluZSA9IGxpbmUgKyAiLCBkYXRhPVwiIiArIGRhdGEgKyAiXCIiOworICAgICAgICAgICAgaWYgKGV4dCAhPSBudWxsKSBsaW5lID0gbGluZSArICIsIGV4dHJhczogIiArIGV4dDsKKyAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihsaW5lKTsKKyAgICAgICAgICAgIG1GaW5pc2hlZCA9IHRydWU7CisgICAgICAgICAgICBub3RpZnlBbGwoKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCB3YWl0Rm9yRmluaXNoKCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICB3aGlsZSAoIW1GaW5pc2hlZCkgd2FpdCgpOworICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0zNjYsNyArMzYxLDcgQEAKICAgICBwcml2YXRlIGNsYXNzIEluc3RydW1lbnRhdGlvbldhdGNoZXIgZXh0ZW5kcyBJSW5zdHJ1bWVudGF0aW9uV2F0Y2hlci5TdHViIHsKICAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1GaW5pc2hlZCA9IGZhbHNlOwogICAgICAgICBwcml2YXRlIGJvb2xlYW4gbVJhd01vZGUgPSBmYWxzZTsKLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFNldCBvciByZXNldCAicmF3IG1vZGUiLiAgSW4gInJhdyBtb2RlIiwgYWxsIGJ1bmRsZXMgYXJlIGR1bXBlZC4gIEluICJwcmV0dHkgbW9kZSIsIAogICAgICAgICAgKiBpZiBhIGJ1bmRsZSBpbmNsdWRlcyBJbnN0cnVtZW50YXRpb24uUkVQT1JUX0tFWV9TVFJFQU1SRVNVTFQsIGp1c3QgcHJpbnQgdGhhdC4KQEAgLTM3NSw3ICszNzAsNyBAQAogICAgICAgICBwdWJsaWMgdm9pZCBzZXRSYXdPdXRwdXQoYm9vbGVhbiByYXdNb2RlKSB7CiAgICAgICAgICAgICBtUmF3TW9kZSA9IHJhd01vZGU7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIHZvaWQgaW5zdHJ1bWVudGF0aW9uU3RhdHVzKENvbXBvbmVudE5hbWUgbmFtZSwgaW50IHJlc3VsdENvZGUsIEJ1bmRsZSByZXN1bHRzKSB7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgICAgICAvLyBwcmV0dHkgcHJpbnRlciBtb2RlPwpAQCAtNDMxLDYgKzQyNiw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB3YWl0KDEwMDApOwogICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKGUpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQpAQCAtNDM4LDYyICs0MzQsMTEgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBydW5Qcm9maWxlKCkgewotICAgICAgICBTdHJpbmcgcHJvZmlsZUZpbGUgPSBudWxsOwotICAgICAgICBib29sZWFuIHN0YXJ0ID0gZmFsc2U7Ci0KLSAgICAgICAgU3RyaW5nIHByb2Nlc3MgPSBuZXh0QXJnKCk7Ci0gICAgICAgIGlmIChwcm9jZXNzID09IG51bGwpIHsKLSAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiRXJyb3I6IE5vIHByb2ZpbGUgcHJvY2VzcyBzdXBwbGllZCIpOwotICAgICAgICAgICAgc2hvd1VzYWdlKCk7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0gbnVsbDsKLSAgICAgICAgCi0gICAgICAgIFN0cmluZyBjbWQgPSBuZXh0QXJnKCk7Ci0gICAgICAgIGlmICgic3RhcnQiLmVxdWFscyhjbWQpKSB7Ci0gICAgICAgICAgICBzdGFydCA9IHRydWU7Ci0gICAgICAgICAgICBwcm9maWxlRmlsZSA9IG5leHRBcmcoKTsKLSAgICAgICAgICAgIGlmIChwcm9maWxlRmlsZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogTm8gcHJvZmlsZSBmaWxlIHBhdGggc3VwcGxpZWQiKTsKLSAgICAgICAgICAgICAgICBzaG93VXNhZ2UoKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGZkID0gUGFyY2VsRmlsZURlc2NyaXB0b3Iub3BlbigKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBGaWxlKHByb2ZpbGVGaWxlKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfQ1JFQVRFIHwKLSAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfVFJVTkNBVEUgfAotICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9SRUFEX1dSSVRFKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogVW5hYmxlIHRvIG9wZW4gZmlsZTogIiArIHByb2ZpbGVGaWxlKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAoISJzdG9wIi5lcXVhbHMoY21kKSkgewotICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJFcnJvcjogUHJvZmlsZSBjb21tYW5kICIgKyBjbWQgKyAiIG5vdCB2YWxpZCIpOwotICAgICAgICAgICAgc2hvd1VzYWdlKCk7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBpZiAoIW1BbS5wcm9maWxlQ29udHJvbChwcm9jZXNzLCBzdGFydCwgcHJvZmlsZUZpbGUsIGZkKSkgewotICAgICAgICAgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiUFJPRklMRSBGQUlMRUQgb24gcHJvY2VzcyAiICsgcHJvY2Vzcyk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJQUk9GSUxFIEZBSUxFRDogIiArIGUuZ2V0TWVzc2FnZSgp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gPj0gbUFyZ3MubGVuZ3RoKSB7CisgICAgICAgICAgICBTdHJpbmcgYXJnID0gbUN1ckFyZ0RhdGE7CisgICAgICAgICAgICBtQ3VyQXJnRGF0YSA9IG51bGw7CisgICAgICAgICAgICByZXR1cm4gYXJnOworICAgICAgICB9IGVsc2UgaWYgKG1OZXh0QXJnIDwgbUFyZ3MubGVuZ3RoKSB7CisgICAgICAgICAgICByZXR1cm4gbUFyZ3NbbU5leHRBcmcrK107CisgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICBTdHJpbmcgZGF0YSA9IG1BcmdzW21OZXh0QXJnXTsKLSAgICAgICAgbU5leHRBcmcrKzsKLSAgICAgICAgcmV0dXJuIGRhdGE7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBTdHJpbmcgbmV4dEFyZygpIHsKLSAgICAgICAgaWYgKG1OZXh0QXJnID49IG1BcmdzLmxlbmd0aCkgewotICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgcHJpdmF0ZSBTdHJpbmcgbmV4dEFyZ1JlcXVpcmVkKCkgeworICAgICAgICBTdHJpbmcgYXJnID0gbmV4dEFyZygpOworICAgICAgICBpZiAoYXJnID09IG51bGwpIHsKKyAgICAgICAgICAgIFN0cmluZyBwcmV2ID0gbUFyZ3NbbU5leHRBcmcgLSAxXTsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkFyZ3VtZW50IGV4cGVjdGVkIGFmdGVyIFwiIiArIHByZXYgKyAiXCIiKTsKICAgICAgICAgfQotICAgICAgICBTdHJpbmcgYXJnID0gbUFyZ3NbbU5leHRBcmddOwotICAgICAgICBtTmV4dEFyZysrOwogICAgICAgICByZXR1cm4gYXJnOwogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBzaG93VXNhZ2UoKSB7Ci0gICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigidXNhZ2U6IGFtIFtzdGFydHxicm9hZGNhc3R8aW5zdHJ1bWVudHxwcm9maWxlXSIpOwotICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIiAgICAgICBhbSBzdGFydCBbLURdIElOVEVOVCIpOwotICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIiAgICAgICBhbSBicm9hZGNhc3QgSU5URU5UIik7Ci0gICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiICAgICAgIGFtIGluc3RydW1lbnQgWy1yXSBbLWUgPEFSR19OQU1FPiA8QVJHX1ZBTFVFPl0gWy1wIDxQUk9GX0ZJTEU+XSIpOwotICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIiAgICAgICAgICAgICAgICBbLXddIDxDT01QT05FTlQ+ICIpOwotICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIiAgICAgICBhbSBwcm9maWxlIDxQUk9DRVNTPiBbc3RhcnQgPFBST0ZfRklMRT58c3RvcF0iKTsKLSAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCIiKTsKLSAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCIgICAgICAgSU5URU5UIGlzIGRlc2NyaWJlZCB3aXRoOiIpOwotICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIiAgICAgICAgICAgICAgICBbLWEgPEFDVElPTj5dIFstZCA8REFUQV9VUkk+XSBbLXQgPE1JTUVfVFlQRT5dIik7Ci0gICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiICAgICAgICAgICAgICAgIFstYyA8Q0FURUdPUlk+IFstYyA8Q0FURUdPUlk+XSAuLi5dIik7Ci0gICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigiICAgICAgICAgICAgICAgIFstZXwtLWVzIDxFWFRSQV9LRVk+IDxFWFRSQV9TVFJJTkdfVkFMVUU+IC4uLl0iKTsKLSAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCIgICAgICAgICAgICAgICAgWy0tZXogPEVYVFJBX0tFWT4gPEVYVFJBX0JPT0xFQU5fVkFMVUU+IC4uLl0iKTsKLSAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCIgICAgICAgICAgICAgICAgWy1lfC0tZWkgPEVYVFJBX0tFWT4gPEVYVFJBX0lOVF9WQUxVRT4gLi4uXSIpOwotICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIiAgICAgICAgICAgICAgICBbLW4gPENPTVBPTkVOVD5dIFstZiA8RkxBR1M+XSBbPFVSST5dIik7CisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBzaG93VXNhZ2UoKSB7CisgICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbigKKyAgICAgICAgICAgICAgICAidXNhZ2U6IGFtIFtzdWJjb21tYW5kXSBbb3B0aW9uc11cbiIgKworICAgICAgICAgICAgICAgICJcbiIgKworICAgICAgICAgICAgICAgICIgICAgc3RhcnQgYW4gQWN0aXZpdHk6IGFtIHN0YXJ0IFstRF0gPElOVEVOVD5cbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIC1EOiBlbmFibGUgZGVidWdnaW5nXG4iICsKKyAgICAgICAgICAgICAgICAiXG4iICsKKyAgICAgICAgICAgICAgICAiICAgIHNlbmQgYSBicm9hZGNhc3QgSW50ZW50OiBhbSBicm9hZGNhc3QgPElOVEVOVD5cbiIgKworICAgICAgICAgICAgICAgICJcbiIgKworICAgICAgICAgICAgICAgICIgICAgc3RhcnQgYW4gSW5zdHJ1bWVudGF0aW9uOiBhbSBpbnN0cnVtZW50IFtmbGFnc10gPENPTVBPTkVOVD5cbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIC1yOiBwcmludCByYXcgcmVzdWx0cyAob3RoZXJ3aXNlIGRlY29kZSBSRVBPUlRfS0VZX1NUUkVBTVJFU1VMVClcbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIC1lIDxOQU1FPiA8VkFMVUU+OiBzZXQgYXJndW1lbnQgPE5BTUU+IHRvIDxWQUxVRT5cbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIC1wIDxGSUxFPjogd3JpdGUgcHJvZmlsaW5nIGRhdGEgdG8gPEZJTEU+XG4iICsKKyAgICAgICAgICAgICAgICAiICAgICAgICAtdzogd2FpdCBmb3IgaW5zdHJ1bWVudGF0aW9uIHRvIGZpbmlzaCBiZWZvcmUgcmV0dXJuaW5nXG4iICsKKyAgICAgICAgICAgICAgICAiXG4iICsKKyAgICAgICAgICAgICAgICAiICAgIHN0YXJ0IHByb2ZpbGluZzogYW0gcHJvZmlsZSA8UFJPQ0VTUz4gc3RhcnQgPEZJTEU+XG4iICsKKyAgICAgICAgICAgICAgICAiICAgIHN0b3AgcHJvZmlsaW5nOiBhbSBwcm9maWxlIDxQUk9DRVNTPiBzdG9wXG4iICsKKyAgICAgICAgICAgICAgICAiXG4iICsKKyAgICAgICAgICAgICAgICAiICAgIDxJTlRFTlQ+IHNwZWNpZmljYXRpb25zIGluY2x1ZGUgdGhlc2UgZmxhZ3M6XG4iICsKKyAgICAgICAgICAgICAgICAiICAgICAgICBbLWEgPEFDVElPTj5dIFstZCA8REFUQV9VUkk+XSBbLXQgPE1JTUVfVFlQRT5dXG4iICsKKyAgICAgICAgICAgICAgICAiICAgICAgICBbLWMgPENBVEVHT1JZPiBbLWMgPENBVEVHT1JZPl0gLi4uXVxuIiArCisgICAgICAgICAgICAgICAgIiAgICAgICAgWy1lfC0tZXMgPEVYVFJBX0tFWT4gPEVYVFJBX1NUUklOR19WQUxVRT4gLi4uXVxuIiArCisgICAgICAgICAgICAgICAgIiAgICAgICAgWy0tZXogPEVYVFJBX0tFWT4gPEVYVFJBX0JPT0xFQU5fVkFMVUU+IC4uLl1cbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIFstZXwtLWVpIDxFWFRSQV9LRVk+IDxFWFRSQV9JTlRfVkFMVUU+IC4uLl1cbiIgKworICAgICAgICAgICAgICAgICIgICAgICAgIFstbiA8Q09NUE9ORU5UPl0gWy1mIDxGTEFHUz5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ByaW50UmVzdG9yZVNldHMoUmVzdG9yZVNldFtdIHNldHMpIHsKICAgICAgICAgZm9yIChSZXN0b3JlU2V0IHMgOiBzZXRzKSB7Ci0gICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIiAgIiArIHMudG9rZW4gKyAiIDogIiArIHMubmFtZSk7CisgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIiAgIiArIExvbmcudG9IZXhTdHJpbmcocy50b2tlbikgKyAiIDogIiArIHMubmFtZSk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTI5NCw3ICsyOTQsNyBAQAogICAgIHByaXZhdGUgdm9pZCBkb1Jlc3RvcmUoKSB7CiAgICAgICAgIGxvbmcgdG9rZW47CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICB0b2tlbiA9IExvbmcucGFyc2VMb25nKG5leHRBcmcoKSk7CisgICAgICAgICAgICB0b2tlbiA9IExvbmcucGFyc2VMb25nKG5leHRBcmcoKSwgMTYpOwogICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgc2hvd1VzYWdlKCk7CiAgICAgICAgICAgICByZXR1cm47CkBAIC0zMTEsMTIgKzMxMSwxMyBAQAogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIFJlc3RvcmVTZXRbXSBzZXRzID0gbVJlc3RvcmUuZ2V0QXZhaWxhYmxlUmVzdG9yZVNldHMoKTsKLSAgICAgICAgICAgIGZvciAoUmVzdG9yZVNldCBzIDogc2V0cykgewotICAgICAgICAgICAgICAgIGlmIChzLnRva2VuID09IHRva2VuKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiU2NoZWR1bGluZyByZXN0b3JlOiAiICsgcy5uYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgbVJlc3RvcmUucGVyZm9ybVJlc3RvcmUodG9rZW4sIG9ic2VydmVyKTsKLSAgICAgICAgICAgICAgICAgICAgZGlkUmVzdG9yZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgaWYgKHNldHMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoUmVzdG9yZVNldCBzIDogc2V0cykgeworICAgICAgICAgICAgICAgICAgICBpZiAocy50b2tlbiA9PSB0b2tlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJTY2hlZHVsaW5nIHJlc3RvcmU6ICIgKyBzLm5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgZGlkUmVzdG9yZSA9IChtUmVzdG9yZS5wZXJmb3JtUmVzdG9yZSh0b2tlbiwgb2JzZXJ2ZXIpID09IDApOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoIWRpZFJlc3RvcmUpIHsKQEAgLTMyNywyMSArMzI4LDI3IEBACiAgICAgICAgICAgICAgICAgICAgIHByaW50UmVzdG9yZVNldHMoc2V0cyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBpZiB3ZSBraWNrZWQgb2ZmIGEgcmVzdG9yZSBzdWNjZXNzZnVsbHksIHdlIGhhdmUgdG8gd2FpdCBmb3IgaXQKKyAgICAgICAgICAgIC8vIHRvIGNvbXBsZXRlIGJlZm9yZSB3ZSBjYW4gc2h1dCBkb3duIHRoZSByZXN0b3JlIHNlc3Npb24gc2FmZWx5CisgICAgICAgICAgICBpZiAoZGlkUmVzdG9yZSkgeworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAob2JzZXJ2ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCFvYnNlcnZlci5kb25lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ic2VydmVyLndhaXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIG9uY2UgdGhlIHJlc3RvcmUgaGFzIGZpbmlzaGVkLCBjbG9zZSBkb3duIHRoZSBzZXNzaW9uIGFuZCB3ZSdyZSBkb25lCiAgICAgICAgICAgICBtUmVzdG9yZS5lbmRSZXN0b3JlU2Vzc2lvbigpOwogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKGUudG9TdHJpbmcoKSk7CiAgICAgICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oQk1HUl9OT1RfUlVOTklOR19FUlIpOwogICAgICAgICB9CiAKLSAgICAgICAgLy8gbm93IHdhaXQgZm9yIGl0IHRvIGJlIGRvbmUKLSAgICAgICAgc3luY2hyb25pemVkIChvYnNlcnZlcikgewotICAgICAgICAgICAgd2hpbGUgKCFvYnNlcnZlci5kb25lKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIud2FpdCgpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9CiAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiZG9uZSIpOwogICAgIH0KIApkaWZmIC0tZ2l0IGEvY21kcy9ib290YW5pbWF0aW9uL0FuZHJvaWQubWsgYi9jbWRzL2Jvb3RhbmltYXRpb24vQW5kcm9pZC5tawpp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Lmg+CisjaW5jbHVkZSA8Y3V0aWxzL3NvY2tldHMuaD4KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkgeworICAgIGNoYXIgYnVmZmVyWzY1NTM2XTsKKyAgICBpbnQgaSwgczsKKworICAgIC8qIHN0YXJ0IHRoZSBkdW1wc3RhdGUgc2VydmljZSAqLworICAgIHByb3BlcnR5X3NldCgiY3RsLnN0YXJ0IiwgImR1bXBzdGF0ZSIpOworCisgICAgLyogc29ja2V0IHdpbGwgbm90IGJlIGF2YWlsYWJsZSB1bnRpbCBzZXJ2aWNlIHN0YXJ0cyAqLworICAgIGZvciAoaSA9IDA7IGkgPCAxMDsgaSsrKSB7CisgICAgICAgIHMgPSBzb2NrZXRfbG9jYWxfY2xpZW50KCJkdW1wc3RhdGUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTkRST0lEX1NPQ0tFVF9OQU1FU1BBQ0VfUkVTRVJWRUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPQ0tfU1RSRUFNKTsKKyAgICAgICAgaWYgKHMgPj0gMCkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAvKiB0cnkgYWdhaW4gaW4gMSBzZWNvbmQgKi8KKyAgICAgICAgc2xlZXAoMSk7CisgICAgfQorCisgICAgaWYgKHMgPCAwKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiRmFpbGVkIHRvIGNvbm5lY3QgdG8gZHVtcHN0YXRlIHNlcnZpY2VcbiIpOworICAgICAgICBleGl0KDEpOworICAgIH0KKworICAgIHdoaWxlICgxKSB7CisgICAgICAgIGludCBsZW5ndGggPSByZWFkKHMsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpOworICAgICAgICBpZiAobGVuZ3RoIDw9IDApCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZndyaXRlKGJ1ZmZlciwgMSwgbGVuZ3RoLCBzdGRvdXQpOworICAgIH0KKworICAgIGNsb3N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ICAgICAiUEFOSUMgVEhSRUFEUyIpOwogICAgIH0KICAgICBQUklOVCgiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iKTsKICAgICBQUklOVCgiPT0gYnVpbGQucHJvcCIpOwpAQCAtMTU3LDExICsxNjUsMTEgQEAKIAogaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkgewogICAgIGludCBkdW1wY3Jhc2ggPSBjaGVja19jb21tYW5kX25hbWUoYXJndlswXSwgImR1bXBjcmFzaCIpOwotICAgIGludCBidWdyZXBvcnQgPSBjaGVja19jb21tYW5kX25hbWUoYXJndlswXSwgImJ1Z3JlcG9ydCIpOwogICAgIGludCBhZGRfZGF0ZSA9IDA7CiAgICAgY2hhciogb3V0ZmlsZSA9IDA7CiAgICAgaW50IHZpYnJhdGUgPSAwOwogICAgIGludCBjb21wcmVzcyA9IDA7CisgICAgaW50IHNvY2tldCA9IDA7CiAgICAgaW50IGMsIGZkLCB2aWJyYXRlX2ZkLCBmZHNbMl07CiAgICAgY2hhciBwYXRoW1BBVEhfTUFYXTsKICAgICBwaWRfdCAgIHBpZDsKQEAgLTE3MywzMSArMTgxLDMyIEBACiAKICAgICBnZXRfdGltZSgmbm93KTsKIAotICAgIGlmIChidWdyZXBvcnQpIHsKLSAgICAgICAgZG8gewotICAgICAgICAgICAgYyA9IGdldG9wdChhcmdjLCBhcmd2LCAiZG86dnoiKTsKLSAgICAgICAgICAgIGlmIChjID09IEVPRikKKyAgICBkbyB7CisgICAgICAgIGMgPSBnZXRvcHQoYXJnYywgYXJndiwgImRvOnN2eiIpOworICAgICAgICBpZiAoYyA9PSBFT0YpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgc3dpdGNoIChjKSB7CisgICAgICAgICAgICBjYXNlICdkJzoKKyAgICAgICAgICAgICAgICBhZGRfZGF0ZSA9IDE7CiAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBzd2l0Y2ggKGMpIHsKLSAgICAgICAgICAgICAgICBjYXNlICdkJzoKLSAgICAgICAgICAgICAgICAgICAgYWRkX2RhdGUgPSAxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlICdvJzoKLSAgICAgICAgICAgICAgICAgICAgb3V0ZmlsZSA9IG9wdGFyZzsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAndic6Ci0gICAgICAgICAgICAgICAgICAgIHZpYnJhdGUgPSAxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlICd6JzoKLSAgICAgICAgICAgICAgICAgICAgY29tcHJlc3MgPSAxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlICc/JzoKLSAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIiVzOiBpbnZhbGlkIG9wdGlvbiAtJWNcbiIsCi0gICAgICAgICAgICAgICAgICAgIGFyZ3ZbMF0sIG9wdG9wdCk7Ci0gICAgICAgICAgICAgICAgICAgIGV4aXQoMSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gd2hpbGUgKDEpOwotICAgIH0KKyAgICAgICAgICAgIGNhc2UgJ28nOgorICAgICAgICAgICAgICAgIG91dGZpbGUgPSBvcHRhcmc7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlICd2JzoKKyAgICAgICAgICAgICAgICB2aWJyYXRlID0gMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgJ3onOgorICAgICAgICAgICAgICAgIGNvbXByZXNzID0gMTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgJ3MnOgorICAgICAgICAgICAgICAgIHNvY2tldCA9IDE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlICc/JzoKKyAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiJXM6IGludmFsaWQgb3B0aW9uIC0lY1xuIiwKKyAgICAgICAgICAgICAgICBhcmd2WzBdLCBvcHRvcHQpOworICAgICAgICAgICAgICAgIGV4aXQoMSk7CisgICAgICAgIH0KKyAgICB9IHdoaWxlICgxKTsKIAogICAgIC8qIG9wZW4gdmlicmF0b3IgYmVmb3JlIHN3aXRjaGluZyB1c2VyICovCiAgICAgaWYgKHZpYnJhdGUpIHsKQEAgLTIwNywxNCArMjE2LDQwIEBACiAgICAgfSBlbHNlCiAgICAgICAgIHZpYnJhdGVfZmQgPSAtMTsKIAorI2lmIDAKICAgICAvKiBzd2l0Y2ggdG8gbm9uLXJvb3QgdXNlciBhbmQgZ3JvdXAgKi8KICAgICBzZXRncm91cHMoc2l6ZW9mKGdyb3Vwcykvc2l6ZW9mKGdyb3Vwc1swXSksIGdyb3Vwcyk7CiAgICAgc2V0dWlkKEFJRF9TSEVMTCk7CisjZW5kaWYKIAogICAgIC8qIG1ha2UgaXQgc2FmZSB0byB1c2UgYm90aCBwcmludGYgYW5kIFNURE9VVF9GSUxFTk8gKi8gCiAgICAgc2V0dmJ1ZihzdGRvdXQsIDAsIF9JT05CRiwgMCk7CiAKLSAgICBpZiAob3V0ZmlsZSkgeworICAgIGlmIChzb2NrZXQpIHsKKyAgICAgICAgc3RydWN0IHNvY2thZGRyIGFkZHI7CisgICAgICAgIHNvY2tsZW5fdCBhbGVuOworCisgICAgICAgIGludCBzID0gYW5kcm9pZF9nZXRfY29udHJvbF9zb2NrZXQoImR1bXBzdGF0ZSIpOworICAgICAgICBpZiAocyA8IDApIHsKKyAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiY291bGQgbm90IG9wZW4gZHVtcHN0YXRlIHNvY2tldFxuIik7CisgICAgICAgICAgICBleGl0KDEpOworICAgICAgICB9CisgICAgICAgIGlmIChsaXN0ZW4ocywgNCkgPCAwKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBsaXN0ZW4gb24gZHVtcHN0YXRlIHNvY2tldFxuIik7CisgICAgICAgICAgICBleGl0KDEpOworICAgICAgICB9CisKKyAgICAgICAgYWxlbiA9IHNpemVvZihhZGRyKTsKKyAgICAgICAgZmQgPSBhY2NlcHQocywgJmFkZHIsICZhbGVuKTsKKyAgICAgICAgaWYgKGZkIDwgMCkgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgYWNjZXB0IGR1bXBzdGF0ZSBzb2NrZXRcbiIpOworICAgICAgICAgICAgZXhpdCgxKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIHJlZGlyZWN0IHN0ZG91dCB0byB0aGUgc29ja2V0ICovCisgICAgICAgIGR1cDIoZmQsIFNURE9VVF9GSUxFTk8pOworICAgICAgICBjbG9zZShmZCk7CisgICAgfSBlbHNlIGlmIChvdXRmaWxlKSB7CiAgICAgICAgIGlmIChzdHJsZW4ob3V0ZmlsZSkgPiBzaXplb2YocGF0aCkgLSAxMDApCiAgICAgICAgICAgICBleGl0KDEpOwogCkBAIC0yOTUsMyArMzMwLDIxIEBACiAgICAgcmV0dXJuIDA7CiB9CiAKK3N0YXRpYyB2b2lkIGR1bXBfa2VybmVsX2xvZyhjb25zdCBjaGFyICpwYXRoLCBjb25zdCBjaGFyICp0aXRsZSkgCisKK3sKKyAgICBwcmludGYoIi0tLS0tLSBLRVJORUwgJXMgTE9HIC0tLS0tLVxuIiwgdGl0bGUpOworICAgIGlmIChhY2Nlc3MocGF0aCwgUl9PSykgPCAwKQorICAgICAgICBwcmludGYoIiVzOiAlc1xuIiwgcGF0aCwgc3RyZXJyb3IoZXJybm8pKTsKKyAgICBlbHNlIHsKKyAgICAgICAgc3RydWN0IHN0YXQgc2J1ZjsKKworICAgICAgICBpZiAoc3RhdChwYXRoLCAmc2J1ZikgPCAwKQorICAgICAgICAgICAgcHJpbnRmKCIlczogc3RhdCBmYWl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ID0gY291bnQgPSAwOwotICAgICAgICAgICAgYyA9IHAgPSBrZXluYW1lOwotICAgICAgICAgICAgdCsrOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKCFpc2FsbnVtKCp0KSkgcmV0dXJuIC0xOwotICAgICAgICAgICAgKnArKyA9ICp0Kys7Ci0gICAgICAgICAgICAvLyBhbHNvIGNoZWNrIGlmIHRoZSBrZXluYW1lL25hbWVzcGFjZSBpcyB0b28gbG9uZy4KLSAgICAgICAgICAgIGlmIChjb3VudCsrID09IE1BWF9LRVlfTkFNRV9MRU5HVEgpIHJldHVybiAtMTsKKyAgICB2YV9zdGFydChhcmdzLCBudG9rZW5zKTsKKyAgICBxID0gdmFfYXJnKGFyZ3MsIGNoYXIqKik7CisgICAgKnEgPSBwOworICAgIHdoaWxlIChwIDwgKGRhdGEgKyBkYXRhX2xlbikpIHsKKyAgICAgICAgaWYgKCoocCsrKSA9PSAwKSB7CisgICAgICAgICAgICBpZiAoKytjb3VudCA9PSBudG9rZW5zKSBicmVhazsKKyAgICAgICAgICAgIGlmICgocSA9IHZhX2FyZyhhcmdzLCBjaGFyKiopKSA9PSBOVUxMKSBicmVhazsKKyAgICAgICAgICAgICpxID0gcDsKICAgICAgICAgfQogICAgIH0KLSAgICAqcCA9IDA7Ci0gICAgcmV0dXJuIDA7CisgICAgdmFfZW5kKGFyZ3MpOworICAgIC8vIHRoZSBmaXJzdCB0d28gc3RyaW5ncyBzaG91bGQgYmUgbnVsbC10ZXJtaW5hdGVkIGFuZCB0aGUgdGhpcmQgY291bGQKKyAgICAvLyBpZ25vcmUgdGhlIGRlbGltaXRlci4KKyAgICBpZiAoY291bnQgPj0gMikgeworICAgICAgICBpZiAoKG50b2tlbnMgPT0gMykgfHwgKChudG9rZW5zID09IDIpICYmIChwID09IChkYXRhICsgZGF0YV9sZW4pKSkpIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiAtMTsKK30KKworc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jE1IDB4Q0YKKyNkZWZpbmUgSlBFR19TT0kgICAweEQ4ICAgICAgICAgICAgLyogblN0YXJ0IE9mIEltYWdlIChiZWdpbm5pbmcgb2YgZGF0YXN0cmVhbSkqLworI2RlZmluZSBKUEVHX0VPSSAgIDB4RDkgICAgICAgICAgICAvKiBFbmQgT2YgSW1hZ2UgKGVuZCBvZiBkYXRhc3RyZWFtKSovCisjZGVmaW5lIEpQRUdfU09TICAgMHhEQSAgICAgICAgICAgIC8qIG5TdGFydCBPZiBTY2FuIChiZWdpbnMgY29tcHJlc3NlZCBkYXRhKSovCisjZGVmaW5lIEpQRUdfSkZJRiAgMHhFMCAgICAgICAgICAgIC8qIEpmaWYgbWFya2VyKi8KKyNkZWZpbmUgSlBFR19FWElGICAweEUxICAgICAgICAgICAgLyogRXhpZiBtYXJrZXIqLworI2RlZmluZSBKUEVHX0NPTSAgIDB4RkUgICAgICAgICAgICAvKiBDT01tZW50ICovCisjZGVmaW5lIEpQRUdfRFFUICAgMHhEQgorI2RlZmluZSBKUEVHX0RIVCAgIDB4QzQKKyNkZWZpbmUgSlBFR19EUkkgICAweERECisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworSlBFR1NvdXJjZTo6SlBFR1NvdXJjZShjb25zdCBzcDxEYXRhU291cmNlPiAmc291cmNlKQorICAgIDogbVNvdXJjZShzb3VyY2UpLAorICAgICAgbUdyb3VwKE5VTEwpLAorICAgICAgbVN0YXJ0ZWQoZmFsc2UpLAorICAgICAgbVNpemUoMCksCisgICAgICBtV2lkdGgoMCksCisgICAgICBtSGVpZ2h0KDApLAorICAgICAgbU9mZnNldCgwKSB7CisgICAgQ0hFQ0tfRVEocGFyc2VKUEVHKCksIE9LKTsKKyAgICBDSEVDSyhtU291cmNlLT5nZXRTaXplKCZtU2l6ZSkgPT0gT0spOworfQorCitKUEVHU291cmNlOjp+SlBFR1NvdXJjZSgpIHsKKyAgICBpZiAobVN0YXJ0ZWQpIHsKKyAgICAgICAgc3RvcCgpOworICAgIH0KK30KKworc3RhdHVzX3QgSlBFR1NvdXJjZTo6c3RhcnQoTWV0YURhdGEgKikgeworICAgIGlmIChtU3RhcnRlZCkgeworICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICB9CisKKyAgICBtR3JvdXAgPSBuZXcgTWVkaWFCdWZmZXJHcm91cDsKKyAgICBtR3JvdXAtPmFkZF9idWZmZXIobmV3IE1lZGlhQnVmZmVyKG1TaXplKSk7CisKKyAgICBtT2Zmc2V0ID0gMDsKKworICAgIG1TdGFydGVkID0gdHJ1ZTsKKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgSlBFR1NvdXJjZTo6c3RvcCgpIHsKKyAgICBpZiAoIW1TdGFydGVkKSB7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgIGRlbGV0ZSBtR3JvdXA7CisgICAgbUdyb3VwID0gTlVMTDsKKworICAgIG1TdGFydGVkID0gZmFsc2U7CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3NwPE1ldGFEYXRhPiBKUEVHU291cmNlOjpnZXRGb3JtYXQoKSB7CisgICAgc3A8TWV0YURhdGE+IG1ldGEgPSBuZXcgTWV0YURhdGE7CisgICAgbWV0YS0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsICJpbWFnZS9qcGVnIik7CisgICAgbWV0YS0+c2V0SW50MzIoa0tleVdpZHRoLCBtV2lkdGgpOworICAgIG1ldGEtPnNldEludDMyKGtLZXlIZWlnaHQsIG1IZWlnaHQpOworICAgIG1ldGEtPnNldEludDMyKGtLZXlNYXhJbnB1dFNpemUsIG1TaXplKTsKKworICAgIHJldHVybiBtZXRhOworfQorCitzdGF0dXNfdCBKUEVHU291cmNlOjpyZWFkKAorICAgICAgICBNZWRpYUJ1ZmZlciAqKm91dCwgY29uc3QgUmVhZE9wdGlvbnMgKm9wdGlvbnMpIHsKKyAgICAqb3V0ID0gTlVMTDsKKworICAgIGludDY0X3Qgc2Vla1RpbWVVczsKKyAgICBpZiAob3B0aW9ucyAhPSBOVUxMICYmIG9wdGlvbnMtPmdldFNlZWtUbygmc2Vla1RpbWVVcykpIHsKKyAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgfQorCisgICAgTWVkaWFCdWZmZXIgKmJ1ZmZlcjsKKyAgICBtR3JvdXAtPmFjcXVpcmVfYnVmZmVyKCZidWZmZXIpOworCisgICAgc3NpemVfdCBuID0gbVNvdXJjZS0+cmVhZF9hdChtT2Zmc2V0LCBidWZmZXItPmRhdGEoKSwgbVNpemUgLSBtT2Zmc2V0KTsKKworICAgIGlmIChuIDw9IDApIHsKKyAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7CisgICAgICAgIGJ1ZmZlciA9IE5VTEw7CisKKyAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgfQorCisgICAgYnVmZmVyLT5zZXRfcmFuZ2UoMCwgbik7CisKKyAgICBtT2Zmc2V0ICs9IG47CisKKyAgICAqb3V0ID0gYnVmZmVyOworCisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBKUEVHU291cmNlOjpwYXJzZUpQRUcoKSB7CisgICAgbVdpZHRoID0gMDsKKyAgICBtSGVpZ2h0ID0gMDsKKworICAgIG9mZl90IGkgPSAwOworCisgICAgdWludDE2X3Qgc29pOworICAgIGlmICghbVNvdXJjZS0+Z2V0VUludDE2KGksICZzb2kpKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICB9CisKKyAgICBpICs9IDI7CisKKyAgICBpZiAoc29pICE9IDB4ZmZkOCkgeworICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICB9CisKKyAgICBmb3IgKDs7KSB7CisgICAgICAgIHVpbnQ4X3QgbWFya2VyOworICAgICAgICBpZiAobVNvdXJjZS0+cmVhZF9hdChpKyssICZtYXJrZXIsIDEpICE9IDEpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgfQorCisgICAgICAgIENIRUNLX0VRKG1hcmtlciwgMHhmZik7CisKKyAgICAgICAgaWYgKG1Tb3VyY2UtPnJlYWRfYXQoaSsrLCAmbWFya2VyLCAxKSAhPSAxKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0KKworICAgICAgICBDSEVDSyhtYXJrZXIgIT0gMHhmZik7CisKKyAgICAgICAgdWludDE2X3QgY2h1bmtTaXplOworICAgICAgICBpZiAoIW1Tb3VyY2UtPmdldFVJbnQxNihpLCAmY2h1bmtTaXplKSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9CisKKyAgICAgICAgaSArPSAyOworCisgICAgICAgIGlmIChjaHVua1NpemUgPCAyKSB7CisgICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgfQorCisgICAgICAgIHN3aXRjaCAobWFya2VyKSB7CisgICAgICAgICAgICBjYXNlIEpQRUdfU09TOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiAobVdpZHRoID4gMCAmJiBtSGVpZ2h0ID4gMCkgPyBPSyA6IFVOS05PV05fRVJST1I7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgSlBFR19FT0k6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgSlBFR19TT0YwOgorICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjE6CisgICAgICAgICAgICBjYXNlIEpQRUdfU09GMzoKKyAgICAgICAgICAgIGNhc2UgSlBFR19TT0Y1OgorICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjY6CisgICAgICAgICAgICBjYXNlIEpQRUdfU09GNzoKKyAgICAgICAgICAgIGNhc2UgSlBFR19TT0Y5OgorICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjEwOgorICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjExOgorICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjEzOgorICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjE0OgorICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjE1OgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHVpbnQxNl90IHdpZHRoLCBoZWlnaHQ7CisgICAgICAgICAgICAgICAgaWYgKCFtU291cmNlLT5nZXRVSW50MTYoaSArIDEsICZoZWlnaHQpCisgICAgICAgICAgICAgICAgICAgIHx8ICFtU291cmNlLT5nZXRVSW50MTYoaSArIDMsICZ3aWR0aCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIG1XaWR0aCA9IHdpZHRoOworICAgICAgICAgICAgICAgIG1IZWlnaHQgPSBoZWlnaHQ7CisKKyAgICAgICAgICAgICAgICBpICs9IGNodW5rU2l6ZSAtIDI7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLy8gU2tpcCBjaHVuaworCisgICAgICAgICAgICAgICAgaSArPSBjaHVua1NpemUgLSAyOworCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gT0s7Cit9CisKK30gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCmRpZmYgLS1naXQgYS9jbWRzL3N0YWdlZnJpZ2h0L0pQRUdTb3VyY2UuaCBiL2NtZHMvc3RhZ2VmcmlnaHQvSlBFR1NvdXJjZS5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjA1MWMwMzQKLS0tIC9kZXYvbnVsbAorKysgYi9jbWRzL3N0YWdlZnJpZ2h0L0pQR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ORFJPSURfV0FWRVdSSVRFUl9IXworCisjZGVmaW5lIEFORFJPSURfV0FWRVdSSVRFUl9IXworCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIFdhdmVXcml0ZXIgeworcHVibGljOgorICAgIFdhdmVXcml0ZXIoY29uc3QgY2hhciAqZmlsZW5hbWUsCisgICAgICAgICAgICAgICB1aW50MTZfdCBudW1fY2hhbm5lbHMsIHVpbnQzMl90IHNhbXBsaW5nX3JhdGUpCisgICAgICAgIDogbUZpbGUoZm9wZW4oZmlsZW5hbWUsICJ3YiIpKSwKKyAgICAgICAgICBtVG90YWxCeXRlcygwKSB7CisgICAgICAgIGZ3cml0ZSgiUklGRnh4eHhXQVZFZm10IFx4MTBceDAwXHgwMFx4MDBceDAxXHgwMCIsIDEsIDIyLCBtRmlsZSk7IAorICAgICAgICB3cml0ZV91MTYobnVtX2NoYW5uZWxzKTsKKyAgICAgICAgd3JpdGVfdTMyKHNhbXBsaW5nX3JhdGUpOworICAgICAgICB3cml0ZV91MzIoc2FtcGxpbmdfcmF0ZSAqIG51bV9jaGFubmVscyAqIDIpOworICAgICAgICB3cml0ZV91MTYobnVtX2NoYW5uZWxzICogMik7CisgICAgICAgIHdyaXRlX3UxNigxNik7CisgICAgICAgIGZ3cml0ZSgiZGF0YXh4eHgiLCAxLCA4LCBtRmlsZSk7CisgICAgfQorCisgICAgfldhdmVXcml0ZXIoKSB7CisgICAgICAgIGZzZWVrKG1GaWxlLCA0MCwgU0VFS19TRVQpOworICAgICAgICB3cml0ZV91MzIobVRvdGFsQnl0ZXMpOworCisgICAgICAgIGZzZWVrKG1GaWxlLCA0LCBTRUVLX1NFVCk7CisgICAgICAgIHdyaXRlX3UzMigzNiArIG1Ub3RhbEJ5dGVzKTsKKworICAgICAgICBmY2xvc2UobUZpbGUpOworICAgICAgICBtRmlsZSA9IE5VTEw7CisgICAgfQorCisgICAgdm9pZCBBcHBlbmQoY29uc3Qgdm9pZCAqZGF0YSwgc2l6ZV90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gICAgcmV0dXJuIE9LOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3QgcmVhZCgKKyAgICAgICAgICAgIE1lZGlhQnVmZmVyICoqYnVmZmVyLCBjb25zdCBNZWRpYVNvdXJjZTo6UmVhZE9wdGlvbnMgKm9wdGlvbnMpIHsKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gbUdyb3VwLmFjcXVpcmVfYnVmZmVyKGJ1ZmZlcik7CisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKworICAgICAgICBjaGFyIHggPSAoY2hhcikoKGRvdWJsZSlyYW5kKCkgLyBSQU5EX01BWCAqIDI1NSk7CisgICAgICAgIG1lbXNldCgoKmJ1ZmZlciktPmRhdGEoKSwgeCwgbVNpemUpOworICAgICAgICAoKmJ1ZmZlciktPnNldF9yYW5nZSgwLCBtU2l6ZSk7CisKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKworcHJvdGVjdGVkOgorICAgIHZpcnR1YWwgfkR1bW15U291cmNlKCkge30KKworcHJpdmF0ZToKKyAgICBNZWRpYUJ1ZmZlckdyb3VwIG1Hcm91cDsKKyAgICBpbnQgbVdpZHRoLCBtSGVpZ2h0OworICAgIHNpemVfdCBtU2l6ZTsKKworICAgIER1bW15U291cmNlKGNvbnN0IER1bW15U291cmNlICYpOworICAgIER1bW15U291cmNlICZvcGVyYXRvcj0oY29uc3QgRHVtbXlTb3VyY2UgJik7Cit9OworCitzcDxNZWRpYVNvdXJjZT4gY3JlYXRlU291cmNlKGNvbnN0IGNoYXIgKmZpbGVuYW1lKSB7CisgICAgc3A8TWVkaWFTb3VyY2U+IHNvdXJjZTsKKworICAgIHNwPE1QRUc0RXh0cmFjdG9yPiBleHRyYWN0b3IgPQorICAgICAgICBuZXcgTVBFRzRFeHRyYWN0b3IobmV3IE1tYXBTb3VyY2UoZmlsZW5hbWUpKTsKKworICAgIHNpemVfdCBudW1fdHJhY2tzID0gZXh0cmFjdG9yLT5jb3VudFRyYWNrcygpOworCisgICAgc3A8TWV0YURhdGE+IG1ldGE7CisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBudW1fdHJhY2tzOyArK2kpIHsKKyAgICAgICAgbWV0YSA9IGV4dHJhY3Rvci0+Z2V0VHJhY2tNZXRhRGF0YShpKTsKKyAgICAgICAgQ0hFQ0sobWV0YS5nZXQoKSAhPSBOVUxMKTsKKworICAgICAgICBjb25zdCBjaGFyICptaW1lOworICAgICAgICBpZiAoIW1ldGEtPmZpbmRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgJm1pbWUpKSB7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzdHJuY2FzZWNtcChtaW1lLCAidmlkZW8vIiwgNikpIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgc291cmNlID0gZXh0cmFjdG9yLT5nZXRUcmFjayhpKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgcmV0dXJuIHNvdXJjZTsKK30KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KSB7CisgICAgYW5kcm9pZDo6UHJvY2Vzc1N0YXRlOjpzZWxmKCktPnN0YXJ0VGhyZWFkUG9vbCgpOworCisjaWYgMQorICAgIGlmIChhcmdjICE9IDIpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJ1c2FnZTogJXMgZmlsZW5hbWVcbiIsIGFyZ3ZbMF0pOworICAgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgICBPTVhDbGllbnQgY2xpZW50OworICAgIENIRUNLX0VRKGNsaWVudC5jb25uZWN0KCksIE9LKTsKKworI2lmIDAKKyAgICBzcDxNZWRpYVNvdXJjZT4gc291cmNlID0gY3JlYXRlU291cmNlKGFyZ3ZbMV0pOworCisgICAgaWYgKHNvdXJjZSA9PSBOVUxMKSB7CisgICAgICAgIGZw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idWZmZXIpOworICAgICAgICBDSEVDS19FUShlcnIsIE9LKTsKKworICAgICAgICBwcmludGYoImdvdCBhIGZyYW1lLCBkYXRhPSVwLCBzaXplPSVkXG4iLAorICAgICAgICAgICAgICAgYnVmZmVyLT5kYXRhKCksIGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkpOworCisgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOworICAgICAgICBidWZmZXIgPSBOVUxMOworICAgIH0KKworICAgIGRlbGV0ZSBzb3VyY2U7CisgICAgc291cmNlID0gTlVMTDsKKyNlbmRpZgorCisgICAgcmV0dXJuIDA7Cit9CisjZWxzZQorCitpbnQgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpIHsKKyAgICBhbmRyb2lkOjpQcm9jZXNzU3RhdGU6OnNlbGYoKS0+c3RhcnRUaHJlYWRQb29sKCk7CisKKyAgICBPTVhDbGllbnQgY2xpZW50OworICAgIENIRUNLX0VRKGNsaWVudC5jb25uZWN0KCksIE9LKTsKKworICAgIGNvbnN0IGludDMyX3Qga1NhbXBsZVJhdGUgPSAyMjA1MDsKKyAgICBjb25zdCBpbnQzMl90IGtOdW1DaGFubmVscyA9IDI7CisgICAgc3A8TWVkaWFTb3VyY2U+IGF1ZGlvU291cmNlID0gbmV3IFNpbmVTb3VyY2Uoa1NhbXBsZVJhdGUsIGtOdW1DaGFubmVscyk7CisKKyNpZiAwCisgICAgc3A8TWVkaWFQbGF5ZXJCYXNlOjpBdWRpb1Npbms+IGF1ZGlvU2luazsKKyAgICBBdWRpb1BsYXllciAqcGxheWVyID0gbmV3IEF1ZGlvUGxheWVyKGF1ZGlvU2luayk7CisgICAgcGxheWVyLT5zZXRTb3VyY2UoYXVkaW9Tb3VyY2UpOworICAgIHBsYXllci0+c3RhcnQoKTsKKworICAgIHNsZWVwKDEwKTsKKworICAgIHBsYXllci0+c3RvcCgpOworI2VuZGlmCisKKyAgICBzcDxNZXRhRGF0YT4gZW5jTWV0YSA9IG5ldyBNZXRhRGF0YTsKKyAgICBlbmNNZXRhLT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgMSA/ICJhdWRpby9hbXItd2IiIDogImF1ZGlvL21wNGEtbGF0bSIpOworICAgIGVuY01ldGEtPnNldEludDMyKGtLZXlTYW1wbGVSYXRlLCBrU2FtcGxlUmF0ZSk7CisgICAgZW5jTWV0YS0+c2V0SW50MzIoa0tleUNoYW5uZWxDb3VudCwga051bUNoYW5uZWxzKTsKKyAgICBlbmNNZXRhLT5zZXRJbnQzMihrS2V5TWF4SW5wdXRTaXplLCA4MTkyKTsKKworICAgIHNwPE1lZGlhU291cmNlPiBlbmNvZGVyID0KKyAgICAgICAgT01YQ29kZWM6OkNyZWF0ZShjbGllbnQuaW50ZXJmYWNlKCksIGVuY01ldGEsIHRydWUsIGF1ZGlvU291cmNlKTsKKworICAgIGVuY29kZXItPnN0YXJ0KCk7CisKKyAgICBpbnQzMl90IG4gPSAwOworICAgIHN0YXR1c190IGVycjsKKyAgICBNZWRpYUJ1ZmZlciAqYnVmZmVyOworICAgIHdoaWxlICgoZXJyID0gZW5jb2Rlci0+cmVhZCgmYnVmZmVyKSkgPT0gT0spIHsKKyAgICAgICAgcHJpbnRmKCIuIik7CisgICAgICAgIGZmbHVzaChzdGRvdXQpOworCisgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOworICAgICAgICBidWZmZXIgPSBOVUxMOworCisgICAgICAgIGlmICgrK24gPT0gMTAwKSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBwcmludGYoIiRcbiIpOworCisgICAgZW5jb2Rlci0+c3RvcCgpOworCisgICAgY2xpZW50LmRpc2Nvbm5lY3QoKTsKKworICAgIHJldHVybiAwOworfQorI2VuZGlmCmRpZmYgLS1naXQgYS9jbWRzL3N0YWdlZnJpZ2h0L3N0YWdlZnJpZ2h0LmNwcCBiL2NtZHMvc3RhZ2VmcmlnaHQvc3RhZ2VmcmlnaHQuY3B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zdGF0aWMgaW50NjRfdCBnZXROb3dVcygpIHsKKyAgICBzdHJ1Y3QgdGltZXZhbCB0djsKKyAgICBnZXR0aW1lb2ZkYXkoJnR2LCBOVUxMKTsKKworICAgIHJldHVybiAoaW50NjRfdCl0di50dl91c2VjICsgdHYudHZfc2VjICogMTAwMDAwMDsKK30KKworc3RhdGljIHZvaWQgcGxheVNvdXJjZShPTVhDbGllbnQgKmNsaWVudCwgY29uc3Qgc3A8TWVkaWFTb3VyY2U+ICZzb3VyY2UpIHsKKyAgICBzcDxNZXRhRGF0YT4gbWV0YSA9IHNvdXJjZS0+Z2V0Rm9ybWF0KCk7CisKKyAgICBzcDxPTVhDb2RlYz4gZGVjb2RlciA9IE9NWENvZGVjOjpDcmVhdGUoCisgICAgICAgICAgICBjbGllbnQtPmludGVyZmFjZSgpLCBtZXRhLCBmYWxzZSAvKiBjcmVhdGVFbmNvZGVyICovLCBzb3VyY2UpOworCisgICAgaWYgKGRlY29kZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgZGVjb2Rlci0+c3RhcnQoKTsKKworICAgIGludCBuID0gMDsKKyAgICBpbnQ2NF90IHN0YXJ0VGltZSA9IGdldE5vd1VzKCk7CisKKyAgICBsb25nIG51bUl0ZXJhdGlvbnNMZWZ0ID0gZ051bVJlcGV0aXRpb25zOworICAgIE1lZGlhU291cmNlOjpSZWFkT3B0aW9ucyBvcHRpb25zOworCisgICAgd2hpbGUgKG51bUl0ZXJhdGlvbnNMZWZ0LS0gPiAwKSB7CisgICAgICAgIGxvbmcgbnVtRnJhbWVzID0gMDsKKworICAgICAgICBNZWRpYUJ1ZmZlciAqYnVmZmVyOworCisgICAgICAgIGZvciAoOzspIHsKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGRlY29kZXItPnJlYWQoJmJ1ZmZlciwgJm9wdGlvbnMpOworICAgICAgICAgICAgb3B0aW9ucy5jbGVhclNlZWtUbygpOworCisgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoYnVmZmVyLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKChuKysgJSAxNikgPT0gMCkgeworICAgICAgICAgICAgICAgIHByaW50ZigiLiIpOworICAgICAgICAgICAgICAgIGZmbHVzaChzdGRvdXQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKKyAgICAgICAgICAgIGJ1ZmZlciA9IE5VTEw7CisKKyAgICAgICAgICAgICsrbnVtRnJhbWVzOworICAgICAgICAgICAgaWYgKGdNYXhOdW1GcmFtZXMgPiAwICYmIG51bUZyYW1lcyA9PSBnTWF4TnVtRnJhbWVzKSB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChnUmVwcm9kdWNlQnVnID09IDEgJiYgbnVtRnJhbWVzID09IDQwKSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCJzZWVraW5nIHBhc3QgdGhlIGVuZCBub3cuIik7CisgICAgICAgICAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8oMHg3ZmZmZmZmZkwpOworICAgICAgICAgICAgfSBlbHNlIGlmIChnUmVwcm9kdWNlQnVnID09IDIgJiYgbnVtRnJhbWVzID09IDQwKSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCJzZWVraW5nIHRvIDUgc2Vjcy4iKTsKKyAgICAgICAgICAgICAgICBvcHRpb25zLnNldFNlZWtUbyg1MDAwMDAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaW50ZigiJCIpOworICAgICAgICBmZmx1c2goc3Rkb3V0KTsKKworICAgICAgICBvcHRpb25zLnNldFNlZWtUbygwKTsKKyAgICB9CisKKyAgICBkZWNvZGVyLT5zdG9wKCk7CisgICAgcHJpbnRmKCJcbiIpOworCisg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ICJoYW46bG06YjoiKSkgPj0gMCkgeworICAgICAgICBzd2l0Y2ggKHJlcykgeworICAgICAgICAgICAgY2FzZSAnYSc6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYXVkaW9Pbmx5ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FzZSAnbCc6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbGlzdENvbXBvbmVudHMgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjYXNlICdtJzoKKyAgICAgICAgICAgIGNhc2UgJ24nOgorICAgICAgICAgICAgY2FzZSAnYic6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgICAgICAgIGxvbmcgeCA9IHN0cnRvbChvcHRhcmcsICZlbmQsIDEwKTsKKworICAgICAgICAgICAgICAgIGlmICgqZW5kICE9ICdcMCcgfHwgZW5kID09IG9wdGFyZyB8fCB4IDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgeCA9IDE7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAnbicpIHsKKyAgICAgICAgICAgICAgICAgICAgZ051bVJlcGV0aXRpb25zID0geDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlcyA9PSAnbScpIHsKKyAgICAgICAgICAgICAgICAgICAgZ01heE51bUZyYW1lcyA9IHg7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfRVEocmVzLCAnYicpOworICAgICAgICAgICAgICAgICAgICBnUmVwcm9kdWNlQnVnID0geDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNhc2UgJz8nOgorICAgICAgICAgICAgY2FzZSAnaCc6CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHVzYWdlKGFyZ3ZbMF0pOworICAgICAgICAgICAgICAgIGV4aXQoMSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBhcmdjIC09IG9wdGluZDsKKyAgICBhcmd2ICs9IG9wdGluZDsKKworICAgIGlmIChsaXN0Q29tcG9uZW50cykgeworICAgICAgICBzcDxJU2VydmljZU1hbmFnZXI+IHNtID0gZGVmYXVsdFNlcnZpY2VNYW5hZ2VyKCk7CisgICAgICAgIHNwPElCaW5kZXI+IGJpbmRlciA9IHNtLT5nZXRTZXJ2aWNlKFN0cmluZzE2KCJtZWRpYS5wbGF5ZXIiKSk7CisgICAgICAgIHNwPElNZWRpYVBsYXllclNlcnZpY2U+IHNlcnZpY2UgPSBpbnRlcmZhY2VfY2FzdDxJTWVkaWFQbGF5ZXJTZXJ2aWNlPihiaW5kZXIpOworCisgICAgICAgIENIRUNLKHNlcnZpY2UuZ2V0KCkgIT0gTlVMTCk7CisKKyAgICAgICAgc3A8SU9NWD4gb214ID0gc2VydmljZS0+Y3JlYXRlT01YKCk7CisgICAgICAgIENIRUNLKG9teC5nZXQoKSAhPSBOVUxMKTsKKworICAgICAgICBMaXN0PFN0cmluZzg+IGxpc3Q7CisgICAgICAgIG9teC0+bGlzdF9ub2RlcygmbGlzdCk7CisKKyAgICAgICAgZm9yIChMaXN0PFN0cmluZzg+OjppdGVyYXRvciBpdCA9IGxpc3QuYmVnaW4oKTsKKyAgICAgICAgICAgICBpdCAhPSBsaXN0LmVuZCgpOyArK2l0KSB7CisgICAgICAgICAgICBwcmludGYoIiVzXG4iLCAoKml0KS5zdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBEYXRhU291cmNlOjpSZWdpc3RlckRlZmF1bHRTbmlmZmVycygpOworCisgICAgT01YQ2xpZW50IGNsaWVudDsKKyAgICBzdGF0dXNfdCBlcnIgPSBjbGllbnQuY29ubmVjdCgpOworCisgICAgZm9yIChpbnQgayA9IDA7IGsgPCBhcmdjOyArK2spIHsKKyAgICAgICAgY29uc3QgY2hhciAqZmlsZW5hbWUgPSBhcmd2W2tdOworCisgICAgICAgIHNwPERhdGFTb3VyY2U+IGRhdGFTb3VyY2U7CisgICAgICAgIGlmICghc3RybmNhc2VjbXAoImh0dHA6Ly8iLCBmaWxlbmFtZSwgNykpIHsKKyAgICAgICAgICAgIGRhdGFTb3VyY2UgPSBuZXcgSFRUUERhdGFTb3VyY2UoZmlsZW5hbWUpOworICAgICAgICAgICAgZGF0YVNvdXJjZSA9IG5ldyBDYWNoaW5nRGF0YVNvdXJjZShkYXRhU291cmNlLCA2NCAqIDEwMjQsIDEwKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRhdGFTb3VyY2UgPSBuZXcgTW1hcFNvdXJjZShmaWxlbmFtZSk7CisgICAgICAgIH0KKworICAgICAgICBib29sIGlzSlBFRyA9IGZhbHNlOworCisgICAgICAgIHNpemVfdCBsZW4gPSBzdHJsZW4oZmlsZW5hbWUpOworICAgICAgICBpZiAobGVuID49IDQgJiYgIXN0cmNhc2VjbXAoZmlsZW5hbWUgKyBsZW4gLSA0LCAiLmpwZyIpKSB7CisgICAgICAgICAgICBpc0pQRUcgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgc3A8TWVkaWFTb3VyY2U+IG1lZGlhU291cmNlOworCisgICAgICAgIGlmIChpc0pQRUcpIHsKKyAgICAgICAgICAgIG1lZGlhU291cmNlID0gbmV3IEpQRUdTb3VyY2UoZGF0YVNvdXJjZSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzcDxNZWRpYUV4dHJhY3Rvcj4gZXh0cmFjdG9yID0gTWVkaWFFeHRyYWN0b3I6OkNyZWF0ZShkYXRhU291cmNlKTsKKworICAgICAgICAgICAgc2l6ZV90IG51bVRyYWNrcyA9IGV4dHJhY3Rvci0+Y291bnRUcmFja3MoKTsKKworICAgICAgICAgICAgc3A8TWV0YURhdGE+IG1ldGE7CisgICAgICAgICAgICBzaXplX3QgaTsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBudW1UcmFja3M7ICsraSkgeworICAgICAgICAgICAgICAgIG1ldGEgPSBleHRyYWN0b3ItPmdldFRyYWNrTWV0YURhdGEoaSk7CisKKyAgICAgICAgICAgICAgICBjb25zdCBjaGFyICptaW1lOworICAgICAgICAgICAgICAgIG1ldGEtPmZpbmRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgJm1pbWUpOworCisgICAgICAgICAgICAgICAgaWYgKGF1ZGlvT25seSAmJiAhc3RybmNhc2VjbXAobWltZSwgImF1ZGlvLyIsIDYpKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICghYXVkaW9Pbmx5ICYmICFzdHJuY2FzZWNtcChtaW1lLCAidmlkZW8vIiwgNikpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtZWRpYVNvdXJjZSA9IGV4dHJhY3Rvci0+Z2V0VHJhY2soaSk7CisgICAgICAgIH0KKworICAgICAgICBwbGF5U291cmNlKCZjbGllbnQsIG1lZGlhU291cmNlKTsKKyAgICB9CisKKyAgICBjbGllbnQuZGlzY29ubmVjdCgpOworCisgICAgcmV0dXJuIDA7Cit9CmRpZmYgLS1naXQgYS9jbWRzL3N1cmZhY2VmbGluZ2VyL0FuZHJvaWQubWsgYi9jbWRzL3N1cmZhY2VmbGluZ2VyL0FuZHJvaWQubWsKaW5kZXggMzdjM2Q5NC4uYmZhNThhMSAxMDA2NDQKLS0tIGEvY21kcy9zdXJmYWNlZmxpbmdlci9BbmRyb2lkLm1rCisrKyBiL2NtZHMvc3VyZmFjZWZ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L2NvcmUvamF2YS9hbmRyb2lkL2FjY2Vzc2liaWxpdHlzZXJ2aWNlL0FjY2Vzc2liaWxpdHlTZXJ2aWNlLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvYWNjZXNzaWJpbGl0eXNlcnZpY2UvQWNjZXNzaWJpbGl0eVNlcnZpY2UuamF2YQpAQCAtMjExLDggKzIxMSwxMCBAQAogICAgICAgICAgICAgc3dpdGNoIChtZXNzYWdlLndoYXQpIHsKICAgICAgICAgICAgICAgICBjYXNlIERPX09OX0FDQ0VTU0lCSUxJVFlfRVZFTlQgOgogICAgICAgICAgICAgICAgICAgICBBY2Nlc3NpYmlsaXR5RXZlbnQgZXZlbnQgPSAoQWNjZXNzaWJpbGl0eUV2ZW50KSBtZXNzYWdlLm9iajsKLSAgICAgICAgICAgICAgICAgICAgbVRhcmdldC5vbkFjY2Vzc2liaWxpdHlFdmVudChldmVudCk7Ci0gICAgICAgICAgICAgICAgICAgIGV2ZW50LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50ICE9IG51bGwpeworICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXQub25BY2Nlc3NpYmlsaXR5RXZlbnQoZXZlbnQpOworICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgY2FzZSBET19PTl9JTlRFUlJVUFQgOgogICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0Lm9uSW50ZXJydXB0KCk7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hY2NvdW50cy9BYnN0cmFjdEFjY291bnRBdXRoZW50aWNhdG9yLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9hY2NvdW50cy9BYnN0cmFjdEFjY291bnRBdXRoZW50aWNhdG9yLmphdmEKbmV3IGZpbGUgbW9kZSAx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G9wdGlvbnMpCisgICAgICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBjaGVja0JpbmRlclBlcm1pc3Npb24oKTsKKyAgICAgICAgICAgIGZpbmFsIEJ1bmRsZSByZXN1bHQ7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9IEFic3RyYWN0QWNjb3VudEF1dGhlbnRpY2F0b3IudGhpcy5hZGRBY2NvdW50KAorICAgICAgICAgICAgICAgICAgICBuZXcgQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZShyZXNwb25zZSksCisgICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50VHlwZSwgYXV0aFRva2VuVHlwZSwgcmVxdWlyZWRGZWF0dXJlcywgb3B0aW9ucyk7CisgICAgICAgICAgICB9IGNhdGNoIChOZXR3b3JrRXJyb3JFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfTkVUV09SS19FUlJPUiwgZS5nZXRNZXNzYWdlKCkpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX1VOU1VQUE9SVEVEX09QRVJBVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJhZGRBY2NvdW50IG5vdCBzdXBwb3J0ZWQiKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vblJlc3VsdChyZXN1bHQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgY29uZmlybVBhc3N3b3JkKElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIHJlc3BvbnNlLAorICAgICAgICAgICAgICAgIEFjY291bnQgYWNjb3VudCwgU3RyaW5nIHBhc3N3b3JkKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGNoZWNrQmluZGVyUGVybWlzc2lvbigpOworICAgICAgICAgICAgYm9vbGVhbiByZXN1bHQ7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9IEFic3RyYWN0QWNjb3VudEF1dGhlbnRpY2F0b3IudGhpcy5jb25maXJtUGFzc3dvcmQoCisgICAgICAgICAgICAgICAgICAgIG5ldyBBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlKHJlc3BvbnNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQsIHBhc3N3b3JkKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX1VOU1VQUE9SVEVEX09QRVJBVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJjb25maXJtUGFzc3dvcmQgbm90IHN1cHBvcnRlZCIpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0gY2F0Y2ggKE5ldHdvcmtFcnJvckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgcmVzcG9uc2Uub25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9ORVRXT1JLX0VSUk9SLCBlLmdldE1lc3NhZ2UoKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQnVuZGxlIGJ1bmRsZSA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgIGJ1bmRsZS5wdXRCb29sZWFuKENvbnN0YW50cy5CT09MRUFOX1JFU1VMVF9LRVksIHJlc3VsdCk7CisgICAgICAgICAgICByZXNwb25zZS5vblJlc3VsdChidW5kbGUpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgY29uZmlybUNyZWRlbnRpYWxzKElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIHJlc3BvbnNlLAorICAgICAgICAgICAgICAgIEFjY291bnQgYWNjb3VudCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBjaGVja0JpbmRlclBlcm1pc3Npb24oKTsKKyAgICAgICAgICAgIGZpbmFsIEJ1bmRsZSByZXN1bHQ7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9IEFic3RyYWN0QWNjb3VudEF1dGhlbnRpY2F0b3IudGhpcy5jb25maXJtQ3JlZGVudGlhbHMoCisgICAgICAgICAgICAgICAgICAgIG5ldyBBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlKHJlc3BvbnNlKSwgYWNjb3VudCk7CisgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgcmVzcG9uc2Uub25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9VTlNVUFBPUlRFRF9PUEVSQVRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAiY29uZmlybUNyZWRlbnRpYWxzIG5vdCBzdXBwb3J0ZWQiKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vblJlc3VsdChyZXN1bHQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgZ2V0QXV0aFRva2VuTGFiZWwoSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgcmVzcG9uc2UsCisgICAgICAgICAgICAgICAgU3RyaW5nIGF1dGhUb2tlblR5cGUpCisgICAgICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBjaGVja0JpbmRlclBlcm1pc3Npb24oKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgQnVuZGxlIHJlc3VsdCA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICByZXN1bHQucHV0U3RyaW5nKENvbnN0YW50cy5BVVRIX1RPS0VOX0xBQkVMX0tFWSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEFic3RyYWN0QWNjb3VudEF1dGhlbnRpY2F0b3IudGhpcy5nZXRBdXRoVG9rZW5MYWJlbChhdXRoVG9rZW5UeXBlKSk7CisgICAgICAgICAgICAgICAgcmVzcG9uc2Uub25SZXN1bHQocmVzdWx0KTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgcmVzcG9uc2Uub25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9CQURfQVJHVU1FTlRTLAorICAgICAgICAgICAgICAgICAgICAgICAgInVua25vd24gYXV0aFRva2VuVHlwZSIpOworICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfVU5TVVBQT1JURURfT1BFUkFUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgImdldEF1dGhUb2tlblR5cGVMYWJlbCBub3Qgc3VwcG9ydGVkIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBnZXRBdXRoVG9rZW4oSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgcmVzcG9uc2UsCisgICAgICAgICAgICAgICAgQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgYXV0aFRva2VuVHlwZSwgQnVuZGxlIGxvZ2luT3B0aW9ucykKKyAgICAgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGNoZWNrQmluZGVyUGVybWlzc2lvbigpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBmaW5hbCBCdW5kbGUgcmVzdWx0ID0gQWJzdHJhY3RBY2NvdW50QXV0aGVudGljYXRvci50aGlzLmdldEF1dGhUb2tlbigKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlKHJlc3BvbnNlKSwgYWNjb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhUb2tlblR5cGUsIGxvZ2luT3B0aW9ucyk7CisgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uUmVzdWx0KHJlc3VsdCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfVU5TVVBQT1JURURfT1BFUkFUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgImdldEF1dGhUb2tlbiBub3Qgc3VwcG9ydGVkIik7CisgICAgICAgICAgICB9IGNhdGNoIChOZXR3b3JrRXJyb3JFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfTkVUV09SS19FUlJPUiwgZS5nZXRNZXNzYWdlKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgdXBkYXRlQ3JlZGVudGlhbHMoSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgcmVzcG9uc2UsIEFjY291bnQgYWNjb3VudCwKKyAgICAgICAgICAgICAgICBTdHJpbmcgYXV0aFRva2VuVHlwZSwgQnVuZGxlIGxvZ2luT3B0aW9ucykgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBjaGVja0JpbmRlclBlcm1pc3Npb24oKTsKKyAgICAgICAgICAgIGZpbmFsIEJ1bmRsZSByZXN1bHQ7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9IEFic3RyYWN0QWNjb3VudEF1dGhlbnRpY2F0b3IudGhpcy51cGRhdGVDcmVkZW50aWFscygKKyAgICAgICAgICAgICAgICAgICAgbmV3IEFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UocmVzcG9uc2UpLCBhY2NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgYXV0aFRva2VuVHlwZSwgbG9naW5PcHRpb25zKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX1VOU1VQUE9SVEVEX09QRVJBVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ1cGRhdGVDcmVkZW50aWFscyBub3Qgc3VwcG9ydGVkIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmVzcG9uc2Uub25SZXN1bHQocmVzdWx0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGVkaXRQcm9wZXJ0aWVzKElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIHJlc3BvbnNlLAorICAgICAgICAgICAgICAgIFN0cmluZyBhY2NvdW50VHlwZSkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBjaGVja0JpbmRlclBlcm1pc3Npb24oKTsKKyAgICAgICAgICAgIGZpbmFsIEJ1bmRsZSByZXN1bHQ7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9IEFic3RyYWN0QWNjb3VudEF1dGhlbnRpY2F0b3IudGhpcy5lZGl0UHJvcGVydGllcygKKyAgICAgICAgICAgICAgICAgICAgbmV3IEFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UocmVzcG9uc2UpLCBhY2NvdW50VHlwZSk7CisgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgcmVzcG9uc2Uub25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9VTlNVUFBPUlRFRF9PUEVSQVRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAiZWRpdFByb3BlcnRpZXMgbm90IHN1cHBvcnRlZCIpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uUmVzdWx0KHJlc3VsdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBoYXNGZWF0dXJlcyhJQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSByZXNwb25zZSwKKyAgICAgICAgICAgICAgICBBY2NvdW50IGFjY291bnQsIFN0cmluZ1tdIGZlYXR1cmVzKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGNoZWNrQmluZGVyUGVybWlzc2lvbigpOworICAgICAgICAgICAgZmluYWwgQnVuZGxlIHJlc3VsdDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gQWJzdHJhY3RBY2NvdW50QXV0aGVudGljYXRvci50aGlzLmhhc0ZlYXR1cmVzKAorICAgICAgICAgICAgICAgICAgICBuZXcgQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZShyZXNwb25zZSksIGFjY291bnQsIGZlYXR1cmVzKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX1VOU1VQUE9SVEVEX09QRVJBVElPTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJoYXNGZWF0dXJlcyBub3Qgc3VwcG9ydGVkIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfSBjYXRjaCAoTmV0d29ya0Vycm9yRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX05FVFdPUktfRVJST1IsIGUuZ2V0TWVzc2FnZSgpKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vblJlc3VsdChyZXN1bHQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgZ2V0QWNjb3VudFJlbW92YWxBbGxvd2VkKElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIHJlc3BvbnNlLAorICAgICAgICAgICAgICAgIEFjY291bnQgYWNjb3VudCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBjaGVja0JpbmRlclBlcm1pc3Npb24oKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZmluYWwgQnVuZGxlIHJlc3VsdCA9IEFic3RyYWN0QWNjb3VudEF1dGhlbnRpY2F0b3IudGhpcy5nZXRBY2NvdW50UmVtb3ZhbEFsbG93ZWQoCisgICAgICAgICAgICAgICAgICAgIG5ldyBBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlKHJlc3BvbnNlKSwgYWNjb3VudCk7CisgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uUmVzdWx0KHJlc3VsdCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfVU5TVVBQT1JURURfT1BFUkFUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgImdldEFjY291bnRSZW1vdmFsQWxsb3dlZCBub3Qgc3VwcG9ydGVkIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfSBjYXRjaCAoTmV0d29ya0Vycm9yRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5vbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX05FVFdPUktfRVJST1IsIGUuZ2V0TWVzc2FnZSgpKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY2hlY2tCaW5kZXJQZXJtaXNzaW9uKCkgeworICAgICAgICBmaW5hbCBpbnQgdWlkID0gQmluZGVyLmdldENhbGxpbmdVaWQoKTsKKyAgICAgICAgZmluYWwgU3RyaW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W5hbCBTdHJpbmcgbmFtZTsKKyAgICBwdWJsaWMgZmluYWwgU3RyaW5nIHR5cGU7CisKKyAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG8pIHsKKyAgICAgICAgaWYgKG8gPT0gdGhpcykgcmV0dXJuIHRydWU7CisgICAgICAgIGlmICghKG8gaW5zdGFuY2VvZiBBY2NvdW50KSkgcmV0dXJuIGZhbHNlOworICAgICAgICBmaW5hbCBBY2NvdW50IG90aGVyID0gKEFjY291bnQpbzsKKyAgICAgICAgcmV0dXJuIG5hbWUuZXF1YWxzKG90aGVyLm5hbWUpICYmIHR5cGUuZXF1YWxzKG90aGVyLnR5cGUpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgaGFzaENvZGUoKSB7CisgICAgICAgIGludCByZXN1bHQgPSAxNzsKKyAgICAgICAgcmVzdWx0ID0gMzEgKiByZXN1bHQgKyBuYW1lLmhhc2hDb2RlKCk7CisgICAgICAgIHJlc3VsdCA9IDMxICogcmVzdWx0ICsgdHlwZS5oYXNoQ29kZSgpOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHB1YmxpYyBBY2NvdW50KFN0cmluZyBuYW1lLCBTdHJpbmcgdHlwZSkgeworICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobmFtZSkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInRoZSBuYW1lIG11c3Qgbm90IGJlIGVtcHR5OiAiICsgbmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHR5cGUpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ0aGUgdHlwZSBtdXN0IG5vdCBiZSBlbXB0eTogIiArIHR5cGUpOworICAgICAgICB9CisgICAgICAgIHRoaXMubmFtZSA9IG5hbWU7CisgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7CisgICAgfQorCisgICAgcHVibGljIEFjY291bnQoUGFyY2VsIGluKSB7CisgICAgICAgIHRoaXMubmFtZSA9IGluLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgdGhpcy50eXBlID0gaW4ucmVhZFN0cmluZygpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcobmFtZSk7CisgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcodHlwZSk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDcmVhdG9yPEFjY291bnQ+IENSRUFUT1IgPSBuZXcgQ3JlYXRvcjxBY2NvdW50PigpIHsKKyAgICAgICAgcHVibGljIEFjY291bnQgY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgc291cmNlKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IEFjY291bnQoc291cmNlKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBBY2NvdW50W10gbmV3QXJyYXkoaW50IHNpemUpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgQWNjb3VudFtzaXplXTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICByZXR1cm4gIkFjY291bnQge25hbWU9IiArIG5hbWUgKyAiLCB0eXBlPSIgKyB0eXBlICsgIn0iOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FjY291bnRzL0FjY291bnRBdXRoZW50aWNhdG9yQWN0aXZpdHkuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FjY291bnRzL0FjY291bnRBdXRoZW50aWNhd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AgICBtUmVzdWx0QnVuZGxlID0gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHJlaXZlcyB0aGUgQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSBmcm9tIGVpdGhlciB0aGUgaW50ZW50IG9mIHRoZSBpY2ljbGUsIGlmIHRoZQorICAgICAqIGljaWNsZSBpcyBub24temVyby4KKyAgICAgKiBAcGFyYW0gaWNpY2xlIHRoZSBzYXZlIGluc3RhbmNlIGRhdGEgb2YgdGhpcyBBY3Rpdml0eSwgbWF5IGJlIG51bGwKKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkNyZWF0ZShCdW5kbGUgaWNpY2xlKSB7CisgICAgICAgIHN1cGVyLm9uQ3JlYXRlKGljaWNsZSk7CisKKyAgICAgICAgaWYgKGljaWNsZSA9PSBudWxsKSB7CisgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gZ2V0SW50ZW50KCk7CisgICAgICAgICAgICBtQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSA9CisgICAgICAgICAgICAgICAgICAgIGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoQ29uc3RhbnRzLkFDQ09VTlRfQVVUSEVOVElDQVRPUl9SRVNQT05TRV9LRVkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgPQorICAgICAgICAgICAgICAgICAgICBpY2ljbGUuZ2V0UGFyY2VsYWJsZShDb25zdGFudHMuQUNDT1VOVF9BVVRIRU5USUNBVE9SX1JFU1BPTlNFX0tFWSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgIT0gbnVsbCkgeworICAgICAgICAgICAgbUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2Uub25SZXF1ZXN0Q29udGludWVkKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICA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sZS5BY2NvdW50QXV0aGVudGljYXRvcl9hY2NvdW50VHlwZSk7CisgICAgICAgICAgICBmaW5hbCBpbnQgbGFiZWxJZCA9IHNhLmdldFJlc291cmNlSWQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkFjY291bnRBdXRoZW50aWNhdG9yX2xhYmVsLCAwKTsKKyAgICAgICAgICAgIGZpbmFsIGludCBpY29uSWQgPSBzYS5nZXRSZXNvdXJjZUlkKAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BY2NvdW50QXV0aGVudGljYXRvcl9pY29uLCAwKTsKKyAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShhY2NvdW50VHlwZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBuZXcgQXV0aGVudGljYXRvckRlc2NyaXB0aW9uKGFjY291bnRUeXBlLCBwYWNrYWdlTmFtZSwgbGFiZWxJZCwgaWNvbklkKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHNhLnJlY3ljbGUoKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FjY291bnRzL0FjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FjY291bnRzL0FjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43MTk4MDQ2Ci0tLSAvZGV2L251bGwKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvYWNjb3VudHMvQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZS5qYXZhCkBAIC0wLDAgKzEsODIgQE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HMgY2FsbHMgdG8gYW4ge0BsaW5rIElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlfSBvYmplY3QuCisgKiBUT0RPOiB0aGlzIGludGVyZmFjZSBpcyBzdGlsbCBpbiBmbHV4CisgKi8KK3B1YmxpYyBjbGFzcyBBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIGltcGxlbWVudHMgUGFyY2VsYWJsZSB7CisgICAgcHJpdmF0ZSBJQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSBtQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZTsKKworICAgIHB1YmxpYyBBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlKElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIHJlc3BvbnNlKSB7CisgICAgICAgIG1BY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlID0gcmVzcG9uc2U7CisgICAgfQorCisgICAgcHVibGljIEFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UoUGFyY2VsIHBhcmNlbCkgeworICAgICAgICBtQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSA9CisgICAgICAgICAgICAgICAgSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UuU3R1Yi5hc0ludGVyZmFjZShwYXJjZWwucmVhZFN0cm9uZ0JpbmRlcigpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvblJlc3VsdChCdW5kbGUgcmVzdWx0KSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZS5vblJlc3VsdChyZXN1bHQpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gdGhpcyBzaG91bGQgbmV2ZXIgaGFwcGVuCisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvblJlcXVlc3RDb250aW51ZWQoK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nRleHQgbUNvbnRleHQ7CisgICAgcHJpdmF0ZSBmaW5hbCBJQWNjb3VudE1hbmFnZXIgbVNlcnZpY2U7CisgICAgcHJpdmF0ZSBmaW5hbCBIYW5kbGVyIG1NYWluSGFuZGxlcjsKKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIEFjY291bnRNYW5hZ2VyKENvbnRleHQgY29udGV4dCwgSUFjY291bnRNYW5hZ2VyIHNlcnZpY2UpIHsKKyAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgICAgICBtU2VydmljZSA9IHNlcnZpY2U7CisgICAgICAgIG1NYWluSGFuZGxlciA9IG5ldyBIYW5kbGVyKG1Db250ZXh0LmdldE1haW5Mb29wZXIoKSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQGhpZGUgdXNlZCBmb3IgdGVzdGluZyBvbmx5CisgICAgICovCisgICAgcHVibGljIEFjY291bnRNYW5hZ2VyKENvbnRleHQgY29udGV4dCwgSUFjY291bnRNYW5hZ2VyIHNlcnZpY2UsIEhhbmRsZXIgaGFuZGxlcikgeworICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CisgICAgICAgIG1TZXJ2aWNlID0gc2VydmljZTsKKyAgICAgICAgbU1haW5IYW5kbGVyID0gaGFuZGxlcjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEFjY291bnRNYW5hZ2VyIGdldChDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgcmV0dXJuIChBY2NvdW50TWFuYWdlcikgY29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKENvbnRleHQuQUNDT1VOVF9TRVJWSUNFKTsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIGdldFBhc3N3b3JkKGZpbmFsIEFjY291bnQgYWNjb3VudCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFBhc3N3b3JkKGFjY291bnQpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gd2lsbCBuZXZlciBoYXBwZW4KKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXRVc2VyRGF0YShmaW5hbCBBY2NvdW50IGFjY291bnQsIGZpbmFsIFN0cmluZyBrZXkpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRVc2VyRGF0YShhY2NvdW50LCBrZXkpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gd2lsbCBuZXZlciBoYXBwZW4KKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvbltdIGdldEF1dGhlbnRpY2F0b3JUeXBlcygpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRBdXRoZW50aWNhdG9yVHlwZXMoKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIC8vIHdpbGwgbmV2ZXIgaGFwcGVuCisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBBY2NvdW50W10gZ2V0QWNjb3VudHMoKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0QWNjb3VudHMobnVsbCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyB3b24ndCBldmVyIGhhcHBlbgorICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgQWNjb3VudFtdIGdldEFjY291bnRzQnlUeXBlKFN0cmluZyB0eXBlKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0QWNjb3VudHModHlwZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyB3b24ndCBldmVyIGhhcHBlbgorICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBhZGRBY2NvdW50RXhwbGljaXRseShBY2NvdW50IGFjY291bnQsIFN0cmluZyBwYXNzd29yZCwgQnVuZGxlIGV4dHJhcykgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmFkZEFjY291bnQoYWNjb3VudCwgcGFzc3dvcmQsIGV4dHJhcyk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyB3b24ndCBldmVyIGhhcHBlbgorICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgQWNjb3VudE1hbmFnZXJGdXR1cmU8Qm9vbGVhbj4gcmVtb3ZlQWNjb3VudChmaW5hbCBBY2NvdW50IGFjY291bnQsCisgICAgICAgICAgICBBY2NvdW50TWFuYWdlckNhbGxiYWNrPEJvb2xlYW4+IGNhbGxiYWNrLCBIYW5kbGVyIGhhbmRsZXIpIHsKKyAgICAgICAgcmV0dXJuIG5ldyBGdXR1cmUyVGFzazxCb29sZWFuPihoYW5kbGVyLCBjYWxsYmFjaykgeworICAgICAgICAgICAgcHVibGljIHZvaWQgZG9Xb3JrKCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICAgICAgbVNlcnZpY2UucmVtb3ZlQWNjb3VudChtUmVzcG9uc2UsIGFjY291bnQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcHVibGljIEJvb2xlYW4gYnVuZGxlVG9SZXN1bHQoQnVuZGxlIGJ1bmRsZSkgdGhyb3dzIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24geworICAgICAgICAgICAgICAgIGlmICghYnVuZGxlLmNvbnRhaW5zS2V5KENvbnN0YW50cy5CT09MRUFOX1JFU1VMVF9LRVkpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdG9yRXhjZXB0aW9uKCJubyByZXN1bHQgaW4gcmVzcG9uc2UiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGJ1bmRsZS5nZXRCb29sZWFuKENvbnN0YW50cy5CT09MRUFOX1JFU1VMVF9LRVkpOworICAgICAgICAgICAgfQorICAgICAgICB9LnN0YXJ0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW52YWxpZGF0ZUF1dGhUb2tlbihmaW5hbCBTdHJpbmcgYWNjb3VudFR5cGUsIGZpbmFsIFN0cmluZyBhdXRoVG9rZW4pIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1TZXJ2aWNlLmludmFsaWRhdGVBdXRoVG9rZW4oYWNjb3VudFR5cGUsIGF1dGhUb2tlbik7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyB3b24ndCBldmVyIGhhcHBlbgorICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIHBlZWtBdXRoVG9rZW4oZmluYWwgQWNjb3VudCBhY2NvdW50LCBmaW5hbCBTdHJpbmcgYXV0aFRva2VuVHlwZSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnBlZWtBdXRoVG9rZW4oYWNjb3VudCwgYXV0aFRva2VuVHlwZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyB3b24ndCBldmVyIGhhcHBlbgorICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZChmaW5hbCBBY2NvdW50IGFjY291bnQsIGZpbmFsIFN0cmluZyBwYXNzd29yZCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgbVNlcnZpY2Uuc2V0UGFzc3dvcmQoYWNjb3VudCwgcGFzc3dvcmQpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gd29uJ3QgZXZlciBoYXBwZW4KKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY2xlYXJQYXNzd29yZChmaW5hbCBBY2NvdW50IGFjY291bnQpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1TZXJ2aWNlLmNsZWFyUGFzc3dvcmQoYWNjb3VudCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyB3b24ndCBldmVyIGhhcHBlbgorICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRVc2VyRGF0YShmaW5hbCBBY2NvdW50IGFjY291bnQsIG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dXJuIG5ldyBGdXR1cmUyVGFzazxCb29sZWFuPihoYW5kbGVyLCBjYWxsYmFjaykgeworICAgICAgICAgICAgcHVibGljIHZvaWQgZG9Xb3JrKCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICAgICAgbVNlcnZpY2UuY29uZmlybVBhc3N3b3JkKG1SZXNwb25zZSwgYWNjb3VudCwgcGFzc3dvcmQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcHVibGljIEJvb2xlYW4gYnVuZGxlVG9SZXN1bHQoQnVuZGxlIGJ1bmRsZSkgdGhyb3dzIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24geworICAgICAgICAgICAgICAgIGlmICghYnVuZGxlLmNvbnRhaW5zS2V5KENvbnN0YW50cy5CT09MRUFOX1JFU1VMVF9LRVkpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdG9yRXhjZXB0aW9uKCJubyByZXN1bHQgaW4gcmVzcG9uc2UiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGJ1bmRsZS5nZXRCb29sZWFuKENvbnN0YW50cy5CT09MRUFOX1JFU1VMVF9LRVkpOworICAgICAgICAgICAgfQorICAgICAgICB9LnN0YXJ0KCk7CisgICAgfQorCisgICAgcHVibGljIEFjY291bnRNYW5hZ2VyRnV0dXJlPEFjY291bnRbXT4gZ2V0QWNjb3VudHNCeVR5cGVBbmRGZWF0dXJlcygKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyB0eXBlLCBmaW5hbCBTdHJpbmdbXSBmZWF0dXJlcywKKyAgICAgICAgICAgIEFjY291bnRNYW5hZ2VyQ2FsbGJhY2s8QWNjb3VudFtdPiBjYWxsYmFjaywgSGFuZGxlciBoYW5kbGVyKSB7CisgICAgICAgIGlmICh0eXBlID09IG51bGwpIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInR5cGUgaXMgbnVsbCIpOworICAgICAgICByZXR1cm4gbmV3IEZ1dHVyZTJUYXNrPEFjY291bnRbXT4oaGFuZGxlciwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGRvV29yaygpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgIG1TZXJ2aWNlLmdldEFjY291bnRzQnlGZWF0dXJlcyhtUmVzcG9uc2UsIHR5cGUsIGZlYXR1cmVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHB1YmxpYyBBY2NvdW50W10gYnVuZGxlVG9SZXN1bHQoQnVuZGxlIGJ1bmRsZSkgdGhyb3dzIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24geworICAgICAgICAgICAgICAgIGlmICghYnVuZGxlLmNvbnRhaW5zS2V5KENvbnN0YW50cy5BQ0NPVU5UU19LRVkpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdG9yRXhjZXB0aW9uKCJubyByZXN1bHQgaW4gcmVzcG9uc2UiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZmluYWwgUGFyY2VsYWJsZVtdIHBhcmNlbGFibGVzID0gYnVuZGxlLmdldFBhcmNlbGFibGVBcnJheShDb25zdGFudHMuQUNDT1VOVFNfS0VZKTsKKyAgICAgICAgICAgICAgICBBY2NvdW50W10gZGVzY3MgPSBuZXcgQWNjb3VudFtwYXJjZWxhYmxlcy5sZW5ndGhdOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcGFyY2VsYWJsZXMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgZGVzY3NbaV0gPSAoQWNjb3VudCkgcGFyY2VsYWJsZXNbaV07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBkZXNjczsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfS5zdGFydCgpOworICAgIH0KKworICAgIHB1YmxpYyBBY2NvdW50TWFuYWdlckZ1dHVyZTxCdW5kbGU+IGNvbmZpcm1DcmVkZW50aWFscyhmaW5hbCBBY2NvdW50IGFjY291bnQsIGZpbmFsIEFjdGl2aXR5IGFjdGl2aXR5LAorICAgICAgICAgICAgZmluYWwgQWNjb3VudE1hbmFnZXJDYWxsYmFjazxCdW5kbGU+IGNhbGxiYWNrLAorICAgICAgICAgICAgZmluYWwgSGFuZGxlciBoYW5kbGVyKSB7CisgICAgICAgIHJldHVybiBuZXcgQW1zVGFzayhhY3Rpdml0eSwgaGFuZGxlciwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGRvV29yaygpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgIG1TZXJ2aWNlLmNvbmZpcm1DcmVkZW50aWFscyhtUmVzcG9uc2UsIGFjY291bnQsIGFjdGl2aXR5ICE9IG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICB9LnN0YXJ0KCk7CisgICAgfQorCisgICAgcHVibGljIEFjY291bnRNYW5hZ2VyRnV0dXJlPEJ1bmRsZT4gdXBkYXRlQ3JlZGVudGlhbHMoZmluYWwgQWNjb3VudCBhY2NvdW50LCBmaW5hbCBTdHJpbmcgYXV0aFRva2VuVHlwZSwKKyAgICAgICAgICAgIGZpbmFsIEJ1bmRsZSBsb2dpbk9wdGlvbnMsIGZpbmFsIEFjdGl2aXR5IGFjdGl2aXR5LAorICAgICAgICAgICAgZmluYWwgQWNjb3VudE1hbmFnZXJDYWxsYmFjazxCdW5kbGU+IGNhbGxiYWNrLAorICAgICAgICAgICAgZmluYWwgSGFuZGxlciBoYW5kbGVyKSB7CisgICAgICAgIHJldHVybiBuZXcgQW1zVGFzayhhY3Rpdml0eSwgaGFuZGxlciwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGRvV29yaygpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgIG1TZXJ2aWNlLnVwZGF0ZUNyZWRlbnRpYWxzKG1SZXNwb25zZSwgYWNjb3VudCwgYXV0aFRva2VuVHlwZSwgYWN0aXZpdHkgIT0gbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvZ2luT3B0aW9ucyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0uc3RhcnQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQWNjb3VudE1hbmFnZXJGdXR1cmU8QnVuZGxlPiBlZGl0UHJvcGVydGllcyhmaW5hbCBTdHJpbmcgYWNjb3VudFR5cGUsIGZpbmFsIEFjdGl2aXR5IGFjdGl2aXR5LAorICAgICAgICAgICAgZmluYWwgQWNjb3VudE1hbmFnZXJDYWxsYmFjazxCdW5kbGU+IGNhbGxiYWNrLAorICAgICAgICAgICAgZmluYWwgSGFuZGxlciBoYW5kbGVyKSB7CisgICAgICAgIHJldHVybiBuZXcgQW1zVGFzayhhY3Rpdml0eSwgaGFuZGxlciwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGRvV29yaygpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgIG1TZXJ2aWNlLmVkaXRQcm9wZXJ0aWVzKG1SZXNwb25zZSwgYWNjb3VudFR5cGUsIGFjdGl2aXR5ICE9IG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICB9LnN0YXJ0KCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGVuc3VyZU5vdE9uTWFpblRocmVhZCgpIHsKKyAgICAgICAgZmluYWwgTG9vcGVyIGxvb3BlciA9IExvb3Blci5teUxvb3BlcigpOworICAgICAgICBpZiAobG9vcGVyICE9IG51bGwgJiYgbG9vcGVyID09IG1Db250ZXh0LmdldE1haW5Mb29wZXIoKSkgeworICAgICAgICAgICAgLy8gV2UgcmVhbGx5IHdhbnQgdG8gdGhyb3cgYW4gZXhjZXB0aW9uIGhlcmUsI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gICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIGNhbGxiYWNrLnJ1bihmdXR1cmUpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcG9zdFRvSGFuZGxlcihIYW5kbGVyIGhhbmRsZXIsIGZpbmFsIE9uQWNjb3VudHNVcGRhdGVkTGlzdGVuZXIgbGlzdGVuZXIsCisgICAgICAgICAgICBmaW5hbCBBY2NvdW50W10gYWNjb3VudHMpIHsKKyAgICAgICAgZmluYWwgQWNjb3VudFtdIGFjY291bnRzQ29weSA9IG5ldyBBY2NvdW50W2FjY291bnRzLmxlbmd0aF07CisgICAgICAgIC8vIHNlbmQgYSBjb3B5IHRvIG1ha2Ugc3VyZSB0aGF0IG9uZSBkb2Vzbid0CisgICAgICAgIC8vIGNoYW5nZSB3aGF0IGFub3RoZXIgc2VlcworICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGFjY291bnRzLCAwLCBhY2NvdW50c0NvcHksIDAsIGFjY291bnRzQ29weS5sZW5ndGgpOworICAgICAgICBoYW5kbGVyID0gKGhhbmRsZXIgPT0gbnVsbCkgPyBtTWFpbkhhbmRsZXIgOiBoYW5kbGVyOworICAgICAgICBoYW5kbGVyLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIGxpc3RlbmVyLm9uQWNjb3VudHNVcGRhdGVkKGFjY291bnRzQ29weSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworICAgIH0KKworICAgIHByaXZhdGUgYWJzdHJhY3QgY2xhc3MgQW1zVGFzayBleHRlbmRzIEZ1dHVyZVRhc2s8QnVuZGxlPiBpbXBsZW1lbnRzIEFjY291bnRNYW5hZ2VyRnV0dXJlPEJ1bmRsZT4geworICAgICAgICBmaW5hbCBJQWNjb3VudE1hbmFnZXJSZXNwb25zZSBtUmVzcG9uc2U7CisgICAgICAgIGZpbmFsIEhhbmRsZXIgbUhhbmRsZXI7CisgICAgICAgIGZpbmFsIEFjY291bnRNYW5hZ2VyQ2FsbGJhY2s8QnVuZGxlPiBtQ2FsbGJhY2s7CisgICAgICAgIGZpbmFsIEFjdGl2aXR5IG1BY3Rpdml0eTsKKyAgICAgICAgcHVibGljIEFtc1Rhc2soQWN0aXZpdHkgYWN0aXZpdHksIEhhbmRsZXIgaGFuZGxlciwgQWNjb3VudE1hbmFnZXJDYWxsYmFjazxCdW5kbGU+IGNhbGxiYWNrKSB7CisgICAgICAgICAgICBzdXBlcihuZXcgQ2FsbGFibGU8QnVuZGxlPigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgQnVuZGxlIGNhbGwoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigidGhpcyBzaG91bGQgbmV2ZXIgYmUgY2FsbGVkIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIG1IYW5kbGVyID0gaGFuZGxlcjsKKyAgICAgICAgICAgIG1DYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgICAgICAgbUFjdGl2aXR5ID0gYWN0aXZpdHk7CisgICAgICAgICAgICBtUmVzcG9uc2UgPSBuZXcgUmVzcG9uc2UoKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBmaW5hbCBBY2NvdW50TWFuYWdlckZ1dHVyZTxCdW5kbGU+IHN0YXJ0KCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBkb1dvcmsoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgc2V0RXhjZXB0aW9uKGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCBkb1dvcmsoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uOworCisgICAgICAgIHByaXZhdGUgQnVuZGxlIGludGVybmFsR2V0UmVzdWx0KExvbmcgdGltZW91dCwgVGltZVVuaXQgdW5pdCkKKyAgICAgICAgICAgICAgICB0aHJvd3MgT3BlcmF0aW9uQ2FuY2VsZWRFeGNlcHRpb24sIElPRXhjZXB0aW9uLCBBdXRoZW50aWNhdG9yRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGVuc3VyZU5vdE9uTWFpblRocmVhZCgpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAodGltZW91dCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXQoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0KHRpbWVvdXQsIHVuaXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKENhbmNlbGxhdGlvbkV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9wZXJhdGlvbkNhbmNlbGVkRXhjZXB0aW9uKCk7CisgICAgICAgICAgICB9IGNhdGNoIChUaW1lb3V0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggYW5kIGNhbmNlbAorICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaCBhbmQgY2FuY2VsCisgICAgICAgICAgICB9IGNhdGNoIChFeGVjdXRpb25FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIGZpbmFsIFRocm93YWJsZSBjYXVzZSA9IGUuZ2V0Q2F1c2UoKTsKKyAgICAgICAgICAgICAgICBpZiAoY2F1c2UgaW5zdGFuY2VvZiBJT0V4Y2VwdGlvbikgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyAoSU9FeGNlcHRpb24pIGNhdXNlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F1c2UgaW5zdGFuY2VvZiBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbikgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRvckV4Y2VwdGlvbihjYXVzZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXVzZSBpbnN0YW5jZW9mIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgKEF1dGhlbnRpY2F0b3JFeGNlcHRpb24pIGNhdXNlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F1c2UgaW5zdGFuY2VvZiBSdW50aW1lRXhjZXB0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IChSdW50aW1lRXhjZXB0aW9uKSBjYXVzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhdXNlIGluc3RhbmNlb2YgRXJyb3IpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgKEVycm9yKSBjYXVzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKGNhdXNlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGNhbmNlbCh0cnVlIC8qIGludGVycnVwdCBpZiBydW5uaW5nICovKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRocm93IG5ldyBPcGVyYXRpb25DYW5jZWxlZEV4Y2VwdGlvbigpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1bmRsZSBnZXRSZXN1bHQoKQorICAgICAgICAgICAgICAgIHRocm93cyBPcGVyYXRpb25DYW5jZWxlZEV4Y2VwdGlvbiwgSU9FeGNlcHRpb24sIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24geworICAgICAgICAgICAgcmV0dXJuIGludGVybmFsR2V0UmVzdWx0KG51bGwsIG51bGwpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1bmRsZSBnZXRSZXN1bHQobG9uZyB0aW1lb3V0LCBUaW1lVW5pdCB1bml0KQorICAgICAgICAgICAgICAgIHRocm93cyBPcGVyYXRpb25DYW5jZWxlZEV4Y2VwdGlvbiwgSU9FeGNlcHRpb24sIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24geworICAgICAgICAgICAgcmV0dXJuIGludGVybmFsR2V0UmVzdWx0KHRpbWVvdXQsIHVuaXQpOworICAgICAgICB9CisKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgZG9uZSgpIHsKKyAgICAgICAgICAgIGlmIChtQ2FsbGJhY2sgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHBvc3RUb0hhbmRsZXIobUhhbmRsZXIsIG1DYWxsYmFjaywgdGhpcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiogSGFuZGxlcyB0aGUgcmVzcG9uc2VzIGZyb20gdGhlIEFjY291bnRNYW5hZ2VyICovCisgICAgICAgIHByaXZhdGUgY2xhc3MgUmVzcG9uc2UgZXh0ZW5kcyBJQWNjb3VudE1hbmFnZXJSZXNwb25zZS5TdHViIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVzdWx0KEJ1bmRsZSBidW5kbGUpIHsKKyAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gYnVuZGxlLmdldFBhcmNlbGFibGUoImludGVudCIpOworICAgICAgICAgICAgICAgIGlmIChpbnRlbnQgIT0gbnVsbCAmJiBtQWN0aXZpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAvLyBzaW5jZSB0aGUgdXNlciBwcm92aWRlZCBhbiBBY3Rpdml0eSB3ZSB3aWxsIHNpbGVudGx5IHN0YXJ0IGludGVudHMKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhhdCB3ZSBzZWUKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5LnN0YXJ0QWN0aXZpdHkoaW50ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgLy8gbGVhdmUgdGhlIEZ1dHVyZSBydW5uaW5nIHRvIHdhaXQgZm9yIHRoZSByZWFsIHJlc3BvbnNlIHRvIHRoaXMgcmVxdWVzdAorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYnVuZGxlLmdldEJvb2xlYW4oInJldHJ5IikpIHsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvV29yaygpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyB3aWxsIG9ubHkgaGFwcGVuIGlmIHRoZSBzeXN0ZW0gcHJvY2VzcyBpcyBkZWFkLCB3aGljaCBtZWFucworICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugd2lsbCBiZSBkeWluZyBvdXJzZWx2ZXMKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNldChidW5kbGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHVibGljIHZvaWQgb25FcnJvcihpbnQgY29kZSwgU3RyaW5nIG1lc3NhZ2UpIHsKKyAgICAgICAgICAgICAgICBpZiAoY29kZSA9PSBDb25zdGFudHMuRVJST1JfQ09ERV9DQU5DRUxFRCkgeworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgYXV0aGVudGljYXRvciBpbmRpY2F0ZWQgdGhhdCB0aGlzIHJlcXVlc3Qgd2FzIGNhbmNlbGVkLCBkbyBzbyBub3cKKyAgICAgICAgICAgICAgICAgICAgY2FuY2VsKHRydWUgLyogbWF5SW50ZXJydXB0SWZSdW5uaW5nICovKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZXRFeGNlcHRpb24oY29udmVydEVycm9yVG9FeGNlcHRpb24oY29kZSwgbWVzc2FnZSkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICB9CisKKyAgICBwcml2YXRlIGFic3RyYWN0IGNsYXNzIEJhc2VGdXR1cmVUYXNrPFQ+IGV4dGVuZHMgRnV0dXJlVGFzazxUPiB7CisgICAgICAgIGZpbmFsIHB1YmxpYyBJQWNjb3VudE1hbmFnZXJSZXNwb25zZSBtUmVzcG9uc2U7CisgICAgICAgIGZpbmFsIEhhbmRsZXIgbUhhbmRsZXI7CisKKyAgICAgICAgcHVibGljIEJhc2VGdXR1cmVUYXNrKEhhbmRsZXIgaGFuZGxlcikgeworICAgICAgICAgICAgc3VwZXIobmV3IENhbGxhYmxlPFQ+KCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyBUIGNhbGwoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigidGhpcyBzaG91bGQgbmV2ZXIgYmUgY2FsbGVkIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBtSGFuZGxlciA9IGhhbmRsZXI7CisgICAgICAgICAgICBtUmVzcG9uc2UgPSBuZXcgUmVzcG9uc2UoKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIGRvV29yaygpIHRocm93cyBSZW1vdGVFeGNlcHRpb247CisKKyAgICAgICAgcHVibGljIGFic3RyYWN0IFQgYnVuZGxlVG9SZXN1bHQoQnVuZGxlIGJ1bmRsZSkgdGhyb3dzIEF1dGhlbnRpY2F0b3JFeGNlcHRpb247CisKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgcG9zdFJ1bm5hYmxlVG9IYW5kbGVyKFJ1bm5hYmxlIHJ1bm5hYmxlKSB7CisgICAgICAgICAgICBIYW5kbGVyIGhhbmRsZXIgPSAobUhhbmRsZXIgPT0gbnVsbCkgPyBtTWFpbkhhbmRsZXIgOiBtSGFuZGxlcjsKKyAgICAgICAgICAgIGhhbmRsZXIucG9zdChydW5uYWJsZSk7CisgICAgICAgIH0KKworICAgICAgICBwcm90ZWN0ZWQgdm9pZCBzdGFydFRhc2soKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGRvV29yaygpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBzZXRFeGNlcHRpb24oZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcm90ZWN0ZWQgY2xhc3MgUmVzcG9uc2UgZXh0ZW5kcyBJQWNjb3VudE1hbmFnZXJSZXNwb25zZS5TdHViIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVzdWx0KEJ1bmRsZSBidW5kbGUpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBUIHJlc3VsdCA9IGJ1bmRsZVRvUmVzdWx0KGJ1bmRsZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNldChyZXN1bHQpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NDYXN0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gd2Ugd2lsbCBzZXQgdGhlIGV4Y2VwdGlvbiBiZWxvdworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEF1dGhlbnRpY2F0b3JFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAvLyB3ZSB3aWxsIHNldCB0aGUgZXhjZXB0aW9uIGJlbG93CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfSU5WQUxJRF9SRVNQT05TRSwgIm5vIHJlc3VsdCBpbiByZXNwb25zZSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkVycm9yKGludCBjb2RlLCBTdHJpbmcgbWVzc2FnZSkgeworICAgICAgICAgICAgICAgIGlmIChjb2RlID09IENvbnN0YW50cy5FUlJPUl9DT0RFX0NBTkNFTEVEKSB7CisgICAgICAgICAgICAgICAgICAgIGNhbmNlbCh0cnVlIC8qIG1heUludGVycnVwdElmUnVubmluZyAqLyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2V0RXhjZXB0aW9uKGNvbnZlcnRFcnJvclRvRXhjZXB0aW9uKGNvZGUsIG1lc3NhZ2UpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgYWJzdHJhY3QgY2xhc3MgRnV0dXJlMlRhc2s8VD4KKyAgICAgICAgICAgIGV4dGVuZHMgQmFzZUZ1dHVyZVRhc2s8VD4gaW1wbGVtZW50cyBBY2NvdW50TWFuYWdlckZ1dHVyZTxUPiB7CisgICAgICAgIGZpbmFsIEFjY291bnRNYW5hZ2VyQ2FsbGJhY2s8VD4gbUNhbGxiYWNrOworICAgICAgICBwdWJsaWMgRnV0dXJlMlRhc2soSGFuZGxlciBoYW5kbGVyLCBBY2NvdW50TWFuYWdlckNhbGxiYWNrPFQ+IGNhbGxiYWNrKSB7CisgICAgICAgICAgICBzdXBlcihoYW5kbGVyKTsKKyAgICAgICAgICAgIG1DYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgICB9CisKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgZG9uZSgpIHsKKyAgICAgICAgICAgIGlmIChtQ2FsbGJhY2sgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHBvc3RSdW5uYWJsZVRvSGFuZGxlcihuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DYWxsYmFjay5ydW4oRnV0dXJlMlRhc2sudGhpcyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBGdXR1cmUyVGFzazxUPiBzdGFydCgpIHsKKyAgICAgICAgICAgIHN0YXJ0VGFzaygpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIFQgaW50ZXJuYWxHZXRSZXN1bHQoTG9uZyB0aW1lb3V0LCBUaW1lVW5pdCB1bml0KQorICAgICAgICAgICAgICAgIHRocm93cyBPcGVyYXRpb25DYW5jZWxlZEV4Y2VwdGlvbiwgSU9FeGNlcHRpb24sIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24geworICAgICAgICAgICAgZW5zdXJlTm90T25NYWluVGhyZWFkKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmICh0aW1lb3V0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldCgpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXQodGltZW91dCwgdW5pdCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaCBhbmQgY2FuY2VsCisgICAgICAgICAgICB9IGNhdGNoIChUaW1lb3V0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggYW5kIGNhbmNlbAorICAgICAgICAgICAgfSBjYXRjaCAoQ2FuY2VsbGF0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggYW5kIGNhbmNlbAorICAgICAgICAgICAgfSBjYXRjaCAoRXhlY3V0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBUaHJvd2FibGUgY2F1c2UgPSBlLmdldENhdXNlKCk7CisgICAgICAgICAgICAgICAgaWYgKGNhdXNlIGluc3RhbmNlb2YgSU9FeGNlcHRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgKElPRXhjZXB0aW9uKSBjYXVzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhdXNlIGluc3RhbmNlb2YgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0b3JFeGNlcHRpb24oY2F1c2UpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F1c2UgaW5zdGFuY2VvZiBBdXRoZW50aWNhdG9yRXhjZXB0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IChBdXRoZW50aWNhdG9yRXhjZXB0aW9uKSBjYXVzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhdXNlIGluc3RhbmNlb2YgUnVudGltZUV4Y2VwdGlvbikgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyAoUnVudGltZUV4Y2VwdGlvbikgY2F1c2U7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXVzZSBpbnN0YW5jZW9mIEVycm9yKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IChFcnJvcikgY2F1c2U7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbihjYXVzZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBjYW5jZWwodHJ1ZSAvKiBpbnRlcnJ1cHQgaWYgcnVubmluZyAqLyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0aHJvdyBuZXcgT3BlcmF0aW9uQ2FuY2VsZWRFeGNlcHRpb24oKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBUIGdldFJlc3VsdCgpCisgICAgICAgICAgICAgICAgdGhyb3dzIE9wZXJhdGlvbkNhbmNlbGVkRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbiwgQXV0aGVudGljYXRvckV4Y2VwdGlvbiB7CisgICAgICAgICAgICByZXR1cm4gaW50ZXJuYWxHZXRSZXN1bHQobnVsbCwgbnVsbCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgVCBnZXRSZXN1bHQobG9uZyB0aW1lb3V0LCBUaW1lVW5pdCB1bml0KQorICAgICAgICAgICAgICAgIHRocm93cyBPcGVyYXRpb25DYW5jZWxlZEV4Y2VwdGlvbiwgSU9FeGNlcHRpb24sIEF1dGhlbnRpY2F0b3JFeGNlcHRpb24geworICAgICAgICAgICAgcmV0dXJuIGludGVybmFsR2V0UmVzdWx0KHRpbWVvdXQsIHVuaXQpOworICAgICAgICB9CisKKyAgICB9CisKKyAgICBwcml2YXRlIEV4Y2VwdGlvbiBjb252ZXJ0RXJyb3JUb0V4Y2VwdGlvbihpbnQgY29kZSwgU3RyaW5nIG1lc3NhZ2UpIHsKKyAgICAgICAgaWYgKGNvZGUgPT0gQ29uc3RhbnRzLkVSUk9SX0NPREVfTkVUV09SS19FUlJPUikgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBJT0V4Y2VwdGlvbihtZXNzYWdlKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjb2RlID09IENvbnN0YW50cy5FUlJPUl9DT0RFX1VOU1VQUE9SVEVEX09QRVJBVElPTikgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbihtZXNzYWdlKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjb2RlID09IENvbnN0YW50cy5FUlJPUl9DT0RFX0lOVkFMSURfUkVTUE9OU0UpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgQXV0aGVudGljYXRvckV4Y2VwdGlvbihtZXNzYWdlKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjb2RlID09IENvbnN0YW50cy5FUlJPUl9DT0RFX0JBRF9BUkdVTUVOVFMpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKG1lc3NhZ2UpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG5ldyBBdXRoZW50aWNhdG9yRXhjZXB0aW9uKG1lc3NhZ2UpOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgR2V0QXV0aFRva2VuQnlUeXBlQW5kRmVhdHVyZXNUYXNrCisgICAgICAgICAgICBleHRlbmRzIEFtc1Rhc2sgaW1wbGVtZW50cyBBY2NvdW50TWFuYWdlckNhbGxiYWNrPEJ1bmRsZT4geworICAgICAgICBHZXRBdXRoVG9rZW5CeVR5cGVBbmRGZWF0dXJlc1Rhc2soZmluYWwgU3RyaW5nIGFjY291bnRUeXBlLCBmaW5hbCBTdHJpbmcgYXV0aFRva2VuVHlwZSwKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmdbXSBmZWF0dXJlcywgQWN0aXZpdHkgYWN0aXZpdHlGb3JQcm9tcHRpbmcsCisgICAgICAgICAgICAgICAgZmluYWwgQnVuZGxlIGFkZEFjY291bnRPcHRpb25zLCBmaW5hbCBCdW5kbGUgbG9naW5PcHRpb25zLAorICAgICAgICAgICAgICAgIEFjY291bnRNYW5hZ2VyQ2FsbGJhY2s8QnVuZGxlPiBjYWxsYmFjaywgSGFuZGxlciBoYW5kbGVyKSB7CisgICAgICAgICAgICBzdXBlcihhY3Rpdml0eUZvclByb21wdGluZywgaGFuZGxlciwgY2FsbGJhY2spOworICAgICAgICAgICAgaWYgKGFjY291bnRUeXBlID09IG51bGwpIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImFjY291bnQgdHlwZSBpcyBudWxsIik7CisgICAgICAgICAgICBtQWNjb3VudFR5cGUgPSBhY2NvdW50VHlwZTsKKyAgICAgICAgICAgIG1BdXRoVG9rZW5UeXBlID0gYXV0aFRva2VuVHlwZTsKKyAgICAgICAgICAgIG1GZWF0dXJlcyA9IGZlYXR1cmVzOworICAgICAgICAgICAgbUFkZEFjY291bnRPcHRpb25zID0gYWRkQWNjb3VudE9wdGlvbnM7CisgICAgICAgICAgICBtTG9naW5PcHRpb25zID0gbG9naW5PcHRpb25zOworICAgICAgICAgICAgbU15Q2FsbGJhY2sgPSB0aGlzOworICAgICAgICB9CisgICAgICAgIHZvbGF0aWxlIEFjY291bnRNYW5hZ2VyRnV0dXJlPEJ1bmRsZT4gbUZ1dHVyZSA9IG51bGw7CisgICAgICAgIGZpbmFsIFN0cmluZyBtQWNjb3VudFR5cGU7CisgICAgICAgIGZpbmFsIFN0cmluZyBtQXV0aFRva2VuVHlwZTsKKyAgICAgICAgZmluYWwgU3RyaW5nW10gbUZlYXR1cmVzOworICAgICAgICBmaW5hbCBCdW5kbGUgbUFkZEFjY291bnRPcHRpb25zOworICAgICAgICBmaW5hbCBCdW5kbGUgbUxvZ2luT3B0aW9uczsKKyAgICAgICAgZmluYWwgQWNjb3VudE1hbmFnZXJDYWxsYmFjazxCdW5kbGU+IG1NeUNhbGxiYWNrOworCisgICAgICAgIHB1YmxpYyB2b2lkIGRvV29yaygpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgZ2V0QWNjb3VudHNCeVR5cGVBbmRGZWF0dXJlcyhtQWNjb3VudFR5cGUsIG1GZWF0dXJlcywKKyAgICAgICAgICAgICAgICAgICAgbmV3IEFjY291bnRNYW5hZ2VyQ2FsbGJhY2s8QWNjb3VudFtdPigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bihBY2NvdW50TWFuYWdlckZ1dHVyZTxBY2NvdW50W10+IGZ1dHVyZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFjY291bnRbXSBhY2NvdW50czsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50cyA9IGZ1dHVyZS5nZXRSZXN1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChPcGVyYXRpb25DYW5jZWxlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEV4Y2VwdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RXhjZXB0aW9uKGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoQXV0aGVudGljYXRvckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEV4Y2VwdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhY2NvdW50cy5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2aXR5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vIGFjY291bnRzLCBhZGQgb25lIG5vdy4gcHJldGVuZCB0aGF0IHRoZSB1c2VyIGRpcmVjdGx5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtYWRlIHRoaXMgcmVxdWVzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZ1dHVyZSA9IGFkZEFjY291bnQobUFjY291bnRUeXBlLCBtQXV0aFRva2VuVHlwZSwgbUZlYXR1cmVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQWRkQWNjb3VudE9wdGlvbnMsIG1BY3Rpdml0eSwgbU15Q2FsbGJhY2ssIG1IYW5kbGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlbmQgcmVzdWx0IHNpbmNlIHdlIGNhbid0IHByb21wdCB0byBhZGQgYW4gYWNjb3VudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQnVuZGxlIHJlc3VsdCA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXRTdHJpbmcoQ29uc3RhbnRzLkFDQ09VTlRfTkFNRV9LRVksIG51bGwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1dFN0cmluZyhDb25zdGFudHMuQUNDT1VOVF9UWVBFX0tFWSwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHV0U3RyaW5nKENvbnN0YW50cy5BVVRIVE9LRU5fS0VZLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJlc3BvbnNlLm9uUmVzdWx0KHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgd2lsbCBuZXZlciBoYXBwZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGFyZSBkb25lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjY291bnRzLmxlbmd0aCA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGhhdmUgYSBzaW5nbGUgYWNjb3VudCwgcmV0dXJuIGFuIGF1dGh0b2tlbiBmb3IgaXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1BY3Rpdml0eSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRnV0dXJlID0gZ2V0QXV0aFRva2VuKGFjY291bnRzWzBdLCBtQXV0aFRva2VuVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UgLyogbm90aWZ5QXV0aEZhaWx1cmUgKi8sIG1NeUNhbGxiYWNrLCBtSGFuZGxlcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRnV0dXJlID0gZ2V0QXV0aFRva2VuKGFjY291bnRzWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXV0aFRva2VuVHlwZSwgbUxvZ2luT3B0aW9ucywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5LCBtTXlDYWxsYmFjaywgbUhhbmRsZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1BY3Rpdml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJQWNjb3VudE1hbmFnZXJSZXNwb25zZSBjaG9vc2VSZXNwb25zZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBJQWNjb3VudE1hbmFnZXJSZXNwb25zZS5TdHViKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVzdWx0KEJ1bmRsZSB2YWx1ZSkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFjY291bnQgYWNjb3VudCA9IG5ldyBBY2NvdW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLmdldFN0cmluZyhDb25zdGFudHMuQUNDT1VOVF9OQU1FX0tFWSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUuZ2V0U3RyaW5nKENvbnN0YW50cy5BQ0NPVU5UX1RZUEVfS0VZKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GdXR1cmUgPSBnZXRBdXRoVG9rZW4oYWNjb3VudCwgbUF1dGhUb2tlblR5cGUsIG1Mb2dpbk9wdGlvbnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5LCBtTXlDYWxsYmFjaywgbUhhbmRsZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uRXJyb3IoaW50IGVycm9yQ29kZSwgU3RyaW5nIGVycm9yTWVzc2FnZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVzcG9uc2Uub25FcnJvcihlcnJvckNvZGUsIGVycm9yTWVzc2FnZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGhhdmUgbWFueSBhY2NvdW50cywgbGF1bmNoIHRoZSBjaG9vc2VyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldENsYXNzTmFtZSgiYW5kcm9pZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJhbmRyb2lkLmFjY291bnRzLkNob29zZUFjY291bnRBY3Rpdml0eSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbnN0YW50cy5BQ0NPVU5UU19LRVksIGFjY291bnRzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShDb25zdGFudHMuQUNDT1VOVF9NQU5BR0VSX1JFU1BPTlNFX0tFWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFjY291bnRNYW5hZ2VyUmVzcG9uc2UoY2hvb3NlUmVzcG9uc2UpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5zdGFydEFjdGl2aXR5KGludGVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcmVzdWx0IHdpbGwgYXJyaXZlIHZpYSB0aGUgSUFjY291bnRNYW5hZ2VyUmVzcG9uc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlbmQgcmVzdWx0IHNpbmNlIHdlIGNhbid0IHByb21wdCB0byBzZWxlY3QgYW4gYWNjb3VudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQnVuZGxlIHJlc3VsdCA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXRTdHJpbmcoQ29uc3RhbnRzLkFDQ09VTlRTX0tFWSwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1SZXNwb25zZS5vblJlc3VsdChyZXN1bHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIHdpbGwgbmV2ZXIgaGFwcGVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBhcmUgZG9uZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfX0sIG1IYW5kbGVyKTsKKyAgICAgICAgfQorCisKKworICAgICAgICAvLyBUT0RPKGZyZWRxKSBwYXNzIHRocm91Z2ggdGhlIGNhbGxzIHRvIG91ciBpbXBsZW1lbnRpb24gb2YgRnV0dXJlMiB0byB0aGUgdW5kZXJseWluZworICAgICAgICAvLyBmdXR1cmUgdGhhdCB3ZSBjcmVhdGUuIFdlIG5lZWQgdG8gZG8gdGhpbmdzIGxpa2UgaGF2ZSBjYW5jZWwgY2FuY2VsIHRoZSBtRnV0dXJlLCBpZiBzZXQKKyAgICAgICAgLy8gb3IgdG8gY2F1c2UgdGhpcyB0byBiZSBjYW5jZWxlZCBpZiBtRnV0dXJlIGlzbid0IHNldC4KKyAgICAgICAgLy8gT25jZSB0aGlzIGlzIGRvbmUgdGhlbiBnZXRBdXRoVG9rZW5CeUZlYXR1cmVzIGNhbiBiZSBjaGFuZ2VkIHRvIHJldHVybiBhIEZ1dHVyZTIuCisKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKEFjY291bnRNYW5hZ2VyRnV0dXJlPEJ1bmRsZT4gZnV0dXJlKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHNldChmdXR1cmUuZ2V0KCkpOworICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIGNhbmNlbCh0cnVlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKENhbmNlbGxhdGlvbkV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgY2FuY2VsKHRydWUpOworICA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FzIGFscmVhZHkgYWRkZWQKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBhZGRPbkFjY291bnRzVXBkYXRlZExpc3RlbmVyKGZpbmFsIE9uQWNjb3VudHNVcGRhdGVkTGlzdGVuZXIgbGlzdGVuZXIsCisgICAgICAgICAgICBIYW5kbGVyIGhhbmRsZXIsIGJvb2xlYW4gdXBkYXRlSW1tZWRpYXRlbHkpIHsKKyAgICAgICAgaWYgKGxpc3RlbmVyID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInRoZSBsaXN0ZW5lciBpcyBudWxsIik7CisgICAgICAgIH0KKyAgICAgICAgc3luY2hyb25pemVkIChtQWNjb3VudHNVcGRhdGVkTGlzdGVuZXJzKSB7CisgICAgICAgICAgICBpZiAobUFjY291bnRzVXBkYXRlZExpc3RlbmVycy5jb250YWluc0tleShsaXN0ZW5lcikpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJ0aGlzIGxpc3RlbmVyIGlzIGFscmVhZHkgYWRkZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gd2FzRW1wdHkgPSBtQWNjb3VudHNVcGRhdGVkTGlzdGVuZXJzLmlzRW1wdHkoKTsKKworICAgICAgICAgICAgbUFjY291bnRzVXBkYXRlZExpc3RlbmVycy5wdXQobGlzdGVuZXIsIGhhbmRsZXIpOworCisgICAgICAgICAgICBpZiAod2FzRW1wdHkpIHsKKyAgICAgICAgICAgICAgICAvLyBSZWdpc3RlciBhIGJyb2FkY2FzdCByZWNlaXZlciB0byBtb25pdG9yIGFjY291bnQgY2hhbmdlcworICAgICAgICAgICAgICAgIEludGVudEZpbHRlciBpbnRlbnRGaWx0ZXIgPSBuZXcgSW50ZW50RmlsdGVyKCk7CisgICAgICAgICAgICAgICAgaW50ZW50RmlsdGVyLm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Tik7CisgICAgICAgIEFDQ09VTlRTX0NIQU5HRURfSU5URU5ULnNldEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWV9CRUZPUkVfQk9PVCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBzaG91bGQgb25seSBiZSBjYWxsZWQgYnkgc3lzdGVtIGNvZGUuIE9uZSBzaG91bGQgb25seSBjYWxsIHRoaXMgYWZ0ZXIgdGhlIHNlcnZpY2UKKyAgICAgKiBoYXMgc3RhcnRlZC4KKyAgICAgKiBAcmV0dXJuIGEgcmVmZXJlbmNlIHRvIHRoZSBBY2NvdW50TWFuYWdlclNlcnZpY2UgaW5zdGFuY2UKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgQWNjb3VudE1hbmFnZXJTZXJ2aWNlIGdldFNpbmdsZXRvbigpIHsKKyAgICAgICAgcmV0dXJuIHNUaGlzLmdldCgpOworICAgIH0KKworICAgIHB1YmxpYyBjbGFzcyBBdXRoVG9rZW5LZXkgeworICAgICAgICBwdWJsaWMgZmluYWwgQWNjb3VudCBtQWNjb3VudDsKKyAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBtQXV0aFRva2VuVHlwZTsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBpbnQgbUhhc2hDb2RlOworCisgICAgICAgIHB1YmxpYyBBdXRoVG9rZW5LZXkoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgYXV0aFRva2VuVHlwZSkgeworICAgICAgICAgICAgbUFjY291bnQgPSBhY2NvdW50OworICAgICAgICAgICAgbUF1dGhUb2tlblR5cGUgPSBhdXRoVG9rZW5UeXBlOworICAgICAgICAgICAgbUhhc2hDb2RlID0gY29tcHV0ZUhhc2hDb2RlKCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG8pIHsKKyAgICAgICAgICAgIGlmIChvID09IHRoaXMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghKG8gaW5zdGFuY2VvZiBBdXRoVG9rZW5LZXkpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQXV0aFRva2VuS2V5IG90aGVyID0gKEF1dGhUb2tlbktleSlvOworICAgICAgICAgICAgaWYgKCFtQWNjb3VudC5lcXVhbHMob3RoZXIubUFjY291bnQpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIChtQXV0aFRva2VuVHlwZSA9PSBudWxsKQorICAgICAgICAgICAgICAgICAgICA/IG90aGVyLm1BdXRoVG9rZW5UeXBlID09IG51bGwKKyAgICAgICAgICAgICAgICAgICAgOiBtQXV0aFRva2VuVHlwZS5lcXVhbHMob3RoZXIubUF1dGhUb2tlblR5cGUpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBpbnQgY29tcHV0ZUhhc2hDb2RlKCkgeworICAgICAgICAgICAgaW50IHJlc3VsdCA9IDE3OworICAgICAgICAgICAgcmVzdWx0ID0gMzEgKiByZXN1bHQgKyBtQWNjb3VudC5oYXNoQ29kZSgpOworICAgICAgICAgICAgcmVzdWx0ID0gMzEgKiByZXN1bHQgKyAoKG1BdXRoVG9rZW5UeXBlID09IG51bGwpID8gMCA6IG1BdXRoVG9rZW5UeXBlLmhhc2hDb2RlKCkpOworICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBpbnQgaGFzaENvZGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbUhhc2hDb2RlOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIEFjY291bnRNYW5hZ2VyU2VydmljZShDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworCisgICAgICAgIG1PcGVuSGVscGVyID0gbmV3IERhdGFiYXNlSGVscGVyKG1Db250ZXh0KTsKKworICAgICAgICBtTWVzc2FnZVRocmVhZCA9IG5ldyBIYW5kbGVyVGhyZWFkKCJBY2NvdW50TWFuYWdlclNlcnZpY2UiKTsKKyAgICAgICAgbU1lc3NhZ2VUaHJlYWQuc3RhcnQoKTsKKyAgICAgICAgbU1lc3NhZ2VIYW5kbGVyID0gbmV3IE1lc3NhZ2VIYW5kbGVyKG1NZXNzYWdlVGhyZWFkLmdldExvb3BlcigpKTsKKworICAgICAgICBtQXV0aGVudGljYXRvckNhY2hlID0gbmV3IEFjY291bnRBdXRoZW50aWNhdG9yQ2FjaGUobUNvbnRleHQpOworICAgICAgICBtQmluZEhlbHBlciA9IG5ldyBBdXRoZW50aWNhdG9yQmluZEhlbHBlcihtQ29udGV4dCwgbUF1dGhlbnRpY2F0b3JDYWNoZSwgbU1lc3NhZ2VIYW5kbGVyLAorICAgICAgICAgICAgICAgIE1FU1NBR0VfQ09OTkVDVEVELCBNRVNTQUdFX0RJU0NPTk5FQ1RFRCk7CisKKyAgICAgICAgbVNpbVdhdGNoZXIgPSBuZXcgU2ltV2F0Y2hlcihtQ29udGV4dCk7CisgICAgICAgIHNUaGlzLnNldCh0aGlzKTsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIGdldFBhc3N3b3JkKEFjY291bnQgYWNjb3VudCkgeworICAgICAgICBjaGVja0F1dGhlbnRpY2F0ZUFjY291bnRzUGVybWlzc2lvbihhY2NvdW50KTsKKworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIHJlYWRQYXNzd29yZEZyb21EYXRhYmFzZShhY2NvdW50KTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIFN0cmluZyByZWFkUGFzc3dvcmRGcm9tRGF0YWJhc2UoQWNjb3VudCBhY2NvdW50KSB7CisgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiID0gbU9wZW5IZWxwZXIuZ2V0UmVhZGFibGVEYXRhYmFzZSgpOworICAgICAgICBDdXJzb3IgY3Vyc29yID0gZGIucXVlcnkoVEFCTEVfQUNDT1VOVFMsIG5ldyBTdHJpbmdbXXtBQ0NPVU5UU19QQVNTV09SRH0sCisgICAgICAgICAgICAgICAgQUNDT1VOVFNfTkFNRSArICI9PyBBTkQgIiArIEFDQ09VTlRTX1RZUEUrICI9PyIsCisgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tde2FjY291bnQubmFtZSwgYWNjb3VudC50eXBlfSwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoY3Vyc29yLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBjdXJzb3IuZ2V0U3RyaW5nKDApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmcgZ2V0VXNlckRhdGEoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcga2V5KSB7CisgICAgICAgIGNoZWNrQXV0aGVudGljYXRlQWNjb3VudHNQZXJtaXNzaW9uKGFjY291bnQpOworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIHJlYWRVc2VyRGF0YUZyb21EYXRhYmFzZShhY2NvdW50LCBrZXkpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIHJlYWRVc2VyRGF0YUZyb21EYXRhYmFzZShBY2NvdW50IGFjY291bnQsIFN0cmluZyBrZXkpIHsKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBtT3BlbkhlbHBlci5nZXRSZWFkYWJsZURhdGFiYXNlKCk7CisgICAgICAgIGRiLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGxvbmcgYWNjb3VudElkID0gZ2V0QWNjb3VudElkKGRiLCBhY2NvdW50KTsKKyAgICAgICAgICAgIGlmIChhY2NvdW50SWQgPCAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBDdXJzb3IgY3Vyc29yID0gZGIucXVlcnkoVEFCTEVfRVhUUkFTLCBuZXcgU3RyaW5nW117RVhUUkFTX1ZBTFVFfSwKKyAgICAgICAgICAgICAgICAgICAgRVhUUkFTX0FDQ09VTlRTX0lEICsgIj0iICsgYWNjb3VudElkICsgIiBBTkQgIiArIEVYVFJBU19LRVkgKyAiPT8iLAorICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW117a2V5fSwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmIChjdXJzb3IubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJzb3IuZ2V0U3RyaW5nKDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgY3Vyc29yLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBkYi5lbmRUcmFuc2FjdGlvbigpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvbltdIGdldEF1dGhlbnRpY2F0b3JUeXBlcygpIHsKKyAgICAgICAgbG9uZyBpZGVudGl0eVRva2VuID0gY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIENvbGxlY3Rpb248QWNjb3VudEF1dGhlbnRpY2F0b3JDYWNoZS5TZXJ2aWNlSW5mbzxBdXRoZW50aWNhdG9yRGVzY3JpcHRpb24+PgorICAgICAgICAgICAgICAgICAgICBhdXRoZW50aWNhdG9yQ29sbGVjdGlvbiA9IG1BdXRoZW50aWNhdG9yQ2FjaGUuZ2V0QWxsU2VydmljZXMoKTsKKyAgICAgICAgICAgIEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvbltdIHR5cGVzID0KKyAgICAgICAgICAgICAgICAgICAgbmV3IEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvblthdXRoZW50aWNhdG9yQ29sbGVjdGlvbi5zaXplKCldOworICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgZm9yIChBY2NvdW50QXV0aGVudGljYXRvckNhY2hlLlNlcnZpY2VJbmZvPEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvbj4gYXV0aGVudGljYXRvcgorICAgICAgICAgICAgICAgICAgICA6IGF1dGhlbnRpY2F0b3JDb2xsZWN0aW9uKSB7CisgICAgICAgICAgICAgICAgdHlwZXNbaV0gPSBhdXRoZW50aWNhdG9yLnR5cGU7CisgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHR5cGVzOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBBY2NvdW50W10gZ2V0QWNjb3VudHNCeVR5cGUoU3RyaW5nIGFjY291bnRUeXBlKSB7CisgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiID0gbU9wZW5IZWxwZXIuZ2V0UmVhZGFibGVEYXRhYmFzZSgpOworCisgICAgICAgIGZpbmFsIFN0cmluZyBzZWxlY3Rpb24gPSBhY2NvdW50VHlwZSA9PSBudWxsID8gbnVsbCA6IChBQ0NPVU5UU19UWVBFICsgIj0/Iik7CisgICAgICAgIGZpbmFsIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MgPSBhY2NvdW50VHlwZSA9PSBudWxsID8gbnVsbCA6IG5ldyBTdHJpbmdbXXthY2NvdW50VHlwZX07CisgICAgICAgIEN1cnNvciBjdXJzb3IgPSBkYi5xdWVyeShUQUJMRV9BQ0NPVU5UUywgQUNDT1VOVF9OQU1FX1RZUEVfUFJPSkVDVElPTiwKKyAgICAgICAgICAgICAgICBzZWxlY3Rpb24sIHNlbGVjdGlvbkFyZ3MsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgQWNjb3VudFtdIGFjY291bnRzID0gbmV3IEFjY291bnRbY3Vyc29yLmdldENvdW50KCldOworICAgICAgICAgICAgd2hpbGUgKGN1cnNvci5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICBhY2NvdW50c1tpXSA9IG5ldyBBY2NvdW50KGN1cnNvci5nZXRTdHJpbmcoMSksIGN1cnNvci5nZXRTdHJpbmcoMikpOworICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBhY2NvdW50czsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gYWRkQWNjb3VudChBY2NvdW50IGFjY291bnQsIFN0cmluZyBwYXNzd29yZCwgQnVuZGxlIGV4dHJhcykgeworICAgICAgICBjaGVja0F1dGhlbnRpY2F0ZUFjY291bnRzUGVybWlzc2lvbihhY2NvdW50KTsKKworICAgICAgICAvLyBmYWlscyBpZiB0aGUgYWNjb3VudCBhbHJlYWR5IGV4aXN0cworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIGluc2VydEFjY291bnRJbnRvRGF0YWJhc2UoYWNjb3VudCwgcGFzc3dvcmQsIGV4dHJhcyk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGluc2VydEFjY291bnRJbnRvRGF0YWJhc2UoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgcGFzc3dvcmQsIEJ1bmRsZSBleHRyYXMpIHsKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBtT3BlbkhlbHBlci5nZXRXcml0YWJsZURhdGFiYXNlKCk7CisgICAgICAgIGRiLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGxvbmcgbnVtTWF0Y2hlcyA9IERhdGFiYXNlVXRpbHMubG9uZ0ZvclF1ZXJ5KGRiLAorICAgICAgICAgICAgICAgICAgICAic2VsZWN0IGNvdW50KCopIGZyb20gIiArIFRBQkxFX0FDQ09VTlRTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIFdIRVJFICIgKyBBQ0NPVU5UU19OQU1FICsgIj0/IEFORCAiICsgQUNDT1VOVFNfVFlQRSsgIj0/IiwKKyAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tde2FjY291bnQubmFtZSwgYWNjb3VudC50eXBlfSk7CisgICAgICAgICAgICBpZiAobnVtTWF0Y2hlcyA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KEFDQ09VTlRTX05BTUUsIGFjY291bnQubmFtZSk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KEFDQ09VTlRTX1RZUEUsIGFjY291bnQudHlwZSk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KEFDQ09VTlRTX1BBU1NXT1JELCBwYXNzd29yZCk7CisgICAgICAgICAgICBsb25nIGFjY291bnRJZCA9IGRiLmluc2VydChUQUJMRV9BQ0NPVU5UUywgQUNDT1VOVFNfTkFNRSwgdmFsdWVzKTsKKyAgICAgICAgICAgIGlmIChhY2NvdW50SWQgPCAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGV4dHJhcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZm9yIChTdHJpbmcga2V5IDogZXh0cmFzLmtleVNldCgpKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyB2YWx1ZSA9IGV4dHJhcy5nZXRTdHJpbmcoa2V5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluc2VydEV4dHJhKGRiLCBhY2NvdW50SWQsIGtleSwgdmFsdWUpIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICBzZW5kQWNjb3VudHNDaGFuZ2VkQ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jb3VudFNlc3Npb24gZXh0ZW5kcyBTZXNzaW9uIHsKKyAgICAgICAgZmluYWwgQWNjb3VudCBtQWNjb3VudDsKKyAgICAgICAgcHVibGljIFJlbW92ZUFjY291bnRTZXNzaW9uKElBY2NvdW50TWFuYWdlclJlc3BvbnNlIHJlc3BvbnNlLCBBY2NvdW50IGFjY291bnQpIHsKKyAgICAgICAgICAgIHN1cGVyKHJlc3BvbnNlLCBhY2NvdW50LnR5cGUsIGZhbHNlIC8qIGV4cGVjdEFjdGl2aXR5TGF1bmNoICovKTsKKyAgICAgICAgICAgIG1BY2NvdW50ID0gYWNjb3VudDsKKyAgICAgICAgfQorCisgICAgICAgIHByb3RlY3RlZCBTdHJpbmcgdG9EZWJ1Z1N0cmluZyhsb25nIG5vdykgeworICAgICAgICAgICAgcmV0dXJuIHN1cGVyLnRvRGVidWdTdHJpbmcobm93KSArICIsIHJlbW92ZUFjY291bnQiCisgICAgICAgICAgICAgICAgICAgICsgIiwgYWNjb3VudCAiICsgbUFjY291bnQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIG1BdXRoZW50aWNhdG9yLmdldEFjY291bnRSZW1vdmFsQWxsb3dlZCh0aGlzLCBtQWNjb3VudCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblJlc3VsdChCdW5kbGUgcmVzdWx0KSB7CisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IG51bGwgJiYgcmVzdWx0LmNvbnRhaW5zS2V5KENvbnN0YW50cy5CT09MRUFOX1JFU1VMVF9LRVkpCisgICAgICAgICAgICAgICAgICAgICYmICFyZXN1bHQuY29udGFpbnNLZXkoQ29uc3RhbnRzLklOVEVOVF9LRVkpKSB7CisgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZW1vdmFsQWxsb3dlZCA9IHJlc3VsdC5nZXRCb29sZWFuKENvbnN0YW50cy5CT09MRUFOX1JFU1VMVF9LRVkpOworICAgICAgICAgICAgICAgIGlmIChyZW1vdmFsQWxsb3dlZCkgeworICAgICAgICAgICAgICAgICAgICByZW1vdmVBY2NvdW50KG1BY2NvdW50KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgSUFjY291bnRNYW5hZ2VyUmVzcG9uc2UgcmVzcG9uc2UgPSBnZXRSZXNwb25zZUFuZENsb3NlKCk7CisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgQnVuZGxlIHJlc3VsdDIgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdDIucHV0Qm9vbGVhbihDb25zdGFudHMuQk9PTEVBTl9SRVNVTFRfS0VZLCByZW1vdmFsQWxsb3dlZCk7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZS5vblJlc3VsdChyZXN1bHQyKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlnbm9yZQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgc3VwZXIub25SZXN1bHQocmVzdWx0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZW1vdmVBY2NvdW50KEFjY291bnQgYWNjb3VudCkgeworICAgICAgICBmaW5hbCBTUUxpdGVEYXRhYmFzZSBkYiA9IG1PcGVuSGVscGVyLmdldFdyaXRhYmxlRGF0YWJhc2UoKTsKKyAgICAgICAgZGIuZGVsZXRlKFRBQkxFX0FDQ09VTlRTLCBBQ0NPVU5UU19OQU1FICsgIj0/IEFORCAiICsgQUNDT1VOVFNfVFlQRSsgIj0/IiwKKyAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW117YWNjb3VudC5uYW1lLCBhY2NvdW50LnR5cGV9KTsKKyAgICAgICAgc2VuZEFjY291bnRzQ2hhbmdlZEJyb2FkY2FzdCgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGludmFsaWRhdGVBdXRoVG9rZW4oU3RyaW5nIGFjY291bnRUeXBlLCBTdHJpbmcgYXV0aFRva2VuKSB7CisgICAgICAgIGNoZWNrTWFuYWdlQWNjb3VudHNQZXJtaXNzaW9uKCk7CisgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBTUUxpdGVEYXRhYmFzZSBkYiA9IG1PcGVuSGVscGVyLmdldFdyaXRhYmxlRGF0YWJhc2UoKTsKKyAgICAgICAgICAgIGRiLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgaW52YWxpZGF0ZUF1dGhUb2tlbihkYiwgYWNjb3VudFR5cGUsIGF1dGhUb2tlbik7CisgICAgICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGRiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGludmFsaWRhdGVBdXRoVG9rZW4oU1FMaXRlRGF0YWJhc2UgZGIsIFN0cmluZyBhY2NvdW50VHlwZSwgU3RyaW5nIGF1dGhUb2tlbikgeworICAgICAgICBpZiAoYXV0aFRva2VuID09IG51bGwgfHwgYWNjb3VudFR5cGUgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIEN1cnNvciBjdXJzb3IgPSBkYi5yYXdRdWVyeSgKKyAgICAgICAgICAgICAgICAiU0VMRUNUICIgKyBUQUJMRV9BVVRIVE9LRU5TICsgIi4iICsgQVVUSFRPS0VOU19JRAorICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCAiICsgVEFCTEVfQUNDT1VOVFMgKyAiLiIgKyBBQ0NPVU5UU19OQU1FCisgICAgICAgICAgICAgICAgICAgICAgICArICIsICIgKyBUQUJMRV9BVVRIVE9LRU5TICsgIi4iICsgQVVUSFRPS0VOU19UWVBFCisgICAgICAgICAgICAgICAgICAgICAgICArICIgRlJPTSAiICsgVEFCTEVfQUNDT1VOVFMKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBKT0lOICIgKyBUQUJMRV9BVVRIVE9LRU5TCisgICAgICAgICAgICAgICAgICAgICAgICArICIgT04gIiArIFRBQkxFX0FDQ09VTlRTICsgIi4iICsgQUNDT1VOVFNfSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiA9ICIgKyBBVVRIVE9LRU5TX0FDQ09VTlRTX0lECisgICAgICAgICAgICAgICAgICAgICAgICArICIgV0hFUkUgIiArIEFVVEhUT0tFTlNfQVVUSFRPS0VOICsgIiA9ID8gQU5EICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgVEFCTEVfQUNDT1VOVFMgKyAiLiIgKyBBQ0NPVU5UU19UWVBFICsgIiA9ID8iLAorICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXthdXRoVG9rZW4sIGFjY291bnRUeXBlfSk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICB3aGlsZSAoY3Vyc29yLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgIGxvbmcgYXV0aFRva2VuSWQgPSBjdXJzb3IuZ2V0TG9uZygwKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgYWNjb3VudE5hbWUgPSBjdXJzb3IuZ2V0U3RyaW5nKDEpOworICAgICAgICAgICAgICAgIFN0cmluZyBhdXRoVG9rZW5UeXBlID0gY3Vyc29yLmdldFN0cmluZygyKTsKKyAgICAgICAgICAgICAgICBkYi5kZWxldGUoVEFCTEVfQVVUSFRPS0VOUywgQVVUSFRPS0VOU19JRCArICI9IiArIGF1dGhUb2tlbklkLCBudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIHNhdmVBdXRoVG9rZW5Ub0RhdGFiYXNlKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIHR5cGUsIFN0cmluZyBhdXRoVG9rZW4pIHsKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBtT3BlbkhlbHBlci5nZXRXcml0YWJsZURhdGFiYXNlKCk7CisgICAgICAgIGRiLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGxvbmcgYWNjb3VudElkID0gZ2V0QWNjb3VudElkKGRiLCBhY2NvdW50KTsKKyAgICAgICAgICAgIGlmIChhY2NvdW50SWQgPCAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGIuZGVsZXRlKFRBQkxFX0FVVEhUT0tFTlMsCisgICAgICAgICAgICAgICAgICAgIEFVVEhUT0tFTlNfQUNDT1VOVFNfSUQgKyAiPSIgKyBhY2NvdW50SWQgKyAiIEFORCAiICsgQVVUSFRPS0VOU19UWVBFICsgIj0/IiwKKyAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tde3R5cGV9KTsKKyAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoQVVUSFRPS0VOU19BQ0NPVU5UU19JRCwgYWNjb3VudElkKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoQVVUSFRPS0VOU19UWVBFLCB0eXBlKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoQVVUSFRPS0VOU19BVVRIVE9LRU4sIGF1dGhUb2tlbik7CisgICAgICAgICAgICBpZiAoZGIuaW5zZXJ0KFRBQkxFX0FVVEhUT0tFTlMsIEFVVEhUT0tFTlNfQVVUSFRPS0VOLCB2YWx1ZXMpID49IDApIHsKKyAgICAgICAgICAgICAgICBkYi5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGRiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIHJlYWRBdXRoVG9rZW5Gcm9tRGF0YWJhc2UoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgYXV0aFRva2VuVHlwZSkgeworICAgICAgICBTUUxpdGVEYXRhYmFzZSBkYiA9IG1PcGVuSGVscGVyLmdldFJlYWRhYmxlRGF0YWJhc2UoKTsKKyAgICAgICAgZGIuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbG9uZyBhY2NvdW50SWQgPSBnZXRBY2NvdW50SWQoZGIsIGFjY291bnQpOworICAgICAgICAgICAgaWYgKGFjY291bnRJZCA8IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBnZXRBdXRoVG9rZW4oZGIsIGFjY291bnRJZCwgYXV0aFRva2VuVHlwZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBkYi5lbmRUcmFuc2FjdGlvbigpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBwZWVrQXV0aFRva2VuKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhUb2tlblR5cGUpIHsKKyAgICAgICAgY2hlY2tBdXRoZW50aWNhdGVBY2NvdW50c1Blcm1pc3Npb24oYWNjb3VudCk7CisgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gcmVhZEF1dGhUb2tlbkZyb21EYXRhYmFzZShhY2NvdW50LCBhdXRoVG9rZW5UeXBlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRBdXRoVG9rZW4oQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgYXV0aFRva2VuVHlwZSwgU3RyaW5nIGF1dGhUb2tlbikgeworICAgICAgICBjaGVja0F1dGhlbnRpY2F0ZUFjY291bnRzUGVybWlzc2lvbihhY2NvdW50KTsKKyAgICAgICAgbG9uZyBpZGVudGl0eVRva2VuID0gY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGNhY2hlQXV0aFRva2VuKGFjY291bnQsIGF1dGhUb2tlblR5cGUsIGF1dGhUb2tlbik7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmQoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgcGFzc3dvcmQpIHsKKyA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koKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHNldFBhc3N3b3JkKGFjY291bnQsIG51bGwpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZW5kUmVzdWx0KElBY2NvdW50TWFuYWdlclJlc3BvbnNlIHJlc3BvbnNlLCBCdW5kbGUgYnVuZGxlKSB7CisgICAgICAgIGlmIChyZXNwb25zZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uUmVzdWx0KGJ1bmRsZSk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBjYWxsZXIgaXMgZGVhZCB0aGVuIHRoZXJlIGlzIG5vIG9uZSB0byBjYXJlIGFib3V0IHJlbW90ZQorICAgICAgICAgICAgICAgIC8vIGV4Y2VwdGlvbnMKKyAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiZmFpbHVyZSB3aGlsZSBub3RpZnlpbmcgcmVzcG9uc2UiLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRVc2VyRGF0YShBY2NvdW50IGFjY291bnQsIFN0cmluZyBrZXksIFN0cmluZyB2YWx1ZSkgeworICAgICAgICBjaGVja0F1dGhlbnRpY2F0ZUFjY291bnRzUGVybWlzc2lvbihhY2NvdW50KTsKKyAgICAgICAgbG9uZyBpZGVudGl0eVRva2VuID0gY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHdyaXRlVXNlcmRhdGFJbnRvRGF0YWJhc2UoYWNjb3VudCwga2V5LCB2YWx1ZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHdyaXRlVXNlcmRhdGFJbnRvRGF0YWJhc2UoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcga2V5LCBTdHJpbmcgdmFsdWUpIHsKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBtT3BlbkhlbHBlci5nZXRXcml0YWJsZURhdGFiYXNlKCk7CisgICAgICAgIGRiLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGxvbmcgYWNjb3VudElkID0gZ2V0QWNjb3VudElkKGRiLCBhY2NvdW50KTsKKyAgICAgICAgICAgIGlmIChhY2NvdW50SWQgPCAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbG9uZyBleHRyYXNJZCA9IGdldEV4dHJhc0lkKGRiLCBhY2NvdW50SWQsIGtleSk7CisgICAgICAgICAgICBpZiAoZXh0cmFzSWQgPCAwICkgeworICAgICAgICAgICAgICAgIGV4dHJhc0lkID0gaW5zZXJ0RXh0cmEoZGIsIGFjY291bnRJZCwga2V5LCB2YWx1ZSk7CisgICAgICAgICAgICAgICAgaWYgKGV4dHJhc0lkIDwgMCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChFWFRSQVNfVkFMVU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VuKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1dFN0cmluZyhDb25zdGFudHMuQUNDT1VOVF9OQU1FX0tFWSwgYWNjb3VudC5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1dFN0cmluZyhDb25zdGFudHMuQUNDT1VOVF9UWVBFX0tFWSwgYWNjb3VudC50eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgb25SZXN1bHQocmVzcG9uc2UsIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG5ldyBTZXNzaW9uKHJlc3BvbnNlLCBhY2NvdW50LnR5cGUsIGV4cGVjdEFjdGl2aXR5TGF1bmNoKSB7CisgICAgICAgICAgICAgICAgcHJvdGVjdGVkIFN0cmluZyB0b0RlYnVnU3RyaW5nKGxvbmcgbm93KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsb2dpbk9wdGlvbnMgIT0gbnVsbCkgbG9naW5PcHRpb25zLmtleVNldCgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3VwZXIudG9EZWJ1Z1N0cmluZyhub3cpICsgIiwgZ2V0QXV0aFRva2VuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgIiArIGFjY291bnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIGF1dGhUb2tlblR5cGUgIiArIGF1dGhUb2tlblR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIGxvZ2luT3B0aW9ucyAiICsgbG9naW5PcHRpb25zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBub3RpZnlPbkF1dGhGYWlsdXJlICIgKyBub3RpZnlPbkF1dGhGYWlsdXJlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgY2FsbGVyIGRvZXNuJ3QgaGF2ZSBwZXJtaXNzaW9uIHRoZW4gY3JlYXRlIGFuZCByZXR1cm4gdGhlCisgICAgICAgICAgICAgICAgICAgIC8vICJncmFudCBwZXJtaXNzaW9uIiBpbnRlbnQgaW5zdGVhZCBvZiB0aGUgImdldEF1dGhUb2tlbiIgaW50ZW50LgorICAgICAgICAgICAgICAgICAgICBpZiAoIXBlcm1pc3Npb25HcmFudGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvci5nZXRBdXRoVG9rZW5MYWJlbCh0aGlzLCBhdXRoVG9rZW5UeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BdXRoZW50aWNhdG9yLmdldEF1dGhUb2tlbih0aGlzLCBhY2NvdW50LCBhdXRoVG9rZW5UeXBlLCBsb2dpbk9wdGlvbnMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZXN1bHQoQnVuZGxlIHJlc3VsdCkgeworICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuY29udGFpbnNLZXkoQ29uc3RhbnRzLkFVVEhfVE9LRU5fTEFCRUxfS0VZKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXdHcmFudENyZWRlbnRpYWxzUGVybWlzc2lvbkludGVudChhY2NvdW50LCBjYWxsZXJVaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSh0aGlzKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhUb2tlblR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuZ2V0U3RyaW5nKENvbnN0YW50cy5BVVRIX1RPS0VOX0xBQkVMX0tFWSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJ1bmRsZSBidW5kbGUgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVuZGxlLnB1dFBhcmNlbGFibGUoQ29uc3RhbnRzLklOVEVOVF9LRVksIGludGVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25SZXN1bHQoYnVuZGxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXV0aFRva2VuID0gcmVzdWx0LmdldFN0cmluZyhDb25zdGFudHMuQVVUSFRPS0VOX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXV0aFRva2VuICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbmFtZSA9IHJlc3VsdC5nZXRTdHJpbmcoQ29uc3RhbnRzLkFDQ09VTlRfTkFNRV9LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyB0eXBlID0gcmVzdWx0LmdldFN0cmluZyhDb25zdGFudHMuQUNDT1VOVF9UWVBFX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHR5cGUpIHx8IFRleHRVdGlscy5pc0VtcHR5KG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfSU5WQUxJRF9SRVNQT05TRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidGhlIHR5cGUgYW5kIG5hbWUgc2hvdWxkIG5vdCBiZSBlbXB0eSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlQXV0aFRva2VuKG5ldyBBY2NvdW50KG5hbWUsIHR5cGUpLCBhdXRoVG9rZW5UeXBlLCBhdXRoVG9rZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gcmVzdWx0LmdldFBhcmNlbGFibGUoQ29uc3RhbnRzLklOVEVOVF9LRVkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGludGVudCAhPSBudWxsICYmIG5vdGlmeU9uQXV0aEZhaWx1cmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb05vdGlmaWNhdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQsIHJlc3VsdC5nZXRTdHJpbmcoQ29uc3RhbnRzLkFVVEhfRkFJTEVEX01FU1NBR0VfS0VZKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc3VwZXIub25SZXN1bHQocmVzdWx0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LmJpbmQoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY3JlYXRlTm9DcmVkZW50aWFsc1Blcm1pc3Npb25Ob3RpZmljYXRpb24oQWNjb3VudCBhY2NvdW50LCBJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIGludCB1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ICAgICAgICAgIFBlbmRpbmdJbnRlbnQuZ2V0QWN0aXZpdHkobUNvbnRleHQsIDAsIGludGVudCwgUGVuZGluZ0ludGVudC5GTEFHX0NBTkNFTF9DVVJSRU5UKSk7CisgICAgICAgICgoTm90aWZpY2F0aW9uTWFuYWdlcikgbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0Lk5PVElGSUNBVElPTl9TRVJWSUNFKSkKKyAgICAgICAgICAgICAgICAubm90aWZ5KGdldENyZWRlbnRpYWxQZXJtaXNzaW9uTm90aWZpY2F0aW9uSWQoYWNjb3VudCwgYXV0aFRva2VuVHlwZSwgdWlkKSwgbik7CisgICAgfQorCisgICAgcHJpdmF0ZSBJbnRlbnQgbmV3R3JhbnRDcmVkZW50aWFsc1Blcm1pc3Npb25JbnRlbnQoQWNjb3VudCBhY2NvdW50LCBpbnQgdWlkLAorICAgICAgICAgICAgQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSByZXNwb25zZSwgU3RyaW5nIGF1dGhUb2tlblR5cGUsIFN0cmluZyBhdXRoVG9rZW5MYWJlbCkgeworICAgICAgICBSZWdpc3RlcmVkU2VydmljZXNDYWNoZS5TZXJ2aWNlSW5mbzxBdXRoZW50aWNhdG9yRGVzY3JpcHRpb24+IHNlcnZpY2VJbmZvID0KKyAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvckNhY2hlLmdldFNlcnZpY2VJbmZvKAorICAgICAgICAgICAgICAgICAgICAgICAgQXV0aGVudGljYXRvckRlc2NyaXB0aW9uLm5ld0tleShhY2NvdW50LnR5cGUpKTsKKyAgICAgICAgaWYgKHNlcnZpY2VJbmZvID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVua25vd24gYWNjb3VudCB0eXBlOiAiICsgYWNjb3VudC50eXBlKTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIENvbnRleHQgYXV0aENvbnRle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QYWlyPEFjY291bnQsIFN0cmluZz4sIEludGVnZXI+KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBQYWlyPEFjY291bnQsIFN0cmluZz4oYWNjb3VudCwgYXV0aFRva2VuVHlwZSksIHVpZCk7CisgICAgICAgICAgICBpZCA9IG1DcmVkZW50aWFsc1Blcm1pc3Npb25Ob3RpZmljYXRpb25JZHMuZ2V0KGtleSk7CisgICAgICAgICAgICBpZiAoaWQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlkID0gbU5vdGlmaWNhdGlvbklkcy5pbmNyZW1lbnRBbmRHZXQoKTsKKyAgICAgICAgICAgICAgICBtQ3JlZGVudGlhbHNQZXJtaXNzaW9uTm90aWZpY2F0aW9uSWRzLnB1dChrZXksIGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gaWQ7CisgICAgfQorCisgICAgcHJpdmF0ZSBJbnRlZ2VyIGdldFNpZ25pblJlcXVpcmVkTm90aWZpY2F0aW9uSWQoQWNjb3VudCBhY2NvdW50KSB7CisgICAgICAgIEludGVnZXIgaWQ7CisgICAgICAgIHN5bmNocm9uaXplZChtU2lnbmluUmVxdWlyZWROb3RpZmljYXRpb25JZHMpIHsKKyAgICAgICAgICAgIGlkID0gbVNpZ25pblJlcXVpcmVkTm90aWZpY2F0aW9uSWRzLmdldChhY2NvdW50KTsKKyAgICAgICAgICAgIGlmIChpZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWQgPSBtTm90aWZpY2F0aW9uSWRzLmluY3JlbWVudEFuZEdldCgpOworICAgICAgICAgICAgICAgIG1TaWduaW5SZXF1aXJlZE5vdGlmaWNhdGlvbklkcy5wdXQoYWNjb3VudCwgaWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBpZDsKKyAgICB9CisKKworICAgIHB1YmxpYyB2b2lkIGFkZEFjb3VudChmaW5hbCBJQWNjb3VudE1hbmFnZXJSZXNwb25zZSByZXNwb25zZSwgZmluYWwgU3RyaW5nIGFjY291bnRUeXBlLAorICAgICAgICAgICAgZmluYWwgU3RyaW5nIGF1dGhUb2tlblR5cGUsIGZpbmFsIFN0cmluZ1tdIHJlcXVpcmVkRmVhdHVyZXMsCisgICAgICAgICAgICBmaW5hbCBib29sZWFuIGV4cGVjdEFjdGl2aXR5TGF1bmNoLCBmaW5hbCBCdW5kbGUgb3B0aW9ucykgeworICAgICAgICBjaGVja01hbmFnZUFjY291bnRzUGVybWlzc2lvbigpOworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbmV3IFNlc3Npb24ocmVzcG9uc2UsIGFjY291bnRUeXBlLCBleHBlY3RBY3Rpdml0eUxhdW5jaCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvci5hZGRBY2NvdW50KHRoaXMsIG1BY2NvdW50VHlwZSwgYXV0aFRva2VuVHlwZSwgcmVxdWlyZWRGZWF0dXJlcywgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcHJvdGVjdGVkIFN0cmluZyB0b0RlYnVnU3RyaW5nKGxvbmcgbm93KSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdXBlci50b0RlYnVnU3RyaW5nKG5vdykgKyAiLCBhZGRBY2NvdW50IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgYWNjb3VudFR5cGUgIiArIGFjY291bnRUeXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCByZXF1aXJlZEZlYXR1cmVzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIChyZXF1aXJlZEZlYXR1cmVzICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gVGV4dFV0aWxzLmpvaW4oIiwiLCByZXF1aXJlZEZlYXR1cmVzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBudWxsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LmJpbmQoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjb25maXJtQ3JlZGVudGlhbHMoSUFjY291bnRNYW5hZ2VyUmVzcG9uc2UgcmVzcG9uc2UsCisgICAgICAgICAgICBmaW5hbCBBY2NvdW50IGFjY291bnQsIGZpbmFsIGJvb2xlYW4gZXhwZWN0QWN0aXZpdHlMYXVuY2gpIHsKKyAgICAgICAgY2hlY2tNYW5hZ2VBY2NvdW50c1Blcm1pc3Npb24oKTsKKyAgICAgICAgbG9uZyBpZGVudGl0eVRva2VuID0gY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG5ldyBTZXNzaW9uKHJlc3BvbnNlLCBhY2NvdW50LnR5cGUsIGV4cGVjdEFjdGl2aXR5TGF1bmNoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICAgICAgICAgIG1BdXRoZW50aWNhdG9yLmNvbmZpcm1DcmVkZW50aWFscyh0aGlzLCBhY2NvdW50KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJvdGVjdGVkIFN0cmluZyB0b0RlYnVnU3RyaW5nKGxvbmcgbm93KSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdXBlci50b0RlYnVnU3RyaW5nKG5vdykgKyAiLCBjb25maXJtQ3JlZGVudGlhbHMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCAiICsgYWNjb3VudDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LmJpbmQoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjb25maXJtUGFzc3dvcmQoSUFjY291bnRNYW5hZ2VyUmVzcG9uc2UgcmVzcG9uc2UsIGZpbmFsIEFjY291bnQgYWNjb3VudCwKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyBwYXNzd29yZCkgeworICAgICAgICBjaGVja01hbmFnZUFjY291bnRzUGVybWlzc2lvbigpOworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbmV3IFNlc3Npb24ocmVzcG9uc2UsIGFjY291bnQudHlwZSwgZmFsc2UgLyogZXhwZWN0QWN0aXZpdHlMYXVuY2ggKi8pIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICAgICAgbUF1dGhlbnRpY2F0b3IuY29uZmlybVBhc3N3b3JkKHRoaXMsIGFjY291bnQsIHBhc3N3b3JkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJvdGVjdGVkIFN0cmluZyB0b0RlYnVnU3RyaW5nKGxvbmcgbm93KSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdXBlci50b0RlYnVnU3RyaW5nKG5vdykgKyAiLCBjb25maXJtUGFzc3dvcmQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCAiICsgYWNjb3VudDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LmJpbmQoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGVDcmVkZW50aWFscyhJQWNjb3VudE1hbmFnZXJSZXNwb25zZSByZXNwb25zZSwgZmluYWwgQWNjb3VudCBhY2NvdW50LAorICAgICAgICAgICAgZmluYWwgU3RyaW5nIGF1dGhUb2tlblR5cGUsIGZpbmFsIGJvb2xlYW4gZXhwZWN0QWN0aXZpdHlMYXVuY2gsCisgICAgICAgICAgICBmaW5hbCBCdW5kbGUgbG9naW5PcHRpb25zKSB7CisgICAgICAgIGNoZWNrTWFuYWdlQWNjb3VudHNQZXJtaXNzaW9uKCk7CisgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBuZXcgU2Vzc2lvbihyZXNwb25zZSwgYWNjb3VudC50eXBlLCBleHBlY3RBY3Rpdml0eUxhdW5jaCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvci51cGRhdGVDcmVkZW50aWFscyh0aGlzLCBhY2NvdW50LCBhdXRoVG9rZW5UeXBlLCBsb2dpbk9wdGlvbnMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwcm90ZWN0ZWQgU3RyaW5nIHRvRGVidWdTdHJpbmcobG9uZyBub3cpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxvZ2luT3B0aW9ucyAhPSBudWxsKSBsb2dpbk9wdGlvbnMua2V5U2V0KCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdXBlci50b0RlYnVnU3RyaW5nKG5vdykgKyAiLCB1cGRhdGVDcmVkZW50aWFscyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsICIgKyBhY2NvdW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBhdXRoVG9rZW5UeXBlICIgKyBhdXRoVG9rZW5UeXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBsb2dpbk9wdGlvbnMgIiArIGxvZ2luT3B0aW9uczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LmJpbmQoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBlZGl0UHJvcGVydGllcyhJQWNjb3VudE1hbmFnZXJSZXNwb25zZSByZXNwb25zZSwgZmluYWwgU3RyaW5nIGFjY291bnRUeXBlLAorICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBleHBlY3RBY3Rpdml0eUxhdW5jaCkgeworICAgICAgICBjaGVja01hbmFnZUFjY291bnRzUGVybWlzc2lvbigpOworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbmV3IFNlc3Npb24ocmVzcG9uc2UsIGFjY291bnRUeXBlLCBleHBlY3RBY3Rpdml0eUxhdW5jaCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvci5lZGl0UHJvcGVydGllcyh0aGlzLCBtQWNjb3VudFR5cGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwcm90ZWN0ZWQgU3RyaW5nIHRvRGVidWdTdHJpbmcobG9uZyBub3cpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN1cGVyLnRvRGVidWdTdHJpbmcobm93KSArICIsIGVkaXRQcm9wZXJ0aWVzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgYWNjb3VudFR5cGUgIiArIGFjY291bnRUeXBlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0uYmluZCgpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgR2V0QWNjb3VudHNCeVR5cGVBbmRGZWF0dXJlU2Vzc2lvbiBleHRlbmRzIFNlc3Npb24geworICAgICAgICBwcml2YXRlIGZpbmFsIFN0cmluZ1tdIG1GZWF0dXJlczsKKyAgICAgICAgcHJpdmF0ZSB2b2xhdGlsZSBBY2NvdW50W10gbUFjY291bnRzT2ZUeXBlID0gbnVsbDsKKyAgICAgICAgcHJpdmF0ZSB2b2xhdGlsZSBBcnJheUxpc3Q8QWNjb3VudD4gbUFjY291bnRzV2l0aEZlYXR1cmVzID0gbnVsbDsKKyAgICAgICAgcHJpdmF0ZSB2b2xhdGlsZSBpbnQgbUN1cnJlbnRBY2NvdW50ID0gMDsKKworICAgICAgICBwdWJsaWMgR2V0QWNjb3VudHNCeVR5cGVBbmRGZWF0dXJlU2Vzc2lvbihJQWNjb3VudE1hbmFnZXJSZXNwb25zZSByZXNwb25zZSwKKyAgICAgICAgICAgIFN0cmluZyB0eXBlLCBTdHJpbmdbXSBmZWF0dXJlcykgeworICAgICAgICAgICAgc3VwZXIocmVzcG9uc2UsIHR5cGUsIGZhbHNlIC8qIGV4cGVjdEFjdGl2aXR5TGF1bmNoICovKTsKKyAgICAgICAgICAgIG1GZWF0dXJlcyA9IGZlYXR1cmVzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBtQWNjb3VudHNPZlR5cGUgPSBnZXRBY2NvdW50c0J5VHlwZShtQWNjb3VudFR5cGUpOworICAgICAgICAgICAgLy8gY2hlY2sgd2hldGhlciBlYWNoIGFjY291bnQgbWF0Y2hlcyB0aGUgcmVxdWVzdGVkIGZlYXR1cmVzCisgICAgICAgICAgICBtQWNjb3VudHNXaXRoRmVhdHVyZXMgPSBuZXcgQXJyYXlMaXN0PEFjY291bnQ+KG1BY2NvdW50c09mVHlwZS5sZW5ndGgpOworICAgICAgICAgICAgbUN1cnJlbnRBY2NvdW50ID0gMDsKKworICAgICAgICAgICAgY2hlY2tBY2NvdW50KCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBjaGVja0FjY291bnQoKSB7CisgICAgICAgICAgICBpZiAobUN1cnJlbnRBY2NvdW50ID49IG1BY2NvdW50c09mVHlwZS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBzZW5kUmVzdWx0KCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1BdXRoZW50aWNhdG9yLmhhc0ZlYXR1cmVzKHRoaXMsIG1BY2NvdW50c09mVHlwZVttQ3VycmVudEFjY291bnRdLCBtRmVhdHVyZXMpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBvbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX1JFTU9URV9FWENFUFRJT04sICJyZW1vdGUgZXhjZXB0aW9uIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblJlc3VsdChCdW5kbGUgcmVzdWx0KSB7CisgICAgICAgICAgICBtTnVtUmVzdWx0cysrOworICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgb25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9JTlZBTElEX1JFU1BPTlNFLCAibnVsbCBidW5kbGUiKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmVzdWx0LmdldEJvb2xlYW4oQ29uc3RhbnRzLkJPT0xFQU5fUkVTVUxUX0tFWSwgZmFsc2UpKSB7CisgICAgICAgICAgICAgICAgbUFjY291bnRzV2l0aEZlYXR1cmVzLmFkZChtQWNjb3VudHNPZlR5cGVbbUN1cnJlbnRBY2NvdW50XSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQ3VycmVudEFjY291bnQrKzsKKyAgICAgICAgICAgIGNoZWNrQWNjb3VudCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2VuZFJlc3VsdCgpIHsKKyAgICAgICAgICAgIElBY2NvdW50TWFuYWdlclJlc3BvbnNlIHJlc3BvbnNlID0gZ2V0UmVzcG9uc2VBbmRDbG9zZSgpOworICAgICAgICAgICAgaWYgKHJlc3BvbnNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBBY2NvdW50W10gYWNjb3VudHMgPSBuZXcgQWNjb3VudFttQWNjb3VudHNXaXRoRmVhdHVyZXMuc2l6ZSgpXTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhY2NvdW50cy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudHNbaV0gPSBtQWNjb3VudHNXaXRoRmVhdHVyZXMuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIEJ1bmRsZSByZXN1bHQgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXRQYXJjZWxhYmxlQXJyYXkoQ29uc3RhbnRzLkFDQ09VTlRTX0tFWSwgYWNjb3VudHMpOworICAgICAgICAgICAgICAgICAgICByZXNwb25zZS5vblJlc3VsdChyZXN1bHQpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBjYWxsZXIgaXMgZGVhZCB0aGVuIHRoZXJlIGlzIG5vIG9uZSB0byBjYXJlIGFib3V0IHJlbW90ZSBleGNlcHRpb25zCisgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiZmFpbHVyZSB3aGlsZSBub3RpZnlpbmcgcmVzcG9uc2UiLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisKKyAgICAgICAgcHJvdGVjdGVkIFN0cmluZyB0b0RlYnVnU3RyaW5nKGxvbmcgbm93KSB7CisgICAgICAgICAgICByZXR1cm4gc3VwZXIudG9EZWJ1Z1N0cmluZyhub3cpICsgIiwgZ2V0QWNjb3VudHNCeVR5cGVBbmRGZWF0dXJlcyIKKyAgICAgICAgICAgICAgICAgICAgKyAiLCAiICsgKG1GZWF0dXJlcyAhPSBudWxsID8gVGV4dFV0aWxzLmpvaW4oIiwiLCBtRmVhdHVyZXMpIDogbnVsbCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgQWNjb3VudFtdIGdldEFjY291bnRzKFN0cmluZyB0eXBlKSB7CisgICAgICAgIGNoZWNrUmVhZEFjY291bnRzUGVybWlzc2lvbigpOworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIGdldEFjY291bnRzQnlUeXBlKHR5cGUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGdldEFjY291bnRzQnlGZWF0dXJlcyhJQWNjb3VudE1hbmFnZXJSZXNwb25zZSByZXNwb25zZSwKKyAgICAgICAgICAgIFN0cmluZyB0eXBlLCBTdHJpbmdbXSBmZWF0dXJlcykgeworICAgICAgICBjaGVja1JlYWRBY2NvdW50c1Blcm1pc3Npb24oKTsKKyAgICAgICAgaWYgKGZlYXR1cmVzICE9IG51bGwgJiYgdHlwZSA9PSBudWxsKSB7CisgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uRXJyb3IoQ29uc3RhbnRzLkVSUk9SX0NPREVfQkFEX0FSR1VNRU5UUywgInR5cGUgaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGlnbm9yZSB0aGlzCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoZmVhdHVyZXMgPT0gbnVsbCB8fCBmZWF0dXJlcy5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgICAgIGdldEFjY291bnRzQnlUeXBlKHR5cGUpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5ldyBHZXRBY2NvdW50c0J5VHlwZUFuZEZlYXR1cmVTZXNzaW9uKHJlc3BvbnNlLCB0eXBlLCBmZWF0dXJlcykuYmluZCgpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBjYWNoZUF1dGhUb2tlbihBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRoVG9rZW5UeXBlLCBTdHJpbmcgYXV0aFRva2VuKSB7CisgICAgICAgIHJldHVybiBzYXZlQXV0aFRva2VuVG9EYXRhYmFzZShhY2NvdW50LCBhdXRoVG9rZW5UeXBlLCBhdXRoVG9rZW4pOworICAgIH0KKworICAgIHByaXZhdGUgbG9uZyBnZXRBY2NvdW50SWQoU1FMaXRlRGF0YWJhc2UgZGIsIEFjY291bnQgYWNjb3VudCkgeworICAgICAgICBDdXJzb3IgY3Vyc29yID0gZGIucXVlcnkoVEFCTEVfQUNDT1VOVFMsIG5ldyBTdHJpbmdbXXtBQ0NPVU5UU19JRH0sCisgICAgICAgICAgICAgICAgIm5hbWU9PyBBTkQgdHlwZT0/IiwgbmV3IFN0cmluZ1tde2FjY291bnQubmFtZSwgYWNjb3VudC50eXBlfSwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoY3Vyc29yLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBjdXJzb3IuZ2V0TG9uZygwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBsb25nIGdldEV4dHJhc0lkKFNRTGl0ZURhdGFiYXNlIGRiLCBsb25nIGFjY291bnRJZCwgU3RyaW5nIGtleSkgeworICAgICAgICBDdXJzb3IgY3Vyc29yID0gZGIucXVlcnkoVEFCTEVfRVhUUkFTLCBuZXcgU3RyaW5nW117RVhUUkFTX0lEfSwKKyAgICAgICAgICAgICAgICBFWFRSQVNfQUNDT1VOVFNfSUQgKyAiPSIgKyBhY2NvdW50SWQgKyAiIEFORCAiICsgRVhUUkFTX0tFWSArICI9PyIsCisgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tde2tleX0sIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKGN1cnNvci5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY3Vyc29yLmdldExvbmcoMCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIGdldEF1dGhUb2tlbihTUUxpdGVEYXRhYmFzZSBkYiwgbG9uZyBhY2NvdW50SWQsIFN0cmluZyBhdXRoVG9rZW5UeXBlKSB7CisgICAgICAgIEN1cnNvciBjdXJzb3IgPSBkYi5xdWVyeShUQUJMRV9BVVRIVE9LRU5TLCBuZXcgU3RyaW5nW117QVVUSFRPS0VOU19BVVRIVE9LRU59LAorICAgICAgICAgICAgICAgIEFVVEhUT0tFTlNfQUNDT1VOVFNfSUQgKyAiPSIgKyBhY2NvdW50SWQgKyAiIEFORCAiICsgQVVUSFRPS0VOU19UWVBFICsgIj0/IiwKKyAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW117YXV0aFRva2VuVHlwZX0sCisgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoY3Vyc29yLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBjdXJzb3IuZ2V0U3RyaW5nKDApOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgYWJzdHJhY3QgY2xhc3MgU2Vzc2lvbiBleHRlbmRzIElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlLlN0dWIKKyAgICAgICAgICAgIGltcGxlbWVudHMgQXV0aGVudGljYXRvckJpbmRIZWxwZXIuQ2FsbGJhY2ssIElCaW5kZXIuRGVhdGhSZWNpcGllbnQgeworICAgICAgICBJQWNjb3VudE1hbmFnZXJSZXNwb25zZSBtUmVzcG9uc2U7CisgICAgICAgIGZpbmFsIFN0cmluZyBtQWNjb3VudFR5cGU7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbUV4cGVjdEFjdGl2aXR5TGF1bmNoOworICAgICAgICBmaW5hbCBsb25nIG1DcmVhdGlvblRpbWU7CisKKyAgICAgICAgcHVibGljIGludCBtTnVtUmVzdWx0cyA9IDA7CisgICAgICAgIHByaXZhdGUgaW50IG1OdW1SZXF1ZXN0Q29udGludWVkID0gMDsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbU51bUVycm9ycyA9IDA7CisKKworICAgICAgICBJQWNjb3VudEF1dGhlbnRpY2F0b3IgbUF1dGhlbnRpY2F0b3IgPSBudWxsOworCisgICAgICAgIHB1YmxpYyBTZXNzaW9uKElBY2NvdW50TWFuYWdlclJlc3BvbnNlIHJlc3BvbnNlLCBTdHJpbmcgYWNjb3VudFR5cGUsCisgICAgICAgICAgICAgICAgYm9vbGVhbiBleHBlY3RBY3Rpdml0eUxhdW5jaCkgeworICAgICAgICAgICAgc3VwZXIoKTsKKyAgICAgICAgICAgIGlmIChyZXNwb25zZSA9PSBudWxsKSB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJyZXNwb25zZSBpcyBudWxsIik7CisgICAgICAgICAgICBpZiAoYWNjb3VudFR5cGUgPT0gbnVsbCkgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiYWNjb3VudFR5cGUgaXMgbnVsbCIpOworICAgICAgICAgICAgbVJlc3BvbnNlID0gcmVzcG9uc2U7CisgICAgICAgICAgICBtQWNjb3VudFR5cGUgPSBhY2NvdW50VHlwZTsKKyAgICAgICAgICAgIG1FeHBlY3RBY3Rpdml0eUxhdW5jaCA9IGV4cGVjdEFjdGl2aXR5TGF1bmNoOworICAgICAgICAgICAgbUNyZWF0aW9uVGltZSA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOworICAgICAgICAgICAgc3luY2hyb25pemVkIChtU2Vzc2lvbnMpIHsKKyAgICAgICAgICAgICAgICBtU2Vzc2lvbnMucHV0KHRvU3RyaW5nKCksIHRoaXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXNwb25zZS5hc0JpbmRlcigpLmxpbmtUb0RlYXRoKHRoaXMsIDAgLyogZmxhZ3MgKi8pOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBtUmVzcG9uc2UgPSBudWxsOworICAgICAgICAgICAgICAgIGJpbmRlckRpZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIElBY2NvdW50TWFuYWdlclJlc3BvbnNlIGdldFJlc3BvbnNlQW5kQ2xvc2UoKSB7CisgICAgICAgICAgICBpZiAobVJlc3BvbnNlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyB0aGlzIHNlc3Npb24gaGFzIGFscmVhZHkgYmVlbiBjbG9zZWQKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIElBY2NvdW50TWFuYWdlclJlc3BvbnNlIHJlc3BvbnNlID0gbVJlc3BvbnNlOworICAgICAgICAgICAgY2xvc2UoKTsgLy8gdGhpcyBjbGVhcnMgbVJlc3BvbnNlIHNvIHdlIG5lZWQgdG8gc2F2ZSB0aGUgcmVzcG9uc2UgYmVmb3JlIHRoaXMgY2FsbAorICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGNsb3NlKCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChtU2Vzc2lvbnMpIHsKKyAgICAgICAgICAgICAgICBpZiAobVNlc3Npb25zLnJlbW92ZSh0b1N0cmluZygpKSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzZXNzaW9uIHdhcyBhbHJlYWR5IGNsb3NlZCwgc28gYmFpbCBvdXQgbm93CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVJlc3BvbnNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBzdG9wIGxpc3RlbmluZyBmb3IgcmVzcG9uc2UgZGVhdGhzCisgICAgICAgICAgICAgICAgbVJlc3BvbnNlLmFzQmluZGVyKCkudW5saW5rVG9EZWF0aCh0aGlzLCAwIC8qIGZsYWdzICovKTsKKworICAgICAgICAgICAgICAgIC8vIGNsZWFyIHRoaXMgc28gdGhhdCB3ZSBkb24ndCBhY2NpZGVudGFsbHkgc2VuZCBhbnkgZnVydGhlciByZXN1bHRzCisgICAgICAgICAgICAgICAgbVJlc3BvbnNlID0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhbmNlbFRpbWVvdXQoKTsKKyAgICAgICAgICAgIHVuYmluZCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgYmluZGVyRGllZCgpIHsKKyAgICAgICAgICAgIG1SZXNwb25zZSA9IG51bGw7CisgICAgICAgICAgICBjbG9zZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJvdGVjdGVkIFN0cmluZyB0b0RlYnVnU3RyaW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIHRvRGVidWdTdHJpbmcoU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCkpOworICAgICAgICB9CisKKyAgICAgICAgcHJvdGVjdGVkIFN0cmluZyB0b0RlYnVnU3RyaW5nKGxvbmcgbm93KSB7CisgICAgICAgICAgICByZXR1cm4gIlNlc3Npb246IGV4cGVjdExhdW5jaCAiICsgbUV4cGVjdEFjdGl2aXR5TGF1bmNoCisgICAgICAgICAgICAgICAgICAgICsgIiwgY29ubmVjdGVkICIgKyAobUF1dGhlbnRpY2F0b3IgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgKyAiLCBzdGF0cyAoIiArIG1OdW1SZXN1bHRzICsgIi8iICsgbU51bVJlcXVlc3RDb250aW51ZWQKKyAgICAgICAgICAgICAgICAgICAgKyAiLyIgKyBtTnVtRXJyb3JzICsgIikiCisgICAgICAgICAgICAgICAgICAgICsgIiwgbGlmZXRpbWUgIiArICgobm93IC0gbUNyZWF0aW9uVGltZSkgLyAxMDAwLjApOworICAgICAgICB9CisKKyAgICAgICAgdm9pZCBiaW5kKCkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiaW5pdGlhdGluZyBiaW5kIHRvIGF1dGhlbnRpY2F0b3IgdHlwZSAiICsgbUFjY291bnRUeXBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghbUJpbmRIZWxwZXIuYmluZChtQWNjb3VudFR5cGUsIHRoaXMpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiYmluZCBhdHRlbXB0IGZhaWxlZCBmb3IgIiArIHRvRGVidWdTdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgb25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9SRU1PVEVfRVhDRVBUSU9OLCAiYmluZCBmYWlsdXJlIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgdW5iaW5kKCkgeworICAgICAgICAgICAgaWYgKG1BdXRoZW50aWNhdG9yICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvciA9IG51bGw7CisgICAgICAgICAgICAgICAgbUJpbmRIZWxwZXIudW5iaW5kKHRoaXMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2NoZWR1bGVUaW1lb3V0KCkgeworICAgICAgICAgICAgbU1lc3NhZ2VIYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZCgKKyAgICAgICAgICAgICAgICAgICAgbU1lc3NhZ2VIYW5kbGVyLm9idGFpbk1lc3NhZ2UoTUVTU0FHRV9USU1FRF9PVVQsIHRoaXMpLCBUSU1FT1VUX0RFTEFZX01TKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGNhbmNlbFRpbWVvdXQoKSB7CisgICAgICAgICAgICBtTWVzc2FnZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTUVTU0FHRV9USU1FRF9PVVQsIHRoaXMpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25Db25uZWN0ZWQoSUJpbmRlciBzZXJ2aWNlKSB7CisgICAgICAgICAgICBtQXV0aGVudGljYXRvciA9IElBY2NvdW50QXV0aGVudGljYXRvci5TdHViLmFzSW50ZXJmYWNlKHNlcnZpY2UpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBydW4oKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgb25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9SRU1PVEVfRVhDRVBUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgInJlbW90ZSBleGNlcHRpb24iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIHJ1bigpIHRocm93cyBSZW1vdGVFeGNlcHRpb247CisKKyAgICAgICAgcHVibGljIHZvaWQgb25EaXNjb25uZWN0ZWQoKSB7CisgICAgICAgICAgICBtQXV0aGVudGljYXRvciA9IG51bGw7CisgICAgICAgICAgICBJQWNjb3VudE1hbmFnZXJSZXNwb25zZSByZXNwb25zZSA9IGdldFJlc3BvbnNlQW5kQ2xvc2UoKTsKKyAgICAgICAgICAgIGlmIChyZXNwb25zZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9SRU1PVEVfRVhDRVBUSU9OLAorICAgICAgICAgICAgICAgICAgICAgICAgImRpc2Nvbm5lY3RlZCIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25UaW1lZE91dCgpIHsKKyAgICAgICAgICAgIElBY2NvdW50TWFuYWdlclJlc3BvbnNlIHJlc3BvbnNlID0gZ2V0UmVzcG9uc2VBbmRDbG9zZSgpOworICAgICAgICAgICAgaWYgKHJlc3BvbnNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX1JFTU9URV9FWENFUFRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAidGltZW91dCIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25SZXN1bHQoQnVuZGxlIHJlc3VsdCkgeworICAgICAgICAgICAgbU51bVJlc3VsdHMrKzsKKyAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gbnVsbCAmJiAhVGV4dFV0aWxzLmlzRW1wdHkocmVzdWx0LmdldFN0cmluZyhDb25zdGFudHMuQVVUSFRPS0VOX0tFWSkpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGFjY291bnROYW1lID0gcmVzdWx0LmdldFN0cmluZyhDb25zdGFudHMuQUNDT1VOVF9OQU1FX0tFWSk7CisgICAgICAgICAgICAgICAgU3RyaW5nIGFjY291bnRUeXBlID0gcmVzdWx0LmdldFN0cmluZyhDb25zdGFudHMuQUNDT1VOVF9UWVBFX0tFWSk7CisgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShhY2NvdW50TmFtZSkgJiYgIVRleHRVdGlscy5pc0VtcHR5KGFjY291bnRUeXBlKSkgeworICAgICAgICAgICAgICAgICAgICBBY2NvdW50IGFjY291bnQgPSBuZXcgQWNjb3VudChhY2NvdW50TmFtZSwgYWNjb3VudFR5cGUpOworICAgICAgICAgICAgICAgICAgICBjYW5jZWxOb3RpZmljYXRpb24oZ2V0U2lnbmluUmVxdWlyZWROb3RpZmljYXRpb25JZChhY2NvdW50KSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgSUFjY291bnRNYW5hZ2VyUmVzcG9uc2UgcmVzcG9uc2U7CisgICAgICAgICAgICBpZiAobUV4cGVjdEFjdGl2aXR5TGF1bmNoICYmIHJlc3VsdCAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICYmIHJlc3VsdC5jb250YWluc0tleShDb25zdGFudHMuSU5URU5UX0tFWSkpIHsKKyAgICAgICAgICAgICAgICByZXNwb25zZSA9IG1SZXNwb25zZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmVzcG9uc2UgPSBnZXRSZXNwb25zZUFuZENsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2Uub25FcnJvcihDb25zdGFudHMuRVJST1JfQ09ERV9JTlZBTElEX1JFU1BPTlNFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibnVsbCBidW5kbGUgcmV0dXJuZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uUmVzdWx0KHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGUgY2FsbGVyIGlzIGRlYWQgdGhlbiB0aGVyZSBpcyBubyBvbmUgdG8gY2FyZSBhYm91dCByZW1vdGUgZXhjZXB0aW9ucworICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImZhaWx1cmUgd2hpbGUgbm90aWZ5aW5nIHJlc3BvbnNlIiwgZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblJlcXVlc3RDb250aW51ZWQoKSB7CisgICAgICAgICAgICBtTnVtUmVxdWVzdENvbnRpbnVlZCsrOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25FcnJvcihpbnQgZXJyb3JDb2RlLCBTdHJpbmcgZXJyb3JNZXNzYWdlKSB7CisgICAgICAgICAgICBtTnVtRXJyb3JzKys7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJTZXNzaW9uLm9uRXJyb3I6ICIgKyBlcnJvckNvZGUgKyAiLCAiICsgZXJyb3JNZXNzYWdlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIElBY2NvdW50TWFuYWdlclJlc3BvbnNlIHJlc3BvbnNlID0gZ2V0UmVzcG9uc2VBbmRDbG9zZSgpOworICAgICAgICAgICAgaWYgKHJlc3BvbnNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiU2Vzc2lvbi5vbkVycm9yOiByZXNwb25kaW5nIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLm9uRXJyb3IoZXJyb3JDb2RlLCBlcnJvck1lc3NhZ2UpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiU2Vzc2lvbi5vbkVycm9yOiBjYXVnaHQgUmVtb3RlRXhjZXB0aW9uIHdoaWxlIHJlc3BvbmRpbmciLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIlNlc3Npb24ub25FcnJvcjogYWxyZWFkeSBjbG9zZWQiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIE1lc3NhZ2VIYW5kbGVyIGV4dGVuZHMgSGFuZGxlciB7CisgICAgICAgIE1lc3NhZ2VIYW5kbGVyKExvb3BlciBsb29wZXIpIHsKKyAgICAgICAgICAgIHN1cGVyKGxvb3Blcik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIGlmIChtQmluZEhlbHBlci5oYW5kbGVNZXNzYWdlKG1zZykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBNRVNTQUdFX1RJTUVEX09VVDoKKyAgICAgICAgICAgICAgICAgICAgU2Vzc2lvbiBzZXNzaW9uID0gKFNlc3Npb24pbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi5vblRpbWVkT3V0KCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigidW5oYW5kbGVkIG1lc3NhZ2U6ICIgKyBtc2cud2hhdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIERhdGFiYXNlSGVscGVyIGV4dGVuZHMgU1FMaXRlT3BlbkhlbHBlciB7CisgICAgICAgIHB1YmxpYyBEYXRhYmFzZUhlbHBlcihDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIERBVEFCQVNFX05BTUUsIG51bGwsIERBVEFCQVNFX1ZFUlNJT04pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ3JlYXRlKFNRTGl0ZURhdGFiYXNlIGRiKSB7CisgICAgICAgICAgICBkYi5leGVjU1FMKCJDUkVBVEUgVEFCTEUgIiArIFRBQkxFX0FDQ09VTlRTICsgIiAoICIKKyAgICAgICAgICAgICAgICAgICAgKyBBQ0NPVU5UU19JRCArICIgSU5URUdFUiBQUklNQVJZIEtFWSBBVVRPSU5DUkVNRU5ULCAiCisgICAgICAgICAgICAgICAgICAgICsgQUNDT1VOVFNfTkFNRSArICIgVEVYVCBOT1QgTlVMTCwgIgorICAgICAgICAgICAgICAgICAgICArIEFDQ09VTlRTX1RZUEUgKyAiIFRFWFQgTk9UIE5VTEwsICIKKyAgICAgICAgICAgICAgICAgICAgKyBBQ0NPVU5UU19QQVNTV09SRCArICIgVEVYVCwgIgorICAgICAgICAgICAgICAgICAgICArICJVTklRVUUoIiArIEFDQ09VTlRTX05BTUUgKyAiLCIgKyBBQ0NPVU5UU19UWVBFICsgIikpIik7CisKKyAgICAgICAgICAgIGRiLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSAiICsgVEFCTEVfQVVUSFRPS0VOUyArICIgKCAgIgorICAgICAgICAgICAgICAgICAgICArIEFVVEhUT0tFTlNfSUQgKyAiIElOVEVHRVIgUFJJTUFSWSBLRVkgQVVUT0lOQ1JFTUVOVCwgICIKKyAgICAgICAgICAgICAgICAgICAgKyBBVVRIVE9LRU5TX0FDQ09VTlRTX0lEICsgIiBJTlRFR0VSIE5PVCBOVUxMLCAiCisgICAgICAgICAgICAgICAgICAgICsgQVVUSFRPS0VOU19UWVBFICsgIiBURVhUIE5PVCBOVUxMLCAgIgorICAgICAgICAgICAgICAgICAgICArIEFVVEhUT0tFTlNfQVVUSFRPS0VOICsgIiBURVhULCAgIgorICAgICAgICAgICAgICAgICAgICArICJVTklRVUUgKCIgKyBBVVRIVE9LRU5TX0FDQ09VTlRTX0lEICsgIiwiICsgQVVUSFRPS0VOU19UWVBFICsgIikpIik7CisKKyAgICAgICAgICAgIGNyZWF0ZUdyYW50c1RhYmxlKGRiKTsKKworICAgICAgICAgICAgZGIuZXhlY1NRTCgiQ1JFQVRFIFRBQkxFICIgKyBUQUJMRV9FWFRSQVMgKyAiICggIgorICAgICAgICAgICAgICAgICAgICArIEVYVFJBU19JRCArICIgSU5URUdFUiBQUklNQVJZIEtFWSBBVVRPSU5DUkVNRU5ULCAiCisgICAgICAgICAgICAgICAgICAgICsgRVhUUkFTX0FDQ09VTlRTX0lEICsgIiBJTlRFR0VSLCAiCisgICAgICAgICAgICAgICAgICAgICsgRVhUUkFTX0tFWSArICIgVEVYVCBOT1QgTlVMTCwgIgorICAgICAgICAgICAgICAgICAgICArIEVYVFJBU19WQUxVRSArICIgVEVYVCwgIgorICAgICAgICAgICAgICAgICAgICArICJVTklRVUUoIiArIEVYVFJBU19BQ0NPVU5UU19JRCArICIsIiArIEVYVFJBU19LRVkgKyAiKSkiKTsKKworICAgICAgICAgICAgZGIuZXhlY1NRTCgiQ1JFQVRFIFRBQkxFICIgKyBUQUJMRV9NRVRBICsgIiAoICIKKyAgICAgICAgICAgICAgICAgICAgKyBNRVRBX0tFWSArICIgVEVYVCBQUklNQVJZIEtFWSBOT1QgTlVMTCwgIgorICAgICAgICAgICAgICAgICAgICArIE1FVEFfVkFMVUUgKyAiIFRFWFQpIik7CisKKyAgICAgICAgICAgIGNyZWF0ZUFjY291bnRzRGVsZXRpb25UcmlnZ2VyKGRiKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBjcmVhdGVBY2NvdW50c0RlbGV0aW9uVHJpZ2dlcihTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICAgICAgZGIuZXhlY1NRTCgiIgorICAgICAgICAgICAgICAgICAgICArICIgQ1JFQVRFIFRSSUdHRVIgIiArIFRBQkxFX0FDQ09VTlRTICsgIkRlbGV0ZSBERUxFVEUgT04gIiArIFRBQkxFX0FDQ09VTlRTCisgICAgICAgICAgICAgICAgICAgICsgIiBCRUdJTiIKKyAgICAgICAgICAgICAgICAgICAgKyAiICAgREVMRVRFIEZST00gIiArIFRBQkxFX0FVVEhUT0tFTlMKKyAgICAgICAgICAgICAgICAgICAgKyAiICAgICBXSEVSRSAiICsgQVVUSFRPS0VOU19BQ0NPVU5UU19JRCArICI9T0xELiIgKyBBQ0NPVU5UU19JRCArICIgOyIKKyAgICAgICAgICAgICAgICAgICAgKyAiICAgREVMRVRFIEZST00gIiArIFRBQkxFX0VYVFJBUworICAgICAgICAgICAgICAgICAgICArICIgICAgIFdIRVJFICIgKyBFWFRSQVNfQUNDT1VOVFNfSUQgKyAiPU9MRC4iICsgQUNDT1VOVFNfSUQgKyAiIDsiCisgICAgICAgICAgICAgICAgICAgICsgIiAgIERFTEVURSBGUk9NICIgKyBUQUJMRV9HUkFOVFMKKyAgICAgICAgICAgICAgICAgICAgKyAiICAgICBXSEVSRSAiICsgR1JBTlRTX0FDQ09VTlRTX0lEICsgIj1PTEQuIiArIEFDQ09VTlRTX0lEICsgIiA7IgorICAgICAgICAgICAgICAgICAgICArICIgRU5EIik7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgY3JlYXRlR3JhbnRzVGFibGUoU1FMaXRlRGF0YWJhc2UgZGIpIHsKKyAgICAgICAgICAgIGRiLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSAiICsgVEFCTEVfR1JBTlRTICsgIiAoICAiCisgICAgICAgICAgICAgICAgICAgICsgR1JBTlRTX0FDQ09VTlRTX0lEICsgIiBJTlRFR0VSIE5PVCBOVUxMLCAiCisgICAgICAgICAgICAgICAgICAgICsgR1JBTlRTX0FVVEhfVE9LRU5fVFlQRSArICIgU1RSSU5HIE5PVCBOVUxMLCAgIgorICAgICAgICAgICAgICAgICAgICArIEdSQU5UU19HUkFOVEVFX1VJRCArICIgSU5URUdFUiBOT1QgTlVMTCwgICIKKyAgICAgICAgICAgICAgICAgICAgKyAiVU5JUVVFICgiICsgR1JBTlRTX0FDQ09VTlRTX0lEICsgIiwiICsgR1JBTlRTX0FVVEhfVE9LRU5fVFlQRQorICAgICAgICAgICAgICAgICAgICArICAgIiwiICsgR1JBTlRTX0dSQU5URUVfVUlEICsgIikpIik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25VcGdyYWRlKFNRTGl0ZURhdGFiYXNlIGRiLCBpbnQgb2xkVmVyc2lvbiwgaW50IG5ld1ZlcnNpb24pIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgInVwZ3JhZGUgZnJvbSB2ZXJzaW9uICIgKyBvbGRWZXJzaW9uICsgIiB0byB2ZXJzaW9uICIgKyBuZXdWZXJzaW9uKTsKKworICAgICAgICAgICAgaWYgKG9sZFZlcnNpb24gPT0gMSkgeworICAgICAgICAgICAgICAgIC8vIG5vIGxvbmdlciBuZWVkIHRvIGRvIGFueXRoaW5nIHNpbmNlIHRoZSB3b3JrIGlzIGRvbmUKKyAgICAgICAgICAgICAgICAvLyB3aGVuIHVwZ3JhZGluZyBmcm9tIHZlcnNpb24gMgorICAgICAgICAgICAgICAgIG9sZFZlcnNpb24rKzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG9sZFZlcnNpb24gPT0gMikgeworICAgICAgICAgICAgICAgIGNyZWF0ZUdyYW50c1RhYmxlKGRiKTsKKyAgICAgICAgICAgICAgICBkYi5leGVjU1FMKCJEUk9QIFRSSUdHRVIgIiArIFRBQkxFX0FDQ09VTlRTICsgIkRlbGV0ZSIpOworICAgICAgICAgICAgICAgIGNyZWF0ZUFjY291bnRzRGVsZXRpb25UcmlnZ2VyKGRiKTsKKyAgICAgICAgICAgICAgICBvbGRWZXJzaW9uKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25PcGVuKFNRTGl0ZURhdGFiYXNlIGRiKSB7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIExvZy52KFRBRywgIm9wZW5lZCBkYXRhYmFzZSAiICsgREFUQUJBU0VfTkFNRSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2V0TWV0YVZhbHVlKFN0cmluZyBrZXksIFN0cmluZyB2YWx1ZSkgeworICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgIHZhbHVlcy5wdXQoTUVUQV9LRVksIGtleSk7CisgICAgICAgIHZhbHVlcy5wdXQoTUVUQV9WQUxVRSwgdmFsdWUpOworICAgICAgICBtT3BlbkhlbHBlci5nZXRXcml0YWJsZURhdGFiYXNlKCkucmVwbGFjZShUQUJMRV9NRVRBLCBNRVRBX0tFWSwgdmFsdWVzKTsKKyAgICB9CisKKyAgICBwcml2YXRlIFN0cmluZyBnZXRNZXRhVmFsdWUoU3RyaW5nIGtleSkgeworICAgICAgICBDdXJzb3IgYyA9IG1PcGVuSGVscGVyLmdldFJlYWRhYmxlRGF0YWJhc2UoKS5xdWVyeShUQUJMRV9NRVRBLAorICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXtNRVRBX1ZBTFVFfSwgTUVUQV9LRVkgKyAiPT8iLCBuZXcgU3RyaW5nW117a2V5fSwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoYy5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gYy5nZXRTdHJpbmcoMCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGMuY2xvc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgU2ltV2F0Y2hlciBleHRlbmRzIEJyb2FkY2FzdFJlY2VpdmVyIHsKKyAgICAgICAgcHVibGljIFNpbVdhdGNoZXIoQ29udGV4dCBj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nIGhhcHBlbnMgaWYgdGhlIElNU0kgaXMgbWlzc2luZyBvciB1bmNoYW5nZWQuCisgICAgICAgICAgICBTdHJpbmcgaW1zaSA9ICgoVGVsZXBob255TWFuYWdlcikgY29udGV4dC5nZXRTeXN0ZW1TZXJ2aWNlKAorICAgICAgICAgICAgICAgICAgICBDb250ZXh0LlRFTEVQSE9OWV9TRVJWSUNFKSkuZ2V0U3Vic2NyaWJlcklkKCk7CisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoaW1zaSkpIHJldHVybjsKKworICAgICAgICAgICAgU3RyaW5nIHN0b3JlZEltc2kgPSBnZXRNZXRhVmFsdWUoImltc2kiKTsKKworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiY3VycmVudCBJTVNJPSIgKyBpbXNpICsgIjsgc3RvcmVkIElNU0k9IiArIHN0b3JlZEltc2kpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIWltc2kuZXF1YWxzKHN0b3JlZEltc2kpICYmICFUZXh0VXRpbHMuaXNFbXB0eShzdG9yZWRJbXNpKSkgeworICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ3aXBpbmcgYWxsIHBhc3N3b3JkcyBhbmQgYXV0aHRva2VucyIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTUUxpdGVEYXRhYmFzZSBkYiA9IG1PcGVuSGVscGVyLmdldFdyaXRhYmxlRGF0YWJhc2UoKTsKKyAgICAgICAgICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgZGIuZXhlY1NRTCgiREVMRVRFIGZyb20gIiArIFRBQkxFX0FVVEhUT0tFTlMpOworICAgICAgICAgICAgICAgICAgICBkYi5leGVjU1FMKCJVUERBVEUgIiArIFRBQkxFX0FDQ09VTlRTICsgIiBTRVQgIiArIEFDQ09VTlRTX1BBU1NXT1JEICsgIiA9ICcnIik7CisgICAgICAgICAgICAgICAgICAgIHNlbmRBY2NvdW50c0NoYW5nZWRCcm9hZGNhc3QoKTsKKyAgICAgICAgICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgZGIuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzZXRNZXRhVmFsdWUoImltc2kiLCBpbXNpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBJQmluZGVyIG9uQmluZChJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIHJldHVybiBhc0JpbmRlcigpOworICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIGR1bXAoRmlsZURlc2NyaXB0b3IgZmQsIFByaW50V3JpdGVyIGZvdXQsIFN0cmluZ1tdIGFyZ3MpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtU2Vzc2lvbnMpIHsKKyAgICAgICAgICAgIGZpbmFsIGxvbmcgbm93ID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7CisgICAgICAgICAgICBmb3V0LnByaW50bG4oIkFjY291bnRNYW5hZ2VyU2VydmljZTogIiArIG1TZXNzaW9ucy5zaXplKCkgKyAiIHNlc3Npb25zIik7CisgICAgICAgICAgICBmb3IgKFNlc3Npb24gc2Vzc2lvbiA6IG1TZXNzaW9ucy52YWx1ZXMoKSkgeworICAgICAgICAgICAgICAgIGZvdXQucHJpbnRsbigiICAiICsgc2Vzc2lvbi50b0RlYnVnU3RyaW5nKG5vdykpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm91dC5wcmludGxuKCk7CisKKyAgICAgICAgbUF1dGhlbnRpY2F0b3JDYWNoZS5kdW1wKGZkLCBmb3V0LCBhcmdzKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZG9Ob3RpZmljYXRpb24oQWNjb3VudCBhY2NvdW50LCBDaGFyU2VxdWVuY2UgbWVzc2FnZSwgSW50ZW50IGludGVudCkgeworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiZG9Ob3RpZmljYXRpb246ICIgKyBtZXNzYWdlICsgIiBpbnRlbnQ6IiArIGludGVudCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpbnRlbnQuZ2V0Q29tcG9uZW50KCkgIT0gbnVsbCAmJgorICAgICAgICAgICAgICAgICAgICBHcmFudENyZWRlbnRpYWxzUGVybWlzc2lvbkFjdGl2aXR5LmNsYXNzLmdldE5hbWUoKS5lcXVhbHMoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LmdldENvbXBvbmVudCgpLmdldENsYXNzTmFtZSgpKSkgeworICAgICAgICAgICAgICAgIGNyZWF0ZU5vQ3JlZGVudGlhbHNQZXJtaXNzaW9uTm90aWZpY2F0aW9uKGFjY291bnQsIGludGVudCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBuID0gbmV3IE5vdGlmaWNhdGlvbihhbmRyb2lkLlIuZHJhd2FibGUuc3RhdF9zeXNfd2FybmluZywgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIDAgLyogd2hlbiAqLyk7CisgICAgICAgICAgICAgICAgbi5zZXRMYXRlc3RFdmVudEluZm8obUNvbnRleHQsIG1Db250ZXh0LmdldFRleHQoUi5zdHJpbmcubm90aWZpY2F0aW9uX3RpdGxlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UsIFBlbmRpbmdJbnRlbnQuZ2V0QWN0aXZpdHkoCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dCwgMCwgaW50ZW50LCBQZW5kaW5nSW50ZW50LkZMQUdfQ0FOQ0VMX0NVUlJFTlQpKTsKKyAgICAgICAgICAgICAgICAoKE5vdGlmaWNhdGlvbk1hbmFnZXIpIG1Db250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5OT1RJRklDQVRJT05fU0VSVklDRSkpCisgICAgICAgICAgICAgICAgICAgICAgICAubm90aWZ5KGdldFNpZ25pblJlcXVpcmVkTm90aWZpY2F0aW9uSWQoYWNjb3VudCksIG4pOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjYW5jZWxOb3RpZmljYXRpb24oaW50IGlkKSB7CisgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICAoKE5vdGlmaWNhdGlvbk1hbmFnZXIpIG1Db250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5OT1RJRklDQVRJT05fU0VSVklDRSkpCisgICAgICAgICAgICAgICAgLmNhbmNlbChpZCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGNoZWNrQmluZGVyUGVybWlzc2lvbihTdHJpbmcgcGVybWlzc2lvbikgeworICAgICAgICBmaW5hbCBpbnQgdWlkID0gQmluZGVyLmdldENhbGxpbmdVaWQoKTsKKyAgICAgICAgaWYgKG1Db250ZXh0LmNoZWNrQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24ocGVybWlzc2lvbikgIT0KKyAgICAgICAgICAgICAgICBQYWNrYWdlTWFuYWdlci5QRVJNSVNTSU9OX0dSQU5URUQpIHsKKyAgICAgICAgICAgIFN0cmluZyBtc2cgPSAiY2FsbGVyIHVpZCAiICsgdWlkICsgIiBsYWNrcyAiICsgcGVybWlzc2lvbjsKKyAgICAgICAgICAgIExvZy53KFRBRywgbXNnKTsKKyAgICAgICAgICAgIHRocm93IG5ldyBTZWN1cml0eUV4Y2VwdGlvbihtc2cpOworICAgICAgICB9CisgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgTG9nLnYoVEFHLCAiY2FsbGVyIHVpZCAiICsgdWlkICsgIiBoYXMgIiArIHBlcm1pc3Npb24pOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGluU3lzdGVtSW1hZ2UoaW50IGNhbGxlclVpZCkgeworICAgICAgICBTdHJpbmdbXSBwYWNrYWdlcyA9IG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCkuZ2V0UGFja2FnZXNGb3JVaWQoY2FsbGVyVWlkKTsKKyAgICAgICAgZm9yIChTdHJpbmcgbmFtZSA6IHBhY2thZ2VzKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIFBhY2thZ2VJbmZvIHBhY2thZ2VJbmZvID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCkuZ2V0UGFja2FnZUluZm8obmFtZSwgMCAvKiBmbGFncyAqLyk7CisgICAgICAgICAgICAgICAgaWYgKChwYWNrYWdlSW5mby5hcHBsaWNhdGlvbkluZm8uZmxhZ3MgJiBBcHBsaWNhdGlvbkluZm8uRkxBR19TWVNURU0pICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoUGFja2FnZU1hbmFnZXIuTmFtZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBwZXJtaXNzaW9uSXNHcmFudGVkKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhUb2tlblR5cGUsIGludCBjYWxsZXJVaWQpIHsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBmcm9tQXV0aGVudGljYXRvciA9IGhhc0F1dGhlbnRpY2F0b3JVaWQoYWNjb3VudC50eXBlLCBjYWxsZXJVaWQpOworICAgICAgICBmaW5hbCBib29sZWFuIGhhc0V4cGxpY2l0R3JhbnRzID0gaGFzRXhwbGljaXRseUdyYW50ZWRQZXJtaXNzaW9uKGFjY291bnQsIGF1dGhUb2tlblR5cGUpOworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgIExvZy52KFRBRywgImNoZWNrR3JhbnRzT3JDYWxsaW5nVWlkQWdhaW5zdEF1dGhlbnRpY2F0b3I6IGNhbGxlciB1aWQgIgorICAgICAgICAgICAgICAgICAgICArIGNhbGxlclVpZCArICIsIGFjY291bnQgIiArIGFjY291bnQKKyAgICAgICAgICAgICAgICAgICAgKyAiOiBpcyBhdXRoZW50aWNhdG9yPyAiICsgZnJvbUF1dGhlbnRpY2F0b3IKKyAgICAgICAgICAgICAgICAgICAgKyAiLCBoYXMgZXhwbGljaXQgcGVybWlzc2lvbj8gIiArIGhhc0V4cGxpY2l0R3JhbnRzKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZnJvbUF1dGhlbnRpY2F0b3IgfHwgaGFzRXhwbGljaXRHcmFudHMgfHwgaW5TeXN0ZW1JbWFnZShjYWxsZXJVaWQpOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBoYXNBdXRoZW50aWNhdG9yVWlkKFN0cmluZyBhY2NvdW50VHlwZSwgaW50IGNhbGxpbmdVaWQpIHsKKyAgICAgICAgZm9yIChSZWdpc3RlcmVkU2VydmljZXNDYWNoZS5TZXJ2aWNlSW5mbzxBdXRoZW50aWNhdG9yRGVzY3JpcHRpb24+IHNlcnZpY2VJbmZvIDoKKyAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvckNhY2hlLmdldEFsbFNlcnZpY2VzKCkpIHsKKyAgICAgICAgICAgIGlmIChzZXJ2aWNlSW5mby50eXBlLnR5cGUuZXF1YWxzKGFjY291bnRUeXBlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiAoc2VydmljZUluZm8udWlkID09IGNhbGxpbmdVaWQpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAobUNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKS5jaGVja1NpZ25hdHVyZXMoc2VydmljZUluZm8udWlkLCBjYWxsaW5nVWlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSBQYWNrYWdlTWFuYWdlci5TSUdOQVRVUkVfTUFUQ0gpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaGFzRXhwbGljaXRseUdyYW50ZWRQZXJtaXNzaW9uKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhUb2tlblR5cGUpIHsKKyAgICAgICAgaWYgKEJpbmRlci5nZXRDYWxsaW5nVWlkKCkgPT0gYW5kcm9pZC5vcy5Qcm9jZXNzLlNZU1RFTV9VSUQpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiID0gbU9wZW5IZWxwZXIuZ2V0UmVhZGFibGVEYXRhYmFzZSgpOworICAgICAgICBTdHJpbmdbXSBhcmdzID0ge1N0cmluZy52YWx1ZU9mKEJpbmRlci5nZXRDYWxsaW5nVWlkKCkpLCBhdXRoVG9rZW5UeXBlLAorICAgICAgICAgICAgICAgIGFjY291bnQubmFtZSwgYWNjb3VudC50eXBlfTsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBwZXJtaXNzaW9uR3JhbnRlZCA9CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5sb25nRm9yUXVlcnkoZGIsIENPVU5UX09GX01BVENISU5HX0dSQU5UUywgYXJncykgIT0gMDsKKyAgICAgICAgaWYgKCFwZXJtaXNzaW9uR3JhbnRlZCAmJiBpc0RlYnVnZ2FibGVNb25rZXlCdWlsZCkgeworICAgICAgICAgICAgLy8gVE9ETzogU2tpcCB0aGlzIGNoZWNrIHdoZW4gcnVubmluZyBhdXRvbWF0ZWQgdGVzdHMuIFJlcGxhY2UgdGhpcworICAgICAgICAgICAgLy8gd2l0aCBhIG1vcmUgZ2VuZXJhbCBzb2x1dGlvbi4KKyAgICAgICAgICAgIExvZy53KFRBRywgIm5vIGNyZWRlbnRpYWxzIHBlcm1pc3Npb24gZm9yIHVzYWdlIG9mICIgKyBhY2NvdW50ICsgIiwgIgorICAgICAgICAgICAgICAgICAgICArIGF1dGhUb2tlblR5cGUgKyAiIGJ5IHVpZCAiICsgQmluZGVyLmdldENhbGxpbmdVaWQoKQorICAgICAgICAgICAgICAgICAgICArICIgYnV0IGlnbm9yaW5nIHNpbmNlIHRoaXMgaXMgYSBtb25rZXkgYnVpbGQiKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBwZXJtaXNzaW9uR3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taXNzaW9uLkdFVF9BQ0NPVU5UUyk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGNoZWNrTWFuYWdlQWNjb3VudHNQZXJtaXNzaW9uKCkgeworICAgICAgICBjaGVja0JpbmRlclBlcm1pc3Npb24oTWFuaWZlc3QucGVybWlzc2lvbi5NQU5BR0VfQUNDT1VOVFMpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFsbG93IGNhbGxlcnMgd2l0aCB0aGUgZ2l2ZW4gdWlkIHBlcm1pc3Npb24gdG8gZ2V0IGNyZWRlbnRpYWxzIGZvciBhY2NvdW50L2F1dGhUb2tlblR5cGUuCisgICAgICogPHA+CisgICAgICogQWx0aG91Z2ggdGhpcyBpcyBwdWJsaWMgaXQgY2FuIG9ubHkgYmUgYWNjZXNzZWQgdmlhIHRoZSBBY2NvdW50TWFuYWdlclNlcnZpY2Ugb2JqZWN0CisgICAgICogd2hpY2ggaXMgaW4gdGhlIHN5c3RlbS4gVGhpcyBtZWFucyB3ZSBkb24ndCBuZWVkIHRvIHByb3RlY3QgaXQgd2l0aCBwZXJtaXNzaW9ucy4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGdyYW50QXBwUGVybWlzc2lvbihBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRoVG9rZW5UeXBlLCBpbnQgdWlkKSB7CisgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiID0gbU9wZW5IZWxwZXIuZ2V0V3JpdGFibGVEYXRhYmFzZSgpOworICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBsb25nIGFjY291bnRJZCA9IGdldEFjY291bnRJZChkYiwgYWNjb3VudCk7CisgICAgICAgICAgICBpZiAoYWNjb3VudElkID49IDApIHsKKyAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgIC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GVybWlzc2lvbihBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRoVG9rZW5UeXBlLCBpbnQgdWlkKSB7CisgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiID0gbU9wZW5IZWxwZXIuZ2V0V3JpdGFibGVEYXRhYmFzZSgpOworICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBsb25nIGFjY291bnRJZCA9IGdldEFjY291bnRJZChkYiwgYWNjb3VudCk7CisgICAgICAgICAgICBpZiAoYWNjb3VudElkID49IDApIHsKKyAgICAgICAgICAgICAgICBkYi5kZWxldGUoVEFCTEVfR1JBTlRTLAorICAgICAgICAgICAgICAgICAgICAgICAgR1JBTlRTX0FDQ09VTlRTX0lEICsgIj0/IEFORCAiICsgR1JBTlRTX0FVVEhfVE9LRU5fVFlQRSArICI9PyBBTkQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIEdSQU5UU19HUkFOVEVFX1VJRCArICI9PyIsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW117U3RyaW5nLnZhbHVlT2YoYWNjb3VudElkKSwgYXV0aFRva2VuVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nLnZhbHVlT2YodWlkKX0pOworICAgICAgICAgICAgICAgIGRiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgZGIuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgfQorICAgICAgICBjYW5jZWxOb3RpZmljYXRpb24oZ2V0Q3JlZGVudGlhbFBlcm1pc3Npb25Ob3RpZmljYXRpb25JZChhY2NvdW50LCBhdXRoVG9rZW5UeXBlLCB1aWQpKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hY2NvdW50cy9BY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FDS0dST1VORCk7Ci0gICAgICAgICAgICBJQWNjb3VudHNTZXJ2aWNlIGFjY291bnRzU2VydmljZSA9IElBY2NvdW50c1NlcnZpY2UuU3R1Yi5hc0ludGVyZmFjZShtU2VydmljZSk7Ci0gICAgICAgICAgICBTdHJpbmdbXSBhY2NvdW50cyA9IG51bGw7Ci0gICAgICAgICAgICBkbyB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgYWNjb3VudHMgPSBhY2NvdW50c1NlcnZpY2UuZ2V0QWNjb3VudHMoKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGUgc2VydmljZSB3YXMga2lsbGVkIHRoZW4gdGhlIHN5c3RlbSB3aWxsIHJlc3RhcnQgaXQgYW5kIHdoZW4gaXQgZG9lcyB3ZQotICAgICAgICAgICAgICAgICAgICAvLyB3aWxsIGdldCBhbm90aGVyIG9uU2VydmljZUNvbm5lY3RlZCwgYXQgd2hpY2ggcG9pbnQgd2Ugd2lsbCBkbyBhIG5vdGlmeS4KLSAgICAgICAgICAgICAgICAgICAgTG9nLncoIkFjY291bnRNb25pdG9yIiwgIlJlbW90ZSBleGNlcHRpb24gd2hlbiBnZXR0aW5nIGFjY291bnRzIiwgZSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKEFjY291bnRNb25pdG9yLnRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgLS1wZW5kaW5nOwotICAgICAgICAgICAgICAgICAgICBpZiAocGVuZGluZyA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gd2hpbGUgKHRydWUpOwotCi0gICAgICAgICAgICBtQ29udGV4dC51bmJpbmRTZXJ2aWNlKEFjY291bnRNb25pdG9yLnRoaXMpOwotCi0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1MaXN0ZW5lci5vbkFjY291bnRzVXBkYXRlZChhY2NvdW50cyk7Ci0gICAgICAgICAgICB9IGNhdGNoIChTUUxFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIC8vIEJldHRlciBsdWNrIG5leHQgdGltZS4gIElmIHRoZSBwcm9ibGVtIHdhcyBkaXNrLWZ1bGwsCi0gICAgICAgICAgICAgICAgLy8gdGhlIFNUT1JBR0VfT0sgaW50ZW50IHdpbGwgcmUtdHJpZ2dlciB0aGUgdXBkYXRlLgotICAgICAgICAgICAgICAgIExvZy5lKCJBY2NvdW50TW9uaXRvciIsICJDYW4ndCB1cGRhdGUgYWNjb3VudHMiLCBlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIEluaXRpYWxpemVzIHRoZSBBY2NvdW50TW9uaXRvciBhbmQgaW5pdGlhdGVzIGEgYmluZCB0byB0aGUKLSAgICAgKiBBY2NvdW50c1NlcnZpY2UgdG8gZ2V0IHRoZSBpbml0aWFsIGFjY291bnQgbGlzdC4gIEZvciAxLjAsCi0gICAgICogdGhlICJsaXN0IiBpcyBhbHdheXMgYSBzaW5nbGUgYWNjb3VudC4KLSAgICAgKgotICAgICAqIEBwYXJhbSBjb250ZXh0IHRoZSBjb250ZXh0IHdlIGFyZSBydW5uaW5nIGluCi0gICAgICogQHBhcmFtIGxpc3RlbmVyIHRoZSB1c2VyIHRvIG5vdGlmeSB3aGVuIHRoZSBhY2NvdW50IHNldCBjaGFuZ2VzCi0gICAgICovCi0gICAgcHVibGljIEFjY291bnRNb25pdG9yKENvbnRleHQgY29udGV4dCwgQWNjb3VudE1vbml0b3JMaXN0ZW5lciBsaXN0ZW5lcikgewotICAgICAgICBpZiAobGlzdGVuZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigibGlzdGVuZXIgaXMgbnVsbCIpOwotICAgICAgICB9Ci0KLSAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OwotICAgICAgICBtTGlzdGVuZXIgPSBsaXN0ZW5lcjsKLQotICAgICAgICAvLyBSZWdpc3RlciBhIGJyb2FkY2FzdCByZWNlaXZlciB0byBtb25pdG9yIGFjY291bnQgY2hhbmdlcwotICAgICAgICBJbnRlbnRGaWx0ZXIgaW50ZW50RmlsdGVyID0gbmV3IEludGVudEZpbHRlcigpOwotICAgICAgICBpbnRlbnRGaWx0ZXIuYWRkQWN0aW9uKEFjY291bnRzU2VydmljZUNvbnN0YW50cy5MT0dJTl9BQ0NPVU5UU19DSEFOR0VEX0FDVElPTik7Ci0gICAgICAgIGludGVudEZpbHRlci5hZGRBY3Rpb24oSW50ZW50LkFDVElPTl9ERVZJQ0VfU1RPUkFHRV9PSyk7ICAvLyBUbyByZWNvdmVyIGZyb20gZGlzay1mdWxsLgotICAgICAgICBtQ29udGV4dC5yZWdpc3RlclJlY2VpdmVyKHRoaXMsIGludGVudEZpbHRlcik7Ci0KLSAgICAgICAgLy8gU2VuZCB0aGUgbGlzdGVuZXIgdGhlIGluaXRpYWwgc3RhdGUgbm93LgotICAgICAgICBub3RpZnlMaXN0ZW5lcigpOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKLSAgICAgICAgbm90aWZ5TGlzdGVuZXIoKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VDb25uZWN0ZWQoQ29tcG9uZW50TmFtZSBjbGFzc05hbWUsIElCaW5kZXIgc2VydmljZSkgewotICAgICAgICAvLyBDcmVhdGUgYSBiYWNrZ3JvdW5kIHRocmVhZCB0byB1cGRhdGUgdGhlIGFjY291bnRzLgotICAgICAgICBuZXcgQWNjb3VudFVwZGF0ZXIoc2VydmljZSkuc3RhcnQoKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoQ29tcG9uZW50TmFtZSBjbGFzc05hbWUpIHsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIG5vdGlmeUxpc3RlbmVyKCkgewotICAgICAgICBpZiAocGVuZGluZyA9PSAwKSB7Ci0gICAgICAgICAgICAvLyBpbml0aWF0ZSB0aGUgYmluZAotICAgICAgICAgICAgaWYgKCFtQ29udGV4dC5iaW5kU2VydmljZShBY2NvdW50c1NlcnZpY2VDb25zdGFudHMuU0VSVklDRV9JTlRFTlQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMsIENvbnRleHQuQklORF9BVVRPX0NSRUFURSkpIHsKLSAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIG5vcm1hbCBpZiBHTFMgaXNuJ3QgcGFydCBvZiB0aGlzIGJ1aWxkLgotICAgICAgICAgICAgICAgIExvZy53KCJBY2NvdW50TW9uaXRvciIsCi0gICAgICAgICAgICAgICAgICAgICAgIkNvdWxkbid0IGNvbm5lY3QgdG8gIiAgKwotICAgICAgICAgICAgICAgICAgICAgIEFjY291bnRzU2VydmljZUNvbnN0YW50cy5TRVJWSUNFX0lOVEVOVCArCi0gICAgICAgICAgICAgICAgICAgICAgIiAoTWlzc2luZyBzZXJ2aWNlPykiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIGFscmVhZHkgYm91bmQuICBiaW5kU2VydmljZSB3aWxsIG5vdCB0cmlnZ2VyIGFub3RoZXIKLSAgICAgICAgICAgIC8vIGNhbGwgdG8gb25TZXJ2aWNlQ29ubmVjdGVkLCBzbyBpbnN0ZWFkIHdlIG1ha2Ugc3Vy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sZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAidGhlIHNlcnZpY2UgaXMgY29ubmVjdGVkLCBzY2hlZHVsaW5nIGEgY29ubmVjdGVkIG1lc3NhZ2UgZm9yICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBhdXRoZW50aWNhdG9yVHlwZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zY2hlZHVsZUNhbGxiYWNrQ29ubmVjdGVkTWVzc2FnZShjYWxsYmFjayk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ0aGUgc2VydmljZSBpcyAqbm90KiBjb25uZWN0ZWQsIHdhaXRpbmcgZm9yIGZvciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYXV0aGVudGljYXRvclR5cGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ0aGVyZSBpcyBubyBzZXJ2aWNlIGNvbm5lY3Rpb24gZm9yICIgKyBhdXRoZW50aWNhdG9yVHlwZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIG90aGVyd2lzZSBmaW5kIHRoZSBjb21wb25lbnQgbmFtZSBmb3IgdGhlIGF1dGhlbnRpY2F0b3IgYW5kIGluaXRpYXRlIGEgYmluZAorICAgICAgICAgICAgLy8gaWYgbm8gYXV0aGVudGljYXRvciBvciB0aGUgYmluZCBmYWlscyB0aGVuIHJldHVybiBmYWxzZSwgb3RoZXJ3aXNlIHJldHVybiB0cnVlCisgICAgICAgICAgICBBY2NvdW50QXV0aGVudGljYXRvckNhY2hlLlNlcnZpY2VJbmZvPEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvbj4gYXV0aGVudGljYXRvckluZm8gPQorICAgICAgICAgICAgICAgICAgICBtQXV0aGVudGljYXRvckNhY2hlLmdldFNlcnZpY2VJbmZvKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvbi5uZXdLZXkoYXV0aGVudGljYXRvclR5cGUpKTsKKyAgICAgICAgICAgIGlmIChhdXRoZW50aWNhdG9ySW5mbyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInRoZXJlIGlzIG5vIGF1dGhlbnRpY2F0b3IgZm9yICIgKyBhdXRoZW50aWNhdG9yVHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgYmFpbGluZyBvdXQiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBNeVNlcnZpY2VDb25uZWN0aW9uIGNvbm5lY3Rpb24gPSBuZXcgTXlTZXJ2aWNlQ29ubmVjdGlvbihhdXRoZW50aWNhdG9yVHlwZSk7CisKKyAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KCk7CisgICAgICAgICAgICBpbnRlbnQuc2V0QWN0aW9uKCJhbmRyb2lkLmFjY291bnRzLkFjY291bnRBdXRoZW50aWNhdG9yIik7CisgICAgICAgICAgICBpbnRlbnQuc2V0Q29tcG9uZW50KGF1dGhlbnRpY2F0b3JJbmZvLmNvbXBvbmVudE5hbWUpOworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicGVyZm9ybWluZyBiaW5kU2VydmljZSB0byAiICsgYXV0aGVudGljYXRvckluZm8uY29tcG9uZW50TmFtZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIW1Db250ZXh0LmJpbmRTZXJ2aWNlKGludGVudCwgY29ubmVjdGlvbiwgQ29udGV4dC5CSU5EX0FVVE9fQ1JFQVRFKSkgeworICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJiaW5kU2VydmljZSB0byAiICsgYXV0aGVudGljYXRvckluZm8uY29tcG9uZW50TmFtZSArICIgZmFpbGVkIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbVNlcnZpY2VDb25uZWN0aW9ucy5wdXQoYXV0aGVudGljYXRvclR5cGUsIGNvbm5lY3Rpb24pOworICAgICAgICAgICAgbVNlcnZpY2VVc2Vycy5wdXQoYXV0aGVudGljYXRvclR5cGUsIExpc3RzLm5ld0FycmF5TGlzdChjYWxsYmFjaykpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1bmJpbmQoQ2FsbGJhY2sgY2FsbGJhY2tUb1VuYmluZCkgeworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgIExvZy52KFRBRywgInVuYmluZGluZyBjYWxsYmFjayAiICsgY2FsbGJhY2tUb1VuYmluZCk7CisgICAgICAgIH0KKyAgICAgICAgc3luY2hyb25pemVkIChtU2VydmljZUNvbm5lY3Rpb25zKSB7CisgICAgICAgICAgICBmb3IgKE1hcC5FbnRyeTxTdHJpbmcsIEFycmF5TGlzdDxDYWxsYmFjaz4+IGVudHJ5IDogbVNlcnZpY2VVc2Vycy5lbnRyeVNldCgpKSB7CisgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGF1dGhlbnRpY2F0b3JUeXBlID0gZW50cnkuZ2V0S2V5KCk7CisgICAgICAgICAgICAgICAgZmluYWwgQXJyYXlMaXN0PENhbGxiYWNrPiBzZXJ2aWNlVXNlcnMgPSBlbnRyeS5nZXRWYWx1ZSgpOworICAgICAgICAgICAgICAgIGZvciAoQ2FsbGJhY2sgY2FsbGJhY2sgOiBzZXJ2aWNlVXNlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrID09IGNhbGxiYWNrVG9VbmJpbmQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImZvdW5kIGNhbGxiYWNrIGluIHNlcnZpY2UiICsgYXV0aGVudGljYXRvclR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2VydmljZVVzZXJzLnJlbW92ZShjYWxsYmFja1RvVW5iaW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXJ2aWNlVXNlcnMuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInRoZXJlIGFyZSBubyBtb3JlIGNhbGxiYWNrcyBmb3Igc2VydmljZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBhdXRoZW50aWNhdG9yVHlwZSArICIsIHVuYmluZGluZyBzZXJ2aWNlIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuYmluZEZyb21TZXJ2aWNlKGF1dGhlbnRpY2F0b3JUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImxlYXZpbmcgc2VydmljZSAiICsgYXV0aGVudGljYXRvclR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgYXJvdW5kIHNpbmNlIHRoZXJlIGFyZSBzdGlsbCBjYWxsYmFja3MgdXNpbmcgaXQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBMb2cuZShUQUcsICJkaWQgbm90IGZpbmQgY2FsbGJhY2sgIiArIGNhbGxiYWNrVG9VbmJpbmQgKyAiIGluIGFueSBvZiB0aGUgc2VydmljZXMiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1bmJpbmRGcm9tU2VydmljZShTdHJpbmcgYXV0aGVudGljYXRvclR5cGUpIHsKKyAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICBMb2cudihUQUcsICJ1bmJpbmRTZXJ2aWNlIGZyb20gIiArIGF1dGhlbnRpY2F0b3JUeXBlKTsKKyAgICAgICAgfQorICAgICAgICBtQ29udGV4dC51bmJpbmRTZXJ2aWNlKG1TZXJ2aWNlQ29ubmVjdGlvbnMuZ2V0KGF1dGhlbnRpY2F0b3JUeXBlKSk7CisgICAgICAgIG1TZXJ2aWNlVXNlcnMucmVtb3ZlKGF1dGhlbnRpY2F0b3JUeXBlKTsKKyAgICAgICAgbVNlcnZpY2VDb25uZWN0aW9ucy5yZW1vdmUoYXV0aGVudGljYXRvclR5cGUpOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgQ29ubmVjdGVkTWVzc2FnZVBheWxvYWQgeworICAgICAgICBwdWJsaWMgZmluYWwgSUJpbmRlciBtU2VydmljZTsKKyAgICAgICAgcHVibGljIGZpbmFsIENhbGxiYWNrIG1DYWxsYmFjazsKKyAgICAgICAgcHVibGljIENvbm5lY3RlZE1lc3NhZ2VQYXlsb2FkKElCaW5kZXIgc2VydmljZSwgQ2FsbGJhY2sgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIG1TZXJ2aWNlID0gc2VydmljZTsKKyAgICAgICAgICAgIG1DYWxsYmFjayA9IGNhbGxiYWNrOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBNeVNlcnZpY2VDb25uZWN0aW9uIGltcGxlbWVudHMgU2VydmljZUNvbm5lY3Rpb24geworICAgICAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtQXV0aGVudGljYXRvclR5cGU7CisgICAgICAgIHByaXZhdGUgSUJpbmRlciBtU2VydmljZSA9IG51bGw7CisKKyAgICAgICAgcHVibGljIE15U2VydmljZUNvbm5lY3Rpb24oU3RyaW5nIGF1dGhlbnRpY2F0b3JUeXBlKSB7CisgICAgICAgICAgICBtQXV0aGVudGljYXRvclR5cGUgPSBhdXRoZW50aWNhdG9yVHlwZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZUNvbm5lY3RlZChDb21wb25lbnROYW1lIG5hbWUsIElCaW5kZXIgc2VydmljZSkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAib25TZXJ2aWNlQ29ubmVjdGVkIGZvciBhY2NvdW50IHR5cGUgIiArIG1BdXRoZW50aWNhdG9yVHlwZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBwb3N0IGEgbWVzc2FnZSBmb3IgZWFjaCBzZXJ2aWNlIHVzZXIgdG8gdGVsbCB0aGVtIHRoYXQgdGhlIHNlcnZpY2UgaXMgY29ubmVjdGVkCisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TZXJ2aWNlQ29ubmVjdGlvbnMpIHsKKyAgICAgICAgICAgICAgICBtU2VydmljZSA9IHNlcnZpY2U7CisgICAgICAgICAgICAgICAgZm9yIChDYWxsYmFjayBjYWxsYmFjayA6IG1TZXJ2aWNlVXNlcnMuZ2V0KG1BdXRoZW50aWNhdG9yVHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ0aGUgc2VydmljZSBiZWNhbWUgY29ubmVjdGVkLCBzY2hlZHVsaW5nIGEgY29ubmVjdGVkICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAibWVzc2FnZSBmb3IgIiArIG1BdXRoZW50aWNhdG9yVHlwZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGVDYWxsYmFja0Nvbm5lY3RlZE1lc3NhZ2UoY2FsbGJhY2spOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBzY2hlZHVsZUNhbGxiYWNrQ29ubmVjdGVkTWVzc2FnZShDYWxsYmFjayBjYWxsYmFjaykgeworICAgICAgICAgICAgZmluYWwgQ29ubmVjdGVkTWVzc2FnZVBheWxvYWQgcGF5bG9hZCA9CisgICAgICAgICAgICAgICAgICAgIG5ldyBDb25uZWN0ZWRNZXNzYWdlUGF5bG9hZChtU2VydmljZSwgY2FsbGJhY2spOworICAgICAgICAgICAgbUhhbmRsZXIub2J0YWluTWVzc2FnZShtTWVzc2FnZVdoYXRDb25uZWN0ZWQsIHBheWxvYWQpLnNlbmRUb1RhcmdldCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlRGlzY29ubmVjdGVkKENvbXBvbmVudE5hbWUgbmFtZSkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAib25TZXJ2aWNlRGlzY29ubmVjdGVkIGZvciBhY2NvdW50IHR5cGUgIiArIG1BdXRoZW50aWNhdG9yVHlwZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBwb3N0IGEgbWVzc2FnZSBmb3IgZWFjaCBzZXJ2aWNlIHVzZXIgdG8gdGVsbCB0aGVtIHRoYXQgdGhlIHNlcnZpY2UgaXMgZGlzY29ubmVjdGVkLAorICAgICAgICAgICAgLy8gYW5kIHVuYmluZCBmcm9tIHRoZSBzZXJ2aWNlLgorICAgICAgICAgICAgc3luY2hyb25pemVkIChtU2VydmljZUNvbm5lY3Rpb25zKSB7CisgICAgICAgICAgICAgICAgZm9yIChDYWxsYmFjayBjYWxsYmFjayA6IG1TZXJ2aWNlVXNlcnMuZ2V0KG1BdXRoZW50aWNhdG9yVHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ0aGUgc2VydmljZSBiZWNhbWUgZGlzY29ubmVjdGVkLCBzY2hlZHVsaW5nIGEgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJkaXNjb25uZWN0ZWQgbWVzc2FnZSBmb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1BdXRoZW50aWNhdG9yVHlwZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIub2J0YWluTWVzc2FnZShtTWVzc2FnZVdoYXREaXNjb25uZWN0ZWQsIGNhbGxiYWNrKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdW5iaW5kRnJvbVNlcnZpY2UobUF1dGhlbnRpY2F0b3JUeXBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGJvb2xlYW4gaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKKyAgICAgICAgaWYgKG1lc3NhZ2Uud2hhdCA9PSBtTWVzc2FnZVdoYXRDb25uZWN0ZWQpIHsKKyAgICAgICAgICAgIENvbm5lY3RlZE1lc3NhZ2VQYXlsb2FkIHBheWxvYWQgPSAoQ29ubmVjdGVkTWVzc2FnZVBheWxvYWQpbWVzc2FnZS5vYmo7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJub3RpZnlpbmcgY2FsbGJhY2sgIiArIHBheWxvYWQubUNhbGxiYWNrICsgIiB0aGF0IGl0IGlzIGNvbm5lY3RlZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcGF5bG9hZC5tQ2FsbGJhY2sub25Db25uZWN0ZWQocGF5bG9hZC5tU2VydmljZSk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLndoYXQgPT0gbU1lc3NhZ2VXaGF0RGlzY29ubmVjdGVkKS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XNjcmlwdGlvbih0eXBlKTsKKyAgICB9CisKKyAgICBwcml2YXRlIEF1dGhlbnRpY2F0b3JEZXNjcmlwdGlvbihTdHJpbmcgdHlwZSkgeworICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOworICAgICAgICB0aGlzLnBhY2thZ2VOYW1lID0gbnVsbDsKKyAgICAgICAgdGhpcy5sYWJlbElkID0gMDsKKyAgICAgICAgdGhpcy5pY29uSWQgPSAwOworICAgIH0KKworICAgIHByaXZhdGUgQXV0aGVudGljYXRvckRlc2NyaXB0aW9uKFBhcmNlbCBzb3VyY2UpIHsKKyAgICAgICAgdGhpcy50eXBlID0gc291cmNlLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgdGhpcy5wYWNrYWdlTmFtZSA9IHNvdXJjZS5yZWFkU3RyaW5nKCk7CisgICAgICAgIHRoaXMubGFiZWxJZCA9IHNvdXJjZS5yZWFkSW50KCk7CisgICAgICAgIHRoaXMuaWNvbklkID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGRlc2NyaWJlQ29udGVudHMoKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgaGFzaENvZGUoKSB7CisgICAgICAgIHJldHVybiB0eXBlLmhhc2hDb2RlKCk7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvKSB7CisgICAgICAgIGlmIChvID09IHRoaXMpIHJldHVybiB0cnVlOworICAgICAgICBpZiAoIShvIGluc3RhbmNlb2YgQXV0aGVudGljYXRvckRlc2NyaXB0aW9uKSkgcmV0dXJuIGZhbHNlOworICAgICAgICBmaW5hbCBBdXRoZW50aWNhdG9yRGVzY3JpcHRpb24gb3RoZXIgPSAoQXV0aGVudGljYXRvckRlc2NyaXB0aW9uKSBvOworICAgICAgICByZXR1cm4gdHlwZS5lcXVhbHMob3RoZXIudHlwZSk7CisgICAgfQorCisgICAgcHVibGljIHZva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nZXJSZXNwb25zZSA9IG51bGw7CisgICAgcHJpdmF0ZSBCdW5kbGUgbVJlc3VsdDsKKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKworICAgICAgICBpZiAoc2F2ZWRJbnN0YW5jZVN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIG1BY2NvdW50cyA9IGdldEludGVudCgpLmdldFBhcmNlbGFibGVBcnJheUV4dHJhKENvbnN0YW50cy5BQ0NPVU5UU19LRVkpOworICAgICAgICAgICAgbUFjY291bnRNYW5hZ2VyUmVzcG9uc2UgPQorICAgICAgICAgICAgICAgICAgICBnZXRJbnRlbnQoKS5nZXRQYXJjZWxhYmxlRXh0cmEoQ29uc3RhbnRzLkFDQ09VTlRfTUFOQUdFUl9SRVNQT05TRV9LRVkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUFjY291bnRzID0gc2F2ZWRJbnN0YW5jZVN0YXRlLmdldFBhcmNlbGFibGVBcnJheShDb25zdGFudHMuQUNDT1VOVFNfS0VZKTsKKyAgICAgICAgICAgIG1BY2NvdW50TWFuYWdlclJlc3BvbnNlID0KKyAgICAgICAgICAgICAgICAgICAgc2F2ZWRJbnN0YW5jZVN0YXRlLmdldFBhcmNlbGFibGUoQ29uc3RhbnRzLkFDQ09VTlRfTUFOQUdFUl9SRVNQT05TRV9LRVkpOworICAgICAgICB9CisKKyAgICAgICAgU3RyaW5nW10gbUFjY291bnROYW1lcyA9IG5ldyBTdHJpbmdbbUFjY291bnRzLmxlbmd0aF07CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUFjY291bnRzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBtQWNjb3VudE5hbWVzW2ldID0gKChBY2NvdW50KSBtQWNjb3VudHNbaV0pLm5hbWU7CisgICAgICAgIH0KKworICAgICAgICAvLyBVc2UgYW4gZXhpc3RpbmcgTGlzdEFkYXB0ZXIgdGhhdCB3aWxsIG1hcCBhbiBhcnJheQorICAgICAgICAvLyBvZiBzdHJpbmdzIHRvIFRleHRWaWV3cworICAgICAgICBzZXRMaXN0QWRhcHRlcihuZXcgQXJyYXlBZGFwdGVyPFN0cmluZz4odGhpcywKKyAgICAgICAgICAgICAgICBhbmRyb2lkLlIubGF5b3V0LnNpbXBsZV9saXN0X2l0ZW1fMSwgbUFjY291bnROYW1lcykpOworICAgICAgICBnZXRMaXN0VmlldygpLnNldFRleHRGaWx0ZXJFbmFibGVkKHRydWUpOworICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIG9uTGlzdEl0ZW1DbGljayhMaXN0VmlldyBsLCBWaWV3IHYsIGludCBwb3NpdGlvbiwgbG9uZyBpZCkgeworICAgICAgICBBY2NvdW50IGFjY291bnQgPSAoQWNjb3VudCkgbUFjY291bnRzW3Bvc2l0aW9uXTsKKyAgICAgICAgTG9nLmQoVEFHLCAic2VsZWN0ZWQgYWNjb3VudCAiICsgYWNjb3VudCk7CisgICAgICAgIEJ1bmRsZSBidW5kbGUgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgIGJ1bmRsZS5wdXRTdHJpbmcoQ29uc3RhbnRzLkFDQ09VTlRfTkFNRV9LRVksIGFjY291bnQubmFtZSk7CisgICAgICAgIGJ1bmRsZS5wdXRTdHJpbmcoQ29uc3RhbnRzLkFDQ09VTlRfVFlQRV9LRVksIGFjY291bnQudHlwZSk7CisgICAgICAgIG1SZXN1bHQgPSBidW5kbGU7CisgICAgICAgIGZpbmlzaCgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGZpbmlzaCgpIHsKKyAgICAgICAgaWYgKG1BY2NvdW50TWFuYWdlclJlc3BvbnNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtUmVzdWx0ICE9IG51bGwpIHsKKyAgICA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lvbiBlKSB7CisgICAgICAgICAgICAgICAgcGFja2FnZUxhYmVsc1tpXSA9IHBhY2thZ2VzW2ldOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgICgoTGlzdFZpZXcpIGZpbmRWaWV3QnlJZChSLmlkLnBhY2thZ2VzX2xpc3QpKS5zZXRBZGFwdGVyKAorICAgICAgICAgICAgICAgIG5ldyBQYWNrYWdlc0FycmF5QWRhcHRlcih0aGlzLCBwYWNrYWdlTGFiZWxzKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgc3dpdGNoICh2LmdldElkKCkpIHsKKyAgICAgICAgICAgIGNhc2UgUi5pZC5hbGxvdzoKKyAgICAgICAgICAgICAgICBBY2NvdW50TWFuYWdlclNlcnZpY2UuZ2V0U2luZ2xldG9uKCkuZ3JhbnRBcHBQZXJtaXNzaW9uKG1BY2NvdW50LCBtQXV0aFRva2VuVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1VaWQpOworICAgICAgICAgICAgICAgIEludGVudCByZXN1bHQgPSBuZXcgSW50ZW50KCk7CisgICAgICAgICAgICAgICAgcmVzdWx0LnB1dEV4dHJhKCJyZXRyeSIsIHRydWUpOworICAgICAgICAgICAgICAgIHNldFJlc3VsdChSRVNVTFRfT0ssIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgc2V0QWNjb3VudEF1dGhlbnRpY2F0b3JSZXN1bHQocmVzdWx0LmdldEV4dHJhcygpKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBSLmlkLmRlbnk6CisgICAgICAgICAgICAgICAgQWNjb3VudE1hbmFnZXJTZXJ2aWNlLmdldFNpbmdsZXRvbigpLnJldm9rZUFwcFBlcm1pc3Npb24obUFjY291bnQsIG1BdXRoVG9rZW5UeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgbVVpZCk7CisgICAgICAgICAgICAgICAgc2V0UmVzdWx0KFJFU1VMVF9DQU5DRUxFRCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZmluaXNoKCk7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIHZvaWQgc2V0QWNjb3VudEF1dGhlbnRpY2F0b3JSZXN1bHQoQnVuZGxlIHJlc3VsdCkgeworICAgICAgICBtUmVzdWx0QnVuZGxlID0gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNlbmRzIHRoZSByZXN1bHQgb3IgYSBDb25zdGFudHMuRVJST1JfQ09ERV9DQU5DRUxFRCBlcnJvciBpZiBhIHJlc3VsdCBpc24ndCBwcmVzZW50LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGZpbmlzaCgpIHsKKyAgICAgICAgSW50ZW50IGludGVudCA9IGdldEludGVudCgpOworICAgICAgICBBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIGFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgPQorICAgICAgICAgICAgICAgIGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoRVhUUkFTX1JFU1BPTlNFKTsKKyAgICAgICAgaWYgKGFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gc2VuZCB0aGUgcmVzdWx0IGJ1bmRsZSBiYWNrIGlmIHNldCwgb3RoZXJ3aXNlIHNlbmQgYW4gZXJyb3IuCisgICAgICAgICAgICBpZiAobVJlc3VsdEJ1bmRsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZS5vblJlc3VsdChtUmVzdWx0QnVuZGxlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZS5vbkVycm9yKENvbnN0YW50cy5FUlJPUl9DT0RFX0NBTkNFTEVELCAiY2FuY2Vs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kZXI7CisKKyAgICAgICAgICAgIC8vIFdoZW4gY29udmVydFZpZXcgaXMgbm90IG51bGwsIHdlIGNhbiByZXVzZSBpdCBkaXJlY3RseSwgdGhlcmUgaXMgbm8gbmVlZAorICAgICAgICAgICAgLy8gdG8gcmVpbmZsYXRlIGl0LiBXZSBvbmx5IGluZmxhdGUgYSBuZXcgVmlldyB3aGVuIHRoZSBjb252ZXJ0VmlldyBzdXBwbGllZAorICAgICAgICAgICAgLy8gYnkgTGlzdFZpZXcgaXMgbnVsbC4KKyAgICAgICAgICAgIGlmIChjb252ZXJ0VmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgY29udmVydFZpZXcgPSBtSW5mbGF0ZXIuaW5mbGF0ZShtUmVzb3VyY2UsIG51bGwpOworCisgICAgICAgICAgICAgICAgLy8gQ3JlYXRlcyBhIFZpZXdIb2xkZXIgYW5kIHN0b3JlIHJlZmVyZW5jZXMgdG8gdGhlIHR3byBjaGlsZHJlbiB2aWV3cworICAgICAgICAgICAgICAgIC8vIHdlIHdhbnQgdG8gYmluZCBkYXRhIHRvLgorICAgICAgICAgICAgICAgIGhvbGRlciA9IG5ldyBWaWV3SG9sZGVyKCk7CisgICAgICAgICAgICAgICAgaG9sZGVyLmxhYmVsID0gKFRleHRWaWV3KSBjb252ZXJ0Vmlldy5maW5kVmlld0J5SWQoUi5pZC50ZXh0MSk7CisKKyAgICAgICAgICAgICAgICBjb252ZXJ0Vmlldy5zZXRUYWcoaG9sZGVyKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBWaWV3SG9sZGVyIGJhY2sgdG8gZ2V0IGZhc3QgYWNjZXNzIHRvIHRoZSBUZXh0VmlldworICAgICAgICAgICAgICAgIC8vIGFuZCB0aGUgSW1hZ2VWaWV3LgorICAgICAgICAgICAgICAgIGhvbGRlciA9IChWaWV3SG9sZGVyKSBjb252ZXJ0Vmlldy5nZXRUYWcoKTsKKyAgICAgICA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VkCisgICAgICovCisgICAgdm9pZCBjb25maXJtUGFzc3dvcmQoaW4gSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgcmVzcG9uc2UsCisgICAgICAgIGluIEFjY291bnQgYWNjb3VudCwgU3RyaW5nIHBhc3N3b3JkKTsKKworICAgIC8qKgorICAgICAqIHByb21wdHMgdGhlIHVzZXIgZm9yIHRoZSBjcmVkZW50aWFscyBvZiB0aGUgYWNjb3VudAorICAgICAqLworICAgIHZvaWQgY29uZmlybUNyZWRlbnRpYWxzKGluIElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIHJlc3BvbnNlLCBpbiBBY2NvdW50IGFjY291bnQpOworCisgICAgLyoqCisgICAgICogZ2V0cyB0aGUgcGFzc3dvcmQgYnkgZWl0aGVyIHByb21wdGluZyB0aGUgdXNlciBvciBxdWVyeWluZyB0aGUgSUFjY291bnRNYW5hZ2VyCisgICAgICovCisgICAgdm9pZCBnZXRBdXRoVG9rZW4oaW4gSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgcmVzcG9uc2UsIGluIEFjY291bnQgYWNjb3VudCwKKyAgICAgICAgU3RyaW5nIGF1dGhUb2tlblR5cGUsIGluIEJ1bmRsZSBvcHRpb25zKTsKKworICAgIC8qKgorICAgICAqIEdldHMgdGhlIHVzZXItdmlzaWJsZSBsYWJlbCBvZiB0aGUgZ2l2ZW4gYXV0aHRva2VuIHR5cGUuCisgICAgICovCisgICAgdm9pZCBnZXRBdXRoVG9rZW5MYWJlbChpbiBJQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSByZXNwb25zZSwgU3RyaW5nIGF1dGhUb2tlblR5cGUpOworCisgICAgLyoqCisgICAgICogcHJvbXB0cyB0aGUgdXNlciBmb3IgYSBuZXcgcGFzc3dvcmQgYW5kIHdyaXRlcyBpdCB0byB0aGUgSUFjY291bnRNYW5hZ2VyCisgICAgICovCisgICAgdm9pZCB1cGRhdGVDcmVkZW50aWFscyhpbiBJQWNjb3VudEF1dGhlbnRpY2F0b3JSZXNwb25zZSByZXNwb25zZSwgaW4gQWNjb3VudCBhY2NvdW50LAorICAgICAgICBTdHJpbmcgYXV0aFRva2VuVHlwZSwgaW4gQnVuZGxlIG9wdGlvbnMpOworCisgICAgLyoqCisgICAgICogbGF1bmNoZXMgYW4gYWN0aXZpdHkgdGhhdCBsZXRzIHRoZSB1c2VyIGVkaXQgYW5kIHNldCB0aGUgcHJvcGVydGllcyBmb3IgYW4gYXV0aGVudGljYXRvcgorICAgICAqLworICAgIHZvaWQgZWRpdFByb3BlcnRpZXMoaW4gSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgcmVzcG9uc2UsIFN0cmluZyBhY2NvdW50VHlwZSk7CisKKyAgICAvKioKKyAgICAgKiByZXR1cm5zIGEgQnVuZGxlIHdoZXJlIHRoZSBib29sZWFuIHZhbHVlIEJPT0xFQU5fUkVTVUxUX0tFWSBpcyBzZXQgaWYgdGhlIGFjY291bnQgaGFzIHRoZQorICAgICAqIHNwZWNpZmllZCBmZWF0dXJlcworICAgICAqLworICAgIHZvaWQgaGFzRmVhdHVyZXMoaW4gSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UgcmVzcG9uc2UsIGluIEFjY291bnQgYWNjb3VudCwgCisgICAgICAgIGluIFN0cmluZ1tdIGZlYXR1cmVzKTsKKworICAgIC8qKgorICAgICAqIEdldHMgd2hldGhlciBvciBub3QgdGhlIGFjY291bnQgaXMgYWxsb3dlZCB0byBiZSByZW1vdmVkLgorICAgICAqLworICAgIHZvaWQgZ2V0QWNjb3VudFJlbW92YWxBbGxvd2VkKGluIElBY2NvdW50QXV0aGVudGljYXRvclJlc3BvbnNlIHJlc3BvbnNlLCBpbiBBY2NvdW50IGFjY291bnQpOworfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvYWNjb3VudHMvSUFjY291bnRBdXRoZW50aWNhdG9yUmVzcG9uc2UuYWlkbCBiL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gcnVucyBpbi4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBTdHJpbmcgcHJvY2VzczsKQEAgLTI5OSw3ICszMDQsNyBAQAogICAgICAgICBwdWJsaWMgYm9vbGVhbiBmb3JlZ3JvdW5kOwogICAgICAgICAKICAgICAgICAgLyoqCi0gICAgICAgICAqIFRoZSB0aW1lIHdoZW4gdGhlIHNlcnZpY2Ugd2FzIGZpcnN0IG1hZGUgYWN0aXZpdHksIGVpdGhlciBieSBzb21lb25lCisgICAgICAgICAqIFRoZSB0aW1lIHdoZW4gdGhlIHNlcnZpY2Ugd2FzIGZpcnN0IG1hZGUgYWN0aXZlLCBlaXRoZXIgYnkgc29tZW9uZQogICAgICAgICAgKiBzdGFydGluZyBvciBiaW5kaW5nIHRvIGl0LgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIGxvbmcgYWN0aXZlU2luY2U7CkBAIC0zMzIsNiArMzM3LDQ4IEBACiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgbG9uZyByZXN0YXJ0aW5nOwogICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIEJpdCBmb3Ige0BsaW5rICNmbGFnc306IHNldCBpZiB0aGlzIHNlcnZpY2UgaGFzIGJlZW4KKyAgICAgICAgICogZXhwbGljaXRseSBzdGFydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRkxBR19TVEFSVEVEID0gMTw8MDsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBCaXQgZm9yIHtAbGluayAjZmxhZ3N9OiBzZXQgaWYgdGhlIHNlcnZpY2UgaGFzIGFza2VkIHRvCisgICAgICAgICAqIHJ1biBhcyBhIGZvcmVncm91bmQgcHJvY2Vzcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZMQUdfRk9SRUdST1VORCA9IDE8PDE7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQml0IGZvciB7QGxpbmsgI2ZsYWdzKTogc2V0IGlmIHRoZSBzZXJ2aWNlIGlzIHJ1bm5pbmcgaW4gYQorICAgICAgICAgKiBjb3JlIHN5c3RlbSBwcm9jZXNzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRkxBR19TWVNURU1fUFJPQ0VTUyA9IDE8PDI7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQml0IGZvciB7QGxpbmsgI2ZsYWdzKTogc2V0IGlmIHRoZSBzZXJ2aWNlIGlzIHJ1bm5pbmcgaW4gYQorICAgICAgICAgKiBwZXJzaXN0ZW50IHByb2Nlc3MuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGTEFHX1BFUlNJU1RFTlRfUFJPQ0VTUyA9IDE8PDM7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogUnVubmluZyBmbGFncy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBpbnQgZmxhZ3M7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogRm9yIHNwZWNpYWwgc2VydmljZXMgdGhhdCBhcmUgYm91bmQgdG8gYnkgc3lzdGVtIGNvZGUsIHRoaXMgaXMKKyAgICAgICAgICogdGhlIHBhY2thZ2UgdGhhdCBob2xkcyB0aGUgYmluZGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBTdHJpbmcgY2xpZW50UGFja2FnZTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBGb3Igc3BlY2lhbCBzZXJ2aWNlcyB0aGF0IGFyZSBib3VuZCB0byBieSBzeXN0ZW0gY29kZSwgdGhpcyBpcworICAgICAgICAgKiBhIHN0cmluZyByZXNvdXJjZSBwcm92aWRpbmcgYSB1c2VyLXZpc2libGUgbGFiZWwgZm9yIHdobyB0aGUKKyAgICAgICAgICogY2xpZW50IGlzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCBjbGllbnRMYWJlbDsKKyAgICAgICAgCiAgICAgICAgIHB1YmxpYyBSdW5uaW5nU2VydmljZUluZm8oKSB7CiAgICAgICAgIH0KIApAQCAtMzQyLDYgKzM4OSw3IEBACiAgICAgICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgewogICAgICAgICAgICAgQ29tcG9uZW50TmFtZS53cml0ZVRvUGFyY2VsKHNlcnZpY2UsIGRlc3QpOwogICAgICAgICAgICAgZGVzdC53cml0ZUludChwaWQpOworICAgICAgICAgICAgZGVzdC53cml0ZUludCh1aWQpOwogICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyhwcm9jZXNzKTsKICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoZm9yZWdyb3VuZCA/IDEgOiAwKTsKICAgICAgICAgICAgIGRlc3Qud3JpdGVMb25nKGFjdGl2ZVNpbmNlKTsKQEAgLTM1MCwxMSArMzk4LDE1IEBACiAgICAgICAgICAgICBkZXN0LndyaXRlSW50KGNyYXNoQ291bnQpOwogICAgICAgICAgICAgZGVzdC53cml0ZUxvbmcobGFzdEFjdGl2aXR5VGltZSk7CiAgICAgICAgICAgICBkZXN0LndyaXRlTG9uZyhyZXN0YXJ0aW5nKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQodGhpcy5mbGFncyk7CisgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nKGNsaWVudFBhY2thZ2UpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChjbGllbnRMYWJlbCk7CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgdm9pZCByZWFkRnJvbVBhcmNlbChQYXJjZWwgc291cmNlKSB7CiAgICAgICAgICAgICBzZXJ2aWNlID0gQ29tcG9uZW50TmFtZS5yZWFkRnJvbVBhcmNlbChzb3VyY2UpOwogICAgICAgICAgICAgcGlkID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIHVpZCA9IHNvdXJjZS5yZWFkSW50KCk7CiAgICAgICAgICAgICBwcm9jZXNzID0gc291cmNlLnJlYWRTdHJpbmcoKTsKICAgICAgICAgICAgIGZvcmVncm91bmQgPSBzb3VyY2UucmVhZEludCgpICE9IDA7CiAgICAgICAgICAgICBhY3RpdmVTaW5jZSA9IHNvdXJjZS5yZWFkTG9uZygpOwpAQCAtMzYzLDYgKzQxNSw5IEBACiAgICAgICAgICAgICBjcmFzaENvdW50ID0gc291cmNlLnJlYWRJbnQoKTsKICAgICAgICAgICAgIGxhc3RBY3Rpdml0eVRpbWUgPSBzb3VyY2UucmVhZExvbmcoKTsKICAgICAgICAgICAgIHJlc3RhcnRpbmcgPSBzb3VyY2UucmVhZExvbmcoKTsKKyAgICAgICAgICAgIGZsYWdzID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGNsaWVudFBhY2thZ2UgPSBzb3VyY2UucmVhZFN0cmluZygpOworICAgICAgICAgICAgY2xpZW50TGFiZWwgPSBzb3VyY2UucmVhZEludCgpOwogICAgICAgICB9CiAgICAgICAgIAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIENyZWF0b3I8UnVubmluZ1NlcnZpY2VJbmZvPiBDUkVBVE9SID0gbmV3IENyZWF0b3I8UnVubmluZ1NlcnZpY2VJbmZvPigpIHsKQEAgLTQwMSw2ICs0NTYsMjIgQEAKICAgICB9CiAgICAgCiAgICAgLyoqCisgICAgICogUmV0dXJucyBhIFBlbmRpbmdJbnRlbnQgeW91IGNhbiBzdGFydCB0byBzaG93IGEgY29udHJvbCBwYW5lbCBmb3IgdGhlCisgICAgICogZ2l2ZW4gcnVubmluZyBzZXJ2aWNlLiAgSWYgdGhlIHNlcnZpY2UgZG9lcyBub3QgaGF2ZSBhIGNvbnRyb2wgcGFuZWwsCisgICAgICogbnVsbCBpcyByZXR1cm5lZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgUGVuZGluZ0ludGVudCBnZXRSdW5uaW5nU2VydmljZUNvbnRyb2xQYW5lbChDb21wb25lbnROYW1lIHNlcnZpY2UpCisgICAgICAgICAgICB0aHJvd3MgU2VjdXJpdHlFeGNlcHRpb24geworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkKKyAgICAgICAgICAgICAgICAgICAgLmdldFJ1bm5pbmdTZXJ2aWNlQ29udHJvbFBhbmVsKHNlcnZpY2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gU3lzdGVtIGRlYWQsIHdlIHdpbGwgYmUgZGVhZCB0b28gc29vbiEKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qKgogICAgICAqIEluZm9ybWF0aW9uIHlvdSBjYW4gcmV0cmlldmUgYWJvdXQgdGhlIGF2YWlsYWJsZSBtZW1vcnkgdGhyb3VnaAogICAgICAqIHtAbGluayBBY3Rpdml0eU1hbmFnZXIjZ2V0TWVtb3J5SW5mb30uCiAgICAgICovCkBAIC02MTMsNiArNjg0LDExIEBACiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgaW50IHBpZDsKICAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdXNlciBpZCBvZiB0aGlzIHByb2Nlc3MuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IHVpZDsKKyAgICAgICAgCiAgICAgICAgIHB1YmxpYyBTdHJpbmcgcGtnTGlzdFtdOwogICAgICAgICAKICAgICAgICAgLyoqCkBAIC02NjYsOCArNzQyLDUxIEBACiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgaW50IGxydTsKICAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBDb25zdGFudCBmb3Ige0BsaW5rICNpbXBvcnRhbmNlUmVhc29uQ29kZX06IG5vdGhpbmcgc3BlY2lhbCBoYXMKKyAgICAgICAgICogYmVlbiBzcGVjaWZpZWQgZm9yIHRoZSByZWFzb24gZm9yIHRoaXMgbGV2ZWwuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBSRUFTT05fVU5LTk9XTiA9IDA7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQ29uc3RhbnQgZm9yIHtAbGluayAjaW1wb3J0YW5jZVJlYXNvbkNvZGV9OiBvbmUgb2YgdGhlIGFwcGxpY2F0aW9uJ3MKKyAgICAgICAgICogY29udGVudCBwcm92aWRlcnMgaXMgYmVpbmcgdXNlZCBieSBhbm90aGVyIHByb2Nlc3MuICBUaGUgcGlkIG9mCisgICAgICAgICAqIHRoZSBjbGllbnQgcHJvY2VzcyBpcyBpbiB7QGxpbmsgI2ltcG9ydGFuY2VSZWFzb25QaWR9IGFuZCB0aGUKKyAgICAgICAgICogdGFyZ2V0IHByb3ZpZGVyIGluIHRoaXMgcHJvY2VzcyBpcyBpbgorICAgICAgICAgKiB7QGxpbmsgI2ltcG9ydGFuY2VSZWFzb25Db21wb25lbnR9LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUkVBU09OX1BST1ZJREVSX0lOX1VTRSA9IDE7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQ29uc3RhbnQgZm9yIHtAbGluayAjaW1wb3J0YW5jZVJlYXNvbkNvZGV9OiBvbmUgb2YgdGhlIGFwcGxpY2F0aW9uJ3MKKyAgICAgICAgICogY29udGVudCBwcm92aWRlcnMgaXMgYmVpbmcgdXNlZCBieSBhbm90aGVyIHByb2Nlc3MuICBUaGUgcGlkIG9mCisgICAgICAgICAqIHRoZSBjbGllbnQgcHJvY2VzcyBpcyBpbiB7QGxpbmsgI2ltcG9ydGFuY2VSZWFzb25QaWR9IGFuZCB0aGUKKyAgICAgICAgICogdGFyZ2V0IHByb3ZpZGVyIGluIHRoaXMgcHJvY2VzcyBpcyBpbgorICAgICAgICAgKiB7QGxpbmsgI2ltcG9ydGFuY2VSZWFzb25Db21wb25lbnR9LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUkVBU09OX1NFUlZJQ0VfSU5fVVNFID0gMjsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgcmVhc29uIGZvciB7QGxpbmsgI2ltcG9ydGFuY2V9LCBpZiBhbnkuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGltcG9ydGFuY2VSZWFzb25Db2RlOworICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZvciB0aGUgc3BlY2lmaWVkIHZhbHVlcyBvZiB7QGxpbmsgI2ltcG9ydGFuY2VSZWFzb25Db2RlfSwgdGhpcworICAgICAgICAgKiBpcyB0aGUgcHJvY2VzcyBJRCBvZiB0aGUgb3RoZXIgcHJvY2VzcyB0aGF0IGlzIGEgY2xpZW50IG9mIHRoaXMKKyAgICAgICAgICogcHJvY2Vzcy4gIFRoaXMgd2lsbCBiZSAwIGlmIG5vIG90aGVyIHByb2Nlc3MgaXMgdXNpbmcgdGhpcyBvbmUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGltcG9ydGFuY2VSZWFzb25QaWQ7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogRm9yIHRoZSBzcGVjaWZpZWQgdmFsdWVzIG9mIHtAbGluayAjaW1wb3J0YW5jZVJlYXNvbkNvZGV9LCB0aGlzCisgICAgICAgICAqIGlzIHRoZSBuYW1lIG9mIHRoZSBjb21wb25lbnQgdGhhdCBpcyBiZWluZyB1c2VkIGluIHRoaXMgcHJvY2Vzcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBDb21wb25lbnROYW1lIGltcG9ydGFuY2VSZWFzb25Db21wb25lbnQ7CisgICAgICAgIAogICAgICAgICBwdWJsaWMgUnVubmluZ0FwcFByb2Nlc3NJbmZvKCkgewogICAgICAgICAgICAgaW1wb3J0YW5jZSA9IElNUE9SVEFOQ0VfRk9SRUdST1VORDsKKyAgICAgICAgICAgIGltcG9ydGFuY2VSZWFzb25Db2RlID0gUkVBU09OX1VOS05PV047CiAgICAgICAgIH0KICAgICAgICAgCiAgICAgICAgIHB1YmxpYyBSdW5uaW5nQXBwUHJvY2Vzc0luZm8oU3RyaW5nIHBQcm9jZXNzTmFtZSwgaW50IHBQaWQsIFN0cmluZyBwQXJyW10pIHsKQEAgLTY4MywxNyArODAyLDI1IEBACiAgICAgICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgewogICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyhwcm9jZXNzTmFtZSk7CiAgICAgICAgICAgICBkZXN0LndyaXRlSW50KHBpZCk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KHVpZCk7CiAgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nQXJyYXkocGtnTGlzdCk7CiAgICAgICAgICAgICBkZXN0LndyaXRlSW50KGltcG9ydGFuY2UpOwogICAgICAgICAgICAgZGVzdC53cml0ZUludChscnUpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChpbXBvcnRhbmNlUmVhc29uQ29kZSk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KGltcG9ydGFuY2VSZWFzb25QaWQpOworICAgICAgICAgICAgQ29tcG9uZW50TmFtZS53cml0ZVRvUGFyY2VsKGltcG9ydGFuY2VSZWFzb25Db21wb25lbnQsIGRlc3QpOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHZvaWQgcmVhZEZyb21QYXJjZWwoUGFyY2VsIHNvdXJjZSkgewogICAgICAgICAgICAgcHJvY2Vzc05hbWUgPSBzb3VyY2UucmVhZFN0cmluZygpOwogICAgICAgICAgICAgcGlkID0gc291cmNlL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WU7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIFNUQVJUX1NFUlZJQ0VfVFJBTlNBQ1RJT046IHsKICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOwogICAgICAgICAgICAgSUJpbmRlciBiID0gZGF0YS5yZWFkU3Ryb25nQmluZGVyKCk7CkBAIC01NTEsOCArNTU4LDEzIEBACiAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUFjdGl2aXR5TWFuYWdlci5kZXNjcmlwdG9yKTsKICAgICAgICAgICAgIENvbXBvbmVudE5hbWUgY2xhc3NOYW1lID0gQ29tcG9uZW50TmFtZS5yZWFkRnJvbVBhcmNlbChkYXRhKTsKICAgICAgICAgICAgIElCaW5kZXIgdG9rZW4gPSBkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKTsKLSAgICAgICAgICAgIGJvb2xlYW4gaXNGb3JlZ3JvdW5kID0gZGF0YS5yZWFkSW50KCkgIT0gMDsKLSAgICAgICAgICAgIHNldFNlcnZpY2VGb3JlZ3JvdW5kKGNsYXNzTmFtZSwgdG9rZW4sIGlzRm9yZWdyb3VuZCk7CisgICAgICAgICAgICBpbnQgaWQgPSBkYXRhLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIE5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24gPSBudWxsOworICAgICAgICAgICAgaWYgKGRhdGEucmVhZEludCgpICE9IDApIHsKKyAgICAgICAgICAgICAgICBub3RpZmljYXRpb24gPSBOb3RpZmljYXRpb24uQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKGRhdGEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYm9vbGVhbiByZW1vdmVOb3RpZmljYXRpb24gPSBkYXRhLnJlYWRJbnQoKSAhPSAwOworICAgICAgICAgICAgc2V0U2VydmljZUZvcmVncm91bmQoY2xhc3NOYW1lLCB0b2tlbiwgaWQsIG5vdGlmaWNhdGlvbiwgcmVtb3ZlTm90aWZpY2F0aW9uKTsKICAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CkBAIC02MDYsNyArNjE4LDEwIEBACiAgICAgICAgIGNhc2UgU0VSVklDRV9ET05FX0VYRUNVVElOR19UUkFOU0FDVElPTjogewogICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElBY3Rpdml0eU1hbmFnZXIuZGVzY3JpcHRvcik7CiAgICAgICAgICAgICBJQmluZGVyIHRva2VuID0gZGF0YS5yZWFkU3Ryb25nQmluZGVyKCk7Ci0gICAgICAgICAgICBzZXJ2aWNlRG9uZUV4ZWN1dGluZyh0b2tlbik7CisgICAgICAgICAgICBpbnQgdHlwZSA9IGRhdGEucmVhZEludCgpOworICAgICAgICAgICAgaW50IHN0YXJ0SWQgPSBkYXRhLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGludCByZXMgPSBkYXRhLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIHNlcnZpY2VEb25lRXhlY3V0aW5nKHRva2VuLCB0eXBlLCBzdGFydElkLCByZXMpOwogICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOwogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KQEAgLTkzNSwxMyArOTUwLDYgQEAKICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CiAKLSAgICAgICAgY2FzZSBTWVNURU1fUkVBRFlfVFJBTlNBQ1RJT046IHsKLSAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOwotICAgICAgICAgICAgc3lzdGVtUmVhZHkoKTsKLSAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KICAgICAgICAgY2FzZSBIQU5ETEVfQVBQTElDQVRJT05fRVJST1JfVFJBTlNBQ1RJT046IHsKICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOwogICAgICAgICAgICAgSUJpbmRlciBhcHAgPSBkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKTsKQEAgLTExMDIsNiArMTExMCwyNSBAQAogICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOwogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGNhc2UgR0VUX1BST0NFU1NfTUVNT1JZX0lORk9fVFJBTlNBQ1RJT046IHsKKyAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOworICAgICAgICAgICAgaW50IHBpZCA9IGRhdGEucmVhZEludCgpOworICAgICAgICAgICAgRGVidWcuTWVtb3J5SW5mbyBtaSA9IG5ldyBEZWJ1Zy5NZW1vcnlJbmZvKCk7CisgICAgICAgICAgICBnZXRQcm9jZXNzTWVtb3J5SW5mbyhwaWQsIG1pKTsKKyAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKKyAgICAgICAgICAgIG1pLndyaXRlVG9QYXJjZWwocmVwbHksIDApOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEtJTExfQVBQTElDQVRJT05fUFJPQ0VTU19UUkFOU0FDVElPTjogeworICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElBY3Rpdml0eU1hbmFnZXIuZGVzY3JpcHRvcik7CisgICAgICAgICAgICBTdHJpbmcgcHJvY2Vzc05hbWUgPSBkYXRhLnJlYWRTdHJpbmcoKTsKKyAgICAg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xlKCk7CisgICAgICAgIHJlcGx5LnJlY3ljbGUoKTsKKyAgICAgICAgcmV0dXJuIHJlczsKKyAgICB9CisgICAgCiAgICAgcHVibGljIENvbXBvbmVudE5hbWUgc3RhcnRTZXJ2aWNlKElBcHBsaWNhdGlvblRocmVhZCBjYWxsZXIsIEludGVudCBzZXJ2aWNlLAogICAgICAgICAgICAgU3RyaW5nIHJlc29sdmVkVHlwZSkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbgogICAgIHsKQEAgLTE2NjQsMTMgKzE3MDYsMjAgQEAKICAgICAgICAgcmV0dXJuIHJlczsKICAgICB9CiAgICAgcHVibGljIHZvaWQgc2V0U2VydmljZUZvcmVncm91bmQoQ29tcG9uZW50TmFtZSBjbGFzc05hbWUsIElCaW5kZXIgdG9rZW4sCi0gICAgICAgICAgICBib29sZWFuIGlzRm9yZWdyb3VuZCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBpbnQgaWQsIE5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24sIGJvb2xlYW4gcmVtb3ZlTm90aWZpY2F0aW9uKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKICAgICAgICAgUGFyY2VsIGRhdGEgPSBQYXJjZWwub2J0YWluKCk7CiAgICAgICAgIFBhcmNlbCByZXBseSA9IFBhcmNlbC5vYnRhaW4oKTsKICAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBY3Rpdml0eU1hbmFnZXIuZGVzY3JpcHRvcik7CiAgICAgICAgIENvbXBvbmVudE5hbWUud3JpdGVUb1BhcmNlbChjbGFzc05hbWUsIGRhdGEpOwogICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKHRva2VuKTsKLSAgICAgICAgZGF0YS53cml0ZUludChpc0ZvcmVncm91bmQgPyAxIDogMCk7CisgICAgICAgIGRhdGEud3JpdGVJbnQoaWQpOworICAgICAgICBpZiAobm90aWZpY2F0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRhdGEud3JpdGVJbnQoMSk7CisgICAgICAgICAgICBub3RpZmljYXRpb24ud3JpdGVUb1BhcmNlbChkYXRhLCAwKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRhdGEud3JpdGVJbnQoMCk7CisgICAgICAgIH0KKyAgICAgICAgZGF0YS53cml0ZUludChyZW1vdmVOb3RpZmljYXRpb24gPyAxIDogMCk7CiAgICAgICAgIG1SZW1vdGUudHJhbnNhY3QoU0VUX1NFUlZJQ0VfRk9SRUdST1VORF9UUkFOU0FDVElPTiwgZGF0YSwgcmVwbHksIDApOwogICAgICAgICByZXBseS5yZWFkRXhjZXB0aW9uKCk7CiAgICAgICAgIGRhdGEucmVjeWNsZSgpOwpAQCAtMTczNywxMSArMTc4NiwxNSBAQAogICAgICAgICByZXBseS5yZWN5Y2xlKCk7CiAgICAgfQogCi0gICAgcHVibGljIHZvaWQgc2VydmljZURvbmVFeGVjdXRpbmcoSUJpbmRlciB0b2tlbikgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgcHVibGljIHZvaWQgc2VydmljZURvbmVFeGVjdXRpbmcoSUJpbmRlciB0b2tlbiwgaW50IHR5cGUsIGludCBzdGFydElkLAorICAgICAgICAgICAgaW50IHJlcykgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CiAgICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOwogICAgICAgICBQYXJjZWwgcmVwbHkgPSBQYXJjZWwub2J0YWluKCk7CiAgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQWN0aXZpdHlNYW5hZ2VyLmRlc2NyaXB0b3IpOwogICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKHRva2VuKTsKKyAgICAgICAgZGF0YS53cml0ZUludCh0eXBlKTsKKyAgICAgICAgZGF0YS53cml0ZUludChzdGFydElkKTsKKyAgICAgICAgZGF0YS53c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W1vcnlJbmZvKGludCBwaWQsIERlYnVnLk1lbW9yeUluZm8gb3V0SW5mbykKKyAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKKyAgICAgICAgUGFyY2VsIHJlcGx5ID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUFjdGl2aXR5TWFuYWdlci5kZXNjcmlwdG9yKTsKKyAgICAgICAgZGF0YS53cml0ZUludChwaWQpOworICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KEdFVF9QUk9DRVNTX01FTU9SWV9JTkZPX1RSQU5TQUNUSU9OLCBkYXRhLCByZXBseSwgMCk7CisgICAgICAgIHJlcGx5LnJlYWRFeGNlcHRpb24oKTsKKyAgICAgICAgb3V0SW5mby5yZWFkRnJvbVBhcmNlbChyZXBseSk7CisgICAgICAgIGRhdGEucmVjeWNsZSgpOworICAgICAgICByZXBseS5yZWN5Y2xlKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQga2lsbEFwcGxpY2F0aW9uUHJvY2VzcyhTdHJpbmcgcHJvY2Vzc05hbWUsIGludCB1aWQpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKKyAgICAgICAgUGFyY2VsIHJlcGx5ID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUFjdGl2aXR5TWFuYWdlci5kZXNjcmlwdG9yKTsKKyAgICAgICAgZGF0YS53cml0ZVN0cmluZyhwcm9jZXNzTmFtZSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQodWlkKTsKKyAgICAgICAgbVJlbW90ZS50cmFuc2FjdChLSUxMX0FQUExJQ0FUSU9OX1BST0NFU1NfVFJBTlNBQ1RJT04sIGRhdGEsIH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Gl0cwogICAgICAgICAgKiBmaWxlIG5hbWUpCiAgICAgICAgICAqIEByZXR1cm4gbnVsbC1vazsgdGhlIGFycmF5IG9mIHNoYXJlZCBsaWJyYXJpZXMsIGVhY2ggb25lCkBAIC0zNTAsNyArMzUzLDcgQEAKICAgICAgICAgICogcmVzdWx0IGlzIGEgc2luZ2xlIHN0cmluZyB3aXRoIHRoZSBuYW1lcyBvZiB0aGUgbGlicmFyaWVzCiAgICAgICAgICAqIHNlcGFyYXRlZCBieSBjb2xvbnMsIG9yIDxjb2RlPm51bGw8L2NvZGU+IGlmIGJvdGggbGlzdHMKICAgICAgICAgICogd2VyZSA8Y29kZT5udWxsPC9jb2RlPiBvciBlbXB0eS4KLSAgICAgICAgICogCisgICAgICAgICAqCiAgICAgICAgICAqIEBwYXJhbSBsaXN0MSBudWxsLW9rOyB0aGUgZmlyc3QgbGlzdAogICAgICAgICAgKiBAcGFyYW0gbGlzdDIgbnVsbC1vazsgdGhlIHNlY29uZCBsaXN0CiAgICAgICAgICAqIEByZXR1cm4gbnVsbC1vazsgdGhlIGNvbWJpbmF0aW9uCkBAIC0zNzgsNyArMzgxLDcgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKGR1cENoZWNrICYmIEFycmF5VXRpbHMuY29udGFpbnMobGlzdDEsIHMpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC0zOTAsNyArMzkzLDcgQEAKIAogICAgICAgICAgICAgcmV0dXJuIHJlc3VsdC50b1N0cmluZygpOwogICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgcHVibGljIENsYXNzTG9hZGVyIGdldENsYXNzTG9hZGVyKCkgewogICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAgICAgaWYgKG1DbGFzc0xvYWRlciAhPSBudWxsKSB7CkBAIC00MjgsNyArNDMxLDcgQEAKIAogICAgICAgICAgICAgICAgICAgICBpZiAoKG1TaGFyZWRMaWJyYXJpZXMgIT0gbnVsbCkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW5zdHJ1bWVudGF0aW9uTGlicyAhPSBudWxsKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgemlwID0gCisgICAgICAgICAgICAgICAgICAgICAgICB6aXAgPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbWJpbmVMaWJzKG1TaGFyZWRMaWJyYXJpZXMsIGluc3RydW1lbnRhdGlvbkxpYnMpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAnOicgKyB6aXA7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTQ4NSw5ICs0ODgsOSBAQAogICAgICAgICAgICAgaWYgKG1BcHBsaWNhdGlvbiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1BcHBsaWNhdGlvbjsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBBcHBsaWNhdGlvbiBhcHAgPSBudWxsOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIFN0cmluZyBhcHBDbGFzcyA9IG1BcHBsaWNhdGlvbkluZm8uY2xhc3NOYW1lOwogICAgICAgICAgICAgaWYgKGZvcmNlRGVmYXVsdEFwcENsYXNzIHx8IChhcHBDbGFzcyA9PSBudWxsKSkgewogICAgICAgICAgICAgICAgIGFwcENsYXNzID0gImFuZHJvaWQuYXBwLkFwcGxpY2F0aW9uIjsKQEAgLTUxMCw3ICs1MTMsNyBAQAogICAgICAgICAgICAgbUFjdGl2aXR5VGhyZWFkLm1BbGxBcHBsaWNhdGlvbnMuYWRkKGFwcCk7CiAgICAgICAgICAgICByZXR1cm4gbUFwcGxpY2F0aW9uID0gYXBwOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyB2b2lkIHJlbW92ZUNvbnRleHRSZWdpc3RyYXRpb25zKENvbnRleHQgY29udGV4dCwKICAgICAgICAgICAgICAgICBTdHJpbmcgd2hvLCBTdHJpbmcgd2hhdCkgewogICAgICAgICAgICAgSGFzaE1hcDxCcm9hZGNhc3RSZWNlaXZlciwgUmVjZWl2ZXJEaXNwYXRjaGVyPiBybWFwID0KQEAgLTY0Myw3ICs2NDYsNyBAQAogICAgICAgICAgICAgZmluYWwgc3RhdGljIGNsYXNzIElubmVyUmVjZWl2ZXIgZXh0ZW5kcyBJSW50ZW50UmVjZWl2ZXIuU3R1YiB7CiAgICAgICAgICAgICAgICAgZmluYWwgV2Vha1JlZmVyZW5jZTxSZWNlaXZlckRpc3BhdGNoZXI+IG1EaXNwYXRjaGVyOwogICAgICAgICAgICAgICAgIGZpbmFsIFJlY2VpdmVyRGlzcGF0Y2hlciBtU3Ryb25nUmVmOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgSW5uZXJSZWNlaXZlcihSZWNlaXZlckRpc3BhdGNoZXIgcmQsIGJvb2xlYW4gc3Ryb25nKSB7CiAgICAgICAgICAgICAgICAgICAgIG1EaXNwYXRjaGVyID0gbmV3IFdlYWtSZWZlcmVuY2U8UmVjZWl2ZXJEaXNwYXRjaGVyPihyZCk7CiAgICAgICAgICAgICAgICAgICAgIG1TdHJvbmdSZWYgPSBzdHJvbmcgPyByZCA6IG51bGw7CkBAIC02NjEsNyArNjY0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBmaW5hbCBJSW50ZW50UmVjZWl2ZXIuU3R1YiBtSUludGVudFJlY2VpdmVyOwogICAgICAgICAgICAgZmluYWwgQnJvYWRjYXN0UmVjZWl2ZXIgbVJlY2VpdmVyOwogICAgICAgICAgICAgZmluYWwgQ29udGV4dCBtQ29udGV4dDsKQEAgLTc3MCw3ICs3NzMsNyBAQAogICAgICAgICAgICAgQnJvYWRjYXN0UmVjZWl2ZXIgZ2V0SW50ZW50UmVjZWl2ZXIoKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1SZWNlaXZlcjsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBJSW50ZW50UmVjZWl2ZXIgZ2V0SUludGVudFJlY2VpdmVyKCkgewogICAgICAgICAgICAgICAgIHJldHVybiBtSUludGVudFJlY2VpdmVyOwogICAgICAgICAgICAgfQpAQCAtOTAxLDcgKzkwNCw3IEBACiAKICAgICAgICAgICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIElubmVyQ29ubmVjdGlvbiBleHRlbmRzIElTZXJ2aWNlQ29ubmVjdGlvbi5TdHViIHsKICAgICAgICAgICAgICAgICBmaW5hbCBXZWFrUmVmZXJlbmNlPFNlcnZpY2VEaXNwYXRjaGVyPiBtRGlzcGF0Y2hlcjsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIElubmVyQ29ubmVjdGlvbihTZXJ2aWNlRGlzcGF0Y2hlciBzZCkgewogICAgICAgICAgICAgICAgICAgICBtRGlzcGF0Y2hlciA9IG5ldyBXZWFrUmVmZXJlbmNlPFNlcnZpY2VEaXNwYXRjaGVyPihzZCk7CiAgICAgICAgICAgICAgICAgfQpAQCAtOTEzLDcgKzkxNiw3IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcHJpdmF0ZSBmaW5hbCBIYXNoTWFwPENvbXBvbmVudE5hbWUsIENvbm5lY3Rpb25JbmZvPiBtQWN0aXZlQ29ubmVjdGlvbnMKICAgICAgICAgICAgICAgICA9IG5ldyBIYXNoTWFwPENvbXBvbmVudE5hbWUsIENvbm5lY3Rpb25JbmZvPigpOwogCkBAIC05NjUsNyArOTY4LDcgQEAKICAgICAgICAgICAgIElTZXJ2aWNlQ29ubmVjdGlvbiBnZXRJU2VydmljZUNvbm5lY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1JU2VydmljZUNvbm5lY3Rpb247CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaW50IGdldEZsYWdzKCkgewogICAgICAgICAgICAgICAgIHJldHVybiBtRmxhZ3M7CiAgICAgICAgICAgICB9CkBAIC0xMTkxLDcgKzExOTQsNyBAQAogICAgICAgICAgICAgICAgICAgICArICIgbW9kZT0iICsgYmFja3VwTW9kZSArICJ9IjsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNsYXNzIENyZWF0ZVNlcnZpY2VEYXRhIHsKICAgICAgICAgSUJpbmRlciB0b2tlbjsKICAgICAgICAgU2VydmljZUluZm8gaW5mbzsKQEAgLTEyMTUsNiArMTIxOCw3IEBACiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgY2xhc3MgU2VydmljZUFyZ3NEYXRhIHsKICAgICAgICAgSUJpbmRlciB0b2tlbjsKICAgICAgICAgaW50IHN0YXJ0SWQ7CisgICAgICAgIGludCBmbGFnczsKICAgICAgICAgSW50ZW50IGFyZ3M7CiAgICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CiAgICAgICAgICAgICByZXR1cm4gIlNlcnZpY2VBcmdzRGF0YXt0b2tlbj0iICsgdG9rZW4gKyAiIHN0YXJ0SWQ9IiArIHN0YXJ0SWQKQEAgLTEyNzAsMTAgKzEyNzQsMTAgQEAKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIEhFQVBfQ09MVU1OID0gIiUxN3MgJThzICU4cyAlOHMgJThzIjsKICAgICAgICAgcHJ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sCi0gICAgICAgICAgICBJbnRlbnQgYXJncykgeworICAgICAgICAgICAgaW50IGZsYWdzICxJbnRlbnQgYXJncykgewogICAgICAgICAgICAgU2VydmljZUFyZ3NEYXRhIHMgPSBuZXcgU2VydmljZUFyZ3NEYXRhKCk7CiAgICAgICAgICAgICBzLnRva2VuID0gdG9rZW47CiAgICAgICAgICAgICBzLnN0YXJ0SWQgPSBzdGFydElkOworICAgICAgICAgICAgcy5mbGFncyA9IGZsYWdzOwogICAgICAgICAgICAgcy5hcmdzID0gYXJnczsKIAogICAgICAgICAgICAgcXVldWVPclNlbmRNZXNzYWdlKEguU0VSVklDRV9BUkdTLCBzKTsKQEAgLTE0NjEsNiArMTQ2NiwxMCBAQAogICAgICAgICAgICAgcXVldWVPclNlbmRNZXNzYWdlKEguRVhJVF9BUFBMSUNBVElPTiwgbnVsbCk7CiAgICAgICAgIH0KIAorICAgICAgICBwdWJsaWMgZmluYWwgdm9pZCBzY2hlZHVsZVN1aWNpZGUoKSB7CisgICAgICAgICAgICBxdWV1ZU9yU2VuZE1lc3NhZ2UoSC5TVUlDSURFLCBudWxsKTsKKyAgICAgICAgfQorCiAgICAgICAgIHB1YmxpYyB2b2lkIHJlcXVlc3RUaHVtYm5haWwoSUJpbmRlciB0b2tlbikgewogICAgICAgICAgICAgcXVldWVPclNlbmRNZXNzYWdlKEguUkVRVUVTVF9USFVNQk5BSUwsIHRva2VuKTsKICAgICAgICAgfQpAQCAtMTUwOCw3ICsxNTE3LDcgQEAKICAgICAgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKICAgICAgICAgICAgIHJlY2VpdmVyLnBlcmZvcm1SZWNlaXZlKGludGVudCwgcmVzdWx0Q29kZSwgZGF0YVN0ciwgZXh0cmFzLCBvcmRlcmVkKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCBzY2hlZHVsZUxvd01lbW9yeSgpIHsKICAgICAgICAgICAgIHF1ZXVlT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FwcGxpY2F0aW9uICE9IG51bGwpCiAgICAgICAgICAgICAgICAgICAgICAgICA/IG1Cb3VuZEFwcGxpY2F0aW9uLnByb2Nlc3NOYW1lIDogInVua25vd24iOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgLy8gSGVhZGVyCiAgICAgICAgICAgICAgICAgcHcucHJpbnQoQUNUSVZJVFlfVEhSRUFEX0NIRUNLSU5fVkVSU0lPTik7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoUHJvY2Vzcy5teVBpZCgpKTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChwcm9jZXNzTmFtZSk7IHB3LnByaW50KCcsJyk7Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAvLyBIZWFwIGluZm8gLSBtYXgKICAgICAgICAgICAgICAgICBwdy5wcmludChuYXRpdmVNYXgpOyBwdy5wcmludCgnLCcpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KGRhbHZpa01heCk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIk4vQSwiKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChuYXRpdmVNYXggKyBkYWx2aWtNYXgpOyBwdy5wcmludCgnLCcpOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgLy8gSGVhcCBpbmZvIC0gYWxsb2NhdGVkCiAgICAgICAgICAgICAgICAgcHcucHJpbnQobmF0aXZlQWxsb2NhdGVkKTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChkYWx2aWtBbGxvY2F0ZWQpOyBwdy5wcmludCgnLCcpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KCJOL0EsIik7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQobmF0aXZlQWxsb2NhdGVkICsgZGFsdmlrQWxsb2NhdGVkKTsgcHcucHJpbnQoJywnKTsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIC8vIEhlYXAgaW5mbyAtIGZyZWUKICAgICAgICAgICAgICAgICBwdy5wcmludChuYXRpdmVGcmVlKTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChkYWx2aWtGcmVlKTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludCgiTi9BLCIpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KG5hdGl2ZUZyZWUgKyBkYWx2aWtGcmVlKTsgcHcucHJpbnQoJywnKTsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIC8vIEhlYXAgaW5mbyAtIHByb3BvcnRpb25hbCBzZXQgc2l6ZQogICAgICAgICAgICAgICAgIHB3LnByaW50KG1lbUluZm8ubmF0aXZlUHNzKTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChtZW1JbmZvLmRhbHZpa1Bzcyk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQobWVtSW5mby5vdGhlclBzcyk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQobWVtSW5mby5uYXRpdmVQc3MgKyBtZW1JbmZvLmRhbHZpa1BzcyArIG1lbUluZm8ub3RoZXJQc3MpOyBwdy5wcmludCgnLCcpOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgLy8gSGVhcCBpbmZvIC0gc2hhcmVkCi0gICAgICAgICAgICAgICAgcHcucHJpbnQobmF0aXZlU2hhcmVkKTsgcHcucHJpbnQoJywnKTsgCi0gICAgICAgICAgICAgICAgcHcucHJpbnQoZGFsdmlrU2hhcmVkKTsgcHcucHJpbnQoJywnKTsgCi0gICAgICAgICAgICAgICAgcHcucHJpbnQob3RoZXJTaGFyZWQpOyBwdy5wcmludCgnLCcpOyAKKyAgICAgICAgICAgICAgICBwdy5wcmludChuYXRpdmVTaGFyZWQpOyBwdy5wcmludCgnLCcpOworICAgICAgICAgICAgICAgIHB3LnByaW50KGRhbHZpa1NoYXJlZCk7IHB3LnByaW50KCcsJyk7CisgICAgICAgICAgICAgICAgcHcucHJpbnQob3RoZXJTaGFyZWQpOyBwdy5wcmludCgnLCcpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KG5hdGl2ZVNoYXJlZCArIGRhbHZpa1NoYXJlZCArIG90aGVyU2hhcmVkKTsgcHcucHJpbnQoJywnKTsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIC8vIEhlYXAgaW5mbyAtIHByaXZhdGUKLSAgICAgICAgICAgICAgICBwdy5wcmludChuYXRpdmVQcml2YXRlKTsgcHcucHJpbnQoJywnKTsgCisgICAgICAgICAgICAgICAgcHcucHJpbnQobmF0aXZlUHJpdmF0ZSk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoZGFsdmlrUHJpdmF0ZSk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQob3RoZXJQcml2YXRlKTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChuYXRpdmVQcml2YXRlICsgZGFsdmlrUHJpdmF0ZSArIG90aGVyUHJpdmF0ZSk7IHB3LnByaW50KCcsJyk7Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAvLyBPYmplY3QgY291bnRzCiAgICAgICAgICAgICAgICAgcHcucHJpbnQodmlld0luc3RhbmNlQ291bnQpOyBwdy5wcmludCgnLCcpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KHZpZXdSb290SW5zdGFuY2VDb3VudCk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoYXBwQ29udGV4dEluc3RhbmNlQ291bnQpOyBwdy5wcmludCgnLCcpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KGFjdGl2aXR5SW5zdGFuY2VDb3VudCk7IHB3LnByaW50KCcsJyk7Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBwdy5wcmludChnbG9iYWxBc3NldENvdW50KTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChnbG9iYWxBc3NldE1hbmFnZXJDb3VudCk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoYmluZGVyTG9jYWxPYmplY3RDb3VudCk7IHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoYmluZGVyUHJveHlPYmplY3RDb3VudCk7IHB3LnByaW50KCcsJyk7Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBwdy5wcmludChiaW5kZXJEZWF0aE9iamVjdENvdW50KTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChvcGVuU3NsU29ja2V0Q291bnQpOyBwdy5wcmludCgnLCcpOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgLy8gU1FMCiAgICAgICAgICAgICAgICAgcHcucHJpbnQoc3FsaXRlQWxsb2NhdGVkKTsgcHcucHJpbnQoJywnKTsKLSAgICAgICAgICAgICAgICBwdy5wcmludChzdGF0cy5kYXRhYmFzZUJ5dGVzIC8gMTAyNCk7IHB3LnByaW50KCcsJyk7IAorICAgICAgICAgICAgICAgIHB3LnByaW50KHN0YXRzLmRhdGFiYXNlQnl0ZXMgLyAxMDI0KTsgcHcucHJpbnQoJywnKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChzdGF0cy5udW1QYWdlcnMpOyBwdy5wcmludCgnLCcpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KChzdGF0cy50b3RhbEJ5dGVzIC0gc3RhdHMucmVmZXJlbmNlZEJ5dGVzKSAvIDEwMjQpOyBwdy5wcmludCgnLCcpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KHN0YXRzLnJlZmVyZW5jZWRCeXRlcyAvIDEwMjQpOyBwdy5wcmludCgnXG4nKTsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICAvLyBvdGhlcndpc2UsIHNob3cgaHVtYW4tcmVhZGFibGUgZm9ybWF0CiAgICAgICAgICAgICBwcmludFJvdyhwdywgSEVBUF9DT0xVTU4sICIiLCAibmF0aXZlIiwgImRhbHZpayIsICJvdGhlciIsICJ0b3RhbCIpOwogICAgICAgICAgICAgcHJpbnRSb3cocHcsIEhFQVBfQ09MVU1OLCAic2l6ZToiLCBuYXRpdmVNYXgsIGRhbHZpa01heCwgIk4vQSIsIG5hdGl2ZU1heCArIGRhbHZpa01heCk7CkBAIC0xNjkyLDcgKzE3MDUsNyBAQAogICAgICAgICAgICAgcHJpbnRSb3cocHcsIE9ORV9DT1VOVF9DT0xVTU4sICJEZWF0aCBSZWNpcGllbnRzOiIsIGJpbmRlckRlYXRoT2JqZWN0Q291bnQpOwogCiAgICAgICAgICAgICBwcmludFJvdyhwdywgT05FX0NPVU5UX0NPTFVNTiwgIk9wZW5TU0wgU29ja2V0czoiLCBvcGVuU3NsU29ja2V0Q291bnQpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIC8vIFNRTGl0ZSBtZW0gaW5mbwogICAgICAgICAgICAgcHcucHJpbnRsbigiICIpOwogICAgICAgICAgICAgcHcucHJpbnRsbigiIFNRTCIpOwpAQCAtMTcwMSw3ICsxNzE0LDcgQEAKICAgICAgICAgICAgIHByaW50Um93KHB3LCBUV09fQ09VTlRfQ09MVU1OUywgIm51bVBhZ2VyczoiLCBzdGF0cy5udW1QYWdlcnMsICJpbmFjdGl2ZVBhZ2VLQjoiLAogICAgICAgICAgICAgICAgICAgICAoc3RhdHMudG90YWxCeXRlcyAtIHN0YXRzLnJlZmVyZW5jZWRCeXRlcykgLyAxMDI0KTsKICAgICAgICAgICAgIHByaW50Um93KHB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yBzdGF0aWMgZmluYWwgaW50IERFU1RST1lfQkFDS1VQX0FHRU5UICAgICA9IDEyOTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgREVTVFJPWV9CQUNLVVBfQUdFTlQgICAgPSAxMjk7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNVSUNJREUgICAgICAgICAgICAgICAgID0gMTMwOwogICAgICAgICBTdHJpbmcgY29kZVRvU3RyaW5nKGludCBjb2RlKSB7CiAgICAgICAgICAgICBpZiAobG9jYWxMT0dWKSB7CiAgICAgICAgICAgICAgICAgc3dpdGNoIChjb2RlKSB7CkBAIC0xNzgwLDYgKzE3OTgsNyBAQAogICAgICAgICAgICAgICAgICAgICBjYXNlIFBST0ZJTEVSX0NPTlRST0w6IHJldHVybiAiUFJPRklMRVJfQ09OVFJPTCI7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ1JFQVRFX0JBQ0tVUF9BR0VOVDogcmV0dXJuICJDUkVBVEVfQkFDS1VQX0FHRU5UIjsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBERVNUUk9ZX0JBQ0tVUF9BR0VOVDogcmV0dXJuICJERVNUUk9ZX0JBQ0tVUF9BR0VOVCI7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU1VJQ0lERTogcmV0dXJuICJTVUlDSURFIjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gIih1bmtub3duKSI7CkBAIC0xNzk5LDYgKzE4MTgsNyBAQAogICAgICAgICAgICAgICAgIH0gYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBQQVVTRV9BQ1RJVklUWToKICAgICAgICAgICAgICAgICAgICAgaGFuZGxlUGF1c2VBY3Rpdml0eSgoSUJpbmRlciltc2cub2JqLCBmYWxzZSwgbXNnLmFyZzEgIT0gMCwgbXNnLmFyZzIpOworICAgICAgICAgICAgICAgICAgICBtYXliZVNuYXBzaG90KCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgUEFVU0VfQUNUSVZJVFlfRklOSVNISU5HOgogICAgICAgICAgICAgICAgICAgICBoYW5kbGVQYXVzZUFjdGl2aXR5KChJQmluZGVyKW1zZy5vYmosIHRydWUsIG1zZy5hcmcxICE9IDAsIG1zZy5hcmcyKTsKQEAgLTE4NDEsNiArMTg2MSw3IEBACiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgUkVDRUlWRVI6CiAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVJlY2VpdmVyKChSZWNlaXZlckRhdGEpbXNnLm9iaik7CisgICAgICAgICAgICAgICAgICAgIG1heWJlU25hcHNob3QoKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBDUkVBVEVfU0VSVklDRToKICAgICAgICAgICAgICAgICAgICAgaGFuZGxlQ3JlYXRlU2VydmljZSgoQ3JlYXRlU2VydmljZURhdGEpbXNnLm9iaik7CkBAIC0xODU2LDYgKzE4NzcsNyBAQAogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNUT1BfU0VSVklDRToKICAgICAgICAgICAgICAgICAgICAgaGFuZGxlU3RvcFNlcnZpY2UoKElCaW5kZXIpbXNnLm9iaik7CisgICAgICAgICAgICAgICAgICAgIG1heWJlU25hcHNob3QoKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBSRVFVRVNUX1RIVU1CTkFJTDoKICAgICAgICAgICAgICAgICAgICAgaGFuZGxlUmVxdWVzdFRodW1ibmFpbCgoSUJpbmRlciltc2cub2JqKTsKQEAgLTE4ODgsNiArMTkxMCwxOCBAQAogICAgICAgICAgICAgICAgIGNhc2UgREVTVFJPWV9CQUNLVVBfQUdFTlQ6CiAgICAgICAgICAgICAgICAgICAgIGhhbmRsZURlc3Ryb3lCYWNrdXBBZ2VudCgoQ3JlYXRlQmFja3VwQWdlbnREYXRhKW1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFNVSUNJREU6CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFByb2Nlc3Mua2lsbFByb2Nlc3MoUHJvY2Vzcy5teVBpZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgbWF5YmVTbmFwc2hvdCgpIHsKKyAgICAgICAgICAgIGlmIChtQm91bmRBcHBsaWNhdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgU2FtcGxpbmdQcm9maWxlckludGVncmF0aW9uLndyaXRlU25hcHNob3QoCisgICAgICAgICAgICAgICAgICAgICAgICBtQm91bmRBcHBsaWNhdGlvbi5wcm9jZXNzTmFtZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0xOTMwLDEzICsxOTY0LDEzIEBACiAgICAgICAgIGZpbmFsIHByaXZhdGUgU3RyaW5nIG1SZXNEaXI7CiAgICAgICAgIGZpbmFsIHByaXZhdGUgZmxvYXQgbVNjYWxlOwogICAgICAgICBmaW5hbCBwcml2YXRlIGludCBtSGFzaDsKLSAgICAgICAgCisKICAgICAgICAgUmVzb3VyY2VzS2V5KFN0cmluZyByZXNEaXIsIGZsb2F0IHNjYWxlKSB7CiAgICAgICAgICAgICBtUmVzRGlyID0gcmVzRGlyOwogICAgICAgICAgICAgbVNjYWxlID0gc2NhbGU7CiAgICAgICAgICAgICBtSGFzaCA9IG1SZXNEaXIuaGFzaENvZGUoKSA8PCAyICsgKGludCkgKG1TY2FsZSAqIDIpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIEBPdmVycmlkZQ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AgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKG1TeXN0ZW1Db250ZXh0ID09IG51bGwpIHsKQEAgLTIyMTQsNyArMjI0OCw3IEBACiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGFJbmZvOwogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBmaW5hbCBBY3Rpdml0eSBzdGFydEFjdGl2aXR5Tm93KEFjdGl2aXR5IHBhcmVudCwgU3RyaW5nIGlkLAogICAgICAgICBJbnRlbnQgaW50ZW50LCBBY3Rpdml0eUluZm8gYWN0aXZpdHlJbmZvLCBJQmluZGVyIHRva2VuLCBCdW5kbGUgc3RhdGUsCiAgICAgICAgIE9iamVjdCBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlKSB7CkBAIC0yMjk3LDcgKzIzMzEsNyBAQAogICAgICAgICAgICAgci5wYWNrYWdlSW5mbyA9IGdldFBhY2thZ2VJbmZvKGFJbmZvLmFwcGxpY2F0aW9uSW5mbywKICAgICAgICAgICAgICAgICAgICAgQ29udGV4dC5DT05URVhUX0lOQ0xVREVfQ09ERSk7CiAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgIENvbXBvbmVudE5hbWUgY29tcG9uZW50ID0gci5pbnRlbnQuZ2V0Q29tcG9uZW50KCk7CiAgICAgICAgIGlmIChjb21wb25lbnQgPT0gbnVsbCkgewogICAgICAgICAgICAgY29tcG9uZW50ID0gci5pbnRlbnQucmVzb2x2ZUFjdGl2aXR5KApAQCAtMjMyOSw3ICsyMzYzLDcgQEAKIAogICAgICAgICB0cnkgewogICAgICAgICAgICAgQXBwbGljYXRpb24gYXBwID0gci5wYWNrYWdlSW5mby5tYWtlQXBwbGljYXRpb24oZmFsc2UpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmIChsb2NhbExPR1YpIExvZy52KFRBRywgIlBlcmZvcm1pbmcgbGF1bmNoIG9mICIgKyByKTsKICAgICAgICAgICAgIGlmIChsb2NhbExPR1YpIExvZy52KAogICAgICAgICAgICAgICAgICAgICBUQUcsIHIgKyAiOiBhcHA9IiArIGFwcApAQCAtMjM0OCw3ICsyMzgyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHIuaWRlbnQsIGFwcCwgci5pbnRlbnQsIHIuYWN0aXZpdHlJbmZvLCB0aXRsZSwgci5wYXJlbnQsCiAgICAgICAgICAgICAgICAgICAgICAgICByLmVtYmVkZGVkSUQsIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSwKICAgICAgICAgICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcywgY29uZmlnKTsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIGlmIChjdXN0b21JbnRlbnQgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBhY3Rpdml0eS5tSW50ZW50ID0gY3VzdG9tSW50ZW50OwogICAgICAgICAgICAgICAgIH0KQEAgLTI0ODYsNyArMjUyMCw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIGZpbmFsIHZvaWQgaGFuZGxlTmV3SW50ZW50KE5ld0ludGVudERhdGEgZGF0YSkgewogICAgICAgICBwZXJmb3JtTmV3SW50ZW50cyhkYXRhLnRva2VuLCBkYXRhLmludGVudHMpOwogICAgIH0KQEAgLTI1MjQsNyArMjU1OCw3IEBACiAKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIEFwcGxpY2F0aW9uIGFwcCA9IHBhY2thZ2VJbmZvLm1ha2VBcHBsaWNhdGlvbihmYWxzZSk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKGxvY2FsTE9HVikgTG9nLnYoCiAgICAgICAgICAgICAgICAgVEFHLCAiUGVyZm9ybWluZyByZWNlaXZlIG9mICIgKyBkYXRhLmludGVudAogICAgICAgICAgICAgICAgICsgIj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KS5zZXJ2aWNlRG9uZUV4ZWN1dGluZyhkYXRhLnRva2VuKTsKKyAgICAgICAgICAgICAgICBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpLnNlcnZpY2VEb25lRXhlY3V0aW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS50b2tlbiwgMCwgMCwgMCk7CiAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgIC8vIG5vdGhpbmcgdG8gZG8uCiAgICAgICAgICAgICB9CkBAIC0yNzEwLDcgKzI3NDUsNyBAQAogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgcy5vblJlYmluZChkYXRhLmludGVudCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpLnNlcnZpY2VEb25lRXhlY3V0aW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnRva2VuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS50b2tlbiwgMCwgMCwgMCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgICAgICB9CkBAIC0yNzM2LDcgKzI3NzEsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnRva2VuLCBkYXRhLmludGVudCwgZG9SZWJpbmQpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmdldERlZmF1bHQoKS5zZXJ2aWNlRG9uZUV4ZWN1dGluZygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS50b2tlbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEudG9rZW4sIDAsIDAsIDApOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICAgICAgfQpAQCAtMjc3Myw5ICsyODA4LDEwIEBACiAgICAgICAgICAgICAgICAgaWYgKGRhdGEuYXJncyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXJncy5zZXRFeHRyYXNDbGFzc0xvYWRlcihzLmdldENsYXNzTG9hZGVyKCkpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBzLm9uU3RhcnQoZGF0YS5hcmdzLCBkYXRhLnN0YXJ0SWQpOworICAgICAgICAgICAgICAgIGludCByZXMgPSBzLm9uU3RhcnRDb21tYW5kKGRhdGEuYXJncywgZGF0YS5mbGFncywgZGF0YS5zdGFydElkKTsKICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpLnNlcnZpY2VEb25lRXhlY3V0aW5nKGRhdGEudG9rZW4pOworICAgICAgICAgICAgICAgICAgICBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpLnNlcnZpY2VEb25lRXhlY3V0aW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEudG9rZW4sIDEsIGRhdGEuc3RhcnRJZCwgcmVzKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAvLyBub3RoaW5nIHRvIGRvLgogICAgICAgICAgICAgICAgIH0KQEAgLTI4MDEsNyArMjgzNyw4IEBACiAgICAgICAgICAgICAgICAgICAgICgoQXBwbGljYXRpb25Db250ZXh0KSBjb250ZXh0KS5zY2hlZHVsZUZpbmFsQ2xlYW51cCh3aG8sICJTZXJ2aWNlIik7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkuc2VydmljZURvbmVFeGVjdXRpbmcodG9rZW4pOworICAgICAgICAgICAgICAgICAgICBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuZ2V0RGVmYXVsdCgpLnNlcnZpY2VEb25lRXhlY3V0aW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuLCAwLCAwLCAwKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAvLyBub3RoaW5nIHRvIGRvLgogICAgICAgICAgICAgICAgIH0KQEAgLTI4MzcsOSArMjg3NCw5IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkucGVyZm9ybVJlc3VtZSgpOwogCi0gICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfT05fUkVTVU1FX0NBTExFRCwgCisgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfT05fUkVTVU1FX0NBTExFRCwKICAgICAgICAgICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkuZ2V0Q29tcG9uZW50TmFtZSgpLmdldENsYXNzTmFtZSgpKTsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIHIucGF1c2VkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgci5zdG9wcGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgaWYgKHIuYWN0aXZpdHkubVN0YXJ0ZWRBY3Rpdml0eSkgewpAQCAtMjg3NSw3ICsyOTEyLDcgQEAKIAogICAgICAgICAgICAgZmluYWwgaW50IGZvcndhcmRCaXQgPSBpc0ZvcndhcmQgPwogICAgICAgICAgICA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gICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tQ2FsbGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIG1JbnN0cnVtZW50YXRpb24uY2FsbEFjdGl2aXR5T25QYXVzZShyLmFjdGl2aXR5KTsKLSAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfT05fUEFVU0VfQ0FMTEVELCAKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfT05fUEFVU0VfQ0FMTEVELAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkuZ2V0Q29tcG9uZW50TmFtZSgpLmdldENsYXNzTmFtZSgpKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFyLmFjdGl2aXR5Lm1DYWxsZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigKQEAgLTMzNDQsNyArMzM4MSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogIiArIGUudG9TdHJpbmcoKSwgZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgci5hY3Rpdml0eS5tQ2FsbGVkID0gZmFsc2U7CkBAIC0zNDI2LDcgKzM0NjMsNyBAQAogICAgICAgICB1bnNjaGVkdWxlR2NJZGxlcigpOwogCiAgICAgICAgIENvbmZpZ3VyYXRpb24gY2hhbmdlZENvbmZpZyA9IG51bGw7Ci0gICAgICAgIAorCiAgICAgICAgIC8vIEZpcnN0OiBtYWtlIHN1cmUgd2UgaGF2ZSB0aGUgbW9zdCByZWNlbnQgY29uZmlndXJhdGlvbiBhbmQgbW9zdAogICAgICAgICAvLyByZWNlbnQgdmVyc2lvbiBvZiB0aGUgYWN0aXZpdHksIG9yIHNraXAgaXQgaWYgc29tZSBwcmV2aW91cyBjYWxsCiAgICAgICAgIC8vIGhhZCB0YWtlbiBhIG1vcmUgcmVjZW50IHZlcnNpb24uCkBAIC0zNDQzLDM4ICszNDgwLDM4IEBACiAgICAgICAgICAgICAgICAgICAgIE4tLTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKHRtcCA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmIChtUGVuZGluZ0NvbmZpZ3VyYXRpb24gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGNoYW5nZWRDb25maWcgPSBtUGVuZGluZ0NvbmZpZ3VyYXRpb247CiAgICAgICAgICAgICAgICAgbVBlbmRpbmdDb25maWd1cmF0aW9uID0gbnVsbDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICAvLyBJZiB0aGVyZSB3YXMgYSBwZW5kaW5nIGNvbmZpZ3VyYXRpb24gY2hhbmdlLCBleGVjdXRlIGl0IGZpcnN0LgogICAgICAgICBpZiAoY2hhbmdlZENvbmZpZyAhPSBudWxsKSB7CiAgICAgICAgICAgICBoYW5kbGVDb25maWd1cmF0aW9uQ2hhbmdlZChjaGFuZ2VkQ29uZmlnKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBBY3Rpdml0eVJlY29yZCByID0gbUFjdGl2aXRpZXMuZ2V0KHRtcC50b2tlbik7CiAgICAgICAgIGlmIChsb2NhbExPR1YpIExvZy52KFRBRywgIkhhbmRsaW5nIHJlbGF1bmNoIG9mICIgKyByKTsKICAgICAgICAgaWYgKHIgPT0gbnVsbCkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHIuYWN0aXZpdHkubUNvbmZpZ0NoYW5nZUZsYWdzIHw9IGNvbmZpZ0NoYW5nZXM7CiAgICAgICAgIEludGVudCBjdXJyZW50SW50ZW50ID0gci5hY3Rpdml0eS5tSW50ZW50OwotICAgICAgICAKKwogICAgICAgICBCdW5kbGUgc2F2ZWRTdGF0ZSA9IG51bGw7CiAgICAgICAgIGlmICghci5wYXVzZWQpIHsKICAgICAgICAgICAgIHNhdmVkU3RhdGUgPSBwZXJmb3JtUGF1c2VBY3Rpdml0eShyLnRva2VuLCBmYWxzZSwgdHJ1ZSk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaGFuZGxlRGVzdHJveUFjdGl2aXR5KHIudG9rZW4sIGZhbHNlLCBjb25maWdDaGFuZ2VzLCB0cnVlKTsKLSAgICAgICAgCisKICAgICAgICAgci5hY3Rpdml0eSA9IG51bGw7CiAgICAgICAgIHIud2luZG93ID0gbnVsbDsKICAgICAgICAgci5oaWRlRm9yTm93ID0gZmFsc2U7CkBAIC0zNDk4LDcgKzM1MzUsNyBAQAogICAgICAgICBpZiAoc2F2ZWRTdGF0ZSAhPSBudWxsKSB7CiAgICAgICAgICAgICByLnN0YXRlID0gc2F2ZWRTdGF0ZTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBoYW5kbGVMYXVuY2hBY3Rpdml0eShyLCBjdXJyZW50SW50ZW50KTsKICAgICB9CiAKQEAgLTM1MjgsNyArMzU2NSw3IEBACiAgICAgICAgICAgICBib29sZWFuIGFsbEFjdGl2aXRpZXMsIENvbmZpZ3VyYXRpb24gbmV3Q29uZmlnKSB7CiAgICAgICAgIEFycmF5TGlzdDxDb21wb25lbnRDYWxsYmFja3M+IGNhbGxiYWNrcwogICAgICAgICAgICAgICAgID0gbmV3IEFycmF5TGlzdDxDb21wb25lbnRDYWxsYmFja3M+KCk7Ci0gICAgICAgIAorCiAgICAgICAgIGlmIChtQWN0aXZpdGllcy5zaXplKCkgPiAwKSB7CiAgICAgICAgICAgICBJdGVyYXRvcjxBY3Rpdml0eVJlY29yZD4gaXQgPSBtQWN0aXZpdGllcy52YWx1ZXMoKS5pdGVyYXRvcigpOwogICAgICAgICAgICAgd2hpbGUgKGl0Lmhhc05leHQoKSkgewpAQCAtMzU2OSwxMCArMzYwNiwxMCBAQAogICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICBjYWxsYmFja3MuYWRkKG1BbGxBcHBsaWNhdGlvbnMuZ2V0KGkpKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICByZXR1cm4gY2FsbGJhY2tzOwogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgZmluYWwgdm9pZCBwZXJmb3JtQ29uZmlndXJhdGlvbkNoYW5nZWQoCiAgICAgICAgICAgICBDb21wb25lbnRDYWxsYmFja3MgY2IsIENvbmZpZ3VyYXRpb24gY29uZmlnKSB7CiAgICAgICAgIC8vIE9ubHkgZm9yIEFjdGl2aXR5IG9iamVjdHMsIGNoZWNrIHRoYXQgdGhleSBhY3R1YWxseSBjYWxsIHVwIHRvIHRoZWlyCkBAIC0zNTgyLDE4ICszNjE5LDE4IEBACiAgICAgICAgIGlmIChhY3Rpdml0eSAhPSBudWxsKSB7CiAgICAgICAgICAgICBhY3Rpdml0eS5tQ2FsbGVkID0gZmFsc2U7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgYm9vbGVhbiBzaG91bGRDaGFuZ2VDb25maWcgPSBmYWxzZTsKICAgICAgICAgaWYgKChhY3Rpdml0eSA9PSBudWxsKSB8fCAoYWN0aXZpdHkubUN1cnJlbnRDb25maWcgPT0gbnVsbCkpIHsKICAgICAgICAgICAgIHNob3VsZENoYW5nZUNvbmZpZyA9IHRydWU7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgLy8gSWYgdGhlIG5ldyBjb25maWcgaXMgdGhlIHNhbWUgYXMgdGhlIGNvbmZpZyB0aGlzIEFjdGl2aXR5CiAgICAgICAgICAgICAvLyBpcyBhbHJlYWR5IHJ1bm5pbmcgd2l0aCB0aGVuIGRvbid0IGJvdGhlciBjYWxsaW5nCiAgICAgICAgICAgICAvLyBvbkNvbmZpZ3VyYXRpb25DaGFuZ2VkCiAgICAgICAgICAgICBpbnQgZGlmZiA9IGFjdGl2aXR5Lm1DdXJyZW50Q29uZmlnLmRpZmYoY29uZmlnKTsKICAgICAgICAgICAgIGlmIChkaWZmICE9IDApIHsKLSAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIC8vIElmIHRoaXMgYWN0aXZpdHkgZG9lc24ndCBoYW5kbGUgYW55IG9mIHRoZSBjb25maWcgY2hhbmdlcwogICAgICAgICAgICAgICAgIC8vIHRoZW4gZG9uJ3QgYm90aGVyIGNhbGxpbmcgb25Db25maWd1cmF0aW9uQ2hhbmdlZCBhcyB3ZSdyZQogICAgICAgICAgICAgICAgIC8vIGdvaW5nIHRvIGRlc3Ryb3kgaXQuCkBAIC0zNjAyLDEwICszNjM5LDEwIEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIGlmIChzaG91bGRDaGFuZ2VDb25maWcpIHsKICAgICAgICAgICAgIGNiLm9uQ29uZmlndXJhdGlvbkNoYW5nZWQoY29uZmlnKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAoYWN0aXZpdHkgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGlmICghYWN0aXZpdHkubUNhbGxlZCkgewogICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oCkBAIC0zNjE5LDE3ICszNjU2LDE3IEBACiAgICAgfQogCiAgICAgZmluYWwgdm9pZCBoYW5kbGVDb25maWd1cmF0aW9uQ2hhbmdlZChDb25maWd1cmF0aW9uIGNvbmZpZykgewotICAgICAgICAKKwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWxhdW5jaGluZ0FjdGl2aXRpZXMpIHsKICAgICAgICAgICAgIGlmIChtUGVuZGluZ0NvbmZpZ3VyYXRpb24gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGNvbmZpZyA9IG1QZW5kaW5nQ29uZmlndXJhdGlvbjsKICAgICAgICAgICAgICAgICBtUGVuZGluZ0NvbmZpZ3VyYXRpb24gPSBudWxsOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIEFycmF5TGlzdDxDb21wb25lbnRDYWxsYmFja3M+IGNhbGxiYWNrcwogICAgICAgICAgICAgICAgID0gbmV3IEFycmF5TGlzdDxDb21wb25lbnRDYWxsYmFja3M+KCk7Ci0gICAgICAgIAorCiAgICAgICAgIHN5bmNocm9uaXplZChtUGFja2FnZXMpIHsKICAgICAgICAgICAgIGlmIChtQ29uZmlndXJhdGlvbiA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgbUNvbmZpZ3VyYXRpb24gPSBuZXcgQ29uZmlndXJhdGlvbigpOwpAQCAtMzY2NCwxMCArMzcwMSwxMCBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGNhbGxiYWNrcyA9IGNvbGxlY3RDb21wb25lbnRDYWxsYmFja3NMb2NrZWQoZmFsc2UsIGNvbmZpZyk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgZmluYWwgaW50IE4gPSBjYWxsYmFja3Muc2l6ZSgpOwogICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICBwZXJmb3JtQ29uZmlndXJhdGlvbkNoYW5nZWQoY2FsbGJhY2tzLmdldChpKSwgY29uZmlnKTsKQEAgLTM2NzksNyArMzcxNiw3IEBACiAgICAgICAgIGlmIChyID09IG51bGwgfHwgci5hY3Rpdml0eSA9PSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcGVyZm9ybUNvbmZpZ3VyYXRpb25DaGFuZ2VkKHIuYWN0aXZpdHksIG1Db25maWd1cmF0aW9uKTsKICAgICB9CiAKQEAgLTM3MDIsNyArMzczOSw3IEBACiAgICAgICAgICAgICBEZWJ1Zy5zdG9wTWV0aG9kVHJhY2luZygpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgZmluYWwgdm9pZCBoYW5kbGVMb3dNZW1vcnkoKSB7CiAgICAgICAgIEFycmF5TGlzdDxDb21wb25lbnRDYWxsYmFja3M+IGNhbGxiYWNrcwogICAgICAgICAgICAgICAgID0gbmV3IEFycmF5TGlzdDxDb21wb25lbnRDYWxsYmFja3M+KCk7CkBAIC0zNzEwLDcgKzM3NDcsNyBAQAogICAgICAgICBzeW5jaHJvbml6ZWQobVBhY2thZ2VzKSB7CiAgICAgICAgICAgICBjYWxsYmFja3MgPSBjb2xsZWN0Q29tcG9uZW50Q2FsbGJhY2tzTG9ja2VkKHRydWUsIG51bGwpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIGZpbmFsIGludCBOID0gY2FsbGJhY2tzLnNpemUoKTsKICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewogICAgICAgICAgICAgY2FsbGJhY2tzLmdldChpKS5vbkxvd01lbW9yeSgpOwpAQCAtMzcyMSw3ICszNzU4LDcgQEAKICAgICAgICAgICAgIGludCBzcWxpdGVSZWxlYXNlZCA9IFNRTGl0ZURhdGFiYXNlLnJlbGVhc2VNZW1vcnkoKTsKICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoU1FMSVRFX01FTV9SRUxFQVNFRF9FVkVOVF9MT0dfVEFHLCBzcWxpdGVSZWxlYXNlZCk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLy8gQXNrIGdyYXBoaWNzI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HBhcGVyOwotICAgIH0KLQotICAgIHByaXZhdGUgRHJhd2FibGUgZ2V0Q3VycmVudFdhbGxwYXBlckxvY2tlZCgpIHsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0gZ2V0V2FsbHBhcGVyU2VydmljZSgpLmdldFdhbGxwYXBlcihtV2FsbHBhcGVyQ2FsbGJhY2spOwotICAgICAgICAgICAgaWYgKGZkICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBCaXRtYXAgYm0gPSBCaXRtYXBGYWN0b3J5LmRlY29kZUZpbGVEZXNjcmlwdG9yKGZkLmdldEZpbGVEZXNjcmlwdG9yKCkpOwotICAgICAgICAgICAgICAgIGlmIChibSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEZvciBub3cgY2xlYXIgdGhlIGRlbnNpdHkgdW50aWwgd2UgZmlndXJlIG91dCBob3cKLSAgICAgICAgICAgICAgICAgICAgLy8gdG8gZGVhbCB3aXRoIGl0IGZvciB3YWxscGFwZXJzLgotICAgICAgICAgICAgICAgICAgICBibS5zZXREZW5zaXR5KDApOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEJpdG1hcERyYXdhYmxlKGdldFJlc291cmNlcygpLCBibSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBudWxsOworICAgIHB1YmxpYyBEcmF3YWJsZSBwZWVrV2FsbHBhcGVyKCkgeworICAgICAgICByZXR1cm4gZ2V0V2FsbHBhcGVyTWFuYWdlcigpLnBlZWtEcmF3YWJsZSgpOwogICAgIH0KIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBpbnQgZ2V0V2FsbHBhcGVyRGVzaXJlZE1pbmltdW1XaWR0aCgpIHsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBnZXRXYWxscGFwZXJTZXJ2aWNlKCkuZ2V0V2lkdGhIaW50KCk7Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAvLyBTaG91bGRuJ3QgaGFwcGVuIQotICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGdldFdhbGxwYXBlck1hbmFnZXIoKS5nZXREZXNpcmVkTWluaW11bVdpZHRoKCk7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGludCBnZXRXYWxscGFwZXJEZXNpcmVkTWluaW11bUhlaWdodCgpIHsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBnZXRXYWxscGFwZXJTZXJ2aWNlKCkuZ2V0SGVpZ2h0SGludCgpOwotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgLy8gU2hvdWxkbid0IGhhcHBlbiEKLSAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICB9CisgICAgICAgIHJldHVybiBnZXRXYWxscGFwZXJNYW5hZ2VyKCkuZ2V0RGVzaXJlZE1pbmltdW1IZWlnaHQoKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgdm9pZCBzZXRXYWxscGFwZXIoQml0bWFwIGJpdG1hcCkgdGhyb3dzIElPRXhjZXB0aW9uICB7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvciBmZCA9IGdldFdhbGxwYXBlclNlcnZpY2UoKS5zZXRXYWxscGFwZXIoKTsKLSAgICAgICAgICAgIGlmIChmZCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgRmlsZU91dHB1dFN0cmVhbSBmb3MgPSBudWxsOwotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBmb3MgPSBuZXcgUGFyY2VsRmlsZURlc2NyaXB0b3IuQXV0b0Nsb3NlT3V0cHV0U3RyZWFtKGZkKTsKLSAgICAgICAgICAgICAgICBiaXRtYXAuY29tcHJlc3MoQml0bWFwLkNvbXByZXNzRm9ybWF0LlBORywgOTAsIGZvcyk7Ci0gICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgIGlmIChmb3MgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBmb3MuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgIH0KKyAgICAgICAgZ2V0V2FsbHBhcGVyTWFuYWdlcigpLnNldEJpdG1hcChiaXRtYXApOwogICAgIH0KIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIHNldFdhbGxwYXBlcihJbnB1dFN0cmVhbSBkYXRhKSB0aHJvd3MgSU9FeGNlcHRpb24gewotICAgICAgICB0cnkgewotICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IgZmQgPSBnZXRXYWxscGFwZXJTZXJ2aWNlKCkuc2V0V2FsbHBhcGVyKCk7Ci0gICAgICAgICAgICBpZiAoZmQgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIEZpbGVPdXRwdXRTdHJlYW0gZm9zID0gbnVsbDsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgZm9zID0gbmV3IFBhcmNlbEZpbGVEZXNjcmlwdG9yLkF1dG9DbG9zZU91dHB1dFN0cmVhbShmZCk7Ci0gICAgICAgICAgICAgICAgc2V0V2FsbHBhcGVyKGRhdGEsIGZvcyk7Ci0gICAgICAgICAgICB9IGZpbmFsbH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yY2VsRmlsZURlc2NyaXB0b3IuQXV0b0Nsb3NlT3V0cHV0U3RyZWFtKGZkKTsKLSAgICAgICAgICAgICAgICAgICAgc2V0V2FsbHBhcGVyKGdldFJlc291cmNlcygpLm9wZW5SYXdSZXNvdXJjZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmRyYXdhYmxlLmRlZmF1bHRfd2FsbHBhcGVyKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3MpOwotICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmb3MgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZm9zLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgIH0KKyAgICAgICAgZ2V0V2FsbHBhcGVyTWFuYWdlcigpLmNsZWFyKCk7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCkBAIC05MDEsOCArODA2LDEyIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSBpZiAoQUNUSVZJVFlfU0VSVklDRS5lcXVhbHMobmFtZSkpIHsKICAgICAgICAgICAgIHJldHVybiBnZXRBY3Rpdml0eU1hbmFnZXIoKTsKKyAgICAgICAgfSBlbHNlIGlmIChJTlBVVF9NRVRIT0RfU0VSVklDRS5lcXVhbHMobmFtZSkpIHsKKyAgICAgICAgICAgIHJldHVybiBJbnB1dE1ldGhvZE1hbmFnZXIuZ2V0SW5zdGFuY2UodGhpcyk7CiAgICAgICAgIH0gZWxzZSBpZiAoQUxBUk1fU0VSVklDRS5lcXVhbHMobmFtZSkpIHsKICAgICAgICAgICAgIHJldHVybiBnZXRBbGFybU1hbmFnZXIoKTsKKyAgICAgICAgfSB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XR1cm4gZ2V0VGVsZXBob255TWFuYWdlcigpOwogICAgICAgICB9IGVsc2UgaWYgKENMSVBCT0FSRF9TRVJWSUNFLmVxdWFscyhuYW1lKSkgewogICAgICAgICAgICAgcmV0dXJuIGdldENsaXBib2FyZE1hbmFnZXIoKTsKLSAgICAgICAgfSBlbHNlIGlmIChJTlBVVF9NRVRIT0RfU0VSVklDRS5lcXVhbHMobmFtZSkpIHsKLSAgICAgICAgICAgIHJldHVybiBJbnB1dE1ldGhvZE1hbmFnZXIuZ2V0SW5zdGFuY2UodGhpcyk7CisgICAgICAgIH0gZWxzZSBpZiAoV0FMTFBBUEVSX1NFUlZJQ0UuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0V2FsbHBhcGVyTWFuYWdlcigpOwogICAgICAgICB9CiAKICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQogCisgICAgcHJpdmF0ZSBBY2NvdW50TWFuYWdlciBnZXRBY2NvdW50TWFuYWdlcigpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChzU3luYykgeworICAgICAgICAgICAgaWYgKHNBY2NvdW50TWFuYWdlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgSUJpbmRlciBiID0gU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZShBQ0NPVU5UX1NFUlZJQ0UpOworICAgICAgICAgICAgICAgIElBY2NvdW50TWFuYWdlciBzZXJ2aWNlID0gSUFjY291bnRNYW5hZ2VyLlN0dWIuYXNJbnRlcmZhY2UoYik7CisgICAgICAgICAgICAgICAgc0FjY291bnRNYW5hZ2VyID0gbmV3IEFjY291bnRNYW5hZ2VyKHRoaXMsIHNlcnZpY2UpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBzQWNjb3VudE1hbmFnZXI7CisgICAgfQorCiAgICAgcHJpdmF0ZSBBY3Rpdml0eU1hbmFnZXIgZ2V0QWN0aXZpdHlNYW5hZ2VyKCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jKSB7CiAgICAgICAgICAgICBpZiAobUFjdGl2aXR5TWFuYWdlciA9PSBudWxsKSB7CkBAIC0xMDAxLDggKzkyMSw3IEBACiAgICAgICAgIHJldHVybiBzV2lmaU1hbmFnZXI7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBOb3RpZmljYXRpb25NYW5hZ2VyIGdldE5vdGlmaWNhdGlvbk1hbmFnZXIoKQotICAgIHsKKyAgICBwcml2YXRlIE5vdGlmaWNhdGlvbk1hbmFnZXIgZ2V0Tm90aWZpY2F0aW9uTWFuYWdlcigpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgewogICAgICAgICAgICAgaWYgKG1Ob3RpZmljYXRpb25NYW5hZ2VyID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uTWFuYWdlciA9IG5ldyBOb3RpZmljYXRpb25NYW5hZ2VyKApAQCAtMTAxMyw2ICs5MzIsMTYgQEAKICAgICAgICAgcmV0dXJuIG1Ob3RpZmljYXRpb25NYW5hZ2VyOwogICAgIH0KIAorICAgIHByaXZhdGUgV2FsbHBhcGVyTWFuYWdlciBnZXRXYWxscGFwZXJNYW5hZ2VyKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jKSB7CisgICAgICAgICAgICBpZiAobVdhbGxwYXBlck1hbmFnZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1XYWxscGFwZXJNYW5hZ2VyID0gbmV3IFdhbGxwYXBlck1hbmFnZXIoZ2V0T3V0ZXJDb250ZXh0KCksCisgICAgICAgICAgICAgICAgICAgICAgICBtTWFpblRocmVhZC5nZXRIYW5kbGVyKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBtV2FsbHBhcGVyTWFuYWdlcjsKKyAgICB9CisKICAgICBwcml2YXRlIFRlbGVwaG9ueU1hbmFnZXIgZ2V0VGVsZXBob255TWFuYWdlcigpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgewogICAgICAgICAgICAgaWYgKG1UZWxlcGhvbnlNYW5hZ2VyID09IG51bGwpIHsKQEAgLTEwNTIsMjEgKzk4MSwxNiBAQAogICAgICAgICByZXR1cm4gbVNlYXJjaE1hbmFnZXI7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBCbHVldG9vdGhEZXZpY2UgZ2V0Qmx1ZXRvb3RoRGV2aWNlKCkgewotICAgICAgICBpZiAoc0lzQmx1ZXRvb3RoRGV2aWNlQ2FjaGVkKSB7Ci0gICAgICAgICAgICByZXR1cm4gc0JsdWV0b290aERldmljZTsKLSAgICAgICAgfQotICAgICAgICBzeW5jaHJvbml6ZWQgKHNTeW5jKSB7CisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgQmx1ZXRvb3RoQWRhcHRlciBnZXRCbHVldG9vdGhBZGFwdGVyKCkgeworICAgICAgICBpZiAoIW1Jc0JsdWV0b290aEFkYXB0ZXJDYWNoZWQpIHsKKyAgICAgICAgICAgIG1Jc0JsdWV0b290aEFkYXB0ZXJDYWNoZWQgPSB0cnVlOwogICAgICAgICAgICAgSUJpbmRlciBiID0gU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZShCTFVFVE9PVEhfU0VSVklDRSk7Ci0gICAgICAgICAgICBpZiAoYiA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgc0JsdWV0b290aERldmljZSA9IG51bGw7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIElCbHVldG9vdGhEZXZpY2Ugc2VydmljZSA9IElCbHVldG9vdGhEZXZpY2UuU3R1Yi5hc0ludGVyZmFjZShiKTsKLSAgICAgICAgICAgICAgICBzQmx1ZXRvb3RoRGV2aWNlID0gbmV3IEJsdWV0b290aERldmljZShzZXJ2aWNlKTsKKyAgICAgICAgICAgIGlmIChiICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBJQmx1ZXRvb3RoIHNlcnZpY2U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CiAKICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBGZWF0dXJlSW5mb1tdIGdldFN5c3RlbUF2YWlsYWJsZUZlYXR1cmVzKCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVBNLmdldFN5c3RlbUF2YWlsYWJsZUZlYXR1cmVzKCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJQYWNrYWdlIG1hbmFnZXIgaGFzIGRpZWQiLCBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyBpbnQgY2hlY2tQZXJtaXNzaW9uKFN0cmluZyBwZXJtTmFtZSwgU3RyaW5nIHBrZ05hbWUpIHsKICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1QTS5jaGVja1Blcm1pc3Npb24ocGVybU5hbWUsIHBrZ05hbWUpOwpAQCAtMTc0Niw2ICsxNjY5LDE1IEBACiAgICAgICAgIH0KIAogICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGludCBjaGVja1NpZ25hdHVyZXMoaW50IHVpZDEsIGludCB1aWQyKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtUE0uY2hlY2tVaWRTaWduYXR1cmVzKHVpZDEsIHVpZDIpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiUGFja2FnZSBtYW5hZ2VyIGhhcyBkaWVkIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibG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aWNhdGlvbkNvbnRleHQgYXBwbGljYXRpb25Db250ZXh0ID0gbUNvbnRleHQuZ2V0KCk7Ci0gICAgICAgICAgICBpZiAoYXBwbGljYXRpb25Db250ZXh0ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBhcHBsaWNhdGlvbkNvbnRleHQubVdhbGxwYXBlciA9IG51bGw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9CiB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQXBwbGljYXRpb25FcnJvclJlcG9ydC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvYXBwL0FwcGxpY2F0aW9uRXJyb3JSZXBvcnQuamF2YQppbmRleCA2YjE3MjM2Li5hZWFlNWY5IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQXBwbGljYXRpb25FcnJvclJlcG9ydC5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9BcHBsaWNhdGlvbkVycm9yUmVwb3J0LmphdmEKQEAgLTE3MSw2ICsxNzEsMTEgQEAKICAgICAgICAgcHVibGljIFN0cmluZyB0aHJvd01ldGhvZE5hbWU7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIExpbmUgbnVtYmVyIHRoZSBleGNlcHRpb24gd2FzIHRocm93biBmcm9tLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCB0aHJvd0xpbmVOdW1iZXI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFN0YWNrIHRyYWNlLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIFN0cmluZyBzdGFja1RyYWNlOwpAQCAtMTkwLDYgKzE5NSw3IEBACiAgICAgICAgICAgICB0aHJvd0ZpbGVOYW1lID0gaW4ucmVhZFN0cmluZygpOwogICAgICAgICAgICAgdGhyb3dDbGFzc05hbWUgPSBpbi5yZWFkU3RyaW5nKCk7CiAgICAgICAgICAgICB0aHJvd01ldGhvZE5hbWUgPSBpbi5yZWFkU3RyaW5nKCk7CisgICAgICAgICAgICB0aHJvd0xpbmVOdW1iZXIgPSBpbi5yZWFkSW50KCk7CiAgICAgICAgICAgICBzdGFja1RyYWNlID0gaW4ucmVhZFN0cmluZygpOwogICAgICAgICB9CiAKQEAgLTIwMiw2ICsyMDgsNyBAQAogICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyh0aHJvd0ZpbGVOYW1lKTsKICAgICAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcodGhyb3dDbGFzc05hbWUpOwogICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyh0aHJvd01ldGhvZE5hbWUpOworICAgICAgICAgICAgZGVzdC53cml0ZUludCh0aHJvd0xpbmVOdW1iZXIpOwogICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyhzdGFja1RyYWNlKTsKICAgICAgICAgfQogCkBAIC0yMTQsNiArMjIxLDcgQEAKICAgICAgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgInRocm93RmlsZU5hbWU6ICIgKyB0aHJvd0ZpbGVOYW1lKTsKICAgICAgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgInRocm93Q2xhc3NOYW1lOiAiICsgdGhyb3dDbGFzc05hbWUpOwogICAgICAgICAgICAgcHcucHJpbnRsbihwcmVmaXggKyAidGhyb3dNZXRob2ROYW1lOiAiICsgdGhyb3dNZXRob2ROYW1lKTsKKyAgICAgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgInRocm93TGluZU51bWJlcjogIiArIHRocm93TGluZU51bWJlcik7CiAgICAgICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJzdGFja1RyYWNlOiAiICsgc3RhY2tUcmFjZSk7CiAgICAgICAgIH0KICAgICB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQXBwbGljYXRpb25UaHJlYWROYXRpdmUuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9B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ICAgICBhcmdzID0gSW50ZW50LkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChkYXRhKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYXJncyA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzY2hlZHVsZVNlcnZpY2VBcmdzKHRva2VuLCBzdGFydElkLCBmbCwgYXJncyk7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogCkBAIC0yNTEsNiArMjU4LDEzIEBACiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogCisgICAgICAgIGNhc2UgU0NIRURVTEVfU1VJQ0lERV9UUkFOU0FDVElPTjoKKyAgICAgICAgeworICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElBcHBsaWNhdGlvblRocmVhZC5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIHNjaGVkdWxlU3VpY2lkZSgpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKwogICAgICAgICBjYXNlIFJFUVVFU1RfVEhVTUJOQUlMX1RSQU5TQUNUSU9OOgogICAgICAgICB7CiAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUFwcGxpY2F0aW9uVGhyZWFkLmRlc2NyaXB0b3IpOwpAQCAtMzY0LDYgKzM3OCwxNiBAQAogICAgICAgICAgICAgc2NoZWR1bGVEZXN0cm95QmFja3VwQWdlbnQoYXBwSW5mbyk7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQorCisgICAgICAgIGNhc2UgR0VUX01FTU9SWV9JTkZPX1RSQU5TQUNUSU9OOgorICAgICAgICB7CisgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUFwcGxpY2F0aW9uVGhyZWFkLmRlc2NyaXB0b3IpOworICAgICAgICAgICAgRGVidWcuTWVtb3J5SW5mbyBtaSA9I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0RFU1RST1lfQkFDS1VQX0FHRU5UX1RSQU5TQUNUSU9OLCBkYXRhLCBudWxsLCAwKTsKKyAgICAgICAgbVJlbW90ZS50cmFuc2FjdChTQ0hFRFVMRV9ERVNUUk9ZX0JBQ0tVUF9BR0VOVF9UUkFOU0FDVElPTiwgZGF0YSwgbnVsbCwKKyAgICAgICAgICAgICAgICBJQmluZGVyLkZMQUdfT05FV0FZKTsKICAgICAgICAgZGF0YS5yZWN5Y2xlKCk7CiAgICAgfQogICAgIApAQCAtNTcxLDEyICs1OTcsMTggQEAKICAgICB9CiAKICAgICBwdWJsaWMgZmluYWwgdm9pZCBzY2hlZHVsZVNlcnZpY2VBcmdzKElCaW5kZXIgdG9rZW4sIGludCBzdGFydElkLAotCSAgICBJbnRlbnQgYXJncykgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisJICAgIGludCBmbGFncywgSW50ZW50IGFyZ3MpIHRocm93cyBSZW1vdGVFeGNlcHRpb24gewogICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKICAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBcHBsaWNhdGlvblRocmVhZC5kZXNjcmlwdG9yKTsKICAgICAgICAgZGF0YS53cml0ZVN0cm9uZ0JpbmRlcih0b2tlbik7CiAgICAgICAgIGRhdGEud3JpdGVJbnQoc3RhcnRJZCk7Ci0gICAgICAgIGFyZ3Mud3JpdGVUb1BhcmNlbChkYXRhLCAwKTsKKyAgICAgICAgZGF0YS53cml0ZUludChmbGFncyk7CisgICAgICAgIGlmIChhcmdzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRhdGEud3JpdGVJbnQoMSk7CisgICAgICAgICAgICBhcmdzLndyaXRlVG9QYXJjZWwoZGF0YSwgMCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkYXRhLndyaXRlSW50KDApOworICAgICAgICB9CiAgICAgICAgIG1SZW1vdGUudHJhbnNhY3QoU0NIRURVTEVfU0VSVklDRV9BUkdTX1RSQU5TQUNUSU9OLCBkYXRhLCBudWxsLAogICAgICAgICAgICAgICAgIElCaW5kZXIuRkxBR19PTkVXQVkpOwogICAgICAgICBkYXRhLnJlY3ljbGUoKTsKQEAgLTYyNyw3ICs2NTksMTUgQEAKICAgICAgICAgICAgICAgICBJQmluZGVyLkZMQUdfT05FV0FZKTsKICAgICAgICAgZGF0YS5yZWN5Y2xlKCk7CiAgICAgfQotICAgIAorCisgICAgcHVibGljIGZpbmFsIHZvaWQgc2NoZWR1bGVTdWljaWRlKCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUFwcGxpY2F0aW9uVGhyZWFkLmRlc2NyaXB0b3IpOworICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KFNDSEVEVUxFX1NVSUNJREVfVFJBTlNBQ1RJT04sIGRhdGEsIG51bGwsCisgICAgICAgICAgICAgICAgSUJpbmRlci5GTEFHX09ORVdBWSk7CisgICAgICAgIGRhdGEucmVjeWNsZSgpOworICAgIH0KKwogICAgIHB1YmxpYyBmaW5hbCB2b2lkIHJlcXVlc3RUaHVtYm5haWwoSUJpbmRlciB0b2tlbikKICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24gewogICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKQEAgLTc0Miw1ICs3ODIsMTYgQEAKICAgICAgICAgICAgICAgICBJQmluZGVyLkZMQUdfT05FV0FZKTsKICAgICAgICAgZGF0YS5yZWN5Y2xlKCk7CiAgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGdldE1lbW9yeUluZm8oRGVidWcuTWVtb3J5SW5mbyBvdXRJbmZvKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgUGFyY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gIGRpc21pc3MoKTsKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgYWN0aXZpdHkgYXNzb2NpYXRlZCB3aXRoIHRoaXMgZGlhbG9nLCBvciBudWxsIGlmIHRoZXJlIGlzIG5vIGFzc29jYWl0ZWQgYWN0aXZpdHkuCisgICAgICovCisgICAgcHJpdmF0ZSBDb21wb25lbnROYW1lIGdldEFzc29jaWF0ZWRBY3Rpdml0eSgpIHsKKyAgICAgICAgQWN0aXZpdHkgYWN0aXZpdHkgPSBtT3duZXJBY3Rpdml0eTsKKyAgICAgICAgQ29udGV4dCBjb250ZXh0ID0gZ2V0Q29udGV4dCgpOworICAgICAgICB3aGlsZSAoYWN0aXZpdHkgPT0gbnVsbCAmJiBjb250ZXh0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChjb250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpIHsKKyAgICAgICAgICAgICAgICBhY3Rpdml0eSA9IChBY3Rpdml0eSkgY29udGV4dDsgIC8vIGZvdW5kIGl0IQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBjb250ZXh0ID0gKGNvbnRleHQgaW5zdGFuY2VvZiBDb250ZXh0V3JhcHBlcikgPworICAgICAgICAgICAgICAgICAgICAgICAgKChDb250ZXh0V3JhcHBlcikgY29udGV4dCkuZ2V0QmFzZUNvbnRleHQoKSA6IC8vIHVud3JhcCBvbmUgbGV2ZWwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkb25lCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGFjdGl2aXR5ID09IG51bGwgPyBudWxsIDogYWN0aXZpdHkuZ2V0Q29tcG9uZW50TmFtZSgpOworICAgIH0KKwogCiAgICAgLyoqCiAgICAgICogUmVxdWVzdCB0aGF0IG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AgIGxhYmVsID0gcmVzb2x2ZUluZm8ubG9hZExhYmVsKHBtKTsKLSAgICAgICAgICAgIGlmIChsYWJlbCA9PSBudWxsICYmIHJlc29sdmVJbmZvLmFjdGl2aXR5SW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICBDb21wb25lbnRJbmZvIGNpID0gcmVzb2x2ZUluZm8uYWN0aXZpdHlJbmZvOworICAgICAgICAgICAgaWYgKGNpID09IG51bGwpIGNpID0gcmVzb2x2ZUluZm8uc2VydmljZUluZm87CisgICAgICAgICAgICBpZiAobGFiZWwgPT0gbnVsbCAmJiBjaSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgbGFiZWwgPSByZXNvbHZlSW5mby5hY3Rpdml0eUluZm8ubmFtZTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIAotICAgICAgICAgICAgaWNvbiA9IHJlc2l6ZXIuY3JlYXRlSWNvblRodW1ibmFpbChyZXNvbHZlSW5mby5sb2FkSWNvbihwbSkpOwotICAgICAgICAgICAgcGFja2FnZU5hbWUgPSByZXNvbHZlSW5mby5hY3Rpdml0eUluZm8uYXBwbGljYXRpb25JbmZvLnBhY2thZ2VOYW1lOwotICAgICAgICAgICAgY2xhc3NOYW1lID0gcmVzb2x2ZUluZm8uYWN0aXZpdHlJbmZvLm5hbWU7CisgICAgICAgICAgICBpZiAocmVzaXplciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWNvbiA9IHJlc2l6ZXIuY3JlYXRlSWNvblRodW1ibmFpbChyZXNvbHZlSW5mby5sb2FkSWNvbihwbSkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcGFja2FnZU5hbWUgPSBjaS5hcHBsaWNhdGlvbkluZm8ucGFja2FnZU5hbWU7CisgICAgICAgICAgICBjbGFzc05hbWUgPSBjaS5uYW1lOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIExpc3RJdGVtKCkgewpAQCAtOTAsMTMgKzk1LDE1IEBACiAgICAgICAgIHByaXZhd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iA9IG1JY29uUmVzaXplci5jcmVhdGVJY29uVGh1bWJuYWlsKAorICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5yZXNvbHZlSW5mby5sb2FkSWNvbihnZXRQYWNrYWdlTWFuYWdlcigpKSk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICB0ZXh0LnNldENvbXBvdW5kRHJhd2FibGVzV2l0aEludHJpbnNpY0JvdW5kcyhpdGVtLmljb24sIG51bGwsIG51bGwsIG51bGwpOwogICAgICAgICB9CiAgICAgICAgIApAQCAtMzI1LDEyICszMzYsMTMgQEAKICAgICAKICAgICAgICAgcmVxdWVzdFdpbmRvd0ZlYXR1cmUoV2luZG93LkZFQVRVUkVfSU5ERVRFUk1JTkFURV9QUk9HUkVTUyk7CiAgICAgICAgIHNldFByb2dyZXNzQmFySW5kZXRlcm1pbmF0ZVZpc2liaWxpdHkodHJ1ZSk7Ci0gICAgICAgIHNldENvbnRlbnRWaWV3KGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LmFjdGl2aXR5X2xpc3QpOwotICAgICAgICAKKyAgICAgICAgb25TZXRDb250ZW50VmlldygpOwogICAgICAgICAgICAgCisgICAgICAgIG1JY29uUmVzaXplciA9IG5ldyBJY29uUmVzaXplcigpOworICAgICAgICAKICAgICAgICAgbUludGVudCA9IG5ldyBJbnRlbnQoZ2V0VGFyZ2V0SW50ZW50KCkpOwogICAgICAgICBtSW50ZW50LnNldENvbXBvbmVudChudWxsKTsKLSAgICAgICAgbUFkYXB0ZXIgPSBuZXcgQWN0aXZpdHlBZGFwdGVyKCk7CisgICAgICAgIG1BZGFwdGVyID0gbmV3IEFjdGl2aXR5QWRhcHRlcihtSWNvblJlc2l6ZXIpOwogICAgICAgICAKICAgICAgICAgc2V0TGlzdEFkYXB0ZXIobUFkYXB0ZXIpOwogICAgICAgICBnZXRMaXN0VmlldygpLnNldFRleHRGaWx0ZXJFbmFibGVkKHRydWUpOwpAQCAtMzM4LDEwICszNTAsMTcgQE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G1hbmFnZXJzZXJ2aWNlLCBpbiB0dXJuLAorICAgICAqIHVzZXMgdGhpcyB0byBwcm9wZXJseSBoYW5kbGUgdGhlIGJhY2sgc3RhY2suCisgICAgICovCiAgICAgcHJpdmF0ZSBpbnQgbUlkZW50OworCisgICAgLyoqCisgICAgICogVGhlIHBhY2thZ2UgYXNzb2NpYXRlZCB3aXRoIHRoaXMgc2VhY2ggbWFuYWdlci4KKyAgICAgKi8KKyAgICBwcml2YXRlIFN0cmluZyBtQXNzb2NpYXRlZFBhY2thZ2U7CiAgICAgCiAgICAgLy8gcGFja2FnZSBwcml2YXRlIHNpbmNlIHRoZXkgYXJlIHVzZWQgYnkgdGhlIGlubmVyIGNsYXNzIFNlYXJjaE1hbmFnZXJDYWxsYmFjawogICAgIC8qIHBhY2thZ2UgKi8gZmluYWwgSGFuZGxlciBtSGFuZGxlcjsKQEAgLTE2NTYsMTEgKzE2NjcsMTUgQEAKICAgICAgICAgcmV0dXJuIG1JZGVudCAhPSAwOwogICAgIH0KICAgICAKLSAgICAvKnBhY2thZ2UqLyB2b2lkIHNldElkZW50KGludCBpZGVudCkgeworICAgIC8qcGFja2FnZSovIHZvaWQgc2V0SWRlbnQoaW50IGlkZW50LCBDb21wb25lbnROYW1lIGNvbXBvbmVudCkgewogICAgICAgICBpZiAobUlkZW50ICE9IDApIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIm1JZGVudCBhbHJlYWR5IHNldCIpOwogICAgICAgICB9CisgICAgICAgIGlmIChjb21wb25lbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiY29tcG9uZW50IG11c3QgYmUgbm9uLW51bGwiKTsKKyAgICAgICAgfQogICAgICAgICBtSWRlbnQgPSBpZGVudDsKKyAgICAgICAgbUFzc29jaWF0ZWRQYWNrYWdlID0gY29tcG9uZW50LmdldFBhY2thZ2VOYW1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2VydmljZUluZm87CisgICAgICAgIAorICAgICAgICBQYWNrYWdlTWFuYWdlciBwbSA9IGNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKTsKKyAgICAgICAgU3RyaW5nIHNldHRpbmdzQWN0aXZpdHlDb21wb25lbnQgPSBudWxsOworICAgICAgICAKKyAgICAgICAgWG1sUmVzb3VyY2VQYXJzZXIgcGFyc2VyID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHBhcnNlciA9IHNpLmxvYWRYbWxNZXRhRGF0YShwbSwgV2FsbHBhcGVyU2VydmljZS5TRVJWSUNFX01FVEFfREFUQSk7CisgICAgICAgICAgICBpZiAocGFyc2VyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigiTm8gIgorICAgICAgICAgICAgICAgICAgICAgICAgKyBXYWxscGFwZXJTZXJ2aWNlLlNFUlZJQ0VfTUVUQV9EQVRBICsgIiBtZXRhLWRhdGEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgICAgICBBdHRyaWJ1dGVTZXQgYXR0cnMgPSBYbWwuYXNBdHRyaWJ1dGVTZXQocGFyc2VyKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaW50IHR5cGU7CisgICAgICAgICAgICB3aGlsZSAoKHR5cGU9cGFyc2VyLm5leHQoKSkgIT0gWG1sUHVsbFBhcnNlci5FTkRfRE9DVU1FTlQKKyAgICAgICAgICAgICAgICAgICAgJiYgdHlwZSAhPSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBTdHJpbmcgbm9kZU5hbWUgPSBwYXJzZXIuZ2V0TmFtZSgpOworICAgICAgICAgICAgaWYgKCEid2FsbHBhcGVyIi5lcXVhbHMobm9kZU5hbWUpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFhtbFB1bGxQYXJzZXJFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiTWV0YS1kYXRhIGRvZXMgbm90IHN0YXJ0IHdpdGggd2FsbHBhcGVyIHRhZyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBUeXBlZEFycmF5IHNhID0gY29udGV4dC5nZXRSZXNvdXJjZXMoKS5vYnRhaW5BdHRyaWJ1dGVzKGF0dHJzLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XYWxscGFwZXIpOworICAgICAgICAgICAgc2V0dGluZ3NBY3Rpdml0eUNvbXBvbmVudCA9IHNhLmdldFN0cmluZygKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2FsbHBhcGVyX3NldHRpbmdzQWN0aXZpdHkpOworICAgICAgICAgICAgc2EucmVjeWNsZSgpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKHBhcnNlciAhPSBudWxsKSBwYXJzZXIuY2xvc2UoKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbVNldHRpbmdzQWN0aXZpdHlOYW1lID0gc2V0dGluZ3NBY3Rpdml0eUNvbXBvbmVudDsKKyAgICB9CisKKyAgICBXYWxscGFwZXJJbmZvKFBhcmNlbCBzb3VyY2UpIHsKKyAgICAgICAgbVNldHRpbmdzQWN0aXZpdHlOYW1lID0gc291cmNlLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgbVNlcnZpY2UgPSBSZXNvbHZlSW5mby5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoc291cmNlKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSAuYXBrIHBhY2thZ2UgdGhhdCBpbXBsZW1lbnRzIHRoaXMgd2FsbHBhcGVyLgorICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgZ2V0UGFja2FnZU5hbWUoKSB7CisgICAgICAgIHJldHVybiBtU2VydmljZS5zZXJ2aWNlSW5mby5wYWNrYWdlTmFtZTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSBjbGFzcyBuYW1lIG9mIHRoZSBzZXJ2aWNlIGNvbXBvbmVudCB0aGF0IGltcGxlbWVudHMKKyAgICAgKiB0aGlzIHdhbGxwYXBlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldFNlcnZpY2VOYW1lKCkgeworICAgICAgICByZXR1cm4gbVNlcnZpY2Uuc2VydmljZUluZm8ubmFtZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIHJhdyBpbmZvcm1hdGlvbiBhYm91dCB0aGUgU2VydmljZSBpbXBsZW1lbnRpbmcgdGhpcworICAgICAqIHdhbGxwYXBlci4gIERvIG5vdCBtb2RpZnkgdGhlIHJldHVybmVkIG9iamVjdC4KKyAgICAgKi8KKyAgICBwdWJsaWMgU2VydmljZUluZm8gZ2V0U2VydmljZUluZm8oKSB7CisgICAgICAgIHJldHVybiBtU2VydmljZS5zZXJ2aWNlSW5mbzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIGNvbXBvbmVudCBvZiB0aGUgc2VydmljZSB0aGF0IGltcGxlbWVudHMgdGhpcyB3YWxscGFwZXIuCisgICAgICovCisgICAgcHVibGljIENvbXBvbmVudE5hbWUgZ2V0Q29tcG9uZW50KCkgeworICAgICAgICByZXR1cm4gbmV3IENvbXBvbmVudE5hbWUobVNlcnZpY2Uuc2VydmljZUluZm8ucGFja2FnZU5hbWUsCisgICAgICAgICAgICAgICAgbVNlcnZpY2Uuc2VydmljZUluZm8ubmFtZSk7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIExvYWQgdGhlIHVzZXItZGlzcGxheWVkIGxhYmVsIGZvciB0aGlzIHdhbGxwYXBlci4KKyA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NzIG5hbWUgcmV0dXJuZWQgaGVyZS4KKyAgICAgKiAKKyAgICAgKiA8cD5BIG51bGwgd2lsbCBiZSByZXR1cm5lZCBpZiB0aGVyZSBpcyBubyBzZXR0aW5ncyBhY3Rpdml0eSBhc3NvY2lhdGVkCisgICAgICogd2l0aCB0aGUgd2FsbHBhcGVyLgorICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgZ2V0U2V0dGluZ3NBY3Rpdml0eSgpIHsKKyAgICAgICAgcmV0dXJuIG1TZXR0aW5nc0FjdGl2aXR5TmFtZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgZHVtcChQcmludGVyIHB3LCBTdHJpbmcgcHJlZml4KSB7CisgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgIlNlcnZpY2U6Iik7CisgICAgICAgIG1TZXJ2aWNlLmR1bXAocHcsIHByZWZpeCArICIgICIpOworICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJtU2V0dGluZ3NBY3Rpdml0eU5hbWU9IiArIG1TZXR0aW5nc0FjdGl2aXR5TmFtZSk7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIHJldHVybiAiV2FsbHBhcGVySW5mb3siICsgbVNlcnZpY2Uuc2VydmljZUluZm8ubmFtZQorICAgICAgICAgICAgICAgICsgIiwgc2V0dGluZ3M6ICIKKyAgICAgICAgICAgICAgICArIG1TZXR0aW5nc0FjdGl2aXR5TmFtZSArICJ9IjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBVc2VkIHRvIHBhY2thZ2UgdGhpcyBvYmplY3QgaW50byBhIHtAbGluayBQYXJjZWx9LgorICAgICAqIAorICAgICAqIEBwYXJhbSBkZXN0IFRoZSB7QGxpbmsgUGFyY2VsfSB0byBiZSB3cml0dGVuLgorICAgICAqIEBwYXJhbSBmbGFncyBUaGUgZmxhZ3MgdXNlZCBmb3IgcGFyY2V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HByaXZhdGUgc3RhdGljIGJvb2xlYW4gREVCVUcgPSBmYWxzZTsKKworICAgIC8qKgorICAgICAqIExhdW5jaCBhbiBhY3Rpdml0eSBmb3IgdGhlIHVzZXIgdG8gcGljayB0aGUgY3VycmVudCBnbG9iYWwgbGl2ZQorICAgICAqIHdhbGxwYXBlci4KKyAgICAgKiBAaGlkZSBMaXZlIFdhbGxwYXBlcgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDVElPTl9MSVZFX1dBTExQQVBFUl9DSE9PU0VSCisgICAgICAgICAgICA9ICJhbmRyb2lkLnNlcnZpY2Uud2FsbHBhcGVyLkxJVkVfV0FMTFBBUEVSX0NIT09TRVIiOworICAgIAorICAgIHByaXZhdGUgZmluYWwgQ29udGV4dCBtQ29udGV4dDsKKyAgICAKKyAgICBzdGF0aWMgY2xhc3MgR2xvYmFscyBleHRlbmRzIElXYWxscGFwZXJNYW5hZ2VyQ2FsbGJhY2suU3R1YiB7CisgICAgICAgIHByaXZhdGUgSVdhbGxwYXBlck1hbmFnZXIgbVNlcnZpY2U7CisgICAgICAgIHByaXZhdGUgQml0bWFwIG1XYWxscGFwZXI7CisgICAgICAgIAorICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTVNHX0NMRUFSX1dBTExQQVBFUiA9IDE7CisgICAgICAgIAorICAgICAgICBwcml2YXRlIGZpbmFsIEhhbmRsZXIgbUhhbmRsZXI7CisgICAgICAgIAorICAgICAgICBHbG9iYWxzKExvb3BlciBsb29wZXIpIHsKKyAgICAgICAgICAgIElCaW5kZXIgYiA9IFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQ29udGV4dC5XQUxMUEFQRVJfU0VSVklDRSk7CisgICAgICAgICAgICBtU2VydmljZSA9IElXYWxscGFwZXJNYW5hZ2VyLlN0dWIuYXNJbnRlcmZhY2UoYik7CisgICAgICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKGxvb3BlcikgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBNU0dfQ0xFQVJfV0FMTFBBUEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2FsbHBhcGVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgdm9pZCBvbldhbGxwYXBlckNoYW5nZWQoKSB7CisgICAgICAgICAgICAvKiBUaGUgd2FsbHBhcGVyIGhhcyBjaGFuZ2VkIGJ1dCB3ZSBzaG91bGRuJ3QgZWFnZXJseSBsb2FkIHRoZQorICAgICAgICAgICAgICogd2FsbHBhcGVyIGFzIHRoYXQgd291bGQgYmUgaW5lZmZpY2llbnQuIFJlc2V0IHRoZSBjYWNoZWQgd2FsbHBhcGVyCisgICAgICAgICAgICAgKiB0byBudWxsIHNvIGlmIHRoZSB1c2VyIHJlcXVlc3RzIHRoZSB3YWxscGFwZXIgYWdhaW4gdGhlbiB3ZSdsbAorICAgICAgICAgICAgICogZmV0Y2ggaXQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2UoTVNHX0NMRUFSX1dBTExQQVBFUik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBCaXRtYXAgcGVla1dhbGxwYXBlckJpdG1hcChDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1XYWxscGFwZXI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1XYWxscGFwZXIgPSBnZXRDdXJyZW50V2FsbHBhcGVyTG9ja2VkKGNvbnRleHQpOworICAgICAgICAgICAgICAgIHJldHVybiBtV2FsbHBhcGVyOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwcml2YXRlIEJpdG1hcCBnZXRDdXJyZW50V2FsbHBhcGVyTG9ja2VkKENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBCdW5kbGUgcGFyYW1zID0gbmV3IEJ1bmRsZSgpOworICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0gbVNlcnZpY2UuZ2V0V2FsbHBhcGVyKHRoaXMsIHBhcmFtcyk7CisgICAgICAgICAgICAgICAgaWYgKGZkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHdpZHRoID0gcGFyYW1zLmdldEludCgid2lkdGgiLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhlaWdodCA9IHBhcmFtcy5nZXRJbnQoImhlaWdodCIsIDApOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgaWYgKHdpZHRoIDw9IDAgfHwgaGVpZ2h0IDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIERlZ2VuZXJhdGUgY2FzZTogbm8gc2l6ZSByZXF1ZXN0ZWQsIGp1c3QgbG9hZAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYml0bWFwIGFzLWlzLgorICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gQml0bWFwRmFjdG9yeS5kZWNvZGVGaWxlRGVzY3JpcHRvcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmQuZ2V0RmlsZURlc2NyaXB0b3IoKSwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZkLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYm0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtLnNldERlbnNpdHkoRGlzcGxheU1ldHJpY3MuREVOU0lUWV9ERVZJQ0UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJtOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAvLyBMb2FkIHRoZSBiaXRtYXAgd2l0aCBmdWxsIGNvbG9yIGRlcHRoLCB0byBwcmVzZXJ2ZQorICAgICAgICAgICAgICAgICAgICAvLyBxdWFsaXR5IGZvciBsYXRlciBwcm9jZXNzaW5nLgorICAgICAgICAgICAgICAgICAgICBCaXRtYXBGYWN0b3J5Lk9wdGlvbnMgb3B0aW9ucyA9IG5ldyBCaXRtYXBGYWN0b3J5Lk9wdGlvbnMoKTsKKyAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5pbkRpdGhlciA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmluUHJlZmVycmVkQ29uZmlnID0gQml0bWFwLkNvbmZpZy5BUkdCXzg4ODg7CisgICAgICAgICAgICAgICAgICAgIEJpdG1hcCBibSA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlRmlsZURlc2NyaXB0b3IoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmQuZ2V0RmlsZURlc2NyaXB0b3IoKSwgbnVsbCwgb3B0aW9ucyk7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmZC5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGJtID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBibTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBibS5zZXREZW5zaXR5KERpc3BsYXlNZXRyaWNzLkRFTlNJVFlfREVWSUNFKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIGZpbmFsIGJpdG1hcCB3ZSB3YW50IHRvIHJldHVybi4KKyAgICAgICAgICAgICAgICAgICAgQml0bWFwIG5ld2JtID0gQml0bWFwLmNyZWF0ZUJpdG1hcCh3aWR0aCwgaGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtLmdldENvbmZpZygpKTsKKyAgICAgICAgICAgICAgICAgICAgbmV3Ym0uc2V0RGVuc2l0eShEaXNwbGF5TWV0cmljcy5ERU5TSVRZX0RFVklDRSk7CisgICAgICAgICAgICAgICAgICAgIENhbnZhcyBjID0gbmV3IENhbnZhcyhuZXdibSk7CisgICAgICAgICAgICAgICAgICAgIGMuc2V0RGVuc2l0eShEaXNwbGF5TWV0cmljcy5ERU5TSVRZX0RFVklDRSk7CisgICAgICAgICAgICAgICAgICAgIFJlY3QgdGFyZ2V0UmVjdCA9IG5ldyBSZWN0KCk7CisgICAgICAgICAgICAgICAgICAgIHRhcmdldFJlY3QubGVmdCA9IHRhcmdldFJlY3QudG9wID0gMDsKKyAgICAgICAgICAgICAgICAgICAgdGFyZ2V0UmVjdC5yaWdodCA9IGJtLmdldFdpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgIHRhcmdldFJlY3QuYm90dG9tID0gYm0uZ2V0SGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpbnQgZGVsdGF3ID0gd2lkdGggLSB0YXJnZXRSZWN0LnJpZ2h0OworICAgICAgICAgICAgICAgICAgICBpbnQgZGVsdGFoID0gaGVpZ2h0IC0gdGFyZ2V0UmVjdC5ib3R0b207CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpZiAoZGVsdGF3ID4gMCB8fCBkZWx0YWggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBuZWVkIHRvIHNjYWxlIHVwIHNvIGl0IGNvdmVycyB0aGUgZW50aXJlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcmVhLgorICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc2NhbGUgPSAxLjBmOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhdyA+IGRlbHRhaCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gd2lkdGggLyAoZmxvYXQpdGFyZ2V0UmVjdC5yaWdodDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSBoZWlnaHQgLyAoZmxvYXQpdGFyZ2V0UmVjdC5ib3R0b207CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRSZWN0LnJpZ2h0ID0gKGludCkodGFyZ2V0UmVjdC5yaWdodCpzY2FsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRSZWN0LmJvdHRvbSA9IChpbnQpKHRhcmdldFJlY3QuYm90dG9tKnNjYWxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhdyA9IHdpZHRoIC0gdGFyZ2V0UmVjdC5yaWdodDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhaCA9IGhlaWdodCAtIHRhcmdldFJlY3QuYm90dG9tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICB0YXJnZXRSZWN0Lm9mZnNldChkZWx0YXcvMiwgZGVsdGFoLzIpOworICAgICAgICAgICAgICAgICAgICBQYWludCBwYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgICAgICAgICBwYWludC5zZXRGaWx0ZXJCaXRtYXAodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHBhaW50LnNldERpdGhlcih0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgYy5kcmF3Qml0bWFwKGJtLCBudWxsLCB0YXJnZXRSZWN0LCBwYWludCk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBibS5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXdibTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBzdGF0aWMgT2JqZWN0IG1TeW5jID0gbmV3IE9iamVjdCgpOworICAgIHByaXZhdGUgc3RhdGljIEdsb2JhbHMgc0dsb2JhbHM7CisKKyAgICBzdGF0aWMgdm9pZCBpbml0R2xvYmFscyhMb29wZXIgbG9vcGVyKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmMpIHsKKyAgICAgICAgICAgIGlmIChzR2xvYmFscyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgc0dsb2JhbHMgPSBuZXcgR2xvYmFscyhsb29wZXIpOworICAgICAgICAgICAgfQorICA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RHJhd2FibGUoKSB7CisgICAgICAgIERyYXdhYmxlIGRyID0gcGVla0RyYXdhYmxlKCk7CisgICAgICAgIHJldHVybiBkciAhPSBudWxsID8gZHIgOiBSZXNvdXJjZXMuZ2V0U3lzdGVtKCkuZ2V0RHJhd2FibGUoCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kcmF3YWJsZS5kZWZhdWx0X3dhbGxwYXBlcik7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0cmlldmUgdGhlIGN1cnJlbnQgc3lzdGVtIHdhbGxwYXBlci4gIFRoaXMgaXMgcmV0dXJuZWQgYXMgYW4KKyAgICAgKiBhYnN0cmFjdCBEcmF3YWJsZSB0aGF0IHlvdSBjYW4gaW5zdGFsbCBpbiBhIFZpZXcgdG8gZGlzcGxheSB3aGF0ZXZlcgorICAgICAqIHdhbGxwYXBlciB0aGUgdXNlciBoYXMgY3VycmVudGx5IHNldC4gIElmIHRoZXJlIGlzIG5vIHdhbGxwYXBlciBzZXQsCisgICAgICogYSBudWxsIHBvaW50ZXIgaXMgcmV0dXJuZWQuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFJldHVybnMgYSBEcmF3YWJsZSBvYmplY3QgdGhhdCB3aWxsIGRyYXcgdGhlIHdhbGxwYXBlciBvciBhCisgICAgICogbnVsbCBwb2ludGVyIGlmIHRoZXNlIGlzIG5vbmUuCisgICAgICovCisgICAgcHVibGljIERyYXdhYmxlIHBlZWtEcmF3YWJsZSgpIHsKKyAgICAgICAgQml0bWFwIGJtID0gc0dsb2JhbHMucGVla1dhbGxwYXBlckJpdG1hcChtQ29udGV4dCk7CisgICAgICAgIHJldHVybiBibSAhPSBudWxsID8gbmV3IEJpdG1hcERyYXdhYmxlKG1Db250ZXh0LmdldFJlc291cmNlcygpLCBibSkgOiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIElmIHRoZSBjdXJyZW50IHdhbGxwYXBlciBpcyBhIGxpdmUgd2Fsb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AqLworICAgIHB1YmxpYyB2b2lkIHNldFJlc291cmNlKGludCByZXNpZCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIFJlc291cmNlcyByZXNvdXJjZXMgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKTsKKyAgICAgICAgICAgIC8qIFNldCB0aGUgd2FsbHBhcGVyIHRvIHRoZSBkZWZhdWx0IHZhbHVlcyAqLworICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IgZmQgPSBzR2xvYmFscy5tU2VydmljZS5zZXRXYWxscGFwZXIoCisgICAgICAgICAgICAgICAgICAgICJyZXM6IiArIHJlc291cmNlcy5nZXRSZXNvdXJjZU5hbWUocmVzaWQpKTsKKyAgICAgICAgICAgIGlmIChmZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgRmlsZU91dHB1dFN0cmVhbSBmb3MgPSBudWxsOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGZvcyA9IG5ldyBQYXJjZWxGaWxlRGVzY3JpcHRvci5BdXRvQ2xvc2VPdXRwdXRTdHJlYW0oZmQpOworICAgICAgICAgICAgICAgICAgICBzZXRXYWxscGFwZXIocmVzb3VyY2VzLm9wZW5SYXdSZXNvdXJjZShyZXNpZCksIGZvcyk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZvcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3MuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBDaGFuZ2UgdGhlIGN1cnJlbnQgc3lzdGVtIHdhbGxwYXBlciB0byBhIGJpdG1hcC4gIFRoZSBnaXZlbiBiaXRtYXAgaXMKKyAgICAgKiBjb252ZXJ0ZWQgdG8gYSBQTkcgYW5kIHN0b3JlZCBhcyB0aGUgd2FsbHBhcGVyLiAgT24gc3VjY2VzcywgdGhlIGludGVudAorICAgICAqIHtAbGluayBJbnRlbnQjQUNUSU9OX1dBTExQQVBFUl9DSEFOR0VEfSBpcyBicm9hZGNhc3QuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYml0bWFwIFRoZSBiaXRtYXAgdG8gc2F2ZS4KKyAgICAgKgorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gSWYgYW4gZXJyb3Igb2NjdXJzIHJldmVydGluZyB0byB0aGUgZGVmYXVsdAorICAgICAqIHdhbGxwYXBlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRCaXRtYXAoQml0bWFwIGJpdG1hcCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGZkID0gc0dsb2JhbHMubVNlcnZpY2Uuc2V0V2FsbHBhcGVyKG51bGwpOworICAgICAgICAgICAgaWYgKGZkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGaWxlT3V0cHV0U3RyZWFtIGZvcyA9IG51bGw7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGZvcyA9IG5ldyBQYXJjZWxGaWxlRGVzY3JpcHRvci5BdXRvQ2xvc2VPdXRwdXRTdHJlYW0oZmQpOworICAgICAgICAgICAgICAgIGJpdG1hcC5jb21wcmVzcyhCaXRtYXAuQ29tcHJlc3NGb3JtYXQuUE5HLCA5MCwgZm9zKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgaWYgKGZvcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZvcy5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENoYW5nZSB0aGUgY3VycmVudCBzeXN0ZW0gd2FsbHBhcGVyIHRvIGEgc3BlY2lmaWMgYnl0ZSBzdHJlYW0uICBUaGUKKyAgICAgKiBnaXZlIElucHV0U3RyZWFtIGlzIGNvcGllZCBpbnRvIHBlcnNpc3RlbnQgc3RvcmFnZSBhbmQgd2lsbCBub3cgYmUKKyAgICAgKiB1c2VkIGFzIHRoZSB3YWxscGFwZXIuICBDdXJyZW50bHkgaXQgbXVzdCBiZSBlaXRoZXIgYSBKUEVHIG9yIFBORworICAgICAqIGltYWdlLiAgT24gc3VjY2VzcywgdGhlIGludGVudCB7QGxpbmsgSW50ZW50I0FDVElPTl9XQUxMUEFQRVJfQ0hBTkdFRH0KKyAgICAgKiBpcyBicm9hZGNhc3QuCisgICAgICoKKyAgICAgKiBAcGFyYW0gZGF0YSBBIHN0cmVhbSBjb250YWluaW5nIHRoZSByYXcgZGF0YSB0byBpbnN0YWxsIGFzIGEgd2FsbHBhcGVyLgorICAgICAqCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBJZiBhbiBlcnJvciBvY2N1cnMgcmV2ZXJ0aW5nIHRvIHRoZSBkZWZhdWx0CisgICAgICogd2FsbHBhcGVyLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFN0cmVhbShJbnB1dFN0cmVhbSBkYXRhKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICB0cnkgeworICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IgZmQgPSBzR2xvYmFscy5tU2VydmljZS5zZXRXYWxscGFwZXIobnVsbCk7CisgICAgICAgICAgICBpZiAoZmQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZpbGVPdXRwdXRTdHJlYW0gZm9zID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZm9zID0gbmV3IFBhcmNlbEZpbGVEZXNjcmlwdG9yLkF1dG9DbG9zZU91dHB1dFN0cmVhbShmZCk7CisgICAgICAgICAgICAgICAgc2V0V2FsbHBhcGVyKGRhdGEsIGZvcyk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlmIChmb3MgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmb3MuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2V0V2FsbHBhcGVyKElucHV0U3RyZWFtIGRhdGEsIEZpbGVPdXRwdXRTdHJlYW0gZm9zKQorICAgICAgICAgICAgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgYnl0ZVtdIGJ1ZmZlciA9IG5ldyBieXRlWzMyNzY4XTsKKyAgICAgICAgaW50IGFtdDsKKyAgICAgICAgd2hpbGUgKChhbXQ9ZGF0YS5yZWFkKGJ1ZmZlcikpID4gMCkgeworICAgICAgICAgICAgZm9zLndyaXRlKGJ1ZmZlciwgMCwgYW10KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGRlc2lyZWQgbWluaW11bSB3aWR0aCBmb3IgdGhlIHdhbGxwYXBlci4gQ2FsbGVycyBvZgorICAgICAqIHtAbGluayAjc2V0Qml0bWFwKGFuZHJvaWQuZ3JhcGhpY3MuQml0bWFwKX0gb3IKKyAgICAgKiB7QGxpbmsgI3NldFN0cmVhbShqYXZhLmlvLklucHV0U3RyZWFtKX0gc2hvdWxkIGNoZW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NlU3RhdGUoU3BhcnNlQXJyYXk8UGFyY2VsYWJsZT4gY29udGFpbmVyKSB7CisgICAgICAgIGZpbmFsIFBhcmNlbGFibGVTcGFyc2VBcnJheSBqYWlsID0gKFBhcmNlbGFibGVTcGFyc2VBcnJheSkgY29udGFpbmVyLmdldChnZW5lcmF0ZUlkKCkpOworICAgICAgICBzdXBlci5kaXNwYXRjaFJlc3RvcmVJbnN0YW5jZVN0YXRlKGphaWwpOworICAgIH0KKwogICAgIC8qKiB7QGluaGVyaXREb2N9ICovCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIExheW91dFBhcmFtcyBnZW5lcmF0ZUxheW91dFBhcmFtcyhBdHRyaWJ1dGVTZXQgYXR0cnMpIHsKQEAgLTMwMyw2ICszMjIsNyBAQAogICAgICAgICAgICAgaWYgKG1JbmZvICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBDb250ZXh0IHRoZWlyQ29udGV4dCA9IG1Db250ZXh0LmNyZWF0ZVBhY2thZ2VDb250ZXh0KAogICAgICAgICAgICAgICAgICAgICAgICAgbUluZm8ucHJvdmlkZXIuZ2V0UGFja2FnZU5hbWUoKSwgQ29udGV4dC5DT05URVhUX1JFU1RSSUNURUQpOworICAgICAgICAgICAgICAgIG1SZW1vdGVDb250ZXh0ID0gdGhlaXJDb250ZXh0OwogICAgICAgICAgICAgICAgIExheW91dEluZmxhdGVyIGluZmxhdGVyID0gKExheW91dEluZmxhdGVyKQogICAgICAgICAgICAgICAgICAgICAgICAgdGhlaXJDb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5MQVlPVVRfSU5GTEFURVJfU0VSVklDRSk7CiAgICAgICAgICAgICAgICAgaW5mbGF0ZXIgPSBpbmZsYXRlci5jbG9uZUluQ29udGV4dCh0aGVpckNvbnRleHQpOwpAQCAtMzE3LDggKzMzNyw4IEBACiAgICAgICAgICAgICBleGNlcHRpb24gPSBlOwogICAgICAgICB9CiAgICAgICAgIAotICAgICAgICBpZiAoZXhjZXB0aW9uICE9IG51bGwgJiYgTE9HRCkgewotICAgICAgICAgICAgTG9nLncoVEFHLCAiRXJyb3IgaW5mbGF0aW5nIEFwcFdpZGdldCAiICsgbUluZm8sIGV4Y2VwdGlvbik7CisgICAgICAgIGlmIChleGNlcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiRXJyb3IgaW5mbGF0aW5nIEFwcFdpZGdldCAiICsgbUluZm8gKyAiOiAiICsgZXhjZXB0aW9uLnRvU3RyaW5nKCkpOwogICAgICAgICB9CiAgICAgICAgIAogICAgICAgICBpZiAoZGVmYXVsdFZpZXcgPT0gbnVsbCkgewpAQCAtMzM5LDQgKzM1OSwzNiBAQAogICAgICAgICB0di5zZXRCYWNrZ3JvdW5kQ29sb3IoQ29sb3IuYXJnYigxMjcsIDAsIDAsIDApKTsKICAgICAgICAgcmV0dXJuIHR2OwogICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFBhcmNlbGFibGVTcGFyc2VBcnJheSBleHRlbmRzIFNwYXJzZUFycmF5PFBhcmNlbGFibGU+IGltcGxlbWVudHMgUGFyY2VsYWJsZSB7CisgICAgICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBzaXplKCk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KGNvdW50KTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoa2V5QXQoaSkpOworICAgICAgICAgICAgICAgIGRlc3Qud3JpdGVQYXJjZWxhYmxlKHZhbHVlQXQoaSksIDApOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBQYXJjZWxhYmxlLkNyZWF0b3I8UGFyY2VsYWJsZVNwYXJzZUFycmF5PiBDUkVBVE9SID0KKyAgICAgICAgICAgICAgICBuZXcgUGFyY2VsYWJsZS5DcmVhdG9yPFBhcmNlbGFibGVTcGFyc2VBcnJheT4oKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyBQYXJjZWxhYmxlU3BhcnNlQXJyYXkgY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgc291cmNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBQYXJjZWxhYmxlU3BhcnNlQXJyYXkgYXJyYXkgPSBuZXcgUGFyY2VsYWJsZVNwYXJzZUFycmF5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBDbGFzc0xvYWRlciBsb2FkZXIgPSBhcnJheS5nZXRDbGFzcygpLmdldENsYXNzTG9hZGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBzb3VyY2UucmVhZEludCgpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXkucHV0KHNvdXJjZS5yZWFkSW50KCksIHNvdXJjZS5yZWFkUGFyY2VsYWJsZShsb2FkZXIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyBQYXJjZWxhYmxlU3BhcnNlQXJyYXlbXSBuZXdBcnJheShpbnQgc2l6ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQYXJjZWxhYmxlU3BhcnNlQXJyYXlbc2l6ZV07CisgICAgIC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LmNvbm5lY3RTaW5rKGRldmljZSk7CiAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cudyhUQUcsICIiLCBlKTsKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhFcnJvci5FUlJPUl9JUEM7CisgICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0KIAogICAgIC8qKiBJbml0aWF0ZSBkaXNjb25uZWN0IGZyb20gYW4gQTJEUCBzaW5rLgogICAgICAqICBMaXN0ZW4gZm9yIFNJTktfU1RBVEVfQ0hBTkdFRF9BQ1RJT04gdG8gZmluZCBvdXQgd2hlbgogICAgICAqICBkaXNjb25uZWN0IGlzIGNvbXBsZXRlZC4KLSAgICAgKiAgQHBhcmFtIGFkZHJlc3MgUmVtb3RlIEJUIGFkZHJlc3MuCi0gICAgICogIEByZXR1cm4gUmVzdWx0IGNvZGUsIG5lZ2F0aXZlIGluZGljYXRlcyBhbiBpbW1lZGlhdGUgZXJyb3IuCisgICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KKyAgICAgKiAgQHJldHVybiBmYWxzZSBvbiBpbW1lZGlhdGUgZXJyb3IsIHRydWUgb3RoZXJ3aXNlCiAgICAgICogIEBoaWRlCiAgICAgICovCi0gICAgcHVibGljIGludCBkaXNjb25uZWN0U2luayhTdHJpbmcgYWRkcmVzcykgewotICAgICAgICBpZiAoREJHKSBsb2coImRpc2Nvbm5lY3RTaW5rKCIgKyBhZGRyZXNzICsgIikiKTsKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNjb25uZWN0U2luayhCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZGlzY29ubmVjdFNpbmsoIiArIGRldmljZSArICIpIik7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZGlzY29ubmVjdFNpbmsoYWRkcmVzcyk7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZGlzY29ubmVjdFNpbmsoZGV2aWNlKTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIiIsIGUpOwotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SX0lQQzsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqIENoZWNrIGlmIGEgc3BlY2lmaWVkIEEyRFAgc2luayBpcyBjb25uZWN0ZWQuCi0gICAgICogIEBwYXJhbSBhZGRyZXNzIFJlbW90ZSBCVCBhZGRyZXNzLgorICAgICAqICBAcGFyYW0gZGV2aWNlIFJlbW90ZSBCVCBkZXZpY2UuCiAgICAgICogIEByZXR1cm4gVHJ1ZSBpZiBjb25uZWN0ZWQgKG9yIHBsYXlpbmcpLCBmYWxzZSBvdGhlcndpc2UgYW5kIG9uIGVycm9yLgogICAgICAqICBAaGlkZQogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGlzU2lua0Nvbm5lY3RlZChTdHJpbmcgYWRkcmVzcykgewotICAgICAgICBpZiAoREJHKSBsb2coImlzU2lua0Nvbm5lY3RlZCgiICsgYWRkcmVzcyArICIpIik7Ci0gICAgICAgIGludCBzdGF0ZSA9IGdldFNpbmtTdGF0ZShhZGRyZXNzKTsKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1NpbmtDb25uZWN0ZWQoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoREJHKSBsb2coImlzU2lua0Nvbm5lY3RlZCgiICsgZGV2aWNlICsgIikiKTsKKyAgICAgICAgaW50IHN0YXRlID0gZ2V0U2lua1N0YXRlKGRldmljZSk7CiAgICAgICAgIHJldHVybiBzdGF0ZSA9PSBTVEFURV9DT05ORUNURUQgfHwgc3RhdGUgPT0gU1RBVEVfUExBWUlORzsKICAgICB9CiAKICAgICAvKiogQ2hlY2sgaWYgYW55IEEyRFAgc2luayBpcyBjb25uZWN0ZWQuCi0gICAgICogQHJldHVybiBhIExpc3Qgb2YgY29ubmVjdGVkIEEyRFAgc2lua3MsIG9yIG51bGwgb24gZXJyb3IuCisgICAgICogQHJldHVybiBhIHVubW9kaWZpYWJsZSBzZXQgb2YgY29ubmVjdGVkIEEyRFAgc2lua3MsIG9yIG51bGwgb24gZXJyb3IuCiAgICAgICogQGhpZGUKICAgICAgKi8KLSAgICBwdWJsaWMgTGlzdDxTdHJpbmc+IGxpc3RDb25uZWN0ZWRTaW5rcygpIHsKLSAgICAgICAgaWYgKERCRykgbG9nKCJsaXN0Q29ubmVjdGVkU2lua3MoKSIpOworICAgIHB1YmxpYyBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBnZXRDb25uZWN0ZWRTaW5rcygpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJnZXRDb25uZWN0ZWRTaW5rcygpIik7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UubGlzdENvbm5lY3RlZFNpbmtzKCk7CisgICAgICAgICAgICByZXR1cm4gQ29sbGVjdGlvbnMudW5tb2RpZmlhYmxlU2V0KAorICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxCbHVldG9vdGhEZXZpY2U+KEFycmF5cy5hc0xpc3QobVNlcnZpY2UuZ2V0Q29ubmVjdGVkU2lua3MoKSkpKTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIiIsIGUpOworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQogICAgIH0KIAogICAgIC8qKiBHZXQgdGhlIHN0YXRlIG9mIGFuIEEyRFAgc2luawotICAgICAqICBAcGFyYW0gYWRkcmVzcyBSZW1vdGUgQlQgYWRkcmVzcy4KLSAgICAgKiAgQHJldHVybiBTdGF0ZSBjb2RlLCBvciBuZWdhdGl2ZSBvbiBlcnJvcgorICAgICAqICBAcGFyYW0gZGV2aWNlIFJlbW90ZSBCVCBkZXZpY2UuCisgICAgICogIEByZXR1cm4gU3RhdGUgY29kZSwgb25lIG9mIFNUQVRFXwogICAgICAqICBAaGlkZQogICAgICAqLwotICAgIHB1YmxpYyBpbnQgZ2V0U2lua1N0YXRlKFN0cmluZyBhZGRyZXNzKSB7Ci0gICAgICAgIGlmIChEQkcpIGxvZygiZ2V0U2lua1N0YXRlKCIgKyBhZGRyZXNzICsgIikiKTsKKyAgICBwdWJsaWMgaW50IGdldFNpbmtTdGF0ZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZ2V0U2lua1N0YXRlKCIgKyBkZXZpY2UgKyAiKSIpOwogICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFNpbmtTdGF0ZShhZGRyZXNzKTsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRTaW5rU3RhdGUoZGV2aWNlKTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIiIsIGUpOwotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SX0lQQzsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEOwogICAgICAgICB9CiAgICAgfQogCkBAIC0xNzcsNTggKzE4MCwzMyBAQAogICAgICAqIFNpbmtzIHdpdGggcHJpb3JpdHkgZ3JlYXRlciB0aGFuIHplcm8gd2lsbCBhY2NlcHQgaW5jb21pbmcgY29ubmVjdGlvbnMKICAgICAgKiAoaWYgbm8gc2luayBpcyBjdXJyZW50bHkgY29ubmVjdGVkKS4KICAgICAgKiBQcmlvcml0eSBmb3IgdW5wYWlyZWQgc2luayBtdXN0IGJlIFBSSU9SSVRZX05PTkUuCi0gICAgICogQHBhcmFtIGFkZHJlc3MgUGFpcmVkIHNpbmsKKyAgICAgKiBAcGFyYW0gZGV2aWNlIFBhaXJlZCBzaW5rCiAgICAgICogQHBhcmFtIHByaW9yaXR5IEludGVnZXIgcHJpb3JpdHksIGZvciBleGFtcGxlIFBSSU9SSVRZX0FVVE8gb3IKICAgICAgKiAgICAgICAgICAgICAgICAgUFJJT1JJVFlfTk9ORQotICAgICAqIEByZXR1cm4gUmVzdWx0IGNvZGUsIG5lZ2F0aXZlIGluZGljYXRlcyBhbiBlcnJvcgorICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBwcmlvcml0eSBpcyBzZXQsIGZhbHNlIG9uIGVycm9yCiAgICAgICovCi0gICAgcHVibGljIGludCBzZXRTaW5rUHJpb3JpdHkoU3RyaW5nIGFkZHJlc3MsIGludCBwcmlvcml0eSkgewotICAgICAgICBpZiAoREJHKSBsb2coInNldFNpbmtQcmlvcml0eSgiICsgYWRkcmVzcyArICIsICIgKyBwcmlvcml0eSArICIpIik7CisgICAgcHVibGljIGJvb2xlYW4gc2V0U2lua1ByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UsIGludCBwcmlvcml0eSkgeworICAgICAgICBpZiAoREJHKSBsb2coInNldFNpbmtQcmlvcml0eSgiICsgZGV2aWNlICsgIiwgIiArIHByaW9yaXR5ICsgIikiKTsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5zZXRTaW5rUHJpb3JpdHkoYWRkcmVzcywgcHJpb3JpdHkpOworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnNldFNpbmtQcmlvcml0eShkZXZpY2UsIHByaW9yaXR5KTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIiIsIGUpOwotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SX0lQQzsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogR2V0IHByaW9yaXR5IG9mIGEyZHAgc2luay4KLSAgICAgKiBAcGFyYW0gYWRkcmVzcyBTaW5rCisgICAgICogQHBhcmFtIGRldmljZSBTaW5rCiAgICAgICogQHJldHVybiBub24tbmVnYXRpdmUgcHJpb3JpdHksIG9yIG5lZ2F0aXZlIGVycm9yIGNvZGUgb24gZXJyb3IuCiAgICAgICovCi0gICAgcHVibGljIGludCBnZXRTaW5rUHJpb3JpdHkoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgaWYgKERCRykgbG9nKCJnZXRTaW5rUHJpb3JpdHkoIiArIGFkZHJlc3MgKyAiKSIpOworICAgIHB1YmxpYyBpbnQgZ2V0U2lua1ByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJnZXRTaW5rUHJpb3JpdHkoIiArIGRldmljZSArICIpIik7CiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0U2lua1ByaW9yaXR5KGFkZHJlc3MpOworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFNpbmtQcmlvcml0eShkZXZpY2UpOwogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgTG9nLncoVEFHLCAiIiwgZSk7Ci0gICAgICAgICAgICByZXR1cm4gQmx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RFX1RVUk5JTkdfT059LAorICAgICAqIHtAbGluayAjU1RBVEVfT059LAorICAgICAqIHtAbGluayAjU1RBVEVfVFVSTklOR19PRkZ9LAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX1NUQVRFID0KKyAgICAgICAgICAgICJhbmRyb2lkLmJsdWV0b290aC5pbnRlbnQuZXh0cmEuU1RBVEUiOworICAgIC8qKgorICAgICAqIFVzZWQgYXMgYW4gaW50IGV4dHJhIGZpZWxkIGluIHtAbGluayAjQUNUSU9OX1NUQVRFX0NIQU5HRUR9CisgICAgICogaW50ZW50cyB0byByZXF1ZXN0IHRoZSBwcmV2aW91cyBwb3dlciBzdGF0ZS4gUG9zc2libGUgdmFsdWVzIGFyZToKKyAgICAgKiB7QGxpbmsgI1NUQVRFX09GRn0sCisgICAgICoge0BsaW5rICNTVEFURV9UVVJOSU5HX09OfSwKKyAgICAgKiB7QGxpbmsgI1NUQVRFX09OfSwKKyAgICAgKiB7QGxpbmsgI1NUQVRFX1RVUk5JTkdfT0ZGfSwKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9QUkVWSU9VU19TVEFURSA9CisgICAgICAgICAgICAiYW5kcm9pZC5ibHVldG9vdGguaW50ZW50LmV4dHJhLlBSRVZJT1VTX1NUQVRFIjsKKworICAgIC8qKgorICAgICAqIEluZGljYXRlcyB0aGUgbG9jYWwgQmx1ZXRvb3RoIGFkYXB0ZXIgaXMgb2ZmLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNUQVRFX09GRiA9IDQwOworICAgIC8qKgorICAgICAqIEluZGljYXRlcyB0aGUgbG9jYWwgQmx1ZXRvb3RoIGFkYXB0ZXIgaXMgdHVybmluZyBvbi4gSG93ZXZlciBsb2NhbAorICAgICAqIGNsaWVudHMgc2hvdWxkIHdhaXQgZm9yIHtAbGluayAjU1RBVEVfT059IGJlZm9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BlKSB7TG9nLmUoVEFHLCAiIiwgZSk7fQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIGludCBnZXREaXNjb3ZlcmFibGVUaW1lb3V0KCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldERpc2NvdmVyYWJsZVRpbWVvdXQoKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsICIiLCBlKTt9CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICAvKiogQGhpZGUgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXREaXNjb3ZlcmFibGVUaW1lb3V0KGludCB0aW1lb3V0KSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtU2VydmljZS5zZXREaXNjb3ZlcmFibGVUaW1lb3V0KHRpbWVvdXQpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgIiIsIGUpO30KKyAgICB9CisKKyAgICAvKiogQGhpZGUgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBzdGFydERpc2NvdmVyeSgpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5zdGFydERpc2NvdmVyeSgpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgIiIsIGUpO30KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKiBAaGlkZSAqLworICAgIHB1YmxpYyB2b2lkIGNhbmNlbERpc2NvdmVyeSgpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1TZXJ2aWNlLmNhbmNlbERpc2NvdmVyeSgpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgIiIsIGU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SkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBzb2NrZXQuY2xvc2UoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUyKSB7IH0KKyAgICAgICAgICAgIHRocm93IGU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHNvY2tldDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb25zdHJ1Y3QgYW4gdW5lbmNyeXB0ZWQsIHVuYXV0aGVudGljYXRlZCwgUkZDT01NIHNlcnZlciBzb2NrZXQuCisgICAgICogQ2FsbCAjYWNjZXB0IHRvIHJldHJpZXZlIGNvbm5lY3Rpb25zIHRvIHRoaXMgc29ja2V0LgorICAgICAqIEByZXR1cm4gQW4gUkZDT01NIEJsdWV0b290aFNlcnZlclNvY2tldAorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gT24gZXJyb3IsIGZvciBleGFtcGxlIEJsdWV0b290aCBub3QgYXZhaWxhYmxlLCBvcgorICAgICAqICAgICAgICAgICAgICAgICAgICAgaW5zdWZmaWNpZW50IHBlcm1pc3Npb25zLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIEJsdWV0b290aFNlcnZlclNvY2tldCBsaXN0ZW5Vc2luZ0luc2VjdXJlUmZjb21tT24oaW50IHBvcnQpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEJsdWV0b290aFNlcnZlclNvY2tldCBzb2NrZXQgPSBuZXcgQmx1ZXRvb3RoU2VydmVyU29ja2V0KAorICAgICAgICAgICAgICAgIEJsdWV0b290aFNvY2tldC5UWVBFX1JGQ09NTSwgZmFsc2UsIGZhbHNlLCBwb3J0KTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHNvY2tldC5tU29ja2V0LmJpbmRMaXN0ZW4oKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBzb2NrZXQuY2xvc2UoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUyKSB7IH0KKyAgICAgICAgICAgIHRocm93IGU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHNvY2tldDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb25zdHJ1Y3QgYSBTQ08gc2VydmVyIHNvY2tldC4KKyAgICAgKiBDYWxsICNhY2NlcHQgdG8gcmV0cmlldmUgY29ubmVjdGlvbnMgdG8gdGhpcyBzb2NrZXQuCisgICAgICogQHJldHVybiBBIFNDTyBCbHVldG9vdGhTZXJ2ZXJTb2NrZXQKKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIE9uIGVycm9yLCBmb3IgZXhhbXBsZSBCbHVldG9vdGggbm90IGF2YWlsYWJsZSwgb3IKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgIGluc3VmZmljaWVudCBwZXJtaXNzaW9ucy4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgQmx1ZXRvb3RoU2VydmVyU29ja2V0IGxpc3RlblVzaW5nU2NvT24oKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBCbHVldG9vdGhTZXJ2ZXJTb2NrZXQgc29ja2V0ID0gbmV3IEJsdWV0b290aFNlcnZlclNvY2tldCgKKyAgICAgICAgICAgICAgICBCbHVldG9vdGhTb2NrZXQuVFlQRV9TQ08sIGZhbHNlLCBmYWxzZSwgLTEpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgc29ja2V0Lm1Tb2NrZXQuYmluZExpc3RlbigpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHNvY2tldC5jbG9zZSgpOworICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZTIpIHsgfQorICAgICAgICAgICAgdGhyb3cg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JlZVNvY2tldEZkOwogICAgIHByaXZhdGUgaW50IG1UaW1lb3V0UmVtYWluaW5nTXM7IC8qIGluL291dCAqLwogCisgICAgcHJpdmF0ZSBmaW5hbCBCbHVldG9vdGhBZGFwdGVyIG1BZGFwdGVyOworCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgREVGQVVMVF9IRl9BR19DSEFOTkVMID0gMTA7CiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgREVGQVVMVF9IU19BR19DSEFOTkVMID0gMTE7CiAKLSAgICBwdWJsaWMgQmx1ZXRvb3RoQXVkaW9HYXRld2F5KEJsdWV0b290aERldmljZSBibHVldG9vdGgpIHsKLSAgICAgICAgdGhpcyhibHVldG9vdGgsIERFRkFVTFRfSEZfQUdfQ0hBTk5FTCwgREVGQVVMVF9IU19BR19DSEFOTkVMKTsKKyAgICBwdWJsaWMgQmx1ZXRvb3RoQXVkaW9HYXRld2F5KEJsdWV0b290aEFkYXB0ZXIgYWRhcHRlcikgeworICAgICAgICB0aGlzKGFkYXB0ZXIsIERFRkFVTFRfSEZfQUdfQ0hBTk5FTCwgREVGQVVMVF9IU19BR19DSEFOTkVMKTsKICAgICB9CiAKLSAgICBwdWJsaWMgQmx1ZXRvb3RoQXVkaW9HYXRld2F5KEJsdWV0b290aERldmljZSBibHVldG9vdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGFuZHNmcmVlQWdSZmNvbW1DaGFubmVsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhlYWRzZXRBZ1JmY29tbUNoYW5uZWwpIHsKLSAgICAgICAgbUJsdWV0b290aCA9IGJsdWV0b290aDsKKyAgICBwdWJsaWMgQmx1ZXRvb3RoQXVkaW9HYXRld2F5KEJsdWV0b290aEFkYXB0ZXIgYWRhcHRlciwgaW50IGhhbmRzZnJlZUFnUmZjb21tQ2hhbm5lbCwKKyAgICAgICAgICAgICAgICBpbnQgaGVhZHNld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gICAgICAgICAgIG1SZW1vdGVEZXZpY2UgPSByZW1vdGVEZXZpY2U7CiAgICAgICAgICAgICBtU29ja2V0RmQgPSBzb2NrZXRGZDsKICAgICAgICAgICAgIG1SZmNvbW1DaGFuID0gcmZjb21tQ2hhbjsKICAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBCbHVldG9vdGhEZXZpY2UgbUJsdWV0b290aDsKLSAgICAgICAgcHVibGljIFN0cmluZyBtQWRkcmVzczsKLSAgICAgICAgcHVibGljIGludCBtU29ja2V0RmQ7Ci0gICAgICAgIHB1YmxpYyBpbnQgbVJmY29tbUNoYW47CiAgICAgfQogCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgTVNHX0lOQ09NSU5HX0hFQURTRVRfQ09OTkVDVElPTiAgID0gMTAwOwpAQCAtMTExLDEyICsxMDksMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0aW5nSGVhZHNldFJmY29tbUNoYW5uZWwpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbihtQ2FsbGJhY2spOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLndoYXQgPSBNU0dfSU5DT01JTkdfSEVBRFNFVF9DT05ORUNUSU9OOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLm9iaiA9IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBJbmNvbWluZ0Nvbm5lY3Rpb25JbmZvKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoLCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RpbmdIZWFkc2V0QWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RpbmdIZWFkc2V0U29ja2V0RmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0aW5nSGVhZHNldFJmY29tbUNoYW5uZWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLm9iaiA9IG5ldyBJbmNvbWluZ0Nvbm5lY3Rpb25JbmZvKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BZGFwdGVyLmdldFJlbW90ZURldmljZShtQ29ubmVjdGluZ0hlYWRzZXRBZGRyZXNzKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGluZ0hlYWRzZXRTb2NrZXRGZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGluZ0hlYWRzZXRSZmNvbW1DaGFubmVsKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNvbm5lY3RpbmdIYW5kc2ZyZWVSZmNvbW1DaGFubmVsID49IDApIHsKQEAgLTEyNiwxMiArMTIzLDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IE1lc3NhZ2Uub2J0YWluKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cuc2V0VGFyZ2V0KG1DYWxsYmFjayk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cud2hhdCA9IE1TR19JTkNPTUlOR19IQU5EU0ZSRUVfQ09OTkVDVElPTjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5vYmogPSAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSW5jb21pbmdDb25uZWN0aW9uSW5mbygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJsdWV0b290aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RpbmdIYW5kc2ZyZWVBZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGluZ0hhbmRzZnJlZVNvY2tldEZkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGluZ0hhbmRzZnJlZVJmY29tbUNoYW5uZWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLm9iaiA9IG5ldyBJbmNvbWluZ0Nvbm5lY3Rpb25JbmZvKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BZGFwdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BZGFwdGVyLmdldFJlbW90ZURldmljZShtQ29ubmVjdGluZ0hhbmRzZnJlZUFkZHJlc3MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0aW5nSGFuZHNmcmVlU29ja2V0RmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RpbmdIYW5kc2ZyZWVSZmNvbW1DaGFubmVsKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2JsdWV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0cy4KKyAgICAgICAgICAgIHN3aXRjaCAoQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLmdldERldmljZShidENsYXNzKSkgeworICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkFVRElPX1ZJREVPX0hJRklfQVVESU86CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuQVVESU9fVklERU9fSEVBRFBIT05FUzoKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5BVURJT19WSURFT19MT1VEU1BFQUtFUjoKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5BVURJT19WSURFT19DQVJfQVVESU86CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChwcm9maWxlID09IFBST0ZJTEVfSEVBRFNFVCkgeworICAgICAgICAgICAgLy8gVGhlIHJlbmRlciBzZXJ2aWNlIGNsYXNzIGlzIHJlcXVpcmVkIGJ5IHRoZSBzcGVjIGZvciBIRlAsIHNvIGlzIGEKKyAgICAgICAgICAgIC8vIHByZXR0eSBnb29kIHNpZ25hbAorICAgICAgICAgICAgaWYgKEJsdWV0b290aENsYXNzLlNlcnZpY2UuaGFzU2VydmljZShidENsYXNzLCBCbHVldG9vdGhDbGFzcy5TZXJ2aWNlLlJFTkRFUikpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEp1c3QgaW4gY2FzZSB0aGV5IGZvcmdvdCB0aGUgcmVuZGVyIHNlcnZpY2UgY2xhc3MKKyAgICAgICAgICAgIHN3aXRjaCAoQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLmdldERldmljZShidENsYXNzKSkgeworICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkFVRElPX1ZJREVPX0hBTkRTRlJFRToKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5BVURJT19WSURFT19XRUFSQUJMRV9IRUFEU0VUOgorICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkFVRElPX1ZJREVPX0NBUl9BVURJTzoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKHByb2ZpbGUgPT0gUFJPRklMRV9PUFApIHsKKyAgICAgICAgICAgIGlmIChCbHVldG9vdGhDbGFzcy5TZXJ2aWNlLmhhc1NlcnZpY2UoYnRDbGFzcywgQmx1ZXRvb3RoQ2xhc3MuU2VydmljZS5PQkpFQ1RfVFJBTlNGRVIpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN3aXRjaCAoQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLmdldERldmljZShidENsYXNzKSkgeworICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkNPTVBVVEVSX1VOQ0FURUdPUklaRUQ6CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuQ09NUFVURVJfREVTS1RPUDoKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5DT01QVVRFUl9TRVJWRVI6CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuQ09NUFVURVJfTEFQVE9QOgorICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkNPTVBVVEVSX0hBTkRIRUxEX1BDX1BEQToKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5DT01QVVRFUl9QQUxNX1NJWkVfUENfUERBOgorICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkNPTVBVVEVSX1dFQVJBQkxFOgorICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLlBIT05FX1VOQ0FURUdPUklaRUQ6CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuUEhPTkVfQ0VMTFVMQVI6CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuUEhPTkVfQ09SRExFU1M6CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuUEhPTkVfU01BUlQ6CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuUEhPTkVfTU9ERU1fT1JfR0FURVdBWToKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5QSE9ORV9JU0ROOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CiB9CiAKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2JsdWV0b290aC9CbHVldG9vdGhEZXZpY2UuYWlkbCBiL2NvcmUvamF2YS9hbmRyb2lkL2JsdWV0b290aC9CbHVldG9vdGhEZXZpY2UuYWl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QuQkxVRVRPT1RIX1NFUlZJQ0UpOworICAgICAgICAgICAgICAgIGlmIChiID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkJsdWV0b290aCBzZXJ2aWNlIG5vdCBhdmFpbGFibGUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc1NlcnZpY2UgPSBJQmx1ZXRvb3RoLlN0dWIuYXNJbnRlcmZhY2UoYik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoIWNoZWNrQmx1ZXRvb3RoQWRkcmVzcyhhZGRyZXNzKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbihhZGRyZXNzICsgIiBpcyBub3QgYSB2YWxpZCBCbHVldG9vdGggYWRkcmVzcyIpOworICAgICAgICB9CisKKyAgICAgICAgbUFkZHJlc3MgPSBhZGRyZXNzOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3QgbykgeworICAgICAgICBpZiAobyBpbnN0YW5jZW9mIEJsdWV0b290aERldmljZSkgeworICAgICAgICAgICAgcmV0dXJuIG1BZGRyZXNzLmVxdWFscygoKEJsdWV0b290aERldmljZSlvKS5nZXRBZGRyZXNzKCkpOworICAgICAgICB9CiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBHZXQgdGhlIGN1cnJlbnQgc3RhdGUgb2YgQmx1ZXRvb3RoLgotICAgICAqCi0gICAgICogQHJldHVybiBPbmUgb2YgQkxVRVRPT1RIX1NUQVRFXyBvciBCbHVldG9vdGhFcnJvci5FUlJPUi4KLSAgICAgKi8KLSAgICBwdWJsaWMgaW50IGdldEJsdWV0b290aFN0YXRlKCkgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlL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HdheXMgdXNlIHtAbGluayAjZ2V0QWRkcmVzc30KKyAgICAgKiBpZiB5b3UgZXhwbGljaXRseSByZXF1aXJlIHRoZSBCbHVldG9vdGggaGFyZHdhcmUgYWRkcmVzcyBpbiBjYXNlIHRoZQorICAgICAqIHtAbGluayAjdG9TdHJpbmd9IHJlcHJlc2VudGF0aW9uIGNoYW5nZXMgaW4gdGhlIGZ1dHVyZS4KKyAgICAgKiBAcmV0dXJuIHN0cmluZyByZXByZXNlbnRhdGlvbiBvZiB0aGlzIEJsdWV0b290aERldmljZQogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGVuYWJsZSgpIHsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5lbmFibGUoKTsKLSAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsICIiLCBlKTt9Ci0gICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICByZXR1cm4gbUFkZHJlc3M7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICAvKiogQGhpZGUgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFBhcmNlbGFibGUuQ3JlYXRvcjxCbHVldG9vdGhEZXZpY2U+IENSRUFUT1IgPQorICAgICAgICAgICAgbmV3IFBhcmNlbGFibGUuQ3JlYXRvcjxCbHVldG9vdGhEZXZpY2U+KCkgeworICAgICAgICBwdWJsaWMgQmx1ZXRvb3RoRGV2aWNlIGNyZWF0ZUZyb21QYXJjZWwoUGFyY2VsIGluKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IEJsdWV0b290aERldmljZShpbi5yZWFkU3RyaW5nKCkpOworICAgICAgICB9Cis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HJldHVybiBudWxsOwotICAgIH0KLSAgICBwdWJsaWMgU3RyaW5nIGdldFJlbW90ZUNvbXBhbnkoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRSZW1vdGVDb21wYW55KGFkZHJlc3MpOwotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgIiIsIGUpO30KLSAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIHJldHVybiBCbHVldG9vdGhEZXZpY2UuRVJST1I7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogUmV0dXJucyB0aGUgUkZDT01NIGNoYW5uZWwgYXNzb2NpYXRlZCB3aXRoIHRoZSAxNi1ieXRlIFVVSUQgb24KLSAgICAgKiB0aGUgcmVtb3RlIEJsdWV0b290aCBhZGRyZXNzLgorICAgICAqIEdldCB0cnVzdCBzdGF0ZSBvZiBhIHJlbW90ZSBkZXZpY2UuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBnZXRUcnVzdFN0YXRlKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIHNTZXJ2aWNlLmdldFRydXN0U3RhdGUobUFkZHJlc3MpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0cnVzdCBzdGF0ZSBmb3IgYSByZW1vdGUgZGV2aWNlLgorICAgICAqIEBwYXJhbSB2YWx1ZSB0aGUgdHJ1c3Qgc3RhdGUgdmFsdWUgKHRydWUgb3IgZmFsc2UpCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBzZXRUcnVzdChib29sZWFuIHZhbHVlKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gc1NlcnZpY2Uuc2V0VHJ1c3QobUFkZHJlc3MsIHZhbHVlKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKiogQGhpZGUgKi8KKyAgICBwdWJsaWMgaW50IGdldEJsdWV0b290aENsYXNzKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIHNTZXJ2aWNlLmdldFJlbW90ZUNsYXNzKG1BZGRyZXNzKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsICIiLCBlKTt9CisgICAgICAgIHJldHVybiBCbHVldG9vdGhEZXZpY2UuRVJST1I7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRVdWlkcygpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBzU2VydmljZS5nZXRSZW1vdGVVdWlkcyhtQWRkcmVzcyk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCAiIiwgZSk7fQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKiogQGhpZGUgKi8KKyAgICBwdWJsaWMgaW50IGdldFNlcnZpY2VDaGFubmVsKFN0cmluZyB1dWlkKSB7CisgICAgICAgICB0cnkgeworICAgICAgICAgICAgIHJldHVybiBzU2VydmljZS5nZXRSZW1vdGVTZXJ2aWNlQ2hhbm5lbChtQWRkcmVzcywgdXVpZCk7CisgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgIiIsIGUpO30KKyAgICAgICAgIHJldHVybiBCbHVldG9vdGhEZXZpY2UuRVJST1I7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIGJvb2xlYW4gc2V0UGluKGJ5dGVbXSBwaW4pIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBzU2VydmljZS5zZXRQaW4obUFkZHJlc3MsIHBpbik7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCAiIiwgZSk7fQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIGJvb2xlYW4gc2V0UGFzc2tleShpbnQgcGFzc2tleSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIHNTZXJ2aWNlLnNldFBhc3NrZXkobUFkZHJlc3MsIHBhc3NrZXkpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgIiIsIGUpO30KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKiBAaGlkZSAqLworICAgIHB1YmxpYyBib29sZWFuIHNldFBhaXJpbmdDb25maXJtYXRpb24oYm9vbGVhbiBjb25maXJtKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gc1NlcnZpY2Uuc2V0UGFpcmluZ0NvbmZpcm1hdGlvbihtQWRkcmVzcywgY29uZmlybSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCAiIiwgZSk7fQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHVibGljIGJvb2xlYW4gY2FuY2VsUGFpcmluZ1VzZXJJbnB1dCgpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBzU2VydmljZS5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kZXZpY2UuCi0gICAgICogVGhlc2UgY2xhc3NlcyBhcmUgZW5jb2RlZCBhcyBhIDMyLWJpdCBpbnRlZ2VyLiBTZWUgQmx1ZXRvb3RoQ2xhc3MuCi0gICAgICogQHBhcmFtIGFkZHJlc3MgcmVtb3RlIGRldmljZQotICAgICAqIEByZXR1cm4gMzItYml0IGNsYXNzIHN1aXRhYmxlIGZvciB1c2Ugd2l0aCBCbHVldG9vdGhDbGFzcywgb3IKLSAgICAgKiAgICAgICAgIEJsdWV0b290aENsYXNzLkVSUk9SIG9uIGVycm9yCisgICAgICogQ29uc3RydWN0IGFuIGluc2VjdXJlIFJGQ09NTSBzb2NrZXQgcmVhZHkgdG8gc3RhcnQgYW4gb3V0Z29pbmcKKyAgICAgKiBjb25uZWN0aW9uLgorICAgICAqIENhbGwgI2Nvbm5lY3Qgb24gdGhlIHJldHVybmVkICNCbHVldG9vdGhTb2NrZXQgdG8gYmVnaW4gdGhlIGNvbm5lY3Rpb24uCisgICAgICogVGhlIHJlbW90ZSBkZXZpY2Ugd2lsbCBub3QgYmUgYXV0aGVudGljYXRlZCBhbmQgY29tbXVuaWNhdGlvbiBvbiB0aGlzCisgICAgICogc29ja2V0IHdpbGwgbm90IGJlIGVuY3J5cHRlZC4KKyAgICAgKiBAcGFyYW0gcG9ydCAgICByZW1vdGUgcG9ydAorICAgICAqIEByZXR1cm4gQW4gUkZDT01NIEJsdWV0b290aFNvY2tldAorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gT24gZXJyb3IsIGZvciBleGFtcGxlIEJsdWV0b290aCBub3QgYXZhaWxhYmxlLCBvcgorICAgICAqICAgICAgICAgICAgICAgICAgICAgaW5zdWZmaWNpZW50IHBlcm1pc3Npb25zLgorICAgICAqIEBoaWRlCiAgICAgICovCi0gICAgcHVibGljIGludCBnZXRSZW1vdGVDbGFzcyhTdHJpbmcgYWRkcmVzcykgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aW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iAgICAgICogZGV2aWNlcyB3aXRoIHByaW9yaXR5IGdyZWF0ZXIgdGhhbiBQUklPUklUWV9BVVRPIGluIGRlc2NlbmRpbmcgb3JkZXIuCi0gICAgICogQHBhcmFtIGFkZHJlc3MgVGhlIEJsdWV0b290aCBBZGRyZXNzIHRvIGNvbm5lY3QgdG8sIG9yIG51bGwgdG8KLSAgICAgKiAgICAgICAgICAgICAgICBhdXRvLWNvbm5lY3QgdG8gdGhlIGxhc3QgY29ubmVjdGVkIGhlYWRzZXQuCi0gICAgICogQHJldHVybiAgICAgICAgRmFsc2UgaWYgdGhlcmUgd2FzIGEgcHJvYmxlbSBpbml0aWF0aW5nIHRoZSBjb25uZWN0aW9uCi0gICAgICogICAgICAgICAgICAgICAgcHJvY2VkdXJlLCBhbmQgbm8gZnVydGhlciBIRUFEU0VUX1NUQVRFX0NIQU5HRUQgaW50ZW50cwotICAgICAqICAgICAgICAgICAgICAgIHdpbGwgYmUgZXhwZWN0ZWQuCisgICAgICogQHBhcmFtIGRldmljZSBkZXZpY2UgdG8gY29ubmVjdCB0bywgb3IgbnVsbCB0byBhdXRvLWNvbm5lY3QgbGFzdCBjb25uZWN0ZWQKKyAgICAgKiAgICAgICAgICAgICAgIGhlYWRzZXQKKyAgICAgKiBAcmV0dXJuICAgICAgIGZhbHNlIGlmIHRoZXJlIHdhcyBhIHByb2JsZW0gaW5pdGlhdGluZyB0aGUgY29ubmVjdGlvbgorICAgICAqICAgICAgICAgICAgICAgcHJvY2VkdXJlLCBhbmQgbm8gZnVydGhlciBIRUFEU0VUX1NUQVRFX0NIQU5HRUQgaW50ZW50cworICAgICAqICAgICAgICAgICAgICAgd2lsbCBiZSBleHBlY3RlZC4KICAgICAgKi8KLSAgICBwdWJsaWMgYm9vbGVhbiBjb25uZWN0SGVhZHNldChTdHJpbmcgYWRkcmVzcykgewotICAgICAgICBpZiAoREJHKSBsb2coImNvbm5lY3RIZWFkc2V0KCIgKyBhZGRyZXNzICsgIikiKTsKKyAgICBwdWJsaWMgYm9vbGVhbiBjb25uZWN0SGVhZHNldChCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiY29ubmVjdEhlYWRzZXQoIiArIGRldmljZSArICIpIik7CiAgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGlmIChtU2VydmljZS5jb25uZWN0SGVhZHNldChhZGRyZXNzKSkgeworICAgICAgICAgICAgICAgIGlmIChtU2VydmljZS5jb25uZWN0SGVhZHNldChkZXZpY2UpKSB7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCBlLnRvU3RyaW5nKCkpO30KQEAgLTIxMywxMSArMjEzLDExIEBACiAgICAgICogY29ubmVjdGluZykuIFJldHVybnMgZmFsc2UgaWYgbm90IGNvbm5lY3RlZCwgb3IgaWYgdGhpcyBwcm94eSBvYmplY3QKICAgICAgKiBpZiBub3QgY3VycmVudGx5IGNvbm5lY3RlZCB0byB0aGUgaGVhZHNldCBzZXJ2aWNlLgogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGlzQ29ubmVjdGVkKFN0cmluZyBhZGRyZXNzKSB7Ci0gICAgICAgIGlmIChEQkcpIGxvZygiaXNDb25uZWN0ZWQoIiArIGFkZHJlc3MgKyAiKSIpOworICAgIHB1YmxpYyBib29sZWFuIGlzQ29ubmVjdGVkKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJpc0Nvbm5lY3RlZCgiICsgZGV2aWNlICsgIikiKTsKICAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ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ICIpIik7CisgICAgcHVibGljIGJvb2xlYW4gc2V0UHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHByaW9yaXR5KSB7CisgICAgICAgIGlmIChEQkcpIGxvZygic2V0UHJpb3JpdHkoIiArIGRldmljZSArICIsICIgKyBwcmlvcml0eSArICIpIik7CiAgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5zZXRQcmlvcml0eShhZGRyZXNzLCBwcmlvcml0eSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLnNldFByaW9yaXR5KGRldmljZSwgcHJpb3JpdHkpOwogICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHtMb2cuZShUQUcsIGUudG9TdHJpbmcoKSk7fQogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgTG9nLncoVEFHLCAiUHJveHkgbm90IGF0dGFjaGVkIHRvIHNlcnZpY2UiKTsKQEAgLTMxNSwxNCArMzE1LDE0IEBACiAKICAgICAvKioKICAgICAgKiBHZXQgcHJpb3JpdHkgb2YgaGVhZHNldC4KLSAgICAgKiBAcGFyYW0gYWRkcmVzcyBIZWFkc2V0Ci0gICAgICogQHJldHVybiBub24tbmVnYXRpdmUgcHJpb3JpdHksIG9yIG5lZ2F0aXZlIGVycm9yIGNvZGUgb24gZXJyb3IuCisgICAgICogQHBhcmFtIGRldmljZSBoZWFkc2V0CisgICAgICogQHJldHVybiBub24tbmVnYXRpdmUgcHJpb3JpdHksIG9yIG5lZ2F0aXZlIGVycm9yIGNvZGUgb24gZXJyb3IKICAgICAgKi8KLSAgICBwdWJsaWMgaW50IGdldFByaW9yaXR5KFN0cmluZyBhZGRyZXNzKSB7Ci0gICAgICAgIGlmIChEQkcpIGxvZygiZ2V0UHJpb3JpdHkoIiArIGFkZHJlc3MgKyAiKSIpOworICAg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ib29sZWFuIGRvZXNDbGFzc01hdGNoKGludCBidENsYXNzKSB7Ci0gICAgICAgIC8vIFRoZSByZW5kZXIgc2VydmljZSBjbGFzcyBpcyByZXF1aXJlZCBieSB0aGUgc3BlYyBmb3IgSEZQLCBzbyBpcyBhCi0gICAgICAgIC8vIHByZXR0eSBnb29kIHNpZ25hbAotICAgICAgICBpZiAoQmx1ZXRvb3RoQ2xhc3MuU2VydmljZS5oYXNTZXJ2aWNlKGJ0Q2xhc3MsIEJsdWV0b290aENsYXNzLlNlcnZpY2UuUkVOREVSKSkgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgLy8gSnVzdCBpbiBjYXNlIHRoZXkgZm9yZ290IHRoZSByZW5kZXIgc2VydmljZSBjbGFzcwotICAgICAgICBzd2l0Y2ggKEJsdWV0b290aENsYXNzLkRldmljZS5nZXREZXZpY2UoYnRDbGFzcykpIHsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuQVVESU9fVklERU9fSEFORFNGUkVFOgotICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5BVURJT19WSURFT19XRUFSQUJMRV9IRUFEU0VUOgotICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5BVURJT19WSURFT19DQVJfQVVESU86Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotICAgIH0KLQogICAgIHByaXZhdGUgU2VydmljZUNvbm5lY3Rpb24gbUNvbm5lY3Rpb24gPSBuZXcgU2VydmljZUNvbm5lY3Rpb24oKSB7CiAgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZUNvbm5lY3RlZChDb21wb25lbnROYW1lIGNsYXNzTmFtZSwgSUJpbmRlciBzZXJ2aWNlKSB7CiAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZ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y2VwdGlvbgorICAgICAqICAgICAgICAgICAgIGlmIGFuIGVycm9yIG9jY3VycyB3aGlsZSB3cml0aW5nIHRvIHRoaXMgc3RyZWFtLgorICAgICAqIEBzaW5jZSBBbmRyb2lkIDEuMAorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHdyaXRlKGludCBvbmVCeXRlKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBieXRlIGJbXSA9IG5ldyBieXRlWzFdOworICAgICAgICBiWzBdID0gKGJ5dGUpb25lQnl0ZTsKKyAgICAgICAgbVNvY2tldC53cml0ZShiLCAwLCAxKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBXcml0ZXMge0Bjb2RlIGNvdW50fSBieXRlcyBmcm9tIHRoZSBieXRlIGFycmF5IHtAY29kZSBidWZmZXJ9IHN0YXJ0aW5nCisgICAgICogYXQgcG9zaXRpb24ge0Bjb2RlIG9mZnNldH0gdG8gdGhpcyBzdHJlYW0uCisgICAgICoKKyAgICAgKiBAcGFyYW0gYgorICAgICAqICAgICAgICAgICAgdGhlIGJ1ZmZlciB0byBiZSB3cml0dGVuLgorICAgICAqIEBwYXJhbSBvZmZzZXQKKyAgICAgKiAgICAgICAgICAgIHRoZSBzdGFydCBwb3NpdGlvbiBpbiB7QGNvZGUgYnVmZmVyfSBmcm9tIHdoZXJlIHRvIGdldCBieXRlcy4KKyAgICAgKiBAcGFyYW0gY291bnQKKyAgICAgKiAgICAgICAgICAgIHRoZSBudW1iZXIgb2YgYnl0ZXMgZnJvbSB7QGNvZGUgYnVmZmVyfSB0byB3cml0ZSB0byB0aGlzCisgICAgICogICAgICAgICAgICBzdHJlYW0uCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbgorICAgICAqICAgICAgICAgICAgIGlmIGFuIGVycm9yIG9jY3VycyB3aGlsZSB3cml0aW5nIHRvIHRoaXMgc3RyZWFtLgorICAgICAqIEB0aHJvd3MgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbg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gICAgICAgKiBUaGlzIGNhbGxiYWNrIHdpbGwgY3VycmVudGx5IG9ubHkgb2NjdXIgaWYgdGhlIGFwcGxpY2F0aW9uIGhvc3RpbmcKKyAgICAgICAgICogdGhlIEJsdWV0b290aFBiYXAgc2VydmljZSwgYnV0IG1heSBiZSBjYWxsZWQgbW9yZSBvZnRlbiBpbiBmdXR1cmUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGUgYSBCbHVldG9vdGhQYmFwIHByb3h5IG9iamVjdC4KKyAgICAgKi8KKyAgICBwdWJsaWMgQmx1ZXRvb3RoUGJhcChDb250ZXh0IGNvbnRleHQsIFNlcnZpY2VMaXN0ZW5lciBsKSB7CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKyAgICAgICAgbVNlcnZpY2VMaXN0ZW5lciA9IGw7CisgICAgICAgIGlmICghY29udGV4dC5iaW5kU2VydmljZShuZXcgSW50ZW50KElCbHVldG9vdGhQYmFwLmNsYXNzLmdldE5hbWUoKSksIG1Db25uZWN0aW9uLCAwKSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IGJpbmQgdG8gQmx1ZXRvb3RoIFBiYXAgU2VydmljZSIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB0aHJvd3MgVGhyb3dhYmxlIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGNsb3NlKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBzdXBlci5maW5hbGl6ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2xvc2UgdGhlIGNvbm5lY3Rpb24gdG8gdGhlIGJhY2tpbmcgc2VydmljZS4KKyAgICAgKiBPdGhlciBwdWJsaWMgZnVuY3Rpb25zIG9mIEJsdWV0b290aFBiYXAgd2lsbCByZXR1cm4gZGVmYXVsdCBlcnJvcgorICAgICAqIHJlc3VsdHMgb25jZSBjbG9zZSgpIGhhcyBiZWVuIGNhbGxlZC4gTXVsdGlwbGUgaW52b2NhdGlvbnMgb2YgY2xvc2UoKQorICAgICAqIGFyZSBvay4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgY2xvc2UoKSB7CisgICAgICAgIGlmIChtQ29ubmVjdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ29udGV4dC51bmJpbmRTZXJ2aWNlKG1Db25uZWN0aW9uKTsKKyAgICAgICAgICAgIG1Db25uZWN0aW9uID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCB0aGUgY3VycmVudCBzdGF0ZSBvZiB0aGUgQmx1ZXRvb3RoUGJhcCBzZXJ2aWNlLgorICAgICAqIEByZXR1cm4gT25lIG9mIHRoZSBTVEFURV8gcmV0dXJuIGNvZGVzLCBvciBTVEFURV9FUlJPUiBpZiB0aGlzIHByb3h5CisgICAgICogICAgICAgICBvYmplY3QgaXMgY3VycmVudGx5IG5vdCBjb25uZWN0ZWQgdG8gdGhlIFBiYXAgc2VydmljZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFN0YXRlKCkgeworICAgICAgICBpZiAoREJHKSBsb2coImdldFN0YXRlKCkiKTsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFN0YXRlKCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkge0xvZy5lKFRBRywgZS50b1N0cmluZygpKTt9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMb2cudyhUQUcsICJQcm94eSBub3QgYXR0YWNoZWQgdG8gc2VydmljZSIpOworICAgICAgICAgICAgaWYgKERCRykgbG9nKExvZy5nZXRTdGFja1RyYWNlU3RyaW5nKG5ldyBUaHJvd2FibGUoKSkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBCbHVldG9vdGhQYmFwLlNUQVRFX0VSUk9SOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCB0aGUgY3VycmVudGx5IGNvbm5lY3RlZCByZW1vdGUgQmx1ZXRvb3RoIGRldmljZSAoUENFKS4KKyAgICAgKiBAcmV0dXJuIFRoZSByZW1vdGUgQmx1ZXRvb3RoIGRldmljZSwgb3IgbnVsbCBpZiBub3QgaW4gY29ubmVjdGVkIG9yCisgICAgICogICAgICAgICBjb25uZWN0aW5nIHN0YXRlLCBvciBpZiB0aGlzIHByb3h5IG9iamVjdCBpcyBub3QgY29ubmVjdGVkIHRvCisgICAgICogICAgICAgICB0aGUgUGJhcCBzZXJ2aWNlLgorICAgICAqLworICAgIHB1YmxpYyBCbHVldG9vdGhEZXZpY2UgZ2V0Q2xpZW50KCkgeworICAgICAgICBpZiAoREJHKSBsb2coImdldENsaWVudCgpIik7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRDbGllbnQoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7TG9nLmUoVEFHLCBlLnRvU3RyaW5nKCkpO30KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExvZy53KFRBRywgIlByb3h5IG5vdCBhdHRhY2hlZCB0byBzZXJ2aWNlIik7CisgICAgICAgICAgICBpZiAoREJHKSBsb2coTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcobmV3IFRocm93YWJsZSgpKSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0cnVlIGlmIHRoZ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FBCQVAuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBib29sZWFuIGRvZXNDbGFzc01hdGNoU2luayhpbnQgYnRDbGFzcykgeworICAgICAgICAvLyBUT0RPIG9wdGltaXplIHRoZSBydWxlCisgICAgICAgIHN3aXRjaCAoQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLmdldERldmljZShidENsYXNzKSkgeworICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5DT01QVVRFUl9ERVNLVE9QOgorICAgICAgICBjYXNlIEJsdWV0b290aENsYXNzLkRldmljZS5DT01QVVRFUl9MQVBUT1A6CisgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkNPTVBVVEVSX1NFUlZFUjoKKyAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuQ09NUFVURVJfVU5DQVRFR09SSVpFRDoKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBTZXJ2aWNlQ29ubmVjdGlvbiBtQ29ubmVjdGlvbiA9IG5ldyBTZXJ2aWNlQ29ubmVjdGlvbigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25TZXJ2aWNlQ29ubmVjdGVkKENvbXBvbmVudE5hbWUgY2xhc3NOYW1lLCBJQmluZGVyIHNlcnZpY2UpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIGxvZygiUHJveHkgb2JqZWN0IGNvbm5lY3RlZCIpOworICAgICAgICAgICAgbVNlcnZpY2UgPSBJQmx1ZXRvb3RoUGJhcC5TdHViLmFzSW50ZXJmYWNlKHNlcnZpY2UpOworICAgICAgICAgICAgaWYgKG1TZXJ2aWNlTGlzdGVuZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1TZXJ2aWNlTGlzdGVuZXIub25TZXJ2aWNlQ29ubmVj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ml2ZWxlZ2VzCisgICAgICovCisgICAgLypwYWNrYWdlKi8gQmx1ZXRvb3RoU2VydmVyU29ja2V0KGludCB0eXBlLCBib29sZWFuIGF1dGgsIGJvb2xlYW4gZW5jcnlwdCwgaW50IHBvcnQpCisgICAgICAgICAgICB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBtU29ja2V0ID0gbmV3IEJsdWV0b290aFNvY2tldCh0eXBlLCAtMSwgYXV0aCwgZW5jcnlwdCwgbnVsbCwgcG9ydCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQmxvY2sgdW50aWwgYSBjb25uZWN0aW9uIGlzIGVzdGFibGlzaGVkLgorICAgICAqIDxwPlJldHVybnMgYSBjb25uZWN0ZWQge0BsaW5rIEJsdWV0b290aFNvY2tldH0gb24gc3VjY2Vzc2Z1bCBjb25uZWN0aW9uLgorICAgICAqIDxwPk9uY2UgdGhpcyBjYWxsIHJldHVybnMsIGl0IGNhbiBiZSBjYWxsZWQgYWdhaW4gdG8gYWNjZXB0IHN1YnNlcXVlbnQKKyAgICAgKiBpbmNvbWluZyBjb25uZWN0aW9ucy4KKyAgICAgKiA8cD57QGxpbmsgI2Nsb3NlfSBjYW4gYmUgdXNlZCB0byBhYm9ydCB0aGlzIGNhbGwgZnJvbSBhbm90aGVyIHRocmVhZC4KKyAgICAgKiBAcmV0dXJuIGEgY29ubmVjdGVkIHtAbGluayBCbHVldG9vdGhTb2NrZXR9CisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBvbiBlcnJvciwgZm9yIGV4YW1wbGUgdGhpcyBjYWxsIHdhcyBhYm9ydGVkLCBvcgorICAgICAqICAgICAgICAgICAgICAgICAgICAgdGltZW91dAorICAgICAqLworICAgIHB1YmxpYyBCbHVldG9vdGhTb2NrZXQgYWNjZXB0KCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgcmV0dXJuIGFjY2VwdCgtMSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQmxvY2sg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gZmQsIGJvb2xlYW4gYXV0aCwgYm9vbGVhbiBlbmNyeXB0LAorICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHBvcnQpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIG1UeXBlID0gdHlwZTsKKyAgICAgICAgbUF1dGggPSBhdXRoOworICAgICAgICBtRW5jcnlwdCA9IGVuY3J5cHQ7CisgICAgICAgIG1EZXZpY2UgPSBkZXZpY2U7CisgICAgICAgIGlmIChkZXZpY2UgPT0gbnVsbCkgeworICAgICAgICAgICAgbUFkZHJlc3MgPSBudWxsOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUFkZHJlc3MgPSBkZXZpY2UuZ2V0QWRkcmVzcygpOworICAgICAgICB9CisgICAgICAgIG1Qb3J0ID0gcG9ydDsKKyAgICAgICAgaWYgKGZkID09IC0xKSB7CisgICAgICAgICAgICBpbml0U29ja2V0TmF0aXZlKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbml0U29ja2V0RnJvbUZkTmF0aXZlKGZkKTsKKyAgICAgICAgfQorICAgICAgICBtSW5wdXRTdHJlYW0gPSBuZXcgQmx1ZXRvb3RoSW5wdXRTdHJlYW0odGhpcyk7CisgICAgICAgIG1PdXRwdXRTdHJlYW0gPSBuZXcgQmx1ZXRvb3RoT3V0cHV0U3RyZWFtKHRoaXMpOworICAgICAgICBtQ2xvc2VkID0gZmFsc2U7CisgICAgICAgIG1Mb2NrID0gbmV3IFJlZW50cmFudFJlYWRXcml0ZUxvY2soKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb25zdHJ1Y3QgYSBCbHVldG9vdGhTb2NrZXQgZnJvbSBhZGRyZXNzLgorICAgICAqIEBwYXJhbSB0eXBlICAgIHR5cGUgb2Ygc29ja2V0CisgICAgICogQHBhcmFtIGZkICAgICAgZmQgdG8gdXNlIGZvciBjb25uZWN0ZWQgc29ja2V0LCBvciAtMSBmb3IgYSBuZXcgc29ja2V0CisgICAgICogQHBhcmFtIGF1dGggICAgcmVxdWlyZSB0aGUgcmVtb3RlIGRldmljZSB0byBiZSBhdXRoZW50aWNhdGVkCisgICAgICogQHBhcmFtIGVuY3J5cHQgcmVxdWlyZSB0aGUgY29ubmVjdGlvbiB0byBiZSBlbmNyeXB0ZWQKKyAgICAgKiBAcGFyYW0gYWRkcmVzcyByZW1vdGUgZGV2aWNlIHRoYXQgdGhpcyBzb2NrZXQgY2FuIGNvbm5lY3QgdG8KKyAgICAgKiBAcGFyYW0gcG9ydCAgICByZW1vdGUgcG9ydAorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gT24gZXJyb3IsIGZvciBleGFtcGxlIEJsdWV0b290aCBub3QgYXZhaWxhYmxlLCBvcgorICAgICAqICAgICAgICAgICAgICAgICAgICAgaW5zdWZmaWNpZW50IHByaXZlbGVnZXMKKyAgICAgKi8KKyAgICBwcml2YXRlIEJsdWV0b290aFNvY2tldChpbnQgdHlwZSwgaW50IGZkLCBib29sZWFuIGF1dGgsIGJvb2xlYW4gZW5jcnlwdCwgU3RyaW5nIGFkZHJlc3MsCisgICAgICAgICAgICBpbnQgcG9ydCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgdGhpcyh0eXBlLCBmZCwgYXV0aCwgZW5jcnlwdCwgbmV3IEJsdWV0b290aERldmljZShhZGRyZXNzKSwgcG9ydCk7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB0aHJvd3MgVGhyb3dhYmxlIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGNsb3NlKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBzdXBlci5maW5hbGl6ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQXR0ZW1wdCB0byBjb25uZWN0IHRvIGEgcmVtb3RlIGRldmljZS4KKyAgICAgKiA8cD5UaGlzIG1ldGhvZCB3aWxsIGJsb2NrIHVudGlsIGEgY29ubmVjdGlvbiBpcyBtYWRlIG9yIHRoZSBjb25uZWN0aW9uCisgICAgICogZmFpbHMuIElmIHRoaXMgbWV0aG9kIHJldHVybnMgd2l0aG91dCBhbiBleGNlcHRpb24gdGhlbiB0aGlzIHNvY2tldAorICAgICAqIGlzIG5vdyBjb25uZWN0ZWQuCisgICAgICogPHA+e0BsaW5rICNjbG9zZX0gY2FuIGJlIHVzZWQgdG8gYWJvcnQgdGhpcyBjYWxsIGZyb20gYW5vdGhlciB0aHJlYWQuCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBvbiBlcnJvciwgZm9yIGV4YW1wbGUgY29ubmVjdGlvbiBmYWlsdXJlCisgICAgICovCisgICAgcHVibGljIHZvaWQgY29ubmVjdCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIG1Mb2NrLnJlYWRMb2NrKCkubG9jaygpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKG1DbG9zZWQpIHRocm93IG5ldyBJT0V4Y2VwdGlvbigic29ja2V0IGNsb3NlZCIpOworICAgICAgICAgICAgY29ubmVjdE5hdGl2ZSgpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgbUxvY2sucmVhZExvY2soKS51bmxvY2soKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEltbWVkaWF0ZWx5IGNsb3NlIHRoaXMgc29ja2V0LCBhbmQgcmVsZWFzZSBhbGwgYXNzb2NpYXRlZCByZXNvdXJjZXMuCisgICAgICogPHA+Q2F1c2VzIGJsb2NrZWQgY2FsbHMgb24gdGhpcyBzb2NrZXQgaW4gb3RoZXIgdGhyZWFkcyB0byBpbW1lZGlhdGVseQorICAgICAqIHRocm93IGFuIElPRXhjZXB0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgLy8gYWJvcnQgYmxvY2tpbmcgb3BlcmF0aW9ucyBvbiB0aGUgc29ja2V0CisgICAgICAgIG1Mb2NrLnJlYWRMb2NrKCkubG9jaygpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKG1DbG9zZWQpIHJldHVybjsKKyAgICAgICAgICAgIGFib3J0TmF0aXZlKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTG9jay5yZWFkTG9jaygpLnVubG9jaygpOworICAgICAgICB9CisKKyAgICAgICAgLy8gYWxsIG5hdGl2ZSBjYWxscyBhcmUgZ3VhcmVudGVlZCB0byBpbW1lZGlhdGVseSByZXR1cm4gYWZ0ZXIKKyAgICAgICAgLy8gYWJvcnROYXRpdmUoKSwgc28gdGhpcyBsb2NrIHNob3VsZCBpbW1lZGlhdGxleSBhY3F1aXJlCisgICAgICAgIG1Mb2NrLndyaXRlTG9jaygpLmxvY2soKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1DbG9zZWQgPSB0cnVlOworICAgICAgICAgICAgZGVzdHJveU5hdGl2ZSgpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgbUxvY2sud3JpdGVMb2NrKCkudW5sb2NrKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXQgdGhlIHJlbW90ZSBkZXZpY2UgdGhpcyBzb2NrZXQgaXMgY29ubmVjdGluZywgb3IgY29ubmVjdGVkLCB0by4KKyAgICAgKiBAcmV0dXJuIHJlbW90ZSBkZXZpY2UKKyAgICAgKi8KKyAgICBwdWJsaWMgQmx1ZXRvb3RoRGV2aWNlIGdldFJlbW90ZURldmljZSgpIHsKKyAgICAgICAgcmV0dXJuIG1EZXZpY2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0IHRoZSBpbnB1dCBzdHJlYW0gYXNzb2NpYXRlZCB3aXRoIHRoaXMgc29ja2V0Lg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7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAobUNsb3NlZCkgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJzb2NrZXQgY2xvc2VkIik7CisgICAgICAgICAgICBiaW5kTGlzdGVuTmF0aXZlKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTG9jay5yZWFkTG9jaygpLnVubG9jaygpOworICAgICAgICB9CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gQmx1ZXRvb3RoU29ja2V0IGFjY2VwdChpbnQgdGltZW91dCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgbUxvY2sucmVhZExvY2soKS5sb2NrKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAobUNsb3NlZCkgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJzb2NrZXQgY2xvc2VkIik7CisgICAgICAgICAgICByZXR1cm4gYWNjZXB0TmF0aXZlKHRpbWVvdXQpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgbUxvY2sucmVhZExvY2soKS51bmxvY2soKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qcGFja2FnZSovIGludCBhdmFpbGFibGUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBtTG9jay5yZWFkTG9jaygpLmxvY2soKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChtQ2xvc2VkKSB0aHJvdyBuZXcgSU9FeGNlcHRpb24oInNvY2tldCBjbG9zZWQiKTsKKyAgICAgICAgICAgIHJldHVybiBhdmFpbGFibGVOYXRpdmUoKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIG1Mb2NrLnJlYWRMb2NrKCkudW5sb2NrKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBpbnQgcmVhZChieXRlW10gYiwgaW50IG9mZnNldCwgaW50IGxlbmd0aCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgbUxvY2sucmVhZExvY2soKS5sb2NrKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAobUNsb3NlZCkgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJzb2NrZXQgY2xvc2VkIik7CisgICAgICAgICAgICByZXR1cm4gcmVhZE5hdGl2ZShiLCBvZmZzZXQsIGxlbmd0aCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTG9jay5yZWFkTG9jaygpLnVubG9jaygpOworICAgICAgICB9CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gaW50IHdyaXRlKGJ5dGVbXSBiLCBpbnQgb2Zmc2V0LCBpbnQgbGVuZ3RoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBtTG9jay5yZWFkTG9jaygpLmxvY2soKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChtQ2xvc2VkKSB0aHJvdyBuZXcgSU9FeGNlcHRpb24oInNvY2tldCBjbG9zZWQiKTsKKyAgICAgICAgICAgIHJldHVybiB3cml0ZU5hdGl2ZShiLCBvZmZzZXQsIGxlbmd0aCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTG9jay5yZWFkTG9jaygpLnVubG9jaygpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBpbml0U29ja2V0TmF0aXZlKCkgdGhyb3dzIElPRXhjZXB0aW9uOworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgaW5pdFNvY2tldEZyb21GZE5hdGl2ZShpbnQgZmQpIHRocm93cyBJT0V4Y2VwdGlvbjsKKyAgICBwcml2YXRlIG5hdGl2ZSB2b2lkIGNvbm5lY3ROYXRpdmUoKSB0aHJvd3MgSU9FeGNlcHRpb247CisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBiaW5kTGlzdGVuTmF0aXZlKCkgdGhyb3dzIElPRXhjZXB0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gICAgICAgICAgICAgICAgIFVVSUQgdXVpZCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKLSAgICAgICAgU3RyaW5nIHhtbFJlY29yZCA9Ci0gICAgICAgICAgICAgICAgIjw/eG1sIHZlcnNpb249XCIxLjBcIiBlbmNvZGluZz1cIlVURi04XCIgPz5cbiIgKwotICAgICAgICAgICAgICAgICI8cmVjb3JkPlxuIiArCi0gICAgICAgICAgICAgICAgIiAgPGF0dHJpYnV0ZSBpZD1cIjB4MDAwMVwiPlxuIiArIC8vIFNlcnZpY2VDbGFzc0lETGlzdAotICAgICAgICAgICAgICAgICIgICAgPHNlcXVlbmNlPlxuIiArCi0gICAgICAgICAgICAgICAgIiAgICAgIDx1dWlkIHZhbHVlPVwiIgotICAgICAgICAgICAgICAgICAgICAgICAgKyB1dWlkLnRvU3RyaW5nKCkgKyAgICAgICAvLyBVVUlEIGZvciB0aGlzIHNlcnZpY2UKLSAgICAgICAgICAgICAgICAgICAgICAgICJcIi8+XG4iICsKLSAgICAgICAgICAgICAgICAiICAgIDwvc2VxdWVuY2U+XG4iICsKLSAgICAgICAgICAgICAgICAiICA8L2F0dHJpYnV0ZT5cbiIgKwotICAgICAgICAgICAgICAgICIgIDxhdHRyaWJ1dGUgaWQ9XCIweDAwMDRcIj5cbiIgKyAvLyBQcm90b2NvbERlc2NyaXB0b3JMaXN0Ci0gICAgICAgICAgICAgICAgIiAgICA8c2VxdWVuY2U+XG4iICsKLSAgICAgICAgICAgICAgICAiICAgICAgPHNlcXVlbmNlPlxuIiArCi0gICAgICAgICAgICAgICAgIiAgICAgICAgPHV1aWQgdmFsdWU9XCIweDAxMDBcIi8+XG4iICsgIC8vIEwyQ0FQCi0gICAgICAgICAgICAgICAgIiAgICAgIDwvc2VxdWVuY2U+XG4iICsKLSAgICAgICAgICAgICAgICAiICAgICAgPHNlcXVlbmNlPlxuIiArCi0gICAgICAgICAgICAgICAgIiAgICAgICAgPHV1aWQgdmFsdWU9XCIweDAwMDNcIi8+XG4iICsgIC8vIFJGQ09NTQotICAgICAgICAgICAgICAgICIgICAgICAgIDx1aW50OCB2YWx1ZT1cIiIgKwotICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0LmdldFBvcnQoKSArICAgICAgICAgICAgICAvLyBSRkNPTU0gcG9ydAotICAgICAgICAgICAgICAgICAgICAgICAgIlwiIG5hbWU9XCJjaGFubmVsXCIvPlxuIiArCi0gICAgICAgICAgICAgICAgIiAgICAgIDwvc2VxdWVuY2U+XG4iICsKLSAgICAgICAgICAgICAgICAiICAgIDwvc2VxdWVuY2U+XG4iICsKLSAgICAgICAgICAgICAgICAiICA8L2F0dHJpYnV0ZT5cbiIgKwotICAgICAgICAgICAgICAgICIgIDxhdHRyaWJ1dGUgaWQ9XCIweDAxMDBcIj5cbiIgKyAvLyBTZXJ2aWNlTmFtZQotICAgICAgICAgICAgICAgICIgICAgPHRleHQgdmFsdWU9XCIiICsgc2VydmljZU5hbWUgKyAiXCIvPlxuIiArCi0gICAgICAgICAgICAgICAgIiAgPC9hdHRyaWJ1dGU+XG4iICsKLSAgICAgICAgICAgICAgICAiPC9yZWNvcmQ+XG4iOwotICAgICAgICBMb2cuaShzTG9nTmFtZSwgeG1sUmVjb3JkKTsKLSAgICAgICAgcmV0dXJuIGFkZFNlcnZpY2VSZWNvcmRGcm9tWG1sKHhtbFJlY29yZCk7Ci0gICAgfQotCi0KLSAgICAvKioKLSAgICAgKiBBZGQgYSBuZXcgc2VydmljZSByZWNvcmQuCi0gICAgICogQHBhcmFtIHJlY29yZCBUaGUgYnl0ZVtdIHJlY29yZAotICAgICAqIEByZXR1cm4gICAgICAgQSBoYW5kbGUgdG8gdGhlIG5ldyByZWNvcmQKLSAgICAgKi8KLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBhZGRTZXJ2aWNlUmVjb3JkKGJ5dGVbXSByZWNvcmQpIHRocm93cyBJT0V4Y2VwdGlvbiB7Ci0gICAgICAgIGludCBoYW5kbGUgPSBhZGRTZXJ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vbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgIGlmIChtRmQgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigic29ja2V0IG5vdCBjcmVhdGVkIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtSXNDb25uZWN0aW5nID0gY29ubmVjdEFzeW5jTmF0aXZlKGFkZHJlc3MsIHBvcnQpOwotICAgICAgICAgICAgcmV0dXJuIG1Jc0Nvbm5lY3Rpbmc7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIGNvbm5lY3RBc3luY05hdGl2ZShTdHJpbmcgYWRkcmVzcywgaW50IHBvcnQpOwotCi0gICAgLyoqCi0gICAgICogSW50ZXJydXB0cyBhbiBhc3luY2hyb25vdXMgY29ubmVjdCBpbiBwcm9ncmVzcy4gVGhpcyBtZXRob2QgZG9lcyBub3RoaW5nCi0gICAgICogd2hlbiB0aGVyZSBpcyBubyBhc3luY2hyb25vdXMgY29ubmVjdCBpbiBwcm9ncmVzcy4KLSAgICAgKiAKLSAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCi0gICAgICogICAgICAgICAgICAgaWYgeW91IGhhdmUgbm90IGNhbGxlZCB7QGxpbmsgI2NyZWF0ZSgpIGNyZWF0ZX0uCi0gICAgICogQHNlZSAjY29ubmVjdEFzeW5jKFN0cmluZywgaW50KQotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIGludGVycnVwdEFzeW5jQ29ubmVjdCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7Ci0gICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewotICAgICAgICAgICAgaWYgKG1GZCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJzb2NrZXQgbm90IGNyZWF0ZWQiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtSX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igpCi0gICAgICogQHNlZSAjc2h1dGRvd25PdXRwdXQoKQotICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIHNodXRkb3duSW5wdXQoKSB0aHJvd3MgSU9FeGNlcHRpb24gewotICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgIGlmIChtRmQgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigic29ja2V0IG5vdCBjcmVhdGVkIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gc2h1dGRvd25OYXRpdmUodHJ1ZSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBTaHV0IGRvd24gdGhlIG91dHB1dCBzdHJlYW0gb2YgdGhlIHNvY2tldCwgYnV0IGxlYXZlcyB0aGUgaW5wdXQgc3RyZWFtIGluCi0gICAgICogaXRzIGN1cnJlbnQgc3RhdGUuCi0gICAgICogCi0gICAgICogQHJldHVybiB0cnVlIG9uIHN1Y2Nlc3MsIGZhbHNlIG9uIGZhaWx1cmUKLSAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCi0gICAgICogICAgICAgICAgICAgaXMgeW91IGhhdmUgbm90IGNhbGxlZCB7QGxpbmsgI2NyZWF0ZSgpIGNyZWF0ZX0KLSAgICAgKiBAc2VlICNzaHV0ZG93bigpCi0gICAgICogQHNlZSAjc2h1dGRvd25JbnB1dCgpCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gc2h1dGRvd25PdXRwdXQoKSB0aHJvd3MgSU9FeGNlcHRpb24gewotICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgIGlmIChtRmQgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigic29ja2V0IG5vdCBjcmVhdGVkIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZ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lIHRoZSBrZXJuZWwgc2VsZWN0IGFuIHVudXNlZAotICAgICAqIHBvcnQuCi0gICAgICoKLSAgICAgKiBAcGFyYW0gZGV2aWNlCi0gICAgICogICAgICAgICAgICBCbHVldG9vdGggYWRkcmVzcyBvZiBkZXZpY2UgdG8gYmluZCB0byAoY3VycmVudGx5IGlnbm9yZWQpLgotICAgICAqIEByZXR1cm4gdHJ1ZSBvbiBzdWNjZXNzLCBmYWxzZSBvbiBmYWlsdXJlCi0gICAgICogQHRocm93cyBJT0V4Y2VwdGlvbgotICAgICAqICAgICAgICAgICAgIGlmIHlvdSBoYXZlIG5vdCBjYWxsZWQge0BsaW5rICNjcmVhdGUoKSBjcmVhdGV9Ci0gICAgICogQHNlZSAjbGlzdGVuKGludCkKLSAgICAgKiBAc2VlICNhY2NlcHQoUmZjb21tU29ja2V0LGludCkKLSAgICAgKi8KLSAgICBwdWJsaWMgYm9vbGVhbiBiaW5kKFN0cmluZyBkZXZpY2UpIHRocm93cyBJT0V4Y2VwdGlvbiB7Ci0gICAgICAgIGlmIChtRmQgPT0gbnVsbCkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJzb2NrZXQgbm90IGNyZWF0ZWQiKTsKLSAgICAgICAgfQotICAgICAgICBmb3IgKGludCBwb3J0ID0gMTI7IHBvcnQgPD0gMzA7IHBvcnQrKykgewotICAgICAgICAgICAgaWYgKGJpbmROYXRpdmUoZGV2aWNlLCBwb3J0KSkgewotICAgICAgICAgICAgICAgIG1Jc0JvdW5kID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBtSXNCb3VuZCA9IGZhbHNlOwotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQmluZHMgYSBsaXN0ZW5pbmcgc29ja2V0IHRvIHRoZSBsb2NhbCBkZXZpY2UsIG9yIGEgbm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ICogdG8gYmVjb21lIGF0IHRoZSBlbmQgdGhlbiBzZXQgbUVudGl0eUN1cnNvciB0byBudWxsLiBJZiBuZXdFbnRpdHlGcm9tQ3Vyc29yIHJldHVybnMgbnVsbAorICAgICAqIHRoZW4gY29udGludWUgYWR2YW5jaW5nIHVudGlsIGl0IGVpdGhlciByZXR1cm5zIGEgbm9uLW51bGwgRW50aXR5IG9yIHRoZSBjdXJzb3IgcmVhY2hlcworICAgICAqIHRoZSBlbmQuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGZpbGxFbnRpdHlJZkF2YWlsYWJsZSgpIHsKKyAgICAgICAgd2hpbGUgKG1OZXh0RW50aXR5ID09IG51bGwpIHsKKyAgICAgICAgICAgIGlmICghbUVudGl0eUN1cnNvci5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAvLyB0aGUgY3Vyc29yIGlzIGF0IHRoZW4gZW5kLCBiYWlsIG91dAorICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFRoaXMgbWF5IHJldHVybiBudWxsIGlmIG5ld0VudGl0eUZyb21DdXJzb3IgaXMgbm90IGFibGUgdG8gY3JlYXRlIGFuIGVudGl0eQorICAgICAgICAgICAgLy8gZnJvbSB0aGUgY3VycmVudCBjdXJzb3IgcG9zaXRpb24uIEluIHRoYXQgY2FzZSB0aGlzIG1ldGhvZCB3aWxsIGxvb3AgYW5kIHRyeQorICAgICAgICAgICAgLy8gdGhlIG5leHQgY3Vyc29yIHBvc2l0aW9uCisgICAgICAgICAgICBtTmV4dEVudGl0eSA9IG5ld0VudGl0eUZyb21DdXJzb3JMb2NrZWQobUVudGl0eUN1cnNvcik7CisgICAgICAgIH0KKyAgICAgICAgbURiLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGludCBwb3NpdGlvbiA9IG1FbnRpdHlDdXJzb3IuZ2V0UG9zaXRpb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Iik7CisgICAgICAgIH0KKyAgICAgICAgZmlsbEVudGl0eUlmQXZhaWxhYmxlKCk7CisgICAgICAgIHJldHVybiBtTmV4dEVudGl0eSAhPSBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIG5leHQgRW50aXR5IHRoYXQgaXMgYWNjZXNzaWJsZSB2aWEgdGhpcyBpdGVyYXRvci4gVGhpcyBtYXkgbm90IGJlIGNhbGxlZAorICAgICAqIGlmIHRoZSBpdGVyYXRvciBpcyBhbHJlYWR5IGNsb3NlZC4KKyAgICAgKiBAcmV0dXJuIHRoZSBuZXh0IEVudGl0eSB0aGF0IGlzIGFjY2Vzc2libGUgdmlhIHRoaXMgaXRlcmF0b3IKKyAgICAgKi8KKyAgICBwdWJsaWMgRW50aXR5IG5leHQoKSB7CisgICAgICAgIGlmIChtSXNDbG9zZWQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImNhbGxpbmcgbmV4dCgpIHdoZW4gdGhlIGl0ZXJhdG9yIGlzIGNsb3NlZCIpOworICAgICAgICB9CisgICAgICAgIGlmICghaGFzTmV4dCgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJ5b3UgbWF5IG9ubHkgY2FsbCBuZXh0KCkgaWYgaGFzTmV4dCgpIGlzIHRydWUiKTsKKyAgICAgICAgfQorCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbU5leHRFbnRpdHk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTmV4dEVudGl0eSA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZXNldCgpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICBpZiAobUlzQ2xvc2VkKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9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pOworICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlci5yZXF1ZXN0U3luYyhudWxsIC8qIGFsbCBhY2NvdW50cyAqLywKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZW50VXJpLmdldEF1dGhvcml0eSgpLCBuZXcgQnVuZGxlKCkpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTE1MCwyMyArMTU5LDM2IEBACiAgICAgICAgIG1PcGVuSGVscGVyID0gbmV3IEFic3RyYWN0U3luY2FibGVDb250ZW50UHJvdmlkZXIuRGF0YWJhc2VIZWxwZXIoZ2V0Q29udGV4dCgpLAogICAgICAgICAgICAgICAgIG1EYXRhYmFzZU5hbWUpOwogICAgICAgICBtU3luY1N0YXRlID0gbmV3IFN5bmNTdGF0ZUNvbnRlbnRQcm92aWRlckhlbHBlcihtT3BlbkhlbHBlcik7Ci0KLSAgICAgICAgQWNjb3VudE1vbml0b3JMaXN0ZW5lciBsaXN0ZW5lciA9IG5ldyBBY2NvdW50TW9uaXRvckxpc3RlbmVyKCkgewotICAgICAgICAgICAgcHVibGljIHZvaWQgb25BY2NvdW50c1VwZGF0ZWQoU3RyaW5nW10gYWNjb3VudHMpIHsKLSAgICAgICAgICAgICAgICAvLyBTb21lIHByb3ZpZGVycyBvdmVycmlkZSBvbkFjY291bnRzQ2hhbmdlZCgpOyBnaXZlIHRoZW0gYSBkYXRhYmFzZSB0byB3b3JrIHdpdGguCi0gICAgICAgICAgICAgICAgbURiID0gbU9wZW5IZWxwZXIuZ2V0V3JpdGFibGVEYXRhYmFzZSgpOwotICAgICAgICAgICAgICAgIG9uQWNjb3VudHNDaGFuZ2VkKGFjY291bnRzKTsKLSAgICAgICAgICAgICAgICBUZW1wUHJvdmlkZXJTeW5jQWRhcHRlciBzeW5jQWRhcHRlciA9IChUZW1wUHJvdmlkZXJTeW5jQWRhcHRlcilnZXRTeW5jQWRhcHRlcigpOwotICAgICAgICAgICAgICAgIGlmIChzeW5jQWRhcHRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN5bmNBZGFwdGVyLm9uQWNjb3VudHNDaGFuZ2VkKGFjY291bnRzKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH07Ci0gICAgICAgIG1BY2NvdW50TW9uaXRvciA9IG5ldyBBY2NvdW50TW9uaXRvcihnZXRDb250ZXh0KCksIGxpc3RlbmVyKTsKKyAgICAgICAgQWNjb3VudE1hbmFnZXIuZ2V0KGdldENvbnRleHQoKSkuYWRkT25BY2NvdW50c1VwZGF0ZWRMaXN0ZW5lcigKKyAgICAgICAgICAgICAgICBuZXcgT25BY2NvdW50c1VwZGF0ZWRMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25BY2NvdW50c1VwZGF0ZWQoQWNjb3VudFtdIGFjY291bnRzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBTb21lIHByb3ZpZGVycyBvdmVycmlkZSBvbkFjY291bnRzQ2hhbmdlZCgpOyBnaXZlIHRoZW0gYSBkYXRhYmFzZSB0bworICAgICAgICAgICAgICAgICAgICAgICAgLy8gd29yayB3aXRoLgorICAgICAgICAgICAgICAgICAgICAgICAgbURiID0gbU9wZW5IZWxwZXIuZ2V0V3JpdGFibGVEYXRhYmFzZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gT25seSBjYWxsIG9uQWNjb3VudHNDaGFuZ2VkIG9uIEdBSUEgYWNjb3VudHM7IG90aGVyd2lzZSwgdGhlIGNvbnRhY3RzIGFuZAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FsZW5kYXIgcHJvdmlkZXJzIHdpbGwgY2hva2UgYXMgdGhleSB0cnkgdG8gc3luYyB1bmtub3duIGFjY291bnRzIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFic3RyYWN0R0RhdGFTeW5jQWRhcHRlciwgd2hpY2ggd2lsbCBwdXQgYWNvcmUgaW50byBhIGNyYXNoIGxvb3AKKyAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxBY2NvdW50PiBnYWlhQWNjb3VudHMgPSBuZXcgQXJyYXlMaXN0PEFjY291bnQ+KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEFjY291bnQgYWNjdDogYWNjb3VudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWNjdC50eXBlLmVxdWFscygiY29tLmdvb2dsZS5HQUlBIikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2FpYUFjY291bnRzLmFkZChhY2N0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50cyA9IG5ldyBBY2NvdW50W2dhaWFBY2NvdW50cy5zaXplKCldOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChBY2NvdW50IGFjY3Q6IGdhaWFBY2NvdW50cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnRzW2krK10gPSBhY2N0OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgb25BY2NvdW50c0NoYW5nZWQoYWNjb3VudHMpOworICAgICAgICAgICAgICAgICAgICAgICAgVGVtcFByb3ZpZGVyU3luY0FkYXB0ZXIgc3luY0FkYXB0ZXIgPSBnZXRUZW1wUHJvdmlkZXJTeW5jQWRhcHRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN5bmNBZGFwdGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW5jQWRhcHRlci5vbkFjY291bnRzQ2hhbmdlZChhY2NvdW50cyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKy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ICogdGhpcyBtYWtlcyBiYXRjaCBpbnNlcnRpb24vdXBkYXRlL2RlbGV0ZSBtdWNoIGZhc3Rlci4KLSAgICAgKi8KLSAgICBwdWJsaWMgZmluYWwgdm9pZCBlbmRUcmFuc2FjdGlvbihib29sZWFuIHN1Y2Nlc3NmdWwpIHsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBub3RBcHBseWluZ0JhdGNoID0gIWFwcGx5aW5nQmF0Y2goKTsKKyAgICAgICAgaWYgKG5vdEFwcGx5aW5nQmF0Y2gpIHsKKyAgICAgICAgICAgIG1EYi5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgIH0KICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGlmIChzdWNjZXNzZnVsKSB7Ci0gICAgICAgICAgICAgICAgLy8gc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCkgbXVzdCBiZSBjYWxsZWQganVzdCBvbmNlIGR1cmluZyBvcGVuaW5nIHRoZQotICAgICAgICAgICAgICAgIC8vIHRyYW5zYWN0aW9uLgorICAgICAgICAgICAgaWYgKGlzVGVtcG9yYXJ5KCkgJiYgbVN5bmNTdGF0ZS5tYXRjaGVzKHVybCkpIHsKKyAgICAgICAgICAgICAgICBpbnQgbnVtUm93cyA9IG1TeW5jU3RhdGUuYXNDb250ZW50UHJvdmlkZXIoKS51cGRhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICB1cmwsIHZhbHVlcywgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzKTsKKyAgICAgICAgICAgICAgICBpZiAobm90QXBwbHlpbmdCYXRjaCkgeworICAgICAgICAgICAgICAgICAgICBtRGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBudW1Sb3dzOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgcmVzdWx0ID0gdXBkYXRlSW50ZXJuYWwodXJsLCB2YWx1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aW5nW10gc2VsZWN0aW9uQXJncykgewotICAgICAgICBpZiAoaXNUZW1wb3JhcnkoKSAmJiBtU3luY1N0YXRlLm1hdGNoZXModXJpKSkgewotICAgICAgICAgICAgaW50IG51bVJvd3MgPSBtU3luY1N0YXRlLmFzQ29udGVudFByb3ZpZGVyKCkudXBkYXRlKAotICAgICAgICAgICAgICAgICAgICB1cmksIHZhbHVlcywgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzKTsKLSAgICAgICAgICAgIHJldHVybiBudW1Sb3dzOwotICAgICAgICB9Ci0KLSAgICAgICAgaW50IHJlc3VsdCA9IHVwZGF0ZUludGVybmFsKHVyaSwgdmFsdWVzLCBzZWxlY3Rpb24sIHNlbGVjdGlvbkFyZ3MpOwotICAgICAgICBpZiAoIWlzVGVtcG9yYXJ5KCkgJiYgcmVzdWx0ID4gMCkgewotICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldENvbnRlbnRSZXNvbHZlcigpLm5vdGlmeUNoYW5nZSh1cmksIG51bGwgLyogb2JzZXJ2ZXIgKi8sCi0gICAgICAgICAgICAgICAgICAgIGNoYW5nZVJlcXVpcmVzTG9jYWxTeW5jKHVyaSkpOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHJlc3VsdDsKLSAgICB9Ci0KLSAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgZmluYWwgaW50IGRlbGV0ZShmaW5hbCBVcmkgdXJpLCBmaW5hbCBTdHJpbmcgc2VsZWN0aW9uLAotICAgICAgICAgICAgZmluYWwgU3RyaW5nW10gc2VsZWN0aW9uQXJncykgewotICAgICAgICBib29sZWFuIHN1Y2Nlc3NmdWwgPSBmYWxzZTsKLSAgICAgICAgYmVnaW5UcmFuc2FjdGlvbigpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgaW50IHJldCA9IG5vblRyYW5zYWN0aW9uYWxEZWxldGUodXJpLCBzZWxlY3Rpb24sIHNlbGVjdGlvbkFyZ3MpOwotICAgIC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XJpLCBmaW5hbCBDb250ZW50VmFsdWVzIHZhbHVlcykgewotICAgICAgICBib29sZWFuIHN1Y2Nlc3NmdWwgPSBmYWxzZTsKLSAgICAgICAgYmVnaW5UcmFuc2FjdGlvbigpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgVXJpIHJldCA9IG5vblRyYW5zYWN0aW9uYWxJbnNlcnQodXJpLCB2YWx1ZXMpOwotICAgICAgICAgICAgc3VjY2Vzc2Z1bCA9IHRydWU7Ci0gICAgICAgICAgICByZXR1cm4gcmV0OwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgZW5kVHJhbnNhY3Rpb24oc3VjY2Vzc2Z1bCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqLwotICAgIHB1YmxpYyBmaW5hbCBVcmkgbm9uVHJhbnNhY3Rpb25hbEluc2VydChmaW5hbCBVcmkgdXJpLCBmaW5hbCBDb250ZW50VmFsdWVzIHZhbHVlcykgewotICAgICAgICBpZiAoaXNUZW1wb3JhcnkoKSAmJiBtU3luY1N0YXRlLm1hdGNoZXModXJpKSkgewotICAgICAgICAgICAgVXJpIHJlc3VsdCA9IG1TeW5jU3RhdGUuYXNDb250ZW50UHJvdmlkZXIoKS5pbnNlcnQodXJpLCB2YWx1ZXMpOworICAgICAgICAgICAgaWYgKCFpc1RlbXBvcmFyeSgpICYmIHJlc3VsdCA+IDApIHsKKyAgICAgICAgICAgICAgICBpZiAobm90QXBwbHlpbmdCYXRjaCkgeworICAgICAgICAgICAgICAgICAgICBnZXRDb250ZXh0KCkuZ2V0Q29udGVudFJlc29sdmVyKCkubm90aWZ5Q2hhbmdlKHVybCwgbnVsbCAvKiBvYnNlcnZlciAqLywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFuZ2VSZXF1aXJlc0xvY2FsU3luYyh1cmwpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ0JhdGNoTm90aWZpY2F0aW9ucy5nZXQoKS5hZGQodXJsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKG5vdEFwcGx5aW5nQmF0Y2gpIHsKKyAgICAgICAgICAgICAgICBtRGIuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICBVcmkgcmVzdWx0ID0gaW5zZXJ0SW50ZXJuYWwodXJpLCB2YWx1ZXMpOwotICAgICAgICBpZiAoIWlzVGVtcG9yYXJ5KCkgJiYgcmVzdWx0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGdldENvbnRleHQoKS5nZXRDb250ZW50UmVzb2x2ZXIoKS5ub3RpZnlDaGFuZ2UodXJpLCBudWxsIC8qIG9ic2VydmVyICovLAotICAgICAgICAgICAgICAgICAgICBjaGFuZ2VSZXF1aXJlc0xvY2FsU3luYyh1cmkpKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgZmluYWwgaW50IGRlbGV0ZShmaW5hbCBVcmkgdXJsLCBmaW5hbCBTdHJpbmcgc2VsZWN0aW9uLAorICAgICAgICAgICAgZmluYWwgU3RyaW5nW10gc2VsZWN0aW9uQXJncykgeworICAgICAgICBtRGIgPSBtT3BlbkhlbHBlci5nZXRXcml0YWJsZURhdGFiYXNlKCk7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbm90QXBwbHlpbmdCYXRjaCA9ICFhcHBseWluZ0JhdGNoKCk7CisgICAgICAgIGlmIChub3RBcHBseWluZ0JhdGNoKSB7CisgICAgICAgICAgICBtRGIuYmVnaW5UcmFuc2FjdGlvbigpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoaXNUZW1wb3JhcnkoKSAmJiBtU3luY1N0YXRlLm1hdGNoZXModXJsKSkgeworICAgICAgICAgICAgICAgIGludCBudW1Sb3dzID0gbVN5bmNTdGF0ZS5hc0NvbnRlbnRQcm92aWRlcigpLmRlbGV0ZSh1cmwsIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncyk7CisgICAgICAgICAgICAgICAgaWYgKG5vdEFwcGx5aW5nQmF0Y2gpIHsKKyAgICAgICAgICAgICAgICAgICAgbURiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVtUm93czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCByZXN1bHQgPSBkZWxldGVJbnRlcm5hbCh1cmwsIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncyk7CisgICAgICAgICAgICBpZiAobm90QXBwbHlpbmdCYXRjaCkgeworICAgICAgICAgICAgICAgIG1EYi5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghaXNUZW1wb3JhcnkoKSAmJiByZXN1bHQgPiAwKSB7CisgICAgICAgICAgICAgICAgaWYgKG5vdEFwcGx5aW5nQmF0Y2gpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldENvbnRlbnRSZXNvbHZlcigpLm5vdGlmeUNoYW5nZSh1cmwsIG51bGwgLyogb2JzZXJ2ZXIgKi8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlUmVxdWlyZXNMb2NhbFN5bmModXJsKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdCYXRjaE5vdGlmaWNhdGlvbnMuZ2V0KCkuYWRkKHVybCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChub3RBcHBseWluZ0JhdGNoKSB7CisgICAgICAgICAgICAgICAgbURiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gYXBwbHlpbmdCYXRjaCgpIHsKKyAgICAgICAgcmV0dXJuIG1BcHBseWluZ0JhdGNoLmdldCgpICE9IG51bGwgJiYgbUFwcGx5aW5nQmF0Y2guZ2V0KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGZpbmFsIFVyaSBpbnNlcnQoZmluYWwgVXJpIHVybCwgZmluYWwgQ29udGVudFZhbHVlcyB2YWx1ZXMpIHsKKyAgICAgICAgbURiID0gbU9wZW5IZWxwZXIuZ2V0V3JpdGFibGVEYXRhYmFzZSgpOworICAgICAgICBmaW5hbCBib29sZWFuIG5vdEFwcGx5aW5nQmF0Y2ggPSAhYXBwbHlpbmdCYXRjaCgpOworICAgICAgICBpZiAobm90QXBwbHlpbmdCYXRjaCkgeworICAgICAgICAgICAgbURiLmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKGlzVGVtcG9yYXJ5KCkgJiYgbVN5bmNTdGF0ZS5tYXRjaGVzKHVybCkpIHsKKyAgICAgICAgICAgICAgICBVcmkgcmVzdWx0ID0gbVN5bmNTdGF0ZS5hc0NvbnRlbnRQcm92aWRlcigpLmluc2VydCh1cmwsIHZhbHVlcyk7CisgICAgICAgICAgICAgICAgaWYgKG5vdEFwcGx5aW5nQmF0Y2gpIHsKKyAgICAgICAgICAgICAgICAgICAgbURiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgVXJpIHJlc3VsdCA9IGluc2VydEludGVybmFsKHVybCwgdmFsdWVzKTsKKyAgICAgICAgICAgIGlmIChub3RBcHBseWluZ0JhdGNoKSB7CisgICAgICAgICAgICAgICAgbURiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFpc1RlbXBvcmFyeSgpICYmIHJlc3VsdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKG5vdEFwcGx5aW5nQmF0Y2gpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldENvbnRlbnRSZXNvbHZlcigpLm5vdGlmeUNoYW5nZSh1cmwsIG51bGwgLyogb2JzZXJ2ZXIgKi8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlUmVxdWlyZXNMb2NhbFN5bmModXJsKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdCYXRjaE5vdGlmaWNhdGlvbnMuZ2V0KCkuYWRkKHVybCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChub3RBcHBseWluZ0JhdGNoKSB7CisgICAgICAgICAgICAgICAgbURiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTQxMSw2ICs0MDMsOTIgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiA8cD4KKyAgICAgKiBTdGFydCBiYXRjaCB0cmFuc2FjdGlvbi4ge0BsaW5rICNlbmRUcmFuc2FjdGlvbn0gTVVTVCBiZSBjYWxsZWQgYWZ0ZXIgCisgICAgICogY2FsbGluZyB0aGlzIG1ldGhvZC4gVGh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Qgd2l0aCB7QGxpbmsgI2JlZ2luQmF0Y2goKX0uCisgICAgICogPC9wPgorICAgICAqCisgICAgICogQGhpZGUgVGhpcyBtZXRob2QgbXVzdCBiZSB1c2VkIHdpdGgge0BsaW5rICNiZWdpblRyYW5zYWN0aW9ufQorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCB2b2lkIGVuZEJhdGNoKGJvb2xlYW4gc3VjY2Vzc2Z1bCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKHN1Y2Nlc3NmdWwpIHsKKyAgICAgICAgICAgICAgICAvLyBzZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKSBtdXN0IGJlIGNhbGxlZCBqdXN0IG9uY2UgZHVyaW5nIG9wZW5pbmcgdGhlCisgICAgICAgICAgICAgICAgLy8gdHJhbnNhY3Rpb24uCisgICAgICAgICAgICAgICAgbURiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgbUFwcGx5aW5nQmF0Y2guc2V0KGZhbHNlKTsKKyAgICAgICAgICAgIGdldERhdGFiYXNlKCkuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIGZvciAoVXJpIHVybCA6IG1QZW5kaW5nQmF0Y2hOb3RpZmljYXRpb25zLmdldCgpKSB7CisgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldENvbnRlbnRSZXNvbHZlcigpLm5vdGlmeUNoYW5nZSh1cmwsIG51bGwgLyogb2JzZXJ2ZXIgKi8sCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFuZ2VSZXF1aXJlc0xvY2FsU3luYyh1cmwpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBDb250ZW50UHJvdmlkZXJSZXN1bHRbXSBhcHBseUJhdGNoKEFycmF5TGlzdDxDb250ZW50UHJvdmlkZXJPcGVyYXRp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IGNvbnRleHQsIEFjY291bnQgYWNjb3VudCkgeworICAgICAgICBpZiAoYWNjb3VudCA9PSBudWxsKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ5b3UgcGFzc2VkIGluIGFuIGVtcHR5IGFjY291bnQiKTsKICAgICAgICAgfQogICAgICAgICBtU3luY2luZ0FjY291bnQgPSBhY2NvdW50OwpAQCAtNDU3LDcgKzUzNSw3IEBACiAgICAgICogVGhlIGFjY291bnQgb2YgdGhlIG1vc3QgcmVjZW50IGNhbGwgdG8gb25TeW5jU3RhcnQoKQogICAgICAqIEByZXR1cm4gdGhlIGFjY291bnQKICAgICAgKi8KLSAgICBwdWJsaWMgU3RyaW5nIGdldFN5bmNpbmdBY2NvdW50KCkgeworICAgIHB1YmxpYyBBY2NvdW50IGdldFN5bmNpbmdBY2NvdW50KCkgewogICAgICAgICByZXR1cm4gbVN5bmNpbmdBY2NvdW50OwogICAgIH0KIApAQCAtNTY4LDEyICs2NDYsMTEgQEAKICAgICAgKiBNYWtlIHN1cmUgdGhhdCB0aGVyZSBhcmUgbm8gZW50cmllcyBmb3IgYWNjb3VudHMgdGhhdCBubyBsb25nZXIgZXhpc3QKICAgICAgKiBAcGFyYW0gYWNjb3VudHNBcnJheSB0aGUgYXJyYXkgb2YgY3VycmVudGx5LWV4aXN0aW5nIGFjY291bnRzCiAgICAgICovCi0gICAgcHJvdGVjdGVkIHZvaWQgb25BY2NvdW50c0NoYW5nZWQoU3RyaW5nW10gYWNjb3VudHNBcnJheSkgewotICAgICAgICBNYXA8U3RyaW5nLCBCb29sZWFuPiBhY2NvdW50cyA9IG5ldyBIYXNoTWFwPFN0cmluZywgQm9vbGVhbj4oKTsKLSAgICAgICAgZm9yIChTdHJpbmcgYWNjb3VudCA6IGFjY291bnRzQXJyYXkpIHsKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkFjY291bnRzQ2hhbmdlZChBY2NvdW50W10gYWNjb3VudHNBcnJheSkgeworICAgICAgICBNYXA8QWNjb3VudCwgQm9vbGVhbj4gYWNjb3VudHMgPSBNYXBzLm5ld0hhc2hNYXAoKTsKKyAgICAgICAgZm9yIChBY2NvdW50IGFjY291bnQgOiBhY2NvdW50c0FycmF5KSB7CiAgICAgICAgICAgICBhY2NvdW50cy5wdXQoYWNjb3VudCwgZmFsc2UpOwogICAgICAgICB9Ci0gICAgICAgIGFjY291bnRzLnB1dChTeW5jQ29uc3RWYWx1ZS5OT05fU1lOQ0FCTEVfQUNDT1VOVCwgZmFsc2UpOwogCiAgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiID0gbU9wZW5IZWxwZXIuZ2V0V3JpdGFibGVEYXRhYmFzZSgpOwogICAgICAgICBNYXA8U3RyaW5nLCBTdHJpbmc+IHRhYmxlTWFwID0gZGIuZ2V0U3luY2VkVGFibGVzKCk7CkBAIC01ODUsOCArNjYyLDcgQEAKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIG1TeW5jU3RhdGUub25BY2NvdW50c0NoYW5nZWQoYWNjb3VudHNBcnJheSk7CiAgICAgICAgICAgICBmb3IgKFN0cmluZyB0YWJsZSA6IHRhYmxlcykgewotICAgICAgICAgICAgICAgIGRlbGV0ZVJvd3NGb3JSZW1vdmVkQWNjb3VudHMoYWNjb3VudHMsIHRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgU3luY0NvbnN0VmFsdWUuX1NZTkNfQUNDT1VOVCk7CisgICAgICAgICAgICAgICAgZGVsZXRlUm93c0ZvclJlbW92ZWRBY2NvdW50cyhhY2NvdW50cywgdGFibGUpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CiAgICAgICAgIH0gZmluYWxseSB7CkBAIC02MDEsMjMgKzY3NywyMyBAQAogICAgICAqCiAgICAgICogQHBhcmFtIGFjY291bnRzIGEgbWFwIG9mIGV4aXN0aW5nIGFjY291bnRzCiAgICAgICogQHBhcmFtIHRhYmxlIHRoZSB0YWJsZSB0byBkZWxldGUgZnJvbQotICAgICAqIEBwYXJhbSBhY2NvdW50Q29sdW1uTmFtZSB0aGUgbmFtZSBvZiB0aGUgY29sdW1uIHRoYXQgaXMgZXhwZWN0ZWQKLSAgICAgKiB0byBob2xkIHRoZSBhY2NvdW50LgogICAgICAqLwotICAgIHByb3RlY3RlZCB2b2lkIGRlbGV0ZVJvd3NGb3JSZW1vdmVkQWNjb3VudHMoTWFwPFN0cmluZywgQm9vbGVhbj4gYWNjb3VudHMsCi0gICAgICAgICAgICBTdHJpbmcgdGFibGUsIFN0cmluZyBhY2NvdW50Q29sdW1uTmFtZSkgeworICAgIHByb3RlY3RlZCB2b2lkIGRlbGV0ZVJvd3NGb3JSZW1vdmVkQWNjb3VudHMoTWFwPEFjY291bnQsIEJvb2xlYW4+IGFjY291bnRzLCBTdHJpbmcgdGFibGUpIHsKICAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBtT3BlbkhlbHBlci5nZXRXcml0YWJsZURhdGFiYXNlKCk7CiAgICAgICAgIEN1cnNvciBjID0gZGIucXVlcnkodGFibGUsIHNBY2NvdW50UHJvamVjdGlvbiwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICBhY2NvdW50Q29sdW1uTmFtZSwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgIl9zeW5jX2FjY291bnQsIF9zeW5jX2FjY291bnRfdHlwZSIsIG51bGwsIG51bGwpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIGFjY291bnQgPSBjLmdldFN0cmluZygwKTsKLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoYWNjb3VudCkpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgYWNjb3VudE5hbWUgPSBjLmdldFN0cmluZygwKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgYWNjb3VudFR5cGUgPSBjLmdldFN0cmluZygxKTsKKyAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoYWNjb3VudE5hbWUpKSB7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBBY2NvdW50IGFjY291bnQgPSBuZXcgQWNjb3VudChhY2NvdW50TmFtZSwgYWNjb3VudFR5cGUpOwogICAgICAgICAgICAgICAgIGlmICghYWNjb3VudHMuY29udGFpbnNLZXkoYWNjb3VudCkpIHsKICAgICAgICAgICAgICAgICAgICAgaW50IG51bURlbGV0ZWQ7Ci0gICAgICAgICAgICAgICAgICAgIG51bURlbGV0ZWQgPSBkYi5kZWxldGUodGFibGUsIGFjY291bnRDb2x1bW5OYW1lICsgIj0/IiwgbmV3IFN0cmluZ1tde2FjY291bnR9KTsKKyAgICAgICAgICAgICAgICAgICAgbnVtRGVsZXRlZCA9IGRiLmRlbGV0ZSh0YWJsZSwgIl9zeW5jX2FjY291bnQ9PyBBTkQgX3N5bmNfYWNjb3VudF90eXBlPT8iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXthY2NvdW50Lm5hbWUsIGFjY291bnQudHlwZX0pOwogICAgICAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImRlbGV0ZWQgIiArIG51bURlbGV0ZWQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHJlY29yZHMgZnJvbSB0YWJsZSAiICsgdGFibGUKQEAgLTYzNCw3ICs3MTAsNyBAQAogICAgICAqIENhbGxlZCB3aGVuIHRoZSBzeW5jIHN5c3RlbSBkZXRlcm1pbmVzIHRoYXQgdGhpcyBwcm92aWRlciBzaG91bGQgbm8gbG9uZ2VyCiAgICAgICogY29udGFpb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dGUgc3RhdGljIGZpbmFsIFN0cmluZyBTRUxFQ1RfVU5TWU5DRUQgPQotICAgICAgICAgICAgIigiICsgX1NZTkNfQUNDT1VOVCArICIgSVMgTlVMTCBPUiAiICsgX1NZTkNfQUNDT1VOVCArICI9PykgQU5EICIKLSAgICAgICAgICAgICsgIigiICsgX1NZTkNfSUQgKyAiIElTIE5VTEwgT1IgKCIgKyBfU1lOQ19ESVJUWSArICIgPiAwIEFORCAiCisgICAgICAgICAgICAiKCIgKyBfU1lOQ19BQ0NPVU5UICsgIiBJUyBOVUxMIE9SICgiCisgICAgICAgICAgICAgICAgKyBfU1lOQ19BQ0NPVU5UICsgIj0/IGFuZCAiICsgX1NZTkNfQUNDT1VOVF9UWVBFICsgIj0/KSkgYW5kICIKKyAgICAgICAgICAgICsgIigiICsgX1NZTkNfSUQgKyAiIElTIE5VTEwgT1IgKCIgKyBfU1lOQ19ESVJUWSArICIgPiAwIGFuZCAiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBfU1lOQ19WRVJTSU9OICsgIiBJUyBOT1QgTlVMTCkpIjsKIAogICAgIHB1YmxpYyBBYnN0cmFjdFRhYmxlTWVyZ2VyKFNRTGl0ZURhdGFiYXNlIGRhdGFiYXNlLApAQCAtMTM0LDcgKzEzNyw3IEBACiAgICAgICogY29uc3RydWN0IGEgdGVtcG9yYXJ5IGluc3RhbmNlIHRvIGhvbGQgdGhlbS4KICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBtZXJnZShmaW5hbCBTeW5jQ29udGV4dCBjb250ZXh0LAotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGFjY291bnQsCisgICAgICAgICAgICBmaW5hbCBBY2NvdW50IGFjY291bnQsCiAgICAgICAgICAgICBmaW5hbCBTeW5jYWJsZUNvbnRlbnRQcm92aWRlciBzZXJ2ZXJEaWZmcywKICAgICAgICAgICAgIFRlbXBQcm92aWRlclN5bmNSZXN1bHQgcmVzdWx0LAog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hYmxlKFRBRywgTG9nLlZFUkJPU0UpKSBMb2cudihUQUcsICJwcm9jZXNzaW5nIHNlcnZlciBlbnRyeSAiICsKLSAgICAgICAgICAgICAgICAgICAgZGlmZnNDb3VudCArICIsICIgKyBzZXJ2ZXJTeW5jSWQpOwotCi0gICAgICAgICAgICBpZiAoVFJBQ0UpIHsKLSAgICAgICAgICAgICAgICBpZiAoZGlmZnNDb3VudCA9PSAxMCkgewotICAgICAgICAgICAgICAgICAgICBEZWJ1Zy5zdGFydE1ldGhvZFRyYWNpbmcoImF0bXRyYWNlIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChkaWZmc0NvdW50ID09IDIwKSB7Ci0gICAgICAgICAgICAgICAgICAgIERlYnVnLnN0b3BNZXRob2RUcmFjaW5nKCk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtVGFibGUgKyAiLiIgKyBfU1lOQ19JRCk7CisgICAgICAgICAgICBpZiAobURlbGV0ZWRUYWJsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZGVsZXRlZEN1cnNvciA9IG1EYi5xdWVyeShtRGVsZXRlZFRhYmxlLCBzeW5jSWRBbmRWZXJzaW9uUHJvamVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFNFTEVDVF9NQVJLRUQsIGFjY291bnRTZWxlY3Rpb25BcmdzLCBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbURlbGV0ZWRUYWJsZSArICIuIiArIF9TWU5DX0lEKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZGVsZXRlZEN1cnNvciA9CisgICAgICAgICAgICAgICAgICAgICAgICBtRGIucmF3UXVlcnkoInNlbGVjdCAnYScgYXMgX3N5bmNfaWQsICdiJyBhcyBfc3luY192ZXJzaW9uIGxpbWl0IDAiLCBudWxsKTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgYm9vbGVh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sgc2VydmVyU3luY0lkKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShzZXJ2ZXJTeW5jSWQpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgInNlcnZlciBlbnRyeSBkb2Vzbid0IGhhdmUgYSBzZXJ2ZXJTeW5jSUQiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIEl0IGlzIHBvc3NpYmxlIHRoYXQgdGhlIHN5bmMgYWRhcHRlciB3cm90ZSB0aGUgc2FtZSByZWNvcmQgbXVsdGlwbGUgdGltZXMsCi0gICAgICAgICAgICAvLyBlLmcuIGlmIHRoZSBzYW1lIHJlY29yZCBjYW1lIHZpYSBtdWx0aXBsZSBmZWVkcy4gSWYgdGhpcyBoYXBwZW5zIGp1c3QgaWdub3JlCi0gICAgICAgICAgICAvLyB0aGUgZHVwbGljYXRlIHJlY29yZHMuCi0gICAgICAgICAgICBpZiAoc2VydmVyU3luY0lkLmVxdWFscyhsYXN0U3luY0lkKSkgewotICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJza2lwcGluZyByZWNvcmQgd2l0aCBkdXBsaWNhdGUgcmVtb3RlIHNlcnZlciBpZCAiICsgbGFzdFN5bmNJZCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbGFzdFN5bmNJZCA9IHNlcnZlclN5bmNJZDsKLQotICAgICAgICAgICAgU3RyaW5nIGxvY2FsU3luY0lEID0gbnVsbDsKLSAgICAgICAgICAgIGJvb2xlYW4gbG9jYWxTeW5jRGlydHkgPSBmYWxzZTsKLQotICAgICAgICAgICAgd2hpbGUgKCFsb2NhbEN1cnNvci5pc0FmdGVyTGFzdCgpKSB7CisgICAgICAgICAgICBTdHJpbmcgbGFzdFN5bmNJZCA9IG51bGw7CisgICAgICAgICAgICBpbnQgZGlmZnNDb3VudCA9IDA7CisgICAgICAgICAgICBpbnQgbG9jYWxDb3VudCA9IDA7CisgICAgICAgICAgICBsb2NhbEN1cnNvci5tb3ZlVG9GaXJzdCgpOworICAgICAgICAgICAgZGVsZXRlZEN1cnNvci5tb3ZlVG9GaXJzdCgpOworICAgICAgICAgICAgd2hpbGUgKGRpZmZzQ3Vyc29yLm1vdmVUb05leHQoKSkgewogICAgICAgICAgICAgICAgIGlmIChtSXNNZXJnZUNhbmNlbGxlZCkgewotICAgICAgICAgICAgICAgICAgICBsb2NhbEN1cnNvci5kZWFjdGl2YXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgIGRlbGV0ZWRDdXJzb3IuZGVhY3RpdmF0ZSgpOwotICAgICAgICAgICAgICAgICAgICBkaWZmc0N1cnNvci5kZWFjdGl2YXRlKCk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbG9jYWxDb3VudCsrOwotICAgICAgICAgICAgICAgIGxvY2FsU3luY0lEID0gbG9jYWxDdXJzb3IuZ2V0U3RyaW5nKDIpOworICAgICAgICAgICAgICAgIG1EYi55aWVsZElmQ29udGVuZGVkKCk7CisgICAgICAgICAgICAgICAgU3RyaW5nIHNlcnZlclN5bmNJZCA9IGRpZmZzQ3Vyc29yLmdldFN0cmluZyhzZXJ2ZXJTeW5jSURDb2x1bW4pOworICAgICAgICAgICAgICAgIFN0cmluZyBzZXJ2ZXJTeW5jVmVyc2lvbiA9IGRpZmZzQ3Vyc29yLmdldFN0cmluZyhzZXJ2ZXJTeW5jVmVyc2lvbkNvbHVtbik7CisgICAgICAgICAgICAgICAgbG9uZyBsb2NhbFJvd0lkID0gMDsKKyAgICAgICAgICAgICAgICBTdHJpbmcgbG9jYWxTeW5jVmVyc2lvbiA9IG51bGw7CiAKLSAgICAgICAgICAgICAgICAvLyBJZiB0aGUgbG9jYWwgcmVjb3JkIGRvZXNuJ3QgaGF2ZSBhIF9zeW5jX2lkIHRoZW4KLSAgICAgICAgICAgICAgICAvLyBpdCBpcyBuZXcuIElnbm9yZSBpdCBmb3Igbm93LCB3ZSB3aWxsIHNlbmQgYW4gaW5zZXJ0Ci0gICAgICAgICAgICAgICAgLy8gdGhlIHRoZSBzZXJ2ZXIgbGF0ZXIuCi0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGxvY2FsU3luY0lEKSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImxvY2FsIHJlY29yZCAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxDdXJzb3IuZ2V0TG9uZygxKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaGFzIG5vIF9zeW5jX2lkLCBpZ25vcmluZyIpOworICAgICAgICAgICAgICAgIGRpZmZzQ291bnQrKzsKKyAgICAgICAgICAgICAgICBjb250ZXh0LnNldFN0YXR1c1RleHQoIlByb2Nlc3NpbmcgIiArIGRpZmZzQ291bnQgKyAiLyIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZGlmZnNDdXJzb3IuZ2V0Q291bnQoKSk7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSBMb2cudihUQUcsICJwcm9jZXNzaW5nIHNlcnZlciBlbnRyeSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpZmZzQ291bnQgKyAiLCAiICsgc2VydmVyU3luY0lkKTsKKworICAgICAgICAgICAgICAgIGlmIChUUkFDRSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoZGlmZnNDb3VudCA9PSAxMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgRGVidWcuc3RhcnRNZXRob2RUcmFjaW5nKCJhdG10cmFjZSIpOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGxvY2FsQ3Vyc29yLm1vdmVUb05leHQoKTsKLSAgICAgICAgICAgICAgICAgICAgbG9jYWxTeW5jSUQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBpZiAoZGlmZnNDb3VudCA9PSAyMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgRGVidWcuc3RvcE1ldGhvZFRyYWNpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGJvb2xlYW4gY29uZmxpY3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBib29sZWFuIHVwZGF0ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIGJvb2xlYW4gaW5zZXJ0ID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiZm91bmQgZXZlbnQgd2l0aCBzZXJ2ZXJTeW5jSUQgIiArIHNlcnZlclN5bmNJZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShzZXJ2ZXJTeW5jSWQpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAic2VydmVyIGVudHJ5IGRvZXNuJ3QgaGF2ZSBhIHNlcnZlclN5bmNJRCIpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGludCBjb21wID0gc2VydmVyU3luY0lkLmNvbXBhcmVUbyhsb2NhbFN5bmNJRCk7Ci0KLSAgICAgICAgICAgICAgICAvLyB0aGUgbG9jYWwgREIgaGFzIGEgcmVjb3JkIHRoYXQgdGhlIHNlcnZlciBkb2Vzbid0IGhhdmUKLSAgICAgICAgICAgICAgICBpZiAoY29tcCA+IDApIHsKKyAgICAgICAgICAgICAgICAvLyBJdCBpcyBwb3NzaWJsZSB0aGF0IHRoZSBzeW5jIGFkYXB0ZXIgd3JvdGUgdGhlIHNhbWUgcmVjb3JkIG11bHRpcGxlIHRpbWVzLAorICAgICAgICAgICAgICAgIC8vIGUuZy4gaWYgdGhlIHNhbWUgcmVjb3JkIGNhbWUgdmlhIG11bHRpcGxlIGZlZWRzLiBJZiB0aGlzIGhhcHBlbnMganVzdCBpZ25vcmUKKyAgICAgICAgICAgICAgICAvLyB0aGUgZHVwbGljYXRlIHJlY29yZHMuCisgICAgICAgICAgICAgICAgaWYgKHNlcnZlclN5bmNJZC5lcXVhbHMobGFzdFN5bmNJZCkpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJsb2NhbCByZWNvcmQgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsQ3Vyc29yLmdldExvbmcoMSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGhhcyBfc3luY19pZCAiICsgbG9jYWxTeW5jSUQgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHRoYXQgaXMgPCBzZXJ2ZXIgX3N5bmNfaWQgIiArIHNlcnZlclN5bmNJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJza2lwcGluZyByZWNvcmQgd2l0aCBkdXBsaWNhdGUgcmVtb3RlIHNlcnZlciBpZCAiICsgbGFzdFN5bmNJZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpZmZzQXJlUGFydGlhbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxDdXJzb3IubW92ZVRvTmV4dCgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlUm93KGxvY2FsQ3Vyc29yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVsZXRlZFRhYmxlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGIuZGVsZXRlKG1EZWxldGVkVGFibGUsIF9TWU5DX0lEICsiPT8iLCBuZXcgU3RyaW5nW10ge2xvY2FsU3luY0lEfSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzeW5jUmVzdWx0LnN0YXRzLm51bURlbGV0ZXMrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1EYi55aWVsZElmQ29udGVuZGVkKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbG9jYWxTeW5jSUQgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGFzdFN5bmNJZCA9IHNlcnZlclN5bmNJZDsKIAotICAgICAgICAgICAgICAgIC8vIHRoZSBzZXJ2ZXIgaGFzIGEgcmVjb3JkIHRoYXQgdGhlIGxvY2FsIERCIGRvZXNuJ3QgaGF2ZQotICAgICAgICAgICAgICAgIGlmIChjb21wIDwgMCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImxvY2FsIHJlY29yZCAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxDdXJzb3IuZ2V0TG9uZygxKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaGFzIF9zeW5jX2lkICIgKyBsb2NhbFN5bmNJRCArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgdGhhdCBpcyA+IHNlcnZlciBfc3luY19pZCAiICsgc2VydmVyU3luY0lkKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgbG9jYWxTeW5jSUQgPSBudWxsOworICAgICAgICAgICAgICAgIGJvb2xlYW4gbG9jYWxTeW5jRGlydHkgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIHdoaWxlICghbG9jYWxDdXJzb3IuaXNBZnRlckxhc3QoKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAobUlzTWVyZ2VDYW5jZWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBsb2NhbFN5bmNJRCA9IG51bGw7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBsb2NhbENvdW50Kys7CisgICAgICAgICAgICAgICAgICAgIGxvY2FsU3luY0lEID0gbG9jYWxDdXJzb3IuZ2V0U3RyaW5nKDIpOwogCi0gICAgICAgICAgICAgICAgLy8gdGhlIHNlcnZlciBhbmQgdGhlIGxvY2FsIERCIGJvdGggaGF2ZSB0aGlzIHJlY29yZAotICAgICAgICAgICAgICAgIGlmIChjb21wID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJsb2NhbCByZWNvcmQgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsQ3Vyc29yLmdldExvbmcoMSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGhhcyBfc3luY19pZCAiICsgbG9jYWxTeW5jSUQgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHRoYXQgbWF0Y2hlcyB0aGUgc2VydmVyIF9zeW5jX2lkIik7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbG9jYWxTeW5jRGlydHkgPSBsb2NhbEN1cnNvci5nZXRJbnQoMCkgIT0gMDsKLSAgICAgICAgICAgICAgICAgICAgbG9jYWxSb3dJZCA9IGxvY2FsQ3Vyc29yLmdldExvbmcoMSk7Ci0gICAgICAgICAgICAgICAgICAgIGxvY2FsU3luY1ZlcnNpb24gPSBsb2NhbEN1cnNvci5nZXRTdHJpbmcoMyk7Ci0gICAgICAgICAgICAgICAgICAgIGxvY2FsQ3Vyc29yLm1vdmVUb05leHQoKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gSWYgdGhpcyByZWNvcmQgaXMgaW4gdGhlIGRlbGV0ZWQgdGFibGUgdGhlbiB1cGRhdGUgdGhlIHNlcnZlciB2ZXJzaW9uCi0gICAgICAgICAgICAvLyBpbiB0aGUgZGVsZXRlZCB0YWJsZSwgaWYgbmVjZXNzYXJ5LCBhbmQgdGhlbiBpZ25vcmUgaXQgaGVyZS4KLSAgICAgICAgICAgIC8vIFdlIHdpbGwgc2VuZCBhIGRlbGV0aW9uIGluZGljYXRpb24gdG8gdGhlIHNlcnZlciBkb3duIGEKLSAgICAgICAgICAgIC8vIGxpdHRsZSBmdXJ0aGVyLgotICAgICAgICAgICAgaWYgKGZpbmRJbkN1cnNvcihkZWxldGVkQ3Vyc29yLCBkZWxldGV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hIGxvY2FsIHN5bmMgaWQsICIgKyBsb2NhbFJvd0lkKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbG9jYWxTeW5jSUQgPSBzZXJ2ZXJTeW5jSWQ7Ci0gICAgICAgICAgICAgICAgbG9jYWxTeW5jRGlydHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBsb2NhbFN5bmNWZXJzaW9uID0gbnVsbDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShsb2NhbFN5bmNJRCkpIHsKLSAgICAgICAgICAgICAgICAvLyBBbiBleGlzdGluZyBzZXJ2ZXIgaXRlbSBoYXMgY2hhbmdlZAotICAgICAgICAgICAgICAgIC8vIElmIHNlcnZlclN5bmNWZXJzaW9uIGlzIG51bGwsIHRoZXJlIGlzIG5vIGVkaXQgVVJMOwotICAgICAgICAgICAgICAgIC8vIHNlcnZlciB3b24ndCBsZXQgdGhpcyBjaGFuZ2UgYmUgd3JpdHRlbi4KLSAgICAgICAgICAgICAgICBib29sZWFuIHJlY29yZENoYW5nZWQgPSAobG9jYWxTeW5jVmVyc2lvbiA9PSBudWxsKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgKHNlcnZlclN5bmNWZXJzaW9uID09IG51bGwpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAhc2VydmVyU3luY1ZlcnNpb24uZXF1YWxzKGxvY2FsU3luY1ZlcnNpb24pOwotICAgICAgICAgICAgICAgIGlmIChyZWNvcmRDaGFuZ2VkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChsb2NhbFN5bmNEaXJ0eSkgeworICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgbG9jYWwgcmVjb3JkIGRvZXNuJ3QgaGF2ZSBhIF9zeW5jX2lkIHRoZW4KKyAgICAgICAgICAgICAgICAgICAgLy8gaXQgaXMgbmV3LiBJZ25vcmUgaXQgZm9yIG5vdywgd2Ugd2lsbCBzZW5kIGFuIGluc2VydAorICAgICAgICAgICAgICAgICAgICAvLyB0aGUgdGhlIHNlcnZlciBsYXRlci4KKyAgICAgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGxvY2FsU3luY0lEKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicmVtb3RlIHJlY29yZCAiICsgc2VydmVyU3luY0lkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgY29uZmxpY3RzIHdpdGggbG9jYWwgX3N5bmNfaWQgIiArIGxvY2FsU3luY0lECi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIGxvY2FsIF9pZCAiICsgbG9jYWxSb3dJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAibG9jYWwgcmVjb3JkICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxDdXJzb3IuZ2V0TG9uZygxKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGhhcyBubyBfc3luY19pZCwgaWdub3JpbmciKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZsaWN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsQ3Vyc29yLm1vdmVUb05leHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3luY0lEID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaW50IGNvbXAgPSBzZXJ2ZXJTeW5jSWQuY29tcGFyZVRvKGxvY2FsU3luY0lEKTsKKworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgbG9jYWwgREIgaGFzIGEgcmVjb3JkIHRoYXQgdGhlIHNlcnZlciBkb2Vzbid0IGhhdmUKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXAgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJsb2NhbCByZWNvcmQgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbEN1cnNvci5nZXRMb25nKDEpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaGFzIF9zeW5jX2lkICIgKyBsb2NhbFN5bmNJRCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHRoYXQgaXMgPCBzZXJ2ZXIgX3N5bmNfaWQgIiArIHNlcnZlclN5bmNJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlmZnNBcmVQYXJ0aWFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxDdXJzb3IubW92ZVRvTmV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVSb3cobG9jYWxDdXJzb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVsZXRlZFRhYmxlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURiLmRlbGV0ZShtRGVsZXRlZFRhYmxlLCBfU1lOQ19JRCArIj0/IiwgbmV3IFN0cmluZ1tdIHtsb2NhbFN5bmNJRH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW5jUmVzdWx0LnN0YXRzLm51bURlbGV0ZXMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGIueWllbGRJZkNvbnRlbmRlZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxTeW5jSUQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgc2VydmVyIGhhcyBhIHJlY29yZCB0aGF0IHRoZSBsb2NhbCBEQiBkb2Vzbid0IGhhdmUKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXAgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJsb2NhbCByZWNvcmQgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbEN1cnNvci5nZXRMb25nKDEpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaGFzIF9zeW5jX2lkICIgKyBsb2NhbFN5bmNJRCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHRoYXQgaXMgPiBzZXJ2ZXIgX3N5bmNfaWQgIiArIHNlcnZlclN5bmNJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbFN5bmNJRCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgc2VydmVyIGFuZCB0aGUgbG9jYWwgREIgYm90aCBoYXZlIHRoaXMgcmVjb3JkCisgICAgICAgICAgICAgICAgICAgIGlmIChjb21wID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImxvY2FsIHJlY29yZCAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsQ3Vyc29yLmdldExvbmcoMSkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBoYXMgX3N5bmNfaWQgIiArIGxvY2FsU3luY0lEICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgdGhhdCBtYXRjaGVzIHRoZSBzZXJ2ZXIgX3N5bmNfaWQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3luY0RpcnR5ID0gbG9jYWxDdXJzb3IuZ2V0SW50KDApICE9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbFJvd0lkID0gbG9jYWxDdXJzb3IuZ2V0TG9uZygxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3luY1ZlcnNpb24gPSBsb2NhbEN1cnNvci5nZXRTdHJpbmcoMyk7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbEN1cnNvci5tb3ZlVG9OZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBJZiB0aGlzIHJlY29yZCBpcyBpbiB0aGUgZGVsZXRlZCB0YWJsZSB0aGVuIHVwZGF0ZSB0aGUgc2VydmVyIHZlcnNpb24KKyAgICAgICAgICAgICAgICAvLyBpbiB0aGUgZGVsZXRlZCB0YWJsZSwgaWYgbmVjZXNzYXJ5LCBhbmQgdGhlbiBpZ25vcmUgaXQgaGVyZS4KKyAgICAgICAgICAgICAgICAvLyBXZSB3aWxsIHNlbmQgYSBkZWxldGlvbiBpbmRpY2F0aW9uIHRvIHRoZSBzZXJ2ZXIgZG93biBhCisgICAgICAgICAgICAgICAgLy8gbGl0dGxlIGZ1cnRoZXIuCisgICAgICAgICAgICAgICAgaWYgKGZpbmRJbkN1cnNvcihkZWxldGVkQ3Vyc29yLCBkZWxldGVkU3luY0lEQ29sdW1uLCBzZXJ2ZXJTeW5jSWQpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicmVtb3RlIHJlY29yZCAiICsgc2VydmVyU3luY0lkICsgIiBpcyBpbiB0aGUgZGVsZXRlZCB0YWJsZSIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBkZWxldGVkU3luY1ZlcnNpb24gPSBkZWxldGVkQ3Vyc29yLmdldFN0cmluZyhkZWxldGVkU3luY1ZlcnNpb25Db2x1bW4pOworICAgICAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5lcXVhbHMoZGVsZXRlZFN5bmNWZXJzaW9uLCBzZXJ2ZXJTeW5jVmVyc2lvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInNldHRpbmcgdmVyc2lvbiBvZiBkZWxldGVkIHJlY29yZCAiICsgc2VydmVyU3luY0lkICsgIiB0byAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNlcnZlclN5bmNWZXJzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoX1NZTkNfVkVSU0lPTiwgc2VydmVyU3luY1ZlcnNpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgbURiLnVwZGF0ZShtRGVsZXRlZFRhYmxlLCB2YWx1ZXMsICJfc3luY19pZD0/IiwgbmV3IFN0cmluZ1tde3NlcnZlclN5bmNJZH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIElmIHRoZSBfc3luY19sb2NhbF9pZCBpcyBwcmVzZW50IGluIHRoZSBkaWZmc0N1cnNvcgorICAgICAgICAgICAgICAgIC8vIHRoZW4gdGhpcyByZWNvcmQgY29ycmVzcG9uZHMgdG8gYSBsb2NhbCByZWNvcmQgdGhhdCB3YXMganVzdAorICAgICAgICAgICAgICAgIC8vIGluc2VydGVkIGludG8gdGhlIHNlcnZlciBhbmQgdGhlIF9zeW5jX2xvY2FsX2lkIGlzIHRoZSByb3cgaWQKKyAgICAgICAgICAgICAgICAvLyBvZiB0aGUgbG9jYWwgcmVjb3JkLiBTZXQgdGhlc2UgZmllbGRzIHNvIHRoYXQgdGhlIG5leHQgY2hlY2sKKyAgICAgICAgICAgICAgICAvLyB0cmVhdHMgdGhpcyByZWNvcmQgYXMgYW4gdXBkYXRlLCB3aGljaCB3aWxsIGFsbG93IHRoZQorICAgICAgICAgICAgICAgIC8vIG1lcmdlciB0byB1cGRhdGUgdGhlIHJlY29yZCB3aXRoIHRoZSBzZXJ2ZXIncyBzeW5jIGlkCisgICAgICAgICAgICAgICAgaWYgKCFkaWZmc0N1cnNvci5pc051bGwoc2VydmVyU3luY0xvY2FsSWRDb2x1bW4pKSB7CisgICAgICAgICAgICAgICAgICAgIGxvY2FsUm93SWQgPSBkaWZmc0N1cnNvci5nZXRMb25nKHNlcnZlclN5bmNMb2NhbElkQ29sdW1uKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ0aGUgcmVtb3RlIHJlY29yZCB3aXRoIHN5bmMgaWQgIiArIHNlcnZlclN5bmNJZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgaGFzIGEgbG9jYWwgc3luYyBpZCwgIiArIGxvY2FsUm93SWQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGxvY2FsU3luY0lEID0gc2VydmVyU3luY0lkOworICAgICAgICAgICAgICAgICAgICBsb2NhbFN5bmNEaXJ0eSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBsb2NhbFN5bmNWZXJzaW9uID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGxvY2FsU3luY0lEKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBBbiBleGlzdGluZyBzZXJ2ZXIgaXRlbSBoYXMgY2hhbmdlZAorICAgICAgICAgICAgICAgICAgICAvLyBJZiBzZXJ2ZXJTeW5jVmVyc2lvbiBpcyBudWxsLCB0aGVyZSBpcyBubyBlZGl0IFVSTDsKKyAgICAgICAgICAgICAgICAgICAgLy8gc2VydmVyIHdvbid0IGxldCB0aGlzIGNoYW5nZSBiZSB3cml0dGVuLgorICAgICAgICAgICAgICAgICAgICBib29sZWFuIHJlY29yZENoYW5nZWQgPSAobG9jYWxTeW5jVmVyc2lvbiA9PSBudWxsKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzZXJ2ZXJTeW5jVmVyc2lvbiA9PSBudWxsKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICFzZXJ2ZXJTeW5jVmVyc2lvbi5lcXVhbHMobG9jYWxTeW5jVmVyc2lvbik7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZWNvcmRDaGFuZ2VkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobG9jYWxTeW5jRGlydHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicmVtb3RlIHJlY29yZCAiICsgc2VydmVyU3luY0lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGNvbmZsaWN0cyB3aXRoIGxvY2FsIF9zeW5jX2lkICIgKyBsb2NhbFN5bmNJRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgbG9jYWwgX2lkICIgKyBsb2NhbFJvd0lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmxpY3QgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZW1vdGUgcmVjb3JkICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VydmVyU3luY0lkICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgdXBkYXRlcyBsb2NhbCBfc3luY19pZCAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3luY0lEICsgIiwgbG9jYWwgX2lkICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxSb3dJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVtb3RlIHJlY29yZCAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VydmVyU3luY0lkICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiB1cGRhdGVzIGxvY2FsIF9zeW5jX2lkICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbFN5bmNJRCArICIsIGxvY2FsIF9pZCAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxSb3dJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU2tpcHBpbmcgdXBkYXRlOiBsb2NhbFN5bmNWZXJzaW9uOiAiICsgbG9jYWxTeW5jVmVyc2lvbiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCBzZXJ2ZXJTeW5jVmVyc2lvbjogIiArIHNlcnZlclN5bmNWZXJzaW9uKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyB0aGUgbG9jYWwgZGIgZG9lc24ndCBrbm93IGFib3V0IHRoaXMgcmVjb3JkIHNvIGFkZCBpdAorICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJlbW90ZSByZWNvcmQgIiArIHNlcnZlclN5bmNJZCArICIgaXMgbmV3LCBpbnNlcnRpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnNlcnQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICh1cGRhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdXBkYXRlUm93KGxvY2FsUm93SWQsIHNlcnZlckRpZmZzLCBkaWZmc0N1cnNvcik7CisgICAgICAgICAgICAgICAgICAgIHN5bmNSZXN1bHQuc3RhdHMubnVtVXBkYXRlcysrOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29uZmxpY3QpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZVJvdyhsb2NhbFJvd0lkLCBzZXJ2ZXJTeW5jSWQsIHNlcnZlckRpZmZzLCBkaWZmc0N1cnNvcik7CisgICAgICAgICAgICAgICAgICAgIHN5bmNSZXN1bHQuc3RhdHMubnVtVXBkYXRlcysrOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5zZXJ0KSB7CisgICAgICAgICAgICAgICAgICAgIGluc2VydFJvdyhzZXJ2ZXJEaWZmcywgZGlmZnNDdXJzb3IpOworICAgICAgICAgICAgICAgICAgICBzeW5jUmVzdWx0LnN0YXRzLm51bUluc2VydHMrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgIExvZy52KFRBRywgInByb2Nlc3NlZCAiICsgZGlmZnNDb3VudCArICIgc2VydmVyIGVudHJpZXMiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gSWYgdG9tYnN0b25lcyBhcmVuJ3QgaW4gdXNlIGRlbGV0ZSBhbnkgcmVtYWluaW5nIGxvY2FsIHJvd3MgdGhhdAorICAgICAgICAgICAgLy8gZG9uJ3QgaGF2ZSBjb3JyZXNwb25kaW5nIHNlcnZlciByb3dzLiBLZWVwIHRoZSByb3dzIHRoYXQgZG9uJ3QKKyAgICAgICAgICAgIC8vIGhhdmUgYSBzeW5jIGlkIHNpbmNlIHRob3NlIHdlcmUgY3JlYXRlZCBsb2NhbGx5IGFuZCBoYXZlbid0IGJlZW4KKyAgICAgICAgICAgIC8vIHN5bmNlZCB0byB0aGUgc2VydmVyIHlldC4KKyAgICAgICAgICAgIGlmICghZGlmZnNBcmVQYXJ0aWFsKSB7CisgICAgICAgICAgICAgICAgd2hpbGUgKCFsb2NhbEN1cnNvci5pc0FmdGVyTGFzdCgpICYmICFUZXh0VXRpbHMuaXNFbXB0eShsb2NhbEN1cnNvci5nZXRTdHJpbmcoMikpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtSXNNZXJnZUNhbmNlbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGxvY2FsQ291bnQrKzsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxvY2FsU3luY0lkID0gbG9jYWxDdXJzb3IuZ2V0U3RyaW5nKDIpOwogICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNraXBwaW5nIHVwZGF0ZTogbG9jYWxTeW5jVmVyc2lvbjogIiArIGxvY2FsU3luY1ZlcnNpb24gKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCBzZXJ2ZXJTeW5jVmVyc2lvbjogIiArIHNlcnZlclN5bmNWZXJzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImRlbGV0aW5nIGxvY2FsIHJlY29yZCAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbEN1cnNvci5nZXRMb25nKDEpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIF9zeW5jX2lkICIgKyBsb2NhbFN5bmNJZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZGVsZXRlUm93KGxvY2FsQ3Vyc29yKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWxldGVkVGFibGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbURiLmRlbGV0ZShtRGVsZXRlZFRhYmxlLCBfU1lOQ19JRCArICI9PyIsIG5ldyBTdHJpbmdbXSB7bG9jYWxTeW5jSWR9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzeW5jUmVzdWx0LnN0YXRzLm51bURlbGV0ZXMrKzsKKyAgICAgICAgICAgICAgICAgICAgbURiLnlpZWxkSWZDb250ZW5kZWQoKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIHRoZSBsb2NhbCBkYiBkb2Vzbid0IGtub3cgYWJvdXQgdGhpcyByZWNvcmQgc28gYWRkIGl0Ci0gICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJlbW90ZSByZWNvcmQgIiArIHNlcnZlclN5bmNJZCArICIgaXMgbmV3LCBpbnNlcnRpbmciKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaW5zZXJ0ID0gdHJ1ZTsKICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHVwZGF0ZSkgewotICAgICAgICAgICAgICAgIHVwZGF0ZVJvdyhsb2NhbFJvd0lkLCBzZXJ2ZXJEaWZmcywgZGlmZnNDdXJzb3IpOwotICAgICAgICAgICAgICAgIHN5bmNSZXN1bHQuc3RhdHMubnVtVXBkYXRlcysrOwotICAgICAgICAgICAgfSBlbHNlIGlmIChjb25mbGljdCkgewotICAgICAgICAgICAgICAgIHJlc29sdmVSb3cobG9jYWxSb3dJZCwgc2VydmVyU3luY0lkLCBzZXJ2ZXJEaWZmcywgZGlmZnNDdXJzb3IpOwotICAgICAgICAgICAgICAgIHN5bmNSZXN1bHQuc3RhdHMubnVtVXBkYXRlcysrOwotICAgICAgICAgICAgfSBlbHNlIGlmIChpbnNlcnQpIHsKLSAgICAgICAgICAgICAgICBpbnNlcnRSb3coc2VydmVyRGlmZnMsIGRpZmZzQ3Vyc29yKTsKLSAgICAgICAgICAgICAgICBzeW5jUmVzdWx0LnN0YXRzLm51bUluc2VydHMrKzsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgTG9nLnYoVEFHLCAiY2hlY2tlZCAiICsgbG9jYWxDb3VudCArCisgICAgICAgICAgICAgICAgICAgICIgbG9jYWwgZW50cmllcyIpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGRpZmZzQ3Vyc29yICE9IG51bGwpIGRpZmZzQ3Vyc29yLmNsb3NlKCk7CisgICAgICAgICAgICBpZiAobG9jYWxDdXJzb3IgIT0gbnVsbCkgbG9jYWxDdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgICAgIGlmIChkZWxldGVkQ3Vyc29yICE9IG51bGwpIGRlbGV0ZWRDdXJzb3IuY2xvc2UoKTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZSh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LSAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJkZWxldGluZyBsb2NhbCByZWNvcmQgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbEN1cnNvci5nZXRMb25nKDEpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgX3N5bmNfaWQgIiArIGxvY2FsU3luY0lkKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZGVsZXRlUm93KGxvY2FsQ3Vyc29yKTsKLSAgICAgICAgICAgICAgICBpZiAobURlbGV0ZWRUYWJsZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EYi5kZWxldGUobURlbGV0ZWRUYWJsZSwgX1NZTkNfSUQgKyAiPT8iLCBuZXcgU3RyaW5nW10ge2xvY2FsU3luY0lkfSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHN5bmNSZXN1bHQuc3RhdHMubnVtRGVsZXRlcysrOwotICAgICAgICAgICAgICAgIG1EYi55aWVsZElmQ29udGVuZGVkKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIExvZy52KFRBRywgImNoZWNrZWQgIiArIGxvY2FsQ291bnQgKwotICAgICAgICAgICAgICAgICIgbG9jYWwgZW50cmllcyIpOwotICAgICAgICBkaWZmc0N1cnNvci5kZWFjdGl2YXRlKCk7Ci0gICAgICAgIGxvY2FsQ3Vyc29yLmRlYWN0aXZhdGUoKTsKLSAgICAgICAgZGVsZXRlZEN1cnNvci5kZWFjdGl2YXRlKCk7CiAKICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSBMb2cudihUQUcsICJhcHBseWluZyBkZWxldGlvbnMgZnJvbSB0aGUgc2VydmVyIik7CiAKICAgICAgICAgLy8gQXBwbHkgZGVsZXRpb25zIGZyb20gdGhlIHNlcnZlcgogICAgICAgICBpZiAobURlbGV0ZWRUYWJsZVVSTCAhPSBudWxsKSB7CiAgICAgICAgICAgICBkaWZmc0N1cnNvciA9IHNlcnZlckRpZmZzLnF1ZXJ5KG1EZWxldGVkVGFibGVVUkwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpOwotCi0gICAgICAgICAgICB3aGlsZSAoZGlmZnNDdXJzb3IubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Jc01lcmdlQ2FuY2VsbGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRpZmZzQ3Vyc29yLmRlYWN0aXZhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICB3aGlsZSAoZGlmZnNDdXJzb3IubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtSXNNZXJnZUNhbmNlbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIGRlbGV0ZSBhbGwgcm93cyB0aGF0IG1hdGNoIGVhY2ggZWxlbWVudCBpbiB0aGUgZGlmZnNDdXJzb3IKKyAgICAgICAgICAgICAgICAgICAgZnVsbHlEZWxldGVNYXRjaGluZ1Jvd3MoZGlmZnNDdXJzb3IsIGFjY291bnQsIHN5bmNSZXN1bHQpOworICAgICAgICAgICAgICAgICAgICBtRGIueWllbGRJZkNvbnRlbmRlZCgpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvLyBkZWxldGUgYWxsIHJvd3MgdGhhdCBtYXRjaCBlYWNoIGVsZ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5KG1UYWJsZSwgbmV3IFN0cmluZ1tde0Jhc2VDb2x1bW5zLl9JRH0sIFNFTEVDVF9CWV9TWU5DX0lEX0FORF9BQ0NPVU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uQXJncywgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCBzZXJ2ZXJTeW5jTG9jYWxJZENvbHVtbiA9IGRpZmZzQ3Vyc29yLmdldENvbHVtbkluZGV4T3JUaHJvdyhfU1lOQ19MT0NBTF9JRCk7CisgICAgICAgICAgICAgICAgc2VsZWN0aW9uQXJncyA9IG5ldyBTdHJpbmdbXXtkaWZmc0N1cnNvci5nZXRTdHJpbmcoc2VydmVyU3luY0xvY2FsSWRDb2x1bW4pfTsKKyAgICAgICAgICAgICAgICBjID0gbURiLnF1ZXJ5KG1UYWJsZSwgbmV3IFN0cmluZ1tde0Jhc2VDb2x1bW5zLl9JRH0sIFNFTEVDVF9CWV9JRCwgc2VsZWN0aW9uQXJncywKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgYy5tb3ZlVG9GaXJzdCgpOwogICAgICAgICAgICAgd2hpbGUgKCFjLmlzQWZ0ZXJMYXN0KCkpIHsKICAgICAgICAgICAgICAgICBkZWxldGVSb3coYyk7IC8vIGFkdmFuY2VzIHRoZSBjdXJzb3IKICAgICAgICAgICAgICAgICBzeW5jUmVzdWx0LnN0YXRzLm51bURlbGV0ZXMrKzsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGMuZGVhY3RpdmF0ZSgpOworICAgICAgICAgIGlmIChjICE9IG51bGwpIGMuY2xvc2UoKTsKICAgICAgICAgfQogICAgICAgICBpZiAoZGVsZXRlQnlTeW5jSWQgJiYgbURlbGV0ZWRUYWJsZSAhPSBudWxsKSB7CiAg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cnkobVRhYmxlLCBudWxsLCBTRUxFQ1RfVU5TWU5DRUQsIGFjY291bnRTZWxlY3Rpb25BcmdzLAogICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwpOwotICAgICAgICBsb25nIG51bUluc2VydHNPclVwZGF0ZXMgPSBsb2NhbENoYW5nZXNDdXJzb3IuZ2V0Q291bnQoKTsKLSAgICAgICAgd2hpbGUgKGxvY2FsQ2hhbmdlc0N1cnNvci5tb3ZlVG9OZXh0KCkpIHsKLSAgICAgICAgICAgIGlmIChtSXNNZXJnZUNhbmNlbGxlZCkgewotICAgICAgICAgICAgICAgIGxvY2FsQ2hhbmdlc0N1cnNvci5jbG9zZSgpOwotICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG51bUluc2VydHNPclVwZGF0ZXMgPSBsb2NhbENoYW5nZXNDdXJzb3IuZ2V0Q291bnQoKTsKKyAgICAgICAgICAgIHdoaWxlIChsb2NhbENoYW5nZXNDdXJzb3IubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Jc01lcmdlQ2FuY2VsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGNsaWVudERpZmZzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgY2xpZW50RGlmZnMgPSB0ZW1wb3JhcnlJbnN0YW5jZUZhY3RvcnkuZ2V0VGVtcG9yYXJ5SW5zdGFuY2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVZhbHVlcy5jbGVhcigpOworICAgICAgICAgICAgICAgIGN1cnNvclJvd1RvQ29udGVudFZhbHVlcyhsb2NhbENoYW5nZXNDdXJzb3IsIG1WYWx1ZXMpOworICAgICAgICAgICAgICAgIG1WYWx1ZXMucmVtb3ZlKCJfaWQiKTsKKyAgICAgICAgICAgICAgICBEYXRhYm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nLnYoVEFHLCAiZ2VuZXJhdGluZyBjbGllbnQgZGVsZXRpb25zIik7CkBAIC01NjQsMjMgKzU2OCwyNSBAQAogICAgICAgICBpZiAobURlbGV0ZWRUYWJsZSAhPSBudWxsKSB7CiAgICAgICAgICAgICBDdXJzb3IgZGVsZXRlZEN1cnNvciA9IG1EYi5xdWVyeShtRGVsZXRlZFRhYmxlLAogICAgICAgICAgICAgICAgICAgICBzeW5jSWRBbmRWZXJzaW9uUHJvamVjdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgX1NZTkNfQUNDT1VOVCArICI9PyBBTkQgIiArIF9TWU5DX0lEICsgIiBJUyBOT1QgTlVMTCIsIGFjY291bnRTZWxlY3Rpb25BcmdzLAorICAgICAgICAgICAgICAgICAgICBfU1lOQ19BQ0NPVU5UICsgIj0/IEFORCAiICsgX1NZTkNfQUNDT1VOVF9UWVBFICsgIj0/IEFORCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBfU1lOQ19JRCArICIgSVMgTk9UIE5VTEwiLCBhY2NvdW50U2VsZWN0aW9uQXJncywKICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbURlbGV0ZWRUYWJsZSArICIuIiArIF9TWU5DX0lEKTsKLQotICAgICAgICAgICAgbnVtRGVsZXRlZEVudHJpZXMgPSBkZWxldGVkQ3Vyc29yLmdldENvdW50KCk7Ci0gICAgICAgICAgICB3aGlsZSAoZGVsZXRlZEN1cnNvci5tb3ZlVG9OZXh0KCkpIHsKLSAgICAgICAgICAgICAgICBpZiAobUlzTWVyZ2VDYW5jZWxsZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgZGVsZXRlZEN1cnNvci5jbG9zZSgpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG51bURlbGV0ZWRFbnRyaWVzID0gZGVsZXRlZEN1cnNvci5nZXRDb3VudCgpOworICAgICAgICAgICAgICAgIHdoaWxlIChkZWxldGVkQ3Vyc29yLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAobUlzTWVyZ2VDYW5jZWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoY2xpZW50RGlmZnMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50RGlmZnMgPSB0ZW1wb3JhcnlJbnN0YW5jZUZhY3RvcnkuZ2V0VGVtcG9yYXJ5SW5zdGFuY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtVmFsdWVzLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yUm93VG9Db250ZW50VmFsdWVzKGRlbGV0ZWRDdXJzb3IsIG1WYWx1ZXMpOworICAgICAgICAgICAgICAgICAgICBjbGllbnREaWZmcy5pbnNlcnQobURlbGV0ZWRUYWJsZVVSTCwgbVZhbHVlcyk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChjbGllbnREaWZmcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNsaWVudERpZmZzID0gdGVtcG9yYXJ5SW5zdGFuY2VGYWN0b3J5LmdldFRlbXBvcmFyeUluc3RhbmNlKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1WYWx1ZXMuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclJvd1RvQ29udGVudFZhbHVlcyhkZWxldGVkQ3Vyc29yLCBtVmFsdWVzKTsKLSAgICAgICAgICAgICAgICBjbGllbnREaWZmcy5pbnNlcnQobURlbGV0ZWRUYWJsZVVSTCwgbVZhbHVlcyk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGRlbG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5bmNTdGFydHMgPSBuZXcgQXRvbWljSW50ZWdlcigwKTsKKyAgICAgICAgbVN5bmNUaHJlYWQgPSBudWxsOworICAgICAgICBtQXV0b0luaXRpYWxpemUgPSBhdXRvSW5pdGlhbGl6ZTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ29udGV4dCBnZXRDb250ZXh0KCkgeworICAgICAgICByZXR1cm4gbUNvbnRleHQ7CisgICAgfQorCisgICAgY2xhc3MgSVN5bmNBZGFwdGVySW1wbCBleHRlbmRzIElTeW5jQWRhcHRlci5TdHViIHsKKyAgICAgICAgcHVibGljIHZvaWQgc3RhcnRTeW5jKElTeW5jQ29udGV4dCBzeW5jQ29udGV4dCwgU3RyaW5nIGF1dGhvcml0eSwgQWNjb3VudCBhY2NvdW50LAorICAgICAgICAgICAgICAgIEJ1bmRsZSBleHRyYXMpIHsKKyAgICAgICAgICAgIGZpbmFsIFN5bmNDb250ZXh0IHN5bmNDb250ZXh0Q2xpZW50ID0gbmV3IFN5bmNDb250ZXh0KHN5bmNDb250ZXh0KTsKKworICAgICAgICAgICAgYm9vbGVhbiBhbHJlYWR5SW5Qcm9ncmVzczsKKyAgICAgICAgICAgIC8vIHN5bmNocm9uaXplIHRvIG1ha2Ugc3VyZSB0aGF0IG1TeW5jVGhyZWFkIGRvZXNuJ3QgY2hhbmdlIGJldHdlZW4gd2hlbiB3ZQorICAgICAgICAgICAgLy8gY2hlY2sgaXQgYW5kIHdoZW4gd2UgdXNlIGl0CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jVGhyZWFkTG9jaykgeworICAgICAgICAgICAgICAgIGlmIChtU3luY1RocmVhZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQXV0b0luaXRpYWxpemUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBleHRyYXMgIT0gbnVsbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGV4dHJhcy5nZXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19JTklUSUFMSVpFLCBmYWxzZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChDb250ZW50UmVzb2x2ZXIuZ2V0SXNTeW5jYWJsZShhY2NvdW50LCBhdXRob3JpdHkpIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlci5zZXRJc1N5bmNhYmxlKGFjY291bnQsIGF1dGhvcml0eSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzeW5jQ29udGV4dENsaWVudC5vbkZpbmlzaGVkKG5ldyBTeW5jUmVzdWx0KCkpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1TeW5jVGhyZWFkID0gbmV3IFN5bmNUaHJlYWQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlN5bmNBZGFwdGVyVGhyZWFkLSIgKyBtTnVtU3luY1N0YXJ0cy5pbmNyZW1lbnRBbmRHZXQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW5jQ29udGV4dENsaWVudCwgYXV0aG9yaXR5LCBhY2NvdW50LCBleHRyYXMpOworICAgICAgICAgICAgICAgICAgICBtU3luY1RocmVhZC5zdGFydCgpOworICAgICAgICAgICAgICAgICAgICBhbHJlYWR5SW5Qcm9ncmVzcyA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGFscmVhZHlJblByb2dyZXNzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGRvIHRoaXMgb3V0c2lkZSBzaW5jZSB3ZSBkb24ndCB3YW50IHRvIGNhbGwgYmFjayBpbnRvIHRoZSBzeW5jQ29udGV4dCB3aGlsZQorICAgICAgICAgICAgLy8gaG9sZGluZyB0aGUgc3luY2hyb25pemF0aW9uIGxvY2sKKyAgICAgICAgICAgIGlmIChhbHJlYWR5SW5Qcm9ncmVzcykgeworICAgICAgICAgICAgICAgIHN5bmNDb250ZXh0Q2xpZW50Lm9uRmluaXNoZWQoU3luY1Jlc3VsdC5BTFJFQURZX0lOX1BST0dSRVNTKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGNhbmNlbFN5bmMoSVN5bmNDb250ZXh0IHN5bmNDb250ZXh0KSB7CisgICAgICAgICAgICAvLyBzeW5jaHJvbml6ZSB0byBtYWtlIHN1cmUgdGhhdCBtU3luY1RocmVhZCBkb2Vzbid0IGNoYW5nZSBiZXR3ZWVuIHdoZW4gd2UKKyAgICAgICAgICAgIC8vIGNoZWNrIGl0IGFuZCB3aGVuIHdlIHVzZSBpdAorICAgICAgICAgICAgc3luY2hyb25pemVkIChtU3luY1RocmVhZExvY2spIHsKKyAgICAgICAgICAgICAgICBpZiAobVN5bmNUaHJlYWQgIT0gbnVsbAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgbVN5bmNUaHJlYWQubVN5bmNDb250ZXh0LmdldElTeW5jQ29udGV4dCgpLmFzQmluZGVyKCkKKyAgICAgICAgICAgICAgICAgICAgICAgID09IHN5bmNDb250ZXh0LmFzQmluZGVyKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbVN5bmNUaHJlYWQuaW50ZXJydXB0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIHRocmVhZCB0aGF0IGludm9rZXMgcGVyZm9ybVN5bmMoKS4gSXQgYWxzbyBhY3F1aXJlcyB0aGUgcHJvdmlkZXIgZm9yIHRoaXMgc3luYworICAgICAqIGJlZm9yZSBjYWxsaW5nIHBlcmZvcm1TeW5jIGFuZCByZWxlYXNlcyBpdCBhZnRlcndhcmRzLiBDYW5jZWwgdGhpcyB0aHJlYWQgaW4gb3JkZXIgdG8KKyAgICAgKiBjYW5jZWwgdGhlIHN5bmMuCisgICAgICovCisgICAgcHJpdmF0ZSBjbGFzcyBTeW5jVGhyZWFkIGV4dGVuZHMgVGhyZWFkIHsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBTeW5jQ29udGV4dCBtU3luY0NvbnRleHQ7CisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1BdXRob3JpdHk7CisgICAgICAgIHByaXZhdGUgZmluYWwgQWNjb3VudCBtQWNjb3VudDsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBCdW5kbGUgbUV4dHJhczsKKyAgICAgICAgcHJpdmF0ZSBsb25nIG1Jbml0aWFsVHhCeXRlczsKKyAgICAgICAgcHJpdmF0ZSBsb25nIG1Jbml0aWFsUnhCeXRlczsKKworICAgICAgICBwcml2YXRlIFN5bmNUaHJlYWQoU3RyaW5nIG5hbWUsIFN5bmNDb250ZXh0IHN5bmNDb250ZXh0LCBTdHJpbmcgYXV0aG9yaXR5LAorICAgICAgICAgICAgICAgIEFjY291bnQgYWNjb3VudCwgQnVuZGxlIGV4dHJhcykgeworICAgICAgICAgICAgc3VwZXIobmFtZSk7CisgICAgICAgICAgICBtU3luY0NvbnRleHQgPSBzeW5jQ29udGV4dDsKKyAgICAgICAgICAgIG1BdXRob3JpdHkgPSBhdXRob3JpdHk7CisgICAgICAgICAgICBtQWNjb3VudCA9IGFjY291bnQ7CisgICAgICAgICAgICBtRXh0cmFzID0gZXh0cmFzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgUHJvY2Vzcy5zZXRUaHJlYWRQcmlvcml0eShQcm9jZXNzLlRIUkVBRF9QUklPUklUWV9CQUNLR1JPVU5EKTsKKworICAgICAgICAgICAgaWYgKGlzQ2FuY2VsZWQoKSkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3luY1Jlc3VsdCBzeW5jUmVzdWx0ID0gbmV3IFN5bmNSZXN1bHQoKTsKKyAgICAgICAgICAgIGludCB1aWQgPSBQcm9jZXNzLm15VWlkKCk7CisgICAgICAgICAgICBtSW5pdGlhbFR4Qnl0ZXMgPSBOZXRTdGF0LmdldFVpZFR4Qnl0ZXModWlkKTsKKyAgICAgICAgICAgIG1Jbml0aWFsUnhCeXRlcyA9IE5ldFN0YXQuZ2V0VWlkUnhCeXRlcyh1aWQpOworICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyQ2xpZW50IHByb3ZpZGVyID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcHJvdmlkZXIgPSBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5hY3F1aXJlQ29udGVudFByb3ZpZGVyQ2xpZW50KG1BdXRob3JpdHkpOworICAgICAgICAgICAgICAgIGlmIChwcm92aWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIEFic3RyYWN0VGhyZWFkZWRTeW5jQWRhcHRlci50aGlzLnBlcmZvcm1TeW5jKG1BY2NvdW50LCBtRXh0cmFzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdXRob3JpdHksIHByb3ZpZGVyLCBzeW5jUmVzdWx0KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBUT0RPKGZyZWRxKSB1cGRhdGUgdGhlIHN5bmNSZXN1bHRzIHRvIGluZGljYXRlIHRoYXQgd2Ugd2VyZSB1bmFibGUgdG8KKyAgICAgICAgICAgICAgICAgICAgLy8gZmluZCB0aGUgcHJvdmlkZXIuIG1heWJlIHdpdGggYSBQcm92aWRlckVycm9yPworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgaWYgKHByb3ZpZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcHJvdmlkZXIucmVsZWFzZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIWlzQ2FuY2VsZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBtU3luY0NvbnRleHQub25GaW5pc2hlZChzeW5jUmVzdWx0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbG9nU3luY0RldGFpbHMoTmV0U3RhdC5nZXRVaWRUeEJ5dGVzKHVpZCkgLSBtSW5pdGlhbFR4Qnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICBOZXRTdGF0LmdldFVpZFJ4Qnl0ZXModWlkKSAtIG1Jbml0aWFsUnhCeXRlcywgc3luY1Jlc3VsdCk7CisgICAgICAgICAgICAgICAgLy8gc3luY2hyb25pemUgc28gdGhhdCB0aGUgYXNzaWdubWVudCB3aWxsIGJlIHNlZW4gYnkgb3RoZXIgdGhyZWFkcworICAgICAgICAgICAgICAgIC8vIHRoYXQgYWxzbyBzeW5jaHJvbml6ZSBhY2Nlc3NlcyB0byBtU3luY1RocmVhZAorICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmNUaHJlYWRMb2NrKSB7CisgICAgICAgICAgICAgICAgICAgIG1TeW5jVGhyZWFkID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIGJvb2xlYW4gaXNDYW5jZWxlZCgpIHsKKyAgICAgICAgICAgIHJldHVybiBUaHJlYWQuY3VycmVudFRocmVhZCgpLmlzSW50ZXJydXB0ZWQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gYSByZWZlcmVuY2UgdG8gdGhlIElTeW5jQWRhcHRlciBpbnRlcmZhY2UgaW50byB0aGlzIFN5bmNBZGFwdGVyIGltcGxlbWVudGF0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCBJU3luY0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UVSWV9FTlRJVElFUyA9IDU7CisKICAgICAvKiBwYWNrYWdlICovIGZpbmFsIFdlYWtSZWZlcmVuY2U8Q29udGVudFJlc29sdmVyPiBtUmVzb2x2ZXI7CiAKICAgICBwcml2YXRlIHN0YXRpYyBMb29wZXIgc0xvb3BlciA9IG51bGw7CkBAIC04NSwxMiArODYsMjUgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3IuZ2V0Q291bnQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgZS50b1N0cmluZygpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvciA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICBhcmdzLnJlc3VsdCA9IGN1cnNvcjsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX0FSR19RVUVSWV9FTlRJVElFUzoKKyAgICAgICAgICAgICAgICAgICAgRW50aXR5SXRlcmF0b3IgaXRlcmF0b3IgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaXRlcmF0b3IgPSByZXNvbHZlci5xdWVyeUVudGl0aWVzKGFyZ3MudXJpLCBhcmdzLnNlbGVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJncy5zZWxlY3Rpb25BcmdzLCBhcmdzLm9yZGVyQnkpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCBlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgYXJncy5yZXN1bHQgPSBpdGVyYXRvcjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX0FSR19JTlNFUlQ6CiAgICAgICAgICAgICAgICAgICAgIGFyZ3MucmVzdWx0ID0gcmVzb2x2ZXIuaW5zZXJ0KGFyZ3MudXJpLCBhcmdzLnZhbHVlcyk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTAzLDcgKzExNyw2IEBACiAgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9BUkdfREVMRVRFOgogICAgICAgICAgICAgICAgICAgICBhcmdzLnJlc3VsdCA9IHJlc29sdmVyLmRlbGV0ZShhcmdzLnVyaSwgYXJncy5zZWxlY3Rpb24sIGFyZ3Muc2VsZWN0aW9uQXJncyk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIC8vIHBhc3NpbmcgdGhlIG9yaWdpbmFsIHRva2VuIHZhbHVlIGJhY2sgdG8gdGhlIGNhbGxlcgpAQCAtMTI4LDcgKzE0MSw3IEBACiAgICAgICAgICAgICBpZiAoc0xvb3BlciA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgSGFuZGxlclRocmVhZCB0aHJlYWQgPSBuZXcgSGFuZGxlclRocmVhZCgiQXN5bmNRdWVyeVdvcmtlciIpOwogICAgICAgICAgICAgICAgIHRocmVhZC5zdGFydCgpOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgc0xvb3BlciA9IHRocmVhZC5nZXRMb29wZXIoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMTgyLDYgKzE5NSw0NCBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIFRoaXMgbWV0aG9kIGJlZ2lucyBhbiBhc3luY2hyb25vdXMgcXVlcnkgZm9yIGFuIHtAbGluayBFbnRpdHlJdGVyYXRvcn0uCisgICAgICogV2hlbiB0aGUgcXVlc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IChDdXJzb3IpIGFyZ3MucmVzdWx0KTsKICAgICAgICAgICAgICAgICBicmVhazsKIAorICAgICAgICAgICAgY2FzZSBFVkVOVF9BUkdfUVVFUllfRU5USVRJRVM6CisgICAgICAgICAgICAgICAgb25RdWVyeUVudGl0aWVzQ29tcGxldGUodG9rZW4sIGFyZ3MuY29va2llLCAoRW50aXR5SXRlcmF0b3IpYXJncy5yZXN1bHQpOworICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICBjYXNlIEVWRU5UX0FSR19JTlNFUlQ6CiAgICAgICAgICAgICAgICAgb25JbnNlcnRDb21wbGV0ZSh0b2tlbiwgYXJncy5jb29raWUsIChVcmkpIGFyZ3MucmVzdWx0KTsKICAgICAgICAgICAgICAgICBicmVhazsKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvQ29udGVudFByb3ZpZGVyLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L0NvbnRlbnRQcm92aWRlci5qYXZhCmluZGV4IDZiNTA0MDUuLjViMjliOTcgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvQ29udGVudFByb3ZpZGVyLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9Db250ZW50UHJvdmlkZXIuamF2YQpAQCAtMzQsNiArMzQsNyBAQAogCiBpbXBvcnQgamF2YS5pby5GaWxlOwogaW1wb3J0IGphdmEuaW8uRmlsZU5vdEZvdW5kRXhjZXB0aW9uOworaW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CiAKIC8qKgogICogQ29udGVudCBwcm92aWRlcnMgYXJlIG9uZSBvZiB0aGUgcHJpbWFyeSBidWlsZGluZyBibG9ja3Mgb2YgQW5kcm9pZCBhcHBsaWNhdGlvbnMsIHByb3ZpZGluZwpAQCAtMTMwLDYgKzEzMSwxMiBAQAogICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25BcmdzLCBzb3J0T3JkZXIpOwogICAgICAgICB9CiAKKyAgICAgICAgcHVibGljIEVudGl0eUl0ZXJhdG9yIHF1ZXJ5RW50aXRpZXMoVXJpIHVyaSwgU3RyaW5nIHNlbGVjdGlvbiwgU3RyaW5nW10gc2VsZWN0aW9uQXJncywKKyAgICAgICAgICAgICAgICBTdHJpbmcgc29ydE9yZGVyKSB7CisgICAgICAgICAgICBlbmZvcmNlUmVhZFBlcm1pc3Npb24odXJpKTsKKyAgICAgICAgICAgIHJldHVybiBDb250ZW50UHJvdmlkZXIudGhpcy5xdWVyeUVudGl0aWVzKHVyaSwgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzLCBzb3J0T3JkZXIpOworICAgICAgICB9CisKICAgICAgICAgcHVibGljIFN0cmluZyBnZXRUeXBlKFVyaSB1cmkpIHsKICAgICAgICAgICAgIHJldHVybiBDb250ZW50UHJvdmlkZXIudGhpcy5nZXRUeXBlKHVyaSk7CiAgICAgICAgIH0KQEAgLTE0NSw2ICsxNTIsMjUgQEAKICAgICAgICAgICAgIHJldHVybiBDb250ZW50UHJvdmlkZXIudGhpcy5idWxrSW5zZXJ0KHVyaSwgaW5pdGlhbFZhbHVlcyk7CiAgICAgICAgIH0KIAorICAgICAgICBwdWJsaWMgVXJpIGluc2VydEVudGl0eShVcmkgdXJpLCBFbnRpdHkgZW50aXRpZXMpIHsKKyAgICAgICAgICAgIGVuZm9yY2VXcml0ZVBlcm1pc3Npb24odXJpKTsKKyAgICAgICAgICAgIHJldHVybiBDb250ZW50UHJvdmlkZXIudGhpcy5pbnNlcnRFbnRpdHkodXJpLCBlbnRpdGllcyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQ29udGVudFByb3ZpZGVyUmVzdWx0W10gYXBwbHlCYXRjaChBcnJheUxpc3Q8Q29udGVudFByb3ZpZGVyT3BlcmF0aW9uPiBvcGVyYXRpb25zKQorICAgICAgICAgICAgICAgIHRocm93cyBPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbiB7CisgICAgICAgICAgICBmb3IgKENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiBvcGVyYXRpb24gOiBvcGVyYXRpb25zKSB7CisgICAgICAgICAgICAgICAgaWYgKG9wZXJhdGlvbi5pc1JlYWRPcGVyYXRpb24oKSkgeworICAgICAgICAgICAgICAgICAgICBlbmZvcmNlUmVhZFBlcm1pc3Npb24ob3BlcmF0aW9uLmdldFVyaSgpKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAob3BlcmF0aW9uLmlzV3JpdGVPcGVyYXRpb24oKSkgeworICAgICAgICAgICAgICAgICAgICBlbmZvcmNlV3JpdGVQZXJtaXNzaW9uKG9wZXJhdGlvbi5nZXRVcmkoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIENvbnRlbnRQcm92aWRlci50aGlzLmFwcGx5QmF0Y2gob3BlcmF0aW9ucyk7CisgICAgICAgIH0KKwogICAgICAgICBwdWJsaWMgaW50IGRlbGV0ZShVcmkgdXJpLCBTdHJpbmcgc2VsZWN0aW9uLCBTdHJpbmdbXSBzZWxlY3Rpb25BcmdzKSB7CiAgICAgICAgICAgICBlbmZvcmNlV3JpdGVQZXJtaXNzaW9uKHVyaSk7CiAgICAgICAgICAgICByZXR1cm4gQ29udGVudFByb3ZpZGVyLnRoaXMuZGVsZXRlKHVyaSwgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzKTsKQEAgLTE1Niw2ICsxODIsMTEgQEAKICAgICAgICAgICAgIHJldHVybiBDb250ZW50UHJvdmlkZXIudGhpcy51cGRhdGUodXJpLCB2YWx1ZXMsIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncyk7CiAgICAgICAgIH0KIAorICAgICAgICBwdWJsaWMgaW50IHVwZGF0ZUVudGl0eShVcmkgdXJpLCBFbnRpdHkgZW50aXR5KSB7CisgICAgICAgICAgICBlbmZvcmNlV3JpdGVQZXJtaXNzaW9uKHVyaSk7CisgICAgICAgICAgICByZXR1cm4gQ29udGVudFByb3ZpZGVyLnRoaXMudXBkYXRlRW50aXR5KHVyaSwgZW50aXR5KTsKKyAgICAgICAgfQorCiAgICAgICAgIHB1YmxpYyBQYXJjZWxGaWxlRGVzY3JpcHRvciBvcGVuRmlsZShVcmkgdXJpLCBTdHJpbmcgbW9kZSkKICAgICAgICAgICAgICAgICB0aHJvd3MgRmlsZU5vdEZvdW5kRXhjZXB0aW9uIHsKICAgICAgICAgICAgIGlmIChtb2RlICE9IG51bGwgJiYgbW9kZS5zdGFydHNXaXRoKCJydyIpKSBlbmZvcmNlV3JpdGVQZXJtaXNzaW9uKHVyaSk7CkBAIC0xNzAsMTIgKzIwMSw2IEBACiAgICAgICAgICAgICByZXR1cm4gQ29udGVudFByb3ZpZGVyLnRoaXMub3BlbkFzc2V0RmlsZSh1cmksIG1vZGUpOwogICAgICAgICB9CiAKLSAgICAgICAgcHVibGljIElTeW5jQWRhcHRlciBnZXRTeW5jQWRhcHRlcigpIHsKLSAgICAgICAgICAgIGVuZm9yY2VXcml0ZVBlcm1pc3Npb24obnVsbCk7Ci0gICAgICAgICAgICBTeW5jQWRhcHRlciBzYSA9IENvbnRlbnRQcm92aWRlci50aGlzLmdldFN5bmNBZGFwdGVyKCk7Ci0gICAgICAgICAgICByZXR1cm4gc2EgIT0gbnVsbCA/IHNhLmdldElTeW5jQWRhcHRlcigpIDogbnVsbDsKLSAgICAgICAgfQotCiAgICAgICAgIHByaXZhdGUgdm9pZCBlbmZvcmNlUmVhZFBlcm1pc3Npb24oVXJpIHVyaSkgewogICAgICAgICAgICAgZmluYWwgaW50IHVpZCA9IEJpbmRlci5nZXRDYWxsaW5nVWlkKCk7CiAgICAgICAgICAgICBpZiAodWlkID09IG1NeVVpZCkgewpAQCAtMzc3LDkgKzQwMiwxMCBAQAogICAgICAqIEV4YW1wbGUgY2xpZW50IGNhbGw6PHA+CiAgICA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pIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICByZXR1cm4gbUNvbnRlbnRQcm92aWRlci5xdWVyeSh1cmwsIHByb2plY3Rpb24sIHNlbGVjdGlvbiwgIHNlbGVjdGlvbkFyZ3MsIHNvcnRPcmRlcik7CisgICAgfQorCisgICAgLyoqIHNlZSB7QGxpbmsgQ29udGVudFByb3ZpZGVyI2dldFR5cGV9ICovCisgICAgcHVibGljIFN0cmluZyBnZXRUeXBlKFVyaSB1cmwpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICByZXR1cm4gbUNvbnRlbnRQcm92aWRlci5nZXRUeXBlKHVybCk7CisgICAgfQorCisgICAgLyoqIHNlZSB7QGxpbmsgQ29udGVudFByb3ZpZGVyI2luc2VydH0gKi8KKyAgICBwdWJsaWMgVXJpIGluc2VydChVcmkgdXJsLCBDb250ZW50VmFsdWVzIGluaXRpYWxWYWx1ZXMpCisgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgcmV0dXJuIG1Db250ZW50UHJvdmlkZXIuaW5zZXJ0KHVybCwgaW5pdGlhbFZhbHVlcyk7CisgICAgfQorCisgICAgLyoqIHNlZSB7QGxpbmsgQ29udGVudFByb3ZpZGVyI2J1bGtJbnNlcnR9ICovCisgICAgcHVibGljIGludCBidWxrSW5zZXJ0KFVyaSB1cmwsIENvbnRlbnRWYWx1ZXNbXSBpbml0aWFsVmFsdWVzKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgcmV0dXJuIG1Db250ZW50UHJvdmlkZXIuYnVsa0luc2VydCh1cmwsIGluaXRpYWxWYWx1ZXMpOworICAgIH0KKworICAgIC8qKiBzZWUge0BsaW5rIENvbnRlbnRQcm92aWRlciNkZWxldGV9ICovCisgICAgcHVibGljIGludCBkZWxldGUoVXJpIHVybCwgU3RyaW5nIHNlbGVjdGlvbiwgU3RyaW5nW10gc2VsZWN0aW9uQXJncykKKyAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICByZXR1cm4gbUNvbnRlbnRQcm92aWRlci5kZWxldGUodXJsLCBzZWxlY3Rpb24sIHNlbGVjdGlvbkFyZ3MpOworICAgIH0KKworICAgIC8qKiBzZWUge0BsaW5rIENvbnRlbnRQcm92aWRlciN1cGRhdGV9ICovCisgICAgcHVibGljIGludCB1cGRhdGUoVXJpIHVybCwgQ29udGVudFZhbHVlcyB2YWx1ZXMsIFN0cmluZyBzZWxlY3Rpb24sCisgICAgICAgICAgICBTdHJpbmdbXSBzZWxlY3Rpb25BcmdzKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgcmV0dXJuIG1Db250ZW50UHJvdmlkZXIudXBkYXRlKHVybCwgdmFsdWVzLCBzZWxlY3Rpb24sIHNlbGVjdGlvbkFyZ3MpOworICAgIH0KKworICAgIC8qKiBzZWUge0BsaW5rIENvbnRlbnRQcm92aWRlciNvcGVuRmlsZX0gKi8KKyAgICBwdWJsaWMgUGFyY2VsRmlsZURlc2NyaXB0b3Igb3BlbkZpbGUoVXJpIHVybCwgU3RyaW5nIG1vZGUpCisgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uLCBGaWxlTm90Rm91bmRFeGNlcHRpb24geworICAgICAgICByZXR1cm4gbUNvbnRlbnRQcm92aWRlci5vcGVuRmlsZSh1cmwsIG1vZGUpOworICAgIH0KKworICAgIC8qKiBzZWUge0BsaW5rIENvbnRlbnRQcm92aWRlciNvcGVuQXNzZXRGaWxlfSAqLworICAgIHB1YmxpYyBBc3NldEZpbGVEZXNjcmlwdG9yIG9wZW5Bc3NldEZpbGUoVXJpIHVybCwgU3RyaW5nIG1vZGUpCisgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uLCBGaWxlTm90Rm91bmRFeGNlcHRpb24geworICAgICAgICByZXR1cm4gbUNvbnRlbnRQcm92aWRlci5vcGVuQX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ZX0VOVElUSUVTX1RSQU5TQUNUSU9OOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElDb250ZW50UHJvdmlkZXIuZGVzY3JpcHRvcik7CisgICAgICAgICAgICAgICAgICAgIFVyaSB1cmwgPSBVcmkuQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKGRhdGEpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2VsZWN0aW9uID0gZGF0YS5yZWFkU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MgPSBkYXRhLnJlYWRTdHJpbmdBcnJheSgpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc29ydE9yZGVyID0gZGF0YS5yZWFkU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgICAgIEVudGl0eUl0ZXJhdG9yIGVudGl0eUl0ZXJhdG9yID0gcXVlcnlFbnRpdGllcyh1cmwsIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3J0T3JkZXIpOworICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlU3Ryb25nQmluZGVyKG5ldyBJRW50aXR5SXRlcmF0b3JJbXBsKGVudGl0eUl0ZXJhdG9yKS5hc0JpbmRlcigpKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgY2FzZSBHRVRfVFlQRV9UUkFOU0FDVElPTjoKICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQ29udGVudFByb3ZpZGVyLmRlc2NyaXB0b3IpOwpAQCAtMTQwLDYgKzE1NSw0MyBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgICAgICBjYXNlIElOU0VSVF9FTlRJVElFU19UUkFOU0FDVElPTjoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQ29udGVudFByb3ZpZGVyLmRlc2NyaXB0b3IpOworICAgICAgICAgICAgICAgICAgICBVcmkgdXJpID0gVXJpLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChkYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgRW50aXR5IGVudGl0eSA9IChFbnRpdHkpIGRhdGEucmVhZFBhcmNlbGFibGUobnVsbCk7CisgICAgICAgICAgICAgICAgICAgIFVyaSBuZXdVcmkgPSBpbnNlcnRFbnRpdHkodXJpLCBlbnRpdHkpOworICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIFVyaS53cml0ZVRvUGFyY2VsKHJlcGx5LCBuZXdVcmkpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIFVQREFURV9FTlRJVElFU19UUkFOU0FDVElPTjoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQ29udGVudFByb3ZpZGVyLmRlc2NyaXB0b3IpOworICAgICAgICAgICAgICAgICAgICBVcmkgdXJpID0gVXJpLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChkYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgRW50aXR5IGVudGl0eSA9IChFbnRpdHkpIGRhdGEucmVhZFBhcmNlbGFibGUobnVsbCk7CisgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCA9IHVwZGF0ZUVudGl0eSh1cmksIGVudGl0eSk7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVJbnQoY291bnQpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIEFQUExZX0JBVENIX1RSQU5TQUNUSU9OOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElDb250ZW50UHJvdmlkZXIuZGVzY3JpcHRvcik7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBudW1PcGVyYXRpb25zID0gZGF0YS5yZWFkSW50KCk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIEFycmF5TGlzdDxDb250ZW50UHJvdmlkZXJPcGVyYXRpb24+IG9wZXJhdGlvbnMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBBcnJheUxpc3Q8Q29udGVudFByb3ZpZGVyT3BlcmF0aW9uPihudW1PcGVyYXRpb25zKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1PcGVyYXRpb25zOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbnMuYWRkKGksIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoZGF0YSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIENvbnRlbnRQcm92aWRlclJlc3VsdFtdIHJlc3VsdHMgPSBhcHBseUJhdGNoKG9wZXJhdGlvbnMpOworICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlVHlwZWRBcnJheShyZXN1bHRzLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgY2FzZSBERUxFVEVfVFJBTlNBQ1RJT046CiAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUNvbnRlbnRQcm92aWRlci5kZXNjcmlwdG9yKTsKQEAgLTIwNiwxNSArMjU4LDYgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBjYXNlIEdFVF9TWU5DX0FEQVBURVJfVFJBTlNBQ1RJT046Ci0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUNvbnRlbnRQcm92aWRlci5kZXNjcmlwdG9yKTsKLSAgICAgICAgICAgICAgICAgICAgSVN5bmNBZGFwdGVyIHNhID0gZ2V0U3luY0FkYXB0ZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOwotICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZVN0cm9uZ0JpbmRlcihzYSAhPSBudWxsID8gc2EuYXNCaW5kZXIoKSA6IG51bGwpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLndyaXRlRXhjZXB0aW9uVG9QYXJjZWwocmVwbHksIGUpOwpAQCAtMjI0LDYgKzI2NywyOSBAQAogICAgICAgICByZXR1cm4gc3VwZXIub25UcmFuc2FjdChjb2RlLCBkYXRhLCByZXBseSwgZmxhZ3MpOwogICAgIH0KIAorICAgIHByaXZhdGUgY2xhc3MgSUVudGl0eUl0ZXJhdG9ySW1wbCBleHRlbmRzIElFbnRpdHlJdGVyYXRvci5TdHViIHsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBFbnRpdHlJdGVyYXRvciBtRW50aXR5SXRlcmF0b3I7CisKKyAgICAgICAgSUVudGl0eUl0ZXJhdG9ySW1wbChFbnRpdHlJdGVyYXRvciBpdGVyYXRvcikgeworICAgICAgICAgICAgbUVudGl0eUl0ZXJhdG9yID0gaXRlcmF0b3I7CisgICAgICAgIH0KKyAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzTmV4dCgpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgcmV0dXJuIG1FbnRpdHlJdGVyYXRvci5oYXNOZXh0KCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgRW50aXR5IG5leHQoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIHJldHVybiBtRW50aXR5SXRlcmF0b3IubmV4dCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcmVzZXQoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIG1FbnRpdHlJdGVyYXRvci5yZXNldCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgY2xvc2UoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIG1FbnRpdHlJdGVyYXRvci5jbG9zZSgpOworICAgICAgICB9CisgICAgfQorCiAgICAgcHVibGljIElCaW5kZXIgYXNCaW5kZXIoKQogICAgIHsKICAgICAgICAgcmV0dXJuIHRoaXM7CkBAIC0yOTcsNyArMzYzLDcgQEAKICAgICAgICAgQnVsa0N1cnNvclRvQ3Vyc29yQWRhcHRvciBhZGFwdG9yID0gbmV3IEJ1bGtDdXJzb3JUb0N1cnNvckFkYXB0b3IoKTsKICAgICAgICAgSUJ1bGtDdXJzb3IgYnVsa0N1cnNvciA9IGJ1bGtRdWVyeSh1cmwsIHByb2plY3Rpb24sIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncywgc29ydE9yZGVyLAogICAgICAgICAgICAgICAgIGFkYXB0b3IuZ2V0T2JzZXJ2ZXIoKSwgd2luZG93KTsKLSAgICAgICAgIAorCiAgICAgICAgIGlmIChidWxrQ3Vyc29yID09IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CkBAIC0zMDUsNiArMzcxLDU4IEBACiAgICAgICAgIHJldHVybiBhZGFwdG9yOwogICAgIH0KIAorICAgIHB1YmxpYyBFbnRpdHlJdGVyYXRvciBxdWVyeUVudGl0aWVzKFVyaSB1cmwsIFN0cmluZyBzZWxlY3Rpb24sIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MsCisgICAgICAgICAgICBTdHJpbmcgc29ydE9yZGVyKQorICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBQYXJjZWwgcmVwbHkgPSBQYXJjZWwub2J0YWluKCk7CisKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb250ZW50UHJvdmlkZXIuZGVzY3JpcHRvcik7CisKKyAgICAgICAgdXJsLndyaXRlVG9QYXJjZWwoZGF0YSwgMCk7CisgICAgICAgIGRhdGEud3JpdGVTdHJpbmcoc2VsZWN0aW9uKTsKKyAgICAgICAgZGF0YS53cml0ZVN0cmluZ0FycmF5KHNlbGVjdGlvbkFyZ3MpOworICAgICAgICBkYXRhLndyaXRlU3RyaW5nKHNvcnRPcmRlcik7CisKKyAgICAgICAgbVJlbW90ZS50cmFuc2FjdChJQ29udGVudFByb3ZpZGVyLlFVRVJZX0VOVElUSUVTX1RSQU5TQUNUSU9OLCBkYXRhLCByZXBseSwgMCk7CisKKyAgICAgICAgR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ucmVzZXQoKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtRW50aXR5SXRlcmF0b3IuY2xvc2UoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLy8gZG9lc24ndCBtYXR0ZXIKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKwogICAgIHB1YmxpYyBTdHJpbmcgZ2V0VHlwZShVcmkgdXJsKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uCiAgICAgewogICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKQEAgLTM2Niw2ICs0ODQsNjYgQEAKICAgICAgICAgcmV0dXJuIGNvdW50OwogICAgIH0KIAorICAgIHB1YmxpYyBDb250ZW50UHJvdmlkZXJSZXN1bHRbXSBhcHBseUJhdGNoKEFycmF5TGlzdDxDb250ZW50UHJvdmlkZXJPcGVyYXRpb24+IG9wZXJhdGlvbnMpCisgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uLCBPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbiB7CisgICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBQYXJjZWwgcmVwbHkgPSBQYXJjZWwub2J0YWluKCk7CisKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb250ZW50UHJvdmlkZXIuZGVzY3JpcHRvcik7CisgICAgICAgIGRhdGEud3JpdGVJbnQob3BlcmF0aW9ucy5zaXplKCkpOworICAgICAgICBmb3IgKENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiBvcGVyYXRpb24gOiBvcGVyYXRpb25zKSB7CisgICAgICAgICAgICBvcGVyYXRpb24ud3JpdGVUb1BhcmNlbChkYXRhLCAwKTsKKyAgICAgICAgfQorICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KElDb250ZW50UHJvdmlkZXIuQVBQTFlfQkFUQ0hfVFJBTlNBQ1RJT04sIGRhdGEsIHJlcGx5LCAwKTsKKworICAgICAgICBEYXRhYmFzZVV0aWxzLnJlYWRFeGNlcHRpb25XaXRoT3BlcmF0aW9uQXBwbGljYXRpb25FeGNlcHRpb25Gcm9tUGFyY2VsKHJlcGx5KTsKKyAgICAgICAgZmluYWwgQ29udGVudFByb3ZpZGVyUmVzdWx0W10gcmVzdWx0cyA9CisgICAgICAgICAgICAgICAgcmVwbHkuY3JlYXRlVHlwZWRBcnJheShDb250ZW50UHJvdmlkZXJSZXN1bHQuQ1JFQVRPUik7CisKKyAgICAgICAgZGF0YS5yZWN5Y2xlKCk7CisgICAgICAgIHJlcGx5LnJlY3ljbGUoKTsKKworICAgICAgICByZXR1cm4gcmVzdWx0czsKKyAgICB9CisKKyAgICBwdWJsaWMgVXJpIGluc2VydEVudGl0eShVcmkgdXJpLCBFbnRpdHkgZW50aXR5KSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgUGFyY2VsIGRhdGEgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgIFBhcmNlbCByZXBseSA9IFBhcmNlbC5vYnRhaW4oKTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb250ZW50UHJvdmlkZXIuZGVzY3JpcHRvcik7CisgICAgICAgICAgICB1cmkud3JpdGVUb1BhcmNlbChkYXRhLCAwKTsKKyAgICAgICAgICAgIGRhdGEud3JpdGVQYXJjZWxhYmxlKGVudGl0eSwgMCk7CisKKyAgICAgICAgICAgIG1SZW1vdGUudHJhbnNhY3QoSUNvbnRlbnRQcm92aWRlci5JTlNFUlRfRU5USVRJRVNfVFJBTlNBQ1RJT04sIGRhdGEsIHJlcGx5LCAwKTsKKworICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5yZWFkRXhjZXB0aW9uRnJvbVBhcmNlbChyZXBseSk7CisgICAgICAgICAgICByZXR1cm4gVXJpLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChyZXBseSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBkYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgICAgIHJlcGx5LnJlY3ljbGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgdXBkYXRlRW50aXR5KFVyaSB1cmksIEVudGl0eSBlbnRpdHkpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKKyAgICAgICAgUGFyY2VsIHJlcGx5ID0gUGFyY2VsLm9idGFpbigpOworCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbnRlbnRQcm92aWRlci5kZXNjcmlwdG9yKTsKKyAgICAgICAgICAgIHVyaS53cml0ZVRvUGFyY2VsKGRhdGEsIDApOworICAgICAgICAgICAgZGF0YS53cml0ZVBhcmNlbGFibGUoZW50aXR5LCAwKTsKKworICAgICAgICAgICAgbVJlbW90ZS50cmFuc2FjdChJQ29udGVudFByb3ZpZGVyLlVQREFURV9FTlRJVElFU19UUkFOU0FDVElPTiwgZGF0YSwgcmVwbHksIDApOworCisgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLnJlYWRFeGNlcHRpb25Gcm9tUGFyY2VsKHJlcGx5KTsKKyAgICAgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50KCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBkYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgICAgIHJlcGx5LnJlY3ljbGUoKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHB1YmxpYyBpbnQgZGVsZXRlKFVyaSB1cmwsIFN0cmluZyBzZW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WxkZXIubVlpZWxkQWxsb3dlZDsKKyAgICB9CisKKyAgICBwcml2YXRlIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbihQYXJjZWwgc291cmNlKSB7CisgICAgICAgIG1UeXBlID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgbVVyaSA9IFVyaS5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoc291cmNlKTsKKyAgICAgICAgbVZhbHVlcyA9IHNvdXJjZS5yZWFkSW50KCkgIT0gMCA/IENvbnRlbnRWYWx1ZXMuQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKHNvdXJjZSkgOiBudWxsOworICAgICAgICBtU2VsZWN0aW9uID0gc291cmNlLnJlYWRJbnQoKSAhPSAwID8gc291cmNlLnJlYWRTdHJpbmcoKSA6IG51bGw7CisgICAgICAgIG1TZWxlY3Rpb25BcmdzID0gc291cmNlLnJlYWRJbnQoKSAhPSAwID8gc291cmNlLnJlYWRTdHJpbmdBcnJheSgpIDogbnVsbDsKKyAgICAgICAgbUV4cGVjdGVkQ291bnQgPSBzb3VyY2UucmVhZEludCgpICE9IDAgPyBzb3VyY2UucmVhZEludCgpIDogbnVsbDsKKyAgICAgICAgbVZhbHVlc0JhY2tSZWZlcmVuY2VzID0gc291cmNlLnJlYWRJbnQoKSAhPSAwCisgICAgICAgICAgICAgICAgPyBDb250ZW50VmFsdWVzLkNSRUFUT1IuY3JlYXRlRnJvbVBhcmNlbChzb3VyY2UpCisgICAgICAgICAgICAgICAgOiBudWxsOworICAgICAgICBtU2VsZWN0aW9uQXJnc0JhY2tSZWZlcmVuY2VzID0gc291cmNlLnJlYWRJbnQoKSAhPSAwCisgICAgICAgICAgICAgICAgPyBuZXcgSGFzaE1hcDxJbnRlZ2VyLCBJbnRlZ2VyPigpCisgICAgICAgICAgICAgICAgOiBudWxsOworICAgICAgICBpZiAobVNlbGVjdGlvbkFyZ3NCYWNrUmVmZXJlbmNlcyAhPSBudWxsKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBzb3VyY2UucmVhZEludCgpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgbVNlbGVjdGlvbkFyZ3NCYWNrUmVmZXJlbmNlcy5wdXQoc291cmNlLnJlYWRJbnQoKSwgc291cmNlLnJlYWRJbnQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbVlpZWxkQWxsb3dlZCA9IHNvdXJjZS5yZWFkSW50KCkgIT0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgZGVzdC53cml0ZUludChtVHlwZSk7CisgICAgICAgIFVyaS53cml0ZVRvUGFyY2VsKGRlc3QsIG1VcmkpOworICAgICAgICBpZiAobVZhbHVlcyAhPSBudWxsKSB7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KDEpOworICAgICAgICAgICAgbVZhbHVlcy53cml0ZVRvUGFyY2VsKGRlc3QsIDApOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVzdC53cml0ZUludCgwKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVNlbGVjdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KDEpOworICAgICAgICAgICAgZGVzdC53cml0ZVN0cmluZyhtU2VsZWN0aW9uKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TZWxlY3Rpb25BcmdzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMSk7CisgICAgICAgICAgICBkZXN0LndyaXRlU3RyaW5nQXJyYXkobVNlbGVjdGlvbkFyZ3MpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVzdC53cml0ZUludCgwKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUV4cGVjdGVkQ291bnQgIT0gbnVsbCkgeworICAgICAgICAgICAgZGVzdC53cml0ZUludCgxKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQobUV4cGVjdGVkQ291bnQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVzdC53cml0ZUludCgwKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVZhbHVlc0JhY2tSZWZlcmVuY2VzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMSk7CisgICAgICAgICAgICBtVmFsdWVzQmFja1JlZmVyZW5jZXMud3JpdGVUb1BhcmNlbChkZXN0LCAwKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TZWxlY3Rpb25BcmdzQmFja1JlZmVyZW5jZXMgIT0gbnVsbCkgeworICAgICAgICAgICAgZGVzdC53cml0ZUludCgxKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQobVNlbGVjdGlvbkFyZ3NCYWNrUmVmZXJlbmNlcy5zaXplKCkpOworICAgICAgICAgICAgZm9yIChNYXAuRW50cnk8SW50ZWdlciwgSW50ZWdlcj4gZW50cnkgOiBtU2VsZWN0aW9uQXJnc0JhY2tSZWZlcmVuY2VzLmVudHJ5U2V0KCkpIHsKKyAgICAgICAgICAgICAgICBkZXN0LndyaXRlSW50KGVudHJ5LmdldEtleSgpKTsKKyAgICAgICAgICAgICAgICBkZXN0LndyaXRlSW50KGVudHJ5LmdldFZhbHVlKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVzdC53cml0ZUludCgwKTsKKyAgICAgICAgfQorICAgICAgICBkZXN0LndyaXRlSW50KG1ZaWVsZEFsbG93ZWQgPyAxIDogMCk7CisgIC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RoZSBudW1iZXIgb2Ygcm93cyBhZmZlY3RlZC4KKyAgICAgKiBAdGhyb3dzIE9wZXJhdGlvbkFwcGxpY2F0aW9uRXhjZXB0aW9uIHRocm93biBpZiBlaXRoZXIgdGhlIGluc2VydCBmYWlscyBvcgorICAgICAqIGlmIHRoZSBudW1iZXIgb2Ygcm93cyBhZmZlY3RlZCBkaWRuJ3QgbWF0Y2ggdGhlIGV4cGVjdGVkIGNvdW50CisgICAgICovCisgICAgcHVibGljIENvbnRlbnRQcm92aWRlclJlc3VsdCBhcHBseShDb250ZW50UHJvdmlkZXIgcHJvdmlkZXIsIENvbnRlbnRQcm92aWRlclJlc3VsdFtdIGJhY2tSZWZzLAorICAgICAgICAgICAgaW50IG51bUJhY2tSZWZzKSB0aHJvd3MgT3BlcmF0aW9uQXBwbGljYXRpb25FeGNlcHRpb24geworICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IHJlc29sdmVWYWx1ZUJhY2tSZWZlcmVuY2VzKGJhY2tSZWZzLCBudW1CYWNrUmVmcyk7CisgICAgICAgIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MgPQorICAgICAgICAgICAgICAgIHJlc29sdmVTZWxlY3Rpb25BcmdzQmFja1JlZmVyZW5jZXMoYmFja1JlZnMsIG51bUJhY2tSZWZzKTsKKworICAgICAgICBpZiAobVR5cGUgPT0gVFlQRV9JTlNFUlQpIHsKKyAgICAgICAgICAgIFVyaSBuZXdVcmkgPSBwcm92aWRlci5pbnNlcnQobVVyaSwgdmFsdWVzKTsKKyAgICAgICAgICAgIGlmIChuZXdVcmkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbigiaW5zZXJ0IGZhaWxlZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQobmV3VXJpKTsKKyAgICAgICAgfQorCisgIC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AgICAgICAgIG51bVJvd3MgPSBjdXJzb3IuZ2V0Q291bnQoKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgd2hpbGUgKGN1cnNvci5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBwcm9qZWN0aW9uLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgY3Vyc29yVmFsdWUgPSBjdXJzb3IuZ2V0U3RyaW5nKGkpOworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGV4cGVjdGVkVmFsdWUgPSB2YWx1ZXMuZ2V0QXNTdHJpbmcocHJvamVjdGlvbltpXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5lcXVhbHMoY3Vyc29yVmFsdWUsIGV4cGVjdGVkVmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhyb3cgZXhjZXB0aW9uIHdoZW4gZXhwZWN0ZWQgdmFsdWVzIGRvbid0IG1hdGNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9wZXJhdGlvbkFwcGxpY2F0aW9uRXhjZXB0aW9uKCJGb3VuZCB2YWx1ZSAiICsgY3Vyc29yVmFsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiB3aGVuIGV4cGVjdGVkICIgKyBleHBlY3RlZFZhbHVlICsgIiBmb3IgY29sdW1uICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgcHJvamVjdGlvbltpXSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOworICAgICAgICAgICA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YmUgY2FsbGVkIGlmIGVpdGhlciBtVmFsdWVzIG9yIG1WYWx1ZXNCYWNrUmVmZXJlbmNlcworICAgICAqIGlzIG51bGwKKyAgICAgKiBAVmlzaWJsZUZvclRlc3RpbmcgdGhpcyBpcyBpbnRlbmRlZCB0byBiZSBhIHByaXZhdGUgbWV0aG9kIGJ1dCBpdCBpcyBleHBvc2VkIGZvcgorICAgICAqIHVuaXQgdGVzdGluZyBwdXJwb3NlcworICAgICAqLworICAgIHB1YmxpYyBDb250ZW50VmFsdWVzIHJlc29sdmVWYWx1ZUJhY2tSZWZlcmVuY2VzKAorICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyUmVzdWx0W10gYmFja1JlZnMsIGludCBudW1CYWNrUmVmcykgeworICAgICAgICBpZiAobVZhbHVlc0JhY2tSZWZlcmVuY2VzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBtVmFsdWVzOworICAgICAgICB9CisgICAgICAgIGZpbmFsIENvbnRlbnRWYWx1ZXMgdmFsdWVzOworICAgICAgICBpZiAobVZhbHVlcyA9PSBudWxsKSB7CisgICAgICAgICAgICB2YWx1ZXMgPSBuZXcgQ29udGVudFZhbHVlcygpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMobVZhbHVlcyk7CisgICAgICAgIH0KKyAgICAgICAgZm9yIChNYXAuRW50cnk8U3RyaW5nLCBPYmplY3Q+IGVudHJ5IDogbVZhbHVlc0JhY2tSZWZlcmVuY2VzLnZhbHVlU2V0KCkpIHsKKyAgICAgICAgICAgIFN0cmluZyBrZXkgPSBlbnRyeS5nZXRLZXkoKTsKKyAgICAgICAgICAgIEludGVnZXIgYmFja1JlZkluZGV4ID0gbVZhbHVlc0JhY2tSZWZlcmVuY2VzLmdldEFzSW50ZWdlcihrZXkpOworICAgICAgICAgICAgaWYgKGJhY2tSZWZJbmRleCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGh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UluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oImFza2VkIGZvciBiYWNrIHJlZiAiICsgYmFja1JlZkluZGV4CisgICAgICAgICAgICAgICAgICAgICsgIiBidXQgdGhlcmUgYXJlIG9ubHkgIiArIG51bUJhY2tSZWZzICsgIiBiYWNrIHJlZnMiKTsKKyAgICAgICAgfQorICAgICAgICBDb250ZW50UHJvdmlkZXJSZXN1bHQgYmFja1JlZiA9IGJhY2tSZWZzW2JhY2tSZWZJbmRleF07CisgICAgICAgIGxvbmcgYmFja1JlZlZhbHVlOworICAgICAgICBpZiAoYmFja1JlZi51cmkgIT0gbnVsbCkgeworICAgICAgICAgICAgYmFja1JlZlZhbHVlID0gQ29udGVudFVyaXMucGFyc2VJZChiYWNrUmVmLnVyaSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBiYWNrUmVmVmFsdWUgPSBiYWNrUmVmLmNvdW50OworICAgICAgICB9CisgICAgICAgIHJldHVybiBiYWNrUmVmVmFsdWU7CisgICAgfQorCisgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIENyZWF0b3I8Q29udGVudFByb3ZpZGVyT3BlcmF0aW9uPiBDUkVBVE9SID0KKyAgICAgICAgICAgIG5ldyBDcmVhdG9yPENvbnRlbnRQcm92aWRlck9wZXJhdGlvbj4oKSB7CisgICAgICAgIHB1YmxpYyBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24gY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgc291cmNlKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbihzb3VyY2UpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbltdIG5ld0FycmF5KGludCBzaXplKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IEN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ZGVsZXRlLCBvciBhc3NlcnQuCisgICAgICAgICAqIEByZXR1cm4gdGhpcyBidWlsZGVyLCB0byBhbGxvdyBmb3IgY2hhaW5pbmcuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgQnVpbGRlciB3aXRoU2VsZWN0aW9uQmFja1JlZmVyZW5jZShpbnQgc2VsZWN0aW9uQXJnSW5kZXgsIGludCBwcmV2aW91c1Jlc3VsdCkgeworICAgICAgICAgICAgaWYgKG1UeXBlICE9IFRZUEVfVVBEQVRFICYmIG1UeXBlICE9IFRZUEVfREVMRVRFICYmIG1UeXBlICE9IFRZUEVfQVNTRVJUKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigib25seSB1cGRhdGVzLCBkZWxldGVzLCBhbmQgYXNzZXJ0cyAiCisgICAgICAgICAgICAgICAgICAgICAgICArICJjYW4gaGF2ZSBzZWxlY3Rpb24gYmFjay1yZWZlcmVuY2VzIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVNlbGVjdGlvbkFyZ3NCYWNrUmVmZXJlbmNlcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVNlbGVjdGlvbkFyZ3NCYWNrUmVmZXJlbmNlcyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIEludGVnZXI+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtU2VsZWN0aW9uQXJnc0JhY2tSZWZlcmVuY2VzLnB1dChzZWxlY3Rpb25BcmdJbmRleCwgcHJldmlvdXNSZXN1bHQpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIENvbnRlbnRWYWx1ZXMgdG8gdXNlLiBUaGlzIG1heSBiZSBudWxsLiBUaGVzZSB2YWx1ZXMgbWF5IGJlIG92ZXJ3cml0dGVuIGJ5CisgICAgICAgICAqIHRoZSBjb3JyZXNwb25kaW5nIH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gICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIFN0cmluZykgeworICAgICAgICAgICAgICAgIG1WYWx1ZXMucHV0KGtleSwgKFN0cmluZykgdmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIEJ5dGUpIHsKKyAgICAgICAgICAgICAgICBtVmFsdWVzLnB1dChrZXksIChCeXRlKSB2YWx1ZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlIGluc3RhbmNlb2YgU2hvcnQpIHsKKyAgICAgICAgICAgICAgICBtVmFsdWVzLnB1dChrZXksIChTaG9ydCkgdmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIEludGVnZXIpIHsKKyAgICAgICAgICAgICAgICBtVmFsdWVzLnB1dChrZXksIChJbnRlZ2VyKSB2YWx1ZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlIGluc3RhbmNlb2YgTG9uZykgeworICAgICAgICAgICAgICAgIG1WYWx1ZXMucHV0KGtleSwgKExvbmcpIHZhbHVlKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgaW5zdGFuY2VvZiBGbG9hdCkgeworICAgICAgICAgICAgICAgIG1WYWx1ZXMucHV0KGtleSwgKEZsb2F0KSB2YWx1ZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlIGluc3RhbmNlb2YgRG91YmxlKSB7CisgICAgICAgICAgICAgICAgbVZhbHVlcy5wdXQoa2V5LCAoRG91YmxlKSB2YWx1ZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlIGluc3RhbmNlb2YgQm9vbGVhbikgeworICAgICAgICAgICAgICAgIG1WYWx1ZXMucHV0KGtleSwgKEJvb2xlYW4pIHZhbHVlKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgaW5zdGFuY2VvZiBieXRlW10pIHsKKy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BwdWJsaWMgQ29udGVudFByb3ZpZGVyUmVzdWx0KFVyaSB1cmkpIHsKKyAgICAgICAgaWYgKHVyaSA9PSBudWxsKSB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1cmkgbXVzdCBub3QgYmUgbnVsbCIpOworICAgICAgICB0aGlzLnVyaSA9IHVyaTsKKyAgICAgICAgdGhpcy5jb3VudCA9IG51bGw7CisgICAgfQorCisgICAgcHVibGljIENvbnRlbnRQcm92aWRlclJlc3VsdChpbnQgY291bnQpIHsKKyAgICAgICAgdGhpcy5jb3VudCA9IGNvdW50OworICAgICAgICB0aGlzLnVyaSA9IG51bGw7CisgICAgfQorCisgICAgcHVibGljIENvbnRlbnRQcm92aWRlclJlc3VsdChQYXJjZWwgc291cmNlKSB7CisgICAgICAgIGludCB0eXBlID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgaWYgKHR5cGUgPT0gMSkgeworICAgICAgICAgICAgY291bnQgPSBzb3VyY2UucmVhZEludCgpOworICAgICAgICAgICAgdXJpID0gbnVsbDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNvdW50ID0gbnVsbDsKKyAgICAgICAgICAgIHVyaSA9IFVyaS5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwoc291cmNlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICBpZiAodXJpID09IG51bGwpIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMSk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KGNvdW50KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQoMik7CisgICAgICAgICAgICB1cmkud3JpdGVUb1BhcmNlbChkZXN0LCAwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDcmVhdG9yPENvbnRlbnRQcm92aWRlclJlc3VsdD4gQ1JFQVRPUiA9CisgICAgICAgICAgICBuZXcgQ3JlYXRvcjxDb250ZW50UHJvdmlkZXJSZXN1bHQ+KCkgeworICAgICAgICBwdWJsaWMgQ29udGVudFByb3ZpZGVyUmVzdWx0IGNyZWF0ZUZyb21QYXJjZWwoUGFyY2VsIHNvdXJjZSkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQoc291cmNlKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBDb250ZW50UHJvdmlkZXJSZXN1bHRbXSBuZXdBcnJheShpbnQgc2l6ZSkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHRbc2l6ZV07CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgaWYgKHVyaSAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gIkNvbnRlbnRQcm92aWRlclJlc3VsdCh1cmk9IiArIHVyaS50b1N0cmluZygpICsgIikiOworICAgICAgICB9CisgICAgICAgIHJldHVybiAiQ29udGVudFByb3ZpZGVyUmVzdWx0KGNvdW50PSIgKyBjb3VudCArICIpIjsKKyAgICB9Cit9ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9Db250ZW50UmVzb2x2ZXIuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvQ29udGVudFJlc29sdmVyLmphdmEKaW5kZXggNzQxNDRmYy4uODhhNGQwMmYgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2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AgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBFbnRpdHkgbmV4dCgpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgaWYgKG1DbGllbnRSZWxlYXNlZCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oInRoaXMgaXRlcmF0b3IgaXMgYWxyZWFkeSBjbG9zZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBtSW5uZXIubmV4dCgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcmVzZXQoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGlmIChtQ2xpZW50UmVsZWFzZWQpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJ0aGlzIGl0ZXJhdG9yIGlzIGFscmVhZHkgY2xvc2VkIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtSW5uZXIucmVzZXQoKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgICAgICAgICAgbUNsaWVudC5yZWxlYXNlKCk7CisgICAgICAgICAgICBtSW5uZXIuY2xvc2UoKTsKKyAgICAgICAgICAgIG1DbGllbnRSZWxlYXNlZCA9IHRydWU7CisgICAgICAgIH0KKworICAgICAgICBwcm90ZWN0ZWQgdm9pZCBmaW5hbGl6ZSgpIHRocm93cyBUaHJvd2FibGUgeworICAgICAgICAgICAgaWYgKCFtQ2xpZW50UmVsZWFzZWQpIHsKKyAgICAgICAgICAgICAgICBtQ2xpZW50LnJlbGVhc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN1cGVyLmZpbmFsaXplKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBRdWVyeSB0aGUgZ2l2ZW4gVVJJLCByZXR1c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AgIHRocm93cyBSZW1vdGVFeGNlcHRpb24sIE9wZXJhdGlvbkFwcGxpY2F0aW9uRXhjZXB0aW9uIHsKKyAgICAgICAgQ29udGVudFByb3ZpZGVyQ2xpZW50IHByb3ZpZGVyID0gYWNxdWlyZUNvbnRlbnRQcm92aWRlckNsaWVudChhdXRob3JpdHkpOworICAgICAgICBpZiAocHJvdmlkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBhdXRob3JpdHkgIiArIGF1dGhvcml0eSk7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBwcm92aWRlci5hcHBseUJhdGNoKG9wZXJhdGlvbnMpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcHJvdmlkZXIucmVsZWFzZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCiAgICAgICogSW5zZXJ0cyBtdWx0aXBsZSByb3dzIGludG8gYSB0YWJsZSBhdCB0aGUgZ2l2ZW4gVVJMLgogICAgICAqCiAgICAgICogVGhpcyBmdW5jdGlvbiBtYWtlIG5vIGd1YXJhbnRlZXMgYWJvdXQgdGhlIGF0b21pY2l0eSBvZiB0aGUgaW5zZXJ0aW9ucy4KQEAgLTU5Miw2ICs3NjAsNDYgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiBSZXR1cm5zIGEge0BsaW5rIENvbnRlbnRQcm92aWRlckNsaWVudH0gdGhhdCBpcyBhc3NvY2lhdGVkIHdpdGggdGhlIHtAbGluayBDb250ZW50UHJvdmlkZXJ9CisgICAgICogdGhhdCBzZXJ2aWNlcyB0aGUgY29udGVudCBhdCB1cmksIHN0YXJ0aW5nIHRoZSBwcm92aWRlciBpZiBuZWNlc3NhcnkuIFJldHVybnMKKyAgICAgKiBudWxsIGlmIHRoZXJlIGlzIG5vIHByb3ZpZGVyIGFzc29jaWF0ZWQgd2loI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lcXVlc3RTeW5jKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSwgQnVuZGxlIGV4dHJhcykgewogICAgICAgICB2YWxpZGF0ZVN5bmNFeHRyYXNCdW5kbGUoZXh0cmFzKTsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGdldENvbnRlbnRTZXJ2aWNlKCkuc3RhcnRTeW5jKHVyaSwgZXh0cmFzKTsKKyAgICAgICAgICAgIGdldENvbnRlbnRTZXJ2aWNlKCkucmVxdWVzdFN5bmMoYWNjb3VudCwgYXV0aG9yaXR5LCBleHRyYXMpOwogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICB9CiAgICAgfQpAQCAtNjk0LDYgKzkzNCw3IEBACiAgICAgICogPGxpPkZsb2F0PC9saT4KICAgICAgKiA8bGk+RG91YmxlPC9saT4KICAgICAgKiA8bGk+U3RyaW5nPC9saT4KKyAgICAgKiA8bGk+QWNjb3VudDwvbGk+CiAgICAgICogPGxpPm51bGw8L2xpPgogICAgICAqIDwvdWw+CiAgICAgICogQHBhcmFtIGV4dHJhcyB0aGUgQnVuZGxlIHRvIGNoZWNrCkBAIC03MDksNiArOTUwLDcgQEAKICAgICAgICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBGbG9hdCkgY29udGludWU7CiAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIGluc3RhbmNlb2YgRG91YmxlKSBjb250aW51ZTsKICAgICAgICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBTdHJpbmcpIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSBpbnN0YW5jZW9mIEFjY291bnQpIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVuZXhwZWN0ZWQgdmFsdWUgdHlwZTogIgogICAgICAgICAgICAgICAgICAgICAgICAgKyB2YWx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x0ZXJzIHRoZSBzeW5jcyB0aGF0IG1hdGNoIGJ5IHRoaXMgYWNjb3VudAorICAgICAqIEBwYXJhbSBhdXRob3JpdHkgZmlsdGVycyB0aGUgc3luY3MgdGhhdCBtYXRjaCBieSB0aGlzIGF1dGhvcml0eQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBjYW5jZWxTeW5jKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSkgewogICAgICAgICB0cnkgewotICAgICAgICAgICAgZ2V0Q29udGVudFNlcnZpY2UoKS5jYW5jZWxTeW5jKHVyaSk7CisgICAgICAgICAgICBnZXRDb250ZW50U2VydmljZSgpLmNhbmNlbFN5bmMoYWNjb3VudCwgYXV0aG9yaXR5KTsKICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgfQogICAgIH0KIAorICAgIC8qKgorICAgICAqIEdldCBpbmZvcm1hdGlvbiBhYm91dCB0aGUgU3luY0FkYXB0ZXJzIHRoYXQgYXJlIGtub3duIHRvIHRoZSBzeXN0ZW0uCisgICAgICogQHJldHVybiBhbiBhcnJheSBvZiBTeW5jQWRhcHRlcnMgdGhhdCBoYXZlIHJlZ2lzdGVyZWQgd2l0aCB0aGUgc3lzdGVtCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTeW5jQWRhcHRlclR5cGVbXSBnZXRTeW5jQWRhcHRlclR5cGVzKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIGdldENvbnRlbnRTZXJ2aWNlKCkuZ2V0U3luY0FkYXB0ZXJUeXBlcygpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oInRoZSBDb250ZW50U2VydmljZSBzaG91bGQgYWx3YXlzIGJlIHJlYWNoYWJsZSIsIGUpOworICAgICAgICB9CisgICAgfQorCisgIC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Y2NvdW50LCBhdXRob3JpdHkpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oInRoZSBDb250ZW50U2VydmljZSBzaG91bGQgYWx3YXlzIGJlIHJlYWNoYWJsZSIsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHdoZXRoZXIgdGhpcyBhY2NvdW50L3Byb3ZpZGVyIGlzIHN5bmNhYmxlLgorICAgICAqIEBwYXJhbSBzeW5jYWJsZSA+MCBkZW5vdGVzIHN5bmNhYmxlLCAwIG1lYW5zIG5vdCBzeW5jYWJsZSwgPDAgbWVhbnMgdW5rbm93bgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzZXRJc1N5bmNhYmxlKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSwgaW50IHN5bmNhYmxlKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBnZXRDb250ZW50U2VydmljZSgpLnNldElzU3luY2FibGUoYWNjb3VudCwgYXV0aG9yaXR5LCBzeW5jYWJsZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyBleGNlcHRpb24gaWdub3JlZDsgaWYgdGhpcyBpcyB0aHJvd24gdGhlbiBpdCBtZWFucyB0aGUgcnVudGltZSBpcyBpbiB0aGUgbWlkc3Qgb2YKKyAgICAgICAgICAgIC8vIGJlaW5nIHJlc3RhcnRlZAorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0cyB0aGUgbWFzdGVyIGF1dG8tc3luYyBzZXR0aW5nIHRoYXQgYXBwbGllcyB0byBhbGwgdGhlIHByb3ZpZGVycyBhbmQgYWNjb3VudHMuCisgICAgICogSWYgdGhpcyBpcyBmYWxzZSB0aGVuIHRoZSBwZXItcHJvdmlkZXIgY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nVsbCBpZiBub25lIGV4aXN0cworICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTeW5jU3RhdHVzSW5mbyBnZXRTeW5jU3RhdHVzKEFjY291bnQgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIGdldENvbnRlbnRTZXJ2aWNlKCkuZ2V0U3luY1N0YXR1cyhhY2NvdW50LCBhdXRob3JpdHkpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oInRoZSBDb250ZW50U2VydmljZSBzaG91bGQgYWx3YXlzIGJlIHJlYWNoYWJsZSIsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJuIHRydWUgaWYgdGhlIHBlbmRpbmcgc3RhdHVzIGlzIHRydWUgb2YgYW55IG1hdGNoaW5nIGF1dGhvcml0aWVzLgorICAgICAqIEBwYXJhbSBhY2NvdW50IHRoZSBhY2NvdW50IHdob3NlIHNldHRpbmcgd2UgYXJlIHF1ZXJ5aW5nCisgICAgICogQHBhcmFtIGF1dGhvcml0eSB0aGUgcHJvdmlkZXIgd2hvc2UgYmVoYXZpb3IgaXMgYmVpbmcgcXVlcmllZAorICAgICAqIEByZXR1cm4gdHJ1ZSBpZiB0aGVyZSBpcyBhIHBlbmRpbmcgc3luYyB3aXRoIHRoZSBtYXRjaGluZyBhY2NvdW50IGFuZCBhdXRob3JpdHkKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gaXNTeW5jUGVuZGluZyhBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRob3JpdHkpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBnZXRDb250ZW50U2VydmljZSgpLmlzU3luY1BlbmRpbmcoYWNjb3VudCwgYXV0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mVzdG9yZSB0aGlzIGJlZm9yZSByZXR1cm5pbmcuCisgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBTeW5jTWFuYWdlciBzeW5jTWFuYWdlciA9IGdldFN5bmNNYW5hZ2VyKCk7CisgICAgICAgICAgICByZXR1cm4gc3luY01hbmFnZXIuZ2V0U3luY0FkYXB0ZXJUeXBlcygpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGdldFN5bmNBdXRvbWF0aWNhbGx5KEFjY291bnQgYWNjb3VudCwgU3RyaW5nIHByb3ZpZGVyTmFtZSkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oTWFuaWZlc3QucGVybWlzc2lvbi5SRUFEX1NZTkNfU0VUVElOR1MsCiAgICAgICAgICAgICAgICAgIm5vIHBlcm1pc3Npb24gdG8gcmVhZCB0aGUgc3luYyBzZXR0aW5ncyIpOwogICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgU3luY01hbmFnZXIgc3luY01hbmFnZXIgPSBnZXRTeW5jTWFuYWdlcigpOwogICAgICAgICAgICAgaWYgKHN5bmNNYW5hZ2VyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gc3luY01hbmFnZXIuZ2V0U3luY1N0b3JhZ2VFbmdpbmUoKS5nZXRTeW5jUHJvdmlkZXJBdXRvbWF0aWNhbGx5KAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgcHJvdmlkZXJOYW1lKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3luY01hbmFnZXIuZ2V0U3luY1N0b3JhZ2VFbmdpbmUoKS5nZXRTeW5jQXV0b21hdGljYWxseSgKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQsIHByb3ZpZGVyTmFtZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOwpAQCAtMjM2LDUxICsyNTgsODIgQEAKICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIHNldFN5bmNQcm92aWRlckF1dG9tYXRpY2FsbHkoU3RyaW5nIHByb3ZpZGVyTmFtZSwgYm9vbGVhbiBzeW5jKSB7CisgICAgcHVibGljIHZvaWQgc2V0U3luY0F1dG9tYXRpY2FsbHkoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgcHJvdmlkZXJOYW1lLCBib29sZWFuIHN5bmMpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKE1hbmlmZXN0LnBlcm1pc3Npb24uV1JJVEVfU1lOQ19TRVRUSU5HUywKICAgICAgICAgICAgICAgICAibm8gcGVybWlzc2lvbiB0byB3cml0ZSB0aGUgc3luYyBzZXR0aW5ncyIpOwogICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgU3luY01hbmFnZXIgc3luY01hbmFnZXIgPSBnZXRTeW5jTWFuYWdlcigpOwogICAgICAgICAgICAgaWYgKHN5bmNNYW5hZ2VyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBzeW5jTWFuYWdlci5nZXRTeW5jU3RvcmFnZUVuZ2luZSgpLnNldFN5bmNQcm92aWRlckF1dG9tYXRpY2FsbHkoCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBwcm92aWRlck5hbWUsIHN5bmMpOworICAgICAgICAgICAgICAgIHN5bmNNYW5hZ2VyLmdldFN5bmNTdG9yYWdlRW5naW5lKCkuc2V0U3luY0F1dG9tYXRpY2FsbHkoCisgICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50LCBwcm92aWRlck5hbWUsIHN5bmMpOwogICAgICAgICAgICAgfQogICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKICAgICAgICAgfQogICAgIH0KIAotICAgIHB1YmxpYyBib29sZWFuIGdldExpc3RlbkZvck5ldHdvcmtUaWNrbGVzKCkgeworICAgIHB1YmxpYyBpbnQgZ2V0SXNTeW5jYWJsZShBY2NvdW50IGFjY291bnQsIFN0cmluZyBwcm92aWRlck5hbWUpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKE1hbmlmZXN0LnBlcm1pc3Npb24uUkVBRF9TWU5DX1NFVFRJTkdTLAogICAgICAgICAgICAgICAgICJubyBwZXJtaXNzaW9uIHRvIHJlYWQgdGhlIHN5bmMgc2V0dGluZ3MiKTsKICAgICAgICAgbG9uZyBpZGVudGl0eVRva2VuID0gY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIFN5bmNNYW5hZ2VyIHN5bmNNYW5hZ2VyID0gZ2V0U3luY01hbmFnZXIoKTsKICAgICAgICAgICAgIGlmIChzeW5jTWFuYWdlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN5bmNNYW5hZ2VyLmdldFN5bmNTdG9yYWdlRW5naW5lKCkuZ2V0TGlzdGVuRm9yTmV0d29ya1RpY2tsZXMoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3luY01hbmFnZXIuZ2V0U3luY1N0b3JhZ2VFbmdpbmUoKS5nZXRJc1N5bmNhYmxlKAorICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudCwgcHJvdmlkZXJOYW1lKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICByZXR1cm4gLTE7CiAgICAgfQotICAgIAotICAgIHB1YmxpYyB2b2lkIHNldExpc3RlbkZvck5ldHdvcmtUaWNrbGVzKGJvb2xlYW4gZmxhZykgeworCisgICAgcHVibGljIHZvaWQgc2V0SXNTeW5jYWJsZShBY2NvdW50IGFjY291bnQsIFN0cmluZyBwcm92aWRlck5hbWUsIGludCBzeW5jYWJsZSkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oTWFuaWZlc3QucGVybWlzc2lvbi5XUklURV9TWU5DX1NFVFRJTkdTLAogICAgICAgICAgICAgICAgICJubyBwZXJtaXNzaW9uIHRvIHdyaXRlIHRoZSBzeW5jIHNldHRpbmdzIik7CiAgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBTeW5jTWFuYWdlciBzeW5jTWFuYWdlciA9IGdldFN5bmNNYW5hZ2VyKCk7CiAgICAgICAgICAgICBpZiAoc3luY01hbmFnZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHN5bmNNYW5hZ2VyLmdldFN5bmNTdG9yYWdlRW5naW5lKCkuc2V0TGlzdGVuRm9yTmV0d29ya1RpY2tsZXMoZmxhZyk7CisgICAgICAgICAgICAgICAgc3luY01hbmFnZXIuZ2V0U3luY1N0b3JhZ2VFbmdpbmUoKS5zZXRJc1N5bmNhYmxlKAorICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudCwgcHJvdmlkZXJOYW1lLCBzeW5jYWJsZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOwogICAgICAgICB9CiAgICAgfQogCi0gICAgcHVibGljIGJvb2xlYW4gaXNTeW5jQWN0aXZlKFN0cmluZyBhY2NvdW50LCBTdHJpbmcgYXV0aG9yaXR5KSB7CisgICAgcHVibGljIGJvb2xlYW4gZ2V0TWFzdGVyU3luY0F1dG9tYXRpY2FsbHkoKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihNYW5pZmVzdC5wZXJtaXNzaW9uLlJFQURfU1lOQ19TRVRUSU5HUywKKyAgICAgICAgICAgICAgICAibm8gcGVybWlzc2lvbiB0byByZWFkIHRoZSBzeW5jIHNldHRpbmdzIik7CisgICAgICAgIGxvbmcgaWRlbnRpdHlUb2tlbiA9IGNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBTeW5jTWFuYWdlciBzeW5jTWFuYWdlciA9IGdldFN5bmNNYW5hZ2VyKCk7CisgICAgICAgICAgICBpZiAoc3luY01hbmFnZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBzeW5jTWFuYWdlci5nZXRTeW5jU3RvcmFnZUVuZ2luZSgpLmdldE1hc3RlclN5bmNBdXRvbWF0aWNhbGx5KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRNYXN0ZXJTeW5jQXV0b21hdGljYWxseShib29sZWFuIGZsYWcpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKE1hbmlmZXN0LnBlcm1pc3Npb24uV1JJVEVfU1lOQ19TRVRUSU5HUywKKyAgICAgICAgICAgICAgICAibm8gcGVybWlzc2lvbiB0byB3cml0ZSB0aGUgc3luYyBzZXR0aW5ncyIpOworICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgU3luY01hbmFnZXIgc3luY01hbmFnZXIgPSBnZXRTeW5jTWFuYWdlcigpOworICAgICAgICAgICAgaWYgKHN5bmNNYW5hZ2VyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzeW5jTWFuYWdlci5nZXRTeW5jU3RvcmFnZUVuZ2luZSgpLnNldE1hc3RlclN5bmNBdXRvbWF0aWNhbGx5KGZsYWcpOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzU3luY0FjdGl2ZShBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRob3JpdHkpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKE1hbmlmZXN0LnBlcm1pc3Npb24uUkVBRF9TWU5DX1NUQVRTLAogICAgICAgICAgICAgICAgICJubyBwZXJtaXNzaW9uIHRvIHJlYWQgdGhlIHN5bmMgc3RhdHMiKTsKICAgICAgICAgbG9uZyBpZGVudGl0eVRva2VuID0gY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKQEAgLTI5NSw3ICszNDgsNyBAQAogICAgICAgICB9CiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9Ci0gICAgCisKICAg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AgICAgICAgIHJldHVybiBzeW5jTWFuYWdlci5nZXRTeW5jU3RvcmFnZUVuZ2luZSgpLmdldFN0YXR1c0J5QWNjb3VudEFuZEF1dGhvcml0eSgKKyAgICAgICAgICAgICAgICAgICAgYWNjb3VudCwgYXV0aG9yaXR5KTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIHJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnRpdHlUb2tlbik7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQotICAgIAotICAgIHB1YmxpYyBib29sZWFuIGlzQXV0aG9yaXR5UGVuZGluZyhTdHJpbmcgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSkgeworCisgICAgcHVibGljIGJvb2xlYW4gaXNTeW5jUGVuZGluZyhBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRob3JpdHkpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKE1hbmlmZXN0LnBlcm1pc3Npb24uUkVBRF9TWU5DX1NUQVRTLAogICAgICAgICAgICAgICAgICJubyBwZXJtaXNzaW9uIHRvIHJlYWQgdGhlIHN5bmMgc3RhdHMiKTsKICAgICAgICAgbG9uZyBpZGVudGl0eVRva2VuID0gY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIFN5bmNNYW5hZ2VyIHN5bmNNYW5hZ2VyID0gZ2V0U3luY01hbmFnZXIoKTsKICAgICAgICAgICAgIGlmIChzeW5jTWFuYWdlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN5bmNNYW5hZ2VyLmdldFN5bmNTdG9yYWdlRW5naW5lKCkuaXNBdXRob3JpdHlQZW5kaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudCwgYXV0aG9yaXR5KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3luY01hbmFnZXIuZ2V0U3luY1N0b3JhZ2VFbmdpbmUoKS5pc1N5bmNQZW5kaW5nKGFjY291bnQsIGF1dGhvcml0eSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICByZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5VG9rZW4pOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBhZGRTdGF0dXNDaGFuZ2VMaXN0ZW5lcihpbnQgbWFzaywgSVN5bmNTdGF0dXNPYnNlcnZlciBjYWxsYmFjaykgewogICAgICAgICBsb25nIGlkZW50aXR5VG9rZW4gPSBjbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgU3luY01hbmFnZXIgc3luY01hbmFnZXIgPSBnZXRTeW5jTWFuYWdlcigpOwogICAgICAgICAgICAgaWYgKHN5bmNNYW5hZ2VyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBzeW5jTWFuYWdlci5nZXRTeW5jU3RvcmFnZUVuZ2luZSgpLmFkZFN0YXR1c0NoYW5nZUxpc3RlbmVyKAotICAgICAgICAgICAgICAgICAgICAgICAgbWFzaywgY2FsbGJhY2spOworICAgICAgICAgICAgICAgIHN5bmNNYW5hZ2VyLmdldFN5bmNTdG9yYWdlRW5naW5lKCkuYWRkU3RhdHVzQ2hhbmdlTGlzdGVuZXIobWFzaywgY2FsbGJhY2spOwogICAgICAgICAgICAgfQogICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudGl0eVRva2VuKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHJlbW92ZVN0YXR1c0NoYW5nZUxpc3RlbmVyKElTeW5jU3RhdHVzT2JzZX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XJhdG9yIGV4dGVuZHMgSUludGVyZmFjZSB7CisgICAgLyoqIExvY2FsLXNpZGUgSVBDIGltcGxlbWVudGF0aW9uIHN0dWIgY2xhc3MuICovCisgICAgcHVibGljIHN0YXRpYyBhYnN0cmFjdCBjbGFzcyBTdHViIGV4dGVuZHMgQmluZGVyIGltcGxlbWVudHMgSUVudGl0eUl0ZXJhdG9yIHsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIFRBRyA9ICJJRW50aXR5SXRlcmF0b3IiOworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBqYXZhLmxhbmcuU3RyaW5nIERFU0NSSVBUT1IgPSAiYW5kcm9pZC5jb250ZW50LklFbnRpdHlJdGVyYXRvciI7CisKKyAgICAgICAgLyoqIENvbnN0cnVjdCB0aGUgc3R1YiBhdCBhdHRhY2ggaXQgdG8gdGhlIGludGVyZmFjZS4gKi8KKyAgICAgICAgcHVibGljIFN0dWIoKSB7CisgICAgICAgICAgICB0aGlzLmF0dGFjaEludGVyZmFjZSh0aGlzLCBERVNDUklQVE9SKTsKKyAgICAgICAgfQorICAgICAgICAvKioKKyAgICAgICAgICogQ2FzdCBhbiBJQmluZGVyIG9iamVjdCBpbnRvIGFuIElFbnRpdHlJdGVyYXRvciBpbnRlcmZhY2UsCisgICAgICAgICAqIGdlbmVyYXRpbmcgYSBwcm94eSBpZiBuZWVkZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIElFbnRpdHlJdGVyYXRvciBhc0ludGVyZmFjZShJQmluZGVyIG9iaikgeworICAgICAgICAgICAgaWYgKChvYmo9PW51bGwpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBJSW50ZXJmYWNlIGlpbiA9IG9iai5xdWVyeUxvY2FsSW50ZXJmYWNlKERFU0NSSVBUT1IpOworICAgICAgICAgICAgaWYgKCgoaWluIT1udWxsKSYmKGlpbiBpbnN0YW5jZW9mIElFbnRpdHlJdGVyYXRvcikpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuICgoSUVudGl0eUl0ZXJhdG9yKWlpbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbmV3IElFbnRpdHlJdGVyYXRvci5TdHViLlByb3h5KG9iaik7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgSUJpbmRlciBhc0JpbmRlcigpIHsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25UcmFuc2FjdChpbnQgY29kZSwgUGFyY2VsIGRhdGEsIFBhcmNlbCByZXBseSwgaW50IGZsYWdzKQorICAgICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgc3dpdGNoIChjb2RlKSB7CisgICAgICAgICAgICAgICAgY2FzZSBJTlRFUkZBQ0VfVFJBTlNBQ1RJT046CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZVN0cmluZyhERVNDUklQVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY2FzZSBUUkFOU0FDVElPTl9oYXNOZXh0OgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKERFU0NSSVBUT1IpOworICAgICAgICAgICAgICAgICAgICBib29sZWFuIF9yZXN1bHQ7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBfcmVzdWx0ID0gdGhpcy5oYXNOZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJjYXVnaHQgZXhjZXB0aW9uIGluIGhhc05leHQoKSIsIGUpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVFeGNlcHRpb24oZSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlSW50KCgoX3Jlc3VsdCk/KDEpOigwKSkpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIFRSQU5TQUNUSU9OX25leHQ6CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoREVTQ1JJUFRPUik7CisgICAgICAgICAgICAgICAgICAgIEVudGl0eSBlbnRpdHk7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnRpdHkgPSB0aGlzLm5leHQoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImNhdWdodCBleGNlcHRpb24gaW4gbmV4dCgpIiwgZSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZUV4Y2VwdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgZW50aXR5LndyaXRlVG9QYXJjZWwocmVwbHksIFBhcmNlbGFibGUuUEFSQ0VMQUJMRV9XUklURV9SRVRVUk5fVkFMVUUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIFRSQU5TQUNUSU9OX3Jlc2V0OgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKERFU0NSSVBUT1IpOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNldCgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiY2F1Z2h0IGV4Y2VwdGlvbiBpbiBuZXh0KCkiLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlRXhjZXB0aW9uKGUpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIFRSQU5TQUNUSU9OX2Nsb3NlOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKERFU0NSSVBUT1IpOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiY2F1Z2h0IGV4Y2VwdGlvbiBpbiBjbG9zZSgpIiwgZSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZUV4Y2VwdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHN1cGVyLm9uVHJhbnNhY3QoY29kZSwgZGF0YSwgcmVwbHksIGZsYWdzKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFByb3h5IGltcGxlbWVudHMgSUVudGl0eUl0ZXJhdG9yIHsKKyAgICAgICAgICAgIHByaXZhdGUgSUJpbmRlciBtUmVtb3RlOworICAgICAgICAgICAgUHJveHkoSUJpbmRlciByZW1vdGUpIHsKKyAgICAgICAgICAgICAgICBtUmVtb3RlID0gcmVtb3RlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcHVibGljIElCaW5kZXIgYXNCaW5kZXIoKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1SZW1vdGU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwdWJsaWMgamF2YS5sYW5nLlN0cmluZyBnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBERVNDUklQVE9SOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzTmV4dCgpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgICAgIFBhcmNlbCBfZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKKyAgICAgICAgICAgICAgICBQYXJjZWwgX3JlcGx5ID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICAgICAgICAgIGJvb2xlYW4gX3Jlc3VsdDsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBfZGF0YS53cml0ZUludGVyZmFjZVRva2VuKERFU0NSSVBUT1IpOworICAgICAgICAgICAgICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KFN0dWIuVFJBTlNBQ1RJT05faGFzTmV4dCwgX2RhdGEsIF9yZXBseSwgMCk7CisgICAgICAgICAgICAgICAgICAgIF9yZXBseS5yZWFkRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIF9yZXN1bHQgPSAoMCE9X3JlcGx5LnJlYWRJbnQoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICBfcmVwbHkucmVjeWNsZSgpOworICAgICAgICAgICAgICAgICAgICBfZGF0YS5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBfcmVzdWx0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgRW50aXR5IG5leHQoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICBQYXJjZWwgX2RhdGEgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgICAgICAgICAgUGFyY2VsIF9yZXBseSA9IFBhcmNlbC5vYnRhaW4oKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBfZGF0YS53cml0ZUludGVyZmFjZVRva2VuKERFU0NSSVBUT1IpOworICAgICAgICAgICAgICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KFN0dWIuVFJBTlNBQ1RJT05fbmV4dCwgX2RhdGEsIF9yZXBseSwgMCk7CisgICAgICAgICAgICAgICAgICAgIF9yZXBseS5yZWFkRXhjZXB0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBFbnRpdHkuQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKF9yZXBseSk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgX3JlcGx5LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgX2RhdGEucmVjeWNsZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHVibGljIHZvaWQgcmVzZXQoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICBQYXJjZWwgX2RhdGEgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgICAgICAgICAgUGFyY2VsIF9yZXBseSA9IFBhcmNlbC5vYnRhaW4oKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBfZGF0YS53cml0ZUludGVyZmFjZVRva2VuKERFU0NSSVBUT1IpOworICAgICAgICAgICAgICAgICAgICBtUmVtb3RlLnRyYW5zYWN0KFN0dWIuVFJBTlNBQ1RJT05fcmVzZXQsIF9kYXRhLCBfcmVwbHksIDApOworICAgICAgICAgICAgICAgICAgICBfcmVwbHkucmVhZEV4Y2VwdGlvbigpOworICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIF9yZXBseS5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgICAgIF9kYXRhLnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICAgICAgUGFyY2VsIF9kYXRhID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICAgICAgICAgIFBhcmNlbCBfcmVwbHkgPSBQYXJjZWwub2J0YWluKCk7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgX2RhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihERVNDUklQVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgbVJlbW90ZS50cmFuc2FjdChTdHViLlRSQ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WQuY29udGVudC5wbS5MYWJlbGVkSW50ZW50fSBvYmplY3RzIGFzIHNldCB3aXRoCisgICAgICoge0BsaW5rICNwdXRFeHRyYShTdHJpbmcsIFBhcmNlbGFibGVbXSl9IG9mIGFkZGl0aW9uYWwgYWN0aXZpdGllcyB0byBwbGFjZQorICAgICAqIGEgdGhlIGZyb250IG9mIHRoZSBsaXN0IG9mIGNob2ljZXMsIHdoZW4gc2hvd24gdG8gdGhlIHVzZXIgd2l0aCBhCisgICAgICoge0BsaW5rICNBQ1RJT05fQ0hPT1NFUn0uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRVhUUkFfSU5JVElBTF9JTlRFTlRTID0gImFuZHJvaWQuaW50ZW50LmV4dHJhLklOSVRJQUxfSU5URU5UUyI7CisKKyAgICAvKioKICAgICAgKiBBIHtAbGluayBhbmRyb2lkLnZpZXcuS2V5RXZlbnR9IG9iamVjdCBjb250YWluaW5nIHRoZSBldmVudCB0aGF0CiAgICAgICogdHJpZ2dlcmVkIHRoZSBjcmVhdGlvbiBvZiB0aGUgSW50ZW50IGl0IGlzIGluLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX0tFWV9FVkVOVCA9ICJhbmRyb2lkLmludGVudC5leHRyYS5LRVlfRVZFTlQiOwogCiAgICAgLyoqCisgICAgICogU2V0IHRvIHRydWUgaW4ge0BsaW5rICNBQ1RJT05fUkVRVUVTVF9TSFVURE9XTn0gdG8gcmVxdWVzdCBjb25maXJtYXRpb24gZnJvbSB0aGUgdXNlcgorICAgICAqIGJlZm9yZSBzaHV0dGluZyBkb3duLgorICAgICAqCisgICAgICoge0BoaWRlfQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX0tFWV9DT05GSVJNID0gImFuZHJvaWQuaW50ZW50LmV4dHJhLktFWV9DT05GSVJNIjsKKworICAgIC8qKgogICAgICAqIFV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biBpbnQgdmFsdWUgZm9yIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuSW50ZW50I0VYVFJBX0RPQ0tfU1RBVEV9CisgICAgICogdG8gcmVwcmVzZW50IHRoYXQgdGhlIHBob25lIGlzIG5vdCBpbiBhbnkgZG9jay4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEVYVFJBX0RPQ0tfU1RBVEVfVU5ET0NLRUQgPSAwOworCisgICAgLyoqCisgICAgICogVXNlZCBhcyBhbiBpbnQgdmFsdWUgZm9yIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuSW50ZW50I0VYVFJBX0RPQ0tfU1RBVEV9CisgICAgICogdG8gcmVwcmVzZW50IHRoYXQgdGhlIHBob25lIGlzIGluIGEgZGVzayBkb2NrLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRVhUUkFfRE9DS19TVEFURV9ERVNLID0gMTsKKworICAgIC8qKgorICAgICAqIFVzZWQgYXMgYW4gaW50IHZhbHVlIGZvciB7QGxpbmsgYW5kcm9pZC5jb250ZW50LkludGVudCNFWFRSQV9ET0NLX1NUQVRFfQorICAgICAqIHRvIHJlcHJlc2VudCB0aGF0IHRoZSBwaG9uZSBpcyBpbiBhIGNhciBkb2NrLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRVhUUkFfRE9DS19TVEFURV9DQVIgPSAyOworCisgICAgLyoqCiAgICAgICogVXNlZCBhcyBhIHBhcmNlbGFibGUgZXh0cmEgZmllbGQgaW4ge0BsaW5rICNBQ1RJT05fQVBQX0VSUk9SfSwgY29udGFpbmluZwogICAgICAqIHRoZSBidWcgcmVwb3J0LgogICAgICAqCkBAIC0xOTQzLDYgKzIwNDgsMzkgQEAKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9JTlNUQUxMRVJfUEFDS0FHRV9OQU1FCiAgICAgICAgICAgICA9ICJhbmRyb2lkLmludGVudC5leHRyYS5JTlNUQUxMRVJfUEFDS0FHRV9OQU1FIjsKIAorICAgIC8qKgorICAgICAqIFVzZWQgaW4gdGhlIGV4dHJhIGZpZWxkIGluIHRoZSByZW1vdGUgaW50ZW50LiBJdCdzIGFzdHJpbmcgdG9rZW4gcGFzc2VkIHdpdGggdGhlCisgICAgICogcmVtb3RlIGludGVudC4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9SRU1PVEVfSU5URU5UX1RPS0VOID0KKyAgICAgICAgICAgICJhbmRyb2lkLmludGVudC5leHRyYS5yZW1vdGVfaW50ZW50X3Rva2VuIjsKKworICAgIC8qKgorICAgICAqIFVzZWQgYXMgYW4gaW50IGV4dHJhIGZpZWxkIGluIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuSW50ZW50I0FDVElPTl9QQUNLQUdFX0NIQU5HRUR9CisgICAgICogaW50ZW50IHRvIHN1cHBseSB0aGUgbmFtZSBvZiB0aGUgY29tcG9uZW50IHRoYXQgY2hhbmdlZC4KKyAgICAgKgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX0NIQU5HRURfQ09NUE9ORU5UX05BTUUgPQorICAgICAgICAgICAgImFuZHJvaWQuaW50ZW50LmV4dHJhLmNoYW5nZWRfY29tcG9uZW50X25hbWUiOworCisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKiBNYWdpYyBleHRyYSBzeXN0ZW0gY29kZSBjYW4gdXNlIHdoZW4gYmluZGluZywgdG8gZ2l2ZSBhIGxhYmVsIGZvcgorICAgICAqIHdobyBpdCBpcyB0aGF0IGhhcyBib3VuZCB0byBhIHNlcnZpY2UuICBUaGlzIGlzIGFuIGludGVnZXIgZ2l2aW5nCisgICAgICogYSBmcmFtZXdvcmsgc3RyaW5nIHJlc291cmNlIHRoYX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bG9hZGluZzsKKyAgICAgICAgdGhpcy5pc0tleSA9IGZhbHNlOworICAgIH0KKworICAgIHByaXZhdGUgU3luY0FkYXB0ZXJUeXBlKFN0cmluZyBhdXRob3JpdHksIFN0cmluZyBhY2NvdW50VHlwZSkgeworICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoYXV0aG9yaXR5KSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigidGhlIGF1dGhvcml0eSBtdXN0IG5vdCBiZSBlbXB0eTogIiArIGF1dGhvcml0eSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGFjY291bnRUeXBlKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigidGhlIGFjY291bnRUeXBlIG11c3Qgbm90IGJlIGVtcHR5OiAiICsgYWNjb3VudFR5cGUpOworICAgICAgICB9CisgICAgICAgIHRoaXMuYXV0aG9yaXR5ID0gYXV0aG9yaXR5OworICAgICAgICB0aGlzLmFjY291bnRUeXBlID0gYWNjb3VudFR5cGU7CisgICAgICAgIHRoaXMudXNlclZpc2libGUgPSB0cnVlOworICAgICAgICB0aGlzLnN1cHBvcnRzVXBsb2FkaW5nID0gdHJ1ZTsKKyAgICAgICAgdGhpcy5pc0tleSA9IHRydWU7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gc3VwcG9ydHNVcGxvYWRpbmcoKSB7CisgICAgICAgIGlmIChpc0tleSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgInRoaXMgbWV0aG9kIGlzIG5vdCBhbGxvd2VkIHRvIGJlIGNhbGxlZCB3aGVuIHRoaXMgaXMgYSBrZXkiKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc3VwcG9ydHNVcGxvYWRpbmc7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNVc2VyVmlzaWJsZSgpIHsKKyAgICAgICAgaWYgKGlzS2V5KSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAidGhpcyBtZXRob2QgaXMgbm90IGFsbG93ZWQgdG8gYmUgY2FsbGVkIHdoZW4gdGhpcyBpcyBhIGtleSIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiB1c2VyVmlzaWJsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFN5bmNBZGFwdGVyVHlwZSBuZXdLZXkoU3RyaW5nIGF1dGhvcml0eSwgU3RyaW5nIGFjY291bnRUeXBlKSB7CisgICAgICAgIHJldHVybiBuZXcgU3luY0FkYXB0ZXJUeXBlKGF1dGhvcml0eSwgYWNjb3VudFR5cGUpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3QgbykgeworICAgICAgICBpZiAobyA9PSB0aGlzKSByZXR1cm4gdHJ1ZTsKKyAgICAgICAgaWYgKCEobyBpbnN0YW5jZW9mIFN5bmNBZGFwdGVyVHlwZSkpIHJldHVybiBmYWxzZTsKKyAgICAgICAgZmluYWwgU3luY0FkYXB0ZXJUeXBlIG90aGVyID0gKFN5bmNBZGFwdGVyVHlwZSlvOworICAgICAgICAvLyBkb24ndCBpbmNsdWRlIHVzZXJWaXNpYmxlIG9yIHN1cHBvcnRzVXBsb2FkaW5nIGluIHRoZSBlcXVhbGl0eSBjaGVjaworICAgICAgICByZXR1cm4gYXV0aG9yaXR5LmVxdWFscyhvdGhlci5hdXRob3JpdHkpICYmIGFjY291bnRUeXBlLmVxdWFscyhvdGhlci5hY2NvdW50VHlwZSk7CisgICAgfQorCisgICAgcHVibGljIGludCBoYXNoQ29kZSgpIHsKKyAgICAgICAgaW50IHJlc3VsdCA9IDE3OworICAgICAgICByZXN1bHQgPSAzMSAqIHJlc3VsdCArIGF1dGhvcml0eS5oYXNoQ29kZSgpOworICAgICAgICByZXN1bHQgPSAzMSAqIHJlc3VsdCArIGFjY291bnRUeXBlLmhhc2hDb2RlKCk7CisgICAgICAgIC8vIGRvbid0IGluY2x1ZGUgdXNlclZpc2libGUgb3Igc3VwcG9ydHNVcGxvYWRpbmcgIHRoZSBoYXNoCisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgaWYgKGlzS2V5KSB7CisgICAgICAgICAgICByZXR1cm4gIlN5bmNBZGFwdGVyVHlwZSBLZXkge25hbWU9IiArIGF1dGhvcml0eQorICAgICAgICAgICAgICAgICAgICArICIsIHR5cGU9IiArIGFjY291bnRUeXBlCisgICAgICAgICAgICAgICAgICAgICsgIn0iOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuICJTeW5jQWRhcHRlclR5cGUge25hbWU9IiArIGF1dGhvcml0eQorICAgICAgICAgICAgICAgICAgICArICIsIHR5cGU9IiArIGFjY291bnRUeXBlCisgICAgICAgICAgICAgICAgICAgICsgIiwgdXNlclZpc2libGU9IiArIHVzZXJWaXNpYmxlCisgICAgICAgICAgICAgICAgICAgICsgIiwgc3VwcG9ydHNVcGxvYWRpbmc9IiArIHN1cHBvcnRzVXBsb2FkaW5nCisgICAgICAgICAgICAgICAgICAgICsgIn0iOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgaWYgKGlzS2V5KSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJrZXlzIGFyZW4ndCBwYXJjZWxhYmxlIik7CisgICAgICAgIH0KKworICAgICAgICBkZXN0LndyaXRlU3RyaW5nKGF1dGhvcml0eSk7CisgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcoYWNjb3VudFR5cGUpOworICAgICAgICBkZXN0LndyaXRlSW50KHVzZXJWaXNpYmxlID8gMSA6IDApOworICAgICAgICBkZXN0LndyaXRlSW50KHN1cHBvcnRzVXBsb2FkaW5nID8gMSA6IDApOworICAgIH0KKworICAgIHB1YmxpYyBTeW5jQWRhcHRlclR5cGUoUGFyY2VsIHNvdXJjZSkgeworICAgICAgICB0aGlzKAorICAgICAgICAgICAgICAgIHNvdXJjZS5yZWFkU3RyaW5nKCksCisgICAgICAgICAgICAgICAgc291cmNlLnJlYWRTdHJpbmcoKSwKKyAgICAgICAgICAgICAgICBzb3VyY2UucmVhZEludCgpICE9IDAsCisgICAgICAgICAgICAgICAgc291cmNlLnJlYWRJbnQoKSAhPSAwKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIENyZWF0b3I8U3luY0FkYXB0ZXJUeXBlPiBDUkVBVE9SID0gbmV3IENyZWF0b3I8U3luY0FkYXB0ZXJUeXBlPigpIHsKKyAgICAgICAgcHVibGljIFN5bmNBZGFwdGVyVHlwZSBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBzb3VyY2UpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgU3luY0FkYXB0ZXJUeXBlKHNvdXJjZSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgU3luY0FkYXB0ZXJUeXBlW10gbmV3QXJyYXkoaW50IHNpemUpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgU3luY0FkYXB0ZXJUeXBlW3NpemVdOworICAgICAgICB9CisgICAgfTsKK30KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L1N5bmNBZGFwdGVyc0NhY2hlLmphdmEgYi9jb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TUUpOworICAgIH0KKworICAgIHB1YmxpYyBTeW5jQWRhcHRlclR5cGUgcGFyc2VTZXJ2aWNlQXR0cmlidXRlcyhTdHJpbmcgcGFja2FnZU5hbWUsIEF0dHJpYnV0ZVNldCBhdHRycykgeworICAgICAgICBUeXBlZEFycmF5IHNhID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkub2J0YWluQXR0cmlidXRlcyhhdHRycywKKyAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5TeW5jQWRhcHRlcik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBmaW5hbCBTdHJpbmcgYXV0aG9yaXR5ID0KKyAgICAgICAgICAgICAgICAgICAgc2EuZ2V0U3RyaW5nKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlN5bmNBZGFwdGVyX2NvbnRlbnRBdXRob3JpdHkpOworICAgICAgICAgICAgZmluYWwgU3RyaW5nIGFjY291bnRUeXBlID0KKyAgICAgICAgICAgICAgICAgICAgc2EuZ2V0U3RyaW5nKGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlN5bmNBZGFwdGVyX2FjY291bnRUeXBlKTsKKyAgICAgICAgICAgIGlmIChhdXRob3JpdHkgPT0gbnVsbCB8fCBhY2NvdW50VHlwZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmaW5hbCBib29sZWFuIHVzZXJWaXNpYmxlID0KKyAgICAgICAgICAgICAgICAgICAgc2EuZ2V0Qm9vbGVhbihjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5TeW5jQWRhcHRlcl91c2VyVmlzaWJsZSwgdHJ1ZSk7CisgICAgICAgICAgICBmaW5hbCBib29sZWFuIHN1cHBvcnRzVXBsb2FkaW5nID0KKyAgICAgICAgICAgICAgICAgICAgc2EuZ2V0Qm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ICAgICAgICBTdHJpbmcgYWN0aW9uID0gaW50ZW50LmdldEFjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICBpZiAoSW50ZW50LkFDVElPTl9ERVZJQ0VfU1RPUkFHRV9MT1cuZXF1YWxzKGFjdGlvbikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIkludGVybmFsIHN0b3JhZ2UgaXMgbG93LiIpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbVN0b3JhZ2VJc0xvdyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW5jZWxBY3RpdmVTeW5jKG51bGwgLyogbm8gdXJsICovKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbmNlbEFjdGl2ZVN5bmMobnVsbCAvKiBhbnkgYWNjb3VudCAqLywgbnVsbCAvKiBhbnkgYXV0aG9yaXR5ICovKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChJbnRlbnQuQUNUSU9OX0RFVklDRV9TVE9SQUdFX09LLmVxdWFscyhhY3Rpb24pKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJJbnRlcm5hbCBzdG9yYWdlIGlzIG9rLiIpOwpAQCAtMTcyLDYgKzE3NCw1NyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH07CiAKKyAgICBwcml2YXRlIEJyb2FkY2FzdFJlY2VpdmVyIG1Cb290Q29tcGxldGVkUmVjZWl2ZXIgPSBuZXcgQnJvYWRjYXN0UmVjZWl2ZXIoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgICAgIGlmICghbUZhY3RvcnlUZXN0KSB7CisgICAgICAgICAgICAgICAgbUJvb3RDb21wbGV0ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIEFjY291bnRNYW5hZ2VyLmdldChtQ29udGV4dCkuYWRkT25BY2NvdW50c1VwZGF0ZWRMaXN0ZW5lcihTeW5jTWFuYWdlci50aGlzLAorICAgICAgICAgICAgICAgICAgICAgICAgbVN5bmNIYW5kbGVyLCB0cnVlIC8qIHVwZGF0ZUltbWVkaWF0ZWx5ICovKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICBwdWJsaWMgdm9pZCBvbkFjY291bnRzVXBkYXRlZChBY2NvdW50W10gYWNjb3VudHMpIHsKKyAgICAgICAgLy8gcmVtZW1iZXIgaWYgdGhpcyB3YXMgdGhlIGZpcnN0IHRpbWUgdGhpcyB3YXMgY2FsbGVkIGFmdGVyIGFuIHVwZGF0ZQorICAgICAgICBmaW5hbCBib29sZWFuIGp1c3RCb290ZWRVcCA9IG1BY2NvdW50cyA9PSBudWxsOworICAgICAgICBtQWNjb3VudHMgPSBhY2NvdW50czsKKworICAgICAgICAvLyBpZiBhIHN5bmMgaXMgaW4gcHJvZ3Jlc3MgeWV0IGl0IGlzIG5vIGxvbmdlciBpbiB0aGUgYWNjb3VudHMgbGlzdCwKKyAgICAgICAgLy8gY2FuY2VsIGl0CisgICAgICAgIEFjdGl2ZVN5bmNDb250ZXh0IGFjdGl2ZVN5bmNDb250ZXh0ID0gbUFjdGl2ZVN5bmNDb250ZXh0OworICAgICAgICBpZiAoYWN0aXZlU3luY0NvbnRleHQgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKCFBcnJheVV0aWxzLmNvbnRhaW5zKGFjY291bnRzLCBhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5hY2NvdW50KSkgeworICAgICAgICAg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c3RlclJlY2VpdmVyKG1TdG9yYWdlSW50ZW50UmVjZWl2ZXIsIGludGVudEZpbHRlcik7CkBAIC0yODIsNDggKzM1NiwxMiBAQAogICAgICAgICBtSGFuZGxlQWxhcm1XYWtlTG9jay5zZXRSZWZlcmVuY2VDb3VudGVkKGZhbHNlKTsKIAogICAgICAgICBtU3luY1N0b3JhZ2VFbmdpbmUuYWRkU3RhdHVzQ2hhbmdlTGlzdGVuZXIoCi0gICAgICAgICAgICAgICAgU3luY1N0b3JhZ2VFbmdpbmUuQ0hBTkdFX1NFVFRJTkdTLCBuZXcgSVN5bmNTdGF0dXNPYnNlcnZlci5TdHViKCkgeworICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlci5TWU5DX09CU0VSVkVSX1RZUEVfU0VUVElOR1MsIG5ldyBJU3luY1N0YXR1c09ic2VydmVyLlN0dWIoKSB7CiAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvblN0YXR1c0NoYW5nZWQoaW50IHdoaWNoKSB7CiAgICAgICAgICAgICAgICAgLy8gZm9yY2UgdGhlIHN5bmMgbG9vcCB0byBydW4gaWYgdGhlIHNldHRpbmdzIGNoYW5nZQogICAgICAgICAgICAgICAgIHNlbmRDaGVja0FsYXJtc01lc3NhZ2UoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSk7Ci0gICAgICAgIAotICAgICAgICBpZiAoIWZhY3RvcnlUZXN0KSB7Ci0gICAgICAgICAgICBBY2NvdW50TW9uaXRvckxpc3RlbmVyIGxpc3RlbmVyID0gbmV3IEFjY291bnRNb25pdG9yTGlzdGVuZXIoKSB7Ci0gICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25BY2NvdW50c1VwZGF0ZWQoU3RyaW5nW10gYWNjb3VudHMpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBoYWRBY2NvdW50c0FscmVhZHkgPSBtQWNjb3VudHMgIT0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgLy8gY29weSB0aGUgYWNjb3VudHMgaW50byBhIG5ldyBhcnJheSBhbmQgY2hhbmdlIG1BY2NvdW50cyB0byBwb2ludCB0byBpdAotICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBuZXdBY2NvdW50cyA9IG5ldyBTdHJpbmdbYWNjb3VudHMubGVuZ3RoXTsKLSAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShhY2NvdW50cywgMCwgbmV3QWNjb3VudHMsIDAsIGFjY291bnRzLmxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgICAgIG1BY2NvdW50cyA9IG5ld0FjY291bnRzOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIGlmIGEgc3luYyBpcyBpbiBwcm9ncmVzcyB5ZXQgaXQgaXMgbm8gbG9uZ2VyIGluIHRoZSBhY2NvdW50cyBsaXN0LCBjYW5jZWwgaXQKLSAgICAgICAgICAgICAgICAgICAgQWN0aXZlU3luY0NvbnRleHQgYWN0aXZlU3luY0NvbnRleHQgPSBtQWN0aXZlU3luY0NvbnRleHQ7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChhY3RpdmVTeW5jQ29udGV4dCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUFycmF5VXRpbHMuY29udGFpbnMobmV3QWNjb3VudHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uLmFjY291bnQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiY2FuY2VsaW5nIHN5bmMgc2luY2UgdGhlIGFjY291bnQgaGFzIGJlZW4gcmVtb3ZlZCIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRTeW5jRmluaXNoZWRPckNhbmNlbGVkTWVzc2FnZShhY3RpdmVTeW5jQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwgLyogbm8gcmVzdWx0IHNpbmNlIHRoaXMgaXMgYSBjYW5jZWwgKi8pOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gd2UgbXVzdCBkbyB0aGlzIHNpbmNlIHdlIGRvbid0IGJvdGhlciBzY2hlZHVsaW5nIGFsYXJtcyB3aGVuCi0gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBhY2NvdW50cyBhcmUgbm90IHNldCB5ZXQKLSAgICAgICAgICAgICAgICAgICAgc2VuZENoZWNrQWxhcm1zTWVzc2FnZSgpOwotCi0gICAgICAgICAgICAgICAgICAgIG1TeW5jU3RvcmFnZUVuZ2luZS5kb0RhdGFiYXNlQ2xlYW51cChhY2NvdW50cyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGhhZEFjY291bnRzQWxyZWFkeSAmJiBtQWNjb3VudHMubGVuZ3RoID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWVzdCBhIHN5bmMgc28gdGhhdCBpZiB0aGUgcGFzc3dvcmQgd2FzIGNoYW5nZWQgd2Ugd2lsbCByZXRyeSBhbnkgc3luYwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhhdCBmYWlsZWQgd2hlbiBpdCB3YXMgd3JvbmcKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0U3luYyhudWxsIC8qIGFsbCBwcm92aWRlcnMgKi8sIG51bGwgLyogbm8gZXh0cmFzICovKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH07Ci0gICAgICAgICAgICBtQWNjb3VudE1vbml0b3IgPSBuZXcgQWNjb3VudE1vbml0b3IoY29udGV4dCwgbGlzdGVuZXIpOwotICAgICAgICB9CiAgICAgfQogCiAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBpbml0aWFsaXpl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ZAogKiAgICAgICAgICBpZiB0aGUgdXJsIGlzIG51bGwuCiAgICAgICogQHBhcmFtIGRlbGF5IGhvdyBtYW55IG1pbGxpc2Vjb25kcyBpbiB0aGUgZnV0dXJlIHRvIHdhaXQgYmVmb3JlIHBlcmZvcm1pbmcgdGhpcwotICAgICAqICAgc3luYy4gLTEgbWVhbnMgdG8gbWFrZSB0aGlzIHRoZSBuZXh0IHN5bmMgdG8gcGVyZm9ybS4KKyAgICAgKiBAcGFyYW0gb25seVRob3NlV2l0aFVua293blN5bmNhYmxlU3RhdGUKICAgICAgKi8KLSAgICBwdWJsaWMgdm9pZCBzY2hlZHVsZVN5bmMoVXJpIHVybCwgQnVuZGxlIGV4dHJhcywgbG9uZyBkZWxheSkgeworICAgIHB1YmxpYyB2b2lkIHNjaGVkdWxlU3luYyhBY2NvdW50IHJlcXVlc3RlZEFjY291bnQsIFN0cmluZyByZXF1ZXN0ZWRBdXRob3JpdHksCisgICAgICAgICAgICBCdW5kbGUgZXh0cmFzLCBsb25nIGRlbGF5LCBib29sZWFuIG9ubHlUaG9zZVdpdGhVbmtvd25TeW5jYWJsZVN0YXRlKSB7CiAgICAgICAgIGJvb2xlYW4gaXNMb2dnYWJsZSA9IExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpOwotICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgTG9nLnYoVEFHLCAic2NoZWR1bGVTeW5jOiIKLSAgICAgICAgICAgICAgICAgICAgKyAiIGRlbGF5ICIgKyBkZWxheQotICAgICAgICAgICAgICAgICAgICArICIsIHVybCAiICsgKCh1cmwgPT0gbnVsbCkgPyAiKG51bGwpIiA6IHVybCkKLSAgICAgICAgICAgICAgICAgICAgKyAiLCBleHRyYXMgIiArICgoZXh0cmFzID09IG51bGwpID8gIihudWxsKSIgOiBleHRyYXMpKTsKKworICAgICAgICBpZiAoIW1Cb290Q29tcGxldGVkKSB7CisgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgeworICAgICAgICAgICAgICAgIExvZy52KFRBRywgInN1cHByZXNzaW5nIHNjaGVkdWxlU3luYygpIHNpbmNlIGJvb3QgaGFzbid0IGNvbXBsZXRlZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKICAgICAgICAgaWYgKCFpc1N5bmNFbmFibGVkKCkpIHsKQEAgLTUyNCw2ICs1NTksMTQgQEAKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCisgICAgICAgIGlmICghZ2V0Q29ubmVjdGl2aXR5TWFuYWdlcigpLmdldEJhY2tncm91bmREYXRhU2V0dGluZygpKSB7CisgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgeworICAgICAgICAgICAgICAgIExvZy52KFRBRywgIm5vdCBzeW5jaW5nIGJlY2F1c2UgYmFja2dyb3VuZCBkYXRhIHVzYWdlIGlzbid0IGFsbG93ZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNldFN0YXR1c1RleHQoIlN5bmMgaXMgZGlzYWJsZWQuIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKwogICAgICAgICBpZiAobUFjY291bnRzID09IG51bGwpIHNldFN0YXR1c1RleHQoIlRoZSBhY2NvdW50cyBhcmVuJ3Qga25vd24geWV0LiIpOwogICAgICAgICBpZiAoIW1EYXRhQ29ubmVjdGlvbklzQ29ubmVjdGVkKSBzZXRTdGF0dXNUZXh0KCJObyBkYXRhIGNvbm5lY3Rpb24iKTsKICAgICAgICAgaWYgKG1TdG9yYWdlSXNMb3cpIHNldFN0YXR1c1RleHQoIk1lbW9yeSBsb3ciKTsKQEAgLTUzNSwxMCArNTc4LDkgQEAKICAgICAgICAgICAgIGRlbGF5ID0gLTE7IC8vIHRoaXMgbWVhbnMgc2NoZWR1bGUgYXQgdGhlIGZyb250IG9mIHRoZSBxdWV1ZQogICAgICAgICB9CiAKLSAgICAgICAgU3RyaW5nW10gYWNjb3VudHM7Ci0gICAgICAgIFN0cmluZyBhY2NvdW50RnJvbUV4dHJhcyA9IGV4dHJhcy5nZXRTdHJpbmcoQ29udGVudFJlc29sdmVyLlNZTkNfRVhUUkFTX0FDQ09VTlQpOwotICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGFjY291bnRGcm9tRXh0cmFzKSkgewotICAgICAgICAgICAgYWNjb3VudHMgPSBuZXcgU3RyaW5nW117YWNjb3VudEZyb21FeHRyYXN9OworICAgICAgICBBY2NvdW50W10gYWNjb3VudHM7CisgICAgICAgIGlmIChyZXF1ZXN0ZWRBY2NvdW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGFjY291bnRzID0gbmV3IEFjY291bnRbXXtyZXF1ZXN0ZWRBY2NvdW50fTsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIC8vIGlmIHRoZSBhY2NvdW50cyBhcmVuJ3QgY29uZmlndXJlZCB5ZXQgdGhlbiB3ZSBjYW4ndCBzdXBwb3J0IGFuIGFjY291bnQtbGVzcwogICAgICAgICAgICAgLy8gc3luYyByZXF1ZXN0CkBAIC01NjAsMTQgKzYwMiwxNCBAQAogICAgICAgICB9CiAKICAgICAgICAgZmluYWwgYm9vbGVhbiB1cGxvYWRPbmx5ID0gZXh0cmFzLmdldEJvb2xlYW4oQ29udGVudFJlc29sdmVyLlNZTkNfRVhUUkFTX1VQTE9BRCwgZmFsc2UpOwotICAgICAgICBmaW5hbCBib29sZWFuIGZvcmNlID0gZXh0cmFzLmdldEJvb2xlYW4oQ29udGVudFJlc29sdmVyLlNZTkNfRVhUUkFTX0ZPUkNFLCBmYWxzZSk7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbWFudWFsU3luYyA9IGV4dHJhcy5nZXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19NQU5VQUwsIGZhbHNlKTsKIAogICAgICAgICBpbnQgc291cmNlOwogICAgICAgICBpZiAodXBsb2FkT25seSkgew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hbHMobmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIC8vIGlmIHRoZSB1cmwgd2FzIHNwZWNpZmllZCB0aGVuIHJlcGxhY2UgdGhlIGxpc3Qgb2YgYXV0aG9yaXRpZXMgd2l0aCBqdXN0IHRoaXMgYXV0aG9yaXR5CisgICAgICAgIC8vIG9yIGNsZWFyIGl0IGlmIHRoaXMgYXV0aG9yaXR5IGlzbid0IHN5bmNhYmxlCisgICAgICAgIGlmIChyZXF1ZXN0ZWRBdXRob3JpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBoYXNTeW5jQWRhcHRlciA9IHN5bmNhYmxlQXV0aG9yaXRpZXMuY29udGFpbnMocmVxdWVzdGVkQXV0aG9yaXR5KTsKKyAgICAgICAgICAgIHN5bmNhYmxlQXV0aG9yaXRpZXMuY2xlYXIoKTsKKyAgICAgICAgICAgIGlmIChoYXNTeW5jQWRhcHRlcikgc3luY2FibGVBdXRob3JpdGllcy5hZGQocmVxdWVzdGVkQXV0aG9yaXR5KTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIGJvb2xlYW4gbWFzdGVyU3luY0F1dG9tYXRpY2FsbHkgPSBtU3luY1N0b3JhZ2VFbmdpbmUuZ2V0TWFzdGVyU3luY0F1dG9tYXRpY2FsbHkoKTsKKworICAgICAgICBmb3IgKFN0cmluZyBhdXRob3JpdHkgOiBzeW5jYWJsZUF1dGhvcml0aWVzKSB7CisgICAgICAgICAgICBmb3IgKEFjY291bnQgYWNjb3VudCA6IGFjY291bnRzKSB7CisgICAgICAgICAgICAgICAgaW50IGlzU3luY2FibGUgPSBtU3luY1N0b3JhZ2VFbmdpbmUuZ2V0SXNTeW5jYWJsZShhY2NvdW50LCBhdXRob3JpdHkpOworICAgICAgICAgICAgICAgIGlmIChpc1N5bmNhYmxlID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChvbmx5VGhvc2VXaXRoVW5rb3duU3luY2FibGVTdGF0ZSAmJiBpc1N5bmNhYmxlID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZpbmFsIFJlZ2lzdGVyZWRTZXJ2aWNlc0NhY2hlLlNlcnZpY2VJbmZvPFN5bmNBZGFwdGVyVHlwZT4gc3luY0FkYXB0ZXJJbmZvID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jQWRhcHRlcnMuZ2V0U2VydmljZUluZm8oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5bmNBZGFwdGVyVHlwZS5uZXdLZXkoYXV0aG9yaXR5LCBhY2NvdW50LnR5cGUpKTsKKyAgICAgICAgICAgICAgICBpZiAoc3luY0FkYXB0ZXJJbmZvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFzeW5jQWRhcHRlckluZm8udHlwZS5zdXBwb3J0c1VwbG9hZGluZygpICYmIHVwbG9hZE9ubHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSB0aGlzIGFuIGluaXRpYWxpemF0aW9uIHN5bmMgaWYgdGhlIGlzU3luY2FibGUgc3RhdGUgaXMgdW5rbm93bgorICAgICAgICAgICAgICAgICAgICBCdW5kbGUgZXh0cmFzQ29weSA9IGV4dHJhczsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyBkZWxheUNvcHkgPSBkZWxheTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzU3luY2FibGUgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXNDb3B5ID0gbmV3IEJ1bmRsZShleHRyYXMpOworICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFzQ29weS5wdXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19JTklUSUFMSVpFLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5Q29weSA9IC0xOyAvLyBleHBlZGl0ZSB0aGlzCisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHN5bmNBdXRvbWF0aWNhbGx5ID0gbWFzdGVyU3luY0F1dG9tYXRpY2FsbHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbVN5bmNTdG9yYWdlRW5naW5lLmdldFN5bmNBdXRvbWF0aWNhbGx5KGFjY291bnQsIGF1dGhvcml0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIHN5bmNBbGxvd2VkID0gbWFudWFsU3luYyB8fCBzeW5jQXV0b21hdGljYWxseTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3luY0FsbG93ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJzY2hlZHVsZVN5bmM6IHN5bmMgb2YgIiArIGFjY291bnQgKyAiLCAiICsgYXV0aG9yaXR5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlzIG5vdCBhbGxvd2VkLCBkcm9wcGluZyByZXF1ZXN0Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAic2NoZWR1bGVTeW5jOiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRlbGF5ICIgKyBkZWxheUNvcHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBzb3VyY2UgIiArIHNvdXJjZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIGFjY291bnQgIiArIGFjY291bnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBhdXRob3JpdHkgIiArIGF1dGhvcml0eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIGV4dHJhcyAiICsgZXh0cmFzQ29weSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGVTeW5jT3BlcmF0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTeW5jT3BlcmF0aW9uKGFjY291bnQsIHNvdXJjZSwgYXV0aG9yaXR5LCBleHRyYXNDb3B5LCBkZWxheUNvcHkpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTU5OCwzNiArNjkwLDExIEBACiAgICAgICAgIG1TdGF0dXNUZXh0ID0gbWVzc2FnZTsKICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgcG9wdWxhdGVQcm92aWRlcnNMaXN0KFVyaSB1cmwsIExpc3Q8U3RyaW5nPiBuYW1lcywgTGlzdDxQcm92aWRlckluZm8+IHByb3ZpZGVycykgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgZmluYWwgSVBhY2thZ2VNYW5hZ2VyIHBhY2thZ2VNYW5hZ2VyID0gZ2V0UGFja2FnZU1hbmFnZXIoKTsKLSAgICAgICAgICAgIGlmICh1cmwgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHBhY2thZ2VNYW5hZ2VyLnF1ZXJ5U3luY1Byb3ZpZGVycyhuYW1lcywgcHJvdmlkZXJzKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGF1dGhvcml0eSA9IHVybC5nZXRBdXRob3JpdHkoKTsKLSAgICAgICAgICAgICAgICBQcm92aWRlckluZm8gaW5mbyA9IHBhY2thZ2VNYW5hZ2VyLnJlc29sdmVDb250ZW50UHJvdmlkZXIodXJsLmdldEF1dGhvcml0eSgpLCAwKTsKLSAgICAgICAgICAgICAgICBpZiAoaW5mbyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgc2V0IHRoaXMgcHJvdmlkZXIgaWYgdGhlIHJlcXVlc3RlZCBhdXRob3JpdHkgaXMgdGhlIHByaW1hcnkgYXV0aG9yaXR5Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZ1tdIHByb3ZpZGVyTmFtZXMgPSBpbmZvLmF1dGhvcml0eS5zcGxpdCgiOyIpOwotICAgICAgICAgICAgICAgICAgICBpZiAodXJsLmdldEF1dGhvcml0eSgpLmVxdWFscyhwcm92aWRlck5hbWVzWzBdKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMuYWRkKGF1dGhvcml0eSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm92aWRlcnMuYWRkKGluZm8pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgIC8vIHdlIHNob3VsZCByZWFsbHkgbmV2ZXIgZ2V0IHRoaXMsIGJ1dCBpZiB3ZSBkbyB0aGVuIGNsZWFyIHRoZSBsaXN0cywgd2hpY2gKLSAgICAgICAgICAgIC8vIHdpbGwgcmVzdWx0IGluIHRoZSBkcm9wcGluZyBvZiB0aGUgc3luYyByZXF1ZXN0Ci0gICAgICAgICAgICBMb2cuZShUQUcsICJlcnJvciB0cnlpbmcgdG8gZ2V0IHRoZSBQcm92aWRlckluZm8gZm9yICIgKyB1cm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hY2NvdW50LmVxdWFscyhhY3RpdmVTeW5jQ29udGV4dC5tU3luY09wZXJhdGlvbi5hY2NvdW50KSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gaWYgYW4gYWNjb3VudCB3YXMgc3BlY2lmaWVkIHRoZW4gb25seSBjYW5jZWwgdGhlIHN5bmMgaWYgaXQgbWF0Y2hlcworICAgICAgICAgICAgaWYgKGF1dGhvcml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKCFhdXRob3JpdHkuZXF1YWxzKGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jT3BlcmF0aW9uLmF1dGhvcml0eSkpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTc5OCwxNCArODY3LDEzIEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogUmVtb3ZlIGFueSBzY2hlZHVsZWQgc3luYyBvcGVyYXRpb25zIHRoYXQgbWF0Y2ggdXJpLiBUaGUgdXJpIGNvcnJlc3BvbmRzIHRvIHRoZSBvbmUgcGFzc2VkCi0gICAgICogaW4gdG8gc3RhcnRTeW5jKCkuCi0gICAgICogQHBhcmFtIHVyaSBJZiBub24tbnVsbCwgb25seSBvcGVyYXRpb25zIHRoYXQgbWF0Y2ggdGhlIHVyaSBhcmUgY2xlYXJlZC4KLSAgICAgKiAgIElmIG51bGwsIGFsbCBvcGVyYXRpb25zIGFyZSBjbGVhcmVkLgorICAgICAqIFJlbW92ZSBzY2hlZHVsZWQgc3luYyBvcGVyYXRpb25zLgorICAgICAqIEBwYXJhbSBhY2NvdW50IGxpbWl0IHRoZSByZW1vdmFscyB0byBvcGVyYXRpb25zIHdpdGggdGhpcyBhY2NvdW50LCBpZiBub24tbnVsbAorICAgICAqIEBwYXJhbSBhdXRob3JpdHkgbGltaXQgdGhlIHJl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QnVuZGxlIGV4dHJhcywgbG9uZyBkZWxheSkgeworICAgICAgICBTeW5jT3BlcmF0aW9uKEFjY291bnQgYWNjb3VudCwgaW50IHNvdXJjZSwgU3RyaW5nIGF1dGhvcml0eSwgQnVuZGxlIGV4dHJhcywgbG9uZyBkZWxheSkgewogICAgICAgICAgICAgdGhpcy5hY2NvdW50ID0gYWNjb3VudDsKICAgICAgICAgICAgIHRoaXMuc3luY1NvdXJjZSA9IHNvdXJjZTsKICAgICAgICAgICAgIHRoaXMuYXV0aG9yaXR5ID0gYXV0aG9yaXR5OwpAQCAtOTM3LDIxICsxMDA1LDE5IEBACiAgICAgLyoqCiAgICAgICogQGhpZGUKICAgICAgKi8KLSAgICBjbGFzcyBBY3RpdmVTeW5jQ29udGV4dCBleHRlbmRzIElTeW5jQ29udGV4dC5TdHViIHsKKyAgICBjbGFzcyBBY3RpdmVTeW5jQ29udGV4dCBleHRlbmRzIElTeW5jQ29udGV4dC5TdHViIGltcGxlbWVudHMgU2VydmljZUNvbm5lY3Rpb24gewogICAgICAgICBmaW5hbCBTeW5jT3BlcmF0aW9uIG1TeW5jT3BlcmF0aW9uOwogICAgICAgICBmaW5hbCBsb25nIG1IaXN0b3J5Um93SWQ7Ci0gICAgICAgIGZpbmFsIElDb250ZW50UHJvdmlkZXIgbUNvbnRlbnRQcm92aWRlcjsKLSAgICAgICAgZmluYWwgSVN5bmNBZGFwdGVyIG1TeW5jQWRhcHRlcjsKKyAgICAgICAgSVN5bmNBZGFwdGVyIG1TeW5jQWRhcHRlcjsKICAgICAgICAgZmluYWwgbG9uZyBtU3RhcnRUaW1lOwogICAgICAgICBsb25nIG1UaW1lb3V0U3RhcnRUaW1lOwogCi0gICAgICAgIHB1YmxpYyBBY3RpdmVTeW5jQ29udGV4dChTeW5jT3BlcmF0aW9uIHN5bmNPcGVyYXRpb24sIElDb250ZW50UHJvdmlkZXIgY29udGVudFByb3ZpZGVyLAotICAgICAgICAgICAgICAgIElTeW5jQWRhcHRlciBzeW5jQWRhcHRlciwgbG9uZyBoaXN0b3J5Um93SWQpIHsKKyAgICAgICAgcHVibGljIEFjdGl2ZVN5bmNDb250ZXh0KFN5bmNPcGVyYXRpb24gc3luY09wZXJhdGlvbiwKKyAgICAgICAgICAgICAgICBsb25nIGhpc3RvcnlSb3dJZCkgewogICAgICAgICAgICAgc3VwZXIoKTsKICAgICAgICAgICAgIG1TeW5jT3BlcmF0aW9uID0gc3luY09wZXJhdGlvbjsKICAgICAgICAgICAgIG1IaXN0b3J5Um93SWQgPSBoaXN0b3J5Um93SWQ7Ci0gICAgICAgICAgICBtQ29udGVudFByb3ZpZGVyID0gY29udGVudFByb3ZpZGVyOwotICAgICAgICAgICAgbVN5bmNBZGFwdGVyID0gc3luY0FkYXB0ZXI7CisgICAgICAgICAgICBtU3luY0FkYXB0ZXIgPSBudWxsOwogICAgICAgICAgICAgbVN0YXJ0VGltZSA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOwogICAgICAgICAgICAgbVRpbWVvdXRTdGFydFRpbWUgPSBtU3RhcnRUaW1lOwogICAgICAgICB9CkBAIC05NzcsNiArMTA0Myw0MSBAQAogICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCIsIHN5bmNPcGVyYXRpb24gIikuYXBwZW5kKG1TeW5jT3BlcmF0aW9uKTsKICAgICAgICAgfQogCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZUNvbm5lY3RlZChDb21wb25lbnROYW1lIG5hbWUsIElCaW5kZXIgc2VydmljZSkgeworICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtU3luY0hhbmRsZXIub2J0YWluTWVzc2FnZSgpOworICAgICAgICAgICAgbXNnLndoYXQgPSBTeW5jSGFuZGxlci5NRVNTQUdFX1NFUlZJQ0VfQ09OTkVDVEVEOworICAgICAgICAgICAgbXNnLm9iaiA9IG5ldyBTZXJ2aWNlQ29ubmVjdGlvbkRhdGEodGhpcywgSVN5bmNBZGFwdGVyLlN0dWIuYXNJbnRlcmZhY2Uoc2VydmljZSkpOworICAgICAgICAgICAgbVN5bmNIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoQ29tcG9uZW50TmFtZSBuYW1lKSB7CisgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1TeW5jSGFuZGxlci5vYnRhaW5NZXNzYWdlKCk7CisgICAgICAgICAgICBtc2cud2hhdCA9IFN5bmNIYW5kbGVyLk1FU1NBR0VfU0VSVklDRV9ESVNDT05ORUNURUQ7CisgICAgICAgICAgICBtc2cub2JqID0gbmV3IFNlcnZpY2VDb25uZWN0aW9uRGF0YSh0aGlzLCBudWxsKTsKKyAgICAgICAgICAgIG1TeW5jSGFuZGxlci5zZW5kTWVzc2FnZShtc2cpOworICAgICAgICB9CisKKyAgICAgICAgYm9vbGVhbiBiaW5kVG9TeW5jQWRhcHRlcihSZWdpc3RlcmVkU2VydmljZXNDYWNoZS5TZXJ2aWNlSW5mbyBpbmZvKSB7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJiaW5kVG9TeW5jQWRhcHRlcjogIiArIGluZm8uY29tcG9uZW50TmFtZSArICIsIGNvbm5lY3Rpb24gIiArIHRoaXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoKTsKKyAgICAgICAgICAgIGludGVudC5zZXRBY3Rpb24oImFuZHJvaWQuY29udGVudC5TeW5jQWRhcHRlciIpOworICAgICAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChpbmZvLmNvbXBvbmVudE5hbWUpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEludGVudC5FWFRSQV9DTElFTlRfTEFCRUwsCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnN5bmNfYmluZGluZ19sYWJlbCk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoSW50ZW50LkVYVFJBX0NMSUVOVF9JTlRFTlQsIFBlbmRpbmdJbnRlbnQuZ2V0QWN0aXZpdHkoCisgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LCAwLCBuZXcgSW50ZW50KFNldHRpbmdzLkFDVElPTl9TWU5DX1NFVFRJTkdTKSwgMCkpOworICAgICAgICAgICAgcmV0dXJuIG1Db250ZXh0LmJpbmRTZXJ2aWNlKGludGVudCwgdGhpcywgQ29udGV4dC5CSU5EX0FVVE9fQ1JFQVRFKTsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgdW5CaW5kRnJvbVN5bmNBZGFwdGVyKCkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAidW5CaW5kRnJvbVN5bmNBZGFwdGVyOiBjb25uZWN0aW9uICIgKyB0aGlzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Db250ZXh0LnVuYmluZFNlcnZpY2UodGhpcyk7CisgICAgICAgIH0KKwogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwpAQCAtOTkxLDYgKzEwOTIsMTIgQEAKICAgICAgICAgaWYgKGlzU3luY0VuYWJsZWQoKSkgewogICAgICAgICAgICAgZHVtcFN5bmNIaXN0b3J5KHB3LCBzYik7CiAgICAgICAgIH0KKworICAgICAgICBwdy5wcmludGxuKCk7CisgICAgICAgIHB3LnByaW50bG4oIlN5bmNBZGFwdGVyczoiKTsKKyAgICAgICAgZm9yIChSZWdpc3RlcmVkU2VydmljZXNDYWNoZS5TZXJ2aWNlSW5mbyBpbmZvIDogbVN5bmNBZGFwdGVycy5nZXRBbGxTZXJ2aWNlcygpKSB7CisgICAgICAgICAgICBwdy5wcmludGxuKCIgICIgKyBpbmZvKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIHN0YXRpYyBTdHJpbmcgZm9ybWF0VGltZShsb25nIHRpbWUpIHsKQEAgLTEwMDQsNyArMTExMSw3IEBACiAgICAgICAgIHB3LnByaW50KCJkYXRhIGNvbm5lY3RlZDogIik7IHB3LnByaW50bG4obURhdGFDb25uZWN0aW9uSXNDb25uZWN0ZWQpOwogICAgICAgICBwdy5wcmludCgibWVtb3J5IGxvdzogIik7IHB3LnByaW50bG4obVN0b3JhZ2VJc0xvdyk7CiAKLSAgICAgICAgZmluYWwgU3RyaW5nW10gYWNjb3VudHMgPSBtQWNjb3VudHM7CisgICAgICAgIGZpbmFsIEFjY291bnRbXSBhY2NvdW50cyA9IG1BY2NvdW50czsKICAgICAgICAgcHcucHJpbnQoImFjY291bnRzOiAiKTsKICAgICAgICAgaWYgKGFjY291bnRzICE9IG51bGwpIHsKICAgICAgICAgICAgIHB3LnByaW50bG4oYWNjb3VudHMubGVuZ3RoKTsKQEAgLTEwNjgsNyArMTE3NSw4IEBACiAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgU3luY1N0b3JhZ2VFbmdpbmUuUGVuZGluZ09wZXJhdGlvbiBvcCA9IG9wcy5nZXQoaSk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgIyIpOyBwdy5wcmludChpKTsgcHcucHJpbnQoIjogYWNjb3VudD0iKTsKLSAgICAgICAgICAgICAgICBwdy5wcmludChvcC5hY2NvdW50KTsgcHcucHJpbnQoIiBhdXRob3JpdHk9Iik7CisgICAgICAgICAgICAgICAgcHcucHJpbnQob3AuYWNjb3VudC5uYW1lKTsgcHcucHJpbnQoIjoiKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludChvcC5hY2NvdW50LnR5cGUpOyBwdy5wcmludCgiIGF1dGhvcml0eT0iKTsKICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG9wLmF1dGhvcml0eSk7CiAgICAgICAgICAgICAgICAgaWYgKG9wLmV4dHJhcyAhPSBudWxsICYmIG9wLmV4dHJhcy5zaXplKCkgPiAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHNiLnNldExlbmd0aCgwKTsKQEAgLTEwNzgsNyArMTE4Niw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBIYXNoU2V0PFN0cmluZz4gcHJvY2Vzc2VkQWNjb3VudHMgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7CisgICAgICAgIEhhc2hTZXQ8QWNjb3VudD4gcHJvY2Vzc2VkQWNjb3VudHMgPSBuZXcgSGFzaFNldDxBY2NvdW50PigpOwogICAgICAgICBBcnJheUxpc3Q8U3luY1N0YXR1c0luZm8+IHN0YXR1c2VzCiAgICAgICAgICAgICAgICAgPSBtU3luY1N0b3JhZ2VFbmdpbmUuZ2V0U3luY1N0YXR1cygpOwogICAgICAgICBpZiAoc3RhdHVzZXMgIT0gbnVsbCAmJiBzdGF0dXNlcy5zaXplKCkgPiAwKSB7CkBAIC0xMDkwLDcgKzExOTgsNyBAQAogICAgICAgICAgICAgICAgIFN5bmNTdG9yYWdlRW5naW5lLkF1dGhvcml0eUluZm8gYXV0aG9yaXR5CiAgICAgICAgICAgICAgICAgICAgICAgICA9IG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRBdXRob3JpdHkoc3RhdHVzLmF1dGhvcml0eUlkKTsKICAgICAgICAgICAgICAgICBpZiAoYXV0aG9yaXR5ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGN1ckFjY291bnQgPSBhdXRob3JpdHkuYWNjb3VudDsKKyAgICAgICAgICAgICAgICAgICAgQWNjb3VudCBjdXJBY2NvdW50ID0gYXV0aG9yaXR5LmFjY291bnQ7CiAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICBpZiAocHJvY2Vzc2VkQWNjb3VudHMuY29udGFpbnMoY3VyQWNjb3VudCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwpAQCAtMTA5OCw4ICsxMjA2LDkgQEAKICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NlZEFjY291bnRzLmFkZChjdXJBY2NvdW50KTsKICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgIEFjY291bnQgIik7IHB3LnByaW50KGF1dGhvcml0eS5hY2NvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiOiIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICBBY2NvdW50ICIpOyBwdy5wcmludChhdXRob3JpdHkuYWNjb3VudC5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICIpOyBwdy5wcmludChhdXRob3JpdHkuYWNjb3VudC50eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKCI6Iik7CiAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGo9aTsgajxOOyBqKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHN0YXR1c2VzLmdldChqKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhvcml0eSA9IG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRBdXRob3JpdHkoc3RhdHVzLmF1dGhvcml0eUlkKTsKQEAgLTEyMTksOSArMTMyOCwxNSBAQAogICAgICAgICAgICAgICAgIFN5bmNTdG9yYWdlRW5naW5lLkF1dGhvcml0eUluZm8gYXV0aG9yaXR5CiAgICAgICAgICAgICAgICAgICAgICAgICA9IG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRBdXRob3JpdHkoaXRlbS5hdXRob3JpdHlJZCk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgIyIpOyBwdy5wcmludChpKzEpOyBwdy5wcmludCgiOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KGF1dGhvcml0eSAhPSBudWxsID8gYXV0aG9yaXR5LmFjY291bnQgOiAiPG5vIGFjY291bnQ+Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoYXV0aG9yaXR5ICE9IG51bGwgPyBhdXRob3JpdHkuYXV0aG9yaXR5IDogIjxubyBhY2NvdW50PiIpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF1dGhvcml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoYXV0aG9yaXR5LmFjY291bnQubmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIjoiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludChhdXRob3JpdHkuYWNjb3VudC50eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KGF1dGhvcml0eS5hdXRob3JpdHkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiPG5vIGFjY291bnQ+Iik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgVGltZSB0aW1lID0gbmV3IFRpbWUoKTsKICAgICAgICAgICAgICAgICB0aW1lLnNldChpdGVtLmV2ZW50VGltZSk7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAiKTsgcHcucHJpbnQoU3luY1N0b3JhZ2VFbmdpbmUuU09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VTU0FHRV9TRVJWSUNFX0RJU0NPTk5FQ1RFRCA9IDU7CiAKICAgICAgICAgcHVibGljIGZpbmFsIFN5bmNOb3RpZmljYXRpb25JbmZvIG1TeW5jTm90aWZpY2F0aW9uSW5mbyA9IG5ldyBTeW5jTm90aWZpY2F0aW9uSW5mbygpOwogICAgICAgICBwcml2YXRlIExvbmcgbUFsYXJtU2NoZWR1bGVUaW1lID0gbnVsbDsKQEAgLTEzMDEsNyArMTQyNyw3IEBACiAgICAgICAgICAqLwogICAgICAgICBjbGFzcyBTeW5jTm90aWZpY2F0aW9uSW5mbyB7CiAgICAgICAgICAgICAvLyBvbmx5IHZhbGlkIGlmIGlzQWN0aXZlIGlzIHRydWUKLSAgICAgICAgICAgIHB1YmxpYyBTdHJpbmcgYWNjb3VudDsKKyAgICAgICAgICAgIHB1YmxpYyBBY2NvdW50IGFjY291bnQ7CiAKICAgICAgICAgICAgIC8vIG9ubHkgdmFsaWQgaWYgaXNBY3RpdmUgaXMgdHJ1ZQogICAgICAgICAgICAgcHVibGljIFN0cmluZyBhdXRob3JpdHk7CkBAIC0xMzU4LDYgKzE0ODQsNTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHJ1blN0YXRlSWRsZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTeW5jSGFuZGxlci5NRVNTQUdFX1NFUlZJQ0VfQ09OTkVDVEVEOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2aWNlQ29ubmVjdGlvbkRhdGEgbXNnRGF0YSA9IChTZXJ2aWNlQ29ubmVjdGlvbkRhdGEpbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImhhbmRsZVN5bmNIYW5kbGVyTWVzc2FnZTogTUVTU0FHRV9TRVJWSUNFX0NPTk5FQ1RFRDogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtc2dEYXRhLmFjdGl2ZVN5bmNDb250ZXh0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgYWN0aXZlIGlzICIgKyBtQWN0aXZlU3luY0NvbnRleHQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgdGhhdCB0aGlzIGlzbid0IGFuIG9sZCBtZXNzYWdlCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmNDb250ZXh0ID09IG1zZ0RhdGEuYWN0aXZlU3luY0NvbnRleHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5Cb3VuZFRvU3luY0FkYXB0ZXIobXNnRGF0YS5zeW5jQWRhcHRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGNhc2UgU3luY0hhbmRsZXIuTUVTU0FHRV9TRVJWSUNFX0RJU0NPTk5FQ1RFRDogeworICAgICAgICAgICAgICAgICAgICAgICAgU2VydmljZUNvbm5lY3Rpb25EYXRhIG1zZ0RhdGEgPSAoU2VydmljZUNvbm5lY3Rpb25EYXRhKW1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJoYW5kbGVTeW5jSGFuZGxlck1lc3NhZ2U6IE1FU1NBR0VfU0VSVklDRV9ESVNDT05ORUNURUQ6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbXNnRGF0YS5hY3RpdmVTeW5jQ29udGV4dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGFjdGl2ZSBpcyAiICsgbUFjdGl2ZVN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIHRoYXQgdGhpcyBpc24ndCBhbiBvbGQgbWVzc2FnZQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1BY3RpdmVTeW5jQ29udGV4dCA9PSBtc2dEYXRhLmFjdGl2ZVN5bmNDb250ZXh0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FuY2VsIHRoZSBzeW5jIGlmIHdlIGhhdmUgYSBzeW5jYWRhcHRlciwgd2hpY2ggbWVhbnMgb25lIGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3V0c3RhbmRpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZlU3luY0NvbnRleHQubVN5bmNBZGFwdGVyLmNhbmNlbFN5bmMobUFjdGl2ZVN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGRvbid0IG5lZWQgdG8gcmV0cnkgdGhpcyBpbiB0aGlzIGNhc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHByZXRlbmQgdGhhdCB0aGUgc3luYyBmYWlsZWQgd2l0aCBhbiBJT0V4Y2VwdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aGljaCBpcyBhIHNvZnQgZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeW5jUmVzdWx0IHN5bmNSZXN1bHQgPSBuZXcgU3luY1Jlc3VsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNSZXN1bHQuc3RhdHMubnVtSW9FeGNlcHRpb25zKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuU3luY0ZpbmlzaGVkT3JDYW5jZWxlZChzeW5jUmVzdWx0KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlIHdlIGFyZSBubyBsb25nZXIgc3luY2luZywgY2hlY2sgaWYgaXQgaXMgdGltZSB0byBzdGFydCBhIG5ldworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN5bmMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5TdGF0ZUlkbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICAgICAgICBjYXNlIFN5bmNIYW5kbGVyLk1FU1NBR0VfU1lOQ19BTEFSTTogewogICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBpc0xvZ2dhYmxlID0gTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewpAQCAtMTQ1Niw3ICsxNjI5LDcgQEAKIAogICAgICAgICAgICAgLy8gSWYgdGhlIGFjY291bnRzIGFyZW4ndCBrbm93biB5ZXQgdGhlbiB3ZSBhcmVuJ3QgcmVhZHkgdG8gcnVuLiBXZSB3aWxsIGJlIGtpY2tlZAogICAgICAgICAgICAgLy8gd2hlbiB0aGUgYWNjb3VudCBsb29rdXAgcmVxdWVzdCBkb2VzIGNvbXBsZXRlLgotICAgICAgICAgICAgU3RyaW5nW10gYWNjb3VudHMgPSBtQWNjb3VudHM7CisgICAgICAgICAgICBBY2NvdW50W10gYWNjb3VudHMgPSBtQWNjb3VudHM7CiAgICAgICAgICAgICBpZiAoYWNjb3VudHMgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGlmIChpc0xvZ2dhYmxlKSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogYWNjb3VudHMgbm90IGtub3duLCBza2lwcGluZyIpOwpAQCAtMTQ2OCwxNCArMTY0MSwxMyBAQAogICAgICAgICAgICAgLy8gT3RoZXJ3aXNlIGNvbnN1bWUgU3luY09wZXJhdGlvbnMgZnJvbSB0aGUgaGVhZCBvZiB0aGUgU3luY1F1ZXVlIHVudGlsIG9uZSBpcwogICAgICAgICAgICAgLy8gZm91bmQgdGhhdCBpcyBydW5uYWJsZSAobm90IGRpc2FibGVkLCBldGMpLiBJZiB0aGF0IG9uZSBpcyByZWFkeSB0byBydW4gdGhlbgogICAgICAgICAgICAgLy8gc3RhcnQgaXQsIG90aGVyd2lzZSBqdXN0IGdldCBvdXQuCi0gICAgICAgICAgICBTeW5jT3BlcmF0aW9uIHN5bmNPcGVyYXRpb247Ci0gICAgICAgICAgICBmaW5hbCBDb25uZWN0aXZpdHlNYW5hZ2VyIGNvbm5NYW5hZ2VyID0gKENvbm5lY3Rpdml0eU1hbmFnZXIpCi0gICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5DT05ORUNUSVZJVFlfU0VSVklDRSk7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIGJhY2tncm91bmREYXRhU2V0dGluZyA9IGNvbm5NYW5hZ2VyLmdldEJhY2tncm91bmREYXRhU2V0dGluZygpOworICAgICAgICAgICAgU3luY09wZXJhdGlvbiBvcDsKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gYmFja2dyb3VuZERhdGFVc2FnZUFsbG93ZWQgPQorICAgICAgICAgICAgICAgICAgICBnZXRDb25uZWN0aXZpdHlNYW5hZ2VyKCkuZ2V0QmFja2dyb3VuZERhdGFTZXR0aW5nKCk7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jUXVldWUpIHsKICAgICAgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgICAgICBzeW5jT3BlcmF0aW9uID0gbVN5bmNRdWV1ZS5oZWFkKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzeW5jT3BlcmF0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgb3AgPSBtU3luY1F1ZXVlLmhlYWQoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG9wID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0xvZ2dhYmxlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicnVuU3RhdGVJZGxlOiBubyBtb3JlIHN5bmMgb3BlcmF0aW9ucywgcmV0dXJuaW5nIik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CkBAIC0xNDg1LDM5ICsxNjU3LDQ5IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIFN5bmMgaXMgZGlzYWJsZWQsIGRyb3AgdGhpcyBvcGVyYXRpb24uCiAgICAgICAgICAgICAgICAgICAgIGlmICghaXNTeW5jRW5hYmxlZCgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogc3luYyBkaXNhYmxlZCwgZHJvcHBpbmcgIiArIHN5bmNPcGVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogc3luYyBkaXNhYmxlZCwgZHJvcHBpbmcgIiArIG9wKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIG1TeW5jUXVldWUucG9wSGVhZCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgICAgICAvLyBza2lwIHRoZSBzeW5jIGlmIGl0IGlzbid0IGEgZm9yY2UgYW5kIHRoZSBzZXR0aW5ncyBhcmUgb2ZmIGZvciB0aGlzIHByb3ZpZGVyCi0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gZm9yY2UgPSBzeW5jT3BlcmF0aW9uLmV4dHJhcy5nZXRCb29sZWFuKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19GT1JDRSwgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICBpZiAoIWZvcmNlICYmICghYmFja2dyb3VuZERhdGFTZXR0aW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIW1TeW5jU3RvcmFnZUVuZ2luZS5nZXRMaXN0ZW5Gb3JOZXR3b3JrVGlja2xlcygpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIW1TeW5jU3RvcmFnZUVuZ2luZS5nZXRTeW5jUHJvdmlkZXJBdXRvbWF0aWNhbGx5KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgc3luY09wZXJhdGlvbi5hdXRob3JpdHkpKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBza2lwIHRoZSBzeW5jIGlmIGl0IGlzbid0IG1hbnVhbCBhbmQgYXV0byBzeW5jIGlzIGRpc2FibGVkCisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gbWFudWFsU3luYyA9IG9wLmV4dHJhcy5nZXRCb29sZWFuKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19NQU5VQUwsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBzeW5jQXV0b21hdGljYWxseSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN5bmNTdG9yYWdlRW5naW5lLmdldFN5bmNBdXRvbWF0aWNhbGx5KG9wLmFjY291bnQsIG9wLmF1dGhvcml0eSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG1TeW5jU3RvcmFnZUVuZ2luZS5nZXRNYXN0ZXJTeW5jQXV0b21hdGljYWxseSgpOworICAgICAgICAgICAgICAgICAgICBib29sZWFuIHN5bmNBbGxvd2VkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYW51YWxTeW5jIHx8IChiYWNrZ3JvdW5kRGF0YVVzYWdlQWxsb3dlZCAmJiBzeW5jQXV0b21hdGljYWxseSk7CisgICAgICAgICAgICAgICAgICAgIGludCBpc1N5bmNhYmxlID0gbVN5bmNTdG9yYWdlRW5naW5lLmdldElzU3luY2FibGUob3AuYWNjb3VudCwgb3AuYXV0aG9yaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzU3luY2FibGUgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgbm90IHN5bmNhYmxlLCBkb24ndCBhbGxvdworICAgICAgICAgICAgICAgICAgICAgICAgc3luY0FsbG93ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpc1N5bmNhYmxlIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIHN5bmNhYmxlIHN0YXRlIGlzIHVua25vd24sIG9ubHkgYWxsb3cgaW5pdGlhbGl6YXRpb24gc3luY3MKKyAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNBbGxvd2VkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3AuZXh0cmFzLmdldEJvb2xlYW4oQ29udGVudFJlc29sdmVyLlNZTkNfRVhUUkFTX0lOSVRJQUxJWkUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoIXN5bmNBbGxvd2VkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogc3luYyBvZmYsIGRyb3BwaW5nICIgKyBzeW5jT3BlcmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJydW5TdGF0ZUlkbGU6IHN5bmMgb2ZmLCBkcm9wcGluZyAiICsgb3ApOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbVN5bmNRdWV1ZS5wb3BIZWFkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIC8vIHNraXAgdGhlIHN5bmMgaWYgdGhlIGFjY291bnQgb2YgdGhpcyBvcGVyYXRpb24gbm8gbG9uZ2VyIGV4aXN0cwotICAgICAgICAgICAgICAgICAgICBpZiAoIUFycmF5VXRpbHMuY29udGFpbnMoYWNjb3VudHMsIHN5bmNPcGVyYXRpb24uYWNjb3VudCkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFBcnJheVV0aWxzLmNvbnRhaW5zKGFjY291bnRzLCBvcC5hY2NvdW50KSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVN5bmNRdWV1ZS5wb3BIZWFkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogYWNjb3VudCBub3QgcHJlc2VudCwgZHJvcHBpbmcgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzeW5jT3BlcmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJydW5TdGF0ZUlkbGU6IGFjY291bnQgbm90IHByZXNlbnQsIGRyb3BwaW5nICIgKyBvcCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIC8vIGdvIGFoZWFkIGFuZCB0cnkgdG8gc3luYyB0aGlzIHN5bmNPcGVyYXRpb24KICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTG9nZ2FibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogZm91bmQgc3luYyBjYW5kaWRhdGU6ICIgKyBzeW5jT3BlcmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN0YXRlSWRsZTogZm91bmQgc3luYyBjYW5kaWRhdGU6ICIgKyBvcCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQpAQCAtMTUyNSwxMSArMTcwNywxMCBAQAogICAgICAgICAgICAgICAgIC8vIElmIHRoZSBmaXJzdCBTeW5jT3BlcmF0aW9uIGlzbid0IHJlYWR5IHRvIHJ1biBzY2hlZHVsZSBhIHdha2V1cCBhbmQKICAgICAgICAgICAgICAgICAvLyBnZXQgb3V0LgogICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgbm93ID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7Ci0gICAgICAgICAgICAgICAgaWYgKHN5bmNPcGVyYXRpb24uZWFybGllc3RSdW5UaW1lID4gbm93KSB7CisgICAgICAgICAgICAgICAgaWYgKG9wLmVhcmxpZXN0UnVuVGltZSA+IG5vdykgewogICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJydW5TdGF0ZUlkbGU6IHRoZSB0aW1lIGlzICIgKyBub3cgKyAiIHlldCB0aGUgbmV4dCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgInN5bmMgb3BlcmF0aW9uIGlzIGZvciAiICsgc3luY09wZXJhdGlvbi5lYXJsaWVzdFJ1blRpbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiAiICsgc3luY09wZXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgInN5bmMgb3BlcmF0aW9uIGlzIGZvciAiICsgb3AuZWFybGllc3RSdW5UaW1lICsgIjogIiArIG9wKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQpAQCAtMTUzNyw3MiArMTcxOCw3MiBAQAogICAgICAgICAgICAgICAgIC8vIFdlIHdpbGwgZG8gdGhpcyBzeW5jLiBSZW1vdmUgaXQgZnJvbSB0aGUgcXVldWUgYW5kIHJ1biBpdCBvdXRzaWRlIG9mIHRoZQogICAgICAgICAgICAgICAgIC8vIHN5bmNocm9uaXplZCBibG9jay4KICAgICAgICAgICAgICAgICBpZiAoaXNMb2dnYWJsZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJydW5TdGF0ZUlkbGU6IHdlIGFyZSBnb2luZyB0byBzeW5jICIgKyBzeW5jT3BlcmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAicnVuU3RhdGVJZGxlOiB3ZSBhcmUgZ29pbmcgdG8gc3luYyAiICsgb3ApOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtU3luY1F1ZXVlLnBvcEhlYWQoKTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgU3RyaW5nIHByb3ZpZGVyTmFtZSA9IHN5bmNPcGVyYXRpb24uYXV0aG9yaXR5OwotICAgICAgICAgICAgZW5zdXJlQ29udGVudFJlc29sdmVyKCk7Ci0gICAgICAgICAgICBJQ29udGVudFByb3ZpZGVyIGNvbnRlbnRQcm92aWRlcjsKLQotICAgICAgICAgICAgLy8gYWNxdWlyZSB0aGUgcHJvdmlkZXIgYW5kIHVwZGF0ZSB0aGUgc3luYyBoaXN0b3J5Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGNvbnRlbnRQcm92aWRlciA9IG1Db250ZW50UmVzb2x2ZXIuYWNxdWlyZVByb3ZpZGVyKHByb3ZpZGVyTmFtZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRQcm92aWRlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlByb3ZpZGVyICIgKyBwcm92aWRlck5hbWUgKyAiIGRvZXNuJ3QgZXhpc3QiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgLy8gY29ubmVjdCB0byB0aGUgc3luYyBhZGFwdGVyCisgICAgICAgICAgICBTeW5jQWRhcHRlclR5cGUgc3luY0FkYXB0ZXJUeXBlID0gU3luY0FkYXB0ZXJUeXBlLm5ld0tleShvcC5hdXRob3JpdHksIG9wLmFjY291bnQudHlwZSk7CisgICAgICAgICAgICBSZWdpc3RlcmVkU2VydmljZXNDYWNoZS5TZXJ2aWNlSW5mbzxTeW5jQWRhcHRlclR5cGU+IHN5bmNBZGFwdGVySW5mbyA9CisgICAgICAgICAgICAgICAgICAgIG1TeW5jQWRhcHRlcnMuZ2V0U2VydmljZUluZm8oc3luY0FkYXB0ZXJUeXBlKTsKKyAgICAgICAgICAgIGlmIChzeW5jQWRhcHRlckluZm8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJjYW4ndCBmaW5kIGEgc3luYyBhZGFwdGVyIGZvciAiICsgc3luY0FkYXB0ZXJUeXBlKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRQcm92aWRlci5nZXRTeW5jQWRhcHRlcigpID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiUHJvdmlkZXIgIiArIHByb3ZpZGVyTmFtZSArICIgaXNuJ3Qgc3luY2FibGUsICIgKyBjb250ZW50UHJvdmlkZXIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIHJlbW90ZUV4YykgewotICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkNhdWdodCBhIFJlbW90ZUV4Y2VwdGlvbiB3aGlsZSBwcmVwYXJpbmcgZm9yIHN5bmMsIHJlc2NoZWR1bGluZyAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIHN5bmNPcGVyYXRpb24sIHJlbW90ZUV4Yyk7Ci0gICAgICAgICAgICAgICAgcmVzY2hlZHVsZVdpdGhEZWxheShzeW5jT3BlcmF0aW9uKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGV4YykgewotICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkNhdWdodCBhIFJ1bnRpbWVFeGNlcHRpb24gd2hpbGUgdmFsaWRhdGluZyBzeW5jIG9mICIgKyBwcm92aWRlck5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBleGMpOworICAgICAgICAgICAgICAgIHJ1blN0YXRlSWRsZSgpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgZmluYWwgbG9uZyBoaXN0b3J5Um93SWQgPSBpbnNlcnRTdGFydFN5bmNFdmVudChzeW5jT3BlcmF0aW9uKTsKLQotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBJU3luY0FkYXB0ZXIgc3luY0FkYXB0ZXIgPSBjb250ZW50UHJvdmlkZXIuZ2V0U3luY0FkYXB0ZXIoKTsKLSAgICAgICAgICAgICAgICBBY3RpdmVTeW5jQ29udGV4dCBhY3RpdmVTeW5jQ29udGV4dCA9IG5ldyBBY3RpdmVTeW5jQ29udGV4dChzeW5jT3BlcmF0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFByb3ZpZGVyLCBzeW5jQWRhcHRlciwgaGlzdG9yeVJvd0lkKTsKLSAgICAgICAgICAgICAgICBtU3luY1dha2VMb2NrLmFjcXVpcmUoKTsKLSAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInN0YXJ0aW5nIHN5bmMgb2YgIiArIHN5bmNPcGVyYXRpb24pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBzeW5jQWRhcHRlci5zdGFydFN5bmMoYWN0aXZlU3luY0NvbnRleHQsIHN5bmNPcGVyYXRpb24uYWNjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNPcGVyYXRpb24uZXh0cmFzKTsKLSAgICAgICAgICAgICAgICBtQWN0aXZlU3luY0NvbnRleHQgPSBhY3RpdmVTeW5jQ29udGV4dDsKKyAgICAgICAgICAgIEFjdGl2ZVN5bmNDb250ZXh0IGFjdGl2ZVN5bmNDb250ZXh0ID0KKyAgICAgICAgICAgICAgICAgICAgbmV3IEFjdGl2ZVN5bmNDb250ZXh0KG9wLCBpbnNlcnRTdGFydFN5bmNFdmVudChvcCkpOworICAgICAgICAgICAgbUFjdGl2ZVN5bmNDb250ZXh0ID0gYWN0aXZlU3luY0NvbnRleHQ7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJydW5TdGF0ZUlkbGU6IHNldHRpbmcgbUFjdGl2ZVN5bmNDb250ZXh0IHRvICIgKyBtQWN0aXZlU3luY0NvbnRleHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVN5bmNTdG9yYWdlRW5naW5lLnNldEFjdGl2ZVN5bmMobUFjdGl2ZVN5bmNDb250ZXh0KTsKKyAgICAgICAgICAgIGlmICghYWN0aXZlU3luY0NvbnRleHQuYmluZFRvU3luY0FkYXB0ZXIoc3luY0FkYXB0ZXJJbmZvKSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkJpbmQgYXR0ZW1wdCBmYWlsZWQgdG8gIiArIHN5bmNBZGFwdGVySW5mbyk7CisgICAgICAgICAgICAgICAgbUFjdGl2ZVN5bmNDb250ZXh0ID0gbnVsbDsKICAgICAgICAgICAgICAgICBtU3luY1N0b3JhZ2VFbmdpbmUuc2V0QWN0aXZlU3luYyhtQWN0aXZlU3luY0NvbnRleHQpOworICAgICAgICAgICAgICAgIHJ1blN0YXRlSWRsZSgpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbVN5bmNXYWtlTG9jay5hY3F1aXJlKCk7CisgICAgICAgICAgICAvLyBubyBuZWVkIHRvIHNjaGVkdWxlIGFuIGFsYXJtLCBhcyB0aGF0IHdpbGwgYmUgZG9uZSBieSBvdXIgY2FsbGVyLgorCisgICAgICAgICAgICAvLyB0aGUgbmV4dCBzdGVwIHdpbGwgb2NjdXIgd2hlbiB3ZSBnZXQgZWl0aGVyIGEgdGltZW91dCBvciBhCisgICAgICAgICAgICAvLyBNRVNTQUdFX1NFUlZJQ0VfQ09OTkV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IG1BY3RpdmVTeW5jQ29udGV4dDsKICAgICAgICAgICAgIG1BY3RpdmVTeW5jQ29udGV4dCA9IG51bGw7CiAgICAgICAgICAgICBtU3luY1N0b3JhZ2VFbmdpbmUuc2V0QWN0aXZlU3luYyhtQWN0aXZlU3luY0NvbnRleHQpOwogCkBAIC0xNjQyLDEwICsxODIzLDEyIEBACiAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInJ1blN5bmNGaW5pc2hlZE9yQ2FuY2VsZWQ6IGlzIGEgY2FuY2VsOiBvcGVyYXRpb24gIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc3luY09wZXJhdGlvbik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0Lm1TeW5jQWRhcHRlci5jYW5jZWxTeW5jKCk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gd2UgZG9uJ3QgbmVlZCB0byByZXRyeSB0aGlzIGluIHRoaXMgY2FzZQorICAgICAgICAgICAgICAgIGlmIChhY3RpdmVTeW5jQ29udGV4dC5tU3luY0FkYXB0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlU3luY0NvbnRleHQubVN5bmNBZGFwdGVyLmNhbmNlbFN5bmMoYWN0aXZlU3luY0NvbnRleHQpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgZG9uJ3QgbmVlZCB0byByZXRyeSB0aGlzIGluIHRoaXMgY2FzZQorICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGhpc3RvcnlNZXNzYWdlID0gU3luY1N0b3JhZ2VFbmdpbmUuTUVTR19DQU5DRUxFRDsKICAgICAgICAgICAgICAgICBkb3duc3RyZWFtQWN0aXZpdHkgPSAwOwpAQCAtMTY1NSw3ICsxODM4LDcgQEAKICAgICAgICAgICAgIHN0b3BTeW5jRXZlbnQoYWN0aXZlU3luY0NvbnRleHQubUhpc3RvcnlSb3dJZCwgc3luY09wZXJhdGlvbiwgaGlzdG9yeU1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtQWN0aXZpdHksIGRvd25zdHJlYW1BY3Rpdml0eSwgZWxhcHNlZFRpbWUpOwogCi0gICAgICAgICAgICBtQ29udGVudFJlc29sdmVyLnJlbGVhc2VQcm92aWRlcihhY3RpdmVTeW5jQ29udGV4dC5tQ29udGVudFByb3ZpZGVyKTsKKyAgICAgICAgICAgIGFjdGl2ZVN5bmNDb250ZXh0LnVuQmluZEZyb21TeW5jQWRhcHRlcigpOwogCiAgICAgICAgICAgICBpZiAoc3luY1Jlc3VsdCAhPSBudWxsICYmIHN5bmNSZXN1bHQudG9vTWFueURlbGV0aW9ucykgewogICAgICAgICAgICAgICAgIGluc3RhbGxIYW5kbGVUb29NYW55RGVsZXRlc05vdGlmaWNhdGlvbihzeW5jT3BlcmF0aW9uLmFjY291bnQsCkBAIC0xNjgzLDIxICsxODY2LDIxIEBACiAgICAgICAgICAqLwogICAgICAgICBwcml2YXRlIGludCBzeW5jUmVzdWx0VG9FcnJvck51bWJlcihTeW5jUmVzdWx0IHN5bmNSZXN1bHQpIHsKICAgICAgICAgICAgIGlmIChzeW5jUmVzdWx0LnN5bmNBbHJlYWR5SW5Qcm9ncmVzcykKLSAgICAgICAgICAgICAgICByZXR1cm4gU3luY1N0b3JhZ2VFbmdpbmUuRVJST1JfU1lOQ19BTFJFQURZX0lOX1BST0dSRVNTOworICAgICAgICAgICAgICAgIHJldHVybiBDb250ZW50UmVzb2x2ZXIuU1lOQ19FUlJPUl9TWU5DX0FMUkVBRFlfSU5fUFJPR1JFU1M7CiAgICAgICAgICAgICBpZiAoc3luY1Jlc3VsdC5zdGF0cy5udW1BdXRoRXhjZXB0aW9ucyA+IDApCi0gICAgICAgICAgICAgICAgcmV0dXJuIFN5bmNTdG9yYWdlRW5naW5lLkVSUk9SX0FVVEhFTlRJQ0FUSU9OOworICAgICAgICAgICAgICAgIHJldHVybiBDb250ZW50UmVzb2x2ZXIuU1lOQ19FUlJPUl9BVVRIRU5USUNBVElPTjsKICAgICAgICAgICAgIGlmIChzeW5jUmVzdWx0LnN0YXRzLm51bUlvRXhjZXB0aW9ucyA+IDApCi0gICAgICAgICAgICAgICAgcmV0dXJuIFN5bmNTdG9yYWdlRW5naW5lLkVSUk9SX0lPOworICAgICAgICAgICAgICAgIHJldHVybiBDb250ZW50UmVzb2x2ZXIuU1lOQ19FUlJPUl9JTzsKICAgICAgICAgICAgIGlmIChzeW5jUmVzdWx0LnN0YXRzLm51bVBhcnNlRXhjZXB0aW9ucyA+IDApCi0gICAgICAgICAgICAgICAgcmV0dXJuIFN5bmNTdG9yYWdlRW5naW5lLkVSUk9SX1BBUlNFOworICAgICAgICAgICAgICAgIHJldHVybiBDb250ZW50UmVzb2x2ZXIuU1lOQ19FUlJPUl9QQVJTRTsKICAgICAgICAgICAgIGlmIChzeW5jUmVzdWx0LnN0YXRzLm51bUNvbmZsaWN0RGV0ZWN0ZWRFeGNlcHRpb25zID4gMCkKLSAgICAgICAgICAgICAgICByZXR1cm4gU3luY1N0b3JhZ2VFbmdpbmUuRVJST1JfQ09ORkxJQ1Q7CisgICAgICAgICAgICAgICAgcmV0dXJuIENvbnRlbnRSZXNvbHZlci5TWU5DX0VSUk9SX0NPTkZMSUNUOwogICAgICAgICAgICAgaWYgKHN5bmNSZXN1bHQudG9vTWFueURlbGV0aW9ucykKLSAgICAgICAgICAgICAgICByZXR1cm4gU3luY1N0b3JhZ2VFbmdpbmUuRVJST1JfVE9PX01BTllfREVMRVRJT05TOworICAgICAgICAgICAgICAgIHJldHVybiBDb250ZW50UmVzb2x2ZXIuU1lOQ19FUlJPUl9UT09fTUFOWV9ERUxFVElPTlM7CiAgICAgICAgICAgICBpZiAoc3luY1Jlc3VsdC50b29NYW55UmV0cmllcykKLSAgICAgICAgICAgICAgICByZXR1cm4gU3luY1N0b3JhZ2VFbmdpbmUuRVJST1JfVE9PX01BTllfUkVUUklFUzsKKyAgICAgICAgICAgICAgICByZXR1cm4gQ29udGVudFJlc29sdmVyLlNZTkNfRVJST1JfVE9PX01BTllfUkVUUklFUzsKICAgICAgICAgICAgIGlmIChzeW5jUmVzdWx0LmRhdGFiYXNlRXJyb3IpCi0gICAgICAgICAgICAgICAgcmV0dXJuIFN5bmNTdG9yYWdlRW5naW5lLkVSUk9SX0lOVEVSTkFMOworICAgICAgICAgICAgICAgIHJldHVybiBDb250ZW50UmVzb2x2ZXIuU1lOQ19FUlJPUl9JTlRFUk5BTDsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIndlIGFyZSBub3QgaW4gYW4gZXJyb3Igc3RhdGUsICIgKyBzeW5jUmVzdWx0KTsKICAgICAgICAgfQogCkBAIC0xNzM4LDkgKzE5MjEsMTAgQEAKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHRpbWVUb1Nob3dOb3RpZmljYXRpb24gPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdyA+IG1TeW5jTm90aWZpY2F0aW9uSW5mby5zdGFydFRpbWUgKyBTWU5DX05PVElGSUNBVElPTl9ERUxBWTsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBzeW5jSXNGb3JjZWQgPSBzeW5jT3BlcmF0aW9uLmV4dHJhcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRCb29sZWFuKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19GT1JDRSwgZmFsc2UpOwotICAgIC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lbmRCcm9hZGNhc3Qoc3luY1N0YXRlSW50ZW50KTsKICAgICAgICAgfQogCi0gICAgICAgIHByaXZhdGUgdm9pZCBpbnN0YWxsSGFuZGxlVG9vTWFueURlbGV0ZXNOb3RpZmljYXRpb24oU3RyaW5nIGFjY291bnQsIFN0cmluZyBhdXRob3JpdHksCisgICAgICAgIHByaXZhdGUgdm9pZCBpbnN0YWxsSGFuZGxlVG9vTWFueURlbGV0ZXNOb3RpZmljYXRpb24oQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgYXV0aG9yaXR5LAogICAgICAgICAgICAgICAgIGxvbmcgbnVtRGVsZXRlcykgewogICAgICAgICAgICAgaWYgKG1Ob3RpZmljYXRpb25NZ3IgPT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgICAgICBmaW5hbCBQcm92aWRlckluZm8gcHJvdmlkZXJJbmZvID0gbUNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKS5yZXNvbHZlQ29udGVudFByb3ZpZGVyKAorICAgICAgICAgICAgICAgICAgICBhdXRob3JpdHksIDAgLyogZmxhZ3MgKi8pOworICAgICAgICAgICAgaWYgKHByb3ZpZGVySW5mbyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQ2hhclNlcXVlbmNlIGF1dGhvcml0eU5hbWUgPSBwcm92aWRlckluZm8ubG9hZExhYmVsKG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCkpOworCiAgICAgICAgICAgICBJbnRlbnQgY2xpY2tJbnRlbnQgPSBuZXcgSW50ZW50KCk7CiAgICAgICAgICAgICBjbGlja0ludGVudC5zZXRDbGFzc05hbWUoImNvbS5hbmRyb2lkLnByb3ZpZGVycy5zdWJzY3JpYmVkZmVlZHMiLAogICAgICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuc2V0dGluZ3MuU3luY0FjdGl2aXR5VG9vTWFueURlbGV0ZXMiKTsKICAgICAgICAgICAgIGNsaWNrSW50ZW50LnB1dEV4dHJhKCJhY2NvdW50IiwgYWNjb3VudCk7Ci0gICAgICAgICAgICBjbGlja0ludGVudC5wdXRFeHRyYSgicHJvdmlkZXIiLCBhdXRob3JpdHkpOworICAgICAgICAgICAgY2xpY2tJbnRlbnQucHV0RXh0cmEoInByb3ZpZGVyIiwgYXV0aG9yaXR5TmFtZS50b1N0cmluZygpKTsKICAgICAgICAgICAgIGNsaWNrSW50ZW50LnB1dEV4dHJhKCJudW1EZWxldGVzIiwgbnVtRGVsZXRlcyk7CiAKICAgICAgICAgICAgIGlmICghaXNBY3Rpdml0eUF2YWlsYWJsZShjbGlja0ludGVudCkpIHsKQEAgLTE4ODEsMTQgKzIwNzQsMTMgQEAKICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0b29NYW55RGVsZXRlc0Rlc2NGb3JtYXQgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRUZXh0KAogICAgICAgICAgICAgICAgICAgICBSLnN0cmluZy5jb250ZW50U2VydmljZVRvb01hbnlEZWxldGVzTm90aWZpY2F0aW9uRGVzYyk7CiAKLSAgICAgICAgICAgIFN0cmluZ1tdIGF1dGhvcml0aWVzID0gYXV0aG9yaXR5LnNwbGl0KCI7Iik7CiAgICAgICAgICAgICBOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uID0KICAgICAgICAgICAgICAgICBuZXcgTm90aWZpY2F0aW9uKFIuZHJhd2FibGUuc3RhdF9ub3RpZnlfc3luY19lcnJvciwKICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFN0cmluZyhSLnN0cmluZy5jb250ZW50U2VydmljZVN5bmMpLAogICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkpOwogICAgICAgICAgICAgbm90aWZpY2F0aW9uLnNldExhdGVzdEV2ZW50SW5mbyhtQ29udGV4dCwKICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQ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291bnRfdHlwZSA9ID8iOwogCiAgICAgcHJpdmF0ZSBmaW5hbCBQcm92aWRlciBtSW50ZXJuYWxQcm92aWRlckludGVyZmFjZTsKIAogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBTWU5DX1NUQVRFX1RBQkxFID0gIl9zeW5jX3N0YXRlIjsKLSAgICBwcml2YXRlIHN0YXRpYyBsb25nIERCX1ZFUlNJT04gPSAyOworICAgIHByaXZhdGUgc3RhdGljIGxvbmcgREJfVkVSU0lPTiA9IDM7CiAKLSAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmdbXSBBQ0NPVU5UX1BST0pFQ1RJT04gPSBuZXcgU3RyaW5nW117Il9zeW5jX2FjY291bnQifTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmdbXSBBQ0NPVU5UX1BST0pFQ1RJT04gPQorICAgICAgICAgICAgbmV3IFN0cmluZ1tdeyJfc3luY19hY2NvdW50IiwgIl9zeW5jX2FjY291bnRfdHlwZSJ9OwogCiAgICAgc3RhdGljIHsKICAgICAgICAgc1VSSU1hdGNoZXIuYWRkVVJJKFNZTkNfU1RBVEVfQVVUSE9SSVRZLCAic3RhdGUiLCBTVEFURSk7CkBAIC03MCw4ICs3Miw5IEBACiAgICAgICAgIGRiLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSBfc3luY19zdGF0ZSAoIiArCiAgICAgICAgICAgICAgICAgICAgIl9pZCBJTlRFR0VSIFBSSU1BUlkgS0VZLCIgKwogICAgICAgICAgICAgICAgICAgICJfc3luY19hY2NvdW50IFRFWFQsIiArCisgICAgICAgICAgICAgICAgICAgIl9zeW5jX2FjY291bnRfdHlwZSBURVhULCIgKwogICAgICAgICAgICAgICAgICAgICJkYXRhIFRFWFQsIiArCi0gICAgICAgICAgICAgICAgICAgIlVOSVFVRShfc3luY19hY2NvdW50KSIgKworICAgICAgICAgICAgICAgICAgICJVTklRVUUoX3N5bmNfYWNjb3VudCwgX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cmluZyBhY2NvdW50TmFtZSA9IGMuZ2V0U3RyaW5nKDApOworICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBhY2NvdW50VHlwZSA9IGMuZ2V0U3RyaW5nKDEpOworICAgICAgICAgICAgICAgIEFjY291bnQgYWNjb3VudCA9IG5ldyBBY2NvdW50KGFjY291bnROYW1lLCBhY2NvdW50VHlwZSk7CiAgICAgICAgICAgICAgICAgaWYgKCFBcnJheVV0aWxzLmNvbnRhaW5zKGFjY291bnRzLCBhY2NvdW50KSkgewotICAgICAgICAgICAgICAgICAgICBkYi5kZWxldGUoU1lOQ19TVEFURV9UQUJMRSwgQUNDT1VOVF9XSEVSRSwgbmV3IFN0cmluZ1tde2FjY291bnR9KTsKKyAgICAgICAgICAgICAgICAgICAgZGIuZGVsZXRlKFNZTkNfU1RBVEVfVEFCTEUsIEFDQ09VTlRfV0hFUkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tde2FjY291bnROYW1lLCBhY2NvdW50VHlwZX0pOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfSBmaW5hbGx5IHsKQEAgLTE5OSw5ICsyMDcsOSBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgcHVibGljIHZvaWQgZGlzY2FyZFN5bmNEYXRhKFNRTGl0ZURhdGFiYXNlIGRiLCBTdHJpbmcgYWNjb3VudCkgeworICAgIHB1YmxpYyB2b2lkIGRpc2NhcmRTeW5jRGF0YShTUUxpdGVEYXRhYmFzZSBkYiwgQWNjb3VudCBhY2NvdW50KSB7CiAgICAgICAgIGlmIChhY2NvdW50ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGRiLmRlbGV0ZShTWU5DX1NUQVRFX1RBQkxFLCBBQ0NPVU5UX1dIRVJFLCBuZXcgU3RyaW5nW117YWNjb3VudH0pOworICAgICAgICAgICAgZGIuZGVsZXRlKFNZTkNfU1RBVEVfVEFCTEUsIEFDQ09VTlRfV0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mZmZmOwotICAgIAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IE1BWF9ISVNUT1JZID0gMTU7Ci0gICAgCisKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTVNHX1dSSVRFX1NUQVRVUyA9IDE7CiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgbG9uZyBXUklURV9TVEFUVVNfREVMQVkgPSAxMDAwKjYwKjEwOyAvLyAxMCBtaW51dGVzCi0gICAgCisKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTVNHX1dSSVRFX1NUQVRJU1RJQ1MgPSAyOwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGxvbmcgV1JJVEVfU1RBVElTVElDU19ERUxBWSA9IDEwMDAqNjAqMzA7IC8vIDEvMiBob3VyCi0gICAgCisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIFNZTkNfRU5BQkxFRF9ERUZBVUxUID0gZmFsc2U7CisKICAgICBwdWJsaWMgc3RhdGljIGNsYXNzIFBlbmRpbmdPcGVyYXRpb24gewotICAgICAgICBmaW5hbCBTdHJpbmcgYWNjb3VudDsKKyAgICAgICAgZmluYWwgQWNjb3VudCBhY2NvdW50OwogICAgICAgICBmaW5hbCBpbnQgc3luY1NvdXJjZTsKICAgICAgICAgZmluYWwgU3RyaW5nIGF1dGhvcml0eTsKICAgICAgICAgZmluYWwgQnVuZGxlIGV4dHJhczsgICAgICAgIC8vIG5vdGU6IHJlYWQtb25seS4KLSAgICAgICAgCisKICAgICAgICAgaW50IGF1dGhvcml0eUlkOwogICAgICAgICBieXRlW10gZmxhdEV4dHJhczsKLSAgICAgICAgCi0gICAgICAgIFBlbmRpbmdPcGVyYXRpb24oU3RyaW5nIGFjY291bnQsIGludCBzb3VyY2UsCisKKyAgICAgICAgUGVuZGluZ09wZXJhdGlvbihBY2NvdW50IGFjY291bnQsIGludCBzb3VyY2UsCiAgICAgICAgICAgICAgICAgU3RyaW5nIGF1dGhvcml0eSwgQnVuZGxlIGV4dHJhcykgewogICAgICAgICAgICAgdGhpcy5hY2NvdW50ID0gYWNjb3VudDsKICAgICAgICAgICAgIHRoaXMuc3luY1NvdXJjZSA9IHNvdXJjZTsKQEAgLTE0OSwzMSArMTM5LDMzIEBACiAgICAgICAgICAgICB0aGlzLmF1dGhvcml0eUlkID0gb3RoZXIuYXV0aG9yaXR5SWQ7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBzdGF0aWMgY2xhc3MgQWNjb3VudEluZm8gewotICAgICAgICBmaW5hbCBTdHJpbmcgYWNjb3VudDsKKyAgICAgICAgZmluYWwgQWNjb3VudCBhY2NvdW50OwogICAgICAgICBmaW5hbCBIYXNoTWFwPFN0cmluZywgQXV0aG9yaXR5SW5mbz4gYXV0aG9yaXRpZXMgPQogICAgICAgICAgICAgICAgIG5ldyBIYXNoTWFwPFN0cmluZywgQXV0aG9yaXR5SW5mbz4oKTsKLSAgICAgICAgCi0gICAgICAgIEFjY291bnRJbmZvKFN0cmluZyBhY2NvdW50KSB7CisKKyAgICAgICAgQWNjb3VudEluZm8oQWNjb3VudCBhY2NvdW50KSB7CiAgICAgICAgICAgICB0aGlzLmFjY291bnQgPSBhY2NvdW50OwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBBdXRob3JpdHlJbmZvIHsKLSAgICAgICAgZmluYWwgU3RyaW5nIGFjY291bnQ7CisgICAgICAgIGZpbmFsIEFjY291bnQgYWNjb3VudDsKICAgICAgICAgZmluYWwgU3RyaW5nIGF1dGhvcml0eTsKICAgICAgICAgZmluYWwgaW50IGlkZW50OwogICAgICAgICBib29sZWFuIGVuYWJsZWQ7Ci0gICAgICAgIAotICAgICAgICBBdXRob3JpdHlJbmZvKFN0cmluZyBhY2NvdW50LCBTdHJpbmcgYXV0aG9yaXR5LCBpbnQgaWRlbnQpIHsKKyAgICAgICAgaW50IHN5bmNhYmxlOworCisgICAgICAgIEF1dGhvcml0eUluZm8oQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgYXV0aG9yaXR5LCBpbnQgaWRlbnQpIHsKICAgICAgICAgICAgIHRoaXMuYWNjb3VudCA9IGFjY291bnQ7CiAgICAgICAgICAgICB0aGlzLmF1dGhvcml0eSA9IGF1dGhvcml0eTsKICAgICAgICAgICAgIHRoaXMuaWRlbnQgPSBpZGVudDsKLSAgICAgICAgICAgIGVuYWJsZWQgPSB0cnVlOworICAgICAgICAgICAgZW5hYmxlZCA9IFNZTkNfRU5BQkxFRF9ERUZBVUxUOworICAgICAgICAgICAgc3luY2FibGUgPSAtMTsgLy8gZGVmYXVsdCB0byAidW5rbm93biIKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgU3luY0hpc3RvcnlJdGVtIHsKICAgICAgICAgaW50IGF1dGhvcml0eUlkOwogICAgICAgICBpbnQgaGlzdG9yeUlkOwpAQCAtMTg1LDY5ICsxNzcsNjkgQEAKICAgICAgICAgbG9uZyBkb3duc3RyZWFtQWN0aXZpdHk7CiAgICAgICAgIFN0cmluZyBtZXNnOwogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgRGF5U3RhdHMgewogICAgICAgICBwdWJsaWMgZmluYWwgaW50IGRheTsKICAgICAgICAgcHVibGljIGludCBzdWNjZXNzQ291bnQ7CiAgICAgICAgIHB1YmxpYyBsb25nIHN1Y2Nlc3NUaW1lOwogICAgICAgICBwdWJsaWMgaW50IGZhaWx1cmVDb3VudDsKICAgICAgICAgcHVibGljIGxvbmcgZmFpbHVyZVRpbWU7Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyBEYXlTdGF0cyhpbnQgZGF5KSB7CiAgICAgICAgICAgICB0aGlzLmRheSA9IGRheTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8vIFByaW1hcnkgbGlzdCBvZiBhbGwgc3luY2F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XNrLCBJU3luY1N0YXR1c09ic2VydmVyIGNhbGxiYWNrKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobUF1dGhvcml0aWVzKSB7CiAgICAgICAgICAgICBtQ2hhbmdlTGlzdGVuZXJzLnJlZ2lzdGVyKGNhbGxiYWNrLCBtYXNrKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHJlbW92ZVN0YXR1c0NoYW5nZUxpc3RlbmVyKElTeW5jU3RhdHVzT2JzZXJ2ZXIgY2FsbGJhY2spIHsKICAgICAgICAgc3luY2hyb25pemVkIChtQXV0aG9yaXRpZXMpIHsKICAgICAgICAgICAgIG1DaGFuZ2VMaXN0ZW5lcnMudW5yZWdpc3RlcihjYWxsYmFjayk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIHZvaWQgcmVwb3J0Q2hhbmdlKGludCB3aGljaCkgewogICAgICAgICBBcnJheUxpc3Q8SVN5bmNTdGF0dXNPYnNlcnZlcj4gcmVwb3J0cyA9IG51bGw7CiAgICAgICAgIHN5bmNocm9uaXplZCAobUF1dGhvcml0aWVzKSB7CkBAIC0zNDAsOSArMzMyLDkgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1DaGFuZ2VMaXN0ZW5lcnMuZmluaXNoQnJvYWRjYXN0KCk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJyZXBvcnRDaGFuZ2UgIiArIHdoaWNoICsgIiB0bzogIiArIHJlcG9ydHMpOwotICAgICAgICAKKwogICAgICAgICBpZiAocmVwb3J0cyAhPSBudWxsKSB7CiAgICAgICAgICAgICBpbnQgaSA9IHJlcG9ydHMuc2l6ZSgpOwogICAgICAgICAgICAgd2hpbGUgKGkgPiAwKSB7CkBAIC0zNjYsMTggKzM1OCwxOCBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgcHVibGljIGJvb2xlYW4gZ2V0U3luY1Byb3ZpZGVyQXV0b21hdGljYWxseShTdHJpbmcgYWNjb3VudCwgU3RyaW5nIHByb3ZpZGVyTmFtZSkgeworICAgIHB1YmxpYyBib29sZWFuIGdldFN5bmNBdXRvbWF0aWNhbGx5KEFjY291bnQgYWNjb3VudCwgU3RyaW5nIHByb3ZpZGVyTmFtZSkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1BdXRob3JpdGllcykgewogICAgICAgICAgICAgaWYgKGFjY291bnQgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gZ2V0QXV0aG9yaXR5TG9ja2VkKGFjY291bnQsIHByb3ZpZGVyTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICJnZXRTeW5jUHJvdmlkZXJBdXRvbWF0aWNhbGx5Iik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGF1dGhvcml0eSAhPSBudWxsID8gYXV0aG9yaXR5LmVuYWJsZWQgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICJnZXRTeW5jQXV0b21hdGljYWxseSIpOworICAgICAgICAgICAgICAgIHJldHVybiBhdXRob3JpdHkgIT0gbnVsbCAmJiBhdXRob3JpdHkuZW5hYmxlZDsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpbnQgaSA9IG1BdXRob3JpdGllcy5zaXplKCk7CiAgICAgICAgICAgICB3aGlsZSAoaSA+IDApIHsKICAgICAgICAgICAgICAgICBpLS07Ci0gICAgICAgICAgICAgICAgQXV0aG9yaXR5SW5mbyBhdXRob3JpdHkgPSBtQXV0aG9yaXRpZXMuZ2V0KGkpOworICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gbUF1dGhvcml0aWVzLnZhbHVlQXQoaSk7CiAgICAgICAgICAgICAgICAgaWYgKGF1dGhvcml0eS5hdXRob3JpdHkuZXF1YWxzKHByb3ZpZGVyTmFtZSkKICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dGhvcml0eS5lbmFibGVkKSB7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwpAQCAtMzg3LDYxICszNzksMTAyIEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCBzZXRTeW5jUHJvdmlkZXJBdXRvbWF0aWNhbGx5KFN0cmluZyBhY2NvdW50LCBTdHJpbmcgcHJvdmlkZXJOYW1lLCBib29sZWFuIHN5bmMpIHsKKyAgICBwdWJsaWMgdm9pZCBzZXRTeW5jQXV0b21hdGljYWxseShBY2NvdW50IGFjY291bnQsIFN0cmluZyBwcm92aWRlck5hbWUsIGJvb2xlYW4gc3luYykgeworICAgICAgICBib29sZWFuIHdhc0VuYWJsZWQ7CisgICAgICAgIHN5bmNocm9uaXplZCAobUF1dGhvcml0aWVzKSB7CisgICAgICAgICAgICBBdXRob3JpdHlJbmZvIGF1dGhvcml0eSA9IGdldE9yQ3JlYXRlQXV0aG9yaXR5TG9ja2VkKGFjY291bnQsIHByb3ZpZGVyTmFtZSwgLTEsIGZhbHNlKTsKKyAgICAgICAgICAgIHdhc0VuYWJsZWQgPSBhdXRob3JpdHkuZW5hYmxlZDsKKyAgICAgICAgICAgIGF1dGhvcml0eS5lbmFibGVkID0gc3luYzsKKyAgICAgICAgICAgIHdyaXRlQWNjb3VudEluZm9Mb2NrZWQoKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghd2FzRW5hYmxlZCAmJiBzeW5jKSB7CisgICAgICAgICAgICBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5yZXF1ZXN0U3luYyhhY2NvdW50LCBwcm92aWRlck5hbWUsIG5ldyBCdW5kbGUoKSk7CisgICAgICAgIH0KKyAgICAgICAgcmVwb3J0Q2hhbmdlKENvbnRlbnRSZXNvbHZlci5TWU5DX09CU0VSVkVSX1RZUEVfU0VUVElOR1MpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0SXNTeW5jYWJsZShBY2NvdW50IGFjY291bnQsIFN0cmluZyBwcm92aWRlck5hbWUpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtQXV0aG9yaXRpZXMpIHsKICAgICAgICAgICAgIGlmIChhY2NvdW50ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBBdXRob3JpdHlJbmZvIGF1dGhvcml0eSA9IGdldEF1dGhvcml0eUxvY2tlZChhY2NvdW50LCBwcm92aWRlck5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAic2V0U3luY1Byb3ZpZGVyQXV0b21hdGljYWxseSIpOwotICAgICAgICAgICAgICAgIGlmIChhdXRob3JpdHkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBhdXRob3JpdHkuZW5hYmxlZCA9IHN5bmM7CisgICAgICAgICAgICAgICAgICAgICAgICAiZ2V0SXNTeW5jYWJsZSIpOworICAgICAgICAgICAgICAgIGlmIChhdXRob3JpdHkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpbnQgaSA9IG1BdXRob3JpdGllcy5zaXplKCk7Ci0gICAgICAgICAgICAgICAgd2hpbGUgKGkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGktLTsKLSAgICAgICAgICAgICAgICAgICAgQXV0aG9yaXR5SW5mbyBhdXRob3JpdHkgPSBtQXV0aG9yaXRpZXMuZ2V0KGkpOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXV0aG9yaXR5LmF1dGhvcml0eS5lcXVhbHMocHJvdmlkZXJOYW1lKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgYXV0aG9yaXR5LmVuYWJsZWQgPSBzeW5jOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGF1dGhvcml0eS5zeW5jYWJsZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IGkgPSBtQXV0aG9yaXRpZXMuc2l6ZSgpOworICAgICAgICAgICAgd2hpbGUgKGkgPiAwKSB7CisgICAgICAgICAgICAgICAgaS0tOworICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gbUF1dGhvcml0aWVzLnZhbHVlQXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGF1dGhvcml0eS5hdXRob3JpdHkuZXF1YWxzKHByb3ZpZGVyTmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF1dGhvcml0eS5zeW5jYWJsZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB3cml0ZUFjY291bnRJbmZvTG9ja2VkKCk7CisgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHJlcG9ydENoYW5nZShDSEFOR0VfU0VUVElOR1MpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIHNldExpc3RlbkZvck5ldHdvcmtUaWNrbGVzKGJvb2xlYW4gZmxhZykgeworICAgIHB1YmxpYyB2b2lkIHNldElzU3luY2FibGUoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgcHJvdmlkZXJOYW1lLCBpbnQgc3luY2FibGUpIHsKKyAgICAgICAgaW50IG9sZFN0YXRlOworICAgICAgICBpZiAoc3luY2FibGUgPiAxKSB7CisgICAgICAgICAgICBzeW5jYWJsZSA9IDE7CisgICAgICAgIH0gZWxzZSBpZiAoc3luY2FibGUgPCAtMSkgeworICAgICAgICAgICAgc3luY2FibGUgPSAtMTsKKyAgICAgICAgfQorICAgICAgICBMb2cuZChUQUcsICJzZXRJc1N5bmNhYmxlOiAiICsgYWNjb3VudCArICIsIHByb3ZpZGVyICIgKyBwcm92aWRlck5hbWUgKyAiIC0+ICIgKyBzeW5jYWJsZSk7CiAgICAgICAgIHN5bmNocm9uaXplZCAobUF1dGhvcml0aWVzKSB7Ci0gICAgICAgICAgICBtTGlzdGVuRm9yVGlja2xlcyA9IGZsYWc7CisgICAgICAgICAgICBBdXRob3JpdHlJbmZvIGF1dGhvcml0eSA9IGdldE9yQ3JlYXRlQXV0aG9yaXR5TG9ja2VkKGFjY291bnQsIHByb3ZpZGVyTmFtZSwgLTEsIGZhbHNlKTsKKyAgICAgICAgICAgIG9sZFN0YXRlID0gYXV0aG9yaXR5LnN5bmNhYmxlOworICAgICAgICAgICAgYXV0aG9yaXR5LnN5bmNhYmxlID0gc3luY2FibGU7CiAgICAgICAgICAgICB3cml0ZUFjY291bnRJbmZvTG9ja2VkKCk7CiAgICAgICAgIH0KLSAgICAgICAgcmVwb3J0Q2hhbmdlKENIQU5HRV9TRVRUSU5HUyk7CisKKyAgICAgICAgaWYgKG9sZFN0YXRlIDw9IDAgJiYgc3luY2FibGUgPiAwKSB7CisgICAgICAgICAgICBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5yZXF1ZXN0U3luYyhhY2NvdW50LCBwcm92aWRlck5hbWUsIG5ldyBCdW5kbGUoKSk7CisgICAgICAgIH0KKyAgICAgICAgcmVwb3J0Q2hhbmdlKENvbnRlbnRSZXNvbHZlci5TWU5DX09CU0VSVkVSX1RZUEVfU0VUVElOR1MpOwogICAgIH0KIAotICAgIHB1YmxpYyBib29sZWFuIGdldExpc3RlbkZvck5ldHdvcmtUaWNrbGVzKCkgeworICAgIHB1YmxpYyB2b2lkIHNldE1hc3RlclN5bmNBdXRvbWF0aWNhbGx5KGJvb2xlYW4gZmxhZykgeworICAgICAgICBib29sZWFuIG9sZDsKICAgICAgICAgc3luY2hyb25pemVkIChtQXV0aG9yaXRpZXMpIHsKLSAgICAgICAgICAgIHJldHVybiBtTGlzdGVuRm9yVGlja2xlczsKKyAgICAgICAgICAgIG9sZCA9IG1NYXN0ZXJTeW5jQXV0b21hdGljYWxseTsKKyAgICAgICAgICAgIG1NYXN0ZXJTeW5jQXV0b21hdGljYWxseSA9IGZsYWc7CisgICAgICAgICAgICB3cml0ZUFjY291bnRJbmZvTG9ja2VkKCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFvbGQgJiYgZmxhZykgeworICAgICAgICAgICAgbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCkucmVxdWVzdFN5bmMobnVsbCwgbnVsbCwgbmV3IEJ1bmRsZSgpKTsKKyAgICAgICAgfQorICAgICAgICByZXBvcnRDaGFuZ2UoQ29udGVudFJlc29sdmVyLlNZTkNfT0JTRVJWRVJfVFlQRV9TRVRUSU5HUyk7CisgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoU1lOQ19DT05ORUNUSU9OX1NFVFRJTkdfQ0hBTkdFRF9JTlRFTlQpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGdldE1hc3RlclN5bmNBdXRvbWF0aWNhbGx5KCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1BdXRob3JpdGllcykgeworICAgICAgICAgICAgcmV0dXJuIG1NYXN0ZXJTeW5jQXV0b21hdGljYWxseTsKICAgICAgICAgfQogICAgIH0KLSAgICAKLSAgICBwdWJsaWMgQXV0aG9yaXR5SW5mbyBnZXRBdXRob3JpdHkoU3RyaW5nIGFjY291bnQsIFN0cmluZyBhdXRob3JpdHkpIHsKKworICAgIHB1YmxpYyBBdXRob3JpdHlJbmZvIGdldEF1dGhvcml0eShBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRob3JpdHkpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtQXV0aG9yaXRpZXMpIHsKICAgICAgICAgICAgIHJldHVybiBnZXRBdXRob3JpdHlMb2NrZWQoYWNjb3VudCwgYXV0aG9yaXR5LCBudWxsKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBBdXRob3JpdHlJbmZvIGdldEF1dGhvcml0eShpbnQgYXV0aG9yaXR5SWQpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtQXV0aG9yaXRpZXMpIHsKICAgICAgICAgICAgIHJldHVybiBtQXV0aG9yaXRpZXMuZ2V0KGF1dGhvcml0eUlkKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGVyZSBpcyBjdXJyZW50bHkgYSBzeW5jIG9wZXJhdGlvbiBmb3IgdGhlIGdpdmVuCiAgICAgICogYWNjb3VudCBvciBhdXRob3JpdHkgaW4gdGhlIHBlbmRpbmcgbGlzdCwgb3IgYWN0aXZlbHkgYmVpbmcgcHJvY2Vzc2VkLgogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGlzU3luY0FjdGl2ZShTdHJpbmcgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSkgeworICAgIHB1YmxpYyBib29sZWFuIGlzU3luY0FjdGl2ZShBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRob3JpdHkpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtQXV0aG9yaXRpZXMpIHsKICAgICAgICAgICAgIGludCBpID0gbVBlbmRpbmdPcGVyYXRpb25zLnNpemUoKTsKICAgICAgICAgICAgIHdoaWxlIChpID4gMCkgewpAQCAtNDUzLDcgKzQ4Niw3IEBACiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAobUFjdGl2ZVN5bmMgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYWluZm8gPSBnZXRBdXRob3JpdHkobUFjdGl2ZVN5bmMuYXV0aG9yaXR5SWQpOwogICAgICAgICAgICAgICAgIGlmIChhaW5mbyAhPSBudWxsICYmIGFpbmZvLmFjY291bnQuZXF1YWxzKGFjY291bnQpCkBAIC00NjIsMTcgKzQ5NSwxNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIFBlbmRpbmdPcGVyYXRpb24gaW5zZXJ0SW50b1BlbmRpbmcoUGVuZGluZ09wZXJhdGlvbiBvcCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1BdXRob3JpdGllcykgewogICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJpbnNlcnRJbnRvUGVuZGluZzogYWNjb3VudD0iICsgb3AuYWNjb3VudAogICAgICAgICAgICAgICAgICAgICArICIgYXV0aD0iICsgb3AuYXV0aG9yaXR5CiAgICAgICAgICAgICAgICAgICAgICsgIiBzcmM9IiArIG9wLnN5bmNTb3VyY2UKICAgICAgICAgICAgICAgICAgICAgKyAiIGV4dHJhcz0iICsgb3AuZXh0cmFzKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBBdXRob3JpdHlJbmZvIGF1dGhvcml0eSA9IGdldE9yQ3JlYXRlQXV0aG9yaXR5TG9ja2VkKG9wLmFjY291bnQsCiAgICAgICAgICAgICAgICAgICAgIG9wLmF1dGhvcml0eSwKICAgICAgICAgICAgICAgICAgICAgLTEgLyogZGVzaXJlZCBpZGVudGlmaWVyICovLApAQCAtNDgwLDE3ICs1MTMsMTcgQEAKICAgICAgICAgICAgIGlmIChhdXRob3JpdHkgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIG9wID0gbmV3IFBlbmRpbmdPcGVyYXRpb24ob3ApOwogICAgICAgICAgICAgb3AuYXV0aG9yaXR5SWQgPSBhdXRob3JpdHkuaWRlbnQ7CiAgICAgICAgICAgICBtUGVuZGluZ09wZXJhdGlvbnMuYWRkKG9wKTsKICAgICAgICAgICAgIGFwcGVuZFBlbmRpbmdPcGVyYXRpb25Mb2NrZWQob3ApOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIFN5bmNTdGF0dXNJbmZvIHN0YXR1cyA9IGdldE9yQ3JlYXRlU3luY1N0YXR1c0xvY2tlZChhdXRob3JpdHkuaWRlbnQpOwogICAgICAgICAgICAgc3RhdHVzLnBlbmRpbmcgPSB0cnVlOwogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICByZXBvcnRDaGFuZ2UoQ0hBTkdFX1BFTkRJTkcpOworCisgICAgICAgIHJlcG9ydENoYW5nZShDb250ZW50UmVzb2x2ZXIuU1lOQ19PQlNFUlZFUl9UWVBFX1BFTkRJTkcpOwogICAgICAgICByZXR1cm4gb3A7CiAgICAgfQogCkBAIC01MDksNyArNTQyLDcgQEAKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBtTnVtUGVuZGluZ0ZpbmlzaGVkKys7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgQXV0aG9yaXR5SW5mbyBhdXRob3JpdHkgPSBnZXRBdXRob3JpdHlMb2NrZWQob3AuYWNjb3VudCwgb3AuYXV0aG9yaXR5LAogICAgICAgICAgICAgICAgICAgICAgICAgImRlbGV0ZUZyb21QZW5kaW5nIik7CiAgICAgICAgICAgICAgICAgaWYgKGF1dGhvcml0eSAhPSBudWxsKSB7CkBAIC01MjQsMTkgKzU1NywxOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgICAgIGlmICghbW9yZVBlbmRpbmcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibm8gbW9yZSBwZW5kaW5nISIpOwogICAgICAgICAgICAgICAgICAgICAgICAgU3luY1N0YXR1c0luZm8gc3RhdHVzID0gZ2V0T3JDcmVhdGVTeW5jU3RhdHVzTG9ja2VkKGF1dGhvcml0eS5pZGVudCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMucGVuZGluZyA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgcmVwb3J0Q2hhbmdlKENIQU5HRV9QRU5ESU5HKTsKKworICAgICAgICByZXBvcnRDaGFuZ2UoQ29udGVudFJlc29sdmVyLlNZTkNfT0JTRVJWRVJfVFlQRV9QRU5ESU5HKTsKICAgICAgICAgcmV0dXJuIHJlczsKICAgICB9CiAKQEAgLTU0OCwxMSArNTgxLDExIEBACiAgICAgICAgICAgICBtUGVuZGluZ09wZXJhdGlvbnMuY2xlYXIoKTsKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbVN5bmNTdGF0dXMuc2l6ZSgpOwogICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewotICAgICAgICAgICAgICAgIG1TeW5jU3RhdHVzLmdldChpKS5wZW5kaW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgbVN5bmNTdGF0dXMudmFsdWVBdChpKS5wZW5kaW5nID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICB3cml0ZVBlbmRpbmdPcGVyYXRpb25zTG9ja2VkKCk7CiAgICAgICAgIH0KLSAgICAgICAgcmVwb3J0Q2hhbmdlKENIQU5HRV9QRU5ESU5HKTsKKyAgICAgICAgcmVwb3J0Q2hhbmdlKENvbnRlbnRSZXNvbHZlci5TWU5DX09CU0VSVkVSX1RZUEVfUEVORElORyk7CiAgICAgICAgIHJldHVybiBudW07CiAgICAgfQogCkBAIC01NjYsNyArNTk5LDcgQEAKICAgICAgICAgICAgIHJldHVybiBuZXcgQXJyYXlMaXN0PFBlbmRpbmdPcGVyYXRpb24+KG1QZW5kaW5nT3BlcmF0aW9ucyk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIG51bWJlciBvZiBjdXJyZW50bHkgcGVuZGluZyBvcGVyYXRpb25zLgogICAgICAqLwpAQCAtNTc1LDEyICs2MDgsMTIgQEAKICAgICAgICAgICAgIHJldHVybiBtUGVuZGluZ09wZXJhdGlvbnMuc2l6ZSgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQ2FsbGVkIHdoZW4gdGhlIHNldCBvZiBhY2NvdW50IGhhcyBjaGFuZ2VkLCBnaXZlbiB0aGUgbmV3IGFycmF5IG9mCiAgICAgICogYWN0aXZlIGFjY291bnRzLgogICAgICAqLwotICAgIHB1YmxpYyB2b2lkIGRvRGF0YWJhc2VDbGVhbnVwKFN0cmluZ1tdIGFjY291bnRzKSB7CisgICAgcHVibGljIHZvaWQgZG9EYXRhYmFzZUNsZWFudXAoQWNjb3VudFtdIGFjY291bnRzKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobUF1dGhvcml0aWVzKSB7CiAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy53KFRBRywgIlVwZGF0aW5nIGZvciBuZXcgYWNjb3VudHMuLi4iKTsKICAgICAgICAgICAgIFNwYXJzZUFycmF5PEF1dGhvcml0eUluZm8+IHJlbW92aW5nID0gbmV3IFNwYXJzZUFycmF5PEF1dGhvcml0eUluZm8+KCk7CkBAIC01OTYsNyArNjI5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgYWNjSXQucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIC8vIENsZWFuIG91dCBhbGwgZGF0YSBzdHJ1Y3R1cmVzLgogICAgICAgICAgICAgaW50IGkgPSByZW1vdmluZy5zaXplKCk7CiAg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OCBAQAogICAgICAgICAgICAgaWQgPSBpdGVtLmhpc3RvcnlJZDsKICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAicmV0dXJuaW5nIGhpc3RvcnlJZCAiICsgaWQpOwogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICByZXBvcnRDaGFuZ2UoQ0hBTkdFX1NUQVRVUyk7CisKKyAgICAgICAgcmVwb3J0Q2hhbmdlKENvbnRlbnRSZXNvbHZlci5TWU5DX09CU0VSVkVSX1RZUEVfU1RBVFVTKTsKICAgICAgICAgcmV0dXJuIGlkOwogICAgIH0KIApAQCAtNzE2LDIwICs3NDksMjAgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaXRlbSA9IG51bGw7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKGl0ZW0gPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIExvZy53KFRBRywgInN0b3BTeW5jRXZlbnQ6IG5vIGhpc3RvcnkgZm9yIGlkICIgKyBoaXN0b3J5SWQpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpdGVtLmVsYXBzZWRUaW1lID0gZWxhcHNlZFRpbWU7CiAgICAgICAgICAgICBpdGVtLmV2ZW50ID0gRVZFTlRfU1RPUDsKICAgICAgICAgICAgIGl0ZW0ubWVzZyA9IHJlc3VsdE1lc3NhZ2U7CiAgICAgICAgICAgICBpdGVtLmRvd25zdHJlYW1BY3Rpdml0eSA9IGRvd25zdHJlYW1BY3Rpdml0eTsKICAgICAgICAgICAgIGl0ZW0udXBzdHJlYW1BY3Rpdml0eSA9IHVwc3RyZWFtQWN0aXZpdHk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgU3luY1N0YXR1c0luZm8gc3RhdHVzID0gZ2V0T3JDcmVhdGVTeW5jU3RhdHVzTG9ja2VkKGl0ZW0uYXV0aG9yaXR5SWQpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHN0YXR1cy5udW1TeW5jcysrOwogICAgICAgICAgICAgc3RhdHVzLnRvdGFsRWxhcHNlZFRpbWUgKz0gZWxhcHNlZFRpbWU7CiAgICAgICAgICAgICBzd2l0Y2ggKGl0ZW0uc291cmNlKSB7CkBAIC03NDYsNyArNzc5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgc3RhdHVzLm51bVNvdXJjZVNlcnZlcisrOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBib29sZWFuIHdyaXRlU3RhdGlzdGljc05vdyA9IGZhbHNlOwogICAgICAgICAgICAgaW50IGRheSA9IGdldEN1cnJlbnREYXlMb2NrZWQoKTsKICAgICAgICAgICAgIGlmIChtRGF5U3RhdHNbMF0gPT0gbnVsbCkgewpAQCAtNzU4LDcgKzc5MSw3IEBACiAgICAgICAgICAgICB9IGVsc2UgaWYgKG1EYXlTdGF0c1swXSA9PSBudWxsKSB7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBmaW5hbCBEYXlTdGF0cyBkcyA9IG1EYXlTdGF0c1swXTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBmaW5hbCBsb25nIGxhc3RTeW5jVGltZSA9IChpdGVtLmV2ZW50VGltZSArIGVsYXBzZWRUaW1lKTsKICAgICAgICAgICAgIGJvb2xlYW4gd3JpdGVTdGF0dXNOb3cgPSBmYWxzZTsKICAgICAgICAgICAgIGlmIChNRVNHX1NVQ0NFU1MuZXF1YWxzKHJlc3VsdE1lc3NhZ2UpKSB7CkBAIC03ODcsNyArODIwLDcgQEAKICAgICAgICAgICAgICAgICBkcy5mYWlsdXJlQ291bnQrKzsKICAgICAgICAgICAgICAgICBkcy5mYWlsdXJlVGltZSArPSBlbGFwc2VkVGltZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAod3JpdGVTdGF0dXNOb3cpIHsKICAgICAgICAgICAgICAgICB3cml0ZVN0YXR1c0xvY2tlZCgpOwogICAgICAgICAgICAgfSBlbHNlIGlmICghaGFzTWVzc2FnZXMoTVNHX1dSSVRFX1NUQVRVUykpIHsKQEAgLTc5OSwxMCArODMyLDEwIEBACiAgICAgICAgICAgICB9IGVsc2UgaWYgKCFoYXNNZXNzYWdlcyhNU0dfV1JJVEVfU1RBVElTVElDUykpIHsKICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZURlbGF5ZWQob2J0YWluTWVzc2FnZShNU0dfV1JJVEVfU1RBVElTVElDUyksCiAgICAgICAgICAgICAgICAgICAgICAgICBXUklURV9TVEFUSVNUSUNTX0RFTEFZKTsKLSAgICAgICAgICAgIH0gICAgICAgICAgICAKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgcmVwb3J0Q2hhbmdlKENIQU5HRV9TVEFUVVMpOworCisgICAgICAgIHJlcG9ydENoYW5nZShDb250ZW50UmVzb2x2ZXIuU1lOQ19PQlNFUlZFUl9UWVBFX1NUQVRVUyk7CiAgICAgfQogCiAgICAgLyoqCkBAIC04MTUsNyArODQ4LDcgQEAKICAgICAgICAgICAgIHJldHVybiBtQWN0aXZlU3luYzsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHVybiBhbiBhcnJheSBvZiB0aGUgY3VycmVudCBzeW5jIHN0YXR1cyBmb3IgYWxsIGF1dGhvcml0aWVzLiAgTm90ZQogICAgICAqIHRoYXQgdGhlIG9iamVjdHMgaW5zaWRlIHRoZSBhcnJheSBhcmUgdGhlIHJlYWwsIGxpdmUgc3RhdHVzIG9iamVjdHMsCkBAIC04MzEsNDAgKzg2NCw0MSBAQAogICAgICAgICAgICAgcmV0dXJuIG9wczsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgotICAgICAqIFJldHVybnMgdGhlIHN0YXR1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iAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgU3luY1N0YXR1c0luZm8gY3VyID0gbVN5bmNTdGF0dXMuZ2V0KGkpOworICAgICAgICAgICAgICAgIFN5bmNTdGF0dXNJbmZvIGN1ciA9IG1TeW5jU3RhdHVzLnZhbHVlQXQoaSk7CiAgICAgICAgICAgICAgICAgQXV0aG9yaXR5SW5mbyBhaW5mbyA9IG1BdXRob3JpdGllcy5nZXQoY3VyLmF1dGhvcml0eUlkKTsKLSAgICAgICAgICAgICAgICBpZiAoYWluZm8gIT0gbnVsbCAmJiBhaW5mby5hdXRob3JpdHkuZXF1YWxzKGF1dGhvcml0eSkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGJlc3QgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGN1cjsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChiZXN0Lmxhc3RTdWNjZXNzVGltZSA+IGN1ci5sYXN0U3VjY2Vzc1RpbWUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJlc3QgPSBjdXI7Ci0gICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChhaW5mbyAhPSBudWxsICYmIGFpbmZvLmF1dGhvcml0eS5lcXVhbHMoYXV0aG9yaXR5KSAmJgorICAgICAgICAgICAgICAgICAgICBhY2NvdW50LmVxdWFscyhhaW5mby5hY2NvdW50KSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuIGN1cjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gYmVzdDsKKyAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogUmV0dXJuIHRydWUgaWYgdGhlIHBlbmRpbmcgc3RhdHVzIGlzIHRydWUgb2YgYW55IG1hdGNoaW5nIGF1dGhvcml0aWVzLgogICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGlzQXV0aG9yaXR5UGVuZGluZyhTdHJpbmcgYWNjb3VudCwgU3RyaW5nIGF1dGhvcml0eSkgeworICAgIHB1YmxpYyBib29sZWFuIGlzU3luY1BlbmRpbmcoQWNjb3VudCBhY2NvdW50LCBTdHJpbmcgYXV0aG9yaXR5KSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobUF1dGhvcml0aWVzKSB7CiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1TeW5jU3RhdHVzLnNpemUoKTsKICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgICAgICBTeW5jU3RhdHVzSW5mbyBjdXIgPSBtU3luY1N0YXR1cy5nZXQoaSk7CisgICAgICAgICAgICAgICAgU3luY1N0YXR1c0luZm8gY3VyID0gbVN5bmNTdGF0dXMudmFsdWVBdChpKTsKICAgICAgICAgICAgICAgICBBdXRob3JpdHlJbmZvIGFpbmZvID0gbUF1dGhvcml0aWVzLmdldChjdXIuYXV0aG9yaXR5SWQpOwogICAgICAgICAgICAgICAgIGlmIChhaW5mbyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwpAQCAtODk1LDcgKzkyOSw3IEBACiAgICAgICAgICAgICByZXR1cm4gaXRlbXM7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBSZXR1cm4gYW4gYXJyYXkgb2YgdGhlIGN1cnJlbnQgcGVyLWRheSBzdGF0aXN0aWNzLiAgTm90ZQogICAgICAqIHRoYXQgdGhlIG9iamVjdHMgaW5zaWRlIHRoZSBhcnJheSBhcmUgdGhlIHJlYWwsIGxpdmUgc3RhdHVzIG9iamVjdHMsCkBAIC05MDgsNyArOTQyLDcgQEAKICAgICAgICAgICAgIHJldHVybiBkczsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIElmIHN5bmMgaXMgZmFpbGluZyBmb3IgYW55IG9mIHRoZSBwcm92aWRlci9hY2NvdW50cyB0aGVuIGRldGVybWluZSB0aGUgdGltZSBhdCB3aGljaCBpdAogICAgICAqIHN0YXJ0ZWQgZmFpbGluZyBhbmQgcmV0dXJuIHRoZSBlYXJsaWVzdCB0aW1lIG92ZXIgYWxsIHRoZSBwcm92aWRlci9hY2NvdW50cy4gSWYgbm9uZSBhcmUKQEAgLTkxNiwxMCArOTUwLDEwIEBACiAgICAgICovCiAgICAgcHVibGljIGxvbmcgZ2V0SW5pdGlhbFN5bmNGYWlsdXJlVGltZSgpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtQXV0aG9yaXRpZXMpIHsKLSAgICAgICAgICAgIGlmICghbUxpc3RlbkZvclRpY2tsZXMpIHsKKyAgICAgICAgICAgIGlmICghbU1hc3RlclN5bmNBdXRvbWF0aWNhbGx5KSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgbG9uZyBvbGRlc3QgPSAwOwogICAgICAgICAgICAgaW50IGkgPSBtU3luY1N0YXR1cy5zaXplKCk7CiAgICAgICAgICAgICB3aGlsZSAoaSA+IDApIHsKQEAgLTkzMiwxMSArOTY2LDExIEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcmV0dXJuIG9sZGVzdDsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgaW50IGdldEN1cnJlbnREYXlMb2NrZWQoKSB7CiAgICAgICAgIG1DYWwuc2V0VGltZUluTWlsbGlzKFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpKTsKICAgICAgICAgZmluYWwgaW50IGRheU9mWWVhciA9IG1DYWwuZ2V0KENhbGVuZGFyLkRBWV9PRl9ZRUFSKTsKQEAgLTk0OCwzNiArOTgyLDQwIEBACiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGRheU9mWWVhciArIG1ZZWFySW5EYXlzOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHJpZXZlIGFuIGF1dGhvcml0eSwgcmV0dXJuaW5nIG51bGwgaWYgb25lIGRvZXMgbm90IGV4aXN0LgotICAgICAqIAorICAgICAqCiAgICAgICogQHBhcmFtIGFjY291bnROYW1lIFRoZSBuYW1lIG9mIHRoZSBhY2NvdW50IGZvciB0aGUgYXV0aG9yaXR5LgogICAgICAqIEBwYXJhbSBhdXRob3JpdHlOYW1lIFRoZSBuYW1lIG9mIHRoZSBhdXRob3JpdHkgaXRzZWxmLgogICAgICAqIEBwYXJhbSB0YWcgSWYgbm9uLW51bGwsIHRoaXMgd2lsbCBiZSB1c2VkIGluIGEgbG9nIG1lc3NhZ2UgaWYgdGhlCiAgICAgICogcmVxdWVzdGVkIGF1dGhvcml0eSBkb2VzIG5vdCBleGlzdC4KICAgICAgKi8KLSAgICBwcml2YXRlIEF1dGhvcml0eUluZm8gZ2V0QXV0aG9yaXR5TG9ja2VkKFN0cmluZyBhY2NvdW50TmFtZSwgU3RyaW5nIGF1dGhvcml0eU5hbWUsCisgICAgcHJpdmF0ZSBBdXRob3JpdHlJbmZvIGdldEF1dGhvcml0eUxvY2tlZChBY2NvdW50IGFjY291bnROYW1lLCBTdHJpbmcgYXV0aG9yaXR5TmFtZSwKICAgICAgICAgICAgIFN0cmluZyB0YWcpIHsKICAgICAgICAgQWNjb3VudEluZm8gYWNjb3VudCA9IG1BY2NvdW50cy5nZXQoYWNjb3VudE5hbWUpOwogICAgICAgICBpZiAoYWNjb3VudCA9PSBudWxsKSB7CiAgICAgICAgICAgICBpZiAodGFnICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBMb2cudyhUQUcsIHRhZyArICI6IHVua25vd24gYWNjb3VudCAiICsgYWNjb3VudE5hbWUpOworICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsIHRhZyArICI6IHVua25vd24gYWNjb3VudCAiICsgYWNjb3VudE5hbWUpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gYWNjb3VudC5hdXRob3JpdGllcy5nZXQoYXV0aG9yaXR5TmFtZSk7CiAgICAgICAgIGlmIChhdXRob3JpdHkgPT0gbnVsbCkgewogICAgICAgICAgICAgaWYgKHRhZyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTG9nLncoVEFHLCB0YWcgKyAiOiB1bmtub3duIGF1dGhvcml0eSAiICsgYXV0aG9yaXR5TmFtZSk7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgdGFnICsgIjogdW5rbm93biBhdXRob3JpdHkgIiArIGF1dGhvcml0eU5hbWUpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHJldHVybiBhdXRob3JpdHk7CiAgICAgfQotICAgIAotICAgIHByaXZhdGUgQXV0aG9yaXR5SW5mbyBnZXRPckNyZWF0ZUF1dGhvcml0eUxvY2tlZChTdHJpbmcgYWNjb3VudE5hbWUsCisKKyAgICBwcml2YXRlIEF1dGhvcml0eUluZm8gZ2V0T3JDcmVhdGVBdXRob3JpdHlMb2NrZWQoQWNjb3VudCBhY2NvdW50TmFtZSwKICAgICAgICAgICAgIFN0cmluZyBhdXRob3JpdHlOYW1lLCBpbnQgaWRlbnQsIGJvb2xlYW4gZG9Xcml0ZSkgewogICAgICAgICBBY2NvdW50SW5mbyBhY2NvdW50ID0gbUFjY291bnRzLmdldChhY2NvdW50TmFtZSk7CiAgICAgICAgIGlmIChhY2NvdW50ID09IG51bGwpIHsKQEAgLTk5Nyw2ICsxMDM1LDggQEAKICAgICAgICAgICAgICAgICAgICAgaWRlbnQrKzsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBMb2cuZChUQUcsICJjcmVhdGVkIGEgbmV3IEF1dGhvcml0eUluZm8gZm9yICIgKyBhY2NvdW50TmFtZQorICAgICAgICAgICAgICAgICAgICArICIsIHByb3ZpZGVyICIgKyBhdXRob3JpdHlOYW1lKTsKICAgICAgICAgICAgIGF1dGhvcml0eSA9IG5ldyBBdXRob3JpdHlJbmZvKGFjY291bnROYW1lLCBhdXRob3JpdHlOYW1lLCBpZGVudCk7CiAgICAgICAgICAgICBhY2NvdW50LmF1dGhvcml0aWVzLnB1dChhdXRob3JpdHlOYW1lLCBhdXRob3JpdHkpOwogICAgICAgICAgICAgbUF1dGhvcml0aWVzLnB1dChpZGVudCwgYXV0aG9yaXR5KTsKQEAgLTEwMDQsMTAgKzEwNDQsMTAgQEAKICAgICAgICAgICAgICAgICB3cml0ZUFjY291bnRJbmZvTG9ja2VkKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcmV0dXJuIGF1dGhvcml0eTsKICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIFN5bmNTdGF0dXNJbmZvIGdldE9yQ3JlYXRlU3luY1N0YXR1c0xvY2tlZChpbnQgYXV0aG9yaXR5SWQpIHsKICAgICAgICAgU3luY1N0YXR1c0luZm8gc3RhdHVzID0gbVN5bmNTdGF0dXMuZ2V0KGF1dGhvcml0eUlkKTsKICAgICAgICAgaWYgKHN0YXR1cyA9PSBudWxsKSB7CkBAIC0xMDE2LDIyICsxMDU2LDIyIEBACiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHN0YXR1czsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCB3cml0ZUFsbFN0YXRlKCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1BdXRob3JpdGllcykgewogICAgICAgICAgICAgLy8gQWNjb3VudCBpbmZvIGlzIGFsd2F5cyB3cml0dGVuIHNvIG5vIG5lZWQgdG8gZG8gaXQgaGVyZS4KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAobU51bVBlbmRpbmdGaW5pc2hlZCA+IDApIHsKICAgICAgICAgICAgICAgICAvLyBPbmx5IHdyaXRlIHRoZXNlIGlmIHRoZXkgYXJlIG91dCBvZiBkYXRlLgogICAgICAgICAgICAgICAgIHdyaXRlUGVuZGluZ09wZXJhdGlvbnNMb2NrZWQoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICAvLyBKdXN0IGFsd2F5cyB3cml0ZSB0aGVzZS4uLiAgdGhleSBhcmUgbGlrZWx5IG91dCBvZiBkYXRlLgogICAgICAgICAgICAgd3JpdGVTdGF0dXNMb2NrZWQoKTsKICAgICAgICAgICAgIHdyaXRlU3RhdGlzdGljc0xvY2tlZCgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogUmVhZCBhbGwgYWNjb3VudCBpbmZvcm1hdGlvbiBiYWNrIGluIHRvIHRoZSBpbml0aWFsIGVuZ2luZSBzdGF0ZS4KICAgICAgKi8KQEAgLTEwNTAsNyArMTA5MCw3IEBACiAgICAgICAgICAgICBpZiAoImFjY291bnRzIi5lcXVhbHModGFnTmFtZSkpIHsKICAgICAgICAgICAgICAgICBTdHJpbmcgbGlzdGVuID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKAogICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgImxpc3Rlbi1mb3ItdGlja2xlcyIpOwotICAgICAgICAgICAgICAgIG1MaXN0ZW5Gb3JUaWNrbGVzID0gbGlzdGVuID09IG51bGwKKyAgICAgICAgICAgICAgICBtTWFzdGVyU3luY0F1dG9tYXRpY2FsbHkgPSBsaXN0ZW4gPT0gbnVsbAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IEJvb2xlYW4ucGFyc2VCb29sZWFuKGxpc3Rlbik7CiAgICAgICAgICAgICAgICAgZXZlbnRUeXBlID0gcGFyc2VyLm5leHQoKTsKICAgICAgICAgICAgICAgICBkbyB7CkBAIC0xMDY4LDI2ICsxMTA4LDQzIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlkID49IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGFjY291bnROYW1lID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsICJhY2NvdW50Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhY2NvdW50VHlwZSA9IHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCAidHlwZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFR5cGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudFR5cGUgPSAiY29tLmdvb2dsZS5HQUlBIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXV0aG9yaXR5TmFtZSA9IHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCAiYXV0aG9yaXR5Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBlbmFibGVkID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsICJlbmFibGVkIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gbUF1dGhvcml0aWVzLmdldChpZCk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc3luY2FibGUgPSBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInN5bmNhYmxlIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gbUF1dGhvcml0aWVzLmdldChpZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19GSUxFKSBMb2cudihUQUcsICJBZGRpbmcgYXV0aG9yaXR5OiBhY2NvdW50PSIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGFjY291bnROYW1lICsgIiBhdXRoPSIgKyBhdXRob3JpdHlOYW1lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGVuYWJsZWQ9IiArIGVuYWJsZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBlbmFibGVkPSIgKyBlbmFibGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHN5bmNhYmxlPSIgKyBzeW5jYWJsZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdXRob3JpdHkgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0ZJTEUpIExvZy52KFRBRywgIkNyZWF0aW5nIGVudHJ5Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRob3JpdHkgPSBnZXRPckNyZWF0ZUF1dGhvcml0eUxvY2tlZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50TmFtZSwgYXV0aG9yaXR5TmFtZSwgaWQsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFjY291bnQoYWNjb3VudE5hbWUsIGFjY291bnRUeXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aG9yaXR5TmFtZSwgaWQsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXV0aG9yaXR5ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhvcml0eS5lbmFibGVkID0gZW5hYmxlZCA9PSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IEJvb2xlYW4ucGFyc2VCb29sZWFuKGVuYWJsZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCJ1bmtub3duIi5lcXVhbHMoc3luY2FibGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aG9yaXR5LnN5bmNhYmxlID0gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhvcml0eS5zeW5jYWJsZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3luY2FibGUgPT0gbnVsbCB8fCBCb29sZWFuLnBhcnNlQm9vbGVhbihlbmFibGVkKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWx1cmUgYWRkaW5nIGF1dGhvcml0eTogYWNjb3VudD0iCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYWNjb3VudE5hbWUgKyAiIGF1dGg9IiArIGF1dGhvcml0eU5hbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGVuYWJsZWQ9IiArIGVuYWJsZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZW5hYmxlZD0iICsgZW5hYmxlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgc3luY2FibGU9IiArIHN5bmNhYmxlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTExMDksNDMgKzExNjYsNDkgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFdyaXRlIGFsbCBhY2NvdW50IGluZm9ybWF0aW9uIHRvIHRoZSBhY2NvdW50IGZpbGUuCiAgICAgICovCiAgICAgcHJpdmF0ZSB2b2lkIHdyaXRlQWNjb3VudEluZm9Mb2NrZWQoKSB7CiAgICAgICAgIGlmIChERUJVR19GSUxFKSBMb2cudihUQUcsICJXcml0aW5nIG5ldyAiICsgbUFjY291bnRJbmZvRmlsZS5nZXRCYXNlRmlsZSgpKTsKICAgICAgICAgRmlsZU91dHB1dFN0cmVhbSBmb3MgPSBudWxsOwotICAgICAgICAKKwogICAgICAgICB0cnkgewogICAgICAgICAgICAgZm9zID0gbUFjY291bnRJbmZvRmlsZS5zdGFydFdyaXRlKCk7CiAgICAgICAgICAgICBYbWxTZXJpYWxpemVyIG91dCA9IG5ldyBGYXN0WG1sU2VyaWFsaXplcigpOwogICAgICAgICAgICAgb3V0LnNldE91dHB1dChmb3MsICJ1dGYtOCIpOwogICAgICAgICAgICAgb3V0LnN0YXJ0RG9jdW1lbnQobnVsbCwgdHJ1ZSk7CiAgICAgICAgICAgICBvdXQuc2V0RmVhdHVyZSgiaHR0cDovL3htbHB1bGwub3JnL3YxL2RvYy9mZWF0dXJlcy5odG1sI2luZGVudC1vdXRwdXQiLCB0cnVlKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgImFjY291bnRzIik7Ci0gICAgICAgICAgICBpZiAoIW1MaXN0ZW5Gb3JUaWNrbGVzKSB7CisgICAgICAgICAgICBpZiAoIW1NYXN0ZXJTeW5jQXV0b21hdGljYWxseSkgewogICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgImxpc3Rlbi1mb3ItdGlja2xlcyIsICJmYWxzZSIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUF1dGhvcml0aWVzLnNpemUoKTsKICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgICAgICBBdXRob3JpdHlJbmZvIGF1dGhvcml0eSA9IG1BdXRob3JpdGllcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgQXV0aG9yaXR5SW5mbyBhdXRob3JpdHkgPSBtQXV0aG9yaXRpZXMudmFsdWVBdChpKTsKICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgImF1dGhvcml0eSIpOwogICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgImlkIiwgSW50ZWdlci50b1N0cmluZyhhdXRob3JpdHkuaWRlbnQpKTsKLSAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJhY2NvdW50IiwgYXV0aG9yaXR5LmFjY291bnQpOworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgImFjY291bnQiLCBhdXRob3JpdHkuYWNjb3VudC5uYW1lKTsKKyAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ0eXBlIiwgYXV0aG9yaXR5LmFjY291bnQudHlwZSk7CiAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAiYXV0aG9yaXR5IiwgYXV0aG9yaXR5LmF1dGhvcml0eSk7CiAgICAgICAgICAgICAgICAgaWYgKCFhdXRob3JpdHkuZW5hYmxlZCkgewogICAgICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJlbmFibGVkIiwgImZhbHNlIik7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChhdXRob3JpdHkuc3luY2FibGUgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInN5bmNhYmxlIiwgInVua25vd24iKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGF1dGhvcml0eS5zeW5jYWJsZSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInN5bmNhYmxlIiwgImZhbHNlIik7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgImF1dGhvcml0eSIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgImFjY291bnRzIik7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgb3V0LmVuZERvY3VtZW50KCk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgbUFjY291bnRJbmZvRmlsZS5maW5pc2hXcml0ZShmb3MpOwogICAgICAgICB9IGNhdGNoIChqYXZhLmlvLklPRXhjZXB0aW9uIGUxKSB7CiAgICAgICAgICAgICBMb2cudyhUQUcsICJFcnJvciB3cml0aW5nIGFjY291bnRzIiwgZTEpOwpAQCAtMTE1NCwxNSArMTIxNywxNSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgc3RhdGljIGludCBnZXRJbnRDb2x1bW4oQ3Vyc29yIGMsIFN0cmluZyBuYW1lKSB7CiAgICAgICAgIHJldHVybiBjLmdldEludChjLmdldENvbHVtbkluZGV4KG5hbWUpKTsKICAgICB9Ci0gICAgCisKICAgICBzdGF0aWMgbG9uZyBnZXRMb25nQ29sdW1uKEN1cnNvciBjLCBTdHJpbmcgbmFtZSkgewogICAgICAgICByZXR1cm4gYy5nZXRMb25nKGMuZ2V0Q29sdW1uSW5kZXgobmFtZSkpOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIExvYWQgc3luYyBlbmdpbmUgc3RhdGUgZnJvbSB0aGUgb2xkIHN5bmNtYW5hZ2VyIGRhdGFiYXNlLCBhbmQgdGhlbgogICAgICAqIGVyYXNlIGl0LiAgTm90ZSB0aGF0IHdlIGRvbid0IGRlYWwgd2l0aCBwZW5kaW5nIG9wZXJhdGlvbnMsIGFjdGl2ZQpAQCAtMTE4MSw4ICsxMjQ0LDEwIEBACiAgICAgICAgICAgICAgICAgICAgIFNRTGl0ZURhdGFiYXNlLk9QRU5fUkVBRE9OTFkpOwogICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgewogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIGlmIChkYiAhPSBudWxsKSB7CisgICAgICAgICAgICBmaW5hbCBib29sZWFuIGhhc1R5cGUgPSBkYi5nZXRWZXJzaW9uKCkgPj0gMTE7CisKICAgICAgICAgICAgIC8vIENvcHkgaW4gYWxsIG9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N0cmluZyBhY2NvdW50TmFtZSA9IGMuZ2V0U3RyaW5nKGMuZ2V0Q29sdW1uSW5kZXgoImFjY291bnQiKSk7CisgICAgICAgICAgICAgICAgU3RyaW5nIGFjY291bnRUeXBlID0gaGFzVHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgPyBjLmdldFN0cmluZyhjLmdldENvbHVtbkluZGV4KCJhY2NvdW50X3R5cGUiKSkgOiBudWxsOworICAgICAgICAgICAgICAgIGlmIChhY2NvdW50VHlwZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFjY291bnRUeXBlID0gImNvbS5nb29nbGUuR0FJQSI7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIFN0cmluZyBhdXRob3JpdHlOYW1lID0gYy5nZXRTdHJpbmcoYy5nZXRDb2x1bW5JbmRleCgiYXV0aG9yaXR5IikpOwogICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gdGhpcy5nZXRPckNyZWF0ZUF1dGhvcml0eUxvY2tlZCgKLSAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnROYW1lLCBhdXRob3JpdHlOYW1lLCAtMSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFjY291bnQoYWNjb3VudE5hbWUsIGFjY291bnRUeXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGF1dGhvcml0eU5hbWUsIC0xLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgaWYgKGF1dGhvcml0eSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGludCBpID0gbVN5bmNTdGF0dXMuc2l6ZSgpOwogICAgICAgICAgICAgICAgICAgICBib29sZWFuIGZvdW5kID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIFN5bmNTdGF0dXNJbmZvIHN0ID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGkgPiAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdCA9IG1TeW5jU3RhdHVzLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0ID0gbVN5bmNTdGF0dXMudmFsdWVBdChpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdC5hdXRob3JpdHlJZCA9PSBhdXRob3JpdHkuaWRlbnQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0xMjQxLDkgKzEzMTUsOSBAQAogICAgICAgICAgICAgICAgICAgICBzdC5wZW5kaW5nID0gZ2V0SW50Q29sdW1uKGMsICJwZW5kaW5nIikgIT0gMDsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgYy5jbG9zZSgpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIC8vIFJldHJpZXZlIHRoZSBzZXR0aW5ncy4KICAgICAgICAgICAgIHFiID0gbmV3IFNRTGl0ZVF1ZXJ5QnVpbGRlcigpOwogICAgICAgICAgICAgcWIuc2V0VGFibGVzKCJzZXR0aW5ncyIpOwpAQCAtMTI1MywyOSArMTMyNywzNSBAQAogICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IGMuZ2V0U3RyaW5nKGMuZ2V0Q29sdW1uSW5kZXgoInZhbHVlIikpOwogICAgICAgICAgICAgICAgIGlmIChuYW1lID09IG51bGwpIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIGlmIChuYW1lLmVxdWFscygibGlzdGVuX2Zvcl90aWNrbGVzIikpIHsKLSAgICAgICAgICAgICAgICAgICAgc2V0TGlzdGVuRm9yTmV0d29ya1RpY2tsZXModmFsdWUgPT0gbnVsbAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IEJvb2xlYW4ucGFyc2VCb29sZWFuKHZhbHVlKSk7CisgICAgICAgICAgICAgICAgICAgIHNldE1hc3RlclN5bmNBdXRvbWF0aWNhbGx5KHZhbHVlID09IG51bGwgfHwgQm9vbGVhbi5wYXJzZUJvb2xlYW4odmFsdWUpKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5hbWUuc3RhcnRzV2l0aCgic3luY19wcm92aWRlcl8iKSkgewogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcHJvdmlkZXIgPSBuYW1lLnN1YnN0cmluZygic3luY19wcm92aWRlcl8iLmxlbmd0aCgpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUubGVuZ3RoKCkpOwotICAgICAgICAgICAgICAgICAgICBzZXRTeW5jUHJvdmlkZXJBdXRvbWF0aWNhbGx5KG51bGwsIHByb3ZpZGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID09IG51bGwgfHwgQm9vbGVhbi5wYXJzZUJvb2xlYW4odmFsdWUpKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGkgPSBtQXV0aG9yaXRpZXMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICB3aGlsZSAoaSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGktLTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEF1dGhvcml0eUluZm8gYXV0aG9yaXR5ID0gbUF1dGhvcml0aWVzLnZhbHVlQXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXV0aG9yaXR5LmF1dGhvcml0eS5lcXVhbHMocHJvdmlkZXIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0aG9yaXR5LmVuYWJsZWQgPSB2YWx1ZSA9PSBudWxsIHx8IEJvb2xlYW4ucGFyc2VCb29sZWFuKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRob3JpdHkuc3luY2FibGUgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGMuY2xvc2UoKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBkYi5jbG9zZSgpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHdyaXRlQWNjb3VudEluZm9Mb2NrZWQoKTsKICAgICAgICAgICAgIHdyaXRlU3RhdHVzTG9ja2VkKCk7CiAgICAgICAgICAgICAobmV3IEZpbGUocGF0aCkpLmRlbGV0ZSgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RBVFVTX0ZJTEVfRU5EID0gMDsKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBTVEFUVVNfRklMRV9JVEVNID0gMTAwOwotICAgIAorCiAgICAgLyoqCiAgICAgICogUmVhZCBhbGwgc3luYyBzdGF0dXMgYmFjayBpbiB0byB0aGUgaW5pdGlhbCBlbmdpbmUgc3RhdGUuCiAgICAgICovCkBAIC0xMzA2LDE3ICsxMzg2LDE3IEBACiAgICAgICAgICAgICBMb2cuaShUQUcsICJObyBpbml0aWFsIHN0YXR1cyIpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogV3JpdGUgYWxsIHN5bmMgc3RhdHVzIHRvIHRoZSBzeW5jIHN0YXR1cyBmaWxlLgogICAgICAqLwogICAgIHByaXZhdGUgdm9pZCB3cml0ZVN0YXR1c0xvY2tlZCgpIHsKICAgICAgICAgaWYgKERFQlVHX0ZJTEUpIExvZy52KFRBRywgIldyaXRpbmcgbmV3ICIgKyBtU3RhdHVzRmlsZS5nZXRCYXNlRmlsZSgpKTsKLSAgICAgICAgCisKICAgICAgICAgLy8gVGhlIGZpbGUgaXMgYmVpbmcgd3JpdHRlbiwgc28gd2UgZG9uJ3QgbmVlZCB0byBoYXZlIGEgc2NoZWR1bGVkCiAgICAgICAgIC8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G9ja2VkKFBlbmRpbmdPcGVyYXRpb24gb3AsIFBhcmNlbCBvdXQpIHsKICAgICAgICAgb3V0LndyaXRlSW50KFBFTkRJTkdfT1BFUkFUSU9OX1ZFUlNJT04pOwogICAgICAgICBvdXQud3JpdGVJbnQob3AuYXV0aG9yaXR5SWQpOwpAQCAtMTM5NSw3ICsxNDc1LDcgQEAKICAgICAgICAgfQogICAgICAgICBvdXQud3JpdGVCeXRlQXJyYXkob3AuZmxhdEV4dHJhcyk7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogV3JpdGUgYWxsIGN1cnJlbnRseSBwZW5kaW5nIG9wcyB0byB0aGUgcGVuZGluZyBvcHMgZmlsZS4KICAgICAgKi8KQEAgLTE0MDgsMTAgKzE0ODgsMTAgQEAKICAgICAgICAgICAgICAgICBtUGVuZGluZ0ZpbGUudHJ1bmNhdGUoKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKERFQlVHX0ZJTEUpIExvZy52KFRBRywgIldyaXRpbmcgbmV3ICIgKyBtUGVuZGluZ0ZpbGUuZ2V0QmFzZUZpbGUoKSk7CiAgICAgICAgICAgICBmb3MgPSBtUGVuZGluZ0ZpbGUuc3RhcnRXcml0ZSgpOwotICAgICAgICAKKwogICAgICAgICAgICAgUGFyY2VsIG91dCA9IFBhcmNlbC5vYnRhaW4oKTsKICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgICAgICBQZW5kaW5nT3BlcmF0aW9uIG9wID0gbVBlbmRpbmdPcGVyYXRpb25zLmdldChpKTsKQEAgLTE0MTksNyArMTQ5OSw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBmb3Mud3JpdGUob3V0Lm1hcnNoYWxsKCkpOwogICAgICAgICAgICAgb3V0LnJlY3ljbGUoKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICB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B0aGUgZGV2aWNlLgogICAgICAqLwotICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIG9uU3luY1N0YXJ0aW5nKFN5bmNDb250ZXh0IGNvbnRleHQsIFN0cmluZyBhY2NvdW50LCBib29sZWFuIGZvcmNlZCwKKyAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCBvblN5bmNTdGFydGluZyhTeW5jQ29udGV4dCBjb250ZXh0LCBBY2NvdW50IGFjY291bnQsIGJvb2xlYW4gbWFudWFsU3luYywKICAgICAgICAgICAgIFN5bmNSZXN1bHQgcmVzdWx0KTsKIAogICAgIC8qKgpAQCAtODUsNiArODgsOSBAQAogICAgICAqLwogICAgIHB1YmxpYyBhYnN0cmFjdCBib29sZWFuIGlzUmVhZE9ubHkoKTsKIAorICAgIHB1YmxpYyBhYnN0cmFjdCBib29sZWFuIGdldElzU3luY2FibGUoQWNjb3VudCBhY2NvdW50KQorICAgICAgICAgICAgdGhyb3dzIElPRXhjZXB0aW9uLCBBdXRoZW50aWNhdG9yRXhjZXB0aW9uLCBPcGVyYXRpb25DYW5jZWxlZEV4Y2VwdGlvbjsKKwogICAgIC8qKgogICAgICAqIEdldCBkaWZmcyBmcm9tIHRoZSBzZXJ2ZXIgc2luY2UgdGhlIGxhc3QgY29tcGxldGVkIHN5bmMgYW5kIHB1dCB0aGVtCiAgICAgICogaW50byBhIHRlbXBvcmFyeSBwcm92aWRlci4KQEAgLTE2OCwxMiArMTc0LDEzIEBACiAgICAgICogZXhpc3QuCiAgICAgICogQHBhcmFtIGFjY291bnRzIHRoZSBsaXN0IG9mIGFjY291bnRzCiAgICAgICovCi0gICAgcHVibGljIGFic3RyYWN0IHZvaWQgb25BY2NvdW50c0NoYW5nZWQoU3RyaW5nW10gYWNjb3VudHMpOworICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIG9uQWNjb3VudHNDaGFuZ2VkKEFjY291bnRbXSBhY2NvdW50cyk7CiAKICAgICBwcml2YXRlIENvbnRleHQgbUNvb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gICAgICAgICAgbUluaXRpYWxUeEJ5dGVzID0gTmV0U3RhdC5nZXRVaWRUeEJ5dGVzKHVpZCk7CiAgICAgICAgICAgICBtSW5pdGlhbFJ4Qnl0ZXMgPSBOZXRTdGF0LmdldFVpZFJ4Qnl0ZXModWlkKTsKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgc3luYyhtU3luY0NvbnRleHQsIG1BY2NvdW50LCBtRXh0cmFzKTsKKyAgICAgICAgICAgICAgICBzeW5jKG1TeW5jQ29udGV4dCwgbUFjY291bnQsIG1BdXRob3JpdHksIG1FeHRyYXMpOwogICAgICAgICAgICAgfSBjYXRjaCAoU1FMRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJTeW5jIGZhaWxlZCIsIGUpOwogICAgICAgICAgICAgICAgIG1SZXN1bHQuZGF0YWJhc2VFcnJvciA9IHRydWU7CkBAIC0yMjEsMTkgKzIyOSw0NSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgcHJpdmF0ZSB2b2lkIHN5bmMoU3luY0NvbnRleHQgc3luY0NvbnRleHQsIFN0cmluZyBhY2NvdW50LCBCdW5kbGUgZXh0cmFzKSB7CisgICAgICAgIHByaXZhdGUgdm9pZCBzeW5jKFN5bmNDb250ZXh0IHN5bmNDb250ZXh0LCBBY2NvdW50IGFjY291bnQsIFN0cmluZyBhdXRob3JpdHksCisgICAgICAgICAgICAgICAgQnVuZGxlIGV4dHJhcykgewogICAgICAgICAgICAgbUlzQ2FuY2VsZWQgPSBmYWxzZTsKIAogICAgICAgICAgICAgbVByb3ZpZGVyU3luY1N0YXJ0ZWQgPSBmYWxzZTsKICAgICAgICAgICAgIG1BZGFwdGVyU3luY1N0YXJ0ZWQgPSBmYWxzZTsKICAgICAgICAgICAgIFN0cmluZyBtZXNzYWdlID0gbnVsbDsKIAotICAgICAgICAgICAgYm9vbGVhbiBzeW5jRm9yY2VkID0gZXh0cmFzLmdldEJvb2xlYW4oQ29udGVudFJlc29sdmVyLlNZTkNfRVhUUkFTX0ZPUkNFLCBmYWxzZSk7CisgICAgICAgICAgICAvLyBhbHdheXMgYXR0ZW1wdCB0byBpbml0aWFsaXplIGlmIHRoZSBpc1N5bmNhYmxlIHN0YXRlIGlzbid0IHNldCB5ZXQKKyAgICAgICAgICAgIGludCBpc1N5bmNhYmxlID0gQ29udGVudFJlc29sdmVyLmdldElzU3luY2FibGUoYWNjb3VudCwgYXV0aG9yaXR5KTsKKyAgICAgICAgICAgIGlmIChpc1N5bmNhYmxlIDwgMCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlzU3luY2FibGUgPSAoZ2V0SXNTeW5jYWJsZShhY2NvdW50KSkgPyAxIDogMDsKKyAgICAgICAgICAgICAgICAgICAgQ29udGVudFJlc29sdmVyLnNldElzU3luY2FibGUoYWNjb3VudCwgYXV0aG9yaXR5LCBpc1N5bmNhYmxlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICsrbVJlc3VsdC5zdGF0cy5udW1Jb0V4Y2VwdGlvbnM7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoQXV0aGVudGljYXRvckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICsrbVJlc3VsdC5zdGF0cy5udW1QYXJzZUV4Y2VwdGlvbnM7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoT3BlcmF0aW9uQ2FuY2VsZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBkbyBub3RoaW5nCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBpZiB0aGlzIGlzIGFuIGluaXRpYWxpemF0aW9uIHJlcXVlc3QgdGhlbiBvdXIgd29yayBpcyBkb25lIGhlcmUKKyAgICAgICAgICAgIGlmIChleHRyYXMuZ2V0Qm9vbGVhbihDb250ZW50UmVzb2x2ZXIuU1lOQ19FWFRSQVNfSU5JVElBTElaRSwgZmFsc2UpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBpZiB3ZSBhcmVuJ3Qgc3luY2FibGUgdGhlbiBnZXQgb3V0CisgICAgICAgICAgICBpZiAoaXNTeW5jYWJsZSA8PSAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBib29sZWFuIG1hbnVhbFN5bmMgPSBleHRyYXMuZ2V0Qm9vbGVhbihDb250ZW50UmVzb2x2ZXIuU1lOQ19FWFRSQVNfTUFOVUFMLCBmYWxzZSk7CiAKICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgbVByb3ZpZGVyLm9uU3luY1N0YXJ0KHN5bmNDb250ZXh0LCBhY2NvdW50KTsKICAgICAgICAgICAgICAgICBtUHJvdmlkZXJTeW5jU3RhcnRlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgb25TeW5jU3RhcnRpbmcoc3luY0NvbnRleHQsIGFjY291bnQsIHN5bmNGb3JjZWQsIG1SZXN1bHQpOworICAgICAgICAgICAgICAgIG9uU3luY1N0YXJ0aW5nKHN5bmNDb250ZXh0LCBhY2NvdW50LCBtYW51YWxTeW5jLCBtUmVzdWx0KTsKICAgICAgICAgICAgICAgICBpZiAobVJlc3VsdC5oYXNFcnJvcigpKSB7CiAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSAiU3luY0FkYXB0ZXIgZmFpbGVkIHdoaWxlIHRyeWluZyB0byBzdGFydCBzeW5jIjsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwpAQCAtMjczLDcgKzMwNyw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBwcml2YXRlIHZvaWQgcnVuU3luY0xvb3AoU3luY0NvbnRleHQgc3lu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zfSBpZiB0aGlzIGZlYXR1cmUgaGFzIGJlZW4gcmVxdWlyZWQgYnkgdGhlIGFwcGxpY2F0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZMQUdfUkVRVUlSRUQgPSAweDAwMDE7CisgICAgCisgICAgLyoqCisgICAgICogQWRkaXRpb25hbCBmbGFncy4gIE1heSBiZSB6ZXJvIG9yIG1vcmUgb2Yge0BsaW5rICNGTEFHX1JFUVVJUkVEfS4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGZsYWdzOworICAgIAorICAgIHB1YmxpYyBGZWF0dXJlSW5mbygpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgRmVhdHVyZUluZm8oRmVhdHVyZUluZm8gb3JpZykgeworICAgICAgICBuYW1lID0gb3JpZy5uYW1lOworICAgICAgICByZXFHbEVzVmVyc2lvbiA9IG9yaWcucmVxR2xFc1ZlcnNpb247CisgICAgICAgIGZsYWdzID0gb3JpZy5mbGFnczsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gIkZlYXR1cmVJbmZveyIKKyAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKFN5c3RlbS5pZGVudGl0eUhhc2hDb2RlKHRoaXMpKQorICAgICAgICAgICAgICAgICAgICArICIgIiArIG5hbWUgKyAiIGZsPTB4IiArIEludGVnZXIudG9IZXhTdHJpbmcoZmxhZ3MpICsgIn0iOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuICJGZWF0dXJlSW5mb3siCisgICAgICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyhTeXN0ZW0uaWRlbnRpdHlIYXNoQ29kZSh0aGlzKSkKKyAgICAgICAgICAgICAgICAgICAgKyAiIGdsRXNWZXJzPSIgKyBnZXRHbEVzVmVyc2lvbigpCisgICAgICAgICAgICAgICAgICAgICsgIiBmbD0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGZsYWdzKSArICJ9IjsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IHBhcmNlbGFibGVGbGFncykgeworICAgICAgICBkZXN0LndyaXRlU3RyaW5nKG5hbWUpOworICAgICAgICBkZXN0LndyaXRlSW50KHJlcUdsRXNWZXJzaW9uKTsKKyAgICAgICAgZGVzdC53cml0ZUludChmbGFncyk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDcmVhdG9yPEZlYXR1cmVJbmZvPiBDUkVBVE9SID0KKyAgICAgICAgbmV3IENyZWF0b3I8RmVhdHVyZUluZm8+KCkgeworICAgICAgICBwdWJsaWMgRmVhdHVyZUluZm8gY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgc291cmNlKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IEZlYXR1cmVJbmZvKHNvdXJjZSk7CisgICAgICAgIH0KKyAgICAgICAgcHVibGljIEZlYXR1cmVJbmZvW10gbmV3QXJyYXkoaW50IHNpemUpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgRmVhdHVyZUluZm9bc2l6ZV07CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHJpdmF0ZSBGZWF0dXJlSW5mbyhQYXJjZWwgc291cmNlKSB7CisgICAgICAgIG5hbWUgPSBzb3VyY2UucmVhZFN0cmluZygpOworICAgICAgICByZXFHbEVzVmVyc2lvbiA9IHNvdXJjZS5yZWFkSW50KCk7CisgICAgICAgIGZsYWdzID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIG1ldGh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JbnRlbnQgVGhlIG9yaWdpbmFsIEludGVudCB0byBjb3B5LgorICAgICAqIEBwYXJhbSBzb3VyY2VQYWNrYWdlIFRoZSBwYWNrYWdlIGluIHdoaWNoIHRoZSBsYWJlbCBhbmQgaWNvbiBsaXZlLgorICAgICAqIEBwYXJhbSBsYWJlbFJlcyBSZXNvdXJjZSBjb250YWluaW5nIHRoZSBsYWJlbCwgb3IgMCBpZiBub25lLgorICAgICAqIEBwYXJhbSBpY29uIFJlc291cmNlIGNvbnRhaW5pbmcgdGhlIGljb24sIG9yIDAgaWYgbm9uZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgTGFiZWxlZEludGVudChJbnRlbnQgb3JpZ0ludGVudCwgU3RyaW5nIHNvdXJjZVBhY2thZ2UsCisgICAgICAgICAgICBpbnQgbGFiZWxSZXMsIGludCBpY29uKSB7CisgICAgICAgIHN1cGVyKG9yaWdJbnRlbnQpOworICAgICAgICBtU291cmNlUGFja2FnZSA9IHNvdXJjZVBhY2thZ2U7CisgICAgICAgIG1MYWJlbFJlcyA9IGxhYmVsUmVzOworICAgICAgICBtTm9uTG9jYWxpemVkTGFiZWwgPSBudWxsOworICAgICAgICBtSWNvbiA9IGljb247CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIENyZWF0ZSBhIGxhYmVsZWQgaW50ZW50IGZyb20gdGhlIGdpdmVuIGludGVudCwgc3VwcGx5aW5nIGEgdGV4dHVhbAorICAgICAqIGxhYmVsIGFuZCBpY29uIHJlc291cmNlIGZvciBpdC4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gb3JpZ0ludGVudCBUaGUgb3JpZ2luYWwgSW50ZW50IHRvIGNvcHkuCisgICAgICogQHBhcmFtIHNvdXJjZVBhY2thZ2UgVGhlIHBhY2thZ2UgaW4gd2hpY2ggdGhlIGxhYmVsIGFuZCBpY29uIGxpdmUuCisgICAgICogQHBhcmFtIG5vbkxvY2FsaXplZExhYmVsIENvbmNyZXRlIHRleHQgdG8gdXNlIGZvciB0aGUgbGFiZWwuCisgICAgICogQHBhcmFtIGljb24gUmVzb3VyY2UgY29udGFpbmluZyB0aGUgaWNvbiwgb3IgMCBpZiBub25lLgorICAgICAqLworICAgIHB1YmxpYyBMYWJlbGVkSW50ZW50KEludGVudCBvcmlnSW50ZW50LCBTdHJpbmcgc291cmNlUGFja2FnZSwKKyAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBub25Mb2NhbGl6ZWRMYWJlbCwgaW50IGljb24pIHsKKyAgICAgICAgc3VwZXIob3JpZ0ludGVudCk7CisgICAgICAgIG1Tb3VyY2VQYWNrYWdlID0gc291cmNlUGFja2FnZTsKKyAgICAgICAgbUxhYmVsUmVzID0gMDsKKyAgICAgICAgbU5vbkxvY2FsaXplZExhYmVsID0gbm9uTG9jYWxpemVkTGFiZWw7CisgICAgICAgIG1JY29uID0gaWNvbjsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQ3JlYXRlIGEgbGFiZWxlZCBpbnRlbnQgd2l0aCBubyBpbnRlbnQgZGF0YSBidXQgc3VwcGx5aW5nIHRoZSBsYWJlbAorICAgICAqIGFuZCBpY29uIHJlc291cmNlcyBmb3IgaXQuCisgICAgICogCisgICAgICogQHBhcmFtIHNvdXJjZVBhY2thZ2UgVGhlIHBhY2thZ2UgaW4gd2hpY2ggdGhlIGxhYmVsIGFuZCBpY29uIGxpdmUuCisgICAgICogQHBhcmFtIGxhYmVsUmVzIFJlc291cmNlIGNvbnRhaW5pbmcgdGhlIGxhYmVsLCBvciAwIGlmIG5vbmUuCisgICAgICogQHBhcmFtIGljb24gUmVzb3VyY2UgY29udGFpbmluZyB0aGUgaWNvbiwgb3IgMCBpZiBub25lLgorICAgICAqLworICAgIHB1YmxpYyBMYWJlbGVkSW50ZW50KFN0cmluZyBzb3VyY2VQYWNrYWdlLCBpbnQgbGFiZWxSZXMsIGludCBpY29uKSB7CisgICAgICAgIG1Tb3VyY2VQYWNrYWdlID0gc291cmNlUGFja2FnZTsKKyAgIC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XVlbmNlIGxvYWRMYWJlbChQYWNrYWdlTWFuYWdlciBwbSkgeworICAgICAgICBpZiAobU5vbkxvY2FsaXplZExhYmVsICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBtTm9uTG9jYWxpemVkTGFiZWw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1MYWJlbFJlcyAhPSAwICYmIG1Tb3VyY2VQYWNrYWdlICE9IG51bGwpIHsKKyAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBsYWJlbCA9IHBtLmdldFRleHQobVNvdXJjZVBhY2thZ2UsIG1MYWJlbFJlcywgbnVsbCk7CisgICAgICAgICAgICBpZiAobGFiZWwgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBsYWJlbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUmV0cmlldmUgdGhlIGljb24gYXNzb2NpYXRlZCB3aXRoIHRoaXMgb2JqZWN0LiAgSWYgdGhlIG9iamVjdCBkb2VzCisgICAgICogbm90IGhhdmUgYSBpY29uLCBudWxsIHdpbGwgYmUgcmV0dXJuZWQsIGluIHdoaWNoIGNhc2UgeW91IHdpbGwgcHJvYmFibHkKKyAgICAgKiB3YW50IHRvIGxvYWQgdGhlIGljb24gZnJvbSB0aGUgdW5kZXJseWluZyByZXNvbHZlZCBpbmZvIGZvciB0aGUgSW50ZW50LgorICAgICAqLworICAgIHB1YmxpYyBEcmF3YWJsZSBsb2FkSWNvbihQYWNrYWdlTWFuYWdlciBwbSkgeworICAgICAgICBpZiAobUljb24gIT0gMCAmJiBtU291cmNlUGFja2FnZSAhPSBudWxsKSB7CisgICAgICAgICAgICBEcmF3YWJsZSBpY29uID0gcG0uZ2V0RHJhd2FibGUobVNvdXJjZVBhY2thZ2UsIG1JY29uLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChpY29uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gaWNvbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IHBhcmNlbGFibGVGbGFncykgeworICAgICAgICBzdXBlci53cml0ZVRvUGFyY2VsKGRlc3QsIHBhcmNlbGFibGVGbGFncyk7CisgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcobVNvdXJjZVBhY2thZ2UpOworICAgICAgICBkZXN0LndyaXRlSW50KG1MYWJlbFJlcyk7CisgICAgICAgIFRleHRVdGlscy53cml0ZVRvUGFyY2VsKG1Ob25Mb2NhbGl6ZWRMYWJlbCwgZGVzdCwgcGFyY2VsYWJsZUZsYWdzKTsKKyAgICAgICAgZGVzdC53cml0ZUludChtSWNvbik7CisgICAgfQorCisgICAgLyoqIEBoaWRlICovCisgICAgcHJvdGVjdGVkIExhYmVsZWRJbnRlbnQoUGFyY2VsIGluKSB7CisgICAgICAgIHJlYWRGcm9tUGFyY2VsKGluKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgcmVhZEZyb21QYXJjZWwoUGFyY2VsIGluKSB7CisgICAgICAgIHN1cGVyLnJlYWRGcm9tUGFyY2VsKGluKTsKKyAgICAgICAgbVNvdXJjZVBhY2thZ2UgPSBpbi5yZWFkU3RyaW5nKCk7CisgICAgICAgIG1MYWJlbFJlcyA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgbU5vbkxvY2FsaXplZExhYmVsID0gVGV4dFV0aWxzLkNIQVJfU0VRVUVOQ0VfQ1JFQVRPUi5jcmVhdGVGcm9tUGFyY2VsKGluKTsKKyAgICAgICAgbUljb24gPSBpbi5yZWFkSW50KCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgQ3JlYXRvcjxMYWJlbGVkSW50ZW50PiBDUkVBVE9SCisgICAgICAgICAgICA9IG5ldyBDcmVhdG9yPExhYmVsZWRJbnRlbnQ+KCkgeworICAgICAgICBwdWJsaWMgTGFiZWxlZEludGVudCBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBzb3VyY2UpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgTGFiZWxlZEludGVudChzb3VyY2UpOworICAgICAgICB9CisgICAgICAgIHB1YmxpYyBMYWJlbGVkSW50ZW50W10gbmV3QXJyYXkoaW50IHNpemUpIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgTGFiZWxlZEludGVudFtzaXplXTsKKyAgICAgICAgfQorICAgIH07CisKK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvcG0vUGFja2FnZUluZm8uamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvcG0vUGFja2FnZUluZm8uamF2YQppbmRleCBkOTMyNmYyLi5hOGNlODg5IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3BtL1BhY2thZ2VJbmZvLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9wbS9QYWNrYWdlSW5mby5qYXZhCkBAIC0xMjcsNiArMTI3LDExIEBACiAgICAgICovCiAgICAgcHVibGljIENvbmZpZ3VyYXRpb25JbmZvW10gY29uZmlnUHJlZmVyZW5jZXM7CiAKKyAgICAvKioKKyAgICAgKiBUaGUgZmVhdHVyZXMgdGhhdCB0aGlzIGFwcGxpY2F0aW9uIGhhcyBzYWlkIGl0IHJlcXVpcmVzLgorICAgICAqLworICAgIHB1YmxpYyBGZWF0dXJlSW5mb1tdIHJlcUZlYXR1cmVzOworICAgIAogICAgIHB1YmxpYyBQYWNrYWdlSW5mbygpIHsKICAgICB9CiAKQEAgLTE2Miw2ICsxNjcsNyBAQAogICAgICAgICBkZXN0LndyaXRlU3RyaW5nQXJyYXkocmVxdWVzdGVkUGVybWlzc2lvbnMpOwogIC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b2lkL2NvbnRlbnQvcG0vUGFja2FnZVBhcnNlci5qYXZhCmluZGV4IDMzZjRiNTIuLmI0YTZmZWUgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvcG0vUGFja2FnZVBhcnNlci5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvcG0vUGFja2FnZVBhcnNlci5qYXZhCkBAIC0xODQsOSArMTg0LDEyIEBACiAgICAgICAgICAgICBpbnQgTiA9IHAuY29uZmlnUHJlZmVyZW5jZXMuc2l6ZSgpOwogICAgICAgICAgICAgaWYgKE4gPiAwKSB7CiAgICAgICAgICAgICAgICAgcGkuY29uZmlnUHJlZmVyZW5jZXMgPSBuZXcgQ29uZmlndXJhdGlvbkluZm9bTl07Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewotICAgICAgICAgICAgICAgICAgICBwaS5jb25maWdQcmVmZXJlbmNlc1tpXSA9IHAuY29uZmlnUHJlZmVyZW5jZXMuZ2V0KGkpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwLmNvbmZpZ1ByZWZlcmVuY2VzLnRvQXJyYXkocGkuY29uZmlnUHJlZmVyZW5jZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTiA9IHAucmVxRmVhdHVyZXMgIT0gbnVsbCA/IHAucmVxRmVhdHVyZXMuc2l6ZSgpIDogMDsKKyAgICAgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgICAgIHBpLnJlcUZlYXR1cmVzID0gbmV3IEZlYXR1cmVJbmZvW05dOworICAgICAgICAgICAgICAgIHAucmVxRmVhdHVyZXMudG9BcnJheShwaS5yZXFGZWF0dXJlcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgaWYgKChmbGFncyZQYWNrYWdlTWFuYWdlci5HRVRfQUNUSVZJVElFUykgIT0gMCkgewpAQCAtMjY4LDEwICsyNzEsMTIgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBpZiAoKGZsYWdzJlBhY2thZ2VNYW5hZ2VyLkdFVF9TSUdOQVRVUkVTKSAhPSAwKSB7Ci0gICAgICAgICAgICBpbnQgTiA9IHAubVNpZ25hdHVyZXMubGVuZ3RoOwotICAgICAgICAgICAgaWYgKE4gPiAwKSB7Ci0gICAgICAgICAgICAgICAgcGkuc2lnbmF0dXJlcyA9IG5ldyBTaWduYXR1cmVbTl07Ci0gICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShwLm1TaWduYXR1cmVzLCAwLCBwaS5zaWduYXR1cmVzLCAwLCBOKTsKKyAgICAgICAgICAgIGlmIChwLm1TaWduYXR1cmVzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbnQgTiA9IHAubVNpZ25hdHVyZXMubGVuZ3RoOworICAgICAgICAgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgICAgICAgICBwaS5zaWduYXR1cmVzID0gbmV3IFNpZ25hdHVyZVtOXTsKKyAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShwLm1TaWduYXR1cmVzLCAwLCBwaS5zaWduYXR1cmVzLCAwLCBOKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHBpOwpAQCAtNzU4LDE0ICs3NjMsMzIgQEAKICAgICAgICAgICAgICAgICBYbWxVdGlscy5za2lwQ3VycmVudFRhZyhwYXJzZXIpOwogCiAgICAgICAgICAgICB9IGVsc2UgaWYgKHRhZ05hbWUuZXF1YWxzKCJ1c2VzLWZlYXR1cmUiKSkgewotICAgICAgICAgICAgICAgIENvbmZpZ3VyYXRpb25JbmZvIGNQcmVmID0gbmV3IENvbmZpZ3VyYXRpb25JbmZvKCk7CisgICAgICAgICAgICAgICAgRmVhdHVyZUluZm8gZmkgPSBuZXcgRmVhdHVyZUluZm8oKTsKICAgICAgICAgICAgICAgICBzYSA9IHJlcy5vYnRhaW5BdHRyaWJ1dGVzKGF0dHJzLAogICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0VXNlc0ZlYXR1cmUpOwotICAgICAgICAgICAgICAgIGNQcmVmLnJlcUdsRXNWZXJzaW9uID0gc2EuZ2V0SW50KAotICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0VXNlc0ZlYXR1cmVfZ2xFc1ZlcnNpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICBDb25maWd1cmF0aW9uSW5mby5HTF9FU19WRVJTSU9OX1VOREVGSU5FRCk7CisgICAgICAgICAgICAgICAgZmkubmFtZSA9IHNhLmdldE5vblJlc291cmNlU3RyaW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0VXNlc0ZlYXR1cmVfbmFtZSk7CisgICAgICAgICAgICAgICAgaWYgKGZpLm5hbWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmaS5yZXFHbEVzVmVyc2lvbiA9IHNhLmdldEludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RVc2VzRmVhdHVyZV9nbEVzVmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGZWF0dXJlSW5mby5HTF9FU19WRVJTSU9OX1VOREVGSU5FRCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChzYS5nZXRCb29sZWFuKAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0VXNlc0ZlYXR1cmVfcmVxdWlyZWQsCisgICAgICAgICAgICAgICAgICAgICAgICB0cnVlKSkgeworICAgICAgICAgICAgICAgICAgICBmaS5mbGFncyB8PSBGZWF0dXJlSW5mby5GTEFHX1JFUVVJUkVEOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBzYS5yZWN5Y2xlKCk7Ci0gICAgICAgICAgICAgICAgcGtnLmNvbmZpZ1ByZWZlcmVuY2VzLmFkZChjUHJlZik7CisgICAgICAgICAgICAgICAgaWYgKHBrZy5yZXFGZWF0dXJlcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHBrZy5yZXFGZWF0dXJlcyA9IG5ldyBBcnJheUxpc3Q8RmVhdHVyZUluZm8+KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBrZy5yZXFGZWF0dXJlcy5hZGQoZmkpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChmaS5uYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgQ29uZmlndXJhdGlvbkluZm8gY1ByZWYgPSBuZXcgQ29uZmlndXJhdGlvbkluZm8oKTsKKyAgICAgICAgICAgICAgICAgICAgY1ByZWYucmVxR2xFc1ZlcnNpb24gPSBmaS5yZXFHbEVzVmVyc2lvbjsKKyAgICAgICAgICAgICAgICAgICAgcGtnLmNvbmZpZ1ByZWZlcmVuY2VzLmFkZChjUHJlZik7CisgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgWG1sVXRpbHMuc2tpcEN1cnJlbnRUYWcocGFyc2VyKTsKIApAQCAtOTQ0LDExICs5NjcsNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIAotICAgICAgICBpZiAocGtnLnVzZXNMaWJyYXJpZXMuc2l6ZSgpID4gMCkgewotICAgICAgICAgICAgcGtnLnVzZXNMaWJyYXJ5RmlsZXMgPSBuZXcgU3RyaW5nW3BrZy51c2VzTGlicmFyaWVzLnNpemUoKV07Ci0gICAgICAgICAgICBwa2cudXNlc0xpYnJhcmllcy50b0FycmF5KHBrZy51c2VzTGlicmFyeUZpbGVzKTsKLSAgICAgICAgfQotICAgICAgICAKICAgICAgICAgaWYgKHN1cHBvcnRzU21hbGxTY3JlZW5zIDwgMCB8fCAoc3VwcG9ydHNTbWFsbFNjcmVlbnMgPiAwCiAgICAgICAgICAgICAgICAgJiYgcGtnLmFwcGxpY2F0aW9uSW5mby50YXJnZXRTZGtWZXJzaW9uCiAgICAgICAgICAgICAgICAgICAgICAgICA+PSBhbmRyb2lkLm9zLkJ1aWxkLlZFUlNJT05fQ09ERVMuRE9OVVQpKSB7CkBAIC0xMjc4LDEyICsxMjk2LDI2IEBACiAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0QXBwbGljYXRpb25fYWxsb3dCYWNrdXAsIHRydWUpOwogICAgICAgICBpZiAoYWxsb3dCYWNrdXApIHsKICAgICAgICAgICAgIGFpLmZsYWdzIHw9IEFwcGxpY2F0aW9uSW5mby5GTEFHX0FMTE9XX0JBQ0tVUDsKKworICAgICAgICAgICAgLy8gYmFja3VwQWdlbnQsIGtpbGxBZnRlclJlc3RvcmUsIGFuZCByZXN0b3JlTmVlZHNBcHBsaWNhdGlvbiBhcmUgb25seSByZWxldmFudAorICAgICAgICAgICAgLy8gaWYgYmFja3VwIGlzIHBvc3NpYmxlIGZvciB0aGUgZ2l2ZW4gYXBwbGljYXRpb24uCiAgICAgICAgICAgICBTdHJpbmcgYmFja3VwQWdlbnQgPSBzYS5nZXROb25SZXNvdXJjZVN0cmluZygKICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0QXBwbGljYXRpb25fYmFja3VwQWdlbnQpOwogICAgICAgICAgICAgaWYgKGJhY2t1cEFnZW50ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBhaS5iYWNrdXBBZ2VudE5hbWUgPSBidWlsZENsYXNzTmFtZShwa2dOYW1lLCBiYWNrdXBBZ2VudCwgb3V0RXJyb3IpOwogICAgICAgICAgICAgICAgIExvZy52KFRBRywgImFuZHJvaWQ6YmFja3VwQWdlbnQgPSAiICsgYWkuYmFja3VwQWdlbnROYW1lCiAgICAgICAgICAgICAgICAgICAgICAgICArICIgZnJvbSAiICsgcGtnTmFtZSArICIrIiArIGJhY2t1cEFnZW50KTsKKworICAgICAgICAgICAgICAgIGlmIChzYS5nZXRCb29sZWFuKAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0QXBwbGljYXRpb25fa2lsbEFmdGVyUmVzdG9yZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRydWUpKSB7CisgICAgICAgICAgICAgICAgICAgIGFpLmZsYWdzIHw9IEFwcGxpY2F0aW9uSW5mby5GTEFHX0tJTExfQUZURVJfUkVTVE9SRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHNhLmdldEJvb2xlYW4oCisgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5BbmRyb2lkTWFuaWZlc3RBcHBsaWNhdGlvbl9yZXN0b3JlTmVlZHNBcHBsaWNhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlKSkgeworICAgICAgICAgICAgICAgICAgICBhaS5mbGFncyB8PSBBcHBsaWNhdGlvbkluZm8uRkxBR19SRVNUT1JFX05FRURTX0FQUExJQ0FUSU9OOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICAKQEAgLTE0MzQsMTEgKzE0NjYsMjggQEAKIAogICAgICAgICAgICAgICAgIFN0cmluZyBsbmFtZSA9IHNhLmdldE5vblJlc291cmNlU3RyaW5nKAogICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0VXNlc0xpYnJhcnlfbmFtZSk7CisgICAgICAgICAgICAgICAgYm9vbGVhbiByZXEgPSBzYS5nZXRCb29sZWFuKAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuQW5kcm9pZE1hbmlmZXN0VXNlc0xpYnJhcnlfcmVxdWlyZWQsCisgICAgICAgICAgICAgICAgICAgICAgICB0cnVlKTsKIAogICAgICAgICAgICAgICAgIHNhLnJlY3ljbGUoKTsKIAotICAgICAgICAgICAgICAgIGlmIChsbmFtZSAhPSBudWxsICYmICFvd25lci51c2VzTGlicmFyaWVzLmNvbnRhaW5zKGxuYW1lKSkgewotICAgICAgICAgICAgICAgICAgICBvd25lci51c2VzTGlicmFyaWVzLmFkZChsbmFtZS5pbnRlcm4oKSk7CisgICAgICAgICAgICAgICAgaWYgKGxuYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlcSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG93bmVyLnVzZXNMaWJyYXJpZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG93bmVyLnVzZXNMaWJyYXJpZXMgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghb3duZXIudXNlc0xpYnJhcmllcy5jb250YWlucyhsbmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvd25lci51c2VzTGlicmFyaWVzLmFkZChsbmFtZS5pbnRlcm4oKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3duZXIudXNlc09wdGlvbmFsTGlicmFyaWVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvd25lci51c2VzT3B0aW9uYWxMaWJyYXJpZXMgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghb3duZXIudXNlc09wdGlvbmFsTGlicmFyaWVzLmNvbnRhaW5zKGxuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG93bmVyLnVzZXNPcHRpb25hbExpYnJhcmllcy5hZGQobG5hbWUuaW50ZXJuKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgWG1sVXRpbHMuc2tpcEN1cnJlbnRUYWcocGFyc2VyKTsKQEAgLTI0MTYsNyArMjQ2NSw4IEBACiAKICAgICAgICAgcHVibGljIEFycmF5TGlzdDxTdHJpbmc+IHByb3RlY3RlZEJyb2FkY2FzdHM7CiAgICAgICAgIAotICAgICAgICBwdWJsaWMgZmluYWwgQXJyYXlMaXN0PFN0cmluZz4gdXNlc0xpYnJhcmllcyA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOworICAgICAgICBwdWJsaWMgQXJyYXlMaXN0PFN0cmluZz4gdXNlc0xpYnJhcmllcyA9IG51bGw7CisgICAgICAgIHB1YmxpYyBBcnJheUxpc3Q8U3RyaW5nPiB1c2VzT3B0aW9uYWxMaWJyYXJpZXMgPSBudWxsOwogICAgICAgICBwdWJsaWMgU3RyaW5nW10gdXNlc0xpYnJhcnlGaWxlcyA9IG51bGw7CiAKICAgICAgICAgLy8gV2Ugc3RvcmUgdGhlIGFwcGxpY2F0aW9uIG1ldGEtZGF0Y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ydmljZXMiKTsKKyAgICAgICAgZm9yIChTZXJ2aWNlSW5mbyBpbmZvIDogc2VydmljZXMudmFsdWVzKCkpIHsKKyAgICAgICAgICAgIGZvdXQucHJpbnRsbigiICAiICsgaW5mbyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gbWF5YmVSZWdpc3RlckZvclBhY2thZ2VDaGFuZ2VzKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmIChtUmVjZWl2ZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgICAgICBtUmVjZWl2ZXIgPSBuZXcgQnJvYWRjYXN0UmVjZWl2ZXIoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VydmljZXMgPSBnZW5lcmF0ZVNlcnZpY2VzTWFwKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgSW50ZW50RmlsdGVyIGludGVudEZpbHRlciA9IG5ldyBJbnRlbnRGaWx0ZXIoKTsKKyAgICAgICAgICAgICAgICBpbnRlbnRGaWx0ZXIuYWRkQWN0aW9uKEludGVudC5BQ1RJT05fUEFDS0FHRV9BRERFRCk7CisgICAgICAgICAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfQ0hBTkdFRCk7CisgICAgICAgICAgICAgICAgaW50ZW50RmlsdGVyLmFkZEFjdGlvbihJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVNT1ZFRCk7CisgICAgICAgICAgICAgICAgaW50ZW50RmlsdGVyLmFkZERhdGFTY2hlbWUoInBhY2thZ2UiKTsKKyAgICAgICAgICAgICAgICBtQ29udGV4dC5yZWdpc3RlclJlY2VpdmVyKG1SZWNlaXZlciwgaW50ZW50RmlsdGVyKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBtYXliZVVucmVnaXN0ZXJGb3JQYWNrYWdlQ2hhbmdlcygpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAobVJlY2VpdmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQ29udGV4dC51bnJlZ2lzdGVyUmVjZWl2ZXIobVJlY2VpdmVyKTsKKyAgICAgICAgICAgICAgICBtUmVjZWl2ZXIgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVmFsdWUgdHlwZSB0aGF0IGRlc2NyaWJlcyBhIFNlcnZpY2UuIFRoZSBpbmZvcm1hdGlvbiB3aXRoaW4gY2FuIGJlIHVzZWQKKyAgICAgKiB0byBiaW5kIHRvIHRoZSBzZXJ2aWNlLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgU2VydmljZUluZm88Vj4geworICAgICAgICBwdWJsaWMgZmluYWwgViB0eXBlOworICAgICAgICBwdWJsaWMgZmluYWwgQ29tcG9uZW50TmFtZSBjb21wb25lbnROYW1lOworICAgICAgICBwdWJsaWMgZmluYWwgaW50IHVpZDsKKworICAgICAgICBwcml2YXRlIFNlcnZpY2VJbmZvKFYgdHlwZSwgQ29tcG9uZW50TmFtZSBjb21wb25lbnROYW1lLCBpbnQgdWlkKSB7CisgICAgICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOworICAgICAgICAgICAgdGhpcy5jb21wb25lbnROYW1lID0gY29tcG9uZW50TmFtZTsKKyAgICAgICAgICAgIHRoaXMudWlkID0gdWlkOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgICAgICByZXR1cm4gIlNlcnZpY2VJbmZvOiAiICsgdHlwZSArICIsICIgKyBjb21wb25lbnROYW1lOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQWNjZXNzb3IgZm9yIHRoZSByZWdpc3RlcmVkIGF1dGhlbnRpY2F0b3JzLgorICAgICAqIEBwYXJhbSB0eXBlIHRoZSBhY2NvdW50IHR5cGUgb2YgdGhlIGF1dGhlbnRpY2F0b3IKKyAgICAgKiBAcmV0dXJuIHRoZSBBdXRoZW50aWNhdG9ySW5mbyB0aGF0IG1hdGNoZXMgdGhlIGFjY291bnQgdHlwZSBvciBudWxsIGlmIG5vbmUgaXMgcHJlc2VudAorICAgICAqLworICAgIHB1YmxpYyBTZXJ2aWNlSW5mbzxWPiBnZXRTZXJ2aWNlSW5mbyhWIHR5cGUpIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlcyA9PSBudWxsKSB7CisgICAgICAgICAgICBtYXliZVJlZ2lzdGVyRm9yUGFja2FnZUNoYW5nZXMoKTsKKyAgICAgICAgICAgIG1TZXJ2aWNlcyA9IGdlbmVyYXRlU2VydmljZXNNYXAoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbVNlcnZpY2VzLmdldCh0eXBlKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIGEgY29sbGVjdGlvbiBvZiB7QGxpbmsgUmVnaXN0ZXJlZFNlcnZpY2VzQ2FjaGUuU2VydmljZUluZm99IG9iamVjdHMgZm9yIGFsbAorICAgICAqIHJlZ2lzdGVyZWQgYXV0aGVudGljYXRvcnMuCisgICAgICovCisgICAgcHVibGljIENvbGxlY3Rpb248U2VydmljZUluZm88Vj4+IGdldEFsbFNlcnZpY2VzKCkgeworICAgICAgICBpZiAobVNlcnZpY2VzID09IG51bGwpIHsKKyAgICAgICAgICAgIG1heWJlUmVnaXN0ZXJGb3JQYWNrYWdlQ2hhbmdlcygpOworICAgICAgICAgICAgbVNlcnZpY2VzID0gZ2VuZXJhdGVTZXJ2aWNlc01hcCgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBDb2xsZWN0aW9ucy51bm1vZGlmaWFibGVDb2xsZWN0aW9uKG1TZXJ2aWNlcy52YWx1ZXMoKSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RvcHMgdGhlIG1vbml0b3Jpbmcgb2YgcGFja2FnZSBhZGRpdGlvbnMsIHJlbW92YWxzIGFuZCBjaGFuZ2VzLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgICAgICBtYXliZVVucmVnaXN0ZXJGb3JQYWNrYWdlQ2hhbmdlcygpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgdGhyb3dzIFRocm93YWJsZSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKG1SZWNlaXZlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVnaXN0ZXJlZFNlcnZpY2VzQ2FjaGUgZmluYWxpemVkIHdpdGhvdXQgYmVpbmcgY2xvc2VkIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgY2xvc2UoKTsKKyAgICAgICAgc3VwZXIuZmluYWxpemUoKTsKKyAgICB9CisKKyAgICBNYXA8ViwgU2VydmljZUluZm88Vj4+IGdlbmVyYXRlU2VydmljZXNNYXAoKSB7CisgICAgICAgIE1hcDxWLCBTZXJ2aWNlSW5mbzxWPj4gc2VydmljZXMgPSBNYXBzLm5ld0hhc2hNYXAoKTsKKyAgICAgICAgUGFja2FnZU1hbmFnZXIgcG0gPSBtQ29udGV4dC5nZXRQYWNrYWdlTWFuYWdlcigpOworCisgICAgICAgIExpc3Q8UmVzb2x2ZUluZm8+IHJlc29sdmVJbmZvcyA9CisgICAgICAgICAgICAgICAgcG0ucXVlcnlJbnRlbnRTZXJ2aWNlcyhuZXcgSW50ZW50KG1JbnRlcmZhY2VOYW1lKSwgUGFja2FnZU1hbmFnZXIuR0VUX01FVEFfREFUQSk7CisKKyAgICAgICAgZm9yIChSZXNvbHZlSW5mbyByZXNvbHZlSW5mbyA6IHJlc29sdmVJbmZvcykgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBTZXJ2aWNlSW5mbzxWPiBpbmZvID0gcGFyc2VTZXJ2aWNlSW5mbyhyZXNvbHZlSW5mbyk7CisgICAgICAgICAgICAgICAgaWYgKGluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlcy5wdXQoaW5mby50eXBlLCBpbmZvKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmFibGUgdG8gbG9hZCBpbnB1dCBtZXRob2QgIiArIHJlc29sdmVJbmZvLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKFhtbFB1bGxQYXJzZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlVuYWJsZSB0byBsb2FkIGlucHV0IG1ldGhvZCAiICsgcmVzb2x2ZUluZm8udG9TdHJpbmcoKSwgZSk7CisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiVW5hYmxlIHRvIGxvYWQgaW5wdXQgbWV0aG9kICIgKyByZXNvbHZlSW5mby50b1N0cmluZygpLCBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBzZXJ2aWNlczsKKyAgICB9CisKKyAgICBwcml2YXRlIFNlcnZpY2VJbmZvPFY+IHBhcnNlU2VydmljZUluZm8oUmVzb2x2ZUluZm8gc2VydmljZSkKKyAgICAgICAgICAgIHRocm93cyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGFuZHJvaWQuY29udGVudC5wbS5TZXJ2aWNlSW5mbyBzaSA9IHNlcnZpY2Uuc2VydmljZUluZm87CisgICAgICAgIENvbXBvbmVudE5hbWUgY29tcG9uZW50TmFtZSA9IG5ldyBDb21wb25lbnROYW1lKHNpLnBhY2thZ2VOYW1lLCBzaS5uYW1lKTsKKworICAgICAgICBQYWNrYWdlTWFuYWdlciBwbSA9IG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCk7CisKKyAgICAgICAgWG1sUmVzb3VyY2VQYXJzZXIgcGFyc2VyID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHBhcnNlciA9IHNpLmxvYWRYbWxNZXRhRGF0YShwbSwgbU1ldGFEYXRhTmFtZSk7CisgICAgICAgICAgICBpZiAocGFyc2VyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigiTm8gIiArIG1NZXRhRGF0YU5hbWUgKyAiIG1ldGEtZGF0YSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBBdHRyaWJ1dGVTZXQgYXR0cnMgPSBYbWwuYXNBdHRyaWJ1dGVTZXQocGFyc2VyKTsKKworICAgICAgICAgICAgaW50IHR5cGU7CisgICAgICAgICAgICB3aGlsZSAoKHR5cGU9cGFyc2VyLm5leHQoKSkgIT0gWG1sUHVsbFBhcnNlci5FTkRfRE9DVU1FTlQKKyAgICAgICAgICAgICAgICAgICAgJiYgdHlwZSAhPSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmcgbm9kZU5hbWUgPSBwYXJzZXIuZ2V0TmFtZSgpOworICAgICAgICAgICAgaWYgKCFtQXR0cmlidXRlc05hbWUuZXF1YWxzKG5vZGVOYW1lKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIk1ldGEtZGF0YSBkb2VzIG5vdCBzdGFydCB3aXRoICIgKyBtQXR0cmlidXRlc05hbWUgKyAgIiB0YWciKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgViB2ID0gcGFyc2VTZXJ2aWNlQXR0cmlidXRlcyhzaS5wYWNrYWdlTmFtZSwgYXR0cnMpOworICAgICAgICAgICAgaWYgKHYgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgYW5kcm9pZC5jb250ZW50LnBtLlNlcnZpY2VJbmZvIHNlcnZpY2VJbmZvID0gc2VydmljZS5zZXJ2aWNlSW5mbzsKKyAgICAgICAgICAgIGZpbmFsIEFwcGxpY2F0aW9uSW5mbyBhcHBsaWNhdGlvbkluZm8gPSBzZXJ2aWNlSW5mby5hcHBsaWNhdGlvbkluZm87CisgICAgICAgICAgICBmaW5hbCBpbnQgdWlkID0gYXBwbGljYXRpb25JbmZvLnVpZDsKKyAgICAgICAgICAgIHJldHVybiBuZXcgU2VydmljZUluZm88Vj4odiwgY29tcG9uZW50TmFtZSwgdWlkKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChwYXJzZXIgIT0gbnVsbCkgcGFyc2VyLmNsb3NlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYWJzdHJhY3QgViBwYXJzZVNlcnZpY2VBdHRyaWJ1dGVzKFN0cmluZyBwYWNrYWd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mV0dXJuIG5vbkxvY2FsaXplZExhYmVsOwogICAgICAgICB9CisgICAgICAgIENoYXJTZXF1ZW5jZSBsYWJlbDsKKyAgICAgICAgaWYgKHJlc29sdmVQYWNrYWdlTmFtZSAhPSBudWxsICYmIGxhYmVsUmVzICE9IDApIHsKKyAgICAgICAgICAgIGxhYmVsID0gcG0uZ2V0VGV4dChyZXNvbHZlUGFja2FnZU5hbWUsIGxhYmVsUmVzLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChsYWJlbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGxhYmVsOworICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgICAgIENvbXBvbmVudEluZm8gY2kgPSBhY3Rpdml0eUluZm8gIT0gbnVsbCA/IGFjdGl2aXR5SW5mbyA6IHNlcnZpY2VJbmZvOwogICAgICAgICBBcHBsaWNhdGlvbkluZm8gYWkgPSBjaS5hcHBsaWNhdGlvbkluZm87Ci0gICAgICAgIENoYXJTZXF1ZW5jZSBsYWJlbDsKICAgICAgICAgaWYgKGxhYmVsUmVzICE9IDApIHsKICAgICAgICAgICAgIGxhYmVsID0gcG0uZ2V0VGV4dChjaS5wYWNrYWdlTmFtZSwgbGFiZWxSZXMsIGFpKTsKICAgICAgICAgICAgIGlmIChsYWJlbCAhPSBudWxsKSB7CkBAIC0xMzMsNiArMTQ2LDEyIEBACiAgICAgICAgIENvbXBvbmVudEluZm8gY2kgPSBhY3Rpdml0eUluZm8gIT0gbnVsbCA/IGFjdGl2aXR5SW5mbyA6IHNlcnZpY2VJbmZvOwogICAgICAgICBBcHBsaWNhdGlvbkluZm8gYWkgPSBjaS5hcHBsaWNhdGlvbkluZm87CiAgICAgICAgIERyYXdhYmxlIGRyOworICAgICAgICBpZiAocmVzb2x2ZVBhY2thZ2VOYW1lICE9IG51bGwgJiYgaWNvbiAhPSAwKSB7CisgICAgICAgICAgICBkciA9IHBtLmdldERyYXdhYmxlKHJlc29sdmVQYWNrYWdlTmFtZSwgaWNvbiwgbnVsbCk7CisgICAgICAgICAgICBpZiAoZHIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBkcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQogICAgICAgICBpZiAoaWNvbiAhPSAwKSB7CiAgICAgICAgICAgICBkciA9IHBtLmdldERyYXdhYmxlKGNpLnBhY2thZ2VOYW1lLCBpY29uLCBhaSk7CiAgICAgICAgICAgICBpZiAoZHIgIT0gbnVsbCkgewpAQCAtMTYwLDI0ICsxNzksMjYgQEAKICAgICAgICAgaWYgKGZpbHRlciAhPSBudWxsKSB7CiAgICAgICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJGaWx0ZXI6Iik7CiAgICAgICAgICAgICBmaWx0ZXIuZHVtcChwdywgcHJlZml4ICsgIiAgIik7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJGaWx0ZXI6IG51bGwiKTsKICAgICAgICAgfQogICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJwcmlvcml0eT0iICsgcHJpb3JpdHkKICAgICAgICAgICAgICAgICArICIgcHJlZmVycmVkT3JkZXI9IiArIHByZWZlcnJlZE9yZGVyCiAgICAgICAgICAgICAgICAgKyAiIG1hdGNoPTB4IiArIEludGVnZXIudG9IZXhTdHJpbmcobWF0Y2gpCiAgICAgICAgICAgICAgICAgKyAiIHNwZWNpZmljSW5kZXg9IiArIHNwZWNpZmljSW5kZXgKICAgICAgICAgICAgICAgICArICIgaXNEZWZhdWx0PSIgKyBpc0RlZmF1bHQpOwotICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJsYWJlbFJlcz0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGxhYmVsUmVzKQotICAgICAgICAgICAgICAgICsgIiBub25Mb2NhbGl6ZWRMYWJlbD0iICsgbm9uTG9jYWxpemVkTGFiZWwKLSAgICAgICAgICAgICAgICArICIgaWNvbj0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGljb24pKTsKKyAgICAgICAgaWYgKHJlc29sdmVQYWNrYWdlTmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJyZXNvbHZlUGFja2FnZU5hbWU9IiArIHJlc29sdmVQYWNrYWdlTmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGxhYmVsUmVzICE9IDAgfHwgbm9uTG9jYWxpemVkTGFiZWwgIT0gbnVsbCB8fCBpY29uICE9IDApIHsKKyAgICAgICAgICAgIHB3LnByaW50bG4ocHJlZml4ICsgImxhYmVsUmVzPTB4IiArIEludGVnZXIudG9IZXhTdHJpbmcobGFiZWxSZXMpCisgICAgICAgICAgICAgICAgICAgICsgIiBub25Mb2NhbGl6ZWRMYWJlbD0iICsgbm9uTG9jYWxpemVkTGFiZWwKKyAgICAgICAgICAgICAgICAgICAgKyAiIGljb249MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhpY29uKSk7CisgICAgICAgIH0KICAgICAgICAgaWYgKGFjdGl2aXR5SW5mbyAhPSBudWxsKSB7CiAgICAgICAgICAgICBwdy5wcmludGxuKHByZWZpeCArICJBY3Rpdml0eUluZm86Iik7CiAgICAgICAgICAgICBhY3Rpdml0eUluZm8uZHVtcChwdywgcHJlZml4ICsgIiAgIik7CiAgICAgICAgIH0gZWxzZSBpZiAoc2VydmljZUluZm8gIT0gbnVsbCkgewogICAgICAgICAgICAgcHcucHJpbnRsbihwcmVmaXggKyAiU2VydmljZUluZm86Iik7Ci0gICAgICAgICAgICAvLyBUT0RPCi0gICAgICAgICAgICAvL3NlcnZpY2VJbmZvLmR1bXAocHcsIHByZWZpeCArICIgICIpOworICAgICAgICAgICAgc2VydmljZUluZm8uZHVtcChwdywgcHJlZml4ICsgIiAgIik7CiAgICAgICAgIH0KICAgICB9CiAgICAgCkBAIC0yMTksNiArMjQwLDcgQEAKICAgICAgICAgZGVzdC53cml0ZUludChsYWJlbF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NlckV4Y2VwdGlvbjsKIAogaW1wb3J0IGFuZHJvaWQuY29udGVudC5wbS5BcHBsaWNhdGlvbkluZm87CitpbXBvcnQgYW5kcm9pZC5ncmFwaGljcy5CaXRtYXBGYWN0b3J5OwogaW1wb3J0IGFuZHJvaWQuZ3JhcGhpY3MuTW92aWU7CiBpbXBvcnQgYW5kcm9pZC5ncmFwaGljcy5kcmF3YWJsZS5EcmF3YWJsZTsKIGltcG9ydCBhbmRyb2lkLmdyYXBoaWNzLmRyYXdhYmxlLkNvbG9yRHJhd2FibGU7CkBAIC0xNzA3LDcgKzE3MDgsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgSW5wdXRTdHJlYW0gaXMgPSBtQXNzZXRzLm9wZW5Ob25Bc3NldCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUuYXNzZXRDb29raWUsIGZpbGUsIEFzc2V0TWFuYWdlci5BQ0NFU1NfQlVGRkVSKTsKICAgICAgICAgLy8gICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJPcGVuZWQgZmlsZSAiICsgZmlsZSArICI6ICIgKyBpcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkciA9IERyYXdhYmxlLmNyZWF0ZUZyb21SZXNvdXJjZVN0cmVhbSh0aGlzLCB2YWx1ZSwgaXMsIGZpbGUpOworICAgICAgICAgICAgICAgICAgICAgICAgZHIgPSBEcmF3YWJsZS5jcmVhdGVGcm9tUmVzb3VyY2VTdHJlYW0odGhpcywgdmFsdWUsIGlzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlLCBudWxsKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlzLmNsb3NlKCk7CiAgICAgICAgIC8vICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQ3JlYXRlZCBzdHJlYW06ICIgKyBkcik7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3Jlcy9TdHJpbmdCbG9jay5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9yZXMvU3RyaW5nQmxvY2suamF2YQppbmRleCBlNjg0Y2I4Li44ZmI4MmJlIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3Jlcy9TdHJpbmdCbG9jay5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvcmVzL1N0cmluZ0Jsb2NrLmphdmEKQEAgLTIwMiw3ICsyMDIsNyBAQAogICAgICAgICAgICAgICAgICAgICBzdWIgPSBzdWJ0YWcodGFnLCAiO3NpemU9Iik7CiAgICAgICAgICAgICAgICAgICAgIGlmIChzdWIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNpemUgPSBJbnRlZ2VyLnBhcnNlSW50KHN1Yik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIuc2V0U3BhbihuZXcgQWJzb2x1dGVTaXplU3BhbihzaXplKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5zZXRTcGFuKG5ldyBBYnNvbHV0ZVNpemVTcGFuKHNpemUsIHRydWUpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGVbaSsxXSwgc3R5bGVbaSsyXSsxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Bhbm5hYmxlLlNQQU5fRVhDTFVTSVZFX0VYQ0xVU0lWRSk7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTMxMCw3ICszMTAsNyBAQAogICAgICAqIHRoZSBhc2NlbnQgaWYgcG9zc2libGUsIG9yIHRoZSBkZXNjZW50IGlmIHNocmlua2luZyB0aGUgYXNjZW50IGZ1cnRoZXIKICAgICAgKiB3aWxsIG1ha2UgdGhlIHRleHQgdW5yZWFkYWJsZS4KICAgICAgKi8KLSAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBIZWlnaHQgaW1wbGVtZW50cyBMaW5lSGVpZ2h0U3BhbiB7CisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSGVpZ2h0IGltcGxlbWVudHMgTGluZUhlaWdodFNwYW4uV2l0aERlbnNpdHkgewogICAgICAgICBwcml2YXRlIGludCBtU2l6ZTsKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmxvYXQgc1Byb3BvcnRpb24gPSAwOwogCkBAIC0zMjEsOSArMzIxLDIxIEBACiAgICAgICAgIHB1YmxpYyB2b2lkIGNob29zZUhlaWdodChDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5zdGFydHYsIGludCB2LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm0pIHsKLSAgICAgICAgICAgIGlmIChmbS5ib3R0b20gLSBmbS50b3AgPCBtU2l6ZSkgewotICAgICAgICAgICAgICAgIGZtLnRvcCA9IGZtLmJvdHRvbSAtIG1TaXplOwotICAgICAgICAgICAgICAgIGZtLmFzY2VudCA9IGZtLmFzY2VudCAtIG1TaXplOworICAgICAgICAgICAgLy8gU2hvdWxkIG5vdCBnZXQgY2FsbGVkLCBhdCBsZWFzdCBub3QgYnkgU3RhdGljTGF5b3V0LgorICAgICAgICAgICAgY2hvb3NlSGVpZ2h0KHRleHQsIHN0YXJ0LCBlbmQsIHNwYW5zdGFydHYsIHYsIGZtLCBudWxsKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGNob29zZUhlaWdodChDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5zdGFydHYsIGludCB2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm0sIFRleHRQYWludCBwYWludCkgeworICAgICAgICAgICAgaW50IHNpemUgPSBtU2l6ZTsKKyAgICAgICAgICAgIGlmIChwYWludCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgc2l6ZSAqPSBwYWludC5kZW5zaXR5OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZm0uYm90dG9tIC0gZm0udG9wIDwgc2l6ZSkgeworICAgICAgICAgICAgICAgIGZtLnRvcCA9IGZtLmJvdHRvbSAtIHNpemU7CisgICAgICAgICAgICAgICAgZm0uYXNjZW50ID0gZm0uYXNjZW50IC0gc2l6ZTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgaWYgKHNQcm9wb3J0aW9uID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgLyoKQEAgLTM0MywyNyArMzU1LDI3IEBACiAKICAgICAgICAgICAgICAgICBpbnQgbmVlZCA9IChpbnQpIE1hdGguY2VpbCgtZm0udG9wICogc1Byb3BvcnRpb24pOwogCi0gICAgICAgICAgICAgICAgaWYgKG1TaXplIC0gZm0uZGVzY2VudCA+PSBuZWVkKSB7CisgICAgICAgICAgICAgICAgaWYgKHNpemUgLSBmbS5kZXNjZW50ID49IG5lZWQpIHsKICAgICAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgICAgICogSXQgaXMgc2FmZSB0byBzaHJpbmsgdGhlIGFzY2VudCB0aGlzIG11Y2guCiAgICAgICAgICAgICAgICAgICAgICAqLwogCi0gICAgICAgICAgICAgICAgICAgIGZtLnRvcCA9IGZtLmJvdHRvbSAtIG1TaXplOwotICAgICAgICAgICAgICAgICAgICBmbS5hc2NlbnQgPSBmbS5kZXNjZW50IC0gbVNpemU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtU2l6ZSA+PSBuZWVkKSB7CisgICAgICAgICAgICAgICAgICAgIGZtLnRvcCA9IGZtLmJvdHRvbSAtIHNpemU7CisgICAgICAgICAgICAgICAgICAgIGZtLmFzY2VudCA9IGZtLmRlc2NlbnQgLSBzaXplOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2l6ZSA+PSBuZWVkKSB7CiAgICAgICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgICAgICAqIFdlIGNhbid0IHNob3cgYWxsIHRoZSBkZXNjZW50LCBidXQgd2UgY2FuIGF0IGxlYXN0CiAgICAgICAgICAgICAgICAgICAgICAqIHNob3cgYWxsIHRoZSBhc2NlbnQuCiAgICAgICAgICAgICAgICAgICAgICAqLwogCiAgICAgICAgICAgICAgICAgICAgIGZtLnRvcCA9IGZtLmFzY2VudCA9IC1uZWVkOwotICAgICAgICAgICAgICAgICAgICBmbS5ib3R0b20gPSBmbS5kZXNjZW50ID0gZm0udG9wICsgbVNpemU7CisgICAgICAgICAgICAgICAgICAgIGZtLmJvdHRvbSA9IGZtLmRlc2NlbnQgPSBmbS50b3AgKyBzaXplOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgICAgICAqIFNob3cgYXMgbXVjaCBvZiB0aGUgYXNjZW50IGFzIHdlIGNhbiwgYW5kIG5vIGRlc2NlbnQuCiAgICAgICAgICAgICAgICAgICAgICAqLwogCi0gICAgICAgICAgICAgICAgICAgIGZtLnRvcCA9IGZtLmFzY2VudCA9IC1tU2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgZm0udG9wID0gZm0uYXNjZW50ID0gLXNpemU7CiAgICAgICAgICAgICAgICAgICAgIGZtLmJvdHRvbSA9IGZtLmRlc2NlbnQgPSAwOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2RhdGFiYXNlL0Fic3RyYWN0V2luZG93ZWRDdXJzb3IuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2RhdGFiYXNlL0Fic3RyYWN0V2luZG93ZWRDdXJzb3IuamF2YQppbmRleCA0YWMwYWVmLi4yN2EwMmUyIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9kYXRhYmFzZS9BYnN0cmFjdFdpbmRvd2VkQ3Vyc29yLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvZGF0YWJhc2UvQWJzdHJhY3RXaW5kb3dlZEN1cnNvci5qYXZhCkBAIC0xNjYsNiArMTY2LDQ4IEBACiAgICAgICAgIHJldHVybiBtV2luZG93LmlzQmxvYihtUG9zLCBjb2x1bW5JbmRleCk7CiAgICAgfQogCisgICAgcHVibGljIGJvb2xlYW4gaXNTdHJpbmcoaW50IGNvbHVtbkluZGV4KQorICAgIHsKKyAgICAgICAgY2hlY2tQb3NpdGlvbigpOworCisgICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKKyAgICAgICAgICAgIGlmIChpc0ZpZWxkVXBkYXRlZChjb2x1bW5JbmRleCkpIHsKKyAgICAgICAgICAgICAgICBPYmplY3Qgb2JqZWN0ID0gZ2V0VXBkYXRlZEZpZWxkKGNvbHVtbkluZGV4KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0ID09IG51bGwgfHwgb2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG1XaW5kb3cuaXNTdHJpbmcobVBvcywgY29sdW1uSW5kZXgpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzTG9uZyhpbnQgY29sdW1uSW5kZXgpCisgICAgeworICAgICAgICBjaGVja1Bvc2l0aW9uKCk7CisKKyAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgeworICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgeworICAgICAgICAgICAgICAgIE9iamVjdCBvYmplY3QgPSBnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOworICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3QgIT0gbnVsbCAmJiAob2JqZWN0IGluc3RhbmNlb2YgSW50ZWdlciB8fCBvYmplY3QgaW5zdGFuY2VvZiBMb25nKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBtV2luZG93LmlzTG9uZyhtUG9zLCBjb2x1bW5JbmRleCk7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNGbG9hdChpbnQgY29sdW1uSW5kZXgpCisgICAgeworICAgICAgICBjaGVja1Bvc2l0aW9uKCk7CisKKyAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgeworICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgeworICAgICAgICAgICAgICAgIE9iamVjdCBvYmplY3QgPSBnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOworICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3QgIT0gbnVsbCAmJiAob2JqZWN0IGluc3RhbmNlb2YgRmxvYXQgfHwgb2JqZWN0IGluc3RhbmNlb2YgRG91YmxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBtV2luZG93LmlzRmxvYXQobVBvcywgY29sdW1uSW5kZXgpOworICAgIH0KKwogICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCB2b2lkIGNoZWNrUG9zaXRpb24oKQogICAgIHsKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2RhdGFiYXNlL0N1cnNvcldpbmRvdy5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvZGF0YWJhc2UvQ3Vyc29yV2luZG93LmphdmEKaW5kZXggOGUyNjczMC4uOTlkYjgxYiAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvZGF0YWJhc2UvQ3Vyc29yV2luZG93LmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvZGF0YWJhc2UvQ3Vyc29yV2luZG93LmphdmEKQEAgLTI2Myw3ICsyNjMsNTggQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIC8qKgorICAgICAqIENoZWNrcyBpZiBhIGZpZWxkIGNvbnRhaW5zIGEgbG9uZworICAgICAqCisgICAgICogQHBhcmFtIHJvdyB0aGUgcm93IHRvIHJlYWQgZnJvbSwgcm93IC0gZ2V0U3RhcnRQb3NpdGlvbigpIGJlaW5nIHRoZSBhY3R1YWwgcm93IGluIHRoZSB3aW5kb3cKKyAgICAgKiBAcGFyYW0gY29sIHRoZSBjb2x1bW4gdG8gcmVhZCBmcm9tCisgICAgICogQHJldHVybiB7QGNvZGUgdHJ1ZX0gaWYgZ2l2ZW4gZmllbGQgaXMgYSBsb25nCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNMb25nKGludCByb3csIGludCBjb2wpIHsKKyAgICAgICAgYWNxdWlyZVJlZmVyZW5jZSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIGlzSW50ZWdlcl9uYXRpdmUocm93IC0gbVN0YXJ0UG9zLCBjb2wpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2hlY2tzIGlmIGEgZmllbGQgY29udGFpbnMgYSBmbG9hdC4KKyAgICAgKgorICAgICAqIEBwYXJhbSByb3cgdGhlIHJvdyB0byByZWFkIGZyb20sIHJvdyAtIGdldFN0YXJ0UG9zaXRpb24oKSBiZWluZyB0aGUgYWN0dWFsIHJvdyBpbiB0aGUgd2luZG93CisgICAgICogQHBhcmFtIGNvbCB0aGUgY29sdW1uIHRvIHJlYWQgZnJvbQorICAgICAqIEByZXR1cm4ge0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XRhYmFzZTsKQEAgLTgyLDYgKzgzLDggQEAKICAgICAgICAgICAgIGNvZGUgPSA4OwogICAgICAgICB9IGVsc2UgaWYgKGUgaW5zdGFuY2VvZiBTUUxpdGVFeGNlcHRpb24pIHsKICAgICAgICAgICAgIGNvZGUgPSA5OworICAgICAgICB9IGVsc2UgaWYgKGUgaW5zdGFuY2VvZiBPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbikgeworICAgICAgICAgICAgY29kZSA9IDEwOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgcmVwbHkud3JpdGVFeGNlcHRpb24oZSk7CiAgICAgICAgICAgICBMb2cuZShUQUcsICJXcml0aW5nIGV4Y2VwdGlvbiB0byBwYXJjZWwiLCBlKTsKQEAgLTEyMyw2ICsxMjYsMTggQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHB1YmxpYyBzdGF0aWMgdm9pZCByZWFkRXhjZXB0aW9uV2l0aE9wZXJhdGlvbkFwcGxpY2F0aW9uRXhjZXB0aW9uRnJvbVBhcmNlbCgKKyAgICAgICAgICAgIFBhcmNlbCByZXBseSkgdGhyb3dzIE9wZXJhdGlvbkFwcGxpY2F0aW9uRXhjZXB0aW9uIHsKKyAgICAgICAgaW50IGNvZGUgPSByZXBseS5yZWFkSW50KCk7CisgICAgICAgIGlmIChjb2RlID09IDApIHJldHVybjsKKyAgICAgICAgU3RyaW5nIG1zZyA9IHJlcGx5LnJlYWRTdHJpbmcoKTsKKyAgICAgICAgaWYgKGNvZGUgPT0gMTApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbihtc2cpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5yZWFkRXhjZXB0aW9uRnJvbVBhcmNlbChyZXBseSwgbXNnLCBjb2RlKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIHZvaWQgcmVhZEV4Y2VwdGlvbkZyb21QYXJjZWwoUGFyY2VsIHJlcGx5LCBTdHJpbmcgbXNnLCBpbnQgY29kZSkgewogICAgICAgICBzd2l0Y2ggKGNvZGUpIHsKICAgICAgICAgICAgIGNhc2UgMjoKQEAgLTIxMSw3ICsyMjYsNyBAQAogICAgICAgICAgICAgc2IuYXBwZW5kKHNxbFN0cmluZyk7CiAgICAgICAgIHNiLmFwcGVuZCgnXCcnKTsKICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBTUUwtZXNjYXBlIGEgc3RyaW5nLgogICAgICAqLwpAQCAtMjQwLDcgKzI1NSw3IEBACiAgICAgICAgICAgICBhcHBlbmRFc2NhcGVkU1FMU3RyaW5nKHNxbCwgdmFsdWUudG9TdHJpbmcoKSk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBDb25jYXRlbmF0ZXMgdHdvIFNRTCBXSEVSRSBjbGF1c2VzLCBoYW5kbGluZyBlbXB0eSBvciBudWxsIHZhbHVlcy4KICAgICAgKiBAaGlkZQpAQCAtMjUyLDEyICsyNjcsMTIgQEAKICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGIpKSB7CiAgICAgICAgICAgICByZXR1cm4gYTsKICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgcmV0dXJuICIoIiArIGEgKyAiKSBBTkQgKCIgKyBiICsgIikiOwogICAgIH0KLSAgICAKKwogICAgIC8qKgotICAgICAqIHJldHVybiB0aGUgY29sbGF0aW9uIGtleSAKKyAgICAgKiByZXR1cm4gdGhlIGNvbGxhdGlvbiBrZXkKICAgICAgKiBAcGFyYW0gbmFtZQogICAgICAqIEByZXR1cm4gdGhlIGNvbGxhdGlvbiBrZXkKICAgICAgKi8KQEAgLTI2OSw3ICsyODQsNyBAQAogICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogcmV0dXJuIHRoZSBjb2xsYXRpb24ga2V5IGluIGhleCBmb3JtYXQKICAgICAgKiBAcGFyYW0gbmFtZQpAQCAtMjgwLDcgKzI5NSw3IEBACiAgICAgICAgIGNoYXJbXSBrZXlzID0gSGV4LmVuY29kZUhleChhcnIpOwogICAgICAgICByZXR1cm4gbmV3IFN0cmluZyhrZXlzLCAwLCBnZXRLZXlMZW4oYXJyKSAqIDIpOwogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgc3RhdGljIGludCBnZXRLZXlMZW4oYnl0ZVtdIGFycikgewogICAgICAgICBpZiAoYXJyW2Fyci5sZW5ndGggLSAxXSAhPSAwKSB7CiAgICAgICAgICAgICByZXR1cm4gYXJyLmxlbmd0aDsKQEAgLTI4OSwxNiArMzA0LDE2IEBACiAgICAgICAgICAgICByZXR1cm4gYXJyLmxlbmd0aC0xOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHJpdmF0ZSBzdGF0aWMgYnl0ZVtdIGdldENvbGxhdGlvbktleUluQnl0ZXMoU3RyaW5nIG5hbWUpIHsKICAgICAgICAgaWYgKG1Db2xsID09IG51bGwpIHsKICAgICAgICAgICAgIG1Db2xsID0gQ29sbGF0b3IuZ2V0SW5zdGFuY2UoKTsKICAgICAgICAgICAgIG1Db2xsLnNldFN0cmVuZ3RoKENvbGxhdG9yLlBSSU1BUlkpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBtQ29sbC5nZXRDb2xsYXRpb25LZXkobmFtZSkudG9CeXRlQXJyYXkoKTsgICAgICAgIAorICAgICAgICByZXR1cm4gbUNvbGwuZ2V0Q29sbGF0aW9uS2V5KG5hbWUpLnRvQnl0ZUFycmF5KCk7CiAgICAgfQotICAgIAotICAgIHByaXZhdGUgc3RhdGljIENvbGxhdG9yIG1Db2xsID0gbnVsbDsgICAgCisKKyAgICBwcml2YXRlIHN0YXRpYyBDb2xsYXRvciBtQ29sbCA9IG51bGw7CiAgICAgLyoqCiAgICAgICogU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AgICAgICAgKiBhcmUgcHJlc2VydmVkIGFuZCBhcmUgbm90IGJhY2tlZCBvdXQuCiAgICAgICAgICAqLwogICAgICAgICBGQUlMKCJGQUlMIiksCi0gICAgICAgIAorCiAgICAgICAgIC8qKgotICAgICAgICAgKiBXaGVuIGEgY29uc3RyYWludCB2aW9sYXRpb24gb2NjdXJzLCB0aGUgb25lIHJvdyB0aGF0IGNvbnRhaW5zIAotICAgICAgICAgKiB0aGUgY29uc3RyYWludCB2aW9sYXRpb24gaXMgbm90IGluc2VydGVkIG9yIGNoYW5nZWQuIAotICAgICAgICAgKiBCdXQgdGhlIGNvbW1hbmQgY29udGludWVzIGV4ZWN1dGluZyBub3JtYWxseS4gT3RoZXIgcm93cyBiZWZvcmUgYW5kIAotICAgICAgICAgKiBhZnRlciB0aGUgcm93IHRoYXQgY29udGFpbmVkIHRoZSBjb25zdHJhaW50IHZpb2xhdGlvbiBjb250aW51ZSB0byBiZSAKKyAgICAgICAgICogV2hlbiBhIGNvbnN0cmFpbnQgdmlvbGF0aW9uIG9jY3VycywgdGhlIG9uZSByb3cgdGhhdCBjb250YWlucworICAgICAgICAgKiB0aGUgY29uc3RyYWludCB2aW9sYXRpb24gaXMgbm90IGluc2VydGVkIG9yIGNoYW5nZWQuCisgICAgICAgICAqIEJ1dCB0aGUgY29tbWFuZCBjb250aW51ZXMgZXhlY3V0aW5nIG5vcm1hbGx5LiBPdGhlciByb3dzIGJlZm9yZSBhbmQKKyAgICAgICAgICogYWZ0ZXIgdGhlIHJvdyB0aGF0IGNvbnRhaW5lZCB0aGUgY29uc3RyYWludCB2aW9sYXRpb24gY29udGludWUgdG8gYmUKICAgICAgICAgICogaW5zZXJ0ZWQgb3IgdXBkYXRlZCBub3JtYWxseS4gTm8gZXJyb3IgaXMgcmV0dXJuZWQuCiAgICAgICAgICAqLwogICAgICAgICBJR05PUkUoIklHTk9SRSIpLAotICAgICAgICAKKwogICAgICAgICAvKioKICAgICAgICAgICogV2hlbiBhIFVOSVF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AgICAgICAgIHRyeSB7CkBAIC00MTEsOCArNDQzLDE3IEBACiAgICAgICAgICAgICAvLyBUaGlzIHRocmVhZCBkaWRuJ3QgYWxyZWFkeSBoYXZlIHRoZSBsb2NrLCBzbyBiZWdpbiBhIGRhdGFiYXNlCiAgICAgICAgICAgICAvLyB0cmFuc2FjdGlvbiBub3cuCiAgICAgICAgICAgICBleGVjU1FMKCJCRUdJTiBFWENMVVNJVkU7Iik7CisgICAgICAgICAgICBtVHJhbnNhY3Rpb25MaXN0ZW5lciA9IHRyYW5zYWN0aW9uTGlzdGVuZXI7CiAgICAgICAgICAgICBtVHJhbnNhY3Rpb25Jc1N1Y2Nlc3NmdWwgPSB0cnVlOwogICAgICAgICAgICAgbUlubmVyVHJhbnNhY3Rpb25Jc1N1Y2Nlc3NmdWwgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmICh0cmFuc2FjdGlvbkxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbkxpc3RlbmVyLm9uQmVnaW4oKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgZXhlY1NRTCgiUk9MTEJBQ0s7Iik7CisgICAgICAgICAgICAgICAgICAgIHRocm93IGU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICAgICAgb2sgPSB0cnVlOwogICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgaWYgKCFvaykgewpAQCAtNDQwLDExICs0ODEsMjcgQEAKICAgICAgICAgICAgIGlmIChtTG9jay5nZXRIb2xkQ291bnQoKSAhPSAxKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgUnVudGltZUV4Y2VwdGlvbiBzYXZlZEV4Y2VwdGlvbiA9IG51bGw7CisgICAgICAgICAgICBpZiAobVRyYW5zYWN0aW9uTGlzdGVuZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtVHJhbnNhY3Rpb25Jc1N1Y2Nlc3NmdWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFuc2FjdGlvbkxpc3RlbmVyLm9uQ29tbWl0KCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNhY3Rpb25MaXN0ZW5lci5vblJvbGxiYWNrKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2F2ZWRFeGNlcHRpb24gPSBlOworICAgICAgICAgICAgICAgICAgICBtVHJhbnNhY3Rpb25Jc1N1Y2Nlc3NmdWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAobVRyYW5zYWN0aW9uSXNTdWNjZXNzZnVsKSB7CiAgICAgICAgICAgICAgICAgZXhlY1NRTCgiQ09NTUlUOyIpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICBleGVjU1FMKCJST0xMQkFDSzsiKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNhdmVkRXhjZXB0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IHNhdmVkRXhjZXB0aW9uOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoU1FMRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKENvbmZpZy5MT0dEKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJleGNlcHRpb24gZHVyaW5nIHJvbGxiYWNrLCBtYXliZSB0aGUgREIgcHJldmlvdXNseSAiCkBAIC00NTMsNiArNTEwLDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtVHJhbnNhY3Rpb25MaXN0ZW5lciA9IG51bGw7CiAgICAgICAgICAgICB1bmxvY2tGb3JjZWQoKTsKICAgICAgICAgICAgIGlmIChDb25maWcuTE9HVikgewogICAgICAgICAgICAgICAgIExvZy52KFRBRywgInVubG9ja2VkICIgKyBUaHJlYWQuY3VycmVudFRocmVhZCgpCkBAIC01MTcsOCArNTc1LDEwIEBACiAgICAgICogQGRlcHJlY2F0ZWQgaWYgdGhlIGRiIGlzIGxvY2tlZCBtb3JlIHRoYW4gb25jZSAoYmVjdWFzZSBvZiBuZXN0ZWQgdHJhbnNhY3Rpb25zKSB0aGVuIHRoZSBsb2NrCiAgICAgICogICB3aWxsIG5vdCBiZSB5aWVsZGVkLiBVc2UgeWllbGRJZkNvbnRlbmRlZFNhZmVseSBpbnN0ZWFkLgogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIGJvb2xlYW4geWllbGRJZkNvbnRlbmRlZCgpIHsKLSAgICAgICAgcmV0dXJuIHlpZWxkSWZDb250ZW5kZWRIZWxwZXIoZmFsc2UgLyogZG8gbm90IGNoZWNrIHlpZWxkaW5nICovKTsKKyAgICAgICAgcmV0dXJuIHlpZWxkSWZDb250ZW5kZWRIZWxwZXIoZmFsc2UgLyogZG8gbm90IGNoZWNrIHlpZWxkaW5nICovLAorICAgICAgICAgICAgICAgIC0xIC8qIHNsZWVwQWZ0ZXJZaWVsZERlbGF5ICovKTsKICAgICB9CiAKICAgICAvKioKQEAgLTUyNiwxNCArNTg2LDI5IEBACiAgICAgICogc3VjY2Vzc2Z1bCBzbyBmYXIuIERvIG5vdCBjYWxsIHNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCBiZW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WxkRGVsYXkgbWlsbGlzZWNvbmRzLCB3YWtpbmcgdXAgcGVyaW9kaWNhbGx5IHRvCisgICAgICAgICAgICAvLyBjaGVjayBpZiBhbnlvbmUgaXMgdXNpbmcgdGhlIGRhdGFiYXNlLiAgSWYgdGhlIGRhdGFiYXNlIGlzIG5vdCBjb250ZW5kZWQsCisgICAgICAgICAgICAvLyByZXRha2UgdGhlIGxvY2sgYW5kIHJldHVybi4KKyAgICAgICAgICAgIGxvbmcgcmVtYWluaW5nRGVsYXkgPSBzbGVlcEFmdGVyWWllbGREZWxheTsKKyAgICAgICAgICAgIHdoaWxlIChyZW1haW5pbmdEZWxheSA+IDApIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBUaHJlYWQuc2xlZXAocmVtYWluaW5nRGVsYXkgPCBTTEVFUF9BRlRFUl9ZSUVMRF9RVUFOVFVNID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1haW5pbmdEZWxheSA6IFNMRUVQX0FGVEVSX1lJRUxEX1FVQU5UVU0pOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgVGhyZWFkLmludGVycnVwdGVkKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbWFpbmluZ0RlbGF5IC09IFNMRUVQX0FGVEVSX1lJRUxEX1FVQU5UVU07CisgICAgICAgICAgICAgICAgaWYgKG1Mb2NrLmdldFF1ZXVlTGVuZ3RoKCkgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgYmVnaW5UcmFuc2FjdGlvbldpdGhMaXN0ZW5lcih0cmFuc2FjdGlvbkxpc3RlbmVyKTsKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCkBAIC02OTYsOSArNzkwLD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W4gZ2V0UHJldmlld0Zvcm1hdCgpCi0gICAgICAgICAqICAgICAgICAgICAgIGZvcm1hdC4KKyAgICAgICAgICogQHBhcmFtIGRhdGEgVGhlIGNvbnRlbnRzIG9mIHRoZSBwcmV2aWV3IGZyYW1lIGluIHtAbGluaworICAgICAgICAgKiAgICAgICAgICAgICBhbmRyb2lkLmhhcmR3YXJlLkNhbWVyYS5QYXJhbWV0ZXJzI2dldFByZXZpZXdGb3JtYXQoKX0KKyAgICAgICAgICogICAgICAgICAgICAgZm9ybWF0LiBJZiB7QGxpbmsKKyAgICAgICAgICogICAgICAgICAgICAgYW5kcm9pZC5oYXJkd2FyZS5DYW1lcmEuUGFyYW1ldGVycyNzZXRQcmV2aWV3Rm9ybWF0KGludCl9CisgICAgICAgICAqICAgICAgICAgICAgIGlzIG5ldmVyIGNhbGxlZCwgdGhlIGRlZmF1bHQgd2lsbCBiZSB0aGUgWUNiQ3JfNDIwX1NQCisgICAgICAgICAqICAgICAgICAgICAgIChOVjIxKSBmb3JtYXQuCiAgICAgICAgICAqIEBwYXJhbSBjYW1lcmEgVGhlIENhbWVyYSBzZXJ2aWNlIG9iamVjdC4KICAgICAgICAgICovCiAgICAgICAgIHZvaWQgb25QcmV2aWV3RnJhbWUoYnl0ZVtdIGRhdGEsIENhbWVyYSBjYW1lcmEpOwogICAgIH07Ci0gICAgCisKICAgICAvKioKICAgICAgKiBTdGFydCBkcmF3aW5nIHByZXZpZXcgZnJhbWVzIHRvIHRoZSBzdXJmYWNlLgogICAgICAqLwogICAgIHB1YmxpYyBuYXRpdmUgZmluYWwgdm9pZCBzdGFydFByZXZpZXcoKTsKLSAgICAKKwogICAgIC8qKgogICAgICAqIFN0b3AgZHJhd2luZyBwcmV2aWV3IGZyYW1lcyB0byB0aGUgc3VyZmFjZS4KICAgICAgKi8KICAgICBwdWJsaWMgbmF0aXZlIGZpbmFsIHZvaWQgc3RvcFByZXZpZXcoKTsKLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHVybiBjdXJyZW50IHByZXZpZXcgc3RhdGUuCiAgICAgICoKQEAgLTE5Niw3ICsyMDcsNyBAQAogICAgICAqIEBoaWRlCiAgICAgICovCiAgICAgcHVibGljIG5hdGl2ZSBmaW5hbCBib29sZWFuIHByZXZpZXdFbmFibGVkKCk7Ci0gICAgCisKICAgICAvKioKICAgICAgKiBDYW4gYmUgY2FsbGVkIGF0IGFueSB0aW1lIHRvIGluc3RydWN0IHRoZSBjYW1lcmEgdG8gdXNlIGEgY2FsbGJhY2sgZm9yCiAgICAgICogZWFjaCBwcmV2aWV3IGZyYW1lIGluIGFkZGl0aW9uIHRvIGRpc3BsYXlpbmcgaXQuCkBAIC0yNDUsMTUgKzI1NiwxNyBAQAogICAgICAgICAgICAgICAgIHJldHVybjsKIAogICAgICAgICAgICAgY2FzZSBDQU1FUkFfTVNHX1JBV19JTUFHRToKLSAgICAgICAgICAgICAgICBpZiAobVJhd0ltYWdlQ2FsbGJhY2sgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICBpZiAobVJhd0ltYWdlQ2FsbGJhY2sgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBtUmF3SW1hZ2VDYWxsYmFjay5vblBpY3R1cmVUYWtlbigoYnl0ZVtdKW1zZy5vYmosIG1DYW1lcmEpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm47CiAKICAgICAgICAgICAgIGNhc2UgQ0FNRVJBX01TR19DT01QUkVTU0VEX0lNQUdFOgotICAgICAgICAgICAgICAgIGlmIChtSnBlZ0NhbGxiYWNrICE9IG51bGwpCisgICAgICAgICAgICAgICAgaWYgKG1KcGVnQ2FsbGJhY2sgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBtSnBlZ0NhbGxiYWNrLm9uUGljdHVyZVRha2VuKChieXRlW10pbXNnLm9iaiwgbUNhbWVyYSk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBjYXNlIENBTUVSQV9NU0dfUFJFVklFV19GUkFNRToKICAgICAgICAgICAgICAgICBpZiAobVByZXZpZXdDYWxsYmFjayAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG1QcmV2aWV3Q2FsbGJhY2sub25QcmV2aWV3RnJhbWUoKGJ5dGVbXSltc2cub2JqLCBtQ2FtZXJhKTsKQEAgLTI2MywxNSArMjc2LDI5IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHJldHVybjsKIAorICAgICAgICAgICAgY2FzZSBDQU1FUkFfTVNHX1BPU1RWSUVXX0ZSQU1FOgorICAgICAgICAgICAgICAgIGlmIChtUG9zdHZpZXdDYWxsYmFjayAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3N0dmlld0NhbGxiYWNrLm9uUGljdHVyZVRha2VuKChieXRlW10pbXNnLm9iaiwgbUNhbWVyYSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybjsKKwogICAgICAgICAgICAgY2FzZSBDQU1FUkFfTVNHX0ZPQ1VTOgotICAgICAgICAgICAgICAgIGlmIChtQXV0b0ZvY3VzQ2FsbGJhY2sgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICBpZiAobUF1dG9Gb2N1c0NhbGxiYWNrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgbUF1dG9Gb2N1c0NhbGxiYWNrLm9uQXV0b0ZvY3VzKG1zZy5hcmcxID09IDAgPyBmYWxzZSA6IHRydWUsIG1DYW1lcmEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm47CisKKyAgICAgICAgICAgIGNhc2UgQ0FNRVJBX01TR19aT09NOgorICAgICAgICAgICAgICAgIGlmIChtWm9vbUNhbGxiYWNrICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVpvb21DYWxsYmFjay5vblpvb21VcGRhdGUobXNnLmF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IGZpbmFsIFN0cmluZyBBTlRJQkFORElOR19BVVRPID0gImF1dG8iOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBTlRJQkFORElOR181MEhaID0gIjUwaHoiOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBTlRJQkFORElOR182MEhaID0gIjYwaHoiOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBTlRJQkFORElOR19PRkYgPSAib2ZmIjsKKworICAgICAgICAvLyBWYWx1ZXMgZm9yIGZsYXNoIG1vZGUgc2V0dGluZ3MuCisgICAgICAgIC8qKgorICAgICAgICAgKiBGbGFzaCB3aWxsIG5vdCBiZSBmaXJlZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEZMQVNIX01PREVfT0ZGID0gIm9mZiI7CisgICAgICAgIC8qKgorICAgICAgICAgKiBGbGFzaCB3aWxsIGJlIGZpcmVkIGF1dG9tYXRpY2FsbHkgd2hlbiByZXF1aXJlZC4gVGhlIHRpbWluZyBpcworICAgICAgICAgKiBkZWNpZGVkIGJ5IGNhbWVyYSBkcml2ZXIuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGTEFTSF9NT0RFX0FVVE8gPSAiYXV0byI7CisgICAgICAgIC8qKgorICAgICAgICAgKiBGbGFzaCB3aWxsIGFsd2F5cyBiZSBmaXJlZC4gVGhlIHRpbWluZyBpcyBkZWNpZGVkIGJ5IGNhbWVyYSBkcml2ZXIuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGTEFTSF9NT0RFX09OID0gIm9uIjsKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZsYXNoIHdpbGwgYmUgZmlyZWQgaW4gcmVkLWV5ZSByZWR1Y3Rpb24gbW9kZS4KKyAgICAgICAgICovCisgICAgICAgIH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W5mbGF0dGVuKFN0cmluZyBmbGF0dGVuZWQpIHsKICAgICAgICAgICAgIG1NYXAuY2xlYXIoKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBTdHJpbmdUb2tlbml6ZXIgdG9rZW5pemVyID0gbmV3IFN0cmluZ1Rva2VuaXplcihmbGF0dGVuZWQsICI7Iik7CiAgICAgICAgICAgICB3aGlsZSAodG9rZW5pemVyLmhhc01vcmVFbGVtZW50cygpKSB7CiAgICAgICAgICAgICAgICAgU3RyaW5nIGt2ID0gdG9rZW5pemVyLm5leHRUb2tlbigpOwpAQCAtNTEyLDE0ICs2OTYsMTQgQEAKICAgICAgICAgICAgICAgICBtTWFwLnB1dChrLCB2KTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCByZW1vdmUoU3RyaW5nIGtleSkgewogICAgICAgICAgICAgbU1hcC5yZW1vdmUoa2V5KTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBTZXRzIGEgU3RyaW5nIHBhcmFtZXRlci4KLSAgICAgICAgICogCisgICAgICAgICAqCiAgICAgICAgICAqIEBwYXJhbSBrZXkgICB0aGUga2V5IG5hbWUgZm9yIHRoZSBwYXJhbWV0ZXIKICAgICAgICAgICogQHBhcmFtIHZhbHVlIHRoZSBTdHJpbmcgdmFsdWUgb2YgdGhlIHBhcmFtZXRlcgogICAgICAgICAgKi8KQEAgLTUzOCw3ICs3MjIsNyBAQAogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBTZXRzIGFuIGludGVnZXIgcGFyYW1ldGVyLgotICAgICAgICAgKiAKKyAgICAgICAgICoKICAgICAgICAgICogQHBhcmFtIGtleSAgIHRoZSBrZXkgbmFtZSBmb3IgdGhlIHBhcmFtZXRlcgogICAgICAgICAgKiBAcGFyYW0gdmFsdWUgdGhlIGludCB2YWx1ZSBvZiB0aGUgcGFyYW1ldGVyCiAgICAgICAgICAqLwpAQCAtNTQ4LDcgKzczMiw3IEBACiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFJldHVybnMgdGhlIHZhbHVlIG9mIGEgU3RyaW5nIHBhcmFtZXRlci4KLSAgICAgICAgICogCisgICAgICAgICAqCiAgICAgICAgICAqIEBwYXJhbSBrZXkgdGhlIGtleSBuYW1lIGZvciB0aGUgcGFyYW1ldGVyCiAgICAgICAgICAqIEByZXR1cm4gdGhlIFN0cmluZyB2YWx1ZSBvZiB0aGUgcGFyYW1ldGVyCiAgICAgICAgICAqLwpAQCAtNTU4LDcgKzc0Miw3IEBACiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFJldHVybnMgdGhlIHZhbHVlIG9mIGFuIGludGVnZXIgcGFyYW1ldGVyLgotICAgICAgICAgKiAKKyAgICAgICAgICoKICAgICAgICAgICogQHBhcmFtIGtleSB0aGUga2V5IG5hbWUgZm9yIHRoZSBwYXJhbWV0ZXIKICAgICAgICAgICogQHJldHVybiB0aGUgaW50IHZhbHVlIG9mIHRoZSBwYXJhbWV0ZXIKICAgICAgICAgICovCkBAIC01NjgsMTEwICs3NTIsMTMzIEBACiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFNldHMgdGhlIGRpbWVuc2lvbnMgZm9yIHByZXZpZXcgcGljdHVyZXMuCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gd2lkdGggIHRoZSB3aWR0aCBvZiB0aGUgcGljdHVyZXMsIGluIHBpeGVscwogICAgICAgICAgKiBAcGFyYW0gaGVpZ2h0IHRoZSBoZWlnaHQgb2YgdGhlIHBpY3R1cmVzLCBpbiBwaXhlbHMKICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldFByZXZpZXdTaXplKGludCB3aWR0aCwgaW50IGhlaWdodCkgewogICAgICAgICAgICAgU3RyaW5nIHYgPSBJbnRlZ2VyLnRvU3RyaW5nKHdpZHRoKSArICJ4IiArIEludGVnZXIudG9TdHJpbmcoaGVpZ2h0KTsKLSAgICAgICAgICAgIHNldCgicHJldmlldy1zaXplIiwgdik7CisgICAgICAgICAgICBzZXQoS0VZX1BSRVZJRVdfU0laRSwgdik7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKICAgICAgICAgICogUmV0dXJucyB0aGUgZGltZW5zaW9ucyBzZXR0aW5nIGZvciBwcmV2aWV3IHBpY3R1cmVzLgotICAgICAgICAgKiAKLSAgICAgICAgICogQHJldHVybiBhIFNpemUgb2JqZWN0IHdpdGggdGhlIGhlaWdodCBhbmQgd2lkdGggc2V0dGluZyAKKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBhIFNpemUgb2JqZWN0IHdpdGggdGhlIGhlaWdodCBhbmQgd2lkdGggc2V0dGluZwogICAgICAgICAgKiAgICAgICAgICBmb3IgdGhlIHByZXZpZXcgcGljdHVyZQogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIFNpemUgZ2V0UHJldmlld1NpemUoKSB7Ci0gICAgICAgICAgICBTdHJpbmcgcGFpciA9IGdldCgicHJldmlldy1zaXplIik7Ci0gICAgICAgICAgICBpZiAocGFpciA9PSBudWxsKQotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICAgICAgU3RyaW5nW10gZGltcyA9IHBhaXIuc3BsaXQoIngiKTsKLSAgICAgICAgICAgIGlmIChkaW1zLmxlbmd0aCAhPSAyKQotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotCi0gICAgICAgICAgICByZXR1cm4gbmV3IFNpemUoSW50ZWdlci5wYXJzZUludChkaW1zWzBdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnBhcnNlSW50KGRpbXNbMV0pKTsKLQorICAgICAgICAgICAgU3RyaW5nIHBhaXIgPSBnZXQoS0VZX1BSRVZJRVdfU0laRSk7CisgICAgICAgICAgICByZXR1cm4gc3RyVG9TaXplKHBhaXIpOwogICAgICAgICB9CiAKICAgICAgICAgLyoqCi0gICAgICAgICAqIFNldHMgdGhlIGRpbWVuc2lvbnMgZm9yIEVYSUYgdGh1bWJuYWlscy4KLSAgICAgICAgICogCisgICAgICAgICAqIEdldHMgdGhlIHN1cHBvcnRlZCBwcmV2aWV3IHNpemVzLgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIGEgTGlzdCBvZiBTaXplIG9iamVjdC4gbnVsbCBpZiBwcmV2aWV3IHNpemUgc2V0dGluZyBpcyBub3QKKyAgICAgICAgICogICAgICAgICBzdXBwb3J0ZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgTGlzdDxTaXplPiBnZXRTdXBwb3J0ZWRQcmV2aWV3U2l6ZXMoKSB7CisgICAgICAgICAgICBTdHJpbmcgc3RyID0gZ2V0KEtFWV9QUkVWSUVXX1NJWkUgKyBTVVBQT1JURURfVkFMVUVTX1NVRkZJWCk7CisgICAgICAgICAgICByZXR1cm4gc3BsaXRTaXplKHN0cik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyB0aGUgZGltZW5zaW9ucyBmb3IgRVhJRiB0aHVtYm5haWwgaW4gSnBlZyBwaWN0dXJlLgorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gd2lkdGggIHRoZSB3aWR0aCBvZiB0aGUgdGh1bWJuYWlsLCBpbiBwaXhlbHMKICAgICAgICAgICogQHBhcmFtIGhlaWdodCB0aGUgaGVpZ2h0IG9mIHRoZSB0aHVtYm5haWwsIGluIHBpeGVscwotICAgICAgICAgKgotICAgICAgICAgKiBGSVhNRTogdW5oaWRlIGJlZm9yZSByZWxlYXNlCi0gICAgICAgICAqIEBoaWRlCiAgICAgICAgICAqLwotICAgICAgICBwdWJsaWMgdm9pZCBzZXRUaHVtYm5haWxTaXplKGludCB3aWR0aCwgaW50IGhlaWdodCkgewotICAgICAgICAgICAgc2V0KCJqcGVnLXRodW1ibmFpbC13aWR0aCIsIHdpZHRoKTsKLSAgICAgICAgICAgIHNldCgianBlZy10aHVtYm5haWwtaGVpZ2h0IiwgaGVpZ2h0KTsKKyAgICAgICAgcHVibGljIHZvaWQgc2V0SnBlZ1RodW1ibmFpbFNpemUoaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgICAgICBzZXQoS0VZX0pQRUdfVEhVTUJOQUlMX1dJRFRILCB3aWR0aCk7CisgICAgICAgICAgICBzZXQoS0VZX0pQRUdfVEhVTUJOQUlMX0hFSUdIVCwgaGVpZ2h0KTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBSZXR1cm5zIHRoZSBkaW1lbnNpb25zIGZvciBFWElGIHRodW1ibmFpbAotICAgICAgICAgKiAKLSAgICAgICAgICogQHJldHVybiBhIFNpemUgb2JqZWN0IHdpdGggdGhlIGhlaWdodCBhbmQgd2lkdGggc2V0dGluZyAKLSAgICAgICAgICogICAgICAgICAgZm9yIHRoZSBFWElGIHRodW1ibmFpbHMKKyAgICAgICAgICogUmV0dXJucyB0aGUgZGltZW5zaW9ucyBmb3IgRVhJRiB0aHVtYm5haWwgaW4gSnBlZyBwaWN0dXJlLgogICAgICAgICAgKgotICAgICAgICAgKiBGSVhNRTogdW5oaWRlIGJlZm9yZSByZWxlYXNlCi0gICAgICAgICAqIEBoaWRlCisgICAgICAgICAqIEByZXR1cm4gYSBTaXplIG9iamVjdCB3aXRoIHRoZSBoZWlnaHQgYW5kIHdpZHRoIHNldHRpbmcgZm9yIHRoZSBFWElGCisgICAgICAgICAqICAgICAgICAgdGh1bWJuYWlscwogICAgICAgICAgKi8KLSAgICAgICAgcHVibGljIFNpemUgZ2V0VGh1bWJuYWlsU2l6ZSgpIHsKLSAgICAgICAgICAgIHJldHVybiBuZXcgU2l6ZShnZXRJbnQoImpwZWctdGh1bWJuYWlsLXdpZHRoIiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SW50KCJqcGVnLXRodW1ibmFpbC1oZWlnaHQiKSk7CisgICAgICAgIHB1YmxpYyBTaXplIGdldEpwZWdUaHVtYm5haWxTaXplKCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBTaXplKGdldEludChLRVlfSlBFR19USFVNQk5BSUxfV0lEVEgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldEludChLRVlfSlBFR19USFVNQk5BSUxfSEVJR0hUKSk7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKLSAgICAgICAgICogU2V0cyB0aGUgcXVhbGl0eSBvZiB0aGUgRVhJRiB0aHVtYm5haWwKLSAgICAgICAgICogCi0gICAgICAgICAqIEBwYXJhbSBxdWFsaXR5IHRoZSBKUEVHIHF1YWxpdHkgb2YgdGhlIEVYSVQgdGh1bWJuYWlsCisgICAgICAgICAqIFNldHMgdGhlIHF1YWxpdHkgb2YgdGhlIEVYSUYgdGh1bWJuYWlsIGluIEpwZWcgcGljdHVyZS4KICAgICAgICAgICoKLSAgICAgICAgICogRklYTUU6IHVuaGlkZSBiZWZvcmUgcmVsZWFzZQotICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKiBAcGFyYW0gcXVhbGl0eSB0aGUgSlBFRyBxdWFsaXR5IG9mIHRoZSBFWElGIHRodW1ibmFpbC4gVGhlIHJhbmdlIGlzIDEKKyAgICAgICAgICogICAgICAgICAgICAgICAgdG8gMTAwLCB3aXRoIDEwMCBiZWluZyB0aGUgYmVzdC4KICAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFRodW1ibmFpbFF1YWxpdHkoaW50IHF1YWxpdHkpIHsKLSAgICAgICAgICAgIHNldCgianBlZy10aHVtYm5haWwtcXVhbGl0eSIsIHF1YWxpdHkpOworICAgICAgICBwdWJsaWMgdm9pZCBzZXRKcGVnVGh1bWJuYWlsUXVhbGl0eShpbnQgcXVhbGl0eSkgeworICAgICAgICAgICAgc2V0KEtFWV9KUEVHX1RIVU1CTkFJTF9RVUFMSVRZLCBxdWFsaXR5KTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBSZXR1cm5zIHRoZSBxdWFsaXR5IHNldHRpbmcgZm9yIHRoZSBFWElGIHRodW1ibmFpbAotICAgICAgICAgKiAKLSAgICAgICAgICogQHJldHVybiB0aGUgSlBFRyBxdWFsaXR5IHNldHRpbmcgb2YgdGhlIEVYSUYgdGh1bWJuYWlsCisgICAgICAgICAqIFJldHVybnMgdGhlIHF1YWxpdHkgc2V0dGluZyBmb3IgdGhlIEVYSUYgdGh1bWJuYWlsIGluIEpwZWcgcGljdHVyZS4KICAgICAgICAgICoKLSAgICAgICAgICogRklYTUU6IHVuaGlkZSBiZWZvcmUgcmVsZWFzZQotICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKiBAcmV0dXJuIHRoZSBKUEVHIHF1YWxpdHkgc2V0dGluZyBvZiB0aGUgRVhJRiB0aHVtYm5haWwuCiAgICAgICAgICAqLwotICAgICAgICBwdWJsaWMgaW50IGdldFRodW1ibmFpbFF1YWxpdHkoKSB7Ci0gICAgICAgICAgICByZXR1cm4gZ2V0SW50KCJqcGVnLXRodW1ibmFpbC1xdWFsaXR5Iik7CisgICAgICAgIHB1YmxpYyBpbnQgZ2V0SnBlZ1RodW1ibmFpbFF1YWxpdHkoKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0SW50KEtFWV9KUEVHX1RIVU1CTkFJTF9RVUFMSVRZKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXRzIEpwZWcgcXVhbGl0eSBvZiBjYXB0dXJlZCBwaWN0dXJlLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gcXVhbGl0eSB0aGUgSlBFRyBxdWFsaXR5IG9mIGNhcHR1cmVkIHBpY3R1cmUuIFRoZSByYW5nZSBpcyAxCisgICAgICAgICAqICAgICAgICAgICAgICAgIHRvIDEwMCwgd2l0aCAxMDAgYmVpbmcgdGhlIGJlc3QuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBzZXRKcGVnUXVhbGl0eShpbnQgcXVhbGl0eSkgeworICAgICAgICAgICAgc2V0KEtFWV9KUEVHX1FVQUxJVFksIHF1YWxpdHkpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJldHVybnMgdGhlIHF1YWxpdHkgc2V0dGluZyBmb3IgdGhlIEpQRUcgcGljdHVyZS4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiB0aGUgSlBFRyBwaWN0dXJlIHF1YWxpdHkgc2V0dGluZy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBpbnQgZ2V0SnBlZ1F1YWxpdHkoKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0SW50KEtFWV9KUEVHX1FVQUxJVFkpOwogICAgICAgICB9CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFNldHMgdGhlIHJhdGUgYXQgd2hpY2ggcHJldmlldyBmcmFtZXMgYXJlIHJlY2VpdmVkLgotICAgICAgICAgKiAKKyAgICAgICAgICoKICAgICAgICAgICogQHBhcmFtIGZwcyB0aGUgZnJhbWUgcmF0ZSAoZnJhbWVzIHBlciBzZWNvbmQpCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgdm9pZCBzZXRQcmV2aWV3RnJhbWVSYXRlKGludCBmcHMpIHsKLSAgICAgICAgICAgIHNldCgicHJldmlldy1mcmFtZS1yYXRlIiwgZnBzKTsKKyAgICAgICAgICAgIHNldChLRVlfUFJFVklFV19GUkFNRV9SQVRFLCBmcHMpOwogICAgICAgICB9CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFJldHVybnMgdGhlIHNldHRpbmcgZm9yIHRoZSByYXRlIGF0IHdoaWNoIHByZXZpZXcgZnJhbWVzCiAgICAgICAgICAqIGFyZSByZWNlaXZlZC4KLSAgICAgICAgICogCisgICAgICAgICAqCiAgICAgICAgICAqIEByZXR1cm4gdGhlIGZyYW1lIHJhdGUgc2V0dGluZyAoZnJhbWVzIHBlciBzZWNvbmQpCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgaW50IGdldFByZXZpZXdGcmFtZVJhdGUoKSB7Ci0gICAgICAgICAgICByZXR1cm4gZ2V0SW50KCJwcmV2aWV3LWZyYW1lLXJhdGUiKTsKKyAgICAgICAgICAgIHJldHVybiBnZXRJbnQoS0VZX1BSRVZJRVdfRlJBTUVfUkFURSk7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKLSAgICAgICAgICogU2V0cyB0aGUgaW1hZ2UgZm9ybWF0IGZvciBwcmV2aWV3IHBpY3R1cmVzLgotICAgICAgICAgKiAKLSAgICAgICAgICogQHBhcmFtIHBpeGVsX2Zvcm1hdCB0aGUgZGVzaXJlZCBwcmV2aWV3IHBpY3R1cmUgZm9ybWF0IAotICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICg8dmFyPlBpeGVsRm9ybWF0LllDYkNyXzQyMF9TUDwvdmFyPiwKKyAgICAgICAgICogR2V0cyB0aGUgc3VwcG9ydGVkIHByZXZpZXcgZnJhbWUgcmF0ZXMuCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gYSBMaXN0IG9mIEludGVnZXIgb2JqZWN0cyAocHJldmlldyBmcmFtZSByYXRlcykuIG51bGwgaWYKKyAgICAgICAgICogICAgICAgICBwcmV2aWV3IGZyYW1lIHJhdGUgc2V0dGluZyBpcyBub3Qgc3VwcG9ydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIExpc3Q8SW50ZWdlcj4gZ2V0U3VwcG9ydGVkUHJldmlld0ZyYW1lUmF0ZXMoKSB7CisgICAgICAgICAgICBTdHJpbmcgc3RyID0gZ2V0KEtFWV9QUkVWSUVXX0ZSQU1FX1JBVEUgKyBTVVBQT1JURURfVkFMVUVTX1NVRkZJWCk7CisgICAgICAgICAgICByZXR1cm4gc3BsaXRJbnQoc3RyKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXRzIHRoZSBpbWFnZSBmb3JtYXQgZm9yIHByZXZpZXcgcGljdHVyZXMuIElmIHRoaXMgaXMgbmV2ZXIgY2FsbGVkLAorICAgICAgICAgKiB0aGUgZGVmYXVsdCB3aWxsIGJlIHRoZSBZQ2JDcl80MjBfU1AgKE5WMjEpIGZvcm1hdC4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHBpeGVsX2Zvcm1hdCB0aGUgZGVzaXJlZCBwcmV2aWV3IHBpY3R1cmUgZm9ybWF0CisgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgKDx2YXI+UGl4ZWxGb3JtYXQuWUNiQ3JfNDIwX1NQIChOVjIxKTwvdmFyPiwKICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgPHZhcj5QaXhlbEZvcm1hdC5SR0JfNTY1PC92YXI+LCBvcgogICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICA8dmFyPlBpeGVsRm9ybWF0LkpQRUc8L3Zhcj4pCiAgICAgICAgICAqIEBzZWUgYW5kcm9pZC5ncmFwaGljcy5QaXhlbEZvcm1hdApAQCAtNjc5LDU2ICs4ODYsNzMgQEAKICAgICAgICAgcHVibGljIHZvaWQgc2V0UHJldmlld0Zvcm1hdChpbnQgcGl4ZWxfZm9ybWF0KSB7CiAgICAgICAgICAgICBTdHJpbmcgcyA9IGNhbWVyYUZvcm1hdEZvclBpeGVsRm9ybWF0KHBpeGVsX2Zvcm1hdCk7CiAgICAgICAgICAgICBpZiAocyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigpOworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBwaXhlbF9mb3JtYXQ9IiArIHBpeGVsX2Zvcm1hdCk7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIHNldCgicHJldmlldy1mb3JtYXQiLCBzKTsKKyAgICAgICAgICAgIHNldChLRVlfUFJFVklFV19GT1JNQVQsIHMpOwogICAgICAgICB9CiAKICAgICAgICAgLyoqCi0gICAgICAgICAqIFJldHVybnMgdGhlIGltYWdlIGZvcm1hdCBmb3IgcHJldmlldyBwaWN0dXJlcy4KLSAgICAgICAgICogCisgICAgICAgICAqIFJldHVybnMgdGhlIGltYWdlIGZvcm1hdCBmb3IgcHJldmlldyBwaWN0dXJlcyBnb3QgZnJvbQorICAgICAgICAgKiB7QGxpbmsgUHJldmlld0NhbGxiYWNrfS4KKyAgICAgICAgICoKICAgICAgICAgICogQHJldHVybiB0aGUgUGl4ZWxGb3JtYXQgaW50IHJlcHJlc2VudGluZyB0aGUgcHJldmlldyBwaWN0dXJlIGZvcm1hdAorICAgICAgICAgKiBAc2VlIGFuZHJvaWQuZ3JhcGhpY3MuUGl4ZWxGb3JtYXQKICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBpbnQgZ2V0UHJldmlld0Zvcm1hdCgpIHsKLSAgICAgICAgICAgIHJldHVybiBwaXhlbEZvcm1hdEZvckNhbWVyYUZvcm1hdChnZXQoInByZXZpZXctZm9ybWF0IikpOworICAgICAgICAgICAgcmV0dXJuIHBpeGVsRm9ybWF0Rm9yQ2FtZXJhRm9ybWF0KGdldChLRVlfUFJFVklFV19GT1JNQVQpKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBHZXRzIHRoZSBzdXBwb3J0ZWQgcHJldmlldyBmb3JtYXRzLgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIGEgTGlzdCBvZiBJbnRlZ2VyIG9iamVjdHMuIG51bGwgaWYgcHJldmlldyBmb3JtYXQgc2V0dGluZyBpcworICAgICAgICAgKiAgICAgICAgIG5vdCBzdXBwb3J0ZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgTGlzdDxJbnRlZ2VyPiBnZXRTdXBwb3J0ZWRQcmV2aWV3Rm9ybWF0cygpIHsKKyAgICAgICAgICAgIFN0cmluZyBzdHIgPSBnZXQoS0VZX1BSRVZJRVdfRk9STUFUICsgU1VQUE9SVEVEX1ZBTFVFU19TVUZGSVgpOworICAgICAgICAgICAgcmV0dXJuIHNwbGl0SW50KHN0cik7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKICAgICAgICAgICogU2V0cyB0aGUgZGltZW5zaW9ucyBmb3IgcGljdHVyZXMuCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gd2lkdGggIHRoZSB3aWR0aCBmb3IgcGljdHVyZXMsIGluIHBpeGVscwogICAgICAgICAgKiBAcGFyYW0gaGVpZ2h0IHRoZSBoZWlnaHQgZm9yIHBpY3R1cmVzLCBpbiBwaXhlbHMKICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldFBpY3R1cmVTaXplKGludCB3aWR0aCwgaW50IGhlaWdodCkgewogICAgICAgICAgICAgU3RyaW5nIHYgPSBJbnRlZ2VyLnRvU3RyaW5nKHdpZHRoKSArICJ4IiArIEludGVnZXIudG9TdHJpbmcoaGVpZ2h0KTsKLSAgICAgICAgICAgIHNldCgicGljdHVyZS1zaXplIiwgdik7CisgICAgICAgICAgICBzZXQoS0VZX1BJQ1RVUkVfU0laRSwgdik7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKICAgICAgICAgICogUmV0dXJucyB0aGUgZGltZW5zaW9uIHNldHRpbmcgZm9yIHBpY3R1cmVzLgotICAgICAgICAgKiAKLSAgICAgICAgICogQHJldHVybiBhIFNpemUgb2JqZWN0IHdpdGggdGhlIGhlaWdodCBhbmQgd2lkdGggc2V0dGluZyAKKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBhIFNpemUgb2JqZWN0IHdpdGggdGhlIGhlaWdodCBhbmQgd2lkdGggc2V0dGluZwogICAgICAgICAgKiAgICAgICAgICBmb3IgcGljdHVyZXMKICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBTaXplIGdldFBpY3R1cmVTaXplKCkgewotICAgICAgICAgICAgU3RyaW5nIHBhaXIgPSBnZXQoInBpY3R1cmUtc2l6ZSIpOwotICAgICAgICAgICAgaWYgKHBhaXIgPT0gbnVsbCkKLSAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgICAgIFN0cmluZ1tdIGRpbXMgPSBwYWlyLnNwbGl0KCJ4Iik7Ci0gICAgICAgICAgICBpZiAoZGltcy5sZW5ndGggIT0gMikKLSAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIFN0cmluZyBwYWlyID0gZ2V0KEtFWV9QSUNUVVJFX1NJWkUpOworICAgICAgICAgICAgcmV0dXJuIHN0clRvU2l6ZShwYWlyKTsKKyAgICAgICAgfQogCi0gICAgICAgICAgICByZXR1cm4gbmV3IFNpemUoSW50ZWdlci5wYXJzZUludChkaW1zWzBdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnBhcnNlSW50KGRpbXNbMV0pKTsKLQorICAgICAgICAvKioKKyAgICAgICAgICogR2V0cyB0aGUgc3VwcG9ydGVkIHBpY3R1cmUgc2l6ZXMuCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gYSBMaXN0IG9mIFNpemUgb2JqZWN0cy4gbnVsbCBpZiBwaWN0dXJlIHNpemUgc2V0dGluZyBpcyBub3QKKyAgICAgICAgICogICAgICAgICBzdXBwb3J0ZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgTGlzdDxTaXplPiBnZXRTdXBwb3J0ZWRQaWN0dXJlU2l6ZXMoKSB7CisgICAgICAgICAgICBTdHJpbmcgc3RyID0gZ2V0KEtFWV9QSUNUVVJFX1NJWkUgKyBTVVBQT1JURURfVkFMVUVTX1NVRkZJWCk7CisgICAgICAgICAgICByZXR1cm4gc3BsaXRTaXplKHN0cik7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKICAgICAgICAgICogU2V0cyB0aGUgaW1hZ2UgZm9ybWF0IGZvciBwaWN0dXJlcy4KLSAgICAgICAgICogCi0gICAgICAgICAqIEBwYXJhbSBwaXhlbF9mb3JtYXQgdGhlIGRlc2lyZWQgcGljdHVyZSBmb3JtYXQgCi0gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgKDx2YXI+UGl4ZWxGb3JtYXQuWUNiQ3JfNDIwX1NQPC92YXI+LAorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gcGl4ZWxfZm9ybWF0IHRoZSBkZXNpcmVkIHBpY3R1cmUgZm9ybWF0CisgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgKDx2YXI+UGl4ZWxGb3JtYXQuWUNiQ3JfNDIwX1NQIChOVjIxKTwvdmFyPiwKICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgPHZhcj5QaXhlbEZvcm1hdC5SR0JfNTY1PC92YXI+LCBvcgogICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICA8dmFyPlBpeGVsRm9ybWF0LkpQRUc8L3Zhcj4pCiAgICAgICAgICAqIEBzZWUgYW5kcm9pZC5ncmFwaGljcy5QaXhlbEZvcm1hdApAQCAtNzM2LDI3ICs5NjAsMzkgQEAKICAgICAgICAgcHVibGljIHZvaWQgc2V0UGljdHVyZUZvcm1hdChpbnQgcGl4ZWxfZm9ybWF0KSB7CiAgICAgICAgICAgICBTdHJpbmcgcyA9IGNhbWVyYUZvcm1hdEZvclBpeGVsRm9ybWF0KHBpeGVsX2Zvcm1hdCk7CiAgICAgICAgICAgICBpZiAocyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigpOworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiSW52YWxpZCBwaXhlbF9mb3JtYXQ9IiArIHBpeGVsX2Zvcm1hdCk7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIHNldCgicGljdHVyZS1mb3JtYXQiLCBzKTsKKyAgICAgICAgICAgIHNldChLRVlfUElDVFVSRV9GT1JNQVQsIHMpOwogICAgICAgICB9CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFJldHVybnMgdGhlIGltYWdlIGZvcm1hdCBmb3IgcGljdHVyZXMuCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcmV0dXJuIHRoZSBQaXhlbEZvcm1hdCBpbnQgcmVwcmVzZW50aW5nIHRoZSBwaWN0dXJlIGZvcm1hdAogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIGludCBnZXRQaWN0dXJlRm9ybWF0KCkgewotICAgICAgICAgICAgcmV0dXJuIHBpeGVsRm9ybWF0Rm9yQ2FtZXJhRm9ybWF0KGdldCgicGljdHVyZS1mb3JtYXQiKSk7CisgICAgICAgICAgICByZXR1cm4gcGl4ZWxGb3JtYXRGb3JDYW1lcmFGb3JtYXQoZ2V0KEtFWV9QSUNUVVJFX0ZPUk1BVCkpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEdldHMgdGhlIHN1cHBvcnRlZCBwaWN0dXJlIGZvcm1hdHMuCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gYSBMaXN0IG9mIEludGVnZXIgb2JqZWN0cyAodmFsdWVzIGFyZSBQaXhlbEZvcm1hdC5YWFgpLiBudWxsCisgICAgICAgICAqICAgICAgICAgaWYgcGljdHVyZSBzZXR0aW5nIGlzIG5vdCBzdXBwb3J0ZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgTGlzdDxJbnRlZ2VyPiBnZXRTdXBwb3J0ZWRQaWN0dXJlRm9ybWF0cygpIHsKKyAgICAgICAgICAgIFN0cmluZyBzdHIgPSBnZXQoS0VZX1BJQ1RVUkVfU0laRSArIFNVUFBPUlRFRF9WQUxVRVNfU1VGRklYKTsKKyAgICAgICAgICAgIHJldHVybiBzcGxpdEludChzdHIpOwogICAgICAgICB9CiAKICAgICAgICAgcHJpdmF0ZSBTdHJpbmcgY2FtZXJhRm9ybWF0Rm9yUGl4ZWxGb3JtYXQoaW50IHBpeGVsX2Zvcm1hdCkgewogICAgICAgICAgICAgc3dpdGNoKHBpeGVsX2Zvcm1hdCkgewotICAgICAgICAgICAgY2FzZSBQaXhlbEZvcm1hdC5ZQ2JDcl80MjJfU1A6IHJldHVybiAieXV2NDIyc3AiOwotICAgICAgICAgICAgY2FzZSBQaXhlbEZvcm1hdC5ZQ2JDcl80MjBfU1A6IHJldHVybiAieXV2NDIwc3AiOwotICAgICAgICAgICAgY2FzZSBQaXhlbEZvcm1hdC5SR0JfNTY1OiAgICAgIHJldHVybiAicmdiNTY1IjsKLSAgICAgICAgICAgIGNhc2UgUGl4ZWxGb3JtYXQuSlBFRzogICAgICAgICByZXR1cm4gImpwZWciOworICAgICAgICAgICAgY2FzZSBQaXhlbEZvcm1hdC5ZQ2JDcl80MjJfU1A6IHJldHVybiBQSVhFTF9GT1JNQVRfWVVWNDIyU1A7CisgICAgICAgICAgICBjYXNlIFBpeGVsRm9ybWF0LllDYkNyXzQyMF9TUDogcmV0dXJuIFBJWEVMX0ZPUk1BVF9ZVVY0MjBTUDsKKyAgICAgICAgICAgIGNhc2UgUGl4ZWxGb3JtYXQuUkdCXzU2NTogICAgICByZXR1cm4gUElYRUxfRk9STUFUX1JHQjU2NTsKKyAgICAgICAgICAgIGNhc2UgUGl4ZWxGb3JtYXQuSlBFRzogICAgICAgICByZXR1cm4gUElYRUxfRk9STUFUX0pQRUc7CiAgICAgICAgICAgICBkZWZhdWx0OiAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTc2NSwyMSArMTAwMSwzMDkgQEAKICAgICAgICAgICAgIGlmIChmb3JtYXQgPT0gbnVsbCkKICAgICAgICAgICAgICAgICByZXR1cm4gUGl4ZWxGb3JtYXQuVU5LTk9XTjsKIAotICAgICAgICAgICAgaWYgKGZvcm1hdC5lcXVhbHMoInl1djQyMnNwIikpCisgICAgICAgICAgICBpZiAoZm9ybWF0LmVxdWFscyhQSVhFTF9GT1JNQVRfWVVWNDIyU1ApKQogICAgICAgICAgICAgICAgIHJldHVybiBQaXhlbEZvcm1hdC5ZQ2JDcl80MjJfU1A7CiAKLSAgICAgICAgICAgIGlmIChmb3JtYXQuZXF1YWxzKCJ5dXY0MjBzcCIpKQorICAgICAgICAgICAgaWYgKGZvcm1hdC5lcXVhbHMoUElYRUxfRk9STUFUX1lVVjQyMFNQKSkKICAgICAgICAgICAgICAgICByZXR1cm4gUGl4ZWxGb3JtYXQuWUNiQ3JfNDIwX1NQOwogCi0gICAgICAgICAgICBpZiAoZm9ybWF0LmVxdWFscygicmdiNTY1IikpCisgICAgICAgICAgICBpZiAoZm9ybWF0LmVxdWFscyhQSVhFTF9GT1JNQVRfUkdCNTY1KSkKICAgICAgICAgICAgICAgICByZXR1cm4gUGl4ZWxGb3JtYXQuUkdCXzU2NTsKIAotICAgICAgICAgICAgaWYgKGZvcm1hdC5lcXVhbHMoImpwZWciKSkKKyAgICAgICAgICAgIGlmIChmb3JtYXQuZXF1YWxzKFBJWEVMX0ZPUk1BVF9KUEVHKSkKICAgICAgICAgICAgICAgICByZXR1cm4gUGl4ZWxGb3JtYXQuSlBFRzsKIAogICAgICAgICAgICAgcmV0dXJuIFBpeGVsRm9ybWF0LlVOS05PV047CiAgICAgICAgIH0KIAorICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyB0aGUgb3JpZW50YXRpb24gb2YgdGhlIGRldmljZSBpbiBkZWdyZWVzLCB3aGljaCBpbnN0cnVjdHMgdGhlCisgICAgICAgICAqIGNhbWVyYSBkcml2ZXIgdG8gcm90YXRlIHRoZSBwaWN0dXJlIGFuZCB0aHVtYm5haWwsIGluIG9yZGVyIHRvIG1hdGNoCisgICAgICAgICAqIHdoYXQgdGhlIHVzZXIgc2VlcyBmcm9tIH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WUgYW5kcm9pZC52aWV3Lk9yaWVudGF0aW9uRXZlbnRMaXN0ZW5lcgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgc2V0Um90YXRpb24oaW50IHJvdGF0aW9uKSB7CisgICAgICAgICAgICBpZiAocm90YXRpb24gPT0gMCB8fCByb3RhdGlvbiA9PSA5MCB8fCByb3RhdGlvbiA9PSAxODAKKyAgICAgICAgICAgICAgICAgICAgfHwgcm90YXRpb24gPT0gMjcwKSB7CisgICAgICAgICAgICAgICAgc2V0KEtFWV9ST1RBVElPTiwgSW50ZWdlci50b1N0cmluZyhyb3RhdGlvbikpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIkludmFsaWQgcm90YXRpb249IiArIHJvdGF0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXRzIEdQUyBsYXRpdHVkZSBjb29yZGluYXRlLiBUaGlzIHdpbGwgYmUgc3RvcmVkIGluIEpQRUcgRVhJRgorICAgICAgICAgKiBoZWFkZXIuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBsYXRpdHVkZSBHUFMgbGF0aXR1ZGUgY29vcmRpbmF0ZS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEdwc0xhdGl0dWRlKGRvdWJsZSBsYXRpdHVkZSkgeworICAgICAgICAgICAgc2V0KEtFWV9HUFNfTEFUSVRVREUsIERvdWJsZS50b1N0cmluZyhsYXRpdHVkZSkpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNldHMgR1BTIGxvbmdpdHVkZSBjb29yZGluYXRlLiBUaGlzIHdpbGwgYmUgc3RvcmVkIGluIEpQRUcgRVhJRgorICAgICAgICAgKiBoZWFkZXIuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBsb25naXR1ZGUgR1BTIGxvbmdpdHVkZSBjb29yZGluYXRlLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgc2V0R3BzTG9uZ2l0dWRlKGRvdWJsZSBsb25naXR1ZGUpIHsKKyAgICAgICAgICAgIHNldChLRVlfR1BTX0xPTkdJVFVERSwgRG91YmxlLnRvU3RyaW5nKGxvbmdpdHVkZSkpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNldHMgR1BTIGFsdGl0dWRlLiBUaGlzIHdpbGwgYmUgc3RvcmVkIGluIEpQRUcgRVhJRiBoZWFkZXIuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbHRpdHVkZSBHUFMgYWx0aXR1ZGUgaW4gbWV0ZXJzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgc2V0R3BzQWx0aXR1ZGUoZG91YmxlIGFsdGl0dWRlKSB7CisgICAgICAgICAgICBzZXQoS0VZX0dQU19BTFRJVFVERSwgRG91YmxlLnRvU3RyaW5nKGFsdGl0dWRlKSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyBHUFMgdGltZXN0YW1wLiBUaGlzIHdpbGwgYmUgc3RvcmVkIGluIEpQRUcgRVhJRiBoZWFkZXIuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSB0aW1lc3RhbXAgR1BTIHRpbWVzdGFtcCAoVVRDIGluIHNlY29uZHMgc2luY2UgSmFudWFyeSAxLAorICAgICAgICAgKiAgICAgICAgICAgICAgICAgIDE5NzApLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgc2V0R3BzVGltZXN0YW1wKGxvbmcgdGltZXN0YW1wKSB7CisgICAgICAgICAgICBzZXQoS0VZX0dQU19USU1FU1RBTVAsIExvbmcudG9TdHJpbmcodGltZXN0YW1wKSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmVtb3ZlcyBHUFMgbGF0aXR1ZGUsIGxvbmdpdHVkZSwgYWx0aXR1ZGUsIGFuZCB0aW1lc3RhbXAgZnJvbSB0aGUKKyAgICAgICAgICogcGFyYW1ldGVycy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHJlbW92ZUdwc0RhdGEoKSB7CisgICAgICAgICAgICByZW1vdmUoS0VZX0dQU19MQVRJVFVERSk7CisgICAgICAgICAgICByZW1vdmUoS0VZX0dQU19MT05HSVRVREUpOworICAgICAgICAgICAgcmVtb3ZlKEtFWV9HUFNfQUxUSVRVREUpOworICAgICAgICAgICAgcmVtb3ZlKEtFWV9HUFNfVElNRVNUQU1QKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBHZXRzIHRoZSBjdXJyZW50IHdoaXRlIGJhbGFuY2Ugc2V0dGluZy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBvbmUgb2YgV0hJVEVfQkFMQU5DRV9YWFggc3RyaW5nIGNvbnN0YW50LiBudWxsIGlmIHdoaXRlCisgICAgICAgICAqICAgICAgICAgYmFsYW5jZSBzZXR0aW5nIGlzIG5vdCBzdXBwb3J0ZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgU3RyaW5nIGdldFdoaXRlQmFsYW5jZSgpIHsKKyAgICAgICAgICAgIHJldHVybiBnZXQoS0VZX1dISVRFX0JBTEFOQ0UpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNldHMgdGhlIHdoaXRlIGJhbGFuY2UuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSB2YWx1ZSBXSElURV9CQUxBTkNFX1hYWCBzdHJpbmcgY29uc3RhbnQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBzZXRXaGl0ZUJhbGFuY2UoU3RyaW5nIHZhbHVlKSB7CisgICAgICAgICAgICBzZXQoS0VZX1dISVRFX0JBTEFOQ0UsIHZhbHVlKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBHZXRzIHRoZSBzdXBwb3J0ZWQgd2hpdGUgYmFsYW5jZS4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBhIExpc3Qgb2YgV0hJVEVfQkFMQU5DRV9YWFggc3RyaW5nIGNvbnN0YW50cy4gbnVsbCBpZiB3aGl0ZQorICAgICAgICAgKiAgICAgICAgIGJhbGFuY2Ugc2V0dGluZyBpcyBub3Qgc3VwcG9ydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIExpc3Q8U3RyaW5nPiBnZXRTdXBwb3J0ZWRXaGl0ZUJhbGFuY2UoKSB7CisgICAgICAgICAgICBTdHJpbmcgc3RyID0gZ2V0KEtFWV9XSElURV9CQUxBTkNFICsgU1VQUE9SVEVEX1ZBTFVFU19TVUZGSVgpOworICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHN0cik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogR2V0cyB0aGUgY3VycmVudCBjb2xvciBlZmZlY3Qgc2V0dGluZy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBvbmUgb2YgRUZGRUNUX1hYWCBzdHJpbmcgY29uc3RhbnQuIG51bGwgaWYgY29sb3IgZWZmZWN0CisgICAgICAgICAqICAgICAgICAgc2V0dGluZyBpcyBub3Qgc3VwcG9ydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIFN0cmluZyBnZXRDb2xvckVmZmVjdCgpIHsKKyAgICAgICAgICAgIHJldHVybiBnZXQoS0VZX0VGRkVDVCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyB0aGUgY3VycmVudCBjb2xvciBlZmZlY3Qgc2V0dGluZy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHZhbHVlIEVGRkVDVF9YWFggc3RyaW5nIGNvbnN0YW50cy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNldENvbG9yRWZmZWN0KFN0cmluZyB2YWx1ZSkgeworICAgICAgICAgICAgc2V0KEtFWV9FRkZFQ1QsIHZhbHVlKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBHZXRzIHRoZSBzdXBwb3J0ZWQgY29sb3IgZWZmZWN0cy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBhIExpc3Qgb2YgRUZGRUNUX1hYWCBzdHJpbmcgY29uc3RhbnRzLiBudWxsIGlmIGNvbG9yIGVmZmVjdAorICAgICAgICAgKiAgICAgICAgIHNldHRpbmcgaXMgbm90IHN1cHBvcnRlZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBMaXN0PFN0cmluZz4gZ2V0U3VwcG9ydGVkQ29sb3JFZmZlY3RzKCkgeworICAgICAgICAgICAgU3RyaW5nIHN0ciA9IGdldChLRVlfRUZGRUNUICsgU1VQUE9SVEVEX1ZBTFVFU19TVUZGSVgpOworICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHN0cik7CisgICAgICAgIH0KKworCisgICAgICAgIC8qKgorICAgICAgICAgKiBHZXRzIHRoZSBjdXJyZW50IGFudGliYW5kaW5nIHNldHRpbmcuCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gb25lIG9mIEFOVElCQU5ESU5HX1hYWCBzdHJpbmcgY29uc3RhbnQuIG51bGwgaWYgYW50aWJhbmRpbmcKKyAgICAgICAgICogICAgICAgICBzZXR0aW5nIGlzIG5vdCBzdXBwb3J0ZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgU3RyaW5nIGdldEFudGliYW5kaW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIGdldChLRVlfQU5USUJBTkRJTkcpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNldHMgdGhlIGFudGliYW5kaW5nLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gYW50aWJhbmRpbmcgQU5USUJBTkRJTkdfWFhYIHN0cmluZyBjb25zdGFudC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEFudGliYW5kaW5nKFN0cmluZyBhbnRpYmFuZGluZykgeworICAgICAgICAgICAgc2V0KEtFWV9BTlRJQkFORElORywgYW50aWJhbmRpbmcpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEdldHMgdGhlIHN1cHBvcnRlZCBhbnRpYmFuZGluZyB2YWx1ZXMuCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gYSBMaXN0IG9mIEFOVElCQU5ESU5HX1hYWCBzdHJpbmcgY29uc3RhbnRzLiBudWxsIGlmCisgICAgICAgICAqICAgICAgICAgYW50aWJhbmRpbmcgc2V0dGluZyBpcyBub3Qgc3VwcG9ydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIExpc3Q8U3RyaW5nPiBnZXRTdXBwb3J0ZWRBbnRpYmFuZGluZygpIHsKKyAgICAgICAgICAgIFN0cmluZyBzdHIgPSBnZXQoS0VZX0FOVElCQU5ESU5HICsgU1VQUE9SVEVEX1ZBTFVFU19TVUZGSVgpOworICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHN0cik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogR2V0cyB0aGUgY3VycmVudCBzY2VuZSBtb2RlIHNldHRpbmcuCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gb25lIG9mIFNDRU5FX01PREVfWFhYIHN0cmluZyBjb25zdGFudC4gbnVsbCBpZiBzY2VuZSBtb2RlCisgICAgICAgICAqICAgICAgICAgc2V0dGluZyBpcyBub3Qgc3VwcG9ydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIFN0cmluZyBnZXRTY2VuZU1vZGUoKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0KEtFWV9TQ0VORV9NT0RFKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXRzIHRoZSBzY2VuZSBtb2RlLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gdmFsdWUgU0NFTkVfTU9ERV9YWFggc3RyaW5nIGNvbnN0YW50cy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFNjZW5lTW9kZShTdHJpbmcgdmFsdWUpIHsKKyAgICAgICAgICAgIHNldChLRVlfU0NFTkVfTU9ERSwgdmFsdWUpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEdldHMgdGhlIHN1cHBvcnRlZCBzY2VuZSBtb2Rlcy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBhIExpc3Qgb2YgU0NFTkVfTU9ERV9YWFggc3RyaW5nIGNvbnN0YW50LiBudWxsIGlmIHNjZW5lIG1vZGUKKyAgICAgICAgICogICAgICAgICBzZXR0aW5nIGlzIG5vdCBzdXBwb3J0ZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgTGlzdDxTdHJpbmc+IGdldFN1cHBvcnRlZFNjZW5lTW9kZXMoKSB7CisgICAgICAgICAgICBTdHJpbmcgc3RyID0gZ2V0KEtFWV9TQ0VORV9NT0RFICsgU1VQUE9SVEVEX1ZBTFVFU19TVUZGSVgpOworICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHN0cik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogR2V0cyB0aGUgY3VycmVudCBmbGFzaCBtb2RlIHNldHRpbmcuCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gb25lIG9mIEZMQVNIX01PREVfWFhYIHN0cmluZyBjb25zdGFudC4gbnVsbCBpZiBmbGFzaCBtb2RlCisgICAgICAgICAqICAgICAgICAgc2V0dGluZyBpcyBub3Qgc3VwcG9ydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIFN0cmluZyBnZXRGbGFzaE1vZGUoKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0KEtFWV9GTEFTSF9NT0RFKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXRzIHRoZSBmbGFzaCBtb2RlLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gdmFsdWUgRkxBU0hfTU9ERV9YWFggc3RyaW5nIGNvbnN0YW50cy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEZsYXNoTW9kZShTdHJpbmcgdmFsdWUpIHsKKyAgICAgICAgICAgIHNldChLRVlfRkxBU0hfTU9ERSwgdmFsdWUpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEdldHMgdGhlIHN1cHBvcnRlZCBmbGFzaCBtb2Rlcy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHJldHVybiBhIExpc3Qgb2YgRkxBU0hfTU9ERV9YWFggc3RyaW5nIGNvbnN0YW50cy4gbnVsbCBpZiBmbGFzaCBtb2RlCisgICAgICAgICAqICAgICAgICAgc2V0dGluZyBpcyBub3Qgc3VwcG9ydGVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIExpc3Q8U3RyaW5nPiBnZXRTdXBwb3J0ZWRGbGFzaE1vZGVzKCkgeworICAgICAgICAgICAgU3RyaW5nIHN0ciA9IGdldChLRVlfRkxBU0hfTU9ERSArIFNVUFBPUlRFRF9WQUxVRVNfU1VGRklYKTsKKyAgICAgICAgICAgIHJldHVybiBzcGxpdChzdHIpOworICAgICAgICB9CisKKyAgICAgICAgLy8gU3BsaXRzIGEgY29tbWEgZGVsaW1pdGVkIHN0cmluZyB0byBhbiBBcnJheUxpc3Qgb2YgU3RyaW5nLgorICAgICAgICAvLyBSZXR1cm4gbnVsbCBpZiB0aGUgcGFzc2luZyBzdHJpbmcgaXMgbnVsbCBvciB0aGUgc2l6ZSBpcyAwLgorICAgICAgICBwcml2YXRlIEF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SW50ZWdlcj4oKTsKKyAgICAgICAgICAgIHdoaWxlICh0b2tlbml6ZXIuaGFzTW9yZUVsZW1lbnRzKCkpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgdG9rZW4gPSB0b2tlbml6ZXIubmV4dFRva2VuKCk7CisgICAgICAgICAgICAgICAgc3Vic3RyaW5ncy5hZGQoSW50ZWdlci5wYXJzZUludCh0b2tlbikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHN1YnN0cmluZ3Muc2l6ZSgpID09IDApIHJldHVybiBudWxsOworICAgICAgICAgICAgcmV0dXJuIHN1YnN0cmluZ3M7CisgICAgICAgIH0KKworICAgICAgICAvLyBTcGxpdHMgYSBjb21tYSBkZWxpbWl0ZWQgc3RyaW5nIHRvIGFuIEFycmF5TGlzdCBvZiBTaXplLgorICAgICAgICAvLyBSZXR1cm4gbnVsbCBpZiB0aGUgcGFzc2luZyBzdHJpbmcgaXMgbnVsbCBvciB0aGUgc2l6ZSBpcyAwLgorICAgICAgICBwcml2YXRlIEFycmF5TGlzdDxTaXplPiBzcGxpdFNpemUoU3RyaW5nIHN0cikgeworICAgICAgICAgICAgaWYgKHN0ciA9PSBudWxsKSByZXR1cm4gbnVsbDsKKworICAgICAgICAgICAgU3RyaW5nVG9rZW5pemVyIHRva2VuaXplciA9IG5ldyBTdHJpbmdUb2tlbml6ZXIoc3RyLCAiLCIpOworICAgICAgICAgICAgQXJyYXlMaXN0PFNpemU+IHNpemVMaXN0ID0gbmV3IEFycmF5TGlzdDxTaXplPigpOworICAgICAgICAgICAgd2hpbGUgKHRva2VuaXplci5oYXNNb3JlRWxlbWVudHMoKSkgeworICAgICAgICAgICAgICAgIFNpemUgc2l6ZSA9IHN0clRvU2l6ZSh0b2tlbml6ZXIubmV4dFRva2VuKCkpOworICAgICAgICAgICAgICAgIGlmIChzaXplICE9IG51bGwpIHNpemVMaXN0LmFkZChzaXplKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChzaXplTGlzdC5zaXplKCkgPT0gMCkgcmV0dXJuIG51bGw7CisgICAgICAgICAgICByZXR1cm4gc2l6ZUxpc3Q7CisgICAgICAgIH0KKworICAgICAgICAvLyBQYXJzZXMgYSBzdHJpbmcgKGV4OiAiNDgweDMyMCIpIHRvIFNpemUgb2JqZWN0LgorICAgICAgICAvLyBSZXR1cm4gbnVsbCBpZiB0aGUgcGFzc2luZyBzdHJpbmcgaXMgbnVsbC4KKyAgICAgICAgcHJpdmF0ZSBTaXplIHN0clRvU2l6ZShTdHJpbmcgc3RyKSB7CisgICAgICAgICAgICBpZiAoc3RyID09IG51bGwpIHJldHVybiBudWxsOworCisgICAgICAgICAgICBpbnQgcG9zID0gc3RyLmluZGV4T2YoJ3gnKTsKKyAgICAgICAgICAgIGlmIChwb3MgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgd2lkdGggPSBzdHIuc3Vic3RyaW5nKDAsIHBvcyk7CisgICAgICAgICAgICAgICAgU3RyaW5nIGhlaWdodCA9IHN0ci5zdWJzdHJpbmcocG9zICsgMSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTaXplKEludGVnZXIucGFyc2VJbnQod2lkdGgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnBhcnNlSW50KGhlaWdodCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9nLmUoVEFHLCAiSW52YWxpZCBzaXplIHBhcmFtZXRlciBzdHJpbmc9IiArIHN0cik7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQogICAgIH07CiB9CiAKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2hhcmR3YXJlL1NlbnNvckxpc3RlbmVyLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9oYXJkd2FyZS9TZW5zb3JMaXN0ZW5lci5qYXZhCmluZGV4IGNmYTE4NGIuLmM3MWU5NjggMTAwNjQ0Ci0tLS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gPT0gbnVsbCkgeworICAgICAgICBpZiAobURyYXdQZW5kaW5nIHx8IG1CdWZmZXIgPT0gbnVsbCB8fCBtS2V5Ym9hcmRDaGFuZ2VkKSB7CiAgICAgICAgICAgICBvbkJ1ZmZlckRyYXcoKTsKICAgICAgICAgfQogICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChtQnVmZmVyLCAwLCAwLCBudWxsKTsKICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIHZvaWQgb25CdWZmZXJEcmF3KCkgewotICAgICAgICBpZiAobUJ1ZmZlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICBtQnVmZmVyID0gQml0bWFwLmNyZWF0ZUJpdG1hcChnZXRXaWR0aCgpLCBnZXRIZWlnaHQoKSwgQml0bWFwLkNvbmZpZy5BUkdCXzg4ODgpOwotICAgICAgICAgICAgbUNhbnZhcyA9IG5ldyBDYW52YXMobUJ1ZmZlcik7CisgICAgICAgIGlmIChtQnVmZmVyID09IG51bGwgfHwgbUtleWJvYXJkQ2hhbmdlZCkgeworICAgICAgICAgICAgaWYgKG1CdWZmZXIgPT0gbnVsbCB8fCBtS2V5Ym9hcmRDaGFuZ2VkICYmCisgICAgICAgICAgICAgICAgICAgIChtQnVmZmVyLmdldFdpZHRoKCkgIT0gZ2V0V2lkdGgoKSB8fCBtQnVmZmVyLmdldEhlaWdodCgpICE9IGdldEhlaWdodCgpKSkgeworICAgICAgICAgICAgICAgIG1CdWZmZXIgPSBCaXRtYXAuY3JlYXRlQml0bWFwKGdldFdpZHRoKCksIGdldEhlaWdodCgpLCBCaXRtYXAuQ29uZmlnLkFSR0JfODg4OCk7CisgICAgICAgICAgICAgICAgbUNhbnZhcyA9IG5ldyBDYW52YXMobUJ1ZmZlcik7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpbnZhbGlkYXRlQWxsS2V5cygpOworICAgICAgICAgICAgbUtleWJvYXJkQ2hhbmdlZCA9IGZhbHNlOwogICAgICAgICB9CiAgICAgICAgIGZpbmFsIENhbnZhcyBjYW52YXMgPSBtQ2FudmFzOwogICAgICAgICBjYW52YXMuY2xpcFJlY3QobURpcnR5UmVjdCwgT3AuUkVQTEFDRSk7CkBAIC01OTAsNyArNjAzLDYgQEAKICAgICAgICAgZmluYWwgS2V5W10ga2V5cyA9IG1LZXlzOwogICAgICAgICBmaW5hbCBLZXkgaW52YWxpZEtleSA9IG1JbnZhbGlkYXRlZEtleTsKIAotICAgICAgICBwYWludC5zZXRBbHBoYSgyNTUpOwogICAgICAgICBwYWludC5zZXRDb2xvcihtS2V5VGV4dENvbG9yKTsKICAgICAgICAgYm9vbGVhbiBkcmF3U2luZ2xlS2V5ID0gZmFsc2U7CiAgICAgICAgIGlmIChpbnZhbGlkS2V5ICE9IG51bGwgJiYgY2FudmFzLmdldENsaXBCb3VuZHMoY2xpcFJlZ2lvbikpIHsKQEAgLTYxMSw3ICs2MjMsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgaW50W10gZHJhd2FibGVTdGF0ZSA9IGtleS5nZXRDdXJyZW50RHJhd2FibGVTdGF0ZSgpOwogICAgICAgICAgICAga2V5QmFja2dyb3VuZC5zZXRTdGF0ZShkcmF3YWJsZVN0YXRlKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICAvLyBTd2l0Y2ggdGhlIGNoYXJhY3RlciB0byB1cHBlcmNhc2UgaWYgc2hpZnQgaXMgcHJlc3NlZAogICAgICAgICAgICAgU3RyaW5nIGxhYmVsID0ga2V5LmxhYmVsID09IG51bGw/IG51bGwgOiBhZGp1c3RDYXNlKGtleS5sYWJlbCkudG9TdHJpbmcoKTsKICAgICAgICAgICAgIApAQCAtNjgwLDcgKzY5Miw2IEBACiAKICAgICBwcml2YXRlIGludCBnZXRLZXlJbmRpY2VzKGludCB4LCBpbnQgeSwgaW50W10gYWxsS2V5cykgewogICAgICAgICBmaW5hbCBLZXlbXSBrZXlzID0gbUtleXM7Ci0gICAgICAgIGZpbmFsIGJvb2xlYW4gc2hpZn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LmdldFgoKSwgbWUuZ2V0WSgpLCBtZS5nZXRNZXRhU3RhdGUoKSk7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gb25Nb2RpZmllZFRvdWNoRXZlbnQoZG93bik7CisgICAgICAgICAgICAgICAgZG93bi5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgLy8gSWYgaXQncyBhbiB1cCBhY3Rpb24sIHRoZW4gZGVsaXZlciB0aGUgdXAgYXMgd2VsbC4KKyAgICAgICAgICAgICAgICBpZiAobWUuZ2V0QWN0aW9uKCkgPT0gTW90aW9uRXZlbnQuQUNUSU9OX1VQKSB7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IG9uTW9kaWZpZWRUb3VjaEV2ZW50KG1lKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIFNlbmQgYW4gdXAgZXZlbnQgZm9yIHRoZSBsYXN0IHBvaW50ZXIKKyAgICAgICAgICAgICAgICBNb3Rpb25FdmVudCB1cCA9IE1vdGlvbkV2ZW50Lm9idGFpbihub3csIG5vdywgTW90aW9uRXZlbnQuQUNUSU9OX1VQLAorICAgICAgICAgICAgICAgICAgICAgICAgbU9sZFBvaW50ZXJYLCBtT2xkUG9pbnRlclksIG1lLmdldE1ldGFTdGF0ZSgpKTsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBvbk1vZGlmaWVkVG91Y2hFdmVudCh1cCk7CisgICAgICAgICAgICAgICAgdXAucmVjeWNsZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKHBvaW50ZXJDb3VudCA9PSAxKSB7CisgICAgICAgICAgICAgICAgbU9sZFBvaW50ZXJYID0gbWUuZ2V0WCgpOworICAgICAgICAgICAgICAgIG1PbGRQb2ludGVyWSA9IG1lLmdldFkoKTsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBvbk1vZGlmaWVkVG91Y2hFdmVudChtZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIERvbid0IGRvIGFueXRoaW5nIHdoZW4gMiBwb2ludGVycyBhcmUgZG93biBhbmQgbW92aW5nLgorICAgICAgICAgICAgICAgIHJlc3VsdCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbU9sZFBvaW50ZXJDb3VudCA9IHBvaW50ZXJDb3VudDsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gb25Nb2RpZmllZFRvdWNoRXZlbnQoTW90aW9uRXZlbnQgbWUpIHsKICAgICAgICAgaW50IHRvdWNoWCA9IChpbnQpIG1lLmdldFgoKSAtIG1QYWRkaW5nTGVmdDsKICAgICAgICAgaW50IHRvdWNoWSA9IChpbnQpIG1lLmdldFkoKSArIG1WZXJ0aWNhbENvcnJlY3Rpb24gLSBtUGFkZGluZ1RvcDsKICAgICAgICAgaW50IGFjdGlvbiA9IG1lLmdldEFjdGlvbigpOwogICAgICAgICBsb25nIGV2ZW50VGltZSA9IG1lLmdldEV2ZW50VGltZSgpOwogICAgICAgICBpbnQga2V5SW5kZXggPSBnZXRLZXlJbmRpY2VzKHRvdWNoWCwgdG91Y2hZLCBudWxsKTsKLSAgICAgICAgCiAgICAgICAgIGlmIChtR2VzdHVyZURldGVjdG9yLm9uVG91Y2hFdmVudChtZSkpIHsKICAgICAgICAgICAgIHNob3dQcmV2aWV3KE5PVF9BX0tFWSk7CiAgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfUkVQRUFUKTsKLSAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19MT05HUFJFU1MpOyAgICAgICAgICAgIAorICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTVNHX0xPTkdQUkVTUyk7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogICAgICAgICAKQEAgLTEwNzIsNyArMTEyMCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoa2V5SW5kZXggPT0gbUN1cnJlbnRLZXkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudEtleVRpbWUgKz0gZXZlbnRUaW1lIC0gbUxhc3RNb3ZlVGltZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZUxvbmdQcmVzcyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtUmVwZWF0S2V5SW5kZXggPT0gTk9UX0FfS0VZKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzZXRNdWx0aVRhcCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0S2V5ID0gbUN1cnJlbnRLZXk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RDb2RlWCA9IG1MYXN0WDsKQEAgLTEwODMsMTAgKzExMzEsNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50S2V5VGltZSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGtleUluZGV4ICE9IG1SZXBlYXRLZXlJbmRleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTVNHX1JFUEVBVCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUmVwZWF0S2V5SW5kZXggPSBOT1RfQV9LRVk7Ci0gICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKCFjb250aW51ZUxvbmdQcmVzcykgewogICAgICAgICAgICAgICAgICAgICAvLyBDYW5jZWwgb2xkI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bHNlOworICAgICAgICB9CisKKyAgICAgICAgbURuc1Byb3BOYW1lcyA9IG5ldyBTdHJpbmdbXSB7CisgICAgICAgICAgICAgICAgIm5ldC5ybW5ldDAuZG5zMSIsCisgICAgICAgICAgICAgICAgIm5ldC5ybW5ldDAuZG5zMiIsCisgICAgICAgICAgICAgICAgIm5ldC5ldGgwLmRuczEiLAorICAgICAgICAgICAgICAgICJuZXQuZXRoMC5kbnMyIiwKKyAgICAgICAgICAgICAgICAibmV0LmV0aDAuZG5zMyIsCisgICAgICAgICAgICAgICAgIm5ldC5ldGgwLmRuczQiLAorICAgICAgICAgICAgICAgICJuZXQuZ3Bycy5kbnMxIiwKKyAgICAgICAgICAgICAgICAibmV0LmdwcnMuZG5zMiIsCisgICAgICAgICAgICAgICAgIm5ldC5wcHAwLmRuczEiLAorICAgICAgICAgICAgICAgICJuZXQucHBwMC5kbnMyIn07CisKICAgICB9CiAKICAgICAvKioKQEAgLTg2LDEwNSArOTUsMTI4IEBACiAgICAgICAgIGZpbHRlci5hZGRBY3Rpb24oVGVsZXBob255SW50ZW50cy5BQ1RJT05fREFUQV9DT05ORUNUSU9OX0ZBSUxFRCk7CiAgICAgICAgIGZpbHRlci5hZGRBY3Rpb24oVGVsZXBob255SW50ZW50cy5BQ1RJT05fU0VSVklDRV9TVEFURV9DSEFOR0VEKTsKIAotICAgICAgICBJbnRlbnQgaW50ZW50ID0gbUNvbnRleHQucmVnaXN0ZXJSZWNlaXZlcihuZXcgTW9iaWxlRGF0YVN0YXRlUmVjZWl2ZXIoKSwgZmlsdGVyKTsKKyAgICAgICAgbVN0YXRlUmVjZWl2ZXIgPSBuZXcgTW9iaWxlRGF0YVN0YXRlUmVjZWl2ZXIoKTsKKyAgICAgICAgSW50ZW50IGludGVudCA9IG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobVN0YXRlUmVjZWl2ZXIsIGZpbHRlcik7CiAgICAgICAgIGlmIChpbnRlbnQgIT0gbnVsbCkKICAgICAgICAgICAgIG1Nb2JpbGVEYXRhU3RhdGUgPSBnZXRNb2JpbGVEYXRhU3RhdGUoaW50ZW50KTsKICAgICAgICAgZWxzZQogICAgICAgICAgICAgbU1vYmlsZURhdGFTdGF0ZSA9IFBob25lLkRhdGFTdGF0ZS5ESVNDT05ORUNURUQ7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aWMgUGhvbmUuRGF0YVN0YXRlIGdldE1vYmlsZURhdGFTdGF0ZShJbnRlbnQgaW50ZW50KSB7CisgICAgcHJpdmF0ZSBQaG9uZS5EYXRhU3RhdGUgZ2V0TW9iaWxlRGF0YVN0YXRlKEludGVudCBpbnRlbnQpIHsKICAgICAgICAgU3RyaW5nIHN0ciA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5TVEFURV9LRVkpOwotICAgICAgICBpZiAoc3RyICE9IG51bGwpCi0gICAgICAgICAgICByZXR1cm4gRW51bS52YWx1ZU9mKFBob25lLkRhdGFTdGF0ZS5jbGFzcywgc3RyKTsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgcmV0dXJuIFBob25lLkRhdGFTdGF0ZS5ESVNDT05ORUNURUQ7CisgICAgICAgIGlmIChzdHIgIT0gbnVsbCkgeworICAgICAgICAgICAgU3RyaW5nIGFwblR5cGVMaXN0ID0KKyAgICAgICAgICAgICAgICAgICAgaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX1RZUEVTX0tFWSk7CisgICAgICAgICAgICBpZiAoaXNBcG5UeXBlSW5jbHVkZWQoYXBuVHlwZUxpc3QpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVudW0udmFsdWVPZihQaG9uZS5EYXRhU3RhdGUuY2xhc3MsIHN0cik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIFBob25lLkRhdGFTdGF0ZS5ESVNDT05ORUNURUQ7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGlzQXBuVHlwZUluY2x1ZGVkKFN0cmluZyB0eXBlTGlzdCkgeworICAgICAgICAvKiBjb21tYSBzZXBlcmF0ZWQgbGlzdCAtIHNwbGl0IGFuZCBjaGVjayAqLworICAgICAgICBpZiAodHlwZUxpc3QgPT0gbnVsbCkKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKworICAgICAgICBTdHJpbmdbXSBsaXN0ID0gdHlwZUxpc3Quc3BsaXQoIiwiKTsKKyAgICAgICAgZm9yKGludCBpPTA7IGk8IGxpc3QubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuZXF1YWxzKGxpc3RbaV0sIG1BcG5UeXBlKSB8fAorICAgICAgICAgICAgICAgIFRleHRVdGlscy5lcXVhbHMobGlzdFtpXSwgUGhvbmUuQVBOX1RZUEVfQUxMKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKICAgICBwcml2YXRlIGNsYXNzIE1vYmlsZURhdGFTdGF0ZVJlY2VpdmVyIGV4dGVuZHMgQnJvYWRjYXN0UmVjZWl2ZXIgewogICAgICAgICBwdWJsaWMgdm9pZCBvblJlY2VpdmUoQ29udGV4dCBjb250ZXh0LCBJbnRlbnQgaW50ZW50KSB7Ci0gICAgICAgICAgICBpZiAoaW50ZW50LmdldEFjdGlvbigpLmVxdWFscyhUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9BTllfREFUQV9DT05ORUNUSU9OX1NUQVRFX0NIQU5HRUQpKSB7Ci0gICAgICAgICAgICAgICAgUGhvbmUuRGF0YVN0YXRlIHN0YXRlID0gZ2V0TW9iaWxlRGF0YVN0YXRlKGludGVudCk7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5TVEFURV9DSEFOR0VfUkVBU09OX0tFWSk7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIGFwbk5hbWUgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9BUE5fS0VZKTsKLSAgICAgICAgICAgICAgICBib29sZWFuIHVuYXZhaWxhYmxlID0gaW50ZW50LmdldEJvb2xlYW5FeHRyYShQaG9uZS5ORVRXT1JLX1VOQVZBSUxBQkxFX0tFWSwgZmFsc2UpOwotICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIlJlY2VpdmVkICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGJyb2FkY2FzdCAtIHN0YXRlID0gIiArIHN0YXRlCi0gICAgICAgICAgICAgICAgICAgICsgIiwgdW5hdmFpbGFibGUgPSAiICsgdW5hdmFpbGFibGUKLSAgICAgICAgICAgICAgICAgICAgKyAiLCByZWFzb24gPSAiICsgKHJlYXNvbiA9PSBudWxsID8gIih1bnNwZWNpZmllZCkiIDogcmVhc29uKSk7Ci0gICAgICAgICAgICAgICAgbU5ldHdvcmtJbmZvLnNldElzQXZhaWxhYmxlKCF1bmF2YWlsYWJsZSk7Ci0gICAgICAgICAgICAgICAgaWYgKG1Nb2JpbGVEYXRhU3RhdGUgIT0gc3RhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgbU1vYmlsZURhdGFTdGF0ZSA9IHN0YXRlOworICAgICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoaW50ZW50LmdldEFjdGlvbigpLmVxdWFscyhUZWxlcGhvbnlJbnRlbnRzLgorICAgICAgICAgICAgICAgICAgICAgICAgQUNUSU9OX0FOWV9EQVRBX0NPTk5FQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgICAgICAgICAgUGhvbmUuRGF0YVN0YXRlIHN0YXRlID0gZ2V0TW9iaWxlRGF0YVN0YXRlKGludGVudCk7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyByZWFzb24gPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuU1RBVEVfQ0hBTkdFX1JFQVNPTl9LRVkpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXBuTmFtZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0FQTl9LRVkpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXBuVHlwZUxpc3QgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9BUE5fVFlQRVNfS0VZKTsKIAotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVEVEOgotICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkRJU0NPTk5FQ1RFRCwgcmVhc29uLCBhcG5OYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSW50ZXJmYWNlTmFtZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTmV0d29ya1V0aWxzLnJlc2V0Q29ubmVjdGlvbnMobUludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgICAgICAgICBib29sZWFuIHVuYXZhaWxhYmxlID0gaW50ZW50LmdldEJvb2xlYW5FeHRyYShQaG9uZS5ORVRXT1JLX1VOQVZBSUxBQkxFX0tFWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgbUFwblR5cGUgKyAiIFJlY2VpdmVkICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgYnJvYWRjYXN0IC0gc3RhdGUgPSAiICsgc3RhdGUgKyAiLCBvbGRzdGF0ZSA9ICIgKyBtTW9iaWxlRGF0YVN0YXRlICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCB1bmF2YWlsYWJsZSA9ICIgKyB1bmF2YWlsYWJsZSArICIsIHJlYXNvbiA9ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZWFzb24gPT0gbnVsbCA/ICIodW5zcGVjaWZpZWQpIiA6IHJlYXNvbikpOworCisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzQXBuVHlwZUluY2x1ZGVkKGFwblR5cGVMaXN0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IHRoaXMgZXZlbiBpZiB0aGUgYXBuIGlzbid0IEVuYWJsZWQKKyAgICAgICAgICAgICAgICAgICAgICAgIG1OZXR3b3JrSW5mby5zZXRJc0F2YWlsYWJsZSghdW5hdmFpbGFibGUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1FbmFibGVkID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UncmUgbm90IGVuYWJsZWQgYnV0IHRoZSBBUE4gVHlwZSBpcyBzdXBwb3J0ZWQgYnkgdGhpcyBjb25uZWN0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugc2hvdWxkIHJlY29yZCB0aGUgaW50ZXJmYWNlIG5hbWUgaWYgb25lJ3MgcHJvdmlkZWQuICBJZiB0aGUgdXNlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHR1cm5zIG9uIHRoaXMgbmV0d29yayB3ZSB3aWxsIG5lZWQgdGhlIGludGVyZmFjZW5hbWUgYnV0IHdvbid0IGdldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGEgZnJlc2ggY29ubmVjdGVkIG1lc3NhZ2UgLSBUT0RPIGZpeCB0aGlzLi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gUGhvbmUuRGF0YVN0YXRlLkNPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJyZXBsYWNpbmcgb2xkIG1JbnRlcmZhY2VOYW1lICgiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJmYWNlTmFtZSArICIpIHdpdGggIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfSUZBQ0VfTkFNRV9LRVkpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGZvciAiICsgbUFwblR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJmYWNlTmFtZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0lGQUNFX05BTUVfS0VZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiICBkcm9wcGVkIC0gbUVuYWJsZWQgPSBmYWxzZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1EZWZhdWx0R2F0ZXdheUFkZHIgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVElORzoKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5DT05ORUNUSU5HLCByZWFzb24sIGFwbk5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgU1VTUEVOREVEOgotICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLlNVU1BFTkRFRCwgcmVhc29uLCBhcG5OYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfSUZBQ0VfTkFNRV9LRVkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1JbnRlcmZhY2VOYW1lID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJDT05ORUNURUQgZXZlbnQgZGlkIG5vdCBzdXBwbHkgaW50ZXJmYWNlIG5hbWUuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZXR1cERuc1Byb3BlcnRpZXMoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5DT05ORUNURUQsIHJlYXNvbiwgYXBuTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIiAgZHJvcHBlZCAtIHdyb25nIEFwbiIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Nb2JpbGVEYXRhU3RhdGUgIT0gc3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Nb2JpbGVEYXRhU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXNUZWFyZG93blJlcXVlc3RlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGVhcmRvd25SZXF1ZXN0ZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkRJU0NPTk5FQ1RFRCwgcmVhc29uLCBhcG5OYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1JbnRlcmZhY2VOYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5ldHdvcmtVdGlscy5yZXNldENvbm5lY3Rpb25zKG1JbnRlcmZhY2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJjbGVhcmluZyBtSW50ZXJmYWNlTmFtZSBmb3IgIisgbUFwblR5cGUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgYXMgaXQgRElTQ09OTkVDVEVEIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURlZmF1bHRHYXRld2F5QWRkciA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ09OTkVDVElORzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkNPTk5FQ1RJTkcsIHJlYXNvbiwgYXBuTmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU1VTUEVOREVEOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuU1VTUEVOREVELCByZWFzb24sIGFwbk5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPTk5FQ1RFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUludGVyZmFjZU5hbWUgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9JRkFDRV9OQU1FX0tFWSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSW50ZXJmYWNlTmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJDT05ORUNURUQgZXZlbnQgZGlkIG5vdCBzdXBwbHkgaW50ZXJmYWNlIG5hbWUuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkNPTk5FQ1RFRCwgcmVhc29uLCBhcG5OYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGludGVudC5nZXRBY3Rpb24oKS4KKyAgICAgICAgICAgICAgICAgICAgICAgIGVxdWFscyhUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9EQVRBX0NPTk5FQ1RJT05fRkFJTEVEKSkgeworICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmVhc29uID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkZBSUxVUkVfUkVBU09OX0tFWSk7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhcG5OYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX0tFWSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIlJlY2VpdmVkICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKyAiIGJyb2FkY2FzdCIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbiA9PSBudWxsID8gIiIgOiAiKCIgKyByZWFzb24gKyAiKSIpOworICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuRkFJTEVELCByZWFzb24sIGFwbk5hbWUpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoaW50ZW50LmdldEFjdGlvbigpLmVxdWFscyhUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9EQVRBX0NPTk5FQ1RJT05fRkFJTEVEKSkgewotICAgICAgICAgICAgICAgIFN0cmluZyByZWFzb24gPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuRkFJTFVSRV9SRUFTT05fS0VZKTsKLSAgICAgICAgICAgICAgICBTdHJpbmcgYXBuTmFtZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0FQTl9LRVkpOwotICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIlJlY2VpdmVkICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKyAiIGJyb2FkY2FzdCIgKwotICAgICAgICAgICAgICAgICAgICByZWFzb24gPT0gbnVsbCA/ICIiIDogIigiICsgcmVhc29uICsgIikiKTsKLSAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuRkFJTEVELCByZWFzb24sIGFwbk5hbWUpOworICAgICAgICAgICAgICAgIFRlbGVwaG9ueU1hbmFnZXIgdG0gPSBUZWxlcGhvbnlNYW5hZ2VyLmdldERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICBzZXRSb2FtaW5nU3RhdHVzKHRtLmlzTmV0d29ya1JvYW1pbmcoKSk7CisgICAgICAgICAgICAgICAgc2V0U3VidHlwZSh0bS5nZXROZXR3b3JrVHlwZSgpLCB0bS5nZXROZXR3b3JrVHlwZU5hbWUoKSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBUZWxlcGhvbnlNYW5hZ2VyIHRtID0gVGVsZXBob255TWFuYWdlci5nZXREZWZhdWx0KCk7Ci0gICAgICAgICAgICBzZXRSb2FtaW5nU3RhdHVzKHRtLmlzTmV0d29ya1JvYW1pbmcoKSk7Ci0gICAgICAgICAgICBzZXRTdWJ0eXBlKHRtLmdldE5ldHdvcmtUeXBlKCksIHRtLmdldE5ldHdvcmtUeXBlTmFtZSgpKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIE1ha2Ugc3VyZSB0aGF0IHJvdXRlKHMpIGV4aXN0IHRvIHRoZSBjYXJyaWVyIEROUyBzZXJ2ZXIocykuCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgYWRkUHJpdmF0ZVJvdXRlcygpIHsKLSAgICAgICAgaWYgKG1JbnRlcmZhY2VOYW1lICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIGFkZHJTdHJpbmcgOiBtRG5zU2VydmVycykgewotICAgICAgICAgICAgICAgIGludCBhZGRyID0gTmV0d29ya1V0aWxzL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lbGVwaG9ueU1hbmFnZXIuTkVUV09SS19UWVBFX0hTUEE6CisgICAgICAgICAgICBuZXR3b3JrVHlwZVN0ciA9ICJoc3BhIjsKKyAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBjYXNlIFRlbGVwaG9ueU1hbmFnZXIuTkVUV09SS19UWVBFX0NETUE6CiAgICAgICAgICAgICBuZXR3b3JrVHlwZVN0ciA9ICJjZG1hIjsKICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFRlbGVwaG9ueU1hbmFnZXIuTkVUV09SS19UWVBFXzF4UlRUOgorICAgICAgICAgICAgbmV0d29ya1R5cGVTdHIgPSAiMXhydHQiOworICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIGNhc2UgVGVsZXBob255TWFuYWdlci5ORVRXT1JLX1RZUEVfRVZET18wOgogICAgICAgICAgICAgbmV0d29ya1R5cGVTdHIgPSAiZXZkbyI7CiAgICAgICAgICAgICBicmVhazsKQEAgLTI3Myw1NCArMzA4LDUxIEBACiAgICAgICovCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gdGVhcmRvd24oKSB7Ci0gICAgICAgIGdldFBob25lU2VydmljZShmYWxzZSk7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIElmIHRoZSBwaG9uZSBwcm9jZXNzIGhhcyBjcmFzaGVkIGluIHRoZSBwYXN0LCB3ZSdsbCBnZXQgYQotICAgICAgICAgKiBSZW1vdGVFeGNlcHRpb24gYW5kIG5lZWQgdG8gcmUtcmVmZXJlbmNlIHRoZSBzZXJ2aWNlLgotICAgICAgICAgKi8KLSAgICAgICAgZm9yIChpbnQgcmV0cnkgPSAwOyByZXRyeSA8IDI7IHJldHJ5KyspIHsKLSAgICAgICAgICAgIGlmIChtUGhvbmVTZXJ2aWNlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBMb2cudyhUQUcsCi0gICAgICAgICAgICAgICAgICAgICJJZ25vcmluZyBtb2JpbGUgZGF0YSB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AgICAgICAgKi8KLSAgICAgICAgZm9yIChpbnQgcmV0cnkgPSAwOyByZXRyeSA8IDI7IHJldHJ5KyspIHsKLSAgICAgICAgICAgIGlmIChtUGhvbmVTZXJ2aWNlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBMb2cudyhUQUcsCi0gICAgICAgICAgICAgICAgICAgICJJZ25vcmluZyBtb2JpbGUgZGF0YSBjb25uZWN0IHJlcXVlc3QgYmVjYXVzZSBjb3VsZCBub3QgYWNxdWlyZSBQaG9uZVNlcnZpY2UiKTsKKyAgICAgICAgc2V0VGVhcmRvd25SZXF1ZXN0ZWQoZmFsc2UpOworICAgICAgICBzd2l0Y2ggKHNldEVuYWJsZUFwbihtQXBuVHlwZSwgdHJ1ZSkpIHsKKyAgICAgICAgICAgIGNhc2UgUGhvbmUuQVBOX0FMUkVBRFlfQUNUSVZFOgorICAgICAgICAgICAgICAgIG1FbmFibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAvLyBuZWVkIHRvIHNldCBzZWxmIHRvIENPTk5FQ1RJTkcgc28gdGhlIGJlbG93IG1lc3NhZ2UgaXMgaGFuZGxlZC4KKyAgICAgICAgICAgICAgICBtTW9iaWxlRGF0YVN0YXRlID0gUGhvbmUuRGF0YVN0YXRlLkNPTk5FQ1RJTkc7CisgICAgICAgICAgICAgICAgc2V0RGV0YWlsZWRTdGF0ZShEZXRhaWxlZFN0YXRlLkNPTk5FQ1RJTkcsIFBob25lLlJFQVNPTl9BUE5fQ0hBTkdFRCwgbnVsbCk7CisgICAgICAgICAgICAgICAgLy9zZW5kIG91dCBhIGNvbm5lY3RlZCBtZXNzYWdlCisgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoVGVsZXBob255SW50ZW50cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIEFDVElPTl9BTllfREFUQV9DT05ORUNUSU9OX1NUQVRFX0NIQU5HRUQpOworICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5TVEFURV9LRVksIFBob25lLkRhdGFTdGF0ZS5DT05ORUNURUQudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKFBob25lLlNUQVRFX0NIQU5HRV9SRUFTT05fS0VZLCBQaG9uZS5SRUFTT05fQVBOX0NIQU5HRUQpOworICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5EQVRBX0FQTl9UWVBFU19LRVksIG1BcG5UeXBlKTsKKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoUGhvbmUuREFUQV9JRkFDRV9OQU1FX0tFWSwgbUludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5ORVRXT1JLX1VOQVZBSUxBQkxFX0tFWSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGlmIChtU3RhdGVSZWNlaXZlciAhPSBudWxsKSBtU3RhdGVSZWNlaXZlci5vblJlY2VpdmUobUNvbnRleHQsIGludGVudCk7CiAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1QaG9uZVNlcnZpY2UuZW5hYmxlRGF0YUNvbm5lY3Rpdml0eSgpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBpZiAocmV0cnkgPT0gMCkgZ2V0UGhvbmVTZXJ2aWNlKHRydWUpOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSBQaG9uZS5BUE5fUkVRVUVTVF9TVEFSVEVEOgorICAgICAgICAgICAgICAgIG1FbmFibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAvLyBubyBuZWVkIHRvIGRvIGFueXRoaW5nIC0gd2UncmUgYWxyZWFkeSBkdWUgc29tZSBzdGF0dXMgdXBkYXRlIGludGVudHMKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgUGhvbmUuQVBOX1JFUVVFU1RfRkFJTEVEOgorICAgICAgICAgICAgICAgIGlmIChtUGhvbmVTZXJ2aWNlID09IG51bGwgJiYgbUFwblR5cGUgPT0gUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkgeworICAgICAgICAgICAgICAgICAgICAvLyBvbiBzdGFydHVwIHdlIG1heSB0cnkgdG8gdGFsayB0byB0aGUgcGhvbmUgYmVmb3JlIGl0J3MgcmVhZHkKKyAgICAgICAgICAgICAgICAgICAgLy8ganVzdCBsZWF2ZSBtRW5hYmxlZCBhcyBpdCBpcyBmb3IgdGhlIGRlZmF1bHQgYXBuLgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIGVsc2UgZmFsbCB0aHJvdWdoCisgICAgICAgICAgICBjYXNlIFBob25lLkFQTl9UWVBFX05PVF9BVkFJTEFCTEU6CisgICAgICAgICAgICAgICAgbUVuYWJsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgaW4gcmVjb25uZWN0IC0gdW5leHBlY3RlZCByZXNwb25zZS4iKTsKKyAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9Ci0KLSAgICAgICAgTG9nLncoVEFHLCAiRmFpbGVkIHRvIHNldCB1cCBtb2JpbGUgZGF0YSBjb25uZWN0aXZpdHkiKTsKLSAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICByZXR1cm4gbUVuYWJsZWQ7CiAgICAgfQogCiAgICAgLyoqCkBAIC0zNzQsMTQgKzQwNiw3IEBACiAgICAgICogPC91bD4KICAgICAgKi8KICAgIC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ZmVhdHVyZSwgUGhvbmUuRkVBVFVSRV9FTkFCTEVfU1VQTCkpIHsKLSAgICAgICAgICAgIHJldHVybiBzZXRFbmFibGVBcG4oUGhvbmUuQVBOX1RZUEVfU1VQTCwgZmFsc2UpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIC0xOwotICAgICAgICB9CisgICAgICAgIHJldHVybiAtMTsKICAgICB9CiAKICAgICAvKioKQEAgLTQxNSwxMCArNDM0LDExIEBACiAgICAgICovCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gcmVxdWVzdFJvdXRlVG9Ib3N0KGludCBob3N0QWRkcmVzcykgeworICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJSZXF1ZXN0ZWQgaG9zdCByb3V0ZSB0byAiICsgSW50ZWdlci50b0hleFN0cmluZyhob3N0QWRkcmVzcykgKworICAgICAgICAgICAgICAgICAgICAiIGZvciAiICsgbUFwblR5cGUgKyAiKCIgKyBtSW50ZXJmYWNlTmFtZSArICIpIik7CisgICAgICAgIH0KICAgICAgICAgaWYgKG1JbnRlcmZhY2VOYW1lICE9IG51bGwgJiYgaG9zdEFkZHJlc3MgIT0gLTEpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJSZXF1ZXN0ZWQgaG9zdCByb3V0ZSB0byAiICsgSW50ZWdlci50b0hleFN0cmluZyhob3N0QWRkcmVzcykpOwotICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIE5ldHdvcmtVdGlscy5hZGRIb3N0Um91dGUobUludGVyZmFjZU5hbWUsIGhvc3RBZGRyZXNzKSA9PSAwOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwpAQCAtNDMzLDQzICs0NTMsNiBAQAogICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsKICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgc2V0dXBEbnNQcm9wZXJ0aWVzKCkgewotICAgICAgICBtRG5zU2VydmVycy5jbGVhcigpOwotICAgICAgICAvLyBTZXQgdXAgcGVyLXByb2Nlc3MgRE5TIHNlcnZlciBsaXN0IG9uIGJlaGFsZiBvZiB0aGUgTU1TIHByb2Nlc3MKLSAgICAgICAgaW50IGkgPSAxOwotICAgICAgICBpZiAobUludGVyZmFjZU5hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChTdHJpbmcgcHJvcE5hbWUgOiBzRG5zUHJvcE5hbWVzKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHByb3BOYW1lLmluZGV4T2YobUludGVyZmFjZU5hbWUpICE9IC0xKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBwcm9wVmFsID0gU3lzdGVtUHJvcGVydGllcy5nZXQocHJvcE5hbWUpOwotICAgICAgICAgICAgICAgICAgICBpZiAocHJvcFZhbCAhPSBudWxsICYmIHByb3BWYWwubGVuZ3RoKCkgIT0gMCAmJiAhcHJvcFZhbC5lcXVhbHMoIjAuMC4wLjAiKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbURuc1NlcnZlcnMuYWRkKHByb3BWYWwpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1MYXN0Q2FsbGluZ1BpZCAhPSAtMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuc2V0KCJuZXQuZG5zIiAgKyBpICsgIi4iICsgbUxhc3RDYWxsaW5nUGlkLCBwcm9wVmFsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICsraTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoaSA9PSAxKSB7Ci0gICAgICAgICAgICBMb2cuZChUQUcsICJETlMgc2VydmVyIGFkZHJlc3NlcyBhcmUgbm90IGtub3duLiIpOwotICAgICAgICB9IGVsc2UgaWYgKG1MYXN0Q2FsbGluZ1BpZCAhPSAtMSkgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICogQnVtcCB0aGUgcHJvcGVydHkgdGhhdCB0ZWxscyB0aGUgbmFtZSByZXNvbHZlciBsaWJyYXJ5Ci0gICAgICAgICAgICAqIHRvIHJlcmVhZCB0aGUgRE5TIHNlcnZlciBsaXN0IGZyb20gdGhlIHByb3BlcnRpZXMuCi0gICAgICAgICAgICAqLwotICAgICAgICAgICAgU3RyaW5nIHByb3BWYWwgPSBTeXN0ZW1Qcm9wZXJ0aWVzLmdldCgibmV0LmRuc2NoYW5nZSIpOwotICAgICAgICAgICAgaWYgKHByb3BWYWwubGVuZ3RoKCkgIT0gMCkgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGludCBuID0gSW50ZWdlci5wYXJzZUludChwcm9wVmFsKTsKLSAgICAgICAgICAgICAgICAgICAgU3lzdGVtUHJvcGVydGllcy5zZXQoIm5ldC5kbnNjaGFuZ2UiLCAiIiArIChuKzEpKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBtTGFzdENhbGxpbmdQaWQgPSAtMTsKLSAgICB9Ci0KICAgIC8qKgogICAgICAqIEludGVybmFsIG1ldGhvZCBzdXBwb3J0aW5nIHRoZSBFTkFCTEVfTU1TIGZlYXR1cmUuCiAgICAgICogQHBhcmFtIGFwblR5cGUgdGhlIHR5cGUgb2YgQVBOIHRvIGJlIGVuYWJsZWQgb3IgZGlzYWJsZWQgKGUuZy4sIG1tcykKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL25ldC9OZXR3b3JrU3RhdGVUcmFja2VyLmphdmEgYi9jb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YW1lcyB0aGUgbmFtZXMgb2YgdGhlIHN5c3RlbSBwcm9wZXJ0aWVzIHdob3NlIHZhbHVlcwpAQCAtMTEyLDYgKzEyMiw1MCBAQAogICAgICAgICByZXR1cm4gZG5zQWRkcmVzc2VzOwogICAgIH0KIAorICAgIHB1YmxpYyB2b2lkIGFkZFByaXZhdGVEbnNSb3V0ZXMoKSB7CisgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgImFkZFByaXZhdGVEbnNSb3V0ZXMgZm9yICIgKyB0aGlzICsKKyAgICAgICAgICAgICAgICAiKCIgKyBtSW50ZXJmYWNlTmFtZSArICIpIik7CisgICAgICAgIGlmIChtSW50ZXJmYWNlTmFtZSAhPSBudWxsICYmICFtUHJpdmF0ZURuc1JvdXRlU2V0KSB7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBhZGRyU3RyaW5nIDogZ2V0TmFtZVNlcnZlcnMoKSkgeworICAgICAgICAgICAgICAgIGludCBhZGRyID0gTmV0d29ya1V0aWxzLmxvb2t1cEhvc3QoYWRkclN0cmluZyk7CisgICAgICAgICAgICAgICAgaWYgKGFkZHIgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgTmV0d29ya1V0aWxzLmFkZEhvc3RSb3V0ZShtSW50ZXJmYWNlTmFtZSwgYWRkcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgbVByaXZhdGVEbnNSb3V0ZVNldCA9IHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVQcml2YXRlRG5zUm91dGVzKCkgeworICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJyZW1vdmVQcml2YXRlRG5zUm91dGVzIGZvciAiICsgdGhpcyArCisgICAgICAgICAgICAgICAgIigiICsgbUludGVyZmFjZU5hbWUgKyAiKSIpOworICAgICAgICAvLyBUT0RPIC0gd2Ugc2hvdWxkIGRvIHRoaXMgZXhwbGljaXRseSBidXQ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ICAgICAgICAgICAgICAgICAgICBpZiAoSHR0cExvZy5MT0dWKSBIdHRwTG9nLnYoIkNvbm5lY3Rpb25UaHJlYWQ6IFdhaXRpbmcgZm9yIHdvcmsiKTsKICAgICAgICAgICAgICAgICAgICAgbVdhaXRpbmcgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGFydFRocmVhZFRpbWUgIT0gLTEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFRocmVhZFRpbWUgPSBTeXN0ZW1DbG9jawotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmN1cnJlbnRUaHJlYWRUaW1lTWlsbGlzKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBtUmVxdWVzdEZlZWRlci53YWl0KCk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBtV2FpdGluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpZiAobUN1cnJlbnRUaHJlYWRUaW1lICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50VGhyZWFkVGltZSA9IFN5c3RlbUNsb2NrCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jdXJyZW50VGhyZWFkVGltZU1pbGxpcygpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBpZiAoSHR0cExvZy5MT0dWKSBIdHRwTG9nLnYoIkNvbm5lY3Rpb25UaHJlYWQ6IG5ldyByZXF1ZXN0ICIgKwpAQCAtMTIzLDYgKzEzMiwxMiBAQAogICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGl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WxzSWdub3JlQ2FzZShtZXRob2QpKSB7CiAgICAgICAgICAgICBtSHR0cFJlcXVlc3QgPSBuZXcgQmFzaWNIdHRwUmVxdWVzdChtZXRob2QsIGdldFVyaSgpKTsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIG1IdHRwUmVxdWVzdCA9IG5ldyBCYXNpY0h0dHBFbnRpdHlFbmNsb3NpbmdSZXF1ZXN0KAogICAgICAgICAgICAgICAgICAgICBtZXRob2QsIGdldFVyaSgpKTsKLSAgICAgICAgICAgIHNldEJvZHlQcm92aWRlcihib2R5UHJvdmlkZXIsIGJvZHlMZW5ndGgpOworICAgICAgICAgICAgLy8gaXQgaXMgb2sgdG8gaGF2ZSBudWxsIGVudGl0eSBmb3IgQmFzaWNIdHRwRW50aXR5RW5jbG9zaW5nUmVxdWVzdC4KKyAgICAgICAgICAgIC8vIEJ5IHVzaW5nIEJhc2ljSHR0cEVudGl0eUVuY2xvc2luZ1JlcXVlc3QsIGl0IHdpbGwgc2V0IHVwIHRoZQorICAgICAgICAgICAgLy8gY29ycmVjdCBjb250ZW50LWxlbmd0aCwgY29udGVudC10eXBlIGFuZCBjb250ZW50LWVuY29kaW5nLgorICAgICAgICAgICAgaWYgKGJvZHlQcm92aWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgc2V0Qm9keVByb3ZpZGVyKGJvZHlQcm92aWRlciwgYm9keUxlbmd0aCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgYWRkSGVhZGVyKEhPU1RfSEVBREVSLCBnZXRIb3N0UG9ydCgpKTsKIApAQCAtMjU1LDYgKzI1NSw4IEBACiAgICAgICAgICAgICAvLyBwcm9jZXNzIGd6aXAgY29udGVudCBlbmNvZGluZwogICAgICAgICAgICAgSGVhZGVyIGNvbnRlbnRFbmNvZGluZyA9IGVudGl0eS5nZXRDb250ZW50RW5jb2RpbmcoKTsKICAgICAgICAgICAgIElucHV0U3RyZWFtIG5pcyA9IG51bGw7CisgICAgICAgICAgICBieXRlW10gYnVmID0gbnVsbDsKKyAgICAgICAgICAgIGludCBjb3VudCA9IDA7CiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIGlmIChjb250ZW50RW5jb2RpbmcgIT0gbnVsbCAmJgogICAgICAgICAgICAgICAgICAgICBjb250ZW50RW5jb2RpbmcuZ2V0VmFsdWUoKS5lcXVhbHMoImd6aXAiKSkgewpAQCAtMjY1LDkgKzI2Nyw4IEBACiAKICAgICAgICAgICAgICAgICAvKiBhY2N1bXVsYXRlIGVub3VnaCBkYXRhIHRvIG1ha2UgaXQgd29ydGggcHVzaGluZyBpdAogICAgICAgICAgICAgICAgICAqIHVwIHRoZSBzdGFjayAqLwotICAgICAgICAgICAgICAgIGJ5dGVbXSBidWYgPSBtQ29ubmVjdGlvbi5nZXRCdWYoKTsKKyAgICAgICAgICAgICAgICBidWYgPSBtQ29ubmVjdGlvbi5nZXRCdWYoKTsKICAgICAgICAgICAgICAgICBpbnQgbGVuID0gMDsKLSAgICAgICAgICAgICAgICBpbnQgY291bnQgPSAwOwogICAgICAgICAgICAgICAgIGludCBsb3dXYXRlciA9IGJ1Zi5sZW5ndGggLyAyOwogICAgICAgICAgICAgICAgIHdoaWxlIChsZW4gIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICAgbGVuID0gbmlzLnJlYWQoYnVmLCBjb3VudCwgYnVmLmxlbmd0aCAtIGNvdW50KTsKQEAgLTI4NCw2ICsyODUsMTAgQEAKICAgICAgICAgICAgICAgICAvKiBJbmZsYXRlcklucHV0U3RyZWFtIHRocm93cyBhbiBFT0ZFeGNlcHRpb24gd2hlbiB0aGUKICAgICAgICAgICAgICAgICAgICBzZXJ2ZXIgdHJ1bmNhdGVzIGd6aXBwZWQgY29udGVudC4gIEhhbmRsZSB0aGlzIGNhc2UKICAgICAgICAgICAgICAgICAgICBhcyB3ZSBkbyB0cnVuY2F0ZWQgbm9uLWd6aXBwZWQgY29udGVudDogbm8gZXJyb3IgKi8KKyAgICAgICAgICAgICAgICBpZiAoY291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZXJlIGlzIHVuY29tbWl0ZWQgY29udGVudCwgd2Ugc2hvdWxkIGNvbW1pdCB0aGVtCisgICAgICAgICAgICAgICAgICAgIG1FdmVudEhhbmRsZXIuZGF0YShidWYsIGNvdW50KTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKEh0dHBMb2cuTE9HVikgSHR0cExvZy52KCAicmVhZFJlc3BvbnNlKCkgaGFuZGxpbmcgIiArIGUpOwogICAgICAgICAgICAgfSBjYXRjaChJT0V4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgdGhyb3cgaWYgd2UgaGF2ZSBhIG5vbi1PSyBzdGF0dXMgY29kZQpAQCAtMzQ2LDcgKzM1MSw3IEBACiAgICAgICogZm9yIGRlYnVnZ2luZwogICAgICAqLwogICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7Ci0gICAgICAgIHJldHVybiAobUhpZ2hQcmlvcml0eSA/ICJQKiIgOiAiIikgKyBtUGF0aDsKKyAgICAgICAgcmV0dXJuIG1QYXRoOwogICAgIH0KIAogCkBAIC00MTIsOCArNDE3LDcgQEAKICAgICAgICAgfQogICAgICAgICByZXR1cm4gc3RhdHVzID49IEh0dHBTdGF0dXMuU0NfT0sKICAgICAgICAgICAgICYmIHN0YXR1cyAhPSBIdHRwU3RhdHVzLlNDX05PX0NPTlRFTlQKLSAgICAgICAgICAgICYmIHN0YXR1cyAhPSBIdHRwU3RhdHVzLlNDX05PVF9NT0RJRklFRAotICAgICAgICAgICAgJiYgc3RhdHVzICE9IEh0dHBTdGF0dXMuU0NfUkVTRVRfQ09OVEVOVDsKKyAgICAgICAgICAgICYmIHN0YXR1cyAhPSBIdHRwU3RhdHVzLlNDX05PVF9NT0RJRklFRDsKICAgICB9CiAKICAgICAvKioKZGlmZiAtLW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GhyZWFkVGltZSAtIHJ0Lm1TdGFydFRocmVhZFRpbWUpOwotICAgICAgICAgICAgICAgIHJ0Lm1TdGFydFRocmVhZFRpbWUgPSAtMTsKKyAgICAgICAgICAgICAgICBpZiAocnQubUN1cnJlbnRUaHJlYWRUaW1lICE9IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIHRvdGFsVGltZSArPSBydC5tVG90YWxUaHJlYWRUaW1lOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBydC5tQ3VycmVudFRocmVhZFRpbWUgPSAwOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgTG9nLmQoIkh0dHAiLCAiSHR0cCB0aHJlYWQgdXNlZCAiICsgdG90YWxUaW1lICsgIiBtcyAiICsgIiBmb3IgIgogICAgICAgICAgICAgICAgICAgICArIG1Ub3RhbFJlcXVlc3QgKyAiIHJlcXVlc3RzIGFuZCAiICsgbVRvdGFsQ29ubmVjdGlvbgotICAgICAgICAgICAgICAgICAgICArICIgY29ubmVjdGlvbnMiKTsKKyAgICAgICAgICAgICAgICAgICAgKyAiIG5ldyBjb25uZWN0aW9ucyIpOwogICAgICAgICB9CiAKICAgICAgICAgdm9pZCBsb2dTdGF0ZSgpIHsKQEAgLTQzNCwxNiArNDM1LDE0IEBACiAgICAgICogZGF0YS4gIENhbGxiYWNrcyB3aWxsIGJlIG1hZGUgb24gdGhlIHN1cHBsaWVkIGluc3RhbmNlLgogICAgICAqIEBwYXJhbSBib2R5UHJvdmlkZXIgSW5wdXRTdHJlYW0gcHJvdmlkaW5nIEhUVFAgYm9keSwgbnVsbCBpZiBub25lCiAgICAgICogQHBhcmFtIGJvZHlMZW5ndGggbGVuZ3RoIG9mIGJvZHksIG11c3QgYmUgMCBpZiBib2R5UHJvdmlkZXIgaXMgbnVsbAotICAgICAqIEBwYXJhbSBoaWdoUHJpb3JpdHkgSWYgdHJ1ZSwgcXVldWVzIGJlZm9yZSBsb3cgcHJpb3JpdHkKLSAgICAgKiAgICAgcm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YmxpYyBzdGF0aWMgY2xhc3MgTWVtb3J5SW5mbyBpbXBsZW1lbnRzIFBhcmNlbGFibGUgewogICAgICAgICAvKiogVGhlIHByb3BvcnRpb25hbCBzZXQgc2l6ZSBmb3IgZGFsdmlrLiAqLwogICAgICAgICBwdWJsaWMgaW50IGRhbHZpa1BzczsKICAgICAgICAgLyoqIFRoZSBwcml2YXRlIGRpcnR5IHBhZ2VzIHVzZWQgYnkgZGFsdmlrLiAqLwpAQCAtMTI1LDYgKzEyNSw1MCBAQAogICAgICAgICBwdWJsaWMgaW50IG90aGVyUHJpdmF0ZURpcnR5OwogICAgICAgICAvKiogVGhlIHNoYXJlZCBkaXJ0eSBwYWdlcyB1c2VkIGJ5IGV2ZXJ5dGhpbmcgZWxzZS4gKi8KICAgICAgICAgcHVibGljIGludCBvdGhlclNoYXJlZERpcnR5OworICAgICAgICAKKyAgICAgICAgcHVibGljIE1lbW9yeUluZm8oKSB7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgaW50IGRlc2NyaWJlQ29udGVudHMoKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICAgICAgZGVzdC53cml0ZUludChkYWx2aWtQc3MpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChkYWx2aWtQcml2YXRlRGlydHkpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChkYWx2aWtTaGFyZWREaXJ0eSk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KG5hdGl2ZVBzcyk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KG5hdGl2ZVByaXZhdGVEaXJ0eSk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KG5hdGl2ZVNoYXJlZERpcnR5KTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVJbnQob3RoZXJQc3MpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChvdGhlclByaXZhdGVEaXJ0eSk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KG90aGVyU2hhcmVkRGlydHkpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcmVhZEZyb21QYXJjZWwoUGFyY2VsIHNvdXJjZSkgeworICAgICAgICAgICAgZGFsdmlrUHNzID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGRhbHZpa1ByaXZhdGVEaXJ0eSA9IHNvdXJjZS5yZWFkSW50KCk7CisgICAgICAgICAgICBkYWx2aWtTaGFyZWREaXJ0eSA9IHNvdXJjZS5yZWFkSW50KCk7CisgICAgICAgICAgICBuYXRpdmVQc3MgPSBzb3VyY2UucmVhZEludCgpOworICAgICAgICAgICAgbmF0aXZlUHJpdmF0ZURpcnR5ID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIG5hdGl2ZVNoYXJlZERpcnR5ID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIG90aGVyUHNzID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIG90aGVyUHJpdmF0ZURpcnR5ID0gc291cmNlLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIG90aGVyU2hhcmVkRGlydHkgPSBzb3VyY2UucmVhZEludCgpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIENyZWF0b3I8TWVtb3J5SW5mbz4gQ1JFQVRPUiA9IG5ldyBDcmVhdG9yPE1lbW9yeUluZm8+KCkgeworICAgICAgICAgICAgcHVibGljIE1lbW9yeUluZm8gY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgc291cmNlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBNZW1vcnlJbmZvKHNvdXJjZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwdWJsaWMgTWVtb3J5SW5mb1tdIG5ld0FycmF5KGludCBza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aW50IG9mIHJlZmVyZW5jZSBmb3IgYSBwYXJ0aWN1bGFyIGl0ZXJhdGlvbgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNhbXBsZShTdHJpbmcgdGFnLCBsb25nIGRlbHRhKSB7CisgICAgICAgIGxvbmdbXSBhcnJheSA9IGdldEFycmF5KHRhZyk7CisKKyAgICAgICAgLy8gYXJyYXlbbVNhbXBsZVNpemVdIGhvbGRzIHRoZSBudW1iZXIgb2YgdXNlZCBlbnRyaWVzCisgICAgICAgIGZpbmFsIGludCBpbmRleCA9IChpbnQpIGFycmF5W21TYW1wbGVTaXplXSsrOworICAgICAgICBhcnJheVtpbmRleF0gPSBkZWx0YTsKKyAgICAgICAgaWYgKGFycmF5W21TYW1wbGVTaXplXSA9PSBtU2FtcGxlU2l6ZSkgeworICAgICAgICAgICAgbG9uZyB0b3RhbERlbHRhID0gMDsKKyAgICAgICAgICAgIGZvciAobG9uZyBkIDogYXJyYXkpIHsKKyAgICAgICAgICAgICAgICB0b3RhbERlbHRhICs9IGQvbVNjYWxlRmFjdG9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYXJyYXlbbVNhbXBsZVNpemVdID0gMDsKKyAgICAgICAgICAgIExvZy5pKFRBRywgdGFnICsgIiBhdmVyYWdlID0gIiArIHRvdGFsRGVsdGEgLyBtU2FtcGxlU2l6ZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGxvbmdbXSBnZXRBcnJheShTdHJpbmcgdGFnKSB7CisgICAgICAgIGxvbmdbXSBkYXRhID0gc3RvcmUuZ2V0KHRhZyk7CisgICAgICAgIGlmIChkYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZChzdG9yZSkgeworICAgICAgICAgICAgICAgIGRhdGEgPSBzdG9yZS5nZXQodGFnKTsKKyAgICAgICAgICAgICAgICBpZiAoZGF0YSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgbG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1TZXJ2aWNlKENvbnRleHQuUE9XRVJfU0VSVklDRSk7CisgICAgICogaW50IHN1cHBvcnRlZEZsYWdzID0gcG0uZ2V0U3VwcG9ydGVkV2FrZUxvY2tGbGFncygpOworICAgICAqICBib29sZWFuIHByb3hpbWl0eVN1cHBvcnRlZCA9ICgoc3VwcG9ydGVkRmxhZ3MgJiBQb3dlck1hbmFnZXIuUFJPWElNSVRZX1NDUkVFTl9PRkZfV0FLRV9MT0NLKQorICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFBvd2VyTWFuYWdlci5QUk9YSU1JVFlfU0NSRUVOX09GRl9XQUtFX0xPQ0spOworICAgICAqIH0KKyAgICAgKgorICAgICAqIEByZXR1cm4gdGhlIHNldCBvZiBzdXBwb3J0ZWQgV2FrZUxvY2sgZmxhZ3MuCisgICAgICoKKyAgICAgKiB7QGhpZGV9CisgICAgICovCisgICAgcHVibGljIGludCBnZXRTdXBwb3J0ZWRXYWtlTG9ja0ZsYWdzKCkKKyAgICB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0U3VwcG9ydGVkV2FrZUxvY2tGbGFncygpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIFBvd2VyTWFuYWdlcigpCiAgICAgewogICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL29zL1Byb2Nlc3MuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL29zL1Byb2Nlc3MuamF2YQppbmRleCA0ODA1MTkzLi42OTlkZGIyIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9vcy9Qcm9jZXNzLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvb3MvUHJvY2Vzcy5qYXZhCkBAIC03NCw2ICs3NCwxMi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aW5nIGtleSwgaW50IGRlZikgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIEludGVnZXIucGFyc2VJbnQoZ2V0KGtleSkpOwotICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgcmV0dXJuIGRlZjsKKyAgICAgICAgaWYgKGtleS5sZW5ndGgoKSA+IFBST1BfTkFNRV9NQVgpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImtleS5sZW5ndGggPiAiICsgUFJPUF9OQU1FX01BWCk7CiAgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG5hdGl2ZV9nZXRfaW50KGtleSwgZGVmKTsKICAgICB9CiAKICAgICAvKioKQEAgLTgxLDExICs4MywxMCBAQAogICAgICAqIEB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGlmIHRoZSBrZXkgZXhjZWVkcyAzMiBjaGFyYWN0ZXJzCiAgICAgICovCiAgICAgcHVibGljIHN0YXRpYyBsb25nIGdldExvbmcoU3RyaW5nIGtleSwgbG9uZyBkZWYpIHsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBMb25nLnBhcnNlTG9uZyhnZXQoa2V5KSk7Ci0gICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICByZXR1cm4gZGVmOworICAgICAgICBpZiAoa2V5Lmxlbmd0aCgpID4gUFJPUF9OQU1FX01BWCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigia2V5Lmxlbmd0aCA+ICIgKyBQUk9QX05BTUVfTUFYKTsKICAgICAgICAgfQorICAgICAgICByZXR1cm4gbmF0aXZlX2dldF9sb25nKGtleSwgZGVmKTsKICAgICB9CiAKICAgICAvKioKQEAgLTEwMiwyNyArM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vcmVDYXNlKCJ5ZXMiKSB8fAotICAgICAgICAgICAgICAgICAgIHZhbHVlLmVxdWFsc0lnbm9yZUNhc2UoInRydWUiKSB8fAotICAgICAgICAgICAgICAgICAgIHZhbHVlLmVxdWFsc0lnbm9yZUNhc2UoIm9uIikpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICBpZiAoa2V5Lmxlbmd0aCgpID4gUFJPUF9OQU1FX01BWCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigia2V5Lmxlbmd0aCA+ICIgKyBQUk9QX05BTUVfTUFYKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gZGVmOworICAgICAgICByZXR1cm4gbmF0aXZlX2dldF9ib29sZWFuKGtleSwgZGVmKTsKICAgICB9CiAKICAgICAvKioKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL29zL1ZpYnJhdG9yLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9vcy9WaWJyYXRvci5qYXZhCmluZGV4IDBmNzUyODkuLjUxZGNmZjEgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL29zL1ZpYnJhdG9yLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvb3MvVmlicmF0b3IuamF2YQpAQCAtMjQsNiArMjQsNyBAQAogcHVibGljIGNsYXNzIFZpYnJhdG9yCiB7CiAgICAgSUhhcmR3YXJlU2VydmljZSBtU2VydmljZTsKKyAgICBwcml2YXRlIGZpbmFsIEJpbmRlciBtVG9rZW4gPSBuZXcgQmluZGVyKCk7CiAKICAgICAvKiogQGhpZGUgKi8KICAgICBwdWJsaWMgVmlicmF0b3IoKQpAQCAtNDAsNyArNDEsNyBAQAogICAgIHB1YmxpYyB2b2lkIHZpYnJhdGUobG9uZyBtaWxsaXNlY29uZHMpCiAgICAgewogICAgICAgICB0cnkgewotICAgICAgICAgICAgbVNlcnZpY2Uudml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Nvbm5lY3Rpb24pIHsKLSAgICAgICAgICAgIC8vIGlmIHRoZSBjb25uZWN0aW9uIGRvZXMgbm90IGV4aXN0LCBzZWUgaWYgdGhlIAorICAgICAgICAgICAgLy8gaWYgdGhlIGNvbm5lY3Rpb24gZG9lcyBub3QgZXhpc3QsIHNlZSBpZiB0aGUKICAgICAgICAgICAgIC8vIG1DdXJyZW50Q2FsbGVySW5mbyBpcyBhbHNvIG51bGwgdG8gbWF0Y2guCiAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbiA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgImlzRGlmZmVyZW50SW1hZ2VSZXF1ZXN0OiBjb25uZWN0aW9uIGlzIG51bGwiKTsKQEAgLTEzMyw1OCArMTMyLDY1IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gcnVuUXVlcnk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLyoqCi0gICAgICAgICAqIFNpbXBsZSBzZXR0ZXIgZm9yIHRoZSBDYWxsZXJJbmZvIG9iamVjdC4gCisgICAgICAgICAqIFNpbXBsZSBzZXR0ZXIgZm9yIHRoZSBDYWxsZXJJbmZvIG9iamVjdC4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldFBob3RvUmVxdWVzdChDYWxsZXJJbmZvIGNpKSB7Ci0gICAgICAgICAgICBtQ3VycmVudENhbGxlckluZm8gPSBjaTsgCisgICAgICAgICAgICBtQ3VycmVudENhbGxlckluZm8gPSBjaTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICAvKioKLSAgICAgICAgICogQ29udmVuaWVuY2UgbWV0aG9kIHVzZWQgdG8gcmV0cmlldmUgdGhlIFVSSSAKLSAgICAgICAgICogcmVwcmVzZW50aW5nIHRoZSBQaG90byBmaWxlIHJlY29yZGVkIGluIHRoZSBhdHRhY2hlZCAKLSAgICAgICAgICogQ2FsbGVySW5mbyBPYmplY3QuIAorICAgICAgICAgKiBDb252ZW5pZW5jZSBtZXRob2QgdXNlZCB0byByZXRyaWV2ZSB0aGUgVVJJCisgICAgICAgICAqIHJlcHJlc2VudGluZyB0aGUgUGhvdG8gZmlsZSByZWNvcmRlZCBpbiB0aGUgYXR0YWNoZWQKKyAgICAgICAgICogQ2FsbGVySW5mbyBPYmplY3QuCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgVXJpIGdldFBob3RvVXJpKCkgewogICAgICAgICAgICAgaWYgKG1DdXJyZW50Q2FsbGVySW5mbyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKFBlb3BsZS5DT05URU5UX1VSSSwgCisgICAgICAgICAgICAgICAgcmV0dXJuIENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKENvbnRhY3RzLkNPTlRFTlRfVVJJLAogICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRDYWxsZXJJbmZvLnBlcnNvbl9pZCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsgCisgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICAvKioKLSAgICAgICAgICogU2ltcGxlIHNldHRlciBmb3IgdGhlIFBob3RvIHN0YXRlLiAKKyAgICAgICAgICogU2ltcGxlIHNldHRlciBmb3IgdGhlIFBob3RvIHN0YXRlLgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHZvaWQgc2V0UGhvdG9TdGF0ZShpbnQgc3RhdGUpIHsKICAgICAgICAgICAgIGRpc3BsYXlNb2RlID0gc3RhdGU7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLyoqCi0gICAgICAgICAqIFNpbXBsZSBnZXR0ZXIgZm9yIHRoZSBQaG90byBzdGF0ZS4gCisgICAgICAgICAqIFNpbXBsZSBnZXR0ZXIgZm9yIHRoZSBQaG90byBzdGF0ZS4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBpbnQgZ2V0UGhvdG9TdGF0ZSgpIHsKICAgICAgICAgICAgIHJldHVybiBkaXNwbGF5TW9kZTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgotICAgICAqIFRocmVhZCB3b3JrZXIgY2xhc3MgdGhhdCBoYW5kbGVzIHRoZSB0YXNrIG9mIG9wZW5pbmcgdGhlIHN0cmVhbSBhbmQgbG9hZGluZyAKKyAgICAgKiBUaHJlYWQgd29ya2VyIGNsYXNzIHRoYXQgaGFuZGxlcyB0aGUgdGFzayBvZiBvcGVuaW5nIHRoZSBzdHJlYW0gYW5kIGxvYWRpbmcKICAgICAgKiB0aGUgaW1hZ2VzLgogICAgICAqLwogICAgIHByaXZhdGUgY2xhc3MgV29ya2VySGFuZGxlciBleHRlbmRzIEhhbmRsZXIgewogICAgICAgICBwdWJsaWMgV29ya2VySGFuZGxlcihMb29wZXIgbG9vcGVyKSB7CiAgICAgICAgICAgICBzdXBlcihsb29wZXIpOwogICAgICAgICB9Ci0gICAgICAgIAorCisgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CiAgICAgICAgICAgICBXb3JrZXJBcmdzIGFyZ3MgPSAoV29ya2VyQXJncykgbXNnLm9iajsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBzd2l0Y2ggKG1zZy5hcmcxKSB7CiAgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9MT0FEX0lNQUdFOgotICAgICAgICAgICAgICAgICAgICBJbnB1dFN0cmVhbSBpbnB1dFN0cmVhbSA9IENvbnRhY3RzLlBlb3BsZS5vcGVuQ29udGFjdFBob3RvSW5wdXRTdHJlYW0oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJncy5jb250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLCBhcmdzLnVyaSk7CisgICAgICAgICAgICAgICAgICAgIElucHV0U3RyZWFtIGlucHV0U3RyZWFtID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtID0gQ29udGFjdHMub3BlbkNvbnRhY3RQaG90b0lucHV0U3RyZWFtKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdzLmNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksIGFyZ3MudXJpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJFcnJvciBvcGVuaW5nIHBob3RvIGlucHV0IHN0cmVhbSIsIGUpOworICAgICAgICAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0U3RyZWFtICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MucmVzdWx0ID0gRHJhd2FibGUuY3JlYXRlRnJvbVN0cmVhbShpbnB1dFN0cmVhbSwgYXJncy51cmkudG9TdHJpbmcoKSk7CiAKQEAgLTE5MiwyMiArMTk4LDIyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgdG9rZW46ICIgKyBtc2cud2hhdCArICIgaW1hZ2UgVVJJOiAiICsgYXJncy51cmkpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgYXJncy5yZXN1bHQgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgIlByb2JsZW0gd2l0aCBpbWFnZTogIiArIG1zZy5hcmcxICsgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgdG9rZW46ICIgKyBtc2cud2hhdCArICIgaW1hZ2UgVVJJOiAiICsgYXJncy51cmkgKyAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJQcm9ibGVtIHdpdGggaW1hZ2U6ICIgKyBtc2cuYXJnMSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgdG9rZW46ICIgKyBtc2cud2hhdCArICIgaW1hZ2UgVVJJOiAiICsgYXJncy51cmkgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCB1c2luZyBkZWZhdWx0IGltYWdlLiIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8vIHNlbmQgdGhlIHJlcGx5IHRvIHRoZSBlbmNsb3NpbmcgY2xhc3MuIAorCisgICAgICAgICAgICAvLyBzZW5kIHRoZSByZXBseSB0byB0aGUgZW5jbG9zaW5nIGNsYXNzLgogICAgICAgICAgICAgTWVzc2FnZSByZXBseSA9IENvbnRhY3RzQXN5bmNIZWxwZXIudGhpcy5vYnRhaW5NZXNzYWdlKG1zZy53aGF0KTsKICAgICAgICAgICAgIHJlcGx5LmFyZzEgPSBtc2cuYXJnMTsKICAgICAgICAgICAgIHJlcGx5Lm9iaiA9IG1zZy5vYmo7CiAgICAgICAgICAgICByZXBseS5zZW5kVG9UYXJnZXQoKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFByaXZhdGUgY29uc3RydWN0b3IgZm9yIHN0YXRpYyBjbGFzcwogICAgICAqLwpAQCAtMjE2LDE0ICsyMjIsMTQgQEAKICAgICAgICAgdGhyZWFkLnN0YXJ0KCk7CiAgICAgICAgIHNUaHJlYWRIYW5kbGVyID0gbmV3IFdvcmtlckhhbmRsZXIodGhyZWFkLmdldExvb3BlcigpKTsKICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBDb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gICByZXR1cm47CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLy8gQWRkZWQgYWRkaXRpb25hbCBDb29raWUgZmllbGQgaW4gdGhlIGNhbGxlZSB0byBoYW5kbGUgYXJndW1lbnRzCiAgICAgICAgIC8vIHNlbnQgdG8gdGhlIGNhbGxiYWNrIGZ1bmN0aW9uLgotICAgICAgICAKKwogICAgICAgICAvLyBzZXR1cCBhcmd1bWVudHMKICAgICAgICAgV29ya2VyQXJncyBhcmdzID0gbmV3IFdvcmtlckFyZ3MoKTsKICAgICAgICAgYXJncy5jb29raWUgPSBjb29raWU7CkBAIC0yNzAsMTUgKzI3NiwxNSBAQAogICAgICAgICBhcmdzLmRlZmF1bHRSZXNvdXJjZSA9IHBsYWNlaG9sZGVySW1hZ2VSZXNvdXJjZTsKICAgICAgICAgYXJncy5saXN0ZW5lciA9IGxpc3RlbmVyOwogICAgICAgICBhcmdzLmluZm8gPSBpbmZvOwotICAgICAgICAKKwogICAgICAgICAvLyBzZXR1cCBtZXNzYWdlIGFyZ3VtZW50cwogICAgICAgICBNZXNzYWdlIG1zZyA9IHNUaHJlYWRIYW5kbGVyLm9idGFpbk1lc3NhZ2UodG9rZW4pOwogICAgICAgICBtc2cuYXJnMSA9IEVWRU5UX0xPQURfSU1BR0U7CiAgICAgICAgIG1zZy5vYmogPSBhcmdzOwotICAgICAgICAKLSAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgIkJlZ2luIGxvYWRpbmcgaW1hZ2U6ICIgKyBhcmdzLnVyaSArIAorCisgICAgICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJCZWdpbiBsb2FkaW5nIGltYWdlOiAiICsgYXJncy51cmkgKwogICAgICAgICAgICAgICAgICIsIGRpc3BsYXlpbmcgZGVmYXVsdCBpbWFnZSBmb3Igbm93LiIpOwotICAgICAgICAKKwogICAgICAgICAvLyBzZXQgdGhlIGRlZmF1bHQgaW1hZ2UgZmlyc3QsIHdoZW4gdGhlIHF1ZXJ5IGlzIGNvbXBsZXRlLCB3ZSB3aWxsCiAgICAgICAgIC8vIHJlcGxhY2UgdGhlIGltYWdlIHdpdGggdGhlIGNvcnJlY3Qgb25lLgogICAgICAgICBpZiAocGxhY2Vob2xkZXJJbWFnZVJlc291cmNlICE9IC0xKSB7CkBAIC0yODcsMTEgKzI5MywxMSBAQAogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgaW1hZ2VWaWV3LnNldFZpc2liaWxpdHkoVmlldy5JTlZJU0lCTEUpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIC8vIG5vdGlmeSB0aGUgdGhyZWFkIHRvIGJlZ2luIHdvcmtpbmcKICAgICAgICAgc1RocmVhZEhhbmRsZXIuc2VuZE1lc3NhZ2UobXNnKTsKICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBDYWxsZWQgd2hlbiBsb2FkaW5nIGlzIGRvbmUuCiAgICAgICovCkBAIC0zMTYsMjEgKzMyMiwyMSBAQAogICAgICAgICAgICAgICAgICAgICBhcmdzLnZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwogICAgICAgICAgICAgICAgICAgICBhcmdzLnZpZXcuc2V0SW1hZ2VSZXNvdXJjZShhcmdzLmRlZmF1bHRSZXNvdXJjZSk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgLy8gTm90ZSB0aGF0IHRoZSBkYXRhIGlzIGNhY2hlZC4KICAgICAgICAgICAgICAgICBpZiAoYXJncy5pbmZvICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgYXJncy5pbmZvLmlzQ2FjaGVkUGhvdG9DdXJyZW50ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAvLyBub3RpZnkgdGhlIGxpc3RlbmVyIGlmIGl0IGlzIHRoZXJlLgogICAgICAgICAgICAgICAgIGlmIChhcmdzLmxpc3RlbmVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgIk5vdGlmeWluZyBsaXN0ZW5lcjogIiArIGFyZ3MubGlzdGVuZXIudG9TdHJpbmcoKSArIAorICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAiTm90aWZ5aW5nIGxpc3RlbmVyOiAiICsgYXJncy5saXN0ZW5lci50b1N0cmluZygpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGltYWdlOiAiICsgYXJncy51cmkgKyAiIGNvbXBsZXRlZCIpOwogICAgICAgICAgICAgICAgICAgICBhcmdzLmxpc3RlbmVyLm9uSW1hZ2VMb2FkQ29tcGxldGUobXNnLndoYXQsIGFyZ3MuY29va2llLCBhcmdzLnZpZXcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2VQcmVzZW50KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OiAgICAKKyAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgIH0KICAgICB9CiB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9waW0vUmVjdXJyZW5jZVNldC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvcGltL1JlY3VycmVuY2VTZXQuamF2YQppbmRleCAxYTI4N2M4Li5iZDc5MjRhIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9waW0vUmVjdXJyZW5jZVNldC5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3BpbS9SZWN1cnJlbmNlU2V0LmphdmEKQEAgLTIyMyw2ICsyMjMsNyBAQAogICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICB9CiAKKyAgICAvLyBUaGlzIGNhbiBiZSByZW1vdmVkIHdoZW4gdGhlIG9sZCBD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cnVsZVN0ciA9IHZhbHVlcy5nZXRBc1N0cmluZyhDYWxlbmRhci5FdmVudHMuRVhSVUxFKTsKKyAgICAgICAgU3RyaW5nIGV4ZGF0ZVN0ciA9IHZhbHVlcy5nZXRBc1N0cmluZyhDYWxlbmRhci5FdmVudHMuRVhEQVRFKTsKKyAgICAgICAgYm9vbGVhbiBhbGxEYXkgPSB2YWx1ZXMuZ2V0QXNJbnRlZ2VyKENhbGVuZGFyLkV2ZW50cy5BTExfREFZKSA9PSAxOworCisgICAgICAgIGlmICgoZHRzdGFydCA9PSAtMSkgfHwKKyAgICAgICAgICAgIChUZXh0VXRpbHMuaXNFbXB0eShkdXJhdGlvbikpfHwKKyAgICAgICAgICAgICgoVGV4dFV0aWxzLmlzRW1wdHkocnJ1bGVTdHIpKSYmCisgICAgICAgICAgICAgICAgKFRleHRVdGlscy5pc0VtcHR5KHJkYXRlU3RyKSkpKSB7CisgICAgICAgICAgICAgICAgLy8gbm8gcmVjdXJyZW5jZS4KKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBJQ2FsZW5kYXIuUHJvcGVydHkgZHRzdGFydFByb3AgPSBuZXcgSUNhbGVuZGFyLlByb3BlcnR5KCJEVFNUQVJUIik7CisgICAgICAgIFRpbWUgZHRzdGFydFRpbWUgPSBudWxsOworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHR6aWQpKSB7CisgICAgICAgICAgICBpZiAoIWFsbERheSkgeworICAgICAgICAgICAgICAgIGR0c3RhcnRQcm9wLmFkZFBhcmFtZXRlcihuZXcgSUNhbGVuZGFyLlBhcmFtZXRlcigiVFpJRCIsIHR6aWQpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGR0c3RhcnRUaW1lID0gbmV3IFRpbWUodHppZCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyB1c2UgdGhlICJmbG9hdGluZyIgdGltZXpvbmUKKyAgICAgICAgICAgIGR0c3RhcnRUaW1lID0gbmV3IFRpbWUoVGltZS5USU1FWk9ORV9VVEMpOworICAgICAgICB9CisKKyAgICAgICAgZHRzdGFydFRpbWUuc2V0KGR0c3RhcnQpOworICAgICAgICAvLyBtYWtlIHN1cmUgdGhlIHRpbWUgaXMgcHJpbnRlZCBqdXN0IGFzIGEgZGF0ZSwgaWYgYWxsIGRheS4KKyAgICAgICAgLy8gVE9ETzogYW5kcm9pZC5waW0uVGltZSByZWFsbHkgc2hvdWxkIHRha2UgY2FyZSBvZiB0aGlzIGZvciB1cy4KKyAgICAgICAgaWYgKGFsbERheSkgeworICAgICAgICAgICAgZHRzdGFydFByb3AuYWRkUGFyYW1ldGVyKG5ldyBJQ2FsZW5kYXIuUGFyYW1ldGVyKCJWQUxVRSIsICJEQVRFIikpOworICAgICAgICAgICAgZHRzdGFydFRpbWUuYWxsRGF5ID0gdHJ1ZTsKKyAgICAgICAgICAgIGR0c3RhcnRUaW1lLmhvdXIgPSAwOworICAgICAgICAgICAgZHRzdGFydFRpbWUubWludXRlID0gMDsKKyAgICAgICAgICAgIGR0c3RhcnRUaW1lLnNlY29uZCA9IDA7CisgICAgICAgIH0KKworICAgICAgICBkdHN0YXJ0UHJvcC5zZXRWYWx1ZShkdHN0YXJ0VGltZS5mb3JtYXQyNDQ1KCkpOworICAgICAgICBjb21wb25lbnQuYWRkUHJvcGVydHkoZHRzdGFydFByb3ApOworICAgICAgICBJQ2FsZW5kYXIuUHJvcGVydHkgZHVyYXRpb25Qcm9wID0gbmV3IElDYWxlbmRhci5Qcm9wZXJ0eSgiRFVSQVRJT04iKTsKKyAgICAgICAgZHVyYXRpb25Qcm9wLnNldFZhbHVlKGR1cmF0aW9uKTsKKyAgICAgICAgY29tcG9uZW50LmFkZFByb3BlcnR5KGR1cmF0aW9uUHJvcCk7CisKKyAgICAgICAgYWRkUHJvcGVydGllc0ZvclJ1bGVTdHIoY29tcG9uZW50LCAiUlJVTEUiLCBycnVsZVN0cik7CisgICAgICAgIGFkZFByb3BlcnR5Rm9yRGF0ZVN0cihjb21wb25lbnQsICJSREFURSIsIHJkYXRlU3RyKTsKKyAgICAgICAgYWRkUHJvcGVydGllc0ZvclJ1bGVTdHIoY29tcG9uZW50LCAiRVhSVUxFIiwgZXhydWxlU3RyKTsKKyAgICAgICAgYWRkUHJvcGVydHlGb3JEYXRlU3RyKGNvbXBvbmVudCwgIkVYREFURSIsIGV4ZGF0ZVN0cik7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKwogICAgIHByaXZhdGUgc3RhdGljIHZvaWQgYWRkUHJvcGVydGllc0ZvclJ1bGVTdHIoSUNhbGVuZGFyLkNvbXBvbmVudCBjb21wb25lbnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcHJvcGVydHlOYW1lLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJ1bGVTdHIpIHsKQEAgLTM1MSwxMCArNDEwLDE0IEBACiAKICAgICAgICAgVGltZSBlbmQgPSBuZXcgVGltZShlbmRUemlkKTsKICAgICAgICAgZW5kLnBhcnNlKGR0ZW5kUHJvcGVydHkuZ2V0VmFsdWUoKSk7Ci0gICAgICAgIGxvbmcgZHVyYXRpb25NaWxsaXMgPSBlbmQudG9NaWxsaXMoZmFsc2UgLyogdXNlIGlzRHN0ICovKSAKKyAgICAgICAgbG9uZyBkdXJhdGlvbk1pbGxpcyA9IGVuZC50b01pbGxpcyhmYWxzZSAvKiB1c2UgaXNEc3QgKi8pCiAgICAgICAgICAgICAgICAgLSBzdGFydC50b01pbGxpcyhmYWxzZSAvKiB1c2UgaXNEc3QgKi8pOwogICAgICAgICBsb25nIGR1cmF0aW9uU2Vjb25kcyA9IChkdXJhdGlvbk1pbGxpcyAvIDEwMDApOwotICAgICAgICByZXR1cm4gIlAiICsgZHVyYXRpb25TZWNvbmRzICsgIlMiOworICAgICAgICBpZiAo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yBpbgorICAgICAgICAvLyB0aGUgb3JpZ2luYWwgVkNhcmQuCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzUHJpbWFyeTsKKyAgICAgICAgcHVibGljIFBob25lRGF0YShpbnQgdHlwZSwgU3RyaW5nIGRhdGEsIFN0cmluZyBsYWJlbCwgYm9vbGVhbiBpc1ByaW1hcnkpIHsKKyAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7CisgICAgICAgICAgICB0aGlzLmRhdGEgPSBkYXRhOworICAgICAgICAgICAgdGhpcy5sYWJlbCA9IGxhYmVsOworICAgICAgICAgICAgdGhpcy5pc1ByaW1hcnkgPSBpc1ByaW1hcnk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgeworICAgICAgICAgICAgaWYgKG9iaiBpbnN0YW5jZW9mIFBob25lRGF0YSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFBob25lRGF0YSBwaG9uZURhdGEgPSAoUGhvbmVEYXRhKW9iajsKKyAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBwaG9uZURhdGEudHlwZSAmJiBkYXRhLmVxdWFscyhwaG9uZURhdGEuZGF0YSkgJiYKKyAgICAgICAgICAgICAgICAgICAgbGFiZWwuZXF1YWxzKHBob25lRGF0YS5sYWJlbCkgJiYgaXNQcmltYXJ5ID09IHBob25lRGF0YS5pc1ByaW1hcnkpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZm9ybWF0KCJ0eXBlOiAlZCwgZGF0YTogJXMsIGxhYmVsOiAlcywgaXNQcmltYXJ5OiAlcyIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGRhdGEsIGxhYmVsLCBpc1ByaW1hcnkpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQGhpZGUgb25seSBmb3IgdGVzdGluZworICAgICAqLworICAgIHN0YXRpYyBwdWJsaWMgY2xhc3MgRW1haWxEYXRhIHsKKyAgICAgICAgcHVibGljIGZpbmFsIGludCB0eXBlOworICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGRhdGE7CisgICAgICAgIC8vIFVzZWQgb25seSB3aGVuIFRZUEUgaXMgVFlQRV9DVVNUT00uCisgICAgICAgIHB1YmxpYyBmaW5hbCBTdHJpbmcgbGFiZWw7CisgICAgICAgIC8vIGlzUHJpbWFyeSBpcyBjaGFuZ2FibGUgb25seSB3aGVuIHRoZXJlJ3Mgbm8gYXBwcm9wcmlhdGUgb25lIGV4aXN0aW5nIGluCisgICAgICAgIC8vIHRoZSBvcmlnaW5hbCBWQ2FyZC4KKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNQcmltYXJ5OworICAgICAgICBwdWJsaWMgRW1haWxEYXRhKGludCB0eXBlLCBTdHJpbmcgZGF0YSwgU3RyaW5nIGxhYmVsLCBib29sZWFuIGlzUHJpbWFyeSkgeworICAgICAgICAgICAgdGhpcy50eXBlID0gdHlwZTsKKyAgICAgICAgICAgIHRoaXMuZGF0YSA9IGRhdGE7CisgICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7CisgICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3Qgb2JqKSB7CisgICAgICAgICAgICBpZiAob2JqIGluc3RhbmNlb2YgRW1haWxEYXRhKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRW1haWxEYXRhIGVtYWlsRGF0YSA9IChFbWFpbERhdGEpb2JqOworICAgICAgICAgICAgcmV0dXJuICh0eXBlID09IGVtYWlsRGF0YS50eXBlICYmIGRhdGEuZXF1YWxzKGVtYWlsRGF0YS5kYXRhKSAmJgorICAgICAgICAgICAgICAgICAgICBsYWJlbC5lcXVhbHMoZW1haWxEYXRhLmxhYmVsKSAmJiBpc1ByaW1hcnkgPT0gZW1haWxEYXRhLmlzUHJpbWFyeSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIFN0cmluZy5mb3JtYXQoInR5cGU6ICVkLCBkYXRhOiAlcywgbGFiZWw6ICVzLCBpc1ByaW1hcnk6ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgdHlwZSwgZGF0YSwgbGFiZWwsIGlzUHJpbWFyeSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgcHVibGljIGNsYXNzIFBvc3RhbERhdGEgeworICAgICAgICAvLyBEZXRlcm1pbmVkIGJ5IHZDYXJkIHNwZWMuCisgICAgICAgIC8vIFBPIEJveCwgRXh0ZW5kZWQgQWRkciwgU3RyZWV0LCBMb2NhbGl0eSwgUmVnaW9uLCBQb3N0YWwgQ29kZSwgQ291bnRyeSBOYW1lCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFERFJfTUFYX0RBVEFfU0laRSA9IDc7CisgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nW10gZGF0YUFycmF5OworICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIHBvYm94OworICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGV4dGVuZGVkQWRkcmVzczsKKyAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBzdHJlZXQ7CisgICAgICAgIHB1YmxpYyBmaW5hbCBTdHJpbmcgbG9jYWx0eTsKKyAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyByZWdpb247CisgICAgICAgIHB1YmxpYyBmaW5hbCBTdHJpbmcgcG9zdGFsQ29kZTsKKyAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBjb3VudHJ5OworCisgICAgICAgIHB1YmxpYyBmaW5hbCBpbnQgdHlwZTsKKyAgICAgICAgCisgICAgICAgIC8vIFVzZWQgb25seSB3aGVuIHR5cGUgdmFyaWFibGUgaXMgVFlQRV9DVVNUT00uCisgICAgICAgIHB1YmxpYyBmaW5hbCBTdHJpbmcgbGFiZWw7CisKKyAgICAgICAgLy8gaXNQcmltYXJ5IGlzIGNoYW5nYWJsZSBvbmx5IHdoZW4gdGhlcmUncyBubyBhcHByb3ByaWF0ZSBvbmUgZXhpc3RpbmcgaW4KKyAgICAgICAgLy8gdGhlIG9yaWdpbmFsIFZDYXJkLgorICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1ByaW1hcnk7CisgICAgICAgIHB1YmxpYyBQb3N0YWxEYXRhKGludCB0eXBlLCBMaXN0PFN0cmluZz4gcHJvcFZhbHVlTGlzdCwKKyAgICAgICAgICAgICAgICBTdHJpbmcgbGFiZWwsIGJvb2xlYW4gaXNQcmltYXJ5KSB7CisgICAgICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOworICAgICAgICAgICAgZGF0YUFycmF5ID0gbmV3IFN0cmluZ1tBRERSX01BWF9EQVRBX1NJWkVdOworCisgICAgICAgICAgICBpbnQgc2l6ZSA9IHByb3BWYWx1ZUxpc3Quc2l6ZSgpOworICAgICAgICAgICAgaWYgKHNpemUgPiBBRERSX01BWF9EQVRBX1NJWkUpIHsKKyAgICAgICAgICAgICAgICBzaXplID0gQUREUl9NQVhfREFUQV9TSVpFOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBhZHItdmFsdWUgICAgPSAwKjYodGV4dC12YWx1ZSAiOyIpIHRleHQtdmFsdWUKKyAgICAgICAgICAgIC8vICAgICAgICAgICAgICA7IFBPIEJveCwgRXh0ZW5kZWQgQWRkcmVzcywgU3RyZWV0LCBMb2NhbGl0eSwgUmVnaW9uLCBQb3N0YWwKKyAgICAgICAgICAgIC8vICAgICAgICAgICAgICA7IENvZGUsIENvdW50cnkgTmFtZQorICAgICAgICAgICAgLy8KKyAgICAgICAgICAgIC8vIFVzZSBJdGVyYXRvciBhc3N1bWluZyBMaXN0IG1heSBiZSBMaW5rZWRMaXN0LCB0aG91Z2ggYWN0dWFsbHkgaXQgaXMKKyAgICAgICAgICAgIC8vIGFsd2F5cyBBcnJheUxpc3QgaW4gdGhlIGN1cnJlbnQgaW1wbGVtZW50YXRpb24uCisgICAgICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBhZGRyZXNzRWxlbWVudCA6IHByb3BWYWx1ZUxpc3QpIHsKKyAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaV0gPSBhZGRyZXNzRWxlbWVudDsKKyAgICAgICAgICAgICAgICBpZiAoKytpID49IHNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgd2hpbGUgKGkgPCBBRERSX01BWF9EQVRBX1NJWkUpIHsKKyAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaSsrXSA9IG51bGw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRoaXMucG9ib3ggPSBkYXRhQXJyYXlbMF07CisgICAgICAgICAgICB0aGlzLmV4dGVuZGVkQWRkcmVzcyA9IGRhdGFBcnJheVsxXTsKKyAgICAgICAgICAgIHRoaXMuc3RyZWV0ID0gZGF0YUFycmF5WzJdOworICAgICAgICAgICAgdGhpcy5sb2NhbHR5ID0gZGF0YUFycmF5WzNdOworICAgICAgICAgICAgdGhpcy5yZWdpb24gPSBkYXRhQXJyYXlbNF07CisgICAgICAgICAgICB0aGlzLnBvc3RhbENvZGUgPSBkYXRhQXJyYXlbNV07CisgICAgICAgICAgICB0aGlzLmNvdW50cnkgPSBkYXRhQXJyYXlbNl07CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHRoaXMubGFiZWwgPSBsYWJlbDsKKyAgICAgICAgICAgIHRoaXMuaXNQcmltYXJ5ID0gaXNQcmltYXJ5OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvYmopIHsKKyAgICAgICAgICAgIGlmIChvYmogaW5zdGFuY2VvZiBQb3N0YWxEYXRhKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgUG9zdGFsRGF0YSBwb3N0YWxEYXRhID0gKFBvc3RhbERhdGEpb2JqOworICAgICAgICAgICAgcmV0dXJuIChBcnJheXMuZXF1YWxzKGRhdGFBcnJheSwgcG9zdGFsRGF0YS5kYXRhQXJyYXkpICYmIAorICAgICAgICAgICAgICAgICAgICAodHlwZSA9PSBwb3N0YWxEYXRhLnR5cGUgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAodHlwZSA9PSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfQ1VTVE9NID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsYWJlbCA9PSBwb3N0YWxEYXRhLmxhYmVsKSA6IHRydWUpKSAmJgorICAgICAgICAgICAgICAgICAgICAoaXNQcmltYXJ5ID09IHBvc3RhbERhdGEuaXNQcmltYXJ5KSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0Rm9ybWF0dGVkQWRkcmVzcyhpbnQgdmNhcmRUeXBlKSB7CisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgYm9vbGVhbiBlbXB0eSA9IHRydWU7CisgICAgICAgICAgICBpZiAoVkNhcmRDb25maWcuaXNKYXBhbmVzZURldmljZSh2Y2FyZFR5cGUpKSB7CisgICAgICAgICAgICAgICAgLy8gSW4gSmFwYW4sIHRoZSBvcmRlciBpcyByZXZlcnNlZC4KKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gQUREUl9NQVhfREFUQV9TSVpFIC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGFkZHJlc3NQYXJ0ID0gZGF0YUFycmF5W2ldOworICAgICAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGFkZHJlc3NQYXJ0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlbXB0eSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCcgJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChhZGRyZXNzUGFydCk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbXB0eSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IEFERFJfTUFYX0RBVEFfU0laRTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhZGRyZXNzUGFydCA9IGRhdGFBcnJheVtpXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShhZGRyZXNzUGFydCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoYWRkcmVzc1BhcnQpOworICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKS50cmltKCk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIFN0cmluZy5mb3JtYXQoInR5cGU6ICVkLCBsYWJlbDogJXMsIGlzUHJpbWFyeTogJXMiLAorICAgICAgICAgICAgICAgICAgICB0eXBlLCBsYWJlbCwgaXNQcmltYXJ5KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAaGlkZSBvbmx5IGZvciB0ZXN0aW5nLgorICAgICAqLworICAgIHN0YXRpYyBwdWJsaWMgY2xhc3MgT3JnYW5pemF0aW9uRGF0YSB7CisgICAgICAgIHB1YmxpYyBmaW5hbCBpbnQgdHlwZTsKKyAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBjb21wYW55TmFtZTsKKyAgICAgICAgLy8gY2FuIGJlIGNoYW5nZWQgaW4gc29tZSBWQ2FyZCBmb3JtYXQuIAorICAgICAgICBwdWJsaWMgU3RyaW5nIHBvc2l0aW9uTmFtZTsKKyAgICAgICAgLy8gaXNQcmltYXJ5IGlzIGNoYW5nYWJsZSBvbmx5IHdoZW4gdGhlcmUncyBubyBhcHByb3ByaWF0ZSBvbmUgZXhpc3RpbmcgaW4KKyAgICAgICAgLy8gdGhlIG9yaWdpbmFsIFZDYXJkLgorICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1ByaW1hcnk7CisgICAgICAgIHB1YmxpYyBPcmdhbml6YXRpb25EYXRhKGludCB0eXBlLCBTdHJpbmcgY29tcGFueU5hbWUsIFN0cmluZyBwb3NpdGlvbk5hbWUsCisgICAgICAgICAgICAgICAgYm9vbGVhbiBpc1ByaW1hcnkpIHsKKyAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7CisgICAgICAgICAgICB0aGlzLmNvbXBhbnlOYW1lID0gY29tcGFueU5hbWU7CisgICAgICAgICAgICB0aGlzLnBvc2l0aW9uTmFtZSA9IHBvc2l0aW9uTmFtZTsKKyAgICAgICAgICAgIHRoaXMuaXNQcmltYXJ5ID0gaXNQcmltYXJ5OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvYmopIHsKKyAgICAgICAgICAgIGlmIChvYmogaW5zdGFuY2VvZiBPcmdhbml6YXRpb25EYXRhKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgT3JnYW5pemF0aW9uRGF0YSBvcmdhbml6YXRpb24gPSAoT3JnYW5pemF0aW9uRGF0YSlvYmo7CisgICAgICAgICAgICByZXR1cm4gKHR5cGUgPT0gb3JnYW5pemF0aW9uLnR5cGUgJiYgY29tcGFueU5hbWUuZXF1YWxzKG9yZ2FuaXphdGlvbi5jb21wYW55TmFtZSkgJiYKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb25OYW1lLmVxdWFscyhvcmdhbml6YXRpb24ucG9zaXRpb25OYW1lKSAmJgorICAgICAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPT0gb3JnYW5pemF0aW9uLmlzUHJpbWFyeSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIFN0cmluZy5mb3JtYXQoInR5cGU6ICVkLCBjb21wYW55OiAlcywgcG9zaXRpb246ICVzLCBpc1ByaW1hcnk6ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgdHlwZSwgY29tcGFueU5hbWUsIHBvc2l0aW9uTmFtZSwgaXNQcmltYXJ5KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBzdGF0aWMgcHVibGljIGNsYXNzIEltRGF0YSB7CisgICAgICAgIHB1YmxpYyBmaW5hbCBpbnQgdHlwZTsKKyAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBkYXRhOworICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGxhYmVsOworICAgICAgICBwdWJsaWMgZmluYWwgYm9vbGVhbiBpc1ByaW1hcnk7CisgICAgICAgIAorICAgICAgICAvLyBUT0RPOiBDb250YWN0c0NvbnN0YW50I1BST1RPQ09MLCBDb250YWN0c0NvbnN0YW50I0NVU1RPTV9QUk9UT0NPTCBzaG91bGQgYmUgdXNlZD8KKyAgICAgICAgcHVibGljIEltRGF0YShpbnQgdHlwZSwgU3RyaW5nIGRhdGEsIFN0cmluZyBsYWJlbCwgYm9vbGVhbiBpc1ByaW1hcnkpIHsKKyAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7CisgICAgICAgICAgICB0aGlzLmRhdGEgPSBkYXRhOworICAgICAgICAgICAgdGhpcy5sYWJlbCA9IGxhYmVsOworICAgICAgICAgICAgdGhpcy5pc1ByaW1hcnkgPSBpc1ByaW1hcnk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgeworICAgICAgICAgICAgaWYgKG9iaiBpbnN0YW5jZW9mIEltRGF0YSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEltRGF0YSBpbURhdGEgPSAoSW1EYXRhKW9iajsKKyAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBpbURhdGEudHlwZSAmJiBkYXRhLmVxdWFscyhpbURhdGEuZGF0YSkgJiYKKyAgICAgICAgICAgICAgICAgICAgbGFiZWwuZXF1YWxzKGltRGF0YS5sYWJlbCkgJiYgaXNQcmltYXJ5ID09IGltRGF0YS5pc1ByaW1hcnkpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZm9ybWF0KCJ0eXBlOiAlZCwgZGF0YTogJXMsIGxhYmVsOiAlcywgaXNQcmltYXJ5OiAlcyIsCisgICAgICAgICAgICAgICAgICAgIHR5cGUsIGRhdGEsIGxhYmVsLCBpc1ByaW1hcnkpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIEBoaWRlIG9ubHkgZm9yIHRlc3RpbmcuCisgICAgICovCisgICAgc3RhdGljIHB1YmxpYyBjbGFzcyBQaG90b0RhdGEgeworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGT1JNQVRfRkxBU0ggPSAiU1dGIjsKKyAgICAgICAgcHVibGljIGZpbmFsIGludCB0eXBlOworICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGZvcm1hdE5hbWU7ICAvLyB1c2VkIHdoZW4gdHlwZSBpcyBub3QgZGVmaW5lZCBpbiBDb250YWN0c0NvbnRyYWN0LgorICAgICAgICBwdWJsaWMgZmluYWwgYnl0ZVtdIHBob3RvQnl0ZXM7CisKKyAgICAgICAgcHVibGljIFBob3RvRGF0YShpbnQgdHlwZSwgU3RyaW5nIGZvcm1hdE5hbWUsIGJ5dGVbXSBwaG90b0J5dGVzKSB7CisgICAgICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOworICAgICAgICAgICAgdGhpcy5mb3JtYXROYW1lID0gZm9ybWF0TmFtZTsKKyAgICAgICAgICAgIHRoaXMucGhvdG9CeXRlcyA9IHBob3RvQnl0ZXM7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgc3RhdGljIC8qIHBhY2thZ2UgKi8gY2xhc3MgUHJvcGVydHkgeworICAgICAgICBwcml2YXRlIFN0cmluZyBtUHJvcGVydHlOYW1lOworICAgICAgICBwcml2YXRlIE1hcDxTdHJpbmcsIENvbGxlY3Rpb248U3RyaW5nPj4gbVBhcmFtZXRlck1hcCA9CisgICAgICAgICAgICBuZXcgSGFzaE1hcDxTdHJpbmcsIENvbGxlY3Rpb248U3RyaW5nPj4oKTsKKyAgICAgICAgcHJpdmF0ZSBMaXN0PFN0cmluZz4gbVByb3BlcnR5VmFsdWVMaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgIHByaXZhdGUgYnl0ZVtdIG1Qcm9wZXJ0eUJ5dGVzOworICAgICAgICAKKyAgICAgICAgcHVibGljIFByb3BlcnR5KCkgeworICAgICAgICAgICAgY2xlYXIoKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIHZvaWQgc2V0UHJvcGVydHlOYW1lKGZpbmFsIFN0cmluZyBwcm9wZXJ0eU5hbWUpIHsKKyAgICAgICAgICAgIG1Qcm9wZXJ0eU5hbWUgPSBwcm9wZXJ0eU5hbWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZFBhcmFtZXRlcihmaW5hbCBTdHJpbmcgcGFyYW1OYW1lLCBmaW5hbCBTdHJpbmcgcGFyYW1WYWx1ZSkgeworICAgICAgICAgICAgQ29sbGVjdGlvbjxTdHJpbmc+IHZhbHVlczsKKyAgICAgICAgICAgIGlmICghbVBhcmFtZXRlck1hcC5jb250YWluc0tleShwYXJhbU5hbWUpKSB7CisgICAgICAgICAgICAgICAgaWYgKHBhcmFtTmFtZS5lcXVhbHMoIlRZUEUiKSkgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZXMgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICA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dChTdHJpbmcgZ2l2ZW5OYW1lLAorICAgICAgICAgICAgU3RyaW5nIGZhbWlseU5hbWUsCisgICAgICAgICAgICBTdHJpbmcgbWlkZGxlTmFtZSwKKyAgICAgICAgICAgIFN0cmluZyBwcmVmaXgsCisgICAgICAgICAgICBTdHJpbmcgc3VmZml4LAorICAgICAgICAgICAgU3RyaW5nIHBob25ldGljR2l2ZW5OYW1lLAorICAgICAgICAgICAgU3RyaW5nIHBoZW5ldGljRmFtaWx5TmFtZSwKKyAgICAgICAgICAgIFN0cmluZyBwaG9uZXRpY01pZGRsZU5hbWUsCisgICAgICAgICAgICBMaXN0PGJ5dGVbXT4gcGhvdG9CeXRlc0xpc3QsCisgICAgICAgICAgICBMaXN0PFN0cmluZz4gbm90ZXMsCisgICAgICAgICAgICBMaXN0PFBob25lRGF0YT4gcGhvbmVMaXN0LCAKKyAgICAgICAgICAgIExpc3Q8RW1haWxEYXRhPiBlbWFpbExpc3QsCisgICAgICAgICAgICBMaXN0PFBvc3RhbERhdGE+IHBvc3RhbExpc3QsCisgICAgICAgICAgICBMaXN0PE9yZ2FuaXphdGlvbkRhdGE+IG9yZ2FuaXphdGlvbkxpc3QsCisgICAgICAgICAgICBMaXN0PFBob3RvRGF0YT4gcGhvdG9MaXN0LAorICAgICAgICAgICAgTGlzdDxTdHJpbmc+IHdlYnNpdGVMaXN0KSB7CisgICAgICAgIHRoaXMoVkNhcmRDb25maWcuVkNBUkRfVFlQRV9ERUZBVUxUKTsKKyAgICAgICAgbUdpdmVuTmFtZSA9IGdpdmVuTmFtZTsKKyAgICAgICAgbUZhbWlseU5hbWUgPSBmYW1pbHlOYW1lOworICAgICAgICBtUHJlZml4ID0gcHJlZml4OworICAgICAgICBtU3VmZml4ID0gc3VmZml4OworICAgICAgICBtUGhvbmV0aWNHaXZlbk5hbWUgPSBnaXZlbk5hbWU7CisgICAgICAgIG1QaG9uZXRpY0ZhbWlseU5hbWUgPSBmYW1pbHlOYW1lOworICAgICAgICBtUGhvbmV0aWNNaWRkbGVOYW1lID0gbWlkZGxlTmFtZTsKKyAgICAgICAgbUVtYWlsTGlzdCA9IGVtYWlsTGlzdDsKKyAgICAgICAgbVBvc3RhbExpc3QgPSBwb3N0YWxMaXN0OworICAgICAgICBtT3JnYW5pemF0aW9uTGlzdCA9IG9yZ2FuaXphdGlvbkxpc3Q7CisgICAgICAgIG1QaG90b0xpc3QgPSBwaG90b0xpc3Q7CisgICAgICAgIG1XZWJzaXRlTGlzdCA9IHdlYnNpdGVMaXN0OworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAaGlkZSBvbmx5IGZvciB0ZXN0aW5nLgorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCBMaXN0PFBob3RvRGF0YT4gZ2V0UGhvdG9MaXN0KCkgeworICAgICAgICByZXR1cm4gbVBob3RvTGlzdDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQGhpZGUgb25seSBmb3IgdGVzdGluZy4KKyAgICAgKi8KKyAgICBwdWJsaWMgZmluYWwgTGlzdDxTdHJpbmc+IGdldE5vdGVzKCkgeworICAgICAgICByZXR1cm4gbU5vdGVMaXN0OworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAaGlkZSBvbmx5IGZvciB0ZXN0aW5nLgorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCBMaXN0PFBob25lRGF0YT4gZ2V0UGhvbmVMaXN0KCkgeworICAgICAgICByZXR1cm4gbVBob25lTGlzdDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQGhpZGUgb25seSBmb3IgdGVzdGluZy4KKyAgICAgKi8KKyAgICBwdWJsaWMgZmluYWwgTGlzdDxFbWFpbERhdGE+IGdldEVtYWlsTGlzdCgpIHsKKyAgICAgICAgcmV0dXJuIG1FbWFpbExpc3Q7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIEBoaWRlIG9ubHkgZm9yIHRlc3RpbmcuCisgICAgICovCisgICAgcHVibGljIGZpbmFsIExpc3Q8UG9zdGFsRGF0YT4gZ2V0UG9zdGFsTGlzdCgpIHsKKyAgICAgICAgcmV0dXJuIG1Qb3N0YWxMaXN0OworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAaGlkZSBvbmx5IGZvciB0ZXN0aW5nLgorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCBMaXN0PE9yZ2FuaXphdGlvbkRhdGE+IGdldE9yZ2FuaXphdGlvbkxpc3QoKSB7CisgICAgICAgIHJldHVybiBtT3JnYW5pemF0aW9uTGlzdDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQWRkIGEgcGhvbmUgaW5mbyB0byBwaG9uZUxpc3QuCisgICAgICogQHBhcmFtIGRhdGEgcGhvbmUgbnVtYmVyCisgICAgICogQHBhcmFtIHR5cGUgdHlwZSBjb2wgb2YgY29udGVudDovL2NvbnRhY3RzL3Bob25lcworICAgICAqIEBwYXJhbSBsYWJlbCBsYWJsZSBjb2wgb2YgY29udGVudDovL2NvbnRhY3RzL3Bob25lcworICAgICAqLworICAgIHByaXZhdGUgdm9pZCBhZGRQaG9uZShpbnQgdHlwZSwgU3RyaW5nIGRhdGEsIFN0cmluZyBsYWJlbCwgYm9vbGVhbiBpc1ByaW1hcnkpeworICAgICAgICBpZiAobVBob25lTGlzdCA9PSBudWxsKSB7CisgICAgICAgICAgICBtUGhvbmVMaXN0ID0gbmV3IEFycmF5TGlzdDxQaG9uZURhdGE+KCk7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgU3RyaW5nIHRyaW1lZCA9IGRhdGEudHJpbSgpOworICAgICAgICBpbnQgbGVuZ3RoID0gdHJpbWVkLmxlbmd0aCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBjaGFyIGNoID0gdHJpbWVkLmNoYXJBdChpKTsKKyAgICAgICAgICAgIGlmICgoJzAnIDw9IGNoICYmIGNoIDw9ICc5JykgfHwgKGkgPT0gMCAmJiBjaCA9PSAnKycpKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgUGhvbmVEYXRhIHBob25lRGF0YSA9IG5ldyBQaG9uZURhdGEodHlwZSwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmZvcm1hdE51bWJlcihidWlsZGVyLnRvU3RyaW5nKCkpLAorICAgICAgICAgICAgICAgIGxhYmVsLCBpc1ByaW1hcnkpOworCisgICAgICAgIG1QaG9uZUxpc3QuYWRkKHBob25lRGF0YSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGFkZE5pY2tOYW1lKGZpbmFsIFN0cmluZyBuaWNrTmFtZSkgeworICAgICAgICBpZiAobU5pY2tOYW1lTGlzdCA9PSBudWxsKSB7CisgICAgICAgICAgICBtTmlja05hbWVMaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgIH0KKyAgICAgICAgbU5pY2tOYW1lTGlzdC5hZGQobmlja05hbWUpOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHZvaWQgYWRkRW1haWwoaW50IHR5cGUsIFN0cmluZyBkYXRhLCBTdHJpbmcgbGFiZWwsIGJvb2xlYW4gaXNQcmltYXJ5KXsKKyAgICAgICAgaWYgKG1FbWFpbExpc3QgPT0gbnVsbCkgeworICAgICAgICAgICAgbUVtYWlsTGlzdCA9IG5ldyBBcnJheUxpc3Q8RW1haWxEYXRhPigpOworICAgICAgICB9CisgICAgICAgIG1FbWFpbExpc3QuYWRkKG5ldyBFbWFpbERhdGEodHlwZSwgZGF0YSwgbGFiZWwsIGlzUHJpbWFyeSkpOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHZvaWQgYWRkUG9zdGFsKGludCB0eXBlLCBMaXN0PFN0cmluZ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lbXMpIHsKKyAgICAgICAgLy8gRmFtaWx5LCBHaXZlbiwgTWlkZGxlLCBQcmVmaXgsIFN1ZmZpeC4gKDEgLSA1KQorICAgICAgICBpbnQgc2l6ZTsKKyAgICAgICAgaWYgKGVsZW1zID09IG51bGwgfHwgKHNpemUgPSBlbGVtcy5zaXplKCkpIDwgMSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChzaXplID4gNSkgeworICAgICAgICAgICAgc2l6ZSA9IDU7CisgICAgICAgIH0KKworICAgICAgICBzd2l0Y2ggKHNpemUpIHsKKyAgICAgICAgLy8gZmFsbHRocm91Z2gKKyAgICAgICAgY2FzZSA1OgorICAgICAgICAgICAgbVN1ZmZpeCA9IGVsZW1zLmdldCg0KTsKKyAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgbVByZWZpeCA9IGVsZW1zLmdldCgzKTsKKyAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgbU1pZGRsZU5hbWUgPSBlbGVtcy5nZXQoMik7CisgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgIG1HaXZlbk5hbWUgPSBlbGVtcy5nZXQoMSk7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBtRmFtaWx5TmFtZSA9IGVsZW1zLmdldCgwKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBTb21lIEphcGFuZXNlIG1vYmlsZSBwaG9uZXMgdXNlIHRoaXMgZmllbGQgZm9yIHBob25ldGljIG5hbWUsCisgICAgICogIHNpbmNlIHZDYXJkIDIuMSBkb2VzIG5vdCBoYXZlICJTT1JULVNUUklORyIgdHlwZS4KKyAgICAgKiBBbHNvLCBpbiBzb21lIGNhc2VzLCB0aGUgZmllbGQgaGFzIHNvbWUgJzsncyBpbiBpdC4KKyAgICAgKiBBc3N1bWUgdGhlICc7JyBtZWFucyB0aGUgc2FtZSBtZWFuaW5nIGluIE4gcHJvcGVydHkKKyAgICAgKi8KKyAgICBAU3VwcHJlc3NXYXJuaW5ncygiZmFsbHRocm91Z2giKQorICAgIHByaXZhdGUgdm9pZCBoYW5kbGVQaG9uZXRpY05hbWVGcm9tU291bmQoTGlzdDxTdHJpbmc+IGVsZW1zKSB7CisgICAgICAgIC8vIEZhbWlseSwgR2l2ZW4sIE1pZGRsZS4gKDEtMykKKyAgICAgICAgLy8gVGhpcyBpcyBub3QgZnJvbSBzcGVjaWZpY2F0aW9uIGJ1dCBtZXJlIGFzc3VtcHRpb24uIFNvbWUgSmFwYW5lc2UgcGhvbmVzIHVzZSB0aGlzIG9yZGVyLgorICAgICAgICBpbnQgc2l6ZTsKKyAgICAgICAgaWYgKGVsZW1zID09IG51bGwgfHwgKHNpemUgPSBlbGVtcy5zaXplKCkpIDwgMSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChzaXplID4gMykgeworICAgICAgICAgICAgc2l6ZSA9IDM7CisgICAgICAgIH0KKworICAgICAgICBzd2l0Y2ggKHNpemUpIHsKKyAgICAgICAgLy8gZmFsbHRocm91Z2gKKyAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgbVBob25ldGljTWlkZGxlTmFtZSA9IGVsZW1zLmdldCgyKTsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgbVBob25ldGljR2l2ZW5OYW1lID0gZWxlbXMuZ2V0KDEpOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgbVBob25ldGljRmFtaWx5TmFtZSA9IGVsZW1zLmdldCgwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZFByb3BlcnR5KFByb3BlcnR5IHByb3BlcnR5KSB7CisgICAgICAgIFN0cmluZyBwcm9wTmFtZSA9IHByb3BlcnR5Lm1Qcm9wZXJ0eU5hbWU7CisgICAgICAgIGZpbmFsIE1hcDxTdHJpbmcsIENvbGxlY3Rpb248U3RyaW5nPj4gcGFyYW1NYXAgPSBwc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GlzdCk7CisgICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKCJTT1JULVNUUklORyIpKSB7CisgICAgICAgICAgICBtUGhvbmV0aWNGdWxsTmFtZSA9IHByb3BWYWx1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChwcm9wTmFtZS5lcXVhbHMoIk5JQ0tOQU1FIikgfHwgcHJvcE5hbWUuZXF1YWxzKCJYLU5JQ0tOQU1FIikpIHsKKyAgICAgICAgICAgIGFkZE5pY2tOYW1lKHByb3BWYWx1ZSk7CisgICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKCJTT1VORCIpKSB7CisgICAgICAgICAgICBpZiAoQ29uc3RhbnRzLkFUVFJfVFlQRV9YX0lSTUNfTi5lcXVhbHMocGFyYW1NYXAuZ2V0KENvbnN0YW50cy5BVFRSX1RZUEUpKSkgeworICAgICAgICAgICAgICAgIGhhbmRsZVBob25ldGljTmFtZUZyb21Tb3VuZChwcm9wVmFsdWVMaXN0KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gSWdub3JlIHRoaXMgZmllbGQgc2luY2UgQW5kcm9pZCBjYW5ub3QgdW5kZXJzdGFuZCB3aGF0IGl0IGlzLgorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKHByb3BOYW1lLmVxdWFscygiQURSIikpIHsKKyAgICAgICAgICAgIGJvb2xlYW4gdmFsdWVzQXJlQWxsRW1wdHkgPSB0cnVlOworICAgICAgICAgICAgZm9yIChTdHJpbmcgdmFsdWUgOiBwcm9wVmFsdWVMaXN0KSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZXNBcmVBbGxFbXB0eSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodmFsdWVzQXJlQWxsRW1wdHkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCB0eXBlID0gLTE7CisgICAgICAgICAgICBTdHJpbmcgbGFiZWwgPSAiIjsKKyAgICAgICAgICAgIGJvb2xlYW4gaXNQcmltYXJ5ID0gZmFsc2U7CisgICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoQ29uc3RhbnRzLkFUVFJfVFlQRSk7CisgICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlQ29sbGVjdGlvbikgeworICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHMoQ29uc3RhbnRzLkFUVFJfVFlQRV9QUkVGKSAmJiAhbVByZWZJc1NldF9BZGRyZXNzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IGZpcnN0ICJQUkVGIiBpcyBjb25zaWRlcmVkLgorICAgICAgICAgICAgICAgICAgICAgICAgbVByZWZJc1NldF9BZGRyZXNzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoQ29uc3RhbnRzLkFUVFJfVFlQRV9IT01FKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9IT01FOworICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhDb25zdGFudHMuQVRUUl9UWVBFX1dPUkspIHx8IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcuZXF1YWxzSWdub3JlQ2FzZSgiQ09NUEFOWSIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyAiQ09NUEFOWSIgc2VlbXMgZW1pdHRlZCBieSBXaW5kb3dzIE1vYmlsZSwgd2hpY2ggaXMgbm90CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBzcGVjaWZpY2FsbHkgc3VwcG9ydGVkIGJ5IHZDYXJkIDIuMS4gV2UgYXNzdW1lIHRoaXMgaXMgc2FtZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYXMgIldPUksiLgorICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9XT1JLOworICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscygiUEFSQ0VMIikgfHwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZVN0cmluZy5lcXVhbHMoIkRPTSIpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZVN0cmluZy5lcXVhbHMoIklOVEwiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZG8gbm90IGhhdmUgYW55IGFwcHJvcHJpYXRlIHdheSB0byBzdG9yZSB0aGlzIGluZm9ybWF0aW9uLgorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuc3RhcnRzV2l0aCgiWC0iKSAmJiB0eXBlIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZDYXJkIDMuMCBhbGxvd3MgaWFuYS10b2tlbi4gQWxzbyBzb21lIHZDYXJkIDIuMSBleHBvcnRlcnMKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVtaXQgbm9uLXN0YW5kYXJkIHR5cGVzLiBXZSBkbyBub3QgaGFuZGxlIHRoZWlyIHZhbHVlcyBub3cuCisgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFdlIHVzZSAiSE9NRSIgYXMgZGVmYXVsdAorICAgICAgICAgICAgaWYgKHR5cGUgPCAwKSB7CisgICAgICAgICAgICAgICAgdHlwZSA9IFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9IT01FOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBhZGRQb3N0YWwodHlwZSwgcHJvcFZhbHVlTGlzdCwgbGFiZWwsIGlzUHJpbWFyeSk7CisgICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKCJFTUFJTCIpKSB7CisgICAgICAgICAgICBpbnQgdHlwZSA9IC0xOworICAgICAgICAgICAgU3RyaW5nIGxhYmVsID0gbnVsbDsKKyAgICAgICAgICAgIGJvb2xlYW4gaXNQcmltYXJ5ID0gZmFsc2U7CisgICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoQ29uc3RhbnRzLkFUVFJfVFlQRSk7CisgICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlQ29sbGVjdGlvbikgeworICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHMoQ29uc3RhbnRzLkFUVFJfVFlQRV9QUkVGKSAmJiAhbVByZWZJc1NldF9FbWFpbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gT25seSBmaXJzdCAiUFJFRiIgaXMgY29uc2lkZXJlZC4KKyAgICAgICAgICAgICAgICAgICAgICAgIG1QcmVmSXNTZXRfRW1haWwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhDb25zdGFudHMuQVRUUl9UWVBFX0hPTUUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9IT01FOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKENvbnN0YW50cy5BVFRSX1RZUEVfV09SSykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBFbWFpbC5UWVBFX1dPUks7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoQ29uc3RhbnRzLkFUVFJfVFlQRV9DRUxMKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IEVtYWlsLlRZUEVfTU9CSUxFOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuc3RhcnRzV2l0aCgiWC0iKSAmJiB0eXBlIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZDYXJkIDMuMCBhbGxvd3MgaWFuYS10b2tlbi4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIG1heSBoYXZlIElOVEVSTkVUIChzcGVjaWZpZWQgaW4gdkNhcmQgc3BlYyksCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBTQ0hPT0wsIGV0Yy4KKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBFbWFpbC5UWVBFX0NVU1RPTTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICh0eXBlIDwgMCkgeworICAgICAgICAgICAgICAgIHR5cGUgPSBFbWFpbC5UWVBFX09USEVSOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYWRkRW1haWwodHlwZSwgcHJvcFZhbHVlLCBsYWJlbCwgaXNQcmltYXJ5KTsKKyAgICAgICAgfSBlbHNlIGlmIChwcm9wTmFtZS5lcXVhbHMoIk9SRyIpKSB7CisgICAgICAgICAgICAvLyB2Q2FyZCBzcGVjaWZpY2F0aW9uIGRvZXMgbm90IHNwZWNpZnkgb3RoZXIgdHlwZXMuCisgICAgICAgICAgICBpbnQgdHlwZSA9IE9yZ2FuaXphdGlvbi5UWVBFX1dPUks7CisgICAgICAgICAgICBib29sZWFuIGlzUHJpbWFyeSA9IGZhbHNlOworICAgICAgICAgICAgCisgICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoQ29uc3RhbnRzLkFUVFJfVFlQRSk7CisgICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlQ29sbGVjdGlvbikgeworICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHMoQ29uc3RhbnRzLkFUVFJfVFlQRV9QUkVGKSAmJiAhbVByZWZJc1NldF9Pcmdhbml6YXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZDYXJkIHNwZWNpZmljYXRpb24gb2ZmaWNpYWxseSBkb2VzIG5vdCBoYXZlIFBSRUYgaW4gT1JHLgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyBqdXN0IGZvciBzYWZldHkuCisgICAgICAgICAgICAgICAgICAgICAgICBtUHJlZklzU2V0X09yZ2FuaXphdGlvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgZm9yIChJdGVyYXRvcjxTdHJpbmc+IGl0ZXIgPSBwcm9wVmFsdWVMaXN0Lml0ZXJhdG9yKCk7IGl0ZXIuaGFzTmV4dCgpOykgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGl0ZXIubmV4dCgpKTsKKyAgICAgICAgICAgICAgICBpZiAoaXRlci5oYXNOZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhZGRPcmdhbml6YXRpb24odHlwZSwgYnVpbGRlci50b1N0cmluZygpLCAiIiwgaXNQcmltYXJ5KTsKKyAgICAgICAgfSBlbHNlIGlmIChwcm9wTmFtZS5lcXVhbHMoIlRJVExFIikpIHsKKyAgIC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gcGFyYW1NYXAuZ2V0KENvbnN0YW50cy5BVFRSX1RZUEUpOworICAgICAgICAgICAgT2JqZWN0IHR5cGVPYmplY3QgPSBWQ2FyZFV0aWxzLmdldFBob25lVHlwZUZyb21TdHJpbmdzKHR5cGVDb2xsZWN0aW9uKTsKKyAgICAgICAgICAgIGZpbmFsIGludCB0eXBlOworICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhYmVsOworICAgICAgICAgICAgaWYgKHR5cGVPYmplY3QgaW5zdGFuY2VvZiBJbnRlZ2VyKSB7CisgICAgICAgICAgICAgICAgdHlwZSA9IChJbnRlZ2VyKXR5cGVPYmplY3Q7CisgICAgICAgICAgICAgICAgbGFiZWwgPSBudWxsOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9DVVNUT007CisgICAgICAgICAgICAgICAgbGFiZWwgPSB0eXBlT2JqZWN0LnRvU3RyaW5nKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5OworICAgICAgICAgICAgaWYgKCFtUHJlZklzU2V0X1Bob25lICYmIHR5cGVDb2xsZWN0aW9uICE9IG51bGwgJiYKKyAgICAgICAgICAgICAgICAgICAgdHlwZUNvbGxlY3Rpb24uY29udGFpbnMoQ29uc3RhbnRzLkFUVFJfVFlQRV9QUkVGKSkgeworICAgICAgICAgICAgICAgIG1QcmVmSXNTZXRfUGhvbmUgPSB0cnVlOworICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYWRkUGhvbmUodHlwZSwgcHJvcFZhbHVlLCBsYWJlbCwgaXNQcmltYXJ5KTsKKyAgICAgICAgfSBlbHNlIGlmIChwcm9wTmFtZS5lcXVhbHMoQ29uc3RhbnRzLlBST1BFUlRZX1hfU0tZUEVfUFNUTk5VTUJFUikpIHsKKyAgICAgICAgICAgIC8vIFRoZSBwaG9uZSBudW1iZXIgYXZhaWxhYmxlIHZpYSBTa3lwZS4KKyAgICAgICAgICAgIENvbGxlY3Rpb248U3RyaW5nPiB0eXBlQ29sbGVjdGlvbiA9IHBhcmFtTWFwLmdldChDb25zdGFudHMuQVRUUl9UWVBFKTsKKyAgICAgICAgICAgIC8vIFhYWDogc2hvdWxkIHVzZSBUWVBFX0NVU1RPTSArIHRoZSBsYWJlbCAiU2t5cGUiPyAod2hpY2ggbWF5IG5lZWQgbG9jYWxpemF0aW9uKQorICAgICAgICAgICAgaW50IHR5cGUgPSBQaG9uZS5UWVBFX09USEVSOworICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhYmVsID0gbnVsbDsKKyAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5OworICAgICAgICAgICAgaWYgKCFtUHJlZklzU2V0X1Bob25lICYmIHR5cGVDb2xsZWN0aW9uICE9IG51bGwgJiYKKyAgICAgICAgICAgICAgICAgICAgdHlwZUNvbGxlY3Rpb24uY29udGFpbnMoQ29uc3RhbnRzLkFUVFJfVFlQRV9QUkVGKSkgeworICAgICAgICAgICAgICAgIG1QcmVmSXNTZXRfUGhvbmUgPSB0cnVlOworICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYWRkUGhvbmUodHlwZSwgcHJvcFZhbHVlLCBsYWJlbCwgaXNQcmltYXJ5KTsKKyAgICAgICAgfSBlbHNlIGlmIChzSW1NYXAuY29udGFpbnNLZXkocHJvcE5hbWUpKXsKKyAgICAgICAgICAgIGludCB0eXBlID0gc0ltTWFwLmdldChwcm9wTmFtZSk7CisgICAgICAgICAgICBib29sZWFuIGlzUHJpbWFyeSA9IGZhbHNlOworICAgICAgICAgICAgZmluYWwgQ29sbGVjdGlvbjxTdHJpbmc+IHR5cGVDb2xsZWN0aW9uID0gcGFyYW1NYXAuZ2V0KENvbnN0YW50cy5BVFRSX1RZUEUpOworICAgICAgICAgICAgaWYgKHR5cGVDb2xsZWN0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB0eXBlU3RyaW5nIDogdHlwZUNvbGxlY3Rpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKENvbnN0YW50cy5BVFRSX1RZUEVfUFJFRikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHNJZ25vcmVDYXNlKENvbnN0YW50cy5BVFRSX1RZUEVfSE9NRSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX0hPTUU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHNJZ25vcmVDYXNlKENvbnN0YW50cy5BVFRSX1RZUEVfV09SSykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX1dPUks7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodHlwZSA8IDApIHsKKyAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9IT01FOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYWRkSW0odHlwZSwgcHJvcFZhbHVlLCBudWxsLCBpc1ByaW1hcnkpOworICAgICAgICB9IGVsc2UgaWYgKHByb3BOYW1lLmVxdWFscygiTk9URSIpKSB7CisgICAgICAgICAgICBhZGROb3RlKHByb3B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XIgZm9yIHRoZSBwcm9kdWN0IHRoYXQgY3JlYXRlZAorICAgICAgICAgICAgLy8gdGhlIHZDYXJkIG9iamVjdC4qLworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVW5rbm93biBYLSB3b3JkcyBhbmQgSUFOQSB0b2tlbi4KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgU3RyaW5nIGdldERpc3BsYXlOYW1lKCkgeworICAgICAgICBpZiAobURpc3BsYXlOYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgIGNvbnN0cnVjdERpc3BsYXlOYW1lKCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1EaXNwbGF5TmFtZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb25zdHJ1Y3QgdGhlIGRpc3BsYXkgbmFtZS4gVGhlIGNvbnN0cnVjdGVkIGRhdGEgbXVzdCBub3QgYmUgbnVsbC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgY29uc3RydWN0RGlzcGxheU5hbWUoKSB7CisgICAgICAgIGlmICghKFRleHRVdGlscy5pc0VtcHR5KG1GYW1pbHlOYW1lKSAmJiBUZXh0VXRpbHMuaXNFbXB0eShtR2l2ZW5OYW1lKSkpIHsKKyAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICBMaXN0PFN0cmluZz4gbmFtZUxpc3Q7CisgICAgICAgICAgICBzd2l0Y2ggKFZDYXJkQ29uZmlnLmdldE5hbWVPcmRlclR5cGUobVZDYXJkVHlwZSkpIHsKKyAgICAgICAgICAgIGNhc2UgVkNhcmRDb25maWcuTkFNRV9PUkRFUl9KQVBBTkVTRToKKyAgICAgICAgICAgICAgICBpZiAoVkNhcmRVdGlscy5jb250YWluc09ubHlBc2NpaShtRmFtaWx5TmFtZSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QXNjaWkobUdpdmVuTmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgbmFtZUxpc3QgPSBBcnJheXMuYXNMaXN0KG1QcmVmaXgsIG1HaXZlbk5hbWUsIG1NaWRkbGVOYW1lLCBtRmFtaWx5TmFtZSwgbVN1ZmZpeCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbmFtZUxpc3QgPSBBcnJheXMuYXNMaXN0KG1QcmVmaXgsIG1GYW1pbHlOYW1lLCBtTWlkZGxlTmFtZSwgbUdpdmVuTmFtZSwgbVN1ZmZpeCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBWQ2FyZENvbmZpZy5OQU1FX09SREVSX0VVUk9QRToKKyAgICAgICAgICAgICAgICBuYW1lTGlzdCA9IEFycmF5cy5hc0xpc3QobVByZWZpeCwgbU1pZGRsZU5hbWUsIG1HaXZlbk5hbWUsIG1GYW1pbHlOYW1lLCBtU3VmZml4KTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgbmFtZUxpc3QgPSBBcnJheXMuYXNMaXN0KG1QcmVmaXgsIG1HaXZlbk5hbWUsIG1NaWRkbGVOYW1lLCBtRmFtaWx5TmFtZSwgbVN1ZmZpeCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBib29sZWFuIGZpcnN0ID0gdHJ1ZTsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIG5hbWVQYXJ0IDogbmFtZUxpc3QpIHsKKyAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KG5hbWVQYXJ0KSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG5hbWVQYXJ0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRGlzcGxheU5hbWUgPSBidWlsZGVyLnRvU3RyaW5nKCk7CisgICAgICAgIH0gZWxzZSBpZiAoIVRleHRVdGlscy5pc0VtcHR5KG1GdWxsTmFtZSkpIHsKKyAgICAgICAgICAgIG1EaXNwbGF5TmFtZSA9IG1GdWxsTmFtZTsKKyAgICAgICAgfSBlbHNlIGlmICghKFRleHRVdGlscy5pc0VtcHR5KG1QaG9uZXRpY0ZhbWlseU5hbWUpICYmCisgICAgICAgICAgICAgICAgVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljR2l2ZW5OYW1lKSkpIHsKKyAgICAgICAgICAgIG1EaXNwbGF5TmFtZSA9IFZDYXJkVXRpbHMuY29uc3RydWN0TmFtZUZyb21FbGVtZW50cyhtVkNhcmRUeXBlLAorICAgICAgICAgICAgICAgICAgICBtUGhvbmV0aWNGYW1pbHlOYW1lLCBtUGhvbmV0aWNNaWRkbGVOYW1lLCBtUGhvbmV0aWNHaXZlbk5hbWUpOworICAgICAgICB9IGVsc2UgaWYgKG1FbWFpbExpc3QgIT0gbnVsbCAmJiBtRW1haWxMaXN0LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIG1EaXNwbGF5TmFtZSA9IG1FbWFpbExpc3QuZ2V0KDApLmRhdGE7CisgICAgICAgIH0gZWxzZSBpZiAobVBob25lTGlzdCAhPSBudWxsICYmIG1QaG9uZUxpc3Quc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgbURpc3BsYXlOYW1lID0gbVBob25lTGlzdC5nZXQoMCkuZGF0YTsKKyAgICAgICAgfSBlbHNlIGlmIChtUG9zdGFsTGlzdCAhPSBudWxsICYmIG1Qb3N0YWxMaXN0LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIG1EaXNwbGF5TmFtZSA9IG1Qb3N0YWxMaXN0LmdldCgwKS5nZXRGb3JtYXR0ZWRBZGRyZXNzKG1WQ2FyZFR5cGUpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1EaXNwbGF5TmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICBtRGlzcGxheU5hbWUgPSAiIjsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBDb25zb2xpZGF0ZSBzZXZlcmFsIGZpZWxzZHMgKGxpa2UgbU5hbWUpIHVzaW5nIG5hbWUgY2FuZGlkYXRlcywgCisgICAgICovCisgICAgcHVibGljIHZvaWQgY29uc29saWRhdGVGaWVsZHMoKSB7CisgICAgICAgIGNvbnN0cnVjdERpc3BsYXlOYW1lKCk7CisgICAgICAgIAorICAgICAgICBpZiAobVBob25ldGljRnVsbE5hbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgbVBob25ldGljRnVsbE5hbWUgPSBtUGhvbmV0aWNGdWxsTmFtZS50cmltKCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyAiUFJFRiIsIHdlIGNob29zZSB0aGUgZmlyc3QgZW50cmllcyBhcyBwcmltYXJ5LgorICAgICAgICBpZiAoIW1QcmVmSXNTZXRfUGhvbmUgJiYgbVBob25lTGlzdCAhPSBudWxsICYmIG1QaG9uZUxpc3Quc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgbVBob25lTGlzdC5nZXQoMCkuaXNQcmltYXJ5ID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghbVByZWZJc1NldF9BZGRyZXNzICYmIG1Qb3N0YWxMaXN0ICE9IG51bGwgJiYgbVBvc3RhbExpc3Quc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgbVBvc3RhbExpc3QuZ2V0KDApLmlzUHJpbWFyeSA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFtUHJlZklzU2V0X0VtYWlsICYmIG1FbWFpbExpc3QgIT0gbnVsbCAmJiBtRW1haWxMaXN0LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIG1FbWFpbExpc3QuZ2V0KDApLmlzUHJpbWFyeSA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFtUHJlZklzU2V0X09yZ2FuaXphdGlvbiAmJiBtT3JnYW5pemF0aW9uTGlzdCAhPSBudWxsICYmIG1Pcmdhbml6YXRpb25MaXN0LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIG1Pcmdhbml6YXRpb25MaXN0LmdldCgwKS5pc1ByaW1hcnkgPSB0cnVlOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHB1c2hJbnRvQ29udGVudFJlc29sdmVyKENvbnRlbnRSZXNvbHZlciByZXNvbHZlcikgeworICAgICAgICBBcnJheUxpc3Q8Q29udGVudFByb3ZpZGVyT3BlcmF0aW9uPiBvcGVyYXRpb25MaXN0ID0KKyAgICAgICAgICAgIG5ldyBBcnJheUxpc3Q8Q29udGVudFByb3ZpZGVyT3BlcmF0aW9uPigpOyAgCisgICAgICAgIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5CdWlsZGVyIGJ1aWxkZXIgPQorICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChSYXdDb250YWN0cy5DT05URU5UX1VSSSk7CisgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlcyhuZXcgQ29udGVudFZhbHVlcygpKTsKKyAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKKworICAgICAgICB7CisgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkN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dXJlZE5hbWUuRElTUExBWV9OQU1FLCBnZXREaXNwbGF5TmFtZSgpKTsKKyAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobU5pY2tOYW1lTGlzdCAhPSBudWxsICYmIG1OaWNrTmFtZUxpc3Quc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBuaWNrTmFtZSA6IG1OaWNrTmFtZUxpc3QpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoTmlja25hbWUuUkFXX0NPTlRBQ1RfSUQsIDApOworICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIE5pY2tuYW1lLkNPTlRFTlRfSVRFTV9UWVBFKTsKKworICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKE5pY2tuYW1lLlRZUEUsIE5pY2tuYW1lLlRZUEVfREVGQVVMVCk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoTmlja25hbWUuTkFNRSwgbmlja05hbWUpOworICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLklTX1BSSU1BUlksIDEpOworICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobVBob25lTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKFBob25lRGF0YSBwaG9uZURhdGEgOiBtUGhvbmVMaXN0KSB7CisgICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKFBob25lLlJBV19DT05UQUNUX0lELCAwKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLk1JTUVUWVBFLCBQaG9uZS5DT05URU5UX0lURU1fVFlQRSk7CisKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG9uZS5UWVBFLCBwaG9uZURhdGEudHlwZSk7CisgICAgICAgICAgICAgICAgaWYgKHBob25lRGF0YS50eXBlID09IFBob25lLlRZUEVfQ1VTVE9NKSB7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKFBob25lLkxBQkVMLCBwaG9uZURhdGEubGFiZWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG9uZS5OVU1CRVIsIHBob25lRGF0YS5kYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAocGhvbmVEYXRhLmlzUHJpbWFyeSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLklTX1BSSU1BUlksIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobU9yZ2FuaXphdGlvbkxpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7CisgICAgICAgICAgICBmb3IgKE9yZ2FuaXphdGlvbkRhdGEgb3JnYW5pemF0aW9uRGF0YSA6IG1Pcmdhbml6YXRpb25MaXN0KSB7CisgICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKE9yZ2FuaXphdGlvbi5SQVdfQ09OVEFDVF9JRCwgMCk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgT3JnYW5pemF0aW9uLkNPTlRFTlRfSVRFTV9UWVBFKTsKKworICAgICAgICAgICAgICAgIC8vIEN1cnJlbnRseSwgd2UgZG8gbm90IHVzZSBUWVBFX0NVU1RPTS4KKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uVFlQRSwgb3JnYW5pemF0aW9uRGF0YS50eXBlKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uQ09NUEFOWSwgb3JnYW5pemF0aW9uRGF0YS5jb21wYW55TmFtZSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoT3JnYW5pemF0aW9uLlRJVExFLCBvcmdhbml6YXRpb25EYXRhLnBvc2l0aW9uTmFtZSk7CisgICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuSVNfUFJJTUFSWSwgMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtRW1haWxMaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoRW1haWxEYXRhIGVtYWlsRGF0YSA6IG1FbWFpbExpc3QpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoRW1haWwuUkFXX0NPTlRBQ1RfSUQsIDApOworICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKTsKKworICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEVtYWlsLlRZUEUsIGVtYWlsRGF0YS50eXBlKTsKKyAgICAgICAgICAgICAgICBpZiAoZW1haWxEYXRhLnR5cGUgPT0gRW1haWwuVFlQRV9DVVNUT00pIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRW1haWwuTEFCRUwsIGVtYWlsRGF0YS5sYWJlbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEVtYWlsLkRBVEEsIGVtYWlsRGF0YS5kYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAoZW1haWxEYXRhLmlzUHJpbWFyeSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLklTX1BSSU1BUlksIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobVBvc3RhbExpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChQb3N0YWxEYXRhIHBvc3RhbERhdGEgOiBtUG9zdGFsTGlzdCkgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOworICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuaW5zZXJ0U3RydWN0dXJlZFBvc3RhbERhdGFVc2luZ0NvbnRhY3RzU3RydWN0KAorICAgICAgICAgICAgICAgICAgICAgICAgbVZDYXJkVHlwZSwgYnVpbGRlciwgcG9zdGFsRGF0YSk7CisgICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKG1JbUxpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChJbURhdGEgaW1EYXRhIDogbUltTGlzdCkgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShJbS5SQVdfQ09OVEFDVF9JRCwgMCk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgSW0uQ09OVEVOVF9JVEVNX1RZUEUpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEltLlRZUEUsIGltRGF0YS50eXBlKTsKKyAgICAgICAgICAgICAgICBpZiAoaW1EYXRhLnR5cGUgPT0gSW0uVFlQRV9DVVNUT00pIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoSW0uTEFCRUwsIGltRGF0YS5sYWJlbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEltLkRBVEEsIGltRGF0YS5kYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAoaW1EYXRhLmlzUHJpbWFyeSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLklTX1BSSU1BUlksIDEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKG1Ob3RlTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBub3RlIDogbU5vdGVMaXN0KSB7CisgICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKE5vdGUuUkFXX0NPTlRBQ1RfSUQsIDApOworICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIE5vdGUuQ09OVEVOVF9JVEVNX1RZUEUpOworCisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoTm90ZS5OT1RFLCBub3RlKTsKKyAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobVBob3RvTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBib29sZWFuIGZpcnN0ID0gdHJ1ZTsKKyAgICAgICAgICAgIGZvciAoUGhvdG9EYXRhIHBob3RvRGF0YSA6IG1QaG90b0xpc3QpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoUGhvdG8uUkFXX0NPTlRBQ1RfSUQsIDApOworICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIFBob3RvLkNPTlRFTlRfSVRFTV9UWVBFKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG90by5QSE9UTywgcGhvdG9EYXRhLnBob3RvQnl0ZXMpOworICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLklTX1BSSU1BUlksIDEpOworICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobVdlYnNpdGVMaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHdlYnNpdGUgOiBtV2Vic2l0ZUxpc3QpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoV2Vic2l0ZS5SQVdfQ09OVEFDVF9JRCwgMCk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgV2Vic2l0ZS5DT05URU5UX0lURU1fVFlQRSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoV2Vic2l0ZS5VUkwsIHdlYnNpdGUpOworICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7CisgICAgICAgICA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hYmxlKCkgeworICAgICAgICByZXR1cm4gZ2V0RGlzcGxheU5hbWUoKS5sZW5ndGgoKSA9PSAwOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIFN0cmluZyBsaXN0VG9TdHJpbmcoTGlzdDxTdHJpbmc+IGxpc3QpeworICAgICAgICBmaW5hbCBpbnQgc2l6ZSA9IGxpc3Quc2l6ZSgpOworICAgICAgICBpZiAoc2l6ZSA+IDEpIHsKKyAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgICAgICBmb3IgKFN0cmluZyB0eXBlIDogbGlzdCkgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHR5cGUpOworICAgICAgICAgICAgICAgIGlmIChpIDwgc2l6ZSAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIjsiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgICAgICB9IGVsc2UgaWYgKHNpemUgPT0gMSkgeworICAgICAgICAgICAgcmV0dXJuIGxpc3QuZ2V0KDApOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcGltL3ZjYXJkL0VudHJ5Q29tbWl0dGVyLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9waW0vdmNhcmQvRW50cnlDb21taXR0ZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zZjE2NTVkCi0tLSAvZGV2L251bGwKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvcGltL3ZjYXJkL0VudHJ5Q29tbWl0dGVyLmphdmEKQEAgLTAs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Db250YWN0cyBQcm92aWRlciAKKyAqLworcHVibGljIGNsYXNzIEVudHJ5Q29tbWl0dGVyIGltcGxlbWVudHMgRW50cnlIYW5kbGVyIHsKKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBMT0dfVEFHID0gInZjYXJkLkVudHJ5Q29taXR0ZXIiOworCisgICAgcHJpdmF0ZSBDb250ZW50UmVzb2x2ZXIgbUNvbnRlbnRSZXNvbHZlcjsKKyAgICBwcml2YXRlIGxvbmcgbVRpbWVUb0NvbW1pdDsKKyAgICAKKyAgICBwdWJsaWMgRW50cnlDb21taXR0ZXIoQ29udGVudFJlc29sdmVyIHJlc29sdmVyKSB7CisgICAgICAgIG1Db250ZW50UmVzb2x2ZXIgPSByZXNvbHZlcjsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvblBhcnNpbmdTdGFydCgpIHsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgb25QYXJzaW5nRW5kKCkgeworICAgICAgICBpZiAoVkNhcmRDb25maWcuc2hvd1BlcmZvcm1hbmNlTG9nKCkpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsIFN0cmluZy5mb3JtYXQoInRpbWUgdG8gY29tbWl0IGVudHJpZXM6ICVkIG1zIiwgbVRpbWVUb0NvbW1pdCkpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25FbnRyeUNyZWF0ZWQoZmluYWwgQ29udGFjdFN0cnVjdCBjb250YWN0U3RydWN0KSB7CisgICAgICAgIGxvbmcgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgY29udGFjdFN0cnVjdC5wdXNoSW50b0NvbnRlbnRSZXNvbHZlcihtQ29udGVudFJlc29sdmVyKTsKKyAgICAgICAgbVRpbWVUb0NvbW1pdCArPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHN0YXJ0OworICAgIH0KK30KXCBObyBuZXdsaW5lIGF0IG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BqYXZhLnV0aWwuTGlzdDsKKworcHVibGljIGludGVyZmFjZSBWQ2FyZEJ1aWxkZXIgeworICAgIHZvaWQgc3RhcnQoKTsKKworICAgIHZvaWQgZW5kKCk7CisKKyAgICAvKiogCisgICAgICogQkVHSU46VkNBUkQKKyAgICAgKi8KKyAgICB2b2lkIHN0YXJ0UmVjb3JkKFN0cmluZyB0eXBlKTsKKworICAgIC8qKiBFTkQ6VlhYICovCisgICAgdm9pZCBlbmRSZWNvcmQoKTsKKworICAgIHZvaWQgc3RhcnRQcm9wZXJ0eSgpOworCisgICAgdm9pZCBlbmRQcm9wZXJ0eSgpOworCisgICAgLyoqCisgICAgICogQHBhcmFtIGdyb3VwIAorICAgICAqLworICAgIHZvaWQgcHJvcGVydHlHcm91cChTdHJpbmcgZ3JvdXApOworICAgIAorICAgIC8qKgorICAgICAqIEBwYXJhbSBuYW1lCisgICAgICogICAgICAgICAgICBOIDxicj4KKyAgICAgKiAgICAgICAgICAgIE4KKyAgICAgKi8KKyAgICB2b2lkIHByb3BlcnR5TmFtZShTdHJpbmcgbmFtZSk7CisKKyAgICAvKioKKyAgICAgKiBAcGFyYW0gdHlwZQorICAgICAqICAgICAgICAgICAgTEFOR1VBR0UgXCBFTkNPRElORyA8YnI+CisgICAgICogICAgICAgICAgICA7TEFOR1VhZ2U9IFwgO0VOQ09ESU5HPQorICAgICAqLworICAgIHZvaWQgcHJvcGVydHlQYXJhbVR5cGUoU3RyaW5nIHR5cGUpOworCisgICAgLyoqCisgICAgICogQHBhcmFtIHZhbHVlCisgICAgICogICAgICAgICAgICBGUi1FTiBcIEdCSyA8YnI+CisgICAgICogICAgICAgICAgICBGUi1FTiBcIEdCSworICAgICAqLworICAgIHZvaWQgcHJvcGVydHlQYXJhbVZhbHVlKFN0cmluZyB2YWx1ZSk7CisKKyAgICB2b2lkIHByb3BlcnR5VmFsdWVzKExpc3Q8U3RyaW5nPiB2YWx1ZXMpOworfQpkaWZmIC0tZ2l0IGEvY29yZS9qYX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lIHN0YXRpYyBmaW5hbCBTdHJpbmcgTE9HX1RBRyA9ICJ2Y2FyZC5WQ2FyZENvbXBvc2VyLkhhbmRsZXJGb3JPdXRwdXRTdHJlYW0iOworCisgICAgICAgIHByaXZhdGUgT3V0cHV0U3RyZWFtIG1PdXRwdXRTdHJlYW07IC8vIG1Xcml0ZXIgd2lsbCBjbG9zZSB0aGlzLgorICAgICAgICBwcml2YXRlIFdyaXRlciBtV3JpdGVyOworCisgICAgICAgIHByaXZhdGUgYm9vbGVhbiBtT25UZXJtaW5hdGVJc0NhbGxlZCA9IGZhbHNlOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbnB1dCBzdHJlYW0gd2lsbCBiZSBjbG9zZWQgb24gdGhlIGRldHJ1Y3Rpb24gb2YgdGhpcyBvYmplY3QuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgSGFuZGxlckZvck91dHB1dFN0cmVhbShPdXRwdXRTdHJlYW0gb3V0cHV0U3RyZWFtKSB7CisgICAgICAgICAgICBtT3V0cHV0U3RyZWFtID0gb3V0cHV0U3RyZWFtOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25Jbml0KENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtV3JpdGVyID0gbmV3IEJ1ZmZlcmVkV3JpdGVyKG5ldyBPdXRwdXRTdHJlYW1Xcml0ZXIoCisgICAgICAgICAgICAgICAgICAgICAgICBtT3V0cHV0U3RyZWFtLCBtQ2hhcnNldFN0cmluZykpOworICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlMSkgeworICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJVbnN1cHBvcnRlZCBjaGFyc2V0OiAiICsgbUNoYXJzZXRTdHJpbmcpOworICAgICAgICAgICAgICAgIG1FcnJvclJlYXNvbiA9ICJFbmNvZGluZyBpcyBub3Qgc3VwcG9ydGVkICh1c3VhbGx5IHRoaXMgZG9lcyBub3QgaGFwcGVuISk6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgbUNoYXJzZXRTdHJpbmc7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIG9uZSBlbXB0eSBlbnRyeS4KKyAgICAgICAgICAgICAgICAgICAgbVdyaXRlci53cml0ZShjcmVhdGVPbmVFbnRyeUludGVybmFsKCItMSIpKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIklPRXhjZXB0aW9uIG9jY3VycmVkIGR1cmluZyBleHBvcnRPbmVDb250YWN0RGF0YTogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBlLmdldE1lc3NhZ2UoKSk7CisgICAgICAgICAgICAgICAgICAgIG1FcnJvclJlYXNvbiA9ICJJT0V4Y2VwdGlvbiBvY2N1cnJlZDogIiArIGUuZ2V0TWVzc2FnZSgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkVudHJ5Q3JlYXRlZChTdHJpbmcgdmNhcmQpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbVdyaXRlci53cml0ZSh2Y2FyZCk7CisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICJJT0V4Y2VwdGlvbiBvY2N1cnJlZCBkdXJpbmcgZXhwb3J0T25lQ29udGFjdERhdGE6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBlLmdldE1lc3NhZ2UoKSk7CisgICAgICAgICAgICAgICAgbUVycm9yUmVhc29uID0gIklPRXhjZXB0aW9uIG9jY3VycmVkOiAiICsgZS5nZXRNZXNzYWdlKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblRlcm1pbmF0ZSgpIHsKKyAgICAgICAgICAgIG1PblRlcm1pbmF0ZUlzQ2FsbGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIGlmIChtV3JpdGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAvLyBGbHVzaCBhbmQgc3luYyB0aGUgZGF0YSBzbyB0aGF0IGEgdXNlciBpcyBhYmxlIHRvIHB1bGwKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlIFNEQ2FyZCBqdXN0IGFmdGVyCisgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBleHBvcnQuCisgICAgICAgICAgICAgICAgICAgIG1Xcml0ZXIuZmx1c2goKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1PdXRwdXRTdHJlYW0gIT0gbnVsbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG1PdXRwdXRTdHJlYW0gaW5zdGFuY2VvZiBGaWxlT3V0cHV0U3RyZWFtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChGaWxlT3V0cHV0U3RyZWFtKSBtT3V0cHV0U3RyZWFtKS5nZXRGRCgpLnN5bmMoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSU9FeGNlcHRpb24gZHVyaW5nIGNsb3NpbmcgdGhlIG91dHB1dCBzdHJlYW06ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgZS5nZXRNZXNzYWdlKCkpOworICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtV3JpdGVyLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBmaW5hbGl6ZSgpIHsKKyAgICAgICAgICAgIGlmICghbU9uVGVybWluYXRlSXNDYWxsZWQpIHsKKyAgICAgICAgICAgICAgICBvblRlcm1pbmF0ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVkNBUkRfVFlQRV9TVFJJTkdfRE9DT01PID0gImRvY29tbyI7CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgVkNBUkRfUFJPUEVSVFlfQURSID0gIkFEUiI7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIFZDQVJEX1BST1BFUlRZX0JFR0lOID0gIkJFR0lOIjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgVkNBUkRfUFJPUEVSVFlfRU1BSUwgPSAiRU1BSUwiOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBWQ0FSRF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lRfSklTOworICAgICAgICB9IGVsc2UgaWYgKG1Vc2VzU2hpZnRKaXMpIHsKKyAgICAgICAgICAgIG1DaGFyc2V0U3RyaW5nID0gQ2hhcnNldFV0aWxzLmNoYXJzZXRGb3JWZW5kb3IoU0hJRlRfSklTKS5uYW1lKCk7CisgICAgICAgICAgICBtVkNhcmRBdHRyaWJ1dGVDaGFyc2V0ID0gIkNIQVJTRVQ9IiArIFNISUZUX0pJUzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1DaGFyc2V0U3RyaW5nID0gIlVURi04IjsKKyAgICAgICAgICAgIG1WQ2FyZEF0dHJpYnV0ZUNoYXJzZXQgPSAiQ0hBUlNFVD1VVEYtOCI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBNdXN0IGNhbGwgYmVmb3JlIHt7QGxpbmsgI2luaXQoKX0uCisgICAgICovCisgICAgcHVibGljIHZvaWQgYWRkSGFuZGxlcihPbmVFbnRyeUhhbmRsZXIgaGFuZGxlcikgeworICAgICAgICBpZiAobUhhbmRsZXJMaXN0ID09IG51bGwpIHsKKyAgICAgICAgICAgIG1IYW5kbGVyTGlzdCA9IG5ldyBBcnJheUxpc3Q8T25lRW50cnlIYW5kbGVyPigpOworICAgICAgICB9CisgICAgICAgIG1IYW5kbGVyTGlzdC5hZGQoaGFuZGxlcik7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaW5pdCgpIHsKKyAgICAgICAgcmV0dXJuIGluaXQobnVsbCwgbnVsbCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBSZXR1cm5zIHRydWUgd2hlbiBpbml0aWFsaXphdGlvbiBpcyBzdWNjZXNzZnVsIGFuZCBhbGwgdGhlIG90aGVyCisgICAgICogICAgICAgICBtZXRob2RzIGFyZSBhdmFpbGFibGUuIFJldHVybnMgZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGluaXQoZmluYWwgU3RyaW5nIHNlbGVjdGlvbiwgZmluYWwgU3RyaW5nW10gc2VsZWN0aW9uQXJncykgeworICAgICAgICBpZiAobUNhcmVIYW5kbGVyRXJyb3JzKSB7CisgICAgICAgICAgICBMaXN0PE9uZUVudHJ5SGFuZGxlcj4gZmluaXNoZWRMaXN0ID0gbmV3IEFycmF5TGlzdDxPbmVFbnRyeUhhbmRsZXI+KAorICAgICAgICAgICAgICAgICAgICBtSGFuZGxlckxpc3Quc2l6ZSgpKTsKKyAgICAgICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWhhbmRsZXIub25Jbml0KG1Db250ZXh0KSkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBmaW5pc2hlZCA6IGZpbmlzaGVkTGlzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoZWQub25UZXJtaW5hdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gSnVzdCBpZ25vcmUgdGhlIGZhbHNlIHJldHVybmVkIGZyb20gb25Jbml0KCkuCisgICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBoYW5kbGVyIDogbUhhbmRsZXJMaXN0KSB7CisgICAgICAgICAgICAgICAgaGFuZGxlci5vbkluaXQobUNvbnRleHQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZmluYWwgU3RyaW5nW10gcHJvamVjdGlvbiA9IG5ldyBTdHJpbmdbXSB7Q29udGFjdHMuX0lELH07CisKKyAgICAgICAgLy8gVE9ETzogdGhvcm93IGFuIGFwcHJvcHJpYXRlIGV4Y2VwdGlvbiEKKyAgICAgICAgbUN1cnNvciA9IG1Db250ZW50UmVzb2x2ZXIucXVlcnkoUmF3Q29udGFjdHMuQ09OVEVOVF9VUkksIHByb2plY3Rpb24sCisgICAgICAgICAgICAgICAgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzLCBudWxsKTsKKyAgICAgICAgaWYgKG1DdXJzb3IgPT0gbnVsbCB8fCAhbUN1cnNvci5tb3ZlVG9GaXJzdCgpKSB7CisgICAgICAgICAgICBpZiAobUN1cnNvciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgbUN1cnNvci5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJTUUxpdGVFeGNlcHRpb24gb24gQ3Vyc29yI2Nsb3NlKCk6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUN1cnNvciA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRXJyb3JSZWFzb24gPSAiR2V0dGluZyBkYXRhYmFzZSBpbmZvcm1hdGlvbiBmYWlsZWQuIjsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIG1JZENvbHVtbiA9IG1DdXJzb3IuZ2V0Q29sdW1uSW5kZXgoQ29udGFjdHMuX0lEKTsKKworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBjcmVhdGVPbmVFbnRyeSgpIHsKKyAgICAgICAgaWYgKG1DdXJzb3IgPT0gbnVsbCB8fCBtQ3Vyc29yLmlzQWZ0ZXJMYXN0KCkpIHsKKyAgICAgICAgICAgIC8vIFRPRE86IGRpdHRvCisgICAgICAgICAgICBtRXJyb3JSZWFzb24gPSAiTm90IGluaXRpYWxpemVkIG9yIGRhdGFiYXNlIGhhcyBzb21lIHByb2JsZW0uIjsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBTdHJpbmcgbmFtZSA9IG51bGw7CisgICAgICAgIFN0cmluZyB2Y2FyZDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHZjYXJkID0gY3JlYXRlT25lRW50cnlJbnRlcm5hbChtQ3Vyc29yLmdldFN0cmluZyhtSWRDb2x1bW4pKTsKKyAgICAgICAgfSBjYXRjaCAoT3V0T2ZNZW1vcnlFcnJvciBlcnJvcikgeworICAgICAgICAgICAgLy8gTWF5YmUgc29tZSBkYXRhIChlLmcuIHBob3RvKSBpcyB0b28gYmlnIHRvIGhhdmUgaW4gbWVtb3J5LiBCdXQgaXQKKyAgICAgICAgICAgIC8vIHNob3VsZCBiZSByYXJlLgorICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIk91dE9mTWVtb3J5RXJyb3Igb2NjdXJlZC4gSWdub3JlIHRoZSBlbnRyeTogIgorICAgICAgICAgICAgICAgICAgICArIG5hbWUpOworICAgICAgICAgICAgU3lzdGVtLmdjKCk7CisgICAgICAgICAgICAvLyBUT0RPOiBzaG91bGQgdGVsbCB1c2VycyB3aGF0IGhhcHBlbmVkPworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtQ3Vyc29yLm1vdmVUb05leHQoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFRoaXMgZnVuY3Rpb24gZG9lcyBub3QgY2FyZSB0aGUgT3V0T2ZNZW1vcnlFcnJvciBvbiB0aGUgaGFuZGxlciBzaWRlCisgICAgICAgIC8vIDotUAorICAgICAgICBpZiAobUNhcmVIYW5kbGVyRXJyb3JzKSB7CisgICAgICAgICAgICBMaXN0PE9uZUVudHJ5SGFuZGxlcj4gZmluaXNoZWRMaXN0ID0gbmV3IEFycmF5TGlzdDxPbmVFbnRyeUhhbmRsZXI+KAorICAgICAgICAgICAgICAgICAgICBtSGFuZGxlckxpc3Quc2l6ZSgpKTsKKyAgICAgICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWhhbmRsZXIub25FbnRyeUNyZWF0ZWQodmNhcmQpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBoYW5kbGVyIDogbUhhbmRsZXJMaXN0KSB7CisgICAgICAgICAgICAgICAgaGFuZGxlci5vbkVudHJ5Q3JlYXRlZCh2Y2FyZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBwcml2YXRlIFN0cmluZyBjcmVhdGVPbmVFbnRyeUludGVybmFsKGZpbmFsIFN0cmluZyBjb250YWN0SWQpIHsKKyAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgYXBwZW5kVkNhcmRMaW5lKGJ1aWxkZXIsIFZDQVJEX1BST1BFUlRZX0JFR0lOLCBWQ0FSRF9EQVRBX1ZDQVJEKTsKKyAgICAgICAgaWYgKG1Jc1YzMCkgeworICAgICAgICAgICAgYXBwZW5kVkNhcmRMaW5lKGJ1aWxkZXIsIFZDQVJEX1BST1BFUlRZX1ZFUlNJT04sIENvbnN0YW50cy5WRVJTSU9OX1YzMCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBhcHBlbmRWQ2FyZExpbmUoYnVpbGRlciwgVkNBUkRfUFJPUEVSVFlfVkVSU0lPTiwgQ29uc3RhbnRzLlZFUlNJT05fVjIxKTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIE1hcDxTdHJpbmcsIExpc3Q8Q29udGVudFZhbHVlcz4+IGNvbnRlbnRWYWx1ZXNMaXN0TWFwID0KKyAgICAgICAgICAgIG5ldyBIYXNoTWFwPFN0cmluZywgTGlzdDxDb250ZW50VmFsdWVzPj4oKTsKKworICAgICAgICBmaW5hbCBTdHJpbmcgc2VsZWN0aW9uID0gRGF0YS5SQVdfQ09OVEFDVF9JRCArICI9PyI7CisgICAgICAgIGZpbmFsIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MgPSBuZXcgU3RyaW5nW10ge2NvbnRhY3RJZH07CisgICAgICAgIEVudGl0eUl0ZXJhdG9yIGVudGl0eUl0ZXJhdG9yID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGVudGl0eUl0ZXJhdG9yID0gbUNvbnRlbnRSZXNvbHZlci5xdWVyeUVudGl0aWVzKAorICAgICAgICAgICAgICAgICAgICBSYXdDb250YWN0cy5DT05URU5UX1VSSSwgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzLCBudWxsKTsKKyAgICAgICAgICAgIHdoaWxlIChlbnRpdHlJdGVyYXRvci5oYXNOZXh0KCkpIHsKKyAgICAgICAgICAgICAgICBFbnRpdHkgZW50aXR5ID0gZW50aXR5SXRlcmF0b3IubmV4dCgpOworICAgICAgICAgICAgICAgIGZvciAoTmFtZWRDb250ZW50VmFsdWVzIG5hbWVkQ29udGVudFZhbHVlcyA6IGVudGl0eQorICAgICAgICAgICAgICAgICAgICAgICAgLmdldFN1YlZhbHVlcygpKSB7CisgICAgICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA9IG5hbWVkQ29udGVudFZhbHVlcy52YWx1ZXM7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKERhdGEuTUlNRVRZUEUpOworICAgICAgICAgICAgICAgICAgICBpZiAoa2V5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QgPSBjb250ZW50VmFsdWVzTGlzdE1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0KGtleSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRWYWx1ZXNMaXN0ID0gbmV3IEFycmF5TGlzdDxDb250ZW50VmFsdWVzPigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRWYWx1ZXNMaXN0TWFwLnB1dChrZXksIGNvbnRlbnRWYWx1ZXNMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRWYWx1ZXNMaXN0LmFkZChjb250ZW50VmFsdWVzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsIFN0cmluZy5mb3JtYXQoIlJlbW90ZUV4Y2VwdGlvbiBhdCBpZCAlcyAoJXMpIiwKKyAgICAgICAgICAgICAgICAgICAgY29udGFjdElkLCBlLmdldE1lc3NhZ2UoKSkpOworICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGVudGl0eUl0ZXJhdG9yICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBlbnRpdHlJdGVyYXRvci5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gVE9ETzogY29uc29saWRhd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FtVGVybWluYXRlSXNDYWxsZWQpIHsKKyAgICAgICAgICAgIHRlcm1pbmF0ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRDb3VudCgpIHsKKyAgICAgICAgaWYgKG1DdXJzb3IgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1DdXJzb3IuZ2V0Q291bnQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0FmdGVyTGFzdCgpIHsKKyAgICAgICAgaWYgKG1DdXJzb3IgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtQ3Vyc29yLmlzQWZ0ZXJMYXN0KCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBSZXR1cm4gdGhlIGVycm9yIHJlYXNvbiBpZiBwb3NzaWJsZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldEVycm9yUmVhc29uKCkgeworICAgICAgICByZXR1cm4gbUVycm9yUmVhc29uOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBhcHBlbmRTdHJ1Y3R1cmVkTmFtZXMoU3RyaW5nQnVpbGRlciBidWlsZGVyLAorICAgICAgICAgICAgZmluYWwgTWFwPFN0cmluZywgTGlzdDxDb250ZW50VmFsdWVzPj4gY29udGVudFZhbHVlc0xpc3RNYXApIHsKKyAgICAgICAgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCA9IGNvbnRlbnRWYWx1ZXNMaXN0TWFwCisgICAgICAgICAgICAgICAgLmdldChTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fVFlQRSk7CisgICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBhcHBlbmRTdHJ1Y3R1cmVkTmFtZXNJbnRlcm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hwcmVmaXgpOworICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkU3VmZml4ID0gZXNjYXBlQ2hhcmFjdGVycyhzdWZmaXgpOworCisgICAgICAgICAgICAgICAgLy8gTiBwcm9wZXJ0eS4gVGhpcyBvcmRlciBpcyBzcGVjaWZpZWQgYnkgdkNhcmQgc3BlYyBhbmQgZG9lcyBub3QgZGVwZW5kIG9uIGNvdW50cmllcy4gCisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfUFJPUEVSVFlfTkFNRSk7CisgICAgICAgICAgICAgICAgaWYgKCEoVkNhcmRVdGlscy5jb250YWluc09ubHlBc2NpaShmYW1pbHlOYW1lKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlBc2NpaShnaXZlbk5hbWUpICYmCisgICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZFV0aWxzLmNvbnRhaW5zT25seUFzY2lpKG1pZGRsZU5hbWUpICYmCisgICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZFV0aWxzLmNvbnRhaW5zT25seUFzY2lpKHByZWZpeCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QXNjaWkoc3VmZml4KSkpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQVRUUl9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChtVkNhcmRBdHRyaWJ1dGVDaGFyc2V0KTsgICAKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZW5jb2RlZEZhbWlseSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVuY29kZWRHaXZlbik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVuY29kZWRNaWRkbGUpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChlbmNvZGVkUHJlZml4KTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZW5jb2RlZFN1ZmZpeCk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQ09MX1NFUEFSQVRPUik7CisKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZEZ1bGxuYW1lID0gVkNhcmRVdGlscy5jb25zdHJ1Y3ROYW1lRnJvbUVsZW1lbnRzKAorICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRDb25maWcuZ2V0TmFtZU9yZGVyVHlwZShtVkNhcmRUeXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kZWRGYW1pbHksIGVuY29kZWRNaWRkbGUsIGVuY29kZWRHaXZlbiwgZW5jb2RlZFByZWZpeCwgZW5jb2RlZFN1ZmZpeCk7CisKKyAgICAgICAgICAgICAgICAvLyBGTiBwcm9wZXJ0eQorICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BST1BFUlRZX0ZVTExfTkFNRSk7CisgICAgICAgICAgICAgICAgaWYgKCFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seUFzY2lpKGVuY29kZWRGdWxsbmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQVRUUl9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChtVkNhcmRBdHRyaWJ1dGVDaGFyc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVuY29kZWRGdWxsbmFtZSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQ09MX1NFUEFSQVRPUik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShkaXNwbGF5TmFtZSkpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9QUk9QRVJUWV9OQU1FKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9BVFRSX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobVZDYXJkQXR0cmlidXRlQ2hhcnNldCk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVzY2FwZUNoYXJhY3RlcnMoZGlzcGxheU5hbWUpKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQ09MX1NFUEFSQVRPUik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1Jc0RvQ29NbykgeworICAgICAgICAgICAgICAgIGFwcGVuZFZDYXJkTGluZShidWlsZGVyLCBWQ0FSRF9QUk9QRVJUWV9OQU1FLCAiIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZyBwaG9uZXRpY0ZhbWlseU5hbWUgPSBjb250ZW50VmFsdWVzCisgICAgICAgICAgICAgICAgICAgIC5nZXRBc1N0cmluZyhTdHJ1Y3R1cmVkTmFtZS5QSE9ORVRJQ19GQU1JTFlfTkFNRSk7CisgICAgICAgICAgICBTdHJpbmcgcGhvbmV0aWNNaWRkbGVOYW1lID0gY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAuZ2V0QXNTdHJpbmcoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfTUlERExFX05BTUUpOworICAgICAgICAgICAgU3RyaW5nIHBob25ldGljR2l2ZW5OYW1lID0gY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAuZ2V0QXNTdHJpbmcoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfR0lWRU5fTkFNRSk7CisgICAgICAgICAgICBpZiAoIShUZXh0VXRpbHMuaXNFbXB0eShwaG9uZXRpY0ZhbWlseU5hbWUpCisgICAgICAgICAgICAgICAgICAgICYmIFRleHRVdGlscy5pc0VtcHR5KHBob25ldGljTWlkZGxlTmFtZSkgJiYgVGV4dFV0aWxzCisgICAgICAgICAgICAgICAgICAgIC5pc0VtcHR5KHBob25ldGljR2l2ZW5OYW1lKSkpIHsgLy8gaWYgbm90IGVtcHR5CisgICAgICAgICAgICAgICAgaWYgKG1Jc0phcGFuZXNlTW9iaWxlUGhvbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgcGhvbmV0aWNGYW1pbHlOYW1lID0gVkNhcmRVdGlscworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50b0hhbGZXaWR0aFN0cmluZyhwaG9uZXRpY0ZhbWlseU5hbWUpOworICAgICAgICAgICAgICAgICAgICBwaG9uZXRpY01pZGRsZU5hbWUgPSBWQ2FyZFV0aWxzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRvSGFsZldpZHRoU3RyaW5nKHBob25ldGljTWlkZGxlTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIHBob25ldGljR2l2ZW5OYW1lID0gVkNhcmRVdGlscworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50b0hhbGZXaWR0aFN0cmluZyhwaG9uZXRpY0dpdmVuTmFtZSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKG1Jc1YzMCkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgc29ydFN0cmluZyA9IFZDYXJkVXRpbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY29uc3RydWN0TmFtZUZyb21FbGVtZW50cyhtVkNhcmRUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmV0aWNGYW1pbHlOYW1lLCBwaG9uZXRpY01pZGRsZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZXRpY0dpdmVuTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BST1BFUlRZX1NPUlRfU1RSSU5HKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5QXNjaWkoc29ydFN0cmluZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0cmljdGx5LCBhZGRpbmcgY2hhcnNldCBpbmZvcm1hdGlvbiBpcyBOT1QgdmFsaWQgaW4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFZDYXJkIDMuMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJ1dCB3ZSdsbCBhZGQgdGhpcyBpbmZvIHNpbmNlIHBhcnNlciBzaWRlIG1heSBiZSBhYmxlIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB1c2UgdGhlIGNoYXJzZXQgdmlhCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGF0dHJpYnV0ZSBmaWVsZC4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZS5nLiBKYXBhbmVzZSBtb2JpbGUgcGhvbmVzIHVzZSBTaGlmdF9KaXMgd2hpbGUgUkZDIDI0MjYKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlY29tbWVuZHMKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFVURi04LiBCeSBhZGRpbmcgdGhpcyBmaWVsZCwgcGFyc2VycyBtYXkgYmUgYWJsZSB0byBrbm93CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIHRleHQKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlzIE5PVCBVVEYtOCBidXQgU2hpZnRfSmlzLgorICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQVRUUl9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobVZDYXJkQXR0cmlidXRlQ2hhcnNldCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHNvcnRTdHJpbmcpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9DT0xfU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBOb3RlOiBUaGVyZSBpcyBubyBhcHByb3ByaWF0ZSBwcm9wZXJ0eSBmb3IgZXhwcmVzc2luZworICAgICAgICAgICAgICAgICAgICAvLyBwaG9uZXRpYyBuYW1lIGluCisgICAgICAgICAgICAgICAgICAgIC8vIFZDYXJkIDIuMSwgd2hpbGUgdGhlcmUgaXMgaW4gVkNhcmQgMy4wIChTT1JULVNUUklORykuCisgICAgICAgICAgICAgICAgICAgIC8vIFdlIGNob3NlIHRvIHVzZSBEb0NvTW8ncyB3YXkgc2luY2UgaXQgaXMgc3VwcG9ydGVkIGJ5IGEKKyAgICAgICAgICAgICAgICAgICAgLy8gbG90IG9mCisgICAgICAgICAgICAgICAgICAgIC8vIEphcGFuZXNlIG1vYmlsZSBwaG9uZXMuCisgICAgICAgICAgICAgICAgICAgIC8vCisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHNob3VsZCB1c2UgUXVvdGVkLVByaXRhYmxlPworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9QUk9QRVJUWV9TT1VORCk7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0FUVFJfU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoQ29uc3RhbnRzLkFUVFJfVFlQRV9YX0lSTUNfTik7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0FUVFJfU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIGlmICghKFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QXNjaWkocGhvbmV0aWNGYW1pbHlOYW1lKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QXNjaWkocGhvbmV0aWNNaWRkbGVOYW1lKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QXNjaWkocGhvbmV0aWNHaXZlbk5hbWUpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobVZDYXJkQXR0cmlidXRlQ2hhcnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChlc2NhcGVDaGFyYWN0ZXJzKHBob25ldGljRmFtaWx5TmFtZSkpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVzY2FwZUNoYXJhY3RlcnMocGhvbmV0aWNNaWRkbGVOYW1lKSk7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZXNjYXBlQ2hhcmFjdGVycyhwaG9uZXRpY0dpdmVuTmFtZSkpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQ09MX1NFUEFSQVRPUik7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Vc2VzQW5kcm9pZFByb3BlcnR5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGhvbmV0aWNOYW1lID0gVkNhcmRVdGlscworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY29uc3RydWN0TmFtZUZyb21FbGVtZW50cyhtVkNhcmRUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob25ldGljRmFtaWx5TmFtZSwgcGhvbmV0aWNNaWRkbGVOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob25ldGljR2l2ZW5OYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BST1BFUlRZX1hfUEhPTkVUSUNfTkFNRSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghVkNhcmRVdGlscy5jb250YWluc09ubHlBc2NpaShwaG9uZXRpY05hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQVRUUl9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG1WQ2FyZEF0dHJpYnV0ZUNoYXJzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBtYXkgbmVlZCB0byBtYWtlIHRoZSB0ZXh0IHF1b3RlZC1wcmludGFibGUuCisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChwaG9uZXRpY05hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQ09MX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1Jc0RvQ29NbykgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BST1BFUlRZX1NPVU5EKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9BVFRSX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoQ29uc3RhbnRzLkFUVFJfVFlQRV9YX0lSTUNfTik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9DT0xfU0VQQVJBVE9SKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1Vc2VzRGVmYWN0UHJvcGVydHkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHBob25ldGljR2l2ZW5OYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9QUk9QRVJUWV9YX1BIT05FVElDX0ZJUlNUX05BTUUpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHBob25ldGljR2l2ZW5OYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQ09MX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvbmV0aWNNaWRkbGVOYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9QUk9QRVJUWV9YX1BIT05FVElDX01JRERMRV9OQU1FKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChwaG9uZXRpY01pZGRsZU5hbWUpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9DT0xfU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShwaG9uZXRpY0ZhbWlseU5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BST1BFUlRZX1hfUEhPTkVUSUNfTEFTVF9OQU1FKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChwaG9uZXRpY0ZhbWlseU5hbWUpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9DT0xfU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgYXBwZW5kTmlja05hbWVzKGZpbmFsIFN0cmluZ0J1aWxkZXIgYnVpbGRlciwKKyAgICAgICAgICAgIGZpbmFsIE1hcDxTdHJpbmcsIExpc3Q8Q29udGVudFZhbHVlcz4+IGNvbnRlbnRWYWx1ZXNMaXN0TWFwKSB7CisgICAgICAgIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QgPSBjb250ZW50VmFsdWVzTGlzdE1hcAorICAgICAgICAgICAgICAgIC5nZXQoTmlja25hbWUuQ09OVEVOVF9JVEVNX1RZUEUpOworICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByb3BlcnR5Tmlja25hbWU7CisgICAgICAgICAgICBpZiAobUlzVjMwKSB7CisgICAgICAgICAgICAgICAgcHJvcGVydHlOaWNrbmFtZSA9IFZDQVJEX1BST1BFUlRZX05JQ0tOQU1FOworICAgICAgICAgICAgfSBlbHNlIGlmIChtVXNlc0FuZHJvaWRQcm9wZXJ0eSkgeworICAgICAgICAgICAgICAgIHByb3BlcnR5Tmlja25hbWUgPSBWQ0FSRF9QUk9QRVJUWV9YX05JQ0tOQU1FOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBUaGVyZSdzIG5vIHdheSB0byBhZGQgdGhpcyBmaWVsZC4KKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbmlja25hbWUgPSBjb250ZW50VmFsdWVzCisgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0QXNTdHJpbmcoTmlja25hbWUuTkFNRSk7CisgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KG5pY2tuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQocHJvcGVydHlOaWNrbmFtZSk7CisKKyAgICAgICAgICAgICAgICBpZiAoIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5QXNjaWkocHJvcGVydHlOaWNrbmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gIFN0cmljdGx5LCB0aGlzIGlzIG5vdCB2YWxpZCBpbiB2Q2FyZCAzLjAuIFNlZSBhYm92ZS4KKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQVRUUl9TRVBBUkFUT1IpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChtVkNhcmRBdHRyaWJ1dGVDaGFyc2V0KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZXNjYXBlQ2hhcmFjdGVycyhuaWNrbmFtZSkpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0NPTF9TRVBBUkFUT1IpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGFwcGVuZFBob25lcyhmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIsCisgICAgICAgICAgICBmaW5hbCBNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PiBjb250ZW50VmFsdWVzTGlzdE1hcCkgeworICAgICAgICBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0ID0gY29udGVudFZhbHVlc0xpc3RNYXAKKyAgICAgICAgICAgICAgICAuZ2V0KFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKTsKKyAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKKyAgICAgICAgICAgICAgICBhcHBlbmRWQ2FyZFRlbGVwaG9uZUxpbmUoYnVpbGRlciwgY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAgICAgLmdldEFzSW50ZWdlcihQaG9uZS5UWVBFKSwgY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAgICAgLmdldEFzU3RyaW5nKFBob25lLkxBQkVMKSwgY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAgICAgLmdldEFzU3RyaW5nKFBob25lLk5VTUJFUikpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKG1Jc0RvQ29NbykgeworICAgICAgICAgICAgYXBwZW5kVkNhcmRUZWxlcGhvbmVMaW5lKGJ1aWxkZXIsIFBob25lLlRZUEVfSE9NRSwgIiIsICIiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBhcHBlbmRFbWFpbHMoZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyLAorICAgICAgICAgICAgZmluYWwgTWFwPFN0cmluZywgTGlzdDxDb250ZW50VmFsdWVzPj4gY29udGVudFZhbHVlc0xpc3RNYXApIHsKKyAgICAgICAgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCA9IGNvbnRlbnRWYWx1ZXNMaXN0TWFwCisgICAgICAgICAgICAgICAgLmdldChFbWFpbC5DT05URU5UX0lURU1fVFlQRSk7CisgICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7CisgICAgICAgICAgICAgICAgYXBwZW5kVkNhcmRFbWFpbExpbmUoYnVpbGRlciwgY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAgICAgLmdldEFzSW50ZWdlcihFbWFpbC5UWVBFKSwgY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAgICAgLmdldEFzU3RyaW5nKEVtYWlsLkxBQkVMKSwgY29udGVudFZhbHVl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9Db01vSW50ZXJuYWwoYnVpbGRlciwgY29udGVudFZhbHVlc0xpc3QsCisgICAgICAgICAgICAgICAgU3RydWN0dXJlZFBvc3RhbC5UWVBFX09USEVSKSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChhcHBlbmRQb3N0YWxzRm9yRG9Db01vSW50ZXJuYWwoYnVpbGRlciwgY29udGVudFZhbHVlc0xpc3QsCisgICAgICAgICAgICAgICAgU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTSkpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIExvZy53KExPR19UQUcsCisgICAgICAgICAgICAgICAgIlNob3VsZCBub3QgY29tZSBoZXJlLiBNdXN0IGhhdmUgYXQgbGVhc3Qgb25lIHBvc3RhbCBkYXRhLiIpOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBhcHBlbmRQb3N0YWxzRm9yRG9Db01vSW50ZXJuYWwoZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyLAorICAgICAgICAgICAgZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCwgaW50IHByZWZlcmVkVHlwZSkgeworICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgdHlwZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFN0cnVjdHVyZWRQb3N0YWwuVFlQRSk7CisgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwgPSBjb250ZW50VmFsdWVzCisgICAgICAgICAgICAgICAgICAgIC5nZXRBc1N0cmluZyhTdHJ1Y3R1cmVkUG9zdGFsLkxBQkVMKTsKKyAgICAgICAgICAgIGlmICh0eXBlID09IHByZWZlcmVkVHlwZSkgeworICAgICAgICAgICAgICAgIGFwcGVuZFZDYXJkUG9zdGFsTGluZShidWlsZGVyLCB0eXBlLCBsYWJlbCwgY29udGVudFZhbHVlcyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBhcHBlbmRQb3N0YWxzRm9yR2VuZXJpYyhmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIsCisgICAgICAgICAgICBmaW5hbCBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0KSB7CisgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCB0eXBlID0gY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoU3RydWN0dXJlZFBvc3RhbC5UWVBFKTsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyBsYWJlbCA9IGNvbnRlbnRWYWx1ZXMKKyAgICAgICAgICAgICAgICAgICAgLmdldEFzU3RyaW5nKFN0cnVjdHVyZWRQb3N0YWwuTEFCRUwpOworICAgICAgICAgICAgYXBwZW5kVkNhcmRQb3N0YWxMaW5lKGJ1aWxkZXIsIHR5cGUsIGxhYmVsLCBjb250ZW50VmFsdWVzKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBhcHBlbmRJbXMoZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyLAorICAgICAgICAgICAgZmluYWwgTWFwPFN0cmluZywgTGlzdDxDb250ZW50VmFsdWVzPj4gY29udGVudFZhbHVlc0xpc3RNYXApIHsKKyAgICAgICAgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCA9IGNvbnRlbnRWYWx1ZXNMaXN0TWFwCisgICAgICAgICAgICAgICAgLmdldChJbS5DT05URU5UX0lURU1fVFlQRSk7CisgICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7CisgICAgICAgICAgICAgICAgaW50IHR5cGUgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihJbS5QUk9UT0NPTCk7CisgICAgICAgICAgICAgICAgU3RyaW5nIGRhdGEgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKEltLkRBVEEpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIExvZy5kKCJAQEAiLCAiSW0gaW5mb3JtYXRpb24uIHByb3RvY29sPVwiIiArIHR5cGUgKworICAgICAgICAgICAgICAgICAgICAgICAgIlwiLCBkYXRhPVwiIiArIGRhdGEgKyAiXCIsIHByb3RvY29sPVwiIiArCisgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKEltLlBST1RPQ09MKSArICJcIiwgY3VzdG9tX3Byb3RvY29sPVwiIiArCisgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKEltLkNVU1RPTV9QUk9UT0NPTCkgKyAiXCIiKTsKKworICAgICAgICAgICAgICAgIGlmICh0eXBlID09IEltLlBST1RPQ09MX0dPT0dMRV9UQUxLKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChWQ2FyZENvbmZpZy51c2VzQW5kcm9pZFNwZWNpZmljUHJvcGVydHkobVZDYXJkVHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFZDYXJkTGluZShidWlsZGVyLCBDb25zdGFudHMuUFJPUEVSVFlfWF9HT09HTEVfVEFMSywgZGF0YSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogYWRkICJYLUdPT0dMRSBUQUxLIiBjYXNlLi4uCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAgICAgICAgICAgIAorICAgICAgICB9CisgICAgfQorICAgIAorICAgIHByaXZhdGUgdm9pZCBhcHBlbmRXZWJzaXRlcyhmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIsCisgICAgICAgICAgICBmaW5hbCBNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PiBjb250ZW50VmFsdWVzTGlzdE1hcCkgeworICAgICAgICBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0ID0gY29udGVudFZhbHVlc0xpc3RNYXAKKyAgICAgICAgICAgICAgICAuZ2V0KFdlYnNpdGUuQ09OVEVOVF9JVEVNX1RZUEUpOworICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyB3ZWJzaXRlID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhXZWJzaXRlLlVSTCk7CisgICAgICAgICAgICAgICAgYXBwZW5kVkNhcmRMaW5lKGJ1aWxkZXIsIFZDQVJEX1BST1BFUlRZX1VSTCwgd2Vic2l0ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSB2b2lkIGFwcGVuZEJpcnRoZGF5KGZpbmFsIFN0cmluZ0J1aWxkZXIgYnVpbGRlciwKKyAgICAgICAgICAgIGZpbmFsIE1hcDxTdHJpbmcsIExpc3Q8Q29udGVudFZhbHVlcz4+IGNvbnRlbnRWYWx1ZXNMaXN0TWFwKSB7CisgICAgICAgIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QgPSBjb250ZW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NvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgY29tcGFueSA9IGNvbnRlbnRWYWx1ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRBc1N0cmluZyhPcmdhbml6YXRpb24uQ09NUEFOWSk7CisgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHRpdGxlID0gY29udGVudFZhbHVlcworICAgICAgICAgICAgICAgICAgICAgICAgLmdldEFzU3RyaW5nKE9yZ2FuaXphdGlvbi5USVRMRSk7CisgICAgICAgICAgICAgICAgYXBwZW5kVkNhcmRMaW5lKGJ1aWxkZXIsIFZDQVJEX1BST1BFUlRZX09SRywgY29tcGFueSwgdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Vc2VzUXVvdGVkUHJpbnRhYmxlKTsKKyAgICAgICAgICAgICAgICBhcHBlbmRWQ2FyZExpbmUoYnVpbGRlciwgVkNBUkRfUFJPUEVSVFlfVElUTEUsIHRpdGxlLCB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgbVVzZXNRdW90ZWRQcmludGFibGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGFwcGVuZFBob3RvcyhmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIsCisgICAgICAgICAgICBmaW5hbCBNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PiBjb250ZW50VmFsdWVzTGlzdE1hcCkgeworICAgICAgICBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0ID0gY29udGVudFZhbHVlc0xpc3RNYXAKKyAgICAgICAgICAgICAgICAuZ2V0KFBob3RvLkNPTlRFTlRfSVRFTV9UWVBFKTsKKyAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKKyAgICAgICAgICAgICAgICBieXRlW10gZGF0YSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNCeXRlQXJyYXkoUGhvdG8uUEhPVE8pOworICAgICAgICAgICAgICAgIGlmIChkYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBwaG90b1R5cGU7CisgICAgICAgICAgICAgICAgLy8gVXNlIHNvbWUgaGV1cmlzdGljcyBmb3IgZ3Vlc3NpbmcgdGhlIGZvcm1hdCBvZiB0aGUgaW1hZ2UuCisgICAgICAgICAgICAgICAgLy8gVE9ETzogdGhlcmUgc2hvdWxkIGJlIHNvbWUgZ2VuZXJhbCBBUEkgZm9yIGRldGVjdGluZyB0aGUgZmlsZSBmb3JtYXQuCisgICAgICAgICAgICAgICAgaWYgKGRhdGEubGVuZ3RoID49IDMgJiYgZGF0YVswXSA9PSAnRycgJiYgZGF0YVsxXSA9PSAnSScKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGRhdGFbMl0gPT0gJ0YnKSB7CisgICAgICAgICAgICAgICAgICAgIHBob3RvVHlwZSA9ICJHSUYiOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YS5sZW5ndGggPj0gNCAmJiBkYXRhWzBdID09IChieXRlKSAweDg5CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBkYXRhWzFdID09ICdQJyAmJiBkYXRhWzJdID09ICdOJyAmJiBkYXRhWzNdID09ICdHJykgeworICAgICAgICAgICAgICAgICAgICAvLyBOb3RlOiB2Q2FyZCAyLjEgb2ZmaWNpYWxseSBkb2VzIG5vdCBzdXBwb3J0IFBORywgYnV0IHdlCisgICAgICAgICAgICAgICAgICAgIC8vIG1heSBoYXZlIGl0CisgICAgICAgICAgICAgICAgICAgIC8vIGFuZCB1c2luZyBYLSB3b3JkIGxpa2UgIlgtUE5HIiBtYXkgbm90IGxldCBpbXBvcnRlcnMga25vdworICAgICAgICAgICAgICAgICAgICAvLyBpdCBpcworICAgICAgICAgICAgICAgICAgICAvLyBQTkcuIFNvIHdlIHVzZSB0aGUgU3RyaW5nICJQTkciIGFzIGlzLi4uCisgICAgICAgICAgICAgICAgICAgIHBob3RvVHlwZSA9ICJQTkciOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YS5sZW5ndGggPj0gMiAmJiBkYXRhWzBdID09IChieXRlKSAweGZmCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBkYXRhWzFdID09IChieXRlKSAweGQ4KSB7CisgICAgICAgICAgICAgICAgICAgIHBob3RvVHlwZSA9ICJKUEVHIjsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiVW5rbm93biBwaG90byB0eXBlLiBJZ25vcmUuIik7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTdHJpbmcgcGhvdG9TdHJpbmcgPSBWQ2FyZFV0aWxzLmVuY29kZUJhc2U2NChkYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAocGhvdG9TdHJpbmcubGVuZ3RoKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGFwcGVuZFZDYXJkUGhvdG9MaW5lKGJ1aWxkZXIsIHBob3RvU3RyaW5nLCBwaG90b1R5cGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBhcHBlbmROb3RlcyhmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIsCisgICAgICAgICAgICBmaW5hbCBNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PiBjb250ZW50VmFsdWVzTGlzdE1hcCkgeworICAgICAgICBmaW5hbCBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0ID0KKyAgICAgICAgICAgIGNvbnRlbnRWYWx1ZXNMaXN0TWFwLmdldChOb3RlLkNPTlRFTlRfSVRFTV9UWVBFKTsKKyAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtT25seU9uZU5vdGVGaWVsZElzQXZhaWxhYmxlKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBub3RlQnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7CisgICAgICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbm90ZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoTm90ZS5OT1RFKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5vdGUubGVuZ3RoKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub3RlQnVpbGRlci5hcHBlbmQoJ1xuJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBub3RlQnVpbGRlci5hcHBlbmQobm90ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYXBwZW5kVkNhcmRMaW5lKGJ1aWxkZXIsIFZDQVJEX1BST1BFUlRZX05PVEUsIG5vdGVCdWlsZGVyLnRvU3RyaW5nKCksCisgICAgICAgICAgICAgICAgICAgICAgICB0cnVlLCBtVXNlc1F1b3RlZFByaW50YWJsZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIG5vdGUgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKE5vdGUuTk9URSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobm90ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFZDYXJkTGluZShidWlsZGVyLCBWQ0FSRF9QUk9QRVJUWV9OT1RFLCBub3RlLCB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVXNlc1F1b3RlZFByaW50YWJsZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBcHBlbmQgJ1wnIHRvIHRoZSBjaGFyYWN0ZXJzIHdoaWNoIHNob3VsZCBiZSBlc2NhcGVkLiBUaGUgY2hhcmFjdGVyIHNldCBpcyBkaWZmZXJlbnQKKyAgICAgKiBub3Qgb25seSBiZXR3ZWVuIHZDYXJkIDIuMSBhbmQgdkNhcmQgMy4wIGJ1dCBhbHNvIGFtb25nIGVhY2ggZGV2aWNlLgorICAgICAqIAorICAgICAqIE5vdGUgdGhhdCBRdW90ZWQtUHJpbnRhYmxlIHN0cmluZyBtdXN0IG5vdCBiZSBpbnB1dCBoZXJlLgorICAgICAqLworICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJmYWxsdGhyb3VnaCIpCisgICAgcHJpdmF0ZSBTdHJpbmcgZXNjYXBlQ2hhcmFjdGVycyhTdHJpbmcgdW5lc2NhcGVkKSB7CisgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eSh1bmVzY2FwZWQpKSB7CisgICAgICAgICAgICByZXR1cm4gIiI7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGZpbmFsIGludCBsZW5ndGggPSB1bmVzY2FwZWQubGVuZ3RoKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIGNoYXIgY2ggPSB1bmVzY2FwZWQuY2hhckF0KGkpOworICAgICAgICAgICAgc3dpdGNoIChjaCkgeworICAgICAgICAgICAgY2FzZSAnOyc6CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJ1xcJyk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJzsnKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgJ1xyJzoKKyAgICAgICAgICAgICAgICBpZiAoaSArIDEgPCBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhciBuZXh0Q2hhciA9IHVuZXNjYXBlZC5jaGFyQXQoaSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0Q2hhciA9PSAnXG4nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSAnXG4nOgorICAgICAgICAgICAgICAgIC8vIEluIHZDYXJkIDIuMSwgdGhlcmUncyBubyBzcGVjaWZpY2F0aW9uIGFib3V0IHRoaXMsIHdoaWxlCisgICAgICAgICAgICAgICAgLy8gdkNhcmQgMy4wIGV4cGxpY2l0bHkKKyAgICAgICAgICAgICAgICAvLyByZXF1aXJlcyB0aGlzIHNob3VsZCBiZSBlbmNvZGVkIHRvICJcbiIuCisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlxcbiIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAnXFwnOgorICAgICAgICAgICAgICAgIGlmIChtSXNWMzApIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlxcXFwiKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgY2FzZSAnPCc6CisgICAgICAgICAgICBjYXNlICc+JzoKKyAgICAgICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCdcXCcpOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAnLCc6CisgICAgICAgICAgICAgICAgaWYgKG1Jc1YzMCkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXFwsIik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgI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3RoOworICAgICAgICBmaW5hbCBib29sZWFuIHVzZVF1b3RlZFByaW50YWJsZSA9IG1Vc2VzUXVvdGVkUHJpbnRhYmxlOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBTdHJpbmcgZGF0YSA9IGRhdGFBcnJheVtpXTsKKyAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGF0YSkpIHsKKyAgICAgICAgICAgICAgICBkYXRhRXhpc3RzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAodXNlUXVvdGVkUHJpbnRhYmxlKSB7CisgICAgICAgICAgICAgICAgICAgIGRhdGFBcnJheVtpXSA9IGVuY29kZVF1b3RlZFByaW50YWJsZShkYXRhKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaV0gPSBlc2NhcGVDaGFyYWN0ZXJzKGRhdGEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gdHlwZUlzQXBwZW5kZWQgPSBmYWxzZTsKKyAgICAgICAgc3dpdGNoICh0eXBlKSB7CisgICAgICAgIGNhc2UgU3RydWN0dXJlZFBvc3RhbC5UWVBFX0hPTUU6CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChDb25zdGFudHMuQVRUUl9UWVBFX0hPTUUpOworICAgICAgICAgICAgdHlwZUlzQXBwZW5kZWQgPSB0cnVlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU3RydWN0dXJlZFBvc3RhbC5UWVBFX1dPUks6CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChDb25zdGFudHMuQVRUUl9UWVBFX1dPUkspOworICAgICAgICAgICAgdHlwZUlzQXBwZW5kZWQgPSB0cnVlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTToKKyAgICAgICAgICAgIGlmIChtVXNlc0FuZHJvaWRQcm9wZXJ0eSAmJiBWQ2FyZFV0aWxzLmNvbnRhaW5zT25seUFscGhhRGlnaXRIeXBoZW4obGFiZWwpKXsKKyAgICAgICAgICAgICAgICAvLyBXZSdyZSBub3Qgc3VyZSB3aGV0aGVyIHRoZSBsYWJlbCBpcyB2YWxpZCBpbiB0aGUgc3BlYyAoIklBTkEtdG9rZW4iIGluIHRoZSB2Q2FyZCAzLjEKKyAgICAgICAgICAgICAgICAvLyBpcyB1bmNsZWFyLi4uKQorICAgICAgICAgICAgICAgIC8vIEp1c3QgZm9yIHNhZmV0eSwgd2UgYWRkICJYLSIgYXQgdGhlIGJlZ2dpbmluZyBvZiBlYWNoIGxhYmVsLgorICAgICAgICAgICAgICAgIC8vIEFsc28gY2hlY2tzIHRoZSBsYWJlbCBvYmV5cyB3aXRoIHZDYXJkIDMuMCBzcGVjLgorICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJYLSIpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxhYmVsKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfT1RIRVI6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJVbmtub3duIFN0cnVjdHVyZWRQb3N0YWwgdHlwZTogIiArIHR5cGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZGF0YUV4aXN0cykgeworICAgICAgICAgICAgaWYgKHR5cGVJc0FwcGVuZGVkKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQVRUUl9TRVBBUkFUT1IpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gU3RyaWN0bHksIHZDYXJkIDMuMCBkb2VzIG5vdCBhbGxvdyB0aGlzLCBidXQgd2UgYWRkIHRoaXMgc2luY2UKKyAgICAgICAgICAgIC8vIHRoaXMgaW5mb3JtYXRpb24KKyAgICAgICAgICAgIC8vIHNob3VsZCBiZSB1c2VmdWwsIEFzc3VtZSBubyBwYXJzZXIgZG9lcyBub3QgZW1pdCBlcnJvciB3aXRoIHRoaXMKKyAgICAgICAgICAgIC8vIGF0dHJpYnV0ZS4KKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG1WQ2FyZEF0dHJpYnV0ZUNoYXJzZXQpOworICAgICAgICAgICAgaWYgKHVzZVF1b3RlZFByaW50YWJsZSkgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0FUVFJfU0VQQVJBVE9SKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9BVFRSX0VOQ09ESU5HX1FQKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgIGlmIChkYXRhRXhpc3RzKSB7CisgICAgICAgICAgICAvLyBUaGUgZWxlbWVudHMgaW4gZGF0YUFycmF5IGFyZSBhbHJlYWR5IGVuY29kZWQgdG8gcXVvdGVkIHByaW50YWJsZQorICAgICAgICAgICAgLy8gaWYgbmVlZGVkLgorICAgICAgICAgICAgLy8gU2VlIGFib3ZlLgorICAgICAgICAgICAgLy8KKyAgICAgICAgICAgIC8vIFRPRE86IGluIHZDYXJkIDMuMCwgb25lIGxpbmUgbWF5IGJlY29tZSB0b28gaHVnZS4gRml4IHRoaXMuCisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChkYXRhQXJyYXlbMF0pOworICAgICAgICAgICAgYnVpb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5cGUpIHsKKyAgICAgICAgY2FzZSBFbWFpbC5UWVBFX0NVU1RPTToKKyAgICAgICAgICAgIGlmIChsYWJlbC5lcXVhbHMoCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQucHJvdmlkZXIuQ29udGFjdHMuQ29udGFjdE1ldGhvZHNDb2x1bW5zLk1PQklMRV9FTUFJTF9UWVBFX05BTUUpKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoQ29uc3RhbnRzLkFUVFJfVFlQRV9DRUxMKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobVVzZXNBbmRyb2lkUHJvcGVydHkgJiYgVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKSl7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlgtIik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGFiZWwpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBEZWZhdWx0IHRvIElOVEVSTkVULgorICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKENvbnN0YW50cy5BVFRSX1RZUEVfSU5URVJORVQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgRW1haWwuVFlQRV9IT01FOgorICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoQ29uc3RhbnRzLkFUVFJfVFlQRV9IT01FKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEVtYWlsLlRZUEVfV09SSzoKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKENvbnN0YW50cy5BVFRSX1RZUEVfV09SSyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBFbWFpbC5UWVBFX09USEVSOgorICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoQ29uc3RhbnRzLkFUVFJfVFlQRV9JTlRFUk5FVCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBFbWFpbC5UWVBFX01PQklMRToKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKENvbnN0YW50cy5BVFRSX1RZUEVfQ0VMTCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJVbmtub3duIEVtYWlsIHR5cGU6ICIgKyB0eXBlKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKENvbnN0YW50cy5BVFRSX1RZUEVfSU5URVJORVQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGRhdGEpOworICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9DT0xfU0VQQVJBVE9SKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgYXBwZW5kVkNhcmRUZWxlcGhvbmVMaW5lKFN0cmluZ0J1aWxkZXIgYnVpbGRlciwgaW50IHR5cGUsCisgICAgICAgICAgICBTdHJpbmcgbGFiZWwsIFN0cmluZyBlbmNvZGVkRGF0YSkgeworICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9QUk9QRVJUWV9URUwpOworICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9BVFRSX1NFUEFSQVRPUik7CisKKyAgICAgICAgc3dpdGNoICh0eXBlKSB7CisgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9IT01FOgorICAgICAgICAgICAgYXBwZW5kVHlwZUF0dHJpYnV0ZXMoYnVpbGRlciwgQXJyYXlzLmFzTGlzdCgKKyAgICAgICAgICAgICAgICAgICAgQ29uc3RhbnRzLkFUVFJfVFlQRV9IT01FLCBDb25zdGFudHMuQVRUUl9UWVBFX1ZPSUNFKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1dPUks6CisgICAgICAgICAgICBhcHBlbmRUeXBlQXR0cmlidXRlcyhidWlsZGVyLCBBcnJheXMuYXNMaXN0KAorICAgICAgICAgICAgICAgICAgICBDb25zdGFudHMuQVRUUl9UWVBFX1dPUkssIENvbnN0YW50cy5BVFRSX1RZUEVfVk9JQ0UpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFBob25lLlRZUEVfRkFYX0hPTUU6CisgICAgICAgICAgICBhcHBlbmRUeXBlQXR0cmlidXRlcyhidWlsZGVyLCBBcnJheXMuYXNMaXN0KAorICAgICAgICAgICAgICAgICAgICBDb25zdGFudHMuQVRUUl9UWVBFX0hPTUUsIENvbnN0YW50cy5BVFRSX1RZUEVfRkFYKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0ZBWF9XT1JLOgorICAgICAgICAgICAgYXBwZW5kVHlwZUF0dHJpYnV0ZXMoYnVpbGRlciwgQXJyYXlzLmFzTGlzdCgKKyAgICAgICAgICAgICAgICAgICAgQ29uc3RhbnRzLkFUVFJfVFlQRV9XT1JLLCBDb25zdGFudHMuQVRUUl9UWVBFX0ZBWCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9NT0JJTEU6CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChDb25zdGFudHMuQVRUUl9UWVBFX0NFTEwpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9QQUdFUjoKKyAgICAgICAgICAgIGlmIChtSXNEb0NvTW8pIHsKKyAgICAgICAgICAgICAgICAvLyBOb3Qgc3VyZSBhYm91dCB0aGUgcmVhc29uLCBidXQgcHJldmlvdXMgaW1wbGVtZW50YXRpb24gaGFkCisgICAgICAgICAgICAgICAgLy8gdXNlZCAiVk9JQ0UiIGluc3RlYWQgb2YgIlBBR0VSIgorICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKENvbnN0YW50cy5BVFRSX1RZUEVfVk9JQ0UpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChDb25zdGFudHMuQVRUUl9UWVBFX1BBR0VSKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFBob25lLlRZUEVfT1RIRVI6CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChDb25zdGFudHMuQVRUUl9UWVBFX1ZPSUNFKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFBob25lLlRZUEVfQ1VTVE9NOgorICAgICAgICAgICAgaWYgKG1Vc2VzQW5kcm9pZFByb3BlcnR5KSB7CisgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiWC0iICsgbGFiZWwpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBKdXN0IGlnbm9yZSB0aGUgY3VzdG9tIHR5cGUuCisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoQ29uc3RhbnRzLkFUVFJfVFlQRV9WT0lDRSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGFwcGVuZFVuY29tbW9uUGhvbmVUeXBlKGJ1aWxkZXIsIHR5cGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7CisgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVuY29kZWREYXRhKTsKKyAgICAgICAgYnVpbGRlci5hcHBlbmQoVkNBUkRfQ09MX1NFUEFSQVRPUik7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXBwZW5kcyBwaG9uZSB0eXBlIHN0cmluZyB3aGljaCBtYXkgbm90IGJlIGF2YWlsYWJsZSBpbiBzb21lIGRldmljZXMuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGFwcGVuZFVuY29tbW9uUGhvbmVUeXBlKFN0cmluZ0J1aWxkZXIgYnVpbGRlciwgaW50IHR5cGUpIHsKKyAgICAgICAgaWYgKG1Jc0RvQ29NbykgeworICAgICAgICAgICAgLy8gVGhlIHByZXZpb3VzIGltcGxlbWVudGF0aW9uIGZvciBEb0NvTW8gaGFkIGJlZW4gY29uc2VydmF0aXZlCisgICAgICAgICAgICAvLyBhYm91dAorICAgICAgICAgICAgLy8gbWlzY2VsbGFuZW91cyB0eXBlcy4KKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKENvbnN0YW50cy5BVFRSX1RZUEVfVk9JQ0UpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgU3RyaW5nIHBob25lQXR0cmlidXRlID0gVkNhcmRVdGlscy5nZXRQaG9uZUF0dHJpYnV0ZVN0cmluZyh0eXBlKTsKKyAgICAgICAgICAgIGlmIChwaG9uZUF0dHJpYnV0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQocGhvbmVBdHRyaWJ1dGUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiVW5rbm93biBvciB1bnN1cHBvcnRlZCAoYnkgdkNhcmQpIFBob25lIHR5cGU6ICIgKyB0eXBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBhcHBlbmRWQ2FyZExpbmUoZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyLAorICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByb3BlcnR5TmFtZSwgZmluYWw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ta25vd24pIGFwcGxpY2F0aW9ucyBkbyBub3QgY2FyZSB0aGlzLiAKKyAgICAgICAgICAgIGVuY29kZWREYXRhID0gZXNjYXBlQ2hhcmFjdGVycyhyYXdEYXRhKTsKKyAgICAgICAgfQorCisgICAgICAgIGJ1aWxkZXIuYXBwZW5kKFZDQVJEX0RBVEFfU0VQQVJBVE9SKTsKKyAgICAgICAgYnVpbGRlci5hcHBlbmQoZW5jb2RlZERhdGEpOworICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9DT0xfU0VQQVJBVE9SKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgYXBwZW5kVHlwZUF0dHJpYnV0ZXMoZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyLAorICAgICAgICAgICAgZmluYWwgTGlzdDxTdHJpbmc+IHR5cGVzKSB7CisgICAgICAgIC8vIFdlIG1heSBoYXZlIHRvIG1ha2UgdGhpcyBjb21tYSBzZXBhcmF0ZWQgZm9ybSBsaWtlICJUWVBFPURPTSxXT1JLIiBpbiB0aGUgZnV0dXJlLAorICAgICAgICAvLyB3aGljaCB3b3VsZCBiZSByZWNvbW1lbmRlZCB3YXkgaW4gdmNhcmQgMy4wIHRob3VnaCBub3QgdmFsaWQgaW4gdkNhcmQgMi4xLgorICAgICAgICBib29sZWFuIGZpcnN0ID0gdHJ1ZTsKKyAgICAgICAgZm9yIChTdHJpbmcgdHlwZSA6IHR5cGVzKSB7CisgICAgICAgICAgICBpZiAoZmlyc3QpIHsKKyAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChWQ0FSRF9BVFRSX1NFUEFSQVRPUik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUlzVjMwKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoQ29uc3RhbnRzLkFUVFJfVFlQRSk7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJz0nKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHR5cGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBTdHJpbmcgZW5jb2RlUXVvdGVkUHJpbnRhYmxlKFN0cmluZyBzdHIpIHsKKyAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHN0cikpIHsKKyAgICAgICAgICAgIHJldHVybiAiIjsKKyAgICAgICAgfQorICAgICAgICB7CisgICAgICAgICAgICAvLyBSZXBsYWNlICJcbiIgYW5kICJcciIgd2l0aCAiXHJcbiIuCisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHRtcEJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgaW50IGxlbmd0aCA9IHN0ci5sZW5ndGgoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICBjaGFyIGNoID0gc3RyLmNoYXJBdChpKTsKKyAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJ1xyJykgeworICAgICAgICAgICAgICAgICAgICBpZiAoaSArIDEgPCBsZW5ndGggJiYgc3RyLmNoYXJBdChpICsgMSkgPT0gJ1xuJykgeworICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKCJcclxuIik7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnXG4nKSB7CisgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKCJcclxuIik7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoY2gpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN0ciA9IHRtcEJ1aWxkZXIudG9TdHJpbmcoKTsKKyAgICAgICAgfQorCisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGludCBpbmRleCA9IDA7CisgICAgICAgIGludCBsaW5lQ291bnQgPSAwOworICAgICAgICBieXRlW10gc3RyQXJyYXkgPSBudWxsOworCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBzdHJBcnJheSA9IHN0ci5nZXRCeXRlcyhtQ2hhcnNldFN0cmluZyk7CisgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkRW5jb2RpbmdFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkNoYXJzZXQgIiArIG1DaGFyc2V0U3RyaW5nICsgIiBjYW5ub3QgYmUgdXNlZC4gIgorICAgICAgICAgICAgICAgICAgICArICJUcnkgZGVmYXVsdCBjaGFyc2V0Iik7CisgICAgICAgICAgICBzdHJBcnJheSA9IHN0ci5nZXRCeXRlcygpOworICAgICAgICB9CisgICAgICAgIHdoaWxlIChpbmRleCA8IHN0ckFycmF5Lmxlbmd0aCkgeworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoU3RyaW5nLmZvcm1hdCgiPSUwMlgiLCBzdHJBcnJheVtpbmRleF0pKTsKKyAgICAgICAgICAgIGluZGV4ICs9IDE7CisgICAgICAgICAgICBsaW5lQ291bnQgKz0gMzsKKworICAgICAgICAgICAgaWYgKGxpbmVDb3VudCA+PSA2NykgeworICAgICAgICAgICAgICAgIC8vIFNwZWNpZmljYXRpb24gcmVxdWlyZXMgQ1JMRiBtdXN0IGJlIGluc2VydGVkIGJlZm9yZSB0aGUKKyAgICAgICAgICAgICAgICAvLyBsZW5ndGggb2YgdGhlIGxpbmUKKyAgICAgICAgICAgICAgICAvLyBiZWNvbWVzIG1vcmUgdGhhbiA3Ni4KKyAgICAg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KKyAgICAgICAgcmV0dXJuICgodmNhcmRUeXBlICYgRkxBR19WMzApICE9IDApOyAgCisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBib29sZWFuIHVzZXNRdW90ZWRQcmludGFibGUoaW50IHZjYXJkVHlwZSkgeworICAgICAgICByZXR1cm4gIWlzVjMwKHZjYXJkVHlwZSk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBib29sZWFuIGlzRG9Db01vKGludCB2Y2FyZFR5cGUpIHsKKyAgICAgICAgcmV0dXJuICgodmNhcmRUeXBlICYgRkxBR19ET0NPTU8pICE9IDApOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIGRldmljZSBpcyBKYXBhbmVzZSBhbmQgc29tZSBKYXBhbmVzZSBjb252ZW5zaW9uIGlzCisgICAgICogYXBwbGllZCB0byBjcmVhdGluZyAiZm9ybWF0dGVkIiBzb21ldGhpbmcgbGlrZSBGT1JNQVRURURfQUREUkVTUy4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gaXNKYXBhbmVzZURldmljZShpbnQgdmNhcmRUeXBlKSB7CisgICAgICAgIHJldHVybiAoKHZjYXJkVHlwZSA9PSBWQ0FSRF9UWVBFX1YyMV9KQVBBTkVTRSkgfHwKKyAgICAgICAgICAgICAgICAodmNhcmRUeXBlID09IFZDQVJEX1RZUEVfVjIxX0pBUEFORVNFX1VURjgpIHx8CisgICAgICAgICAgICAgICAgKHZjYXJkVHlwZSA9PSBWQ0FSRF9UWVBFX1YzMF9KQVBBTkVTRSkgfHwKKyAgICAgICAgICAgICAgICAodmNhcmRUeXBlID09IFZDQVJEX1RZUEVfVjMwX0pBUEFORVNFX1VURjgpIHx8CisgICAgICAgICAgICAgICAgKHZjYXJkVHlwZSA9PSBWQ0FSRF9UWVBFX0RPQ09NTykpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiB1c2VzU2hpZ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aWxkZXIoaW50IHZjYXJkVHlwZSkgeworICAgICAgICB0aGlzKG51bGwsIG51bGwsIGZhbHNlLCB2Y2FyZFR5cGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlIAorICAgICAqLworICAgIHB1YmxpYyBWQ2FyZERhdGFCdWlsZGVyKFN0cmluZyBjaGFyc2V0LCBib29sZWFuIHN0cmljdExpbmVCcmVha1BhcnNpbmcsIGludCB2Y2FyZFR5cGUpIHsKKyAgICAgICAgdGhpcyhudWxsLCBjaGFyc2V0LCBzdHJpY3RMaW5lQnJlYWtQYXJzaW5nLCB2Y2FyZFR5cGUpOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBWQ2FyZERhdGFCdWlsZGVyKFN0cmluZyBzb3VyY2VDaGFyc2V0LAorICAgICAgICAgICAgU3RyaW5nIHRhcmdldENoYXJzZXQsCisgICAgICAgICAgICBib29sZWFuIHN0cmljdExpbmVCcmVha1BhcnNpbmcsCisgICAgICAgICAgICBpbnQgdmNhcmRUeXBlKSB7CisgICAgICAgIGlmIChzb3VyY2VDaGFyc2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Tb3VyY2VDaGFyc2V0ID0gc291cmNlQ2hhcnNldDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1Tb3VyY2VDaGFyc2V0ID0gVkNhcmRDb25maWcuREVGQVVMVF9DSEFSU0VUOworICAgICAgICB9CisgICAgICAgIGlmICh0YXJnZXRDaGFyc2V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1UYXJnZXRDaGFyc2V0ID0gdGFyZ2V0Q2hhcnNldDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1UYXJnZXRDaGFyc2V0ID0gVEFSR0VUX0NIQVJTRVQ7CisgICAgICAgIH0KKyAgICAgICAgbVN0cmljdExpbmVCcmVha1BhcnNpbmcgPSBzdHJpY3RMaW5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CisgICAgICAgICAgICAvLyBUT0RPOiBzaG91bGQgdGhyb3cgc29tZSBFeGNlcHRpb24KKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJOZXN0ZWQgVkNhcmQgY29kZSBpcyBub3Qgc3VwcG9ydGVkIG5vdy4iKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoIXR5cGUuZXF1YWxzSWdub3JlQ2FzZSgiVkNBUkQiKSkgeworICAgICAgICAgICAgLy8gVE9ETzogYWRkIHRlc3QgY2FzZSBmb3IgdGhpcworICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIlRoaXMgaXMgbm90IFZDQVJEISIpOworICAgICAgICB9CisKKyAgICAgICAgbUN1cnJlbnRDb250YWN0U3RydWN0ID0gbmV3IENvbnRhY3RTdHJ1Y3QobVZDYXJkVHlwZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZW5kUmVjb3JkKCkgeworICAgICAgICBtQ3VycmVudENvbnRhY3RTdHJ1Y3QuY29uc29saWRhdGVGaWVsZHMoKTsKKyAgICAgICAgZm9yIChFbnRyeUhhbmRsZXIgZW50cnlIYW5kbGVyIDogbUVudHJ5SGFuZGxlcnMpIHsKKyAgICAgICAgICAgIGVudHJ5SGFuZGxlci5vbkVudHJ5Q3JlYXRlZChtQ3VycmVudENvbnRhY3RTdHJ1Y3QpOworICAgICAgICB9CisgICAgICAgIG1DdXJyZW50Q29udGFjdFN0cnVjdCA9IG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3RhcnRQcm9wZXJ0eSgpIHsKKyAgICAgICAgbUN1cnJlbnRQcm9wZXJ0eS5jbGVhcigpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGVuZFByb3BlcnR5KCkgeworICAgICAgICBtQ3VycmVudENvbnRhY3RTdHJ1Y3QuYWRkUHJvcGVydHkobUN1cnJlbnRQcm9wZXJ0eSk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHByb3BlcnR5TmFtZShTdHJpbmcgbmFtZSkgeworICAgICAgICBtQ3VycmVudFByb3BlcnR5LnNldFByb3BlcnR5TmFtZShuYW1lKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eUdyb3VwKFN0cmluZyBncm91cCkgeworICAgICAgICAvLyBDb250YWN0U3RydWN0IGRvZXMgbm90IHN1cHBvcnQgR3JvdXAuCisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHByb3BlcnR5UGFyYW1UeXBlKFN0cmluZyB0eXBlKSB7CisgICAgICAgIGlmIChtUGFyYW1UeXBlICE9IG51bGwpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJwcm9wZXJ0eVBhcmFtVHlwZSgpIGlzIGNhbGxlZCBtb3JlIHRoYW4gb25jZSAiICsKKyAgICAgICAgICAgICAgICAgICAgImJlZm9yZSBwcm9wZXJ0eVBhcmFtVmFsdWUoKSBpcyBjYWxsZWQiKTsKKyAgICAgICAgfQorICAgICAgICBtUGFyYW1UeXBlID0gdHlwZTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eVBhcmFtVmFsdWUoU3RyaW5nIHZhbHVlKSB7CisgICAgICAgIGlmIChtUGFyYW1UeXBlID09IG51bGwpIHsKKyAgICAgICAgICAgIC8vIEZyb20gdkNhcmQgMi4xIHNwZWNpZmljYXRpb24uIHZDYXJkIDMuMCBmb3JtYWxseSBkb2VzIG5vdCBhbGxvdyB0aGlzIGNhc2UuCisgICAgICAgICAgICBtUGFyYW1UeXBlID0gIlRZUEUiOworICAgICAgICB9CisgICAgICAgIG1DdXJyZW50UHJvcGVydHkuYWRkUGFyYW1ldGVyKG1QYXJhbVR5cGUsIHZhbHVlKTsKKyAgICAgICAgbVBhcmFtVHlwZSA9IG51bGw7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgU3RyaW5nIGVuY29kZVN0cmluZyhTdHJpbmcgb3JpZ2luYWxTdHJpbmcsIFN0cmluZyB0YXJnZXRD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mcgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKGVuY29kaW5nLmVxdWFscygiQkFTRTY0IikgfHwgZW5jb2RpbmcuZXF1YWxzKCJCIikpIHsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFByb3BlcnR5LnNldFByb3BlcnR5Qnl0ZXMoQmFzZTY0LmRlY29kZUJhc2U2NCh2YWx1ZS5nZXRCeXRlcygpKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChlbmNvZGluZy5lcXVhbHMoIlFVT1RFRC1QUklOVEFCTEUiKSkgeworICAgICAgICAgICAgICAgIC8vICI9ICIgLT4gIiAiLCAiPVx0IiAtPiAiXHQiLgorICAgICAgICAgICAgICAgIC8vIFByZXZpb3VzIGNvZGUgaGFkIGRvbmUgdGhpcyByZXBsYWNlbWVudC4gS2VlcCBvbiB0aGUgc2FmZSBzaWRlLgorICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgaW50IGxlbmd0aCA9IHZhbHVlLmxlbmd0aCgpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhciBjaCA9IHZhbHVlLmNoYXJBdChpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09ICc9JyAmJiBpIDwgbGVuZ3RoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBuZXh0Q2ggPSB2YWx1ZS5jaGFyQXQoaSArIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRDaCA9PSAnICcgfHwgbmV4dENoID09ICdcdCcpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG5leHRDaCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU3RyaW5nIHF1b3RlZFByaW50YWJsZSA9IGJ1aWxkZXIudG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBTdHJpbmdbXSBsaW5lczsKKyAgICAgICAgICAgICAgICBpZiAobVN0cmljdExpbmVCcmVha1BhcnNpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgbGluZXMgPSBxdW90ZWRQcmludGFibGUuc3BsaXQoIlxyXG4iKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gcXVvdGVkUHJpbnRhYmxlLmxlbmd0aCgpOworICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBsaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgY2ggPSBxdW90ZWRQcmludGFibGUuY2hhckF0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09ICdcbicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChidWlsZGVyLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnXHInKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA8IGxlbmd0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBuZXh0Q2ggPSBxdW90ZWRQcmludGFibGUuY2hhckF0KGkgKyAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRDaCA9PSAnXG4nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmluYWxMaW5lID0gYnVpbGRlci50b1N0cmluZygpOworICAgICAgICAgICAgICAgICAgICBpZiAoZmluYWxMaW5lLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5hZGQoZmluYWxMaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IGxpc3QudG9BcnJheShuZXcgU3RyaW5nWzBdKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgbGluZSA6IGxpbmVzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsaW5lLmVuZHNXaXRoKCI9IikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUgPSBsaW5lLnN1YnN0cmluZygwLCBsaW5lLmxlbmd0aCgpIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ5dGVbXSBieXRlczsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBieXRlcyA9IGJ1aWxkZXIudG9TdHJpbmcoKS5nZXRCeXRlcyhtU291cmNlQ2hhcnNldCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlMSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRmFpbGVkIHRvIGVuY29kZTogY2hhcnNldD0iICsgbVNvdXJjZUNoYXJzZXQpOworICAgICAgICAgICAgICAgICAgICBieXRlcyA9IGJ1aWxkZXIudG9TdHJpbmcoKS5nZXRCeXRlcygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBieXRlcyA9IFF1b3RlZFByaW50YWJsZUNvZGVjLmRlY29kZVF1b3RlZFByaW50YWJsZShieXRlcyk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRGVjb2RlckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gZGVjb2RlIHF1b3RlZC1wcmludGFibGU6ICIgKyBlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGJ5dGVzLCB0YXJnZXRDaGFyc2V0KTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBlbmNvZGU6IGNoYXJzZXQ9IiArIHRhcmdldENoYXJzZXQpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0cmluZyhieXRlcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gVW5rbm93biBlbmNvZGluZy4gRmFsbCBiYWNrIHRvIGRlZmF1bHQuCisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGVuY29kZVN0cmluZyh2YWx1ZSwgdGFyZ2V0Q2hhcnNldCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHByb3BlcnR5VmFsdWVzKExpc3Q8U3RyaW5nPiB2YWx1ZXMpIHsKKyAgICAgICAgaWYgKHZhbHVlcyA9PSBudWxsIHx8IHZhbHVlcy5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgQ29sbGVjdGlvbjxTdHJpbmc+IGNoYXJzZXRDb2xsZWN0aW9uID0gbUN1cnJlbnRQcm9wZXJ0eS5nZXRQYXJhbWV0ZXJzKCJDSEFSU0VUIik7CisgICAgICAgIFN0cmluZyBjaGFyc2V0ID0KKyAgICAgICAgICAgICgoY2hhcnNldENvbGxlY3Rpb24gIT0gbnVsbCkgPyBjaGFyc2V0Q29sbGVjdGlvbi5pdGVyYXRvcigpLm5leHQoKSA6IG51bGwpOworICAgICAgICBTdHJpbmcgdGFyZ2V0Q2hhcnNldCA9IENoYXJzZXRVdGlscy5uYW1lRm9yRGVmYXVsdFZlbmRvcihjaGFyc2V0KTsgCisgICAgICAgIAorICAg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LnV0aWwuTGlzdDsKKworcHVibGljIGNsYXNzIFZDYXJkRW50cnlDb3VudGVyIGltcGxlbWVudHMgVkNhcmRCdWlsZGVyIHsKKyAgICBwcml2YXRlIGludCBtQ291bnQ7CisgICAgCisgICAgcHVibGljIGludCBnZXRDb3VudCgpIHsKKyAgICAgICAgcmV0dXJuIG1Db3VudDsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc3RhcnQoKSB7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGVuZCgpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdGFydFJlY29yZChTdHJpbmcgdHlwZSkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGVuZFJlY29yZCgpIHsKKyAgICAgICAgbUNvdW50Kys7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHN0YXJ0UHJvcGVydHkoKSB7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGVuZFByb3BlcnR5KCkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHByb3BlcnR5R3JvdXAoU3RyaW5nIGdyb3VwKSB7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcHJvcGVydHlOYW1lKFN0cmluZyBuYW1lKSB7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcHJvcGVydHlQYXJhbVR5cGUoU3RyaW5nIHR5cGUpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eVBhcmFtVmFsdWUoU3RyaW5nIHZhbHVlKSB7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcHJvcGVydHlWYWx1ZXMoTGlzdDxTdHJpbmc+IHZhbHVlcykgeworICAgIH0gICAgCit9ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcGltL3ZjYXJkL1ZDYXJkUGFyc2VyLmphdmEgYi9jb3JlL2phdmEvYW5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QRV9GT01BKSB7CisgICAgICAgICAgICBtTmVzdENvdW50ID0gMTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBQYXJzZSB0aGUgZmlsZSBhdCB0aGUgZ2l2ZW4gcG9zaXRpb24KKyAgICAgKiB2Y2FyZF9maWxlID0gW3dzbHNdIHZjYXJkIFt3c2xzXQorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIHBhcnNlVkNhcmRGaWxlKCkgdGhyb3dzIElPRXhjZXB0aW9uLCBWQ2FyZEV4Y2VwdGlvbiB7CisgICAgICAgIGJvb2xlYW4gZmlyc3RSZWFkaW5nID0gdHJ1ZTsKKyAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgIGlmIChtQ2FuY2VsZWQpIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghcGFyc2VPbmVWQ2FyZChmaXJzdFJlYWRpbmcpKSB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmaXJzdFJlYWRpbmcgPSBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtTmVzdENvdW50ID4gMCkgeworICAgICAgICAgICAgYm9vbGVhbiB1c2VDYWNoZSA9IHRydWU7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1OZXN0Q291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIHJlYWRFbmRWQ2FyZCh1c2VDYWNoZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgdXNlQ2FjaGUgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCBTdHJpbmcgZ2V0VmVyc2lvbigpIHsKKyAgICAgICAgcmV0dXJuICIyLjEiOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIHRydWUgd2hlbiB0a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ZyBnZXRMaW5lKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgcmV0dXJuIG1SZWFkZXIucmVhZExpbmUoKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQHJldHVybiBTdHJpbmcgd2l0aCBpdCdzIGxlbmd0aCA+IDAKKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCisgICAgICogQHRocm93cyBWQ2FyZEV4Y2VwdGlvbiB3aGVuIHRoZSBzdHJlYW0gcmVhY2hlZCBlbmQgb2YgbGluZQorICAgICAqLworICAgIHByb3RlY3RlZCBTdHJpbmcgZ2V0Tm9uRW1wdHlMaW5lKCkgdGhyb3dzIElPRXhjZXB0aW9uLCBWQ2FyZEV4Y2VwdGlvbiB7CisgICAgICAgIFN0cmluZyBsaW5lOworICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgbGluZSA9IGdldExpbmUoKTsKKyAgICAgICAgICAgIGlmIChsaW5lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIlJlYWNoZWQgZW5kIG9mIGJ1ZmZlci4iKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS50cmltKCkubGVuZ3RoKCkgPiAwKSB7ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHJldHVybiBsaW5lOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqICB2Y2FyZCAgICAgICAgPSAiQkVHSU4iIFt3c10gIjoiIFt3c10gIlZDQVJEIiBbd3NdIDEqQ1JMRgorICAgICAqICAgICAgICAgICAgICAgICBpdGVtcyAqQ1JMRgorICAgICAqICAgICAgICAgICAgICAgICAiRU5EIiBbd3NdICI6IiBbd3NdICJWQ0FSRCIKKyAgICAgKi8KKyAgICBwcml2YXRlIGJvb2xlYW4gcGFyc2VPbmVWQ2FyZChib29sZWFuIGZpcnN0UmVhZGluZykgdGhyb3dzIElPRXhjZXB0aW9uLCBWQ2FyZEV4Y2VwdGlvbiB7CisgICAgICAgIGJvb2xlYW4gYWxsb3dHYXJiYWdlID0gZmFsc2U7CisgICAgICAgIGlmIChmaXJzdFJlYWRpbmcpIHsKKyAgICAgICAgICAgIGlmIChtTmVzdENvdW50ID4gMCkgeworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU5lc3RDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghcmVhZEJlZ2luVkNhcmQoYWxsb3dHYXJiYWdlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGFsbG93R2FyYmFnZSA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCFyZWFkQmVnaW5WQ2FyZChhbGxvd0dhcmJhZ2UpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgbG9uZyBzdGFydDsKKyAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIHN0YXJ0ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CisgICAgICAgICAgICBtQnVpbGRlci5zdGFydFJlY29yZCgiVkNBUkQiKTsKKyAgICAgICAgICAgIG1UaW1lUmVhZFN0YXJ0UmVjb3JkICs9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7CisgICAgICAgIH0KKyAgICAgICAgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgcGFyc2VJdGVtcygpOworICAgICAgICBtVGltZVBhcnNlSXRlbXMgKz0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzdGFydDsKKyAgICAgICAgcmVhZEVuZFZDYXJkKHRydWUsIGZhbHNlKTsKKyAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIHN0YXJ0ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CisgICAgICAgICAgICBtQnVpbGRlci5lbmRSZWNvcmQoKTsKKyAgICAgICAgICAgIG1UaW1lUmVhZEVuZFJlY29yZCArPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHN0YXJ0OworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRydWUgd2hlbiBzdWNjZXNzZnVsLiBGYWxzZSB3aGVuIHJlYWNoaW5nIHRoZSBlbmQgb2YgbGluZSAgCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbgorICAgICAqIEB0aHJvd3MgVkNhcmRFeGNlcHRpb24KKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgYm9vbGVhbiByZWFkQmVnaW5WQ2FyZChib29sZWFuIGFsbG93R2FyYmFnZSkKKyAgICAgICAgICAgIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24geworICAgICAgICBTdHJpbmcgbGluZTsKKyAgICAgICAgZG8geworICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgICAgICBsaW5lID0gZ2V0TGluZSgpOworICAgICAgICAgICAgICAgIGlmIChsaW5lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS50cmltKCkubGVuZ3RoKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFN0cmluZ1tdIHN0ckFycmF5ID0gbGluZS5zcGxpdCgiOiIsIDIpOworICAgICAgICAgICAgaW50IGxlbmd0aCA9IHN0ckFycmF5Lmxlbmd0aDsKKworICAgICAgICAgICAgLy8gVGhvdWdoIHZDYXJkIDIuMS8zLjAgc3BlY2lmaWNhdGlvbiBkb2VzIG5vdCBhbGxvdyBsb3dlciBjYXNlcywKKyAgICAgICAgICAgIC8vIHNvbWUgZGF0YSBtYXkgaGF2ZSB0aGVtLCBzbyB3ZSBhbGxvdyBpdCAoQWN0dWFsbHksIHByZXZpb3VzIGNvZGUKKyAgICAgICAgICAgIC8vIGhhZCBleHBsaWNpdGx5IGFsbG93ZWQgIkJFR0lOOnZDYXJkIiB0aG91Z2ggdGhlcmUncyBubyBleGFtcGxlKS4KKyAgICAgICAgICAgIGlmIChsZW5ndGggPT0gMiAmJgorICAgICAgICAgICAgICAgICAgICBzdHJBcnJheVswXS50cmltKCkuZXF1YWxzSWdub3JlQ2FzZSgiQkVHSU4iKSAmJgorICAgICAgICAgICAgICAgICAgICBzdHJBcnJheVsxXS50cmltKCkuZXF1YWxzSWdub3JlQ2FzZSgiVkNBUkQiKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmICghYWxsb3dHYXJiYWdlKSB7CisgICAgICAgICAgICAgICAgaWYgKG1OZXN0Q291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJFeHBlY3RlZCBTdHJpbmcgXCJCRUdJTjpWQ0FSRFwiIGRpZCBub3QgY29tZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiKEluc3RlYWQsIFwiIiArIGxpbmUgKyAiXCIgY2FtZSkiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gd2hpbGUoYWxsb3dHYXJiYWdlKTsKKworICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIlJlYWNoZWQgd2hlcmUgbXVzdCBub3QgYmUgcmVhY2hlZC4iKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgYXJndW1lbnRzIHVzZUNhY2hlIGFuZCBhbGxvd0dhcmJhc2UgYXJlIHVzdWFsbHkgdHJ1ZSBhbmQgZmFsc2UgYWNjb3JkaW5nbHkgd2hlbgorICAgICAqIHRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIG91dHNpZGUgdGhpcyBmdW5jdGlvbiBpdHNlbGYuIAorICAgICAqIAorICAgICAqIEBwYXJhbSB1c2VDYWNoZSBXaGVuIHRydWUsIGxpbmUgaXMgb2J0YWluZWQgZnJvbSBtUHJldmlvdXNsaW5lLiBPdGhlcndpc2UsIGdldExpbmUoKQorICAgICAqIGlzIHVzZWQuCisgICAgICogQHBhcmFtIGFsbG93R2FyYmFnZSBXaGVuIHRydWUsIGlnbm9yZSBub24gIkVORDpWQ0FSRCIgbGluZS4KKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCisgICAgICogQHRocm93cyBWQ2FyZEV4Y2VwdGlvbgorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIHJlYWRFbmRWQ2FyZChib29sZWFuIHVzZUNhY2hlLCBib29sZWFuIGFsbG93R2FyYmFnZSkKKyAgICAgICAgICAgIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24geworICAgICAgICBTdHJpbmcgbGluZTsKKyAgICAgICAgZG8geworICAgICAgICAgICAgaWYgKHVzZUNhY2hlKSB7CisgICAgICAgICAgICAgICAgLy8gVGhvdWdoIHZDYXJkIHNwZWNpZmljYXRpb24gZG9lcyBub3QgYWxsb3cgbG93ZXIgY2FzZXMsCisgICAgICAgICAgICAgICAgLy8gc29tZSBkYXRhIG1heSBoYXZlIHRoZW0sIHNvIHdlIGFsbG93IGl0LgorICAgICAgICAgICAgICAgIGxpbmUgPSBtUHJldmlvdXNMaW5lOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICBsaW5lID0gZ2V0TGluZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkV4cGVjdGVkIEVORDpWQ0FSRCB3YXMgbm90IGZvdW5kLiIpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUudHJpbSgpLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZ1tdIHN0ckFycmF5ID0gbGluZS5zcGxpdCgiOiIsIDIpOworICAgICAgICAgICAgaWYgKHN0ckFycmF5Lmxlbmd0aCA9PSAyICYmCisgICAgICAgICAgICAgICAgICAgIHN0ckFycmF5WzBdLnRyaW0oKS5lcXVhbHNJZ25vcmVDYXNlKCJFTkQiKSAmJgorICAgICAgICAgICAgICAgICAgICBzdHJBcnJheVsxXS50cmltKCkuZXF1YWxzSWdub3JlQ2FzZSgiVkNBUkQiKSkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoIWFsbG93R2FyYmFnZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiRU5EOlZDQVJEICE9IFwiIiArIG1QcmV2aW91c0xpbmUgKyAiXCIiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHVzZUNhY2hlID0gZmFsc2U7CisgIC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ICAgICAgICAgbG9uZyBzdGFydCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICAgICAgICAgIG1CdWlsZGVyLnN0YXJ0UHJvcGVydHkoKTsKKyAgICAgICAgICAgICAgICBtVGltZVN0YXJ0UHJvcGVydHkgKz0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzdGFydDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVuZGVkID0gcGFyc2VJdGVtKCk7CisgICAgICAgICAgICBpZiAobUJ1aWxkZXIgIT0gbnVsbCAmJiAhZW5kZWQpIHsKKyAgICAgICAgICAgICAgICBsb25nIHN0YXJ0ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgbUJ1aWxkZXIuZW5kUHJvcGVydHkoKTsKKyAgICAgICAgICAgICAgICBtVGltZUVuZFByb3BlcnR5ICs9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogaXRlbSA9IFtncm91cHMgIi4iXSBuYW1lICAgIFtwYXJhbXNdICI6IiB2YWx1ZSBDUkxGCisgICAgICogICAgICAvIFtncm91cHMgIi4iXSAiQURSIiAgIFtwYXJhbXNdICI6IiBhZGRyZXNzcGFydHMgQ1JMRgorICAgICAqICAgICAgLyBbZ3JvdXBzICIuIl0gIk9SRyIgICBbcGFyYW1zXSAiOiIgb3JncGFydHMgQ1JMRgorICAgICAqICAgICAgLyBbZ3JvdXBzICIuIl0gIk4iICAgICBbcGFyYW1zXSAiOiIgbmFtZXBhcnRzIENSTEYKKyAgICAgKiAgICAgIC8gW2dyb3VwcyAiLiJdICJBR0VOVCIgW3BhcmFtc10gIjoiIHZjYXJkIENSTEYgCisgICAgICovCisgICAgcHJvdGVjdGVkIGJvb2xlYW4gcGFyc2VJdGVtKCkgdGhyb3dzI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worICAgICAgICBpbnQgbGVuZ3RoID0gbGluZS5sZW5ndGgoKTsKKyAgICAgICAgaW50IHN0YXRlID0gU1RBVEVfR1JPVVBfT1JfUFJPUE5BTUU7CisgICAgICAgIGludCBuYW1lSW5kZXggPSAwOworCisgICAgICAgIFN0cmluZ1tdIHByb3BlcnR5TmFtZUFuZFZhbHVlID0gbmV3IFN0cmluZ1syXTsKKyAgICAgICAgCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIGNoYXIgY2ggPSBsaW5lLmNoYXJBdChpKTsgCisgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CisgICAgICAgICAgICBjYXNlIFNUQVRFX0dST1VQX09SX1BST1BOQU1FOgorICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnOicpIHsgCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwcm9wZXJ0eU5hbWUgPSBsaW5lLnN1YnN0cmluZyhuYW1lSW5kZXgsIGkpOworICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydHlOYW1lLmVxdWFsc0lnbm9yZUNhc2UoIkVORCIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eU5hbWUocHJvcGVydHlOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU5hbWVBbmRWYWx1ZVswXSA9IHByb3BlcnR5TmFtZTsgCisgICAgICAgICAgICAgICAgICAgIGlmIChpIDwgbGVuZ3RoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lQW5kVmFsdWVbMV0gPSBsaW5lLnN1YnN0cmluZyhpICsgMSk7IAorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lQW5kVmFsdWVbMV0gPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvcGVydHlOYW1lQW5kVmFsdWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnLicpIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGdyb3VwTmFtZSA9IGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eUdyb3VwKGdyb3VwTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbmFtZUluZGV4ID0gaSArIDE7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHByb3BlcnR5TmFtZSA9IGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eU5hbWUuZXF1YWxzSWdub3JlQ2FzZSgiRU5EIikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLnByb3BlcnR5TmFtZShwcm9wZXJ0eU5hbWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzBdID0gcHJvcGVydHlOYW1lOworICAgICAgICAgICAgICAgICAgICBuYW1lSW5kZXggPSBpICsgMTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9QQVJBTVM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTVEFURV9QQVJBTVM6CisgICAgICAgICAgICAgICAgaWYgKGNoID09ICciJykgeworICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1BBUkFNU19JTl9EUVVPVEU7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsgCisgICAgICAgICAgICAgICAgICAgIGhhbmRsZVBhcmFtcyhsaW5lLnN1YnN0cmluZyhuYW1lSW5kZXgsIGkpKTsKKyAgICAgICAgICAgICAgICAgICAgbmFtZUluZGV4ID0gaSArIDE7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOicpIHsKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlUGFyYW1zKGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSkpOworICAgICAgICAgICAgICAgICAgICBpZiAoaSA8IGxlbmd0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzFdID0gbGluZS5zdWJzdHJpbmcoaSArIDEpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lQW5kVmFsdWVbMV0gPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvcGVydHlOYW1lQW5kVmFsdWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTVEFURV9QQVJBTVNfSU5fRFFVT1RFOgorICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnIicpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9QQVJBTVM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkludmFsaWQgbGluZTogXCIiICsgbGluZSArICJcIiIpOworICAgIH0KKyAgICAKKyAgICAKKyAgICAvKioKKyAgICAgKiBwYXJhbXMgICAgICA9ICI7IiBbd3NdIHBhcmFtbGlzdAorICAgICAqIHBhcmFtbGlzdCAgID0gcGFyYW1saXN0IFt3c10gIjsiIFt3c10gcGFyYW0KKyAgICAgKiAgICAgICAgICAgICAvIHBhcmFtCisgICAgICogcGFyYW0gICAgICAgPSAiVFlQRSIgW3dzXSAiPSIgW3dzXSBwdHlwZXZhbAorICAgICAqICAgICAgICAgICAgIC8gIlZBTFVFIiBbd3NdICI9IiBbd3NdIHB2YWx1ZXZhbAorICAgICAqICAgICAgICAgICAgIC8gIkVOQ09ESU5HIiBbd3NdICI9IiBbd3NdIHBlbmNvZGluZ3ZhbAorICAgICAqICAgICAgICAgICAgIC8gIkNIQVJTRVQiIFt3c10gIj0iIFt3c10gY2hhcnNldHZhbAorICAgICAqICAgICAgICAgICAgIC8gIkxBTkdVQUdFIiBbd3NdICI9IiBbd3NdIGxhbmd2YWwKKyAgICAgKiAgICAgICAgICAgICAvICJYLSIgd29yZCBbd3NdICI9IiBbd3NdIHdvcmQKKyAgICAgKiAgICAgICAgICAgICAvIGtub3dudHlwZQorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIGhhbmRsZVBhcmFtcyhTdHJpbmcgcGFyYW1zKSB0aHJvd3MgVkNhcmRFeGNlcHRpb24geworICAgICAgICBTdHJpbmdbXSBzdHJBcnJheSA9IHBhcmFtcy5zcGxpdCgiPSIsIDIpOworICAgICAgICBpZiAoc3RyQXJyYXkubGVuZ3RoID09IDIpIHsKKyAgICAgICAgICAgIFN0cmluZyBwYXJhbU5hbWUgPSBzdHJBcnJheVswXS50cmltKCk7CisgICAgICAgICAgICBTdHJpbmcgcGFyYW1WYWx1ZSA9IHN0ckFycmF5WzFdLnRyaW0oKTsKKyAgICAgICAgICAgIGlmIChwYXJhbU5hbWUuZXF1YWxzKCJUWVBFIikpIHsKKyAgICAgICAgICAgICAgICBoYW5kbGVUeXBlKHBhcmFtVmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIGlmIChwYXJhbU5hbWUuZXF1YWxzKCJWQUxVRSIpKSB7CisgICAgICAgICAgICAgICAgaGFuZGxlVmFsdWUocGFyYW1WYWx1ZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtTmFtZS5lcXVhbHMoIkVOQ09ESU5HIikpIHsKKyAgICAgICAgICAgICAgICBoYW5kbGVFbmNvZGluZyhwYXJhbVZhbHVlKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1OYW1lLmVxdWFscygiQ0hBUlNFVCIpKSB7CisgICAgICAgICAgICAgICAgaGFuZGxlQ2hhcnNldChwYXJhbVZhbHVlKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1OYW1lLmVxdWFscygiTEFOR1VBR0UiKSkgeworICAgICAgICAgICAgICAgIGhhbmRsZUxhbmd1YWdlKHBhcmFtVmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIGlmIChwYXJhbU5hbWUuc3RhcnRzV2l0aCgiWC0iKSkgeworICAgICAgICAgICAgICAgIGhhbmRsZUFueVBhcmFtKHBhcmFtTmFtZSwgcGFyYW1WYWx1ZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiVW5rbm93biB0eXBlIFwiIiArIHBhcmFtTmFtZSArICJcIiIpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaGFuZGxlVHlwZShzdHJBcnJheVswXSk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogcHR5cGV2YWwgPSBrbm93bnR5cGUgLyAiWC0iIHdvcmQKKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgdm9pZCBoYW5kbGVUeXBlKFN0cmluZyBwdHlwZXZhbCkgeworICAgICAgICBTdHJpbmcgdXBwZXJUeXBlVmFsdWUgPSBwdHlwZXZhbDsKKyAgICAgICAgaWYgKCEoc0tub3duVHlwZVNldC5jb250YWlucyh1cHBlclR5cGVWYWx1ZSkgfHwgdXBwZXJUeXBlVmFsdWUuc3RhcnRzV2l0aCgiWC0iKSkgJiYgCisgICAgICAgICAgICAgICAgIW1XYXJuaW5nVmFsdWVNYXAuY29udGFpbnMocHR5cGV2YWwpKSB7CisgICAgICAgICAgICBtV2FybmluZ1ZhbHVlTWFwLmFkZChwdHlwZXZhbCk7CisgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiVHlwZSB1bnN1cHBvcnRlZCBieSB2Q2FyZCAyLjE6ICIgKyBwdHlwZXZhbCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1CdWlsZGVyLnByb3BlcnR5UGFyYW1UeXBlKCJUWVBFIik7CisgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eVBhcmFtVmFsdWUodXBwZXJUeXBlVmFsdWUpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIHB2YWx1ZXZhbCA9ICJJTkxJTkUiIC8gIlVSTCIgLyAiQ09OVEVOVC1JRCIgLyAiQ0lEIiAvICJYLSIgd29yZAorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIGhhbmRsZVZhbHVlKFN0cmluZyBwdmFsdWV2YWwpIHRocm93cyBWQ2FyZEV4Y2VwdGlvbiB7CisgICAgICAgIGlmIChzS25vd25WYWx1ZVNldC5jb250YWlucyhwdmFsdWV2YWwudG9VcHBlckNhc2UoKSkgfHwKKyAgICAgICAgICAgICAgICBwdmFsdWV2YWwuc3RhcnRzV2l0aCgiWC0iKSkgeworICAgICAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eVBhcmFtVHlwZSgiVkFMVUUiKTsKKyAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eVBhcmFtVmFsdWUocHZhbHVldmFsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiVW5rbm93biB2YWx1ZSBcIiIgKyBwdmFsdWV2YWwgKyAiXCIiKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBwZW5jb2Rpbmd2YWwgPSAiN0JJVCIgLyAiOEJJVCIgLyAiUVVPVEVELVBSSU5UQUJMRSIgLyAiQkFTRTY0IiAvICJYLSIgd29yZAorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIGhhbmRsZUVuY29kaW5nKFN0cmluZyBwZW5jb2Rpbmd2YWwpIHRocm93cyBWQ2FyZEV4Y2VwdGlvbiB7CisgICAgICAgIGlmIChpc1ZhbGlkRW5jb2RpbmcocGVuY29kaW5ndmFsKSB8fAorICAgICAgICAgICAgICAgIHBlbmNvZGluZ3ZhbC5zdGFydHNXaXRoKCJYLSIpKSB7CisgICAgICAgICAgICBpZiAobUJ1aWxkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1CdWlsZGVyLnByb3BlcnR5UGFyYW1UeXBlKCJFTkNPRElORyIpOworICAgICAgICAgICAgICAgIG1CdWlsZGVyLnByb3BlcnR5UGFyYW1WYWx1ZShwZW5jb2Rpbmd2YWwpOworICAgICAgICAgICA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ArICJcIiIpOworICAgICAgICB9CisgICAgICAgIFN0cmluZyB0bXAgPSBzdHJBcnJheVswXTsKKyAgICAgICAgaW50IGxlbmd0aCA9IHRtcC5sZW5ndGgoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgeworICAgICAgICAgICAgaWYgKCFpc0xldHRlcih0bXAuY2hhckF0KGkpKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiSW52YWxpZCBMYW5ndWFnZTogXCIiICsgbGFuZ3ZhbCArICJcIiIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHRtcCA9IHN0ckFycmF5WzFdOworICAgICAgICBsZW5ndGggPSB0bXAubGVuZ3RoKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIGlmICghaXNMZXR0ZXIodG1wLmNoYXJBdChpKSkpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkludmFsaWQgTGFuZ3VhZ2U6IFwiIiArIGxhbmd2YWwgKyAiXCIiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobUJ1aWxkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbUJ1aWxkZXIucHJvcGVydHlQYXJhbVR5cGUoIkxBTkdVQUdFIik7CisgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eVBhcmFtVmFsdWUobGFuZ3ZhbCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBNYWlubHkgZm9yICJYLSIgdHlwZS4gVGhpcyBhY2NlcHRzIGFueSBraW5kIG9mIHR5cGUgd2l0aG91dCBjaGVjay4KKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgdm9pZCBoYW5kbGVBbnlQYXJhbShTdHJpbmcgcGFyYW1OYW1lLCBTd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x8CisgICAgICAgICAgICAgICAgbUVuY29kaW5nLmVxdWFsc0lnbm9yZUNhc2UoIkIiKSkgeworICAgICAgICAgICAgbG9uZyBzdGFydCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICAgICAgLy8gSXQgaXMgdmVyeSByYXJlLCBidXQgc29tZSBCQVNFNjQgZGF0YSBtYXkgYmUgc28gYmlnIHRoYXQKKyAgICAgICAgICAgIC8vIE91dE9mTWVtb3J5RXJyb3Igb2NjdXJzLiBUbyBpZ25vcmUgc3VjaCBjYXNlcywgdXNlIHRyeS1jYXRjaC4KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIHJlc3VsdCA9IGdldEJhc2U2NChwcm9wZXJ0eVZhbHVlKTsKKyAgICAgICAgICAgICAgICBpZiAobUJ1aWxkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiB2ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgICAgICAgICAgICAgIHYuYWRkKHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLnByb3BlcnR5VmFsdWVzKHYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKE91dE9mTWVtb3J5RXJyb3IgZXJyb3IpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiT3V0T2ZNZW1vcnlFcnJvciBoYXBwZW5lZCBkdXJpbmcgcGFyc2luZyBCQVNFNjQgZGF0YSEiKTsKKyAgICAgICAgICAgICAgICBpZiAobUJ1aWxkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eVZhbHVlcyhudWxsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtVGltZUhhbmRsZUJhc2U2NCArPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHN0YXJ0OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKCEobUVuY29kaW5nID09IG51bGwgfHwgbUVuY29kaW5nLmVxdWFsc0lnbm9yZUNhc2UoIjdCSVQiKQorICAgICAgICAgICAgICAgICAgICB8fCBtRW5jb2RpbmcuZXF1YWxzSWdub3JlQ2FzZSgiOEJJVCIpCisgICAgICAgICAgICAgICAgICAgIHx8IG1FbmNvZGluZy50b1VwcGVyQ2FzZSgpLnN0YXJ0c1dpdGgoIlgtIikpKSB7CisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIlRoZSBlbmNvZGluZyB1bnN1cHBvcnRlZCBieSB2Q2FyZCBzcGVjOiBcIiIgKyBtRW5jb2RpbmcgKyAiXCIuIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGxvbmcgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gdiA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOworICAgICAgICAgICAgICAgIHYuYWRkKG1heWJlVW5lc2NhcGVUZXh0KHByb3BlcnR5VmFsdWUpKTsKKyAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eVZhbHVlcyh2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1UaW1lSGFuZGxlTWlzY1Byb3BlcnR5VmFsdWUgKz0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzdGFydDsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwcm90ZWN0ZWQgU3RyaW5nIGdldFF1b3RlZFByaW50YWJsZShTdHJpbmcgZmlyc3RTdHJpbmcpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24geworICAgICA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lxyXG4iKTsKKyAgICAgICAgICAgIFN0cmluZyBsaW5lOworICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgICAgICBsaW5lID0gZ2V0TGluZSgpOworICAgICAgICAgICAgICAgIGlmIChsaW5lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJGaWxlIGVuZGVkIGR1cmluZyBwYXJzaW5nIHF1b3RlZC1wcmludGFibGUgU3RyaW5nIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChsaW5lLnRyaW0oKS5lbmRzV2l0aCgiPSIpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHJlbW92ZSAidHJhbnNwb3J0LXBhZGRpbmciCisgICAgICAgICAgICAgICAgICAgIHBvcyA9IGxpbmUubGVuZ3RoKCkgLSAxOworICAgICAgICAgICAgICAgICAgICB3aGlsZShsaW5lLmNoYXJBdChwb3MpICE9ICc9JykgeworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUuc3Vic3RyaW5nKDAsIHBvcyArIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlxyXG4iKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChsaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsgCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmlyc3RTdHJpbmc7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJvdGVjdGVkIFN0cmluZyBnZXRCYXNlNjQoU3RyaW5nIGZpcnN0U3RyaW5nKSB0aHJvd3MgSU9FeGNlcHRpb24sIFZDYXJkRXhjZXB0aW9uIHsKKyAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgYnVpbGRlci5hcHBlbmQoZmlyc3RTdHJpbmcpOworICAgICAgICAKKyAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgIFN0cmluZyBsaW5lID0gZ2V0TGluZSgpOworICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJGaWxlIGVuZGVkIGR1cmluZyBwYXJzaW5nIEJBU0U2NCBiaW5hcnkiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChsaW5lLmxlbmd0aCgpID09IDApIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBNYWlubHkgZm9yICJBRFIiLCAiT1JHIiwgYW5kICJOIgorICAgICAqIFdlIGRvIG5vdCBjYXJlIHRoZSBudW1iZXIgb2Ygc3Rybm9zZW1pIGhlcmUuCisgICAgICogCisgICAgICogYWRkcmVzc3BhcnRzID0gMCo2KHN0cm5vc2VtaSAiOyIpIHN0cm5vc2VtaQorICAgICAqICAgICAgICAgICAgICA7IFBPIEJveCwgRXh0ZW5kZWQgQWRkciwgU3RyZWV0LCBMb2NhbGl0eSwgUmVnaW9uLAorICAgICAqICAgICAgICAgICAgICAgIFBvc3RhbCBDb2RlLCBDb3VudHJ5IE5hbWUKKyAgICAgKiBvcmdw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BRVU9URUQtUFJJTlRBQkxFIGhlcmUsCisgICAgICAgIC8vIGJ1dCBzb21lIHNvZnR3YXJlcy9kZXZpY2VzIGVtaXQgc3VjaCBkYXRhLgorICAgICAgICBpZiAobUVuY29kaW5nLmVxdWFsc0lnbm9yZUNhc2UoIlFVT1RFRC1QUklOVEFCTEUiKSkgeworICAgICAgICAgICAgcHJvcGVydHlWYWx1ZSA9IGdldFF1b3RlZFByaW50YWJsZShwcm9wZXJ0eVZhbHVlKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOworICAgICAgICAgICAgaW50IGxlbmd0aCA9IHByb3BlcnR5VmFsdWUubGVuZ3RoKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgY2hhciBjaCA9IHByb3BlcnR5VmFsdWUuY2hhckF0KGkpOworICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnXFwnICYmIGkgPCBsZW5ndGggLSAxKSB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoID0gcHJvcGVydHlWYWx1ZS5jaGFyQXQoaSArIDEpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdW5lc2NhcGVkU3RyaW5nID0gbWF5YmVVbmVzY2FwZUNoYXJhY3RlcihuZXh0Q2gpOyAKKyAgICAgICAgICAgICAgICAgICAgaWYgKHVuZXNjYXBlZFN0cmluZyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCh1bmVzY2FwZWRTdHJpbmcpOworICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsKKyAgICAgICAgICAgICAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7CisgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eVZhbHVlcyhsaXN0KTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiB2Q2FyZCAyLjEgc3BlY2lmaWVzIEFHRU5UIGFsbG93cyBvbmUgdmNhcmQgZW50cnkuIEl0IGlzIG5vdCBlbmNvZGVkIGF0IGFsbC4KKyAgICAgKiAKKyAgICAgKiBpdGVtICAgICA9IC4uLgorICAgICAqICAgICAgICAgIC8gW2dyb3VwcyAiLiJdICJBR0VOVCIKKyAgICAgKiAgICAgICAgICAgIFtwYXJhbXNdICI6IiB2Y2FyZCBDUkxGCisgICAgICogdmNhcmQgICAgPSAiQkVHSU4iIFt3c10gIjoiIFt3c10gIlZDQVJEIiBbd3NdIDEqQ1JMRgorICAgICAqICAgICAgICAgICAgaXRlbXMgKkNSTEYgIkVORCIgW3dzXSAiOiIgW3dzXSAiVkNBUkQiCisgICAgICogCisgICAgICovCisgICAgcHJvdGVjdGVkIHZvaWQgaGFuZGxlQWdlbnQoU3RyaW5nIHByb3BlcnR5VmFsdWUpIHRocm93cyBWQ2FyZEV4Y2Vwd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isgICAgICAgICAgICB0aHJvd3MgSU9FeGNlcHRpb24sIFZDYXJkRXhjZXB0aW9uIHsKKyAgICAgICAgZmluYWwgSW5wdXRTdHJlYW1SZWFkZXIgdG1wUmVhZGVyID0gbmV3IElucHV0U3RyZWFtUmVhZGVyKGlzLCBjaGFyc2V0KTsKKyAgICAgICAgaWYgKFZDYXJkQ29uZmlnLnNob3dQZXJmb3JtYW5jZUxvZygpKSB7CisgICAgICAgICAgICBtUmVhZGVyID0gbmV3IEN1c3RvbUJ1ZmZlcmVkUmVhZGVyKHRtcFJlYWRlcik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtUmVhZGVyID0gbmV3IEJ1ZmZlcmVkUmVhZGVyKHRtcFJlYWRlcik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIG1CdWlsZGVyID0gYnVpbGRlcjsKKworICAgICAgICBsb25nIHN0YXJ0ID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CisgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtQnVpbGRlci5zdGFydCgpOworICAgICAgICB9CisgICAgICAgIHBhcnNlVkNhcmRGaWxlKCk7CisgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtQnVpbGRlci5lbmQoKTsKKyAgICAgICAgfQorICAgICAgICBtVGltZVRvdGFsICs9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7CisgICAgICAgIAorICAgICAgICBpZiAoVkNhcmRDb25maWcuc2hvd1BlcmZvcm1hbmNlTG9nKCkpIHsKKyAgICAgICAgICAgIHNob3dQZXJmb3JtYW5jZUluZm8oKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHBhcnNlKElucHV0U3RyZWFtIGlzLCBTdHJpb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HJvcGVydHlOYW1lKTsKKyAgICAgICAgICAgIExvZy53KExPR19UQUcsICJQcm9wZXJ0eSBuYW1lIHVuc3VwcG9ydGVkIGJ5IHZDYXJkIDMuMDogIiArIHByb3BlcnR5TmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCBib29sZWFuIGlzVmFsaWRFbmNvZGluZyhTdHJpbmcgZW5jb2RpbmcpIHsKKyAgICAgICAgcmV0dXJuIHNBY2NlcHRhYmxlRW5jb2RpbmdWMzAuY29udGFpbnMoZW5jb2RpbmcudG9VcHBlckNhc2UoKSk7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCBTdHJpbmcgZ2V0TGluZSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGlmIChtUHJldmlvdXNMaW5lICE9IG51bGwpIHsKKyAgICAgICAgICAgIFN0cmluZyByZXQgPSBtUHJldmlvdXNMaW5lOworICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IG51bGw7CisgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIG1SZWFkZXIucmVhZExpbmUoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiB2Q2FyZCAzLjAgcmVxdWlyZXMgdGhhdCB0aGUgbGluZSB3aXRoIHNwYWNlIGF0IHRoZSBiZWdpbm5pbmcgb2YgdGhlIGxpbmUKKyAgICAgKiBtdXN0IGJlIGNvbWJpbmVkIHdpdGggcHJldmlvdXMgbGluZS4gCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIFN0cmluZyBnZXROb25FbXB0eUxpbmUoKSB0aHJvd3MgSU9FeGNlcHRpb24sIFZDYXJkRXhjZXB0aW9uIHsKKyAgICAgICAgU3RyaW5nIGxpbmU7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG51bGw7CisgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgICBsaW5lID0gbVJlYWRlci5yZWFkTGluZSgpOworICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2aW91c0xpbmUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmV0ID0gbVByZXZpb3VzTGluZTsKKyAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiUmVhY2hlZCBlbmQgb2YgYnVmZmVyLiIpOworICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5lLmxlbmd0aCgpID09IDApIHsKKyAgICAgICAgICAgICAgICBpZiAoYnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtUHJldmlvdXNMaW5lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJldCA9IG1QcmV2aW91c0xpbmU7CisgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS5jaGFyQXQoMCkgPT0gJyAnIHx8IGxpbmUuY2hhckF0KDApID09ICdcdCcpIHsKKyAgICAgICAgICAgICAgICBpZiAoYnVpbGRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFNlZSBTZWN0aW9uIDUuOC4xIG9mIFJGQyAyNDI1IChNSU1FLURJUiBkb2N1bWVudCkuCisgICAgICAgICAgICAgICAgICAgIC8vIEZvbGxvd2luZyBpcyB0aGUgZXhjZXJwdHMgZnJvbSBpdC4gIAorICAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgICAgICAvLyBERVNDUklQVElPTjpUaGlzIGlzIGEgbG9uZyBkZXNjcmlwdGlvbiB0aGF0IGV4aXN0cyBvbiBhIGxvbmcgbGluZS4KKyAgICAgICAgICAgICAgICAgICAgLy8gCisgICAgICAgICAgICAgICAgICAgIC8vIENhbiBiZSByZXByZXNlbnRlZCBhczoKKyAgICAgICAgICAgICAgICAgICAgLy8KKyAgICAgICAgICAgICAgICAgICAgLy8gREVTQ1JJUFRJT046VGhpcyBpcyBhIGxvbmcgZGVzY3JpcHRpb24KKyAgICAgICAgICAgICAgICAgICAgLy8gIHRoYXQgZXhpc3RzIG9uIGEgbG9uZyBsaW5lLgorICAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgICAgICAvLyBJdCBjb3VsZCBhbHNvIGJlIHJlcHJlc2VudGVkIGFzOgorICAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgICAgICAvLyBERVNDUklQVElPTjpUaGlzIGlzIGEgbG9uZyBkZXNjcmlwCisgICAgICAgICAgICAgICAgICAgIC8vICB0aW9uIHRoYXQgZXhpc3RzIG8KKyAgICAgICAgICAgICAgICAgICAgLy8gIG4gYSBsb25nIGxpbmUuCisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUuc3Vic3RyaW5nKDEpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2aW91c0xpbmUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobVByZXZpb3VzTGluZSk7CisgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChsaW5lLnN1YnN0cmluZygxKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJTcGFjZSBleGlzdHMgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUgbGluZSIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKG1QcmV2aW91c0xpbmUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyByZXQgPSBtUHJldmlvdXNMaW5lOworICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgCisgICAgLyoqCisgICAgICogdmNhcmQgPSBbZ3JvdXAgIi4iXSAiQkVHSU4iICI6IiAiVkNBUkQiIDEqQ1JMRgorICAgICAqICAgICAgICAgMSooY29udGVudGxpbmUpCisgICAgICogICAgICAgICA7QSB2Q2FyZCBvYmplY3QgTVVTVCBpbm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FyZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyBtYXliZSBJQU5BIHR5cGUKKyAgICAgICAgICAgIFN0cmluZ1tdIHN0ckFycmF5ID0gcGFyYW1zLnNwbGl0KCI9IiwgMik7CisgICAgICAgICAgICBpZiAoc3RyQXJyYXkubGVuZ3RoID09IDIpIHsKKyAgICAgICAgICAgICAgICBoYW5kbGVBbnlQYXJhbShzdHJBcnJheVswXSwgc3RyQXJyYXlbMV0pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBNdXN0IG5vdCBjb21lIGhlcmUgaW4gdGhlIGN1cnJlbnQgaW1wbGVtZW50YXRpb24uCisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIlVua25vd24gcGFyYW1zIHZhbHVlOiAiICsgcGFyYW1zKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBoYW5kbGVBbnlQYXJhbShTdHJpbmcgcGFyYW1OYW1lLCBTdHJpbmcgcGFyYW1WYWx1ZSkgeworICAgICAgICAvLyB2Q2FyZCAzLjAgYWNjZXB0IGNvbW1hLXNlcGFyYXRlZCBtdWx0aXBsZSB2YWx1ZXMsIGJ1dAorICAgICAgICAvLyBjdXJyZW50IFByb3BlcnR5Tm9kZSBkb2VzIG5vdCBhY2NlcHQgaXQuCisgICAgICAgIC8vIEZvciBub3csIHdlIGRvIG5vdCBzcGxpdCB0aGUgdmFsdWVzLgorICAgICAgICAvLworICAgICAgICAvLyBUT0RPOiBmaXggdGhpcy4KKyAgICAgICAgc3VwZXIuaGFuZGxlQW55UGFyYW0ocGFyYW1OYW1lLCBwYXJhbVZhbHVlKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogIHZDYXJkIDMuMCBkZWZpbmVzCisgICAgIC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lOworICAgICAgICB9CisgICAgICAgIC8vIEp1c3QgaWdub3JlIHRoZSBsaW5lIGZvciBub3csIHNpbmNlIHdlIGNhbm5vdCBrbm93IGhvdyB0byBoYW5kbGUgaXQuLi4KKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogdkNhcmQgMy4wIGRvZXMgbm90IHJlcXVpcmUgdHdvIENSTEYgYXQgdGhlIGxhc3Qgb2YgQkFTRTY0IGRhdGEuCisgICAgICogSXQgb25seSByZXF1aXJlcyB0aGF0IGRhdGEgc2hvdWxkIGJlIE1JTUUtZW5jb2RlZC4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgU3RyaW5nIGdldEJhc2U2NChTdHJpbmcgZmlyc3RTdHJpbmcpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24geworICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICBidWlsZGVyLmFwcGVuZChmaXJzdFN0cmluZyk7CisgICAgICAgIAorICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgU3RyaW5nIGxpbmUgPSBnZXRMaW5lKCk7CisgICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIkZpbGUgZW5kZWQgZHVyaW5nIHBhcnNpbmcgQkFTRTY0IGJpbmFyeSIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGxpbmUubGVuZ3RoKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfSBlbHNlIGlmICghbGluZS5zdGFydHNXaXRoKCIgIikgJiYgIWxpbmUuc3RhcnRzV2l0aCgiXHQiKSkgeworICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIEVTQ0FQRUQtQ0hBUiA9ICJcXCIgLyAiXDsiIC8gIlwsIiAvICJcbiIgLyAiXE4iKQorICAgICAqICAgICAgICAgICAgICA7IFxcIGVuY29kZXMgXCwgXG4gb3IgXE4gZW5jb2RlcyBuZXdsaW5lCisgICAgICogICAgICAgICAgICAgIDsgXDsgZW5jb2RlcyA7LCBcLCBlbmNvZGVzICwKKyAgICAgKiAgICAgICAgICAgICAgCisgICAgICogTm90ZTogQXBwbGUgZXNjYXBlICc6JyBpbnRvICdcOicgd2hpbGUgZG9lcyBub3QgZXNjYXBlICdcJworICAgICAqLyAKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgU3RyaW5nIG1heWJlVW5lc2NhcGVUZXh0KFN0cmluZyB0ZXh0KSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGludCBsZW5ndGggPSB0ZXh0Lmxlbmd0aCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBjaGFyIGNoID0gdGV4dC5jaGFyQXQoaSk7CisgICAgICAgICAgICBpZiAoY2ggPT0gJ1xcJyAmJiBpIDwgbGVuZ3RoIC0gMSkgeworICAgICAgICAgICAgICAgIGNoYXIgbmV4dF9jaCA9IHRleHQuY2hhckF0KCsraSk7IAorICAgICAgICAgICAgICAgIGlmIChuZXh0X2NoID09ICduJyB8fCBuZXh0X2NoID09ICdOJykgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXG4iKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChuZXh0X2NoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgU3RyaW5nIG1heWJlVW5lc2NhcGVDaGFyYWN0ZXIoY2hhciBjaCkgeworICAgICAgICBpZiAoY2ggPT0gJ24nIHx8IGNoID09ICdOJykgeworICAgICAgICAgICAgcmV0dXJuICJcbiI7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gU3RyaW5nLnZhbHVlT2YoY2gpOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcGltL3ZjYXJkL1ZDYXJkU291cmNlRGV0ZWN0b3IuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3BpbS92Y2FyZC9WQ2FyZFNvdXJjZURldGVjdG9yLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uN2UyYmUyYgotLS0gL2Rldi9udWxsCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3BpbS92Y2FyZC9WQ2FyZFNvdXJjZURldGVjdG9yLmphdmEKQEAgLTAsMCArMSwxMzcgQEAKKy8qCisgKiBDb3B5cmlnaHQgKEMpIDIwMDkgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoa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zdGFydCgpIHsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgZW5kKCkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN0YXJ0UmVjb3JkKFN0cmluZyB0eXBlKSB7CisgICAgfSAgICAKKworICAgIHB1YmxpYyB2b2lkIHN0YXJ0UHJvcGVydHkoKSB7CisgICAgICAgIG1OZWVkUGFyc2VTcGVjaWZpZWRDaGFyc2V0ID0gZmFsc2U7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGVuZFByb3BlcnR5KCkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGVuZFJlY29yZCgpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eUdyb3VwKFN0cmluZyBncm91cCkgeworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eU5hbWUoU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgaWYgKG5hbWUuZXF1YWxzSWdub3JlQ2FzZShUWVBFX0ZPTUFfQ0hBUlNFVF9TSUdOKSkgeworICAgICAgICAgICAgbVR5cGUgPSBUWVBFX0ZPTUE7CisgICAgICAgICAgICBtTmVlZFBhcnNlU3BlY2lmaWVkQ2hhcnNldCA9IHRydWU7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1UeXBlICE9IFRZUEVfVU5LTk9XTikgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChXSU5ET1dTX01PQklMRV9QSE9ORV9TSUdOUy5jb250YWlucyhuYW1lKSkgeworICAgICAgICAgICAgbVR5cGUgPSBUWVBFX1dJTkRPV1NfTU9CSUxFX0pQOworICAgICAgICB9IGVsc2UgaWYgKEZPTUFfU0lHTlMuY29udGFpbnMobmFtZSkpIHsKKyAgICAgICAgICAgIG1UeXBlID0gVFlQRV9GT01BOworICAgICAgICB9IGVsc2UgaWYgKEpBUEFORVNFX01PQklMRV9QSE9ORV9TSUdOUy5jb250YWlucyhuYW1lKSkgeworICAgICAgICAgICAgbVR5cGUgPSBUWVBFX0pBUEFORVNFX01PQklMRV9QSE9ORTsKKyAgICAgICAgfSBlbHNlIGlmIChBUFBMRV9TSUdOUy5jb250YWlucyhuYW1lKSkgeworICAgICAgICAgICAgbVR5cGUgPSBUWVBFX0FQUExFOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcHJvcGVydHlQYXJhbVR5cGUoU3RyaW5nIHR5cGUpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eVBhcmFtVmFsdWUoU3RyaW5nIHZhbHVlKSB7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcHJvcGVydHlWYWx1ZXMoTGlzdDxTdHJpbmc+IHZhbHVlcykgeworICAgICAgICBpZiAobU5lZWRQYXJzZVNwZWNpZmllZENoYXJzZXQgJiYgdmFsdWVzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIG1TcGVjaWZpZWRDaGFyc2V0ID0gdmFsdWVzLmdldCgwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGludCBnZXRUeXBlKCkgeworICAgICAgICByZXR1cm4gbVR5cGU7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFJldHVybiBjaGFyc2V0IFN0cmluZyBndWVzc2VkIGZyb20gdGhlIHNvdXJjZSdzIHByb3BlcnRpZXMuCisgICAgICogVGhpcyBtZXRob2QgbXVzdCBiZSBjYWxsZWQgYWZ0ZXIgcGFyc2luZyB0YXJnZXQgZmlsZShzKS4KKyAgICAgKiBAcmV0dXJuIENoYXJzZXQgU3RyaW5nLiBOdWxsIGlzIHJldHVybmVkIGlmIGd1ZXNzaW5nIHRoZSBzb3VyY2UgZmFpbHMuCisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRFc3RpbWF0ZWRDaGFyc2V0KCkgeworICAgICAgICBpZiAobVNwZWNpZmllZENoYXJzZXQgIT0gbn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FudHMuQVRUUl9UWVBFX1BIT05FX0VYVFJBX09USEVSLCBQaG9uZS5UWVBFX09USEVSKTsKKyAgICAgICAgc0tub3duUGhvbmVUeXBlc01hcF9TdG9JLnB1dChDb25zdGFudHMuQVRUUl9UWVBFX1BIT05FX0VYVFJBX0NBTExCQUNLLCBQaG9uZS5UWVBFX0NBTExCQUNLKTsKKyAgICAgICAgc0tub3duUGhvbmVUeXBlc01hcF9TdG9JLnB1dCgKKyAgICAgICAgICAgICAgICBDb25zdGFudHMuQVRUUl9UWVBFX1BIT05FX0VYVFJBX0NPTVBBTllfTUFJTiwgUGhvbmUuVFlQRV9DT01QQU5ZX01BSU4pOworICAgICAgICBzS25vd25QaG9uZVR5cGVzTWFwX1N0b0kucHV0KENvbnN0YW50cy5BVFRSX1RZUEVfUEhPTkVfRVhUUkFfUkFESU8sIFBob25lLlRZUEVfUkFESU8pOworICAgICAgICBzS25vd25QaG9uZVR5cGVzTWFwX1N0b0kucHV0KENvbnN0YW50cy5BVFRSX1RZUEVfUEhPTkVfRVhUUkFfVEVMRVgsIFBob25lLlRZUEVfVEVMRVgpOworICAgICAgICBzS25vd25QaG9uZVR5cGVzTWFwX1N0b0kucHV0KENvbnN0YW50cy5BVFRSX1RZUEVfUEhPTkVfRVhUUkFfVFRZX1RERCwgUGhvbmUuVFlQRV9UVFlfVEREKTsKKyAgICAgICAgc0tub3duUGhvbmVUeXBlc01hcF9TdG9JLnB1dChDb25zdGFudHMuQVRUUl9UWVBFX1BIT05FX0VYVFJBX0FTU0lTVEFOVCwgUGhvbmUuVFlQRV9BU1NJU1RBTlQpOworCisgICAgICAgIHNQaG9uZVR5cGVzU2V0VW5rbm93blRvQ29udGFjdHMgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7CisgICAgICAgIHNQaG9uZVR5cGVzU2V0VW5rbm93blRvQ29udGFjdHMuYWRkKENvbnN0YW50cy5BVFRSX1RZUEVfTU9ERU0pOworICAgICAgICBzUGhvbmVUeXBlc1NldFVua25vd25Ub0NvbnRhY3RzLmFkZChDb25zdGFudHMuQVRUUl9UWVBFX01TRyk7CisgICAgICAgIHNQaG9uZVR5cGVzU2V0VW5rbm93blRvQ29udGFjdHMuYWRkKENvbnN0YW50cy5BVFRSX1RZUEVfQkJTKTsKKyAgICAgICAgc1Bob25lVHlwZXNTZXRVbmtub3duVG9Db250YWN0cy5hZGQoQ29uc3RhbnRzLkFUVFJfVFlQRV9WSURFTyk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGdldFBob25lQXR0cmlidXRlU3RyaW5nKGludCB0eXBlKSB7CisgICAgICAgIHJldHVybiBzS25vd25QaG9uZVR5cGVzTWFwX0l0b1MuZ2V0KHR5cGUpOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIEludGVyZ2VyIHdoZW4gdGhlIGdpdmVuIHR5cGVzIGNhbiBiZSBwYXJzZWQgYXMga25vd24gdHlwZS4gUmV0dXJucyBTdHJpbmcgb2JqZWN0CisgICAgICogd2hlbiBub3QsIHdoaWNoIHNob3VsZCBiZSBzZXQgdG8gbGFiZWwuIAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgT2JqZWN0IGdldFBob25lVHlwZUZyb21TdHJpbmdzKENvbGxlY3Rpb248U3RyaW5nPiB0eXBlcykgeworICAgICAgICBpbnQgdHlwZSA9IC0xOworICAgICAgICBTdHJpbmcgbGFiZWwgPSBudWxsOworICAgICAgICBib29sZWFuIGlzRmF4ID0gZmFsc2U7CisgICAgICAgIGJvb2xlYW4gaGFzUHJlZiA9IGZhbHNlOworICAgICAgICAKKyAgICAgICAgaWYgKHR5cGVzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlcykgeworICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnRvVXBwZXJDYXNlKCk7IAorICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLmVxdWFscyhDb25zdGFudHMuQVRUUl9UWVBFX1BSRUYpKSB7CisgICAgICAgICAgICAgICAgICAgIGhhc1ByZWYgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoQ29uc3RhbnRzLkFUVFJfVFlQRV9GQVgpKSB7CisgICAgICAgICAgICAgICAgICAgIGlzRmF4ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5zdGFydHNXaXRoKCJYLSIpICYmIHR5cGUgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy5zdWJzdHJpbmcoMik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgSW50ZWdlciB0bXAgPSBzS25vd25QaG9uZVR5cGVzTWFwX1N0b0kuZ2V0KHR5cGVTdHJpbmcpOworICAgICAgICAgICAgICAgICAgICBpZiAodG1wICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSB0bXA7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX0NVU1RPTTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAodHlwZSA8IDApIHsKKyAgICAgICAgICAgIGlmIChoYXNQcmVmKSB7CisgICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfTUFJTjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gZGVmYXVsdCB0byBUWVBFX0hPTUUKKyAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9IT01FOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChpc0ZheCkgeworICAgICAgICAgICAgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9IT01FKSB7CisgICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfRkFYX0hPTUU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9XT1JLKSB7CisgICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfRkFYX1dPUks7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9PVEhFUikgeworICAgICAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX09USEVSX0ZBWDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAodHlwZSA9PSBQaG9uZS5UWVBFX0NVU1RPTSkgeworICAgICAgICAgICAgcmV0dXJuIGxhYmVsOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIHR5cGU7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBib29sZWFuIGlzVmFsaWRQaG9uZUF0dHJpYnV0ZShTdHJpbmcgcGhvbmVBdHRyaWJ1dGUsIGludCB2Y2FyZFR5cGUpIHsKKyAgICAgICAgLy8gVE9ETzogY2hlY2sgdGhlIGZvbGxvd2luZy4KKyAgICAgICAgLy8gLSBpdCBtYXkgdmlvbGF0ZSB2Q2FyZCBzcGVjCisgICAgICAgIC8vIC0gaXQgbWF5IGNvbnRhaW4gbm9uLUFTQ0lJIGNoYXJhY3RlcnMKKyAgICAgICAgLy8KKyAgICAgICAgLy8gVE9ETzogdXNlIHZjYXJkVHlwZQorICAgICAgICByZXR1cm4gKHBob25lQXR0cmlidXRlLnN0YXJ0c1dpdGgoIlgtIikgfHwgcGhvbmVBdHRyaWJ1dGUuc3RhcnRzV2l0aCgieC0iKSB8fAorICAgICAgICAgICAgICAgIHNQaG9uZVR5cGVzU2V0VW5rbm93blRvQ29udGFjdHMuY29udGFpbnMocGhvbmVBdHRyaWJ1dGUpKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmdbXSBzb3J0TmFtZUVsZW1lbnRzKGludCB2Y2FyZFR5cGUsCisgICAgICAgICAgICBTdHJpbmcgZmFtaWx5TmFtZSwgU3RyaW5nIG1pZGRsZU5hbWUsIFN0cmluZyBnaXZlbk5hbWUpIHsKKyAgICAgICAgU3RyaW5nW10gbGlzdCA9IG5ldyBTdHJpbmdbM107CisgICAgICAgIHN3aXRjaCAoVkNhcmRDb25maWcuZ2V0TmFtZU9yZGVyVHlwZSh2Y2FyZFR5cGUpKSB7CisgICAgICAgIGNhc2UgVkNhcmRDb25maWcuTkFNRV9PUkRFUl9KQVBBTkVTRToKKyAgICAgICAgICAgIC8vIFRPRE86IFNob3VsZCBoYW5kbGUgQXNjaWkgY2FzZT8KKyAgICAgICAgICAgIGxpc3RbMF0gPSBmYW1pbHlOYW1lOworICAgICAgICAgICAgbGlzdFsxXSA9IG1pZGRsZU5hbWU7CisgICAgICAgICAgICBsaXN0WzJdID0gZ2l2ZW5OYW1lOyAKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFZDYXJkQ29uZmlnLk5BTUVfT1JERVJfRVVST1BFOgorICAgICAgICAgICAgbGlzdFswXSA9IG1pZGRsZU5hbWU7CisgICAgICAgICAgICBsaXN0WzFdID0gZ2l2ZW5OYW1lOworICAgICAgICAgICAgbGlzdFsyXSA9IGZhbWlseU5hbWU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGxpc3RbMF0gPSBnaXZlbk5hbWU7CisgICAgICAgICAgICBsaXN0WzFdID0gbWlkZGxlTmFtZTsKKyAgICAgICAgICAgIGxpc3RbMl0gP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0gPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFN0cnVjdHVyZWRQb3N0YWwuUE9CT1gpOworICAgICAgICBpZiAoZGF0YUFycmF5WzBdID09IG51bGwpIHsKKyAgICAgICAgICAgIGRhdGFBcnJheVswXSA9ICIiOworICAgICAgICB9CisgICAgICAgIC8vIEV4dGVuZGVkIGFkZHIuIFRoZXJlJ3Mgbm8gcmVsZXZhbnQgZGF0YSBpbiBDb250YWN0c0NvbnRyYWN0LgorICAgICAgICBkYXRhQXJyYXlbMV0gPSAiIjsKKyAgICAgICAgZGF0YUFycmF5WzJdID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhTdHJ1Y3R1cmVkUG9zdGFsLlNUUkVFVCk7CisgICAgICAgIGlmIChkYXRhQXJyYXlbMl0gPT0gbnVsbCkgeworICAgICAgICAgICAgZGF0YUFycmF5WzJdID0gIiI7CisgICAgICAgIH0KKyAgICAgICAgLy8gQXNzdW1lIHRoYXQgbG9jYWx0eSA9PSBjaXR5CisgICAgICAgIGRhdGFBcnJheVszXSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoU3RydWN0dXJlZFBvc3RhbC5DSVRZKTsKKyAgICAgICAgaWYgKGRhdGFBcnJheVszXSA9PSBudWxsKSB7CisgICAgICAgICAgICBkYXRhQXJyYXlbM10gPSAiIjsKKyAgICAgICAgfQorICAgICAgICBTdHJpbmcgcmVnaW9uID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhTdHJ1Y3R1cmVkUG9zdGFsLlJFR0lPTik7CisgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocmVnaW9uKSkgeworICAgICAgICAgICAgZGF0YUFycmF5WzRdID0gcmVnaW9uOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGF0YUFycmF5WzRdID0gIiI7CisgICAgICAgIH0KKyAgICAgICAgZGF0YUFycmF5WzVdID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhTd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uYW1lTGlzdCA9IHNvcnROYW1lRWxlbWVudHMobmFtZU9yZGVyVHlwZSwKKyAgICAgICAgICAgICAgICBmYW1pbHlOYW1lLCBtaWRkbGVOYW1lLCBnaXZlbk5hbWUpOworICAgICAgICBib29sZWFuIGZpcnN0ID0gdHJ1ZTsKKyAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShwcmVmaXgpKSB7CisgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQocHJlZml4KTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKFN0cmluZyBuYW1lUGFydCA6IG5hbWVMaXN0KSB7CisgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KG5hbWVQYXJ0KSkgeworICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgeworICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCcgJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG5hbWVQYXJ0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHN1ZmZpeCkpIHsKKyAgICAgICAgICAgIGlmICghZmlyc3QpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoc3VmZml4KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gY29udGFpbnNPbmx5QXNjaWkoU3RyaW5nIHN0cikgeworICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoc3RyKSkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGZpbmFsIGludCBsZW5ndGggPSBzdHIubGVuZ3RoKCk7CisgICAgICAgIGZpbmFsIGludCBhc2NpaUZpcnN0ID0gMHgyMDsKKyAgICAgICAgZmluYWwgaW50IGFzY2lpTGFzdCA9IDB4MTI2OworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSA9IHN0ci5vZmZzZXRCeUNvZGVQb2ludHMoaSwgMSkpIHsKKyAgICAgICAgICAgIGludCBjID0gc3RyLmNvZGVQb2ludEF0KGkpOworICAgICAgICAgICAgaWYgKGMgPCBhc2NpaUZpcnN0IHx8IGFzY2lpTGFzdCA8IGMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFRoaXMgaXMgdXNlZnVsIHNpbmNlIHZDYXJkIDMuMCBvZnRlbiByZXF1aXJlcyB0aGUgKCJYLSIpIHByb3BlcnRpZXMgYW5kIGdyb3VwcworICAgICAqIHNob3VsZCBjb250YWluIG9ubHkgYWxwaGFiZXRzLCBkaWdpdHMsIGFuZCBoeXBoZW4uCisgICAgICogCisgICAgICogTm90ZTogSXQgaXMgYWxyZWFkeSBrbm93biBzb21lIGRldmljZXMgKHdyb25nbHkpIG91dHB1dHMgcHJvcGVydGllcyB3aXRoIGNoYXJhY3RlcnMKKyAgICAgKiAgICAgICB3aGljaCBzaG91bGQgbm90IGJlIGluIHRoZSBmaWVsZC4gT25lIGV4YW1wbGUgaXMgIlgtR09PR0xFIFRBTEsiLiBXZSBhcHByZWNpYXRlCisgICAgICogICAgICAgc3VjaCBraW5kIG9mIGlucHV0IGJ1dCBtdXN0IG5ldmVyIG91dHB1dCBpdCB1bmxlc3MgdGhlIHRhcmdldCBpcyB2ZXJ5IHNwZWNpZmljCisgICAgICogICAgICAgdG8gdGhlIGRldmljZSB3aGljaCBpcyBhYmxlIHRvIHBhcnNlIHRoZSBtYWxmb3JtZWQgaW5wdXQuIAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBjb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKFN0cmluZyBzdHIpIHsKKyAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHN0cikpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgaW50IGxvd2VyQWxwaGFiZXRGaXJzdCA9IDB4NDE7ICAvLyBpbmNsdWRlZCAoJ0EnKQorICAgICAgICBmaW5hbCBpbnQgbG93ZXJBbHBoYWJldExhc3QgPSAweDViOyAgLy8gbm90IGluY2x1ZGVkICgnWycpCisgICAgICAgIGZpbmFsIGludCB1cHBlckFscGhhYmV0Rmlyc3QgPSAweDYxOyAgLy8gaW5jbHVkZWQgKCdhJykKKyAgICAgICAgZmluYWwgaW50IHVwcGVyQWxwaGFiZXRMYXN0ID0gMHg3YjsgIC8vIGluY2x1ZGVkICgneycpCisgICAgICAgIGZpbmFsIGludCBkaWdpdEZpcnN0ID0gMHgzMDsgIC8vIGluY2x1ZGVkICgnMCcpCisgICAgICAgIGZpbmFsIGludCBkaWdpdExhc3QgPSAweDM5OyAgLy8gaW5jbHVkZWQgKCc5JykKKyAgICAgICAgZmluYWwgaW50IGh5cGhlbiA9ICctJzsKKyAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IHN0ci5sZW5ndGgoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkgPSBzdHIub2Zmc2V0QnlDb2RlUG9pbnRzKGksIDEpKSB7CisgICAgICAgICAgICBpbnQgY29kZXBvaW50ID0gc3RyLmNvZGVQb2ludEF0KGkpOworICAgICAgICAgICAgaWYgKCEoKGxvd2VyQWxwaGFiZXRGaXJzdCA8PSBjb2RlcG9pbnQgJiYgY29kZXBvaW50IDwgbG93ZXJBbHBoYWJldExhc3QpIHx8CisgICAgICAgICAgICAgICAgICAgICh1cHBlckFscGhhYmV0Rmlyc3QgPD0gY29kZXBvaW50ICYmIGNvZGVwb2ludCA8IHVwcGVyQWxwaGFiZXRMYXN0KSB8fAorICAgICAgICAgICAgICAgICAgICAoZGlnaXRGaXJzdCA8PSBjb2RlcG9pbnQgJiYgY29kZXBvaW50IDwgZGlnaXRMYXN0KSB8fAorICAgICAgICAgICAgICAgICAgICAoY29kZXBvaW50ID09IGh5cGhlbikpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICAKKyAgICAvLyBUT0RPOiBSZXBsYWNlIHd0aCB0aGUgbWV0aG9kIGluIEJhc2U2NCBjbGFzcy4KKyAgICBwcml2YXRlIHN0YXRpYyBjaGFyIFBBRCA9ICc9JzsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjaGFyW10gRU5DT0RFNjQgPSB7CisgICAgICAgICdBJywnQicsJ0MnLCdEJywnRScsJ0YnLCdHJywnSCcsJ0knLCdKJywnSycsJ0wnLCdNJywnTicsJ08nLCdQJywKKyAgICAgICAgJ1EnLCdSJywnUycsJ1QnLCdVJywnVicsJ1cnLCdYJywnWScsJ1onLCdhJywnYicsJ2MnLCdkJywnZScsJ2YnLAorICAgICAgICAnZycsJ2gnLCdpJywnaicsJ2snLCdsJywnbScsJ24nLCdvJywncCcsJ3EnLCdyJywncycsJ3QnLCd1JywndicsCisgICAgICAgICd3JywneCcsJ3knLCd6JywnMCcsJzEnLCcyJywnMycsJzQnLCc1JywnNicsJzcnLCc4JywnOScsJysnLCcvJworICAgIH07CisKKyAgICBzdGF0aWMgcHVibGljIFN0cmluZyBlbmNvZGVCYXNlNjQoYnl0ZVtdIGRhdGEpIHsKKyAgICAgICAg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rK10gPSBFTkNPREU2NFsoXzNieXRlID4+IDEyKSAmIDB4M0ZdOworICAgICAgICAgICAgY2hhckJ1ZmZlcltwb3NpdGlvbisrXSA9IFBBRDsKKyAgICAgICAgICAgIGNoYXJCdWZmZXJbcG9zaXRpb24rK10gPSBQQUQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOiAvLyBbMTExMTExXVsxMSAxMTExXVsxMTExIDAwXVswMDAwMDBdCisgICAgICAgICAgICBfM2J5dGUgPSAoKGRhdGFbZGF0YS5sZW5ndGgtMl0gJiAweEZGKSA8PCAxNikgKyAoKGRhdGFbZGF0YS5sZW5ndGgtMV0gJiAweEZGKSA8PCA4KTsKKyAgICAgICAgICAgIGNoYXJCdWZmZXJbcG9zaXRpb24rK10gPSBFTkNPREU2NFtfM2J5dGUgPj4gMThdOworICAgICAgICAgICAgY2hhckJ1ZmZlcltwb3NpdGlvbisrXSA9IEVOQ09ERTY0WyhfM2J5dGUgPj4gMTIpICYgMHgzRl07CisgICAgICAgICAgICBjaGFyQnVmZmVyW3Bvc2l0aW9uKytdID0gRU5DT0RFNjRbKF8zYnl0ZSA+PiAgNikgJiAweDNGXTsKKyAgICAgICAgICAgIGNoYXJCdWZmZXJbcG9zaXRpb24rK10gPSBQQUQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGNoYXJCdWZmZXIpOworICAgIH0KKyAgICAKKyAgICBzdGF0aWMgcHVibGljIFN0cmluZyB0b0hhbGZXaWR0aFN0cmluZyhTdHJpbmcgb3JnU3RyaW5nKSB7CisgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShvcmdTdHJpbmcpKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICBpbnQgbGVuZ3RoID0gb3JnU3RyaW5nLmxlbmd0aCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAvLyBBbGwgSmFwYW5lc2UgY2hhcmFjdGVyIGlzIGFibGUgdG8gYmUgZXhwcmVzc2VkIGJ5IGNoYXIuCisgICAgICAgICAgICAvLyBEbyBub3QgbmVlZCB0byB1c2UgU3RyaW5nI2NvZGVwUG9pbnRBdCgpLgorICAgICAgICAgICAgY2hhciBjaCA9IG9yZ1N0cmluZy5jaGFyQXQoaSk7CisgICAgICAgICAgICBDaGFyU2VxdWVuY2UgaGFsZldpZHRoVGV4dCA9IEphcGFuZXNlVXRpbHMudHJ5R2V0SGFsZldpZHRoVGV4dChjaCk7CisgICAgICAgICAgICBpZiAoaGFsZldpZHRoVGV4dCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoaGFsZldpZHRoVGV4dCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIFZDYXJkVXRpbHMoKSB7CisgICAgfQorfQorCisvKioKKyAqIFRleHRVdGlscyBlc3BlY2lhbGx5IGZvciBKYXBhbmVzZS4KKyAqIFRPRE86IG1ha2UgdGhpcyBpbiBhbmRyb2lkLnRleHQgaW4gdGhlIGZ1dHVyZQorICovCitjbGFzcyBKYXBhbmVzZVV0aWxzIHsKKyAgICBzdGF0aWMgcHJpdmF0ZSBmaW5hbCBNYXA8Q2hhcmFjdGVyLCBTdHJpbmc+IHNIYWxmV2lkdGhNYXAgPQorICAgICAgICBuZXcgSGFzaE1hcDxDaGFyYWN0ZXIsIFN0cmluZz4oKTsKKworICAgIHN0YXRpYyB7CisgICAgICAgIC8vIFRo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AgICAgIHNIYWxmV2lkdGhNYXAucHV0KCdcdUZGNDInLCAiYiIpOworICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRjQzJywgImMiKTsKKyAgICAgICAgc0hhbGZXaWR0aE1hcC5wdXQoJ1x1RkY0NCcsICJkIik7CisgICAgICAgIHNIYWxmV2lkdGhNYXAucHV0KCdcdUZGNDUnLCAiZSIpOworICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRjQ2JywgImYiKTsKKyAgICAgICAgc0hhbGZXaWR0aE1hcC5wdXQoJ1x1RkY0NycsICJnIik7CisgICAgICAgIHNIYWxmV2lkdGhNYXAucHV0KCdcdUZGNDgnLCAiaCIpOworICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRjQ5JywgImkiKTsKKyAgICAgICAgc0hhbGZXaWR0aE1hcC5wdXQoJ1x1RkY0QScsICJqIik7CisgICAgICAgIHNIYWxmV2lkdGhNYXAucHV0KCdcdUZGNEInLCAiayIpOworICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRjRDJywgImwiKTsKKyAgICAgICAgc0hhbGZXaWR0aE1hcC5wdXQoJ1x1RkY0RCcsICJtIik7CisgICAgICAgIHNIYWxmV2lkdGhNYXAucHV0KCdcdUZGNEUnLCAibiIpOworICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRjRGJywgIm8iKTsKKyAgICAgICAgc0hhbGZXaWR0aE1hcC5wdXQoJ1x1RkY1MCcsICJwIik7CisgICAgICAgIHNIYWxmV2lkdGhNYXAucHV0KCdcdUZGNTEnLCAicSIpOworICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRjUyJywgInIiKTsKKyAgICAgICAgc0hhbGZXaWR0aE1hcC5wdXQoJ1x1RkY1MycsICJzIik7CisgICAgICAgIHNIYWxmV2lkdGhNYXAucHV0KCdcdUZGNTQnLCAidCIpOworICAgICAgICBzSGFsZldpZHRoTWFwLnB1dCgnXHVGRj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ICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfVVA6CisgICAgICAgICAgICAgICAgaWYgKGlzZG93bikgeworICAgICAgICAgICAgICAgICAgICBtU2Vla0JhclZvbHVtaXplci5jaGFuZ2VWb2x1bWVCeSgxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtNzQsNyArMTA0LDcgQEAKICAgICAgICAgaWYgKCFwb3NpdGl2ZVJlc3VsdCAmJiBtU2Vla0JhclZvbHVtaXplciAhPSBudWxsKSB7CiAgICAgICAgICAgICBtU2Vla0JhclZvbHVtaXplci5yZXZlcnRWb2x1bWUoKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBjbGVhbnVwKCk7CiAgICAgfQogCkBAIC04NywxOSArMTE3LDk2IEBACiAgICAgICovCiAgICAgcHJpdmF0ZSB2b2lkIGNsZWFudXAoKSB7CiAgICAgICAgZ2V0UHJlZmVyZW5jZU1hbmFnZXIoKS51bnJlZ2lzdGVyT25BY3Rpdml0eVN0b3BMaXN0ZW5lcih0aGlzKTsKLSAgICAgICAKKwogICAgICAgIGlmIChtU2Vla0JhclZvbHVtaXplciAhPSBudWxsKSB7CisgICAgICAgICAgIERpYWxvZyBkaWFsb2cgPSBnZXREaWFsb2coKTsKKyAgICAgICAgICAgaWYgKGRpYWxvZyAhPSBudWxsICYmIGRpYWxvZy5pc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgICAgLy8gU3RvcHBlZCB3aGlsZSBkaWFsb2cgd2FzIHNob3dpbmcsIHJldmVydCBjaGFuZ2VzCisgICAgICAgICAgICAgICBtU2Vla0JhclZvbHVtaXplci5yZXZlcnRWb2x1bWUoKTsKKyAgICAgICAgICAgfQogICAgICAgICAgICB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lcihzb3VyY2UpOworICAgICAgICAgICAgbVZvbHVtZVN0b3JlLnZvbHVtZSA9IHNvdXJjZS5yZWFkSW50KCk7CisgICAgICAgICAgICBtVm9sdW1lU3RvcmUub3JpZ2luYWxWb2x1bWUgPSBzb3VyY2UucmVhZEludCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICAgICAgc3VwZXIud3JpdGVUb1BhcmNlbChkZXN0LCBmbGFncyk7CisgICAgICAgICAgICBkZXN0LndyaXRlSW50KG1Wb2x1bWVTdG9yZS52b2x1bWUpOworICAgICAgICAgICAgZGVzdC53cml0ZUludChtVm9sdW1lU3RvcmUub3JpZ2luYWxWb2x1bWUpOworICAgICAgICB9CisKKyAgICAgICAgVm9sdW1lU3RvcmUgZ2V0Vm9sdW1lU3RvcmUoKSB7CisgICAgICAgICAgICByZXR1cm4gbVZvbHVtZVN0b3JlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFNhdmVkU3RhdGUoUGFyY2VsYWJsZSBzdXBlclN0YXRlKSB7CisgICAgICAgICAgICBzdXBlcihzdXBlclN0YXRlKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJsZS5DcmVhdG9yPFNhdmVkU3RhdGU+IENSRUFUT1IgPQorICAgICAgICAgICAgICAgIG5ldyBQYXJjZWxhYmxlLkNyZWF0b3I8U2F2ZWRTdGF0ZT4oKSB7CisgICAgICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZSBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBpbikgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU2F2ZWRTdGF0ZShpbik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyBTYXZlZFN0YXRlW10gbmV3QXJyYXkoaW50IHNpemUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNhdmVkU3RhdGVbc2l6ZV07CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfQorCiAgICAgLyoqCiAgICAgICogVHVybnMgYSB7QGxpbmsgU2Vla0Jhcn0gaW50byBhIHZvbHVtZSBjb250cm9sLgogICAgICAqLwpAQCAtMTEzLDcgKzIyMCw3IEBACiAgICAgICAgIHByaXZhdGUgaW50IG1PcmlnaW5hbFN0cmVhbVZvbHVtZTsgCiAgICAgICAgIHByaXZhdGUgUmluZ3RvbmUgbVJpbmd0b25lOwogICAgIAotICAgICAgICBwcml2YXRlIGludCBtTGFzdFByb2dyZXNzOworICAgICAgICBwcml2YXRlIGludCBtTGFzdFByb2dyZXNzID0gLTE7CiAgICAgICAgIHByaXZhdGUgU2Vla0JhciBtU2Vla0JhcjsKICAgICAgICAgCiAgICAgICAgIHByaXZhdGUgQ29udGVudE9ic2VydmVyIG1Wb2x1bWVPYnNlcnZlciA9IG5ldyBDb250ZW50T2JzZXJ2ZXIobUhhbmRsZXIpIHsKQEAgLTEyNyw3ICsyMzQsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfTsKLSAgICAKKwogICAgICAgICBwdWJsaWMgU2Vla0JhclZvbHVtaXplcihDb250ZXh0IGNvbnRleHQsIFNlZWtCYXIgc2Vla0JhciwgaW50IHN0cmVhbVR5cGUpIHsKICAgICAgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKICAgICAgICAgICAgIG1BdWRpb01hbmFnZXIgPSAoQXVkaW9NYW5hZ2VyKSBjb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5BVURJT19TRVJWSUNFKTsKQEAgLTE0NywxMSArMjU0LDE5IEBACiAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5nZXRVcmlGb3IoU3lzdGVtLlZPTFVNRV9TRVRUSU5HU1ttU3RyZWFtVHlwZV0pLAogICAgICAgICAgICAgICAgICAgICBmYWxzZSwgbVZvbHVtZU9ic2VydmVyKTsKICAgICAKLSAgICAgICAgICAgIG1SaW5ndG9uZSA9IFJpbmd0b25lTWFuYWdlci5nZXRSaW5ndG9uZShtQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgbVN0cmVhbVR5cGUgPT0gQXVkaW9NYW5hZ2VyLlNUUkVBTV9OT1RJRklDQVRJT04KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFNldHRpbmdzLlN5c3RlbS5ERUZBVUxUX05PVElGSUNBVElPTl9VUkkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFNldHRpbmdzLlN5c3RlbS5ERUZBVUxUX1JJTkdUT05FX1VSSSk7Ci0gICAgICAgICAgICBtUmluZ3RvbmUuc2V0U3RyZWFtVHlwZShtU3RyZWFtVHlwZSk7CisgICAgICAgICAgICBVcmkgZGVmYXVsdFVyaSA9IG51bGw7CisgICAgICAgICAgICBpZiAobVN0cmVhbVR5cGUgPT0gQXVkaW9NYW5hZ2VyLlNUUkVBTV9SSU5HKSB7CisgICAgICAgICAgICAgICAgZGVmYXVsdFVyaSA9IFNldHRpbmdzLlN5c3RlbS5ERUZBVUxUX1JJTkdUT05FX1VSSTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobVN0cmVhbVR5cGUgPT0gQXVkaW9NYW5hZ2VyLlNUUkVBTV9OT1RJRklDQVRJT04pIHsKKyAgICAgICAgICAgICAgICBkZWZhdWx0VXJpID0gU2V0dGluZ3MuU3lzdGVtLkRFRkFVTFRfTk9USUZJQ0FUSU9OX1VSSTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZGVmYXVsdFVyaSA9IFNldHRpbmdzLlN5c3RlbS5ERUZBVUxUX0FMQVJNX0FMRVJUX1VSSTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbVJpbmd0b25lID0gUmluZ3RvbmVNYW5hZ2VyLmdldFJpbmd0b25lKG1Db250ZXh0LCBkZWZhdWx0VXJpKTsKKyAgICAgICAgICAgIGlmIChtUmluZ3RvbmUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1SaW5ndG9uZS5zZXRTdHJlYW1UeXBlKG1TdHJlYW1UeXBlKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICAKICAgICAgICAgcHVibGljIHZvaWQgc3RvcCgpIHsKQEAgLTE3Myw3ICsyODgsNyBAQAogICAgICAgICAgICAgcG9zdFNldFZvbHVtZShwcm9ncmVzcyk7CiAgICAgICAgIH0KIAotICAgICAgICBwcml2YXRlIHZvaWQgcG9zdFNldFZvbHVtZShpbnQgcHJvZ3Jlc3MpIHsKKyAgICAgICAgdm9pZCBwb3N0U2V0Vm9sdW1lKGludCBwcm9ncmVzcykgewogICAgICAgICAgICAgLy8gRG8gdGhlIHZvbHVtZSBjaGFuZ2luZyBzZXBhcmF0ZWx5IHRvIGdpdmUgcmVzcG9uc2l2ZSBVSQogICAgICAgICAgICAgbUxhc3RQcm9ncmVzcyA9IHByb2dyZXNzOwogICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKHRoaXMpOwpAQCAtMjA4LDUgKzMyMywyNyBAQAogICAgICAgICAgICAgcmV0dXJuIG1TZWVrQmFyOwogICAgICAgICB9CiAgICAgICAgIAorICAgICAgICBwdWJsaWMgdm9pZCBjaGFuZ2VWb2x1bWVCeShpbnQgYW1vdW50KSB7CisgICAgICAgICAgICBtU2Vla0Jhci5pbmNyZW1lbnRQcm9ncmVzc0J5KGFtb3VudCk7CisgICAgICAgICAgICBpZiAobVJpbmd0b25lICE9IG51bGwgJiYgIW1SaW5ndG9uZS5pc1BsYXlpbmcoKSkgeworICAgICAgICAgICAgICAgIHNhbXBsZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcG9zdFNldFZvbHVtZShtU2Vla0Jhci5nZXRQcm9ncmVzcygpKTsKKyAgICAgICAgfQorCisgIC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mRhci5DYWxlbmRhcnMuX1NZTkNfQUNDT1VOVCArICI9PyBBTkQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgQ2FsZW5kYXIuQ2FsZW5kYXJzLl9TWU5DX0FDQ09VTlRfVFlQRSArICI9PyIsCisgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXSB7YWNjb3VudC5uYW1lLCBhY2NvdW50LnR5cGV9KTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgpAQCAtMTcwLDkgKzE4Myw2IEBACiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0KICAgICAgICAgICAgIFVyaS5wYXJzZSgiY29udGVudDovL2NhbGVuZGFyL2NhbGVuZGFycyIpOwogCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIExJVkVfQ09OVEVOVF9VUkkgPQotICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vY2FsZW5kYXIvY2FsZW5kYXJzP3VwZGF0ZT0xIik7Ci0KICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBkZWZhdWx0IHNvcnQgb3JkZXIgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCkBAIC0yMDcsNiArMjE3LDEzIEBACiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGJvb2xlYW4pPC9QPgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgSElEREVOID0gImhpZGRlbiI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBvd25lciBhY2NvdW50IGZvciB0aGlzIGNhbGVuZGFyLCBiYXNlZCBvbiB0aGUgY2FsZW5kYXIgZmVlZC4KKyAgICAgICAgICogVGhpcyB3aWxsIGJlIGRpZmZlcmVudCBmcm9tIHRoZSBfU1lOQ19BQ0NPVU5UIGZvciBkZWxlZ2F0ZWQgY2FsZW5kYXJzLgorICAgICAgICAg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Uga2V5IG9mIHRoaXMgc2V0dGluZy4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEtFWSA9ICJrZXkiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgdmFsdWUgb2YgdGhpcyBzZXR0aW5nLgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVkFMVUUgPSAidmFsdWUiOwogICAgIH0KIAogICAgIC8qKgogICAgICAqIFRoZSBzZXR0aW5ncyBvdmVyIGFsbCBvZiB0aGUgcGVvcGxlCiAgICAgICovCisgICAgQERlcHJlY2F0ZWQKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFNldHRpbmdzIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIFNldHRpbmdzQ29sdW1ucyB7CiAgICAgICAgIC8qKgogICAgICAgICAgKiBubyBwdWJsaWMgY29uc3RydWN0b3Igc2luY2UgdGhpcyBpcyBhIHV0aWxpdHkgY2xhc3MKQEAgLTk5LDE3ICsxMTksMjAgQEAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPQogICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vY29udGFjdHMvc2V0dGluZ3MiKTsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGRpcmVjdG9yeSB0d2lnIGZvciB0aGlzIHN1Yi10YWJsZQogICAgICAgICAgKi8KK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ICAgICAgICAgICAgICAgIHNlbGVjdFN0cmluZyA9IChhY2NvdW50ID09IG51bGwpCiAgICAgICAgICAgICAgICAgICAgICAgICA/ICJfc3luY19hY2NvdW50IGlzIG51bGwgQU5EIGtleT0/IgogICAgICAgICAgICAgICAgICAgICAgICAgOiAiX3N5bmNfYWNjb3VudD0/IEFORCBrZXk9PyI7CisvLyAgICAgICAgICAgICAgICA6ICJfc3luY19hY2NvdW50PT8gQU5EIF9zeW5jX2FjY291bnRfdHlwZT0/IEFORCBrZXk9PyI7CiAgICAgICAgICAgICAgICAgc2VsZWN0QXJncyA9IChhY2NvdW50ID09IG51bGwpCiAgICAgICAgICAgICAgICAgPyBuZXcgU3RyaW5nW117a2V5fQogICAgICAgICAgICAgICAgIDogbmV3IFN0cmluZ1tde2FjY291bnQsIGtleX07CkBAIC0xNTEsNiArMTc3LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzZXRTZXR0aW5nKENvbnRlbnRSZXNvbHZlciBjciwgU3RyaW5nIGFjY291bnQsIFN0cmluZyBrZXksCiAgICAgICAgICAgICAgICAgU3RyaW5nIHZhbHVlKSB7CiAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CkBAIC0xNTgsNyArMTg1LDggQEAKICAgICAgICAgICAgIC8vIHRoZSBhY2NvdW50IG5hbWUgaXMsIHNvIHdlJ3JlIHVzaW5nIGEgZ2xvYmFsIHNldHRpbmcgZm9yIFNZTkNfRVZFUllUSElORy4KICAgICAgICAgICAgIC8vIFNvbWUgZGF5IHdoZW4gd2UgYWRkIG11bHRpcGxlIGFjY291bnRzIHRvIHRoZSBVSSB0aGlzIHNob3VsZCBob25vciB0aGUgYWNjb3VudAogICAgICAgICAgICAgLy8gdGhhdCB3YXMgYXNrZWQgZm9yLgotICAgICAgICAgICAgLy92YWx1ZXMucHV0KF9TWU5DX0FDQ09VTlQsIGFjY291bnQpOworICAgICAgICAgICAgLy92YWx1ZXMucHV0KF9TWU5DX0FDQ09VTlQsIGFjY291bnQubU5hbWUpOworICAgICAgICAgICAgLy92YWx1ZXMucHV0KF9TWU5DX0FDQ09VTlRfVFlQRSwgYWNjb3VudC5tVHlwZSk7CiAgICAgICAgICAgICB2YWx1ZXMucHV0KEtFWSwga2V5KTsKICAgICAgICAgICAgIHZhbHVlcy5wdXQoVkFMVUUsIHZhbHVlKTsKICAgICAgICAgICAgIGNyLnVwZGF0ZShTZXR0aW5ncy5DT05URU5UX1VSSSwgdmFsdWVzLCBudWxsLCBudWxsKTsKQEAgLTE2OCwxMSArMTk2LDEzIEBACiAgICAgLyoqCiAgICAgICogQ29sdW1ucyBmcm9tIHRoZSBQZW9wbGUgdGFibGUgdGhhdCBvdGhlciB0YWJsZXMgam9pbiBpbnRvIHRoZW1zZWx2ZXMuCiAgICAgICovCisgICAgQERlcHJlY2F0ZWQKICAgICBwdWJsaWMgaW50ZXJmYWNlIFBlb3BsZUNvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHBlcnNvbidzIG5hbWUuCiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBOQU1FID0gIm5hbWUiOwogCiAgICAgICAgIC8qKgpAQCAtMTgxLDEzICsyMTEsMTUgQEAKICAgICAgICAgICogVXNlZCBmb3IgcHJvbnVuY2lhdGlvbiBhbmQvb3IgY29sbGF0aW9uIGluIHNvbWUgbGFuZ3VhZ2VzLgogICAgICAgICAgKiA8cD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPTkVUSUNfTkFNRSA9ICJwaG9uZXRpY19uYW1lIjsKLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBkaXNwbGF5IG5hbWUuIElmIG5hbWUgaXMgbm90IG51bGwgbmFtZSwgZWxzZSBpZiBudW1iZXIgaXMgbm90IG51bGwgbnVtYmVyLAogICAgICAgICAgKiBlbHNlIGlmIGVtYWlsIGlzIG5vdCBudWxsIGVtYWlsLgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRElTUExBWV9OQU1FID0gImRpc3BsYXlfbmFtZSI7CiAKICAgICAgICAgLyoqCkBAIC0xOTYsMzAgKzIyOCwzNSBAQAogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9wPgogICAgICAgICAgKiBAaGlkZSBVc2VkIG9ubHkgaW4gQ29udGFjdHMgYXBwbGljYXRpb24gZm9yIG5vdy4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNPUlRfU1RSSU5HID0gInNvcnRfc3RyaW5nIjsKLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIE5vdGVzIGFib3V0IHRoZSBwZXJzb24uCiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBOT1RFUyA9ICJub3RlcyI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBudW1iZXIgb2YgdGltZXMgYSBwZXJzb24gaGFzIGJlZW4gY29udGFjdGVkCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUSU1FU19DT05UQUNURUQgPSAidGltZXNfY29udGFjdGVkIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGxhc3QgdGltZSBhIHBlcnNvbiB3YXMgY29udGFjdGVkLgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTEFTVF9USU1FX0NPTlRBQ1RFRCA9ICJsYXN0X3RpbWVfY29udGFjdGVkIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogQSBjdXN0b20gcmluZ3RvbmUgYXNzb2NpYXRlZCB3aXRoIGEgcGVyc29uLiBOb3QgYWx3YXlzIHByZXNlbnQuCiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQgKFVSSSB0byB0aGUgcmluZ3RvbmUpPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ1VTVE9NX1JJTkdUT05FID0gImN1c3RvbV9yaW5ndG9uZSI7CiAKICAgICAgICAgLyoqCkBAIC0yMjcsMjQgKzI2NCwyOCBAQAogICAgICAgICAgKiBwcmVzZW50LgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSICgwIGZvciBmYWxzZSwgMSBmb3IgdHJ1ZSk8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRU5EX1RPX1ZPSUNFTUFJTCA9ICJzZW5kX3RvX3ZvaWNlbWFpbCI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIElzIHRoZSBjb250YWN0IHN0YXJyZWQ/CiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGJvb2xlYW4pPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1RBUlJFRCA9ICJzdGFycmVkIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHNlcnZlciB2ZXJzaW9uIG9mIHRoZSBwaG90bwogICAgICAgICAgKiA8UD5UeXBlOiBURVhUICh0aGUgdmVyc2lvbiBudW1iZXIgcG9ydGlvbiBvZiB0aGUgcGhvdG8gVVJJKTwvUD4KICAgICAgICAgICovCi0gICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBIT1RPX1ZFUlNJT04gPSAicGhvdG9fdmVyc2lvbiI7ICAgICAgIAorICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9UT19WRVJTSU9OID0gInBob3RvX3ZlcnNpb24iOwogICAgIH0KIAogICAgIC8qKgogICAgICAqIFRoaXMgdGFibGUgY29udGFpbnMgcGVvcGxlLgogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBQZW9wbGUgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgU3luY0NvbnN0VmFsdWUsIFBlb3BsZUNvbHVtbnMsCiAgICAgICAgICAgICBQaG9uZXNDb2x1bW5zLCBQcmVzZW5jZUNvbHVtbnMgewogICAgICAgICAvKioKQEAgLTI1NSw2ICsyOTYsNyBAQAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJMIGZvciB0aGlzIHRhYmxlCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9CiAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9jb250YWN0cy9wZW9wb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AqIE5vdCBleHBvc2VkIGJlY2F1c2Ugd2UgZXhwZWN0IHNpZ25pZmljYW50IGNoYW5nZXMgaW4gdGhlIGNvbnRhY3RzCiAgICAgICAgICAqIHNjaGVtYSBhbmQgZG8gbm90IHdhbnQgdG8gaGF2ZSB0byBzdXBwb3J0IHRoaXMuCiAgICAgICAgICAqIEBoaWRlCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBXSVRIX0VNQUlMX09SX0lNX0ZJTFRFUl9VUkkgPQogICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vY29udGFjdHMvcGVvcGxlL3dpdGhfZW1haWxfb3JfaW1fZmlsdGVyIik7Ci0gICAgICAgIAorCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHtAbGluayAjQ09OVEVOVF9VUkl9IHByb3ZpZGluZyBhIGRpcmVjdG9yeSBvZgogICAgICAgICAgKiBwZW9wbGUuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLmRpci9wZXJzb24iOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIGEge0BsaW5rICNDT05URU5UX1VSSX0gc3ViZGlyZWN0b3J5IG9mIGEgc2luZ2xlCiAgICAgICAgICAqIHBlcnNvbi4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL3BlcnNvbiI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBkZWZhdWx0IHNvcnQgb3JkZXIgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFRkFVTFRfU09SVF9PUkRFUiA9IFBlb3BsZS5OQU1FICsgIiBBU0MiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgSUQgb2YgdGhlIHBlcnNvbnMgcHJlZmVycmVkIHBob25lIG51bWJlci4KICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAoZm9yZWlnbiBrZXkgdG8gcGhvbmVzIHRhYmxlIG9uIHRoZSBfSUQgZmllbGQpPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUFJJTUFSWV9QSE9ORV9JRCA9ICJwcmltYXJ5X3Bob25lIjsKIAogICAgICAgICAvKioKQEAgLTMxNCw2ICszNjMsNyBAQAogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChmb3JlaWduIGtleSB0byBjb250YWN0X21ldGhvZHMgdGFibGUgb24gdGhlCiAgICAgICAgICAqIF9JRCBmaWVsZCk8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQUklNQVJZX0VNQUlMX0lEID0gInByaW1hcnlfZW1haWwiOwogCiAgICAgICAgIC8qKgpAQCAtMzIxLDYgKzM3MSw3IEBACiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGZvcmVpZ24ga2V5IHRvIG9yZ2FuaXphdGlvbnMgdGFibGUgb24gdGhlCiAgICAgICAgICAqIF9JRCBmaWVsZCk8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQUklNQVJZX09SR0FOSVpBVElPTl9JRCA9ICJwcmltYXJ5X29yZ2FuaXphdGlvbiI7CiAKICAgICAgICAgLyoqCkBAIC0zMjksNiArMzgwLDcgQEAKICAgICAgICAgICogQHBhcmFtIHJlc29sdmVyIHRoZSBDb250ZW50UmVzb2x2ZXIgdG8gdXNlCiAgICAgICAgICAqIEBwYXJhbSBwZXJzb25JZCB0aGUgcGVyc29uIHdobyB3YXMgY29udGFjdGVkCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFya0FzQ29udGFjdGVkKENvbnRlbnRSZXNvbHZlciByZXNvbHZlciwgbG9uZyBwZXJzb25JZCkgewogICAgICAgICAgICAgVXJpIHVyaSA9IENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKENPTlRFTlRfVVJJLCBwZXJzb25JZCk7CiAgICAgICAgICAgICB1cmkgPSBVcmkud2l0aEFwcGVuZGVkUGF0aCh1cmksICJ1cGRhdGVfY29udGFjdF90aW1lIik7CkBAIC0zNDIsNiArMzk0LDcgQEAKICAgICAgICAgLyoqCiAgICAgICAgICAqIEBoaWRlIFVzZWQgaW4gdkNhcmQgcGFyc2VyIGNvZGUuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGxvbmcgdHJ5R2V0TXlDb250YWN0c0dyb3VwSWQoQ29udGVudFJlc29sdmVyIHJlc29sdmVyKSB7CiAgICAgICAgICAgICBDdXJzb3IgZ3JvdXBzQ3Vyc29yID0gcmVzb2x2ZXIucXVlcnkoR3JvdXBzLkNPTlRFTlRfVVJJLCBHUk9VUFNfUFJPSkVDVElPTiwKICAgICAgICAgICAgICAgICAgICAgR3JvdXBzLlNZU1RFTV9JRCArICI9JyIgKyBHcm91cHMuR1JPVVBfTVlfQ09OVEFDVFMgKyAiJyIsIG51bGwsIG51bGwpOwpAQCAtMzY1LDI0ICs0MTgsMjYgQEAKICAgICAgICAgICogQHJldHVybiB0aGUgVVJJIG9mIHRoZSBncm91cCBtZW1iZXJzaGlwIHJvdwogICAgICAgICAgKiBAdGhyb3dzIElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBpZiB0aGUgTXkgQ29udGFjdHMgZ3JvdXAgY2FuJ3QgYmUgZm91bmQKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGFkZFRvTXlDb250YWN0c0dyb3VwKENvbnRlbnRSZXNvbHZlciByZXNvbHZlciwgbG9uZyBwZXJzb25JZCkgewogICAgICAgICAgICAgbG9uZyBncm91cElkID0gdHJ5R2V0TXlDb250YWN0c0dyb3VwSWQocmVzb2x2ZXIpOwogICAgICAgICAgICAgaWYgKGdyb3VwSWQgPT0gMCkgewogICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZhaWxlZCB0byBmaW5kIHRoZSBNeSBDb250YWN0cyBncm91cCIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHJldHVybiBhZGRUb0dyb3VwKHJlc29sdmVyLCBwZXJzb25JZCwgZ3JvdXBJZCk7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKICAgICAgICAgICogQWRkcyBhIHBlcnNvbiB0byBhIGdyb3VwIHJlZmVycmVkIHRvIGJ5IG5hbWUuCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gcmVzb2x2ZXIgdGhlIHJlc29sdmVyIHRvIHVzZQogICAgICAgICAgKiBAcGFyYW0gcGVyc29uSWQgdGhlIHBlcnNvbiB0byBhZGQgdG8gdGhlIGdyb3VwCiAgICAgICAgICAqIEBwYXJhbSBncm91cE5hbWUgdGhlIG5hbWUgb2YgdGhlIGdyb3VwIHRvIGFkZCB0aGUgY29udGFjdCB0bwogICAgICAgICAgKiBAcmV0dXJuIHRoZSBVUkkgb2YgdGhlIGdyb3VwIG1lbWJ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XJuIHRoZSBVUkkgb2YgdGhlIGdyb3VwIG1lbWJlcnNoaXAgcm93CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBhZGRUb0dyb3VwKENvbnRlbnRSZXNvbHZlciByZXNvbHZlciwgbG9uZyBwZXJzb25JZCwgbG9uZyBncm91cElkKSB7CiAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CiAgICAgICAgICAgICB2YWx1ZXMucHV0KEdyb3VwTWVtYmVyc2hpcC5QRVJTT05fSUQsIHBlcnNvbklkKTsKICAgICAgICAgICAgIHZhbHVlcy5wdXQoR3JvdXBNZW1iZXJzaGlwLkdST1VQX0lELCBncm91cElkKTsKICAgICAgICAgICAgIHJldHVybiByZXNvbHZlci5pbnNlcnQoR3JvdXBNZW1iZXJzaGlwLkNPTlRFTlRfVVJJLCB2YWx1ZXMpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZ1tdIEdST1VQU19QUk9KRUNUSU9OID0gbmV3IFN0cmluZ1tdIHsKICAgICAgICAgICAgIEdyb3Vwcy5fSUQsCiAgICAgICAgIH07CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgY29udGFjdHMgYW5kIGFkZHMgaXQgdG8gdGhlICJNeSBDb250YWN0cyIgZ3JvdXAuCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gcmVzb2x2ZXIgdGhlIENvbnRlbnRSZXNvbHZlciB0byB1c2UKICAgICAgICAgICogQHBhcmFtIHZhbHVlcyB0aGUgdmFsdWVzIHRvIHVzZSB3aGVuIGNyZWF0aW5nIHRoZSBjb250YWN0CiAgICAgICAgICAqIEByZXR1cm4gdGhlIFVSSSBvZiB0aGUgY29udGFjdCwgb3IgbnVsbCBpZiB0aGUgb3BlcmF0aW9uIGZhaWxzCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBjcmVhdGVQZXJzb25Jbk15Q29udGFjdHNHcm91cChDb250ZW50UmVzb2x2ZXIgcmVzb2x2ZXIsCiAgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyB2YWx1ZXMpIHsKIApAQCAtNDQ2LDYgKzUwMyw3IEBACiAgICAgICAgICAgICByZXR1cm4gY29udGFjdFVyaTsKICAgICAgICAgfQogCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgQ3Vyc29yIHF1ZXJ5R3JvdXBzKENvbnRlbnRSZXNvbHZlciByZXNvbHZlciwgbG9uZyBwZXJzb24pIHsKICAgICAgICAgICAgIHJldHVybiByZXNvbHZlci5xdWVyeShHcm91cE1lbWJlcnNoaXAuQ09OVEVOVF9VUkksIG51bGwsICJwZXJzb249PyIsCiAgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXtTdHJpbmcudmFsdWVPZihwZXJzb24pfSwgR3JvdXBzLkRFRkFVTFRfU09SVF9PUkRFUik7CkBAIC00NTcsMTggKzUxNSwyMCBAQAogICAgICAgICAgKiBAcGFyYW0gcGVyc29uIHRoZSBVcmkgb2YgdGhlIHBlcnNvbiB3aG9zZSBwaG90byBpcyB0byBiZSB1cGRhdGVkCiAgICAgICAgICAqIEBwYXJhbSBkYXRhIHRoZSBieXRlW10gdGhhdCByZXByZXNlbnRzIHRoZSBwaG90bwogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyB2b2lkIHNldFBob3RvRGF0YShDb250ZW50UmVzb2x2ZXIgY3IsIFVyaSBwZXJzb24sIGJ5dGVbXSBkYXRhKSB7CiAgICAgICAgICAgICBVcmkgcGhvdG9VcmkgPSBVcmkud2l0aEFwcGVuZGVkUGF0aChwZXJzb24sIENvbnRhY3RzLlBob3Rvcy5DT05URU5UX0RJUkVDVE9SWSk7CiAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CiAgICAgICAgICAgICB2YWx1ZXMucHV0KFBob3Rvcy5EQVRBLCBkYXRhKTsKICAgICAgICAgICAgIGNyLnVwZGF0ZShwaG90b1VyaSwgdmFsdWVzLCBudWxsLCBudWxsKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICAvKioKICAgICAgICAgICogT3BlbnMgYW4gSW5wdXRTdHJlYW0gZm9yIHRoZSBwZXJzb24ncyBwaG90byBhbmQgcmV0dXJucyB0aGUgcGhvdG8gYXMgYSBCaXRtYXAuCiAgICAgICAgICAqIElmIHRoZSBwZXJzb24ncyBwaG90byBpc24ndCBwcmVzZW50IHJldHVybnMgdGhlIHBsYWNlaG9sZGVySW1hZ2VSZXNvdXJjZSBpbnN0ZWFkLgogICAgICAgICAgKiBAcGFyYW0gcGVyc29uIHRoZSBwZXJzb24gd2hvc2UgcGhvdG8gc2hvdWxkIGJlIHVzZWQKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgSW5wdXRTdHJlYW0gb3BlbkNvbnRhY3RQaG90b0lucHV0U3RyZWFtKENvbnRlbnRSZXNvbHZlciBjciwgVXJpIHBlcnNvbikgewogICAgICAgICAgICAgVXJpIHBob3RvVXJpID0gVXJpLndpdGhBcHBlbmRlZFBhdGgocGVyc29uLCBDb250YWN0cy5QaG90b3MuQ09OVEVOVF9ESVJFQ1RPUlkpOwogICAgICAgICAgICAgQ3Vyc29yIGN1cnNvciA9IGNyLnF1ZXJ5KHBob3RvVXJpLCBuZXcgU3RyaW5nW117UGhvdG9zLkRBVEF9LCBudWxsLCBudWxsLCBudWxsKTsKQEAgLTQ5NSw2ICs1NTUsNyBAQAogICAgICAgICAgKiAgIGhhdmUgYSBwaG90bwogICAgICAgICAgKiBAcGFyYW0gb3B0aW9ucyB0aGUgZGVjb2Rpbmcgb3B0aW9ucywgY2FuIGJlIHNldCB0byBudWxsCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIEJpdG1hcCBsb2FkQ29udGFjdFBob3RvKENvbnRleHQgY29udGV4dCwgVXJpIHBlcnNvbiwKICAgICAgICAgICAgICAgICBpbnQgcGxhY2Vob2xkZXJJbWFnZVJlc291cmNlLCBCaXRtYXBGYWN0b3J5Lk9wdGlvbnMgb3B0aW9ucykgewogICAgICAgICAgICAgaWYgKHBlcnNvbiA9PSBudWxsKSB7CkBAIC01MjEsNiArNTgyLDcgQEAKICAgICAgICAgLyoqCiAgICAgICAgICAqIEEgc3ViIGRpcmVjdG9yeSBvZiBhIHNpbmdsZSBwZXJzb24gdGhhdCBjb250YWlucyBhbGwgb2YgdGhlaXIgUGhvbmVzLgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBQaG9uZXMgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgUGhvbmVzQ29sdW1ucywKICAgICAgICAgICAgICAgICBQZW9wbGVDb2x1bW5zIHsKICAgICAgICAgICAgIC8qKgpAQCAtNTMxLDExICs1OTMsMTMgQEAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGRpcmVjdG9yeSB0d2lnIGZvciB0aGlzIHN1Yi10YWJsZQogICAgICAgICAgICAgICovCisgICAgICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9ESVJFQ1RPUlkgPSAicGhvbmVzIjsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZGVmYXVsdCBzb3J0IG9yZGVyIGZvciB0aGlzIHRhYmxlCiAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBERUZBVUxUX1NPUlRfT1JERVIgPSAibnVtYmVyIEFTQyI7CiAgICAgICAgIH0KIApAQCAtNTQzLDYgKzYwNyw3IEBACiAgICAgICAgICAqIEEgc3ViZGlyZWN0b3J5IG9mIGEgc2luZ2xlIHBlcnNvbiB0aGF0IGNvbnRhaW5zIGFsbCBvZiB0aGVpcgogICAgICAgICAgKiBDb250YWN0TWV0aG9kcy4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgQ29udGFjdE1ldGhvZHMKICAgICAgICAgICAgICAgICBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBDb250YWN0TWV0aG9kc0NvbHVtbnMsIFBlb3BsZUNvbHVtbnMgewogICAgICAgICAgICAgLyoqCkBAIC01NTMsMTcgKzYxOCwyMCBAQAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZGlyZWN0b3J5IHR3aWcgZm9yIHRoaXMgc3ViLXRhYmxlCiAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0RJUkVDVE9SWSA9ICJjb250YWN0X21ldGhvZHMiOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBkZWZhdWx0IHNvcnQgb3JkZXIgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICAgICAqLworICAgICAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFRkFVTFRfU09SVF9PUkRFUiA9ICJkYXRhIEFTQyI7CiAgICAgICAgIH0KIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGV4dGVuc2lvbnMgZm9yIGEgcGVyc29uCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEV4dGVuc2lvbnMgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgRXh0ZW5zaW9uc0NvbHVtbnMgewogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBubyBwdWJsaWMgY29uc3RydWN0b3Igc2luY2UgdGhpcyBpcyBhIHV0aWxpdHkgY2xhc3MKQEAgLTU3MywxNyArNjQxLDIwIEBACiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBkaXJlY3RvcnkgdHdpZyBmb3IgdGhpcyBzdWItdGFibGUKICAgICAgICAgICAgICAqLworICAgICAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfRElSRUNUT1JZID0gImV4dGVuc2lvbnMiOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBkZWZhdWx0IHNvcnQgb3JkZXIgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICAgICAqLworICAgICAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFRkFVTFRfU09SVF9PUkRFUiA9ICJuYW1lIEFTQyI7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIElEIG9mIHRoZSBwZXJzb24gdGhpcyBwaG9uZSBudW1iZXIgaXMgYXNzaWduZWQgdG8uCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KICAgICAgICAgICAgICAqLworICAgICAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBFUlNPTl9JRCA9ICJwZXJzb24iOwogICAgICAgICB9CiAgICAgfQpAQCAtNTkxLDE3ICs2NjIsMjAgQEAKICAgICAvKioKICAgICAgKiBDb2x1bW5zIGZyb20gdGhlIGdyb3VwcyB0YWJsZS4KICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBpbnRlcmZhY2UgR3JvdXBzQ29sdW1ucyB7CiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgZ3JvdXAgbmFtZS4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5BTUUgPSAibmFtZSI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIE5vdGVzIGFib3V0IHRoZSBncm91cC4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5PVEVTID0gIm5vdGVzIjsKIAogICAgICAgICAvKioKQEAgLTYwOSwxOCArNjgzLDIxIEBACiAgICAgICAgICAqIGZvciB0aGlzIGdyb3VwJ3MgYWNjb3VudC4KICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAoYm9vbGVhbik8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTSE9VTERfU1lOQyA9ICJzaG91bGRfc3luYyI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBJRCBvZiB0aGlzIGdyb3VwIGlmIGl0IGlzIGEgU3lzdGVtIEdyb3VwLCBudWxsIG90aGVyd2lzZS4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNZU1RFTV9JRCA9ICJzeXN0ZW1faWQiOwogICAgIH0KIAogICAgIC8qKgogICAgICAqIFRoaXMgdGFibGUgY29udGFpbnMgdGhlIGdyb3VwcyBmb3IgYW4gYWNjb3VudC4KICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgR3JvdXBzCiAgICAgICAgICAgICBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBTeW5jQ29uc3RWYWx1ZSwgR3JvdXBzQ29sdW1ucyB7CiAgICAgICAgIC8qKgpAQCAtNjMxLDYgKzcwOCw3IEBACiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkwgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0KICAgICAgICAgICAgIFVyaS5wYXJzZSgiY29udGVudDovL2NvbnRhY3RzL2dyb3VwcyIpOwogCkBAIC02MzgsNiArNzE2LDcgQEAKICAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJMIGZvciB0aGUgdGFibGUgdGhhdCBob2xkcyB0aGUgZGVsZXRlZAogICAgICAgICAgKiBncm91cHMuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBERUxFVEVEX0NPTlRFTlRfVVJJID0KICAgICAgICAgICAgIFVyaS5wYXJzZSgiY29udGVudDovL2NvbnRhY3RzL2RlbGV0ZWRfZ3JvdXBzIik7CiAKQEAgLTY0NSw3MSArNzI0LDkwIEBACiAgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2Yge0BsaW5rICNDT05URU5UX1VSSX0gcHJvdmlkaW5nIGEgZGlyZWN0b3J5IG9mCiAgICAgICAgICAqIGdyb3Vwcy4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL2NvbnRhY3RzZ3JvdXAiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIGEge0BsaW5rICNDT05URU5UX1VSSX0gc3ViZGlyZWN0b3J5IG9mIGEgc2luZ2xlCiAgICAgICAgICAqIGdyb3VwLgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vY29udGFjdHNncm91cCI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBkZWZhdWx0IHNvcnQgb3JkZXIgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFRkFVTFRfU09SVF9PUkRFUiA9IE5BTUUgKyAiIEFTQyI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBHUk9VUF9BTkRST0lEX1NUQVJSRUQgPSAiU3RhcnJlZCBpbiBBbmRyb2lkIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlICJNeSBDb250YWN0cyIgc3lzdGVtIGdyb3VwLgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1JPVVBfTVlfQ09OVEFDVFMgPSAiQ29udGFjdHMiOwogICAgIH0KIAogICAgIC8qKgogICAgICAqIENvbHVtbnMgZnJvbSB0aGUgUGhvbmVzIHRhYmxlIHRoYXQgb3RoZXIgY29sdW1ucyBqb2luIGludG8gdGhlbXNlbHZlcy4KICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBpbnRlcmZhY2UgUGhvbmVzQ29sdW1ucyB7CiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgdHlwZSBvZiB0aGUgdGhlIHBob25lIG51bWJlci4KICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAob25lIG9mIHRoZSBjb25zdGFudHMgYmVsb3cpPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVFlQRSA9ICJ0eXBlIjsKIAorICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0NVU1RPTSA9IDA7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfSE9NRSA9IDE7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfTU9CSUxFID0gMjsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9XT1JLID0gMzsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9GQVhfV09SSyA9IDQ7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfRkFYX0hPTUUgPSA1OworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1BBR0VSID0gNjsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDc7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSB1c2VyIHByb3ZpZGVkIGxhYmVsIGZvciB0aGUgcGhvbmUgbnVtYmVyLCBvbmx5IHVzZWQgaWYgVFlQRSBpcyBUWVBFX0NVU1RPTS4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExBQkVMID0gImxhYmVsIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHBob25lIG51bWJlciBhcyB0aGUgdXNlciBlbnRlcmVkIGl0LgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTlVNQkVSID0gIm51bWJlciI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBub3JtYWxpemVkIHBob25lIG51bWJlcgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTlVNQkVSX0tFWSA9ICJudW1iZXJfa2V5IjsKIAogICAgICAgICAvKioKICAgICAgICAgICogV2hldGhlciB0aGlzIGlzIHRoZSBwcmltYXJ5IHBob25lIG51bWJlcgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChpZiBzZXQsIG5vbi0wIG1lYW5zIHRydWUpPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YX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kKICAgICAgICAgICAgICAgICAgICAgICAgIDogY29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRUZXh0QXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXJyYXkucGhvbmVUeXBlcyk7CiAgICAgICAgICAgICAgICAgdHJ5IHsKQEAgLTc0NiwyMCArODQ2LDIzIEBACiAgICAgICAgICAgICByZXR1cm4gZGlzcGxheTsKICAgICAgICAgfQogCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgQ2hhclNlcXVlbmNlIGdldERpc3BsYXlMYWJlbChDb250ZXh0IGNvbnRleHQsIGludCB0eXBlLAogICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBsYWJlbCkgewogICAgICAgICAgICAgcmV0dXJuIGdldERpc3BsYXlMYWJlbChjb250ZXh0LCB0eXBlLCBsYWJlbCwgbnVsbCk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPQogICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vY29udGFjdHMvcGhvbmVzIik7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgZmlsdGVyaW5nIHBob25lIG51bWJlcnMKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfRklMVEVSX1VSTCA9CiAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9jb250YWN0cy9waG9uZXMvZmlsdGVyIik7CiAKQEAgLTc2NywyNiArODcwLDMxIEBACiAgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2Yge0BsaW5rICNDT05URU5UX1VSSX0gcHJvdmlkaW5nIGEgZGlyZWN0b3J5IG9mCiAgICAgICAgICAqIHBob25lcy4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL3Bob25lIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiBhIHtAbGluayAjQ09OVEVOVF9VUkl9IHN1YmRpcmVjdG9yeSBvZiBhIHNpbmdsZQogICAgICAgICAgKiBwaG9uZS4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL3Bob25lIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGRlZmF1bHQgc29ydCBvcmRlciBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgREVGQVVMVF9TT1JUX09SREVSID0gIm5hbWUgQVNDIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIElEIG9mIHRoZSBwZXJzb24gdGhpcyBwaG9uZSBudW1iZXIgaXMgYXNzaWduZWQgdG8uCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEVSU09OX0l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ICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHtAbGluayAjQ09OVEVOVF9VUkl9IHByb3ZpZGluZyBhIGRpcmVjdG9yeSBvZiBhbGwKICAgICAgICAgICogcGVyc29uIGdyb3Vwcy4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL2NvbnRhY3RzZ3JvdXBtZW1iZXJzaGlwIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiBhIHtAbGluayAjQ09OVEVOVF9VUkl9IHN1YmRpcmVjdG9yeSBvZiBhIHNpbmdsZQogICAgICAgICAgKiBwZXJzb24gZ3JvdXAuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9CiAgICAgICAgICAgICAgICAgInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL2NvbnRhY3RzZ3JvdXBtZW1iZXJzaGlwIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGRlZmF1bHQgc29ydCBvcmRlciBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgREVGQVVMVF9TT1JUX09SREVSID0gImdyb3VwX2lkIEFTQyI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSByb3cgaWQgb2YgdGhlIGFjY291bnRzIGdyb3VwLgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1JPVVBfSUQgPSAiZ3JvdXBfaWQiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgc3luYyBpZCBvZiB0aGUgZ3JvdXAuCiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBHUk9VUF9TWU5DX0lEID0gImdyb3VwX3N5bmNfaWQiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgYWNjb3VudCBvZiB0aGUgZ3JvdXAuCiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBHUk9VUF9TWU5DX0FDQ09VTlQgPSAiZ3JvdXBfc3luY19hY2NvdW50IjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFjY291bnQgdHlwZSBvZiB0aGUgZ3JvdXAuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBHUk9VUF9TWU5DX0FDQ09VTlRfVFlQRSA9ICJncm91cF9zeW5jX2FjY291bnRfdHlwZSI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSByb3cgaWQgb2YgdGhlIHBlcnNvbi4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBFUlNPTl9JRCA9ICJwZXJzb24iOwogICAgIH0KIApAQCAtODU2LDU3ICs5ODIsNzAgQEAKICAgICAgKiBDb2x1bW5zIGZyb20gdGhlIENvbnRhY3RNZXRob2RzIHRhYmxlIHRoYXQgb3RoZXIgdGFibGVzIGpvaW4gaW50bwogICAgICAqIHRoZW1zZWxldmVzLgogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIGludGVyZmFjZSBDb250YWN0TWV0aG9kc0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGtpbmQgb2YgdGhlIHRoZSBjb250YWN0IG1ldGhvZC4gRm9yIGV4YW1wbGUsIGVtYWlsIGFkZHJlc3MsCiAgICAgICAgICAqIHBvc3RhbCBhZGRyZXNzLCBldGMuCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKG9uZSBvZiB0aGUgdmFsdWVzIGJlbG93KTwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEtJTkQgPSAia2luZCI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSB0eXBlIG9mIHRoZSBjb250YWN0IG1ldGhvZCwgbXVzdCBiZSBvbmUgb2YgdGhlIHR5cGVzIGJlbG93LgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChvbmUgb2YgdGhlIHZhbHVlcyBiZWxvdyk8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUWVBFID0gInR5cGUiOworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0NVU1RPTSA9IDA7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfSE9NRSA9IDE7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfV09SSyA9IDI7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICA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AgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRBID0gImRhdGEiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBBdXhpbGlhcnkgZGF0YSBmb3IgdGhlIGNvbnRhY3QgbWV0aG9kLgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQVVYX0RBVEEgPSAiYXV4X2RhdGEiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBXaGV0aGVyIHRoaXMgaXMgdGhlIHByaW1hcnkgb3JnYW5pemF0aW9uCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGlmIHNldCwgbm9uLTAgbWVhbnMgdHJ1ZSk8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJU1BSSU1BUlkgPSAiaXNwcmltYXJ5IjsKICAgICB9CiAKQEAgLTkxNCwxOCArMTA1MywyMSBAQAogICAgICAqIFRoaXMgdGFibGUgc3RvcmVzIGFsbCBub24tcGhvbmUgY29udGFjdCBtZXRob2RzIGFuZCBhIHJlZmVyZW5jZSB0byB0aGUKICAgICAgKiBwZXJzb24gdGhhdCB0aGUgY29udGFjdCBtZXRob2QgYmVsb25ncyB0by4KICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgQ29udGFjdE1ldGhvZHMKICAgICAgICAgICAgIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIENvbnRhY3RNZXRob2RzQ29sdW1ucywgUGVvcGxlQ29sdW1ucyB7CiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgY29sdW1uIHdpdGggbGF0aXR1ZGUgZGF0YSBmb3IgcG9zdGFsIGxvY2F0aW9ucwogICAgICAgICAgKiA8UD5UeXBlOiBSRUFMPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUE9TVEFMX0xPQ0FUSU9OX0xBVElUVURFID0gREFUQTsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNvbHVtbiB3aXRoIGxvbmdpdHVkZSBkYXRhIGZvciBwb3N0YWwgbG9jYXRpb25zCiAgICAgICAgICAqIDxQPlR5cGU6IFJFQUw8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQT1NUQUxfTE9DQVRJT05fTE9OR0lUVURFID0gQVVYX0RBVEE7CiAKICAgICAgICAgLyoqCkBAIC05MzYsMjMgKzEwNzgsMzQgQEAKICAgICAgICAgICogIC0gcHJlOjxhbiBpbnRlZ2VyLCBvbmUgb2YgdGhlIHByb3RvY29scyBiZWxvdz4KICAgICAgICAgICogIC0gY3VzdG9tOjxhIHN0cmluZz4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RPQ09MX0FJTSA9IDA7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RPQ09MX01TTiA9IDE7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RPQ09MX1lBSE9PID0gMjsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJPVE9DT0xfU0tZUEUgPSAzOworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9UT0NPTF9RUSA9IDQ7CisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RPQ09MX0dPT0dMRV9UQUxLID0gNTsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJPVE9DT0xfSUNRID0gNjsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJPVE9DT0xfSkFCQkVSID0gNzsKIAorICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBlbmNvZGVQcmVkZWZpbmVkSW1Qcm90b2NvbChpbnQgcHJvdG9jb2wpIHsKICAgICAgICAgICAgIHJldHVybiAicHJlOiIgKyBwcm90b2NvbDsKICAgICAgICAgfQogCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGVuY29kZUN1c3RvbUltUHJvdG9jb2woU3RyaW5nIHByb3RvY29sU3RyaW5nKSB7CiAgICAgICAgICAgICByZXR1cm4gImN1c3RvbToiICsgcHJvdG9jb2xTdHJpbmc7CiAgICAgICAgIH0KIAorICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIE9iamVjdCBkZWNvZGVJbVByb3RvY29sKFN0cmluZyBlbmNvZGVkU3RyaW5nKSB7CiAgICAgICAgICAgICBpZiAoZW5jb2RlZFN0cmluZyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CkBAIC05NjksNyArMTEyMiw3IEBACiAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICAidGhlIHZhbHVlIGlzIG5vdCBhIHZhbGlkIGVuY29kZWQgcHJvdG9jb2wsICIgKyBlbmNvZGVkU3RyaW5nKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICAvKioKICAgICAgICAgICogVGhpcyBsb29rcyB1cCB0aGUgcHJvdmlkZXIgbmFtZSBkZWZpbmVkIGluCiAgICAgICAgICAqIHtAbGluayBhbmRyb2lkLnByb3ZpZGVyLkltLlByb3ZpZGVyTmFtZXN9IGZyb20gdGhlIHByZWRlZmluZWQgSU0gcHJvdG9jb2wgaWQuCkBAIC05ODAsNiArMTEzMyw3IEBACiAgICAgICAgICAqIHByb3ZpZGVyIGlzIGRlZmluZWQgZm9yIHRoZSBnaXZlbiBwcm90b2NvbAogICAgICAgICAgKiBAaGlkZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgbG9va3VwUHJvdmlkZXJOYW1lRnJvbUlkKGludCBwcm90b2NvbCkgewogICAgICAgICAgICAgc3dpdGNoIChwcm90b2NvbCkgewogICAgICAgICAgICAgICAgIGNhc2UgUFJPVE9DT0xfR09PR0xFX1RBTEs6CkBAIC0xMDA3LDYgKzExNjEsNyBAQAogICAgICAgICAgKi8KICAgICAgICAgcHJpdmF0ZSBDb250YWN0TWV0aG9kcygpIHt9CiAKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDaGFyU2VxdWVuY2UgZ2V0RGlzcGxheUxhYmVsKENvbnRleHQgY29udGV4dCwgaW50IGtpbmQsCiAgICAgICAgICAgICAgICAgaW50IHR5cGUsIENoYXJTZXF1ZW5jZSBsYWJlbCkgewogICAgICAgICAgICAgQ2hhclNlcXVlbmNlIGRpc3BsYXkgPSAiIjsKQEAgLTEwMjIsMTMgKzExNzcsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShsYWJlbCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGFiZWwudG9TdHJpbmcoKS5lcXVhbHMoTU9CSUxFX0VNQUlMX1RZUEVfTkFNRSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmdldFN0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcubW9iaWxlRW1haWxUeXBlTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheSA9IGxhYmVsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5ID0gbGFiZWw7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0xMDY1LDYgKzEyMTQsNyBAQAogICAgICAgICAgKiBAcGFyYW0gbGF0aXR1ZGUgdGhlIGxhdGl0dWRlIGZvciB0aGUgYWRkcmVzcwogICAgICAgICAgKiBAcGFyYW0gbG9uZ2l0dWRlIHRoZSBsb25naXR1ZGUgZm9yIHRoZSBhZGRyZXNzCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgdm9pZCBhZGRQb3N0YWxMb2NhdGlvbihDb250ZXh0IGNvbnRleHQsIGxvbmcgcG9zdGFsSWQsCiAgICAgICAgICAgICAgICAgZG91YmxlIGxhdGl0dWRlLCBkb3VibGUgbG9uZ2l0dWRlKSB7CiAgICAgICAgICAgICBmaW5hbCBDb250ZW50UmVzb2x2ZXIgcmVzb2x2ZXIgPSBjb250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpOwpAQCAtMTA4NCwxMiArMTIzNCwxNCBAQAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJMIGZvciB0aGlzIHRhYmxlCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9CiAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9jb250YWN0cy9jb250YWN0X21ldGhvZHMiKTsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJMIGZvciBzdWItZGlyZWN0b3J5IG9mIGUtbWFpbCBhZGRyZXNzZXMuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX0VNQUlMX1VSSSA9CiAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9jb250YWN0cy9jb250YWN0X21ldGhvZHMvZW1haWwiKTsKIApAQCAtMTA5NywzMCArMTI0OSwzNSBAQAogICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHtAbGluayAjQ09OVEVOVF9VUkl9IHByb3ZpZGluZyBhIGRpcmVjdG9yeSBvZgogICAgICAgICAgKiBwaG9uZXMuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLmRpci9jb250YWN0LW1ldGhvZHMiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIGEge0BsaW5rICNDT05URU5UX0VNQUlMX1VSSX0gc3ViLWRpcmVjdG9yeSBvZlwKICAgICAgICAgICogbXVsdGlwbGUge0BsaW5rIENvbnRhY3RzI0tJTkRfRU1BSUx9IGVudHJpZXMuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0VNQUlMX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLmRpci9lbWFpbCI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2YgYSB7QGxpbmsgI0NPTlRFTlRfRU1BSUxfVVJJfSBzdWItZGlyZWN0b3J5IG9mXAogICAgICAgICAgKiBtdWx0aXBsZSB7QGxpbmsgQ29udGFjdHMjS0lORF9QT1NUQUx9IGVudHJpZXMuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1BPU1RBTF9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5kaXIvcG9zdGFsLWFkZHJlc3MiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIGEge0BsaW5rICNDT05URU5UX1VSSX0gc3ViLWRpcmVjdG9yeSBvZiBhIHNpbmdsZQogICAgICAgICAgKiB7QGxpbmsgQ29udGFjdHMjS0lORF9FTUFJTH0gZW50cnkuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0VNQUlMX0lURU1fVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9lbWFpbCI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2YgYSB7QGxpbmsgI0NPTlRFTlRfVVJJfSBzdWItZGlyZWN0b3J5IG9mIGEgc2luZ2xlCiAgICAgICAgICAqIHtAbGluayBDb250YWN0cyNLSU5EX1BPU1RBTH0gZW50cnkuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1BPU1RBTF9JVEVNX1RZUEUKICAgICAgICAgICAgICAgICA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9wb3N0YWwtYWRkcmVzcyI7CiAKQEAgLTExMjgsMjMgKzEyODUsMjcgQEAKICAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiBhIHtAbGluayAjQ09OVEVOVF9VUkl9IHN1Yi1kaXJlY3Rvcnkgb2YgYSBzaW5nbGUKICAgICAgICAgICoge0BsaW5rIENvbnRhY3RzI0tJTkRfSU19IGVudHJ5LgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JTV9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vamFiYmVyLWltIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGRlZmF1bHQgc29ydCBvcmRlciBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgREVGQVVMVF9TT1JUX09SREVSID0gIm5hbWUgQVNDIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIElEIG9mIHRoZSBwZXJzb24gdGhpcyBjb250YWN0IG1ldGhvZCBpcyBhc3NpZ25lZCB0by4KICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZyk8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQRVJTT05fSUQgPSAicGVyc29uIjsKICAgICB9CiAKICAgICAvKioKICAgICAgKiBU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F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgSU1fQUNDT1VOVCA9ICJpbV9hY2NvdW50IjsKICAgICB9CiAKQEAgLTExNzIsMTEgKzEzMzYsMTMgQEAKICAgICAgKiBDb250YWlucyBwcmVzZW5jZSBpbmZvcm1hdGlvbiBhYm91dCBjb250YWN0cy4KICAgICAgKiBAaGlkZQogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBQcmVzZW5jZQogICAgICAgICAgICAgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgUHJlc2VuY2VDb2x1bW5zLCBQZW9wbGVDb2x1bW5zIHsKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPQogICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vY29udGFjdHMvcHJlc2VuY2UiKTsKIApAQCAtMTE4NCwyOSArMTM1MCwzMSBAQAogICAgICAgICAgKiBUaGUgSUQgb2YgdGhlIHBlcnNvbiB0aGlzIHByZXNlbmNlIGl0ZW0gaXMgYXNzaWduZWQgdG8uCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEVSU09OX0lEID0gInBlcnNvbiI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIEdldHMgdGhlIHJlc291cmNlIElEIGZvciB0aGUgcHJvcGVyIHByZXNlbmNlIGljb24uCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gc3RhdHVzIHRoZSBzdGF0dXMgdG8gZ2V0IHRoZSBpY29uIGZvcgogICAgICAgICAgKiBAcmV0dXJuIHRoZSByZXNvdXJjZSBJRCBmb3IgdGhlIHByb3BlciBwcmVzZW5jZSBpY29uCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBnZXRQcmVzZW5jZUljb25SZXNvdXJjZUlkKGludCBzdGF0dXMpIHsKICAgICAgICAgICAgIHN3aXRjaCAoc3RhdHVzKSB7CiAgICAgICAgICAgICAgICAgY2FzZSBDb250YWN0cy5QZW9wbGUuQVZBSUxBQkxFOgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kcmF3YWJsZS5wcmVzZW5jZV9vbmxpbmU7Ci0gICAgCisKICAgICAgICAgICAgICAgICBjYXNlIENvbnRhY3RzLlBlb3BsZS5JRExFOgogICAgICAgICAgICAgICAgIGNhc2UgQ29udGFjdHMuUGVvcGxlLkFXQVk6CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmRyYXdhYmxlLnByZXNlbmNlX2F3YXk7Ci0gICAgCisKICAgICAgICAgICAgICAgICBjYXNlIENvbnRhY3RzLlBlb3BsZS5ET19OT1RfRElTVFVSQjoKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUucHJlc2VuY2VfYnVzeTsKLSAgICAKKwogICAgICAgICAgICAgICAgIGNhc2UgQ29udGFjdHMuUGVvcGxlLklOVklTSUJMRToKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUucHJlc2VuY2VfaW52aXNpYmxlOwotICAgICAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgIGNhc2UgQ29udGFjdHMuUGVvcGxlLk9GRkxJTkU6CiAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUucHJlc2VuY2Vfb2ZmbGluZTsKQEAgLTEyMTksNiArMTM4Nyw3IEBACiAgICAgICAgICAqIEBwYXJhbSBpY29uIHRoZSBpY29uIHRvIHRvIHNldAogICAgICAgICAgKiBAcGFyYW0gc2VydmVyU3RhdHVzIHRoYXQgc3RhdHVzCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIHZvaWQgc2V0UHJlc2VuY2VJY29uKEltYWdlVmlldyBpY29uLCBpbnQgc2VydmVyU3RhdHVzKSB7CiAgICAgICAgICAgICBpY29uLnNldEltYWdlUmVzb3VyY2UoZ2V0UHJlc2VuY2VJY29uUmVzb3VyY2VJZChzZXJ2ZXJTdGF0dXMpKTsKICAgICAgICAgfQpAQCAtMTIyNyw1NyArMTM5Niw2OSBAQAogICAgIC8qKgogICAgICAqIENvbHVtbnMgZnJvbSB0aGUgT3JnYW5pemF0aW9ucyB0YWJsZSB0aGF0IG90aGVyIGNvbHVtbnMgam9pbiBpbnRvIHRoZW1zZWx2ZXMuCiAgICAgICovCisgICAgQERlcHJlY2F0ZWQKICAgICBwdWJsaWMgaW50ZXJmYWNlIE9yZ2FuaXphdGlvbkNvbHVtbnMgewogICAgICAgICAvKioKLSAgICAgICAgICogVGhlIHR5cGUgb2YgdGhlIHRoZSBwaG9uZSBudW1iZXIuCisgICAgICAgICAqIFRoZSB0eXBlIG9mIHRoZSBvcmdhbml6YXRpb25zLgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChvbmUgb2YgdGhlIGNvbnN0YW50cyBiZWxvdyk8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUWVBFID0gInR5cGUiOwogCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfQ1VTVE9NID0gMDsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9XT1JLID0gMTsKKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSB1c2VyIHByb3ZpZGVkIGxhYmVsLCBvbmx5IHVzZWQgaWYgVFlQRSBpcyBUWVBFX0NVU1RPTS4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExBQkVMID0gImxhYmVsIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIG5hbWUgb2YgdGhlIGNvbXBhbnkgZm9yIHRoaXMgb3JnYW5pemF0aW9uLgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09NUEFOWSA9ICJjb21wYW55IjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHRpdGxlIHdpdGhpbiB0aGlzIG9yZ2FuaXphdGlvbi4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJVExFID0gInRpdGxlIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHBlcnNvbiB0aGlzIG9yZ2FuaXphdGlvbiBpcyB0aWVkIHRvLgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEVSU09OX0lEID0gInBlcnNvbiI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFdoZXRoZXIgdGhpcyBpcyB0aGUgcHJpbWFyeSBvcmdhbml6YXRpb24KICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAoaWYgc2V0LCBub24tMCBtZWFucyB0cnVlKTwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElTUFJJTUFSWSA9ICJpc3ByaW1hcnkiOwogICAgIH0KIAogICAgIC8qKgogICAgICAqIEEgc3ViIGRpcmVjdG9yeSBvZiBhIHNpbmdsZSBwZXJzb24gdGhhdCBjb250YWlucyBhbGwgb2YgdGhlaXIgUGhvbmVzLgogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBPcmdhbml6YXRpb25zIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIE9yZ2FuaXphdGlvbkNvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogbm8gcHVibGljIGNvbnN0cnVjdG9yIHNpbmNlIHRoaXMgaXMgYSB1dGlsaXR5IGNsYXNzCiAgICAgICAgICAqLwogICAgICAgICBwcml2YXRlIE9yZ2FuaXphdGlvbnMoKSB7fQogCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgQ2hhclNlcXVlbmNlIGdldERpc3BsYXlMYWJlbChDb250ZXh0IGNvbnRleHQsIGludCB0eXBlLAogICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBsYWJlbCkgewogICAgICAgICAgICAgQ2hhclNlcXVlbmNlIGRpc3BsYXkgPSAiIjsKQEAgLTEzMDEsMzQgKzE0ODIsNDAgQEAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPQogICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vY29udGFjdHMvb3JnYW5pemF0aW9ucyIpOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgZGlyZWN0b3J5IHR3aWcgZm9yIHRoaXMgc3ViLXRhYmxlCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0RJUkVDVE9SWSA9ICJvcmdhbml6YXRpb25zIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGRlZmF1bHQgc29ydCBvcmRlciBmb3IgdGhpcyB0YWJsZQogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgREVGQVVMVF9TT1JUX09SREVSID0gImNvbXBhbnksIHRpdGxlLCBpc3ByaW1hcnkgQVNDIjsKICAgICB9CiAKICAgICAvKioKICAgICAgKiBDb2x1bW5zIGZyb20gdGhlIFBob3RvcyB0YWJsZSB0aGF0IG90aGVyIGNvbHVtbnMgam9pbiBpbnRvIHRoZW1zZWx2ZXMuCiAgICAgICovCisgICAgQERlcHJlY2F0ZWQKICAgICBwdWJsaWMgaW50ZXJmYWNlIFBob3Rvc0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIF9TWU5DX1ZFUlNJT04gb2YgdGhlIHBob3RvIHRoYXQgd2FzIGxhc3QgZG93bmxvYWRlZAogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTE9DQUxfVkVSU0lPTiA9ICJsb2NhbF92ZXJzaW9uIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHBlcnNvbiB0aGlzIHBob3RvIGlzIGFzc29jaWF0ZWQgd2l0aC4KICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBFUlNPTl9JRCA9ICJwZXJzb24iOwogCiAgICAgICAgIC8qKgpAQCAtMTMzNiwxMiArMTUyMywxNCBAQAogICAgICAgICAgKiBZb3UgbXVzdCBzcGVjaWZ5IHRoaXMgaW4gdGhlIGNvbHVtbnMgaW4gb3JkZXIgdG8gdXNlIGl0IGluIHRoZSB3aGVyZSBjbGF1c2UuCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIoYm9vbGVhbik8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBET1dOTE9BRF9SRVFVSVJFRCA9ICJkb3dubG9hZF9yZXF1aXJlZCI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIG5vbi16ZXJvIGlmIHRoaXMgcGhvdG8gaXMga25vd24gdG8gZXhpc3Qgb24gdGhlIHNlcnZlcgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSKGJvb2xlYW4pPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRVhJU1RTX09OX1NFUlZFUiA9ICJleGlzdHNfb25fc2VydmVyIjsKIAogICAgICAgICAvKioKQEAgLTEzNDksMTIgKzE1MzgsMTQgQEAKICAgICAgICAgICogdGhlIHByZXZpb3VzIGF0dGVtcHQuIElmIG51bGwgdGhlbiB0aGUgcHJldmlvdXMgYXR0ZW1wdCBzdWNjZWVkZWQuCiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTWU5DX0VSUk9SID0gInN5bmNfZXJyb3IiOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgaW1hZ2UgZGF0YSwgb3IgbnVsbCBpZiB0aGVyZSBpcyBubyBpbWFnZS4KICAgICAgICAgICogPFA+VHlwZTogQkxPQjwvUD4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERBVEEgPSAiZGF0YSI7CiAKICAgICB9CkBAIC0xMzYyLDYgKzE1NTMsNyBAQAogICAgIC8qKgogICAgICAqIFRoZSBwaG90b3Mgb3ZlciBhbGwgb2YgdGhlIHBlb3BsZQogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBQaG90b3MgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgUGhvdG9zQ29sdW1ucywgU3luY0NvbnN0VmFsdWUgewogICAgICAgICAvKioKICAgICAgICAgICogbm8gcHVibGljIGNvbnN0cnVjdG9yIHNpbmNlIHRoaXMgaXMgYSB1dGlsaXR5IGNsYXNzCkBAIC0xMzcxLDM3ICsxNTYzLDQ0IEBACiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkwgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0KICAgICAgICAgICAgIFVyaS5wYXJzZSgiY29udGVudDovL2NvbnRhY3RzL3Bob3RvcyIpOwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgZGlyZWN0b3J5IHR3aWcgZm9yIHRoaXMgc3ViLXRhYmxlCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0RJUkVDVE9SWSA9ICJwaG90byI7CiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBkZWZhdWx0IHNvcnQgb3JkZXIgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFRkFVTFRfU09SVF9PUkRFUiA9ICJwZXJzb24gQVNDIjsKICAgICB9CiAKKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBpbnRlcmZhY2UgRXh0ZW5zaW9uc0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIG5hbWUgb2YgdGhpcyBleHRlbnNpb24uIE1heSBub3QgYmUgbnVsbC4gVGhlcmUgbWF5IGJlIGF0IG1vc3Qgb25lIHJvdyBmb3IgZWFjaCBuYW1lLgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTkFNRSA9ICJuYW1lIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIHZhbHVlIG9mIHRoaXMgZXh0ZW5zaW9uLiBNYXkgbm90IGJlIG51bGwuCiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBWQUxVRSA9ICJ2YWx1ZSI7CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogVGhlIGV4dGVuc2lvbnMgZm9yIGEgcGVyc29uCiAgICAgICovCisgICAgQERlcHJlY2F0ZWQKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIEV4dGVuc2lvbnMgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgRXh0ZW5zaW9uc0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogbm8gcHVibGljIGNvbnN0cnVjdG9yIHNpbmNlIHRoaXMgaXMgYSB1dGlsaXR5IGNsYXNzCkBAIC0xNDExLDYgKzE2MTAsNyBAQAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJMIGZvciB0aGlzIHRhYmxlCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9CiAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9jb250YWN0cy9leHRlbnNpb25zIik7CiAKQEAgLTE0MTgsMjIgKzE2MTgsMjcgQEAKICAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiB7QGxpbmsgI0NPTlRFTlRfVVJJfSBwcm92aWRpbmcgYSBkaXJlY3Rvcnkgb2YKICAgICAgICAgICogcGhvbmVzLgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5kaXIvY29udGFjdF9leHRlbnNpb25zIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiBhIHtAbGluayAjQ09OVEVOVF9VUkl9IHN1YmRpcmVjdG9yeSBvZiBhIHNpbmdsZQogICAgICAgICAgKiBwaG9uZS4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL2NvbnRhY3RfZXh0ZW5zaW9ucyI7CisKICAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBkZWZhdWx0IHNvcnQgb3JkZXIgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFRkFVTFRfU09SVF9PUkRFUiA9ICJwZXJzb24sIG5hbWUgQVNDIjsKIAogICAgICAgICAvKioKICAgICAgICAgICogVGhlIElEIG9mIHRoZSBwZXJzb24gdGhpcyBwaG9uZSBudW1iZXIgaXMgYXNzaWduZWQgdG8uCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEVSU09OX0lEID0gInBlcnNvbiI7CiAgICAgfQogCkBAIC0xNDQxLDMzICsxNjQ2LDQxIEBACiAgICAgICogQ29udGFpbnMgaGVscGVyIGNsYXNzZXMgdXNlZCB0byBjcmVhdGUgb3IgbWFuYWdlIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuSW50ZW50IEludGVudHN9CiAgICAgICogdGhhdCBpbnZvbHZlIGNvbnRhY3RzLgogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBJbnRlbnRzIHsKKyAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgcHVibGljIEludGVudHMoKSB7CisgICAgICAgIH0KKwogICAgICAgICAvKio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RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9GT1JDRV9DUkVBVEUgPSBDb250YWN0c0NvbnRyYWN0LkludGVudHMuRVhUUkFfRk9SQ0VfQ1JFQVRFOworCiAgICAgICAgIC8qKgogICAgICAgICAgKiBVc2VkIHdpdGgge0BsaW5rICNTSE9XX09SX0NSRUFURV9DT05UQUNUfSB0byBzcGVjaWZ5IGFuIGV4YWN0CiAgICAgICAgICAqIGRlc2NyaXB0aW9uIHRvIGJlIHNob3duIHdoZW4gcHJvbXB0aW5nIHVzZXIgYWJvdXQgY3JlYXRpbmcgYSBuZXcKQEAgLTE1MTIsNjkgKzE3MjYsOTMgQEAKICAgICAgICAgICogPHA+CiAgICAgICAgICAqIFR5cGU6IFNUUklORwogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRVhUUkFfQ1JFQVRFX0RFU0NSSVBUSU9OID0KLSAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uQ1JFQVRFX0RFU0NSSVBUSU9OIjsKKyAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuRVhUUkFfQ1JFQVRFX0RFU0NSSVBUSU9OOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBPcHRpb25hbCBleHRyYSB1c2VkIHdpdGgge0BsaW5rICNTSE9XX09SX0NSRUFURV9DT05UQUNUfSB0byBzcGVjaWZ5IGEKKyAgICAgICAgICogZGlhbG9nIGxvY2F0aW9uIHVzaW5nIHNjcmVlbiBjb29yZGluYXRlcy4gV2hlbiBub3Qgc3BlY2lmaWVkLCB0aGUKKyAgICAgICAgICogZGlhbG9nIHdpbGwgYmUgY2VudGVyZWQuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgcmV2aWV3CisgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9UQVJHRVRfUkVDVCA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5FWFRSQV9UQVJHRVRfUkVDVDsKIAogICAgICAgICAvKioKICAgICAgICAgICogSW50ZW50cyByZWxhdGVkIHRvIHRoZSBDb250YWN0cyBhcHAgVUkuCiAgICAgICAgICAqLworICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFVJIHsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgVUkoKSB7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGFjdGlvbiBmb3IgdGhlIGRlZmF1bHQgY29udGFjdHMgbGlzdCB0YWIuCiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExJU1RfREVGQVVMVCA9Ci0gICAgICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uTElTVF9ERUZBVUxUIjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMSVNUX0RFRkFVTFQgPSBDb250YWN0c0NvbnRyYWN0LkludGVudHMuVUkuTElTVF9ERUZBVUxUOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBhY3Rpb24gZm9yIHRoZSBjb250YWN0cyBsaXN0IHRhYi4KICAgICAgICAgICAgICAqLworICAgICAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExJU1RfR1JPVVBfQUNUSU9OID0KLSAgICAgICAgICAgICAgICAgICAgImNvbS5hbmRyb2lkLmNvbnRhY3RzLmFjdGlvbi5MSVNUX0dST1VQIjsKKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLlVJLkxJU1RfR1JPVVBfQUNUSU9OOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFdoZW4gaW4gTElTVF9HUk9VUF9BQ1RJT04gbW9kZSwgdGhpcyBpcyB0aGUgZ3JvdXAgdG8gZGlzcGxheS4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1JPVVBfTkFNRV9FWFRSQV9LRVkgPSAiY29tLmFuZHJvaWQuY29udGFjdHMuZXh0cmEuR1JPVVAiOwotICAgICAgICAgICAgCisgICAgICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1JPVVBfTkFNRV9FWFRSQV9LRVkgPQorICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuVUkuR1JPVVBfTkFNRV9FWFRSQV9LRVk7CiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBhY3Rpb24gZm9yIHRoZSBhbGwgY29udGFjdHMgbGlzdCB0YWIuCiAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMSVNUX0FMTF9DT05UQUNUU19BQ1RJT04gPQotICAgICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLkxJU1RfQUxMX0NPTlRBQ1RTIjsKKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLlVJLkxJU1RfQUxMX0NPTlRBQ1RTX0FDVElPTjsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgYWN0aW9uIGZvciB0aGUgY29udGFjdHMgd2l0aCBwaG9uZSBudW1iZXJzIGxpc3QgdGFiLgogICAgICAgICAgICAgICovCisgICAgICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTElTVF9DT05UQUNUU19XSVRIX1BIT05FU19BQ1RJT04gPQotICAgICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLkxJU1RfQ09OVEFDVFNfV0lUSF9QSE9ORVMiOworICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuVUkuTElTVF9DT05UQUNUU19XSVRIX1BIT05FU19BQ1RJT047CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGFjdGlvbiBmb3IgdGhlIHN0YXJyZWQgY29udGFjdHMgbGlzdCB0YWIuCiAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMSVNUX1NUQVJSRURfQUNUSU9OID0KLSAgICAgICAgICAgICAgICAgICAgImNvbS5hbmRyb2lkLmNvbnRhY3RzLmFjdGlvbi5MSVNUX1NUQVJSRUQiOworICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuVUkuTElTVF9TVEFSUkVEX0FDVElPTjsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgYWN0aW9uIGZvciB0aGUgZnJlcXVlbnQgY29udGFjdHMgbGlzdCB0YWIuCiAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMSVNUX0ZSRVFVRU5UX0FDVElPTiA9Ci0gICAgICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uTElTVF9GUkVRVUVOVCI7CisgICAgICAgICAgICAgICAgICAgIENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5VSS5MSVNUX0ZSRVFVRU5UX0FDVElPTjsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgYWN0aW9uIGZvciB0aGUgInN0cmVxdWVudCIgY29udGFjdHMgbGlzdCB0YWIuIEl0IGZpcnN0IGxpc3RzIHRoZSBzdGFycmVkCiAgICAgICAgICAgICAgKiBjb250YWN0cyBpbiBhbHBoYWJldGljYWwgb3JkZXIgYW5kIHRoZW4gdGhlIGZyZXF1ZW50IGNvbnRhY3RzIGluIGRlc2NlbmRpbmcKICAgICAgICAgICAgICAqIG9yZGVyIG9mIHRoZSBudW1iZXIgb2YgdGltZXMgdGhleSBoYXZlIGJlZW4gY29udGFjdGVkLgogICAgICAgICAgICAgICovCisgICAgICAgICAgICBARGVwcmVjYXRlZAogICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTElTVF9TVFJFUVVFTlRfQUNUSU9OID0KLSAgICAgICAgICAgICAgICAgICAgImNvbS5hbmRyb2lkLmNvbnRhY3RzLmFjdGlvbi5MSVNUX1NUUkVRVUVOVCI7CisgICAgICAgICAgICAgICAgICAgIENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5VSS5MSVNUX1NUUkVRVUVOVF9BQ1RJT047CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogQSBrZXkgZm9yIHRvIGJlIHVzZWQgYXMgYW4gaW50ZW50IGV4dHJhIHRvIHNldCB0aGUgYWN0aXZpdHkKICAgICAgICAgICAgICAqIHRpdGxlIHRvIGEgY3VzdG9tIFN0cmluZyB2YWx1ZS4KICAgICAgICAgICAgICAqLworICAgICAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJVExFX0VYVFJBX0tFWSA9Ci0gICAgICAgICAgICAgICAgImNvbS5hbmRyb2lkLmNvbnRhY3RzLmV4dHJhLlRJVExFX0VYVFJBIjsKLSAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuVUkuVElUTEVfRVhUUkFfS0VZOworCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIEFjdGl2aXR5IEFjdGlvbjogRGlzcGxheSBhIGZpbHRlcmVkIGxpc3Qgb2YgY29udGFjdHMKICAgICAgICAgICAgICAqIDxwPgpAQCAtMTU4MywxODcgKzE4MjEsMjMyIEBACiAgICAgICAgICAgICAgKiA8cD4KICAgICAgICAgICAgICAqIE91dHB1dDogTm90aGluZy4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRklMVEVSX0NPTlRBQ1RTX0FDVElPTiA9IAotICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uRklMVEVSX0NPTlRBQ1RTIjsKLSAgICAgICAgICAgIAorICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEZJTFRFUl9DT05UQUNUU19BQ1RJT04gPQorICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuVUkuRklMVEVSX0NPTlRBQ1RTX0FDVElPTjsKKwogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBVc2VkIGFzIGFuIGludCBleHRyYSBmaWVsZCBpbiB7QGxpbmsgI0ZJTFRFUl9DT05UQUNUU19BQ1RJT059CiAgICAgICAgICAgICAgKiBpbnRlbnRzIHRvIHN1cHBseSB0aGUgdGV4dCBvbiB3aGljaCB0byBmaWx0ZXIuCiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEZJTFRFUl9URVhUX0VYVFJBX0tFWSA9IAotICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5leHRyYS5GSUxURVJfVEVYVCI7CisgICAgICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRklMVEVSX1RFWFRfRVhUUkFfS0VZID0KKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLlVJLkZJTFRFUl9URVhUX0VYVFJBX0tFWTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBDb252ZW5pZW5jZSBjbGFzcyB0aGF0IGNvbnRhaW5zIHN0cmluZyBjb25zdGFudHMgdXNlZAogICAgICAgICAgKiB0byBjcmVhdGUgY29udGFjdCB7QGxpbmsgYW5kcm9pZC5jb250ZW50LkludGVudCBJbnRlbnRzfS4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgSW5zZXJ0IHsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgSW5zZXJ0KCkgeworICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAvKiogVGhlIGFjdGlvbiBjb2RlIHRvIHVzZSB3aGVuIGFkZGluZyBhIGNvbnRhY3QgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDVElPTiA9IEludGVudC5BQ1RJT05fSU5TRVJUOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDVElPTiA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuQUNUSU9OOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIElmIHByZXNlbnQsIGZvcmNlcyBhIGJ5cGFzcyBvZiBxdWljayBpbnNlcnQgbW9kZS4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRlVMTF9NT0RFID0gImZ1bGxfbW9kZSI7CisgICAgICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRlVMTF9NT0RFID0gQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5GVUxMX01PREU7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBuYW1lLgogICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgogICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBOQU1FID0gIm5hbWUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5BTUUgPSBDb250YWN0c0NvbnRyYWN0LkludGVudHMuSW5zZXJ0Lk5BTUU7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBwaG9uZXRpYyBuYW1lLgogICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgogICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9ORVRJQ19OQU1FID0gInBob25ldGljX25hbWUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBIT05FVElDX05BTUUgPQorICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuSW5zZXJ0LlBIT05FVElDX05BTUU7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBjb21wYW55LgogICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgogICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT01QQU5ZID0gImNvbXBhbnkiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTVBBTlkgPSBDb250YWN0c0NvbnRyYWN0LkludGVudHMuSW5zZXJ0LkNPTVBBTlk7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBqb2IgdGl0bGUuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEpPQl9USVRMRSA9ICJqb2JfdGl0bGUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEpPQl9USVRMRSA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuSk9CX1RJVExFOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIGNvbnRhY3Qgbm90ZXMuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5PVEVTID0gIm5vdGVzIjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBOT1RFUyA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuTk9URVM7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBwaG9uZSBudW1iZXIuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBIT05FID0gInBob25lIjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9ORSA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuUEhPTkU7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBwaG9uZSBudW1iZXIgdHlwZS4KICAgICAgICAgICAgICAqIDxQPlR5cGU6IEVpdGhlciBhbiBpbnRlZ2VyIHZhbHVlIGZyb20ge0BsaW5rIGFuZHJvaWQucHJvdmlkZXIuQ29udGFjdHMuUGhvbmVzQ29sdW1ucyBQaG9uZXNDb2x1bW5zfSwKICAgICAgICAgICAgICAqICBvciBhIHN0cmluZyBzcGVjaWZ5aW5nIGEgY3VzdG9tIGxhYmVsLjwvUD4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPTkVfVFlQRSA9ICJwaG9uZV90eXBlIjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9ORV9UWVBFID0gQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5QSE9ORV9UWVBFOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIHBob25lIGlzcHJpbWFyeSBmbGFnLgogICAgICAgICAgICAgICogPFA+VHlwZTogYm9vbGVhbjwvUD4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPTkVfSVNQUklNQVJZID0gInBob25lX2lzcHJpbWFyeSI7CisgICAgICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPTkVfSVNQUklNQVJZID0KKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5QSE9ORV9JU1BSSU1BUlk7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBvcHRpb25hbCBzZWNvbmQgY29udGFjdCBwaG9uZSBudW1iZXIuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQ09OREFSWV9QSE9ORSA9ICJzZWNvbmRhcnlfcGhvbmUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQ09OREFSWV9QSE9ORSA9CisgICAgICAgICAgICAgICAgICAgIENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuU0VDT05EQVJZX1BIT05FOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgYW4gb3B0aW9uYWwgc2Vjb25kIGNvbnRhY3QgcGhvbmUgbnVtYmVyIHR5cGUuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBFaXRoZXIgYW4gaW50ZWdlciB2YWx1ZSBmcm9tIHtAbGluayBhbmRyb2lkLnByb3ZpZGVyLkNvbnRhY3RzLlBob25lc0NvbHVtbnMgUGhvbmVzQ29sdW1uc30sCiAgICAgICAgICAgICAgKiAgb3IgYSBzdHJpbmcgc3BlY2lmeWluZyBhIGN1c3RvbSBsYWJlbC48L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQ09OREFSWV9QSE9ORV9UWVBFID0gInNlY29uZGFyeV9waG9uZV90eXBlIjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUNPTkRBUllfUEhPTkVfVFlQRSA9CisgICAgICAgICAgICAgICAgICAgIENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuU0VDT05EQVJZX1BIT05FX1RZUEU7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBvcHRpb25hbCB0aGlyZCBjb250YWN0IHBob25lIG51bWJlci4KICAgICAgICAgICAgICAqIDxQPlR5cGU6IFN0cmluZzwvUD4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEVSVElBUllfUEhPTkUgPSAidGVydGlhcnlfcGhvbmUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRFUlRJQVJZX1BIT05FID0KKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5URVJUSUFSWV9QSE9ORTsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHRoaXJkIGNvbnRhY3QgcGhvbmUgbnVtYmVyIHR5cGUuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBFaXRoZXIgYW4gaW50ZWdlciB2YWx1ZSBmcm9tIHtAbGluayBhbmRyb2lkLnByb3ZpZGVyLkNvbnRhY3RzLlBob25lc0NvbHVtbnMgUGhvbmVzQ29sdW1uc30sCiAgICAgICAgICAgICAgKiAgb3IgYSBzdHJpbmcgc3BlY2lmeWluZyBhIGN1c3RvbSBsYWJlbC48L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRFUlRJQVJZX1BIT05FX1RZUEUgPSAidGVydGlhcnlfcGhvbmVfdHlwZSI7CisgICAgICAgICAgICBARGVwcmVjYXRlZAorICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEVSVElBUllfUEhPTkVfVFlQRSA9CisgICAgICAgICAgICAgICAgICAgIENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuVEVSVElBUllfUEhPTkVfVFlQRTsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIHRoZSBjb250YWN0IGVtYWlsIGFkZHJlc3MuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVNQUlMID0gImVtYWlsIjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFTUFJTCA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuRU1BSUw7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBlbWFpbCB0eXBlLgogICAgICAgICAgICAgICogPFA+VHlwZTogRWl0aGVyIGFuIGludGVnZXIgdmFsdWUgZnJvbSB7QGxpbmsgYW5kcm9pZC5wcm92aWRlci5Db250YWN0cy5Db250YWN0TWV0aG9kc0NvbHVtbnMgQ29udGFjdE1ldGhvZHNDb2x1bW5zfQogICAgICAgICAgICAgICogIG9yIGEgc3RyaW5nIHNwZWNpZnlpbmcgYSBjdXN0b20gbGFiZWwuPC9QPgogICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFTUFJTF9UWVBFID0gImVtYWlsX3R5cGUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVNQUlMX1RZUEUgPSBDb250YWN0c0NvbnRyYWN0LkludGVudHMuSW5zZXJ0LkVNQUlMX1RZUEU7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgZW1haWwgaXNwcmltYXJ5IGZsYWcuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBib29sZWFuPC9QPgogICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFTUFJTF9JU1BSSU1BUlkgPSAiZW1haWxfaXNwcmltYXJ5IjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFTUFJTF9JU1BSSU1BUlkgPQorICAgICAgICAgICAgICAgICAgICBDb250YWN0c0NvbnRyYWN0LkludGVudHMuSW5zZXJ0LkVNQUlMX0lTUFJJTUFSWTsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHNlY29uZCBjb250YWN0IGVtYWlsIGFkZHJlc3MuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQ09OREFSWV9FTUFJTCA9ICJzZWNvbmRhcnlfZW1haWwiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQ09OREFSWV9FTUFJTCA9CisgICAgICAgICAgICAgICAgICAgIENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuU0VDT05EQVJZX0VNQUlMOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgYW4gb3B0aW9uYWwgc2Vjb25kIGNvbnRhY3QgZW1haWwgdHlwZS4KICAgICAgICAgICAgICAqIDxQPlR5cGU6IEVpdGhlciBhbiBpbnRlZ2VyIHZhbHVlIGZyb20ge0BsaW5rIGFuZHJvaWQucHJvdmlkZXIuQ29udGFjdHMuQ29udGFjdE1ldGhvZHNDb2x1bW5zIENvbnRhY3RNZXRob2RzQ29sdW1uc30KICAgICAgICAgICAgICAqICBvciBhIHN0cmluZyBzcGVjaWZ5aW5nIGEgY3VzdG9tIGxhYmVsLjwvUD4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VDT05EQVJZX0VNQUlMX1RZUEUgPSAic2Vjb25kYXJ5X2VtYWlsX3R5cGUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQ09OREFSWV9FTUFJTF9UWVBFID0KKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5TRUNPTkRBUllfRU1BSUxfVFlQRTsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHRoaXJkIGNvbnRhY3QgZW1haWwgYWRkcmVzcy4KICAgICAgICAgICAgICAqIDxQPlR5cGU6IFN0cmluZzwvUD4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEVSVElBUllfRU1BSUwgPSAidGVydGlhcnlfZW1haWwiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRFUlRJQVJZX0VNQUlMID0KKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5URVJUSUFSWV9FTUFJTDsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHRoaXJkIGNvbnRhY3QgZW1haWwgdHlwZS4KICAgICAgICAgICAgICAqIDxQPlR5cGU6IEVpdGhlciBhbiBpbnRlZ2VyIHZhbHVlIGZyb20ge0BsaW5rIGFuZHJvaWQucHJvdmlkZXIuQ29udGFjdHMuQ29udGFjdE1ldGhvZHNDb2x1bW5zIENvbnRhY3RNZXRob2RzQ29sdW1uc30KICAgICAgICAgICAgICAqICBvciBhIHN0cmluZyBzcGVjaWZ5aW5nIGEgY3VzdG9tIGxhYmVsLjwvUD4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEVSVElBUllfRU1BSUxfVFlQRSA9ICJ0ZXJ0aWFyeV9lbWFpbF90eXBlIjsKKyAgICAgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBURVJUSUFSWV9FTUFJTF9UWVBFID0KKyAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5URVJUSUFSWV9FTUFJTF9UWVBFOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIGNvbnRhY3QgcG9zdGFsIGFkZHJlc3MuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBPU1RBTCA9ICJwb3N0YWwiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBPU1RBTCA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuUE9TVEFMOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIGNvbnRhY3QgcG9zdGFsIGFkZHJlc3MgdHlwZS4KICAgICAgICAgICAgICAqIDxQPlR5cGU6IEVpdGhlciBhbiBpbnRlZ2VyIHZhbHVlIGZyb20ge0BsaW5rIGFuZHJvaWQucHJvdmlkZXIuQ29udGFjdHMuQ29udGFjdE1ldGhvZHNDb2x1bW5zIENvbnRhY3RNZXRob2RzQ29sdW1uc30KICAgICAgICAgICAgICAqICBvciBhIHN0cmluZyBzcGVjaWZ5aW5nIGEgY3VzdG9tIGxhYmVsLjwvUD4KICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUE9TVEFMX1RZUEUgPSAicG9zdGFsX3R5cGUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBPU1RBTF9UWVBFID0gQ29udGFjdHNDb250cmFjdC5JbnRlbnRzLkluc2VydC5QT1NUQUxfVFlQRTsKIAogICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIHRoZSBwb3N0YWwgaXNwcmltYXJ5IGZsYWcuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBib29sZWFuPC9QPgogICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQT1NUQUxfSVNQUklNQVJZID0gInBvc3RhbF9pc3ByaW1hcnkiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBPU1RBTF9JU1BSSU1BUlkgPSBDb250YWN0c0NvbnRyYWN0LkludGVudHMuSW5zZXJ0LlBPU1RBTF9JU1BSSU1BUlk7CiAKICAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBJTSBoYW5kbGUuCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNX0hBTkRMRSA9ICJpbV9oYW5kbGUiOworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNX0hBTkRMRSA9IENvbnRhY3RzQ29udHJhY3QuSW50ZW50cy5JbnNlcnQuSU1fSEFORExFOwogCiAgICAgICAgICAgICAvKioKICAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIElNIHByb3RvY29sCiAgICAgICAgICAgICAgKiA8UD5UeXBlOiB0aGUgcmVzdWx0IG9mIHtAbGluayBDb250YWN0cy5Db250YWN0TWV0aG9kcyNlbmNvZGVQcmVkZWZpbmVkSW1Qcm90b2NvbH0KICAgICAgICAgICAgICAqIG9yIHtAbGluayBDb250YWN0cy5Db250YWN0TWV0aG9kcyNlbmNvZGVDdXN0b21JbVByb3RvY29sfS48L1A+CiAg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VUkkgPSBVcmkucGFyc2UoImNvbnRlbnQ6Ly8iICsgQVVUSE9SSVRZKTsKKworICAgIHB1YmxpYyBpbnRlcmZhY2UgU3luY1N0YXRlQ29sdW1ucyBleHRlbmRzIFN5bmNTdGF0ZUNvbnRyYWN0LkNvbHVtbnMgeworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgU3luY1N0YXRlIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgdXRpbGl0eSBjbGFzcyBjYW5ub3QgYmUgaW5zdGFudGlhdGVkCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIFN5bmNTdGF0ZSgpIHt9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9ESVJFQ1RPUlkgPQorICAgICAgICAgICAgICAgIFN5bmNTdGF0ZUNvbnRyYWN0LkNvbnN0YW50cy5DT05URU5UX0RJUkVDVE9SWTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9CisgICAgICAgICAgICAgICAgVXJpLndpdGhBcHBlbmRlZFBhdGgoQVVUSE9SSVRZX1VSSSwgQ09OVEVOVF9ESVJFQ1RPUlkpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBAc2VlIGFuZHJvaWQucHJvdmlkZXIuU3luY1N0YXRlQ29udHJhY3QuSGVscGVycyNnZXQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgYnl0ZVtdIGdldChDb250ZW50UHJvdmlkZXJDbGllbnQgcHJvdmlkZXIsIEFjY291bnQgYWNjb3VudCkKKyAgICAgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIHJldHVybiBTeW5jU3RhdGVDb250cmFjdC5IZWxwZXJzLmdldChwcm92aWRlciwgQ09OVEVOVF9VUkksIGFjY291bnQpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBzZWUgYW5kcm9pZC5wcm92aWRlci5TeW5jU3RhdGVDb250cmFjdC5IZWxwZXJzI2dldAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBQYWlyPFVyaSwgYnl0ZVtdPiBnZXRXaXRoVXJpKENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlciwgQWNjb3VudCBhY2NvdW50KQorICAgICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgcmV0dXJuIFN5bmNTdGF0ZUNvbnRyYWN0LkhlbHBlcnMuZ2V0V2l0aFVyaShwcm92aWRlciwgQ09OVEVOVF9VUkksIGFjY291bnQpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBzZWUgYW5kcm9pZC5wcm92aWRlci5TeW5jU3RhdGVDb250cmFjdC5IZWxwZXJzI3NldAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyB2b2lkIHNldChDb250ZW50UHJvdmlkZXJDbGllbnQgcHJvdmlkZXIsIEFjY291bnQgYWNjb3VudCwgYnl0ZVtdIGRhdGEpCisgICAgICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBTeW5jU3RhdGVDb250cmFjdC5IZWxwZXJzLnNldChwcm92aWRlciwgQ09OVEVOVF9VUkksIGFjY291bnQsIGRhdGEpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBzZWUgYW5kcm9pZC5wcm92aWRlci5TeW5jU3RhdGVDb250cmFjdC5IZWxwZXJzI25ld1NldE9wZXJhdGlvbgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBDb250ZW50UHJvdmlkZXJPcGVyY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qLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTWU5DNCA9ICJzeW5jNCI7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29sdW1ucyB0aGF0IGFwcGVhciB3aGVuIGVhY2ggcm93IG9mIGEgdGFibGUgYmVsb25ncyB0byBhIHNwZWNpZmljCisgICAgICogYWNjb3VudCwgaW5jbHVkaW5nIHN5bmMgaW5mb3JtYXRpb24gdGhhdCBhbiBhY2NvdW50IG1heSBuZWVkLgorICAgICAqLworICAgIHByaXZhdGUgaW50ZXJmYWNlIFN5bmNDb2x1bW5zIGV4dGVuZHMgQmFzZVN5bmNDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBuYW1lIG9mIHRoZSBhY2NvdW50IGluc3RhbmNlIHRvIHdoaWNoIHRoaXMgcm93IGJlbG9uZ3MuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ0NPVU5UX05BTUUgPSAiYWNjb3VudF9uYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHR5cGUgb2YgYWNjb3VudCB0byB3aGljaCB0aGlzIHJvdyBiZWxvbmdzLCB3aGljaCB3aGVuIHBhaXJlZCB3aXRoCisgICAgICAgICAqIHtAbGluayAjQUNDT1VOVF9OQU1FfSBpZGVudGlmaWVzIGEgc3BlY2lmaWMgYWNjb3VudC4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ09VTlRfVFlQRSA9ICJhY2NvdW50X3R5cGUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBTdHJpbmcgdGhhdCB1bmlxdWVseSBpZGVudGlmaWVzIHRoaXMgcm93IHRvIGl0cyBzb3VyY2UgYWNjb3VudC4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNPVVJDRV9JRCA9ICJzb3VyY2VpZCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFZlcnNpb24gbnVtYmVyIHRoYXQgaXMgdXBkYXRlZCB3aGVuZXZlciB0aGlzIHJvdyBvciBpdHMgcmVsYXRlZCBkYXRhCisgICAgICAgICAqIGNoYW5nZXMuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBWRVJTSU9OID0gInZlcnNpb24iOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBGbGFnIGluZGljYXRpbmcgdGhhdCB7QGxpbmsgI1ZFUlNJT059IGhhcyBjaGFuZ2VkLCBhbmQgdGhpcyByb3cgbmVlZHMKKyAgICAgICAgICogdG8gYmUgc3luY2hyb25pemVkIGJ5IGl0cyBvd25pbmcgYWNjb3VudC4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAoYm9vbGVhbik8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBESVJUWSA9ICJkaXJ0eSI7CisgICAgfQorCisgICAgcHVibGljIGludGVyZmFjZSBDb250YWN0T3B0aW9uc0NvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG51bWJlciBvZiB0aW1lcyBhIHBlcnNvbiBoYXMgYmVlbiBjb250YWN0ZWQKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJTUVTX0NPTlRBQ1RFRCA9ICJ0aW1lc19jb250YWN0ZWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbGFzdCB0aW1lIGEgcGVyc29uIHdhcyBjb250YWN0ZWQuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMQVNUX1RJTUVfQ09OVEFDVEVEID0gImxhc3RfdGltZV9jb250YWN0ZWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBJcyB0aGUgY29udGFjdCBzdGFycmVkPworICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNUQVJSRUQgPSAic3RhcnJlZCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEEgY3VzdG9tIHJpbmd0b25lIGFzc29jaWF0ZWQgd2l0aCBhIHBlcnNvbi4gTm90IGFsd2F5cyBwcmVzZW50LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUIChVUkkgdG8gdGhlIHJpbmd0b25lKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENVU1RPTV9SSU5HVE9ORSA9ICJjdXN0b21fcmluZ3RvbmUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBXaGV0aGVyIHRoZSBwZXJzb24gc2hvdWxkIGFsd2F5cyBiZSBzZW50IHRvIHZvaWNlbWFpbC4gTm90IGFsd2F5cworICAgICAgICAgKiBwcmVzZW50LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSICgwIGZvciBmYWxzZSwgMSBmb3IgdHJ1ZSk8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRU5EX1RPX1ZPSUNFTUFJTCA9ICJzZW5kX3RvX3ZvaWNlbWFpbCI7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnRlcmZhY2UgQ29udGFjdHNDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBkaXNwbGF5IG5hbWUgZm9yIHRoZSBjb250YWN0LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRElTUExBWV9OQU1FID0gImRpc3BsYXlfbmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgcm93IGluIHRoZSBkYXRhIHRhYmxlIGhvbGRpbmcgdGhlIHBob3RvLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIFJFRkVSRU5DRVMgZGF0YShfaWQpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPVE9fSUQgPSAicGhvdG9faWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBMb29rdXAgdmFsdWUgdGhhdCByZWZsZWN0cyB0aGUge0BsaW5rIEdyb3VwcyNHUk9VUF9WSVNJQkxFfSBzdGF0ZSBvZgorICAgICAgICAgKiBhbnkge0BsaW5rIENvbW1vbkRhdGFLaW5kcy5Hcm91cE1lbWJlcnNoaXB9IGZvciB0aGlzIGNvbnRhY3QuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJTl9WSVNJQkxFX0dST1VQID0gImluX3Zpc2libGVfZ3JvdXAiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBDb250YWN0IHByZXNlbmNlIHN0YXR1cy4gIFNlZSB7QGxpbmsgYW5kcm9pZC5wcm92aWRlci5JbS5Db21tb25QcmVzZW5jZUNvbHVtbnN9CisgICAgICAgICAqIGZvciBpbmRpdmlkdWFsIHN0YXR1cyBkZWZpbml0aW9ucy4gIFRoaXMgY29sdW1uIGlzIG9ubHkgcmV0dXJuZWQgaWYgZXhwbGljaXRseQorICAgICAgICAgKiByZXF1ZXN0ZWQgaW4gdGhlIHF1ZXJ5IHByb2plY3Rpb24uCisgICAgICAgICAqIDxwPlR5cGU6IE5VTUJFUjwvcD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBSRVNFTkNFX1NUQVRVUyA9IFByZXNlbmNlLlBSRVNFTkNFX1NUQVRVUzsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ29udGFjdCBwcmVzZW5jZSBjdXN0b20gc3RhdHVzLiBUaGlzIGNvbHVtbiBpcyBvbmx5IHJldHVybmVkIGlmIGV4cGxpY2l0bHkKKyAgICAgICAgICogcmVxdWVzdGVkIGluIHRoZSBxdWVyeSBwcm9qZWN0aW9uLgorICAgICAgICAgKiA8cD5UeXBlOiBURVhUPC9wPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUFJFU0VOQ0VfQ1VTVE9NX1NUQVRVUyA9IFByZXNlbmNlLlBSRVNFTkNFX0NVU1RPTV9TVEFUVVM7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEFuIGluZGljYXRvciBvZiB3aGV0aGVyIHRoaXMgY29udGFjdCBoYXMgYXQgbGVhc3Qgb25lIHBob25lIG51bWJlci4gIjEiIGlmIHRoZXJlIGlzCisgICAgICAgICAqIGF0IGxlYXN0IG9uZSBwaG9uZSBudW1iZXIsICIwIiBvdGhlcndpc2UuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBIQVNfUEhPTkVfTlVNQkVSID0gImhhc19waG9uZV9udW1iZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbiBvcGFxdWUgdmFsdWUgdGhhdCBjb250YWlucyBoaW50cyBvbiBob3cgdG8gZmluZCB0aGUgY29udGFjdCBpZgorICAgICAgICAgKiBpdHMgcm93IGlkIGN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BwZW5kZWRQYXRoKENPTlRFTlRfVVJJLAorICAgICAgICAgICAgICAgICJsb29rdXAiKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ29tcHV0ZXMgYSBjb21wbGV0ZSBsb29rdXAgVVJJIChzZWUge0BsaW5rICNDT05URU5UX0xPT0tVUF9VUkl9KS4KKyAgICAgICAgICogUGFzcyBlaXRoZXIgYSBiYXNpYyBjb250ZW50IFVSSSB3aXRoIGEgY29udGFjdCBJRCB0byBvYnRhaW4gYW4KKyAgICAgICAgICogZXF1aXZhbGVudCBsb29rdXAgVVJJLiBQYXNzIGEgcG9zc2libHkgc3RhbGUgbG9va3VwIFVSSSB0byBnZXQgYSBmcmVzaAorICAgICAgICAgKiBsb29rdXAgVVJJIGZvciB0aGUgc2FtZSBjb250YWN0LgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogUmV0dXJucyBudWxsIGlmIHRoZSBjb250YWN0IGNhbm5vdCBiZSBmb3VuZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldExvb2t1cFVyaShDb250ZW50UmVzb2x2ZXIgcmVzb2x2ZXIsIFVyaSBjb250ZW50VXJpKSB7CisgICAgICAgICAgICBDdXJzb3IgYyA9IHJlc29sdmVyLnF1ZXJ5KGNvbnRlbnRVcmksCisgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXtDb250YWN0cy5MT09LVVBfS0VZLCBDb250YWN0cy5fSUR9LCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChjID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAoYy5tb3ZlVG9GaXJzdCgpKSB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBsb29rdXBLZXkgPSBjLmdldFN0cmluZygwKTsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyBjb250YWN0SWQgPSBjLmdldExvbmcoMSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBDb250ZW50VXJpcy53aXRoQXBwZW5kZWRJZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVcmkud2l0aEFwcGVuZGVkUGF0aChDb250YWN0cy5DT05URU5UX0xPT0tVUF9VUkksIGxvb2t1cEtleSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFjdElkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEJ1aWxkIGEge0BsaW5rICNDT05URU5UX0xPT0tVUF9VUkl9IGxvb2t1cCB7QGxpbmsgVXJpfSB1c2luZyB0aGUKKyAgICAgICAgICogZ2l2ZW4ge0BsaW5rIENvbnRhY3RzI19JRH0gYW5kIHtAbGluayBDb250YWN0cyNMT09LVVBfS0VZfS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldExvb2t1cFVyaShsb25nIGNvbnRhY3RJZCwgU3RyaW5nIGxvb2t1cEtleSkgeworICAgICAgICAgICAgcmV0dXJuIENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKFVyaS53aXRoQXBwZW5kZWRQYXRoKENvbnRhY3RzLkNPTlRFTlRfTE9PS1VQX1VSSSwKKyAgICAgICAgICAgICAgICAgICAgbG9va3VwS2V5KSwgY29udGFjdElkKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBDb21wdXRlcyBhIGNvbnRlbnQgVVJJIChzZWUge0BsaW5rICNDT05URU5UX1VSSX0pIGdpdmVuIGEgbG9va3VwIFVSSS4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFJldHVybnMgbnVsbCBpZiB0aGUgY29udGFjdCBjYW5ub3QgYmUgZm91bmQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBsb29rdXBDb250YWN0KENvbnRlbnRSZXNvbHZlciByZXNvbHZlciwgVXJpIGxvb2t1cFVyaSkgeworICAgICAgICAgICAgaWYgKGxvb2t1cFVyaSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEN1cnNvciBjID0gcmVzb2x2ZXIucXVlcnkobG9va3VwVXJpLCBuZXcgU3RyaW5nW117Q29udGFjdHMuX0lEfSwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICBpZiAoYyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgaWYgKGMubW92ZVRvRmlyc3QoKSkgeworICAgICAgICAgICAgICAgICAgICBsb25nIGNvbnRhY3RJZCA9IGMuZ2V0TG9uZygwKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIENvbnRlbnRVcmlzLndpdGhBcHBlbmRlZElkKENvbnRhY3RzLkNPTlRFTlRfVVJJLCBjb250YWN0SWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIHVzZWQgZm9yICJ0eXBlLXRvLWZpbHRlciIgZnVuY3Rpb25hbGl0eSBvbiB0aGUKKyAgICAgICAgICoge0BsaW5rICNDT05URU5UX1VSSX0gVVJJLiBUaGUgZmlsdGVyIHN0cmluZyB3aWxsIGJlIHVzZWQgd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gc3ViLWRpcmVjdG9yeSBvZiBhIHNpbmdsZSBjb250YWN0IHRoYXQgY29udGFpbnMgYWxsIG9mIHRoZSBjb25zdGl0dWVudCByYXcgY29udGFjdAorICAgICAgICAgKiB7QGxpbmsgRGF0YX0gcm93cy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgRGF0YSBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBEYXRhQ29sdW1ucyB7CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIG5vIHB1YmxpYyBjb25zdHJ1Y3RvciBzaW5jZSB0aGlzIGlzIGEgdXRpbGl0eSBjbGFzcworICAgICAgICAgICAgICovCisgICAgICAgICAgICBwcml2YXRlIERhdGEoKSB7fQorCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBkaXJlY3RvcnkgdHdpZyBmb3IgdGhpcyBzdWItdGFibGUKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9ESVJFQ1RPUlkgPSAiZGF0YSI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQSBzdWItZGlyZWN0b3J5IG9mIGEgc2luZ2xlIGNvbnRhY3QgYWdncmVnYXRlIHRoYXQgY29udGFpbnMgYWxsIGFnZ3JlZ2F0aW9uIHN1Z2dlc3Rpb25zCisgICAgICAgICAqIChvdGhlciBjb250YWN0cykuICBUaGUgYWdncmVnYXRpb24gc3VnZ2VzdGlvbnMgYXJlIGNvbXB1dGVkIGJhc2VkIG9uIGFwcHJveGltYXRlCisgICAgICAgICAqIGRhdGEgbWF0Y2hlcyB3aXRoIHRoaXMgY29udGFjdC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgQWdncmVnYXRpb25TdWdnZXN0aW9ucyBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBDb250YWN0c0NvbHVtbnMgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBObyBwdWJsaWMgY29uc3RydWN0b3Igc2luY2UgdGhpcyBpcyBhIHV0aWxpdHkgY2xhc3MKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHJpdmF0ZSBBZ2dyZWdhdGlvblN1Z2dlc3Rpb25zKCkge30KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZGlyZWN0b3J5IHR3aWcgZm9yIHRoaXMgc3ViLXRhYmxlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfRElSRUNUT1JZID0gInN1Z2dlc3Rpb25zIjsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIHN1Yi1kaXJlY3Rvcnkgb2YgYSBzaW5nbGUgY29udGFjdCB0aGF0IGNvbnRhaW5zIHRoZSBjb250YWN0J3MgcHJpbWFyeSBwaG90by4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgUGhvdG8gaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgRGF0YUNvbHVtbnMgeworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBubyBwdWJsaWMgY29uc3RydWN0b3Igc2luY2UgdGhpcyBpcyBhIHV0aWxpdHkgY2xhc3MKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHJpdmF0ZSBQaG90bygpIHt9CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGRpcmVjdG9yeSB0d2lnIGZvciB0aGlzIHN1Yi10YWJsZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0RJUkVDVE9SWSA9ICJwaG90byI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogT3BlbnMgYW4gSW5wdXRTdHJlYW0gZm9yIHRoZSBwZXJzb24ncyBkZWZhdWx0IHBob3RvIGFuZCByZXR1cm5zIHRoZQorICAgICAgICAgKiBwaG90byBhcyBhIEJpdG1hcCBzdHJlYW0uCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBjb250YWN0VXJpIHRoZSBjb250YWN0IHdob3NlIHBob3RvIHNob3VsZCBiZSB1c2VkCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIElucHV0U3RyZWFtIG9wZW5Db250YWN0UGhvdG9JbnB1dFN0cmVhbShDb250ZW50UmVzb2x2ZXIgY3IsIFVyaSBjb250YWN0VXJpKSB7CisgICAgICAgICAgICBVcmkgcGhvdG9VcmkgPSBVcmkud2l0aEFwcGVuZGVkUGF0aChjb250YWN0VXJpLCBQaG90by5DT05URU5UX0RJUkVDVE9SWSk7CisgICAgICAgICAgICBpZiAocGhvdG9VcmkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQ3Vyc29yIGN1cnNvciA9IGNyLnF1ZXJ5KHBob3RvVXJpLAorICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW117Q29udGFjdHNDb250cmFjdC5Db21tb25EYXRhS2luZHMuUGhvdG8uUEhPVE99LCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgaWYgKGN1cnNvciA9PSBudWxsIHx8ICFjdXJzb3IubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBieXRlW10gZGF0YSA9IGN1cnNvci5nZXRCbG9iKDApOworICAgICAgICAgICAgICAgIGlmIChkYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQnl0ZUFycmF5SW5wdXRTdHJlYW0oZGF0YSk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGludGVyZmFjZSBSYXdDb250YWN0c0NvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogQSByZWZlcmVuY2UgdG8gdGhlIHtAbGluayBhbmRyb2lkLnByb3ZpZGVyLkNvbnRhY3RzQ29udHJhY3QuQ29udGFjdHMjX0lEfSB0aGF0IHRoaXMKKyAgICAgICAgICogZGF0YSBiZWxvbmdzIHRvLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEFDVF9JRCA9ICJjb250YWN0X2lkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogRmxhZyBpbmRpY2F0aW5nIHRoYXQgdGhpcyB7QGxpbmsgUmF3Q29udGFjdHN9IGVudHJ5IGFuZCBpdHMgY2hpbGRyZW4gaGFzCisgICAgICAgICAqIGJlZW4gcmVzdHJpY3RlZCB0byBzcGVjaWZpYyBwbGF0Zm9ybSBhcHBzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvUD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUgdW50aWwgZmluYWxpemVkIGluIGZ1dHVyZSBwbGF0Zm9ybSByZWxlYXNlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJU19SRVNUUklDVEVEID0gImlzX3Jlc3RyaWN0ZWQiOworCisgICAgICAg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nRzIGZvciB0aGUgcmF3X2NvbnRhY3RzIHRhYmxlLCB3aGljaCBjb250YWlucyB0aGUgYmFzZSBjb250YWN0CisgICAgICogaW5mb3JtYXRpb24gcGVyIHN5bmMgc291cmNlLiBTeW5jIGFkYXB0ZXJzIGFuZCBjb250YWN0IG1hbmFnZW1lbnQgYXBwcworICAgICAqIGFyZSB0aGUgcHJpbWFyeSBjb25zdW1lcnMgb2YgdGhpcyBBUEkuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBSYXdDb250YWN0cyBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBSYXdDb250YWN0c0NvbHVtbnMsCisgICAgICAgICAgICBDb250YWN0T3B0aW9uc0NvbHVtbnMsIFN5bmNDb2x1bW5zICB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGlzIHV0aWxpdHkgY2xhc3MgY2Fubm90IGJlIGluc3RhbnRpYXRlZAorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBSYXdDb250YWN0cygpIHsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkkgZm9yIHRoaXMgdGFibGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0gVXJpLndpdGhBcHBlbmRlZFBhdGgoQVVUSE9SSVRZX1VSSSwgInJhd19jb250YWN0cyIpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHtAbGluayAjQ09OVEVOVF9VUkl9IHByb3ZpZGluZyBhIGRpcmVjdG9yeSBvZgorICAgICAgICAgKiBwZW9wbGUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLmRpci9yYXdfY29udGFjdCI7CisKKyAgICA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ICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFHR1JFR0FUSU9OX01PREVfRElTQUJMRUQgPSAzOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIHN1Yi1kaXJlY3Rvcnkgb2YgYSBzaW5nbGUgcmF3IGNvbnRhY3QgdGhhdCBjb250YWlucyBhbGwgb2YgdGhlaXIge0BsaW5rIERhdGF9IHJvd3MuCisgICAgICAgICAqIFRvIGFjY2VzcyB0aGlzIGRpcmVjdG9yeSBhcHBlbmQge0BsaW5rIERhdGEjQ09OVEVOVF9ESVJFQ1RPUll9IHRvIHRoZSBjb250YWN0IFVSSS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgRGF0YSBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBEYXRhQ29sdW1ucyB7CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIG5vIHB1YmxpYyBjb25zdHJ1Y3RvciBzaW5jZSB0aGlzIGlzIGEgdXRpbGl0eSBjbGFzcworICAgICAgICAgICAgICovCisgICAgICAgICAgICBwcml2YXRlIERhdGEoKSB7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGRpcmVjdG9yeSB0d2lnIGZvciB0aGlzIHN1Yi10YWJsZQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0RJUkVDVE9SWSA9ICJkYXRhIjsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgaW50ZXJmYWNlIERhdGFDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBwYWNrYWdlIG5hbWUgdG8gdXNlIHdoZW4gY3JlYXRpbmcge0BsaW5rIFJlc291cmNlc30gb2JqZWN0cyBmb3IKKyAgICAgICAgICogdGhpcyBkYXRhIHJvdy4gVGhpcyB2YWx1ZSBpcyBvbmx5IGRlc2lnbmVkIGZvciB1c2Ugd2hlbiBidWlsZGluZyB1c2VyCisgICAgICAgICAqIGludGVyZmFjZXMsIGFuZCBzaG91bGQgbm90IGJlIHVzZWQgdG8gaW5mZXIgdGhlIG93bmVyLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUkVTX1BBQ0tBR0UgPSAicmVzX3BhY2thZ2UiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHRoZSBpdGVtIHJlcHJlc2VudGVkIGJ5IHRoaXMgcm93LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTUlNRVRZUEUgPSAibWltZXR5cGUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIHJlZmVyZW5jZSB0byB0aGUge0BsaW5rIFJhd0NvbnRhY3RzI19JRH0KKyAgICAgICAgICogdGhhdCB0aGlzIGRhdGEgYmVsb25ncyB0by4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFJBV19DT05UQUNUX0lEID0gInJhd19jb250YWN0X2lkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogV2hldGhlciB0aGlzIGlzIHRoZSBwcmltYXJ5IGVudHJ5IG9mIGl0cyBraW5kIGZvciB0aGUgcmF3IGNvbnRhY3QgaXQgYmVsb25ncyB0bworICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChpZiBzZXQsIG5vbi0wIG1lYW5zIHRydWUpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgSVNfUFJJTUFSWSA9ICJpc19wcmltYXJ5IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogV2hldGhlciB0aGlzIGlzIHRoZSBwcmltYXJ5IGVudHJ5IG9mIGl0cyBraW5k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cmtfYXNfZGlydHkiOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnN0YW50cyBmb3IgdGhlIGRhdGEgdGFibGUsIHdoaWNoIGNvbnRhaW5zIGRhdGEgcG9pbnRzIHRpZWQgdG8gYSByYXcgY29udGFjdC4KKyAgICAgKiBGb3IgZXhhbXBsZSwgYSBwaG9uZSBudW1iZXIgb3IgZW1haWwgYWRkcmVzcy4gRWFjaCByb3cgaW4gdGhpcyB0YWJsZSBjb250YWlucyBhIHR5cGUKKyAgICAgKiBkZWZpbml0aW9uIGFuZCBzb21lIGdlbmVyaWMgY29sdW1ucy4gRWFjaCBkYXRhIHR5cGUgY2FuIGRlZmluZSB0aGUgbWVhbmluZyBmb3IgZWFjaCBvZgorICAgICAqIHRoZSBnZW5lcmljIGNvbHVtbnMuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBEYXRhIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIERhdGFDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgdXRpbGl0eSBjbGFzcyBjYW5ub3QgYmUgaW5zdGFudGlhdGVkCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIERhdGEoKSB7fQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkkgZm9yIHRoaXMgdGFibGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0gVXJpLndpdGhBcHBlbmRlZFBhdGgoQVVUSE9SSVRZX1VSSSwgImRhdGEiKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlIGpvaW5lZCB3aXRoIHtAbGluayBQcmVzZW5jZX0KKyAgICAgICAgICogZGF0YSB3aGVyZSBhcHBsaWNhYmxlLgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9XSVRIX1BSRVNFTkNFX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKEFVVEhPUklUWV9VUkksCisgICAgICAgICAgICAgICAgImRhdGFfd2l0aF9wcmVzZW5jZSIpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIHtAbGluayAjQ09OVEVOVF9VUkl9IHByb3ZpZGluZyBhIGRpcmVjdG9yeSBvZiBkYXRhLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5kaXIvZGF0YSI7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnRlcmZhY2UgUGhvbmVMb29rdXBDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBwaG9uZSBudW1iZXIgYXMgdGhlIHVzZXIgZW50ZXJlZCBpdC4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5VTUJFUiA9ICJudW1iZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdHlwZSBvZiBwaG9uZSBudW1iZXIsIGZvciBleGFtcGxlIEhvbWUgb3IgV29yay4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRZUEUgPSAidHlwZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB1c2VyIGRlZmluZWQgbGFiZWwgZm9yIHRoZSBwaG9uZSBudW1iZXIuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMQUJFTCA9ICJsYWJlbCI7CisgICAgfQorCisgICAgLyoqCisgICAgICogQSB0YWJsZSB0aGF0IHJlcHJlc2VudHMgdGhlIHJlc3VsdCBvZiBsb29raW5nIHVwIGEgcGhvbmUgbnVtYmVyLCBmb3IKKyAgICAgKiBleGFtcGxlIGZvciBjYWxsZXIgSUQuIFRvIHBlcmZvcm0gYSBsb29rdXAgeW91IG11c3QgYXBwZW5kIHRoZSBudW1iZXIgeW91CisgICAgICogd2FudCB0byBmaW5kIHRvIHtAbGluayAjQ09OVEVOVF9GSUxURVJfVVJJfS4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFBob25lTG9va3VwIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIFBob25lTG9va3VwQ29sdW1ucywKKyAgICAgICAgICAgIENvbnRhY3RzQ29sdW1ucywgQ29udGFjdE9wdGlvbnNDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgdXRpbGl0eSBjbGFzcyBjYW5ub3QgYmUgaW5zdGFudGlhdGVkCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIFBob25lTG9va3VwKCkge30KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlLiBBcHBlbmQgdGhlIHBob25lIG51bWJlciB5b3Ugd2FudCB0byBsb29rdXAKKyAgICAgICAgICogdG8gdGhpcyBVUkkgYW5kIHF1ZXJ5IGl0IHRvIHBlcmZvcm0gYSBsb29rdXAuIEZvciBleGFtcGxlOgorICAgICAgICAgKgorICAgICAgICAgKiB7QGNvZGUKKyAgICAgICAgICogVXJpIGxvb2t1cFVyaSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKFBob25lTG9va3VwLkNPTlRFTlRfVVJJLCBwaG9uZU51bWJlcik7CisgICAgICAgICAqIH0KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfRklMVEVSX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKEFVVEhPUklUWV9VUkksCisgICAgICAgICAgICAgICAgInBob25lX2xvb2t1cCIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFkZGl0aW9uYWwgZGF0YSBtaXhlZCBpbiB3aXRoIHtAbGluayBJbS5Db21tb25QcmVzZW5jZUNvbHVtbnN9IHRvIGxpbmsKKyAgICAgKiBiYWNrIHRvIHNwZWNpZmljIHtAbGluayBDb250YWN0c0NvbnRyYWN0LkNvbnRhY3RzI19JRH0gZW50cmllcy4KKyAgICAgKi8KKyAgICBwcml2YXRlIGludGVyZmFjZSBQcmVzZW5jZUNvbHVtbnMgeworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdW5pcXVlIElEIGZvciBhIHJvdy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZyk8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBfSUQgPSAicHJlc2VuY2VfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBSZWZlcmVuY2UgdG8gdGhlIHtAbGluayBEYXRhI19JRH0gZW50cnkgdGhhdCBvd25zIHRoaXMgcHJlc2VuY2UuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRBX0lEID0gInByZXNlbmNlX2RhdGFfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiA8cD5UeXBlOiBOVU1CRVI8L3A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQUk9UT0NPTCA9ICJwcm90b2NvbCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE5hbWUgb2YgdGhlIGN1c3RvbSBwcm90b2NvbC4gIFNob3VsZCBiZSBzdXBwbGllZCBhbG9uZyB3aXRoIHRoZSB7QGxpbmsgI1BST1RPQ09MfSB2YWx1ZQorICAgICAgICAgKiB7QGxpbmsgQ29udGFjdHNDb250cmFjdC5Db21tb25EYXRhS2luZHMuSW0jUFJPVE9DT0xfQ1VTVE9NfS4gIFNob3VsZCBiZSBudWxsIG9yCisgICAgICAgICAqIG9taXR0ZWQgaWYge0BsaW5rICNQUk9UT0NPTH0gdmFsdWUgaXMgbm90CisgICAgICAgICAqIHtAbGluayBDb250YWN0c0NvbnRyYWN0LkNvbW1vbkRhdGFLaW5kcy5JbSNQUk9UT0NPTF9DVVNUT019LgorICAgICAgICAgKgorICAgICAgICAgKiA8cD5UeXBlOiBOVU1CRVI8L3A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDVVNUT01fUFJPVE9DT0wgPSAiY3VzdG9tX3Byb3RvY29sIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIElNIGhhbmRsZSB0aGUgcHJlc2VuY2UgaXRlbSBpcyBmb3IuIFRoZSBoYW5kbGUgaXMgc2NvcGVkIHRvCisgICAgICAgICAqIHtAbGluayAjUFJPVE9DT0x9LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgSU1fSEFORExFID0gImltX2hhbmRsZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBJTSBhY2NvdW50IGZvciB0aGUgbG9jYWwgdXNlciB0aGF0IHRoZSBwcmVzZW5jZSBkYXRhIGNhbWUgZnJvbS4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNX0FDQ09VTlQgPSAiaW1fYWNjb3VudCI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBQcmVzZW5jZSBpbXBsZW1lbnRzIFByZXNlbmNlQ29sdW1ucywgSW0uQ29tbW9uUHJlc2VuY2VDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgdXRpbGl0eSBjbGFzcyBjYW5ub3QgYmUgaW5zdGFudGlhdGVkCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIFByZXNlbmNlKCkgeworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSSSBmb3IgdGhpcyB0YWJsZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPSBVcmkud2l0aEFwcGVuZGVkUGF0aChBVVRIT1JJVFlfVVJJLCAicHJlc2VuY2UiKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogR2V0cyB0aGUgcmVzb3VyY2UgSUQgZm9yIHRoZSBwcm9wZXIgcHJlc2VuY2UgaWNvbi4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHN0YXR1cyB0aGUgc3RhdHVzIHRvIGdldCB0aGUgaWNvbiBmb3IKKyAgICAgICAgICogQHJldHVybiB0aGUgcmVzb3VyY2UgSUQgZm9yIHRoZSBwcm9wZXIgcHJlc2VuY2UgaWNvbgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgZ2V0UHJlc2VuY2VJY29uUmVzb3VyY2VJZChpbnQgc3RhdHVzKSB7CisgICAgICAgICAgICBzd2l0Y2ggKHN0YXR1cykgeworICAgICAgICAgICAgICAgIGNhc2UgQVZBSUxBQkxFOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gYW5kcm9pZC5SLmRyYXdhYmxlLnByZXNlbmNlX29ubGluZTsKKyAgICAgICAgICAgICAgICBjYXNlIElETEU6CisgICAgICAgICAgICAgICAgY2FzZSBBV0FZOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gYW5kcm9pZC5SLmRyYXdhYmxlLnByZXNlbmNlX2F3YXk7CisgICAgICAgICAgICAgICAgY2FzZSBET19OT1RfRElTVFVSQjoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFuZHJvaWQuUi5kcmF3YWJsZS5wcmVzZW5jZV9idXN5OworICAgICAgICAgICAgICAgIGNhc2UgSU5WSVNJQkxFOgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gYW5kcm9pZC5SLmRyYXdhYmxlLnByZXNlbmNlX2ludmlzaWJsZTsKKyAgICAgICAgICAgICAgICBjYXNlIE9GRkxJTkU6CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFuZHJvaWQuUi5kcmF3YWJsZS5wcmVzZW5jZV9vZmZsaW5lOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJldHVybnMgdGhlIHByZWNlZGVuY2Ugb2YgdGhlIHN0YXR1cyBjb2RlIHRoZSBoaWdoZXIgbnVtYmVyIGJlaW5nIHRoZSBoaWdoZXIgcHJlY2VkZW5jZS4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHN0YXR1cyBUaGUgc3RhdHVzIGNvZGUuCisgICAgICAgICAqIEByZXR1cm4gQW4gaW50ZWdlciByZXByZXNlbnRpbmcgdGhlIHByZWNlZGVuY2UsIDAgYmVpbmcgdGhlIGxvd2VzdC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IGdldFByZXNlbmNlUHJlY2VkZW5jZShpbnQgc3RhdHVzKSB7CisgICAgICAgICAgICAvLyBLZWVwIHRoaXMgZnVuY3Rpb24gaGVyZSBpbmNhc2Ugd2Ugd2FudCB0byBlbmZvcmNlIGEgZGlmZmVyZW50IHByZWNlZGVuY2UgdGhhbiB0aGUKKyAgICAgICAgICAgIC8vIG5hdHVyYWwgb3JkZXIgb2YgdGhlIHN0YXR1cyBjb25zdGFudHMuCisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2Yge0BsaW5rICNDT05URU5UX1VSSX0gcHJvdmlkaW5nIGEgZGlyZWN0b3J5IG9mCisgICAgICAgICAqIHByZXNlbmNlIGRldGFpbHMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLmRpci9pbS1wcmVzZW5jZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2YgYSB7QGxpbmsgI0NPTlRFTlRfVVJJfSBzdWJkaXJlY3Rvcnkgb2YgYSBzaW5nbGUKKyAgICAgICAgICogcHJlc2VuY2UgZGV0YWlsLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vaW0tcHJlc2VuY2UiOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnRhaW5lciBmb3IgZGVmaW5pdGlvbnMgb2YgY29tbW9uIGRhdGEgdHlwZXMgc3RvcmVkIGluIHRoZSB7QGxpbmsgRGF0YX0gdGFibGUuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBDb21tb25EYXRhS2luZHMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHtAbGluayBEYXRhI1JFU19QQUNLQUdFfSB2YWx1ZSBmb3IgY29tbW9uIGRhdGEgdGhhdCBzaG91bGQgYmUKKyAgICAgICAgICogc2hvd24gdXNpbmcgYSBkZWZhdWx0IHN0eWxlLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEFDS0FHRV9DT01NT04gPSAiY29tbW9uIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ29sdW1ucyBjb21tb24gYWNyb3NzIHRoZSBzcGVjaWZpYyB0eXBlcy4KKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgaW50ZXJmYWNlIEJhc2VDb21tb25Db2x1bW5zIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIHBhY2thZ2UgbmFtZSB0byB1c2Ugd2hlbiBjcmVhdGluZyB7QGxpbmsgUmVzb3VyY2VzfSBvYmplY3RzIGZvcgorICAgICAgICAgICAgICogdGhpcyBkYXRhIHJvdy4gVGhpcyB2YWx1ZSBpcyBvbmx5IGRlc2lnbmVkIGZvciB1c2Ugd2hlbiBidWlsZGluZyB1c2VyCisgICAgICAgICAgICAgKiBpbnRlcmZhY2VzLCBhbmQgc2hvdWxkIG5vdCBiZSB1c2VkIHRvIGluZmVyIHRoZSBvd25lci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUkVTX1BBQ0tBR0UgPSAicmVzX3BhY2thZ2UiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2YgdGhlIGl0ZW0gcmVwcmVzZW50ZWQgYnkgdGhpcyByb3cuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE1JTUVUWVBFID0gIm1pbWV0eXBlIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUge0BsaW5rIFJhd0NvbnRhY3RzI19JRH0gdGhhdCB0aGlzIGRhdGEgYmVsb25ncyB0by4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUkFXX0NPTlRBQ1RfSUQgPSAicmF3X2NvbnRhY3RfaWQiOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBiYXNlIHR5cGVzIHRoYXQgYWxsICJUeXBlZCIgZGF0YSBraW5kcyBzdXBwb3J0LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludGVyZmFjZSBCYXNlVHlwZXMgeworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIEEgY3VzdG9tIHR5cGUuIFRoZSBjdXN0b20gbGFiZWwgc2hvdWxkIGJlIHN1cHBsaWVkIGJ5IHVzZXIuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgaW50IFRZUEVfQ1VTVE9NID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBDb2x1bW5zIGNvbW1vbiBhY3Jvc3MgdGhlIHNwZWNpZmljIHR5cGVzLgorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBpbnRlcmZhY2UgQ29tbW9uQ29sdW1ucyBleHRlbmRzIEJhc2VUeXBlc3sKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIHR5cGUgb2YgZGF0YSwgZm9yIGV4YW1wbGUgSG9tZSBvciBXb3JrLgorICAgICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVFlQRSA9ICJkYXRhMSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGRhdGEgZm9yIHRoZSBjb250YWN0IG1ldGhvZC4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERBVEEgPSAiZGF0YTIiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSB1c2VyIGRlZmluZWQgbGFiZWwgZm9yIHRoZSB0aGUgY29udGFjdCBtZXRob2QuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMQUJFTCA9ICJkYXRhMyI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUGFydHMgb2YgdGhlIG5hbWUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFN0cnVjdHVyZWROYW1lIGltcGxlbWVudHMgQmFzZUNvbW1vbkNvbHVtbnMgeworICAgICAgICAgICAgcHJpdmF0ZSBTdHJ1Y3R1cmVkTmFtZSgpIHt9CisKKyAgICAgICAgICAgIC8qKiBNSU1FIHR5cGUgdXNlZCB3aGVuIHN0b3JpbmcgdGhpcyBpbiBkYXRhIHRhYmxlLiAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vbmFtZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGdpdmVuIG5hbWUgZm9yIHRoZSBjb250YWN0LgorICAgICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR0lWRU5fTkFNRSA9ICJkYXRhMSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGZhbWlseSBuYW1lIGZvciB0aGUgY29udGFjdC4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEZBTUlMWV9OQU1FID0gImRhdGEyIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgY29udGFjdCdzIGhvbm9yaWZpYyBwcmVmaXgsIGUuZy4gIlNpciIKKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBSRUZJWCA9ICJkYXRhMyI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGNvbnRhY3QncyBtaWRkbGUgbmFtZQorICAgICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTUlERExFX05BTUUgPSAiZGF0YTQiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBjb250YWN0J3MgaG9ub3JpZmljIHN1ZmZpeCwgZS5nLiAiSnIiCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNVRkZJWCA9ICJkYXRhNSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIHBob25ldGljIHZlcnNpb24gb2YgdGhlIGdpdmVuIG5hbWUgZm9yIHRoZSBjb250YWN0LgorICAgICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPTkVUSUNfR0lWRU5fTkFNRSA9ICJkYXRhNiI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIHBob25ldGljIHZlcnNpb24gb2YgdGhlIGFkZGl0aW9uYWwgbmFtZSBmb3IgdGhlIGNvbnRhY3QuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9ORVRJQ19NSURETEVfTkFNRSA9ICJkYXRhNyI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIHBob25ldGljIHZlcnNpb24gb2YgdGhlIGZhbWlseSBuYW1lIGZvciB0aGUgY29udGFjdC4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBIT05FVElDX0ZBTUlMWV9OQU1FID0gImRhdGE4IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgbmFtZSB0aGF0IHNob3VsZCBiZSB1c2VkIHRvIGRpc3BsYXkgdGhlIGNvbnRhY3QuCisgICAgICAgICAgICAgKiA8aT5VbnN0cnVjdHVyZWQgY29tcG9uZW50IG9mIHRoZSBuYW1lIHNob3VsZCBiZSBjb25zaXN0ZW50IHdpdGgKKyAgICAgICAgICAgICAqIGl0cyBzdHJ1Y3R1cmVkIHJlcHJlc2VudGF0aW9uLjwvaT4KKyAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICogVHlwZTogVEVYVAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBESVNQTEFZX05BTUUgPSAiZGF0YTkiOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEEgbmlja25hbWUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIE5pY2tuYW1lIGltcGxlbWVudHMgQ29tbW9uQ29sdW1ucywgQmFzZUNvbW1vbkNvbHVtbnMgeworICAgICAgICAgICAgcHJpdmF0ZSBOaWNrbmFtZSgpIHt9CisKKyAgICAgICAgICAgIC8qKiBNSU1FIHR5cGUgdXNlZCB3aGVuIHN0b3JpbmcgdGhpcyBpbiBkYXRhIHRhYmxlLiAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vbmlja25hbWUiOworCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0RFRkFVTFQgPSAxOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUl9OQU1FID0gMjsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfTUFJTkRFTl9OQU1FID0gMzsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfU0hPUlRfTkFNRSA9IDQ7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0lOSVRJQUxTID0gNTsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgbmFtZSBpdHNlbGYKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTkFNRSA9IERBVEE7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29tbW9uIGRhdGEgZGVmaW5pdGlvbiBmb3IgdGVsZXBob25lIG51bWJlcnMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFBob25lIGltcGxlbWVudHMgQmFzZUNvbW1vbkNvbHVtbnMsIENvbW1vbkNvbHVtbnMgeworICAgICAgICAgICAgcHJpdmF0ZSBQaG9uZSgpIHt9CisKKyAgICAgICAgICAgIC8qKiBNSU1FIHR5cGUgdXNlZCB3aGVuIHN0b3JpbmcgdGhpcyBpbiBkYXRhIHRhYmxlLiAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vcGhvbmVfdjIiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBNSU1FIHR5cGUgb2Yge0BsaW5rICNDT05URU5UX1VSSX0gcHJvdmlkaW5nIGEgZGlyZWN0b3J5IG9mCisgICAgICAgICAgICAgKiBwaG9uZXMuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL3Bob25lX3YyIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkkgZm9yIGFsbCBkYXRhIHJlY29yZHMgb2YgdGhlCisgICAgICAgICAgICAgKiB7QGxpbmsgUGhvbmUjQ09OVEVOVF9JVEVNX1RZUEV9IE1JTUUgdHlwZSwgY29tYmluZWQgd2l0aCB0aGUKKyAgICAgICAgICAgICAqIGFzc29jaWF0ZWQgcmF3IGNvbnRhY3QgYW5kIGFnZ3JlZ2F0ZSBjb250YWN0IGRhdGEuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJID0gVXJpLndpdGhBcHBlbmRlZFBhdGgoRGF0YS5DT05URU5UX1VSSSwKKyAgICAgICAgICAgICAgICAgICAgInBob25lcyIpOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgcGhvbmUgbG9va3VwIHVzaW5nIGEgZmlsdGVyLiBUaGUgZmlsdGVyIHJldHVybnMKKyAgICAgICAgICAgICAqIHJlY29yZHMgb2YgTUlNRSB0eXBlIHtAbGluayBQaG9uZSNDT05URU5UX0lURU1fVFlQRX0uIFRoZSBmaWx0ZXIgaXMgYXBwbGllZAorICAgICAgICAgICAgICogdG8gZGlzcGxheSBuYW1lcyBhcyB3ZWxsIGFzIHBob25lIG51bWJlcnMuIFRoZSBmaWx0ZXIgYXJndW1lbnQgc2hvdWxkIGJlIHBhc3NlZAorICAgICAgICAgICAgICogYXMgYW4gYWRkaXRpb25hbCBwYXRoIHNlZ21lbnQgYWZ0ZXIgdGhpcyBVUkkuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfRklMVEVSX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKENPTlRFTlRfVVJJLAorICAgICAgICAgICAgICAgICAgICAiZmlsdGVyIik7CisKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfSE9NRSA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX01PQklMRSA9IDI7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1dPUksgPSAzOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9GQVhfV09SSyA9IDQ7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0ZBWF9IT01FID0gNTsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfUEFHRVIgPSA2OworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDc7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0NBTExCQUNLID0gODsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfQ0FSID0gOTsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfQ09NUEFOWV9NQUlOID0gMTA7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0lTRE4gPSAxMTsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfTUFJTiA9IDEyOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUl9GQVggPSAxMzsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfUkFESU8gPSAxNDsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfVEVMRVggPSAxNTsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfVFRZX1RERCA9IDE2OworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9XT1JLX01PQklMRSA9IDE3OworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9XT1JLX1BBR0VSID0gMTg7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0FTU0lTVEFOVCA9IDE5OworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBwaG9uZSBudW1iZXIgYXMgdGhlIHVzZXIgZW50ZXJlZCBpdC4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5VTUJFUiA9IERBVEE7CisKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgQ2hhclNlcXVlbmNlIGdldERpc3BsYXlMYWJlbChDb250ZXh0IGNvbnRleHQsIGludCB0eXBlLAorICAgICAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgbGFiZWwsIENoYXJTZXF1ZW5jZVtdIGxhYmVsQXJyYXkpIHsKKyAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgZGlzcGxheSA9ICIiOworCisgICAgICAgICAgICAgICAgaWYgKHR5cGUgIT0gUGhvbmUuVFlQRV9DVVNUT00pIHsKKyAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlW10gbGFiZWxzID0gbGFiZWxBcnJheSAhPSBudWxsPyBsYWJlbEFycmF5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjb250ZXh0LmdldFJlc291cmNlcygpLmdldFRleHRBcnJheSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXJyYXkucGhvbmVUeXBlcyk7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5ID0gbGFiZWxzW3R5cGUgLSAxXTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoQXJyYXlJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXkgPSBsYWJlbHNbUGhvbmUuVFlQRV9DVVNUT01dOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShsYWJlbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXkgPSBsYWJlbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gZGlzcGxheTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBDaGFyU2VxdWVuY2UgZ2V0RGlzcGxheUxhYmVsKENvbnRleHQgY29udGV4dCwgaW50IHR5cGUsCisgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBsYWJlbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBnZXREaXNwbGF5TGFiZWwoY29udGV4dCwgdHlwZSwgbGFiZWwsIG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbW1vbiBkYXRhIGRlZmluaXRpb24gZm9yIGVtYWlsIGFkZHJlc3Nlcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgRW1haWwgaW1wbGVtZW50cyBCYXNlQ29tbW9uQ29sdW1ucywgQ29tbW9uQ29sdW1ucyB7CisgICAgICAgICAgICBwcml2YXRlIEVtYWlsKCkge30KKworICAgICAgICAgICAgLyoqIE1JTUUgdHlwZSB1c2VkIHdoZW4gc3RvcmluZyB0aGlzIGluIGRhdGEgdGFibGUuICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9lbWFpbF92MiI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciBhbGwgZGF0YSByZWNvcmRzIG9mIHRoZQorICAgICAgICAgICAgICoge0BsaW5rIEVtYWlsI0NPTlRFTlRfSVRFTV9UWVBFfSBNSU1FIHR5cGUsIGNvbWJpbmVkIHdpdGggdGhlCisgICAgICAgICAgICAgKiBhc3NvY2lhdGVkIHJhdyBjb250YWN0IGFuZCBhZ2dyZWdhdGUgY29udGFjdCBkYXRhLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKERhdGEuQ09OVEVOVF9VUkksCisgICAgICAgICAgICAgICAgICAgICJlbWFpbHMiKTsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkwgZm9yIGxvb2tpbmcgdXAgZGF0YSByb3dzIGJ5IGVtYWlsIGFkZHJlc3MuIFRoZQorICAgICAgICAgICAgICogbG9va3VwIGFyZ3VtZW50LCBhbiBlbWFpbCBhZGRyZXNzLCBzaG91bGQgYmUgcGFzc2VkIGFzIGFuIGFkZGl0aW9uYWwgcGF0aCBzZWdtZW50CisgICAgICAgICAgICAgKiBhZnRlciB0aGlzIFVSSS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9MT09LVVBfVVJJID0gVXJpLndpdGhBcHBlbmRlZFBhdGgoQ09OVEVOVF9VUkksCisgICAgICAgICAgICAgICAgICAgICJsb29rdXAiKTsKKworICAgICAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfRklMVEVSX0VNQUlMX1VSSSA9IENPTlRFTlRfTE9PS1VQX1VSSTsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkwgZm9yIGVtYWlsIGxvb2t1cCB1c2luZyBhIGZpbHRlci4gVGhlIGZpbHRlciByZXR1cm5zCisgICAgICAgICAgICAgKiByZWNvcmRzIG9mIE1JTUUgdHlwZSB7QGxpbmsgRW1haWwjQ09OVEVOVF9JVEVNX1RZUEV9LiBUaGUgZmlsdGVyIGlzIGFwcGxpZWQKKyAgICAgICAgICAgICAqIHRvIGRpc3BsYXkgbmFtZXMgYXMgd2VsbCBhcyBlbWFpbCBhZGRyZXNzZXMuIFRoZSBmaWx0ZXIgYXJndW1lbnQgc2hvdWxkIGJlIHBhc3NlZAorICAgICAgICAgICAgICogYXMgYW4gYWRkaXRpb25hbCBwYXRoIHNlZ21lbnQgYWZ0ZXIgdGhpcyBVUkkuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfRklMVEVSX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKENPTlRFTlRfVVJJLAorICAgICAgICAgICAgICAgICAgICAiZmlsdGVyIik7CisKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfSE9NRSA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1dPUksgPSAyOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDM7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX01PQklMRSA9IDQ7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGRpc3BsYXkgbmFtZSBmb3IgdGhlIGVtYWlsIGFkZHJlc3MKKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERJU1BMQVlfTkFNRSA9ICJkYXRhNCI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29tbW9uIGRhdGEgZGVmaW5pdGlvbiBmb3IgcG9zdGFsIGFkZHJlc3Nlcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgU3RydWN0dXJlZFBvc3RhbCBpbXBsZW1lbnRzIEJhc2VDb21tb25Db2x1bW5zLCBDb21tb25Db2x1bW5zIHsKKyAgICAgICAgICAgIHByaXZhdGUgU3RydWN0dXJlZFBvc3RhbCgpIHsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqIE1JTUUgdHlwZSB1c2VkIHdoZW4gc3RvcmluZyB0aGlzIGluIGRhdGEgdGFibGUuICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9CisgICAgICAgICAgICAgICAgICAgICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9wb3N0YWwtYWRkcmVzc192MiI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiB7QGxpbmsgI0NPTlRFTlRfVVJJfSBwcm92aWRpbmcgYSBkaXJlY3Rvcnkgb2YKKyAgICAgICAgICAgICAqIHBvc3RhbCBhZGRyZXNzZXMuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL3Bvc3RhbC1hZGRyZXNzX3YyIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkkgZm9yIGFsbCBkYXRhIHJlY29yZHMgb2YgdGhlCisgICAgICAgICAgICAgKiB7QGxpbmsgU3RydWN0dXJlZFBvc3RhbCNDT05URU5UX0lURU1fVFlQRX0gTUlNRSB0eXBlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKERhdGEuQ09OVEVOVF9VUkksCisgICAgICAgICAgICAgICAgICAgICJwb3N0YWxzIik7CisKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfSE9NRSA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1dPUksgPSAyOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDM7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGZ1bGwsIHVuc3RydWN0dXJlZCBwb3N0YWwgYWRkcmVzcy4gPGk+VGhpcyBmaWVsZCBtdXN0IGJlCisgICAgICAgICAgICAgKiBjb25zaXN0ZW50IHdpdGggYW55IHN0cnVjdHVyZWQgZGF0YS48L2k+CisgICAgICAgICAgICAgKiA8cD4KKyAgICAgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRk9STUFUVEVEX0FERFJFU1MgPSBEQVRBOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIENhbiBiZSBzdHJlZXQsIGF2ZW51ZSwgcm9hZCwgZXRjLiBUaGlzIGVsZW1lbnQgYWxzbyBpbmNsdWRlcyB0aGUKKyAgICAgICAgICAgICAqIGhvdXNlIG51bWJlciBhbmQgcm9vbS9hcGFydG1lbnQvZmxhdC9mbG9vciBudW1iZXIuCisgICAgICAgICAgICAgKiA8cD4KKyAgICAgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1RSRUVUID0gImRhdGE2IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBDb3ZlcnMgYWN0dWFsIFAuTy4gYm94ZXMsIGRyYXdlcnMsIGxvY2tlZCBiYWdzLCBldGMuIFRoaXMgaXMKKyAgICAgICAgICAgICAqIHVzdWFsbHkgYnV0IG5vdCBhbHdheXMgbXV0dWFsbHkgZXhjbHVzaXZlIHdpdGggc3RyZWV0LgorICAgICAgICAgICAgICogPHA+CisgICAgICAgICAgICAgKiBUeXBlOiBURVhUCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBPQk9YID0gImRhdGE3IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGlzIGlzIHVzZWQgdG8gZGlzYW1iaWd1YXRlIGEgc3RyZWV0IGFkZHJlc3Mgd2hlbiBhIGNpdHkKKyAgICAgICAgICAgICAqIGNvbnRhaW5zIG1vcmUgdGhhbiBvbmUgc3RyZWV0IHdpdGggdGhlIHNhbWUgbmFtZSwgb3IgdG8gc3BlY2lmeSBhCisgICAgICAgICAgICAgKiBzbWFsbCBwbGFjZSB3aG9zZSBtYWlsIGlzIHJvdXRlZCB0aHJvdWdoIGEgbGFyZ2VyIHBvc3RhbCB0b3duLiBJbgorICAgICAgICAgICAgICogQ2hpbmEgaXQgY291bGQgYmUgYSBjb3VudHkgb3IgYSBtaW5vciBjaXR5LgorICAgICAgICAgICAgICogPHA+CisgICAgICAgICAgICAgKiBUeXBlOiBURVhUCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE5FSUdIQk9SSE9PRCA9ICJkYXRhOCI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ2FuIGJlIGNpdHksIHZpbGxhZ2UsIHRvd24sIGJvcm91Z2gsIGV0Yy4gVGhpcyBpcyB0aGUgcG9zdGFsIHRvd24KKyAgICAgICAgICAgICAqIGFuZCBub3QgbmVjZXNzYXJpbHkgdGhlIHBsYWNlIG9mIHJlc2lkZW5jZSBvciBwbGFjZSBvZiBidXNpbmVzcy4KKyAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICogVHlwZTogVEVYVAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDSVRZID0gImRhdGE5IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBBIHN0YXRlLCBwcm92aW5jZSwgY291bnR5IChpbiBJcmVsYW5kKSwgTGFuZCAoaW4gR2VybWFueSksCisgICAgICAgICAgICAgKiBkZXBhcnRlbWVudCAoaW4gRnJhbmNlKSwgZXRjLgorICAgICAgICAgICAgICogPHA+CisgICAgICAgICAgICAgKiBUeXBlOiBURVhUCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFJFR0lPTiA9ICJkYXRhMTEiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFBvc3RhbCBjb2RlLiBVc3VhbGx5IGNvdW50cnktd2lkZSwgYnV0IHNvbWV0aW1lcyBzcGVjaWZpYyB0byB0aGUKKyAgICAgICAgICAgICAqIGNpdHkgKGUuZy4gIjIiIGluICJEdWJsaW4gMiwgSXJlbGFuZCIgYWRkcmVzc2VzKS4KKyAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICogVHlwZTogVEVYVAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQT1NUQ09ERSA9ICJkYXRhMTIiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBuYW1lIG9yIGNvZGUgb2YgdGhlIGNvdW50cnkuCisgICAgICAgICAgICAgKiA8cD4KKyAgICAgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09VTlRSWSA9ICJkYXRhMTMiOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbW1vbiBkYXRhIGRlZmluaXRpb24gZm9yIElNIGFkZHJlc3Nlcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgSW0gaW1wbGVtZW50cyBCYXNlQ29tbW9uQ29sdW1ucywgQ29tbW9uQ29sdW1ucyB7CisgICAgICAgICAgICBwcml2YXRlIEltKCkge30KKworICAgICAgICAgICAgLyoqIE1JTUUgdHlwZSB1c2VkIHdoZW4gc3RvcmluZyB0aGlzIGluIGRhdGEgdGFibGUuICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9pbSI7CisKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfSE9NRSA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1dPUksgPSAyOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDM7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhpcyBjb2x1bW4gc2hvdWxkIGJlIHBvcHVsYXRlZCB3aXRoIG9uZSBvZiB0aGUgZGVmaW5lZAorICAgICAgICAgICAgICogY29uc3RhbnRzLCBlLmcuIHtAbGluayAjUFJPVE9DT0xfWUFIT099LiBJZiB0aGUgdmFsdWUgb2YgdGhpcworICAgICAgICAgICAgICogY29sdW1uIGlzIHtAbGluayAjUFJPVE9DT0xfQ1VTVE9NfSwgdGhlIHtAbGluayAjQ1VTVE9NX1BST1RPQ09MfQorICAgICAgICAgICAgICogc2hvdWxkIGNvbnRhaW4gdGhlIG5hbWUgb2YgdGhlIGN1c3RvbSBwcm90b2NvbC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUFJPVE9DT0wgPSAiZGF0YTUiOworCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDVVNUT01fUFJPVE9DT0wgPSAiZGF0YTYiOworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogVGhlIHByZWRlZmluZWQgSU0gcHJvdG9jb2wgdHlwZXMuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RPQ09MX0NVU1RPTSA9IC0xOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJPVE9DT0xfQUlNID0gMDsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RPQ09MX01TTiA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9UT0NPTF9ZQUhPTyA9IDI7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9UT0NPTF9TS1lQRSA9IDM7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9UT0NPTF9RUSA9IDQ7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9UT0NPTF9HT09HTEVfVEFMSyA9IDU7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9UT0NPTF9JQ1EgPSA2OworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJPVE9DT0xfSkFCQkVSID0gNzsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RPQ09MX05FVE1FRVRJTkcgPSA4OworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbW1vbiBkYXRhIGRlZmluaXRpb24gZm9yIG9yZ2FuaXphdGlvbnMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIE9yZ2FuaXphdGlvbiBpbXBsZW1lbnRzIEJhc2VDb21tb25Db2x1bW5zLCBDb21tb25Db2x1bW5zIHsKKyAgICAgICAgICAgIHByaXZhdGUgT3JnYW5pemF0aW9uKCkge30KKworICAgICAgICAgICAgLyoqIE1JTUUgdHlwZSB1c2VkIHdoZW4gc3RvcmluZyB0aGlzIGluIGRhdGEgdGFibGUuICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9vcmdhbml6YXRpb24iOworCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1dPUksgPSAxOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGNvbXBhbnkgYXMgdGhlIHVzZXIgZW50ZXJlZCBpdC4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTVBBTlkgPSBEQVRBOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBwb3NpdGlvbiB0aXRsZSBhdCB0aGlzIGNvbXBhbnkgYXMgdGhlIHVzZXIgZW50ZXJlZCBpdC4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJVExFID0gImRhdGE0IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZGVwYXJ0bWVudCBhdCB0aGlzIGNvbXBhbnkgYXMgdGhlIHVzZXIgZW50ZXJlZCBpdC4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFUEFSVE1FTlQgPSAiZGF0YTUiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBqb2IgZGVzY3JpcHRpb24gYXQgdGhpcyBjb21wYW55IGFzIHRoZSB1c2VyIGVudGVyZWQgaXQuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBKT0JfREVTQ1JJUFRJT04gPSAiZGF0YTYiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBzeW1ib2wgb2YgdGhpcyBjb21wYW55IGFzIHRoZSB1c2VyIGVudGVyZWQgaXQuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTWU1CT0wgPSAiZGF0YTciOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBwaG9uZXRpYyBuYW1lIG9mIHRoaXMgY29tcGFueSBhcyB0aGUgdXNlciBlbnRlcmVkIGl0LgorICAgICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPTkVUSUNfTkFNRSA9ICJkYXRhOCI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29tbW9uIGRhdGEgZGVmaW5pdGlvbiBmb3IgbWlzY2VsbGFuZW91cyBpbmZvcm1hdGlvbi4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgTWlzY2VsbGFuZW91cyBpbXBsZW1lbnRzIEJhc2VDb21tb25Db2x1bW5zIHsKKyAgICAgICAgICAgIHByaXZhdGUgTWlzY2VsbGFuZW91cygpIHt9CisKKyAgICAgICAgICAgIC8qKiBNSU1FIHR5cGUgdXNlZCB3aGVuIHN0b3JpbmcgdGhpcyBpbiBkYXRhIHRhYmxlLiAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vbWlzYyI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGJpcnRoZGF5IGFzIHRoZSB1c2VyIGVudGVyZWQgaXQuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBCSVJUSERBWSA9ICJkYXRhMSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIG5pY2tuYW1lIGFzIHRoZSB1c2VyIGVudGVyZWQgaXQuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBOSUNLTkFNRSA9ICJkYXRhMiI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29tbW9uIGRhdGEgZGVmaW5pdGlvbiBmb3IgcmVsYXRpb25zLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBSZWxhdGlvbiBpbXBsZW1lbnRzIEJhc2VDb21tb25Db2x1bW5zLCBDb21tb25Db2x1bW5zIHsKKyAgICAgICAgICAgIHByaXZhdGUgUmVsYXRpb24oKSB7fQorCisgICAgICAgICAgICAvKiogTUlNRSB0eXBlIHVzZWQgd2hlbiBzdG9yaW5nIHRoaXMgaW4gZGF0YSB0YWJsZS4gKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL3JlbGF0aW9uIjsKKworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9BU1NJU1RBTlQgPSAxOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9CUk9USEVSID0gMjsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfQ0hJTEQgPSAzOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9ET01FU1RJQ19QQVJUTkVSID0gNDsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfRkFUSEVSID0gNTsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfRlJJRU5EID0gNjsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfTUFOQUdFUiA9IDc7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX01PVEhFUiA9IDg7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1BBUkVOVCA9IDk7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1BBUlRORVIgPSAxMDsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfUkVGRVJSRURfQlkgPSAxMTsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfUkVMQVRJVkUgPSAxMjsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfU0lTVEVSID0gMTM7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1NQT1VTRSA9IDE0OworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBuYW1lIG9mIHRoZSByZWxhdGl2ZSBhcyB0aGUgdXNlciBlbnRlcmVkIGl0LgorICAgICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTkFNRSA9IERBVEE7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29tbW9uIGRhdGEgZGVmaW5pdGlvbiBmb3IgZXZlbnRzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBFdmVudCBpbXBsZW1lbnRzIEJhc2VDb21tb25Db2x1bW5zLCBDb21tb25Db2x1bW5zIHsKKyAgICAgICAgICAgIHByaXZhdGUgRXZlbnQoKSB7fQorCisgICAgICAgICAgICAvKiogTUlNRSB0eXBlIHVzZWQgd2hlbiBzdG9yaW5nIHRoaXMgaW4gZGF0YSB0YWJsZS4gKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0gInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL2V2ZW50IjsKKworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9BTk5JVkVSU0FSWSA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX09USEVSID0gMjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXZlbnQgc3RhcnQgZGF0ZSBhcyB0aGUgdXNlciBlbnRlcmVkIGl0LgorICAgICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1RBUlRfREFURSA9IERBVEE7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUGhvdG8gb2YgdGhlIGNvbnRhY3QuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFBob3RvIGltcGxlbWVudHMgQmFzZUNvbW1vbkNvbHVtbnMgeworICAgICAgICAgICAgcHJpdmF0ZSBQaG90bygpIHt9CisKKyAgICAgICAgICAgIC8qKiBNSU1FIHR5cGUgdXNlZCB3aGVuIHN0b3JpbmcgdGhpcyBpbiBkYXRhIHRhYmxlLiAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vcGhvdG8iOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRodW1ibmFpbCBwaG90byBvZiB0aGUgcmF3IGNvbnRhY3QuIFRoaXMgaXMgdGhlIHJhdyBieXRlcyBvZiBhbiBpbWFnZQorICAgICAgICAgICAgICogdGhhdCBjb3VsZCBiZSBpbmZsYXRlZCB1c2luZyB7QGxpbmsgQml0bWFwRmFjdG9yeX0uCisgICAgICAgICAgICAgKiA8cD4KKyAgICAgICAgICAgICAqIFR5cGU6IEJMT0IKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEhPVE8gPSAiZGF0YTEiOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE5vdGVzIGFib3V0IHRoZSBjb250YWN0LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBOb3RlIGltcGxlbWVudHMgQmFzZUNvbW1vbkNvbHVtbnMgeworICAgICAgICAgICAgcHJpdmF0ZSBOb3RlKCkge30KKworICAgICAgICAgICAgLyoqIE1JTUUgdHlwZSB1c2VkIHdoZW4gc3RvcmluZyB0aGlzIGluIGRhdGEgdGFibGUuICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9ub3RlIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgbm90ZSB0ZXh0LgorICAgICAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTk9URSA9ICJkYXRhMSI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogR3JvdXAgTWVtYmVyc2hpcC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgR3JvdXBNZW1iZXJzaGlwIGltcGxlbWVudHMgQmFzZUNvbW1vbkNvbHVtbnMgeworICAgICAgICAgICAgcHJpdmF0ZSBHcm91cE1lbWJlcnNoaXAoKSB7fQorCisgICAgICAgICAgICAvKiogTUlNRSB0eXBlIHVzZWQgd2hlbiBzdG9yaW5nIHRoaXMgaW4gZGF0YSB0YWJsZS4gKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0KKyAgICAgICAgICAgICAgICAgICAgInZuZC5hbmRyb2lkLmN1cnNvci5pdGVtL2dyb3VwX21lbWJlcnNoaXAiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSByb3cgaWQgb2YgdGhlIGdyb3VwIHRoYXQgdGhpcyBncm91cCBtZW1iZXJzaGlwIHJlZmVycyB0by4gRXhhY3RseSBvbmUgb2YKKyAgICAgICAgICAgICAqIHRoaXMgb3Ige0BsaW5rICNHUk9VUF9TT1VSQ0VfSUR9IG11c3QgYmUgc2V0IHdoZW4gaW5zZXJ0aW5nIGEgcm93LgorICAgICAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1JPVVBfUk9XX0lEID0gImRhdGExIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgc291cmNlaWQgb2YgdGhlIGdyb3VwIHRoYXQgdGhpcyBncm91cCBtZW1iZXJzaGlwIHJlZmVycyB0by4gIEV4YWN0bHkgb25lIG9mCisgICAgICAgICAgICAgKiB0aGlzIG9yIHtAbGluayAjR1JPVVBfUk9XX0lEfSBtdXN0IGJlIHNldCB3aGVuIGluc2VydGluZyBhIHJvdy4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEdST1VQX1NPVVJDRV9JRCA9ICJncm91cF9zb3VyY2VpZCI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogV2Vic2l0ZSByZWxhdGVkIHRvIHRoZSBjb250YWN0LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBXZWJzaXRlIGltcGxlbWVudHMgQmFzZUNvbW1vbkNvbHVtbnMsIENvbW1vbkNvbHVtbnMgeworICAgICAgICAgICAgcHJpdmF0ZSBXZWJzaXRlKCkge30KKworICAgICAgICAgICAgLyoqIE1JTUUgdHlwZSB1c2VkIHdoZW4gc3RvcmluZyB0aGlzIGluIGRhdGEgdGFibGUuICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX0lURU1fVFlQRSA9ICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS93ZWJzaXRlIjsKKworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9IT01FUEFHRSA9IDE7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0JMT0cgPSAyOworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9QUk9GSUxFID0gMzsKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfSE9NRSA9IDQ7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1dPUksgPSA1OworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9GVFAgPSA2OworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9PVEhFUiA9IDc7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIHdlYnNpdGUgVVJMIHN0cmluZy4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFVSTCA9ICJkYXRhMSI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBUT0RPOiBtYWtlIHRoaXMgcHJpdmF0ZSBiZWZvcmUgdW5oaWRpbmcKKyAgICBwdWJsaWMgaW50ZXJmYWNlIEdyb3Vwc0NvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGRpc3BsYXkgdGl0bGUgb2YgdGhpcyBncm91cC4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJVExFID0gInRpdGxlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHBhY2thZ2UgbmFtZSB0byB1c2Ugd2hlbiBjcmVhdGluZyB7QGxpbmsgUmVzb3VyY2VzfSBvYmplY3RzIGZvcgorICAgICAgICAgKiB0aGlzIGdyb3VwLiBUaGlzIHZhbHVlIGlzIG9ubHkgZGVzaWduZWQgZm9yIHVzZSB3aGVuIGJ1aWxkaW5nIHVzZXIKKyAgICAgICAgICogaW50ZXJmYWNlcywgYW5kIHNob3VsZCBub3QgYmUgdXNlZCB0byBpbmZlciB0aGUgb3duZXIuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBSRVNfUEFDS0FHRSA9ICJyZXNfcGFja2FnZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBkaXNwbGF5IHRpdGxlIG9mIHRoaXMgZ3JvdXAgdG8gbG9hZCBhcyBhIHJlc291cmNlIGZyb20KKyAgICAgICAgICoge0BsaW5rICNSRVNfUEFDS0FHRX0sIHdoaWNoIG1heSBiZSBsb2NhbGl6ZWQuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUSVRMRV9SRVMgPSAidGl0bGVfcmVzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogTm90ZXMgYWJvdXQgdGhlIGdyb3VwLgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVHlwZTogVEVYVAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTk9URVMgPSAibm90ZXMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgSUQgb2YgdGhpcyBncm91cCBpZiBpdCBpcyBhIFN5c3RlbSBHcm91cCwgaS5lLiBhIGdyb3VwIHRoYXQgaGFzIGEgc3BlY2lhbCBtZWFuaW5nCisgICAgICAgICAqIHRvIHRoZSBzeW5jIGFkYXB0ZXIsIG51bGwgb3RoZXJ3aXNlLgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1lTVEVNX0lEID0gInN5c3RlbV9pZCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0b3RhbCBudW1iZXIgb2Yge0BsaW5rIENvbnRhY3RzfSB0aGF0IGhhdmUKKyAgICAgICAgICoge0BsaW5rIENvbW1vbkRhdGFLaW5kcy5Hcm91cE1lbWJlcnNoaXB9IGluIHRoaXMgZ3JvdXAuIFJlYWQtb25seSB2YWx1ZSB0aGF0IGlzIG9ubHkKKyAgICAgICAgICogcHJlc2VudCB3aGVuIHF1ZXJ5aW5nIHtAbGluayBHcm91cHMjQ09OVEVOVF9TVU1NQVJZX1VSSX0uCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBJTlRFR0VSCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTVU1NQVJZX0NPVU5UID0gInN1bW1fY291bnQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdG90YWwgbnVtYmVyIG9mIHtAbGluayBDb250YWN0c30gdGhhdCBoYXZlIGJvdGgKKyAgICAgICAgICoge0BsaW5rIENvbW1vbkRhdGFLaW5kcy5Hcm91cE1lbWJlcnNoaXB9IGluIHRoaXMgZ3JvdXAsIGFuZCBhbHNvIGhhdmUgcGhvbmUgbnVtYmVycy4KKyAgICAgICAgICogUmVhZC1vbmx5IHZhbHVlIHRoYXQgaXMgb25seSBwcmVzZW50IHdoZW4gcXVlcnlpbmcKKyAgICAgICAgICoge0BsaW5rIEdyb3VwcyNDT05URU5UX1NVTU1BUllfVVJJfS4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IElOVEVHRVIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNVTU1BUllfV0lUSF9QSE9ORVMgPSAic3VtbV9waG9uZXMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBGbGFnIGluZGljYXRpbmcgaWYgdGhlIGNvbnRhY3RzIGJlbG9uZ2luZyB0byB0aGlzIGdyb3VwIHNob3VsZCBiZQorICAgICAgICAgKiB2aXNpYmxlIGluIGFueSB1c2VyIGludGVyZmFjZS4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IElOVEVHRVIgKGJvb2xlYW4pCis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dzIGFjY291bnQuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBJTlRFR0VSIChib29sZWFuKQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0hPVUxEX1NZTkMgPSAic2hvdWxkX3N5bmMiOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnN0YW50cyBmb3IgdGhlIGdyb3VwcyB0YWJsZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIEdyb3VwcyBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBHcm91cHNDb2x1bW5zLCBTeW5jQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGlzIHV0aWxpdHkgY2xhc3MgY2Fubm90IGJlIGluc3RhbnRpYXRlZAorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBHcm91cHMoKSB7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS53aXRoQXBwZW5kZWRQYXRoKEFVVEhPUklUWV9VUkksICJncm91cHMiKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlIGpvaW5lZCB3aXRoIGRldGFpbHMgZGF0YSBmcm9tCisgICAgICAgICAqIHtAbGluayBEYXRhfS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfU1VNTUFSWV9VUkkgPSBVcmkud2l0aEFwcGVuZGVkUGF0aChBVVRIT1JJVFlfVVJJLAorICAgICAgICAgICAgICAgICJncm91cHNfc3VtbWFyeSIpOworCis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C4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfQVVUT01BVElDID0gMDsKKworICAgICAgICAvKioKKyAgICAgICAgICogTWFrZXMgc3VyZSB0aGF0IHRoZSBzcGVjaWZpZWQgcmF3IGNvbnRhY3RzIGFyZSBpbmNsdWRlZCBpbiB0aGUgc2FtZQorICAgICAgICAgKiBhZ2dyZWdhdGUgY29udGFjdC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfS0VFUF9UT0dFVEhFUiA9IDE7CisKKyAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVFlQRV9LRUVQX0lOID0gMTsKKworICAgICAgICAvKioKKyAgICAgICAgICogTWFrZXMgc3VyZSB0aGF0IHRoZSBzcGVjaWZpZWQgcmF3IGNvbnRhY3RzIGFyZSBOT1QgaW5jbHVkZWQgaW4gdGhlIHNhbWUKKyAgICAgICAgICogYWdncmVnYXRlIGNvbnRhY3QuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0tFRVBfU0VQQVJBVEUgPSAyOworCisgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFRZUEVfS0VFUF9PVVQgPSAyOworCisgICAgICAgIEBEZXByZWNhdGVkCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRBQ1RfSUQgPSAiY29udGFjdF9pZCI7CisKKyAgICAgICAgQERlcHJlY2F0ZWQKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUkFXX0NPTlRBQ1RfSUQgPSAicmF3X2NvbnRhY3RfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIHJlZmVyZW5jZSB0byB0aGUge0BsaW5rIFJhd0NvbnRhY3RzI19JRH0gb2YgdGhlIHJhdyBjb250YWN0IHRoYXQgdGhlIHJ1bGUgYXBwbGllcyB0by4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFJBV19DT05UQUNUX0lEMSA9ICJyYXdfY29udGFjdF9pZDEiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIHJlZmVyZW5jZSB0byB0aGUgb3RoZXIge0BsaW5rIFJhd0NvbnRhY3RzI19JRH0gb2YgdGhlIHJhdyBjb250YWN0IHRoYXQgdGhlIHJ1bGUKKyAgICAgICAgICogYXBwbGllcyB0by4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFJBV19DT05UQUNUX0lEMiA9ICJyYXdfY29udGFjdF9pZDIiOworICAgIH0KKworICAgIHByaXZhdGUgaW50ZXJmYWNlIFNldHRpbmdzQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgYWNjb3VudCBpbnN0YW5jZSB0byB3aGljaCB0aGlzIHJvdyBiZWxvbmdzLgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUNDT1VOVF9OQU1FID0gImFjY291bnRfbmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0eXBlIG9mIGFjY291bnQgdG8gd2hpY2ggdGhpcyByb3cgYmVsb25ncywgd2hpY2ggd2hlbiBwYWlyZWQgd2l0aAorICAgICAgICAgKiB7QGxpbmsgI0FDQ09VTlRfTkFNRX0gaWRlbnRpZmllcyBhIHNwZWNpZmljIGFjY291bnQuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ0NPVU5UX1RZUEUgPSAiYWNjb3VudF90eXBlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogRGVwZW5kaW5nIG9uIHRoZSBtb2RlIGRlZmluZWQgYnkgdGhlIHN5bmMtYWRhcHRlciwgdGhpcyBmbGFnIGNvbnRyb2xzCisgICAgICAgICAqIHRoZSB0b3AtbGV2ZWwgc3luYyBiZWhhdmlvciBmb3IgdGhpcyBkYXRhIHNvdXJjZS4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IElOVEVHRVIgKGJvb2xlYW4pCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTSE9VTERfU1lOQyA9ICJzaG91bGRfc3luYyI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZsYWcgaW5kaWNhdGluZyBpZiBjb250YWN0cyB3aXRob3V0IGFueSB7QGxpbmsgQ29tbW9uRGF0YUtpbmRzLkdyb3VwTWVtYmVyc2hpcH0KKyAgICAgICAgICogZW50cmllcyBzaG91bGQgYmUgdmlzaWJsZSBpbiBhbnkgdXNlciBpbnRlcmZhY2UuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBJTlRFR0VSIChib29sZWFuKQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVU5HUk9VUEVEX1ZJU0lCTEUgPSAidW5ncm91cGVkX3Zpc2libGUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBSZWFkLW9ubHkgY291bnQgb2Yge0BsaW5rIENvbnRhY3RzfSBmcm9tIGEgc3BlY2lmaWMgc291cmNlIHRoYXQgaGF2ZQorICAgICAgICAgKiBubyB7QGxpbmsgQ29tbW9uRGF0YUtpbmRzLkdyb3VwTWVtYmVyc2hpcH0gZW50cmllcy4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IElOVEVHRVIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFVOR1JPVVBFRF9DT1VOVCA9ICJzdW1tX2NvdW50IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogUmVhZC1vbmx5IGNvdW50IG9mIHtAbGluayBDb250YWN0c30gZnJvbSBhIHNwZWNpZmljIHNvdXJjZSB0aGF0IGhhdmUKKyAgICAgICAgICogbm8ge0BsaW5rIENvbW1vbkRhdGFLaW5kcy5Hcm91cE1lbWJlcnNoaXB9IGVudHJpZXMsIGFuZCBhbHNvIGhhdmUgcGhvbmUgbnVtYmVycy4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IElOVEVHRVIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFVOR1JPVVBFRF9XSVRIX1BIT05FUyA9ICJzdW1tX3Bob25lcyI7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29udGFjdHMtc3BlY2lmaWMgc2V0dGluZ3MgZm9yIHZhcmlvdXMge0BsaW5rIEFjY291bnR9LgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgU2V0dGluZ3MgaW1wbGVtZW50cyBTZXR0aW5nc0NvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyB1dGlsaXR5IGNsYXNzIGNhbm5vdCBiZSBpbnN0YW50aWF0ZWQKKyAgICAgICAgICovCisgICAgICAgIHByaXZhdGUgU2V0dGluZ3MoKSB7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9CisgICAgICAgICAgICAgICAgVXJpLndpdGhBcHBlbmRlZFBhdGgoQVVUSE9SSVRZX1VSSSwgInNldHRpbmdzIik7CisKKyAgICAgICAgLyoqCisgIC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KyAgICAgICAgICogdG8gZXhpc3RpbmcgbnVtYmVycyB1c2luZyB0aGUgc3RhbmRhcmQgY2FsbGVyIElEIGxvb2t1cCBhbGdvcml0aG0uCisgICAgICAgICAqIFRoZSBudW1iZXIgbXVzdCBiZSBwcm9wZXJseSBlbmNvZGVkLCBmb3IgZXhhbXBsZSB1c2luZworICAgICAgICAgKiB7QGxpbmsgVXJpI2Zyb21QYXJ0cyhTdHJpbmcsIFN0cmluZywgU3RyaW5nKX0uCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBBbnkgZXh0cmFzIGZyb20gdGhlIHtAbGluayBJbnNlcnR9IGNsYXNzIHdpbGwgYmUgcGFzc2VkIGFsb25nIHRvIHRoZQorICAgICAgICAgKiBjcmVhdGUgYWN0aXZpdHkgaWYgdGhlcmUgYXJlIG5vIGNvbnRhY3RzIHRvIHNob3cuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBQYXNzaW5nIHRydWUgZm9yIHRoZSB7QGxpbmsgI0VYVFJBX0ZPUkNFX0NSRUFURX0gZXh0cmEgd2lsbCBza2lwCisgICAgICAgICAqIHByb21wdGluZyB0aGUgdXNlciB3aGVuIHRoZSBjb250YWN0IGRvZXNuJ3QgZXhpc3QuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTSE9XX09SX0NSRUFURV9DT05UQUNUID0KKyAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLlNIT1dfT1JfQ1JFQVRFX0NPTlRBQ1QiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBVc2VkIHdpdGgge0BsaW5rICNTSE9XX09SX0NSRUFURV9DT05UQUNUfSB0byBmb3JjZSBjcmVhdGluZyBhIG5ldworICAgICAgICAgKiBjb250YWN0IGlmIG5vIG1hdGNoaW5nIGNvbnRhY3QgZm91bmQuIE90aGVyd2lzZSwgZGVmYXVsdCBiZWhhdmlvciBpcworICAgICAgICAgKiB0byBwcm9tcHQgdXNlciB3aXRoIGRpYWxvZyBiZWZvcmUgY3JlYXRpbmcuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBCT09MRUFOCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFRSQV9GT1JDRV9DUkVBVEUgPQorICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uRk9SQ0VfQ1JFQVRFIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVXNlZCB3aXRoIHtAbGluayAjU0hPV19PUl9DUkVBVEVfQ09OVEFDVH0gdG8gc3BlY2lmeSBhbiBleGFjdAorICAgICAgICAgKiBkZXNjcmlwdGlvbiB0byBiZSBzaG93biB3aGVuIHByb21wdGluZyB1c2VyIGFib3V0IGNyZWF0aW5nIGEgbmV3CisgICAgICAgICAqIGNvbnRhY3QuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBTVFJJTkcKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX0NSRUFURV9ERVNDUklQVElPTiA9CisgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLkNSRUFURV9ERVNDUklQVElPTiI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE9wdGlvbmFsIGV4dHJhIHVzZWQgd2l0aCB7QGxpbmsgI1NIT1dfT1JfQ1JFQVRFX0NPTlRBQ1R9IHRvIHNwZWNpZnkgYQorICAgICAgICAgKiBkaWFsb2cgbG9jYXRpb24gdXNpbmcgc2NyZWVuIGNvb3JkaW5hdGVzLiBXaGVuIG5vdCBzcGVjaWZpZWQsIHRoZQorICAgICAgICAgKiBkaWFsb2cgd2lsbCBiZSBjZW50ZXJlZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX1RBUkdFVF9SRUNUID0gInRhcmdldF9yZWN0IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogT3B0aW9uYWwgZXh0cmEgdXNlZCB3aXRoIHtAbGluayAjU0hPV19PUl9DUkVBVEVfQ09OVEFDVH0gdG8gc3BlY2lmeSBhCisgICAgICAgICAqIGRlc2lyZWQgZGlhbG9nIHN0eWxlLCB1c3VhbGx5IGEgdmFyaWF0aW9uIG9uIHNpemUuIE9uZSBvZgorICAgICAgICAgKiB7QGxpbmsgI01PREVfU01BTEx9LCB7QGxpbmsgI01PREVfTUVESVVNfSwgb3Ige0BsaW5rICNNT0RFX0xBUkdFfS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVYVFJBX01PREUgPSAibW9kZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFZhbHVlIGZvciB7QGxpbmsgI0VYVFJBX01PREV9IHRvIHNob3cgYSBzbWFsbC1zaXplZCBkaWFsb2cuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBNT0RFX1NNQUxMID0gMTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVmFsdWUgZm9yIHtAbGluayAjRVhUUkFfTU9ERX0gdG8gc2hvdyBhIG1lZGl1bS1zaXplZCBkaWFsb2cuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBNT0RFX01FRElVTSA9IDI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFZhbHVlIGZvciB7QGxpbmsgI0VYVFJBX01PREV9IHRvIHNob3cgYSBsYXJnZS1zaXplZCBkaWFsb2cuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBNT0RFX0xBUkdFID0gMzsKKworICAgICAgICAvKioKKyAgICAgICAgICogT3B0aW9uYWwgZXh0cmEgdXNlZCB3aXRoIHtAbGluayAjU0hPV19PUl9DUkVBVEVfQ09OVEFDVH0gdG8gaW5kaWNhdGUKKyAgICAgICAgICogYSBsaXN0IG9mIHNwZWNpZmljIE1JTUUtdHlwZXMgdG8gZXhjbHVkZSBhbmQgbm90IGRpc3BsYXkuIFN0b3JlZCBhcyBhCisgICAgICAgICAqIHtAbGluayBTdHJpbmd9IGFycmF5LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRVhUUkFfRVhDTFVERV9NSU1FUyA9ICJleGNsdWRlX21pbWVzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogSW50ZW50cyByZWxhdGVkIHRvIHRoZSBDb250YWN0cyBhcHAgVUkuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFVJIHsKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGFjdGlvbiBmb3IgdGhlIGRlZmF1bHQgY29udGFjdHMgbGlzdCB0YWIuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExJU1RfREVGQVVMVCA9CisgICAgICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uTElTVF9ERUZBVUxUIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgYWN0aW9uIGZvciB0aGUgY29udGFjdHMgbGlzdCB0YWIuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExJU1RfR1JPVVBfQUNUSU9OID0KKyAgICAgICAgICAgICAgICAgICAgImNvbS5hbmRyb2lkLmNvbnRhY3RzLmFjdGlvbi5MSVNUX0dST1VQIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBXaGVuIGluIExJU1RfR1JPVVBfQUNUSU9OIG1vZGUsIHRoaXMgaXMgdGhlIGdyb3VwIHRvIGRpc3BsYXkuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEdST1VQX05BTUVfRVhUUkFfS0VZID0gImNvbS5hbmRyb2lkLmNvbnRhY3RzLmV4dHJhLkdST1VQIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgYWN0aW9uIGZvciB0aGUgYWxsIGNvbnRhY3RzIGxpc3QgdGFiLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMSVNUX0FMTF9DT05UQUNUU19BQ1RJT04gPQorICAgICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLkxJU1RfQUxMX0NPTlRBQ1RTIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgYWN0aW9uIGZvciB0aGUgY29udGFjdHMgd2l0aCBwaG9uZSBudW1iZXJzIGxpc3QgdGFiLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMSVNUX0NPTlRBQ1RTX1dJVEhfUEhPTkVTX0FDVElPTiA9CisgICAgICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uTElTVF9DT05UQUNUU19XSVRIX1BIT05FUyI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGFjdGlvbiBmb3IgdGhlIHN0YXJyZWQgY29udGFjdHMgbGlzdCB0YWIuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExJU1RfU1RBUlJFRF9BQ1RJT04gPQorICAgICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLkxJU1RfU1RBUlJFRCI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGFjdGlvbiBmb3IgdGhlIGZyZXF1ZW50IGNvbnRhY3RzIGxpc3QgdGFiLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMSVNUX0ZSRVFVRU5UX0FDVElPTiA9CisgICAgICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5hY3Rpb24uTElTVF9GUkVRVUVOVCI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGFjdGlvbiBmb3IgdGhlICJzdHJlcXVlbnQiIGNvbnRhY3RzIGxpc3QgdGFiLiBJdCBmaXJzdCBsaXN0cyB0aGUgc3RhcnJlZAorICAgICAgICAgICAgICogY29udGFjdHMgaW4gYWxwaGFiZXRpY2FsIG9yZGVyIGFuZCB0aGVuIHRoZSBmcmVxdWVudCBjb250YWN0cyBpbiBkZXNjZW5kaW5nCisgICAgICAgICAgICAgKiBvcmRlciBvZiB0aGUgbnVtYmVyIG9mIHRpbWVzIHRoZXkgaGF2ZSBiZWVuIGNvbnRhY3RlZC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTElTVF9TVFJFUVVFTlRfQUNUSU9OID0KKyAgICAgICAgICAgICAgICAgICAgImNvbS5hbmRyb2lkLmNvbnRhY3RzLmFjdGlvbi5MSVNUX1NUUkVRVUVOVCI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQSBrZXkgZm9yIHRvIGJlIHVzZWQgYXMgYW4gaW50ZW50IGV4dHJhIHRvIHNldCB0aGUgYWN0aXZpdHkKKyAgICAgICAgICAgICAqIHRpdGxlIHRvIGEgY3VzdG9tIFN0cmluZyB2YWx1ZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVElUTEVfRVhUUkFfS0VZID0KKyAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuZXh0cmEuVElUTEVfRVhUUkEiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIEFjdGl2aXR5IEFjdGlvbjogRGlzcGxheSBhIGZpbHRlcmVkIGxpc3Qgb2YgY29udGFjdHMKKyAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICogSW5wdXQ6IEV4dHJhIGZpZWxkIHtAbGluayAjRklMVEVSX1RFWFRfRVhUUkFfS0VZfSBpcyB0aGUgdGV4dCB0byB1c2UgZm9yCisgICAgICAgICAgICAgKiBmaWx0ZXJpbmcKKyAgICAgICAgICAgICAqIDxwPgorICAgICAgICAgICAgICogT3V0cHV0OiBOb3RoaW5nLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGSUxURVJfQ09OVEFDVFNfQUNUSU9OID0KKyAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLkZJTFRFUl9DT05UQUNUUyI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVXNlZCBhcyBhbiBpbnQgZXh0cmEgZmllbGQgaW4ge0BsaW5rICNGSUxURVJfQ09OVEFDVFNfQUNUSU9OfQorICAgICAgICAgICAgICogaW50ZW50cyB0byBzdXBwbHkgdGhlIHRleHQgb24gd2hpY2ggdG8gZmlsdGVyLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGSUxURVJfVEVYVF9FWFRSQV9LRVkgPQorICAgICAgICAgICAgICAgICJjb20uYW5kcm9pZC5jb250YWN0cy5leHRyYS5GSUxURVJfVEVYVCI7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29udmVuaWVuY2UgY2xhc3MgdGhhdCBjb250YWlucyBzdHJpbmcgY29uc3RhbnRzIHVzZWQKKyAgICAgICAgICogdG8gY3JlYXRlIGNvbnRhY3Qge0BsaW5rIGFuZHJvaWQuY29udGVudC5JbnRlbnQgSW50ZW50c30uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIEluc2VydCB7CisgICAgICAgICAgICAvKiogVGhlIGFjdGlvbiBjb2RlIHRvIHVzZSB3aGVuIGFkZGluZyBhIGNvbnRhY3QgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDVElPTiA9IEludGVudC5BQ1RJT05fSU5TRVJUOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIElmIHByZXNlbnQsIGZvcmNlcyBhIGJ5cGFzcyBvZiBxdWljayBpbnNlcnQgbW9kZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRlVMTF9NT0RFID0gImZ1bGxfbW9kZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBuYW1lLgorICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBOQU1FID0gIm5hbWUiOworCisgICAgICAgICAgICAvLyBUT0RPIGFkZCBzdHJ1Y3R1cmVkIG5hbWUgdmFsdWVzIGhlcmUuCisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBwaG9uZXRpYyBuYW1lLgorICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9ORVRJQ19OQU1FID0gInBob25ldGljX25hbWUiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIGNvbnRhY3QgY29tcGFueS4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFN0cmluZzwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09NUEFOWSA9ICJjb21wYW55IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIHRoZSBjb250YWN0IGpvYiB0aXRsZS4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFN0cmluZzwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgSk9CX1RJVExFID0gImpvYl90aXRsZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBub3Rlcy4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFN0cmluZzwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTk9URVMgPSAibm90ZXMiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIGNvbnRhY3QgcGhvbmUgbnVtYmVyLgorICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9ORSA9ICJwaG9uZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBwaG9uZSBudW1iZXIgdHlwZS4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IEVpdGhlciBhbiBpbnRlZ2VyIHZhbHVlIGZyb20KKyAgICAgICAgICAgICAqIHtAbGluayBhbmRyb2lkLnByb3ZpZGVyLkNvbnRhY3RzLlBob25lc0NvbHVtbnMgUGhvbmVzQ29sdW1uc30sCisgICAgICAgICAgICAgKiAgb3IgYSBzdHJpbmcgc3BlY2lmeWluZyBhIGN1c3RvbSBsYWJlbC48L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBIT05FX1RZUEUgPSAicGhvbmVfdHlwZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgcGhvbmUgaXNwcmltYXJ5IGZsYWcuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBib29sZWFuPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBQSE9ORV9JU1BSSU1BUlkgPSAicGhvbmVfaXNwcmltYXJ5IjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHNlY29uZCBjb250YWN0IHBob25lIG51bWJlci4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFN0cmluZzwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VDT05EQVJZX1BIT05FID0gInNlY29uZGFyeV9waG9uZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBvcHRpb25hbCBzZWNvbmQgY29udGFjdCBwaG9uZSBudW1iZXIgdHlwZS4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IEVpdGhlciBhbiBpbnRlZ2VyIHZhbHVlIGZyb20KKyAgICAgICAgICAgICAqIHtAbGluayBhbmRyb2lkLnByb3ZpZGVyLkNvbnRhY3RzLlBob25lc0NvbHVtbnMgUGhvbmVzQ29sdW1uc30sCisgICAgICAgICAgICAgKiAgb3IgYSBzdHJpbmcgc3BlY2lmeWluZyBhIGN1c3RvbSBsYWJlbC48L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQ09OREFSWV9QSE9ORV9UWVBFID0gInNlY29uZGFyeV9waG9uZV90eXBlIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHRoaXJkIGNvbnRhY3QgcGhvbmUgbnVtYmVyLgorICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBURVJUSUFSWV9QSE9ORSA9ICJ0ZXJ0aWFyeV9waG9uZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBvcHRpb25hbCB0aGlyZCBjb250YWN0IHBob25lIG51bWJlciB0eXBlLgorICAgICAgICAgICAgICogPFA+VHlwZTogRWl0aGVyIGFuIGludGVnZXIgdmFsdWUgZnJvbQorICAgICAgICAgICAgICoge0BsaW5rIGFuZHJvaWQucHJvdmlkZXIuQ29udGFjdHMuUGhvbmVzQ29sdW1ucyBQaG9uZXNDb2x1bW5zfSwKKyAgICAgICAgICAgICAqICBvciBhIHN0cmluZyBzcGVjaWZ5aW5nIGEgY3VzdG9tIGxhYmVsLjwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEVSVElBUllfUEhPTkVfVFlQRSA9ICJ0ZXJ0aWFyeV9waG9uZV90eXBlIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIHRoZSBjb250YWN0IGVtYWlsIGFkZHJlc3MuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVNQUlMID0gImVtYWlsIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIHRoZSBjb250YWN0IGVtYWlsIHR5cGUuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBFaXRoZXIgYW4gaW50ZWdlciB2YWx1ZSBmcm9tCisgICAgICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5wcm92aWRlci5Db250YWN0cy5Db250YWN0TWV0aG9kc0NvbHVtbnMgQ29udGFjdE1ldGhvZHNDb2x1bW5zfQorICAgICAgICAgICAgICogIG9yIGEgc3RyaW5nIHNwZWNpZnlpbmcgYSBjdXN0b20gbGFiZWwuPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFTUFJTF9UWVBFID0gImVtYWlsX3R5cGUiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIGVtYWlsIGlzcHJpbWFyeSBmbGFnLgorICAgICAgICAgICAgICogPFA+VHlwZTogYm9vbGVhbjwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRU1BSUxfSVNQUklNQVJZID0gImVtYWlsX2lzcHJpbWFyeSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBvcHRpb25hbCBzZWNvbmQgY29udGFjdCBlbWFpbCBhZGRyZXNzLgorICAgICAgICAgICAgICogPFA+VHlwZTogU3RyaW5nPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUNPTkRBUllfRU1BSUwgPSAic2Vjb25kYXJ5X2VtYWlsIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHNlY29uZCBjb250YWN0IGVtYWlsIHR5cGUuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBFaXRoZXIgYW4gaW50ZWdlciB2YWx1ZSBmcm9tCisgICAgICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5wcm92aWRlci5Db250YWN0cy5Db250YWN0TWV0aG9kc0NvbHVtbnMgQ29udGFjdE1ldGhvZHNDb2x1bW5zfQorICAgICAgICAgICAgICogIG9yIGEgc3RyaW5nIHNwZWNpZnlpbmcgYSBjdXN0b20gbGFiZWwuPC9QPgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUNPTkRBUllfRU1BSUxfVFlQRSA9ICJzZWNvbmRhcnlfZW1haWxfdHlwZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBvcHRpb25hbCB0aGlyZCBjb250YWN0IGVtYWlsIGFkZHJlc3MuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRFUlRJQVJZX0VNQUlMID0gInRlcnRpYXJ5X2VtYWlsIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIGFuIG9wdGlvbmFsIHRoaXJkIGNvbnRhY3QgZW1haWwgdHlwZS4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IEVpdGhlciBhbiBpbnRlZ2VyIHZhbHVlIGZyb20KKyAgICAgICAgICAgICAqIHtAbGluayBhbmRyb2lkLnByb3ZpZGVyLkNvbnRhY3RzLkNvbnRhY3RNZXRob2RzQ29sdW1ucyBDb250YWN0TWV0aG9kc0NvbHVtbnN9CisgICAgICAgICAgICAgKiAgb3IgYSBzdHJpbmcgc3BlY2lmeWluZyBhIGN1c3RvbSBsYWJlbC48L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRFUlRJQVJZX0VNQUlMX1RZUEUgPSAidGVydGlhcnlfZW1haWxfdHlwZSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBwb3N0YWwgYWRkcmVzcy4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IFN0cmluZzwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUE9TVEFMID0gInBvc3RhbCI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciB0aGUgY29udGFjdCBwb3N0YWwgYWRkcmVzcyB0eXBlLgorICAgICAgICAgICAgICogPFA+VHlwZTogRWl0aGVyIGFuIGludGVnZXIgdmFsdWUgZnJvbQorICAgICAgICAgICAgICoge0BsaW5rIGFuZHJvaWQucHJvdmlkZXIuQ29udGFjdHMuQ29udGFjdE1ldGhvZHNDb2x1bW5zIENvbnRhY3RNZXRob2RzQ29sdW1uc30KKyAgICAgICAgICAgICAqICBvciBhIHN0cmluZyBzcGVjaWZ5aW5nIGEgY3VzdG9tIGxhYmVsLjwvUD4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUE9TVEFMX1RZUEUgPSAicG9zdGFsX3R5cGUiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIHBvc3RhbCBpc3ByaW1hcnkgZmxhZy4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IGJvb2xlYW48L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBPU1RBTF9JU1BSSU1BUlkgPSAicG9zdGFsX2lzcHJpbWFyeSI7CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhlIGV4dHJhIGZpZWxkIGZvciBhbiBJTSBoYW5kbGUuCisgICAgICAgICAgICAgKiA8UD5UeXBlOiBTdHJpbmc8L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNX0hBTkRMRSA9ICJpbV9oYW5kbGUiOworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoZSBleHRyYSBmaWVsZCBmb3IgdGhlIElNIHByb3RvY29sCisgICAgICAgICAgICAgKiA8UD5UeXBlOiB0aGUgcmVzdWx0IG9mIHtAbGluayBDb21tb25EYXRhS2luZHMuSW0jZW5jb2RlUHJlZGVmaW5lZEltUHJvdG9jb2woaW50KX0KKyAgICAgICAgICAgICAqIG9yIHtAbGluayBDb21tb25EYXRhS2luZHMuSW0jZW5jb2RlQ3VzdG9tSW1Qcm90b2NvbChTdHJpbmcpfS48L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNX1BST1RPQ09MID0gImltX3Byb3RvY29sIjsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGUgZXh0cmEgZmllbGQgZm9yIHRoZSBJTSBpc3ByaW1hcnkgZmxhZy4KKyAgICAgICAgICAgICAqIDxQPlR5cGU6IGJvb2xlYW48L1A+CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBzdG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VVUSE9SSVRZICsgIi9pbWFnZXMiKTsKICAgICB9Ci0gICAgIAorCiAgICAgcHVibGljIGludGVyZmFjZSBBdWRpbyBleHRlbmRzIENvbHVtbnMgewotICAgICAKKwogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS5wYXJzZSgiY29udGVudDovLyIgKyBBVVRIT1JJVFkgKyAiL2F1ZGlvIik7CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogVXRpbGl0eSBmdW5jdGlvbiBmb3IgaW5zZXJ0aW5nIGEgZmlsZSBpbnRvIHRoZSBEUk0gY29udGVudCBwcm92aWRlci4KLSAgICAgKiAKKyAgICAgKgogICAgICAqIEBwYXJhbSBjciBUaGUgY29udGVudCByZXNvbHZlciB0byB1c2UKICAgICAgKiBAcGFyYW0gZmlsZSBUaGUgZmlsZSB0byBpbnNlcnQKICAgICAgKiBAcGFyYW0gdGl0bGUgVGhlIHRpdGxlIGZvciB0aGUgY29udGVudCAob3IgbnVsbCkKQEAgLTEwMSwxMiArMTAxLDQ2IEBACiAgICAgICovCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBJbnRlbnQgYWRkRHJtRmlsZShDb250ZW50UmVzb2x2ZXIgY3IsIEZpbGUgZmlsZSwgU3RyaW5nIHRpdGxlKSB7CiAgICAgICAgIEZpbGVJbnB1dFN0cmVhbSBmaXMgPSBudWxsOwotICAgICAgICBPdXRwdXRTdHJlYW0gb3MgPSBudWxsOwogICAgICAgICBJbnRlbnQgcmVzdWx0ID0gbnVsbDsKIAogICAgICAgICB0cnkgewogICAgICAgICAgICAgZmlzID0gbmV3IEZpbGVJbnB1dFN0cmVhbShmaWxlKTsKLSAgICAgICAgICAgIERybVJhd0NvbnRlbnQgY29udGVudCA9IG5ldyBEcm1SYXdDb250ZW50KGZpcywgKGludCkgZmlsZS5sZW5ndGgoKSwKKyAgICAgICAgICAgIGlmICh0aXRsZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGl0bGUgPSBmaWxlLmdldE5hbWUoKTsKKyAgICAgICAgICAgICAgICBpbnQgbGFzdERvdCA9IHRpdGxlLmxhc3RJbmRleE9mKCcuJyk7CisgICAgICAgICAgICAgICAgaWYgKGxhc3REb3QgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUuc3Vic3RyaW5nKDAsIGxhc3REb3QpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJlc3VsdCA9IGFkZERybUZpbGUoY3IsIGZpcywgdGl0bGUpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAicHVzaGluZyBmaWxlIGZhaWxlZCIsIGUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAoZmlzICE9IG51bGwpCisgICAgICAgICAgICAgICAgICAgIGZpcy5jbG9zZSgpOworICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklPRXhjZXB0aW9uIGluIERybVN0b3JlLmFkZERybUZpbGUoKSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBVdGlsaXR5IGZ1bmN0aW9uIGZvciBpbnNlcnRpbmcgYSBmaWxlIHN0cmVhbSBpbnRvIHRoZSBEUk0gY29udGVudCBwcm92aWRlci4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjciBUaGUgY29udGVudCByZXNvbHZlciB0byB1c2UKKyAgICAgKiBAcGFyYW0gZmlsZVN0cmVhbSBUaGUgRmlsZUlucHV0U3RyZWFtIHRvIGluc2VydAorICAgICAqIEBwYXJhbSB0aXRsZSBUaGUgdGl0bGUgZm9yIHRoZSBjb250ZW50IChvciBudWxsKQorICAgICAqIEByZXR1cm4gdXJpIHRvIHRoZSBEUk0gcmVjb3JkIG9yIG51bGwKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIEludGVudCBhZGREcm1GaWxlKENvbnRlbnRSZXNvbHZlciBjciwgRmlsZUlucHV0U3RyZWFtIGZpcywgU3RyaW5nIHRpdGxlKSB7CisgICAgICAgIE91dHB1dFN0cmVhbSBvcyA9IG51bGw7CisgICAgICAgIEludGVudCByZXN1bHQgPSBudWxsOworCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBEcm1SYXdDb250ZW50IGNvbnRlbnQgPSBuZXcgRHJtUmF3Q29udGVudChmaXMsIChpbnQpIGZpcy5hdmFpbGFibGUoKSwKICAgICAgICAgICAgICAgICAgICAgRHJtUmF3Q29udGVudC5EUk1fTUlNRVRZUEVfTUVTU0FHRV9TVFJJTkcpOwogICAgICAgICAgICAgU3RyaW5nIG1pbWVUeXBlID0gY29udGVudC5nZXRDb250ZW50VHlwZSgpOwogCkBAIC0xMjYsMTQgKzE2MCw2IEBACiAKICAgICAgICAgICAgIGlmIChjb250ZW50VXJpICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKDMpOwotICAgICAgICAgICAgICAgIC8vIGNvbXB1dGUgdGl0bGUgZnJvbSBmaWxlIG5hbWUsIGlmIGl0IGlzIG5vdCBzcGVjaWZpZWQKLSAgICAgICAgICAgICAgICBpZiAodGl0bGUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGZpbGUuZ2V0TmFtZSgpOwotICAgICAgICAgICAgICAgICAgICBpbnQgbGFzdERvdCA9IHRpdGxlLmxhc3RJbmRleE9mKCcuJyk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChsYXN0RG90ID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5zdWJzdHJpbmcoMCwgbGFzdERvdCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChEcm1TdG9yZS5Db2x1bW5zLlRJVExFLCB0aXRsZSk7CiAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChEcm1TdG9yZS5Db2x1bW5zLlNJWkUsIHNpemUpOwogICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoRHJtU3RvcmUuQ29sdW1ucy5NSU1FX1RZUEUsIG1pbWVUeXBlKTsKQEAgLTE2Miw3ICsxODgsNyBAQAogICAgICAgICAgICAgICAgIGlmIChvcyAhPSBudWxsKQogICAgICAgICAgICAgICAgICAgICBvcy5jbG9zZSgpOwogICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklPRXhjZXB0aW9uIGluIERybVRlc3Qub25DcmVhdGUoKSIsIGUpOworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklPRXhjZXB0aW9uIGluIERybVN0b3JlLmFkZERybUZpbGUoKSIsIGUpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTE3Miw3ICsxOTgsNyBAQAogICAgIC8qKgogICAgICAqIFV0aWxpdHkgZnVuY3Rpb24gdG8gZW5mb3JjZSBhbnkgcGVybWlzc2lvbnMgcmVxdWlyZWQgdG8gYWNjZXNzIERSTQogICAgICAqIGNvbnRlbnQuCi0gICAgICogCisgICAgICoKICAgICAgKiBAcGFyYW0gY29udGV4dCBBIGNvbnRleHQgdXNlZCBmb3IgY2hlY2tpbmcgY2FsbGluZyBwZXJtaXNzaW9uLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBlbmZvcmNlQWNjZXNzRHJtUGVybWlzc2lvbihDb250ZXh0IGNvbnRleHQpIHsKQEAgLTE4MSw1ICsyMDcsNSBAQAogICAgICAgICAgIC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gICAgICogQGRlcHJlY2F0ZWQKKyAgICAgICAgICogQGRlcHJlY2F0ZWQgVXNlIHtAbGluayAjZ2V0TGFiZWxJZH0gaW5zdGVhZC4KICAgICAgICAgICovCisgICAgICAgIEBEZXByZWNhdGVkCiAgICAgICAgIHB1YmxpYyBpbnQgZ2V0TnVtQ29udmVyc2F0aW9ucyhTdHJpbmcgbGFiZWwpIHsKICAgICAgICAgICAgIHJldHVybiBnZXROdW1Db252ZXJzYXRpb25zKGdldExhYmVsSWQobGFiZWwpKTsKICAgICAgICAgfQpAQCAtMTUzNCw4ICsxNTM1LDkgQEAKIAogICAgICAgICAvKioKICAgICAgICAgICogUmV0dXJucyB0aGUgbnVtYmVyIG9mIHVucmVhZCBjb252ZXJzYXRpb24gd2l0aCBhIGdpdmVuIGxhYmVsLgotICAgICAgICAgKiBAZGVwcmVjYXRlZAorICAgICAgICAgKiBAZGVwcmVjYXRlZCBVc2Uge0BsaW5rICNnZXRMYWJlbElkfSBpbnN0ZWFkLgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIGludCBnZXROdW1VbnJlYWRDb252ZXJzYXRpb25zKFN0cmluZyBsYWJlbCkgewogICAgICAgICAgICAgcmV0dXJuIGdldE51bVVucmVhZENvbnZlcnNhdGlvbnMoZ2V0TGFiZWxJZChsYWJlbCkpOwogICAgICAgICB9CkBAIC0xNTQ2LDExICsxNTQ4LDEyIEBACiAgICAgICAgICAgICAgICAgICAgIGdldExhYmVsSWRWYWx1ZXMobGFiZWxJZCkuZ2V0QXNJbnRlZ2VyKExhYmVsQ29sdW1ucy5OVU1fVU5SRUFEX0NPTlZFUlNBVElPTlMpOwogICAgICAgICAgICAgLy8gVGhlcmUgc2VlbXMgdG8gYmUgYSByYWNlIGNvbmRpdGlvbiBoZXJlIHRoYXQgY2FuIGdldCB0aGUgbGFiZWwgbWFwcyBpbnRvIGEgYmFkCiAgICAgICAgICAgICAvLyBzdGF0ZSBhbmQgbG9zZSBzdGF0ZSBvbiBhIHBhcnRpY3VsYXIgbGFiZWwuCi0gICAgICAgICAgICBpZiAodW5yZWFkQ29udmVyc2F0aW9ucyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiB1bnJlYWRDb252ZXJzYXRpb25zOworICAgICAgICAgICAgaW50IHJlc3VsdCA9IDA7CisgICAgICAgICAgICBpZiAodW5yZWFkQ29udmVyc2F0aW9ucyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gdW5yZWFkQ29udmVyc2F0aW9ucyA8IDAgPyAwIDogdW5yZWFkQ29udmVyc2F0aW9uczsKICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgpAQCAtMjA0MCw4ICsyMDQzLDkgQEAKICAgICAgICAgfQogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBAZGVwcmVjYXRlZAorICAgICAgICAgKiBAZGVwcmVjYXRlZCBBbHdheXMgcmV0dXJucyB0cnVlLgogICAgICAgICAgKi8KKyAgICAgICAgQERlcHJlY2F0ZWQKICAgICAgICAgcHVibGljIGJvb2xlYW4gZ2V0RXhwYW5kZWQoKSB7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcHJvdmlkZXIvSW0uamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3Byb3ZpZGVyL0ltLmphdmEKaW5kZXggMTlhZDE1OC4uZjEyNmM0ZCAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvcHJvdmlkZXIvSW0uamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9wcm92aWRlci9JbS5qYXZhCkBAIC0xMzgsNiArMTM4LDcgQEAKICAg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aW5nIFBBQ0tFVF9JRCA9ICJwYWNrZXRfaWQiOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIENvbHVtbnMgZnJvbSB0aGUgTWVzc2FnZXMgdGFibGUuCi0gICAgICovCi0gICAgcHVibGljIGludGVyZmFjZSBNZXNzYWdlc0NvbHVtbnMgZXh0ZW5kcyBCYXNlTWVzc2FnZUNvbHVtbnN7Ci0gICAgICAgIC8qKgotICAgICAgICAgKiBUaGUgcHJvdmlkZXIgaWQKLSAgICAgICAgICogPFA+IFR5cGU6IElOVEVHRVIgPC9QPgotICAgICAgICAgKi8KLSAgICAgICAgU3RyaW5nIFBST1ZJREVSID0gInByb3ZpZGVyIjsKIAogICAgICAgICAvKioKLSAgICAgICAgICogVGhlIGFjY291bnQgaWQKLSAgICAgICAgICogPFA+IFR5cGU6IElOVEVHRVIgPC9QPgorICAgICAgICAgKiBJcyBncm91cGNoYXQgbWVzc2FnZSBvciBub3QKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KICAgICAgICAgICovCi0gICAgICAgIFN0cmluZyBBQ0NPVU5UID0gImFjY291bnQiOworICAgICAgICBTdHJpbmcgSVNfR1JPVVBfQ0hBVCA9ICJpc19tdWMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIGhpbnQgdGhhdCB0aGUgVUkgc2hvdWxkIHNob3cgdGhlIHNlbnQgdGltZSBvZiB0aGlzIG1lc3NhZ2UKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIFN0cmluZyBESVNQTEFZX1NFTlRfVElNRSA9ICJzaG93X3RzIjsKICAgICB9CiAKICAgICAvKioKICAgICAgKiBUaGlzIHRhYmxlIGNvbnRhaW5zIG1lc3NhZ2VzLgogICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgY2xhc3MgTWVzc2FnZXMgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgTWVzc2FnZXNDb2x1bW5zIHsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIE1lc3NhZ2VzIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIE1lc3NhZ2VDb2x1bW5zIHsKICAgICAgICAgLyoqCiAgICAgICAgICAqIG5vIHB1YmxpYyBjb25zdHJ1Y3RvciBzaW5jZSB0aGlzIGlzIGEgdXRpbGl0eSBjbGFzcwogICAgICAgICAgKi8KICAgICAgICAgcHJpdmF0ZSBNZXNzYWdlcygpIHt9CiAKICAgICAgICAgLyoqCi0gICAgICAgICAqIEdldHMgdGhlIFVyaSB0byBxdWVyeSBtZXNzYWdlcyBieSBjb250YWN0LgorICAgICAgICAgKiBHZXRzIHRoZSBVcmkgdG8gcXVlcnkgbWVzc2FnZXMgYnkgdGhyZWFkIGlkLgogICAgICAgICAgKgotICAgICAgICAgKiBAcGFyYW0gcHJvdmlkZXJJZCB0aGUgcHJvdmlkZXIgaWQgb2YgdGhlIGNvbnRhY3QuCisgICAgICAgICAqIEBwYXJhbSB0aHJlYWRJZCB0aGUgdGhyZWFkIGlkIG9mIHRoZSBtZXNzYWdlLgorICAgICAgICAgKiBAcmV0dXJuIHRoZSBVcmkKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIGdldENvbnRlbnRVcmlCeVRocmVhZElkKGxvbmcgdGhyZWFkSWQpIHsKKyAgICAgICAgICAgIFVyaS5CdWlsZGVyIGJ1aWxkZXIgPSBDT05URU5UX1VSSV9NRVNTQUdFU19CWV9USFJFQURfSUQuYnVpbGRVcG9uKCk7CisgICAgICAgICAgICBDb250ZW50VXJpcy5hcHBlbmRJZChidWlsZGVyLCB0aHJlYWRJZCk7CisgICAgICAgICAgICByZXR1cm4gYnVpbGRlci5idWlsZCgpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBkZXByZWNhdGVkCisgICAgICAgICAqCisgICAgICAgICAqIEdldHMgdGhlIFVyaSB0byBxdWVyeSBtZXNzYWdlcyBieSBhY2NvdW50IGFuZCBjb250YWN0LgorICAgICAgICAgKgogICAgICAgICAgKiBAcGFyYW0gYWNjb3VudElkIHRoZSBhY2NvdW50IGlkIG9mIHRoZSBjb250YWN0LgogICAgICAgICAgKiBAcGFyYW0gdXNlcm5hbWUgdGhlIHVzZXIgbmFtZSBvZiB0aGUgY29udGFjdC4KICAgICAgICAgICogQHJldHVybiB0aGUgVXJpCiAgICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBnZXRDb250ZW50VXJpQnlDb250YWN0KGxvbmcgcHJvdmlkZXJJZCwKLSAgICAgICAgICAgICAgICBsb25nIGFjY291bnRJZCwgU3RyaW5nIHVzZXJuYW1lKSB7Ci0gICAgICAgICAgICBVcmkuQnVpbGRlciBidWlsZGVyID0gQ09OVEVOVF9VUklfTUVTU0FHRVNfQlkuYnVpbGRVcG9uKCk7Ci0gICAgICAgICAgICBDb250ZW50VXJpcy5hcHBlbmRJZChidWlsZGVyLCBwcm92aWRlcklkKTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgZ2V0Q29udGVudFVyaUJ5Q29udGFjdChsb25nIGFjY291bnRJZCwgU3RyaW5nIHVzZXJuYW1lKSB7CisgICAgICAgICAgICBVcmkuQnVpbGRlciBidWlsZGVyID0gQ09OVEVOVF9VUklfTUVTU0FHRVNfQllfQUNDT1VOVF9BTkRfQ09OVEFDVC5idWlsZFVwb24oKTsKICAgICAgICAgICAgIENvbnRlbnRVcmlzLmFwcGVuZElkKGJ1aWxkZXIsIGFjY291bnRJZCk7CiAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZFBhdGgodXNlcm5hbWUpOwogICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIuYnVpbGQoKTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBHZXRzIHRoZSBVcmkgdG8gcXVlcnkgbWVzc2FnZXMgYnkgcHJvdmlkZXIuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBwcm92aWRlcklkIHRoZSBzZXJ2aWNlIHByb3ZpZGVyIGlkLgorICAgICAgICAgKiBAcmV0dXJuIHRoZSBVcmkKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIGdldENvbnRlbnRVcmlCeVByb3ZpZGVyKGxvbmcgcHJvdmlkZXJJZCkgeworICAgICAgICAgICAgVXJpLkJ1aWxkZXIgYnVpbGRlciA9IENPTlRFTlRfVVJJX01FU1NBR0VTX0JZX1BST1ZJREVSLmJ1aWxkVXBvbigpOworICAgICAgICAgICAgQ29udGVudFVyaXMuYXBwZW5kSWQoYnVpbGRlciwgcHJvdmlkZXJJZCk7CisgICAgICAgICAgICByZXR1cm4gYnVpbGRlci5idWlsZCgpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEdldHMgdGhlIFVyaSB0byBxdWVyeSBvZmYgdGhlIHJlY29yZCBtZXNzYWdlcyBieSBhY2NvdW50LgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gYWNjb3VudElkIHRoZSBhY2NvdW50IGlkLgorICAgICAgICAgKiBAcmV0dXJuIHRoZSBVcmkKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIGdldENvbnRlbnRVcmlCeUFjY291bnQobG9uZyBhY2NvdW50SWQpIHsKKyAgICAgICAgICAgIFVyaS5CdWlsZGVyIGJ1aWxkZXIgPSBDT05URU5UX1VSSV9CWV9BQ0NPVU5ULmJ1aWxkVXBvbigpOworICAgICAgICAgICAgQ29udGVudFVyaXMuYXBwZW5kSWQoYnVpbGRlciwgYWNjb3VudElkKTsKKyAgICAgICAgICAgIHJldHVybiBidWlsZGVyLmJ1aWxkKCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogR2V0cyB0aGUgVXJpIHRvIHF1ZXJ5IG9mZiB0aGUgcmVjb3JkIG1lc3NhZ2VzIGJ5IHRocmVhZCBpZC4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHRocmVhZElkIHRoZSB0aHJlYWQgaWQgb2YgdGhlIG1lc3NhZ2UuCisgICAgICAgICAqIEByZXR1cm4gdGhlIFVyaQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgZ2V0T3RyTWVzc2FnZXNDb250ZW50VXJpQnlUaHJlYWRJZChsb25nIHRocmVhZElkKSB7CisgICAgICAgICAgICBVcmkuQnVpbGRlciBidWlsZGVyID0gT1RSX01FU1NBR0VTX0NPTlRFTlRfVVJJX0JZX1RIUkVBRF9JRC5idWlsZFVwb24oKTsKKyAgICAgICAgICAgIENvbnRlbnRVcmlzLmFwcGVuZElkKGJ1aWxkZXIsIHRocmVhZElkKTsKKyAgICAgICAgICAgIHJldHVybiBidWlsZGVyLmJ1aWxkKCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQGRlcHJlY2F0ZWQKKyAgICAgICAgICoKKyAgICAgICAgICogR2V0cyB0aGUgVXJpIHRvIHF1ZXJ5IG9mZiB0aGUgcmVjb3JkIG1lc3NhZ2VzIGJ5IGFjY291bnQgYW5kIGNvbnRhY3QuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhY2NvdW50SWQgdGhlIGFjY291bnQgaWQgb2YgdGhlIGNvbnRhY3QuCisgICAgICAgICAqIEBwYXJhbSB1c2VybmFtZSB0aGUgdXNlciBuYW1lIG9mIHRoZSBjb250YWN0LgorICAgICAgICAgKiBAcmV0dXJuIHRoZSBVcmkKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIGdldE90ck1lc3NhZ2VzQ29udGVudFVyaUJ5Q29udGFjdChsb25nIGFjY291bnRJZCwgU3RyaW5nIHVzZXJuYW1lKSB7CisgICAgICAgICAgICBVcmkuQnVpbGRlciBidWlsZGVyID0gT1RSX01FU1NBR0VTX0NPTlRFTlRfVVJJX0JZX0FDQ09VTlRfQU5EX0NPTlRBQ1QuYnVpbGRVcG9uKCk7CisgICAgICAgICAgICBDb250ZW50VXJpcy5hcHBlbmRJZChidWlsZGVyLCBhY2NvdW50SWQpOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmRQYXRoKHVzZXJuYW1lKTsKKyAgICAgICAgICAgIHJldHVybiBidWlsZGVyLmJ1aWxkKCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogR2V0cyB0aGUgVXJpIHRvIHF1ZXJ5IG9mZiB0aGUgcmVjb3JkIG1lc3NhZ2VzIGJ5IHByb3ZpZGVyLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gcHJvdmlkZXJJZCB0aGUgc2VydmljZSBwcm92aWRlciBpZC4KKyAgICAgICAgICogQHJldHVybiB0aGUgVXJpCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBnZXRPdHJNZXNzYWdlc0NvbnRlbnRVcmlCeVByb3ZpZGVyKGxvbmcgcHJvdmlkZXJJZCkgeworICAgICAgICAgICAgVXJpLkJ1aWxkZXIgYnVpbGRlciA9IE9UUl9NRVNTQUdFU19DT05URU5UX1VSSV9CWV9QUk9WSURFUi5idWlsZFVwb24oKTsKKyAgICAgICAgICAgIENvbnRlbnRVcmlzLmFwcGVuZElkKGJ1aWxkZXIsIHByb3ZpZGVySWQpOworICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIuYnVpbGQoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBHZXRzIHRoZSBVcmkgdG8gcXVlcnkgb2ZmIHRoZSByZWNvcmQgbWVzc2FnZXMgYnkgYWNjb3VudC4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGFjY291bnRJZCB0aGUgYWNjb3VudCBpZC4KKyAgICAgICAgICogQHJldHVybiB0aGUgVXJ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X0JZX1RIUkVBRF9JRCA9CisgICAgICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vaW0vbWVzc2FnZXNCeVRocmVhZElkIik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgbWVzc2FnZXMgYnkgYWNjb3VudCBhbmQgY29udGFjdAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUklfTUVTU0FHRVNfQllfQUNDT1VOVF9BTkRfQ09OVEFDVCA9CisgICAgICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vaW0vbWVzc2FnZXNCeUFjY3RBbmRDb250YWN0Iik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3IgbWVzc2FnZXMgYnkgcHJvdmlkZXIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIENPTlRFTlRfVVJJX01FU1NBR0VTX0JZX1BST1ZJREVSID0KKyAgICAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9pbS9tZXNzYWdlc0J5UHJvdmlkZXIiKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJMIGZvciBtZXNzYWdlcyBieSBhY2NvdW50CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSV9CWV9BQ0NPVU5UID0KKyAgICAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9pbS9tZXNzYWdlc0J5QWNjb3VudCIpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSB1cmwgZm9yIG9mZiB0aGUgcmVjb3JkIG1lc3NhZ2VzCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBPVFJfTUVTU0FHRVNfQ09OVEVOVF9VUkkgPQorICAgICAgICAgICAgICAgIFVyaS5wYXJzZSgiY29udGVudDovL2ltL290ck1lc3NhZ2VzIik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIHVybCBmb3Igb2ZmIHRoZSByZWNvcmQgbWVzc2FnZXMgYnkgdGhyZWFkIGlkCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBPVFJfTUVTU0FHRVNfQ09OVEVOVF9VUklfQllfVEhSRUFEX0lEID0KKyAgICAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9pbS9vdHJNZXNzYWdlc0J5VGhyZWFkSWQiKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgdXJsIGZvciBvZmYgdGhlIHJlY29yZCBtZXNzYWdlcyBieSBhY2NvdW50IGFuZCBjb250YWN0CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBPVFJfTUVTU0FHRVNfQ09OVEVOVF9VUklfQllfQUNDT1VOVF9BTkRfQ09OVEFDVCA9CisgICAgICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8vaW0vb3RyTWVzc2FnZXNCeUFjY3RBbmRDb250YWN0Iik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb250ZW50Oi8vIHN0eWxlIFVSTCBmb3Igb2ZmIHRoZSByZWNvcmQgbWVzc2FnZXMgYnkgcHJvdmlkZXIKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVXJpIE9UUl9NRVNTQUdFU19DT05URU5UX1VSSV9CWV9QUk9WSURFUiA9CisgICAgICAgICAgICAgICAgVXJpLnBhcnNlKCJjb250ZW50Oi8va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AgICAgICAgICogZ3JvdXAgbWVzc2FnZXMuCi0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1RZUEUgPSAidm5kLmFuZHJvaWQuY3Vyc29yLmRpci9pbS1ncm91cE1lc3NhZ2VzIjsKLQotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIE1JTUUgdHlwZSBvZiBhIHtAbGluayAjQ09OVEVOVF9VUkl9IHN1YmRpcmVjdG9yeSBvZiBhIHNpbmdsZQotICAgICAgICAgKiBncm91cCBtZXNzYWdlLgotICAgICAgICAgKi8KLSAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9JVEVNX1RZUEUgPQotICAgICAgICAgICAgICAgICJ2bmQuYW5kcm9pZC5jdXJzb3IuaXRlbS9pbS1ncm91cE1lc3NhZ2VzIjsKLQotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIGRlZmF1bHQgc29ydCBvcmRlciBmb3IgdGhpcyB0YWJsZQotICAgICAgICAgKi8KLSAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgREVGQVVMVF9TT1JUX09SREVSID0gImRhdGUgQVNDIjsKLSAgICB9Ci0KLSAgICAvKioKICAgICAgKiBDb2x1bW5zIGZyb20gdGhlIEF2YXRhcnMgdGFibGUKICAgICAgKi8KICAgICBwdWJsaWMgaW50ZXJmYWNlIEF2YXRhcnNDb2x1bW5zIHsKQEAgLTEzODQsNyArMTQ2OCw3IEBACiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CiAgICAgICAgICAqLwogICAgICAgICBTdHJpbmcgVU5TRU5UX0NPTVBPU0VEX01FU1NBR0UgPSAidW5zZW50X2NvbXBvc2VkX21lc3NhZ2UiOwotICAgICAgICAKKwogICAgICAgICAvKioKICAgICAgICAgICogQSB2YWx1ZSBmcm9tIDAtOSBpbmRpY2F0aW5nIHdoaWNoIHF1aWNrLXN3aX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sYXN0IHJlY2VpdmVkIGZyb20gdGhlIHNlcnZlci4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzZXRIZWFydGJlYXRJbnRlcnZhbChDb250ZW50UmVzb2x2ZXIgY29udGVudFJlc29sdmVyLAorICAgICAgICAgICAgICAgIGxvbmcgcHJvdmlkZXJJZCwgbG9uZyBpbnRlcnZhbCkgeworICAgICAgICAgICAgcHV0TG9uZ1ZhbHVlKGNvbnRlbnRSZXNvbHZlciwgcHJvdmlkZXJJZCwgU0VUVElOR19IRUFSVEJFQVRfSU5URVJWQUwsIGludGVydmFsKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIGNvbnZlbmllbmNlIG1ldGhvZCB0byBzZXQgdGhlIGppZCByZXNvdXJjZS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzZXRKaWRSZXNvdXJjZShDb250ZW50UmVzb2x2ZXIgY29udGVudFJlc29sdmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBwcm92aWRlcklkLCBTdHJpbmcgamlkUmVzb3VyY2UpIHsKKyAgICAgICAgICAgIHB1dFN0cmluZ1ZhbHVlKGNvbnRlbnRSZXNvbHZlciwgcHJvdmlkZXJJZCwgU0VUVElOR19KSURfUkVTT1VSQ0UsIGppZFJlc291cmNlKTsKKyAgICAgICAgfQorCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgUXVlcnlNYXAgZXh0ZW5kcyBDb250ZW50UXVlcnlNYXAgewogICAgICAgICAgICAgcHJpdmF0ZSBDb250ZW50UmVzb2x2ZXIgbUNvbnRlbnRSZXNvbHZlcjsKICAgICAgICAgICAgIHByaXZhdGUgbG9uZyBtUHJvdmlkZXJJZDsKQEAgLTE4NzIsNiArMjAwOSw3OSBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFNldCB3aGV0aGVyIG9yIG5vdCB0byBzaG93IGFzIGF3YXkgd2hlbiBkZXZpY2UgaXMgaWRsZS4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiBAcGFyYW0gc2hvd0F3YXkgd2hldGhlciBvciBub3QgdG8gc2hvdyBhcyBhd2F5IHdoZW4gZGV2aWNlIGlzIGlkbGUuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHNldFNob3dBd2F5T25JZGxlKGJvb2xlYW4gc2hvd0F3YXkpIHsKKyAgICAgICAgICAgICAgICBQcm92aWRlclNldHRpbmdzLnNldFNob3dBd2F5T25JZGxlKG1Db250ZW50UmVzb2x2ZXIsIG1Qcm92aWRlcklkLCBzaG93QXdheSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogR2V0IHdoZXRoZXIgb3Igbm90IHRvIHNob3cgYXMgYXdheSB3aGVuIGRldmljZSBpcyBpZGxlLgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEByZXR1cm4gV2hldGhlciBvciBub3QgdG8gc2hvdyBhcyBhd2F5IHdoZW4gZGV2aWNlIGlzIGlkbGUuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGdldFNob3dBd2F5T25JZGxlKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBnZXRCb29sZWFuKFNFVFRJTkdfU0hPV19BV0FZX09OX0lETEUsCisgICAgICAgICAgICAgICAgICAgICAgICB0cnVlIC8qIGJ5IGRlZmF1bHQgc2hvdyBhcyBhd2F5IG9uIGlkbGUqLyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogU2V0IHdoZXRoZXIgb3Igbm90IHRvIHVwbG9hZCBoZWFydGJlYXQgc3RhdC4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiBAcGFyYW0gdXBsb2FkU3RhdCB3aGV0aGVyIG9yIG5vdCB0byB1cGxvYWQgaGVhcnRiZWF0IHN0YXQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHNldFVwbG9hZEhlYXJ0YmVhdFN0YXQoYm9vbGVhbiB1cGxvYWRTdGF0KSB7CisgICAgICAgICAgICAgICAgUHJvdmlkZXJTZXR0aW5ncy5zZXRVcGxvYWRIZWFydGJlYXRTdGF0KG1Db250ZW50UmVzb2x2ZXIsIG1Qcm92aWRlcklkLCB1cGxvYWRTdGF0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBHZXQgd2hldGhlciBvciBub3QgdG8gdXBsb2FkIGhlYXJ0YmVhdCBzdGF0LgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEByZXR1cm4gV2hldGhlciBvciBub3QgdG8gdXBsb2FkIGhlYXJ0YmVhdCBzdGF0LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBnZXRVcGxvYWRIZWFydGJlYXRTdGF0KCkgeworICAgICAgICAgICAgICAgIHJldHVybiBnZXRCb29sZWFuKFNFVFRJTkdfVVBMT0FEX0hFQVJUQkVBVF9TVEFULAorICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UgLyogYnkgZGVmYXVsdCBkbyBub3QgdXBsb2FkICovKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBTZXQgdGhlIGxhc3QgcmVjZWl2ZWQgaGVhcnRiZWF0IGludGVydmFsIGZyb20gdGhlIHNlcnZlci4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiBAcGFyYW0gaW50ZXJ2YWwgdGhlIGxhc3QgcmVjZWl2ZWQgaGVhcnRiZWF0IGludGVydmFsIGZyb20gdGhlIHNlcnZlci4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHZvaWQgc2V0SGVhcnRiZWF0SW50ZXJ2YWwobG9uZyBpbnRlcnZhbCkgeworICAgICAgICAgICAgICAgIFByb3ZpZGVyU2V0dGluZ3Muc2V0SGVhcnRiZWF0SW50ZXJ2YWwobUNvbnRlbnRSZXNvbHZlciwgbVByb3ZpZGVySWQsIGludGVydmFsKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBHZXQgdGhlIGxhc3QgcmVjZWl2ZWQgaGVhcnRiZWF0IGludGVydmFsIGZyb20gdGhlIHNlcnZlci4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiBAcmV0dXJuIHRoZSBsYXN0IHJlY2VpdmVkIGhlYXJ0YmVhdCBpbnRlcnZhbCBmcm9tIHRoZSBzZXJ2ZXIuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBsb25nIGdldEhlYXJ0YmVhdEludGVydmFsKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBnZXRMb25nKFNFVFRJTkdfSEVBUlRCRUFUX0lOVEVSVkFMLCAwTCAvKiBhbiBpbnZhbGlkIGRlZmF1bHQgaW50ZXJ2YWwgKi8pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFNldCB0aGUgSklEIHJlc291cmNlLgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEBwYXJhbSBqaWRSZXNvdXJjZSB0aGUgamlkIHJlc291cmNlIHRvIGJlIHN0b3JlZC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgcHVibGljIHZvaWQgc2V0SmlkUmVzb3VyY2UoU3RyaW5nIGppZFJlc291cmNlKSB7CisgICAgICAgICAgICAgICAgUHJvdmlkZXJTZXR0aW5ncy5zZXRKaWRSZXNvdXJjZShtQ29udGVudFJlc29sdmVyLCBtUHJvdmlkZXJJZCwgamlkUmVzb3VyY2UpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBHZXQgdGhlIEpJRCByZXNvdXJjZSB1c2VkIGZvciB0aGUgR29vZ2xlIFRhbGsgY29ubmVjdGlvbgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqIEByZXR1cm4gdGhlIEpJRCByZXNvdXJjZSBzdG9yZWQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0SmlkUmVzb3VyY2UoKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGdldFN0cmluZyhTRVRUSU5HX0pJRF9SRVNPVVJDRSwgbnVsbCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogQ29udmVuaWVuY2UgZnVuY3Rpb24gZm9yIHJldHJpZXZpbmcgYSBzaW5nbGUgc2V0dGluZ3MgdmFsdWUKICAgICAgICAgICAgICAqIGFzIGEgYm9vbGVhbi4KICAgICAgICAgICAgICAqCkBAIC0xOTA5LDIxICsyMTE5LDc3IEBACiAgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSBnZXRWYWx1ZXMobmFtZSk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlcyAhPSBudWxsID8gdmFsdWVzLmdldEFzSW50ZWdlcihWQUxVRSkgOiBkZWY7CiAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQ29udmVuaWVuY2UgZnVuY3Rpb24gZm9yIHJldHJpZXZpbmcgYSBzaW5nbGUgc2V0dGluZ3MgdmFsdWUKKyAgICAgICAgICAgICAqIGFzIGEgTG9uZy4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiBAcGFyYW0gbmFtZSBUaGUgbmFtZSBvZiB0aGUgc2V0dGluZyB0byByZXRyaWV2ZS4KKyAgICAgICAgICAgICAqIEBwYXJhbSBkZWYgVGhlIHZhbHVlIHRvIHJldHVybiBpZiB0aGUgc2V0dGluZyBpcyBub3QgZGVmaW5lZC4KKyAgICAgICAgICAgICAqIEByZXR1cm4gVGhlIHNldHRpbmcncyBjdXJyZW50IHZhbHVlIG9yICdkZWYnIGlmIGl0IGlzIG5vdCBkZWZpbmVkLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwcml2YXRlIGxvbmcgZ2V0TG9uZyhTdHJpbmcgbmFtZSwgbG9uZyBkZWYpIHsKKyAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IGdldFZhbHVlcyhuYW1lKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWVzICE9IG51bGwgPyB2YWx1ZXMuZ2V0QXNMb25nKFZBTFVFKSA6IGRlZjsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgfQogCisKKyAgICAvKioKKyAgICAgKiBDb2x1bW5zIGZvciBJTSBicmFuZGluZyByZXNvdXJjZSBtYXAgY2FjaGUgdGFibGUuIFRoaXMgdGFibGUgY2FjaGVzIHRoZSByZXN1bHQgb2YKKyAgICAgKiBsb2FkaW5nIHRoZSBicmFuZGluZyByZXNvdXJjZXMgdG8gc3BlZWQgdXAgSU0gbGFuZGluZyBwYWdlIHN0YXJ0LgorICAgICAqLworICAgIHB1YmxpYyBpbnRlcmZhY2UgQnJhbmRpbmdSZXNvdXJjZU1hcENhY2hlQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgcHJvdmlkZXIgSUQKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIFN0cmluZyBQUk9WSURFUl9JRCA9ICJwcm92aWRlcl9pZCI7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgYXBwbGljYXRpb24gcmVzb3VyY2UgSUQKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIFN0cmluZyBBUFBfUkVTX0lEID0gImFwcF9yZXNfaWQiOworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHBsdWdpbiByZXNvdXJjZSBJRAorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgU3RyaW5nIFBMVUdJTl9SRVNfSUQgPSAicGx1Z2luX3Jlc19pZCI7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIHRhYmxlIGZvciBjYWNoaW5nIHRoZSByZXN1bHQgb2YgbG9hZGluZyBJTSBicmFuZGluZyByZXNvdXJjZXMuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBCcmFuZGluZ1Jlc291cmNlTWFwQ2FjaGUKKyAgICAgICAgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgQnJhbmRpbmdSZXNvdXJjZU1hcENhY2hlQ29sdW1ucyB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkwgZm9yIHRoaXMgdGFibGUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS5wYXJzZSgiY29udGVudDovL2ltL2JyYW5kaW5nUmVzTWFwQ2FjaGUiKTsKKyAgICB9CisKKworCisgICAgLyoqCisgICAgICogLy9UT0RPOiBtb3ZlIHRoZXNlIHRvIE1DUyBzcGVjaWZpYyBwcm92aWRlci4KKyAgICAgKiBUaGUgZm9sbG93aW5nIGFyZSBNQ1Mgc3R1ZmYsIGFuZCBzaG91bGQgcmVhbGx5IGxpdmUgaW4gYSBzZXBhcmF0ZSBwcm92aWRlciBzcGVjaWZpYyB0bworICAgICAqIE1DUyBjb2RlLgorICAgICAqLworCiAgICAgLyoqCiAgICAgICogQ29sdW1ucyBmcm9tIE91dGdvaW5nUm1xIHRhYmxlCiAgICAgICovCiAgICAgcHVibGljIGludGVyZmFjZSBPdXRnb2luZ1JtcUNvbHVtbnMgewogICAgICAgICBTdHJpbmcgUk1R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icmFuZGluZyByZXNvdXJjZXMgdG8gc3BlZWQgdXAgSU0gbGFuZGluZyBwYWdlIHN0YXJ0LgorICAgICAqIENvbHVtbnMgZm9yIHRoZSBzMmRSbXFJZHMgdGFibGUsIHdoaWNoIHN0b3JlcyB0aGUgc2VydmVyLXRvLWRldmljZSBtZXNzYWdlCisgICAgICogcGVyc2lzdGVudCBpZHMuIFRoZXNlIGFyZSB1c2VkIGluIHRoZSBSTVEyIHByb3RvY29sLCB3aGVyZSBpbiB0aGUgbG9naW4gcmVxdWVzdCwgdGhlCisgICAgICogY2xpZW50IHNlbGVjdGl2ZSBhY2tzIHRoZXNlIHMyZCBpZHMgdG8gdGhlIHNlcnZlci4KICAgICAgKi8KLSAgICBwdWJsaWMgaW50ZXJmYWNlIEJyYW5kaW5nUmVzb3VyY2VNYXBDYWNoZUNvbHVtbnMgewotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIHByb3ZpZGVyIElECi0gICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+Ci0gICAgICAgICAqLwotICAgICAgICBTdHJpbmcgUFJPVklERVJfSUQgPSAicHJvdmlkZXJfaWQiOwotICAgICAgICAvKioKLSAgICAgICAgICogVGhlIGFwcGxpY2F0aW9uIHJlc291cmNlIElECi0gICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+Ci0gICAgICAgICAqLwotICAgICAgICBTdHJpbmcgQVBQX1JFU19JRCA9ICJhcHBfcmVzX2lkIjsKLSAgICAgICAgLyoqCi0gICAgICAgICAqIFRoZSBwbHVnaW4gcmVzb3VyY2UgSUQKLSAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KLSAgICAgICAgICovCi0gICAgICAgIFN0cmluZyBQTFVHSU5fUkVTX0lEID0gInBsdWdpbl9yZXNfaWQiOworICAgIHB1YmxpYyBpbnRlcmZhY2UgU2VydmVyVG9EZXZpY2VSbXFJZHNDb2x1bW4geworICAgICAgICBTdHJpbmcgUk1RX0lEID0gInJt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ZmluYWwgU3RyaW5nIExPQ0FUSU9OX1BST1ZJREVSU19BTExPV0VEID0gImxvY2F0aW9uX3Byb3ZpZGVyc19hbGxvd2VkIjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogV2hldGhlciBhc3Npc3RlZCBHUFMgc2hvdWxkIGJlIGVuYWJsZWQgb3Igbm90LgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQVNTSVNURURfR1BTX0VOQUJMRUQgPSAiYXNzaXN0ZWRfZ3BzX2VuYWJsZWQiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgTG9nZ2luZyBJRCAoYSB1bmlxdWUgNjQtYml0IHZhbHVlKSBhcyBhIGhleCBzdHJpbmcuCiAgICAgICAgICAqIFVzZWQgYXMgYSBwc2V1ZG9ueW1vdXMgaWRlbnRpZmllciBmb3IgbG9nZ2luZy4KICAgICAgICAgICogQGRlcHJlY2F0ZWQgVGhpcyBpZGVudGlmaWVyIGlzIHBvb3JseSBpbml0aWFsaXplZCBhbmQgaGFzCkBAIC0yMjAxLDYgKzIyNDUsMzIgQEAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQkFDS0dST1VORF9EQVRBID0gImJhY2tncm91bmRfZGF0YSI7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0aW1lIGluIG1zZWMsIHdoZW4gdGhlIExBU1RfS01TRyBmaWxlIHdhcyBzZW5kIHRvIHRoZSBjaGVja2luIHNlcnZlci4KKyAgICAgICAgICogV2Ugd2lsbCBvbmx5IHNlbmQgdGhlIExBU1RfS01TRyBmaWxlIGlmIGl0IHdhcyBtb2RpZmllZCBhZnRlciB0aGlzIHRpbWUuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDSEVDS0lOX1NFTkRfTEFTVF9LTVNHX1RJTUUgPSAiY2hlY2tpbl9rbXNnX3RpbWUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdGltZSBpbiBtc2VjLCB3aGVuIHRoZSBhcGFuaWNfY29uc29sZSBmaWxlIHdhcyBzZW5kIHRvIHRoZSBjaGVja2luIHNlcnZlci4KKyAgICAgICAgICogV2Ugd2lsbCBvbmx5IHNlbmQgdGhlIGFwYW5pY19jb25zb2xlIGZpbGUgaWYgaXQgd2FzIG1vZGlmaWVkIGFmdGVyIHRoaXMgdGltZS4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENIRUNLSU5fU0VORF9BUEFOSUNfQ09OU09MRV9USU1FID0KKyAgICAgICAgICAgICJjaGVja2luX2FwYW5pY19jb25zb2xlX3RpbWUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdGltZSBpbiBtc2VjLCB3aGVuIHRoZSBhcGFuaWNfdGhyZWFkIGZpbGUgd2FzIHNlbmQgdG8gdGhlIGNoZWNraW4gc2VydmVyLgorICAgICAgICAgKiBXZSB3aWxsIG9ubHkgc2VuZCB0aGUgYXBhbmljX3RocmVhZCBmaWxlIGlmIGl0IHdhcyBtb2RpZmllZCBhZnRlciB0aGlzIHRpbWUuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDSEVDS0lOX1NFTkRfQVBBTklDX1RIUkVBRF9USU1FID0KKyAgICAgICAgICAgICJjaGVja2luX2FwYW5pY190aHJlYWRfdGltZSI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBDRE1BIHJvYW1pbmcgbW9kZSAwID0gSG9tZSBOZXR3b3JrcywgQ0RNQSBkZWZhdWx0CiAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAg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AgICAgICAgICAgICAgICJndGFsa19vbGRfY2hhdF9tc2dfdGhyZXNob2xkX2luX3NlYyI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIGEgc2V0dGluZyB0byBjb250cm9sIHRoZSBtYXggY29ubmVjdGlvbiBoaXN0b3J5IHJlY29yZCBHVGFsa1NlcnZpY2Ugc3RvcmVzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1RBTEtfTUFYX0NPTk5FQ1RJT05fSElTVE9SWV9SRUNPUkRTID0KKyAgICAgICAgICAgICAgICAiZ3RhbGtfbWF4X2Nvbm5faGlzdG9yeV9yZWNvcmRzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyBpcyBnZGF0YSB1cmwgdG8gbG9va3VwIGFsYnVtIGFuZCBwaWN0dXJlIGluZm8gZnJvbSBwaWNhc2Egd2ViLiBJdCBhbHNvIGNvbnRyb2xzCisgICAgICAgICAqIHdoZXRoZXIgdXJsIHNjcmFwaW5nIGZvciBwaWNhc2EgaXMgZW5hYmxlZCAoTlVMTCB0byBkaXNhYmxlKS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEdUQUxLX1BJQ0FTQV9BTEJVTV9VUkwgPQorICAgICAgICAgICAgICAgICJndGFsa19waWNhc2FfYWxidW1fdXJsIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyBpcyB0aGUgdXJsIHRvIGxvb2t1cCBwaWN0dXJlIGluZm8gZnJvbSBmbGlja3IuIEl0IGFsc28gY29udHJvbHMKKyAgICAgICAgICogd2hldGhlciB1cmwgc2NyYXBpbmcgZm9yIGZsaWNrciBpcyBlbmFibGVkIChOVUxMIHRvIGRpc2FibGUpLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1RBTEtfRkxJQ0tSX1BIT1RPX0lORk9fVVJMID0KKyAgICAgICAgICAgICAgICAiZ3RhbGtfZmxpY2tyX3Bob3RvX2luZm9fdXJsIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyBpcyB0aGUgdXJsIHRvIGxvb2t1cCBhbiBhY3R1YWwgcGljdHVyZSBmcm9tIGZsaWNrci4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEdUQUxLX0ZMSUNLUl9QSE9UT19VUkwgPQorICAgICAgICAgICAgICAgICJndGFsa19mbGlja3JfcGhvdG9fdXJsIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhpcyBpcyB0aGUgZ2RhdGEgdXJsIHRvIGxvb2t1cCBpbmZvIG9uIGEgeW91dHViZSB2aWRlby4gSXQgYWxzbyBjb250cm9scworICAgICAgICAgKiB3aGV0aGVyIHVybCBzY3JhcGluZyBmb3IgeW91dHViZSBpcyBlbmFibGVkIChOVUxMIHRvIGRpc2FibGUpLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1RBTEtfWU9VVFVCRV9WSURFT19VUkwgPQorICAgICAgICAgICAgICAgICJndGFsa195b3V0dWJlX3ZpZGVvX3VybCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEVuYWJsZS9kaXNhYmxlIEdUYWxrIFVSTCBzY3JhcGluZyBmb3IgSlBHIGltYWdlcyAoInRydWUiIHRvIGVuYWJsZSkuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBHVEFMS19VUkxfU0NSQVBJTkdfRk9SX0pQRyA9CisgICAgICAgICAgICAgICAgImd0YWxrX3VybF9zY3JhcGluZ19mb3JfanBnIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ2hhdCBtZXNzYWdlIGxpZmV0aW1lIChmb3IgcHJ1bmluZyBvbGQgY2hhdCBtZXNzYWdlcykuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBHVEFMS19DSEFUX01FU1NBR0VfTElGRVRJTUUgPQorICAgICAgICAgICAgICAgICJndGFsa19jaGF0X21lc3NhZ2VfbGlmZXRpbWUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBPVFIgbWVzc2FnZSBsaWZldGltZSAoZm9yIHBydW5pbmcgb2xkIG90ciBtZXNzYWdlcykuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBHVEFMS19PVFJfTUVTU0FHRV9MSUZFVElNRSA9CisgICAgICAgICAgICAgICAgImd0YWxrX290cl9tZXNzYWdlX2xpZmV0aW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ2hhdCBleHBpcmF0aW9uIHRpbWUsIGkuZS4sIHRpbWUgc2luY2UgbGFzdCBtZXNzYWdlIGluIHRoZSBjaGF0IChmb3IgcHJ1bmluZyBvbGQgY2hhdHMpLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR1RBTEtfQ0hBVF9FWFBJUkFUSU9OX1RJTUUgPQorICAgICAgICAgICAgICAgICJndGFsa19jaGF0X2V4cGlyYXRpb25fdGltZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgaXMgdGhlIHVybCBmb3IgZ2V0dGluZyB0aGUgYXBwIHRva2VuIGZvciBzZXJ2ZXItdG8tZGV2aWNlIHB1c2ggbWVzc2FnaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUFVTSF9NRVNTQUdJTkdfUkVHSVNUUkFUSU9OX1VSTCA9CisgICAgICAgICAgICAgICAgInB1c2hfbWVzc2FnaW5nX3JlZ2lzdHJhdGlvbl91cmwiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBVc2UgYW5kcm9pZDovLyZsdDtpdCZndDsgcm91dGluZyBpbmZvc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oIG9mIHRoZSBjYWxlbmRhciBzeW5jIHdpbmRvdyBpbnRvIHRoZSBmdXR1cmUuCisgICAgICAgICAqIFRoaXMgc3BlY2lmaWVzIHRoZSBudW1iZXIgb2YgZGF5cyBpbnRvIHRoZSBmdXR1cmUgZm9yIHRoZSBzbGlkaW5nIHdpbmRvdyBzeW5jLgorICAgICAgICAgKiBTZXR0aW5nIHRoaXMgdG8gemVybyB3aWxsIGRpc2FibGUgc2xpZGluZyBzeW5jLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR09PR0xFX0NBTEVOREFSX1NZTkNfV0lORE9XX0RBWVMgPQorICAgICAgICAgICAgICAgICJnb29nbGVfY2FsZW5kYXJfc3luY193aW5kb3dfZGF5cyI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEhvdyBvZnRlbiB0byB1cGRhdGUgdGhlIGNhbGVuZGFyIHN5bmMgd2luZG93LgorICAgICAgICAgKiBUaGUgd2luZG93IHdpbGwgYmUgYWR2YW5jZWQgZXZlcnkgbiBkYXlzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgR09PR0xFX0NBTEVOREFSX1NZTkNfV0lORE9XX1VQREFURV9EQVlTID0KKyAgICAgICAgICAgICAgICAiZ29vZ2xlX2NhbGVuZGFyX3N5bmNfd2luZG93X3VwZGF0ZV9kYXlzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG51bWJlciBvZiBwcm9tb3RlZCBzb3VyY2VzIGluIEdsb2JhbFNlYXJjaC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQVJDSF9OVU1fUFJPTU9URURfU09VUkNFUyA9ICJzZWFyY2hfbnVtX3Byb21vdGVkX3NvdXJjZXMiOworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1heGltdW0gbnVtYmVyIG9mIHN1Z2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SQ0hfUFJPTU9URURfU09VUkNFX0RFQURMSU5FX01JTExJUyA9CisgICAgICAgICAgICAgICAgInNlYXJjaF9wcm9tb3RlZF9zb3VyY2VfZGVhZGxpbmVfbWlsbGlzIjsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBudW1iZXIgb2YgbWlsbGlzZWNvbmRzIGJlZm9yZSBHbG9iYWxTZWFyY2ggYWJvcnRzIHNlYXJjaCBzdWdnZXNpdG9uIHF1ZXJpZXMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUFSQ0hfU09VUkNFX1RJTUVPVVRfTUlMTElTID0gInNlYXJjaF9zb3VyY2VfdGltZW91dF9taWxsaXMiOworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1heGltdW0gbnVtYmVyIG9mIG1pbGxpc2Vjb25kcyB0aGF0IEdsb2JhbFNlYXJjaCBzaG93cyB0aGUgcHJldmlvdXMgcmVzdWx0cworICAgICAgICAgKiBhZnRlciByZWNlaXZpbmcgYSBuZXcgcXVlcnkuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUFSQ0hfUFJFRklMTF9NSUxMSVMgPSAic2VhcmNoX3ByZWZpbGxfbWlsbGlzIjsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBtYXhpbXVtIGFnZSBvZiBsb2cgZGF0YSB1c2VkIGZvciBzaG9ydGN1dHMgaW4gR2xvYmFsU2VhcmNoLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VBUkNIX01BWF9TVEFUX0FHRV9NSUxMSVMgPSAic2VhcmNoX21heF9zdGF0X2FnZV9taWxsaXMiOworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1heGltdW0gYWdlIG9mIGxvZyBkYXRhIHVzZWQgZm9yIHNvdXJjZSByYW5raW5nIGluIEdsb2JhbFNlYXJjaC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQVJDSF9NQVhfU09VUkNFX0VWRU5UX0FHRV9NSUxMSVMgPQorICAgICAgICAgICAgICAgICJzZWFyY2hfbWF4X3NvdXJjZV9ldmVudF9hZ2VfbWlsbGlzIjsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBtaW5pbXVtIG51bWJlciBvZiBpbXByZXNzaW9ucyBuZWVkZWQgdG8gcmFuayBhIHNvdXJjZSBpbiBHbG9iYWxTZWFyY2guCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUFSQ0hfTUlOX0lNUFJFU1NJT05TX0ZPUl9TT1VSQ0VfUkFOS0lORyA9CisgICAgICAgICAgICAgICAgInNlYXJjaF9taW5faW1wcmVzc2lvbnNfZm9yX3NvdXJjZV9yYW5raW5nIjsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBtaW5pbXVtIG51bWJlciBvZiBjbGlja3MgbmVlZGVkIHRvIHJhbmsgYSBzb3VyY2UgaW4gR2xvYmFsU2VhcmNoLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VBUkNIX01JTl9DTElDS1NfRk9SX1NPVVJDRV9SQU5LSU5HID0KKyAgICAgICAgICAgICAgICAic2VhcmNoX21pbl9jbGlja3NfZm9yX3NvdXJjZV9yYW5raW5nIjsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBtYXhpbXVtIG51bWJlciBvZiBzaG9ydGN1dHMgc2hvd24gYnkgR2xvYmFsU2VhcmNoLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VBUkNIX01BWF9TSE9SVENVVFNfUkVUVVJORUQgPSAic2VhcmNoX21heF9zaG9ydGN1dHNfcmV0dXJuZWQiOworICAgICAgICAvKio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HB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFQVJDSF9TSE9SVENVVF9SRUZSRVNIX01BWF9QT09MX1NJWkUgPQorICAgICAgICAgICAgICAgICJzZWFyY2hfc2hvcnRjdXRfcmVmcmVzaF9tYXhfcG9vbF9zaXplIjsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBtYXhpbXVuIHRpbWUgdGhhdCBleGNlc3MgdGhyZWFkcyBpbiB0aGUgR2xvYmFsU2VhY2ggdGhyZWFkIHBvb2xzIHdpbGwKKyAgICAgICAgICogd2FpdCBiZWZvcmUgdGVybWluYXRpbmcuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUFSQ0hfVEhSRUFEX0tFRVBBTElWRV9TRUNPTkRTID0KKyAgICAgICAgICAgICAgICAic2VhcmNoX3RocmVhZF9rZWVwYWxpdmVfc2Vjb25kcyI7CisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbWF4aW11bSBudW1iZXIgb2YgY29uY3VycmVudCBzdWdnZXN0aW9uIHF1ZXJpZXMgdG8gZWFjaCBzb3VyY2UuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTRUFSQ0hfUEVSX1NPVVJDRV9DT05DVVJSRU5UX1FVRVJZX0xJTUlUID0KKyAgICAgICAgICAgICAgICAic2VhcmNoX3Blcl9zb3VyY2VfY29uY3VycmVudF9xdWVyeV9saW1pdCI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIEBkZXByZWNhdGVkCiAgICAgICAgICAqIEBoaWRlCiAgICAgICAgICAqLwpAQCAtMzU0Miw0MiArMzgxNCw2IEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogUmV0dXJucyB0aGUgR1RhbGsgSklEIHJlc291cmNlIGFzc29jaWF0ZWQgd2l0aCB0aGlzIGRldmljZS4KLSAgICAgKgotICAgICAqIEByZXR1cm4gIFN0cm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25lZCBmb3IgdXNlIHdoZW4gYnVpbGRpbmcgdXNlcgorICAgICAgICAgKiBpbnRlcmZhY2VzLCBhbmQgc2hvdWxkIG5vdCBiZSB1c2VkIHRvIGluZmVyIHRoZSBvd25lci4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFJFU19QQUNLQUdFID0gInJlc19wYWNrYWdlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1pbWUtdHlwZSBvZiB0aGlzIHNvY2lhbCBhY3Rpdml0eS4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIE1JTUVUWVBFID0gIm1pbWV0eXBlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogSW50ZXJuYWwgcmF3IGlkZW50aWZpZXIgZm9yIHRoaXMgc29jaWFsIGFjdGl2aXR5LiBUaGlzIGZpZWxkIGlzCisgICAgICAgICAqIGFuYWxvZ291cyB0byB0aGUgPGNvZGU+YXRvbTppZDwvY29kZT4gZWxlbWVudCBkZWZpbmVkIGluIFJGQyA0Mjg3LgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVHlwZTogVEVYVAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUkFXX0lEID0gInJhd19pZCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFJlZmVyZW5jZSB0byBhbm90aGVyIHtAbGluayBBY3Rpdml0aWVzI1JBV19JRH0gdGhhdCB0aGlzIHNvY2lhbCBhY3Rpdml0eQorICAgICAgICAgKiBpcyByZXBseWluZyB0by4gVGhpcyBmaWVsZCBpcyBhbmFsb2dvdXMgdG8gdGhlCisgICAgICAgICAqIDxjb2RlPnRocjppbi1yZXBseS10b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1wIG9mIHRoZSBvcmlnaW5hbCBhY3Rpdml0eS4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFRoaXMgZmllbGQgaXMgdXNlZnVsIGZvciBzb3J0aW5nIG9yZGVyIG9mIGFjdGl2aXRpZXMgdGhhdCBrZWVwcyB0b2dldGhlciBhbGwKKyAgICAgICAgICogbWVzc2FnZXMgaW4gZWFjaCB0aHJlYWQuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBJTlRFR0VSCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUSFJFQURfUFVCTElTSEVEID0gInRocmVhZF9wdWJsaXNoZWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaXRsZSBvZiB0aGlzIHNvY2lhbCBhY3Rpdml0eS4gVGhpcyBmaWVsZCBpcyBhbmFsb2dvdXMgdG8gdGhlCisgICAgICAgICAqIDxjb2RlPmF0b206dGl0bGU8L2NvZGU+IGVsZW1lbnQgZGVmaW5lZCBpbiBSRkMgNDI4Ny4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRJVExFID0gInRpdGxlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogU3VtbWFyeSBvZiB0aGlzIHNvY2lhbCBhY3Rpdml0eS4gVGhpcyBmaWVsZCBpcyBhbmFsb2dvdXMgdG8gdGhlCisgICAgICAgICAqIDxjb2RlPmF0b206c3VtbWFyeTwvY29kZT4gZWxlbWVudCBkZWZpbmVkIGluIFJGQyA0Mjg3LgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVHlwZTogVEVYVAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1VNTUFSWSA9ICJzdW1tYXJ5IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQSBVUkkgYXNzb2NpYXRlZCB0aGlzIHNvY2lhbCBhY3Rpdml0eS4gVGhpcyBmaWVsZCBpcyBhbmFsb2dvdXMgdG8gdGhlCisgICAgICAgICAqIDxjb2RlPmF0b206bGluayByZWw9ImFsdGVybmF0ZSI8L2NvZGU+IGVsZW1lbnQgZGVmaW5lZCBpbiBSRkMgNDI4Ny4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IFRFWFQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExJTksgPSAibGluayI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE9wdGlvbmFsIHRodW1ibmFpbCBzcGVjaWZpYyB0byB0aGlzIHNvY2lhbCBhY3Rpdml0eS4gVGhpcyBpcyB0aGUgcmF3CisgICAgICAgICAqIGJ5dGVzIG9mIGFuIGltYWdlIHRoYXQgY291bGQgYmUgaW5mbGF0ZWQgdXNpbmcge0BsaW5rIEJpdG1hcEZhY3Rvcnl9LgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVHlwZTogQkxPQgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJOQUlMID0gInRodW1ibmFpbCI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBBY3Rpdml0aWVzIGltcGxlbWVudHMgQmFzZUNvbHVtbnMsIEFjdGl2aXRpZXNDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoaXMgdXRpbGl0eSBjbGFzcyBjYW5ub3QgYmUgaW5zdGFudGlhdGVkCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIEFjdGl2aXRpZXMoKSB7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGNvbnRlbnQ6Ly8gc3R5bGUgVVJJIGZvciB0aGlzIHRhYmxlCisgICAgICAgICAqLworICAgICAgICBwd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JyYXkgYWNjb3VudC4KKyAqIFRoaXMgbWF5IGJlIHVzZWQgYnkgcHJvdmlkZXJzIHRoYXQgd2FudCB0byBzdG9yZSB0aGlzIGRhdGEgaW4gYSBzdGFuZGFyZCB3YXkuCisgKi8KK3B1YmxpYyBjbGFzcyBTeW5jU3RhdGVDb250cmFjdCB7CisgICAgcHVibGljIGludGVyZmFjZSBDb2x1bW5zIGV4dGVuZHMgQmFzZUNvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogQSByZWZlcmVuY2UgdG8gdGhlIG5hbWUgb2YgdGhlIGFjY291bnQgdG8gd2hpY2ggdGhpcyBkYXRhIGJlbG9uZ3MKKyAgICAgICAgICogPFA+VHlwZTogU1RSSU5HPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUNDT1VOVF9OQU1FID0gImFjY291bnRfbmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEEgcmVmZXJlbmNlIHRvIHRoZSB0eXBlIG9mIHRoZSBhY2NvdW50IHRvIHdoaWNoIHRoaXMgZGF0YSBiZWxvbmdzCisgICAgICAgICAqIDxQPlR5cGU6IFNUUklORzwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ09VTlRfVFlQRSA9ICJhY2NvdW50X3R5cGUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc3luYyBkYXRhIGFzc29jaWF0ZWQgd2l0aCB0aGlzIGFjY291bnQuCisgICAgICAgICAqIDxQPlR5cGU6IE5PTkU8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRBID0gImRhdGEiOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQ29uc3RhbnRzIGltcGxlbWVudHMgQ29sdW1ucyB7CisgICAgICAgIHB1YmxpYyBzdGF0aW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UgYWNjb3VudAorICAgICAgICAgKiBAdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiBpZiB0aGVyZSBpcyBhIGZhaWx1cmUgY29tbXVuaWNhdGluZyB3aXRoIHRoZSByZW1vdGUKKyAgICAgICAgICoge0BsaW5rIGFuZHJvaWQuY29udGVudC5Db250ZW50UHJvdmlkZXJ9CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGJ5dGVbXSBnZXQoQ29udGVudFByb3ZpZGVyQ2xpZW50IHByb3ZpZGVyLCBVcmkgdXJpLAorICAgICAgICAgICAgICAgIEFjY291bnQgYWNjb3VudCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBDdXJzb3IgYyA9IHByb3ZpZGVyLnF1ZXJ5KHVyaSwgREFUQV9QUk9KRUNUSU9OLCBTRUxFQ1RfQllfQUNDT1VOVCwKKyAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tde2FjY291bnQubmFtZSwgYWNjb3VudC50eXBlfSwgbnVsbCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmIChjLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gYy5nZXRCbG9iKGMuZ2V0Q29sdW1uSW5kZXhPclRocm93KENvbHVtbnMuREFUQSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQXNzaWducyB0aGUgZGF0YSBhcnJheSBhcyB0aGUgc3luYyBzdGF0ZSBmb3IgdGhlIGdpdmVuIGFjY291bnQuCisgICAgICAgICAqIEBwYXJhbSBwcm92aWRlciB0aGUge0BsaW5rIENvbnRlbnRQcm92aWRlckNsaWVudH0gdGhhdCBpcyB0byBiZ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92aWRlci5pbnNlcnQodXJpLCB2YWx1ZXMpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBVcmkgaW5zZXJ0KENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlciwgVXJpIHVyaSwKKyAgICAgICAgICAgICAgICBBY2NvdW50IGFjY291bnQsIGJ5dGVbXSBkYXRhKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoQ29sdW1ucy5EQVRBLCBkYXRhKTsKKyAgICAgICAgICAgIHZhbHVlcy5wdXQoQ29sdW1ucy5BQ0NPVU5UX05BTUUsIGFjY291bnQubmFtZSk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KENvbHVtbnMuQUNDT1VOVF9UWVBFLCBhY2NvdW50LnR5cGUpOworICAgICAgICAgICAgcmV0dXJuIHByb3ZpZGVyLmluc2VydCh1cmksIHZhbHVlcyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3RhdGljIHZvaWQgdXBkYXRlKENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlciwgVXJpIHVyaSwgYnl0ZVtdIGRhdGEpCisgICAgICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KENvbHVtbnMuREFUQSwgZGF0YSk7CisgICAgICAgICAgICBwcm92aWRlci51cGRhdGUodXJpLCB2YWx1ZXMsIG51bGwsIG51bGwpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBQYWlyPFVyaSwgYnl0ZVtdPiBnZXRXaXRoVXJpKENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlciwgVXJpIHVyaSwKKyAgICAgICAgICAgICAgICBBY2NvdW50IGFjY291bnQpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICAgICAgQ3Vyc29yIGMgPSBwcm92aWRlci5xdWVyeSh1cmksIERBVEFfUFJPSkVDVElPTiwgU0VMRUNUX0JZX0FDQ09VTlQsCisgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXthY2NvdW50Lm5hbWUsIGFjY291bnQudHlwZX0sIG51bGwpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAoYy5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyByb3dJZCA9IGMuZ2V0TG9uZygxKTsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIGJsb2IgPSBjLmdldEJsb2IoYy5nZXRDb2x1bW5JbmRleE9yVGhyb3coQ29sdW1ucy5EQVRBKSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBQYWlyLmNyZWF0ZShDb250ZW50VXJpcy53aXRoQXBwZW5kZWRJZCh1cmksIHJvd0lkKSwgYmxvYik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBDcmVhdGVzIGFuZCByZXR1cm5zIGEgQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uIHRoYXQgYXNzaWducyB0aGUgZGF0YSBhcnJheSBhcyB0aGUKKyAgICAgICAgICogc3luYyBzdGF0ZSBmb3IgdGhlIGdpdmVuIGFjY291bnQuCisgICAgICAgICAqIEBwYXJhbSB1cmkgdGhlIHVyaSBvZiB0aGUgc3luYyBzdGF0ZQorICAgICAgICAgKiBAcGFyYW0gYWNjb3VudCB0aGUge0BsaW5rIEFjY291bnR9IHdob3NlIHN5bmMgc3RhdGUgc2hvdWxkIGJlIHNldAorICAgICAgICAgKiBAcGFyYW0gZGF0YSB0aGUgYnl0ZVtdIHRoYXQgY29udGFpbnMgdGhlIHN5bmMgc3RhdGUKKyAgICAgICAgICogQHJldHVybiB0aGUgbmV3IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiB0aGF0IGFzc2lnbnMgdGhlIGRhdGEgYXJyYXkgYXMgdGhlCisgICAgICAgICAqIGFjY291bnQncyBzeW5jIHN0YXRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiBuZXdTZXRPcGVyYXRpb24oVXJpIHVyaSwKKyAgICAgICAgICAgICAgICBBY2NvdW50IGFjY291bnQsIGJ5dGVbXSBkYXRhKSB7CisgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KENvbHVtbnMuREFUQSwgZGF0YSk7CisgICAgICAgICAgICByZXR1cm4gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uCisgICAgICAgICAgICAgICAgICAgIC5uZXdJbnNlcnQodXJpKQorICAgICAgICAgICAgICAgICAgICAud2l0aFZhbHVlKENvbHVtbnMuQUNDT1VOVF9OQU1FLCBhY2NvdW50Lm5hbWUpCisgICAgICAgICAgICAgICAgICAgIC53aXRoVmFsdWUoQ29sdW1ucy5BQ0NPVU5UX1RZUEUsIGFjY291bnQudHlwZSkKKyAgICAgICAgICAgICAgICAgICAgLndpdGhWYWx1ZXModmFsdWVzKQorICAgICAgICAgICAgICAgICAgICAuYnVpbGQoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBDcmVhdGVzIGFuZCByZXR1cm5zIGEgQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uIHRoYXQgYXNzaWducyB0aGUgZGF0YSBhcnJheSBhcyB0aGUKKyAgICAgICAgICogc3luYyBzdGF0ZSBmb3IgdGhlIGdpdmVuIGFjY291bnQuCisgICAgICAgICAqIEBwYXJhbSB1cmkgdGhlIHVyaSBvZiB0aGUgc3BlY2lmaWMgc3luYyBzdGF0ZSB0byBzZXQKKyAgICAgICAgICogQHBhcmFtIGRhdGEgdGhlIGJ5dGVbXSB0aGF0IGNvbnRhaW5zIHRoZSBzeW5jIHN0YXRlCisgICAgICAgICAqIEByZXR1cm4gdGhlIG5ldyBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24gdGhhdCBhc3NpZ25zIHRoZSBkYXRhIGFycmF5IGFzIHRoZQorICAgICAgICAgKiBhY2NvdW50J3Mgc3luYyBzdGF0ZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24gbmV3VXBkYXRlT3BlcmF0aW9uKFVyaSB1cmksIGJ5dGVbXSBkYXRhKSB7CisgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICB2YWx1ZXMucHV0KENvbHVtbnMuREFUQSwgZGF0YSk7CisgICAgICAgICAgICByZXR1cm4gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uCisgICAgICAgICAgICAgICAgICAgIC5uZXdVcGRhdGUodXJpKQorICAgICAgICAgICAgICAgICAgICAud2l0aFZhbHVlcyh2YWx1ZXMpCisgICAgICAgICAgICAgICAgICAgIC5idWlsZCgpOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcHJvdmlkZXIvVGVsZXBob255LmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9wcm92aWRlci9UZWxlcGhvbnkuamF2YQppbmRleCBjMjkyYzUzLi5jNjM3ZTAyIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9wcm92aWRlci9UZWxlcGhvbnkuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9wcm92aWRlci9UZWxlcGhvbnkuamF2YQpAQCAtMTQ2LDcgKzE0NiwxMyBAQAogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VSVklDRV9DRU5URVIgPSAic2VydmljZV9jZW50ZXIiOwotICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogSGFzIHRoZSBtZXNzYWdlIGJlZW4gbG9ja2VkPworICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExPQ0tFRCA9ICJsb2NrZWQiOworfQogCiAgICAgLyoqCiAgICAgICogQ29udGFpbnMgYWxsIHRleHQgYmFzZWQgU01TIG1lc3NhZ2VzLgpAQCAtNDg0LDYgKzQ5MCwxMyBAQAogICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUkVTVUxUX1NNU19PVVRfT0ZfTUVNT1JZID0gMzsKIAogICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBTZXQgYnkgQnJvYWRjYXN0UmVjZWl2ZXIuIEluZGljYXRlcyB0aGUgbWVzc2FnZSwgd2hpbGUKKyAgICAgICAgICAgICAqIHBvc3NpYmx5IHZhbGlkLCBpcyBvZiBhIGZvcm1hdCBvciBlbmNvZGluZyB0aGF0IGlzIG5vdAorICAgICAgICAgICAgICogc3VwcG9ydGVkLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBSRVNVTFRfU01TX1VOU1VQUE9SVEVEID0gNDsKKworICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAgKiBCcm9hZGNhc3QgQWN0aW9uOiBBIG5ldyB0ZXh0IGJhc2VkIFNNUyBtZXNzYWdlIGhhcyBiZWVuIHJlY2VpdmVkCiAgICAgICAgICAgICAgKiBieSB0aGUgZGV2aWNlLiBUaGUgaW50ZW50IHdpbGwgaGF2ZSB0aGUgZm9sbG93aW5nIGV4dHJhCiAgICAgICAgICAgICAgKiB2YWx1ZXM6PC9wPgpAQCAtNTUyLDYgKzU2NSwyMyBAQAogICAgICAgICAgICAgICAgICJhbmRyb2lkLnByb3ZpZGVyLlRlbGVwaG9ueS5TSU1fRlVMTCI7CiAKICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogQnJvYWRjYXN0IEFjdGlvbjogQW4gaW5jb21pbmcgU01TIGhhcyBiZWVuIHJlamVjdGVkIGJ5IHRoZQorICAgICAgICAgICAgICogdGVsZXBob255IGZyYW1ld29yay4gIFRoaXMgaW50ZW50IGlzIHNlbnQgaW4gbGlldSBvZiBhbnkKKyAgICAgICAgICAgICAqIG9mIHRoZSBSRUNFSVZFRF9BQ1RJT04gaW50ZW50cy4gIFRoZSBpbnRlbnQgd2lsbCBoYXZlIHRoZQorICAgICAgICAgICAgICogZm9sbG93aW5nIGV4dHJhIHZhbHVlOjwvcD4KKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiA8dWw+CisgICAgICAgICAgICAgKiAgIDxsaT48ZW0+cmVzdWx0PC9lbT4gLSBBbiBpbnQgcmVzdWx0IGNvZGUsIGVnLAorICAgICAgICAgICAgICogICA8Y29kZT57QGxpbmsgI1JFU1VMVF9TTVNfT1VUX09GX01FTU9SWX08L2NvZGU+LAorICAgICAgICAgICAgICogICBpbmRpY2F0aW5nIHRoZSBlcnJvciByZXR1cm5lZCB0byB0aGUgbmV0d29yay48L2xpPgorICAgICAgICAgICAgICogPC91bD4KKworICAgICAgICAgICAgICovCisgICAgICAgICAgICBAU2RrQ29uc3RhbnQoU2RrQ29uc3RhbnRUeXBlLkJST0FEQ0FTVF9JTlRFTlRfQUNUSU9OKQorICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU01TX1JFSkVDVEVEX0FDVElPTiA9CisgICAgICAgICAgICAgICAgImFuZHJvaWQucHJvdmlkZXIuVGVsZXBob255LlNNU19SRUpFQ1RFRCI7CisKKyAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgICogUmVhZCB0aGUgUERVcyBvdXQgb2YgYW4ge0BsaW5rICNTTVNfUkVDRUlWRURfQUNUSU9OfSBvciBhCiAgICAgICAgICAgICAgKiB7QGxpbmsgI0RBVEFfU01TX1JFQ0VJVkVEX0FDVElPTn0gaW50ZW50LgogICAgICAgICAgICAgICoKQEAgLTEwMDgsNiArMTAzOCwxMiBAQAogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhSRUFEX0lEID0gInRocmVhZF9pZCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEhhcyB0aGUgbWVzc2FnZSBiZWVuIGxvY2tlZD8KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAoYm9vbGVhbik8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBMT0NLRUQgPSAibG9ja2VkIjsKICAgICB9CiAKICAgICAvKioKQEAgLTEyNTIsNiArMTI4OCwyMSBAQAogICAgICAgICB9CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgbnVtYmVyIGlzIGEgUGhvbmUgbnVtYmVyCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBudW1iZXIgdGhlIGlucHV0IG51bWJlciB0byBiZSB0ZXN0ZWQKKyAgICAgICAgICogQHJldHVybiB0cnVlIGlmIG51bWJlciBpcyBhIFBob25lIG51bWJlcgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBib29sZWFuIGlzUGhvbmVOdW1iZXIoU3RyaW5nIG51bWJlcikgeworICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KG51bWJlcikpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIE1hdGNoZXIgbWF0Y2ggPSBSZWdleC5QSE9ORV9QQVRURVJOLm1hdGNoZXIobnVtYmVyKTsKKyAgICAgICAgICAgIHJldHVybiBtYXRjaC5tYXRjaGVzKCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKICAgICAgICAgICogQ29udGFpbnMgYWxsIE1NUyBtZXNzYWdlcyBpbiB0aGUgTU1TIGFwcCdzIGluYm94LgogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBJbmJveCBpbXBsZW1lbnRzIEJhc2VNbXNDb2x1bW5zIHsKQEAgLTE0MTYsNiArMTQ2Nyw4IEBACiAgICAgICAgICAgICAgKi8KICAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9EQVRBID0gIl9kYXRhIjsKIAorICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEVYVCA9ICJ0ZXh0IjsKKwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBSYXRlIHsKQEAgLTE0OTMsNiArMTU0NiwxNyBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX0RSQUZUX1VSSSA9IFVyaS5wYXJzZSgKICAgICAgICAgICAgICAgICAiY29udGVudDovL21tcy1zbXMvZHJhZnQiKTsKIAorICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX0xPQ0tFRF9VUkkgPSBVcmkucGFyc2UoCisgICAgICAgICAgICAgICAgImNvbnRlbnQ6Ly9tbXMtc21zL2xvY2tlZCIpOworCisgICAgICAgIC8qKioKKyAgICAgICAg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ua3MKLSAgICBwcml2YXRlIGludCBtU2lua0NvdW50ID0gMDsgCisgICAgcHJpdmF0ZSBmaW5hbCBCcm9hZGNhc3RSZWNlaXZlciBtUmVjZWl2ZXIgPSBuZXcgQnJvYWRjYXN0UmVjZWl2ZXIoKSB7CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvblJlY2VpdmUoQ29udGV4dCBjb250ZXh0LCBJbnRlbnQgaW50ZW50KSB7CisgICAgICAgICAgICBTdHJpbmcgYWN0aW9uID0gaW50ZW50LmdldEFjdGlvbigpOworICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9CisgICAgICAgICAgICAgICAgICAgIGludGVudC5nZXRQYXJjZWxhYmxlRXh0cmEoQmx1ZXRvb3RoSW50ZW50LkRFVklDRSk7CisgICAgICAgICAgICBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBZGFwdGVyLkFDVElPTl9TVEFURV9DSEFOR0VEKSkgeworICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhBZGFwdGVyLkVYVFJBX1NUQVRFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhBZGFwdGVyLkVSUk9SKTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09OOgorICAgICAgICAgICAgICAgICAgICBvbkJsdWV0b290aEVuYWJsZSgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfVFVSTklOR19PRkY6CisgICAgICAgICAgICAgICAgICAgIG9uQmx1ZXRvb3RoRGlzYWJsZSgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoSW50ZW50LkJPTkRfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pKSB7CisgICAgICAgICAgICAgICAgaW50IGJvbmRTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhJbnRlbnQuQk9ORF9TVEFURSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5FUlJPUik7CisgICAgICAgICAgICAgICAgc3dpdGNoKGJvbmRTdGF0ZSkgeworICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLkJPTkRfQk9OREVEOgorICAgICAgICAgICAgICAgICAgICBzZXRTaW5rUHJpb3JpdHkoZGV2aWNlLCBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX0FVVE8pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkc6CisgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9OT1RfQk9OREVEOgorICAgICAgICAgICAgICAgICAgICBzZXRTaW5rUHJpb3JpdHkoZGV2aWNlLCBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX09GRik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhJbnRlbnQuUkVNT1RFX0RFVklDRV9DT05ORUNURURfQUNUSU9OKSkgeworICAgICAgICAgICAgICAgIGlmIChnZXRTaW5rUHJpb3JpdHkoZGV2aWNlKSA+IEJsdWV0b290aEEyZHAuUFJJT1JJVFlfT0ZGICYmCisgICAgICAgICAgICAgICAgICAgICAgICBpc1NpbmtEZXZpY2UoZGV2aWNlKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGRldmljZSBpcyBhIHByZWZlcnJlZCBzaW5rLiBNYWtlIGFuIEEyRFAgY29ubmVjdGlvbgorICAgICAgICAgICAgICAgICAgICAvLyBhZnRlciBhIGRlbGF5LiBXZSBkZWxheSB0byBhdm9pZCBjb25uZWN0aW9uIGNvbGxpc2lvbnMsCisgICAgICAgICAgICAgICAgICAgIC8vIGFuZCB0byBnaXZlIG90aGVyIHByb2ZpbGVzIHN1Y2ggYXMgSEZQIGEgY2hhbmNlIHRvCisgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3QgZmlyc3QuCisgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gTWVzc2FnZS5vYnRhaW4obUhhbmRsZXIsIE1FU1NBR0VfQ09OTkVDVF9UTywgZGV2aWNlKTsKKyAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKG1zZywgNjAwMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKIAotICAgIHByaXZhdGUgY2xhc3MgU2lua1N0YXRlIHsKLSAgICAgICAgcHVibGljIFN0cmluZyBhZGRyZXNzOwotICAgICAgICBwdWJsaWMgaW50IHN0YXRlOwotICAgICAgICBwdWJsaWMgU2lua1N0YXRlKFN0cmluZyBhLCBpbnQgcykge2FkZHJlc3MgPSBhOyBzdGF0ZSA9IHM7fQotICAgIH0KLQotICAgIHB1YmxpYyBCbHVldG9vdGhBMmRwU2VydmljZShDb250ZXh0IGNvbnRleHQpIHsKKyAgICBwdWJsaWMgQmx1ZXRvb3RoQTJkcFNlcnZpY2UoQ29udGV4dCBjb250ZXh0LCBCbHVldG9vdGhTZXJ2aWNlIGJsdWV0b290aFNlcnZpY2UpIHsKICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OwogCiAgICAgICAgIG1BdWRpb01hbmFnZXIgPSAoQXVkaW9NYW5hZ2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lci5hZGRBY3Rpb24oQmx1ZXRvb3RoSW50ZW50LlJFTU9URV9ERVZJQ0VfQ09OTkVDVEVEX0FDVElPTik7CiAgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobVJlY2VpdmVyLCBtSW50ZW50RmlsdGVyKTsKIAotICAgICAgICBpZiAobUJsdWV0b290aC5pc0VuYWJsZWQoKSkgeworICAgICAgICBtQXVkaW9EZXZpY2VzID0gbmV3IEhhc2hNYXA8Qmx1ZXRvb3RoRGV2aWNlLCBJbnRlZ2VyPigpOworCisgICAgICAgIGlmIChtQmx1ZXRvb3RoU2VydmljZS5pc0VuYWJsZWQoKSkKICAgICAgICAgICAgIG9uQmx1ZXRvb3RoRW5hYmxlKCk7Ci0gICAgICAgIH0KICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTExMCwzMzAgKzE1MywyODQgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgZmluYWwgQnJvYWRjYXN0UmVjZWl2ZXIgbVJlY2VpdmVyID0gbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgewotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgewotICAgICAgICAgICAgU3RyaW5nIGFjdGlvbiA9IGludGVudC5nZXRBY3Rpb24oKTsKLSAgICAgICAgICAgIFN0cmluZyBhZGRyZXNzID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKEJsdWV0b290aEludGVudC5BRERSRVNTKTsKLSAgICAgICAgICAgIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aEludGVudC5CTFVFVE9PVEhfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pKSB7Ci0gICAgICAgICAgICAgICAgaW50IHN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aEludGVudC5CTFVFVE9PVEhfU1RBVEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEVycm9yLkVSUk9SKTsKLSAgICAgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7Ci0gICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQkxVRVRPT1RIX1NUQVRFX09OOgotICAgICAgICAgICAgICAgICAgICBvbkJsdWV0b290aEVuYWJsZSgpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CTFVFVE9PVEhfU1RBVEVfVFVSTklOR19PRkY6Ci0gICAgICAgICAgICAgICAgICAgIG9uQmx1ZXRvb3RoRGlzYWJsZSgpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoSW50ZW50LkJPTkRfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pKSB7Ci0gICAgICAgICAgICAgICAgaW50IGJvbmRTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhJbnRlbnQuQk9ORF9TVEFURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEVycm9yLkVSUk9SKTsKLSAgICAgICAgICAgICAgICBzd2l0Y2goYm9uZFN0YXRlKSB7Ci0gICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQ6Ci0gICAgICAgICAgICAgICAgICAgIHNldFNpbmtQcmlvcml0eShhZGRyZXNzLCBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX0FVVE8pOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkc6Ci0gICAgICAgICAgICAgICAgY2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0gbmV3IEhhbmRsZXIoKSB7CiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CiAgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CiAgICAgICAgICAgICBjYXNlIE1FU1NBR0VfQ09OTkVDVF9UTzoKLSAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzcyA9IChTdHJpbmcpbXNnLm9iajsKKyAgICAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UgZGV2aWNlID0gKEJsdWV0b290aERldmljZSkgbXNnLm9iajsKICAgICAgICAgICAgICAgICAvLyBjaGVjayBibHVldG9vdGggaXMgc3RpbGwgb24sIGRldmljZSBpcyBzdGlsbCBwcmVmZXJyZWQsIGFuZAogICAgICAgICAgICAgICAgIC8vIG5vdGhpbmcgaXMgY3VycmVudGx5IGNvbm5lY3RlZAotICAgICAgICAgICAgICAgIGlmIChtQmx1ZXRvb3RoLmlzRW5hYmxlZCgpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBnZXRTaW5rUHJpb3JpdHkoYWRkcmVzcykgPiBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX09GRiAmJgorICAgICAgICAgICAgICAgIGlmIChtQmx1ZXRvb3RoU2VydmljZS5pc0VuYWJsZWQoKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgZ2V0U2lua1ByaW9yaXR5KGRldmljZSkgPiBCbHVldG9vdGhBMmRwLlBSSU9SSVRZX09GRiAmJgogICAgICAgICAgICAgICAgICAgICAgICAgbG9va3VwU2lua3NNYXRjaGluZ1N0YXRlcyhuZXcgaW50W10gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVElORywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNUSU5HfSkuc2l6ZSgpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbG9nKCJBdXRvLWNvbm5lY3RpbmcgQTJEUCB0byBzaW5rICIgKyBhZGRyZXNzKTsKLSAgICAgICAgICAgICAgICAgICAgY29ubmVjdFNpbmsoYWRkcmVzcyk7CisgICAgICAgICAgICAgICAgICAgIGxvZygiQXV0by1jb25uZWN0aW5nIEEyRFAgdG8gc2luayAiICsgZGV2aWNlKTsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdFNpbmsoZGV2aWNlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIE1FU1NBR0VfRElTQ09OTkVDVDoKLSAgICAgICAgICAgICAgICBoYW5kbGVEZWZlcnJlZERpc2Nvbm5lY3QoKFN0cmluZyltc2cub2JqKTsKLSAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH07CiAKLSAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIG9uQmx1ZXRvb3RoRW5hYmxlKCkgewotICAgICAgICBtQXVkaW9EZXZpY2VzID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBTaW5rU3RhdGU+KCk7Ci0gICAgICAgIFN0cmluZ1tdIHBhdGhzID0gKFN0cmluZ1tdKWxpc3RIZWFkc2V0c05hdGl2ZSgpOwotICAgICAgICBpZiAocGF0aHMgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChTdHJpbmcgcGF0aCA6IHBhdGhzKSB7Ci0gICAgICAgICAgICAgICAgbUF1ZGlvRGV2aWNlcy5wdXQocGF0aCwgbmV3IFNpbmtTdGF0ZShnZXRBZGRyZXNzTmF0aXZlKHBhdGgpLAotICAgICAgICAgICAgICAgICAgICAgICAgaXNTaW5rQ29ubmVjdGVkTmF0aXZlKHBhdGgpID8gQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpKTsKKyAgICBwcml2YXRlIGludCBjb252ZXJ0Qmx1ZXpTaW5rU3RyaW5ndG9TdGF0ZShTdHJpbmcgdmFsdWUpIHsKKyAgICAgICAgaWYgKHZhbHVlLmVxdWFsc0lnbm9yZUNhc2UoImRpc2Nvbm5lY3RlZCIpKQorICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICBpZiAodmFsdWUuZXF1YWxzSWdub3JlQ2FzZSgiY29ubmVjdGluZyIpKQorICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVElORzsKKyAgICAgICAgaWYgKHZhbHVlLmVxdWFsc0lnbm9yZUNhc2UoImNvbm5lY3RlZCIpKQorICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVEOworICAgICAgICBpZiAodmFsdWUuZXF1YWxzSWdub3JlQ2FzZSgicGxheWluZyIpKQorICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEEyZHAuU1RBVEVfUExBWUlORzsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBpc1NpbmtEZXZpY2UoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBTdHJpbmcgdXVpZHNbXSA9IG1CbHVldG9vdGhTZXJ2aWNlLmdldFJlbW90ZVV1aWRzKGRldmljZS5nZXRBZGRyZXNzKCkpOworICAgICAgICBVVUlEIHV1aWQ7CisgICAgICAgIGlmICh1dWlkcyAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBkZXZpY2VVdWlkOiB1dWlkcykgeworICAgICAgICAgICAgICAgIHV1aWQgPSBVVUlELmZyb21TdHJpbmcoZGV2aWNlVXVpZCk7CisgICAgICAgICAgICAgICAgaWYgKEJsdWV0b290aFV1aWQuaXNBdWRpb1NpbmsodXVpZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIG1BdWRpb01hbmFnZXIuc2V0UGFyYW1ldGVyKEJMVUVUT09USF9FTkFCTEVELCAidHJ1ZSIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgYm9vbGVhbiBhZGRBdWRpb1NpbmsgKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgU3RyaW5nIHBhdGggPSBtQmx1ZXRvb3RoU2VydmljZS5nZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIFN0cmluZyBwcm9wVmFsdWVzW10gPSAoU3RyaW5nIFtdKSBnZXRTaW5rUHJvcGVydGllc05hdGl2ZShwYXRoKTsKKyAgICAgICAgaWYgKHByb3BWYWx1ZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3Igd2hpbGUgZ2V0dGluZyBBdWRpb1NpbmsgcHJvcGVydGllcyBmb3IgZGV2aWNlOiAiICsgZGV2aWNlKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBJbnRlZ2VyIHN0YXRlID0gbnVsbDsKKyAgICAgICAgLy8gUHJvcGVydGllcyBhcmUgbmFtZS12YWx1ZSBwYWlycworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8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gbUJsdWV0b290aFNlcnZpY2UuZ2V0UmVtb3RlVXVpZHMoYWRkcmVzcyk7CisgICAgICAgICAgICAgICAgaWYgKHV1aWRzICE9IG51bGwpCisgICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHV1aWQ6IHV1aWRzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBVVUlEIHJlbW90ZVV1aWQgPSBVVUlELmZyb21TdHJpbmcodXVpZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQmx1ZXRvb3RoVXVpZC5pc0F1ZGlvU2luayhyZW1vdGVVdWlkKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aFV1aWQuaXNBdWRpb1NvdXJjZShyZW1vdGVVdWlkKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aFV1aWQuaXNBZHZBdWRpb0Rpc3QocmVtb3RlVXVpZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRBdWRpb1NpbmsoZGV2aWNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIG1BdWRpb01hbmFnZXIuc2V0UGFyYW1ldGVycyhCTFVFVE9PVEhfRU5BQkxFRCsiPXRydWUiKTsKICAgICB9CiAKICAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIG9uQmx1ZXRvb3RoRGlzYWJsZSgpIHsKLSAgICAgICAgaWYgKG1BdWRpb0RldmljZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgLy8gY29weSB0byBhbGxvdyBtb2RpZmljYXRpb24gZHVyaW5nIGl0ZXJhdGlvbgotICAgICAgICAgICAgU3RyaW5nW10gcGF0aHMgPSBuZXcgU3RyaW5nW21BdWRpb0RldmljZXMuc2l6ZSgpXTsKLSAgICAgICAgICAgIHBhdGhzID0gbUF1ZGlvRGV2aWNlcy5rZXlTZXQoKS50b0FycmF5KHBhdGhzKTsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIHBhdGggOiBwYXRocykgewotICAgICAgICAgICAgICAgIHN3aXRjaCAobUF1ZGlvRGV2aWNlcy5nZXQocGF0aCkuc3RhdGUpIHsKKyAgICAgICAgaWYgKCFtQXVkaW9EZXZpY2VzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlW10gZGV2aWNlcyA9IG5ldyBCbHVldG9vdGhEZXZpY2VbbUF1ZGlvRGV2aWNlcy5zaXplKCldOworICAgICAgICAgICAgZGV2aWNlcyA9IG1BdWRpb0RldmljZXMua2V5U2V0KCkudG9BcnJheShkZXZpY2VzKTsKKyAgICAgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA6IGRldmljZXMpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhdGUgPSBnZXRTaW5rU3RhdGUoZGV2aWNlKTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNUSU5HOgogICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVEOgogICAgICAgICAgICAgICAgICAgICBjYXNlIEJsdWV0b290aEEyZHAuU1RBVEVfUExBWUlORzoKLSAgICAgICAgICAgICAgICAgICAgICAgIGRpc2Nvbm5lY3RTaW5rTmF0aXZlKHBhdGgpOwotICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlU3RhdGUocGF0aCwgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpOworICAgICAgICAgICAgICAgICAgICAgICAgZGlzY29ubmVjdFNpbmtOYXRpdmUobUJsdWV0b290aFNlcnZpY2UuZ2V0T2JqZWN0UGF0aEZyb21BZGRyZXNzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2UuZ2V0QWRkcmVzcygpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVTaW5rU3RhdGVDaGFuZ2UoZGV2aWNlLCBzdGF0ZSwgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpOwogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNUSU5HOgotICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlU3RhdGUocGF0aCwgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpOworICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlU2lua1N0YXRlQ2hhbmdlKGRldmljZSwgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNUSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1BdWRpb0RldmljZXMgPSBudWxsOworICAgICAgICAgICAgbUF1ZGlvRGV2aWNlcy5jbGVhcigpOwogICAgICAgICB9Ci0gICAgICAgIG1BdWRpb01hbmFnZXIuc2V0Qmx1ZXRvb3RoQTJkcE9uKGZhbHNlKTsKLSAgICAgICAgbUF1ZGlvTWFuYWdlci5zZXRQYXJhbWV0ZXIoQkxVRVRPT1RIX0VOQUJMRUQsICJmYWxzZSIpOworCisgICAgICAgIG1BdWRpb01hbmFnZXIuc2V0UGFyYW1ldGVycyhCTFVFVE9PVEhfRU5BQkxFRCArICI9ZmFsc2UiKTsKICAgICB9CiAKLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBjb25uZWN0U2luayhTdHJpbmcgYWRkcmVzcykgeworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBjb25uZWN0U2luayhCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7Ci0gICAgICAgIGlmIChEQkcpIGxvZygiY29ubmVjdFNpbmsoIiArIGFkZHJlc3MgKyAiKSIpOwotICAgICAgICBpZiAoIUJsdWV0b290aERldmljZS5jaGVja0JsdWV0b290aEFkZHJlc3MoYWRkcmVzcykpIHsKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhFcnJvci5FUlJPUjsKLSAgICAgICAgfQotICAgICAgICBpZiAobUF1ZGlvRGV2aWNlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRXJyb3IuRVJST1I7Ci0gICAgICAgIH0KKyAgICAgICAgaWYgKERCRykgbG9nKCJjb25uZWN0U2luaygiICsgZGV2aWNlICsgIikiKTsKKwogICAgICAgICAvLyBpZ25vcmUgaWYgdGhlcmUgYXJlIGFueSBhY3RpdmUgc2lua3MKICAgICAgICAgaWYgKGxvb2t1cFNpbmtzTWF0Y2hpbmdTdGF0ZXMobmV3IGludFtdIHsKICAgICAgICAgICAgICAgICBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkcsCiAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQsCiAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HLAogICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVElOR30pLnNpemUoKSAhPSAwKSB7Ci0gICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRXJyb3IuRVJST1I7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIAotICAgICAgICBTdHJpbmcgcGF0aCA9IGxvb2t1cFBhdGgoYWRkcmVzcyk7Ci0gICAgICAgIGlmIChwYXRoID09IG51bGwpIHsKLSAgICAgICAgICAgIHBhdGggPSBjcmVhdGVIZWFkc2V0TmF0aXZlKGFkZHJlc3MpOwotICAgICAgICAgICAgaWYgKERCRykgbG9nKCJuZXcgYmx1ZXogc2luazogIiArIGFkZHJlc3MgKyAiICgiICsgcGF0aCArICIpIik7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHBhdGggPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOwotICAgICAgICB9CisgICAgICAgIGlmIChtQXVkaW9EZXZpY2VzLmdldChkZXZpY2UpID09IG51bGwgJiYgIWFkZEF1ZGlvU2luayhkZXZpY2UpKQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogCi0gICAgICAgIFNpbmtTdGF0ZSBzaW5rID0gbUF1ZGlvRGV2aWNlcy5nZXQocGF0aCk7Ci0gICAgICAgIGludCBzdGF0ZSA9IEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEOwotICAgICAgICBpZiAoc2luayAhPSBudWxsKSB7Ci0gICAgICAgICAgICBzdGF0ZSA9IHNpbmsuc3RhdGU7Ci0gICAgICAgIH0KKyAgICAgICAgaW50IHN0YXRlID0gbUF1ZGlvRGV2aWNlcy5nZXQoZGV2aWNlKTsKKwogICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CiAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQ6CiAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HOgogICAgICAgICBjYXNlIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVElORzoKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhFcnJvci5FUlJPUjsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgY2FzZSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkc6Ci0gICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRXJyb3IuU1VDQ0VTUzsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CiAKKyAgICAgICAgU3RyaW5nIHBhdGggPSBtQmx1ZXRvb3RoU2VydmljZS5nZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIGlmIChwYXRoID09IG51bGwpCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisKICAgICAgICAgLy8gU3RhdGUgaXMgRElTQ09OTkVDVEVECiAgICAgICAgIGlmICghY29ubmVjdFNpbmtOYXRpdmUocGF0aCkpIHsKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhFcnJvci5FUlJPUjsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQotICAgICAgICB1cGRhdGVTdGF0ZShwYXRoLCBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkcpOwotICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRXJyb3IuU1VDQ0VTUzsKKyAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCi0gICAgcHVibGljIHN5bmNocm9uaXplZCBpbnQgZGlzY29ubmVjdFNpbmsoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZGlzY29ubmVjdFNpbmsoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX0FETUlOX1BFUk0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBCTFVFVE9PVEhfQURNSU4gcGVybWlzc2lvbiIpOwotICAgICAgICBpZiAoREJHKSBsb2coImRpc2Nvbm5lY3RTaW5rKCIgKyBhZGRyZXNzICsgIikiKTsKLSAgICAgICAgaWYgKCFCbHVldG9vdGhEZXZpY2UuY2hlY2tCbHVldG9vdGhBZGRyZXNzKGFkZHJlc3MpKSB7Ci0gICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRXJyb3IuRVJST1I7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG1BdWRpb0RldmljZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOwotICAgICAgICB9Ci0gICAgICAgIFN0cmluZyBwYXRoID0gbG9va3VwUGF0aChhZGRyZXNzKTsKKyAgICAgICAgaWYgKERCRykgbG9nKCJkaXNjb25uZWN0U2luaygiICsgZGV2aWNlICsgIikiKTsKKworICAgICAgICBTdHJpbmcgcGF0aCA9IG1CbHVldG9vdGhTZXJ2aWNlLmdldE9iamVjdFBhdGhGcm9tQWRkcmVzcyhkZXZpY2UuZ2V0QWRkcmVzcygpKTsKICAgICAgICAgaWYgKHBhdGggPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9Ci0gICAgICAgIHN3aXRjaCAobUF1ZGlvRGV2aWNlcy5nZXQocGF0aCkuc3RhdGUpIHsKKworICAgICAgICBzd2l0Y2ggKGdldFNpbmtTdGF0ZShkZXZpY2UpKSB7CiAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQ6Ci0gICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRXJyb3IuRVJST1I7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNUSU5HOgotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLlNVQ0NFU1M7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogCiAgICAgICAgIC8vIFN0YXRlIGlzIENPTk5FQ1RJTkcgb3IgQ09OTkVDVEVEIG9yIFBMQVlJTkcKICAgICAgICAgaWYgKCFkaXNjb25uZWN0U2lua05hdGl2ZShwYXRoKSkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgdXBkYXRlU3RhdGUocGF0aCwgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNUSU5HKTsKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhFcnJvci5TVUNDRVNTOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwdWJsaWMgc3luY2hyb25pemVkIExpc3Q8U3RyaW5nPiBsaXN0Q29ubmVjdGVkU2lua3MoKSB7CisgICAgcHVibGljIHN5bmNocm9uaXplZCBCbHVldG9vdGhEZXZpY2VbXSBnZXRDb25uZWN0ZWRTaW5rcygpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOwotICAgICAgICByZXR1cm4gbG9va3VwU2lua3NNYXRjaGluZ1N0YXRlcyhuZXcgaW50W10ge0JsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfUExBWUlOR30pOworICAgICAgICBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBzaW5rcyA9IGxvb2t1cFNpbmtzTWF0Y2hpbmdTdGF0ZXMoCisgICAgICAgICAgICAgICAgbmV3IGludFtdIHtCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCwgQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HfSk7CisgICAgICAgIHJldHVybiBzaW5rcy50b0FycmF5KG5ldyBCbHVldG9vdGhEZXZpY2Vbc2lua3Muc2l6ZSgpXSk7CiAgICAgfQogCi0gICAgcHVibGljIHN5bmNocm9uaXplZCBpbnQgZ2V0U2lua1N0YXRlKFN0cmluZyBhZGRyZXNzKSB7CisgICAgcHVibGljIHN5bmNocm9uaXplZCBpbnQgZ2V0U2lua1N0YXRlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOwotICAgICAgICBpZiAoIUJsdWV0b290aERldmljZS5jaGVja0JsdWV0b290aEFkZHJlc3MoYWRkcmVzcykpIHsKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhFcnJvci5FUlJPUjsKLSAgICAgICAgfQotICAgICAgICBpZiAobUF1ZGlvRGV2aWNlcyA9PSBudWxsKSB7CisgICAgICAgIEludGVnZXIgc3RhdGUgPSBtQXVkaW9EZXZpY2VzLmdldChkZXZpY2UpOworICAgICAgICBpZiAoc3RhdGUgPT0gbnVsbCkKICAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhBMmRwLlNUQVRFX0RJU0NPTk5FQ1RFRDsKLSAgICAgICAgfQotICAgICAgICBmb3IgKFNpbmtTdGF0ZSBzaW5rIDogbUF1ZGlvRGV2aWNlcy52YWx1ZXMoKSkgewotICAgICAgICAgICAgaWYgKGFkZHJlc3MuZXF1YWxzKHNpbmsuYWRkcmVzcykpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gc2luay5zdGF0ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQ7CisgICAgICAgIHJldHVybiBzdGF0ZTsKICAgICB9CiAKLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRTaW5rUHJpb3JpdHkoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRTaW5rUHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7Ci0gICAgICAgIGlmICghQmx1ZXRvb3RoRGV2aWNlLmNoZWNrQmx1ZXRvb3RoQWRkcmVzcyhhZGRyZXNzKSkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOwotICAgICAgICB9CiAgICAgICAgIHJldHVybiBTZXR0aW5ncy5TZWN1cmUuZ2V0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRCbHVldG9vdGhBMmRwU2lua1ByaW9yaXR5S2V5KGFkZHJlc3MpLAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRCbHVldG9vdGhBMmRwU2lua1ByaW9yaXR5S2V5KGRldmljZS5nZXRBZGRyZXNzKCkpLAogICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuUFJJT1JJVFlfT0ZGKTsKICAgICB9CiAKLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBzZXRTaW5rUHJpb3JpdHkoU3RyaW5nIGFkZHJlc3MsIGludCBwcmlvcml0eSkgeworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBzZXRTaW5rUHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHByaW9yaXR5KSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7Ci0gICAgICAgIGlmICghQmx1ZXRvb3RoRGV2aWNlLmNoZWNrQmx1ZXRvb3RoQWRkcmVzcyhhZGRyZXNzKSkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOworICAgICAgICBpZiAoIUJsdWV0b290aERldmljZS5jaGVja0JsdWV0b290aEFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSkpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gU2V0dGluZ3MuU2VjdXJlLnB1dEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuZ2V0Qmx1ZXRvb3RoQTJkcFNpbmtQcmlvcml0eUtleShhZGRyZXNzKSwgcHJpb3JpdHkpID8KLSAgICAgICAgICAgICAgICBCbHVldG9vdGhFcnJvci5TVUNDRVNTIDogQmx1ZXRvb3RoRXJyb3IuRVJST1I7CisgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLmdldEJsdWV0b290aEEyZHBTaW5rUHJpb3JpdHlLZXkoZGV2aWNlLmdldEFkZHJlc3MoKS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dXBkYXRlU3RhdGUocGF0aCwgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZVNpbmtTdGF0ZUNoYW5nZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlLCBpbnQgcHJldlN0YXRlLCBpbnQgc3RhdGUpIHsKKyAgICAgICAgaWYgKHN0YXRlICE9IHByZXZTdGF0ZSkgeworICAgICAgICAgICAgaWYgKHN0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEIHx8CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVElORykgeworICAgICAgICAgICAgICAgIGlmIChwcmV2U3RhdGUgPT0gQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZXZTdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpIHsKKyAgICAgICAgICAgICAgICAgICAvLyBkaXNjb25uZWN0aW5nIG9yIGRpc2Nvbm5lY3RlZAorICAgICAgICAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEF1ZGlvTWFuYWdlci5BQ1RJT05fQVVESU9fQkVDT01JTkdfTk9JU1kpOworICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVNpbmtDb3VudC0tOworICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgIG1TaW5rQ291bnQgKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQXVkaW9EZXZpY2VzLnB1dChkZXZpY2UsIHN0YXRlKTsKKworICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoQmx1ZXRvb3RoQTJkcC5TSU5LX1NUQVRFX0NIQU5HRURfQUNUSU9OKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuREVWSUNFLCBkZXZpY2UpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEEyZHAuU0lOS19QUkVWSU9VU19TVEFURSwgcHJldlN0YXRlKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhBMmRwLlNJTktfU1RBVEUsIHN0YXRlKTsKKyAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfUEVSTSk7CisKKyAgICAgICAgICAgIGlmIChEQkcpIGxvZygiQTJEUCBzdGF0ZSA6IGRldmljZTogIiArIGRldmljZSArICIgU3RhdGU6IiArIHByZXZTdGF0ZSArICItPiIgKyBzdGF0ZSk7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIG9uU2lua1BsYXlpbmcoU3RyaW5nIHBhdGgpIHsKLSAgICAgICAgdXBkYXRlU3RhdGUocGF0aCwgQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HKTsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIG9uU2lua1N0b3BwZWQoU3RyaW5nIHBhdGgpIHsKLSAgICAgICAgdXBkYXRlU3RhdGUocGF0aCwgQmx1ZXRvb3RoQTJkcC5TVEFURV9DT05ORUNURUQpOwotICAgIH0KLQotICAgIHByaXZhdGUgc3luY2hyb25pemVkIGZpbmFsIFN0cmluZyBsb29rdXBBZGRyZXNzKFN0cmluZyBwYXRoKSB7Ci0gICAgICAgIGlmIChtQXVkaW9EZXZpY2VzID09IG51bGwpIHJldHVybiBudWxsOwotICAgICAgICBTaW5rU3RhdGUgc2luayA9IG1BdWRpb0RldmljZXMuZ2V0KHBhdGgpOwotICAgICAgICBpZiAoc2luayA9PSBudWxsKSB7Ci0gICAgICAgICAgICBMb2cudyhUQUcsICJsb29rdXBBZGRyZXNzKCkgY2FsbGVkIGZvciB1bmtub3duIGRldmljZSAiICsgcGF0aCk7Ci0gICAgICAgICAgICB1cGRhdGVTdGF0ZShwYXRoLCBCbHVldG9vdGhBMmRwLlNUQVRFX0RJU0NPTk5FQ1RFRCk7Ci0gICAgICAgIH0KLSAgICAgICAgU3RyaW5nIGFkZHJlc3MgPSBtQXVkaW9EZXZpY2VzLmdldChwYXRoKS5hZGRyZXNzOwotICAgICAgICBpZiAoYWRkcmVzcyA9PSBudWxsKSBMb2cuZShUQUcsICJDYW4ndCBmaW5kIGFkZHJlc3MgZm9yICIgKyBwYXRoKTsKLSAgICAgICAgcmV0dXJuIGFkZHJlc3M7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgZmluYWwgU3RyaW5nIGxvb2t1cFBhdGgoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgaWYgKG1BdWRpb0RldmljZXMgPT0gbnVsbCkgcmV0dXJuIG51bGw7Ci0KLSAgICAgICAgZm9yIChTdHJpbmcgcGF0aCA6IG1BdWRpb0RldmljZXMua2V5U2V0KCkpIHsKLSAgICAgICAgICAgIGlmIChhZGRyZXNzLmVxdWFscyhtQXVkaW9EZXZpY2VzLmdldChwYXRoKS5hZGRyZXNzKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBwYXRoOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBudWxsOwotICAgIH0KLQotICAgIHByaXZhdGUgc3luY2hyb25pemVkIExpc3Q8U3RyaW5nPiBsb29rdXBTaW5rc01hdGNoaW5nU3RhdGVzKGludFtdIHN0YXRlcykgewotICAgICAgICBMaXN0PFN0cmluZz4gc2lua3MgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKLSAgICAgICAgaWYgKG1BdWRpb0RldmljZXMgPT0gbnVsbCkgeworICAgIHByaXZhdGUgc3luY2hyb25pemVkIFNldDxCbHVldG9vdGhEZXZpY2U+IGxvb2t1cFNpbmtzTWF0Y2hpbmdTdGF0ZXMoaW50W10gc3RhdGVzKSB7CisgICAgICAgIFNldDxCbHVldG9vdGhEZXZpY2U+IHNpbmtzID0gbmV3IEhhc2hTZXQ8Qmx1ZXRvb3RoRGV2aWNlPigpOworICAgICAgICBpZiAobUF1ZGlvRGV2aWNlcy5pc0VtcHR5KCkpIHsKICAgICAgICAgICAgIHJldHVybiBzaW5rczsKICAgICAgICAgfQotICAgICAgICBmb3IgKFNpbmtTdGF0ZSBzaW5rIDogbUF1ZGlvRGV2aWNlcy52YWx1ZXMoKSkgeworICAgICAgICBmb3IgKEJsdWV0b290aERldmljZSBkZXZpY2U6IG1BdWRpb0RldmljZXMua2V5U2V0KCkpIHsKKyAgICAgICAgICAgIGludCBzaW5rU3RhdGUgPSBnZXRTaW5rU3RhdGUoZGV2aWNlKTsKICAgICAgICAgICAgIGZvciAoaW50IHN0YXRlIDogc3RhdGVzKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHNpbmsuc3RhdGUgPT0gc3RhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgc2lua3MuYWRkKHNpbmsuYWRkcmVzcyk7CisgICAgICAgICAgICAgICAgaWYgKHN0YXRlID09IHNpbmtTdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICBzaW5rcy5hZGQoZGV2aWNlKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQpAQCAtNDQxLDU3ICs0MzgsMTMgQEAKICAgICAgICAgcmV0dXJuIHNpbmtzOwogICAgIH0KIAotICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgdXBkYXRlU3RhdGUoU3RyaW5nIHBhdGgsIGludC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5TVEFURV9ESVNDT05ORUNURUQpIHsKLSAgICAgICAgICAgICAgICBtU2lua0NvdW50LS07Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEEyZHAuU0lOS19TVEFURV9DSEFOR0VEX0FDVElPTik7Ci0gICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LkFERFJFU1MsIGFkZHJlc3MpOwotICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEEyZHAuU0lOS19QUkVWSU9VU19TVEFURSwgcHJldlN0YXRlKTsKLSAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhBMmRwLlNJTktfU1RBVEUsIHN0YXRlKTsKLSAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfUEVSTSk7Ci0KLSAgICAgICAgICAgIGlmICgocHJldlN0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVEIHx8Ci0gICAgICAgICAgICAgICAgIHByZXZTdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpICYmCi0gICAgICAgICAgICAgICAgICAgIChzdGF0ZSAhPSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RJTkcgJiYKLSAgICAgICAgICAgICAgICAgICAgIHN0YXRlICE9IEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVEICYmCi0gICAgICAgICAgICAgICAgICAgICBzdGF0ZSAhPSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpKSB7Ci0gICAgICAgICAgICAgICAgLy8gZGlzY29ubmVjdGVkCi0gICAgICAgICAgICAgICAgaW50ZW50ID0gbmV3IEludGVudChBdWRpb01hbmFnZXIuQUNUSU9OX0FVRElPX0JFQ09NSU5HX05PSVNZKTsKLSA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gICAvKioKLSAgICAgKiBCcmluZyBkb3duIGJsdWV0b290aCBhbmQgZGlzYWJsZSBCVCBpbiBzZXR0aW5ncy4gUmV0dXJucyB0cnVlIG9uIHN1Y2Nlc3MuCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gZGlzYWJsZSgpIHsKLSAgICAgICAgcmV0dXJuIGRpc2FibGUodHJ1ZSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQnJpbmcgZG93biBibHVldG9vdGguIFJldHVybnMgdHJ1ZSBvbiBzdWNjZXNzLgotICAgICAqCi0gICAgICogQHBhcmFtIHNhdmVTZXR0aW5nIElmIHRydWUsIGRpc2FibGUgQlQgaW4gc2V0dGluZ3MKLSAgICAgKi8KLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZGlzYWJsZShib29sZWFuIHNhdmVTZXR0aW5nKSB7Ci0gICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7Ci0KLSAgICAgICAgc3dpdGNoIChtQmx1ZXRvb3RoU3RhdGUpIHsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQkxVRVRPT1RIX1NUQVRFX09GRjoKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CTFVFVE9PVEhfU1RBVEVfT046Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotICAgICAgICBpZiAobUVuYWJsZVRocmVhZCAhPSBudWxsICYmIG1FbmFibGVUaHJlYWQuaXNBbGl2ZSgpKSB7Ci0gICAgICAgICAgICByZXR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gICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBNRVNTQUdFX0ZJTklTSF9ESVNBQkxFOgotICAgICAgICAgICAgICAgIGZpbmlzaERpc2FibGUobXNnLmFyZzEgIT0gMCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9OwotCi0gICAgcHJpdmF0ZSBFbmFibGVUaHJlYWQgbUVuYWJsZVRocmVhZDsKLQotICAgIHByaXZhdGUgY2xhc3MgRW5hYmxlVGhyZWFkIGV4dGVuZHMgVGhyZWFkIHsKLSAgICAgICAgcHJpdmF0ZSBmaW5hbCBib29sZWFuIG1TYXZlU2V0dGluZzsKLSAgICAgICAgcHVibGljIEVuYWJsZVRocmVhZChib29sZWFuIHNhdmVTZXR0aW5nKSB7Ci0gICAgICAgICAgICBtU2F2ZVNldHRpbmcgPSBzYXZlU2V0dGluZzsKLSAgICAgICAgfQotICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICBib29sZWFuIHJlcyA9IChlbmFibGVOYXRpdmUoKSA9PSAwKTsKLSAgICAgICAgICAgIGlmIChyZXMpIHsKLSAgICAgICAgICAgICAgICBpbnQgcmV0cnlDb3VudCA9IDI7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBydW5uaW5nID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgd2hpbGUgKChyZXRyeUNvdW50LS0gPiAwKSAmJiAhcnVubmluZykgewotICAgICAgICAgICAgICAgICAgICBtRXZlbnRMb29wLnN0YXJ0KCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGl0IG1heSB0YWtlIGEgbW9tZW1lbnQgZm9yIHRoZSBvdGhlciB0aHJlYWQgdG8gZG8gaXRzCi0gICAgICAgICAgICAgICAgICAgIC8vIHRoaW5nLiAgQ2hlY2sgcGVyaW9kaWNhbGx5IGZvciBhIHdoaWxlLgotICAgICAgICAgICAgICAgICAgICBpbnQgcG9sbENvdW50ID0gNTsKLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChwb2xsQ291bnQtLSA+IDApICYmICFydW5uaW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUV2ZW50TG9vcC5pc0V2ZW50TG9vcFJ1bm5pbmcoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaHJlYWQuc2xlZXAoMTAwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHt9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFydW5uaW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxvZygiYnQgRW5hYmxlVGhyZWFkIGdpdmluZyB1cCIpOwotICAgICAgICAgICAgICAgICAgICByZXMgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgZGlzYWJsZU5hdGl2ZSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICBpZiAocmVzKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1TYXZlU2V0dGluZykgewotICAgICAgICAgICAgICAgICAgICBwZXJzaXN0Qmx1ZXRvb3RoT25TZXR0aW5nKHRydWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtSXNEaXNjb3ZlcmluZyA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1Cb25kU3RhdGUubG9hZEJvbmRTdGF0ZSgpOwotICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtSGFuZGxlci5vYnRhaW5NZXNzYWdlKE1FU1NBR0VfUkVHSVNURVJfU0RQX1JFQ09SRFMpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMDAwKTsKLQotICAgICAgICAgICAgICAgIC8vIExvZyBibHVldG9vdGggb24gdG8gYmF0dGVyeSBzdGF0cy4KLSAgICAgICAgICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlQmx1ZXRvb3RoT24oKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1FbmFibGVUaHJlYWQgPSBudWxsOwotCi0gICAgICAgICAgICBzZXRCbHVldG9vdGhTdGF0ZShyZXMgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlLkJMVUVUT09USF9TVEFURV9PTiA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UuQkxVRVRPT1RIX1NUQVRFX09GRik7Ci0KLSAgICAgICAgICAgIGlmIChyZXMpIHsKLSAgICAgICAgICAgICAgICAvLyBVcGRhdGUgbW9kZQotICAgICAgICAgICAgICAgIG1FdmVudExvb3Aub25Nb2RlQ2hhbmdlZChnZXRNb2RlTmF0aXZlKCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUlzQWlycGxhbmVTZW5zaXRpdmUgJiYgaXNBaXJwbGFuZU1v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NrZXIKLSAgICAgICAgcHJpdmF0ZSBmaW5hbCBBcnJheUxpc3Q8U3RyaW5nPiAgbUF1dG9QYWlyaW5nQmxhY2tsaXN0ZWQgPQotICAgICAgICAgICAgICAgIG5ldyBBcnJheUxpc3Q8U3RyaW5nPihBcnJheXMuYXNMaXN0KAotICAgICAgICAgICAgICAgICAgICAgICAgIjAwOjAyOkM3IiwgIjAwOjE2OkZFIiwgIjAwOjE5OkMxIiwgIjAwOjFCOkZCIiwgIjAwOjFFOjNEIiwgIjAwOjIxOjRGIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICIwMDoyMzowNiIsICIwMDoyNDozMyIsICIwMDpBMDo3OSIsICIwMDowRTo2RCIsICIwMDoxMzpFMCIsICIwMDoyMTpFOCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiMDA6NjA6NTciLCAiMDA6MEU6OUYiLCAiMDA6MTI6MUMiLCAiMDA6MTg6OTEiLCAiMDA6MTg6OTYiLCAiMDA6MTM6MDQiLAotICAgICAgICAgICAgICAgICAgICAgICAgIjAwOjE2OkZEIiwgIjAwOjIyOkEwIiwgIjAwOjBCOjRDIiwgIjAwOjYwOjZGIiwgIjAwOjIzOjNEIiwgIjAwOkMwOjU5IiwKLSAgICAgICAgICAgICAgICAgICAgICAgICIwMDowQTozMCIsICIwMDoxRTpBRSIsICIwMDoxQzpENyIKLSAgICAgICAgICAgICAgICAgICAgICAgICkpOwotCi0gICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBsb2FkQm9uZFN0YXRlKCkgewotICAgICAgICAgICAgaWYgKG1CbHVldG9vdGhTdGF0ZSAhPSBCbHVldG9vdGhEZXZpY2UuQkxVRVRPT1RIX1NUQVRFX1RVUk5JTkdfT04pIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBTdHJpbmdbXSBib25kcyA9IGxpc3RCb25kaW5nc05hdGl2ZSgpOwotICAgICAgICAgICAgaWYgKGJvbmRzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtU3RhdGUuY2xlYXIoKTsKLSAgICAgICAgICAgIGlmIChEQkcpIGxvZygiZm91bmQgIiArIGJvbmRzLmxlbmd0aCArICIgYm9uZGVkIGRldmljZXMiKTsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIGFkZHJlc3MgOiBib25kcykgewotICAgICAgICAgICAgICAgIG1TdGF0ZS5wdXQoYWRkcmVzcy50b1VwcGVyQ2FzZSgpLCBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldEJvbmRTdGF0ZShTdHJpbmcgYWRkcmVzcywgaW50IHN0YXRlKSB7Ci0gICAgICAgICAgICBzZXRCb25kU3RhdGUoYWRkcmVzcywgc3RhdGUsIDApOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqIHJlYXNvbiBpcyBpZ25vcmVkIHVubGVzcyBzdGF0ZSA9PSBCT05EX05PVF9CT05ERUQgKi8KLSAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldEJvbmRTdGF0ZShTdHJpbmcgYWRkcmVzcywgaW50IHN0YXRlLCBpbnQgcmVhc29uKSB7Ci0gICAgICAgICAgICBpbnQgb2xkU3RhdGUgPSBnZXRCb25kU3RhdGUoYWRkcmVzcyk7Ci0gICAgICAgICAgICBpZiAob2xkU3RhdGUgPT0gc3RhdGUpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoREJHKSBsb2coYWRkcmVzcyArICIgYm9uZCBzdGF0ZSAiICsgb2xkU3RhdGUgKyAiIC0+ICIgKyBzdGF0ZSArICIgKCIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbiArICIpIik7Ci0gICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhJbnRlbnQuQk9ORF9TVEFURV9DSEFOR0VEX0FDVElPTik7Ci0gICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LkFERFJFU1MsIGFkZHJlc3MpOwotICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5CT05EX1NUQVRFLCBzdGF0ZSk7Ci0gICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LkJPTkRfUFJFVklPVVNfU1RBVEUsIG9sZFN0YXRlKTsKLSAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhEZXZpY2UuQk9ORF9OT1RfQk9OREVEKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHJlYXNvbiA8PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgInNldEJvbmRTdGF0ZSgpIGNhbGxlZCB0byB1bmJvbmQgZGV2aWNlLCBidXQgcmVhc29uIGNvZGUgaXMgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkLiBPdmVycmlkaW5nIHJlYXNvbiBjb2RlIHdpdGggQk9ORF9SRVNVTFRfUkVNT1ZFRCIpOwotICAgICAgICAgICAgICAgICAgICByZWFzb24gPSBCbHVldG9vdGhEZXZpY2UuVU5CT05EX1JFQVNPTl9SRU1PVkVEOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LlJFQVNPTiwgcmVhc29uKTsKLSAgICAgICAgICAgICAgICBtU3RhdGUucmVtb3ZlKGFkZHJlc3MpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtU3RhdGUucHV0KGFkZHJlc3MsIHN0YXRlKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQsIEJMVUVUT09USF9QRVJNKTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzQXV0b1BhaXJpbmdCbGFja2xpc3RlZChTdHJpbmcgYWRkcmVzcykgewotICAgICAgICAgICAgZm9yIChTdHJpbmcgYmxhY2tsaXN0QWRkcmVzcyA6IG1BdXRvUGFpcmluZ0JsYWNrbGlzdGVkKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGFkZHJlc3Muc3RhcnRzV2l0aChibGFja2xpc3RBZGRyZXNzKSkgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRCb25kU3RhdGUoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgICAgIEludGVnZXIgc3RhdGUgPSBtU3RhdGUuZ2V0KGFkZHJlc3MpOwotICAgICAgICAgICAgaWYgKHN0YXRlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRGV2aWNlLkJPTkRfTk9UX0JPTkRFRDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBzdGF0ZS5pbnRWYWx1ZSgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgU3RyaW5nW10gbGlzdEluU3RhdGUoaW50IHN0YXRlKSB7Ci0gICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiByZXN1bHQgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4obVN0YXRlLnNpemUoKSk7Ci0gICAgICAgICAgICBmb3IgKE1hcC5FbnRyeTxTdHJpbmcsIEludGVnZXI+IGUgOiBtU3RhdGUuZW50cnlTZXQoKSkgewotICAgICAgICAgICAgICAgIGlmICh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zeW5jaHJvbml6ZWQgaW50IGdldEF0dGVtcHQoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgICAgIEludGVnZXIgYXR0ZW1wdCA9IG1QaW5BdHRlbXB0LmdldChhZGRyZXNzKTsKLSAgICAgICAgICAgIGlmIChhdHRlbXB0ID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBhdHRlbXB0LmludFZhbHVlKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgYXR0ZW1wdChTdHJpbmcgYWRkcmVzcykgewotICAgICAgICAgICAgSW50ZWdlciBhdHRlbXB0ID0gbVBpbkF0dGVtcHQuZ2V0KGFkZHJlc3MpOwotICAgICAgICAgICAgaW50IG5ld0F0dGVtcHQ7Ci0gICAgICAgICAgICBpZiAoYXR0ZW1wdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbmV3QXR0ZW1wdCA9IDE7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG5ld0F0dGVtcHQgPSBhdHRlbXB0LmludFZhbHVlKCkgKyAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVBpbkF0dGVtcHQucHV0KGFkZHJlc3MsIG5ldyBJbnRlZ2VyKG5ld0F0dGVtcHQpKTsKLSAgICAgICAgfQotCi0gICAgfQotICAgIHByaXZhdGUgbmF0aXZlIFN0cmluZ1tdIGxpc3RCb25kaW5nc05hdGl2ZSgpOwotCi0gICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIHRvQm9uZFN0YXRlU3RyaW5nKGludCBib25kU3RhdGUpIHsKLSAgICAgICAgc3dpdGNoIChib25kU3RhdGUpIHsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9OT1RfQk9OREVEOgotICAgICAgICAgICAgcmV0dXJuICJub3QgYm9uZGVkIj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gcmV0dXJuIGJsdWV6U3RyaW5nVG9TY2FuTW9kZShnZXRNb2RlTmF0aXZlKCkpOwotICAgIH0KLSAgICBwcml2YXRlIG5hdGl2ZSBTdHJpbmcgZ2V0TW9kZU5hdGl2ZSgpOwotCi0gICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIHNldFNjYW5Nb2RlKGludCBtb2RlKSB7Ci0gICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7Ci0gICAgICAgIFN0cmluZyBibHVlek1vZGUgPSBzY2FuTW9kZVRvQmx1ZXpTdHJpbmcobW9kZSk7Ci0gICAgICAgIGlmIChibHVlek1vZGUgIT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIHNldE1vZGVOYXRpdmUoYmx1ZXpNb2RlKTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2V0TW9kZU5hdGl2ZShTdHJpbmcgbW9kZSk7Ci0KLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZGlzY29ubmVjdFJlbW90ZURldmljZUFjbChTdHJpbmcgYWRkcmVzcykgewotICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX0FETUlOX1BFUk0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBCTFVFVE9PVEhfQURNSU4gcGVybWlzc2lvbiIpOwotICAgICAgICBpZiAoIUJsdWV0b290aERldmljZS5jaGVja0JsdWV0b290aEFkZHJlc3MoYWRkcmVzcykpIHsKLSA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ZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKLSAgICAgICAgaWYgKCFCbHVldG9vdGhEZXZpY2UuY2hlY2tCbHVldG9vdGhBZGRyZXNzKGFkZHJlc3MpKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgYWRkcmVzcyA9IGFkZHJlc3MudG9VcHBlckNhc2UoKTsKLSAgICAgICAgaWYgKG1Cb25kU3RhdGUuZ2V0Qm9uZFN0YXRlKGFkZHJlc3MpICE9IEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkcpIHsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIG1Cb25kU3RhdGUuc2V0Qm9uZFN0YXRlKGFkZHJlc3MsIEJsdWV0b290aERldmljZS5CT05EX05PVF9CT05ERUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5VTkJPTkRfUkVBU09OX0FVVEhfQ0FOQ0VMRUQpOwotICAgICAgICBjYW5jZWxCb25kaW5nUHJvY2Vzc05hdGl2ZShhZGRyZXNzKTsKLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gY2FuY2VsQm9uZGluZ1Byb2Nlc3NOYXRpdmUoU3RyaW5nIGFkZHJlc3MpOwotCi0gICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIHJlbW92ZUJvbmQoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAotICAgICAgICAgICAgICAgICAgICAgICAgICAg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ICAgIGlmIChkYXRhID09IG51bGwpIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgInNldFBpbigiICsgYWRkcmVzcyArICIpIGNhbGxlZCBidXQgbm8gbmF0aXZlIGRhdGEgYXZhaWxhYmxlLCAiICsKLSAgICAgICAgICAgICAgICAgICJpZ25vcmluZy4gTWF5YmUgdGhlIFBhc3NrZXlBZ2VudCBSZXF1ZXN0IHdhcyBjYW5jZWxsZWQgYnkgdGhlIHJlbW90ZSBkZXZpY2UiICsKLSAgICAgICAgICAgICAgICAgICIgb3IgYnkgYmx1ZXouXG4iKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotICAgICAgICAvLyBibHVleiBBUEkgd2FudHMgcGluIGFzIGEgc3RyaW5nCi0gICAgICAgIFN0cmluZyBwaW5TdHJpbmc7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBwaW5TdHJpbmcgPSBuZXcgU3RyaW5nKHBpbiwgIlVURjgiKTsKLSAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiB1ZWUpIHsKLSAgICAgICAgICAgIExvZy5lKFRBRywgIlVURjggbm90IHN1cHBvcnRlZD8hPyIpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzZXRQaW5OYXRpdmUoYWRkcmVzcywgcGluU3RyaW5nLCBkYXRhLmludFZhbHVlKCkpOwotICAgIH0KLSAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIHNldFBpbk5hdGl2ZShTdHJpbmcgYWRkcmVzcywgU3RyaW5nIHBpbiwgaW50IG5hdGl2ZURhdGEpOwotCi0gICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGNhbmNlbFBpbihTdHJpbmcgYWRkcmVzcykgewotICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVR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CkgewotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgewotICAgICAgICAgICAgU3RyaW5nIGFjdGlvbiA9IGludGVudC5nZXRBY3Rpb24oKTsKLSAgICAgICAgICAgIGlmIChhY3Rpb24uZXF1YWxzKEludGVudC5BQ1RJT05fQUlSUExBTkVfTU9ERV9DSEFOR0VEKSkgewotICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlciByZXNvbHZlciA9IGNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7Ci0gICAgICAgICAgICAgICAgLy8gUXVlcnkgdGhlIGFpcnBsYW5lIG1vZGUgZnJvbSBTZXR0aW5ncy5TeXN0ZW0ganVzdCB0byBtYWtlIHN1cmUgdGhhdAotICAgICAgICAgICAgICAgIC8vIHNvbWUgcmFuZG9tIGFwcCBpcyBub3Qgc2VuZGluZyB0aGlzIGludGVudCBhbmQgZGlzYWJsaW5nIGJsdWV0b290aAotICAgICAgICAgICAgICAgIGJvb2xlYW4gZW5hYmxlZCA9ICFpc0FpcnBsYW5lTW9kZU9uKCk7Ci0gICAgICAgICAgICAgICAgLy8gSWYgYmx1ZXRvb3RoIGlzIGN1cnJlbnRseSBleHBlY3RlZCB0byBiZSBvbiwgdGhlbiBlbmFibGUgb3IgZGlzYWJsZSBibHVldG9vdGgKLSAgICAgICAgICAgICAgICBpZiAoU2V0dGluZ3MuU2VjdXJlLmdldEludChyZXNvbHZlciwgU2V0dGluZ3MuU2VjdXJlLkJMVUVUT09USF9PTiwgMCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChlbmFibGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbmFibGUoZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZShmYWxzZSk7Ci0gICAgICAgICAgIC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ERV9PTiwgMCkgPT0gMTsKLSAgICB9Ci0KLSAgICBAT3ZlcnJpZGUKLSAgICBwcm90ZWN0ZWQgdm9pZCBkdW1wKEZpbGVEZXNjcmlwdG9yIGZkLCBQcmludFdyaXRlciBwdywgU3RyaW5nW10gYXJncykgewotICAgICAgICBwdy5wcmludGxuKCJcbm1Jc0FpcnBsYW5lU2Vuc2l0aXZlID0gIiArIG1Jc0FpcnBsYW5lU2Vuc2l0aXZlICsgIlxuIik7Ci0KLSAgICAgICAgc3dpdGNoKG1CbHVldG9vdGhTdGF0ZSkgewotICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CTFVFVE9PVEhfU1RBVEVfT0ZGOgotICAgICAgICAgICAgcHcucHJpbnRsbigiXG5CbHVldG9vdGggT0ZGXG4iKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQkxVRVRPT1RIX1NUQVRFX1RVUk5JTkdfT046Ci0gICAgICAgICAgICBwdy5wcmludGxuKCJcbkJsdWV0b290aCBUVVJOSU5HIE9OXG4iKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQkxVRVRPT1RIX1NUQVRFX1RVUk5JTkdfT0ZGOgotICAgICAgICAgICAgcHcucHJpbnRsbigiXG5CbHVldG9vdGggVFVSTklORyBPRkZcbiIpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5CTFVFVE9PVEhfU1RBVEVfT046Ci0gICAgICAgICAgICBwdy5wcmludGxuKCJcbkJsdWV0b290aCBPTlxuIik7Ci0gICAgICAgIH0KLQotICAgICAgICBwdy5wcmludGxuKCJcbkxvY2FsIGFkZHJlc3MgPSAiICsgZ2V0QWRkcmVzcygpKTsKLSAgICAgICAgcHcucHJpbnRsbigiXG5Mb2NhbCBuYW1lID0gIiArIGdldE5hbWUoKSk7Ci0gICAgICAgIHB3L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sbCkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOwotICAgICAgICB9Ci0gICAgICAgIG1vZGUgPSBtb2RlLnRvTG93ZXJDYXNlKCk7Ci0gICAgICAgIGlmIChtb2RlLmVxdWFscygib2ZmIikpIHsKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhEZXZpY2UuU0NBTl9NT0RFX05PTkU7Ci0gICAgICAgIH0gZWxzZSBpZiAobW9kZS5lcXVhbHMoImNvbm5lY3RhYmxlIikpIHsKLSAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhEZXZpY2UuU0NBTl9NT0RFX0NPTk5FQ1RBQkxFOwotICAgICAgICB9IGVsc2UgaWYgKG1vZGUuZXF1YWxzKCJkaXNjb3ZlcmFibGUiKSkgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aERldmljZS5TQ0FOX01PREVfQ09OTkVDVEFCTEVfRElTQ09WRVJBQkxFOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEVycm9yLkVSUk9SOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogcGFja2FnZSAqLyBzdGF0aWMgU3RyaW5nIHNjYW5Nb2RlVG9CbHVlelN0cmluZyhpbnQgbW9kZSkgewotICAgICAgICBzd2l0Y2ggKG1vZGUpIHsKLSAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuU0NBTl9NT0RFX05PTkU6Ci0gICAgICAgICAgICByZXR1cm4gIm9mZiI7Ci0gICAgICAgIGNhc2UgQmx1ZXRvb3RoRGV2aWNlLlNDQU5fTU9ERV9DT05ORUNUQUJMRToKLSAgICAgICAgICAgIHJldHVybiAiY29ubmVjdGFibGUiOwotICAgICAgICBjYXNlIEJsdWV0b290aERldmljZS5TQ0FOX01PREVfQ09OTkVDVEFCTEVfRElTQ09WRVJBQkxFOgotICAgICAgICAgICAgcmV0dXJuICJkaXNjb3ZlcmFibGUiOwotICAgIC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AgICAgICBpZiAocnNzaSAhPSBudWxsKSB7CisgICAgICAgICAgICByc3NpVmFsdWUgPSAoc2hvcnQpSW50ZWdlci52YWx1ZU9mKHJzc2kpLmludFZhbHVlKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByc3NpVmFsdWUgPSBTaG9ydC5NSU5fVkFMVUU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGNsYXNzVmFsdWUgIT0gbnVsbCkgeworICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoQmx1ZXRvb3RoSW50ZW50LlJFTU9URV9ERVZJQ0VfRk9VTkRfQUNUSU9OKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuREVWSUNFLCBtQWRhcHRlci5nZXRSZW1vdGVEZXZpY2UoYWRkcmVzcykpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5DTEFTUywgSW50ZWdlci52YWx1ZU9mKGNsYXNzVmFsdWUpKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuUlNTSSwgcnNzaVZhbHVlKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuTkFNRSwgbmFtZSk7CisKICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfUEVSTSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBsb2cgKCJDbGFzc1ZhbHVlOiAiICsgY2xhc3NWYWx1ZSArICIgZm9yIHJlbW90ZSBkZXZpY2U6ICIgKyBhZGRyZXNzICsgIiBpcyBudWxsIik7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgb25EaXNjb3ZlcnlTdGFydGVkKCkgewotICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5zZXRJc0Rpc2N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290aEludGVudC5BRERSRVNTLCBhZGRyZXNzKTsKLSAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5DTEFTUywgZGV2aWNlQ2xhc3MpOwotICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LlJTU0ksIHJzc2kpOwotICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX1BFUk0pOwotICAgIH0KLSAgICBwcml2YXRlIHZvaWQgb25SZW1vdGVEZXZpY2VEaXNhcHBlYXJlZChTdHJpbmcgYWRkcmVzcykgeworICAgIHByaXZhdGUgdm9pZCBvbkRldmljZURpc2FwcGVhcmVkKFN0cmluZyBhZGRyZXNzKSB7CiAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5SRU1PVEVfREVWSUNFX0RJU0FQUEVBUkVEX0FDVElPTik7Ci0gICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuQUREUkVTUywgYWRkcmVzcyk7Ci0gICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfUEVSTSk7Ci0gICAgfQotICAgIHByaXZhdGUgdm9pZCBvblJlbW90ZUNsYXNzVXBkYXRlZChTdHJpbmcgYWRkcmVzcywgaW50IGRldmljZUNsYXNzKSB7Ci0gICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5SRU1PVEVfREVWSUNFX0NMQVNTX1VQREFURURfQUNUSU9OKTsKLSAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5BRERSRVNTLCBhZGRyZXNzKTsKLSAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5DTEFTUywgZGV2aWNlQ2xhc3MpOwotICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjY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mdldEJvbmRTdGF0ZSgpLmF0dGVtcHQoYWRkcmVzcyk7CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIG9uQm9uZGluZ0NyZWF0ZWQoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgbUJsdWV0b290aFNlcnZpY2UuZ2V0Qm9uZFN0YXRlKCkuc2V0Qm9uZFN0YXRlKGFkZHJlc3MudG9VcHBlckNhc2UoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5CT05EX0JPTkRFRCk7CisgICAgcHJpdmF0ZSB2b2lkIG9uRGV2aWNlQ3JlYXRlZChTdHJpbmcgZGV2aWNlT2JqZWN0UGF0aCkgeworICAgICAgICBTdHJpbmcgYWRkcmVzcyA9IG1CbHVldG9vdGhTZXJ2aWNlLmdldEFkZHJlc3NGcm9tT2JqZWN0UGF0aChkZXZpY2VPYmplY3RQYXRoKTsKKyAgICAgICAgaWYgKCFtQmx1ZXRvb3RoU2VydmljZS5pc1JlbW90ZURldmljZUluQ2FjaGUoYWRkcmVzcykpIHsKKyAgICAgICAgICAgIC8vIEluY29taW5nIGNvbm5lY3Rpb24sIHdlIGhhdmVuJ3Qgc2VlbiB0aGlzIGRldmljZSwgYWRkIHRvIGNhY2hlLgorICAgICAgICAgICAgU3RyaW5nW10gcHJvcGVydGllcyA9IG1CbHVldG9vdGhTZXJ2aWNlLmdldFJlbW90ZURldmljZVByb3BlcnRpZXMoYWRkcmVzcyk7CisgICAgICAgICAgICBpZiAocHJvcGVydGllcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYWRkRGV2aWNlKGFkZHJlc3MsIHByb3BlcnRpZXMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybjsKICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgb25Cb25kaW5nUmVtb3ZlZChTdHJpbmcgYWRkcmVzcykgewotICAgICAgICBtQ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ydmljZS5pc0FkYXB0ZXJQcm9wZXJ0aWVzRW1wdHkoKSkgeworICAgICAgICAgICAgLy8gV2UgaGF2ZSBnb3QgYSBwcm9wZXJ0eSBjaGFuZ2UgYmVmb3JlCisgICAgICAgICAgICAvLyB3ZSBmaWxsZWQgdXAgb3VyIGNhY2hlLgorICAgICAgICAgICAgbUJsdWV0b290aFNlcnZpY2UuZ2V0QWxsUHJvcGVydGllcygpOworICAgICAgICB9CisgICAgICAgIFN0cmluZyBuYW1lID0gcHJvcFZhbHVlc1swXTsKKyAgICAgICAgaWYgKG5hbWUuZXF1YWxzKCJOYW1lIikpIHsKKyAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5OQU1FX0NIQU5HRURfQUNUSU9OKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuTkFNRSwgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX1BFUk0pOworICAgICAgICAgICAgbUJsdWV0b290aFNlcnZpY2Uuc2V0UHJvcGVydHkobmFtZSwgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIlBhaXJhYmxlIikgfHwgbmFtZS5lcXVhbHMoIkRpc2NvdmVyYWJsZSIpKSB7CisgICAgICAgICAgICBTdHJpbmcgcGFpcmFibGUgPSBuYW1lLmVxdWFscygiUGFpcmFibGUiKSA/IHByb3BWYWx1ZXNbMV0gOgorICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLmdldFByb3BlcnR5KCJQYWlyYWJsZSIpOworICAgICAgICAgICAgU3RyaW5nIGRpc2NvdmVyYWJsZSA9IG5hbWUuZXF1YWxzKCJEaXNjb3ZlcmFibGUiKSA/IHByb3BWYWx1ZXNbMV0gOgorICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLmdldFByb3BlcnR5KCJEaXNjb3ZlcmFibGUiKTsKKworICAgICAgICAgICAgLy8gVGhpcyBzaG91bGRuJ3QgaGFwcGVuLCB1bmxlc3MgQWRhcHRlciBQcm9wZXJ0aWVzIGFyZSBudWxsLgorICAgICAgICAgICAgaWYgKHBhaXJhYmxlID09IG51bGwgfHwgZGlzY292ZXJhYmxlID09IG51bGwpCisgICAgICAgICAgICAgICAgcmV0dXJuOworCisgICAgICAgICAgICBpbnQgbW9kZSA9IEJsdWV0b290aFNlcnZpY2UuYmx1ZXpTdHJpbmdUb1NjYW5Nb2RlKAorICAgICAgICAgICAgICAgICAgICBwYWlyYWJsZS5lcXVhbHMoInRydWUiKSwKKyAgICAgICAgICAgICAgICAgICAgZGlzY292ZXJhYmxlLmVxdWFscygidHJ1ZSIpKTsKKyAgICAgICAgICAgIGlmIChtb2RlID49IDApIHsKKyAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhBZGFwdGVyLkFDVElPTl9TQ0FOX01PREVfQ0hBTkdFRCk7CisgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEFkYXB0ZXIuRVhUUkFfU0NBTl9NT0RFLCBtb2RlKTsKKyAgICAgICAgICAgICAgICBpbnRlbnQuYWRkRmxhZ3MoSW50ZW50LkZMQUdfUkVDRUlWRVJfUkVHSVNURVJFRF9PTkxZX0JFRk9SRV9CT09UKTsKKyAgICAgICAgICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX1BFUk0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUJsdWV0b290aFNlcnZpY2Uuc2V0UHJvcGVydHkobmFtZSwgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIkRpc2NvdmVyaW5nIikpIHsKKyAgICAgICAgICAgIEludGVudCBpbnRlbnQ7CisgICAgICAgICAgICBpZiAocHJvcFZhbHVlc1sxXS5lcXVhbHMoInRydWUiKSkgeworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLnNldElzRGlzY292ZXJpbmcodHJ1ZSk7CisgICAgICAgICAgICAgICAgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhJbnRlbnQuRElTQ09WRVJZX1NUQVJURURfQUNUSU9OKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gU3RvcCB0aGUgZGlzY292ZXJ5LgorICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLmNhbmNlbERpc2NvdmVyeSgpOworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLnNldElzRGlzY292ZXJpbmcoZmFsc2UpOworICAgICAgICAgICAgICAgIGludGVudCA9IG5ldyBJbnRlbnQoQmx1ZXRvb3RoSW50ZW50LkRJU0NPVkVSWV9DT01QTEVURURfQUNUSU9OKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfUEVSTSk7CisgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5zZXRQcm9wZXJ0eShuYW1lLCBwcm9wVmFsdWVzWzFdKTsKKyAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygiRGV2aWNlcyIpKSB7CisgICAgICAgICAgICBTdHJpbmcgdmFsdWUgPSBudWxsOworICAgICAgICAgICAgaW50IGxlbiA9IEludGVnZXIudmFsdWVPZihwcm9wVmFsdWVzWzFdKTsKKyAgICAgICAgICAgIGlmIChsZW4gPiAwKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzdHIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAyOyBpIDwgcHJvcFZhbHVlcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBzdHIuYXBwZW5kKHByb3BWYWx1ZXNbaV0pOworICAgICAgICAgICAgICAgICAgICBzdHIuYXBwZW5kKCIsIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZhbHVlID0gc3RyLnRvU3RyaW5nKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5zZXRQcm9wZXJ0eShuYW1lLCB2YWx1ZSk7CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIlBvd2VyZWQiKSkgeworICAgICAgICAgICAgLy8gYmx1ZXRvb3RoZCBoYXMgcmVzdGFydGVkLCByZS1yZWFkIGFsbCBvdXIgcHJvcGVydGllcy4KKyAgICAgICAgICAgIC8vIE5vdGU6IGJsdWV6IG9ubHkgc2VuZHMgdGhpcyBwcm9wZXJ0eSBjaGFuZ2Ugd2hlbiBpdCByZXN0YXJ0cy4KKyAgICAgICAgICAgIGlmIChwcm9wVmFsdWVzWzFdLmVxdWFscygidHJ1ZSIpKQorICAgICAgICAgICAgICAgIG9uUmVzdGFydFJlcXVpcmVkKCk7CisgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgb25QYXNza2V5QWdlbnRSZXF1ZXN0KFN0cmluZyBhZGRyZXNzLCBpbnQgbmF0aXZlRGF0YSkgeworICAgIHByaXZhdGUgdm9pZCBvbkRldmljZVByb3BlcnR5Q2hhbmdlZChTdHJpbmcgZGV2aWNlT2JqZWN0UGF0aCwgU3RyaW5nW10gcHJvcFZhbHVlcykgeworICAgICAgICBTdHJpbmcgbmFtZSA9IHByb3BWYWx1ZXNbMF07CisgICAgICAgIFN0cmluZyBhZGRyZXNzID0gbUJsdWV0b290aFNlcnZpY2UuZ2V0QWRkcmVzc0Zyb21PYmplY3RQYXRoKGRldmljZU9iamVjdFBhdGgpOworICAgICAgICBpZiAoYWRkcmVzcyA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJvbkRldmljZVByb3BlcnR5Q2hhbmdlZDogQWRkcmVzcyBvZiB0aGUgcmVtb3RlIGRldmljZSBpbiBudWxsIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9IG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKTsKKyAgICAgICAgaWYgKG5hbWUuZXF1YWxzKCJOYW1lIikpIHsKKyAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5SRU1PVEVfTkFNRV9VUERBVEVEX0FDVElPTik7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LkRFVklDRSwgZGV2aWNlKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuTkFNRSwgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX1BFUk0pOworICAgICAgICAgICAgbUJsdWV0b290aFNlcnZpY2Uuc2V0UmVtb3RlRGV2aWNlUHJvcGVydHkoYWRkcmVzcywgbmFtZSwgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIkNsYXNzIikpIHsKKyAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5SRU1PVEVfREVWSUNFX0NMQVNTX1VQREFURURfQUNUSU9OKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuREVWSUNFLCBkZXZpY2UpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5DTEFTUywgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX1BFUk0pOworICAgICAgICAgICAgbUJsdWV0b290aFNlcnZpY2Uuc2V0UmVtb3RlRGV2aWNlUHJvcGVydHkoYWRkcmVzcywgbmFtZSwgcHJvcFZhbHVlc1sxXSk7CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIkNvbm5lY3RlZCIpKSB7CisgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChwcm9wVmFsdWVzWzFdLmVxdWFscygidHJ1ZSIpKSB7CisgICAgICAgICAgICAgICAgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhJbnRlbnQuUkVNT1RFX0RFVklDRV9DT05ORUNURURfQUNUSU9OKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhJbnRlbnQuUkVNT1RFX0RFVklDRV9ESVNDT05ORUNURURfQUNUSU9OKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuREVWSUNFLCBkZXZpY2UpOworICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQsIEJMVUVUT09USF9QRVJNKTsKKyAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLnNldFJlbW90ZURldmljZVByb3BlcnR5KGFkZHJlc3MsIG5hbWUsIHByb3BWYWx1ZXNbMV0pOworICAgICAgICB9IGVsc2UgaWYgKG5hbWUuZXF1YWxzKCJVVUlEcyIpKSB7CisgICAgICAgICAgICBTdHJpbmcgdXVpZCA9IG51bGw7CisgICAgICAgICAgICBpbnQgbGVuID0gSW50ZWdlci52YWx1ZU9mKHByb3BWYWx1ZXNbMV0pOworICAgICAgICAgICAgaWYgKGxlbiA+IDApIHsKKyAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHN0ciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDI7IGkgPCBwcm9wVmFsdWVzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHN0ci5hcHBlbmQocHJvcFZhbHVlc1tpXSk7CisgICAgICAgICAgICAgICAgICAgIHN0ci5hcHBlbmQoIiwiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdXVpZCA9IHN0ci50b1N0cmluZygpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUJsdWV0b290aFNlcnZpY2Uuc2V0UmVtb3RlRGV2aWNlUHJvcGVydHkoYWRkcmVzcywgbmFtZSwgdXVpZCk7CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIlBhaXJlZCIpKSB7CisgICAgICAgICAgICBpZiAocHJvcFZhbHVlc1sxXS5lcXVhbHMoInRydWUiKSkgeworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLmdldEJvbmRTdGF0ZSgpLnNldEJvbmRTdGF0ZShhZGRyZXNzLCBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5nZXRCb25kU3RhdGUoKS5zZXRCb25kU3RhdGUoYWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5CT05EX05PVF9CT05ERUQpOworICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTZXJ2aWNlLnNldFJlbW90ZURldmljZVByb3BlcnR5KGFkZHJlc3MsICJUcnVzdGVkIiwgImZhbHNlIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIlRydXN0ZWQiKSkgeworICAgICAgICAgICA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bHVldG9vdGhBZGFwdGVyLlNUQVRFX1RVUk5JTkdfT0ZGKSB7CiAgICAgICAgICAgICAvLyBzaHV0ZG93biBwYXRoCi0gICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5jYW5jZWxQaW4oYWRkcmVzcyk7Ci0gICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5jYW5jZWxQYWlyaW5nVXNlcklucHV0KGFkZHJlc3MpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGFkZHJlc3M7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIG9uUmVxdWVzdENvbmZpcm1hdGlvbihTdHJpbmcgb2JqZWN0UGF0aCwgaW50IHBhc3NrZXksIGludCBuYXRpdmVEYXRhKSB7CisgICAgICAgIFN0cmluZyBhZGRyZXNzID0gY2hlY2tQYWlyaW5nUmVxdWVzdEFuZEdldEFkZHJlc3Mob2JqZWN0UGF0aCwgbmF0aXZlRGF0YSk7CisgICAgICAgIGlmIChhZGRyZXNzID09IG51bGwpIHJldHVybjsKKworICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhJbnRlbnQuUEFJUklOR19SRVFVRVNUX0FDVElPTik7CisgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuREVWSUNFLCBtQWRhcHRlci5nZXRSZW1vdGVEZXZpY2UoYWRkcmVzcykpOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LlBBU1NLRVksIHBhc3NrZXkpOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LlBBSVJJTkdfVkFSSUFOVCwKKyAgICAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UuUEFJUklOR19WQVJJQU5UX0NPTkZJUk1BVElPTik7CisgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfQURNSU5fUEVSTSk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgb25SZXF1ZXN0UGFzc2tleShTdHJpbmcgb2JqZWN0UGF0aCwgaW50IG5hdGl2ZURhdGEpIHsKKyAgICAgICAgU3RyaW5nIGFkZHJlc3MgPSBjaGVja1BhaXJpbmdSZXF1ZXN0QW5kR2V0QWRkcmVzcyhvYmplY3RQYXRoLCBuYXRpdmVEYXRhKTsKKyAgICAgICAgaWYgKGFkZHJlc3MgPT0gbnVsbCkgcmV0dXJuOworCisgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5QQUlSSU5HX1JFUVVFU1RfQUNUSU9OKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5ERVZJQ0UsIG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKSk7CisgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuUEFJUklOR19WQVJJQU5ULCBCbHVldG9vdGhEZXZpY2UuUEFJUklOR19WQVJJQU5UX1BBU1NLRVkpOworICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX0FETUlOX1BFUk0pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIG9uUmVxdWVzdFBpbkNvZGUoU3RyaW5nIG9iamVjdFBhdGgsIGludCBuYXRpdmVEYXRhKSB7CisgICAgICAgIFN0cmluZyBhZGRyZXNzID0gY2hlY2tQYWlyaW5nUmVxdWVzdEFuZEdldEFkZHJlc3Mob2JqZWN0UGF0aCwgbmF0aXZlRGF0YSk7CisgICAgICAgIGlmIChhZGRyZXNzID09IG51bGwpIHJldHVybjsKIAogICAgICAgICBpZiAobUJsdWV0b290aFNlcnZpY2UuZ2V0Qm9uZFN0YXRlKCkuZ2V0Qm9uZFN0YXRlKGFkZHJlc3MpID09CiAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlLkJPTkRfQk9ORElORykgewpAQCAtMzA3LDU1ICs0MjgsNTEgQEAKICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5QQUlSSU5HX1JFUVVFU1RfQUNUSU9OKTsKLSAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5BRERSRVNTLCBhZGRyZXNzKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5ERVZJQ0UsIG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKSk7CisgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuUEFJUklOR19WQVJJQU5ULCBCbHVldG9vdGhEZXZpY2UuUEFJUklOR19WQVJJQU5UX1BJTik7CiAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50LCBCTFVFVE9PVEhfQURNSU5fUEVSTSk7CisgICAgICAgIHJldHVybjsKICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgb25QYXNza2V5QWdlbnRDYW5jZWwoU3RyaW5nIGFkZHJlc3MpIHsKLSAgICAgICAgYWRkcmVzcyA9IGFkZHJlc3MudG9VcHBlckNhc2UoKTsKLSAgICAgICAgbUJsdWV0b290aFNlcnZpY2UuY2FuY2VsUGluKGFkZHJlc3MpOwotICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChCbHVldG9vdGhJbnRlbnQuUEFJUklOR19DQU5DRUxfQUNUSU9OKTsKLSAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5BRERSRVNTLCBhZGRyZXNzKTsKLSAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQsIEJMVUVUT09USF9BRE1JTl9QRVJNKTsKLSAgICAgICAgbUJsdWV0b290aFNlcnZpY2UuZ2V0Qm9uZFN0YXRlKCkuc2V0Qm9uZFN0YXRlKGFkZHJlc3MsIEJsdWV0b290aERldmljZS5CT05EX05PVF9CT05ERUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UuVU5CT05EX1JFQVNPTl9BVVRIX0NBTkNFTEVEKTsKLSAgICB9CisgICAgcHJpdmF0ZSBib29sZWFuIG9uQWdlbnRBdXRob3JpemUoU3RyaW5nIG9iamVjdFBhdGgsIFN0cmluZyBkZXZpY2VVdWlkKSB7CisgICAgICAgIFN0cmluZyBhZGRyZXNzID0gbUJsdWV0b290aFNlcnZpY2UuZ2V0QWRkcmVzc0Zyb21PYmplY3RQYXRoKG9iamVjdFBhdGgpOworICAgICAgICBpZiAoYWRkcmVzcyA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJVbmFibGUgdG8gZ2V0IGRldmljZSBhZGRyZXNzIGluIG9uQXV0aEFnZW50QXV0aG9yaXplIik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KIAotICAgIHByaXZhdGUgYm9vbGVhbiBvbkF1dGhBZ2VudEF1dGhvcml6ZShTdHJpbmcgYWRkcmVzcywgU3RyaW5nIHNlcnZpY2UsIFN0cmluZyB1dWlkKSB7CiAgICAgICAgIGJvb2xlYW4gYXV0aG9yaXplZCA9IGZhbHNlOwotICAgICAgICBpZiAobUJsdWV0b290aFNlcnZpY2UuaXNFbmFibGVkKCkgJiYgc2VydmljZS5lbmRzV2l0aCgic2VydmljZV9hdWRpbyIpKSB7CisgICAgICAgIFVVSUQgdXVpZCA9IFVVSUQuZnJvbVN0cmluZyhkZXZpY2VVdWlkKTsKKyAgICAgICAgLy8gQmx1ZXogc2VuZHMgdGhlIFVVSUQgb2YgdGhlIGxvY2FsIHNlcnZpY2UgYmVpbmcgYWNjZXNzZWQsIF9ub3RfIHRoZQorICAgICAgICAvLyByZW1vdGUgc2VydmljZQorICAgICAgICBpZiAobUJsdWV0b290aFNlcnZpY2UuaXNFbmFibGVkKCkgJiYKKyAgICAgICAgICAgICAgICAoQmx1ZXRvb3RoVXVpZC5pc0F1ZGlvU291cmNlKHV1aWQpIHx8IEJsdWV0b290aFV1aWQuaXNBdnJjcFRhcmdldCh1dWlkKQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgQmx1ZXRvb3RoVXVpZC5pc0FkdkF1ZGlvRGlzdCh1dWlkKSkpIHsKICAgICAgICAgICAgIEJsdWV0b290aEEyZHAgYTJkcCA9IG5ldyBCbHVldG9vdGhBMmRwKG1Db250ZXh0KTsKLSAgICAgICAgICAgIGF1dGhvcml6ZWQgPSBhMmRwLmdldFNpbmtQcmlvcml0eShhZGRyZXNzKSA+IEJsdWV0b290aEEyZHAuUFJJT1JJVFlfT0ZGOworICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9IG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKTsKKyAgICAgICAgICAgIGF1dGhvcml6ZWQgPSBhMmRwLmdldFNpbmtQcmlvcml0eShkZXZpY2UpID4gQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9PRkY7CiAgICAgICAgICAgICBpZiAoYXV0aG9yaXplZCkgewotICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkFsbG93aW5nIGluY29taW5nIEEyRFAgY29ubmVjdGlvbiBmcm9tICIgKyBhZGRyZXNzKTsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJBbGxvd2luZyBpbmNvbWluZyBBMkRQIC8gQVZSQ1AgY29ubmVjdGlvbiBmcm9tICIgKyBhZGRyZXNzKTsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiUmVqZWN0aW5n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AgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgdGhyb3dzIFRocm93YWJsZSB7CisgICAgICAgIGlmIChtSXNBaXJwbGFuZVNlbnNpdGl2ZSkgeworICAgICAgICAgICAgbUNvbnRleHQudW5yZWdpc3RlclJlY2VpdmVyKG1SZWNlaXZlcik7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGNsZWFudXBOYXRpdmVEYXRhTmF0aXZlKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBzdXBlci5maW5hbGl6ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNFbmFibGVkKCkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisgICAgICAgIHJldHVybiBtQmx1ZXRvb3RoU3RhdGUgPT0gQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9PTjsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEJsdWV0b290aFN0YXRlKCkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisgICAgICAgIHJldHVybiBtQmx1ZXRvb3RoU3RhdGU7CisgICAgfQorCisKKyAgICAvKioKKyAgICAgKiBCcmluZyBkb3duIGJsdWV0b290aCBhbmQgZGlzYWJsZSBCVCBpbiBzZXR0aW5ncy4gUmV0dXJucyB0cnVlIG9uIHN1Y2Nlc3MuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gZGlzYWJsZSgpIHsKKyAgICAgICAgcmV0dXJuIGRpc2FibGUodHJ1ZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQnJpbmcgZG93biBibHVldG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XMgZG9uZSBzaHV0dGluZyBkb3duCisgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZCgKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5vYnRhaW5NZXNzYWdlKE1FU1NBR0VfRklOSVNIX0RJU0FCTEUsIHNhdmVTZXR0aW5nID8gMSA6IDAsIDApLCAzMDAwKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIGZpbmlzaERpc2FibGUoYm9vbGVhbiBzYXZlU2V0dGluZykgeworICAgICAgICBpZiAobUJsdWV0b290aFN0YXRlICE9IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfVFVSTklOR19PRkYpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBtRXZlbnRMb29wLnN0b3AoKTsKKyAgICAgICAgdGVhckRvd25OYXRpdmVEYXRhTmF0aXZlKCk7CisgICAgICAgIGRpc2FibGVOYXRpdmUoKTsKKworICAgICAgICAvLyBtYXJrIGluIHByb2dyZXNzIGJvbmRpbmdzIGFzIGNhbmNlbGxlZAorICAgICAgICBmb3IgKFN0cmluZyBhZGRyZXNzIDogbUJvbmRTdGF0ZS5saXN0SW5TdGF0ZShCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ESU5HKSkgeworICAgICAgICAgICAgbUJvbmRTdGF0ZS5zZXRCb25kU3RhdGUoYWRkcmVzcywgQmx1ZXRvb3RoRGV2aWNlLkJPTkRfTk9UX0JPTkRFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5VTkJPTkRfUkVBU09OX0FVVEhfQ0FOQ0VMRUQpOworICAgICAgICB9CisKKyAgICAgICAgLy8gdXBkYXRlIG1vZGUKKyAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoQmx1ZXRvb3RoQWRhcHRlci5BQ1RJT05fU0NBTl9NT0RFX0NIQU5HRUQpOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoQWRhcHRlci5FWFRSQV9TQ0FOX01PREUsIEJsdWV0b290aEFkYXB0ZXIuU0NBTl9NT0RFX05PTkUpOworICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCwgQkxVRVRPT1RIX1BFUk0pOworCisgICAgICAgIG1Jc0Rpc2NvdmVyaW5nID0gZmFsc2U7CisgICAgICAgIG1BZGFwdGVyUHJvcGVydGllcy5jbGVhcigpOworCisgICAgICAgIGlmIChzYXZlU2V0dGluZykgeworICAgICAgICAgICAgcGVyc2lzdEJsdWV0b290aE9uU2V0dGluZyhmYWxzZSk7CisgICAgICAgIH0KKworICAgICAgICBzZXRCbHVldG9vdGhTdGF0ZShCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09GRik7CisKKyAgICAgICAgLy8gTG9nIGJsdWV0b290aCBvZmYgdG8gYmF0dGVyeSBzdGF0cy4KKyAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlQmx1ZXRvb3RoT2ZmKCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShpZGVudCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobVJlc3RhcnQpIHsKKyAgICAgICAgICAgIG1SZXN0YXJ0ID0gZmFsc2U7CisgICAgICAgICAgICBlbmFibGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKiBCcmluZyB1cCBCVCBhbmQgcGVyc2lzdCBCVCBvbiBpbiBzZXR0aW5ncyAqLworICAgIHB1YmxpYyBib29sZWFuIGVuYWJsZSgpIHsKKyAgICAgICAgcmV0dXJuIGVuYWJsZSh0cnVlKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBFbmFibGUgdGhpcyBCbHVldG9vdGggZGV2aWNlLCBhc3luY2hyb25vdXNseS4KKyAgICAgKiBUaGlzIHR1cm5zIG9uL29mZiB0aGUgdW5kZXJseWluZyBoYXJkd2FyZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBzYXZlU2V0dGluZyBJZiB0cnVlLCBwZXJzaXN0IHRoZSBuZXcgc3RhdGUgb2YgQlQgaW4gc2V0dGluZ3MKKyAgICAgKiBAcmV0dXJuIFRydWUgb24gc3VjY2VzcyAoc28gZmFyKQorICAgICAqLworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBlbmFibGUoYm9vbGVhbiBzYXZlU2V0dGluZykgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX0FETUlOX1BFUk0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBCTFVFVE9PVEhfQURNSU4gcGVybWlzc2lvbiIpOworCisgICAgICAgIC8vIEFpcnBsYW5lIG1vZGUgY2FuIHByZXZlbnQgQmx1ZXRvb3RoIHJhZGlvIGZyb20gYmVpbmcgdHVybmVkIG9uLgorICAgICAgICBpZiAobUlzQWlycGxhbmVTZW5zaXRpdmUgJiYgaXNBaXJwbGFuZU1vZGVPbigpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1CbHVldG9vdGhTdGF0ZSAhPSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09GRikgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIGlmIChtRW5hYmxlVGhyZWFkICE9IG51bGwgJiYgbUVuYWJsZVRocmVhZC5pc0FsaXZlKCkpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBzZXRCbHVldG9vdGhTdGF0ZShCbHVldG9vdGhBZGFwdGVyLlNUQVRFX1RVUk5JTkdfT04pOworICAgICAgICBtRW5hYmxlVGhyZWFkID0gbmV3IEVuYWJsZVRocmVhZChzYXZlU2V0dGluZyk7CisgICAgICAgIG1FbmFibGVUaHJlYWQuc3RhcnQoKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLyoqIEZvcmNpYmx5IHJlc3RhcnQgQmx1ZXRvb3RoIGlmIGl0IGlzIG9uICovCisgICAgLyogcGFja2FnZSAqLyBzeW5jaHJvbml6ZWQgdm9pZCByZXN0YXJ0KCkgeworICAgICAgICBpZiAobUJsdWV0b290aFN0YXRlICE9IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfT04pIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBtUmVzdGFydCA9IHRydWU7CisgICAgICAgIGlmICghZGlzYWJsZShmYWxzZSkpIHsKKyAgICAgICAgICAgIG1SZXN0YXJ0ID0gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHNldEJsdWV0b290aFN0YXRlKGludCBzdGF0ZSkgeworICAgICAgICBpZiAoc3RhdGUgPT0gbUJsdWV0b290aFN0YXRlKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAoREJHKSBsb2coIkJsdWV0b290aCBzdGF0ZSAiICsgbUJsdWV0b290aFN0YXRlICsgIiAtPiAiICsgc3RhdGUpOworCisgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEFkYXB0ZXIuQUNUSU9OX1NUQVRFX0NIQU5HRUQpOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoQWRhcHRlci5FWFRSQV9QUkVWSU9VU19TVEFURSwgbUJsdWV0b290aFN0YXRlKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEFkYXB0ZXIuRVhUUkFfU1RBVEUsIHN0YXRlKTsKKyAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWV9CRUZPUkVfQk9PVCk7CisKKyAgICAgICAgbUJsdWV0b290aFN0YXRlID0gc3RhdGU7CisKKyAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQsIEJMVUVUT09USF9QRVJNKTsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIEhhbmRsZXIgbUhhbmRsZXIgPSBuZXcgSGFuZGxlcigpIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9SRUdJU1RFUl9TRFBfUkVDT1JEUzoKKyAgICAgICAgICAgICAgICAvL1RPRE86IERvbid0IGFzc3VtZSBIU1AvSEZQIGlzIHJ1bm5pbmcsIGRvbid0IHVzZSBzZHB0b29sLAorICAgICAgICAgICAgICAgIGlmIChpc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBTeXN0ZW1TZXJ2aWNlLnN0YXJ0KCJoc2FnIik7CisgICAgICAgICAgICAgICAgICAgIFN5c3RlbVNlcnZpY2Uuc3RhcnQoImhmYWciKTsKKyAgICAgICAgICAgICAgICAgICAgU3lzdGVtU2VydmljZS5zdGFydCgib3B1c2giKTsKKyAgICAgICAgICAgICAgICAgICAgU3lzdGVtU2VydmljZS5zdGFydCgicGJhcCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9GSU5JU0hfRElTQUJMRToKKyAgICAgICAgICAgICAgICBmaW5pc2hEaXNhYmxlKG1zZy5hcmcxICE9IDApOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHByaXZhdGUgRW5hYmxlVGhyZWFkIG1FbmFibGVUaHJlYWQ7CisKKyAgICBwcml2YXRlIGNsYXNzIEVuYWJsZVRocmVhZCBleHRlbmRzIFRocmVhZCB7CisgICAgICAgIHByaXZhdGUgZmluYWwgYm9vbGVhbiBtU2F2ZVNldHRpbmc7CisgICAgICAgIHB1YmxpYyBFbmFibGVUaHJlYWQoYm9vbGVhbiBzYXZlU2V0dGluZykgeworICAgICAgICAgICAgbVNhdmVTZXR0aW5nID0gc2F2ZVNldHRpbmc7CisgICAgICAgIH0KKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgYm9vbGVhbiByZXMgPSAoZW5hYmxlTmF0aXZlKCkgPT0gMCk7CisgICAgICAgICAgICBpZiAocmVzKSB7CisgICAgICAgICAgICAgICAgaW50IHJldHJ5Q291bnQgPSAyOworICAgICAgICAgICAgICAgIGJvb2xlYW4gcnVubmluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIHdoaWxlICgocmV0cnlDb3VudC0tID4gMCkgJiYgIXJ1bm5pbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgbUV2ZW50TG9vcC5zdGFydCgpOworICAgICAgICAgICAgICAgICAgICAvLyBpdCBtYXkgdGFrZSBhIG1vbWVtZW50IGZvciB0aGUgb3RoZXIgdGhyZWFkIHRvIGRvIGl0cworICAgICAgICAgICAgICAgICAgICAvLyB0aGluZy4gIENoZWNrIHBlcmlvZGljYWxseSBmb3IgYSB3aGlsZS4KKyAgICAgICAgICAgICAgICAgICAgaW50IHBvbGxDb3VudCA9IDU7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlICgocG9sbENvdW50LS0gPiAwKSAmJiAhcnVubmluZykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1FdmVudExvb3AuaXNFdmVudExvb3BSdW5uaW5nKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5uaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhyZWFkLnNsZWVwKDEwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7fQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghcnVubmluZykgeworICAgICAgICAgICAgICAgICAgICBsb2coImJ0IEVuYWJsZVRocmVhZCBnaXZpbmcgdXAiKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGRpc2FibGVOYXRpdmUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgaWYgKHJlcykgeworICAgICAgICAgICAgICAgIGlmICghc2V0dXBOYXRpdmVEYXRhTmF0aXZlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobVNhdmVTZXR0aW5nKSB7CisgICAgICAgICAgICAgICAgICAgIHBlcnNpc3RCbHVldG9vdGhPblNldHRpbmcodHJ1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1Jc0Rpc2NvdmVyaW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgbUJvbmRTdGF0ZS5sb2FkQm9uZFN0YXRlKCk7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoTUVTU0FHRV9SRUdJU1RFUl9TRFBfUkVDT1JEUyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwMDApOworCisgICAgICAgICAgICAgICAgLy8gTG9nIGJsdWV0b290aCBvbiB0byBiYXR0ZXJ5IHN0YXRzLgorICAgICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeVN0YXRzLm5vdGVCbHVldG9vdGhPbigpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUVuYWJsZVRocmVhZCA9IG51bGw7CisKKyAgICAgICAgICAgIHNldEJsdWV0b290aFN0YXRlKHJlcyA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09OIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfT0ZGKTsKKworICAgICAgICAgICAgaWYgKHJlcykgeworICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBtb2RlCisgICAgICAgICAgICAgICAgU3RyaW5nW10gcHJvcFZhbCA9IHsiUGFpcmFibGUiLCBnZXRQcm9wZXJ0eSgiUGFpcmFibGUiKX07CisgICAgICAgICAgICAgICAgbUV2ZW50TG9vcC5vblByb3BlcnR5Q2hhbmdlZChwcm9wVmFsKTsKKyAgICAgICAgICAgIH0KKworICA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BtQXV0b1BhaXJpbmdCbGFja2xpc3RlZCA9CisgICAgICAgICAgICAgICAgbmV3IEFycmF5TGlzdDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoCisgICAgICAgICAgICAgICAgICAgICAgICAiMDA6MDI6QzciLCAiMDA6MTY6RkUiLCAiMDA6MTk6QzEiLCAiMDA6MUI6RkIiLCAiMDA6MUU6M0QiLCAiMDA6MjE6NEYiLAorICAgICAgICAgICAgICAgICAgICAgICAgIjAwOjIzOjA2IiwgIjAwOjI0OjMzIiwgIjAwOkEwOjc5IiwgIjAwOjBFOjZEIiwgIjAwOjEzOkUwIiwgIjAwOjIxOkU4IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICIwMDo2MDo1NyIsICIwMDowRTo5RiIsICIwMDoxMjoxQyIsICIwMDoxODo5MSIsICIwMDoxODo5NiIsICIwMDoxMzowNCIsCisgICAgICAgICAgICAgICAgICAgICAgICAiMDA6MTY6RkQiLCAiMDA6MjI6QTAiLCAiMDA6MEI6NEMiLCAiMDA6NjA6NkYiLCAiMDA6MjM6M0QiLCAiMDA6QzA6NTkiLAorICAgICAgICAgICAgICAgICAgICAgICAgIjAwOjBBOjMwIiwgIjAwOjFFOkFFIiwgIjAwOjFDOkQ3IgorICAgICAgICAgICAgICAgICAgICAgICAgKSk7CisKKyAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIGxvYWRCb25kU3RhdGUoKSB7CisgICAgICAgICAgICBpZiAobUJsdWV0b290aFN0YXRlICE9IEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfVFVSTklOR19PTikgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFN0cmluZyBbXWJvbmRzID0gbnVsbDsKKyAgICAgICAgICAgIFN0cmluZyB2YWwgPSBnZXRQcm9wZXJ0eSgiRGV2aWNlcyIpOworICAgICAgICAgICAgaWYgKHZhbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYm9uZHMgPSB2YWwuc3BsaXQoIiwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChib25kcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVN0YXRlLmNsZWFyKCk7CisgICAgICAgICAgICBpZiAoREJHKSBsb2coImZvdW5kICIgKyBib25kcy5sZW5ndGggKyAiIGJvbmRlZCBkZXZpY2VzIik7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBkZXZpY2UgOiBib25kcykgeworICAgICAgICAgICAgICAgIG1TdGF0ZS5wdXQoZ2V0QWRkcmVzc0Zyb21PYmplY3RQYXRoKGRldmljZSkudG9VcHBlckNhc2UoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5CT05EX0JPTkRFRCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc2V0Qm9uZFN0YXRlKFN0cmluZyBhZGRyZXNzLCBpbnQgc3RhdGUpIHsKKyAgICAgICAgICAgIHNldEJvbmRTdGF0ZShhZGRyZXNzLCBzdGF0ZSwgMCk7CisgICAgICAgIH0KKworICAgICAgICAvKiogcmVhc29uIGlzIGlnbm9yZWQgdW5sZXNzIHN0YXRlID09IEJPTkRfTk9UX0JPTkRFRCAqLworICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc2V0Qm9uZFN0YXRlKFN0cmluZyBhZGRyZXNzLCBpbnQgc3RhdGUsIGludCByZWFzb24pIHsKKyAgICAgICAgICAgIGludCBvbGRTdGF0ZSA9IGdldEJvbmRTdGF0ZShhZGRyZXNzKTsKKyAgICAgICAgICAgIGlmIChvbGRTdGF0ZSA9PSBzdGF0ZSkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChEQkcpIGxvZyhhZGRyZXNzICsgIiBib25kIHN0YXRlICIgKyBvbGRTdGF0ZSArICIgLT4gIiArIHN0YXRlICsgIiAoIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uICsgIikiKTsKKyAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEJsdWV0b290aEludGVudC5CT05EX1NUQVRFX0NIQU5HRURfQUNUSU9OKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShCbHVldG9vdGhJbnRlbnQuREVWSUNFLCBtQWRhcHRlci5nZXRSZW1vdGVEZXZpY2UoYWRkcmVzcykpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEJsdWV0b290aEludGVudC5CT05EX1NUQVRFLCBzdGF0ZSk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LkJPTkRfUFJFVklPVVNfU1RBVEUsIG9sZFN0YXRlKTsKKyAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBCbHVldG9vdGhEZXZpY2UuQk9ORF9OT1RfQk9OREVEKSB7CisgICAgICAgICAgICAgICAgaWYgKHJlYXNvbiA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgInNldEJvbmRTdGF0ZSgpIGNhbGxlZCB0byB1bmJvbmQgZGV2aWNlLCBidXQgcmVhc29uIGNvZGUgaXMgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkLiBPdmVycmlkaW5nIHJlYXNvbiBjb2RlIHdpdGggQk9ORF9SRVNVTFRfUkVNT1ZFRCIpOworICAgICAgICAgICAgICAgICAgICByZWFzb24gPSBCbHVldG9vdGhEZXZpY2UuVU5CT05EX1JFQVNPTl9SRU1PVkVEOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQmx1ZXRvb3RoSW50ZW50LlJFQVNPTiwgcmVhc29uKTsKKyAgICAgICAgICAgICAgICBtU3RhdGUucmVtb3ZlKGFkZHJlc3MpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtU3RhdGUucHV0KGFkZHJlc3MsIHN0YXRlKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQsIEJMVUVUT09USF9QRVJNKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQXV0b1BhaXJpbmdCbGFja2xpc3RlZChTdHJpbmcgYWRkcmVzcykgeworICAgICAgICAgICAgZm9yIChTdHJpbmcgYmxhY2tsaXN0QWRkcmVzcyA6IG1BdXRvUGFpcmluZ0JsYWNrbGlzdGVkKSB7CisgICAgICAgICAgICAgICAgaWYgKGFkZHJlc3Muc3RhcnRzV2l0aChibGFja2xpc3RBZGRyZXNzKSkgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRCb25kU3RhdGUoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgICAgIEludGVnZXIgc3RhdGUgPSBtU3RhdGUuZ2V0KGFkZHJlc3MpOworICAgICAgICAgICAgaWYgKHN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRGV2aWNlLkJPTkRfTk9UX0JPTkRFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzdGF0ZS5pbnRWYWx1ZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgU3RyaW5nW10gbGlzdEluU3RhdGUoaW50IHN0YXRlKSB7CisgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiByZXN1bHQgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4obVN0YXRlLnNpemUoKSk7CisgICAgICAgICAgICBmb3IgKE1hcC5FbnRyeTxTdHJpbmcsIEludGVnZXI+IGUgOiBtU3RhdGUuZW50cnlTZXQoKSkgeworICAgICAgICAgICAgICAgIGlmIChlLmdldFZhbHVlKCkuaW50VmFsdWUoKSA9PSBzdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICByZXN1bHQuYWRkKGUuZ2V0S2V5KCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiByZXN1bHQudG9BcnJheShuZXcgU3RyaW5nW3Jlc3VsdC5zaXplKCldKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBhZGRBdXRvUGFpcmluZ0ZhaWx1cmUoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgICAgIGlmICghbUF1dG9QYWlyaW5nRmFpbHVyZXMuY29udGFpbnMoYWRkcmVzcykpIHsKKyAgICAgICAgICAgICAgICBtQXV0b1BhaXJpbmdGYWlsdXJlcy5hZGQoYWRkcmVzcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gaXNBdXRvUGFpcmluZ0F0dGVtcHRzSW5Qcm9ncmVzcyhTdHJpbmcgYWRkcmVzcykgeworICAgICAgICAgICAgcmV0dXJuIGdldEF0dGVtcHQoYWRkcmVzcykgIT0gMDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBjbGVhclBpbkF0dGVtcHRzKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgICAgICBtUGluQXR0ZW1wdC5yZW1vdmUoYWRkcmVzcyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gaGFzQXV0b1BhaXJpbmdGYWlsZWQoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgICAgIHJldHVybiBtQXV0b1BhaXJpbmdGYWlsdXJlcy5jb250YWlucyhhZGRyZXNzKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldEF0dGVtcHQoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgICAgIEludGVnZXIgYXR0ZW1wdCA9IG1QaW5BdHRlbXB0LmdldChhZGRyZXNzKTsKKyAgICAgICAgICAgIGlmIChhdHRlbXB0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBhdHRlbXB0LmludFZhbHVlKCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgYXR0ZW1wdChTdHJpbmcgYWRkcmVzcykgeworICAgICAgICAgICAgSW50ZWdlciBhdHRlbXB0ID0gbVBpbkF0dGVtcHQuZ2V0KGFkZHJlc3MpOworICAgICAgICAgICAgaW50IG5ld0F0dGVtcHQ7CisgICAgICAgICAgICBpZiAoYXR0ZW1wdCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbmV3QXR0ZW1wdCA9IDE7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG5ld0F0dGVtcHQgPSBhdHRlbXB0LmludFZhbHVlKCkgKyAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBpbkF0dGVtcHQucHV0KGFkZHJlc3MsIG5ldyBJbnRlZ2VyKG5ld0F0dGVtcHQpKTsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIHRvQm9uZFN0YXRlU3RyaW5nKGludCBib25kU3RhdGUpIHsKKyAgICAgICAgc3dpdGNoIChib25kU3RhdGUpIHsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9OT1RfQk9OREVEOgorICAgICAgICAgICAgcmV0dXJuICJub3QgYm9uZGVkIjsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ESU5HOgorICAgICAgICAgICAgcmV0dXJuICJib25kaW5nIjsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhEZXZpY2UuQk9ORF9CT05ERUQ6CisgICAgICAgICAgICByZXR1cm4gImJvbmRlZCI7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gIj8/Pz8/PyI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKnBhY2thZ2UqLyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBpc0FkYXB0ZXJQcm9wZXJ0aWVzRW1wdHkoKSB7CisgICAgICAgIHJldHVybiBtQWRhcHRlclByb3BlcnRpZXMuaXNFbXB0eSgpOworICAgIH0KKworICAgIC8qcGFja2FnZSovc3luY2hyb25pemVkIHZvaWQgZ2V0QWxsUHJvcGVydGllcygpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICBtQWRhcHRlclByb3BlcnRpZXMuY2xlYXIoKTsKKworICAgICAgICBTdHJpbmcgcHJvcGVydGllc1tdID0gKFN0cmluZyBbXSlnZXRBZGFwdGVyUHJvcGVydGllc05hdGl2ZSgpOworICAgICAgICAvLyBUaGUgU3RyaW5nIEFycmF5IGNvbnNpc3RzIG9mIGtleS12YWx1ZSBwYWlycy4KKyAgICAgICAgaWYgKHByb3BlcnRpZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiKkVycm9yKjogR2V0QWRhcHRlclByb3BlcnRpZXMgcmV0dXJuZWQgTlVMTCIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBwcm9wZXJ0aWVzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBTdHJpbmcgbmFtZSA9IHByb3BlcnRpZXNbaV07CisgICAgICAgICAgICBTdHJpbmcgbmV3VmFsdWUgPSBudWxsOworICAgICAgICAgICAgaW50IGxlbjsKKyAgICAgICAgICAgIGlmIChuYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvcjpBZGFwdGVyIFByb3BlcnR5IGF0IGluZGV4IiArIGkgKyAiaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG5hbWUuZXF1YWxzKCJEZXZpY2VzIikpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHN0ciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgbGVuID0gSW50ZWdlci52YWx1ZU9mKHByb3BlcnRpZXNbKytpXSk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBsZW47IGorKykgeworICAgICAgICAgICAgICAgICAgICBzdHIuYXBwZW5kKHByb3BlcnRpZXNbKytpXSk7CisgICAgICAgICAgICAgICAgICAgIHN0ci5hcHBlbmQoIiwiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGxlbiA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgbmV3VmFsdWUgPSBzdHIudG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG5ld1ZhbHVlID0gcHJvcGVydGllc1srK2ldOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUFkYXB0ZXJQcm9wZXJ0aWVzLnB1dChuYW1lLCBuZXdWYWx1ZSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBBZGQgYWRhcHRlciBvYmplY3QgcGF0aCBwcm9wZXJ0eS4KKyAgICAgICAgU3RyaW5nIGFkYXB0Z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sKKyAgICAgICAgYm9vbGVhbiBwYWlyYWJsZSA9IGZhbHNlOworICAgICAgICBib29sZWFuIGRpc2NvdmVyYWJsZSA9IGZhbHNlOworICAgICAgICBzd2l0Y2ggKG1vZGUpIHsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9OT05FOgorICAgICAgICAgICAgcGFpcmFibGUgPSBmYWxzZTsKKyAgICAgICAgICAgIGRpc2NvdmVyYWJsZSA9IGZhbHNlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQmx1ZXRvb3RoQWRhcHRlci5TQ0FOX01PREVfQ09OTkVDVEFCTEU6CisgICAgICAgICAgICBwYWlyYWJsZSA9IHRydWU7CisgICAgICAgICAgICBkaXNjb3ZlcmFibGUgPSBmYWxzZTsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9DT05ORUNUQUJMRV9ESVNDT1ZFUkFCTEU6CisgICAgICAgICAgICBwYWlyYWJsZSA9IHRydWU7CisgICAgICAgICAgICBkaXNjb3ZlcmFibGUgPSB0cnVlOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTG9nLncoVEFHLCAiUmVxdWVzdGVkIGludmFsaWQgc2NhbiBtb2RlICIgKyBtb2RlKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBzZXRQcm9wZXJ0eUJvb2xlYW4oIlBhaXJhYmxlIiwgcGFpcmFibGUpOworICAgICAgICBzZXRQcm9wZXJ0eUJvb2xlYW4oIkRpc2NvdmVyYWJsZSIsIGRpc2NvdmVyYWJsZSk7CisKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3luY2hyb25pemVkIFN0cmluZyBnZXRQcm9wZXJ0eSAoU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgaWYgKCFtQWRhcHRlclByb3BlcnRpZXMuaXNFbXB0eSgpKQorICAgICAgICAgICAgcmV0dXJuIG1BZGFwdGVyUHJvcGVydGllcy5nZXQobmFtZSk7CisgICAgICAgIGdldEFsbFByb3BlcnRpZXMoKTsKKyAgICAgICAgcmV0dXJuIG1BZGFwdGVyUHJvcGVydGllcy5nZXQobmFtZSk7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBTdHJpbmcgZ2V0QWRkcmVzcygpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICByZXR1cm4gZ2V0UHJvcGVydHkoIkFkZHJlc3MiKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIFN0cmluZyBnZXROYW1lKCkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisgICAgICAgIHJldHVybiBnZXRQcm9wZXJ0eSgiTmFtZSIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIHVzZXItZnJpZW5kbHkgbmFtZSBvZiBhIHJlbW90ZSBkZXZpY2UuICBUaGlzIHZhbHVlIGlzCisgICAgICogcmV0dXJuZWQgZnJvbSBvdXIgbG9jYWwgY2FjaGUsIHdoaWNoIGlzIHVwZGF0ZWQgd2hlbiBvblByb3BlcnR5Q2hhbmdlCisgICAgICogZXZlbnQgaXMgcmVjZWl2ZWQuCisgICAgICogRG8gbm90IGV4cGVjdCB0byByZXRyaWV2ZSB0aGUgdXBkYXRlZCByZW1vdGUgbmFtZSBpbW1lZGlhdGVseSBhZnRlcgorICAgICAqIGNoYW5naW5nIHRoZSBuYW1lIG9uIHRoZSByZW1vdGUgZGV2aWNlLgorICAgICAqCisgICAgICogQ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uZHMuICBBIG5lZ2F0aXZlCisgICAgICogICAgICAgICB2YWx1ZSBpbmRpY2F0ZXMgYW4gZXJyb3IuCisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCBpbnQgZ2V0RGlzY292ZXJhYmxlVGltZW91dCgpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICBTdHJpbmcgdGltZW91dCA9IGdldFByb3BlcnR5KCJEaXNjb3ZlcmFibGVUaW1lb3V0Iik7CisgICAgICAgIGlmICh0aW1lb3V0ICE9IG51bGwpCisgICAgICAgICAgIHJldHVybiBJbnRlZ2VyLnZhbHVlT2YodGltZW91dCk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRTY2FuTW9kZSgpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICBpZiAoIWlzRW5hYmxlZCgpKQorICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEFkYXB0ZXIuU0NBTl9NT0RFX05PTkU7CisKKyAgICAgICAgYm9vbGVhbiBwYWlyYWJsZSA9IGdldFByb3BlcnR5KCJQYWlyYWJsZSIpLmVxdWFscygidHJ1ZSIpOworICAgICAgICBib29sZWFuIGRpc2NvdmVyYWJsZSA9IGdldFByb3BlcnR5KCJEaXNjb3ZlcmFibGUiKS5lcXVhbHMoInRydWUiKTsKKyAgICAgICAgcmV0dXJuIGJsdWV6U3RyaW5nVG9TY2FuTW9kZSAocGFpcmFibGUsIGRpc2NvdmVyYWJsZSk7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIHN0YXJ0RGlzY292ZXJ5KCkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX0FETUlOX1BFUk0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBCTFVFVE9PVEhfQURNSU4gcGVybWlzc2lvbiIpOworICAgICAgICBpZiAoIWlzRW5hYmxlZCgpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHN0YXJ0RGlzY292ZXJ5TmF0aXZlKCk7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGNhbmNlbERpc2NvdmVyeSgpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKKyAgICAgICAgcmV0dXJuIHN0b3BEaXNjb3ZlcnlOYXRpdmUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gaXNEaXNjb3ZlcmluZygpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICByZXR1cm4gbUlzRGlzY292ZXJpbmc7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyB2b2lkIHNldElzRGlzY292ZXJpbmcoYm9vbGVhbiBpc0Rpc2NvdmVyaW5nKSB7CisgICAgICAgIG1Jc0Rpc2NvdmVyaW5nID0gaXNEaXNjb3ZlcmluZzsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gY3JlYXRlQm9uZChTdHJpbmcgYWRkcmVzcykgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX0FETUlOX1BFUk0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBCTFVFVE9PVEhfQURNSU4gcGVybWlzc2lvbiIpOworICAgICAgICBpZiAoIUJsdWV0b290aERldmljZS5jaGVja0JsdWV0b290aEFkZHJlc3MoYWRkcmVzcykpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBhZGRyZXNzID0gYWRkcmVzcy50b1VwcGVyQ2FzZSgpOworCisgICAgICAgIFN0cmluZ1tdIGJvbmRpbmcgPSBtQm9uZFN0YXRlLmxpc3RJblN0YXRlKEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkcpOworICAgICAgICBpZiAoYm9uZGluZy5sZW5ndGggPiAwICYmICFib25kaW5nWzBdLmVxdWFscyhhZGRyZXNzKSkgeworICAgICAgICAgICAgbG9nKCJJZ25vcmluZyBjcmVhdGVCb25kKCk6IGFub3RoZXIgZGV2aWNlIGlzIGJvbmRpbmciKTsKKyAgICAgICAgICAgIC8vIGEgZGlmZmVyZW50IGRldmljZSBpcyBjdXJyZW50bHkgYm9uZGluZywgZmFpbAorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ2hlY2sgZm9yIGJvbmQgc3RhdGUgb25seSBpZiB3ZSBhcmUgbm90IHBlcmZvcm1pbmcgYXV0bworICAgICAgICAvLyBwYWlyaW5nIGV4cG9uZW50aWFsIGJhY2stb2ZmIGF0dGVtcHRzLgorICAgICAgICBpZiAoIW1Cb25kU3RhdGUuaXNBdXRvUGFpcmluZ0F0dGVtcHRzSW5Qcm9ncmVzcyhhZGRyZXNzKSAmJgorICAgICAgICAgICAgICAgIG1Cb25kU3RhdGUuZ2V0Qm9uZFN0YXRlKGFkZHJlc3MpICE9IEJsdWV0b290aERldmljZS5CT05EX05PVF9CT05ERUQpIHsKKyAgICAgICAgICAgIGxvZygiSWdub3JpbmcgY3JlYXRlQm9uZCgpOiB0aGlzIGRldmljZSBpcyBhbHJlYWR5IGJvbmRpbmcgb3IgYm9uZGVkIik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIWNyZWF0ZVBhaXJlZERldmljZU5hdGl2ZShhZGRyZXNzLCA2MDAwMCAvKiAxIG1pbnV0ZSAqLykpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIG1Cb25kU3RhdGUuc2V0Qm9uZFN0YXRlKGFkZHJlc3MsIEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkcpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gY2FuY2VsQm9uZFByb2Nlc3MoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKKyAgICAgICAgaWYgKCFCbHVldG9vdGhEZXZpY2UuY2hlY2tCbHVldG9vdGhBZGRyZXNzKGFkZHJlc3MpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgYWRkcmVzcyA9IGFkZHJlc3MudG9VcHBlckNhc2UoKTsKKyAgICAgICAgaWYgKG1Cb25kU3RhdGUuZ2V0Qm9uZFN0YXRlKGFkZHJlc3MpICE9IEJsdWV0b290aERldmljZS5CT05EX0JPTkRJTkcpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIG1Cb25kU3RhdGUuc2V0Qm9uZFN0YXRlKGFkZHJlc3MsIEJsdWV0b290aERldmljZS5CT05EX05PVF9CT05ERUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aERldmljZS5VTkJPTkRfUkVBU09OX0FVVEhfQ0FOQ0VMRUQpOworICAgICAgICBjYW5jZWxEZXZpY2VDcmVhdGlvbk5hdGl2ZShhZGRyZXNzKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIHJlbW92ZUJvbmQoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKKyAgICAgICAgaWYgKCFCbHVldG9vdGhEZXZpY2UuY2hlY2tCbHVldG9vdGhBZGRyZXNzKGFkZHJlc3MpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJlbW92ZURldmljZU5hdGl2ZShnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoYWRkcmVzcykpOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgU3RyaW5nW10gbGlzdEJvbmRzKCkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisgICAgICAgIHJldHVybiBtQm9uZFN0YXRlLmxpc3RJblN0YXRlKEJsdWV0b290aERldmljZS5CT05EX0JPTkRFRCk7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBpbnQgZ2V0Qm9uZFN0YXRlKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfUEVSTSwgIk5lZWQgQkxVRVRPT1RIIHBlcm1pc3Npb24iKTsKKyAgICAgICAgaWYgKCFCbHVldG9vdGhEZXZpY2UuY2hlY2tCbHVldG9vdGhBZGRyZXNzKGFkZHJlc3MpKSB7CisgICAgICAgICAgICByZXR1cm4gQmx1ZXRvb3RoRGV2aWNlLkVSUk9SOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtQm9uZFN0YXRlLmdldEJvbmRTdGF0ZShhZGRyZXNzLnRvVXBwZXJDYXNlKCkpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIGJvb2xlYW4gaXNSZW1vdGVEZXZpY2VJbkNhY2hlKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIHJldHVybiAobURldmljZVByb3BlcnRpZXMuZ2V0KGFkZHJlc3MpICE9IG51bGwpOworICAgIH0KKworICAgIC8qcGFja2FnZSovIFN0cmluZ1tdIGdldFJlbW90ZURldmljZVByb3BlcnRpZXMoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgU3RyaW5nIG9iamVjdFBhdGggPSBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoYWRkcmVzcyk7CisgICAgICAgIHJldHVybiAoU3RyaW5nIFtdKWdldERldmljZVByb3BlcnRpZXNOYXRpdmUob2JqZWN0UGF0aCk7CisgICAgfQorCisgICAgLypwYWNrYWdlKi8gc3luY2hyb25pemVkIFN0cmluZyBnZXRSZW1vdGVEZXZpY2VQcm9wZXJ0eShTdHJpbm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yBhZGRyZXNzLCBTdHJpbmdbXSBwcm9wZXJ0aWVzKSB7CisgICAgICAgIC8qCisgICAgICAgICAqIFdlIGdldCBhIERldmljZUZvdW5kIHNpZ25hbCBldmVyeSB0aW1lIFJTU0kgY2hhbmdlcyBvciBuYW1lIGNoYW5nZXMuCisgICAgICAgICAqIERvbid0IGNyZWF0ZSBhIG5ldyBNYXAgb2JqZWN0IGV2ZXJ5IHRpbWUgKi8KKyAgICAgICAgTWFwPFN0cmluZywgU3RyaW5nPiBwcm9wZXJ0eVZhbHVlcyA9IG1EZXZpY2VQcm9wZXJ0aWVzLmdldChhZGRyZXNzKTsKKyAgICAgICAgaWYgKHByb3BlcnR5VmFsdWVzID09IG51bGwpIHsKKyAgICAgICAgICAgIHByb3BlcnR5VmFsdWVzID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBTdHJpbmc+KCk7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHByb3BlcnRpZXMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIFN0cmluZyBuYW1lID0gcHJvcGVydGllc1tpXTsKKyAgICAgICAgICAgIFN0cmluZyBuZXdWYWx1ZSA9IG51bGw7CisgICAgICAgICAgICBpbnQgbGVuOworICAgICAgICAgICAgaWYgKG5hbWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yOiBSZW1vdGUgRGV2aWNlIFByb3BlcnR5IGF0IGluZGV4IiArIGkgKyAiaXMgbnVsbCIpOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG5hbWUuZXF1YWxzKCJVVUlEcyIpIHx8IG5hbWUuZXF1YWxzKCJOb2RlcyIpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzdHIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgIGxlbiA9IEludGVnZXIudmFsdWVPZihwcm9wZXJ0aWVzWysraV0pOworICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbGVuOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgc3RyLmFwcGVuZChwcm9wZXJ0aWVzWysraV0pOworICAgICAgICAgICAgICAgICAgICBzdHIuYXBwZW5kKCIsIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChsZW4gPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG5ld1ZhbHVlID0gc3RyLnRvU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBuZXdWYWx1ZSA9IHByb3BlcnRpZXNbKytpXTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHJvcGVydHlWYWx1ZXMucHV0KG5hbWUsIG5ld1ZhbHVlKTsKKyAgICAgICAgfQorICAgICAgICBtRGV2aWNlUHJvcGVydGllcy5wdXQoYWRkcmVzcywgcHJvcGVydHlWYWx1ZXMpOworICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCByZW1vdmVSZW1vdGVEZXZpY2VQcm9wZXJ0aWVzKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIG1EZXZpY2VQcm9wZXJ0aWVzLnJlbW92ZShhZGRyZXNzKTsKKyAgICB9CisKKyAgICAvKiBwYWNrYWdlICovIHN5bmNocm9uaXplZCB2b2lkIHNldFJlbW90ZURldmljZVByb3BlcnR5KFN0cmluZyBhZGRyZXNzLCBTdHJpbmcgbmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHZhbHVlKSB7CisgICAgICAgIE1hcCA8U3RyaW5nLCBTdHJpbmc+IHByb3BWYWwgPSBtRGV2aWNlUHJvcGVydGllcy5nZXQoYWRkcmVzcyk7CisgICAgICAgIGlmIChwcm9wVmFsICE9IG51bGwpIHsKKyAgICAgICAgICAgIHByb3BWYWwucHV0KG5hbWUsIHZhbHVlKTsKKyAgICAgICAgICAgIG1EZXZpY2VQcm9wZXJ0aWVzLnB1dChhZGRyZXNzLCBwcm9wVmFsKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgInNldFJlbW90ZURldmljZVByb3BlcnR5IGZvciBhIGRldmljZSBub3QgaW4gY2FjaGU6IiArIGFkZHJlc3MpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgcmVtb3RlIGRldmljZSB0cnVzdCBzdGF0ZS4KKyAgICAgKgorICAgICAqIEByZXR1cm4gYm9vbGVhbiB0byBpbmRpY2F0ZSBvcGVyYXRpb24gc3VjY2VzcyBvciBmYWlsCisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIHNldFRydXN0KFN0cmluZyBhZGRyZXNzLCBib29sZWFuIHZhbHVlKSB7CisgICAgICAgIGlmICghQmx1ZXRvb3RoRGV2aWNlLmNoZWNrQmx1ZXRvb3RoQWRkcmVzcyhhZGRyZXNzKSkgeworICAgICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHNldERldmljZVByb3BlcnR5Qm9vbGVhbk5hdGl2ZShnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoYWRkcmVzcyksICJUcnVzdGVkIiwKKyAgICAgICAgICAgICAgICB2YWx1ZSA/IDEgOiAwKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXRzIHRoZSByZW1vdGUgZGV2aWNlIHRydXN0IHN0YXRlIGFzIGJvb2xlYW4uCisgICAgICogTm90ZTogdGhpcyB2Y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nkuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIDMyLWJpdCBpbnRlZ2VyIGVuY29kaW5nIHRoZSByZW1vdGUgbWFqb3IsIG1pbm9yLCBhbmQgc2VydmljZQorICAgICAqICAgICAgICAgY2xhc3Nlcy4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRSZW1vdGVDbGFzcyhTdHJpbmcgYWRkcmVzcykgeworICAgICAgICBpZiAoIUJsdWV0b290aERldmljZS5jaGVja0JsdWV0b290aEFkZHJlc3MoYWRkcmVzcykpIHsKKyAgICAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfUEVSTSwgIk5lZWQgQkxVRVRPT1RIIHBlcm1pc3Npb24iKTsKKyAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhDbGFzcy5FUlJPUjsKKyAgICAgICAgfQorICAgICAgICBTdHJpbmcgdmFsID0gZ2V0UmVtb3RlRGV2aWNlUHJvcGVydHkoYWRkcmVzcywgIkNsYXNzIik7CisgICAgICAgIGlmICh2YWwgPT0gbnVsbCkKKyAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhDbGFzcy5FUlJPUjsKKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gSW50ZWdlci52YWx1ZU9mKHZhbCk7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIC8qKgorICAgICAqIEdldHMgdGhlIHJlbW90ZSBmZWF0dXJlcyBlbmNvZGVkIGFzIGJpdCBtYXNrLgorICAgICAqCisgICAgICogTm90ZTogVGhpcyBtZXRob2QgbWF5IGJlIG9ic29sZXRlZCBzb29uLgorICAgICAqCisgICAgICogQHJldHVybiBTdHJpbmcgYXJyYXkgb2YgMTI4Yml0IFVVSURzCisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCBTdHJpbmdbXSBnZXRSZW1vdGVVdWlkcyhTdHJpbmcgYWRkcmV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FHLCAic2V0UGluKCIgKyBhZGRyZXNzICsgIikgY2FsbGVkIGJ1dCBubyBuYXRpdmUgZGF0YSBhdmFpbGFibGUsICIgKworICAgICAgICAgICAgICAgICAgImlnbm9yaW5nLiBNYXliZSB0aGUgUGFzc2tleUFnZW50IFJlcXVlc3Qgd2FzIGNhbmNlbGxlZCBieSB0aGUgcmVtb3RlIGRldmljZSIgKworICAgICAgICAgICAgICAgICAgIiBvciBieSBibHVlei5cbiIpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIC8vIGJsdWV6IEFQSSB3YW50cyBwaW4gYXMgYSBzdHJpbmcKKyAgICAgICAgU3RyaW5nIHBpblN0cmluZzsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHBpblN0cmluZyA9IG5ldyBTdHJpbmcocGluLCAiVVRGOCIpOworICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIHVlZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiVVRGOCBub3Qgc3VwcG9ydGVkPyE/Iik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHNldFBpbk5hdGl2ZShhZGRyZXNzLCBwaW5TdHJpbmcsIGRhdGEuaW50VmFsdWUoKSk7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIHNldFBhc3NrZXkoU3RyaW5nIGFkZHJlc3MsIGludCBwYXNza2V5KSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CisgICAgICAgIGlmIChwYXNza2V5IDwgMCB8fCBwYXNza2V5ID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24iKTsKKyAgICAgICAgYWRkcmVzcyA9IGFkZHJlc3MudG9VcHBlckNhc2UoKTsKKyAgICAgICAgSW50ZWdlciBkYXRhID0gbUV2ZW50TG9vcC5nZXRQYXNza2V5QWdlbnRSZXF1ZXN0RGF0YSgpLnJlbW92ZShhZGRyZXNzKTsKKyAgICAgICAgaWYgKGRhdGEgPT0gbnVsbCkgeworICAgICAgICAgICAgTG9nLncoVEFHLCAic2V0UGFzc2tleSgiICsgYWRkcmVzcyArICIpIGNhbGxlZCBidXQgbm8gbmF0aXZlIGRhdGEgYXZhaWxhYmxlLCAiICsKKyAgICAgICAgICAgICAgICAgICJpZ25vcmluZy4gTWF5YmUgdGhlIFBhc3NrZXlBZ2VudCBSZXF1ZXN0IHdhcyBjYW5jZWxsZWQgYnkgdGhlIHJlbW90ZSBkZXZpY2UiICsKKyAgICAgICAgICAgICAgICAgICIgb3IgYnkgYmx1ZXouXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc2V0UGFpcmluZ0NvbmZpcm1hdGlvbk5hdGl2ZShhZGRyZXNzLCBjb25maXJtLCBkYXRhLmludFZhbHVlKCkpOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBjYW5jZWxQYWlyaW5nVXNlcklucHV0KFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CisgICAgICAgIGlmICghQmx1ZXRvb3RoRGV2aWNlLmNoZWNrQmx1ZXRvb3RoQWRkcmVzcyhhZGRyZXNzKSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIG1Cb25kU3RhdGUuc2V0Qm9uZFN0YXRlKGFkZHJlc3MsIEJsdWV0b290aERldmljZS5CT05EX05PVF9CT05ERUQsCisgICAgICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlLlVOQk9ORF9SRUFTT05fQVVUSF9DQU5DRUxFRCk7CisgICAgICAgIGFkZHJlc3MgPSBhZGRyZXNzLnRvVXBwZXJDYXNlKCk7CisgICAgICAgIEludGVnZXIgZGF0YSA9IG1FdmVudExvb3AuZ2V0UGFzc2tleUFnZW50UmVxdWVzdERhdGEoKS5yZW1vdmUoYWRkcmVzcyk7CisgICAgICAgIGlmIChkYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgIExvZy53KFRBRywgImNhbmNlbFVzZXJJbnB1dE5hdGl2ZSgiICsgYWRkcmVzcyArICIpIGNhbGxlZCBidXQgbm8gbmF0aXZlIGRhdGEgIiArCisgICAgICAgICAgICAgICAgImF2YWlsYWJsZSwgaWdub3JpbmcuIE1heWJlIHRoZSBQYXNza2V5QWdlbnQgUmVxdWVzdCB3YXMgYWxyZWFkeSBjYW5jZWxsZWQgIiArCisgICAgICAgICAgICAgICAgImJ5IHRoZSByZW1vdGUgb3IgYnkgYmx1ZXouXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY2FuY2VsUGFpcmluZ1VzZXJJbnB1dE5hdGl2ZShhZGRyZXNzLCBkYXRhLmludFZhbHVlKCkpOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgQnJvYWRjYXN0UmVjZWl2ZXIgbVJlY2VpdmVyID0gbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgU3RyaW5nIGFjdGlvbiA9IGludGVudC5nZXRBY3Rpb24oKTsKKyAgICAgICAgICAgIGlmIChhY3Rpb24uZXF1YWxzKEludGVudC5BQ1RJT05fQUlSUExBTkVfTU9ERV9DSEFOR0VEKSkgeworICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlciByZXNvbHZlciA9IGNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7CisgICAgICAgICAgICAgICAgLy8gUXVlcnkgdGhlIGFpcnBsYW5lIG1vZGUgZnJvbSBTZXR0aW5ncy5TeXN0ZW0ganVzdCB0byBtYWtlIHN1cmUgdGhhdAorICAgICAgICAgICAgICAgIC8vIHNvbWUgcmFuZG9tIGFwcCBpcyBub3Qgc2VuZGluZyB0aGlzIGludGVudCBhbmQgZGlzYWJsaW5nIGJsdWV0b290aAorICAgICAgICAgICAgICAgIGJvb2xlYW4gZW5hYmxlZCA9ICFpc0FpcnBsYW5lTW9kZU9uKCk7CisgICAgICAgICAgICAgICAgLy8gSWYgYmx1ZXRvb3RoIGlzIGN1cnJlbnRseSBleHBlY3RlZCB0byBiZSBvbiwgdGhlbiBlbmFibGUgb3IgZGlzYWJsZSBibHVldG9vdGgKKyAgICAgICAgICAgICAgICBpZiAoU2V0dGluZ3MuU2VjdXJlLmdldEludChyZXNvbHZlciwgU2V0dGluZ3MuU2VjdXJlLkJMVUVUT09USF9PTiwgMCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChlbmFibGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbmFibGUoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZShmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHJpdmF0ZSB2b2lkIHJlZ2lzdGVyRm9yQWlycGxhbmVNb2RlKCkgeworICAgICAgICBTdHJpbmcgYWlycGxhbmVN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cbm1Jc0FpcnBsYW5lU2Vuc2l0aXZlID0gIiArIG1Jc0FpcnBsYW5lU2Vuc2l0aXZlICsgIlxuIik7CisKKyAgICAgICAgc3dpdGNoKG1CbHVldG9vdGhTdGF0ZSkgeworICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfT0ZGOgorICAgICAgICAgICAgcHcucHJpbnRsbigiXG5CbHVldG9vdGggT0ZGXG4iKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX1RVUk5JTkdfT046CisgICAgICAgICAgICBwdy5wcmludGxuKCJcbkJsdWV0b290aCBUVVJOSU5HIE9OXG4iKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX1RVUk5JTkdfT0ZGOgorICAgICAgICAgICAgcHcucHJpbnRsbigiXG5CbHVldG9vdGggVFVSTklORyBPRkZcbiIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU1RBVEVfT046CisgICAgICAgICAgICBwdy5wcmludGxuKCJcbkJsdWV0b290aCBPTlxuIik7CisgICAgICAgIH0KKworICAgICAgICBwdy5wcmludGxuKCJcbkxvY2FsIGFkZHJlc3MgPSAiICsgZ2V0QWRkcmVzcygpKTsKKyAgICAgICAgcHcucHJpbnRsbigiXG5Mb2NhbCBuYW1lID0gIiArIGdldE5hbWUoKSk7CisgICAgICAgIHB3LnByaW50bG4oIlxuaXNEaXNjb3ZlcmluZygpID0gIiArIGlzRGlzY292ZXJpbmcoKSk7CisKKyAgICAgICAgQmx1ZXRvb3RoSGVhZHNldCBoZWFkc2V0ID0gbmV3IEJsdWV0b290aEhlYWRzZXQobUNvbnRleHQsIG51bGwpOworCisgICAgICAgIHB3LnByaW50bG4oIlxuLS1Lbm93biBkZXZpY2VzLS0iKTsKKyAgICAgICAgZm9yIChTdHJpbmcgYWRkcmVzcyA6IG1EZXZpY2VQcm9wZXJ0aWVzLmtleVNldCgpKSB7CisgICAgICAgICAgICBpbnQgYm9uZFN0YXRlID0gbUJvbmRTdGF0ZS5nZXRCb25kU3RhdGUoYWRkcmVzcyk7CisgICAgICAgICAgICBwdy5wcmludGYoIiVzICUxMHMgKCVkKSAlc1xuIiwgYWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgdG9Cb25kU3RhdGVTdHJpbmcoYm9uZFN0YXRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgbUJvbmRTdGF0ZS5nZXRBdHRlbXB0KGFkZHJlc3MpLAorICAgICAgICAgICAgICAgICAgICAgICBnZXRSZW1vdGVOYW1lKGFkZHJlc3MpKTsKKyAgICAgICAgICAgIGlmIChib25kU3RhdGUgPT0gQmx1ZXRvb3RoRGV2aWNlLkJPTkRfQk9OREVEKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nW10gdXVpZHMgPSBnZXRSZW1vdGVVdWlkcyhhZGRyZXNzKTsKKyAgICAgICAgICAgICAgICBpZiAodXVpZHMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGYoIlx0dXVpZHMgPSBudWxsXG4iKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB1dWlkIDogdXVpZHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50ZigiXHQiICsgdXVpZCArICJcbiIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgU3RyaW5nIHZhbHVlID0gZ2V0UHJvcGVydHkoIkRldmljZXMiKTsKKyAgICAgICAgU3RyaW5nW10gZGV2aWNlc09iamVjdFBhdGggPSBudWxsOworICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgeworICAgICAgICAgICAgZGV2aWNlc09iamVjdFBhdGggPSB2YWx1ZS5zcGxpdCgiLCIpOworICAgICAgICB9CisgICAgICAgIHB3LnByaW50bG4oIlxuLS1BQ0wgY29ubmVjdGVkIGRldmljZXMtLSIpOworICAgICAgICBmb3IgKFN0cmluZyBkZXZpY2UgOiBkZXZpY2VzT2JqZWN0UGF0aCkgeworICAgICAgICAgICAgcHcucHJpbnRsbihnZXRBZGRyZXNzRnJvbU9iamVjdFBhdGgoZGV2aWNlKSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBSYXRoZXIgbm90IGRvIHRoaXMgZnJvbSBoZXJlLCBidXQgbm8td2hlcmUgZWxzZSBhbmQgSSBuZWVkIHRoaXMKKyAgICAgICAgLy8gZHVtcAorICAgICAgICBwdy5wcmludGxuKCJcbi0tSGVhZHNldCBTZXJ2aWNlLS0iKTsKKyAgICAgICAgc3dpdGNoIChoZWFkc2V0LmdldFN0YXRlKCkpIHsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0RJU0NPTk5FQ1RFRDoKKyAgICAgICAgICAgIHB3LnByaW50bG4oImdldFN0YXRlKCkgPSBTVEFURV9ESVNDT05ORUNURUQiKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfQ09OTkVDVElORzoKKyAgICAgICAgICAgIHB3LnByaW50bG4oImdldFN0YXRlKCkgPSBTVEFURV9DT05ORUNUSU5HIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRDoKKyAgICAgICAgICAgIHB3LnByaW50bG4oImdldFN0YXRlKCkgPSBTVEFURV9DT05ORUNURUQiKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRVJST1I6CisgICAgICAgICAgICBwdy5wcmludGxuKCJnZXRTdGF0ZSgpID0gU1RBVEVfRVJST1IiKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHB3LnByaW50bG4oImdldEN1cnJlbnRIZWFkc2V0KCkgPSAiICsgaGVhZHNldC5nZXRDdXJyZW50SGVhZHNldCgpKTsKKyAgICAgICAgcHcucHJpbnRsbigiZ2V0QmF0dGVyeVVzYWdlSGludCgpID0gIiArIGhlYWRzZXQuZ2V0QmF0dGVyeVVzYWdlSGludCgpKTsKKworICAgICAgICBoZWFkc2V0LmNsb3NlKCk7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyBzdGF0aWMgaW50IGJsdWV6U3RyaW5nVG9TY2FuTW9kZShib29sZWFuIHBhaXJhYmxlLCBib29sZWFuIGRpc2NvdmVyYWJsZSkgeworICAgICAgICBpZiAocGFpcmFibGUgJiYgZGlzY292ZXJhYmxlKQorICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEFkYXB0ZXIuU0NBTl9NT0RFX0NPTk5FQ1RBQkxFX0RJU0NPVkVSQUJMRTsKKyAgICAgICAgZWxzZSBpZiAocGFpcmFibGUgJiYgIWRpc2NvdmVyYWJsZSkKKyAgICAgICAgICAgIHJldHVybiBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9DT05ORUNUQUJMRTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aEFkYXB0ZXIuU0NBTl9NT0RFX05PTkU7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyBzdGF0aWMgU3RyaW5nIHNjYW5Nb2RlVG9CbHVlelN0cmluZyhpbnQgbW9kZSkgeworICAgICAgICBzd2l0Y2ggKG1vZGUpIHsKKyAgICAgICAgY2FzZSBCbHVldG9vdGhBZGFwdGVyLlNDQU5fTU9ERV9OT05FOgorICAgICAgICAgICAgcmV0dXJuICJvZmYiOworICAgICAgICBjYXNlIEJsdWV0b290aEFkYXB0ZXIuU0NBTl9NT0RFX0NPTk5FQ1RBQkxFOgorICAgICAgICAgICAgcmV0dXJuICJjb25uZWN0YWJsZSI7CisgICAgICAgIGNhc2UgQmx1ZXRvb3RoQWRhcHRlci5TQ0FOX01PREVfQ09OTkVDVEFCTEVfRElTQ09WRVJBQkxFOgorICAgICAgICAgICAgcmV0dXJuICJkaXNjb3ZlcmFibGUiOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qcGFja2FnZSovIFN0cmluZyBnZXRBZGRyZXNzRnJvbU9iamVjdFBhdGgoU3RyaW5nIG9iamVjdFBhdGgpIHsKKyAgICAgICAgU3RyaW5nIGFkYXB0ZXJPYmplY3RQYXRoID0gZ2V0UHJvcGVydHkoIk9iamVjdFBhdGgiKTsKKyAgICAgICAgaWYgKGFkYXB0ZXJPYmplY3RQYXRoID09IG51bGwgfHwgb2JqZWN0UGF0aCA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJnZXRBZGRyZXNzRnJvbU9iamVjdFBhdGg6IEFkcGF0ZXJPYmplY3RQYXRoOiIgKyBhZGFwdGVyT2JqZWN0UGF0aCArCisgICAgICAgICAgICAgICAgICAgICIgIG9yIGRldmljZU9iamVjdFBhdGg6IiArIG9iamVjdFBhdGggKyAiIGlzIG51bGwiKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIGlmICghb2JqZWN0UGF0aC5zdGFydHNXaXRoKGFkYXB0ZXJPYmplY3RQYXRoKSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiZ2V0QWRkcmVzc0Zyb21PYmplY3RQYXRoOiBBZHBhdGVyT2JqZWN0UGF0aDoiICsgYWRhcHRlck9iamVjdFBhdGggKworICAgICAgICAgICAgICAgICAgICAiICBpcyBub3QgYSBwcmVmaXggb2YgZGV2aWNlT2JqZWN0UGF0aDoiICsgb2JqZWN0UGF0aCArCisgICAgICAgICAgICAgICAgICAgICJibHVldG9vdGhkIGNyYXNoZWQgPyIpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIGFkZHJlc3MgPSBvYmplY3RQYXRoLnN1YnN0cmluZyhhZGFwdGVyT2JqZWN0UGF0aC5sZW5ndGgoKSk7CisgICAgICAgIGlmIChhZGRyZXNzICE9IG51bGwpIHJldHVybiBhZGRyZXNzLnJlcGxhY2UoJ18nLCAnOicpOworCisgICAgICAgIExvZy5lKFRBRywgImdldEFkZHJlc3NGcm9tT2JqZWN0UGF0aDogQWRkcmVzcyBiZWluZyByZXR1cm5lZCBpcyBudWxsIik7CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qcGFja2FnZSovIFN0cmluZyBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgU3RyaW5nIHBhdGggPSBnZXRQcm9wZXJ0eSgiT2JqZWN0UGF0aCIpOworICAgICAgICBpZiAocGF0aCA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvcjogT2JqZWN0IFBhdGggaXMgbnVsbCIpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgcGF0aCA9IHBhdGggKyBhZGRyZXNzLnJlcGxhY2UoIjoiLCAiXyIpOworICAgICAgICByZXR1cm4gcGF0aDsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGxvZyhTdHJpbmcgbXNnKSB7CisgICAgICAgIExvZy5kKFRBRywgbXNnKTsKKyAgICB9CisKKyAgICBwcml2YXRlIG5hdGl2ZSBzdGF0aWMgdm9pZCBjbGFzc0luaXROYXRpdmUoKTsKKyAgICBwcml2YXRlIG5hdGl2ZSB2b2lkIGluaXRpYWxpemVOYXRpdmVEYXRhTmF0aXZlKCk7CisgICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBzZXR1cE5hdGl2ZURhdGFOYXRpdmUoKTsKKyAgICBwcml2YXR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amF2YQpAQCAtMjMzLDcgKzIzMywzMSBAQAogICAgICAgICAgICAgICAgIGFwcFNlYXJjaERhdGEsCiAgICAgICAgICAgICAgICAgZ2xvYmFsU2VhcmNoLAogICAgICAgICAgICAgICAgIHNlYXJjaE1hbmFnZXJDYWxsYmFjaywKLSAgICAgICAgICAgICAgICBpZGVudCk7CisgICAgICAgICAgICAgICAgaWRlbnQsCisgICAgICAgICAgICAgICAgZmFsc2UpOyAvLyBkb24ndCB0cmlnZ2VyCisgICAgfQorCisgICAgLyoqCisgICAgICogTGF1bmNoZXMgdGhlIHNlYXJjaCBVSSBhbmQgdHJpZ2dlcnMgdGhlIHNlYXJjaCwgYXMgaWYgdGhlIHVzZXIgaGFkIGNsaWNrZWQgb24gdGhlCisgICAgICogc2VhcmNoIGJ1dHRvbiB3aXRoaW4gdGhlIGRpYWxvZy4KKyAgICAgKgorICAgICAqIEBzZWUgU2VhcmNoTWFuYWdlciN0cmlnZ2VyU2VhcmNoKFN0cmluZywgYW5kcm9pZC5jb250ZW50LkNvbXBvbmVudE5hbWUsIGFuZHJvaWQub3MuQnVuZGxlKQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHRyaWdnZXJTZWFyY2goU3RyaW5nIHF1ZXJ5LAorICAgICAgICAgICAgQ29tcG9uZW50TmFtZSBsYXVuY2hBY3Rpdml0eSwKKyAgICAgICAgICAgIEJ1bmRsZSBhcHBTZWFyY2hEYXRhLAorICAgICAgICAgICAgSVNlYXJjaE1hbmFnZXJDYWxsYmFjayBzZWFyY2hNYW5hZ2VyQ2FsbGJhY2ssCisgICAgICAgICAgICBib29sZWFuIGdsb2JhbFNlYXJjaCwKKyAgICAgICAgICAgIGludCBpZGVudCkgeworICAgICAgICBnZXRTZWFyY2hEaWFsb2coKS5zdGFydFNlYXJjaCgKKyAgICAgICAgICAgICAgICBxdWVyeSwKKyAgICAgICAgICAgICAgICBmYWxzZSwKKyAgICAgICAgICAgICAgICBsYXVuY2hBY3Rpdml0eSwKKyAg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dGUgc3RhdGljIGZpbmFsIGludCBNU0dfV0FMTFBBUEVSX09GRlNFVFMgPSAxMDAyMDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTVNHX1dJTkRPV19SRVNJWkVEID0gMTAwMzA7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE1TR19UT1VDSF9FVkVOVCA9IDEwMDQwOworICAgIAorICAgIC8qKgorICAgICAqIFRoZSBhY3R1YWwgaW1wbGVtZW50YXRpb24gb2YgYSB3YWxscGFwZXIuICBBIHdhbGxwYXBlciBzZXJ2aWNlIG1heQorICAgICAqIGhhdmUgbXVsdGlwbGUgaW5zdGFuY2VzIHJ1bm5pbmcgKGZvciBleGFtcGxlIGFzIGEgcmVhbCB3YWxscGFwZXIKKyAgICAgKiBhbmQgYXMgYSBwcmV2aWV3KSwgZWFjaCBvZiB3aGljaCBpcyByZXByZXNlbnRlZCBieSBpdHMgb3duIEVuZ2luZQorICAgICAqIGluc3RhbmNlLiAgWW91IG11c3QgaW1wbGVtZW50IHtAbGluayBXYWxscGFwZXJTZXJ2aWNlI29uQ3JlYXRlRW5naW5lKCl9CisgICAgICogdG8gcmV0dXJuIHlvdXIgY29uY3JldGUgRW5naW5lIGltcGxlbWVudGF0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBjbGFzcyBFbmdpbmUgeworICAgICAgICBJV2FsbHBhcGVyRW5naW5lV3JhcHBlciBtSVdhbGxwYXBlckVuZ2luZTsKKyAgICAgICAgCisgICAgICAgIC8vIENvcGllcyBmcm9tIG1JV2FsbHBhcGVyRW5naW5lLgorICAgICAgICBIYW5kbGVyQ2FsbGVyIG1DYWxsZXI7CisgICAgICAgIElXYWxscGFwZXJDb25uZWN0aW9uIG1Db25uZWN0aW9uOworICAgICAgICBJQmluZGVyIG1XaW5kb3dUb2tlbjsKKyAgICAgICAgCisgICAgICAgIGJvb2xlYW4gbUluaXRpYWxpemluZyA9IHRydWU7CisgICAgICAgIGJvb2xlYW4gbVZpc2libGU7CisgICAgICAgIGJvb2xlYW4gbURlc3Ryb3llZDsKKyAgICAgICAgCisgICAgICAgIC8vIEN1cnJlbnQgd2luZG93IHN0YXRlLgorICAgICAgICBib29sZWFuIG1DcmVhdGVkOworICAgICAgICBib29sZWFuIG1Jc0NyZWF0aW5nOworICAgICAgICBib29sZWFuIG1EcmF3aW5nQWxsb3dlZDsKKyAgICAgICAgaW50IG1XaWR0aDsKKyAgICAgICAgaW50IG1IZWlnaHQ7CisgICAgICAgIGludCBtRm9ybWF0OworICAgICAgICBpbnQgbVR5cGU7CisgICAgICAgIGludCBtQ3VyV2lkdGg7CisgICAgICAgIGludCBtQ3VySGVpZ2h0OworICAgICAgICBpbnQgbVdpbmRvd0ZsYWdzID0gV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfVE9VQ0hBQkxFOworICAgICAgICBpbnQgbUN1cldpbmRvd0ZsYWdzID0gbVdpbmRvd0ZsYWdzOworICAgICAgICBib29sZWFuIG1EZXN0cm95UmVwb3J0TmVlZGVkOworICAgICAgICBmaW5hbCBSZWN0IG1WaXNpYmxlSW5zZXRzID0gbmV3IFJlY3QoKTsKKyAgICAgICAgZmluYWwgUmVjdCBtV2luRnJhbWUgPSBuZXcgUmVjdCgpOworICAgICAgICBmaW5hbCBSZWN0IG1Db250ZW50SW5zZXRzID0gbmV3IFJlY3QoKTsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIG1MYXlvdXQKKyAgICAgICAgICAgICAgICA9IG5ldyBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcygpOworICAgICAgICBJV2luZG93U2Vzc2lvbiBtU2Vzc2lvbjsKKworICAgICAgICBmaW5hbCBPYmplY3QgbUxvY2sgPSBuZXcgT2JqZWN0KCk7CisgICAgICAgIGJvb2xlYW4gbU9mZnNldE1lc3NhZ2VFbnF1ZXVlZDsKKyAgICAgICAgZmxvYXQgbVBlbmRpbmdYT2Zmc2V0OworICAgICAgICBmbG9hdCBtUGVuZGluZ1lPZmZzZXQ7CisgICAgICAgIE1vdGlvbkV2ZW50IG1QZW5kaW5nTW92ZTsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIEJhc2VTdXJmYWNlSG9sZGVyIG1TdXJmYWNlSG9sZGVyID0gbmV3IEJhc2VTdXJmYWNlSG9sZGVyKCkgeworCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIG9uQWxsb3dMb2NrQ2FudmFzKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBtRHJhd2luZ0FsbG93ZWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWxheW91dENvbnRhaW5lcigpIHsKKyAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1DYWxsZXIub2J0YWluTWVzc2FnZShNU0dfVVBEQVRFX1NVUkZBQ0UpOworICAgICAgICAgICAgICAgIG1DYWxsZXIuc2VuZE1lc3NhZ2UobXNnKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvblVwZGF0ZVN1cmZhY2UoKSB7CisgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtQ2FsbGVyLm9idGFpbk1lc3NhZ2UoTVNHX1VQREFURV9TVVJGQUNFKTsKKyAgICAgICAgICAgICAgICBtQ2FsbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQ3JlYXRpbmcoKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1Jc0NyZWF0aW5nOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHNldEZpeGVkU2l6ZShpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiV2FsbHBhcGVycyBjdXJyZW50bHkgb25seSBzdXBwb3J0IHNpemluZyBmcm9tIGxheW91dCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBzZXRLZWVwU2NyZWVuT24oYm9vbGVhbiBzY3JlZW5PbikgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJXYWxscGFwZXJzIGRvIG5vdCBzdXBwb3J0IGtlZXAgc2NyZWVuIG9uIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgfTsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIEJhc2VJV2luZG93IG1XaW5kb3cgPSBuZXcgQmFzZUlXaW5kb3coKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIG9uRGlzcGF0Y2hQb2ludGVyKE1vdGlvbkV2ZW50IGV2ZW50LCBsb25nIGV2ZW50VGltZSwKKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBjYWxsV2hlbkRvbmUpIHsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1QZW5kaW5nTW92ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNhbGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfVE9VQ0hfRVZFTlQsIG1QZW5kaW5nTW92ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdNb3ZlLnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1QZW5kaW5nTW92ZSA9IGV2ZW50OworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdNb3ZlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1DYWxsZXIub2J0YWluTWVzc2FnZU8oTVNHX1RPVUNIX0VWRU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgbUNhbGxlci5zZW5kTWVzc2FnZShtc2cpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgcmVzaXplZChpbnQgdywgaW50IGgsIFJlY3QgY292ZXJlZEluc2V0cywKKyAgICAgICAgICAgICAgICAgICAgUmVjdCB2aXNpYmxlSW5zZXRzLCBib29sZWFuIHJlcG9ydERyYXcpIHsKKyAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1DYWxsZXIub2J0YWluTWVzc2FnZUkoTVNHX1dJTkRPV19SRVNJWkVELAorICAgICAgICAgICAgICAgICAgICAgICAgcmVwb3J0RHJhdyA/IDEgOiAwKTsKKyAgICAgICAgICAgICAgICBtQ2FsbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hBcHBWaXNpYmlsaXR5KGJvb2xlYW4gdmlzaWJsZSkgeworICAgICAgICAgICAgICAgIC8vIFdlIGRvbid0IGRvIHRoaXMgaW4gcHJldmlldyBtb2RlOyB3ZSdsbCBsZXQgdGhlIHByZXZpZXcKKyAgICAgICAgICAgICAgICAvLyBhY3Rpdml0eSB0ZWxsIHVzIHdoZW4gdG8gcnVuLgorICAgICAgICAgICAgICAgIGlmICghbUlXYWxscGFwZXJFbmdpbmUubUlzUHJldmlldykgeworICAgICAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1DYWxsZXIub2J0YWluTWVzc2FnZUkoTVNHX1ZJU0lCSUxJVFlfQ0hBTkdFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aXNpYmxlID8gMSA6IDApOworICAgICAgICAgICAgICAgICAgICBtQ2FsbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoV2FsbHBhcGVyT2Zmc2V0cyhmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ1hPZmZzZXQgPSB4OworICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ1lPZmZzZXQgPSB5OworICAgICAgICAgICAgICAgICAgICBpZiAoIW1PZmZzZXRNZXNzYWdlRW5xdWV1ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1PZmZzZXRNZXNzYWdlRW5xdWV1ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtQ2FsbGVyLm9idGFpbk1lc3NhZ2UoTVNHX1dBTExQQVBFUl9PRkZTRVRTKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DYWxsZXIuc2VuZE1lc3NhZ2UobXNnKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICB9OworICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIFByb3ZpZGVzIGFjY2VzcyB0byB0aGUgc3VyZmFjZSBpbiB3aGljaCB0aGlzIHdhbGxwYXBlciBpcyBkcmF3bi4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBTdXJmYWNlSG9sZGVyIGdldFN1cmZhY2VIb2xkZXIoKSB7CisgICAgICAgICAgICByZXR1cm4gbVN1cmZhY2VIb2xkZXI7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBDb252ZW5pZW5jZSBmb3Ige0BsaW5rIFdhbGxwYXBlck1hbmFnZXIjZ2V0RGVzaXJlZE1pbmltdW1XaWR0aCgpCisgICAgICAgICAqIFdhbGxwYXBlck1hbmFnZXIuZ2V0RGVzaXJlZE1pbmltdW1XaWR0aCgpfSwgcmV0dXJuaW5nIHRoZSB3aWR0aAorICAgICAgICAgKiB0aGF0IHRoZSBzeXN0ZW0gd291bGQgbGlrZSB0aGlzIHdhbGxwYXBlciB0byBydW4gaW4uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGdldERlc2lyZWRNaW5pbXVtV2lkdGgoKSB7CisgICAgICAgICAgICByZXR1cm4gbUlXYWxscGFwZXJFbmdpbmUubVJlcVdpZHRoOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQ29udmVuaWVuY2UgZm9yIHtAbGluayBXYWxscGFwZXJNYW5hZ2VyI2dldERlc2lyZWRNaW5pbXVtSGVpZ2h0KCkKKyAgICAgICAgICogV2FsbHBhcGVyTWFuYWdlci5nZXREZXNpcmVkTWluaW11bUhlaWdodCgpfSwgcmV0dXJuaW5nIHRoZSBoZWlnaHQKKyAgICAgICAgICogdGhhdCB0aGUgc3lzdGVtIHdvdWxkIGxpa2UgdGhpcyB3YWxscGFwZXIgdG8gcnVuIGluLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCBnZXREZXNpcmVkTWluaW11bUhlaWdodCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtSVdhbGxwYXBlckVuZ2luZS5tUmVxSGVpZ2h0OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJuIHdoZXRoZXIgdGhlIHdhbGxwYXBlciBpcyBjdXJyZW50bHkgdmlzaWJsZSB0byB0aGUgdXNlciwKKyAgICAgICAgICogdGhpcyBpcyB0aGUgbGFzdCB2YWx1ZSBzdXBwbGllZCB0bworICAgICAgICAgKiB7QGxpbmsgI29uVmlzaWJpbGl0eUNoYW5nZWQoYm9vbGVhbil9LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNWaXNpYmxlKCkgeworICAgICAgICAgICAgcmV0dXJuIG1WaXNpYmxlOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJucyB0cnVlIGlmIHRoaXMgZW5naW5lIGlzIHJ1bm5pbmcgaW4gcHJldmlldyBtb2RlIC0tIHRoYXQgaXMsCisgICAgICAgICAqIGl0IGlzIGJlaW5nIHNob3duIHRvIHRoZSB1c2VyIGJlZm9yZSB0aGV5IHNlbGVjdCBpdCBhcyB0aGUgYWN0dWFsCisgICAgICAgICAqIHdhbGxwYXBlci4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzUHJldmlldygpIHsKKyAgICAgICAgICAgIHJldHVybiBtSVdhbGxwYXBlckVuZ2luZS5tSXNQcmV2aWV3OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQ29udHJvbCB3aGV0aGVyIHRoaXMgd2FsbHBhcGVyIHdpbGwgcmVjZWl2ZSByYXcgdG91Y2ggZXZlbnRzCisgICAgICAgICAqIGZyb20gdGhlIHdpbmRvdyBtYW5hZ2VyIGFzIHRoZSB1c2VyIGludGVyYWN0cyB3aXRoIHRoZSB3aW5kb3cKKyAgICAgICAgICogdGhhdCBpcyBjdXJyZW50bHkgZGlzcGxheWluZyB0aGUgd2FsbHBhcGVyLiAgQnkgZGVmYXVsdCB0aGV5CisgICAgICAgICAqIGFyZSB0dXJuZWQgb2ZmLiAgSWYgZW5hYmxlZCwgdGhlIGV2ZW50cyB3aWxsIGJlIHJlY2VpdmVkIGluCisgICAgICAgICAqIHtAbGluayAjb25Ub3VjaEV2ZW50KE1vdGlvbkV2ZW50KX0uCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBzZXRUb3VjaEV2ZW50c0VuYWJsZWQoYm9vbGVhbiBlbmFibGVkKSB7CisgICAgICAgICAgICBtV2luZG93RmxhZ3MgPSBlbmFibGVkCisgICAgICAgICAgICAgICAgICAgID8gKG1XaW5kb3dGbGFncyZ+V2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfVE9VQ0hBQkxFKQorICAgICAgICAgICAgICAgICAgICA6IChtV2luZG93RmxhZ3N8V2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfVE9VQ0hBQkxFKTsKKyAgICAgICAgICAgIGlmIChtQ3JlYXRlZCkgeworICAgICAgICAgICAgICAgIHVwZGF0ZVN1cmZhY2UoZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIENhbGxlZCBvbmNlIHRvIGluaXRpYWxpemUgdGhlIGVuZ2luZS4gIEFmdGVyIHJldHVybmluZywgdGhlCisgICAgICAgICAqIGVuZ2luZSdzIHN1cmZhY2Ugd2lsbCBiZSBjcmVhdGVkIGJ5IHRoZSBmcmFtZXdvcmsuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBv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IGludCBkZXNpcmVkSGVpZ2h0KSB7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBDb252ZW5pZW5jZSBmb3Ige0BsaW5rIFN1cmZhY2VIb2xkZXIuQ2FsbGJhY2sjc3VyZmFjZUNoYW5nZWQKKyAgICAgICAgICogU3VyZmFjZUhvbGRlci5DYWxsYmFjay5zdXJmYWNlQ2hhbmdlZCgpfS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU3VyZmFjZUNoYW5nZWQoU3VyZmFjZUhvbGRlciBob2xkZXIsIGludCBmb3JtYXQsIGludCB3aWR0aCwgaW50IGhlaWdodCkgeworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbnZlbmllbmNlIGZvciB7QGxpbmsgU3VyZmFjZUhvbGRlci5DYWxsYmFjayNzdXJmYWNlQ3JlYXRlZAorICAgICAgICAgKiBTdXJmYWNlSG9sZGVyLkNhbGxiYWNrLnN1cmZhY2VDcmVhdGVkKCl9LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25TdXJmYWNlQ3JlYXRlZChTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbnZlbmllbmNlIGZvciB7QGxpbmsgU3VyZmFjZUhvbGRlci5DYWxsYmFjayNzdXJmYWNlRGVzdHJveWVkCisgICAgICAgICAqIFN1cmZhY2VIb2xkZXIuQ2FsbGJhY2suc3VyZmFjZURlc3Ryb3llZCgpfS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU3VyZmFjZURlc3Ryb3llZChTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworICAgICAgICB9CisKKyAgICAgICAgdm9pZCB1cGRhdGVTdXJmYWNlKGJvb2xlYW4gZm9yY2VSZWxheW91dCwgYm9vbGVhbiBmb3JjZVJlcG9ydCkgeworICAgICAgICA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RpbmcgfHwgZm9ybWF0Q2hhbmdlZCB8fCBzaXplQ2hhbmdlZAorICAgICAgICAgICAgICAgICAgICB8fCB0eXBlQ2hhbmdlZCB8fCBmbGFnc0NoYW5nZWQpIHsKKworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiQ2hhbmdlczogY3JlYXRpbmc9IiArIGNyZWF0aW5nCisgICAgICAgICAgICAgICAgICAgICAgICArICIgZm9ybWF0PSIgKyBmb3JtYXRDaGFuZ2VkICsgIiBzaXplPSIgKyBzaXplQ2hhbmdlZCk7CisKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtV2lkdGggPSBteVdpZHRoOworICAgICAgICAgICAgICAgICAgICBtSGVpZ2h0ID0gbXlIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIG1Gb3JtYXQgPSBtU3VyZmFjZUhvbGRlci5nZXRSZXF1ZXN0ZWRGb3JtYXQoKTsKKyAgICAgICAgICAgICAgICAgICAgbVR5cGUgPSBtU3VyZmFjZUhvbGRlci5nZXRSZXF1ZXN0ZWRUeXBlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgbUxheW91dC54ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgbUxheW91dC55ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgbUxheW91dC53aWR0aCA9IG15V2lkdGg7CisgICAgICAgICAgICAgICAgICAgIG1MYXlvdXQuaGVpZ2h0ID0gbXlIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBtTGF5b3V0LmZvcm1hdCA9IG1Gb3JtYXQ7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBtQ3VyV2luZG93RmxhZ3MgPSBtV2luZG93RmxhZ3M7CisgICAgICAgICAgICAgICAgICAgIG1MYXlvdXQuZmxhZ3MgPSBtV2luZG93RmxhZ3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfTEFZT1VUX05PX0xJTUlUUworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19MQVlPVVRfSU5fU0NSRUVOCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5GTEFHX05PVF9GT0NVU0FCTEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA7CisKKyAgICAgICAgICAgICAgICAgICAgbUxheW91dC5tZW1vcnlUeXBlID0gbVR5cGU7CisgICAgICAgICAgICAgICAgICAgIG1MYXlvdXQudG9rZW4gPSBtV2luZG93VG9rZW47CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFtQ3JlYXRlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUxheW91dC50eXBlID0gbUlXYWxscGFwZXJFbmdpbmUubVdpbmRvd1R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGF5b3V0LmdyYXZpdHkgPSBHcmF2aXR5LkxFRlR8R3Jhdml0eS5UT1A7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGF5b3V0LnNldFRpdGxlKFdhbGxwYXBlclNlcnZpY2UudGhpcy5nZXRDbGFzcygpLmdldE5hbWUoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGF5b3V0LndpbmRvd0FuaW1hdGlvbnMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlLkFuaW1hdGlvbl9XYWxscGFwZXI7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2Vzc2lvbi5hZGQobVdpbmRvdywgbUxheW91dCwgVmlldy5WSVNJQkxFLCBtQ29udGVudEluc2V0cyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIG1TdXJmYWNlSG9sZGVyLm1TdXJmYWNlTG9jay5sb2NrKCk7CisgICAgICAgICAgICAgICAgICAgIG1EcmF3aW5nQWxsb3dlZCA9IHRydWU7CisKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IHJlbGF5b3V0UmVzdWx0ID0gbVNlc3Npb24ucmVsYXlvdXQoCisgICAgICAgICAgICAgICAgICAgICAgICBtV2luZG93LCBtTGF5b3V0LCBtV2lkdGgsIG1IZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlldy5WSVNJQkxFLCBmYWxzZSwgbVdpbkZyYW1lLCBtQ29udGVudEluc2V0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVmlzaWJsZUluc2V0cywgbVN1cmZhY2VIb2xkZXIubVN1cmZhY2UpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiTmV3IHN1cmZhY2U6ICIgKyBtU3VyZmFjZUhvbGRlci5tU3VyZmFjZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgZnJhbWU9IiArIG1XaW5GcmFtZSk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpbnQgdyA9IG1XaW5GcmFtZS53aWR0aCgpOworICAgICAgICAgICAgICAgICAgICBpZiAobUN1cldpZHRoICE9IHcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVDaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJXaWR0aCA9IHc7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaW50IGggPSBtV2luRnJhbWUuaGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQ3VySGVpZ2h0ICE9IGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVDaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJIZWlnaHQgPSBoOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUhvbGRlci5tU3VyZmFjZUxvY2sudW5sb2NrKCk7CisKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1EZXN0cm95UmVwb3J0TmVlZGVkID0gdHJ1ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgU3VyZmFjZUhvbGRlci5DYWxsYmFjayBjYWxsYmFja3NbXSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TdXJmYWNlSG9sZGVyLm1DYWxsYmFja3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1TdXJmYWNlSG9sZGVyLm1DYWxsYmFja3Muc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja3MgPSBuZXcgU3VyZmFjZUhvbGRlci5DYWxsYmFja1tOXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN1cmZhY2VIb2xkZXIubUNhbGxiYWNrcy50b0FycmF5KGNhbGxiYWNrcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1DcmVhdGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUlzQ3JlYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAib25TdXJmYWNlQ3JlYXRlZCgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1TdXJmYWNlSG9sZGVyICsgIik6ICIgKyB0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvblN1cmZhY2VDcmVhdGVkKG1TdXJmYWNlSG9sZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2tzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChTdXJmYWNlSG9sZGVyLkNhbGxiYWNrIGMgOiBjYWxsYmFja3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMuc3VyZmFjZUNyZWF0ZWQobVN1cmZhY2VIb2xkZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvcmNlUmVwb3J0IHx8IGNyZWF0aW5nIHx8IGZvcm1hdENoYW5nZWQgfHwgc2l6ZUNoYW5nZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVudGltZUV4Y2VwdGlvbiBlID0gbmV3IFJ1bnRpbWVFeGNlcHRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5maWxsSW5TdGFja1RyYWNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgImZvcmNlUmVwb3J0PSIgKyBmb3JjZVJlcG9ydCArICIgY3JlYXRpbmc9IiArIGNyZWF0aW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGZvcm1hdENoYW5nZWQ9IiArIGZvcm1hdENoYW5nZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgc2l6ZUNoYW5nZWQ9IiArIHNpemVDaGFuZ2VkLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJvblN1cmZhY2VDaGFuZ2VkKCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbVN1cmZhY2VIb2xkZXIgKyAiLCAiICsgbUZvcm1hdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCAiICsgbUN1cldpZHRoICsgIiwgIiArIG1DdXJIZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIik6ICIgKyB0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvblN1cmZhY2VDaGFuZ2VkKG1TdXJmYWNlSG9sZGVyLCBtRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUN1cldpZHRoLCBtQ3VySGVpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2tzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChTdXJmYWNlSG9sZGVyLkNhbGxiYWNrIGMgOiBjYWxsYmFja3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMuc3VyZmFjZUNoYW5nZWQobVN1cmZhY2VIb2xkZXIsIG1Gb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJXaWR0aCwgbUN1ckhlaWdodCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtSXNDcmVhdGluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgbUNyZWF0ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNyZWF0aW5nIHx8IChyZWxheW91dFJlc3VsdCZXaW5kb3dNYW5hZ2VySW1wbC5SRUxBWU9VVF9GSVJTVF9USU1FKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb24uZmluaXNoRHJhd2luZyhtV2luZG93KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KAorICAgICAgICAgICAgICAgICAgICBUQUcsICJMYXlvdXQ6IHg9IiArIG1MYXlvdXQueCArICIgeT0iICsgbUxheW91dC55ICsKKyAgICAgICAgICAgICAgICAgICAgIiB3PSIgKyBtTGF5b3V0LndpZHRoICsgIiBoPSIgKyBtTGF5b3V0LmhlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHZvaWQgYXR0YWNoKElXYWxscGFwZXJFbmdpbmVXcmFwcGVyIHdyYXBwZXIpIHsKKyAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiYXR0YWNoOiAiICsgdGhpcyArICIgd3JhcHBlcj0iICsgd3JhcHBlcik7CisgICAgICAgICAgICBpZiAobURlc3Ryb3llZCkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUlXYWxscGFwZXJFbmdpbmUgPSB3cmFwcGVyOworICAgICAgICAgICAgbUNhbGxlciA9IHdyYXBwZXIubUNhbGxlcjsKKyAgICAgICAgICAgIG1Db25uZWN0aW9uID0gd3JhcHBlci5tQ29ubmVjdGlvbjsKKyAgICAgICAgICAgIG1XaW5kb3dUb2tlbiA9IHdyYXBwZXIubVdpbmRvd1Rva2VuOworICAgICAgICAgICAgbVN1cmZhY2VIb2xkZXIuc2V0U2l6ZUZyb21MYXlvdXQoKTsKKyAgICAgICAgICAgIG1Jbml0aWFsaXppbmcgPSB0cnVlOworICAgICAgICAgICAgbVNlc3Npb24gPSBWaWV3Um9vdC5nZXRXaW5kb3dTZXNzaW9uKGdldE1haW5Mb29wZXIoKSk7CisgICAgICAgICAgICBtV2luZG93LnNldFNlc3Npb24obVNlc3Npb24pOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm9uQ3JlYXRlKCk6ICIgKyB0aGlzKTsKKyAgICAgICAgICAgIG9uQ3JlYXRlKG1TdXJmYWNlSG9sZGVyKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUluaXRpYWxpemluZyA9IGZhbHNlOworICAgICAgICAgICAgdXBkYXRlU3VyZmFjZShmYWxzZSwgZmFsc2UpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICB2b2lkIGRvRGVzaXJlZFNpemVDaGFuZ2VkKGludCBkZXNpcmVkV2lkdGgsIGludCBkZXNpcmVkSGVpZ2h0KSB7CisgICAgICAgICAgICBpZiAoIW1EZXN0cm95ZWQpIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm9uRGVzaXJlZFNpemVDaGFuZ2VkKCIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZGVzaXJlZFdpZHRoICsgIiwiICsgZGVzaXJlZEhlaWdodCArICIpOiAiICsgdGhpcyk7CisgICAgICAgICAgICAgICAgb25EZXNpcmVkU2l6ZUNoYW5nZWQoZGVzaXJlZFdpZHRoLCBkZXNpcmVkSGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdm9pZCBkb1Zpc2liaWxpdHlDaGFuZ2VkKGJvb2xlYW4gdmlzaWJsZSkgeworICAgICAgICAgICAgaWYgKCFtRGVzdHJveWVkKSB7CisgICAgICAgICAgICAgICAgbVZpc2libGUgPSB2aXNpYmxlOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAib25WaXNpYmlsaXR5Q2hhbmdlZCgiICsgdmlzaWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgKyAiKTogIiArIHRoaXMpOworICAgICAgICAgICAgICAgIG9uVmlzaWJpbGl0eUNoYW5nZWQodmlzaWJsZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHZvaWQgZG9PZmZzZXRzQ2hhbmdlZCgpIHsKKyAgICAgICAgICAgIGlmIChtRGVzdHJveWVkKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBmbG9hdCB4T2Zmc2V0OworICAgICAgICAgICAgZmxvYXQgeU9mZnNldDsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgICAgICB4T2Zmc2V0ID0gbVBlbmRpbmdYT2Zmc2V0OworICAgICAgICAgICAgICAgIHlPZmZzZXQgPSBtUGVuZGluZ1lPZmZzZXQ7CisgICAgICAgICAgICAgICAgbU9mZnNldE1lc3NhZ2VFbnF1ZXVlZCA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJPZmZzZXRzIGNoYW5nZSBpbiAiICsgdGhpcworICAgICAgICAgICAgICAgICAgICArICI6ICIgKyB4T2Zmc2V0ICsgIiwiICsgeU9mZnNldCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgYXZhaWx3ID0gbUlXYWxscGFwZXJFbmdpbmUubVJlcVdpZHRoLW1DdXJXaWR0aDsKKyAgICAgICAgICAgIGZpbmFsIGludCB4UGl4ZWxzID0gYXZhaWx3ID4gMCA/IC0oaW50KShhdmFpbHcqeE9mZnNldCsuNWYpIDogMDsKKyAgICAgICAgICAgIGZpbmFsIGludCBhdmFpbGggPSBtSVdhbGxwYXBlckVuZ2luZS5tUmVxSGVpZ2h0LW1DdXJIZWlnaHQ7CisgICAgICAgICAgICBmaW5hbCBpbnQgeVBpeGVscyA9IGF2YWlsaCA+IDAgPyAtKGludCkoYXZhaWxoKnlPZmZzZXQrLjVmKSA6IDA7CisgICAgICAgICAgICBvbk9mZnNldHNDaGFuZ2VkKHhPZmZzZXQsIHlPZmZzZXQsIHhQaXhlbHMsIHlQaXhlbHMpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICB2b2lkIGRldGFjaCgpIHsKKyAgICAgICAgICAgIG1EZXN0cm95ZWQgPSB0cnVlOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAobVZpc2libGUpIHsKKyAgICAgICAgICAgICAgICBtVmlzaWJsZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAib25WaXNpYmlsaXR5Q2hhbmdlZChmYWxzZSk6ICIgKyB0aGlzKTsKKyAgICAgICAgICAgICAgICBvblZpc2liaWxpdHlDaGFuZ2VkKGZhbHNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG1EZXN0cm95UmVwb3J0TmVlZGVkKSB7CisgICAgICAgICAgICAgICAgbURlc3Ryb3lSZXBvcnROZWVkZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBTdXJmYWNlSG9sZGVyLkNhbGxiYWNrIGNhbGxiYWNrc1tdOworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVN1cmZhY2VIb2xkZXIubUNhbGxiYWNrcykgeworICAgICAgICAgICAgICAgICAgICBjYWxsYmFja3MgPSBuZXcgU3VyZmFjZUhvbGRlci5DYWxsYmFja1sKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUhvbGRlci5tQ2FsbGJhY2tzLnNpemUoKV07CisgICAgICAgICAgICAgICAgICAgIG1TdXJmYWNlSG9sZGVyLm1DYWxsYmFja3MudG9BcnJheShjYWxsYmFja3MpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKFN1cmZhY2VIb2xkZXIuQ2FsbGJhY2sgYyA6IGNhbGxiYWNrcykgeworICAgICAgICAgICAgICAgICAgICBjLnN1cmZhY2VEZXN0cm95ZWQobVN1cmZhY2VIb2xkZXIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm9uU3VyZmFjZURlc3Ryb3llZCgiCisgICAgICAgICAgICAgICAgICAgICAgICArIG1TdXJmYWNlSG9sZGVyICsgIik6ICIgKyB0aGlzKTsKKyAgICAgICAgICAgICAgICBvblN1cmZhY2VEZXN0cm95ZWQobVN1cmZhY2VIb2xkZXIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm9uRGVzdHJveSgpOiAiICsgdGhpcyk7CisgICAgICAgICAgICBvbkRlc3Ryb3koKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG1DcmVhdGVkKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgbVNlc3Npb24ucmVtb3ZlKG1XaW5kb3cpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1TdXJmYWNlSG9sZGVyLm1TdXJmYWNlLnJlbGVhc2UoKTsKKyAgICAgICAgICAgICAgICBtQ3JlYXRlZCA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIGNsYXNzIElXYWxscGFwZXJFbmdpbmVXcmFwcGVyIGV4dGVuZHMgSVdhbGxwYXBlckVuZ2luZS5TdHViCisgICAgICAgICAgICBpbXBsZW1lbnRzIEhhbmRsZXJDYWxsZXIuQ2FsbGJhY2sgeworICAgICAgICBwcml2YXRlIGZpbmFsIEhhbmRsZXJDYWxsZXIgbUNhbGxlcjsKKworICAgICAgICBmaW5hbCBJV2FsbHBhcGVyQ29ubmVjdGlvbiBtQ29ubmVjdGlvbjsKKyAgICAgICAgZmluYWwgSUJpbmRlciBtV2luZG93VG9rZW47CisgICAgICAgIGZpbmFsIGludCBtV2luZG93VHlwZTsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBtSXNQcmV2aWV3OworICAgICAgICBpbnQgbVJlcVdpZHRoOworICAgICAgICBpbnQgbVJlcUhlaWdodDsKKyAgICAgICAgCisgICAgICAgIEVuZ2luZSBtRW5naW5lOworICAgICAgICAKKyAgICAgICAgSVdhbGxwYXBlckVuZ2luZVdyYXBwZXIoV2FsbHBhcGVyU2VydmljZSBjb250ZXh0LAorICAgICAgICAgICAgICAgIElXYWxscGFwZXJDb25uZWN0aW9uIGNvbm4sIElCaW5kZXIgd2luZG93VG9rZW4sCisgICAgICAgICAgICAgICAgaW50IHdpbmRvd1R5cGUsIGJvb2xlYW4gaXNQcmV2aWV3LCBpbnQgcmVxV2lkdGgsIGludCByZXFIZWlnaHQpIHsKKyAgICAgICAgICAgIG1DYWxsZXIgPSBuZXcgSGFuZGxlckNhbGxlcihjb250ZXh0LCB0aGlzKTsKKyAgICAgICAgICAgIG1Db25uZWN0aW9uID0gY29ubjsKKyAgICAgICAgICAgIG1XaW5kb3dUb2tlbiA9IHdpbmRvd1Rva2VuOworICAgICAgICAgICAgbVdpbmRvd1R5cGUgPSB3aW5kb3dUeXBlOworICAgICAgICAgICAgbUlzUHJldmlldyA9IGlzUHJldmlldzsKKyAgICAgICAgICAgIG1SZXFXaWR0aCA9IHJlcVdpZHRoOworICAgICAgICAgICAgbVJlcUhlaWdodCA9IHJlcUhlaWdodDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtQ2FsbGVyLm9idGFpbk1lc3NhZ2UoRE9fQVRUQUNIKTsKKyAgICAgICAgICAgIG1DYWxsZXIuc2VuZE1lc3NhZ2UobXNnKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIHZvaWQgc2V0RGVzaXJlZFNpemUoaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1DYWxsZXIub2J0YWluTWVzc2FnZUlJKERPX1NFVF9ERVNJUkVEX1NJWkUsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgbUNhbGxlci5zZW5kTWVzc2FnZShtc2cpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgdm9pZCBzZXRWaXNpYmlsaXR5KGJvb2xlYW4gdmlzaWJsZSkgeworICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtQ2FsbGVyLm9idGFpbk1lc3NhZ2VJKE1TR19WSVNJQklMSVRZX0NIQU5HRUQsCisgICAgICAgICAgICAgICAgICAgIHZpc2libGUgPyAxIDogMCk7CisgICAgICAgICAgICBtQ2FsbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBkZXN0cm95KCkgeworICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtQ2FsbGVyLm9idGFpbk1lc3NhZ2UoRE9fREVUQUNIKTsKKyAgICAgICAgICAgIG1DYWxsZXIuc2VuZE1lc3NhZ2UobXNnKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGV4ZWN1dGVNZXNzYWdlKE1lc3NhZ2UgbWVzc2FnZSkgeworICAgICAgICAgICAgc3dpdGNoIChtZXNzYWdlLndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIERPX0FUVEFDSDogeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3Rpb24uYXR0YWNoRW5naW5lKHRoaXMpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiV2FsbHBhcGVyIGhvc3QgZGlzYXBwZWFyZWQiLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBFbmdpbmUgZW5naW5lID0gb25DcmVhdGVFbmdpbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgbUVuZ2luZSA9IGVuZ2luZTsKKyAgICAgICAgICAgICAgICAgICAgZW5naW5lLmF0dGFjaCh0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIERPX0RFVEFDSDogeworICAgICAgICAgICAgICAgICAgICBtRW5naW5lLmRldGFjaCgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRE9fU0VUX0RFU0lSRURfU0laRTogeworICAgICAgICAgICAgICAgICAgICBtRW5naW5lLmRvRGVzaXJlZFNpemVDaGFuZ2VkKG1lc3NhZ2UuYXJnMSwgbWVzc2FnZS5hcmcyKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIE1TR19VUERBVEVfU1VSRkFDRToKKyAgICAgICAgICAgICAgICAgICAgbUVuZ2luZS51cGRhdGVTdXJmYWNlKHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfVklTSUJJTElUWV9DSEFOR0VEOgorICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIlZpc2liaWxpdHkgY2hhbmdlIGluICIgKyBtRW5naW5lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiAiICsgbWVzc2FnZS5hcmcxKTsKKyAgICAgICAgICAgICAgICAgICAgbUVuZ2luZS5kb1Zpc2liaWxpdHlDaGFuZ2VkKG1lc3NhZ2UuYXJnMSAhPSAwKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBNU0dfV0FMTFBBUEVSX09GRlNFVFM6IHsKKyAgICAgICAgICAgICAgICAgICAgbUVuZ2luZS5kb09mZnNldHNDaGFuZ2VkKCk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19XSU5ET1dfUkVTSVpFRDogeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlcG9ydERyYXcgPSBtZXNzYWdlLmFyZzEgIT0gMDsKKyAgICAgICAgICAgICAgICAgICAgbUVuZ2luZS51cGRhdGVTdXJmYWNlKHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlcG9ydERyYXcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUVuZ2luZS5tU2Vzc2lvbi5maW5pc2hEcmF3aW5nKG1FbmdpbmUubVdpbmRvdyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE1TR19UT1VDSF9FVkVOVDogeworICAgICAgICAgICAgICAgICAgICBNb3Rpb25FdmVudCBldiA9IChNb3Rpb25FdmVudCltZXNzYWdlLm9iajsKKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtRW5naW5lLm1Mb2NrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUVuZ2luZS5tUGVuZGluZ01vdmUgPT0gZXYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRW5naW5lLm1QZW5kaW5nTW92ZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbUVuZ2luZS5vblRvdWNoRXZlbnQoZXYpOworICAgICAgICAgICAgICAgICAgICBldi5yZWN5Y2xlKCk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0IDoKKyAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiVW5rbm93biBtZXNzYWdlIHR5cGUgIiArIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBJbXBsZW1lbnRzIHRoZSBpbnRlcm5hbCB7QGxpbmsgSVdhbGxwYXBlclNlcnZpY2V9IGludGVyZmFjZSB0byBjb252ZXJ0CisgICAgICogaW5jb21pbmcgY2FsbHMgdG8gaXQgYmFjayB0byBjYWxscyBvbiBhbiB7QGxpbmsgV2FsbHBhcGVyU2VydmljZX0uCisgICAgICovCisgICAgY2xhc3MgSVdhbGxwYXBlclNlcnZpY2VXcmFwcGVyIGV4dGVuZHMgSVdhbGxwYXBlclNlcnZpY2UuU3R1YiB7CisgICAgICAgIHByaXZhdGUgZmluYWwgV2FsbHBhcGVyU2VydmljZSBtVGFyZ2V0OworCisgICAgICAgIHB1YmxpYyBJV2FsbHBhcGVyU2VydmljZVdyYXBwZXIoV2FsbHBhcGVyU2VydmljZSBjb250ZXh0KSB7CisgICAgICAgICAgICBtVGFyZ2V0ID0gY29udGV4dDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGF0dGFjaChJV2FsbHBhcGVyQ29ubmVjdGlvbiBjb25uLCBJQmluZGVyIHdpbmRvd1Rva2VuLAor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yw3IEBACiBwYWNrYWdlIGFuZHJvaWQuc3luY21sLnBpbS52Y2FyZDsKIAogaW1wb3J0IGFuZHJvaWQuY29udGVudC5BYnN0cmFjdFN5bmNhYmxlQ29udGVudFByb3ZpZGVyOworaW1wb3J0IGFuZHJvaWQuY29udGVudC5Db250ZW50UHJvdmlkZXJPcGVyYXRpb247CiBpbXBvcnQgYW5kcm9pZC5jb250ZW50LkNvbnRlbnRSZXNvbHZlcjsKIGltcG9ydCBhbmRyb2lkLmNvbnRlbnQuQ29udGVudFVyaXM7CiBpbXBvcnQgYW5kcm9pZC5jb250ZW50LkNvbnRlbnRWYWx1ZXM7CkBAIC03ODAsMTcgKzc4MSwxNiBAQAogICAgICAgICAgICAgICAgIHBlcnNvbklkID0gQ29udGVudFVyaXMucGFyc2VJZChwZXJzb25VcmkpOwogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcGVyc29uVXJpID0gcHJvdmlkZXIubm9uVHJhbnNhY3Rpb25hbEluc2VydChQZW9wbGUuQ09OVEVOVF9VUkksIGNvbnRlbnRWYWx1ZXMpOworICAgICAgICAgICAgcGVyc29uVXJpID0gcHJvdmlkZXIuaW5zZXJ0KFBlb3BsZS5DT05URU5UX1VSSSwgY29udGVudFZhbHVlcyk7CiAgICAgICAgICAgICBpZiAocGVyc29uVXJpICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBwZXJzb25JZCA9IENvbnRlbnRVcmlzLnBhcnNlSWQocGVyc29uVXJpKTsKICAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CiAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChHcm91cE1lbWJlcnNoaXAuUEVSU09OX0lELCBwZXJzb25JZCk7CiAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChHcm91cE1lbWJlcnNoaXAuR1JPVVBfSUQsIG15Q29udGFjdHNHcm91cElkKTsKLSAgICAgICAgICAgICAgICBVcmkgcmVzdWx0VXJpID0gcHJvdmlkZXIubm9uVHJhbnNhY3Rpb25hbEluc2VydCgKLSAgICAgICAgICAgICAgICAgICAgICAgIEdyb3VwTWVtYmVyc2hpcC5DT05URU5UX1VSSSwgdmFsdWVzKTsKKyAgICAgICAgICAgICAgICBVcmkgcmVzdWx0VXJpID0gcHJvdmlkZXIuaW5zZXJ0KEdyb3VwTWVtYmVyc2hpcC5DT05URU5UX1VSSSwgdmFsdWVzKTsKICAgICAgICAgICAgICAgICBpZiAocmVzdWx0VXJpID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkZhaWxkIHRvIGluc2VydCB0aGUgcGVyc29uIHRvIE15Q29udGFjdC4iKTsKLSAgICAgICAgICAgICAgICAgICAgcHJvdmlkZXIubm9uVHJhbnNhY3Rpb25hbERlbGV0ZShwZXJzb25VcmksIG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgICAgICBwcm92aWRlci5kZWxldGUocGVyc29uVXJpLCBudWxsLCBudWxsKTsKICAgICAgICAgICAgICAgICAgICAgcGVyc29uVXJpID0gbnVsbDsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC04MzAsNyArODMwLDcgQEAKICAgICAgICAgICAgICAgICBpZiAocmVzb2x2ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBwaG9uZVVyaSA9IHJlc29sdmVyLmluc2VydChQaG9uZXMuQ09OVEVOVF9VUkksIHZhbHVlcyk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcGhvbmVVcmkgPSBwcm92aWRlci5ub25UcmFuc2FjdGlvbmFsSW5zZXJ0KFBob25lcy5DT05URU5UX1VSSSwgdmFsdWVzKTsKKyAgICAgICAgICAgICAgICAgICAgcGhvbmVVcmkgPSBwcm92aWRlci5pbnNlcnQoUGhvbmVzLkNPTlRFTlRfVVJJLCB2YWx1ZXMpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAocGhvbmVEYXRhLmlzUHJpbWFyeSkgewogICAgICAgICAgICAgICAgICAgICBwcmltYXJ5UGhvbmVJZCA9IExvbmcucGFyc2VMb25nKHBob25lVXJpLmdldExhc3RQYXRoU2VnbWVudCgpKTsKQEAgLTg1Niw4ICs4NTYsNyBAQAogICAgICAgICAgICAgICAgIGlmIChyZXNvbHZlciAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG9yZ2FuaXphdGlvblVyaSA9IHJlc29sdmVyLmluc2VydChPcmdhbml6YXRpb25zLkNPTlRFTlRfVVJJLCB2YWx1ZXMpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG9yZ2FuaXphdGlvblVyaSA9IHByb3ZpZGVyLm5vblRyYW5zYWN0aW9uYWxJbnNlcnQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT3JnYW5pemF0aW9ucy5DT05URU5UX1VSSSwgdmFsdWVzKTsKKyAgICAgICAgICAgICAgICAgICAgb3JnYW5pemF0aW9uVXJpID0gcHJvdmlkZXIuaW5zZXJ0KE9yZ2FuaXphdGlvbnMuQ09OVEVOVF9VUkksIHZhbHVlcyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmIChvcmdhbml6YXRpb25EYXRhLmlzUHJpbWFyeSkgewogICAgICAgICAgICAgICAgICAgICBwcmltYXJ5T3JnYW5pemF0aW9uSWQgPSBMb25nLnBhcnNlTG9uZyhvcmdhbml6YXRpb25VcmkuZ2V0TGFzdFBhdGhTZWdtZW50KCkpOwpAQCAtODgzLDggKzg4Miw3IEBACiAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNvbHZlciAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBlbWFpbFVyaSA9IHJlc29sdmVyLmluc2VydChDb250YWN0TWV0aG9kcy5DT05URU5UX1VSSSwgdmFsdWVzKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGVtYWlsVXJpID0gcHJvdmlkZXIubm9uVHJhbnNhY3Rpb25hbEluc2VydCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29udGFjdE1ldGhvZHMuQ09OVEVOVF9VUkksIHZhbHVlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbWFpbFVyaSA9IHByb3ZpZGVyLmluc2VydChDb250YWN0TWV0aG9kcy5DT05URU5UX1VSSSwgdmFsdWVzKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAoY29udGFjdE1ldGhvZC5pc1ByaW1hcnkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlFbWFpbElkID0gTG9uZy5wYXJzZUxvbmcoZW1haWxVcmkuZ2V0TGFzdFBhdGhTZWdtZW50KCkpOwpAQCAtODkzLDggKzg5MSw3IEBACiAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNvbHZlciAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlci5pbnNlcnQoQ29udGFjdE1ldGhvZHMuQ09OVEVOVF9VUkksIHZhbHVlcyk7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm92aWRlci5ub25UcmFuc2FjdGlvbmFsSW5zZXJ0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb250YWN0TWV0aG9kcy5DT05URU5UX1VSSSwgdmFsdWVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyLmluc2VydChDb250YWN0TWV0aG9kcy5DT05URU5UX1VSSSwgdmFsdWVzKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTkxOCw3ICs5MTUsNyBAQAogICAgICAgICAgICAgICAgICAgICBpZiAocmVzb2x2ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0FycmF5LmFkZCh2YWx1ZXMpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgcHJvdmlkZXIubm9uVHJhbnNhY3Rpb25hbEluc2VydChFeHRlbnNpb25zLkNPTlRFTlRfVVJJLCB2YWx1ZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgcHJvdmlkZXIuaW5zZXJ0KEV4dGVuc2lvbnMuQ09OVEVOVF9VUkksIHZhbHVlcyk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC05NDIsNyArOTM5LDcgQEAKICAgICAgICAgICAgIGlmIChyZXNvbHZlciAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmVzb2x2ZXIudXBkYXRlKHBlcnNvblVyaSwgdmFsdWVzLCBudWxsLCBudWxsKTsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHJvdmlkZXIubm9uVHJhbnNhY3Rpb25hbFVwZGF0ZShwZXJzb25VcmksIHZhbHVlcywgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgcHJvdmlkZXIudXBkYXRlKHBlcnNvblVyaSwgdmFsdWVzLCBudWxsLCBudWxsKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTk2MCwxMiArOTU3LDEyIEBACiAgICAgcHVibGljIHZvaWQgcHVzaEludG9BYnN0cmFjdFN5bmNhYmxlQ29udGVudFByb3ZpZGVyKAogICAgICAgICAgICAgQWJzdHJhY3RTeW5jYWJsZUNvbnRlbnRQcm92aWRlciBwcm92aWRlciwgbG9uZyBteUNvbnRhY3RzR3JvdXBJZCkgewogICAgICAgICBib29sZWFuIHN1Y2Nlc3NmdWwgPSBmYWxzZTsKLSAg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5nZTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChzdGFydERheSAhPSBlbmREYXkpIHsKQEAgLTE0OTYsMTIgKzE1MjMsMTEgQEAKIAogICAgICAgICAgICAgLy8gVGhlIHZhbHVlcyB0aGF0IGFyZSB1c2VkIGluIGEgZnVsbEZvcm1hdCBzdHJpbmcgYXJlIHNwZWNpZmllZAogICAgICAgICAgICAgLy8gYnkgcG9zaXRpb24uCi0gICAgICAgICAgICBkYXRlUmFuZ2UgPSBTdHJpbmcuZm9ybWF0KGZ1bGxGb3JtYXQsCisgICAgICAgICAgICByZXR1cm4gZm9ybWF0dGVyLmZvcm1hdChmdWxsRm9ybWF0LAogICAgICAgICAgICAgICAgICAgICBzdGFydFdlZWtEYXlTdHJpbmcsIHN0YXJ0TW9udGhTdHJpbmcsIHN0YXJ0TW9udGhEYXlTdHJpbmcsCiAgICAgICAgICAgICAgICAgICAgIHN0YXJ0WWVhclN0cmluZywgc3RhcnRUaW1lU3RyaW5nLAogICAgICAgICAgICAgICAgICAgICBlbmRXZWVrRGF5U3RyaW5nLCBlbmRNb250aFN0cmluZywgZW5kTW9udGhEYXlTdHJpbmcsCiAgICAgICAgICAgICAgICAgICAgIGVuZFllYXJTdHJpbmcsIGVuZFRpbWVTdHJpbmcpOwotICAgICAgICAgICAgcmV0dXJuIGRhdGVSYW5nZTsKICAgICAgICAgfQogCiAgICAgICAgIC8vIFNhbWUgc3RhcnQgYW5kIGVuZCBkYXkKQEAgLTE1MjIsNiArMTU0OCw3IEBACiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIC8vIEV4YW1wbGU6ICIxMDowMCAtIDExOjAwIGFtIgogICAgICAgICAgICAgICAgIFN0cmluZyB0aW1lRm9ybWF0ID0gcmVzLmdldFN0cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy50aW1lMV90aW1lMik7CisgICAgICAgICAgICAgICAgLy8gRG9uJ3QgdXNlIHRoZSB1c2VyIHN1cHBsaWVkIEZvcm1hdHRlciBiZWNhdXNlIHRoZSByZXN1bHQgd2lsbCBwb2xsdXRlIHRoZSBidWZmZXIuCiAgICAgICAgICAgICAgICAgdGltZVN0cmluZyA9IFN0cmluZy5mb3JtYXQodGltZUZvcm1hdCwgc3RhcnRUaW1lU3RyaW5nLCBlbmRUaW1lU3RyaW5nKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMTU0NSw3ICsxNTcyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgZnVsbEZvcm1hdCA9IHJlcy5nZXRTdHJpbmcoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcudGltZV9kYXRlKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAvLyBFeGFtcGxlOiAiT2N0IDkiCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXRlU3RyaW5nOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZm9ybWF0dGVyLmZvcm1hdCgiJXMiLCBkYXRlU3RyaW5nKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSBpZiAoc2hvd1dlZWtEYXkpIHsKQEAgLTE1NTQsMTYgKzE1ODEsMTUgQEAKICAgICAgICAgICAgICAgICBmdWxsRm9ybWF0ID0gcmVzLmdldFN0cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy50aW1lX3dkYXkpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAvLyBFeGFtcGxlOiAiVHVlIgotICAgICAgICAgICAgICAgIHJldHVybiBzdGFydFdlZWtEYXlTdHJpbmc7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZvcm1hdHRlci5mb3JtYXQoIiVzIiwgc3RhcnRXZWVrRGF5U3RyaW5nKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIGlmIChzaG93VGltZSkgewotICAgICAgICAgIC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vcnQgYW5kcm9pZC52aWV3LlZpZXdDb25maWd1cmF0aW9uOwogaW1wb3J0IGFuZHJvaWQudmlldy5Nb3Rpb25FdmVudDsKIAogLy8gWFhYIHRoaXMgZG9lc24ndCBleHRlbmQgTWV0YUtleUtleUxpc3RlbmVyIGJlY2F1c2UgdGhlIHNpZ25hdHVyZXMKQEAgLTI1Niw4ICsyNTcsMzIgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChNZXRhS2V5S2V5TGlzdGVuZXIuZ2V0TWV0YVN0YXRlKGJ1ZmZlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWV0YUtleUtleUxpc3RlbmVyLk1FVEFfU0VMRUNUSU5HKSAhPSAwKTsKIAorICAgICAgICAgICAgICAgIERvdWJsZVRhcFN0YXRlW10gdGFwID0gYnVmZmVyLmdldFNwYW5zKDAsIGJ1ZmZlci5sZW5ndGgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEb3VibGVUYXBTdGF0ZS5jbGFzcyk7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBkb3VibGV0YXAgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIGlmICh0YXAubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQuZ2V0RXZlbnRUaW1lKCkgLSB0YXBbMF0ubVdoZW4gPD0KKyAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdDb25maWd1cmF0aW9uLmdldERvdWJsZVRhcFRpbWVvdXQoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNhbWVXb3JkKGJ1ZmZlciwgb2ZmLCBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKGJ1ZmZlcikpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxldGFwID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHRhcFswXS5tV2hlbiA9IGV2ZW50LmdldEV2ZW50VGltZSgpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIERvdWJsZVRhcFN0YXRlIG5ld3RhcCA9IG5ldyBEb3VibGVUYXBTdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICBuZXd0YXAubVdoZW4gPSBldmVudC5nZXRFdmVudFRpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnNldFNwYW4obmV3dGFwLCAwLCBidWZmZXIubGVuZ3RoKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uYWJsZS5TUEFOX0lOQ0xVU0lWRV9JTkNMVVNJVkUpOworICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICAgIGlmIChjYXApIHsKICAgICAgICAgICAgICAgICAgICAgU2VsZWN0aW9uLmV4dGVuZFNlbGVjdGlvbihidWZmZXIsIG9mZik7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkb3VibGV0YXApIHsKKyAgICAgICAgICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbihidWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFdvcmRTdGFydChidWZmZXIsIG9mZiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFdvcmRFbmQoYnVmZmVyLCBvZmYpKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKGJ1ZmZlciwgb2ZmKTsKICAgICAgICAgICAgICAgICB9CkBAIC0yNzIsNiArMjk3LDYyIEBACiAgICAgICAgIHJldHVybiBoYW5kbGVkOwogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIERvdWJsZVRhcFN0YXRlIGltcGxlbWVudHMgTm9Db3B5U3BhbiB7CisgICAgICAgIGxvbmcgbVdoZW47CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBzYW1lV29yZChDaGFyU2VxdWVuY2UgdGV4dCwgaW50IG9uZSwgaW50IHR3bykgeworICAgICAgICBpbnQgc3RhcnQgPSBmaW5kV29yZFN0YXJ0KHRleHQsIG9uZSk7CisgICAgICAgIGludCBlbmQgPSBmaW5kV29yZEVuZCh0ZXh0LCBvbmUpOworCisgICAgICAgIGlmIChlbmQgPT0gc3RhcnQpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBzdGFydCA9PSBmaW5kV29yZFN0YXJ0KHRleHQsIHR3bykgJiYKKyAgICAgICAgICAgICAgIGVuZCA9PSBmaW5kV29yZEVuZCh0ZXh0LCB0d28pOworICAgIH0KKworICAgIC8vIFRPRE86IFVuaWZ5IHdpdGggVGV4dFZpZXcuZ2V0V29yZEZvckRpY3Rpb25hcnkoKQorICAgIHByaXZhdGUgc3RhdGljIGludCBmaW5kV29yZFN0YXJ0KENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQpIHsKKyAgICAgICAgZm9yICg7IHN0YXJ0ID4gMDsgc3RhcnQtLSkgeworICAgICAgICAgICAgY2hhciBjID0gdGV4dC5jaGFyQXQoc3RhcnQgLSAxKTsKKyAgICAgICAgICAgIGludCB0eXBlID0gQ2hhcmFjdGVyLmdldFR5cGUoYyk7CisKKyAgICAgICAgICAgIGlmIChjICE9ICdcJycgJiYKKyAgICAgICAgICAgICAgICB0eXBlICE9IENoYXJhY3Rlci5VUFBFUkNBU0VfTEVUVEVSICYmCisgICAgICAgICAgICAgICAgdHlwZSAhPSBDaGFyYWN0ZXIuTE9XRVJDQVNFX0xFVFRFUiAmJgorICAgICAgICAgICAgICAgIHR5cGUgIT0gQ2hhcmFjdGVyLlRJVExFQ0FTRV9MRVRURVIgJiYKKyAgICAgICAgICAgICAgICB0eXBlICE9IENoYXJhY3Rlci5NT0RJRklFUl9MRVRURVIgJiYKKyAgICAgICAgICAgICAgICB0eXBlICE9IENoYXJhY3Rlci5ERUNJTUFMX0RJR0lUX05VTUJFUikgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHN0YXJ0OworICAgIH0KKworICAgIC8vIFRPRE86IFVuaWZ5IHdpdGggVGV4dFZpZXcuZ2V0V29yZEZvckRpY3Rpb25hcnkoKQorICAgIHByaXZhdGUgc3RhdGljIGludCBmaW5kV29yZEVuZChDaGFyU2VxdWVuY2UgdGV4dCwgaW50IGVuZCkgeworICAgICAgICBpbnQgbGVuID0gdGV4dC5sZW5ndGgoKTsKKworICAgICAgICBmb3IgKDsgZW5kIDwgbGVuOyBlbmQrKykgeworICAgICAgICAgICAgY2hhciBjID0gdGV4dC5jaGFyQXQoZW5kKTsKKyAgICAgICAgICAgIGludCB0eXBlID0gQ2hhcmFjdGVyLmdldFR5cGUoYyk7CisKKyAgICAgICAgICAgIGlmIChjICE9ICdcJycgJiYKKyAgICAgICAgICAgICAgICB0eXBlICE9IENoYXJhY3Rlci5VUFBFUkNBU0VfTEVUVEVSICYmCisgICAgICAgICAgICAgICAgdHlwZSAhPSBDaGFyYWN0ZXIuTE9XRVJDQVNFX0xFVFRFUiAmJgorICAgICAgICAgICAgICAgIHR5cGUgIT0gQ2hhcmFjdGVyLlRJVExFQ0FTRV9MRVRURVIgJiYKKyAgICAgICAgICAgICAgICB0eXBlICE9IENoYXJhY3Rlci5NT0RJRklFUl9MRVRURVIgJiYKKyAgICAgICAgICAgICAgICB0eXBlICE9IENoYXJhY3Rlci5ERUNJTUFMX0RJR0lUX05VTUJFUikgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGVuZDsKKyAgICB9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FBhaW50OwogCiBwdWJsaWMgaW50ZXJmYWNlIExpbmVIZWlnaHRTcGFuCiBleHRlbmRzIFBhcmFncmFwaFN0eWxlLCBXcmFwVG9nZXRoZXJTcGFuCkBAIC0yNiw0ICsyNywxMCBAQAogICAgIHB1YmxpYyB2b2lkIGNob29zZUhlaWdodChDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3BhbnN0YXJ0diwgaW50IHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhaW50LkZvbnRNZXRyaWNzSW50IGZtKTsKKworICAgIHB1YmxpYyBpbnRlcmZhY2UgV2l0aERlbnNpdHkgZXh0ZW5kcyBMaW5lSGVpZ2h0U3BhbiB7CisgICAgICAgIHB1YmxpYyB2b2lkIGNob29zZUhlaWdodChDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5zdGFydHYsIGludCB2LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm0sIFRleHRQYWludCBwYWludCk7CisgICAgfQogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvdXRpbC9Db25maWcuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3V0aWwvQ29uZmlnLmphdmEKaW5kZXggOTU3MTA0MS4uOTI0YjQ5ZCAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvdXRpbC9Db25maWcuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC91dGlsL0NvbmZpZy5qYXZhCkBAIC0zNCwyNSArMzQsMjUgQEAKICAgICAgKi8KIAogICAgIC8qKgotICAgICAqIEFsd2F5cyB0aGUgaW52ZXJzZSBvZiBERUJVRy4KKyAgICAgKiBAZGVw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pbmUsIHVzZWQgdG8gaGVscCBkZXRlY3QgYW5kIHJlY292ZXIgZnJvbSBsb2cKLSAqICAgICAgICAgICAgICAgICAgICAgY29ycnVwdGlvbiBhbmQgZW5hYmxlIHN0YW5zYXJkIHVuaXggdG9vbHMgbGlrZSBncmVwLCB0YWlsIGFuZCB3YyB0byBvcGVyYXRlCisgKiAgICAgICAgICAgICAgICAgICAgIGNvcnJ1cHRpb24gYW5kIGVuYWJsZSBzdGFuZGFyZCB1bml4IHRvb2xzIGxpa2UgZ3JlcCwgdGFpbCBhbmQgd2MgdG8gb3BlcmF0ZQogICogICAgICAgICAgICAgICAgICAgICBvbiBldmVudCBsb2dzLiA8L2xpPgogICogPC91bD4KICAqCkBAIC0xMjQsMTAgKzEyNCw2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAiQSBMaXN0IG11c3QgaGF2ZSBmZXdlciB0aGFuICIKICAgICAgICAgICAgICAgICAgICAgICAgICsgQnl0ZS5NQVhfVkFMVUUgKyAiIGl0ZW1zIGluIGl0LiIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGl0ZW1zLmxlbmd0aCA8IDEpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgIkEgTGlzdCBtdXN0IGhhdmUgYXQgbGVhc3Qgb25lIGl0ZW0gaW4gaXQuIik7Ci0gICAgICAgICAgICB9CiAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1zLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgZmluYWwgT2JqZWN0IGl0ZW0gPSBpdGVtc1tpXTsKICAgICAgICAgICAgICAgICBpZiAoaXRlbSA9PSBudWxsKSB7CkBAIC0xOTIsMTcgKzE4OCwyMSBAQAogICAgICAgICAgICAgcmV0dXJuIGRlY29kZU9iamVjdCgpOwogICAgICAgICB9CiAKKyAgICAgICAgcHVibGljIGJ5dGVbXSBnZXRSYXdEYXRhKCkgeworICAgICAgICAgICAgcmV0dXJuIG1CdWZmZXIuYXJyYXkoKTsKKyAgICAgICAgfQorCiAgICAgICAgIC8qKiBAcmV0dXJuIHRoZSBsb2dnYWJsZSBpdGVtIGF0IHRoZSBjdXJyZW50IHBvc2l0aW9uIGluIG1CdWZmZXIuICovCiAgICAgICAgIHByaXZhdGUgT2JqZWN0IGRlY29kZU9iamVjdCgpIHsKICAgICAgICAgICAgIGlmIChtQnVmZmVyLnJlbWFpbmluZygpIDwgMSkgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICBzd2l0Y2ggKG1CdWZmZXIuZ2V0KCkpIHsKICAgICAgICAgICAgIGNhc2UgSU5UOgogICAgICAgICAgICAgICAgIGlmIChtQnVmZmVyLnJlbWFpbmluZygpIDwgNCkgcmV0dXJuIG51bGw7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1CdWZmZXIuZ2V0SW50KCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIChJbnRlZ2VyKSBtQnVmZmVyLmdldEludCgpOwogCiAgICAgICAgICAgICBjYXNlIExPTkc6CiAgICAgICAgICAgICAgICAgaWYgKG1CdWZmZXIucmVtYWluaW5nKCkgPCA4KSByZXR1cm4gbnVsbDsKLSAgICAgICAgICAgICAgICByZXR1cm4gbUJ1ZmZlci5nZXRMb25nKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIChMb25nKSBtQnVmZmVyLmdldExvbmcoKTsKIAogICAgICAgICAgICAgY2FzZSBTVFJJTkc6CiAgICAgICAgICAgICAgICAgdHJ5IHsKQEAgLTIxOSw3ICsyMTksNyBAQAogICAgICAgICAgICAgY2FzZSBMSVNUOgogICAgICAgICAgICAgICAgIGlmIChtQnVmZmVyLnJlbWFpbmluZygpIDwgMSkgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCA9IG1CdWZmZXIuZ2V0KCk7Ci0gICAgICAgICAgICAg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isgICAgICAgIHJldHVybiAoZmxvYXQpIE1hdGguZXhwKGEpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgcG93KGZsb2F0IGEsIGZsb2F0IGIpIHsKKyAgICAgICAgcmV0dXJuIChmbG9hdCkgTWF0aC5wb3coYSwgYik7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBtYXgoZmxvYXQgYSwgZmxvYXQgYikgeworICAgICAgICByZXR1cm4gYSA+IGIgPyBhIDogYjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZsb2F0IG1heChpbnQgYSwgaW50IGIpIHsKKyAgICAgICAgcmV0dXJuIGEgPiBiID8gYSA6IGI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBtYXgoZmxvYXQgYSwgZmxvYXQgYiwgZmxvYXQgYykgeworICAgICAgICByZXR1cm4gYSA+IGIgPyAoYSA+IGMgPyBhIDogYykgOiAoYiA+IGMgPyBiIDogYyk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBtYXgoaW50IGEsIGludCBiLCBpbnQgYykgeworICAgICAgICByZXR1cm4gYSA+IGIgPyAoYSA+IGMgPyBhIDogYykgOiAoYiA+IGMgPyBiIDogYyk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBtaW4oZmxvYXQgYSwgZmxvYXQgYikgeworICAgICAgICByZXR1cm4gYSA8IGIgPyBhIDogYjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZsb2F0IG1pbihpbnQgYSwgaW50IGIpIHsKKyAgICAgICAgcmV0dXJuIGEgPCBiID8gYSA6IGI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBtaW4oZmxvYXQgYSwgZmxvYXQgYiwgZmxvYXQgYykgeworICAgICAgICByZXR1cm4gYSA8IGIgPyAoYSA8IGMgPyBhIDogYykgOiAoYiA8IGMgPyBiIDogYyk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBtaW4oaW50IGEsIGludCBiLCBpbnQgYykgeworICAgICAgICByZXR1cm4gYSA8IGIgPyAoYSA8IGMgPyBhIDogYykgOiAoYiA8IGMgPyBiIDogYyk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBkaXN0KGZsb2F0IHgxLCBmbG9hdCB5MSwgZmxvYXQgeDIsIGZsb2F0IHkyKSB7CisgICAgICAgIGZpbmFsIGZsb2F0IHggPSAoeDIgLSB4MSk7CisgICAgICAgIGZpbmFsIGZsb2F0IHkgPSAoeTIgLSB5MSk7CisgICAgICAgIHJldHVybiAoZmxvYXQpIE1hdGguc3FydCh4ICogeCArIHkgKiB5KTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZsb2F0IGRpc3QoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwgZmxvYXQgeDIsIGZsb2F0IHkyLCBmbG9hdCB6MikgeworICAgICAgICBmaW5hbCBmbG9hdCB4ID0gKHgyIC0geDEpOworICAgICAgICBmaW5hbCBmbG9hdCB5ID0gKHkyIC0geTEpOworICAgICAgICBmaW5hbCBmbG9hdCB6ID0gKHoyIC0gejEpOworICAgICAgICByZXR1cm4gKGZsb2F0KSBNYXRoLnNxcnQoeCAqIHggKyB5ICogeSArIHogKiB6KTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZsb2F0IG1hZyhmbG9hdCBhLCBmbG9hdCBiKSB7CisgICAgICAgIHJldHVybiAoZmxvYXQpIE1hdGguc3FydChhICogYSArIGIgKiBiKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZsb2F0IG1hZyhmbG9hdCBhLCBmbG9hdCBiLCBmbG9hdCBjKSB7CisgICAgICAgIHJldHVybiAoZmxvYXQpIE1hdGguc3FydChhICogYSArIGIgKiBiICsgYyAqIGMpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQ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ICogYW1vdW50OworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgc3RhdGljIGZsb2F0IG5vcm0oZmxvYXQgc3RhcnQsIGZsb2F0IHN0b3AsIGZsb2F0IHZhbHVlKSB7CisgICAgICAgIHJldHVybiAodmFsdWUgLSBzdGFydCkgLyAoc3RvcCAtIHN0YXJ0KTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBtYXAoZmxvYXQgbWluU3RhcnQsIGZsb2F0IG1pblN0b3AsIGZsb2F0IG1heFN0YXJ0LCBmbG9hdCBtYXhTdG9wLCBmbG9hdCB2YWx1ZSkgeworICAgICAgICByZXR1cm4gbWF4U3RhcnQgKyAobWF4U3RhcnQgLSBtYXhTdG9wKSAqICgodmFsdWUgLSBtaW5TdGFydCkgLyAobWluU3RvcCAtIG1pblN0YXJ0KSk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBpbnQgcmFuZG9tKGludCBob3diaWcpIHsKKyAgICAgICAgcmV0dXJuIChpbnQpIChzUmFuZG9tLm5leHRGbG9hdCgpICogaG93YmlnKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGludCByYW5kb20oaW50IGhvd3NtYWxsLCBpbnQgaG93YmlnKSB7CisgICAgICAgIGlmIChob3dzbWFsbCA+PSBob3diaWcpIHJldHVybiBob3dzbWFsbDsKKyAgICAgICAgcmV0dXJuIChpbnQpIChzUmFuZG9tLm5leHRGbG9hdCgpICogKGhvd2JpZyAtIGhvd3NtYWxsKSArIGhvd3NtYWxsKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCByYW5kb20oZmxvYXQgaG93YmlnKSB7CisgICAgICAgIHJldHVybiBzUmFuZG9tLm5leHRGbG9hdCgpICogaG93YmlnOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgcmFuZG9tKGZsb2F0IGhvd3NtYWxsLCBmbG9hdCBob3diaWcpIHsKKyAgICAgICAgaWY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VibGljIHN0YXRpYyBmaW5hbCBpbnQgQUNUSU9OX1VQICAgICAgICAgICAgICAgPSAxOworICAgIAogICAgIC8qKgogICAgICAqIENvbnN0YW50IGZvciB7QGxpbmsgI2dldEFjdGlvbn06IEEgY2hhbmdlIGhhcyBoYXBwZW5lZCBkdXJpbmcgYQogICAgICAqIHByZXNzIGdlc3R1cmUgKGJldHdlZW4ge0BsaW5rICNBQ1RJT05fRE9XTn0gYW5kIHtAbGluayAjQUNUSU9OX1VQfSkuCkBAIC00NSwxMiArNTQsMTQgQEAKICAgICAgKiBwb2ludHMgc2luY2UgdGhlIGxhc3QgZG93biBvciBtb3ZlIGV2ZW50LgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFDVElPTl9NT1ZFICAgICAgICAgICAgID0gMjsKKyAgICAKICAgICAvKioKICAgICAgKiBDb25zdGFudCBmb3Ige0BsaW5rICNnZXRBY3Rpb259OiBUaGUgY3VycmVudCBnZXN0dXJlIGhhcyBiZWVuIGFib3J0ZWQuCiAgICAgICogWW91IHdpbGwgbm90IHJlY2VpdmUgYW55IG1vcmUgcG9pbnRzIGluIGl0LiAgWW91IHNob3VsZCB0cmVhdCB0aGlzIGFzCiAgICAgICogYW4gdXAgZXZlbnQsIGJ1dCBub3QgcGVyZm9ybSBhbnkgYWN0aW9uIHRoYXQgeW91IG5vcm1hbGx5IHdvdWxkLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFDVElPTl9DQU5DRUwgICAgICAgICAgID0gMzsKKyAgICAKICAgICAvKioKICAgICAgKiBDb25zdGFudCBmb3Ige0BsaW5rICNnZXRBY3Rpb259OiBBIG1vdmVtZW50IGhhcyBoYXBwZW5lZCBvdXRzaWRlIG9mIHRoZQogICAgICAqIG5vcm1hbCBib3VuZHMgb2YgdGhlIFVJIGVsZW1lbnQuICBUaGlzIGRvZXMgbm90IHByb3ZpZGUgYSBmdWxsIGdlc3R1cmUsCkBAIC01OCw2ICs2OSw3MCBAQAogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFDVElPTl9PVVRTSURFICAgICAgICAgID0gNDsKIAorICAgIC8qKgorICAgICAqIEEgbm9uLXByaW1hcnkgcG9pbnRlciBoYXMgZ29uZSBkb3duLiAgVGhlIGJpdHMgaW4KKyAgICAgKiB7QGxpbmsgI0FDVElPTl9QT0lOVEVSX0lEX01BU0t9IGluZGljYXRlIHdoaWNoIHBvaW50ZXIgY2hhbmdlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBBQ1RJT05fUE9JTlRFUl9ET1dOICAgICA9IDU7CisgICAgCisgICAgLyoqCisgICAgICogU3lub255bSBmb3Ige0BsaW5rICNBQ1RJT05fUE9JTlRFUl9ET1dOfSB3aXRoCisgICAgICoge0BsaW5rICNBQ1RJT05fUE9JTlRFUl9JRF9NQVNLfSBvZiAwOiB0aGUgcHJpbWFyeSBwb2ludGVyIGhhcyBnb25lIGRvbmUuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQUNUSU9OX1BPSU5URVJfMV9ET1dOICAgPSBBQ1RJT05fUE9JTlRFUl9ET1dOIHwgMHgwMDAwOworICAgIAorICAgIC8qKgorICAgICAqIFN5bm9ueW0gZm9yIHtAbGluayAjQUNUSU9OX1BPSU5URVJfRE9XTn0gd2l0aAorICAgICAqIHtAbGluayAjQUNUSU9OX1BPSU5URVJfSURfTUFTS30gb2YgMTogdGhlIHNlY29uZGFyeSBwb2ludGVyIGhhcyBnb25lIGRvbmUuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQUNUSU9OX1BPSU5URVJfMl9ET1dOICAgPSBBQ1RJT05fUE9JTlRFUl9ET1dOIHwgMHgwMTAwOworICAgIAorICAgIC8qKgorICAgICAqIFN5bm9ueW0gZm9yIHtAbGluayAjQUNUSU9OX1BPSU5URVJfRE9XTn0gd2l0aAor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oqCisgICAgICogQml0IHNoaWZ0IGZvciB0aGUgYWN0aW9uIGJpdHMgaG9sZGluZyB0aGUgcG9pbnRlciBpZGVudGlmaWVyIGFzCisgICAgICogZGVmaW5lZCBieSB7QGxpbmsgI0FDVElPTl9QT0lOVEVSX0lEX01BU0t9LgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFDVElPTl9QT0lOVEVSX0lEX1NISUZUID0gODsKKyAgICAKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIFRSQUNLX1JFQ1lDTEVEX0xPQ0FUSU9OID0gZmFsc2U7CiAKICAgICAvKioKQEAgLTgwLDM0ICsxNTUsODMgQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBFREdFX1JJR0hUID0gMHgwMDAwMDAwODsKIAorICAgIC8qKgorICAgICAqIE9mZnNldCBmb3IgdGhlIHNhbXBsZSdzIFggY29vcmRpbmF0ZS4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHN0YXRpYyBwdWJsaWMgZmluYWwgaW50IFNBTVBMRV9YID0gMDsKKyAgICAKKyAgICAvKioKKyAgICAgKiBPZmZzZXQgZm9yIHRoZSBzYW1wbGUncyBZIGNvb3JkaW5hdGUuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBzdGF0aWMgcHVibGljIGZpbmFsIGludCBTQU1QTEVfWSA9IDE7CisgICAgCisgICAgLyoqCisgICAgICogT2Zmc2V0IGZvciB0aGUgc2FtcGxlJ3MgWCBjb29yZGluYXRlLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgc3RhdGljIHB1YmxpYyBmaW5hbCBpbnQgU0FNUExFX1BSRVNTVVJFID0gMjsKKyAgICAKKyAgICAvKioKKyAgICAgKiBPZmZzZXQgZm9yIHRoZSBzYW1wbGUncyBYIGNvb3JkaW5hdGUuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBzdGF0aWMgcHVibGljIGZpbm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nRUaW1lTmFubywKKyAgICAgICAgICAgIGludCBhY3Rpb24sIGludCBwb2ludGVycywgaW50W10gaW5Qb2ludGVySWRzLCBmbG9hdFtdIGluRGF0YSwgaW50IG1ldGFTdGF0ZSwKKyAgICAgICAgICAgIGZsb2F0IHhQcmVjaXNpb24sIGZsb2F0IHlQcmVjaXNpb24sIGludCBkZXZpY2VJZCwgaW50IGVkZ2VGbGFncykgeworICAgICAgICBNb3Rpb25FdmVudCBldiA9IG9idGFpbigpOworICAgICAgICBldi5tRGV2aWNlSWQgPSBkZXZpY2VJZDsKKyAgICAgICAgZXYubUVkZ2VGbGFncyA9IGVkZ2VGbGFnczsKKyAgICAgICAgZXYubURvd25UaW1lID0gZG93blRpbWU7CisgICAgICAgIGV2Lm1FdmVudFRpbWVOYW5vID0gZXZlbnRUaW1lTmFubzsKKyAgICAgICAgZXYubUFjdGlvbiA9IGFjdGlvbjsKKyAgICAgICAgZXYubU1ldGFTdGF0ZSA9IG1ldGFTdGF0ZTsKKyAgICAgICAgZXYubVJhd1ggPSBpbkRhdGFbU0FNUExFX1hdOworICAgICAgICBldi5tUmF3WSA9IGluRGF0YVtTQU1QTEVfWV07CisgICAgICAgIGV2Lm1YUHJlY2lzaW9uID0geFByZWNpc2lvbjsKKyAgICAgICAgZXYubVlQcmVjaXNpb24gPSB5UHJlY2lzaW9uOworICAgICAgICBldi5tTnVtUG9pbnRlcnMgPSBwb2ludGVyczsKKyAgICAgICAgZXYubU51bVNhbXBsZXMgPSAxOworICAgICAgICAKKyAgICAgICAgaW50W10gcG9pbnRlcklkZW50aWZpZXJzID0gZXYubVBvaW50ZXJJZGVudGlmaWVyczsKKyAgICAgICAgaWYgKHBvaW50ZXJJZGVudGlmaWVycy5sZW5ndGggPCBwb2ludGVycykgeworICAgICAgICAgICAgZXYubVBvaW50ZXJJZGVudGlmaWVycyA9IHBvaW50ZXJJZGVudGlmaWVycyA9IG5ldyBpbnRbcG9pbnRlcnNdOworICAgICAgICB9CisgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaW5Qb2ludGVySWRzLCAwLCBwb2ludGVySWRlbnRpZmllcnMsIDAsIHBvaW50ZXJzKTsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIGludCBORCA9IHBvaW50ZXJzICogTlVNX1NBTVBMRV9EQVRBOworICAgICAgICBmbG9hdFtdIGRhdGFTYW1wbGVzID0gZXYubURhdGFTYW1wbGVzOworICAgICAgICBpZiAoZGF0YVNhbXBsZXMubGVuZ3RoIDwgTkQpIHsKKyAgICAgICAgICAgIGV2Lm1EYXRhU2FtcGxlcyA9IGRhdGFTYW1wbGVzID0gbmV3IGZsb2F0W05EXTsKKyAgICAgICAgfQorICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGluRGF0YSwgMCwgZGF0YVNhbXBsZXMsIDAsIE5EKTsKKyAgICAgICAgCisgICAgICAgIGV2Lm1UaW1lU2FtcGxlc1swXSA9IGV2ZW50VGltZTsKKworICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIHsKKyAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcigxMjgpOworICAgICAgICAgICAgc2IuYXBwZW5kKCJOZXc6Iik7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8cG9pbnRlcnM7IGkrKykgeworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiICMiKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoZXYubVBvaW50ZXJJZGVudGlmaWVyc1tpXSk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIoIik7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGV2Lm1EYXRhU2FtcGxlc1soaSpOVU1fU0FNUExFX0RBVEEpICsgU0FNUExFX1hdKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiwiKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoZXYubURhdGFTYW1wbGVzWyhpKk5VTV9TQU1Q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l6ZTsKICAgICAgICAgZXYubU1ldGFTdGF0ZSA9IG1ldGFTdGF0ZTsKICAgICAgICAgZXYubVhQcmVjaXNpb24gPSB4UHJlY2lzaW9uOwogICAgICAgICBldi5tWVByZWNpc2lvbiA9IHlQcmVjaXNpb247CiAKKyAgICAgICAgZXYubU51bVBvaW50ZXJzID0gMTsKKyAgICAgICAgZXYubU51bVNhbXBsZXMgPSAxOworICAgICAgICBpbnRbXSBwb2ludGVySWRzID0gZXYubVBvaW50ZXJJZGVudGlmaWVyczsKKyAgICAgICAgcG9pbnRlcklkc1swXSA9IDA7CisgICAgICAgIGZsb2F0W10gZGF0YSA9IGV2Lm1EYXRhU2FtcGxlczsKKyAgICAgICAgZGF0YVtTQU1QTEVfWF0gPSBldi5tUmF3WCA9IHg7CisgICAgICAgIGRhdGFbU0FNUExFX1ldID0gZXYubVJhd1kgPSB5OworICAgICAgICBkYXRhW1NBTVBMRV9QUkVTU1VSRV0gPSBwcmVzc3VyZTsKKyAgICAgICAgZGF0YVtTQU1QTEVfU0laRV0gPSBzaXplOworICAgICAgICBldi5tVGltZVNhbXBsZXNbMF0gPSBldmVudFRpbWU7CisKKyAgICAgICAgcmV0dXJuIGV2OworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZSBhIG5ldyBNb3Rpb25FdmVudCwgZmlsbGluZyBpbiBhbGwgb2YgdGhlIGJhc2ljIHZhbHVlcyB0aGF0CisgICAgICogZGVmaW5lIHRoZSBtb3Rpb24uCisgICAgICoKKyAgICAgKiBAcGFyYW0gZG93blRpbWUgVGhlIHRpbWUgKGluIG1zKSB3aGVuIHRoZSB1c2VyIG9yaWdpbmFsbHkgcHJlc3NlZCBkb3duIHRvIHN0YXJ0CisgICAgICogYSBzdHJlYW0gb2YgcG9zaXRpb24gZXZlbnRzLiAgVGhpcyBtdXN0IGJlIG9idGFpbmVkIGZyb20ge0BsaW5rIFN5c3RlbUNsb2NrI3VwdGltZU1pbGxpcygpfS4KKyAgICAgKiBAcG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tdIGRhdGEgPSBldi5tRGF0YVNhbXBsZXM7CisgICAgICAgIGRhdGFbU0FNUExFX1hdID0gZXYubVJhd1ggPSB4OworICAgICAgICBkYXRhW1NBTVBMRV9ZXSA9IGV2Lm1SYXdZID0geTsKKyAgICAgICAgZGF0YVtTQU1QTEVfUFJFU1NVUkVdID0gcHJlc3N1cmU7CisgICAgICAgIGRhdGFbU0FNUExFX1NJWkVdID0gc2l6ZTsKKyAgICAgICAgZXYubVRpbWVTYW1wbGVzWzBdID0gZXZlbnRUaW1lOworCiAgICAgICAgIHJldHVybiBldjsKICAgICB9CiAKQEAgLTE5OCwxNiArNDY5LDI0IEBACiAgICAgICAgIGV2Lm1EZXZpY2VJZCA9IDA7CiAgICAgICAgIGV2Lm1FZGdlRmxhZ3MgPSAwOwogICAgICAgICBldi5tRG93blRpbWUgPSBkb3duVGltZTsKLSAgICAgICAgZXYubUV2ZW50VGltZSA9IGV2ZW50VGltZTsKKyAgICAgICAgZXYubUV2ZW50VGltZU5hbm8gPSBldmVudFRpbWUgKiAxMDAwMDAwOwogICAgICAgICBldi5tQWN0aW9uID0gYWN0aW9uOwotICAgICAgICBldi5tWCA9IGV2Lm1SYXdYID0geDsKLSAgICAgICAgZXYubVkgPSBldi5tUmF3WSA9IHk7Ci0gICAgICAgIGV2Lm1QcmVzc3VyZSA9IDEuMGY7Ci0gICAgICAgIGV2Lm1TaXplID0gMS4wZjsKKyAgICAgICAgZXYubU51bVBvaW50ZXJzID0gMTsKICAgICAgICAgZXYubU1ldGFTdGF0ZSA9IG1ldGFTdGF0ZTsKICAgICAgICAgZXYubVhQcmVjaXNpb24gPSAxLjBmOwogICAgICAgICBldi5tWVByZWNpc2lvbiA9IDEuMGY7CiAKKyAgICAgICAgZXYubU51bVBvaW50ZXJzID0gMTsKKyAgICAgICAgZXYubU51bVNhbXBsZXMgPSAxOworICAgICAgICBpbnRbXSBwb2ludGVySWRzID0gZXYubVBvaW50ZXJJZGVudGlmaWVyczsKKyAgICAgICAgcG9pbnRlcklkc1swXSA9IDA7CisgICAgICAgIGZsb2F0W10gZGF0YSA9IGV2Lm1EYXRhU2FtcGxlczsKKyAgICAgICAgZGF0YVtTQU1QTEVfWF0gPSBldi5tUmF3WCA9IHg7CisgICAgICAgIGRhdGFbU0FNUExFX1ldID0gZXYubVJhd1kgPSB5OworICAgICAgICBkYXRhW1NBTVBMRV9QUkVTU1VSRV0gPSAxLjBmOworICAgICAgICBkYXRhW1NBTVBMRV9TSVpFXSA9IDEuMGY7CisgICAgICAgIGV2Lm1UaW1lU2FtcGxlc1swXSA9IGV2ZW50VGltZTsKKwogICAgICAgICByZXR1cm4gZXY7CiAgICAgfQogCkBAIC0yMTcsNDMgKzQ5NiwxNyBAQAogICAgICAqIEBoaWRlCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2NhbGUoZmxvYXQgc2NhbGUpIHsKLSAgICAgICAgbVggKj0gc2NhbGU7Ci0gICAgICAgIG1ZICo9IHNjYWxlOwogICAgICAgICBtUmF3WCAqPSBzY2FsZTsKICAgICAgICAgbVJhd1kgKj0gc2NhbGU7Ci0gICAgICAgIG1TaXplICo9IHNjYWxlOwogICAgICAgICBtWFByZWNpc2lvbiAqPSBzY2FsZTsKICAgICAgICAgbVlQcmVjaXNpb24gKj0gc2NhbGU7Ci0gICAgICAgIGlmIChtSGlzdG9yeSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmbG9hdFtdIGhpc3RvcnkgPSBtSGlzdG9yeTsKLSAgICAgICAgICAgIGludCBsZW5ndGggPSBoaXN0b3J5Lmxlbmd0aDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpICs9IDQpIHsKLSAgICAgICAgICAgICAgICBoaXN0b3J5W2ldICo9IHNjYWxlOyAgICAgICAgLy8gWAotICAgICAgICAgICAgICAgIGhpc3RvcnlbaSArIDFdICo9IHNjYWxlOyAgICAvLyBZCi0gICAgICAgICAgICAgICAgLy8gbm8gbmVlZCB0byBzY2FsZSBwcmVzc3VyZSAoW2krMl0pCi0gICAgICAgICAgICAgICAgaGlzdG9yeVtpICsgM10gKj0gc2NhbGU7ICAgIC8vIFNpemUsIFRPRE86IHNxdWFyZSB0aGlzPwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogVHJhbnNsYXRlIHRoZSBjb29yZGluYXRpb24gb2YgdGhlIGV2ZW50IGJ5IGdpdmVuIHggYW5kIHkuCi0gICAgICoKLSAgICAgKiBAaGlkZQotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHRyYW5zbGF0ZShmbG9hdCBkeCwgZmxvYXQgZHkpIHsKLSAgICAgICAgbVggKz0gZHg7Ci0gICAgICAgIG1ZICs9IGR5OwotICAgICAgICBtUmF3WCArPSBkeDsKLSAgICAgICAgbVJhd1kgKz0gZHg7Ci0gICAgICAgIGlmIChtSGlzdG9yeSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmbG9hdFtdIGhpc3RvcnkgPSBtSGlzdG9yeTsKLSAgICAgICAgICAgIGludCBsZW5ndGggPSBoaXN0b3J5Lmxlbmd0aDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpICs9IDQpIHsKLSAgICAgICAgICAgICAgICBoaXN0b3J5W2ldICs9IGR4OyAgICAgICAgLy8gWAotICAgICAgICAgICAgICAgIGhpc3RvcnlbaSArIDFdICs9IGR5OyAgICAvLyBZCi0gICAgICAgICAgICAgICAgLy8gbm8gbmVlZCB0byB0cmFuc2xhdGUgcHJlc3N1cmUgKGkrMikgYW5kIHNpemUgKGkrMykgCi0gICAgICAgICAgICB9CisgICAgICAgIGZsb2F0W10gaGlzdG9yeSA9IG1EYXRhU2FtcGxlczsKKyAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IG1OdW1Qb2ludGVycyAqIG1OdW1TYW1wbGVzICogTlVNX1NBTVBMRV9EQVRBOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSArPSBOVU1fU0FNUExFX0RBVEEpIHsKKyAgICAgICAgICAgIGhpc3RvcnlbaSArIFNBTVBMRV9YXSAqPSBzY2FsZTsKKyAgICAgICAgICAgIGhpc3RvcnlbaSArIFNBTVBMRV9ZXSAqPSBzY2FsZTsKKyAgICAgICAgICAgIC8vIG5vIG5lZWQgdG8gc2NhbGUgcHJlc3N1cmUKKyAgICAgICAgICAgIGhpc3RvcnlbaSArIFNBTVBMRV9TSVpFXSAqPSBzY2FsZTsgICAgLy8gVE9ETzogc3F1YXJlIHRoaXM/CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTI2NSwyNCArNTE4LDc0IEBACiAgICAgICAgIGV2Lm1EZXZpY2VJZCA9IG8ubURldmljZUlkOwogICAgICAgICBldi5tRWRnZUZsYWdzID0gby5tRWRnZUZsYWdzOwogICAgICAgICBldi5tRG93blRpbWUgPSBvLm1Eb3duVGltZTsKLSAgICAgICAgZXYubUV2ZW50VGltZSA9IG8ubUV2ZW50VGltZTsKKyAgICAgICAgZXYubUV2ZW50VGltZU5hbm8gPSBvLm1FdmVudFRpbWVOYW5vOwogICAgICAgICBldi5tQWN0aW9uID0gby5tQWN0aW9uOwotICAgICAgICBldi5tWCA9IG8ubVg7CisgICAgICAgIGV2Lm1OdW1Qb2ludGVycyA9IG8ubU51bVBvaW50ZXJzOwogICAgICAgICBldi5tUmF3WCA9IG8ubVJhd1g7Ci0gICAgICAgIGV2Lm1ZID0gby5tWTsKICAgICAgICAgZXYubVJhd1kgPSBvLm1SYXdZOwotICAgICAgICBldi5tUHJlc3N1cmUgPSBvLm1QcmVzc3VyZTsKLSAgICAgICAgZXYubVNpemUgPSBvLm1TaXplOwogICAgICAgICBldi5tTWV0YVN0YXRlID0gby5tTWV0YVN0YXRlOwogICAgICAgICBldi5tWFByZWNpc2lvbiA9IG8ubVhQcmVjaXNpb247CiAgICAgICAgIGV2Lm1ZUHJlY2lzaW9uID0gby5tWVByZWNpc2lvbjsKLSAgICAgICAgZmluYWwgaW50IE4gPSBvLm1OdW1IaXN0b3J5OwotICAgICAgICBldi5tTnVtSGlzdG9yeSA9IE47Ci0gICAgICAgIGlmIChOID4gMCkgewotICAgICAgICAgICAgLy8gY291bGQgYmUgbW9yZSBlZmZpY2llbnQgYWJvdXQgdGhpcy4uLgotICAgICAgICAgICAgZXYubUhpc3RvcnkgPSAoZmxvYXRbXSlvLm1IaXN0b3J5LmNsb25lKCk7Ci0gICAgICAgICAgICBldi5tSGlzdG9yeVRpbWVzID0gKGxvbmdbXSlvLm1IaXN0b3J5VGltZXMuY2xvbmUoKTsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIGludCBOUyA9IGV2Lm1OdW1TYW1wbGVzID0gby5tTnVtU2FtcGxlczsKKyAgICAgICAgaWYgKGV2Lm1UaW1lU2FtcGxlcy5sZW5ndGggPj0gTlMpIHsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoby5tVGltZVNhbXBsZXMsIDAsIGV2Lm1UaW1lU2FtcGxlcywgMCwgTlMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZXYubVRpbWVTYW1wbGVzID0gKGxvbmdbXSlvLm1UaW1lU2FtcGxlcy5jbG9uZSgpOwogICAgICAgICB9CisgICAgICAgIAorICAgICAgICBmaW5hbCBpbnQgTlAgPSAoZXYubU51bVBvaW50ZXJzPW8ubU51bVBvaW50ZXJzKTsKKyAgICAgICAgaWYgKGV2Lm1Qb2ludGVySWRlbnRpZmllcnMubGVuZ3RoID49IE5QKSB7CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG8ubVBvaW50ZXJJZGVudGlmaWVycywgMCwgZXYubVBvaW50ZXJJZGVudGlmaWVycywgMCwgTlApOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZXYubVBvaW50ZXJJZGVudGlmaWVycyA9IChpbnRbXSlvLm1Qb2ludGVySWRlbnRpZmllcnMuY2xvbmUoKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgZmluYWwgaW50IE5EID0gTlAgKiBOUyAqIE5VTV9TQU1QTEVfREFUQTsKKyAgICAgICAgaWYgKGV2Lm1EYXRhU2FtcGxlcy5sZW5ndGggPj0gTkQpIHsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoby5tRGF0YVNhbXBsZXMsIDAsIGV2Lm1EYXRhU2FtcGxlcywgMCwgTkQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZXYubURhdGFTYW1wbGVzID0gKGZsb2F0W10pby5tRGF0YVNhbXBsZXMuY2xvbmUoKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIGV2OworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZSBhIG5ldyBNb3Rpb25FdmVudCwgY29weWluZyBmcm9tIGFuIGV4aXN0aW5nIG9uZSwgYnV0IG5vdCBpbmNsdWRpbmcKKyAgICAgKiBhbnkgaGlzdG9yaWNhbCBwb2ludCBpbmZvcm1hdGlvbi4KKyAgICAgKi8KKyAgICBzdGF0aWMgcHVibGljIE1vdGlvbkV2ZW50IG9idGFpbk5vSGlzdG9yeShNb3Rpb25FdmVudCBvKSB7CisgICAgICAgIE1vdGlvbkV2ZW50IGV2ID0gb2J0YWluKCk7CisgICAgICAgIGV2Lm1EZXZpY2VJZCA9IG8ubURldmljZUlkOworICAgICAgICBldi5tRWRnZUZsYWdzID0gby5tRWRnZUZsYWdzOworICAgICAgICBldi5tRG93blRpbWUgPSBvLm1Eb3duVGltZTsKKyAgICAgICAgZXYubUV2ZW50VGltZU5hbm8gPSBvLm1FdmVudFRpbWVOYW5vOworICAgICAgICBldi5tQWN0aW9uID0gby5tQWN0aW9uOworICAgICAgICBldi5tTnVtUG9pbnRlcnMgPSBvLm1OdW1Qb2ludGVyczsKKyAgICAgICAgZXYubVJhd1ggPSBvLm1SYXdYOworICAgICAgICBldi5tUmF3WSA9IG8ubVJhd1k7CisgICAgICAgIGV2Lm1NZXRhU3RhdGUgPSBvLm1NZXRhU3RhdGU7CisgICAgICAgIGV2Lm1YUHJlY2lzaW9uID0gby5tWFByZWNpc2lvbjsKKyAgICAgICAgZXYubVlQcmVjaXNpb24gPSBvLm1ZUHJlY2lzaW9uOworICAgICAgICAKKyAgICAgICAgZXYubU51bVNhbXBsZXMgPSAxOworICAgICAgICBldi5tVGltZVNhbXBsZXNbMF0gPSBvLm1UaW1lU2FtcGxlc1swXTsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIGludCBOUCA9IChldi5tTnVtUG9pbnRlcnM9by5tTnVtUG9pbnRlcnMpOworICAgICAgICBpZiAoZXYubVBvaW50ZXJJZGVudGlmaWVycy5sZW5ndGggPj0gTlApIHsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoby5tUG9pbnRlcklkZW50aWZpZXJzLCAwLCBldi5tUG9pbnRlcklkZW50aWZpZXJzLCAwLCBOUCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBldi5tUG9pbnRlcklkZW50aWZpZXJzID0gKGludFtdKW8ubVBvaW50ZXJJZGVudGlmaWVycy5jbG9uZSgpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBmaW5hbCBpbnQgTkQgPSBOUCAqIE5VTV9TQU1QTEVfREFUQTsKKyAgICAgICAgaWYgKGV2Lm1EYXRhU2FtcGxlcy5sZW5ndGggPj0gTkQpIHsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoby5tRGF0YVNhbXBsZXMsIDAsIGV2Lm1EYXRhU2FtcGxlcywgMCwgTkQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZXYubURhdGFTYW1wbGVzID0gKGZsb2F0W10pby5tRGF0YVNhbXBsZXMuY2xvbmUoKTsKKyAgICAgICAgfQorICAgICAgICAKICAgICAgICAgcmV0dXJuIGV2OwogICAgIH0KIApAQCAtMzA1LDcgKzYwOCw3IEBACiAgICAgICAgIHN5bmNocm9uaXplZCAoZ1JlY3ljbGVyTG9jaykgewogICAgICAgICAgICAgaWYgKGdSZWN5Y2xlclVzZWQgPCBNQVhfUkVDWUNMRUQpIHsKICAgICAgICAgICAgICAgICBnUmVjeWNsZXJVc2VkKys7Ci0gICAgICAgICAgICAgICAgbU51bUhpc3RvcnkgPSAwOworICAgICAgICAgICAgICAgIG1OdW1TYW1wbGVzID0gMDsKICAgICAgICAgICAgICAgICBtTmV4dCA9IGdSZWN5Y2xlclRvcDsKICAgICAgICAgICAgICAgICBnUmVjeWNsZXJUb3AgPSB0aGlzOwogICAgICAgICAgICAgfQpAQCAtMzMzLDQ0ICs2MzYsMTQ1IEBACiAgICAgICogUmV0dXJucyB0aGUgdGltZSAoaW4gbXMpIHdoZW4gdGhpcyBzcGVjaWZpYyBldmVudCB3YXMgZ2VuZXJhdGVkLgogICAgICAqLwogICAgIHB1YmxpYyBmaW5hbCBsb25nIGdldEV2ZW50VGltZSgpIHsKLSAgICAgICAgcmV0dXJuIG1FdmVudFRpbWU7CisgICAgICAgIHJldHVybiBtVGltZVNhbXBsZXNbMF07CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogUmV0dXJucyB0aGUgWCBjb29yZGluYXRlIG9mIHRoaXMgZXZlbnQuICBXaG9sZSBudW1iZXJzIGFyZSBwaXhlbHM7IHRoZQotICAgICAqIHZhbHVlIG1heSBoYXZlIGEgZnJhY3Rpb24gZm9yIGlucHV0IGRldmljZXMgdGhhdCBhcmUgc3ViLXBpeGVsIHByZWNpc2UuCisgICAgICogUmV0dXJucyB0aGUgdGltZSAoaW4gbnMpIHdoZW4gdGhpcyBzcGVjaWZpYyBldmVudCB3YXMgZ2VuZXJhdGVkLgorICAgICAqIFRoZSB2YWx1ZSBpcyBpbiBuYW5vc2Vjb25kIHByZWNpc2lvbiBidXQgaXQgbWF5IG5vdCBoYXZlIG5hbm9zZWNvbmQgYWNjdXJhY3kuCisgICAgICoKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1Ym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0aGUgY3VycmVudCBnZXN0dXJlLgorICAgICAqIEBwYXJhbSBwb2ludGVySW5kZXggUmF3IGluZGV4IG9mIHBvaW50ZXIgdG8gcmV0cmlldmUuICBWYWx1ZSBtYXkgYmUgZnJvbSAwCisgICAgICogKHRoZSBmaXJzdCBwb2ludGVyIHRoYXQgaXMgZG93bikgdG8ge0BsaW5rICNnZXRQb2ludGVyQ291bnQoKX0tMS4KKyAgICAgKi8KKyAgICBwdWJsaWMgZmluYWwgaW50IGdldFBvaW50ZXJJZChpbnQgcG9pbnRlckluZGV4KSB7CisgICAgICAgIHJldHVybiBtUG9pbnRlcklkZW50aWZpZXJzW3BvaW50ZXJJbmRleF07CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIEdpdmVuIGEgcG9pbnRlciBpZGVudGlmaWVyLCBmaW5kIHRoZSBpbmRleCBvZiBpdHMgZGF0YSBpbiB0aGUgZXZlbnQuCisgICAgICogCisgICAgICogQHBhcmFtIHBvaW50ZXJJZCBUaGUgaWRlbnRpZmllciBvZiB0aGUgcG9pbnRlciB0byBiZSBmb3VuZC4KKyAgICAgKiBAcmV0dXJuIFJldHVybnMgZWl0aGVyIHRoZSBpbmRleCBvZiB0aGUgcG9pbnRlciAoZm9yIHVzZSB3aXRoCisgICAgICoge0BsaW5rICNnZXRYKGludCkgZXQgYWwuKSwgb3IgLTEgaWYgdGhlcmUgaXMgbm8gZGF0YSBhdmFpbGFibGUgZm9yCisgICAgICogdGhhdCBwb2ludGVyIGlkZW50aWZpZXIuCisgICAgICovCisgICAgcHVibGljIGZpbmFsIGludCBmaW5kUG9pbnRlckluZGV4KGludCBwb2ludGVySWQpIHsKKyAgICAgICAgaW50IGkgPSBtTnVtUG9pbnRlcnM7CisgICAgICAgIHdoaWxlIChpID4gMCkgeworICAgICAgICAgICAgaS0tOworICAgICAgICAgICAgaWYgKG1Qb2ludGVySWRlbnRpZmllcnNbaV0gPT0gcG9pbnRlcklkKSB7CisgICAgICAgICAgICAgICAgcmV0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XIgaWRlbnRpZmllcikuCisgICAgICovCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldEhpc3RvcmljYWxZKGludCBwb3MpIHsKKyAgICAgICAgcmV0dXJuIG1EYXRhU2FtcGxlc1soKHBvcyArIDEpICogTlVNX1NBTVBMRV9EQVRBICogbU51bVBvaW50ZXJzKSArIFNBTVBMRV9ZXTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiB7QGxpbmsgI2dldEhpc3RvcmljYWxQcmVzc3VyZShpbnQpfSBmb3IgdGhlIGZpcnN0IHBvaW50ZXIgaW5kZXggKG1heSBiZSBhbgorICAgICAqIGFyYml0cmFyeSBwb2ludGVyIGlkZW50aWZpZXIpLgorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCBmbG9hdCBnZXRIaXN0b3JpY2FsUHJlc3N1cmUoaW50IHBvcykgeworICAgICAgICByZXR1cm4gbURhdGFTYW1wbGVzWygocG9zICsgMSkgKiBOVU1fU0FNUExFX0RBVEEgKiBtTnVtUG9pbnRlcnMpICsgU0FNUExFX1BSRVNTVVJFXTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiB7QGxpbmsgI2dldEhpc3RvcmljYWxTaXplKGludCl9IGZvciB0aGUgZmlyc3QgcG9pbnRlciBpbmRleCAobWF5IGJlIGFuCisgICAgICogYXJiaXRyYXJ5IHBvaW50ZXIgaWRlbnRpZmllcikuCisgICAgICovCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldEhpc3RvcmljYWxTaXplKGludCBwb3MpIHsKKyAgICAgICAgcmV0dXJuIG1EYXRhU2FtcGxlc1soKHBvcyArIDEpICogTlVNX1NBTVBMRV9EQVRBICogbU51bVBvaW50ZXJzKSArIFNBTVBMRV9TSVpFXTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIGEgaGlzdG9yaWNhbCBYIGNvb3JkaW5hdGUsIGFzIHBlciB7QGxpbmsgI2dldFgoaW50KX0sIHRoYXQKKyAgICAgKiBv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AgICAgICogQHBhcmFtIHBvcyBXaGljaCBoaXN0b3JpY2FsIHZhbHVlIHRvIHJldHVybjsgbXVzdCBiZSBsZXNzIHRoYW4KICAgICAgKiB7QGxpbmsgI2dldEhpc3RvcnlTaXplfQotICAgICAqCisgICAgICogCiAgICAgICogQHNlZSAjZ2V0SGlzdG9yeVNpemUKICAgICAgKiBAc2VlICNnZXRTaXplCiAgICAgICovCi0gICAgcHVibGljIGZpbmFsIGZsb2F0IGdldEhpc3RvcmljYWxTaXplKGludCBwb3MpIHsKLSAgICAgICAgcmV0dXJuIG1IaXN0b3J5W3Bvcyo0ICsgM107CisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldEhpc3RvcmljYWxTaXplKGludCBwb2ludGVySW5kZXgsIGludCBwb3MpIHsKKyAgICAgICAgcmV0dXJuIG1EYXRhU2FtcGxlc1soKHBvcyArIDEpICogTlVNX1NBTVBMRV9EQVRBICogbU51bVBvaW50ZXJzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKHBvaW50ZXJJbmRleCAqIE5VTV9TQU1QTEVfREFUQSkgKyBTQU1QTEVfU0laRV07CiAgICAgfQogCiAgICAgLyoqCkBAIC01NTYsMTYgKzEwMDgsMTEgQEAKICAgICAgKiBAcGFyYW0gZGVsdGFZIEFtb3VudCB0byBhZGQgdG8gdGhlIGN1cnJlbnQgWSBjb29yZGluYXRlIG9mIHRoZSBldmVudC4KICAgICAgKi8KICAgICBwdWJsaWMgZmluYWwgdm9pZCBvZmZzZXRMb2NhdGlvbihmbG9hdCBkZWx0YVgsIGZsb2F0IGRlbHRhWSkgewotICAgICAgICBtWCArPSBkZWx0YVg7Ci0gICAgICAgIG1ZICs9IGRlbHRhWTsKLSAgICAgICAgZmluYWwgaW50IE4gPSBtTnVtSGlzdG9yeSo0OwotICAgICAgICBpZiAoTiA8PSAwKSB7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgZmluYWwgZmxvYXRbXSBwb3MgPSBtSGlzdG9yeTsKLSAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrPTQpIHsKLSAgICAgICAgICAgIHBvc1tpXSArPSBkZWx0YVg7Ci0gICAgICAgICAgICBwb3NbaSsxXSArPSBkZWx0YVk7CisgICAgICAgIGZpbmFsIGludCBOID0gbU51bVBvaW50ZXJzKm1OdW1TYW1wbGVzKjQ7CisgICAgICAgIGZpbmFsIGZsb2F0W10gcG9zID0gbURhdGFTYW1wbGVzOworICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSs9TlVNX1NBTVBMRV9EQVRBKSB7CisgICAgICAgICAgICBwb3NbaStTQU1QTEVfWF0gKz0gZGVsdGFYOworICAgICAgICAgICAgcG9zW2krU0FNUExFX1ldICs9IGRlbHRhWTsKICAgICAgICAgfQogICAgIH0KIApAQCAtNTc3LDggKzEwMjQsOCBAQAogICAgICAqIEBwYXJhbSB5IE5ldyBhYnNvbHV0ZSBZIGxvY2F0aW9uLgogICAgICAqLwogICAgIHB1YmxpYyBmaW5hbCB2b2lkIHNldExvY2F0aW9uKGZsb2F0IHgsIGZsb2F0IHkpIHsKLSAgICAgICAgZmxvYXQgZGVsdGFYID0geC1tWDsKLSAgICAgICAgZmxvYXQgZGVsdGFZID0geS1tWTsKKyAgICAgICAgZmxvYXQgZGVsdGFYID0geC1tRGF0YVNhbXBsZXNbU0FNUExFX1hdOworICAgICAgICBmbG9hdCBkZWx0YVkgPSB5LW1EYXRhU2FtcGxlc1tTQU1QTEVfWV07CiAgICAgICAgIGlmIChkZWx0YVggIT0gMCB8fCBkZWx0YVkgIT0gMCkgewogICAgICAgICAgICAgb2Zmc2V0TG9jYXRpb24oZGVsdGFYLCBkZWx0YVkpOwogICAgICAgICB9CkBAIC01OTAsNTggKzEwMzcsMTE5IEBACiAgICAgICogdGhlIGZ1dHVyZSwgdGhlIGN1cnJlbnQgdmFsdWVzIGluIHRoZSBldmVudCB3aWxsIGJlIGFkZGVkIHRvIGEgbGlzdCBvZg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ICBpZiAoTiA9PSBhdmFpbCkgewotICAgICAgICAgICAgICAgIGF2YWlsICs9IDg7Ci0gICAgICAgICAgICAgICAgZmxvYXRbXSBuZXdIaXN0b3J5ID0gbmV3IGZsb2F0W2F2YWlsKjRdOwotICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGlzdG9yeSwgMCwgbmV3SGlzdG9yeSwgMCwgTio0KTsKLSAgICAgICAgICAgICAgICBtSGlzdG9yeSA9IGhpc3RvcnkgPSBuZXdIaXN0b3J5OwotICAgICAgICAgICAgICAgIGxvbmdbXSBuZXdIaXN0b3J5VGltZXMgPSBuZXcgbG9uZ1thdmFpbF07Ci0gICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShoaXN0b3J5VGltZXMsIDAsIG5ld0hpc3RvcnlUaW1lcywgMCwgTik7Ci0gICAgICAgICAgICAgICAgbUhpc3RvcnlUaW1lcyA9IGhpc3RvcnlUaW1lcyA9IG5ld0hpc3RvcnlUaW1lczsKLSAgICAgICAgICAgIH0KKyAgICAgICAgZmxvYXRbXSBkYXRhID0gbURhdGFTYW1wbGVzOworICAgICAgICBsb25nW10gdGltZXMgPSBtVGltZVNhbXBsZXM7CisgICAgICAgIAorICAgICAgICBmaW5hbCBpbnQgTlAgPSBtTnVtUG9pbnRlcnM7CisgICAgICAgIGZpbmFsIGludCBOUyA9IG1OdW1TYW1wbGVzOworICAgICAgICBmaW5hbCBpbnQgTkkgPSBOUCpOUzsKKyAgICAgICAgZmluYWwgaW50IE5EID0gTkkgKiBOVU1fU0FNUExFX0RBVEE7CisgICAgICAgIGlmIChkYXRhLmxlbmd0aCA8PSBORCkgeworICAgICAgICAgICAgZmluYWwgaW50IE5FV19ORCA9IE5EICsgKE5QICogKEJBU0VfQVZBSUxfU0FNUExFUyAqIE5VTV9TQU1QTEVfREFUQSkpOworICAgICAgICAgICAgZmxvYXRbXSBuZXdEYXRhID0gbmV3IGZsb2F0W05FV19ORF07CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGRhdGEsIDAsIG5ld0RhdGEsIDAsIE5EKTsKKyAgICAgICAgICAgIG1EYXRhU2FtcGxlcyA9IGRhdGEgPSBuZXdEYXRhOwogICAgICAgICB9CisgICAgICAgIGlmICh0aW1lcy5sZW5ndGggPD0gTlMpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBORVdfTlMgPSBOUyArIEJBU0VfQVZBSUxfU0FNUExFUzsKKyAgICAgICAgICAgIGxvbmdbXSBuZXdIaXN0b3J5VGltZXMgPSBuZXcgbG9uZ1tORVdfTlNdOworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weSh0aW1lcywgMCwgbmV3SGlzdG9yeVRpbWVzLCAwLCBOUyk7CisgICAgICAgICAgICBtVGltZVNhbXBsZXMgPSB0aW1lcyA9IG5ld0hpc3RvcnlUaW1lczsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdGltZXNbTlNdID0gdGltZXNbMF07CisgICAgICAgIHRpbWVzWzBdID0gZXZlbnRUaW1lOworICAgICAgICAKKyAgICAgICAgZmluYWwgaW50IHBvcyA9IE5TKk5VTV9TQU1QTEVfREFUQTsKKyAgICAgICAgZGF0YVtwb3MrU0FNUExFX1hdID0gZGF0YVtTQU1QTEVfWF07CisgICAgICAgIGRhdGFbcG9zK1NBTVBMRV9ZXSA9IGRhdGFbU0FNUExFX1ldOworICAgICAgICBkYXRhW3BvcytTQU1QTEVfUFJFU1NVUkVdID0gZGF0YVtTQU1QTEVfUFJFU1NVUkVdOworICAgICAgICBkYXRhW3BvcytTQU1QTEVfU0laRV0gPSBkYXRhW1NBTVBMRV9TSVpFXTsKKyAgICAgICAgZGF0YVtTQU1QTEVfWF0gPSB4OworICAgICAgICBkYXRhW1NBTVBMRV9ZXSA9IHk7CisgICAgICAgIGRhdGFbU0FNUExFX1BSRVNTVVJFXSA9IHByZXNzdXJlOworICAgICAgICBkYXRhW1NBTVBMRV9TSVpFXSA9IHNpemU7CisgICAgICAgIG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lzdG9yeVRpbWVzOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICB0aW1lc1tOU10gPSB0aW1lc1swXTsKKyAgICAgICAgdGltZXNbMF0gPSBldmVudFRpbWU7CisgICAgICAgIAorICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGRhdGEsIDAsIGRhdGEsIE5ELCBtTnVtUG9pbnRlcnMqTlVNX1NBTVBMRV9EQVRBKTsKKyAgICAgICAgU3lzdGVtLmFycmF5Y29weShpbkRhdGEsIDAsIGRhdGEsIDAsIG1OdW1Qb2ludGVycypOVU1fU0FNUExFX0RBVEEpOworICAgICAgICAKKyAgICAgICAgbU51bVNhbXBsZXMgPSBOUysxOworCisgICAgICAgIG1SYXdYID0gaW5EYXRhW1NBTVBMRV9YXTsKKyAgICAgICAgbVJhd1kgPSBpbkRhdGFbU0FNUExFX1ldOworICAgICAgICBtTWV0YVN0YXRlIHw9IG1ldGFTdGF0ZTsKKyAgICAgICAgCisgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgeworICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKDEyOCk7CisgICAgICAgICAgICBzYi5hcHBlbmQoIkFkZDoiKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtTnVtUG9pbnRlcnM7IGkrKykgeworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiICMiKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQobVBvaW50ZXJJZGVudGlmaWVyc1tpXSk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCIoIik7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKG1EYXRhU2FtcGxlc1soaSpOVU1fU0FNUExFX0RBVEEpICsgU0FNUExFX1hdKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiwiKTsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQobURhdGFTYW1wbGVzWyhpKk5VTV9TQU1QTEVfREFUQSkgKyBTQU1QTEVfWV0pOworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiKSIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9nLnYoIk1vdGlvbkV2ZW50Iiwgc2IudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewogICAgICAgICByZXR1cm4gIk1vdGlvbkV2ZW50eyIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKFN5c3RlbS5pZGVudGl0eUhhc2hDb2RlKHRoaXMpKQotICAgICAgICAgICAgKyAiIGFjdGlvbj0iICsgbUFjdGlvbiArICIgeD0iICsgbVgKLSAgICAgICAgICAgICsgIiB5PSIgKyBtWSArICIgcHJlc3N1cmU9IiArIG1QcmVzc3VyZSArICIgc2l6ZT0iICsgbVNpemUgKyAifSI7CisgICAgICAgICAgICArICIgYWN0aW9uPSIgKyBtQWN0aW9uICsgIiB4PSIgKyBnZXRYKCkKKyAgICAgICAgICAgICsgIiB5PSIgKyBnZXRZKCkgKyAiIHByZXNzdXJlPSIgKyBnZXRQcmVzc3VyZSgpICsgIiBzaXplPSIgKyBnZXRTaXplKCkgKyAifSI7CiAgICAgfQogCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBQYXJjZWxhYmxlLkNyZWF0b3I8TW90aW9uRXZlbnQ+IENSRUFUT1IKQEAgLTY2MywyNiArMTE3MSwyOSBAQAogCiAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgb3V0LCBpbnQgZmxhZ3MpIHsKICAgICAgICAgb3V0LndyaXRlTG9uZyhtRG93blRpbWUpOwotICAgICAgICBvdXQud3JpdGVMb25nKG1FdmVudFRpbWUpOworICAgICAgICBvdXQud3JpdGVMb25nKG1FdmVudFRpbWVOYW5vKTsKICAgICAgICAgb3V0LndyaXRlSW50KG1BY3Rpb24pOwotICAgICAgICBvdXQud3JpdGVGbG9hdChtWCk7Ci0gICAgICAgIG91dC53cml0ZUZsb2F0KG1ZKTsKLSAgICAgICAgb3V0LndyaXRlRmxvYXQobVByZXNzdXJlKTsKLSAgICAgICAgb3V0LndyaXRlRmxvYXQobVNpemUpOwogICAgICAgICBvdXQud3JpdGVJbnQobU1ldGFTdGF0ZSk7CiAgICAgICAgIG91dC53cml0ZUZsb2F0KG1SYXdYKTsKICAgICAgICAgb3V0LndyaXRlRmxvYXQobVJhd1kpOwotICAgICAgICBmaW5hbCBpbnQgTiA9IG1OdW1IaXN0b3J5OwotICAgICAgICBvdXQud3JpdGVJbnQoTik7Ci0gICAgICAgIGlmIChOID4gMCkgewotICAgICAgICAgICAgZmluYWwgaW50IE40ID0gTio0OworICAgICAgICBmaW5hbCBpbnQgTlAgPSBtTnVtUG9pbnRlcnM7CisgICAgICAgIG91dC53cml0ZUludChOUCk7CisgICAgICAgIGZpbmFsIGludCBOUyA9IG1OdW1TYW1wbGVzOworICAgICAgICBvdXQud3JpdGVJbnQoTlMpOworICAgICAgICBmaW5hbCBpbnQgTkkgPSBOUCpOUzsKKyAgICAgICAgaWYgKE5JID4gMCkgewogICAgICAgICAgICAgaW50IGk7Ci0gICAgICAgICAgICBmbG9hdFtdIGhpc3RvcnkgPSBtSGlzdG9yeTsKLSAgICAgICAgICAgIGZvciAoaT0wOyBpPE40OyBpKyspIHsKKyAgICAgICAgICAgIGludFtdIHN0YXRlID0gbVBvaW50ZXJJZGVudGlmaWVyczsKKyAgICAgICAgICAgIGZvciAoaT0wOyBpPE5QOyBpKyspIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGVJbnQoc3RhdGVbaV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgaW50IE5EID0gTkkqTlVNX1NBTVBMRV9EQVRBOworICAgICAgICAgICAgZmxvYXRbXSBoaXN0b3J5ID0gbURhdGFTYW1wbGVzOworICAgICAgICAgICAgZm9yIChpPTA7IGk8TkQ7IGkrKykgewogICAgICAgICAgICAgICAgIG91dC53cml0ZUZsb2F0KGhpc3RvcnlbaV0pOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgbG9uZ1tdIHRpbWVzID0gbUhpc3RvcnlUaW1lczsKLSAgICAgICAgICAgIGZvciAoaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgbG9uZ1tdIHRpbWVzID0gbVRpbWVTYW1wbGVzOworICAgICAgICAgICAgZm9yIChpPTA7IGk8TlM7IGkrKykgewogICAgICAgICAgICAgICAgIG91dC53cml0ZUxvbmcodGltZXNbaV0pOwogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC02OTQsMzAgKzEyMDUsMzcgQEAKIAogICAgIHByaXZhdGUgdm9pZCByZWFkRnJvbVBhcmNlbChQYXJjZWwgaW4pIHsKICAgICAgICAgbURvd25UaW1lID0gaW4ucmVhZExvbmcoKTsKLSAgICAgICAgbUV2ZW50VGltZSA9IGluLnJlYWRMb25nKCk7CisgICAgICAgIG1FdmVudFRpbWVOYW5vID0gaW4ucmVhZExvbmcoKTsKICAgICAgICAgbUFjdGlvbiA9IGluLnJlYWRJbnQoKTsKLSAgICAgICAgbVggPSBpbi5yZWFkRmxvYXQoKTsKLSAgICAgICAgbVkgPSBpbi5yZWFkRmxvYXQoKTsKLSAgICAgICAgbVByZXNzdXJlID0gaW4ucmVhZEZsb2F0KCk7Ci0gICAgICAgIG1TaXplID0gaW4ucmVhZEZsb2F0KCk7CiAgICAgICAgIG1NZXRhU3RhdGUgPSBpbi5yZWFkSW50KCk7CiAgICAgICAgIG1SYXdYID0gaW4ucmVhZEZsb2F0KCk7CiAgICAgICAgIG1SYXdZID0gaW4ucmVhZEZsb2F0KCk7Ci0gICAgICAgIGZpbmFsIGludCBOID0gaW4ucmVhZEludCgpOwotICAgICAgICBpZiAoKG1OdW1IaXN0b3J5PU4pID4gMCkgewotICAgICAgICAgICAgZmluYWwgaW50IE40ID0gTio0OwotICAgICAgICAgICAgZmxvYXRbXSBoaXN0b3J5ID0gbUhpc3Rvcnk7Ci0gICAgICAgICAgICBpZiAoaGlzdG9yeSA9PSBudWxsIHx8IGhpc3RvcnkubGVuZ3RoIDwgTjQpIHsKLSAgICAgICAgICAgICAgICBtSGlzdG9yeSA9IGhpc3RvcnkgPSBuZXcgZmxvYXRbTjQgKyAoNCo0KV07CisgICAgICAgIGZpbmFsIGludCBOUCA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgbU51bVBvaW50ZXJzID0gTlA7CisgICAgICAgIGZpbmFsIGludCBOUyA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgbU51bVNhbXBsZXMgPSBOUzsKKyAgICAgICAgZmluYWwgaW50IE5JID0gTlAqTlM7CisgICAgICAgIGlmIChOSSA+IDApIHsKKyAgICAgICAgICAgIGludFtdIGlkcyA9IG1Qb2ludGVySWRlbnRpZmllcnM7CisgICAgICAgICAgICBpZiAoaWRzLmxlbmd0aCA8IE5QKSB7CisgICAgICAgICAgICAgICAgbVBvaW50ZXJJZGVudGlmaWVycyA9IGlkcyA9IG5ldyBpbnRbTlBdOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE40OyBpKyspIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOUDsgaSsrKSB7CisgICAgICAgICAgICAgICAgaWRzW2ldID0gaW4ucmVhZEludCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmxvYXRbXSBoaXN0b3J5ID0gbURhdGFTYW1wbGVzOworICAgICAgICAgICAgZmluYWwgaW50IE5EID0gTkkqTlVNX1NBTVBMRV9EQVRBOworICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoIDwgTkQpIHsKKyAgICAgICAgICAgICAgICBtRGF0YVNhbXBsZXMgPSBoaXN0b3J5ID0gbmV3IGZsb2F0W05EXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxORDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgaGlzdG9yeVtpXSA9IGluLnJlYWRGbG9hdCgpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgbG9uZ1tdIHRpbWVzID0gbUhpc3RvcnlUaW1lczsKLSAgICAgICAgICAgIGlmICh0aW1lcyA9PSBudWxsIHx8IHRpbWVzLmxlbmd0aCA8IE4pIHsKLSAgICAgICAgICAgICAgICBtSGlzdG9yeVRpbWVzID0gdGltZXMgPSBuZXcgbG9uZ1tOICsgNF07CisgICAgICAgICAgICBsb25nW10gdGltZXMgPSBtVGltZVNhbXBsZXM7CisgICAgICAgICAgICBpZiAodGltZXMgPT0gbnVsbCB8fCB0aW1lcy5sZW5ndGggPCBOUykgeworICAgICAgICAgICAgICAgIG1UaW1lU2FtcGxlcyA9IHRpbWVzID0gbmV3IGxvbmdbTlNdOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE5TOyBpKyspIHsKICAgICAgICAgICAgICAgICB0aW1lc1tpXSA9IGluLnJlYWRMb25nKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3ZpZXcvUmF3SW5wdXRFdmVudC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9SYXdJbnB1dEV2ZW50LmphdmEKaW5kZXggMzBkYTgzZS4uOGIzY2RkNCAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9SYXdJbnB1dEV2ZW50LmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9SYXdJbnB1dEV2ZW50LmphdmEKQEAgLTEzLDYgKzEzLDggQEAKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBDTEFTU19BTFBIQUtFWSA9IDB4MDAwMDAwMDI7CiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQ0xBU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ggQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoUG9pbnRlcihNb3Rpb25FdmVudCBldmVudCwgbG9uZyBldmVudFRpbWUpIHsKKyAgICAgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hQb2ludGVyKE1vdGlvbkV2ZW50IGV2ZW50LCBsb25nIGV2ZW50VGltZSwKKyAgICAgICAgICAgICAgICBib29sZWFuIGNhbGxXaGVuRG9uZSkgewogICAgICAgICAgICAgTG9nLncoIlN1cmZhY2VWaWV3IiwgIlVuZXhwZWN0ZWQgcG9pbnRlciBldmVudCBpbiBzdXJmYWNlOiAiICsgZXZlbnQpOwogICAgICAgICAgICAgLy9pZiAobVNlc3Npb24gIT0gbnVsbCAmJiBtU3VyZmFjZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAvLyAgICB0cnkgewpAQCAtNDg2LDcgKzQ5Miw4IEBACiAgICAgICAgICAgICAvL30KICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoVHJhY2tiYWxsKE1vdGlvbkV2ZW50IGV2ZW50LCBsb25nIGV2ZW50VGltZSkgeworICAgICAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaFRyYWNrYmFsbChNb3Rpb25FdmVudCBldmVudCwgbG9uZyBldmVudFRpbWUsCisgICAgICAgICAgICAgICAgYm9vbGVhbiBjYWxsV2hlbkRvbmUpIHsKICAgICAgICAgICAgIExvZy53KCJTdXJmYWNlVmlldyIsICJVbmV4cGVjdGVkIHRyYWNrYmFsbCBldmVudCBpbiBzdXJmYWNlOiAiICsgZXZlbnQpOwogICAgICAgICAgICAgLy9pZiAobVNlc3Npb24gIT0gbnVsbCAmJiBtU3VyZmFjZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAvLyAgICB0cnkgewpAQCAtNTY4LDkgKzU3NSwxNCBAQAogCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldFR5cGUoaW50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ogaW1wb3J0IGFuZHJvaWQudXRpbC5FdmVudExvZzsKIGltcG9ydCBhbmRyb2lkLnV0aWwuTG9nOwogaW1wb3J0IGFuZHJvaWQudXRpbC5Qb29sOwpAQCAtMjk4Myw2ICsyOTgyLDggQEAKICAgICAgKiBAcGFyYW0gZW5hYmxlZCBUcnVlIGlmIHRoaXMgdmlldyBpcyBlbmFibGVkLCBmYWxzZSBvdGhlcndpc2UuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0RW5hYmxlZChib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgaWYgKGVuYWJsZWQgPT0gaXNFbmFibGVkKCkpIHJldHVybjsKKwogICAgICAgICBzZXRGbGFncyhlbmFibGVkID8gRU5BQkxFRCA6IERJU0FCTEVELCBFTkFCTEVEX01BU0spOwogCiAgICAgICAgIC8qCkBAIC01MzQyLDEyICs1MzQzLDM2IEBACiAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBjYWNoZS5zY3JvbGxCYXJTaXplOwogICAgICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgICAgIGZpbmFsIGludCBzY3JvbGxYID0gbVNjcm9sbFg7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IHNjcm9sbFkgPSBtU2Nyb2xsWTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaW5zaWRlID0gKHZpZXdGbGFncyAmIFNDUk9MTEJBUlNfT1VUU0lERV9NQVNLKSA9PSAwID8gfjAgOiAwOworCiAgICAgICAgICAgICAgICAgaWYgKGRyYXdIb3Jpem9udGFsU2Nyb2xsQmFyKSB7Ci0gICAgICAgICAgICAgICAgICAgIG9uRHJhd0hvcml6b250YWxTY3JvbGxCYXIoY2FudmFzLCBzY3JvbGxCYXIsIHdpZHRoLCBoZWlnaHQsIHNpemUpOworICAgICAgICAgICAgICAgICAgICBzY3JvbGxCYXIuc2V0UGFyYW1ldGVycygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcHV0ZUhvcml6b250YWxTY3JvbGxSYW5nZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlSG9yaXpvbnRhbFNjcm9sbE9mZnNldCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlSG9yaXpvbnRhbFNjcm9sbEV4dGVudCgpLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCB0b3AgPSBzY3JvbGxZICsgaGVpZ2h0IC0gc2l6ZSAtIChtVXNlclBhZGRpbmdCb3R0b20gJiBpbnNpZGUpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdmVydGljYWxTY3JvbGxCYXJHYXAgPSBkcmF3VmVydGljYWxTY3JvbGxCYXIgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0VmVydGljYWxTY3JvbGxiYXJXaWR0aCgpIDogMDsKKyAgICAgICAgICAgICAgICAgICAgb25EcmF3SG9yaXpvbnRhbFNjcm9sbEJhcihjYW52YXMsIHNjcm9sbEJhciwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjcm9sbFggKyAobVBhZGRpbmdMZWZ0ICYgaW5zaWRlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjcm9sbFggKyB3aWR0aCAtIChtVXNlclBhZGRpbmdSaWdodCAmIGluc2lkZSkgLSB2ZXJ0aWNhbFNjcm9sbEJhckdhcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvcCArIHNpemUpOwogICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIGlmIChkcmF3VmVydGljYWxTY3JvbGxCYXIpIHsKLSAgICAgICAgICAgICAgICAgICAgb25EcmF3VmVydGljYWxTY3JvbGxCYXIoY2FudmFzLCBzY3JvbGxCYXIsIHdpZHRoLCBoZWlnaHQsIHNpemUpOworICAgICAgICAgICAgICAgICAgICBzY3JvbGxCYXIuc2V0UGFyYW1ldGVycyhjb21wdXRlVmVydGljYWxTY3JvbGxSYW5nZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlVmVydGljYWxTY3JvbGxPZmZzZXQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcHV0ZVZlcnRpY2FsU2Nyb2xsRXh0ZW50KCksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBEZWFsIHdpdGggUlRMIGxhbmd1YWdlcyB0byBwb3NpdGlvbiBzY3JvbGxiYXIgb24gbGVmdAorICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbGVmdCA9IHNjcm9sbFggKyB3aWR0aCAtIHNpemUgLSAobVVzZXJQYWRkaW5nUmlnaHQgJiBpbnNpZGUpOworICAgICAgICAgICAgICAgICAgICBvbkRyYXdWZXJ0aWNhbFNjcm9sbEJhcihjYW52YXMsIHNjcm9sbEJhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Nyb2xsWSArIChtUGFkZGluZ1RvcCAmIGluc2lkZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgKyBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JvbGxZICsgaGVpZ2h0IC0gKG1Vc2VyUGFkZGluZ0JvdHRvbSAmIGluc2lkZSkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtNTM2Nyw0NCArNTM5MiwyMCBAQAogICAgICAqIDxwPkRyYXcgdGhlIGhvcml6b250YWwgc2Nyb2xsYmFyIGlmCiAgICAgICoge0BsaW5rICNpc0hvcml6b250YWxTY3JvbGxCYXJFbmFibGVkKCl9IHJldHVybnMgdHJ1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2Nyb2xsQmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsLCBpbnQgdCwgaW50IHIsIGludCBiKSB7CisgICAgICAgIHNjcm9sbEJhci5zZXRCb3VuZHMobCwgdCwgciwgYik7CiAgICAgICAgIHNjcm9sbEJhci5kcmF3KGNhbnZhcyk7CiAgICAgfQogCkBAIC02OTExLDcgKzY4OTIsNyBAQAogCiAgICAgLyoqCiAgICAgICogU2V0IHRoZSBiYWNrZ3JvdW5kIHRvIGEgZ2l2ZW4gcmVzb3VyY2UuIFRoZSByZXNvdXJjZSBzaG91bGQgcmVmZXIgdG8KLSAgICAgKiBhIERyYXdhYmxlIG9iamVjdC4KKyAgICAgKiBhIERyYXdhYmxlIG9iamVjdCBvciAwIHRvIHJlbW92ZSB0aGUgYmFja2dyb3VuZC4KICAgICAgKiBAcGFyYW0gcmVzaWQgVGhlIGlkZW50aWZpZXIgb2YgdGhlIHJlc291cmNlLgogICAgICAqIEBhdHRyIHJlZiBhbmRyb2lkLlIuc3R5bGVhYmxlI1ZpZXdfYmFja2dyb3VuZAogICAgICAqLwpAQCAtODc0MCw3ICs4NzIxLDggQEAKICAgICAgICAgICAgICAgICBtTGFzdENvbG9yID0gY29sb3I7CiAgICAgICAgICAgICAgICAgY29sb3IgfD0gMHhGRjAwMDAwMDsKIAotICAgICAgICAgICAgICAgIHNoYWRlciA9IG5ldyBMaW5lYXJHcmFkaWVudCgwLCAwLCAwLCAxLCBjb2xvciwgMCwgU2hhZGVyLlRpbGVNb2RlLkNMQU1QKTsKKyAgICAgICAgICAgICAgICBzaGFkZXIgPSBuZXcgTGluZWFyR3JhZGllbnQoMCwgMCwgMCwgMSwgY29sb3IgfCAweEZGMDAwMDAwLAorICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgJiAweDAwRkZGRkZGLCBTaGFkZXIuVGlsZU1vZGUuQ0xBTVApOwogCiAgICAgICAgICAgICAgICAgcGFpbnQuc2V0U2hhZGVyK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aG9kTWFuYWdlciBpbW0gPSBJbnB1dE1ldGhvZE1hbmFnZXIuZ2V0SW5zdGFuY2UobWFpbkxvb3Blcik7CiAgICAgICAgICAgICAgICAgICAgIHNXaW5kb3dTZXNzaW9uID0gSVdpbmRvd01hbmFnZXIuU3R1Yi5hc0ludGVyZmFjZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKCJ3aW5kb3ciKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3BlblNlc3Npb24oaW1tLmdldENsaWVudCgpLCBpbW0uZ2V0SW5wdXRDb250ZXh0KCkpOwpAQCAtMjA3LDggKzIwNCwyNCBAQAogICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHNXaW5kb3dTZXNzaW9uOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBWaWV3Um9vdChDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgc3VwZXIoKTsKKworICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZICYmIGx0ID09IG51bGwpIHsKKyAgICAgICAgICAgIGx0ID0gbmV3IExhdGVuY3lUaW1lcigxMDAsIDEwMDApOwogICAgICAgICB9CiAKKyAgICAgICAgKytzSW5zdGFuY2VDb3VudDsKKworICAgICAgICAvLyBJbml0aWFsaXplIHRoZSBzdGF0aWNzIHdoZW4gdGhpcyBjbGFzcyBpcyBmaXJzdCBpbnN0YW50aWF0ZWQuIFRoaXMgaXMKKyAgICAgICAgLy8gZG9uZSBoZXJlIGluc3RlYWQgb2YgaW4gdGhlIHN0YXRpYyBibG9jayBiZWNhdXNlIFp5Z290ZSBkb2VzIG5vdAorICAgICAgICAvLyBhbGxvdyB0aGUgc3Bhd25pbmcgb2YgdGhyZWFkcy4KKyAgICAgICAgZ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TYyOCwxNiArMTY0NSwyNCBAQAogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIGNhc2UgRElTUEFUQ0hfUE9JTlRFUjogewogICAgICAgICAgICAgTW90aW9uRXZlbnQgZXZlbnQgPSAoTW90aW9uRXZlbnQpbXNnLm9iajsKLQotICAgICAgICAgICAgYm9vbGVhbiBkaWRGaW5pc2g7CisgICAgICAgICAgICBib29sZWFuIGNhbGxXaGVuRG9uZSA9IG1zZy5hcmcxICE9IDA7CisgICAgICAgICAgICAKICAgICAgICAgICAgIGlmIChldmVudCA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyB0aW1lQmVmb3JlR2V0dGluZ0V2ZW50czsKKyAgICAgICAgICAgICAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGltZUJlZm9yZUdldHRpbmdFdmVudHMgPSBTeXN0ZW0ubmFub1RpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgICAgIGV2ZW50ID0gc1dpbmRvd1Nlc3Npb24uZ2V0UGVuZGluZ1BvaW50ZXJNb3ZlKG1XaW5kb3cpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kgJiYgZXZlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCI5IENsaWVudCBnb3QgZXZlbnRzICAgICAgIiwgU3lzdGVtLm5hbm9UaW1lKCkgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCI4IENsaWVudCBnZXR0aW5nIGV2ZW50cyAgIiwgdGltZUJlZm9yZUdldHRpbmdFdmVudHMgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZGlkRmluaXNoID0gdHJ1ZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZGlkRmluaXNoID0gZXZlbnQuZ2V0QWN0aW9uKCkgPT0gTW90aW9uRXZlbnQuQUNUSU9OX09VVFNJREU7CisgICAgICAgICAgICAgICAgY2FsbFdoZW5Eb25lID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoZXZlbnQgIT0gbnVsbCAmJiBtVHJhbnNsYXRvciAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgbVRyYW5zbGF0b3IudHJhbnNsYXRlRXZlbnRJblNjcmVlblRvQXBwV2luZG93KGV2ZW50KTsKQEAgLTE2NTQsOCArMTY3OSwxNiBAQAogICAgICAgICAgICAgICAgICAgICBpZihDb25maWcuTE9HVikgewogICAgICAgICAgICAgICAgICAgICAgICAgY2FwdHVyZU1vdGlvbkxvZygiY2FwdHVyZURpc3BhdGNoUG9pbnRlciIsIGV2ZW50KTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBldmVudC5vZmZzZXRMb2NhdGlvbigwLCBtQ3VyU2Nyb2xsWSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQ3VyU2Nyb2xsWSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5vZmZzZXRMb2NhdGlvbigwLCBtQ3VyU2Nyb2xsWSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCJBIERpc3BhdGNoaW5nIFRvdWNoRXZlbnRzIiwgU3lzdGVtLm5hbm9UaW1lKCkgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSBtVmlldy5kaXNwYXRjaFRvdWNoRXZlbnQoZXZlbnQpOworICAgICAgICAgICAgICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsdC5zYW1wbGUoIkIgRGlzcGF0Y2hlZCBUb3VjaEV2ZW50cyAiLCBTeXN0ZW0ubmFub1RpbWUoKSAtIGV2ZW50LmdldEV2ZW50VGltZU5hbm8oKSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKCFoYW5kbGVkICYmIGlzRG93bikgewogICAgICAgICAgICAgICAgICAgICAgICAgaW50IGVkZ2VTbG9wID0gbVZpZXdDb25maWd1cmF0aW9uLmdldFNjYWxlZEVkZ2VTbG9wKCk7CiAKQEAgLTE3MDEsNyArMTczNCw3IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgIGlmICghZGlkRmluaXNoKSB7CisgICAgICAgICAgICAgICAgaWYgKGNhbGxXaGVuRG9uZSkgewogICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgc1dpbmRvd1Nlc3Npb24uZmluaXNoS2V5KG1XaW5kb3cpOwogICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewpAQCAtMTcxNiw3ICsxNzQ5LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBESVNQQVRDSF9UUkFDS0JBTEw6Ci0gICAgICAgICAgICBkZWxpdmVyVHJhY2tiYWxsRXZlbnQoKE1vdGlvbkV2ZW50KW1zZy5vYmopOworICAgICAgICAgICAgZGVsaXZlclRyYWNrYmFsbEV2ZW50KChNb3Rpb25FdmVudCltc2cub2JqLCBtc2cuYXJnMSAhPSAwKTsKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBjYXNlIERJU1BBVENIX0FQUF9WSVNJQklMSVRZOgogICAgICAgICAgICAgaGFuZGxlQXBwVmlzaWJpbGl0eShtc2cuYXJnMSAhPSAwKTsKQEAgLTE5NTgsMTYgKzE5OTEsMTMgQEAKICAgICB9CiAKIAotICAgIHByaXZhdGUgdm9pZCBkZWxpdmVyVHJhY2tiYWxsRXZlbnQoTW90aW9uRXZlbnQgZXZlbnQpIHsKLSAgICAgICAgYm9vbGVhbiBkaWRGaW5pc2g7CisgICAgcHJpdmF0ZSB2b2lkIGRlbGl2ZXJUcmFja2JhbGxFdmVudChNb3Rpb25FdmVudCBldmVudCwgYm9vbGVhbiBjYWxsV2hlbkRvbmUpIHsKICAgICAgICAgaWYgKGV2ZW50ID09IG51bGwpIHsKICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgZXZlbnQgPSBzV2luZG93U2Vzc2lvbi5nZXRQZW5kaW5nVHJhY2tiYWxsTW92ZShtV2luZG93KTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBkaWRGaW5pc2ggPSB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZGlkRmluaXNoID0gZmFsc2U7CisgICAgICAgICAgICBjYWxsV2hlbkRvbmUgPSBmYWxzZTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChERUJVR19UUkFDS0JBTEwpIExvZy52KFRBRywgIk1vdGlvbiBldmVudDoiICsgZXZlbnQpOwpAQCAtMTk4NSw3ICsyMDE1LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIGlmIChoYW5kbGVkKSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFkaWRGaW5pc2gpIHsKKyAgICAgICAgICAgICAgICBpZiAoY2FsbFdoZW5Eb25lKSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBzV2luZG93U2Vzc2lvbi5maW5pc2hLZXkobVdpbmRvdyk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CkBAIC0yMTAxLDcgKzIxMzEsNyBAQAogICAgICAgICAgICAgICAgIG1MYXN0VHJhY2tiYWxsVGltZSA9IGN1clRpbWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICBpZiAoIWRpZEZpbmlzaCkgeworICAgICAgICAgICAgaWYgKGNhbGxXaGVuRG9uZSkgewogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIHNXaW5kb3dTZXNzaW9uLmZpbmlzaEtleShtV2luZG93KTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewpAQCAtMjUwMiw3ICsyNTMyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIG1TdXJmYWNlID0gbnVsbDsKKyAgICAgICAgICAgICAgICBtU3VyZmFjZS5yZWxlYXNlKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAobUFkZGVkKSB7CiAgICAgICAgICAgICAgICAgbUFkZGVkID0gZmFsc2U7CkBAIC0yNTY0LDE1ICsyNTk0LDE5IEBACiAgICAgICAgIHNlbmRNZXNzYWdlQXRUaW1lKG1zZywgZXZlbnQuZ2V0RXZlbnRUaW1lKCkpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoUG9pbnRlcihNb3Rpb25FdmVudCBldmVudCwgbG9uZyBldmVudFRpbWUpIHsKKyAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaF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xsV2hlbkRvbmUpIHsKICAgICAgICAgICAgIGZpbmFsIFZpZXdSb290IHZpZXdSb290ID0gbVZpZXdSb290LmdldCgpOwotICAgICAgICAgICAgaWYgKHZpZXdSb290ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB2aWV3Um9vdC5kaXNwYXRjaFBvaW50ZXIoZXZlbnQsIGV2ZW50VGltZSk7CisgICAgICAgICAgICBpZiAodmlld1Jvb3QgIT0gbnVsbCkgeyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIE5vdGU6IGV2ZW50VGltZSBpcyBpbiBtaWxsaXNlY29uZHMKKyAgICAgICAgICAgICAgICAgICAgVmlld1Jvb3QubHQuc2FtcGxlKCIqIFZpZXdSb290IGI0IGRpc3BhdGNoUHRyIiwgU3lzdGVtLm5hbm9UaW1lKCkgLSBldmVudFRpbWUgKiAxMDAwMDAwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdmlld1Jvb3QuZGlzcGF0Y2hQb2ludGVyKGV2ZW50LCBldmVudFRpbWUsIGNhbGxXaGVuRG9uZSk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIG5ldyBFdmVudENvbXBsZXRpb24obU1haW5Mb29wZXIsIHRoaXMsIG51bGwsIHRydWUsIGV2ZW50KTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoVHJhY2tiYWxsKE1vdGlvbkV2ZW50IGV2ZW50LCBsb25nIGV2ZW50VGltZSkgeworICAgICAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaFRyYWNrYmFsbChNb3Rpb25FdmVudCBldmVudCwgbG9uZyBldmVudFRpbWUsCisgICAgICAgICAgICAgICAgYm9vbGVhbiBjYWxsV2hlbkRvbmUpIHsKICAgICAgICAgICAgIGZpbmFsIFZpZXdSb290IHZpZXdSb290ID0gbVZpZXdSb290LmdldCgpOwogICAgICAgICAgICAgaWYgKHZpZXdSb290ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB2aWV3Um9vdC5kaXNwYXRjaFRyYWNrYmFsbChldmVudCwgZXZlbnRUaW1lKTsKKyAgICAgICAgICAgICAgICB2aWV3Um9vdC5kaXNwYXRjaFRyYWNrYmFsbChldmVudCwgZXZlbnRUaW1lLCBjYWxsV2hlbkRvbmUpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBuZXcgRXZlbnRDb21wbGV0aW9uKG1NYWluTG9vcGVyLCB0aGlzLCBudWxsLCBmYWxzZSwgZXZlbnQpOwogICAgICAgICAgICAgfQpAQCAtMjgyNyw2ICsyODY3LDkgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoV2FsbHBhcGVyT2Zmc2V0cyhmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTMxMDcsNyArMzE1MCw3IEBACiAgICAgICAgICAgICAgICAgICAgIGhhbmRsZXIucG9zdERlbGF5ZWQoaGFuZGxlckFjdGlvbi5hY3Rpb24sIGhhbmRsZXJBY3Rpb24uZGVsYXkpOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIG1BY3Rpb25zLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgYWN0aW9ucy5jbGVhcigpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTMxMjEsNyArMzE2NCw2IEBACiAgICAgICAgICAgICAgICAgaWYgKG8gPT0gbnVsbCB8fCBnZXRDbGFzcygpICE9IG8uZ2V0Q2xhc3MoKSkgcmV0dXJuIGZhbHNlOwogCiAgICAgICAgICAgICAgICAgSGFuZGxlckFjdGlvbiB0aGF0ID0gKE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yaWRlCiAgICAgcHVibGljIHZvaWQgc2V0VmlzaWJpbGl0eShpbnQgdmlzaWJpbGl0eSkgewotICAgICAgICBzdXBlci5zZXRWaXNpYmlsaXR5KHZpc2liaWxpdHkpOwotCi0gICAgICAgIGlmICh2aXNpYmlsaXR5ID09IFZJU0lCTEUgfHwgdmlzaWJpbGl0eSA9PSBJTlZJU0lCTEUpIHsKKyAgICAgICAgaWYgKG1JbmZsYXRlZFZpZXdSZWYgIT0gbnVsbCkgeworICAgICAgICAgICAgVmlldyB2aWV3ID0gbUluZmxhdGVkVmlld1JlZi5nZXQoKTsKKyAgICAgICAgICAgIGlmICh2aWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB2aWV3LnNldFZpc2liaWxpdHkodmlzaWJpbGl0eSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oInNldFZpc2liaWxpdHkgY2FsbGVkIG9uIHVuLXJlZmVyZW5jZWQgdmlldyIpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKHZpc2liaWxpdHkgPT0gVklTSUJMRSB8fCB2aXNpYmlsaXR5ID09IElOVklTSUJMRSkgeworICAgICAgICAgICAgc3VwZXIuc2V0VmlzaWJpbGl0eSh2aXNpYmlsaXR5KTsKICAgICAgICAgICAgIGluZmxhdGUoKTsKICAgICAgICAgfQogICAgIH0KQEAgLTIzNCw2ICsyNDQsOCBAQAogICAgICAgICAgICAgICAgICAgICBwYXJlbnQuYWRkVmlldyh2aWV3LCBpbmRleCk7CiAgICAgICAgICAgICAgICAgfQogCisgICAgICAgICAgICAgICAgbUluZmxhdGVkVmlld1JlZiA9IG5ldyBXZWFrUmVmZXJlbmNlKHZpZXcpOworCiAgICAgICAgICAgICAgICAgaWYgKG1JbmZsYXRlTGlzdGVuZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBtSW5mbGF0ZUxpc3R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OS05PV05fVk9MVU1FX1RFWFQ7CiAgICAgICAgIGludCBhZGRpdGlvbmFsTWVzc2FnZSA9IDA7CisgICAgICAgIG1SaW5nSXNTaWxlbnQgPSBmYWxzZTsKIAogICAgICAgICBpZiAoTE9HRCkgewogICAgICAgICAgICAgTG9nLmQoVEFHLCAib25TaG93Vm9sdW1lQ2hhbmdlZChzdHJlYW1UeXBlOiAiICsgc3RyZWFtVHlwZQpAQCAtMTY5LDggKzE3MywxNSBAQAogICAgICAgICBzd2l0Y2ggKHN0cmVhbVR5cGUpIHsKIAogICAgICAgICAgICAgY2FzZSBBdWRpb01hbmFnZXIuU1RSRUFNX1JJTkc6IHsKKyAgICAgICAgICAgICAgICBzZXRSaW5nZXJJY29uKCk7CiAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IFJJTkdUT05FX1ZPTFVNRV9URVhUOwotICAgICAgICAgICAgICAgIHNldFJpbmdlckljb24oaW5kZXgpOworICAgICAgICAgICAgICAgIFVyaSByaW5ndXJpID0gUmluZ3RvbmVNYW5hZ2VyLmdldEFjdHVhbERlZmF1bHRSaW5ndG9uZVVyaSgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LCBSaW5ndG9uZU1hbmFnZXIuVFlQRV9SSU5HVE9ORSk7CisgICAgICAgICAgICAgICAgaWYgKHJpbmd1cmkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBhZGRpdGlvbmFsTWVzc2FnZSA9CisgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy52b2x1bWVfbXVzaWNfaGludF9zaWxlbnRfcmluZ3RvbmVfc2VsZWN0ZWQ7CisgICAgICAgICAgICAgICAgICAgIG1SaW5nSXNTaWxlbnQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KIApAQCAtMjA4LDYgKzIxOSwxMyBAQAogICAgICAgICAgICAgY2FzZSBBdWRpb01hbmFnZXIuU1RSRUFNX05PVElGSUNBVElPTjogewogICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSBOT1RJRklDQVRJT05fVk9MVU1FX1RFWFQ7CiAgICAgICAgICAgICAgICAgc2V0U21hbGxJY29uKGluZGV4KTsKKyAgICAgICAgICAgICAgICBVcmkgcmluZ3VyaSA9IFJpbmd0b25lTWFuYWdlci5nZXRBY3R1YWxEZWZhdWx0UmluZ3RvbmVVcmkoCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dCwgUmluZ3RvbmVNYW5hZ2VyLlRZUEVfTk9USUZJQ0FUSU9OKTsKKyAgICAgICAgICAgICAgICBpZiAocmluZ3VyaSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFkZGl0aW9uYWxNZXNzYWdlID0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLnZvbHVtZV9tdXNpY19oaW50X3NpbGVudF9yaW5ndG9uZV9zZWxlY3RlZDsKKyAgICAgICAgICAgICAgICAgICAgbVJpbmdJc1NpbGVudCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogCkBAIC0yNTQsNyArMjcyLDYgQEAKICAgICAgICAgICAgICAgICBtQXVkaW9TZXJ2aWNlLnNob3VsZFZpYnJhdGUoQXVkaW9NYW5hZ2VyLlZJQlJBVEVfVFlQRV9SSU5HRVIpKSB7CiAgICAgICAgICAgICBzZW5kTWVzc2FnZURlbGF5ZWQob2J0YWluTWVzc2FnZShNU0dfVklCUkFURSksIFZJQlJBVEVfREVMQVkpOwogICAgICAgICB9Ci0KICAgICB9CiAKICAgICBwcm90ZWN0ZWQgdm9pZCBvblBsYXlTb3VuZChpbnQgc3RyZWFtVHlwZSwgaW50IGZsYWdzKSB7CkBAIC0zMzcsMTcgKzM1NCwxNSBAQAogICAgIC8qKgogICAgICA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WV3L1dpbmRvd01hbmFnZXIuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC92aWV3L1dpbmRvd01hbmFnZXIuamF2YQpAQCAtMzE0LDYgKzMxNCwxMiBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX0lOUFVUX01FVEhPRF9ESUFMT0c9IEZJUlNUX1NZU1RFTV9XSU5ET1crMTI7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFdpbmRvdyB0eXBlOiB3YWxscGFwZXIgd2luZG93LCBwbGFjZWQgYmVoaW5kIGFueSB3aW5kb3cgdGhhdCB3YW50cworICAgICAgICAgKiB0byBzaXQgb24gdG9wIG9mIHRoZSB3YWxscGFwZXIuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBUWVBFX1dBTExQQVBFUiAgICAgICAgICA9IEZJUlNUX1NZU1RFTV9XSU5ET1crMTM7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIEVuZCBvZiB0eXBlcyBvZiBzeXN0ZW0gd2luZG93cy4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IExBU1RfU1lTVEVNX1dJTkRPVyAgICAgID0gMjk5OTsKQEAgLTMyMyw4ICszMjksNiBAQAogICAgICAgICAgKiBEZWZhdWx0IGlzIG5vcm1hbC4KICAgICAgICAgICogCiAgICAgICAgICAqIEBzZWUgI01FTU9SWV9UWVBFX05PUk1BTAotICAgICAgICAgKiBAc2VlICNNRU1PUllfVFlQRV9IQVJEV0FSRQotICAgICAgICAgKiBAc2VlICNNRU1PUllfVFlQRV9HUFUKICAgICAgICAgICogQHNlZSAjTUVNT1JZX1RZUEVfUFVTSF9CVUZGRVJTCiAgICAgICAgICAqLwogICAgICAgICBwdWJsaWMgaW50IG1lbW9yeVR5cGU7CkBAIC0zMzIsMTAgKzMzNiwxNiBAQAogICAgICAgICAvKiogTWVtb3J5IHR5cGU6IFRo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AgICAgICAgIGNhc2UgRlJBTUVfQ09NUExFVEVEOiB7CiAgICAgICAgICAgICAgICAgaWYgKG1TZXR0aW5ncy5nZXRTYXZlUGFzc3dvcmQoKSAmJiBoYXNQYXNzd29yZEZpZWxkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKFdlYlZpZXcuREVCVUcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnROb3ROdWxsKG1DYWxsYmFja1Byb3h5LmdldEJhY2tGb3J3YXJkTGlzdCgpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDdXJyZW50SXRlbSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBXZWJBZGRyZXNzIHVyaSA9IG5ldyBXZWJBZGRyZXNzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DYWxsYmFja1Byb3h5LmdldEJhY2tGb3J3YXJkTGlzdCgpLmdldEN1cnJlbnRJdGVtKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0VXJsKCkpOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2NoZW1lUGx1c0hvc3QgPSB1cmkubVNjaGVtZSArIHVyaS5tSG9zdDsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gdXAgPSBtRGF0YWJhc2UuZ2V0VXNlcm5hbWVQYXNzd29yZChzY2hlbWVQbHVzSG9zdCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh1cCAhPSBudWxsICYmIHVwWzBdICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldFVzZXJuYW1lUGFzc3dvcmQodXBbMF0sIHVwWzFdKTsKKyAgICAgICAgICAgICAgICAgICAgV2ViSGlzdG9yeUl0ZW0gaXRlbSA9IG1DYWxsYmFja1Byb3h5LmdldEJhY2tGb3J3YXJkTGlzdCgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldEN1cnJlbnRJdGVtKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChpdGVtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFdlYkFkZHJlc3MgdXJpID0gbmV3IFdlYkFkZHJlc3MoaXRlbS5nZXRVcmwoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2NoZW1lUGx1c0hvc3QgPSB1cmkubVNjaGVtZSArIHVyaS5tSG9zdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZ1tdIHVwID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURhdGFiYXNlLmdldFVzZXJuYW1lUGFzc3dvcmQoc2NoZW1lUGx1c0hvc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVwICE9IG51bGwgJiYgdXBbMF0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFVzZXJuYW1lUGFzc3dvcmQodXBbMF0sIHVwWzFdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBDYWNoZU1hbmFnZXIudHJpbUNhY2hlSWZOZWVkZWQoKTsKQEAgLTQ2Myw4ICs0NjcsNiBAQAogICAgICAqIEBwYXJhbSBwb3N0RGF0YSBJZiB0aGUgbWV0aG9kIGlzICJQT1NUIiBwb3N0RGF0YSBpcyBzZW50IGFzIHRoZSByZXF1ZXN0CiAgICAgICogICAgICAgICAgICAgICAgIGJvZHkuIElzIG51bGwgd2hlbiBlbXB0eS4KICAgICAgKiBAcGFyYW0gY2FjaGVNb2RlIFRoZSBjYWNoZSBtb2RlIHRvIHVzZSB3aGVuIGxvYWRpbmcgdGhpcyByZXNvdXJjZS4KLSAgICAgKiBAcGFyYW0gaXNIaWdoUHJpb3JpdHkgVHJ1ZSBpZiB0aGlzIHJlc291cmNlIG5lZWRzIHRvIGJlIHB1dCBhdCB0aGUgZnJvbnQKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgb2YgdGhlIG5ldHdvcmsgcXVldWUuCiAgICAgICogQHBhcmFtIHN5bmNocm9ub3VzIFRydWUgaWYgdGhlIGxvYWQgaXMgc3luY2hyb25vdXMuCiAgICAgICogQHJldHVybiBBIG5ld2x5IGNyZWF0ZWQgTG9hZExpc3RlbmVyIG9iamVjdC4KICAgICAgKi8KQEAgLTQ3NCw3ICs0NzYsNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhhc2hNYXAgaGVhZGVycywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlW10gcG9zdERhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNhY2hlTW9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGlzSGlnaFByaW9yaXR5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gc3luY2hyb25vdXMpIHsKICAgICAgICAgUGVyZkNoZWNrZXIgY2hlY2tlciA9IG5ldyBQZXJmQ2hlY2tlcigpOwogCkBAIC00OTAsNyArNDkxLDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChtU2V0dGluZ3MuZ2V0U2F2ZVBhc3N3b3JkKCkgJiYgaGFzUGFzc3dvcmRGaWVsZCgpKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKFdlYlZpZXcuREVCVUcpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuQlJPV1NFUl9GUkFNRSkgewogICAgICAgICAgICAgICAgICAgICAgICAgQXNzZXJ0LmFzc2VydE5vdE51bGwobUNhbGxiYWNrUHJveHkuZ2V0QmFja0ZvcndhcmRMaXN0KCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldEN1cnJlbnRJdGVtKCkpOwogICAgICAgICAgICAgICAgICAgICB9CkBAIC01MzgsMTAgKzUzOSwxMCBAQAogICAgICAgICAvLyBpcyB0aGlzIHJlc291cmNlIHRoZSBtYWluLWZyYW1lIHRvcC1sZXZlbCBwYWdlPwogICAgICAgICBib29sZWFuIGlzTWFpbkZyYW1lUGFnZSA9IG1Jc01haW5GcmFtZTsKIAotICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuQlJPV1NFUl9GUkFNRSkgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAic3RhcnRMb2FkaW5nUmVzb3VyY2U6IHVybD0iICsgdXJsICsgIiwgbWV0aG9kPSIKLSAgICAgICAgICAgICAgICAgICAgKyBtZXRob2QgKyAiLCBwb3N0RGF0YT0iICsgcG9zdERhdGEgKyAiLCBpc0hpZ2hQcmlvcml0eT0iCi0gICAgICAgICAgICAgICAgICAgICsgaXNIaWdoUHJpb3JpdHkgKyAiLCBpc01haW5GcmFtZVBhZ2U9IiArIGlzTWFpbkZyYW1lUGFnZSk7CisgICAgICAgICAgICAgICAgICAgICsgbWV0aG9kICsgIiwgcG9zdERhdGE9IiArIHBvc3REYXRhICsgIiwgaXNNYWluRnJhbWVQYWdlPSIKKyAgICAgICAgICAgICAgICAgICAgKyBpc01haW5GcmFtZVBhZ2UpOwogICAgICAgICB9CiAKICAgICAgICAgLy8gQ3JlYXRlIGEgTG9hZExpc3RlbmVyCkBAIC01NTEsMjMgKzU1MiwxNyBAQAogICAgICAgICBtQ2FsbGJhY2tQcm94eS5vbkxvYWRSZXNvdXJjZSh1cmwpOwogCiAgICAgICAgIGlmIChMb2FkTGlzdGVuZXIuZ2V0TmF0aXZlTG9hZGVyQ291bnQoKSA+IE1BWF9PVVRTVEFORElOR19SRVFVRVNUUykgeworICA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AgICAgICAgICAgICBicmVhazsKKwogICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJnZXRSYXdSZXNGaWxlbmFtZSBnb3QgaW5jb21wYXRpYmxlIHJlc291cmNlIElEIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgIH0KICAgICAgICAgVHlwZWRWYWx1ZSB2YWx1ZSA9IG5ldyBUeXBlZFZhbHVlKCk7CiAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFZhbHVlKHJlc2lkLCB2YWx1ZSwgdHJ1ZSk7CisgICAgICAgIGlmIChpZCA9PSBEUkFXQUJMRURJUikgeworICAgICAgICAgICAgU3RyaW5nIHBhdGggPSB2YWx1ZS5zdHJpbmcudG9TdHJpbmcoKTsKKyAgICAgICAgICAgIGludCBpbmRleCA9IHBhdGgubGFzdEluZGV4T2YoJy8nKTsKKyAgICAgICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJDYW4ndCBmaW5kIGRyYXdhYmxlIGRpcmVjdG9yeS4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gIiI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gcGF0aC5zdWJzdHJpbmcoMCwgaW5kZXggKyAxKTsKKyAgICAgICAgfQogICAgICAgICByZXR1cm4gdmFsdWUuc3RyaW5nLnRvU3RyaW5nKCk7CiAgICAgfQogCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvQ2FjaGVMb2FkZXIuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9DYWNoZUxvYWRlci5qYXZhCmluZGV4IDNlMWI2MDIuLmRlOGY4ODggMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL3d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ml2YXRlIjsKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgTUFYX0FHRSA9ICJtYXgtYWdlIjsKIAogICAgIHByaXZhdGUgc3RhdGljIGxvbmcgQ0FDSEVfVEhSRVNIT0xEID0gNiAqIDEwMjQgKiAxMDI0OwpAQCAtODAsMTIgKzc5LDE0IEBACiAgICAgICAgIGludCBodHRwU3RhdHVzQ29kZTsKICAgICAgICAgbG9uZyBjb250ZW50TGVuZ3RoOwogICAgICAgICBsb25nIGV4cGlyZXM7CisgICAgICAgIFN0cmluZyBleHBpcmVzU3RyaW5nOwogICAgICAgICBTdHJpbmcgbG9jYWxQYXRoOwogICAgICAgICBTdHJpbmcgbGFzdE1vZGlmaWVkOwogICAgICAgICBTdHJpbmcgZXRhZzsKICAgICAgICAgU3RyaW5nIG1pbWVUeXBlOwogICAgICAgICBTdHJpbmcgbG9jYXRpb247CiAgICAgICAgIFN0cmluZyBlbmNvZGluZzsKKyAgICAgICAgU3RyaW5nIGNvbnRlbnRkaXNwb3NpdGlvbjsKIAogICAgICAgICAvLyB0aGVzZSBmaWVsZHMgYXJlIE5PVCBzYXZlZCB0byB0aGUgZGF0YWJhc2UKICAgICAgICAgSW5wdXRTdHJlYW0gaW5TdHJlYW07CkBAIC0xMDgsNiArMTA5LDEzIEBACiAgICAgICAgICAgICByZXR1cm4gZXhwaXJlczsKICAgICAgICAgfQogCisgICAgICAgIC8qKgorICAgICAgICAgKiBAaGlkZSBQZW5kaW5nIEFQSSBjb3VuY2lsIGFwcHJvdmFsCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgU3RyaW5nIGdldEV4cGlyZXNTdHJpbmcoKSB7CisgICAgICAgICAgICByZXR1cm4gZXhwaXJlc1N0cmluZzsKKyAgICAgICAgfQorCiAgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0TGFzdE1vZGlmaWVkKCkgewogICAgICAgICAgICAgcmV0dXJuIGxhc3RNb2RpZmllZDsKICAgICAgICAgfQpA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GggPT0gMCkgewotICAgICAgICAgICAgY2FjaGVSZXQub3V0RmlsZS5kZWxldGUoKTsKKyAgICAgICAgICAgIGNhY2hlUmV0LmxvY2FsUGF0aCA9ICIiOworICAgICAgICB9CisgICAgICAgIGlmICgocmVkaXJlY3QgfHwgY2FjaGVSZXQuY29udGVudExlbmd0aCA9PSAwKQorICAgICAgICAgICAgICAgICYmICFjYWNoZVJldC5vdXRGaWxlLmRlbGV0ZSgpKSB7CisgICAgICAgICAgICBMb2cuZShMT0dUQUcsIGNhY2hlUmV0Lm91dEZpbGUuZ2V0UGF0aCgpICsgIiBkZWxldGUgZmFpbGVkLiIpOworICAgICAgICB9CisgICAgICAgIGlmIChjYWNoZVJldC5jb250ZW50TGVuZ3RoID09IDApIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCiAgICAgICAgIG1EYXRhQmFzZS5hZGRDYWNoZSh1cmwsIGNhY2hlUmV0KTsKIAotICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuQ0FDSEVfTUFOQUdFUikgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAic2F2ZUNhY2hlRmlsZSBmb3IgdXJsICIgKyB1cmwpOwogICAgICAgICB9CiAgICAgfQpAQCAtNDQ0LDcgKzQ3MSwxMCBAQAogICAgICAgICAgICAgICAgICAgICAvLyBpZiBtQmFzZURpciBkb2Vzbid0IGV4aXN0LCBmaWxlcyBjYW4gYmUgbnVsbC4KICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVzICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZmlsZXMubGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgRmlsZShtQmFzZURpciwgZmlsZXNbaV0pLmRlbGV0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUgZiA9IG5ldyBGaWxlKG1CYXNlRGlyLCBmaWxlc1tpXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLmRlbGV0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgZi5nZXRQYXRoKCkgKyAiIGRlbGV0ZSBmYWlsZWQuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoU2VjdXJpdHlFeGNlcHRpb24gZSkgewpAQCAtNDcyLDcgKzUwMiwxMCBAQAogICAgICAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gcGF0aExpc3QgPSBtRGF0YUJhc2UudHJpbUNhY2hlKENBQ0hFX1RSSU1fQU1PVU5UKTsKICAgICAgICAgICAgIGludCBzaXplID0gcGF0aExpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKLSAgICAgICAgICAgICAgICBuZXcgRmlsZShtQmFzZURpciwgcGF0aExpc3QuZ2V0KGkpKS5kZWxldGUoKTsKKyAgICAgICAgICAgICAgICBGaWxlIGYgPSBuZXcgRmlsZShtQmFzZURpciwgcGF0aExpc3QuZ2V0KGkpKTsKKyAgICAgICAgICAgICAgICBpZiAoIWYuZGVsZXRlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HVEFHLCBmLmdldFBhdGgoKSArICIgZGVsZXRlIGZhaWxlZC4iKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC01MTEsMTIgKzU0NCw3IEBACiAgICAgICAgICAgICAgICAgLy8gY2FjaGUgZmlsZS4gSWYgaXQgaXMgbm90LCByZXNvbHZlIHRoZSBjb2xsaXNpb24uCiAgICAgICAgICAgICAgICAgd2hpbGUgKGZpbGUuZXhpc3RzKCkpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZWNrT2xkUGF0aCkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gYXMgdGhpcyBpcyBjYWxsZWQgZnJvbSBodHRwIHRocmVhZCB0aHJvdWdoIAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlQ2FjaGVGaWxlLCB3ZSBuZWVkIGVuZENhY2hlVHJhbnNhY3Rpb24gYmVmb3JlIAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGF0YWJhc2UgYWNjZXNzLgotICAgICAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUuZW5kQ2FjaGVUcmFuc2FjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgQ2FjaGVSZXN1bHQgb2xkUmVzdWx0ID0gbURhdGFCYXNlLmdldENhY2hlKHVybCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3Q29yZS5zdGFydENhY2hlVHJhbnNhY3Rpb24oKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbGRSZXN1bHQgIT0gbnVsbCAmJiBvbGRSZXN1bHQuY29udGVudExlbmd0aCA+IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGF0aC5lcXVhbHMob2xkUmVzdWx0LmxvY2FsUGF0aCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aCA9IG9sZFJlc3VsdC5sb2NhbFBhdGg7CkBAIC01OTYsMjEgKzYyNCwyNyBAQAogICAgICAgICBpZiAobG9jYXRpb24gIT0gbnVsbCkgcmV0LmxvY2F0aW9uID0gbG9jYXRpb247CiAKICAgICAgICAgcmV0LmV4cGlyZXMgPSAtMTsKLSAgICAgICAgU3RyaW5nIGV4cGlyZXMgPSBoZWFkZXJzLmdldEV4cGlyZXMoKTsKLSAgICAgICAgaWYgKGV4cGlyZXMgIT0gbnVsbCkgeworICAgICAgICByZXQuZXhwaXJlc1N0cmluZyA9IGhlYWRlcnMuZ2V0RXhwaXJlcygpOworICAgICAgICBpZiAocmV0LmV4cGlyZXNTdHJpbmcgIT0gbnVsbCkgewogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICByZXQuZXhwaXJlcyA9IEh0dHBEYXRlVGltZS5wYXJzZShleHBpcmVzKTsKKyAgICAgICAgICAgICAgICByZXQuZXhwaXJlcyA9IEh0dHBEYXRlVGltZS5wYXJzZShyZXQuZXhwaXJlc1N0cmluZyk7CiAgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgICAgICAvLyBUYWtlIGNhcmUgb2YgdGhlIHNwZWNpYWwgIi0xIiBhbmQgIjAiIGNhc2VzCi0gICAgICAgICAgICAgICAgaWYgKCItMSIuZXF1YWxzKGV4cGlyZXMpIHx8ICIwIi5lcXVhbHMoZXhwaXJlcykpIHsKKyAgICAgICAgICAgICAgICBpZiAoIi0xIi5lcXVhbHMocmV0LmV4cGlyZXNTdHJpbmcpCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAiMCIuZXF1YWxzKHJldC5leHBpcmVzU3RyaW5nKSkgewogICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIGl0IGV4cGlyZWQsIGJ1dCBjYW4gYmUgdXNlZCBmb3IgaGlzdG9yeSBuYXZpZ2F0aW9uCiAgICAgICAgICAgICAgICAgICAgIHJldC5leHBpcmVzID0gMDsKICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJpbGxlZ2FsIGV4cGlyZXM6ICIgKyBleHBpcmVzKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HVEFHLCAiaWxsZWdhbCBleHBpcmVzOiAiICsgcmV0LmV4cGlyZXNTdHJpbmcpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogCisgICAgICAgIFN0cmluZyBjb250ZW50RGlzcG9zaXRpb24gPSBoZWFkZXJzLmdldENvbnRlbnREaXNwb3NpdGlvbigpOworICAgICAgICBpZiAoY29udGVudERpc3Bvc2l0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldC5jb250ZW50ZGlzcG9zaXRpb24gPSBjb250ZW50RGlzcG9zaXRpb247CisgICAgICAgIH0KKwogICAgICAgICBTdHJpbmcgbGFzdE1vZGlmaWVkID0gaGVhZGVycy5nZXRMYXN0TW9kaWZpZWQoKTsKICAgICAgICAgaWYgKGxhc3RNb2RpZmllZCAhPSBudWxsKSByZXQubGFzdE1vZGlmaWVkID0gbGFzdE1vZGlmaWVkOwogCkBAIC02MjgsNyArNjYyLDcgQEAKICAgICAgICAgICAgICAgICAvLyBtdXN0IGJlIHJlLXZhbGlkYXRlZCBvbiBldmVyeSBsb2FkLiBJdCBkb2VzIG5vdCBtZWFuIHRoYXQKICAgICAgICAgICAgICAgICAvLyB0aGUgY29udGVudCBjYW4gbm90IGJlIGNhY2hlZC4gc2V0IHRvIGV4cGlyZSAwIG1lYW5zIGl0CiAgICAgICAgICAgICAgICAgLy8gY2FuIG9ubHkgYmUgdXNlZCBpbiBDQUNIRV9NT0RFX0NBQ0hFX09OTFkgY2FzZQotICAgICAgICAgICAgICAgIGlmIChOT19DQUNIRS5lcXVhbHMoY29udHJvbHNbaV0pIHx8IFBSSVZBVEUuZXF1YWxzKGNvbnRyb2xzW2ldKSkgeworICAgICAgICAgICAgICAgIGlmIChOT19DQUNIRS5lcXVhbHMoY29udHJvbHNbaV0pKSB7CiAgICAgICAgICAgICAgICAgICAgIHJldC5leHBpcmVzID0gMDsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNvbnRyb2xzW2ldLnN0YXJ0c1dpdGgoTUFYX0FHRSkpIHsKICAgICAgICAgICAgICAgICAgICAgaW50IHNlcGFyYXRvciA9IGNvbnRyb2xzW2ldLmluZGV4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gIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTQ0FMRV9DSEFOR0VEICAgICAgICA9IDEyMzsKLSAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUkVDRUlWRURfQ0VSVElGSUNBVEUgPSAxMjQ7Ci0gICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNXSVRDSF9PVVRfSElTVE9SWSAgID0gMTI1OwotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBKU19USU1FT1VUICAgICAgICAgICA9IDEyNjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUEFHRV9TVEFSVEVEICAgICAgICAgICAgICAgICAgICAgICAgPSAxMDA7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFJFQ0VJVkVEX0lDT04gICAgICAgICAgICAgICAgICAgICAgID0gMTAxOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBSRUNFSVZFRF9USVRMRSAgICAgICAgICAgICAgICAgICAgICA9IDEwMjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgT1ZFUlJJREVfVVJMICAgICAgICAgICAgICAgICAgICAgICAgPSAxMDM7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEFVVEhfUkVRVUVTVCAgICAgICAgICAgICAgICAgICAgICAgID0gMTA0OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTU0xfRVJST1IgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDEwNTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUFJPR1JFU1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAxMDY7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFVQREFURV9WSVNJVEVEICAgICAgICAgICAgICAgICAgICAgID0gMTA3OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBMT0FEX1JFU09VUkNFICAgICAgICAgICAgICAgICAgICAgICA9IDEwODsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ1JFQVRFX1dJTkRPVyAgICAgICAgICAgICAgICAgICAgICAgPSAxMDk7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENMT1NFX1dJTkRPVyAgICAgICAgICAgICAgICAgICAgICAgID0gMTEwOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTQVZFX1BBU1NXT1JEICAgICAgICAgICAgICAgICAgICAgICA9IDExMTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgSlNfQUxFUlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAxMTI7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEpTX0NPTkZJUk0gICAgICAgICAgICAgICAgICAgICAgICAgID0gMTEzOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBKU19QUk9NUFQgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDExNDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgSlNfVU5MT0FEICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAxMTU7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEFTWU5DX0tFWUVWRU5UUyAgICAgICAgICAgICAgICAgICAgID0gMTE2OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBUT09fTUFOWV9SRURJUkVDVFMgICAgICAgICAgICAgICAgICA9IDExNzsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRE9XTkxPQURfRklMRSAgICAgICAgICAgICAgICAgICAgICAgPSAxMTg7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFJFUE9SVF9FUlJPUiAgICAgICAgICAgICAgICAgICAgICAgID0gMTE5OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBSRVNFTkRfUE9TVF9EQVRBICAgICAgICAgICAgICAgICAgICA9IDEyMDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUEFHRV9GSU5JU0hFRCAgICAgICAgICAgICAgICAgICAgICAgPSAxMjE7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFJFUVVFU1RfRk9DVVMgICAgICAgICAgICAgICAgICAgICAgID0gMTIyOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTQ0FMRV9DSEFOR0VEICAgICAgICAgICAgICAgICAgICAgICA9IDEyMzsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUkVDRUlWRURfQ0VSVElGSUNBVEUgICAgICAgICAgICAgICAgPSAxMjQ7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNXSVRDSF9PVVRfSElTVE9SWSAgICAgICAgICAgICAgICAgID0gMTI1OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBFWENFRURFRF9EQVRBQkFTRV9RVU9UQSAgICAgICAgICAgICA9IDEyNjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUkVBQ0hFRF9BUFBDQUNIRV9NQVhTSVpFICAgICAgICAgICAgPSAxMjc7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEpTX1RJTUVPVVQgICAgICAgICAgICAgICAgICAgICAgICAgID0gMTI4OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBBRERfTUVTU0FHRV9UT19DT05TT0xFICAgICAgICAgICAgICA9IDEyOTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgR0VPTE9DQVRJT05fUEVSTUlTU0lPTlNfU0hPV19QUk9NUFQgPSAxMzA7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEdFT0xPQ0FUSU9OX1BFUk1JU1NJT05TX0hJREVfUFJPTVBUID0gMTMxOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBSRUNFSVZFRF9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IG9mIERvd25sb2FkTGlzdGVuZXIuCiAgICAgICovCkBAIC0yMjksNiArMjQ1LDEzIEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogCisgICAgICAgICAgICBjYXNlIFJFQ0VJVkVEX1RPVUNIX0lDT05fVVJMOgorICAgICAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vblJlY2VpdmVkVG91Y2hJY29uVXJsKG1XZWJWaWV3LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTdHJpbmcpIG1zZy5vYmopOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKwogICAgICAgICAgICAgY2FzZSBSRUNFSVZFRF9USVRMRToKICAgICAgICAgICAgICAgICBpZiAobVdlYkNocm9tZUNsaWVudCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG1XZWJDaHJvbWVDbGllbnQub25SZWNlaXZlZFRpdGxlKG1XZWJWaWV3LApAQCAtMzg5LDYgKzQxMiw2MyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKIAorICAgICAgICAgICAgY2FzZSBFWENFRURFRF9EQVRBQkFTRV9RVU9UQToKKyAgICAgICAgICAgICAgICBpZiAobVdlYkNocm9tZUNsaWVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIEhhc2hNYXA8U3RyaW5nLCBPYmplY3Q+IG1hcCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEhhc2hNYXA8U3RyaW5nLCBPYmplY3Q+KSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZGF0YWJhc2VJZGVudGlmaWVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3RyaW5nKSBtYXAuZ2V0KCJkYXRhYmFzZUlkZW50aWZpZXIiKTsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IChTdHJpbmcpIG1hcC5nZXQoInVybCIpOworICAgICAgICAgICAgICAgICAgICBsb25nIGN1cnJlbnRRdW90YSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChMb25nKSBtYXAuZ2V0KCJjdXJyZW50UXVvdGEiKSkubG9uZ1ZhbHVlKCk7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgdG90YWxVc2VkUXVvdGEgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoTG9uZykgbWFwLmdldCgidG90YWxVc2VkUXVvdGEiKSkubG9uZ1ZhbHVlKCk7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgZXN0aW1hdGVkU2l6ZSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChMb25nKSBtYXAuZ2V0KCJlc3RpbWF0ZWRTaXplIikpLmxvbmdWYWx1ZSgpOworICAgICAgICAgICAgICAgICAgICBXZWJTdG9yYWdlLlF1b3RhVXBkYXRlciBxdW90YVVwZGF0ZXIgPQorICAgICAgICAgICAgICAgICAgICAgICAgKFdlYlN0b3JhZ2UuUXVvdGFVcGRhdGVyKSBtYXAuZ2V0KCJxdW90YVVwZGF0ZXIiKTsKKworICAgICAgICAgICAgICAgICAgICBtV2ViQ2hyb21lQ2xpZW50Lm9uRXhjZWVkZWREYXRhYmFzZVF1b3RhKHVybCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhYmFzZUlkZW50aWZpZXIsIGN1cnJlbnRRdW90YSwgZXN0aW1hdGVkU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbFVzZWRRdW90YSwgcXVvdGFVcGRhdGVyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgUkVBQ0hFRF9BUFBDQUNIRV9NQVhTSVpFOgorICAgICAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4gbWFwID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4pIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgc3BhY2VOZWVkZWQgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoTG9uZykgbWFwLmdldCgic3BhY2VOZWVkZWQiKSkubG9uZ1ZhbHVlKCk7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgdG90YWxVc2VkUXVvdGEgPQorICAgICAgICAgICAgICAgICAgICAgICAgKChMb25nKSBtYXAuZ2V0KCJ0b3RhbFVzZWRRdW90YSIpKS5sb25nVmFsdWUoKTsKKyAgICAgICAgICAgICAgICAgICAgV2ViU3RvcmFnZS5RdW90YVVwZGF0ZXIgcXVvdGFVcGRhdGVyID0KKyAgICAgICAgICAgICAgICAgICAgICAgIChXZWJTdG9yYWdlLlF1b3RhVXBkYXRlcikgbWFwLmdldCgicXVvdGFVcGRhdGVyIik7CisKKyAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vblJlYWNoZWRNYXhBcHBDYWNoZVNpemUoc3BhY2VOZWVkZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG90YWxVc2VkUXVvdGEsIHF1b3RhVXBkYXRlcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEdFT0xPQ0FUSU9OX1BFUk1JU1NJT05TX1NIT1dfUFJPTVBUOgorICAgICAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4gbWFwID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4pIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBvcmlnaW4gPSAoU3RyaW5nKSBtYXAuZ2V0KCJvcmlnaW4iKTsKKyAgICAgICAgICAgICAgICAgICAgR2VvbG9jYXRpb25QZXJtaXNzaW9ucy5DYWxsYmFjayBjYWxsYmFjayA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEdlb2xvY2F0aW9uUGVybWlzc2lvbnMuQ2FsbGJhY2spCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwLmdldCgiY2FsbGJhY2siKTsKKyAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vbkdlb2xvY2F0aW9uUGVybWlzc2lvbnNTaG93UHJvbXB0KG9yaWdpbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEdFT0xPQ0FUSU9OX1BFUk1JU1NJT05TX0hJREVfUFJPTVBUOgorICAgICAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vbkdlb2xvY2F0aW9uUGVybWlzc2lvbnNIaWRlUHJvbXB0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICBjYXNlIEpTX0FMRVJUOgogICAgICAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgZmluYWwgSnNSZXN1bHQgcmVzID0gKEpzUmVzdWx0KSBtc2cub2JqOwpAQCAtNTYzLDYgKzY0MywxMyBAQAogICAgICAgICAgICAgY2FzZSBTV0lUQ0hfT1VUX0hJU1RPUlk6CiAgICAgICAgICAgICAgIC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IEJpdG1hcCBmYXZpY29uKSB7CiAgICAgICAgIC8vIERvIGFuIHVuc3luY2hyb25pemVkIHF1aWNrIGNoZWNrIHRvIGF2b2lkIHBvc3RpbmcgaWYgbm8gY2FsbGJhY2sgaGFzCkBAIC02MTQsOSArNzM0LDEyIEBACiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgLy8gUGVyZm9ybWFuY2UgcHJvYmUKLSAgICAgICAgaWYgKGZhbHNlKSB7CisgICAgICAgIGlmIChQRVJGX1BST0JFKSB7CiAgICAgICAgICAgICBtV2ViQ29yZVRocmVhZFRpbWUgPSBTeXN0ZW1DbG9jay5jdXJyZW50VGhyZWFkVGltZU1pbGxpcygpOworICAgICAgICAgICAgbVdlYkNvcmVJZGxlVGltZSA9IDA7CiAgICAgICAgICAgICBOZXR3b3JrLmdldEluc3RhbmNlKG1Db250ZXh0KS5zdGFydFRpbWluZygpOworICAgICAgICAgICAgLy8gdW4tY29tbWVudCB0aGlzIGlmIFBFUkZfUFJPQkUgaXMgdHJ1ZQorLy8gICAgICAgICAgICBMb29wZXIubXlRdWV1ZSgpLnNldFdhaXRDYWxsYmFjayhtSWRsZUNhbGxiYWNrKTsKICAgICAgICAgfQogICAgICAgICBNZXNzYWdlIG1zZyA9IG9idGFpbk1lc3NhZ2UoUEFHRV9TVEFSVEVEKTsKICAgICAgICAgbXNnLm9iaiA9IGZhdmljb247CkBAIC02MzEsMTAgKzc1NCwxMiBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIC8vIFBlcmZvcm1hbmNlIHByb2JlCi0gICAgICAgIGlmIChmYWxzZSkgeworICAgICAgICBpZiAoUEVSRl9QUk9CRSkgeworICAgICAgICAgICAgLy8gdW4tY29tbWVudCB0aGlzIGlmIFBFUkZfUFJPQkUgaXMgdHJ1ZQorLy8gICAgICAgICAgICBMb29wZXIubXlRdWV1ZSgpLnNldFdhaXRDYWxsYmFjayhudWxsKTsKICAgICAgICAgICAgIExvZy5kKCJXZWJDb3JlIiwgIldlYkNvcmUgdGhyZWFkIHVzZWQgIiArIAogICAgICAgICAgICAgICAgICAgICAoU3lzdGVtQ2xvY2suY3VycmVudFRocmVhZFRpbWVNaWxsaXMoKSAtIG1XZWJDb3JlVGhyZWFkVGltZSkKLSAgICAgICAgICAgICAgICAgICAgKyAiIG1zIik7CisgICAgICAgICAgICAgICAgICAgICsgIiBtcyBhbmQgaWRsZWQgIiArIG1XZWJDb3JlSWRsZVRpbWUgKyAiIG1zIik7CiAgICAgICAgICAgICBOZXR3b3JrLmdldEluc3RhbmNlKG1Db250ZXh0KS5zdG9wVGltaW5nKCk7CiAgICAgICAgIH0KICAgICAgICAgTWVzc2FnZSBtc2cgPSBvYnRhaW5NZXNzYWdlKFBBR0VfRklOSVNIRUQsIHVybCk7CkBAIC04MzQsNyArOTU5LDcgQEAKICAgICAgICAgICAgIFN0cmluZyBwYXNzd29yZCwgTWVzc2FnZSByZXN1bWVNc2cpIHsKICAgICAgICAgLy8gcmVzdW1lTXNnIHNob3VsZCBiZSBudWxsIGF0IHRoaXMgcG9pbnQgYmVjYXVzZSB3ZSB3YW50IHRvIGNyZWF0ZSBpdAogICAgICAgICAvLyB3aXRoaW4gdGhlIENhbGxiYWNrUHJveHkuCi0gICAgICAgIGlmIChXZWJWaWV3LkRFQlVHKSB7CisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLkNBTExCQUNLX1BST1hZKSB7CiAgICAgICAgICAgICBqdW5pdC5mcmFtZXdvcmsuQXNzZXJ0LmFzc2VydE51bGwocmVzdW1lTXNnKTsKICAgICAgICAgfQogICAgICAgICByZXN1bWVNc2cgPSBvYnRhaW5NZXNzYWdlKE5PVElGWSk7CkBAIC05MzksNiArMTA2NCwyMSBAQAogICAgICAgICBzZW5kTWVzc2FnZShvYnRhaW5NZXNzYWdlKFJFQ0VJVkVEX0lDT04sIGljb24pKTsKICAgICB9CiAKKyAgICAvKiBwYWNrYWdlICovIHZvaWQgb25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aykgeworICAgICAgICBpZiAobVdlYkNocm9tZUNsaWVudCA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBNZXNzYWdlIHNob3dNZXNzYWdlID0KKyAgICAgICAgICAgICAgICBvYnRhaW5NZXNzYWdlKEdFT0xPQ0FUSU9OX1BFUk1JU1NJT05TX1NIT1dfUFJPTVBUKTsKKyAgICAgICAgSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4gbWFwID0gbmV3IEhhc2hNYXAoKTsKKyAgICAgICAgbWFwLnB1dCgib3JpZ2luIiwgb3JpZ2luKTsKKyAgICAgICAgbWFwLnB1dCgiY2FsbGJhY2siLCBjYWxsYmFjayk7CisgICAgICAgIHNob3dNZXNzYWdlLm9iaiA9IG1hcDsKKyAgICAgICAgc2VuZE1lc3NhZ2Uoc2hvd01lc3NhZ2UpOworICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCBieSBXZWJWaWV3Q29yZSB0byBpbnN0cnVjdCB0aGUgYnJvd3NlciB0byBoaWRlIHRoZSBHZW9sb2NhdGlvbgorICAgICAqIHBlcm1pc3Npb25zIHByb21wdC4KKyAgICAgKiBvcmlnaW4uCisgICAgICogQGhpZGUgcGVuZGluZyBBUEkgY291bmNpbCByZXZpZXcuCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25HZW9sb2NhdGlvblBlcm1pc3Npb25zSGlkZVByb21wdCgpIHsKKyAgICAgICAgaWYgKG1XZWJDaHJvbWVDbGllbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgTWVzc2FnZSBoaWRlTWVzc2FnZSA9IG9idGFpbk1lc3NhZ2UoR0VPTE9DQVRJT05fUEVSTUlTU0lPTlNfSElERV9QUk9NUFQpOworICAgICAgICBzZW5kTWVzc2FnZShoaWRlTWVzc2FnZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FsbGVkIGJ5IFdlYlZpZX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ogICAgICAgICAgICAgbURhdGFTdHJlYW0gPSBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5vcGVuSW5wdXRTdHJlYW0odXJpKTsKICAgICAgICAgICAgIG1IYW5kbGVyLnN0YXR1cygxLCAxLCAwLCAiT0siKTsKICAgICAgICAgfSBjYXRjaCAoamF2YS5pby5GaWxlTm90Rm91bmRFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgIG1IYW5kbGVyLmVycm9yKAotICAgICAgICAgICAgICAgICAgICBFdmVudEhhbmRsZXIuRklMRV9OT1RfRk9VTkRfRVJST1IsCi0gICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFN0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5odHRwRXJyb3JGaWxlTm90Rm91bmQpICsKLSAgICAgICAgICAgICAgICAgICAgIiAiICsgZXguZ2V0TWVzc2FnZSgpKTsKKyAgICAgICAgICAgIG1IYW5kbGVyLmVycm9yKEV2ZW50SGFuZGxlci5GSUxFX05PVF9GT1VORF9FUlJPUiwgZXJyU3RyaW5nKGV4KSk7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAKICAgICAgICAgfSBjYXRjaCAoamF2YS5pby5JT0V4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgbUhhbmRsZXIuZXJyb3IoCi0gICAgICAgICAgICAgICAgICAgIEV2ZW50SGFuZGxlci5GSUxFX0VSUk9SLAotICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuaHR0cEVycm9yRmlsZU5vdEZvdW5kKSArCi0gICAgICAgICAgICAgICAgICAgICIgIiArIGV4LmdldE1lc3NhZ2UoKSk7CisgICAgICAgICAgICBtSGFuZGxlci5lcnJvcihFdmVudEhhbmRsZXIuRklMRV9FUlJPUiwgZXJyU3RyaW5nKGV4KSk7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0gY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgIC8vIHJlYWRFeGNlcHRpb25XaXRoRmlsZU5vdEZvdW5kRXhjZXB0aW9uRnJvbVBhcmNlbCBpbiBEYXRhYmFzZVV0aWxzCiAgICAgICAgICAgICAvLyBjYW4gdGhyb3cgYSBzZXJpYWwgb2YgUnVudGltZUV4Y2VwdGlvbi4gQ2F0Y2ggdGhlbSBhbGwgaGVyZS4KLSAgICAgICAgICAgIG1IYW5kbGVyLmVycm9yKAotICAgICAgICAgICAgICAgICAgICBFdmVudEhhbmRsZXIuRklMRV9FUlJPUiwKLSAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmh0dHBFcnJvckZpbGVOb3RGb3VuZCkgKwotICAgICAgICAgICAgICAgICAgICAiICIgKyBleC5nZXRNZXNzYWdlKCkpOworICAgICAgICAgICAgbUhhbmRsZXIuZXJyb3IoRXZlbnRIYW5kbGVyLkZJTEVfRVJST1IsIGVyclN0cmluZyhleCkpOwogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiB0cnVlOwpAQCAtMTA1LDggKzEwMyw3IEBACiAgICAgICAgIGlmIChtQ29udGVudFR5cGUgIT0gbnVsbCkgewogICAgICAgICAgICAgaGVhZGVycy5zZXRDb250ZW50VHlwZSgidGV4dC9odG1sIik7CiAgICAgICAgIH0KLSAgICAgICAgLy8gb3ZlcnJpZGUgdGhlIGNhY2hlLWNvbnRyb2wgaGVhZGVyIHNldCBieSBTdHJlYW1Mb2FkZXIgYXMgY29udGVudCBjYW4KLSAgICAgICAgLy8gY2hhbmdlLCB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vciBDT01QQVJBVE9SID0gbmV3IENvb2tpZUNvbXBhcmF0b3IoKTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNsYXNzIENvb2tpZUNvbXBhcmF0b3IgaW1wbGVtZW50cyBDb21wYXJhdG9yPENvb2tpZT4geworICAgICAgICBwdWJsaWMgaW50IGNvbXBhcmUoQ29va2llIGNvb2tpZTEsIENvb2tpZSBjb29raWUyKSB7CisgICAgICAgICAgICAvLyBBY2NvcmRpbmcgdG8gUkZDIDIxMDksIG11bHRpcGxlIGNvb2tpZXMgYXJlIG9yZGVyZWQgaW4gYSB3YXkgc3VjaAorICAgICAgICAgICAgLy8gdGhhdCB0aG9zZSB3aXRoIG1vcmUgc3BlY2lmaWMgUGF0aCBhdHRyaWJ1dGVzIHByZWNlZGUgdGhvc2Ugd2l0aAorICAgICAgICAgICAgLy8gbGVzcyBzcGVjaWZpYy4gT3JkZXJpbmcgd2l0aCByZXNwZWN0IHRvIG90aGVyIGF0dHJpYnV0ZXMgKGUuZy4sCisgICAgICAgICAgICAvLyBEb21haW4pIGlzIHVuc3BlY2lmaWVkLgorICAgICAgICAgICAgLy8gQXMgU2V0IGlzIG5vdCBtb2RpZmllZCBpZiB0aGUgdHdvIG9iamVjdHMgYXJlIHNhbWUsIHdlIGRvIHdhbnQgdG8KKyAgICAgICAgICAgIC8vIGFzc2lnbiBkaWZmZXJlbnQgdmFsdWUgZm9yIGVhY2ggY29va2llLgorICAgICAgICAgICAgaW50IGRpZmYgPSBjb29raWUyLnBhdGgubGVuZ3RoKCkgLSBjb29raWUxLnBhdGgubGVuZ3RoKCk7CisgICAgICAgICAgICBpZiAoZGlmZiA9PSAwKSB7CisgICAgICAgICAgICAgICAgZGlmZiA9IGNvb2tpZTIuZG9tYWluLmxlbmd0aCgpIC0gY29va2llMS5kb21haW4ubGVuZ3RoKCk7CisgICAgICAgICAgICAgICAgaWYgKGRpZmYgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBkaWZmID0gY29va2llMi5uYW1lLmhhc2hDb2RlKCkgLSBjb29raWUxLm5hbWUuaGFzaENvZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRpZmYgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HVEFHLCAiRm91bmQgdHdvIGNvb2tpZXMgd2l0aCB0aGUgc2FtZSB2YWx1ZS4iICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNvb2tpZTE9IiArIGNvb2tpZTEgKyAiICwgY29va2llMj0iICsgY29va2llMik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZGlmZjsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHByaXZhdGUgQ29va2llTWFuYWdlcigpIHsKICAgICB9CiAKQEAgLTI2Miw3ICsyOTAsNyBAQAogICAgICAgICBpZiAoIW1BY2NlcHRDb29raWUgfHwgdXJpID09IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuQ09PS0lFX01BTkFHRVIpIHsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgInNldENvb2tpZTogdXJpOiAiICsgdXJpICsgIiB2YWx1ZTogIiArIHZhbHVlKTsKICAgICAgICAgfQogCkBAIC00MDEsOCArNDI5LDggQEAKICAgICAgICAgbG9uZyBub3cgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKICAgICAgICAgYm9vbGVhbiBzZWN1cmUgPSBIVFRQUy5lcXVhbHModXJpLm1TY2hlbWUpOwogICAgICAgICBJdGVyYXRvcjxDb29raWU+IGl0ZXIgPSBjb29raWVMaXN0Lml0ZXJhdG9yKCk7Ci0gICAgICAgIFN0cmluZ0J1aWxkZXIgcmV0ID0gbmV3IFN0cmluZ0J1aWxkZXIoMjU2KTsKIAorICAgICAgICBTb3J0ZWRTZXQ8Q29va2llPiBjb29raWVTZXQgPSBuZXcgVHJlZVNldDxDb29raWU+KENPTVBBUkFUT1IpOwogICAgICAgICB3aGlsZSAoaXRlci5oYXNOZXh0KCkpIHsKICAgICAgICAgICAgIENvb2tpZSBjb29raWUgPSBpdGVyLm5leHQoKTsKICAgICAgICAgICAgIGlmIChjb29raWUuZG9tYWluTWF0Y2goaG9zdEFuZFBhdGhbMF0pICYmCkBAIC00MTMsMjYgKzQ0MSwzMyBAQAogICAgICAgICAgICAgICAgICAgICAmJiAoIWNvb2tpZS5zZWN1cmUgfHwgc2VjdXJlKQogICAgICAgICAgICAgICAgICAgICAmJiBjb29raWUubW9kZSAhPSBDb29raWUuTU9ERV9ERUxFVEVEKSB7CiAgICAgICAgICAgICAgICAgY29va2llLmxhc3RBY2Vzc1RpbWUgPSBub3c7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmV0Lmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICByZXQuYXBwZW5kKFNFTUlDT0xPTik7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGFjY29yZGluZyB0byBSQzIxMDksIFNFTUlDT0xPTiBpcyBvZmZpY2Ugc2VwYXJhdG9yLAotICAgICAgICAgICAgICAgICAgICAvLyBidXQgd2hlbiBsb2cgaW4geWFob28uY29tLCBpdCBuZWVkcyBXSElURV9TUEFDRSB0b28uCi0gICAgICAgICAgICAgICAgICAgIHJldC5hcHBlbmQoV0hJVEVfU1BBQ0UpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHJldC5hcHBlbmQoY29va2llLm5hbWUpOwotICAgICAgICAgICAgICAgIHJldC5hcHBlbmQoRVFVQUwpOwotICAgICAgICAgICAgICAgIHJldC5hcHBlbmQoY29va2llLnZhbHVlKTsKKyAgICAgICAgICAgICAgICBjb29raWVTZXQuYWRkKGNvb2tpZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKworICAgICAgICBTdHJpbmdCdWlsZGVyIHJldCA9IG5ldyBTdHJpbmdCdWlsZGVyKDI1Nik7CisgICAgICAgIEl0ZXJhdG9yPENvb2tpZT4gc2V0SXRlciA9IGNvb2tpZVNldC5pdGVyYXRvcigpOworICAgICAgICB3aGlsZSAoc2V0SXRlci5oYXNOZXh0KCkpIHsKKyAgICAgICAgICAgIENvb2tpZSBjb29raWUgPSBzZXRJdGVyLm5leHQoKTsKKyAgICAgICAgICAgIGlmIChyZXQubGVuZ3RoKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgcmV0LmFwcGVuZChTRU1JQ09MT04pOworICAgICAgICAgICAgICAgIC8vIGFjY29yZGluZyB0byBSQzIxMDksIFNFTUlDT0xPTiBpcyBvZmZpY2lhbCBzZXBhcmF0b3IsCisgICAgICAgICAgICAgICAgLy8gYnV0IHdoZW4gbG9nIGluIHlhaG9vLmNvbSwgaXQgbmVlZHMgV0hJVEVfU1BBQ0UgdG9vLgorICAgICAgICAgICAgICAgIHJldC5hcHBlbmQoV0hJVEVfU1BBQ0UpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXQuYXBwZW5kKGNvb2tpZS5uYW1lKTsKKyAgICAgICAgICAgIHJldC5hcHBlbmQoRVFVQUwpOworICAgICAgICAgICAgcmV0LmFwcGVuZChjb29raWUudmFsdWUpOworICAgICAgICB9CisKICAgICAgICAgaWYgKHJldC5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuQ09PS0lFX01BTkFHRVIpIHsKICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJnZXRDb29raWU6IHVyaTogIiArIHVyaSArICIgdmFsdWU6ICIgKyByZXQpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIHJldC50b1N0cmluZygpOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKFdlYlZpZXcuTE9HVl9FTkFCTEVEKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5DT09LSUVfTUFOQUdFUikgewogICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgImdldENvb2tpZTogdXJpOiAiICsgdXJpCiAgICAgICAgICAgICAgICAgICAgICAgICArICIgQnV0IGNhbid0IGZpbmQgY29va2llLiIpOwogICAgICAgICAgICAgfQpAQCAtNTg4LDcgKzYyMyw3IEBACiAgICAgICAgICAgICBJdGVyYXRvcjxBcnJheUxpc3Q8Q29va2llPj4gbGlzdEl0ZXIgPSBjb29raWVMaXN0cy5pdGVyYXRvcigpOwogICAgICAgICAgICAgd2hpbGUgKGxpc3RJdGVyLmhhc05leHQoKSAmJiBjb3VudCA8IE1BWF9SQU1fQ09PS0lFU19DT1VOVCkgewogICAgICAgICAgICAgICAgIEFycmF5TGlzdDxDb29raWU+IGxpc3QgPSBsaXN0SXRlci5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgaWYgKFdlYlZpZXcuREVCVUcpIHsKKyAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5DT09LSUVfTUFOQUdFUikgewogICAgICAgICAgICAgICAgICAgICBJdGVyYXRvcjxDb29raWU+IGl0ZXIgPSBsaXN0Lml0ZXJhdG9yKCk7CiAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChpdGVyLmhhc05leHQoKSAmJiBjb3VudCA8IE1BWF9SQU1fQ09PS0lFU19DT1VOVCkgewogICAgICAgICAgICAgICAgICAgICAgICAgQ29va2llIGNvb2tpZSA9IGl0ZXIubmV4dCgpOwpAQCAtNjA4LDcgKzY0Myw3IEBACiAKICAgICAgICAgQXJyYXlMaXN0PENvb2tpZT4gcmV0bGlzdCA9IG5ldyBBcnJheUxpc3Q8Q29va2llPigpOwogICAgICAgICBpZiAobWFwU2l6ZSA+PSBNQVhfUkFNX0RPTUFJTl9DT1VOVCB8fCBjb3VudCA+PSBNQVhfUkFNX0NPT0tJRVNfQ09VTlQpIHsKLSAgICAgICAgICAgIGlmIChXZWJWaWV3LkRFQlVHKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5DT09LSUVfTUFOQUdFUikgewogICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgY291bnQgKyAiIGNvb2tpZXMgdXNlZCAiICsgYnl0ZUNvdW50CiAgICAgICAgICAgICAgICAgICAgICAgICArICIgYnl0ZXMgd2l0aCAiICsgbWFwU2l6ZSArICIgZG9tYWlucyIpOwogICAgICAgICAgICAgfQpAQCAtNjE2LDcgKzY1MSw3IEBACiAgICAgICAgICAgICBpbnQgdG9HbyA9IG1hcFNpemUgLyAxMCArIDE7CiAgICAgICAgICAgICB3aGlsZSAodG9Hby0tID4gMCl7CiAgICAgICAgICAgICAgICAgU3RyaW5nIGRvbWFpbiA9IGRvbWFpbnNbdG9Hb10udG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5DT09LSUVfTUFOQUdFUikgewogICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkZWxldGUgZG9tYWluOiAiICsgZG9tYWluCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGZyb20gUkFNIGNhY2hlIik7CiAgICAgICAgICAgICAgICAgfQpAQCAtNzk4LDIyICs4MzMsMjQgQEAKIAogICAgICAgICAgICAgICAgIC8vICJzZWN1cmUiIGlzIGEga25vd24gYXR0cmlidXRlIGRvZXNuJ3QgdXNlICI9IjsKICAgICAgICAgICAgICAgICAvLyB3aGlsZSBzaXRlcyBsaWtlIGxpdmUuY29tIHVzZXMgInNlY3VyZT0iCi0gICAgICAgICAgICAgICAgaWYgKGxlbmd0aCAtIGluZGV4ID4gU0VDVVJFX0xFTkdUSAorICAgICAgICAgICAgICAgIGlmIChsZW5ndGggLSBpbmRleCA+PSBTRUNVUkVfTEVOR1RICiAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjb29raWVTdHJpbmcuc3Vic3RyaW5nKGluZGV4LCBpbmRleCArIFNFQ1VSRV9MRU5HVEgpLgogICAgICAgICAgICAgICAgICAgICAgICAgZXF1YWxzSWdub3JlQ2FzZShTRUNVUkUpKSB7CiAgICAgICAgICAgICAgICAgICAgIGluZGV4ICs9IFNFQ1VSRV9MRU5HVEg7CiAgICAgICAgICAgICAgICAgICAgIGNvb2tpZS5zZWN1cmUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT0gbGVuZ3RoKSBicmVhazsKICAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZVN0cmluZy5jaGFyQXQoaW5kZXgpID09IEVRVUFMKSBpbmRleCsrOwogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAvLyAiaHR0cG9ubHkiIGlzIGEga25vd24gYXR0cmlidXRlIGRvZXNuJ3QgdXNlICI9IjsKICAgICAgICAgICAgICAgICAvLyB3aGlsZSBzaXRlcyBsaWtlIGxpdmUuY29tIHVzZXMgImh0dHBvbmx5PSIKLSAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIC0gaW5kZXggPiBIVFRQX09OTFlfTEVOR1RICisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCAtIGluZGV4ID49IEhUVFBfT05MWV9MRU5HVEgKICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNvb2tpZVN0cmluZy5zdWJzdHJpbmcoaW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggKyBIVFRQX09OTFlfTEVOR1RIKS4KICAgICAgICAgICAgICAgICAgICAgICAgIGVxdWFsc0lnbm9yZUNhc2UoSFRUUF9PTkxZKSkgewogICAgICAgICAgICAgICAgICAgICBpbmRleCArPSBIVFRQX09OTFlfTEVOR1RIOworICAgICAgICAgICAgICAgICA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ICAgICAvLyBGYWlsIHdpdGggYSBiYWQgdXJsIGVycm9yIGlmIHRoZSBkZWNvZGUgZmFpbHMuCi0gICAgICAgICAgICBtTGlzdGVuZXIuZXJyb3IoRXZlbnRIYW5kbGVyLkVSUk9SX0JBRF9VUkwsCi0gICAgICAgICAgICAgICAgICAgIG1MaXN0ZW5lci5nZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmh0dHBFcnJvckJhZFVybCkpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KICAgICAgICAgaWYgKFVSTFV0aWwuaXNOZXR3b3JrVXJsKHVybCkpewogICAgICAgICAgICAgaWYgKG1TZXR0aW5ncy5nZXRCbG9ja05ldHdvcmtMb2FkcygpKSB7CiAgICAgICAgICAgICAgICAgbUxpc3RlbmVyLmVycm9yKEV2ZW50SGFuZGxlci5FUlJPUl9CQURfVVJMLApAQCAtMTE1LDEyICsxMDIsMTkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuaHR0cEVycm9yQmFkVXJsKSk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gTWFrZSBzdXJlIGl0IGlzIGNvcnJlY3RseSBVUkwgZW5jb2RlZCBiZWZvcmUgc2VuZGluZyB0aGUgcmVxdWVzdAorICAgICAgICAgICAgaWYgKCFVUkxVdGlsLnZlcmlmeVVSTEVuY29kaW5nKHVybCkpIHsKKyAgICAgICAgICAgICAgICBtTGlzdGVuZXIuZXJyb3IoRXZlbnRIYW5kbGVyLkVSUk9SX0JBRF9VUkwsCisgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIuZ2V0Q29udGV4dCgpLmdldFN0cmluZygKKyAgICAgICAgICAg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ZWF0ZURhdGFiYXNlKGZpbGUsIG51bGwpOwotICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIkNvdWxkIG5vdCBvcGVuIEdlYXJzIHBlcm1pc3Npb24gREI6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gSnVzdCBiYWlsIG91dC4KLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICAvLyBXZSBub3cgaGF2ZSBhIGRhdGFiYXNlIG9wZW4uIEJlZ2luIGEgdHJhbnNhY3Rpb24uCi0gICAgICAgIHBlcm1pc3Npb25zLmJlZ2luVHJhbnNhY3Rpb24oKTsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGlmIChuZWVkVG9DcmVhdGVUYWJsZXMpIHsKLSAgICAgICAgICAgICAgICAvLyBDcmVhdGUgdGhlIHRhYmxlcy4gTm90ZSB0aGF0IHRoaXMgY3JlYXRlcyB0aGUKLSAgICAgICAgICAgICAgICAvLyBHZWFycyB0YWJsZXMgZm9yIHRoZSBwZXJtaXNzaW9ucyBEQiBzY2hlbWEgdmVyc2lvbiAyLgotICAgICAgICAgICAgICAgIC8vIFRoZSBHZWFycyBzY2hlbWEgdXBncmFkZSBwcm9jZXNzIHdpbGwgdGFrZSBjYXJlIG9mIHRoZSByZXN0LgotICAgICAgICAgICAgICAgIC8vIEZpcnN0LCB0aGUgc3RvcmFnZSBhY2Nlc3MgdGFibGUuCi0gICAgICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0YXRlbWVudCA9IHBlcm1pc3Npb25zLmNvbXBpbGVTdGF0ZW1lbnQoCi0gICAgICAgICAgICAgICAgICAgICAgICAiQ1JFQVRFIFRBQkxFIElGIE5PVCBFWElTVFMgIgotICAgICAgICAgICAgICAgICAgICAgICAgKyBHRUFSU19TVE9SQUdFX0FDQ0VTU19UQUJMRV9OQU1FCi0gICAgICAgICAgICAgICAgICAgICAgICArICIgKE5hbWUgVEVYVCBVTklRVUUsIFZhbHVlKSIpOwotICAgICAgICAgICAgICAgIHN0YXRlbWVudC5leGVjdXRlKCk7Ci0gICAgICAgICAgICAgICAgLy8gTmV4dCB0aGUgbG9jYXRpb24gYWNjZXNzIHRhYmxlLgotICAgICAgICAgICAgICAgIHN0YXRlbWVudCA9IHBlcm1pc3Npb25zLmNvbXBpbGVTdGF0ZW1lbnQoCi0gICAgICAgICAgICAgICAgICAgICAgICAiQ1JFQVRFIFRBQkxFIElGIE5PVCBFWElTVFMgIgotICAgICAgICAgICAgICAgICAgICAgICAgKyBHRUFSU19MT0NBVElPTl9BQ0NFU1NfVEFCTEVfTkFNRQotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIChOYW1lIFRFWFQgVU5JUVVFLCBWYWx1ZSkiKTsKLSAgICAgICAgICAgICAgICBzdGF0ZW1lbnQuZXhlY3V0ZSgpOwotICAgICAgICAgICAgICAgIC8vIEZpbmFsbHksIHRoZSBzY2hlbWEgdmVyc2lvbiB0YWJsZS4KLSAgICAgICAgICAgICAgICBzdGF0ZW1lbnQgPSBwZXJtaXNzaW9ucy5jb21waWxlU3RhdGVtZW50KAotICAgICAgICAgICAgICAgICAgICAgICAgIkNSRUFURSBUQUJMRSBJRiBOT1QgRVhJU1RTICIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgR0VBUlNfU0NIRU1BX1ZFUlNJT05fVEFCTEVfTkFNRQotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIChOYW1lIFRFWFQgVU5JUVVFLCBWYWx1ZSkiKTsKLSAgICAgICAgICAgICAgICBzdGF0ZW1lbnQuZXhlY3V0ZSgpOwotICAgICAgICAgICAgICAgIC8vIFNldCB0aGUgc2NoZW1hIHZlcnNpb24gdG8gMi4KLSAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHNjaGVtYSA9IG5ldyBDb250ZW50VmFsdWVzKCk7Ci0gICAgICAgICAgICAgICAgc2NoZW1hLnB1dCgiTmFtZSIsICJWZXJzaW9uIik7Ci0gICAgICAgICAgICAgICAgc2NoZW1hLnB1dCgiVmFsdWUiLCAyKTsKLSAgICAgICAgICAgICAgICBwZXJtaXNzaW9ucy5pbnNlcnQoR0VBUlNfU0NIRU1BX1ZFUlNJT05fVEFCTEVfTkFNRSwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjaGVtYSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChhZGRUb0dlYXJzTG9jYXRpb25UYWJsZSkgewotICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgcGVybWlzc2lvblZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB1cmwgOiBzR2VhcnNXaGl0ZUxpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgcGVybWlzc2lvblZhbHVlcy5wdXQoIk5hbWUiLCB1cmwpOwotICAgICAgICAgICAgICAgICAgICBwZXJtaXNzaW9uVmFsdWVzLnB1dCgiVmFsdWUiLCBHRUFSU19BTExPV19MT0NBVElPTl9BQ0NFU1MpOwotICAgICAgICAgICAgICAgICAgICBwZXJtaXNzaW9ucy5yZXBsYWNlKEdFQVJTX0xPQ0FUSU9OX0FDQ0VTU19UQUJMRV9OQU1FLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcm1pc3Npb25WYWx1ZXMpOwotICAgICAgICAgICAgICAgICAgICBwZXJtaXNzaW9uVmFsdWVzLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB1cmwgOiBzR2VhcnNXaGl0ZUxpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgcGVybWlzc2lvbnMuZGVsZXRlKEdFQVJTX0xPQ0FUSU9OX0FDQ0VTU19UQUJMRV9OQU1FLCAiTmFtZT0/IiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW10geyB1cmwgfSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gQ29tbWl0IHRoZSB0cmFuc2FjdGlvbi4KLSAgICAgICAgICAgIHBlcm1pc3Npb25zLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOwotICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIkNvdWxkIG5vdCBzZXQgdGhlIEdlYXJzIHBlcm1pc3Npb25zOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIHBlcm1pc3Npb25zLmVuZFRyYW5zYWN0aW9uKCk7Ci0gICAgICAgICAgICBwZXJtaXNzaW9ucy5jbG9zZSgpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgY2xhc3MgU2VjdXJlU2V0dGluZ3NPYnNlcnZlciBleHRlbmRzIENvbnRlbnRPYnNlcnZlciB7Ci0gICAgICAgIFNlY3VyZVNldHRpbmdzT2JzZXJ2ZXIoKSB7Ci0gICAgICAgICAgICBzdXBlcihuZXcgSGFuZGxlcigpKTsKLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgb2JzZXJ2ZSgpIHsKLSAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlciByZXNvbHZlciA9IG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpOwotICAgICAgICAgICAgcmVzb2x2ZXIucmVnaXN0ZXJDb250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uZGl0aW9uIG1VcGRhdGVkQ29uZGl0aW9uID0gbUxvY2submV3Q29uZGl0aW9uKCk7CisKKyAgICAvLyBNZXNzYWdlIGlkcworICAgIHN0YXRpYyBmaW5hbCBpbnQgR0VUX09SSUdJTlMgPSAwOworICAgIHN0YXRpYyBmaW5hbCBpbnQgR0VUX0FMTE9XRUQgPSAxOworICAgIHN0YXRpYyBmaW5hbCBpbnQgQ0xFQVIgPSAyOworICAgIHN0YXRpYyBmaW5hbCBpbnQgQUxMT1cgPSAzOworICAgIHN0YXRpYyBmaW5hbCBpbnQgQ0xFQVJfQUxMID0gNDsKKworICAgIC8qKgorICAgICAqIEdldHMgdGhlIHNpbmdsZXRvbiBpbnN0YW5jZSBvZiB0aGUgY2xhc3MuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBHZW9sb2NhdGlvblBlcm1pc3Npb25zIGdldEluc3RhbmNlKCkgeworICAgICAgaWYgKHNJbnN0YW5jZSA9PSBudWxsKSB7CisgICAgICAgICAgc0luc3RhbmNlID0gbmV3IEdlb2xvY2F0aW9uUGVybWlzc2lvbnMoKTsKKyAgICAgIH0KKyAgICAgIHJldHVybiBzSW5zdGFuY2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ3JlYXRlcyB0aGUgbWVzc2FnZSBoYW5kbGVyLiBNdXN0IGJlIGNhbGxlZCBvbiB0aGUgV2ViS2l0IHRocmVhZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBjcmVhdGVIYW5kbGVyKCkgeworICAgICAgICBtTG9jay5sb2NrKCk7CisgICAgICAgIGlmIChtSGFuZGxlciA9PSBudWxsKSB7CisgICAgICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gUnVucyBvbiB0aGUgV2ViS2l0IHRocmVhZC4KKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBHRVRfT1JJR0lOUzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRPcmlnaW5zSW1wbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBHRVRfQUxMT1dFRDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRBbGxvd2VkSW1wbCgoU3RyaW5nKSBtc2cub2JqKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ0xFQVI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlQ2xlYXIoKFN0cmluZykgbXNnLm9iaik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEFMTE9XOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUFsbG93KChTdHJpbmcpIG1zZy5vYmopOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTEVBUl9BTEw6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlQ2xlYXJBbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGlmIChtT3JpZ2luc1RvQ2xlYXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIG9yaWdpbiA6IG1PcmlnaW5zVG9DbGVhcikgeworICAgICAgICAgICAgICAgICAgICBuYXRpdmVDbGVhcihvcmlnaW4pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtT3JpZ2luc1RvQWxsb3cgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIG9yaWdpbiA6IG1PcmlnaW5zVG9BbGxvdykgeworICAgICAgICAgICAgICAgICAgICBuYXRpdmVBbGxvdyhvcmlnaW4pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtTG9jay51bmxvY2soKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBVdGlsaXR5IGZ1bmN0aW9uIHRvIHNlbmQgYSBtZXNzYWdlIHRvIG91ciBoYW5kbGVyLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBwb3N0TWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICBhc3NlcnQobUhhbmRsZXIgIT0gbnVsbCk7CisgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0cyB0aGUgc2V0IG9mIG9yaWdpbnMgZm9yIHdoaWNoIEdlb2xvY2F0aW9uIHBlcm1pc3Npb25zIGFyZSBzdG9yZWQuCisgICAgICogTm90ZSB0aGF0IHdlIHJlcHJlc2VudCB0aGUgb3JpZ2lucyBhcyBzdHJpbmdzLiBUaGVzZSBhcmUgY3JlYXRlZCB1c2luZworICAgICAqIFdlYkNvcmU6OlNlY3VyaXR5T3JpZ2luOjp0b1N0cmluZygpLiBBcyBsb25nIGFzIGFsbCAnSFRNTCA1IG1vZHVsZXMnCisgICAgICogKERhdGFiYXNlLCBHZW9sb2NhdGlvbiBldGMpIGRvIHNvLCBpdCdzIHNhZmUgdG8gbWF0Y2ggdXAgb3JpZ2lucyBmb3IgdGhlCisgICAgICogcHVycG9zZXMgb2YgZGlzcGxheWluZyBVSS4KKyAgICAgKi8KKyAgICBwdWJsaWMgU2V0IGdldE9yaWdpbnMoKSB7CisgICAgICAgIC8vIENhbGxlZCBvbiB0aGUgVUkgdGhyZWFkLgorICAgICAgICBTZXQgb3JpZ2lucyA9IG51bGw7CisgICAgICAgIG1Mb2NrLmxvY2soKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1VcGRhdGVkID0gZmFsc2U7CisgICAgICAgICAgICBwb3N0TWVzc2FnZShNZXNzYWdlLm9idGFpbihudWxsLCBHRVRfT1JJR0lOUykpOworICAgICAgICAgICAgd2hpbGUgKCFtVXBkYXRlZCkgeworICAgICAgICAgICAgICAgIG1VcGRhdGVkQ29uZGl0aW9uLmF3YWl0KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBvcmlnaW5zID0gbU9yaWdpbnM7CisgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIkV4Y2VwdGlvbiB3aGlsZSB3YWl0aW5nIGZvciB1cGRhdGUiLCBlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIG1Mb2NrLnVubG9jaygpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBvcmlnaW5zOworICAgIH0KKworICAgIC8qKgorICAgICAqIEhlbHBlciBtZXRob2QgdG8gZ2V0IHRoZSBzZXQgb2Ygb3JpZ2lucy4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgZ2V0T3JpZ2luc0ltcGwoKSB7CisgICAgICAgIC8vIENhbGxlZCBvbiB0aGUgV2ViS2l0IHRocmVhZC4KKyAgICAgICAgbUxvY2subG9jaygpOworICAgICAgICBtT3JpZ2lucyA9IG5hdGl2ZUdldE9yaWdpbnMoKTsKKyAgICAgICAgbVVwZGF0ZWQgPSB0cnVlOworICAgICAgICBtVXBkYXRlZENvbmRpdGlvbi5zaWduYWwoKTsKKyAgICAgICAgbUxvY2sudW5sb2NrKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0cyB0aGUgcGVybWlzc2lvbiBzdGF0ZSBmb3IgdGhlIHNwZWNpZmllZCBvcmlnaW4uCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gZ2V0QWxsb3dlZChTdHJpbmcgb3JpZ2luKSB7CisgICAgICAgIC8vIENhbGxlZCBvbiB0aGUgVUkgdGhyZWFkLgorICAgICAgICBib29sZWFuIGFsbG93ZWQgPSBmYWxzZTsKKyAgICAgICAgbUxvY2subG9jaygpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbVVwZGF0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHBvc3RNZXNzYWdlKE1lc3NhZ2Uub2J0YWluKG51bGwsIEdFVF9BTExPV0VELCBvcmlnaW4pKTsKKyAgICAgICAgICAgIHdoaWxlICghbVVwZGF0ZWQpIHsKKyAgICAgICAgICAgICAgICBtVXBkYXRlZENvbmRpdGlvbi5hd2FpdCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYWxsb3dlZCA9IG1BbGxvd2VkOworICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJFeGNlcHRpb24gd2hpbGUgd2FpdGluZyBmb3IgdXBkYXRlIiwgZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTG9jay51bmxvY2soKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYWxsb3dlZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBIZWxwZXIgbWV0aG9kIHRvIGdldCB0aGUgcGVybWlzc2lvbiBzdGF0ZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgZ2V0QWxsb3dlZEltcGwoU3RyaW5nIG9yaWdpbikgeworICAgICAgICAvLyBDYWxsZWQgb24gdGhlIFdlYktpdCB0aHJlYWQuCisgICAgICAgIG1Mb2NrLmxvY2soKTsKKyAgICAgICAgbUFsbG93ZWQgPSBuYXRpdmVHZXRBbGxvd2VkKG9yaWdpbik7CisgICAgICAgIG1VcGRhdGVkID0gdHJ1ZTsKKyAgICAgICAgbVVwZGF0ZWRDb25kaXRpb24uc2lnbmFsKCk7CisgICAgICAgIG1Mb2NrLnVubG9jaygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIENsZWFycyB0aGUgcGVybWlzc2lvbiBzdGF0ZSBmb3IgdGhlIHNwZWNpZmllZCBvcmlnaW4uIFRoaXMgbWV0aG9kIG1heSBiZQorICAgICAqIGNhbGxlZCBiZWZvcmUgdGhlIFdlYktpdCB0aHJlYWQgaGFzIGludGlhbGl6ZWQgdGhlIG1lc3NhZ2UgaGFuZGxlci4KKyAgICAgKiBNZXNzYWdlcyB3aWxsIGJlIHF1ZXVlZCB1bnRpbCB0aGlzIHRpbWUuCisgICAgICovCisgICAgcHVibGljIHZvaWQgY2xlYXIoU3RyaW5nIG9yaWdpbikgeworICAgICAgICAvLyBDYWxsZWQgb24gdGhlIFVJIHRocmVhZC4KKyAgICAgICAgbUxvY2subG9jaygpOworICAgICAgICBpZiAobUhhbmRsZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKG1PcmlnaW5zVG9DbGVhciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbU9yaWdpbnNUb0NsZWFyID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU9yaWdpbnNUb0NsZWFyLmFkZChvcmlnaW4pOworICAgICAgICAgICAgaWYgKG1PcmlnaW5zVG9BbGxvdyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbU9yaWdpbnNUb0FsbG93LnJlbW92ZShvcmlnaW4pOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcG9zdE1lc3NhZ2UoTWVzc2FnZS5vYnRhaW4obnVsbCwgQ0xFQVIsIG9yaWdpbikpOworICAgICAgICB9CisgICAgICAgIG1Mb2NrLnVubG9jaygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFsbG93cyB0aGUgc3BlY2lmaWVkIG9yaWdpbi4gVGhpcyBtZXRob2QgbWF5IGJlIGNhbGxlZCBiZWZvcmUgdGhlIFdlYktpdAorICAgICAqIHRocmVhZCBoYXMgaW50aWFsaXplZCB0aGUgbWVzc2FnZSBoYW5kbGVyLiBNZXNzYWdlcyB3aWxsIGJlIHF1ZXVlZCB1bnRpbAorICAgICAqIHRoaXMgdGltZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBhbGxvdyhTdHJpbmcgb3JpZ2luKSB7CisgICAgICAgIC8vIENhbGxlZCBvbiB0aGUgVUkgdGhyZWFkLgorICAgICAgICBtTG9jay5sb2NrKCk7CisgICAgICAgIGlmIChtSGFuZGxlciA9PSBudWxsKSB7CisgICAgICAgICAgICBpZiAobU9yaWdpbnNUb0FsbG93ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtT3JpZ2luc1RvQWxsb3cgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtT3JpZ2luc1RvQWxsb3cuYWRkKG9yaWdpbik7CisgICAgICAgICAgICBpZiAobU9yaWdpbnNUb0NsZWFyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtT3JpZ2luc1RvQ2xlYXIucmVtb3ZlKG9yaWdpbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBwb3N0TWVzc2FnZShNZXNzYWdlLm9idGFpbihudWxsLCBBTExPVywgb3JpZ2luKSk7CisgICAgICAgIH0KKyAgICAgICAgbUxvY2sudW5sb2NrKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2xlYXJzIHRoZSBwZXJtaXNzaW9uIHN0YXRlIGZvciBhbGwgb3JpZ2lucy4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBjbGVhckFsbCgpIHsKKyAgICAgICAgLy8gQ2FsbGVkIG9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lIHByb3ZpZGVyIGlzIGRpc2FibGVkLgorICAgICAqIEBwYXJhbSBwcm92aWRlciBUaGUgbmFtZSBvZiB0aGUgbG9jYXRpb24gcHJvdmlkZXIgdGhhdCBpcyBub3cgZGlzYWJsZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25Qcm92aWRlckRpc2FibGVkKFN0cmluZyBwcm92aWRlck5hbWUpIHsKKyAgICAgICAgaWYgKExvY2F0aW9uTWFuYWdlci5ORVRXT1JLX1BST1ZJREVSLmVxdWFscyhwcm92aWRlck5hbWUpKSB7CisgICAgICAgICAgICBtSXNOZXR3b3JrUHJvdmlkZXJBdmFpbGFibGUgPSBmYWxzZTsKKyAgICAgICAgfSBlbHNlIGlmIChMb2NhdGlvbk1hbmFnZXIuR1BTX1BST1ZJREVSLmVxdWFscyhwcm92aWRlck5hbWUpKSB7CisgICAgICAgICAgICBtSXNHcHNQcm92aWRlckF2YWlsYWJsZSA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIG1heWJlUmVwb3J0RXJyb3IoIlRoZSBsYXN0IGxvY2F0aW9uIHByb3ZpZGVyIHdhcyBkaXNhYmxlZCIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlZ2lzdGVycyB0aGlzIG9iamVjdCB3aXRoIHRoZSBsb2NhdGlvbiBzZXJ2aWNlLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCByZWdpc3RlckZvckxvY2F0aW9uVXBkYXRlcygpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1Mb2NhdGlvbk1hbmFnZXIucmVxdWVzdExvY2F0aW9uVXBkYXRlcyhMb2NhdGlvbk1hbmFnZXIuTkVUV09SS19QUk9WSURFUiwgMCwgMCwgdGhpcyk7CisgICAgICAgICAgICBtSXNOZXR3b3JrUHJvdmlkZXJBdmFpbGFibGUgPSB0cnVlOworICAgICAgICAgICAgaWYgKG1Jc0dwc0VuYWJsZWQpIHsKKyAgICAgICAgICAgICAgICBtTG9jYX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9TRVJWSUNFUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RSZWFkU2V0dGluZyk7CisKKyAgICAgICAgaWYgKGxhc3RSZWFkU2V0dGluZyA9PSBzZXR0aW5nKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBFZGl0b3IgZWRpdG9yID0gcHJlZmVyZW5jZXMuZWRpdCgpOworICAgICAgICBlZGl0b3IucHV0SW50KExBU1RfUkVBRF9VU0VfTE9DQVRJT05fRk9SX1NFUlZJQ0VTLCBzZXR0aW5nKTsKKyAgICAgICAgZWRpdG9yLmNvbW1pdCgpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBcHBsaWVzIHRoZSBzdXBwbGllZCBzZXR0aW5nIHRvIHRoZSBHZW9sb2NhdGlvbiBwZXJtaXNzaW9ucy4KKyAgICAgKiBAcGFyYW0gc2V0dGluZyBUaGUgc2V0dGluZy4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgYXBwbHlTZXR0aW5nKGludCBzZXR0aW5nKSB7CisgICAgICAgIGZvciAoU3RyaW5nIG9yaWdpbiA6IHNHb29nbGVPcmlnaW5zKSB7CisgICAgICAgICAgICBpZiAoc2V0dGluZyA9PSBzU3lzdGVtU2V0dGluZ1RydWUpIHsKKyAgICAgICAgICAgICAgICBHZW9sb2NhdGlvblBlcm1pc3Npb25zLmdldEluc3RhbmNlKCkuYWxsb3cob3JpZ2luKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgR2VvbG9jYXRpb25QZXJtaXNzaW9ucy5nZXRJbnN0YW5jZSgpLmNsZWFyKG9yaWdpbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGNsYXNzIGltcGxlbWVudHMgYW4gb2JzZXJ2ZXIgdG8gbGl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VyKCkgeworICAgICAgICAgICAgcHVibGljIHZvaWQgb25QcmVwYXJlZChNZWRpYVBsYXllciBtcCkgeworICAgICAgICAgICAgICAgIHJlc3VtZVBsYXliYWNrKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgSFRNTDVWaWRlb1ZpZXcoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0KTsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgc2F2ZVBsYXliYWNrUG9zaXRpb24oKSB7CisgICAgICAgICAgICBpZiAoaXNQbGF5aW5nKCkpIHsKKyAgICAgICAgICAgICAgICBtUGxheWJhY2tQb3NpdGlvbiA9IGdldEN1cnJlbnRQb3NpdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgdm9pZCByZXN1bWVQbGF5YmFjaygpIHsKKyAgICAgICAgICAgIHNlZWtUbyhtUGxheWJhY2tQb3NpdGlvbik7CisgICAgICAgICAgICBzdGFydCgpOworICAgICAgICAgICAgc2V0T25QcmVwYXJlZExpc3RlbmVyKG51bGwpOworICAgICAgICB9CisKKyAgICAgICAgdm9pZCBwbGF5RW1iZWRkZWQoKSB7CisgICAgICAgICAgICAvLyBBdHRhY2ggdG8gdGhlIFdlYlZpZXcuCisgICAgICAgICAgICBtQ2hpbGRWaWV3LmF0dGFjaFZpZXdPblVJVGhyZWFkKG1FbWJlZGRlZExheW91dFBhcmFtcyk7CisgICAgICAgICAgICAvLyBNYWtlIHN1cmUgd2UncmUgdmlzaWJsZQorICAgICAgICAgICAgc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgLy8gU2V0IHRoZSBvblByZXBhcmVkIGxpc3RlbmVyIHNvIHdlIHN0YXJ0CisgICAgICAgICAgICAvLyBwbGF5aW5nIHdoZW4gdGhlIHZpZGVvIHZpZXcgaXMgcmVhdHRhY2hlZAorICAgICAgICAgICAgLy8gYW5kIGl0cyBzdXJmYWNlIGlzIHJlY3JlYXRlZC4KKyAgICAgICAgICAgIHNldE9uUHJlcGFyZWRMaXN0ZW5lcihtUHJlcGFyZWRMaXN0ZW5lcik7CisgICAgICAgICAgICBtSXNGdWxsc2NyZWVuID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHBsYXlGdWxsU2NyZWVuKCkgeworICAgICAgICAgICAgV2ViQ2hyb21lQ2xpZW50IGNsaWVudCA9IG1XZWJWaWV3LmdldFdlYkNocm9tZUNsaWVudCgpOworICAgICAgICAgICAgaWYgKGNsaWVudCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gU2F2ZSB0aGUgY3VycmVudCBsYXlvdXQgcGFyYW1zLgorICAgICAgICAgICAgbUVtYmVkZGVkTGF5b3V0UGFyYW1zID0KKyAgICAgICAgICAgICAgICAgICAgKEFic29sdXRlTGF5b3V0LkxheW91dFBhcmFtcykgZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICAvLyBEZXRhY2ggZnJvbSB0aGUgV2ViVmlldy4KKyAgICAgICAgICAgIG1DaGlsZFZpZXcucmVtb3ZlVmlld09uVUlUaHJlYWQoKTsKKyAgICAgICAgICAgIC8vIEF0dGFjaCB0byB0aGUgYnJvd3NlciBVSS4KKyAgICAgICAgICAgIGNsaWVudC5vblNob3dDdXN0b21WaWV3KHRoaXMsIG1DYWxsYmFjayk7CisgICAgICAgICAgICAvLyBTZXQgdGhlIG9uUHJlcGFyZWQgbGlzdGVuZXIgc28gd2Ugc3RhcnQKKyAgICAgICAgICAgIC8vIHBsYXlpbmcgd2hlbiBhZnRlciB0aGUgdmlkZW8gdmlldyBpcyByZWF0dGFjaGVkCisgICAgICAgICAgICAvLyBhbmQgaXRzIHN1cmZhY2UgaXMgcmVjcmVhdGVkLgorICAgICAgICAgICAgc2V0T25QcmVwYXJlZExpc3RlbmVyKG1QcmVwYXJlZExpc3RlbmVyKTsKKyAgICAgICAgICAgIG1Jc0Z1bGxzY3JlZW4gPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikgeworICAgICAgICAgICAgLy8gVE9ETzogaW1wbGVtZW50IHByb3Blcmx5IChpLmUuIGRldGVjdCBkb3VibGUgdGFwKQorICAgICAgICAgICAgaWYgKG1Jc0Z1bGxzY3JlZW4gfHwgIWlzUGxheWluZygpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHN1cGVyLm9uVG91Y2hFdmVudChldik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwbGF5RnVsbFNjcmVlbigpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25EZXRhY2hlZEZyb21XaW5kb3coKSB7CisgICAgICAgICAgICBzdXBlci5vbkRldGFjaGVkRnJvbVdpbmRvdygpOworICAgICAgICAgICAgc2F2ZVBsYXliYWNrUG9zaXRpb24oKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFByaXZhdGUgY29uc3RydWN0b3IuCisgICAgICogQHBhcmFtIGNvbnRleHQgaXMgdGhlIGFwcGxpY2F0aW9uIGNvbnRleHQuCisgICAgICovCisgICAgcHJpdmF0ZSBIVE1MNVZpZGVvVmlld1Byb3h5KFdlYlZpZXcgd2ViVmlldykgeworICAgICAgICAvLyBUaGlzIGhhbmRsZXIgaXMgZm9yIHRoZSBtYWluIChVSSkgdGhyZWFkLgorICAgICAgICBzdXBlcihMb29wZXIuZ2V0TWFpbkxvb3BlcigpKTsKKyAgICAgICAgLy8gU2F2ZSB0aGUgV2ViVmlldyBvYmplY3QuCisgICAgICAgIG1XZWJWaWV3ID0gd2ViVmlldzsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgIC8vIFRoaXMgZXhlY3V0ZXMgb24gdGhlIFVJIHRocmVhZC4KKyAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgeworICAgICAgICAgICAgY2FzZSBJTklUOgorICAgICAgICAgICAgICAgIC8vIENyZWF0ZSB0aGUgdmlkZW8gdmlldyBhbmQgc2V0IGEgZGVmYXVsdCBjb250cm9sbGVyLgorICAgICAgICAgICAgICAgIG1WaWRlb1ZpZXcgPSBuZXcgSFRNTDVWaWRlb1ZpZXcobVdlYlZpZXcuZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIG5lZWRlZCBiZWNhdXNlIG90aGVyd2lzZSB0aGVyZSB3aWxsIGJlIGEgYmxhY2sgc3F1YXJlCisgICAgICAgICAgICAgICAgLy8gc3R1Y2sgb24gdGhlIHNjcmVlbi4KKyAgICAgICAgICAgICAgICBtVmlkZW9WaWV3LnNldFdpbGxOb3REcmF3KGZhbHNlKTsKKyAgICAgICAgICAgICAgICBtVmlkZW9WaWV3LnNldE1lZGlhQ29udHJvbGxlcihuZXcgTWVkaWFDb250cm9sbGVyKG1XZWJWaWV3LmdldENvbnRleHQoKSkpOworICAgICAgICAgICAgICAgIG1DaGlsZFZpZXcubVZpZXcgPSBtVmlkZW9WaWV3OworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBQTEFZOgorICAgICAgICAgICAgICAgIGlmIChtVmlkZW9WaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBIYXNoTWFwPFN0cmluZywgT2JqZWN0PiBtYXAgPQorICAgICAgICAgICAgICAgICAgICAgICAgKEhhc2hNYXA8U3RyaW5nLCBPYmplY3Q+KSBtc2cub2JqOworICAgICAgICAgICA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IgcGFyc2luZyBIVFRQLWRhdGUuCkBAIC00NywxNCArNDgsMTYgQEAKICAgICAgKiBXZHksIEREIE1vbiBZWVlZIEhIOk1NOlNTCiAgICAgICogV2R5IE1vbiAoU1ApRCBISDpNTTpTUyBZWVlZCiAgICAgICogV2R5IE1vbiBERCBISDpNTTpTUyBZWVlZIEdNVAorICAgICAqIAorICAgICAqIEhIIGNhbiBiZSBIIGlmIHRoZSBmaXJzdCBkaWdpdCBpcyB6ZXJvLgogICAgICAqLwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBIVFRQX0RBVEVfUkZDX1JFR0VYUCA9CiAgICAgICAgICAgICAiKFswLTldezEsMn0pWy0gXShbQS1aYS16XXszLDN9KVstIF0oWzAtOV17Miw0fSlbIF0iCi0gICAgICAgICAgICArICIoWzAtOV1bMC05XTpbMC05XVswLTldOlswLTldWzAtOV0pIjsKKyAgICAgICAgICAgICsgIihbMC05XXsxLDJ9OlswLTldWzAtOV06WzAtOV1bMC05XSkiOwogCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIEhUVFBfREFURV9BTlNJQ19SRUdFWFAgPQogICAgICAgICAgICAgIlsgXShbQS1aYS16XXszLDN9KVsgXSsoWzAtOV17MSwyfSlbIF0iCi0gICAgICAgICAgICArICIoWzAtOV1bMC05XTpbMC05XVswLTldOlswLTldWzAtOV0pWyBdKFswLTldezIsNH0pIjsKKyAgICAgICAgICAgICsgIihbMC05XXsxLDJ9OlswLTldWzAtOV06WzAtOV1bMC05XSlbIF0oWzAtOV17Miw0fSkiOwogCiAgICAgLyoqCiAgICAgICogVGhlIGNvbXBpbGVkIHZlcnNpb24gb2YgdGhlIEhUVFAtZGF0ZSByZWd1bGFyIGV4cHJlc3Npb25zLgpAQCAtNjUsNiArNjgsMTIgQEAKICAgICAgICAgICAgIFBhdHRlcm4uY29tcGlsZShIVFRQX0RBVEVfQU5TSUNfUkVHRVhQKTsKIAogICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFRpbWVPZkRheSB7CisgICAgICAgIFRpbWVPZkRheShpbnQgaCwgaW50IG0sIGludCBzKSB7CisgICAgICAgICAgICB0aGlzLmhvdXIgPSBoOworICAgICAgICAgICAgdGhpcy5taW51dGUgPSBtOworICAgICAgICAgICAgdGhpcy5zZWNvbmQgPSBzOworICAgICAgICB9CisgICAgICAgIAogICAgICAgICBpbnQgaG91cjsKICAgICAgICAgaW50IG1pbnV0ZTsKICAgICAgICAgaW50IHNlY29uZDsKQEAgLTc2LDcgKzg1LDcgQEAKICAgICAgICAgaW50IGRhdGUgPSAxOwogICAgICAgICBpbnQgbW9udGggPSBDYWxlbmRhci5KQU5VQVJZOwogICAgICAgICBpbnQgeWVhciA9IDE5NzA7Ci0gICAgICAgIFRpbWVPZkRheSB0aW1lT2ZEYXkgPSBuZXcgVGltZU9mRGF5KCk7CisgICAgICAgIFRpbWVPZkRheSB0aW1lT2ZEYXk7CiAKICAgICAgICAgTWF0Y2hlciByZmNNYXRjaGVyID0gSFRUUF9EQVRFX1JGQ19QQVRURVJOLm1hdGNoZXIodGltZVN0cmluZyk7CiAgICAgICAgIGlmIChyZmNNYXRjaGVyLmZpbmQoKSkgewpAQCAtMTgzLDEzICsxOTIsMjIgQEAKICAgICB9CiAKICAgICBwcml2YXRlIHN0YXRpYyBUaW1lT2ZEYXkgZ2V0VGltZShTdHJpbmcgdGltZVN0cmluZykgewotICAgICAgICBUaW1lT2ZEYXkgdGltZSA9IG5ldyBUaW1lT2ZEYXkoKTsKLSAgICAgICAgdGltZS5ob3VyID0gKHRpbWVTdHJpbmcuY2hhckF0KDApIC0gJzAnKSAqIDEwCi0gICAgICAgICAgICAgICAgKyAodGltZVN0cmluZy5jaGFyQXQoMSkgLSAnMCcpOwotICAgICAgICB0aW1lLm1pbnV0ZSA9ICh0aW1lU3RyaW5nLmNoYXJBdCgzKSAtICcwJykgKiAxMAotICAgICAgICAgICAgICAgICsgKHRpbWVTdHJpbmcuY2hhckF0KDQpIC0gJzAnKTsKLSAgICAgICAgdGltZS5zZWNvbmQgPSAodGltZVN0cmluZy5jaGFyQXQoNikgLSAnMCcpICogMTAKLSAgICAgICAgICAgICAgICArICh0aW1lU3RyaW5nLmNoYXJBdCg3KSAtICcwJyk7Ci0gICAgICAgIHJldHVybiB0aW1lOworICAgICAgICAvLyBISCBtaWdodCBiZSBICisgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgaW50IGhvdXIgPSB0aW1lU3RyaW5nLmNoYXJBdChpKyspIC0gJzAnOworICAgICAgICBpZiAodGltZVN0cmluZy5jaGFyQXQoaSkgIT0gJzonKQorICAgICAgICAgICAgaG91ciA9IGhvdXIgKiAxMCArICh0aW1lU3RyaW5nLmNoYXJBdChpKyspIC0gJzAnKTsKKyAgICAgICAgLy8gU2tpcCAnOicKKyAgICAgICAgaSsrOworICAgICAgICAKKyAgICAgICAgaW50IG1pbnV0ZSA9ICh0aW1lU3RyaW5nLmNoYXJBdChpKyspIC0gJzAnKSAqIDEwCisgICAgICAgICAgICAgICAgICAgICsgKHRpbWVTdHJpbmcuY2hhckF0KGkrKykgLSAnMCcpOworICAgICAgICAvLyBTa2lwICc6JworICAgICAgICBpKys7CisgICAgICAgIAorICAgICAgICBpbnQgc2Vjb25kID0gKHRpbWVTdHJpbmcuY2hhckF0KGkrKykgLSAnMCcpICogMTAKKyAgICAgICAgICAgICAgICAgICsgKHRpbWVTdHJpbmcuY2hhckF0KGkrKykgLSAnMCcpOworCisgICAgICAgIHJldHVybiBuZXcgVGltZU9mRGF5KGhvdXIsIG1pbnV0ZSwgc2Vjb25kKTsgICAgICAgIAogICAgIH0KIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9KV2ViQ29yZUphdmFCcmlkZ2UuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9KV2ViQ29yZUphdmFCcmlkZ2UuamF2YQppbmRleCAxZGJkMDA3Li5kZGMyZGExIDEw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ckZpcmVkKCkgY2FuIHNldCBhIG5ldyB0aW1lcgorICAgICAgICBtSGFzSW5zdGFudFRpbWVyID0gZmFsc2U7CisgICAgICAgIHNoYXJlZFRpbWVyRmlyZWQoKTsKKyAgICAgICAgY2hlY2tlci5yZXNwb25zZUFsZXJ0KCJzaGFyZWRUaW1lciIpOworICAgIH0KKworICAgIC8qKgogICAgICAqIGhhbmRsZU1lc3NhZ2UKICAgICAgKiBAcGFyYW0gbXNnIFRoZSBkaXNwYXRjaGVkIG1lc3NhZ2UuCiAgICAgICoKQEAgLTYwLDE2ICs3OCwyMSBAQAogICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgewogICAgICAgICAgICAgY2FzZSBUSU1FUl9NRVNTQUdFOiB7Ci0gICAgICAgICAgICAgICAgUGVyZkNoZWNrZXIgY2hlY2tlciA9IG5ldyBQZXJmQ2hlY2tlcigpOwotICAgICAgICAgICAgICAgIC8vIGNsZWFyIHRoZSBmbGFnIHNvIHRoYXQgc2hhcmVkVGltZXJGaXJlZCgpIGNhbiBzZXQgYSBuZXcgdGltZXIKLSAgICAgICAgICAgICAgICBtSGFzSW5zdGFudFRpbWVyID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgc2hhcmVkVGltZXJGaXJlZCgpOwotICAgICAgICAgICAgICAgIGNoZWNrZXIucmVzcG9uc2VBbGVydCgic2hhcmVkVGltZXIiKTsKKyAgICAgICAgICAgICAgICBpZiAobVRpbWVyUGF1c2VkKSB7CisgICAgICAgICAgICAgICAgICAgIG1IYXNEZWZlcnJlZFRpbWVycyA9IHRydWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZmlyZVNoYXJlZFRpbWVyKCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FzZSBGVU5DUFRSX01FU1NBR0U6CiAgICAgICAgICAgICAgICAgbmF0aXZlU2VydmljZUZ1bmNQdHJRdWV1ZSgpOwogICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBSRUZSRVNIX1BMVUdJTlM6CisgICAgICAgICAgICAgICAgbmF0aXZlVXBkYXRlUGx1Z2luRGlyZWN0b3JpZXMoUGx1Z2luTWFuYWdlci5nZXRJbnN0YW5jZShudWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgLmdldFBsdWdpbkRpcmVjdG9yaWVzKCksICgoQm9vbGVhbikgbXNnLm9iaikKKyAgICAgICAgICAgICAgICAgICAgICAgIC5ib29sZWFuVmFsdWUoKSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KICAgICB9CiAgICAgCkBAIC04Niw3ICsxMDksOCBAQAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHBhdXNlKCkgewogICAgICAgICBpZiAoLS1tUGF1c2VUaW1lclJlZkNvdW50ID09IDApIHsKLSAgICAgICAgICAgIHNldERlZmVycmluZ1RpbWVycyh0cnVlKTsKKyAgICAgICAgICAgIG1UaW1lclBhdXNlZCA9IHRydWU7CisgICAgICAgICAgICBtSGFzRGVmZXJyZWRUaW1lcnMgPSBmYWxzZTsKICAgICAgICAgfQogICAgIH0KIApAQCAtOTUsNyArMTE5LDExIEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgcmVzdW1lKCkgewogICAgICAgICBpZiAoKyttUGF1c2VUaW1lclJlZkNvdW50ID09IDEpIHsKLSAgICAgICAgICAgIHNldERlZmVycmluZ1RpbWVycyhmYWxzZSk7CisgICAgICAgICAgIG1UaW1lclBhdXNlZCA9IGZhbHNlOworICAgICAgICAgICBpZiAobUhhc0RlZmVycmVkVGltZXJzKSB7CisgICAgICAgICAgICAgICBtSGFzRGVmZXJyZWRUaW1lcnMgPSBmYWxzZTsKKyAgICAgICAgICAgICAgIGZpcmVTaGFyZW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L29jdGV0LXN0cmVhbSIpKSB7CisgICAgICAgICAgICBpZiAobU1pbWVUeXBlLmVxdWFscygidGV4dC9wbGFpbiIpIHx8CisgICAgICAgICAgICAgICAgICAgIG1NaW1lVHlwZS5lcXVhbHMoImFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbSIpKSB7CiAKICAgICAgICAgICAgICAgICAvLyBmb3IgYXR0YWNobWVudCwgdXNlIHRoZSBmaWxlbmFtZSBpbiB0aGUgQ29udGVudC1EaXNwb3NpdGlvbgogICAgICAgICAgICAgICAgIC8vIHRvIGd1ZXNzIHRoZSBtaW1ldHlwZQpAQCAtMzM5LDE3ICszMzMsMTQgQEAKICAgICAgICAgICAgICAgICBpZiAobmV3TWltZVR5cGUgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBtTWltZVR5cGUgPSBuZXdNaW1lVHlwZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKG1NaW1lVHlwZS5lcXVhbHNJZ25vcmVDYXNlKCJ0ZXh0L3ZuZC53YXAud21sIikpIHsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobU1pbWVUeXBlLmVxdWFscygidGV4dC92bmQud2FwLndtbCIpKSB7CiAgICAgICAgICAgICAgICAgLy8gQXMgd2UgZG9uJ3Qgc3VwcG9ydCB3bWwsIHJlbmRlciBpdCBhcyBwbGFpbiB0ZXh0CiAgICAgICAgICAgICAgICAgbU1pbWVUeXBlID0gInRleHQvcGxhaW4iOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBYWFg6IFVudGlsIHRoZSBzZXJ2ZXJzIHNlbmQgdXMgZWl0aGVyIGNvcnJlY3QgeGh0bWwgb3IKLSAgICAgICAgICAgICAgICAvLyB0ZXh0L2h0bWwsIHRyZWF0IGFwcGxpY2F0aW9uL3hodG1sK3htbCBhcyB0ZXh0L2h0bWwuCiAgICAgICAgICAgICAgICAgLy8gSXQgc2VlbXMgdGhhdCB4aHRtbCt4bWwgYW5kIHZuZC53YXAueGh0bWwreG1sIG1pbWUKICAgICAgICAgICAgICAgICAvLyBzdWJ0eXBlcyBhcmUgdXNlZCBpbnRlcmNoYW5nZWFibHkuIFNvIHRyZWF0IHRoZW0gdGhlIHNhbWUuCi0gICAgICAgICAgICAgICAgaWYgKG1NaW1lVHlwZS5lcXVhbHNJZ25vcmVDYXNlKCJhcHBsaWNhdGlvbi94aHRtbCt4bWwiKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgbU1pbWVUeXBlLmVxdWFscygiYXBwbGljYXRpb24vdm5kLndhcC54aHRtbCt4bWwiKSkgewotICAgICAgICAgICAgICAgICAgICBtTWltZVR5cGUgPSAidGV4dC9odG1sIjsKKyAgICAgICAgICAgICAgICBpZiAobU1pbWVUeXBlLmVxdWFscygiYXBwbGljYXRpb24vdm5kLndhcC54aHRtbCt4bWwiKSkgeworICAgICAgICAgICAgICAgICAgICBtTWltZVR5cGUgPSAiYXBwbGljYXRpb24veGh0bWwreG1sIjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CkBAIC00MTksMTEgKzQxMCwxMSBAQAogICAgICAgICAgICAgICAgIG1TdGF0dXNDb2RlID09IEhUVFBfTU9WRURfUEVSTUFORU5UTFkgfHwKICAgICAgICAgICAgICAgICBtU3RhdHVzQ29kZSA9PSBIVFRQX1RFTVBPUkFSWV9SRURJUkVDVCkgJiYgCiAgICAgICAgICAgICAgICAgbU5hdGl2ZUxvYWRlciAhPSAwKSB7Ci0gICAgICAgICAgICAvLyBDb250ZW50IGFycml2aW5nIGZyb20gYSBTdHJlYW1Mb2FkZXIgKGVnIEZpbGUsIENhY2hlIG9yIERhdGEpCi0gICAgICAgICAgICAvLyB3aWxsIG5vdCBiZSBjYWNoZWQgYXMgdGhleSBoYXZlIHRoZSBoZWFkZXI6Ci0gICAgICAgICAgICAvLyBjYWNoZS1jb250cm9sOiBuby1zdG9yZQot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VmVyc2lvbgogICAgICAgICAgICAgICAgICAgICArICIgbWlub3I6ICIgKyBtaW5vclZlcnNpb24KQEAgLTQ2NCw2ICs0NTUsOSBAQAogICAgICAgICBzdGF0dXMucHV0KCJyZWFzb24iLCByZWFzb25QaHJhc2UpOwogICAgICAgICAvLyBOZXcgc3RhdHVzIG1lYW5zIG5ldyBkYXRhLiBDbGVhciB0aGUgb2xkLgogICAgICAgICBtRGF0YUJ1aWxkZXIuY2xlYXIoKTsKKyAgICAgICAgbU1pbWVUeXBlID0gIiI7CisgICAgICAgIG1FbmNvZGluZyA9ICIiOworICAgICAgICBtVHJhbnNmZXJFbmNvZGluZyA9ICIiOwogICAgICAgICBzZW5kTWVzc2FnZUludGVybmFsKG9idGFpbk1lc3NhZ2UoTVNHX1NUQVRVUywgc3RhdHVzKSk7CiAgICAgfQogCkBAIC01MDcsNyArNTAxLDcgQEAKICAgICAgKiBkaXJlY3RseQogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGVycm9yKGludCBpZCwgU3RyaW5nIGRlc2NyaXB0aW9uKSB7Ci0gICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5MT0FEX0xJU1RFTkVSKSB7CiAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJMb2FkTGlzdGVuZXIuZXJyb3IgdXJsOiIgKwogICAgICAgICAgICAgICAgICAgICB1cmwoKSArICIgaWQ6IiArIGlkICsgIiBkZXNjcmlwdGlvbjoiICsgZGVzY3JpcHRpb24pOwogICAgICAgICB9CkBAIC01MzUsMjMgKzUyOSwxMCBAQAogICAgICAqIG1EYXRhQnVpbGRlciBpcyBhIHRocmVhZC1zYWZlIHN0cnVjdHVyZS4KICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBkYXRhKGJ5dGVbXSBkYXRhLCBpbnQgbGVuZ3RoKSB7Ci0gICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkge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GEgb3IgbURhdGFMZW5ndGggYXQgdGhlIHNhbWUgdGltZQogICAgICAgICAvLyBhcyBhIHdyaXRlLgpAQCAtNTczLDcgKzU1NCw3IEBACiAgICAgICogZGlyZWN0bHkKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBlbmREYXRhKCkgewotICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuTE9BRF9MSVNURU5FUikgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiTG9hZExpc3RlbmVyLmVuZERhdGEoKTogdXJsOiAiICsgdXJsKCkpOwogICAgICAgICB9CiAgICAgICAgIHNlbmRNZXNzYWdlSW50ZXJuYWwob2J0YWluTWVzc2FnZShNU0dfQ09OVEVOVF9GSU5JU0hFRCkpOwpAQCAtNjI2LDcgKzYwNyw4IEBACiAgICAgICAgICAgICAgICAgLy8gYmVmb3JlIGNhbGxpbmcgaXQuCiAgICAgICAgICAgICAgICAgaWYgKG1DYWNoZUxvYWRlciAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG1DYWNoZUxvYWRlci5sb2FkKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgICAgICAgICAgICAgICAgICBtRnJvbUNhY2hlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuTE9BRF9MSVNURU5FUikgewogICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiTG9hZExpc3RlbmVyIGNhY2hlIGxvYWQgdXJsPSIgKyB1cmwoKSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwpAQCAtNjQ2LDYgKzYyOCw3IEBACiAgICAgICogc2VydmljZWQgYnkgdGhlIENhY2hlLiAqLwogICAgIC8qIHBhY2thZ2UgKi8gdm9pZCBzZXRDYWNoZUxvYWRlcihDYWNoZUxvYWRlciBjKSB7CiAgICAgICAgIG1DYWNoZUxvYWRlciA9IGM7CisgICAgICAgIG1Gcm9tQ2FjaGUgPSB0cnVlOwogICAgIH0KIAogICAgIC8qKgpAQCAtNjYyLDYgKzY0NSw4IEBACiAgICAgICAgIC8vIEdvIGFoZWFkIGFuZCBzZXQgdGhlIGNhY2hlIGxvYWRlciB0byBudWxsIGluIGNhc2UgdGhlIHJlc3VsdCBpcwogICAgICAgICAvLyBudWxsLgogICAgICAgICBtQ2FjaGVMb2FkZXIgPSBudWxsOworICAgICAgICAvLyByZXNldCB0aGUgZmxhZworICAgICAgICBtRnJvbUNhY2hlID0gZmFsc2U7CiAKICAgICAgICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7CiAgICAgICAgICAgICAvLyBUaGUgY29udGVudHMgb2YgdGhlIGNhY2hlIG1heSBuZWVkIHRvIGJlIHJldmFsaWRhdGVkIHNvIGp1c3QKQEAgLTY3NiwxMiArNjYxLDEzIEBACiAgICAgICAgICAgICAgICAgICAgIENhY2hlTWFuYWdlci5IRUFERVJfS0VZX0lGTk9ORU1BVENIKSAmJgogICAgICAgICAgICAgICAgICAgICAhaGVhZGVycy5jb250YWluc0tleSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYWNoZU1hbmFnZXIuSEVBREVSX0tFWV9JRk1PRElGSUVEU0lOQ0UpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKFdlYlZpZXcuTE9HVl9FTkFCTEVEKSB7CisgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuTE9BRF9MSVNURU5FUikgewogICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJGcmFtZUxvYWRlcjogSFRUUCBVUkwgaW4gY2FjaGUgIiArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImFuZCB1c2FibGU6ICIgKyB1cmwoKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIC8vIExvYWQgdGhlIGNhY2hlZCBmaWxlCiAgICAgICAgICAgICAgICAgbUNhY2hlTG9hZGVyLmxvYWQoKTsKKyAgICAgICAgICAgICAgICBtRnJvbUNhY2hlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtNjk1LDEyICs2ODEsMjMgQEAKICAgICAgKiBkaXJlY3RseQogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIGhhbmRsZVNzbEVycm9yUmVxdWVzdChTc2xFcnJvciBlcnJvcikgewotICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuTE9BRF9MSVNURU5FUikgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLAogICAgICAgICAgICAgICAgICAgICAiTG9hZExpc3RlbmVyLmhhbmRsZVNzbEVycm9yUmVxdWVzdCgpOiB1cmw6IiArIHVybCgpICsKICAgICAgICAgICAgICAgICAgICAgIiBwcmltYXJ5IGVycm9yOiAiICsgZXJyb3IuZ2V0UHJpbWFyeUVycm9yKCkgKwogICAgICAgICAgICAgICAgICAgICAiIGNlcnRpZmljYXRlOiAiICsgZXJyb3IuZ2V0Q2VydGlmaWNhdGUoKSk7CiAgICAgICAgIH0KKyAgICAgICAgLy8gQ2hlY2sgdGhlIGNhY2hlZCBwcmVmZXJlbmNlIHRhYmxlIGJlZm9yZSBzZW5kaW5nIGEgbWVzc2FnZS4gVGhpcworICAgICAgICAvLyB3aWxsIHByZXZlbnQgd2FpdGluZyBmb3IgYW4gYWxyZWFkeSBhdmFpbGFibGUgYW5zd2VyLgorICAgICAgICBpZiAoTmV0d29yay5nZXRJbnN0YW5jZShtQ29udGV4dCkuY2hlY2tTc2xQcmVmVGFibGUodGhpcywgZXJyb3IpKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICAvLyBE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gICAgICAgfSBlbHNlIHsKQEAgLTEyMjEsNyArMTIxOSw3IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIE5ldHdvcmsucmVxdWVzdFVSTC4KICAgICAgICAgICAgICAgICAgICAgTmV0d29yayBuZXR3b3JrID0gTmV0d29yay5nZXRJbnN0YW5jZShnZXRDb250ZXh0KCkpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW5ldHdvcmsucmVxdWVzdFVSTChtTWV0aG9kLCBtUmVxdWVzdEhlYWRlcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvc3REYXRhLCB0aGlzLCBtSXNIaWdoUHJpb3JpdHkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvc3REYXRhLCB0aGlzKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2lnbmFsIGEgYmFkIHVybCBlcnJvciBpZiB3ZSBjb3VsZCBub3QgbG9hZCB0aGUKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlZGlyZWN0aW9uLgogICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlRXJyb3IoRXZlbnRIYW5kbGVyLkVSUk9SX0JBRF9VUkwsCkBAIC0xMjQ3LDcgKzEyNDUsNyBAQAogICAgICAgICAgICAgdGVhckRvd24oKTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5MT0FEX0xJU1RFTkVSKSB7CiAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJMb2FkTGlzdGVuZXIub25SZWRpcmVjdCgpOiByZWRpcmVjdCB0bzogIiArCiAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0VG8pOwogICAgICAgICB9CkBAIC0xMjYwLDggKzEyNTgsOCBAQAogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFBhdHRlcm4gQ09OVEVOVF9UWVBFX1BBVFRFUk4gPQogICAgICAgICAgICAgUGF0dGVybi5jb21waWxlKCJeKCg/Olt4WF0tKT9bYS16QS1aXFwqXSsvW1xcd1xcK1xcKi1dK1tcXC5bXFx3XFwrLV0rXSopJCIpOwogCi0gICAgcHJpdmF0ZSB2b2lkIHBhcnNlQ29udGVudFR5cGVIZWFkZXIoU3RyaW5nIGNvbnRlbnRUeXBlKSB7Ci0gICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCBwYXJzZUNvbnRlbnRUeXBlSGVhZGVyKFN0cmluZyBjb250ZW50VHlwZSkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5MT0FEX0xJU1RFTkVSKSB7CiAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJMb2FkTGlzdGVuZXIucGFyc2VDb250ZW50VHlwZUhlYWRlcjogIiArCiAgICAgICAgICAgICAgICAgICAgICJjb250ZW50VHlwZTogIiArIGNvbnRlbnRUeXBlKTsKICAgICAgICAgfQpAQCAtMTI4MiwxMyArMTI4MCwxNCBAQAogICAgICAgICAgICAgICAgICAgICBtRW5jb2RpbmcgPSBjb250ZW50VHlwZS5zdWJzdHJpbmcoaSArIDEpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBUcmltIGV4Y2VzcyB3aGl0ZXNwYWNlLgotICAgICAgICAgICAgICAgIG1FbmNvZGluZyA9IG1FbmNvZGluZy50cmltKCk7CisgICAgICAgICAgICAgICAgbUVuY29kaW5nID0gbUVuY29kaW5nLnRyaW0oKS50b0xvd2VyQ2FzZSgpOwogCiAgICAgICAgICAgICAgICAgaWYgKGkgPCBjb250ZW50VHlwZS5sZW5ndGgoKSAtIDEpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gZm9yIGRhdGE6IHVyaSB0aGUgbWltZVR5cGUgYW5kIGVuY29kaW5nIGhhdmUKICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGZvcm0gaW1hZ2UvanBlZztiYXNlNjQgb3IgdGV4dC9wbGFpbjtjaGFyc2V0PXV0Zi04CiAgICAgICAgICAgICAgICAgICAgIC8vIG9yIHRleHQvaHRtbDtjaGFyc2V0PXV0Zi04O2Jhc2U2NAotICAgICAgICAgICAgICAgICAgICBtVHJhbnNmZXJFbmNvZGluZyA9IGNvbnRlbnRUeXBlLnN1YnN0cmluZyhpICsgMSkudHJpbSgpOworICAgICAgICAgICAgICAgICAgICBtVHJhbnNmZXJFbmNvZGluZyA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFR5cGUuc3Vic3RyaW5nKGkgKyAxKS50cmltKCkudG9Mb3dlckNhc2UoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIG1NaW1lVHlwZSA9IGNvbnRlbnRUeXBlOwpAQCAtMTMwOCw2ICsxMzA3LDggQEAKICAgICAgICAgICAgICAgICBndWVzc01pbWVUeXBlKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgLy8gRW5zdXJlIG1NaW1lVHlwZSBpcyBsb3dlciBjYXNlLgorICAgICAgICBtTWltZVR5cGUgPSBtTWltZVR5cGUudG9Mb3dlckNhc2UoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTEzOTcsNyArMTM5OCw4IEBACiAgICAgICovCiAgICAgcHJpdmF0ZSBib29sZWFuIGlnbm9yZUNhbGxiYWNrcygpIHsKICAgICAgICAgcmV0dXJuIChtQ2FuY2VsbGVkIHx8IG1BdXRoSGVhZGVyICE9IG51bGwgfHwKLSAgICAgICAgICAgICAgICAobVN0YXR1c0NvZGUgPiAzMDAgJiYgbVN0YXR1c0NvZGUgPCA0MDApKTsKKyAgICAgICAgICAgICAgICAvLyBBbGxvdyAzMDUgKFVzZSBQcm94eSkgdG8gY2FsbCB0aHJvdWdoLgorICAgICAgICAgICAgICAgIChtU3RhdHVzQ29kZSA+IDMwMCAmJiBtU3RhdHVzQ29kZSA8IDQwMC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UeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vbWF0aGVtYXRpY2EiLCAibmIiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL21zYWNjZXNzIiwgIm1kYiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vb2RhIiwgIm9kYSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vb2dnIiwgIm9nZyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vcGRmIiwgInBkZiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vcGdwLWtleXMiLCAia2V5Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi9wZ3Atc2lnbmF0dXJlIiwgInBncCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vcGljcy1ydWxlcyIsICJwcmYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3JhciIsICJyYXIiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3JkZit4bWwiLCAicmRmIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi9yc3MreG1sIiwgInJzcyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vemlwIiwgInppcCIpOwogICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLmFuZHJvaWQucGFja2FnZS1hcmNoaXZlIiwgCi0gICAgICAgICAgICAgICAgICAgICJhcGsiLCBmYWxzZSk7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuY2luZGVyZWxsYSIsICJjZHkiLCBmYWxzZSk7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQubXMtcGtpLnN0bCIsICJzdGwiLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcGsiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5jaW5kZXJlbGxhIiwgImNkeSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLm1zLXBraS5zdGwiLCAic3RsIik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC5kYXRhYmFzZSIsICJvZGIiLCAKLSAgICAgICAgICAgICAgICAgICAgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC5kYXRhYmFzZSIsICJvZGIiKTsKICAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LmZvcm11bGEiLCAib2RmIiwgCi0gICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQuZm9ybXVsYSIsICJvZGYiKTsKICAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LmdyYXBoaWNzIiwgIm9kZyIsIAotICAgICAgICAgICAgICAgICAgICBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LmdyYXBoaWNzIiwgIm9kZyIpOwogICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKICAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQuZ3JhcGhpY3MtdGVtcGxhdGUiLAotICAgICAgICAgICAgICAgICAgICAib3RnIiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAib3RnIik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC5pbWFnZSIsICJvZGkiLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LmltYWdlIiwgIm9kaSIpOwogICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQuc3ByZWFkc2hlZXQiLCAib2RzIiwgCi0gICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQuc3ByZWFkc2hlZXQiLCAib2RzIik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAogICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC5zcHJlYWRzaGVldC10ZW1wbGF0ZSIsCi0gICAgICAgICAgICAgICAgICAgICJvdHMiLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJvdHMiKTsKICAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LnRleHQiLCAib2R0IiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC50ZXh0IiwgIm9kdCIpOwogICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQudGV4dC1tYXN0ZXIiLCAib2RtIiwgCi0gICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5vYXNpcy5vcGVuZG9jdW1lbnQudGV4dC1tYXN0ZXIiLCAib2RtIik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC50ZXh0LXRlbXBsYXRlIiwgIm90dCIsIAotICAgICAgICAgICAgICAgICAgICBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQub2FzaXMub3BlbmRvY3VtZW50LnRleHQtdGVtcGxhdGUiLCAib3R0Iik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLm9hc2lzLm9wZW5kb2N1bWVudC50ZXh0LXdlYiIsICJvdGgiLCAKLSAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAg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xzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLmltcHJlc3MiLCAic2RkIik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLnN0YXJkaXZpc2lvbi5pbXByZXNzIiwgInNkcCIsIGZhbHNlKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdGFyZGl2aXNpb24ubWF0aCIsICJzbWYiLCAKLSAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLnN0YXJkaXZpc2lvbi53cml0ZXIiLCAic2R3IiwgCi0gICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdGFyZGl2aXNpb24ud3JpdGVyIiwgInZvciIsIAotICAgICAgICAgICAgICAgICAgICBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLmltcHJlc3MiLCAic2RwIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLm1hdGgiLCAic21mIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLndyaXRlciIsCisgICAgICAgICAgICAgICAgICAgICJzZHciKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdGFyZGl2aXNpb24ud3JpdGVyIiwKKyAgICAgICAgICAgICAgICAgICAgInZvciIpOwogICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5zdGFyZGl2aXNpb24ud3JpdGVyLWdsb2JhbCIsICJzZ2wiLCBmYWxzZSk7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3VuLnhtbC5jYWxjIiwgInN4YyIsIAotICAgICAgICAgICAgICAgICAgICBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQuc3RhcmRpdmlzaW9uLndyaXRlci1nbG9iYWwiLCAic2dsIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3VuLnhtbC5jYWxjIiwgInN4YyIpOwogICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLmNhbGMudGVtcGxhdGUiLCAic3RjIiwgZmFsc2UpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLnN1bi54bWwuZHJhdyIsICJzeGQiLCAKLSAgICAgICAgICAgICAgICAgICAgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLnN1bi54bWwuY2FsYy50ZW1wbGF0ZSIsICJzdGMiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLmRyYXciLCAic3hkIik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLnN1bi54bWwuZHJhdy50ZW1wbGF0ZSIsICJzdGQiLCBmYWxzZSk7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3VuLnhtbC5pbXByZXNzIiwgInN4aSIsIAotICAgICAgICAgICAgICAgICAgICBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQuc3VuLnhtbC5kcmF3LnRlbXBsYXRlIiwgInN0ZCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24vdm5kLnN1bi54bWwuaW1wcmVzcyIsICJzeGkiKTsKICAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoCi0gICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQuc3VuLnhtbC5pbXByZXNzLnRlbXBsYXRlIiwgInN0aSIsIGZhbHNlKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLm1hdGgiLCAic3htIiwgCi0gICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLndyaXRlciIsICJzeHciLCAKLSAgICAgICAgICAgICAgICAgICAgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLnN1bi54bWwuaW1wcmVzcy50ZW1wbGF0ZSIsICJzdGkiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLm1hdGgiLCAic3htIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQuc3VuLnhtbC53cml0ZXIiLCAic3h3Iik7CiAgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KAotICAgICAgICAgICAgICAgICAgICAiYXBwbGljYXRpb24vdm5kLnN1bi54bWwud3JpdGVyLmdsb2JhbCIsICJzeGciLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbi92bmQuc3VuLnhtbC53cml0ZXIuZ2xvYmFsIiwgInN4ZyIpOwogICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgKLSAgICAgICAgICAgICAgICAgICAgImFwcGxpY2F0aW9uL3ZuZC5zdW4ueG1sLndyaXRlci50ZW1wbGF0ZSIsICJzdHciLCBmYWxzZSk7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi92bmQudmlzaW8iLCAidnNkIiwgZmFsc2UpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1hYml3b3JkIiwgImFidyIsIGZhbHNlKTsKLSAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtYXBwbGUtZGlza2ltYWdlIiwgImRtZyIsIAotICAgICAgICAgICAgICAgICAgICBmYWxzZSk7Ci0gICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWJjcGlvIiwgImJjcGlvIiwgZmFsc2UpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1iaXR0b3JyZW50IiwgInRvcnJlbnQiLCAKLSAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1jZGYiLCAiY2RmIiwgZmFsc2UpOwotICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1jZGxpbmsiLCAidmNkIiwgZm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IHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtYXBwbGUtZGlza2ltYWdlIiwgImRtZyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1iY3BpbyIsICJiY3BpbyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1iaXR0b3JyZW50IiwgInRvcnJlbnQiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtY2RmIiwgImNkZiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1jZGxpbmsiLCAidmNkIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWNoZXNzLXBnbiIsICJwZ24iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtY3BpbyIsICJjcGlvIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWRlYmlhbi1wYWNrYWdlIiwgImRlYiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1kZWJpYW4tcGFja2FnZSIsICJ1ZGViIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWRpcmVjdG9yIiwgImRjciIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1kaXJlY3RvciIsICJkaXIiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZGlyZWN0b3IiLCAiZHhyIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWRtcyIsICJkbXMiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZG9vbSIsICJ3YWQiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZHZpIiwgImR2aSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1mbGFjIiwgImZsYWMiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZm9udCIsICJwZmEiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZm9udCIsICJwZmIiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZm9udCIsICJnc2YiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZm9udCIsICJwY2YiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZm9udCIsICJwY2YuWiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1mcmVlbWluZCIsICJtbSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1mdXR1cmVzcGxhc2giLCAic3BsIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWdudW1lcmljIiwgImdudW1lcmljIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWdvLXNnZiIsICJzZ2YiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZ3JhcGhpbmctY2FsY3VsYXRvciIsICJnY2YiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtZ3RhciIsICJndGFyIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWd0YXIiLCAidGd6Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWd0YXIiLCAidGF6Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWhkZiIsICJoZGYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtaWNhIiwgImljYSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1pbnRlcm5ldC1zaWdudXAiLCAiaW5zIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWludGVybmV0LXNpZ251cCIsICJpc3AiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtaXBob25lIiwgImlpaSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1pc285NjYwLWltYWdlIiwgImlzbyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1qbW9sIiwgImpteiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rY2hhcnQiLCAiY2hydCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1raWxsdXN0cmF0b3IiLCAia2lsIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWtvYW4iLCAic2twIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWtvYW4iLCAic2tkIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWtvYW4iLCAic2t0Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWtvYW4iLCAic2ttIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWtwcmVzZW50ZXIiLCAia3ByIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWtwcmVzZW50ZXIiLCAia3B0Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWtzcHJlYWQiLCAia3NwIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWt3b3JkIiwgImt3ZCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1rd29yZCIsICJrd3QiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbGF0ZXgiLCAibGF0ZXgiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbGhhIiwgImxoYSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1semgiLCAibHpoIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LWx6eCIsICJsengiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbWFrZXIiLCAiZnJtIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1ha2VyIiwgIm1ha2VyIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1ha2VyIiwgImZyYW1lIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1ha2VyIiwgImZiIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1ha2VyIiwgImJvb2siKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbWFrZXIiLCAiZmJkb2MiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbWlmIiwgIm1pZiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1tcy13bWQiLCAid21kIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW1zLXdteiIsICJ3bXoiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtbXNpIiwgIm1zaSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1ucy1wcm94eS1hdXRvY29uZmlnIiwgInBhYyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1ud2MiLCAibndjIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW9iamVjdCIsICJvIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LW96LWFwcGxpY2F0aW9uIiwgIm96YSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1wa2NzMTIiLCAicDEyIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LXBrY3M3LWNlcnRyZXFyZXNwIiwgInA3ciIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1wa2NzNy1jcmwiLCAiY3JsIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LXF1aWNrdGltZXBsYXllciIsICJxdGwiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gtc2hhciIsICJzaGFyIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LXN0dWZmaXQiLCAic2l0Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LXN2NGNwaW8iLCAic3Y0Y3BpbyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXBwbGljYXRpb24veC1zdjRjcmMiLCAic3Y0Y3JjIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhcHBsaWNhdGlvbi94LXRhciIsICJ0YXIiKTsKKyAgICAgICAgICAgIHN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AgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3gteGZpZyIsICJmaWciKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImFwcGxpY2F0aW9uL3hodG1sK3htbCIsICJ4aHRtbCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8vYmFzaWMiLCAic25kIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby9taWRpIiwgIm1pZCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8vbWlkaSIsICJtaWRpIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby9taWRpIiwgImthciIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8vbXBlZyIsICJtcGdhIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby9tcGVnIiwgIm1wZWdhIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby9tcGVnIiwgIm1wMiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8vbXBlZyIsICJtcDMiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImF1ZGlvL21wZWciLCAibTRhIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby9tcGVndXJsIiwgIm0zdSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8vcHJzLnNpZCIsICJzaWQiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImF1ZGlvL3gtYWlmZiIsICJhaWYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImF1ZGlvL3gtYWlmZiIsICJhaWZmIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby94LWFpZmYiLCAiYWlmYyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8veC1nc20iLCAiZ3NtIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby94LW1wZWd1cmwiLCAibTN1Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby94LW1zLXdtYSIsICJ3bWEiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImF1ZGlvL3gtbXMtd2F4IiwgIndheCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8veC1wbi1yZWFsYXVkaW8iLCAicmEiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImF1ZGlvL3gtcG4tcmVhbGF1ZGlvIiwgInJtIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby94LXBuLXJlYWxhdWRpbyIsICJyYW0iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImF1ZGlvL3gtcmVhbGF1ZGlvIiwgInJhIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby94LXNjcGxzIiwgInBscyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiYXVkaW8veC1zZDIiLCAic2QyIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJhdWRpby94LXdhdiIsICJ3YXYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL2JtcCIsICJibXAiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL2dpZiIsICJnaWYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL2ljbyIsICJjdXIiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL2ljbyIsICJpY28iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL2llZiIsICJpZWYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL2pwZWciLCAianBlZyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiaW1hZ2UvanBlZyIsICJqcGciKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL2pwZWciLCAianBlIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS9wY3giLCAicGN4Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS9wbmciLCAicG5nIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS9zdmcreG1sIiwgInN2ZyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiaW1hZ2Uvc3ZnK3htbCIsICJzdmd6Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS90aWZmIiwgInRpZmYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3RpZmYiLCAidGlmIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS92bmQuZGp2dSIsICJkanZ1Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS92bmQuZGp2dSIsICJkanYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3ZuZC53YXAud2JtcCIsICJ3Ym1wIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS94LWNtdS1yYXN0ZXIiLCAicmFzIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS94LWNvcmVsZHJhdyIsICJjZHIiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gtY29yZWxkcmF3cGF0dGVybiIsICJwYXQiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gtY29yZWxkcmF3dGVtcGxhdGUiLCAiY2R0Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS94LWNvcmVscGhvdG9wYWludCIsICJjcHQiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gtaWNvbiIsICJpY28iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gtamciLCAiYXJ0Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS94LWpuZyIsICJqbmciKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gtbXMtYm1wIiwgImJtcCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiaW1hZ2UveC1waG90b3Nob3AiLCAicHNkIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS94LXBvcnRhYmxlLWFueW1hcCIsICJwbm0iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gtcG9ydGFibGUtYml0bWFwIiwgInBibSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiaW1hZ2UveC1wb3J0YWJsZS1ncmF5bWFwIiwgInBnbSIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgiaW1hZ2UveC1wb3J0YWJsZS1waXhtYXAiLCAicHBtIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJpbWFnZS94LXJnYiIsICJyZ2IiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gteGJpdG1hcCIsICJ4Ym0iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gteHBpeG1hcCIsICJ4cG0iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoImltYWdlL3gteHdpbmRvd2R1bXAiLCAieHdkIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJtb2RlbC9pZ2VzIiwgImlncyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgibW9kZWwvaWdlcyIsICJpZ2VzIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJtb2RlbC9tZXNoIiwgIm1zaCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgibW9kZWwvbWVzaCIsICJtZXNoIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJtb2RlbC9tZXNoIiwgInNpbG8iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQvY2FsZW5kYXIiLCAiaWNzIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L2NhbGVuZGFyIiwgImljeiIpOworICAgICAgICAgICAgc01pbWVUe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NaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQvcGxhaW4iLCAiZGlmZiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC9wbGFpbiIsICJwb3QiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQvcmljaHRleHQiLCAicnR4Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3J0ZiIsICJydGYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQvdGV4bWFjcyIsICJ0cyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC90ZXh0IiwgInBocHMiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQvdGFiLXNlcGFyYXRlZC12YWx1ZXMiLCAidHN2Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtYmlidGV4IiwgImJpYiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWJvbyIsICJib28iKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jKytoZHIiLCAiaCsrIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtYysraGRyIiwgImhwcCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWMrK2hkciIsICJoeHgiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jKytoZHIiLCAiaGgiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jKytzcmMiLCAiYysrIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtYysrc3JjIiwgImNwcCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWMrK3NyYyIsICJjeHgiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jaGRyIiwgImgiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1jb21wb25lbnQiLCAiaHRjIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtY3NoIiwgImNzaCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWNzcmMiLCAiYyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWRzcmMiLCAiZCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LWhhc2tlbGwiLCAiaHMiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1qYXZhIiwgImphdmEiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1saXRlcmF0ZS1oYXNrZWxsIiwgImxocyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LW1vYyIsICJtb2MiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1wYXNjYWwiLCAicCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXBhc2NhbCIsICJwYXMiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC1wY3MtZ2NkIiwgImdjZCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXNldGV4dCIsICJldHgiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC10Y2wiLCAidGNsIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtdGV4IiwgInRleCIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXRleCIsICJsdHgiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC10ZXgiLCAic3R5Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ0ZXh0L3gtdGV4IiwgImNscyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidGV4dC94LXZjYWxlbmRhciIsICJ2Y3MiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInRleHQveC12Y2FyZCIsICJ2Y2YiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvLzNncHAiLCAiM2dwIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby8zZ3BwIiwgIjNnMiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vZGwiLCAiZGwiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL2R2IiwgImRpZiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vZHYiLCAiZHYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL2ZsaSIsICJmbGkiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL21wZWciLCAibXBlZyIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vbXBlZyIsICJtcGciKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL21wZWciLCAibXBlIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby9tcDQiLCAibXA0Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby9tcGVnIiwgIlZPQiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8vcXVpY2t0aW1lIiwgInF0Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby9xdWlja3RpbWUiLCAibW92Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby92bmQubXBlZ3VybCIsICJteHUiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3gtbGEtYXNmIiwgImxzZiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8veC1sYS1hc2YiLCAibHN4Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby94LW1uZyIsICJtbmciKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2FkRW50cnkoInZpZGVvL3gtbXMtYXNmIiwgImFzZiIpOworICAgICAgICAgICAgc01pbWVUeXBlTWFwLmxvYWRFbnRyeSgidmlkZW8veC1tcy1hc2YiLCAiYXN4Iik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby94LW1zLXdtIiwgIndtIik7CisgICAgICAgICAgICBzTWltZVR5cGVNYXAubG9hZEVudHJ5KCJ2aWRlby94LW1zLXdtdiIsICJ3bXYiKTsKKyAgICAgICAgICAgIHNNaW1lVHlwZU1hcC5sb2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ICAgICAgIGludGVudC5nZXRTdHJpbmdFeHRyYShJTlRFTlRfRVhUUkFfUEFDS0FHRV9OQU1FKTsKKyAgICAgICAgZmluYWwgU3RyaW5nIGNsYXNzTmFtZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShJTlRFTlRfRVhUUkFfQ0xBU1NfTkFNRSk7CisgICAgICAgIGZpbmFsIGludCBucHAgPSBpbnRlbnQuZ2V0SW50RXh0cmEoSU5URU5UX0VYVFJBX05QUF9JTlNUQU5DRSwgLTEpOworICAgICAgICAvLyBSZXRyaWV2ZSB0aGUgUGx1Z2luU3R1YiBpbXBsZW1lbnRlZCBpbiBwYWNrYWdlTmFtZS5jbGFzc05hbWUKKyAgICAgICAgUGx1Z2luU3R1YiBzdHViID0KKyAgICAgICAgICAgICAgICBQbHVnaW5VdGlsLmdldFBsdWdpblN0dWIodGhpcywgcGFja2FnZU5hbWUsIGNsYXNzTmFtZSwgbnBwKTsKKworICAgICAgICBpZiAoc3R1YiAhPSBudWxsKSB7CisgICAgICAgICAgICBWaWV3IHBsdWdpblZpZXcgPSBzdHViLmdldEZ1bGxTY3JlZW5WaWV3KHRoaXMpOworICAgICAgICAgICAgaWYgKHBsdWdpblZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHNldENvbnRlbnRWaWV3KHBsdWdpblZpZXcpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBObyBjdXN0b20gZnVsbC1zcmVlbiB2aWV3IHJldHVybmVkIGJ5IHRoZSBwbHVnaW4sIG9kZCBidXQKKyAgICAgICAgICAgICAgICAvLyBqdXN0IGluIGNhc2UsIGZpbmlzaCB0aGUgYWN0aXZpdHkuCisgICAgICAgICAgICAgICAgZmluaXNoKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmaW5pc2goKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb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RJT04gPSAiYW5kcm9pZC53ZWJraXQuUExVR0lOIjsKKworICAgIC8qKgorICAgICAqIEEgcGx1Z2luIHdpc2hlcyB0byBiZSBsb2FkZWQgaW4gdGhlIFdlYlZpZXcgbXVzdCBwcm92aWRlIHRoaXMgcGVybWlzc2lvbgorICAgICAqIGluIHRoZWlyIEFuZHJvaWRNYW5pZmVzdC54bWwuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUExVR0lOX1BFUk1JU1NJT04gPSAiYW5kcm9pZC53ZWJraXQucGVybWlzc2lvbi5QTFVHSU4iOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIExPR1RBRyA9ICJ3ZWJraXQiOworCisgICAgcHJpdmF0ZSBzdGF0aWMgUGx1Z2luTWFuYWdlciBtSW5zdGFuY2UgPSBudWxsOworCisgICAgcHJpdmF0ZSBmaW5hbCBDb250ZXh0IG1Db250ZXh0OworCisgICAgcHJpdmF0ZSBQbHVnaW5NYW5hZ2VyKENvbnRleHQgY29udGV4dCkgeworICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBzeW5jaHJvbml6ZWQgUGx1Z2luTWFuYWdlciBnZXRJbnN0YW5jZShDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1JbnN0YW5jZSA9PSBudWxsKSB7CisgICAgICAgICAgICBpZiAoY29udGV4dCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJGaXJzdCBjYWxsIHRvIFBsdWdpbk1hbmFnZXIgbmVlZCBhIHZhbGlkIGNvbnRleHQuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtSW5zdGFuY2UgPSBuZXcgUGx1Z2luTWFuYWdlcihjb250ZXh0KTsKKyAgICAgICAgfQorICAg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AgICAgICAgICAgIFBMVUdJTl9BQ1RJT04pLCBQYWNrYWdlTWFuYWdlci5HRVRfU0VSVklDRVMpOworICAgICAgICBmb3IgKFJlc29sdmVJbmZvIGluZm8gOiBwbHVnaW5zKSB7CisgICAgICAgICAgICBTZXJ2aWNlSW5mbyBzZXJ2aWNlSW5mbyA9IGluZm8uc2VydmljZUluZm87CisgICAgICAgICAgICBpZiAoc2VydmljZUluZm8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIExvZy53KExPR1RBRywgIklnbm9yZSBiYWQgcGx1Z2luIik7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBQYWNrYWdlSW5mbyBwa2dJbmZvOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBwa2dJbmZvID0gcG0uZ2V0UGFja2FnZUluZm8oc2VydmljZUluZm8ucGFja2FnZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICBQYWNrYWdlTWFuYWdlci5HRVRfUEVSTUlTU0lPTlMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBQYWNrYWdlTWFuYWdlci5HRVRfU0lHTkFUVVJFUyk7CisgICAgICAgICAgICB9IGNhdGNoIChOYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KExPR1RBRywgIkNhbnQgZmluZCBwbHVnaW46ICIgKyBzZXJ2aWNlSW5mby5wYWNrYWdlTmFtZSk7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocGtnSW5mbyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdHJpbmcgZGlyZWN0b3J5ID0gcGtnSW5mby5hcHBsaWNhdGlvbkluZm8uZGF0YURpciArICIvbGliIjsKKyAgICAgICAgICAgIGlmIChkaXJlY3Rvcmllcy5jb250YWlucyhkaXJlY3RvcnkpKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdHJpbmcgcGVybWlzc2lvbnNbXSA9IHBrZ0luZm8ucmVxdWVzdGVkUGVybWlzc2lvbnM7CisgICAgICAgICAgICBpZiAocGVybWlzc2lvbnMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYm9vbGVhbiBwZXJtaXNzaW9uT2sgPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHBlcm1pdCA6IHBlcm1pc3Npb25zKSB7CisgICAgICAgICAgICAgICAgaWYgKFBMVUdJTl9QRVJNSVNTSU9OLmVxdWFscyhwZXJtaXQpKSB7CisgICAgICAgICAgICAgICAgICAgIHBlcm1pc3Npb25PayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghcGVybWlzc2lvbk9rKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTaWduYXR1cmUgc2lnbmF0dXJlc1tdID0gcGtnSW5mby5zaWduYXR1cmVzOworICAgICAgICAgICAgaWYgKHNpZ25hdHVyZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYm9vbGVhbiBzaWduYXR1cmVNYXRjaCA9IGZhbHNlOworICAgICAgICAgICAgZm9yIChTaWduYXR1cmUgc2lnbmF0dXJlIDogc2lnbmF0dXJlcykgeworICAgICAgICAgICAgICAgIC8vIFRPRE86IGNoZWNrIHNpZ25hdHVyZSBhZ2FpbnN0IEdvb2dsZSBwcm92aWRlZCBvbmUKKyAgICAgICAgICAgICAgICBzaWduYXR1cmVNYXRjaCA9IHRydWU7CisgICAgICAgICAgICAg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XRlUGFja2FnZUNvbnRleHQocGFja2FnZU5hbWUsCisgICAgICAgICAgICAgICAgICAgIENvbnRleHQuQ09OVEVYVF9JTkNMVURFX0NPREUgfAorICAgICAgICAgICAgICAgICAgICBDb250ZXh0LkNPTlRFWFRfSUdOT1JFX1NFQ1VSSVRZKTsKKyAgICAgICAgICAgIENsYXNzTG9hZGVyIHBsdWdpbkNMID0gcGx1Z2luQ29udGV4dC5nZXRDbGFzc0xvYWRlcigpOworCisgICAgICAgICAgICBDbGFzczw/PiBzdHViQ2xhc3MgPQorICAgICAgICAgICAgICAgICAgICBwbHVnaW5DTC5sb2FkQ2xhc3MoY2xhc3NOYW1lKTsKKyAgICAgICAgICAgIENvbnN0cnVjdG9yPD8+IHN0dWJDb25zdHJ1Y3RvciA9CisgICAgICAgICAgICAgICAgICAgIHN0dWJDbGFzcy5nZXRDb25zdHJ1Y3RvcihpbnQuY2xhc3MpOworICAgICAgICAgICAgT2JqZWN0IHN0dWJPYmplY3QgPSBzdHViQ29uc3RydWN0b3IubmV3SW5zdGFuY2UoTlBQKTsKKworICAgICAgICAgICAgaWYgKHN0dWJPYmplY3QgaW5zdGFuY2VvZiBQbHVnaW5TdHViKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIChQbHVnaW5TdHViKSBzdHViT2JqZWN0OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJUaGUgcGx1Z2luIGNsYXNzIGlzIG5vdCBvZiB0eXBlIFBsdWdpblN0dWIiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIC8vIEFueSBudW1iZXIgb2YgdGhpbmdzIGNvdWxkIGhhdmUgaGFwcGVuZWQuIExvZyB0aGUgZXhjZXB0aW9uIGFuZAorICAgICAgICAgICAgLy8gcmV0dXJuIG51bGwuIENhcmVmdWwgbm90IHRvIHVzZSBMb2cuZShMT0dUQU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XZhdGUgZmluYWwgaW50IEhBTkRMRV9SRVNQT05TRSA9IDEwMDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgSEFORExFX1JFU1BPTlNFID0gMTAwOwogCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgewogICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CiAgICAgICAgICAgICBjYXNlIEhBTkRMRV9SRVNQT05TRToKLSAgICAgICAgICAgICAgICBoYW5kbGVTc2xFcnJvclJlc3BvbnNlKG1zZy5hcmcxID09IDEpOworICAgICAgICAgICAgICAgIExvYWRMaXN0ZW5lciBsb2FkZXIgPSAoTG9hZExpc3RlbmVyKSBtc2cub2JqOworICAgICAgICAgICAgICAgIGhhbmRsZVNzbEVycm9yUmVzcG9uc2UobG9hZGVyLCBsb2FkZXIuc3NsRXJyb3IoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5hcmcxID09IDEpOwogICAgICAgICAgICAgICAgIGZhc3RQcm9jZXNzUXVldWVkU3NsRXJyb3JzKCk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KQEAgLTcyLDkgKzY5LDcgQEAKICAgICAvKioKICAgICAgKiBDcmVhdGVzIGEgbmV3IGVycm9yIGhhbmRsZXIgd2l0aCBhbiBlbXB0eSBsb2FkZXIgcXVldWUuCiAgICAgICovCi0gICAgLyogcGFja2FnZSAqLyBTc2xFcnJvckhhbmRsZXIoTmV0d29yayBuZXR3b3JrKSB7Ci0gICAgICAgIG1OZXR3b3JrID0gbmV0d29yazsKLQorICAgIC8qIHBhY2thZ2UgKi8gU3NsRXJyb3JIYW5kbGVyKCkgewogICAgICAgICBtTG9hZGVyUXVldWUgPSBuZXcgTGlua2VkTGlzdDxMb2FkTGlzdGVuZXI+KCk7CiAgICAgICAgIG1Tc2xQcmVmVGFibGUgPSBuZXcgQnVuZGxlKCk7CiAg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BoYW5kbGVTc2xFcnJvclJlcXVlc3QoTG9hZExpc3RlbmVyIGxvYWRlcikgewotICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuU1NMX0VSUk9SX0hBTkRMRVIpIHsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgIlNzbEVycm9ySGFuZGxlci5oYW5kbGVTc2xFcnJvclJlcXVlc3QoKTogIiArCiAgICAgICAgICAgICAgICAgICAidXJsPSIgKyBsb2FkZXIudXJsKCkpOwogICAgICAgICB9CkBAIC0xMzQsNiArMTI5LDI4IEBACiAgICAgfQogCiAgICAgLyoqCisgICAgICogQ2hlY2sgdGhlIHByZWZlcmVuY2UgdGFibGUgZm9yIGEgc3NsIGVycm9yIHRoYXQgaGFzIGFscmVhZHkgYmVlbiBzaG93bgorICAgICAqIHRvIHRoZSB1c2VyLgorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gc3luY2hyb25pemVkIGJvb2xlYW4gY2hlY2tTc2xQcmVmVGFibGUoTG9hZExpc3RlbmVyIGxvYWRlciwKKyAgICAgICAgICAgIFNzbEVycm9yIGVycm9yKSB7CisgICAgICAgIGZpbmFsIFN0cmluZyBob3N0ID0gbG9hZGVyLmhvc3QoKTsKKyAgICAgICAgZmluYWwgaW50IHByaW1hcnkgPSBlcnJvci5nZXRQcmltYXJ5RXJyb3IoKTsKKworICAgICAgICBpZiAoRGVidWdGbGFncy5TU0xfRVJST1JfSEFORExFUikgeworICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoaG9zdCAhPSBudWxsICYmIHByaW1hcnkgIT0gMCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobVNzbFByZWZUYWJsZS5jb250YWluc0tleShob3N0KSkgeworICAgICAgICAgICAgaWYgKHByaW1hcnkgPD0gbVNzbFByZWZUYWJsZS5nZXRJbnQoaG9zdCkpIHsKKyAgICAgICAgICAgICAgICBoYW5kbGVTc2xFcnJvclJlc3BvbnNlKGxvYWRlciwgZXJyb3IsIHRydWUpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKICAgICAgKiBQcm9jZXNzZXMgcXVldWVkIFNTTC1lcnJvciBjb25maXJtYXRpb24gcmVxdWVzdHMgaW4KICAgICAgKiBhIHRpZ2h0IGxvb3Agd2hpbGUgdGhlcmUgaXMgbm8gbmVlZCB0byBhc2sgdGhlIHVzZXIuCiAgICAgICovCkBAIC0xNTEsMjggKzE2OCwyNCBAQAogICAgICAgICBpZiAobG9hZGVyICE9IG51bGwpIHsKICAgICAgICAgICAgIC8vIGlmIHRoaXMgbG9hZGVyIGhhcyBiZWVuIGNhbmNlbGxlZAogICAgICAgICAgICAgaWYgKGxvYWRlci5jYW5jZWxsZWQoKSkgewotICAgICAgICAgICAgICAgIC8vIGdvIHRvIHRoZSBmb2xsb3dpbmcgbG9hZGVyIGluIHRoZSBxdWV1ZQorICAgICAgICAgICAgICAgIC8vIGdvIHRvIHRoZSBmb2xsb3dpbmcgbG9hZGVyIGluIHRoZSBxdWV1ZS4gTWFrZSBzdXJlIHRoaXMKKyAgICAgICAgICAgICAgICAvLyBsb2FkZXIgaGFzIGJlZW4gcmVtb3ZlZCBmcm9tIHRoZSBxdWV1ZS4KKyAgICAgICAgICAgICAgICBtTG9hZGVyUXVldWUucmVtb3ZlKGxvYWRlcik7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIFNzbEVycm9yIGVycm9yID0gbG9hZGVyLnNzbEVycm9yKCk7CiAKLSAgICAgICAgICAgIGlmIChXZWJWaWV3LkRFQlVHKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5TU0xfRVJST1JfSEFORExFUikgewogICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnROb3ROdWxsKGVycm9yKTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaW50IHByaW1hcnkgPSBlcnJvci5nZXRQcmltYXJ5RXJyb3IoKTsKLSAgICAgICAgICAgIFN0cmluZyBob3N0ID0gbG9hZGVyLmhvc3QoKTsKLQotICAgICAgICAgICAgaWYgKFdlYlZpZXcuREVCVUcpIHsKLSAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0VHJ1ZShob3N0ICE9IG51bGwgJiYgcHJpbWFyeSAhPSAwKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1Tc2xQcmVmVGFibGUuY29udGFpbnNLZXkoaG9zdCkpIHsKLSAgICAgICAgICAgICAgICBpZiAocHJpbWFyeSA8PSBtU3NsUHJlZlRhYmxlLmdldEludChob3N0KSkgewotICAgICAgICAgICAgICAgICAgICBoYW5kbGVTc2xFcnJvclJlc3BvbnNlKHRydWUpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBjaGVja1NzbFByZWZUYWJsZSB3aWxsIGhhbmRsZSB0aGUgc3NsIGVycm9yIHJlc3BvbnNlIGlmIHRoZQorICAgICAgICAgICAgLy8gYW5zd2VyIGlzIGF2YWlsYWJsZS4gSXQgZG9lcyBub3QgcmVtb3ZlIHRoZSBsb2FkZXIgZnJvbSB0aGUKKyAgICAgICAgICAgIC8vIHF1ZXVlLgorICAgICAgICAgICAgaWYgKGNoZWNrU3NsUHJlZlRhYmxlKGxvYWRlciwgZXJyb3IpKSB7CisgICAgICAgICAgICAgICAgbUxvYWRlclF1ZXVlLnJlbW92ZShsb2FkZXIpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvLyBpZiB3ZSBkbyBub3QgaGF2ZSBpbmZvcm1hdGlvbiBvbiByZWNvcmQsIGFzawpAQCAtMTg5LDcgKzIwMiw3IEB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JvY2VlZCkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5TU0xfRVJST1JfSEFORExFUikgewogICAgICAgICAgICAgQXNzZXJ0LmFzc2VydE5vdE51bGwobG9hZGVyKTsKKyAgICAgICAgICAgIEFzc2VydC5hc3NlcnROb3ROdWxsKGVycm9yKTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5TU0xfRVJST1JfSEFORExFUikgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiU3NsRXJyb3JIYW5kbGVyLmhhbmRsZVNzbEVycm9yUmVzcG9uc2UoKToiCiAgICAgICAgICAgICAgICAgICArICIgcHJvY2VlZDogIiArIHByb2NlZWQKICAgICAgICAgICAgICAgICAgICsgIiB1cmw6IiArIGxvYWRlci51cmwoKSk7CkBAIC0yMTgsMTYgKzIzMiwxNiBAQAogICAgICAgICBpZiAoIWxvYWRlci5jYW5jZWxsZWQoKSkgewogICAgICAgICAgICAgaWYgKHByb2NlZWQpIHsKICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIHVzZXIncyBTU0wgZXJyb3IgcHJlZmVyZW5jZSB0YWJsZQotICAgICAgICAgICAgICAgIGludCBwcmltYXJ5ID0gbG9hZGVyLnNzbEVycm9yKCkuZ2V0UHJpbWFyeUVycm9yKCk7CisgICAgICAgICAgICAgICAgaW50IHByaW1hcnkgPSBlcnJvci5nZXRQcmltYXJ5RXJyb3IoKTsKICAgICAgICAgICAgICAgICBTdHJpbmcgaG9zdCA9IGxvYWRlci5ob3N0KCk7CiAKLSAgICAgICAgICAgICAgICBpZiAoV2ViVmlldy5ERUJVRykgeworICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLlNTTF9FUlJPUl9IQU5ETEVSKSB7CiAgICAgICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKGhvc3QgIT0gbnVsbCAmJiBwcmltY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RhKCkgJiYgIW1IYW5kbGVyLmNhbmNlbGxlZCgpKTsKICAgICAgICAgICAgICAgICBjbG9zZVN0cmVhbUFuZFNlbmRFbmREYXRhKCk7CiAgICAgICAgICAgICAgICAgbUhhbmRsZXIubG9hZFN5bmNocm9ub3VzTWVzc2FnZXMoKTsKICAgICAgICAgICAgIH0KQEAgLTExMyw5ICsxMTMsMTMgQEAKICAgICAgKiBAc2VlIGFuZHJvaWQub3MuSGFuZGxlciNoYW5kbGVNZXNzYWdlKGFuZHJvaWQub3MuTWVzc2FnZSkKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7Ci0gICAgICAgIGlmIChXZWJWaWV3LkRFQlVHICYmIG1IYW5kbGVyLmlzU3luY2hyb25vdXMoKSkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5TVFJFQU1fTE9BREVSICYmIG1IYW5kbGVyLmlzU3luY2hyb25vdXMoKSkgewogICAgICAgICAgICAgdGhyb3cgbmV3IEFzc2VydGlvbkVycm9yKCk7CiAgICAgICAgIH0KKyAgICAgICAgaWYgKG1IYW5kbGVyLmNhbmNlbGxlZCgpKSB7CisgICAgICAgICAgICBjbG9zZVN0cmVhbUFuZFNlbmRFbmREYXRhKCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KICAgICAgICAgc3dpdGNoKG1zZy53aGF0KSB7CiAgICAgICAgICAgICBjYXNlIE1TR19TVEFUVVM6CiAgICAgICAgICAgICAgICAgaWYgKHNldHVwU3RyZWFtQW5kU2VuZFN0YXR1cygpKSB7CkBAIC0xNTMsNyArMTU3LDYgQEAKICAgICAgICAgaWYgKG1Db250ZW50TGVuZ3RoID4gMCkgewogICAgICAgICAgICAgaGVhZGVycy5zZXRDb250ZW50TGVuZ3RoKG1Db250ZW50TGVuZ3RoKTsKICAgICAgICAgfQotICAgICAgICBoZWFkZXJzLnNldENhY2hlQ29udHJvbChOT19TVE9SRSk7CiAg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SAgICAgICAgICAgICAgICBzZW5kRG9tRXZlbnQoZXZlbnQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIHN1cGVyLmRpc3BhdGNoS2V5RXZlbnQoZXZlbnQpOwotICAgICAgICB9IGVsc2UgaWYgKEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVIgPT0ga2V5Q29kZSkgewotICAgICAgICAgICAgLy8gTm90ZSB0aGF0IHRoaXMgaGFuZGxlcyBjZW50ZXIga2V5IGFuZCB0cmFja2JhbGwuCi0gICAgICAgICAgICBpZiAoaXNQb3B1cFNob3dpbmcoKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBzdXBlci5kaXNwYXRjaEtleUV2ZW50KGV2ZW50KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIENlbnRlciBrZXkgc2hvdWxkIGJlIHBhc3NlZCB0byBhIHBvdGVudGlhbCBvbkNsaWNrCi0gICAgICAgICAgICBpZiAoIWRvd24pIHsKLSAgICAgICAgICAgICAgICBtV2ViVmlldy5zaG9ydFByZXNzT25UZXh0RmllbGQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIFBhc3MgdG8gc3VwZXIgdG8gaGFuZGxlIGxvbmdwcmVzcy4KLSAgICAgICAgICAgIHJldHVybiBzdXBlci5kaXNwYXRjaEtleUV2ZW50KGV2ZW50KTsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIEVuc3VyZSB0aGVyZSBpcyBhIGxheW91dCBzbyBhcnJvdyBrZXlzIGFyZSBoYW5kbGVkIHByb3Blcmx5LgotICAgICAgICBpZiAoZ2V0TGF5b3V0KCkgPT0gbnVsbCkgewotICAgICAgICAgICAgbWVhc3VyZShtV2lkdGhTcGVjLCBtSGVpZ2h0U3BlYyk7Ci0gICAgICAgIH0KLSAgICAgICAgaW50IG9sZFN0YXJ0ID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvblN0YXJ0KHRleHQpOwotICAgICAgICBpbnQ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IC8vIGNhc2UsIGlmIHRoZSBzdHJpbmcgd2FzIGFscmVhZHkgYXQgdGhlIG1heCBsZW5ndGgsIGFuCi0gICAgICAgICAgICAvLyBhbHBoYW51bWVyaWMga2V5IHdpbGwgYmUgZXJhc2VkIGJ5IHRoZSBMZW5ndGhGaWx0ZXIsCi0gICAgICAgICAgICAvLyBzbyBkbyBub3QgcGFzcyBkb3duIHRvIGphdmFzY3JpcHQsIGFuZCBpbnN0ZWFkCi0gICAgICAgICAgICAvLyByZXR1cm4gdHJ1ZS4gIElmIGl0IGlzIGFuIGFycm93IGtleSBvciBhIGRlbGV0ZSBrZXksIHdlIGNhbiBnbwotICAgICAgICAgICAgLy8gYWhlYWQgYW5kIHBhc3MgaXQgZG93bi4KLSAgICAgICAgICAgIGJvb2xlYW4gaXNBcnJvd0tleTsKLSAgICAgICAgICAgIHN3aXRjaChrZXlDb2RlKSB7Ci0gICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfTEVGVDoKLSAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9SSUdIVDoKLSAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUDoKLSAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOOgotICAgICAgICAgICAgICAgICAgICBpc0Fycm93S2V5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSOgotICAgICAgICAgICAgICAgICAgICAvLyBGb3IgbXVsdGktbGluZSB0ZXh0IGJveGVzLCBuZXdsaW5lcyB3aWxsCi0gICAgICAgICAgICAgICAgICAgIC8vIHRyaWdnZXIgb25UZXh0Q2hhbmdlZCBmb3Iga2V5IGRvd24gKHdoaWNoIHdpbGwgc2VuZCBib3RoCi0gICAgICAgICAgICAgICAgICAgIC8vIGtleSB1cCBhbmQga2V5IGRvd24pIGJ1dCBub3Qga2V5IHVwLgotICAgICAgICAgICAgICAgICAgICBtR290RW50ZXJEb3duID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBpc0Fycm93S2V5ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1heGVkT3V0ICYmICFpc0Fycm93S2V5ICYmIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9ERUwpIHsKLSAgICAgICAgICAgICAgICBpZiAob2xkRW5kID09IG9sZFN0YXJ0KSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFJldHVybiB0cnVlIHNvIHRoZSBrZXkgZ2V0cyBkcm9wcGVkLgotICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsVG9BY2NvbW1vZGF0ZUN1cnNvciA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIW9sZFRleHQuZXF1YWxzKGdldFRleHQoKS50b1N0cmluZygpKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRTogVGhpcyBtYWtlcyB0aGUgdGV4dCB3b3JrIHByb3Blcmx5LCBidXQgaXQKLSAgICAgICAgICAgICAgICAgICAgLy8gZG9lcyBub3QgcGFzcyBkb3duIHRoZSBrZXkgZXZlbnQsIHNvIGl0IG1heSBub3QKLSAgICAgICAgICAgICAgICAgICAgLy8gd29yayBmb3IgYSB0ZXh0ZmllbGQgdGhhdCBoYXMgdGhlIHR5cGUgb2YKLSAgICAgICAgICAgICAgICAgICAgLy8gYmVoYXZpb3Igb2YgR29vZ2xlU3VnZ2VzdC4gIFRoYXQgc2FpZCwgaXQgaXMKLSAgICAgICAgICAgICAgICAgICAgLy8gdW5saWtlbHkgdGhhdCBhIHNpdGUgd291bGQgY29tYmluZSB0aGUgdHdvIGluCi0gICAgICAgICAgICAgICAgICAgIC8vIG9uZSB0ZXh0ZmllbGQuCi0gICAgICAgICAgICAgICAgICAgIFNwYW5uYWJsZSBzcGFuID0gKFNwYW5uYWJsZSkgZ2V0VGV4dCgpOwotICAgICAgICAgICAgICAgICAgICBpbnQgbmV3U3RhcnQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uU3RhcnQoc3Bhbik7Ci0gICAgICAgICAgICAgICAgICAgIGludCBuZXdFbmQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKHNwYW4pOwotICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5yZXBsYWNlVGV4dGZpZWxkVGV4dCgwLCBvbGRMZW5ndGgsIHNwYW4udG9TdHJpbmcoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdTdGFydCwgbmV3RW5kKTsKLSAgICAgICAgICAgICAgICAgICAgbVNjcm9sbFRvQWNjb21tb2RhdGVDdXJzb3IgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoaXNBcnJvd0tleSkgewotICAgICAgICAgICAgICAgIC8vIEFycm93IGtleSBkb2VzIG5vdCBjaGFuZ2UgdGhlIHRleHQsIGJ1dCB3ZSBzdGlsbCB3YW50IHRvIHNlbmQKLSAgICAgICAgICAgICAgICAvLyB0aGUgRE9NIGV2ZW50cy4KLSAgICAgICAgICAgICAgICBzZW5kRG9tRXZlbnQoZXZlbnQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVNjcm9sbFRvQWNjb21tb2RhdGVDdXJzb3IgPSB0cnVlOwotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgLy8gRklYTUU6IFRleHRWaWV3cyByZXR1cm4gZmFsc2UgZm9yIHVwIG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AgICAgICAgICAgICAgICAgIChUZXh0Vmlldykgc3VwZXIuZ2V0Vmlldyhwb3NpdGlvbiwgY29udmVydFZpZXcsIHBhcmVudCk7Ci0gICAgICAgICAgICBpZiAodHYgIT0gbnVsbCAmJiBtVGV4dFZpZXcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHR2LnNldFRleHRTaXplKG1UZXh0Vmlldy5nZXRUZXh0U2l6ZSgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiB0djsKLSAgICAgICAgfQotCi0gICAgICAgIC8qKgotICAgICAgICAgKiBTZXQgdGhlIFRleHRWaWV3IHNvIHdlIGNhbiBtYXRjaCBpdHMgdGV4dCBzaXplLgotICAgICAgICAgKi8KLSAgICAgICAgcHJpdmF0ZSB2b2lkIHNldFRleHRWaWV3KFRleHRWaWV3IHR2KSB7Ci0gICAgICAgICAgICBtVGV4dFZpZXcgPSB0djsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIERldGVybWluZSB3aGV0aGVyIHRvIHVzZSB0aGUgc3lzdGVtLXdpZGUgcGFzc3dvcmQgZGlzZ3Vpc2luZyBtZXRob2QsCi0gICAgICogb3IgdG8gdXNlIG5vbmUuCi0gICAgICogQHBhcmFtICAgaW5QYXNzd29yZCAgVHJ1ZSBpZiB0aGUgdGV4dGZpZWxkIGlzIGEgcGFzc3dvcmQgZmllbGQuCi0gICAgICovCi0gICAgLyogcGFja2FnZSAqLyB2b2lkIHNldEluUGFzc3dvcmQoYm9vbGVhbiBpblBhc3N3b3JkKSB7Ci0gICAgICAgIGlmIChpblBhc3N3b3JkKSB7Ci0gICAgICAgICAgICBzZXRJbnB1dFR5cGUoRWRpdG9ySW5mby5UWVBFX0NMQVNTX1RFWFQgfCBFZGl0b3JJbmZvLgotICAgICAgICAgICAgICAgICAgICBUWVBFX1RFWFRfVkFSSUFUSU9OX1BBU1NXT1JEKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIHB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WQvd2Via2l0L1VSTFV0aWwuamF2YQppbmRleCA5ODg5ZmU5Li4yMzJlZDM2IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvVVJMVXRpbC5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9VUkxVdGlsLmphdmEKQEAgLTYxLDcgKzYxLDcgQEAKICAgICAgICAgICAgIHdlYkFkZHJlc3MgPSBuZXcgV2ViQWRkcmVzcyhpblVybCk7CiAgICAgICAgIH0gY2F0Y2ggKFBhcnNlRXhjZXB0aW9uIGV4KSB7CiAKLSAgICAgICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuVVJMX1VUSUwpIHsKICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJzbWFydFVybEZpbHRlcjogZmFpbGVkIHRvIHBhcnNlIHVybCA9ICIgKyBpblVybCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gcmV0VmFsOwpAQCAtMTI2LDYgKzEyNiwzMiBAQAogICAgICAgICByZXR1cm4gcmV0RGF0YTsKICAgICB9CiAKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRydWUgaWZmIHRoZSB1cmwgaXMgY29ycmVjdGx5IFVSTCBlbmNvZGVkCisgICAgICovCisgICAgc3RhdGljIGJvb2xlYW4gdmVyaWZ5VVJMRW5jb2RpbmcoU3RyaW5nIHVybCkgeworICAgICAgICBpbnQgY291bnQgPSB1cmwubGVuZ3RoKCk7CisgICAgICAgIGlmIChjb3VudCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBpbnQgaW5kZXggPSB1cmwuaW5kZXhPZignJScpOworICAgICAgICB3aGlsZSAoaW5kZXggPj0gMCAmJiBpbmRleCA8IGNvdW50KSB7CisgICAgICAgICAgICBpZiAoaW5kZXggPCBjb3VudCAtIDIpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBwYXJzZUhleCgoYnl0ZSkgdXJsLmNoYXJBdCgrK2luZGV4KSk7CisgICAgICAgICAgICAgICAgICAgIHBhcnNlSGV4KChieXRlKSB1cmwuY2hhckF0KCsraW5kZXgpKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbmRleCA9IHVybC5pbmRleE9mKCclJywgaW5kZXggKyAxKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKICAgICBwcml2YXRlIHN0YXRpYyBpbnQgcGFyc2VIZXgoYnl0ZSBiKSB7CiAgICAgICAgIGlmIChiID49ICcwJyAmJiBiIDw9ICc5JykgcmV0dXJuIChiIC0gJzAnKTsKICAgICAgICAgaWYgKGIgPj0gJ0EnICYmIGIgPD0gJ0YnKSByZXR1cm4gKGIgLSAnQScgKyAxMCk7CkBAIC0xNDYsNiArMTcyLDcgQEAKICAgICAgKiByZXF1ZXN0cyBmcm9tIGEgZmlsZSB1cmwuCiAgICAgICogQGRlcHJlY2F0ZWQgQ29va2llbGVzcyBwcm94eSBpcyBubyBsb25nZXIgc3VwcG9ydGVkLgogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN0YXRpYyBib29sZWFuIGlzQ29va2llbGVzc1Byb3h5VXJsKFN0cmluZyB1cmwpIHsKICAgICAgICAgcmV0dXJuIChudWxsICE9IHVybCkgJiYgdXJsLnN0YXJ0c1dpdGgoUFJPWFlfQkFTRSk7CiAgICAgfQpkaWZmIC0tZ2l0IGEvY29yZS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wcml2YXRlIGJvb2xlYW4gbUhpZGRlbjsKKworICAgIGNsYXNzIENoaWxkVmlldyB7CisgICAgICAgIGludCB4OworICAgICAgICBpbnQgeTsKKyAgICAgICAgaW50IHdpZHRoOworICAgICAgICBpbnQgaGVpZ2h0OworICAgICAgICBWaWV3IG1WaWV3OyAvLyBnZW5lcmljIHZpZXcgdG8gc2hvdworCisgICAgICAgIENoaWxkVmlldygpIHsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgc2V0Qm91bmRzKGludCB4LCBpbnQgeSwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgICAgICB0aGlzLnggPSB4OworICAgICAgICAgICAgdGhpcy55ID0geTsKKyAgICAgICAgICAgIHRoaXMud2lkdGggPSB3aWR0aDsKKyAgICAgICAgICAgIHRoaXMuaGVpZ2h0ID0gaGVpZ2h0OworICAgICAgICB9CisKKyAgICAgICAgdm9pZCBhdHRhY2hWaWV3KGludCB4LCBpbnQgeSwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgICAgICBpZiAobVZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNldEJvdW5kcyh4LCB5LCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgIGZpbmFsIEFic29sdXRlTGF5b3V0LkxheW91dFBhcmFtcyBscCA9CisgICAgICAgICAgICAgICAgICAgIG5ldyBBYnNvbHV0ZUxheW91dC5MYXlvdXRQYXJhbXMoY3R2RCh3aWR0aCksIGN0dkQoaGVpZ2h0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHZYKHgpLCBjdHZZKHkpKTsKKyAgICAgICAgICAgIG1XZWJWaWV3Lm1Qcml2YXRlSGFuZGxlci5wb3N0KG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgbWV0aG9kIG1heSBiZSBjYWxsZWQgbXVsdGlwbGUgdGltZXMuIElmIHRoZSB2aWV3IGlzCisgICAgICAgICAgICAgICAgICAgIC8vIGFscmVhZHkgYXR0YWNoZWQsIGp1c3Qgc2V0IHRoZSBuZXcgTGF5b3V0UGFyYW1zLAorICAgICAgICAgICAgICAgICAgICAvLyBvdGhlcndpc2UgYXR0YWNoIHRoZSB2aWV3IGFuZCBhZGQgaXQgdG8gdGhlIGxpc3Qgb2YKKyAgICAgICAgICAgICAgICAgICAgLy8gY2hpbGRyZW4uCisgICAgICAgICAgICAgICAgICAgIGlmIChtVmlldy5nZXRQYXJlbnQoKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVmlldy5zZXRMYXlvdXRQYXJhbXMobHApOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgYXR0YWNoVmlld09uVUlUaHJlYWQobHApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIGF0dGFjaFZpZXdPblVJVGhyZWFkKEFic29sdXRlTGF5b3V0LkxheW91dFBhcmFtcyBscCkgeworICAgICAgICAgICAgbVdlYlZpZXcuYWRkVmlldyhtVmlldywgbHApOworICAgICAgICAgICAgbUNoaWxkcmVuLmFkZCh0aGlzKTsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgcmVtb3ZlVmlldygpIHsKKyAgICAgICAgICAgIGlmIChtVmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVmlld09uVUlUaHJlYWQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgcmVtb3ZlVmlld09uVUlUaHJlYWQoKSB7CisgICAgICAgICAgICBtV2ViVmlldy5yZW1vdmVWaWV3KG1WaWV3KTsKKyAgICAgICAgICAgIG1DaGlsZHJlbi5yZW1vdmUodGhpcyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBWaWV3TWFuYWdlcihXZWJWaWV3IHcpIHsKKyAgICAgICAgbVdlYlZpZXcgPSB3OworICAgIH0KKworICAgIENoaWxkVmlldyBjcmVhdGVWaWV3KCkgeworICAgICAgICByZXR1cm4gbmV3IENoaWxkVmlldygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNob3J0aGFuZCBmb3IgY2FsbGluZyBtV2ViVmlldy5jb250ZW50VG9WaWV3RGltZW5zaW9uLiAgVXNlZCB3aGVuCisgICAgICogb2J0YWluaW5nIGEgdmlldyBkaW1lbnNpb24gZnJvbSBhIGNvbnRlbnQgZGltZW5zaW9uLCB3aGV0aGVyIGl0IGJlIGluIHgKKyAgICAgKiBvciB5LgorICAgICAqLworICAgIHByaXZhdGUgaW50IGN0dkQoaW50IHZhbCkgeworICAgICAgICByZXR1cm4gbVdlYlZpZXcuY29udGVudFRvVmlld0RpbWVuc2lvbih2YWwpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNob3J0aGFuZCBmb3IgY2FsbGluZyBtV2ViVmlldy5jb250ZW50VG9WaWV3WC4gIFVzZWQgd2hlbiBvYnRhaW5pbmcgYQorICAgICAqIHZpZXcgeCBjb29yZGluYXRlIGZyb20gYSBjb250ZW50IHggY29vcmRpbmF0ZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBjdHZYKGludCB2YWwpIHsKKyAgICAgICAgcmV0dXJuIG1XZWJWaWV3LmNvbnRlbnRUb1ZpZXdYKHZhbCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2hvcnRoYW5kIGZvciBjYWxsaW5nIG1XZWJWaWV3LmNvbnRlbnRUb1ZpZXdZLiAgVXNlZCB3aGVuIG9idGFpbmluZyBhCisgICAgICogdmlldyB5IGNvb3JkaW5hdGUgZnJvbSBhIGNvbnRlbnQgeSBjb29yZGluYXRlLgorICAgICAqLworICAgIHByaXZhdGUgaW50IGN0dlkoaW50IHZhbCkgeworICAgICAgICByZXR1cm4gbVdlYlZpZXcuY29udGVudFRvVmlld1kodmFsKTsKKyAgICB9CisKKyAgICB2b2lkIHNjYWxlQWxsKCkgeworICAgICAgICBmb3IgKENoaWxkVmlldyB2IDogbUNoaWxkcmVuKSB7CisgICAgICAgICAgICBWaWV3IHZpZXcgPSB2Lm1WaWV3OworICAgICAgICAgICAgQWJzb2x1dGVMYXlvdXQuTGF5b3V0UGFyYW1zIGxwID0KKyAgICAgICAgICAgICAgICAgICAgKEFic29sdXRlTGF5b3V0LkxheW91dFBhcmFtcykgdmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgICAgIGxwLndpZHRoID0gY3R2RCh2LndpZHRoKTsKKyAgICAgICAgICAgIGxwLmhlaWdodCA9IGN0dkQodi5oZWlnaHQpOworICAgICAgICAgICAgbHAueCA9IGN0dlgodi54KTsKKyAgICAgICAgICAgIGxwLnkgPSBjdHZZKHYueSk7CisgICAgICAgICAgICB2aWV3LnNldExheW91dFBhcmFtcyhscCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIGhpZGVBbGwoKSB7CisgICAgICAgIGlmIChtSGlkZGVuKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgZm9yIChDaGlsZFZpZXcgdiA6IG1DaGlsZHJlbikgeworICAgICAgICAgICAgdi5tVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgIH0KKyAgICAgICAgbUhpZGRlbiA9IHRydWU7CisgICAgfQorCisgICAgdm9pZCBz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Wlzc2lvbnNNYW5hZ2VyOworICAgIC8vIE1hbmFnZXMgaW50ZXJhY3Rpb24gb2YgdGhlIHN5c3RlbSBzZXR0aW5nICdMb2NhdGlvbiAmIHNlY3VyaXR5IC0gU2hhcmUKKyAgICAvLyB3aXRoIEdvb2dsZScgYW5kIHRoZSBicm93c2VyLgorICAgIHN0YXRpYyBHb29nbGVMb2NhdGlvblNldHRpbmdNYW5hZ2VyIHNHb29nbGVMb2NhdGlvblNldHRpbmdNYW5hZ2VyOwogCiAgICAgLy8gQ2xhc3MgdG8gaGFuZGxlIG1lc3NhZ2VzIGJlZm9yZSBXZWJDb3JlIGlzIHJlYWR5LgogICAgIHByaXZhdGUgY2xhc3MgRXZlbnRIYW5kbGVyIHsKQEAgLTE5OSw3ICsyMTMsNiBAQAogICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNZTkM6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChXZWJTZXR0aW5ncy50aGlzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrR2VhcnNQZXJtaXNzaW9ucygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUJyb3dzZXJGcmFtZS5tTmF0aXZlRnJhbWUgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU3luYyhtQnJvd3NlckZyYW1lLm1OYXRpdmVGcmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTI0NywxMyArMjYwLDEzIEBACiAKICAgICAvLyBVc2VyIGFnZW50IHN0cmluZ3MuCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIERFU0tUT1BfVVNFUkFHRU5UID0KLSAgICAgICAgICAgICJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBVOyBJbn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AgICAgCkBAIC0zNDcsMTEgKzM2MCwxMyBAQAogICAgICAgICAgICAgLy8gZGVmYXVsdCB0byAiZW4iCiAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCJlbiIpOwogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBmaW5hbCBTdHJpbmcgbW9kZWwgPSBCdWlsZC5NT0RFTDsKLSAgICAgICAgaWYgKG1vZGVsLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiOyAiKTsKLSAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQobW9kZWwpOworICAgICAgICAvLyBhZGQgdGhlIG1vZGVsIGZvciB0aGUgcmVsZWFzZSBidWlsZAorICAgICAgICBpZiAoIlJFTCIuZXF1YWxzKEJ1aWxkLlZFUlNJT04uQ09ERU5BTUUpKSB7CisgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbW9kZWwgPSBCdWlsZC5NT0RFTDsKKyAgICAgICAgICAgIGlmIChtb2RlbC5sZW5ndGgoKSA+IDApIHsKKyAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCI7ICIpOworICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQobW9kZWwpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGZpbmFsIFN0cmluZyBpZCA9IEJ1aWxkLklEOwogICAgICAgICBpZiAoaWQubGVuZ3RoKCkgPiAwKSB7CkBAIC00MjEsNiArNDM2LDIyIEBACiAgICAgfQogCiAgICAgLyoqCisgICAgICogU2V0IHdoZXRoZXIgdGhlIFdlYlZpZXcgbG9hZHMgYSBwYWdlIHdpdGggb3ZlcnZpZXcgbW9kZS4KKyAgICAgKiBAaGlkZSBQZW5kaW5nIEFQSSBjb3VuY2lsIGFwcHJvdmFsCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0TG9hZFdpdGhPdmVydmlld01vZGUoYm9vbGVhbiBvdmVydmlldykgeworICAgICAgICBtTG9hZFdp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RyZWUgIT0gdXNlKSB7Ci0gICAgICAgICAgICBtVXNlRG91YmxlVHJlZSA9IHVzZTsKLSAgICAgICAgICAgIHBvc3RTeW5jKCk7Ci0gICAgICAgIH0KKyAgICAgICAgcmV0dXJuOwogICAgIH0KIAogICAgIC8qKgotICAgICAqIFJldHVybiB0cnVlIGlmIHRoZSBXZWJWaWV3IGlzIHVzaW5nIHRoZSBkb3VibGUgdHJlZSByZW5kZXJpbmcgYWxnb3JpdGhtLgotICAgICAqIEByZXR1cm4gVHJ1ZSBpZiB0aGUgV2ViVmlldyBpcyB1c2luZyB0aGUgZG91YmxlIHRyZWUgcmVuZGVyaW5nCi0gICAgICogICAgICAgICBhbGdvcml0aG0uCisgICAgICogQGRlcHJlY2F0ZWQgVGhpcyBzZXR0aW5nIGNvbnRyb2xsZWQgYSByZW5kZXJpbmcgb3B0aW1pemF0aW9uCisgICAgICogdGhhdCBpcyBubyBsb25nZXIgcHJlc2VudC4gU2V0dGluZyBpdCBub3cgaGFzIG5vIGVmZmVjdC4KICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBnZXRVc2VEb3VibGVUcmVlKCkgewotICAgICAgICByZXR1cm4gbVVzZURvdWJsZVRyZWU7CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKICAgICAvKioKQEAgLTYzMyw3ICs2NjEsNyBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIFJldHVybiB0aGUgY3VycmVudCBsYXlvdXQgYWxnb3JpdGhtLgorICAgICAqIFJldHVybiB0aGUgY3VycmVudCBsYXlvdXQgYWxnb3JpdGhtLiBUaGUgZGVmYXVsdCBpcyBOQVJST1dfQ09MVU1OUy4KICAgICAgKiBAcmV0dXJuIExheW91dEFsZ29yaXRobSBlbnVtIHZhbHVlIGRlc2NyaWJpbmcgdGhlIGxheW91dCBhbGdvcml0aG0KICAgICAgKiAgICAgICAgIGJlaW5nIHVzZ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Tc3MCw3ICs3OTgsNyBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIEdldCB0aGUgbWluaW11bSBmb250IHNpemUuCisgICAgICogR2V0IHRoZSBtaW5pbXVtIGZvbnQgc2l6ZS4gVGhlIGRlZmF1bHQgaXMgOC4KICAgICAgKiBAcmV0dXJuIEEgbm9uLW5lZ2F0aXZlIGludGVnZXIgYmV0d2VlbiAxIGFuZCA3Mi4KICAgICAgKi8KICAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRNaW5pbXVtRm9udFNpemUoKSB7CkBAIC03OTEsNyArODE5LDcgQEAKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBHZXQgdGhlIG1pbmltdW0gbG9naWNhbCBmb250IHNpemUuCisgICAgICogR2V0IHRoZSBtaW5pbXVtIGxvZ2ljYWwgZm9udCBzaXplLiBUaGUgZGVmYXVsdCBpcyA4LgogICAgICAqIEByZXR1cm4gQSBub24tbmVnYXRpdmUgaW50ZWdlciBiZXR3ZWVuIDEgYW5kIDcyLgogICAgICAqLwogICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldE1pbmltdW1Mb2dpY2FsRm9udFNpemUoKSB7CkBAIC04MTIsNyArODQwLDcgQEAKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBHZXQgdGhlIGRlZmF1bHQgZm9udCBzaXplLgorICAgICAqIEdldCB0aGUgZGVmYXVsdCBmb250IHNpemUuIFRoZSBkZWZhdWx0IGlzIDE2LgogICAgICAqIEByZXR1cm4gQSBub24tbmVnYXRpdmUgaW50ZWdlciBiZXR3ZWVuIDEgYW5kIDcyLgogICAgICAqLwogICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldERlZmF1bHRGb250U2l6ZSgpIHsKQEAgLTgzMyw3ICs4NjEsNyBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIEdldCB0aGUgZGVmYXVsdCBmaXhlZCBmb250IHNpemUuCisgICAgICogR2V0IHRoZSBkZWZh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dGgoU3RyaW5nIGFwcENhY2hlUGF0aCkgeworICAgICAgICBpZiAoYXBwQ2FjaGVQYXRoICE9IG51bGwgJiYgIWFwcENhY2hlUGF0aC5lcXVhbHMobUFwcENhY2hlUGF0aCkpIHsKKyAgICAgICAgICAgIG1BcHBDYWNoZVBhdGggPSBhcHBDYWNoZVBhdGg7CisgICAgICAgICAgICBwb3N0U3luYygpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHRoZSBtYXhpbXVtIHNpemUgZm9yIHRoZSBBcHBsaWNhdGlvbiBDYWNoZXMgY29udGVudC4KKyAgICAgKiBAcGFyYW0gYXBwQ2FjaGVNYXhTaXplIHRoZSBtYXhpbXVtIHNpemUgaW4gYnl0ZXMuCisgICAgICoKKyAgICAgKiBAaGlkZSBwZW5kaW5nIGFwaSBjb3VuY2lsIGFwcHJvdmFsCisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldEFwcENhY2hlTWF4U2l6ZShsb25nIGFwcENhY2hlTWF4U2l6ZSkgeworICAgICAgICBpZiAoYXBwQ2FjaGVNYXhTaXplICE9IG1BcHBDYWNoZU1heFNpemUpIHsKKyAgICAgICAgICAgIG1BcHBDYWNoZU1heFNpemUgPSBhcHBDYWNoZU1heFNpemU7CisgICAgICAgICAgICBwb3N0U3luYygpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHdoZXRoZXIgdGhlIGRhdGFiYXNlIHN0b3JhZ2UgQVBJIGlzIGVuYWJsZWQuCisgICAgICogQHBhcmFtIGZsYWcgYm9vbGVhbiBUcnVlIGlmIHRoZSBXZWJWaWV3IHNob3VsZCB1c2UgdGhlIGRhdGFiYXNlIHN0b3JhZ2UKKyAgICAgKiAgICAgQVBJLgorICAgICAqLworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBzZXREYXRhYmFzZUVuYWJsZWQoYm9vbGVhbiBmbGFnKSB7CisgICAgICAgaWYg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isgICAgICAgICAgICBtV29ya2Vyc0VuYWJsZWQgPSBmbGFnOworICAgICAgICAgICAgcG9zdFN5bmMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgd2hldGhlciBHZW9sb2NhdGlvbiBpcyBlbmFibGVkLgorICAgICAqIEBwYXJhbSBmbGFnIFdoZXRoZXIgR2VvbG9jYXRpb24gc2hvdWxkIGJlIGVuYWJsZWQuCisgICAgICogQGhpZGUgcGVuZGluZyBhcGkgY291bmNpbCBhcHByb3ZhbAorICAgICAqLworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBzZXRHZW9sb2NhdGlvbkVuYWJsZWQoYm9vbGVhbiBmbGFnKSB7CisgICAgICAgIGlmIChtR2VvbG9jYXRpb25FbmFibGVkICE9IGZsYWcpIHsKKyAgICAgICAgICAgIG1HZW9sb2NhdGlvbkVuYWJsZWQgPSBmbGFnOworICAgICAgICAgICAgcG9zdFN5bmMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0cnVlIGlmIGphdmFzY3JpcHQgaXMgZW5hYmxlZC4gPGI+Tm90ZTogVGhlIGRlZmF1bHQgaXMgZmFsc2UuPC9iPgogICAgICAqIEByZXR1cm4gVHJ1ZSBpZiBqYXZhc2NyaXB0IGlzIGVuYWJsZWQuCiAgICAgICovCiAgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGdldEphdmFTY3JpcHRFbmFibGVkKCkgewpAQCAtOTY0LDExICsxMTMzLDEwIEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogUmV0dXJuIHRoZSBjdXJyZW50IHBhdGggdXNlZCBmb3IgcGx1Z2lucyBpbiB0aGUgV2ViVmlldy4KLSAgICAgKiBAcmV0dXJuIFRoZSBzdHJpbmcgcGF0aCB0byB0aGUgV2ViVmlldyBwbHVnaW5zLgorICAgICAqIFRPRE86IG5lZWQgdG8gYWRkIEBEZXByZWNhdGVk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bUxvY2submV3Q29uZGl0aW9uKCk7CisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBtVXBkYXRlQXZhaWxhYmxlOworCisgICAgLy8gTWVzc2FnZSBpZHMKKyAgICBzdGF0aWMgZmluYWwgaW50IFVQREFURSA9IDA7CisgICAgc3RhdGljIGZpbmFsIGludCBTRVRfUVVPVEFfT1JJR0lOID0gMTsKKyAgICBzdGF0aWMgZmluYWwgaW50IERFTEVURV9PUklHSU4gPSAyOworICAgIHN0YXRpYyBmaW5hbCBpbnQgREVMRVRFX0FMTCA9IDM7CisKKyAgICBwcml2YXRlIFNldCA8U3RyaW5nPiBtT3JpZ2luczsKKyAgICBwcml2YXRlIEhhc2hNYXAgPFN0cmluZywgTG9uZz4gbVF1b3RhcyA9IG5ldyBIYXNoTWFwPFN0cmluZywgTG9uZz4oKTsKKyAgICBwcml2YXRlIEhhc2hNYXAgPFN0cmluZywgTG9uZz4gbVVzYWdlcyA9IG5ldyBIYXNoTWFwPFN0cmluZywgTG9uZz4oKTsKKworICAgIHByaXZhdGUgSGFuZGxlciBtSGFuZGxlciA9IG51bGw7CisKKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBPcmlnaW4geworICAgICAgICBTdHJpbmcgbU9yaWdpbiA9IG51bGw7CisgICAgICAgIGxvbmcgbVF1b3RhID0gMDsKKworICAgICAgICBwdWJsaWMgT3JpZ2luKFN0cmluZyBvcmlnaW4sIGxvbmcgcXVvdGEpIHsKKyAgICAgICAgICAgIG1PcmlnaW4gPSBvcmlnaW47CisgICAgICAgICAgICBtUXVvdGEgPSBxdW90YTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBPcmlnaW4oU3RyaW5nIG9yaWdpbikgeworICAgICAgICAgICAgbU9yaWdpbiA9IG9yaWdpbjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0T3JpZ2luKCkgeworICAgICAgICAgICAgcmV0dXJuIG1PcmlnaW47CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgbG9uZyBnZXRRdW90YSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtUXVvdGE7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqIE1lc3NhZ2UgaGFuZGxlcgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNyZWF0ZUhhbmRsZXIoKSB7CisgICAgICAgIGlmIChtSGFuZGxlciA9PSBudWxsKSB7CisgICAgICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTRVRfUVVPVEFfT1JJR0lOOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgT3JpZ2luIHdlYnNpdGUgPSAoT3JpZ2luKSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldFF1b3RhRm9yT3JpZ2luKHdlYnNpdGUuZ2V0T3JpZ2luKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2Vic2l0ZS5nZXRRdW90YSgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIERFTEVURV9PUklHSU46IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcmlnaW4gd2Vic2l0ZSA9IChPcmlnaW4pIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlRGVsZXRlT3JpZ2luKHdlYnNpdGUuZ2V0T3JpZ2luKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgREVMRVRFX0FMTDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVEZWxldGVBbGxEYXRhKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNWYWx1ZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqIFJldHVybnMgYSBsaXN0IG9mIG9yaWdpbnMgaGF2aW5nIGEgZGF0YWJhc2UKKyAgICAgKi8KKyAgICBwdWJsaWMgU2V0IGdldE9yaWdpbnMoKSB7CisgICAgICAgIFNldCByZXQgPSBudWxsOworICAgICAgICBtTG9jay5sb2NrKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtVXBkYXRlQXZhaWxhYmxlID0gZmFsc2U7CisgICAgICAgICAgICB1cGRhdGUoKTsKKyAgICAgICAgICAgIHdoaWxlICghbVVwZGF0ZUF2YWlsYWJsZSkgeworICAgICAgICAgICAgICAgIG1VcGRhdGVDb25kaXRpb24uYXdhaXQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldCA9IG1PcmlnaW5zOworICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJFeGNlcHRpb24gd2hpbGUgd2FpdGluZyBvbiB0aGUgdXBkYXRlZCBvcmlnaW5zIiwgZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTG9jay51bmxvY2soKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICogUmV0dXJucyB0aGUgdXNlIGZvciBhIGdpdmVuIG9yaWdpbgorICAgICAqLworICAgIHB1YmxpYyBsb25nIGdldFVzYWdlRm9yT3JpZ2luKFN0cmluZyBvcmlnaW4pIHsKKyAgICAgICAgbG9uZyByZXQgPSAwOworICAgICAgICBpZiAob3JpZ2luID09IG51bGwpIHsKKyAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICB9CisgICAgICAgIG1Mb2NrLmxvY2soKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1VcGRhdGVBdmFpbGFibGUgPSBmYWxzZTsKKyAgICAgICAgICAgIHVwZGF0ZSgpOworICAgICAgICAgICAgd2hpbGUgKCFtVXBkYXRlQXZhaWxhYmxlKSB7CisgICAgICAgICAgICAgICAgbVVwZGF0ZUNvbmRpdGlvbi5hd2FpdCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9uZyB1c2FnZSA9IG1Vc2FnZXMuZ2V0KG9yaWdpbik7CisgICAgICAgICAgICBpZiAodXNhZ2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldCA9IHVzYWdlLmxvbmdWYWx1ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJFeGNlcHRpb24gd2hpbGUgd2FpdGluZyBvbiB0aGUgdXBkYXRlZCBvcmlnaW5zIiwgZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBtTG9jay51bmxvY2soKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlCisgICAgICogUmV0dXJucyB0aGUgcXVvdGEgZm9yIGEgZ2l2ZW4gb3JpZ2luCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0UXVvdGFGb3JPcmlnaW4oU3RyaW5nIG9yaWdpbikgeworICAgICAgICBsb25nIHJldCA9IDA7CisgICAgICAgIGlmIChvcmlnaW4gPT0gbnVsbCkgeworICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgIH0KKyAgICAgICAgbUxvY2subG9jaygpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbVVwZGF0ZUF2YWlsYWJsZSA9IGZhbHNlOworICAgICAgICAgICAgdXBkYXRlKCk7CisgICAgICAgICAgICB3aGlsZSAoIW1VcGRhdGVBdmFpbGFibGUpIHsKKyAgICAgICAgICAgICAgICBtVXBkYXRlQ29uZGl0aW9uLmF3YWl0KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBMb25nIHF1b3RhID0gbVF1b3Rhcy5nZXQob3JpZ2luKTsKKyAgICAgICAgICAgIGlmIChxdW90YSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0ID0gcXVvdGEubG9uZ1ZhbHVlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIkV4Y2VwdGlvbiB3aGlsZSB3YWl0aW5nIG9uIHRoZSB1cGRhdGVkIG9yaWdpbnMiLCBlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIG1Mb2NrLnVubG9jaygpOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKiBTZXQgdGhlIHF1b3RhIGZvciBhIGdpdmVuIG9yaWdpbgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFF1b3RhRm9yT3JpZ2luKFN0cmluZyBvcmlnaW4sIGxvbmcgcXVvdGEpIHsKKyAgICAgICAgaWYgKG9yaWdpbiAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAoV2ViVmlld0NvcmUuVEhSRUFEX05BTUUuZXF1YWxzKFRocmVhZC5jdXJyZW50VGhyZWFkKCkuZ2V0TmFtZSgpKSkgeworICAgICAgICAgICAgICAgIG5hdGl2ZVNldFF1b3RhRm9yT3JpZ2luKG9yaWdpbiwgcXVvdGEpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZShNZXNzYWdlLm9idGFpbihudWxsLCBTRVRfUVVPVEFfT1JJR0lOLAorICAgICAgICAgICAgICAgICAgICBuZXcgT3JpZ2luKG9yaWdpbiwgcXVvdGEpKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqIERlbGV0ZSBhIGdpdmVuIG9yaWdpbgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGRlbGV0ZU9yaWdpbihTdHJpbmcgb3JpZ2luKSB7CisgICAgICAgIGlmIChvcmlnaW4gIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKFdlYlZpZXdDb3JlLlRIUkVBRF9OQU1FLmVxdWFscyhUaHJlYWQuY3VycmVudFRocmVhZCgpLmdldE5hbWUoKSkpIHsKKyAgICAgICAgICAgICAgICBuYXRpdmVEZWxldGVPcmlnaW4ob3JpZ2luKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcG9zdE1lc3NhZ2UoTWVzc2FnZS5vYnRhaW4obnVsbCwgREVMRVRFX09SSUdJTiwKKyAgICAgICAgICAgICAgICAgICAgbmV3IE9yaWdpbihvcmlnaW4pKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqIERlbGV0ZSBhbGwgZGF0YWJhc2VzCisgICAgICovCisgICAgcHVibGljIHZvaWQgZGVsZXRlQWxsRGF0YSgpIHsKKyAgICAgICAgaWYgKFdlYlZpZXdDb3JlLlRI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uY3VycmVudFRocmVhZCgpLmdldE5hbWUoKSkpIHsKKyAgICAgICAgICAgIHN5bmNWYWx1ZXMoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHBvc3RNZXNzYWdlKE1lc3NhZ2Uub2J0YWluKG51bGwsIFVQREFURSkpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUnVuIG9uIHRoZSB3ZWJjb3JlIHRocmVhZAorICAgICAqIHNldCB0aGUgbG9jYWwgdmFsdWVzIHdpdGggdGhlIGN1cnJlbnQgb25lcworICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzeW5jVmFsdWVzKCkgeworICAgICAgICBtTG9jay5sb2NrKCk7CisgICAgICAgIFNldCB0bXAgPSBuYXRpdmVHZXRPcmlnaW5zKCk7CisgICAgICAgIG1PcmlnaW5zID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOworICAgICAgICBtUXVvdGFzLmNsZWFyKCk7CisgICAgICAgIG1Vc2FnZXMuY2xlYXIoKTsKKyAgICAgICAgSXRlcmF0b3I8U3RyaW5nPiBpdGVyID0gdG1wLml0ZXJhdG9yKCk7CisgICAgICAgIHdoaWxlIChpdGVyLmhhc05leHQoKSkgeworICAgICAgICAgICAgU3RyaW5nIG9yaWdpbiA9IGl0ZXIubmV4dCgpOworICAgICAgICAgICAgbU9yaWdpbnMuYWRkKG9yaWdpbik7CisgICAgICAgICAgICBtUXVvdGFzLnB1dChvcmlnaW4sIG5ldyBMb25nKG5hdGl2ZUdldFF1b3RhRm9yT3JpZ2luKG9yaWdpbikpKTsKKyAgICAgICAgICAgIG1Vc2FnZXMucHV0KG9yaWdpbiwgbmV3IExvbmcobmF0aXZlR2V0VXNhZ2VGb3JPcmlnaW4ob3JpZ2luKSkpOworICAgICAgICB9CisgICAgICAgIG1VcGRhdGVBdmFpbGFibGUgPSB0cnVlOworICAgICAgICBtVXBkYXRlQ29uZGl0aW9uLnNpZ25hbCgpOworICAgICAgICBtTG9jay51b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CA9PSBTWU5DX01FU1NBR0UpIHsKLSAgICAgICAgICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfU1lOQ19NQU5BR0VSKSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIioqKiBXZWJTeW5jTWFuYWdlciBzeW5jICoqKiIpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBzeW5jRnJvbVJhbVRvRmxhc2goKTsKQEAgLTk0LDcgKzk0LDcgQEAKICAgICAgKiBzeW5jKCkgZm9yY2VzIHN5bmMgbWFuYWdlciB0byBzeW5jIG5vdwogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHN5bmMoKSB7Ci0gICAgICAgIGlmIChXZWJWaWV3LkxPR1ZfRU5BQkxFRCkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfU1lOQ19NQU5BR0VSKSB7CiAgICAgICAgICAgICBMb2cudihMT0dUQUcsICIqKiogV2ViU3luY01hbmFnZXIgc3luYyAqKioiKTsKICAgICAgICAgfQogICAgICAgICBpZiAobUhhbmRsZXIgPT0gbnVsbCkgewpAQCAtMTA5LDcgKzEwOSw3IEBACiAgICAgICogcmVzZXRTeW5jKCkgcmVzZXRzIHN5bmMgbWFuYWdlcidzIHRpbWVyCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgcmVzZXRTeW5jKCkgewotICAgICAgICBpZiAoV2ViVmlldy5MT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1NZTkNfTUFOQUdFUikgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiKioqIFdlYlN5bmNNYW5hZ2VyIHJlc2V0U3luYyAqKioiKTsKICAgICAgICAgfQogICAgICAgICBpZiAobUhhbmRsZXIgPT0gbnVsbCkgewpAQCAtMTI0LDcgKzEyNCw3IEBACiAgICAgICogc3RhcnRT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WQuCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgSW5wdXRGaWx0ZXJbXSBOT19GSUxURVJTID0gbmV3IElucHV0RmlsdGVyWzBdOworCisgICAgLyoqCisgICAgICogQ3JlYXRlIGEgbmV3IFdlYlRleHRWaWV3LgorICAgICAqIEBwYXJhbSAgIGNvbnRleHQgVGhlIENvbnRleHQgZm9yIHRoaXMgV2ViVGV4dFZpZXcuCisgICAgICogQHBhcmFtICAgd2ViVmlldyBUaGUgV2ViVmlldyB0aGF0IGNyZWF0ZWQgdGhpcy4KKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIFdlYlRleHRWaWV3KENvbnRleHQgY29udGV4dCwgV2ViVmlldyB3ZWJWaWV3KSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQpOworICAgICAgICBtV2ViVmlldyA9IHdlYlZpZXc7CisgICAgICAgIG1NYXhMZW5ndGggPSAtMTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNwYXRjaEtleUV2ZW50KEtleUV2ZW50IGV2ZW50KSB7CisgICAgICAgIGlmIChldmVudC5pc1N5c3RlbSgpKSB7CisgICAgICAgICAgICByZXR1cm4gc3VwZXIuZGlzcGF0Y2hLZXlFdmVudChldmVudCk7CisgICAgICAgIH0KKyAgICAgICAgLy8gVHJlYXQgQUNUSU9OX0RPV04gYW5kIEFDVElPTiBNVUxUSVBMRSB0aGUgc2FtZQorICAgICAgICBib29sZWFuIGRvd24gPSBldmVudC5nZXRBY3Rpb24oKSAhPSBLZXlFdmVudC5BQ1RJT05fVVA7CisgICAgICAgIGludCBrZXlDb2RlID0gZXZlbnQuZ2V0S2V5Q29kZSgpOworCisgICAgICAgIGJvb2xlYW4gaXNBcnJvd0tleSA9IGZhbHNlOworICAgICAgICBzd2l0Y2goa2V5Q29kZSkgeworICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfTEVGVDoKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUOgorICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVA6CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOOgorICAgICAgICAgICAgICAgIGlmICghbVdlYlZpZXcubmF0aXZlQ3Vyc29yTWF0Y2hlc0ZvY3VzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRvd24gPyBtV2ViVmlldy5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpIDogbVdlYlZpZXcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAub25LZXlVcChrZXlDb2RlLCBldmVudCk7CisKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaXNBcnJvd0tleSA9IHRydWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFpc0Fycm93S2V5ICYmICFtT2theUZvckZvY3VzTm90VG9NYXRjaAorICAgICAgICAgICAgICAgICYmIG1XZWJWaWV3Lm5hdGl2ZUZvY3VzTm9kZVBvaW50ZXIoKSAhPSBtTm9kZVBvaW50ZXIpIHsKKyAgICAgICAgICAgIG1XZWJWaWV3Lm5hdGl2ZUNsZWFyQ3Vyc29yKCk7CisgICAgICAgICAgICAvLyBEbyBub3QgY2FsbCByZW1vdmUoKSBoZXJlLCB3aGljaCBoaWRlcyB0aGUgc29mdCBrZXlib2FyZC4gIElmCisgICAgICAgICAgICAvLyB0aGUgc29mdCBrZXlib2FyZCBpcyBiZWluZyBkaXNwbGF5ZWQsIHRoZSB1c2VyIHdpbGwgc3RpbGwgd2FudAorICAgICAgICAgICAgLy8gaXQgdGhlcmUuCisgICAgICAgICAgICBtV2ViVmlldy5yZW1vdmVWaWV3KHRoaXMpOworICAgICAgICAgICAgbVdlYlZpZXcucmVxdWVzdEZvY3VzKCk7CisgICAgICAgICAgICByZ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gICAgIH0KKyAgICAgICAgICAgIGlmICghZG93bikgeworICAgICAgICAgICAgICAgIC8vIEhpZGUgdGhlIGtleWJvYXJkLCBzaW5jZSB0aGUgdXNlciBoYXMganVzdCBzdWJtaXR0ZWQgdGhpcworICAgICAgICAgICAgICAgIC8vIGZvcm0uICBUaGUgc3VibWlzc2lvbiBoYXBwZW5zIHRoYW5rcyB0byB0aGUgdHdvIGNhbGxzCisgICAgICAgICAgICAgICAgLy8gdG8gc2VuZERvbUV2ZW50LgorICAgICAgICAgICAgICAgIElucHV0TWV0aG9kTWFuYWdlci5nZXRJbnN0YW5jZShtQ29udGV4dCkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5oaWRlU29mdElucHV0RnJvbVdpbmRvdyhnZXRXaW5kb3dUb2tlbigpLCAwKTsKKyAgICAgICAgICAgICAgICBzZW5kRG9tRXZlbnQobmV3IEtleUV2ZW50KEtleUV2ZW50LkFDVElPTl9ET1dOLCBrZXlDb2RlKSk7CisgICAgICAgICAgICAgICAgc2VuZERvbUV2ZW50KGV2ZW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzdXBlci5kaXNwYXRjaEtleUV2ZW50KGV2ZW50KTsKKyAgICAgICAgfSBlbHNlIGlmIChLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSID09IGtleUNvZGUpIHsKKyAgICAgICAgICAgIC8vIE5vdGUgdGhhdCB0aGlzIGhhbmRsZXMgY2VudGVyIGtleSBhbmQgdHJhY2tiYWxsLgorICAgICAgICAgICAgaWYgKGlzUG9wdXBTaG93aW5nKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3VwZXIuZGlzcGF0Y2hLZXlFdmVudChldmVudCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIW1XZWJWaWV3Lm5hdGl2ZUN1cnNvck1hdGNoZXNGb2N1cygpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGRvd24gPyBtV2ViVmlldy5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpIDogbVdlYlZpZXcKKyAgICAgICAgICAgICAgICAgICAgICAgIC5vbktleVVwKGtleUNvZGUsIGV2ZW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIENlbnRlciBrZXkgc2hvdWxkIGJlIHBhc3NlZCB0byBhIHBvdGVudGlhbCBvbkNsaWNrCisgICAgICAgICAgICBpZiAoIWRvd24pIHsKKyAgICAgICAgICAgICAgICBtV2ViVmlldy5zaG9ydFByZXNzT25UZXh0RmllbGQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFBhc3MgdG8gc3VwZXIgdG8gaGFuZGxlIGxvbmdwcmVzcy4KKyAgICAgICAgICAgIHJldHVybiBzdXBlci5kaXNwYXRjaEtleUV2ZW50KGV2ZW50KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEVuc3VyZSB0aGVyZSBpcyBhIGxheW91dCBzbyBhcnJvdyBrZXlzIGFyZSBoYW5kbGVkIHByb3Blcmx5LgorICAgICAgICBpZiAoZ2V0TGF5b3V0KCkgPT0gbnVsbCkgeworICAgICAgICAgICAgbWVhc3VyZShtV2lkdGhTcGVjLCBtSGVpZ2h0U3BlYyk7CisgICAgICAgIH0KKyAgICAgICAgaW50IG9sZFN0YXJ0ID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvblN0YXJ0KHRleHQpOworICAgICAgICBpbnQgb2xkRW5kID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvbkVuZCh0ZXh0KTsKKworICAgICAgICBib29sZWFuIG1heGVkT3V0ID0gbU1heExlbmd0aCAhPSAtMSAmJiBvbGRMZW5ndGggPT0gbU1heExlbmd0aDsKKyAgICAgICAgLy8gSWYgd2UgYXJlIGF0IG1heCBsZW5ndGgsIGFuZCB0aGVyZSBpcyBhIHNlbGVjdGlvbiByYXRoZXIgdGhhbiBhCisgICAgICAgIC8vIGN1cnNvciwgd2UgbmVlZCB0byBzdG9yZSB0a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ldGUga2V5LCB3ZSBjYW4gZ28KKyAgICAgICAgICAgIC8vIGFoZWFkIGFuZCBwYXNzIGl0IGRvd24uCisgICAgICAgICAgICBpZiAoS2V5RXZlbnQuS0VZQ09ERV9FTlRFUiA9PSBrZXlDb2RlKSB7CisgICAgICAgICAgICAgICAgLy8gRm9yIG11bHRpLWxpbmUgdGV4dCBib3hlcywgbmV3bGluZXMgd2lsbAorICAgICAgICAgICAgICAgIC8vIHRyaWdnZXIgb25UZXh0Q2hhbmdlZCBmb3Iga2V5IGRvd24gKHdoaWNoIHdpbGwgc2VuZCBib3RoCisgICAgICAgICAgICAgICAgLy8ga2V5IHVwIGFuZCBrZXkgZG93bikgYnV0IG5vdCBrZXkgdXAuCisgICAgICAgICAgICAgICAgbUdvdEVudGVyRG93biA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobWF4ZWRPdXQgJiYgIWlzQXJyb3dLZXkgJiYga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0RFTCkgeworICAgICAgICAgICAgICAgIGlmIChvbGRFbmQgPT0gb2xkU3RhcnQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gUmV0dXJuIHRydWUgc28gdGhlIGtleSBnZXRzIGRyb3BwZWQuCisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIW9sZFRleHQuZXF1YWxzKGdldFRleHQoKS50b1N0cmluZygpKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRTogVGhpcyBtYWtlcyB0aGUgdGV4dCB3b3JrIHByb3Blcmx5LCBidXQgaXQKKyAgICAgICAgICAgICAgICAgICAgLy8gZG9lcyBub3QgcGFzcyBkb3duIHRoZSBrZXkgZXZlbnQsIHNvIGl0IG1heSBub3QKKyAgICAgICAgICAgICAgICAgICAgLy8gd29yayBmb3IgYSB0ZXh0ZmllbGQgdGhhdCBoYXMgdGhlIHR5cGUgb2YKKyAgICAgICAgICAgICAgICAgICAgLy8gYmVoYXZpb3Igb2YgR29vZ2xlU3VnZ2VzdC4gIFRoYXQgc2FpZCwgaXQgaXMKKyAgICAgICAgICAgICAgICAgICAgLy8gdW5saWtlbHkgdGhhdCBhIHNpdGUgd291bGQgY29tYmluZSB0aGUgdHdvIGluCisgICAgICAgICAgICAgICAgICAgIC8vIG9uZSB0ZXh0ZmllbGQuCisgICAgICAgICAgICAgICAgICAgIFNwYW5uYWJsZSBzcGFuID0gKFNwYW5uYWJsZSkgZ2V0VGV4dCgpOworICAgICAgICAgICAgICAgICAgICBpbnQgbmV3U3RhcnQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uU3RhcnQoc3Bhbik7CisgICAgICAgICAgICAgICAgICAgIGludCBuZXdFbmQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKHNwYW4pOworICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5yZXBsYWNlVGV4dGZpZWxkVGV4dCgwLCBvbGRMZW5ndGgsIHNwYW4udG9TdHJpbmcoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdTdGFydCwgbmV3RW5kKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogRklYTUU6CisgICAgICAgICAgICAgKiBJbiB0aGVvcnksIHdlIHdvdWxkIGxpa2UgdG8gc2VuZCB0aGUgZXZlbnRzIGZvciB0aGUgYXJyb3cga2V5cy4KKyAgICAgICAgICAgICAqIEhvd2V2ZXIsIHRoZSBUZXh0VmlldyBjYW4gYXJiaXRyYXJpbHkgY2hhbmdlIHRoZSBzZWxlY3Rpb24gKGkuZS4KKyAgICAgICAgICAgICAqIGxvbmcgcHJlc3MgZm9sbG93ZWQgYnkgdXNpbmcgdGhlIHRyYWNrYmFsbCkuICBUaGVyZWZvcmUsIHdlIGtlZXAKKyAgICAgICAgICAgICAqIGluIHN5bmMgd2l0aCB0aGUgVGV4dFZpZXcgdmlhIG9uU2VsZWN0aW9uQ2hhbmdlZC4gIElmIHdlIGFsc28KKyAgICAgICAgICAgICAqIHNlbmQgdGhlIERPTSBldmVudCwgd2UgbG9zZSB0aGUgY29ycmVjdCBzZWxlY3Rpb24uCisgICAgICAgICAgICBpZiAoaXNBcnJvd0tleSkgeworICAgICAgICAgICAgICAgIC8vIEFycm93IGtleSBkb2VzIG5vdCBjaGFuZ2UgdGhlIHRleHQsIGJ1dCB3ZSBzdGlsbCB3YW50IHRvIHNlbmQKKyAgICAgICAgICAgICAgICAvLyB0aGUgRE9NIGV2ZW50cy4KKyAgICAgICAgICAgICAgICBzZW5kRG9tRXZlbnQoZXZlbnQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgICovCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICAvLyBJZ25vcmUgdGhlIGtleSB1cCBldmVudCBmb3IgbmV3bGluZXMuIFRoaXMgcHJldmVudHMKKyAgICAgICAgLy8gbXVsdGlwbGUgbmV3bGluZXMgaW4gdGhlIG5hdGl2ZSB0ZXh0YXJlYS4KKyAgICAgICAgaWYgKG1Hb3RFbnRlckRvd24gJiYgIWRvd24pIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIC8vIGlmIGl0IGlzIGEgbmF2aWdhdGlvbiBrZXksIHBhc3MgaXQgdG8gV2ViVmlldworICAgICAgICBpZiAoaXNBcnJvd0tleSkgeworICAgICAgICAgICAgLy8gV2ViVmlldyBjaGVjayB0aGUgdHJhY2tiYWxsdGltZSBpbiBvbktleURvd24gdG8gYXZvaWQgY2FsbGluZworICAgICAgICAgICAgLy8gbmF0aXZlIGZyb20gYm90aCB0cmFja2JhbGwgYW5kIGtleSBoYW5kbGluZy4gQXMgdGhpcyBpcyBjYWxsZWQKKyAgICAgICAgICAgIC8vIGZyb20gV2ViVGV4dFZpZXcsIHdlI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gICAgIG1lYXN1cmUobVdpZHRoU3BlYywgbUhlaWdodFNwZWMpOworICAgICAgICB9CisgICAgICAgIC8vIENyZWF0ZSBhIGZha2UgdG91Y2ggdXAsIHdoaWNoIGlzIHVzZWQgdG8gcGxhY2UgdGhlIGN1cnNvci4KKyAgICAgICAgTW90aW9uRXZlbnQgZXYgPSBNb3Rpb25FdmVudC5vYnRhaW4oMCwgMCwgTW90aW9uRXZlbnQuQUNUSU9OX1VQLAorICAgICAgICAgICAgICAgIHgsIHksIDApOworICAgICAgICBvblRvdWNoRXZlbnQoZXYpOworICAgICAgICBldi5yZWN5Y2xlKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogIERldGVybWluZSB3aGV0aGVyIHRoaXMgV2ViVGV4dFZpZXcgY3VycmVudGx5IHJlcHJlc2VudHMgdGhlIG5vZGUKKyAgICAgKiAgcmVwcmVzZW50ZWQgYnkgcHRyLgorICAgICAqICBAcGFyYW0gIHB0ciBQb2ludGVyIHRvIGEgbm9kZSB0byBjb21wYXJlIHRvLgorICAgICAqICBAcmV0dXJuIGJvb2xlYW4gV2hldGhlciB0aGlzIFdlYlRleHRWaWV3IGFscmVhZHkgcmVwcmVzZW50cyB0aGUgbm9kZQorICAgICAqICAgICAgICAgIHBvaW50ZWQgdG8gYnkgcHRyLgorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gYm9vbGVhbiBpc1NhbWVUZXh0RmllbGQoaW50IHB0cikgeworICAgICAgICByZXR1cm4gcHRyID09IG1Ob2RlUG9pbnRlcjsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUgcHVibGljIElucHV0Q29ubmVjdGlvbiBvbkNyZWF0ZUlucHV0Q29ubmVjdGlvbigKKyAgICAgICAgICAgIEVkaXRvckluZm8gb3V0QXR0cnMpIHsKKyAgICAgICAgSW5wdXRDb25uZWN0aW9uIGNvbm5lY3Rpb24gPSBzdXBlci5vbkNyZWF0ZUlucHV0Q29ubmVjdGlvbihvdXRBdHRycyk7CisgICAg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WN0aXZlKCk7CisgICAgICAgICAgICBtT2theUZvckZvY3VzTm90VG9NYXRjaCA9IHRydWU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBFZGl0b3JJbmZvLklNRV9BQ1RJT05fRE9ORToKKyAgICAgICAgICAgIHN1cGVyLm9uRWRpdG9yQWN0aW9uKGFjdGlvbkNvZGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgRWRpdG9ySW5mby5JTUVfQUNUSU9OX0dPOgorICAgICAgICAgICAgLy8gU2VuZCBhbiBlbnRlciBhbmQgaGlkZSB0aGUgc29mdCBrZXlib2FyZAorICAgICAgICAgICAgSW5wdXRNZXRob2RNYW5hZ2VyLmdldEluc3RhbmNlKG1Db250ZXh0KQorICAgICAgICAgICAgICAgICAgICAuaGlkZVNvZnRJbnB1dEZyb21XaW5kb3coZ2V0V2luZG93VG9rZW4oKSwgMCk7CisgICAgICAgICAgICBzZW5kRG9tRXZlbnQobmV3IEtleUV2ZW50KEtleUV2ZW50LkFDVElPTl9ET1dOLAorICAgICAgICAgICAgICAgICAgICBLZXlFdmVudC5LRVlDT0RFX0VOVEVSKSk7CisgICAgICAgICAgICBzZW5kRG9tRXZlbnQobmV3IEtleUV2ZW50KEtleUV2ZW50LkFDVElPTl9VUCwKKyAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQuS0VZQ09ERV9FTlRFUikpOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uU2VsZWN0aW9uQ2hhbmdlZChpbnQgc2VsU3RhcnQsIGludCBzZWxFbmQpIHsKKyAgICAgICAgaWYgKCFtRnJvbVdlYktpdCAmJiBtV2ViVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVEVYVF9WSUVXKSB7CisgICAgICAgICAgICAgICAgTG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B0cmFja2JhbGwgb3IgYXV0by1jb3JyZWN0LgorICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1RFWFRfVklFVykgeworICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm9uVGV4dENoYW5nZWQgc3RhcnQ9IiArIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICArICIgc3RhcnQgKyBiZWZvcmU9IiArIChzdGFydCArIGJlZm9yZSkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVdlYlZpZXcuc2V0U2VsZWN0aW9uKHN0YXJ0LCBzdGFydCArIGJlZm9yZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFjYW5ub3RVc2VLZXlFdmVudHMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSBldmVudHMubGVuZ3RoOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIC8vIFdlIG5ldmVyIHNlbmQgbW9kaWZpZXIga2V5cyB0byBuYXRpdmUgY29kZSBzbyBkb24ndCBzZW5kIHRoZW0KKyAgICAgICAgICAgICAgICAvLyBoZXJlIGVpdGhlci4KKyAgICAgICAgICAgICAgICBpZiAoIUtleUV2ZW50LmlzTW9kaWZpZXJLZXkoZXZlbnRzW2ldLmdldEtleUNvZGUoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VuZERvbUV2ZW50KGV2ZW50c1tpXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHVwZGF0ZUNhY2hlZFRleHRmaWVsZCgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldmVudCkgeworICAgICAgICBzd2l0Y2ggKGV2ZW50LmdldEFjdGlvbigpKSB7CisgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0RPV046CisgICAgICAgICAgICBzdXBlci5vblRvdWNoRXZlbnQoZXZlbnQpOworICAgICAgICAgICAgLy8gVGhpcyBldmVudCBtYXkgYmUgdGhlIHN0YXJ0IG9mIGEgZHJhZywgc28gc3RvcmUgaXQgdG8gcGFzcyB0byB0aGUKKyAgICAgICAgICAgIC8vIFdlYlZpZXcgaWYgaXQgaXMuCisgICAgICAgICAgICBtRHJhZ1N0YXJ0WCA9IGV2ZW50LmdldFgoKTsKKyAgICAgICAgICAgIG1EcmFnU3RhcnRZID0gZXZlbnQuZ2V0WSgpOworICAgICAgICAgICAgbURyYWdTdGFydFRpbWUgPSBldmVudC5nZXRFdmVudFRpbWUoKTsKKyAgICAgICAgICAgIG1EcmFnU2VudCA9IGZhbHNlOworICAgICAgICAgICAgbVNjcm9sbGVkID0gZmFsc2U7CisgICAgICAgICAgICBtR290VG91Y2hEb3duID0gdHJ1ZTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFOgorICAgICAgICAgICAgU3Bhbm5hYmxlIGJ1ZmZlciA9IGdldFRleHQoKTsKKyAgICAgICAgICAgIGludCBpbml0aWFsU2Nyb2xsWCA9IFRvdWNoLmdldEluaXRpYWxTY3JvbGxYKHRoaXMsIGJ1ZmZlcik7CisgICAgICAgICAgICBpbnQgaW5pdGlhbFNjcm9sbFkgPSBUb3VjaC5nZXRJbml0aWFsU2Nyb2xsWSh0aGlzLCBidWZmZXIpOworICAgICAgICAgICAgc3VwZXIub25Ub3VjaEV2ZW50KGV2ZW50KTsKKyAgICAgICAgICAgIGlmIChtU2Nyb2xsWCAhPSBpbml0aWFsU2Nyb2xsWAorICAgICAgICAgICAgICAgICAgICB8fCBtU2Nyb2xsWSAhPSBpbml0aWFsU2Nyb2xsWSkgeworICAgICAgICAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3LnNjcm9sbEZvY3VzZWRUZXh0SW5wdXQobVNjcm9sbFgsIG1TY3JvbGxZKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVNjcm9sbGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gT25seSB3YW50IHRvIHNldCB0aGUgaW5pdGlhbCBzdGF0ZSBvbmNlLgorICAgICAgICAgICAgICAgIGlmICghbURyYWdTZW50KSB7CisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3LmluaXRpYXRlVGV4dEZpZWxkRHJhZyhtRHJhZ1N0YXJ0WCwgbURyYWdTdGFydFksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyYWdTdGFydFRpbWUpOworICAgICAgICAgICAgICAgICAgICBtRHJhZ1NlbnQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBib29sZWFuIHNjcm9sbGVkID0gbVdlYlZpZXcudGV4dEZpZWxkRHJhZyhldmVudCk7CisgICAgICAgICAgICAgICAgaWYgKHNjcm9sbGVkKSB7CisgICAgICAgICAgICAgICAgICAgIG1TY3JvbGxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGNhbmNlbExvbmdQcmVzcygpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOgorICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6CisgICAgICAgICAgICBpZiAoIW1TY3JvbGxlZCkgeworICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwYWdlIHNjcm9sbGVkLCBvciB0aGUgVGV4dFZpZXcgc2Nyb2xsZWQsIHdlIGRvIG5vdAorICAgICAgICAgICAgICAgIC8vIHdhbnQgdG8gY2hhbmdlIHRoZSBzZWxlY3Rpb24KKyAgICAgICAgICAgICAgICBjYW5jZWxMb25nUHJlc3MoKTsKKyAgICAgICAgICAgICAgICBpZiAobUdvdFRvdWNoRG93biAmJiBtV2ViVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3LnRvdWNoVXBPblRleHRGaWVsZChldmVudCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gTmVjZXNzYXJ5IGZvciB0aGUgV2ViVmlldyB0byByZXNldCBpdHMgc3RhdGUKKyAgICAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsICYmIG1EcmFnU2VudCkgeworICAgICAgICAgICAgICAgIG1XZWJWaWV3Lm9uVG91Y2hFdmVudChldmVudCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtR290VG91Y2hEb3duID0gZmFsc2U7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVHJhY2tiYWxsRXZlbnQoTW90aW9uRXZlbnQgZXZlbnQpIHsKKyAgICAgICAgaWYgKGlzUG9wdXBTaG93aW5nKCkpIHsKKyAgICAgICAgICAgIHJldHVybiBzdXBlci5vblRyYWNrYmFsbEV2ZW50KGV2ZW50KTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZXZlbnQuZ2V0QWN0aW9uKCkgIT0gTW90aW9uRXZlbnQuQUNUSU9OX01PVkUpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICAvLyBJZiB0aGUgQ3Vyc29yIGlzIG5vdCBvbiB0aGUgdGV4dC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CAwKTsKKyAgICAgICAgbVdlYlZpZXcucmVtb3ZlVmlldyh0aGlzKTsKKyAgICAgICAgbVdlYlZpZXcucmVxdWVzdEZvY3VzKCk7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyB2b2lkIGJyaW5nSW50b1ZpZXcoKSB7CisgICAgICAgIGlmIChnZXRMYXlvdXQoKSAhPSBudWxsKSB7CisgICAgICAgICAgICBicmluZ1BvaW50SW50b1ZpZXcoU2VsZWN0aW9uLmdldFNlbGVjdGlvbkVuZChnZXRUZXh0KCkpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqICBTZW5kIHRoZSBET00gZXZlbnRzIGZvciB0aGUgc3BlY2lmaWVkIGV2ZW50LgorICAgICAqICBAcGFyYW0gZXZlbnQgICAgS2V5RXZlbnQgdG8gYmUgdHJhbnNsYXRlZCBpbnRvIGEgRE9NIGV2ZW50LgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzZW5kRG9tRXZlbnQoS2V5RXZlbnQgZXZlbnQpIHsKKyAgICAgICAgbVdlYlZpZXcucGFzc1RvSmF2YVNjcmlwdChnZXRUZXh0KCkudG9TdHJpbmcoKSwgZXZlbnQpOworICAgIH0KKworICAgIC8qKgorICAgICAqICBBbHdheXMgdXNlIHRoaXMgaW5zdGVhZCBvZiBzZXRBZGFwdGVyLCBhcyB0aGlzIGhhcyBmZWF0dXJlcyBzcGVjaWZpYyB0bworICAgICAqICB0aGUgV2ViVGV4dFZpZXcuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0QWRhcHRlckN1c3RvbShBdXRvQ29tcGxldGVBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgaWYgKGFkYXB0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgc2V0SW5wdXRUeXBlKEVkaXRvckluZm8uVFlQRV9URVhUX0ZMQUdfQVVUT19DT01QTEVURSk7CisgICAgICAgICAgICBhZGFwdGVyLnNldFRleHRWaWV3KHRoaXMpOworICAgICAgICB9CisgICAgICAgIHN1cGVyLnNldEFkYXB0ZXIoYWRhcHRlcik7CisgICAgfQorCisgICAgLyoqCisgICAgICogIFRoaXMgaXMgYSBzcGVjaWFsIHZlcnNpb24gb2YgQXJyYXlBZGFwdGVyIHdoaWNoIGNoYW5nZXMgaXRzIHRleHQgc2l6ZQorICAgICAqICB0byBtYXRjaCB0aGUgdGV4dCBzaXplIG9mIGl0cyBob3N0IFRleHRWaWV3LgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQXV0b0NvbXBsZXRlQWRhcHRlciBleHRlbmRzIEFycmF5QWRhcHRlcjxTdHJpbmc+IHsKKyAgICAgICAgcHJpdmF0ZSBUZXh0VmlldyBtVGV4dFZpZXc7CisKKyAgICAgICAgcHVibGljIEF1dG9Db21wbGV0ZUFkYXB0ZXIoQ29udGV4dCBjb250ZXh0LCBBcnJheUxpc3Q8U3RyaW5nPiBlbnRyaWVzKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmxheW91dAorICAgICAgICAgICAgICAgICAgICAuc2VhcmNoX2Ryb3Bkb3duX2l0ZW1fMWxpbmUsIGVudHJpZXMpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBWaWV3IGdldFZpZXcoaW50IHBvc2l0aW9uLCBWaWV3IGNvbnZlcnRWaWV3LCBWaWV3R3JvdXAgcGFyZW50KSB7CisgICAgICAgICAgICBUZXh0VmlldyB0diA9CisgICAgICAgICAgICAgICAgICAgIChUZXh0Vmlldykgc3VwZXIuZ2V0Vmlldyhwb3NpdGlvbiwgY29udmVydFZpZXcsIHBhcmVudCk7CisgICAgICAgICAgICBpZiAodHYgIT0gbnVsbCAmJiBtVGV4dFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHR2LnNldFRleHRTaXplKG1UZXh0Vmlldy5nZXRUZXh0U2l6ZSgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0djsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXQgdGhlIFRleHRWaWV3IHNvIHdlIGNhbiBtYXRjaCBpdHMgdGV4dCBzaXplLgorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSB2b2lkIHNldFRleHRWaWV3KFRleHRWaWV3IHR2KSB7CisgICAgICAgICAgICBtVGV4dFZpZXcgPSB0djsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIERldGVybWluZSB3aGV0aGVyIHRvIHVzZSB0aGUgc3lzdGVtLXdpZGUgcGFzc3dvcmQgZGlzZ3Vpc2luZyBtZXRob2QsCisgICAgICogb3IgdG8gdXNlIG5vbmUuCisgICAgICogQHBhcmFtICAgaW5QYXNzd29yZCAgVHJ1ZSBpZiB0aGUgdGV4dGZpZWxkIGlzIGEgcGFzc3dvcmQgZmllbGQuCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyB2b2lkIHNldEluUGFzc3dvcmQoYm9vbGVhbiBpblBhc3N3b3JkKSB7CisgICAgICAgIGlmIChpblBhc3N3b3JkKSB7CisgICAgICAgICAgICBzZXRJbnB1dFR5cGUoRWRpdG9ySW5mby5UWVBFX0NMQVNTX1RFWFQgfCBFZGl0b3JJbmZvLgorICAgICAgICAgICAgICAgICAgICBUWVBFX1RFWFRfVkFSSUFUSU9OX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGNyZWF0ZUJhY2tncm91bmQoKTsKKyAgICAgICAgfQorICAgICAgICAvLyBGb3IgcGFzc3dvcmQgZmllbGRzLCBkcmF3IHRoZSBXZWJUZXh0Vmlldy4gIEZvciBvdGhlcnMsIGp1c3Qgc2hvdworICAgICAgICAvLyB3ZWJraXQncyBkcmF3aW5nLgorICAgICAgICBzZXRXaWxsTm90RHJhdyghaW5QYXNzd29yZCk7CisgICAgICAgIHNldEJhY2tncm91bmREcmF3YWJsZShpblBhc3N3b3JkID8gbUJhY2tncm91bmQgOiBudWxsKTsKKyAgICAgICAgLy8gRm9yIG5vbi1wYXNzd29yZCBmaWVsZHMsIGF2b2lkIHRoZSBpbnZhbHMgZnJvbSBUZXh0VmlldydzIGJsaW5raW5nCisgICAgICAgIC8vIGN1cnNvcgorICAgICAgICBzZXRDdXJzb3JWaXNpYmxlKGluUGFzc3dvcmQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFByaXZhdGUgY2xhc3MgdXNlZCBmb3IgdGhlIGJhY2tncm91bmQgb2YgYSBwYXNzd29yZCB0ZXh0ZmllbGQuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgT3V0bGluZURyYXdhYmxlIGV4dGVuZHMgRHJhd2FibGUgeworICAgICAgICBwdWJsaWMgdm9pZCBkcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIFJlY3QgYm91bmRzID0gZ2V0Qm91bmRzKCk7CisgICAgICAgICAgICBQYWludCBwYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgcGFpbnQuc2V0QW50aUFsaWFzKHRydWUpOworICAgICAgICAgICAgLy8gRHJhdyB0aGUgYmFja2dyb3VuZC4KKyAgICAgICAgICAgIHBhaW50LnNldENvbG9yKENvbG9yLldISVRFKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdChib3VuZHMsIHBhaW50KTsKKyAgICAgICAgICAgIC8vIERyYXcgdGhlIG91dGxpbmUuCisgICAgICAgICAgICBwYWludC5zZXRTdHlsZShQYWludC5TdHlsZS5TVFJPS0UpOworICAgICAgICAgICAgcGFpbnQuc2V0Q29sb3IoQ29sb3IuQkxBQ0spOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KGJvdW5kcywgcGFpbnQpOworICAgICAgICB9CisgICAgICAgIC8vIEFsd2F5cyB3YW50IGl0IHRvIGJlIG9wYXF1ZS4KKyA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c2V0UmVjdChpbnQgeCwgaW50IHksIGludCB3aWR0aCwgaW50IGhlaWdodCkgeworICAgICAgICBMYXlvdXRQYXJhbXMgbHAgPSAoTGF5b3V0UGFyYW1zKSBnZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgaWYgKG51bGwgPT0gbHApIHsKKyAgICAgICAgICAgIGxwID0gbmV3IExheW91dFBhcmFtcyh3aWR0aCwgaGVpZ2h0LCB4LCB5KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGxwLnggPSB4OworICAgICAgICAgICAgbHAueSA9IHk7CisgICAgICAgICAgICBscC53aWR0aCA9IHdpZHRoOworICAgICAgICAgICAgbHAuaGVpZ2h0ID0gaGVpZ2h0OworICAgICAgICB9CisgICAgICAgIGlmIChnZXRQYXJlbnQoKSA9PSBudWxsKSB7CisgICAgICAgICAgICBtV2ViVmlldy5hZGRWaWV3KHRoaXMsIGxwKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHNldExheW91dFBhcmFtcyhscCk7CisgICAgICAgIH0KKyAgICAgICAgLy8gU2V0IHVwIGEgbWVhc3VyZSBzcGVjIHNvIGEgbGF5b3V0IGNhbiBhbHdheXMgYmUgcmVjcmVhdGVkLgorICAgICAgICBtV2lkdGhTcGVjID0gTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKHdpZHRoLCBNZWFzdXJlU3BlYy5FWEFDVExZKTsKKyAgICAgICAgbUhlaWdodFNwZWMgPSBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoaGVpZ2h0LCBNZWFzdXJlU3BlYy5FWEFDVExZKTsKKyAgICAgICAgcmVxdWVzdEZvY3VzKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHRoZSBzZWxlY3Rpb24sIGFuZCBkaXNhYmxlIG91ciBvblNlbGVjdGlvbkNoYW5nZWQgYWN0aW9uLgorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCB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VCX0VESVRfVEVYVDsKKyAgICAgICAgaWYgKHNpbmdsZSkgeworICAgICAgICAgICAgaW50IGFjdGlvbiA9IG1XZWJWaWV3Lm5hdGl2ZVRleHRGaWVsZEFjdGlvbigpOworICAgICAgICAgICAgc3dpdGNoIChhY3Rpb24pIHsKKyAgICAgICAgICAgIC8vIEtlZXAgaW4gc3luYyB3aXRoIENhY2hlZFJvb3Q6OkltZUFjdGlvbgorICAgICAgICAgICAgY2FzZSAwOiAvLyBORVhUCisgICAgICAgICAgICAgICAgc2V0SW1lT3B0aW9ucyhFZGl0b3JJbmZvLklNRV9BQ1RJT05fTkVYVCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDE6IC8vIEdPCisgICAgICAgICAgICAgICAgc2V0SW1lT3B0aW9ucyhFZGl0b3JJbmZvLklNRV9BQ1RJT05fR08pOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAtMTogLy8gRkFJTFVSRQorICAgICAgICAgICAgY2FzZSAyOiAvLyBET05FCisgICAgICAgICAgICAgICAgc2V0SW1lT3B0aW9ucyhFZGl0b3JJbmZvLklNRV9BQ1RJT05fRE9ORSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnB1dFR5cGUgfD0gRWRpdG9ySW5mby5UWVBFX1RFWFRfRkxBR19NVUxUSV9MSU5FCisgICAgICAgICAgICAgICAgICAgIHwgRWRpdG9ySW5mby5UWVBFX1RFWFRfRkxBR19DQVBfU0VOVEVOQ0VTCisgICAgICAgICAgICAgICAgICAgIHwgRWRpdG9ySW5mby5UWVBFX1RFWFRfRkxBR19BVVRPX0NPUlJFQ1Q7CisgICAgICAgICAgICBzZXRJbWVPcHRpb25zKEVkaXRvckluZm8uSU1FX0FDVElPTl9OT05FKTsKKyAgICAgICAgfQorICAgICAgICBtU2luZ2xlID0gc2luZ2xlOworICAgICAgICBzZXRIb3Jpem9udGFsbHlTY3JvbGxpbmcoc2luZ2xlKTsKKyAgICAgICAgc2V0SW5wdXRUeXBlKGlucHV0VHlwZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHRoZSB0ZXh0IGZvciB0aGlzIFdlYlRleHRWaWV3LCBhbmQgc2V0IHRoZSBzZWxlY3Rpb24gdG8gKHN0YXJ0LCBlbmQpCisgICAgICogQHBhcmFtICAgdGV4dCAgICBUZXh0IHRvIGdvIGludG8gdGhpcyBXZWJUZXh0Vmlldy4KKyAgICAgKiBAcGFyYW0gICBzdGFydCAgIEJlZ2lubmluZyBvZiB0aGUgc2VsZWN0aW9uLgorICAgICAqIEBwYXJhbSAgIGVuZCAgICAgRW5kIG9mIHRoZSBzZWxlY3Rpb24uCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyB2b2lkIHNldFRleHQoQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCkgeworICAgICAgICBtUHJlQ2hhbmdlID0gdGV4dC50b1N0cmluZygpOworICAgICAgICBzZXRUZXh0KHRleHQpOworICAgICAgICBTcGFubmFibGUgc3BhbiA9IChTcGFubmFibGUpIGdldFRleHQoKTsKKyAgICAgICAgaW50IGxlbmd0aCA9IHNwYW4ubGVuZ3RoKCk7CisgICAgICAgIGlmIChlbmQgPiBsZW5ndGgpIHsKKyAgICAgICAgICAgIGVuZCA9IGxlbmd0aDsKKyAgICAgICAgfQorICAgICAgICBpZiAoc3RhcnQgPCAwKSB7CisgICAgICAgICAgICBzdGFydCA9IDA7CisgICAgICAgIH0gZWxzZSBpZiAoc3RhcnQgPiBsZW5ndGgpIHsKKyAgICAgICAgICAgIHN0YXJ0ID0gbGVuZ3RoOworICAgICAgICB9CisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9URVhUX1ZJRVcpIHsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgInNldFRleHQgc3RhcnQ9IiArIHN0YXJ0CisgICA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gICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC56b29tQ29udHJvbHMpOwogICAgICAgICAgICAgbVpvb21NYWduaWZ5ID0gKEltYWdlVmlldykgZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuem9vbU1hZ25pZnkpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyB2b2lkIHNob3coYm9vbGVhbiBzaG93Wm9vbSwgYm9vbGVhbiBjYW5ab29tT3V0KSB7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xzLnNldFZpc2liaWxpdHkoc2hvd1pvb20gPyBWaWV3LlZJU0lCTEUgOiBWaWV3LkdPTkUpOworICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5zZXRWaXNpYmlsaXR5KAorICAgICAgICAgICAgICAgICAgICBzaG93Wm9vbSA/IFZpZXcuVklTSUJMRSA6IFZpZXcuR09ORSk7CiAgICAgICAgICAgICBtWm9vbU1hZ25pZnkuc2V0VmlzaWJpbGl0eShjYW5ab29tT3V0ID8gVmlldy5WSVNJQkxFIDogVmlldy5HT05FKTsKICAgICAgICAgICAgIGZhZGUoVmlldy5WSVNJQkxFLCAwLjBmLCAxLjBmKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCBoaWRlKCkgewogICAgICAgICAgICAgZmFkZShWaWV3LkdPTkUsIDEuMGYsIDAuMGYpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHByaXZhdGUgdm9pZCBmYWRlKGludCB2aXNpYmlsaXR5LCBmbG9hdCBzdGFydEFscGhhLCBmbG9hdCBlbmRBbHBoYSkgewogICAgICAgICAgICAgQWxwaGFBbmltYXRpb24gYW5pbSA9IG5ldyBBbHBoYUFuaW1hdGlvbihzdGFydEFscGhhLCBlbmRBbHBoYSk7CiAgICAgICAgICAgICBhbmltLnNldER1cmF0aW9uKDUwMCk7CiAgICAgICAgICAgICBzdGFydEFuaW1hdGlvbihhbmltKTsKICAgICAgICAgICAgIHNldFZpc2liaWxpdHkodmlzaWJpbGl0eSk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIHZvaWQgc2V0SXNab29tTWFnbmlmeUVuYWJsZWQoYm9vbGVhbiBpc0VuYWJsZWQpIHsKICAgICAgICAgICAgIG1ab29tTWFnbmlmeS5zZXRFbmFibGVkKGlzRW5hYmxlZCk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzRm9jdXMoKSB7Ci0gICAgICAgICAgICByZXR1cm4gbVpvb21Db250cm9scy5oYXNGb2N1cygpIHx8IG1ab29tTWFnbmlmeS5oYXNGb2N1cygpOworICAgICAgICAgICAgcmV0dXJuIG1QbHVzTWludXNab29tQ29udHJvbHMuaGFzRm9jdXMoKSB8fCBtWm9vbU1hZ25pZnkuaGFzRm9jdXMoKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgdm9pZCBzZXRPblpvb21JbkNsaWNrTGlzdGVuZXIoT25DbGlja0xpc3RlbmVyIGxpc3RlbmVyKSB7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xzLnNldE9uWm9vbUluQ2xpY2tMaXN0ZW5lcihsaXN0ZW5lcik7CisgICAgICAgICAgICBtUGx1c01pbnVzWm9vbUNvbnRyb2xzLnNldE9uWm9vbUluQ2xpY2tMaXN0ZW5lcihsaXN0ZW5lcik7CiAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgIHB1YmxpYyB2b2lkIHNldE9uWm9vbU91dENsaWNrTGlzdGVuZXIoT25DbGlja0xpc3RlbmVyIGxpc3RlbmVyKSB7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xzLnNldE9uWm9vbU91dENsaWNrTGlzdGVuZXIobGlzdGVuZXIpOworICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5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RpYyBmaW5hbCBpbnQgUkVNRU1CRVJfUEFTU1dPUkQgICAgICAgICAgPSAxOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBORVZFUl9SRU1FTUJFUl9QQVNTV09SRCAgICA9IDI7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFNXSVRDSF9UT19TSE9SVFBSRVNTICAgICAgID0gMzsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgU1dJVENIX1RPX0xPTkdQUkVTUyAgICAgICAgPSA0OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBSRUxFQVNFX1NJTkdMRV9UQVAgICAgICAgICA9IDU7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFJFUVVFU1RfRk9STV9EQVRBICAgICAgICAgID0gNjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgU1dJVENIX1RPX0NMSUNLICAgICAgICAgICAgPSA3OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBSRVNVTUVfV0VCQ09SRV9VUERBVEUgICAgICA9IDg7CiAKICAgICAvLyEgYXJnMT14LCBhcmcyPXkKLSAgICBzdGF0aWMgZmluYWwgaW50IFNDUk9MTF9UT19NU0dfSUQgICAgICAgICAgICAgICA9IDEwOwotICAgIHN0YXRpYyBmaW5hbCBpbnQgU0NST0xMX0JZX01TR19JRCAgICAgICAgICAgICAgID0gMTE7CisgICAgc3RhdGljIGZpbmFsIGludCBTQ1JPTExfVE9fTVNHX0lEICAgICAgICAgICAgICAgICAgID0gMTA7CisgICAgc3RhdGljIGZpbmFsIGludCBTQ1JPTExfQllfTVNHX0lEICAgICAgICAgICAgICAgICAgID0gMTE7CiAgICAgLy8hIGFyZzE9eCwgYXJnMj15Ci0gICAgc3RhdGljIGZpbmFsIGludCBTUEFXTl9TQ1JPTExfVE9fTVNHX0lEICAgICAgICAgPSAxMjsKKyAgICBzdGF0aWMgZmluYWwgaW50IFNQQVdOX1NDUk9MTF9UT19NU0dfSUQgICAgICAgICAgICAgPSAxMjsKICAgICAvLyEgYXJnMT14LCBhcmcyPXkKLSAgICBzdGF0aWMgZmluYWwgaW50IFNZTkNfU0NST0xMX1RPX01TR19JRCAgICAgICAgICA9IDEzOwotICAgIHN0YXRpYyBmaW5hbCBpbnQgTkVXX1BJQ1RVUkVfTVNHX0lEICAgICAgICAgICAgID0gMTQ7Ci0gICAgc3RhdGljIGZpbmFsIGludCBVUERBVEVfVEVYVF9FTlRSWV9NU0dfSUQgICAgICAgPSAxNTsKLSAgICBzdGF0aWMgZmluYWwgaW50IFdFQkNPUkVfSU5JVElBTElaRURfTVNHX0lEICAgICA9IDE2OwotICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX1RFWFRGSUVMRF9URVhUX01TR19JRCAgID0gMTc7Ci0gICAgc3RhdGljIGZpbmFsIGludCBESURfRklSU1RfTEFZT1VUX01TR19JRCAgICAgICAgPSAxODsKLSAgICBzdGF0aWMgZmluYWwgaW50IFJFQ09NUFVURV9GT0NVU19NU0dfSUQgICAgICAgICA9IDE5OwotICAgIHN0YXRpYyBmaW5hbCBpbnQgTk9USUZZX0ZPQ1VTX1NFVF9NU0dfSUQgICAgICAgID0gMjA7Ci0gICAgc3RhdGljIGZpbmFsIGludCBNQVJLX05PREVfSU5WQUxJRF9JRCAgICAgICAgICAgPSAyMTsKLSAgICBzdGF0aWMgZmluYWwgaW50IFVQREFURV9DTElQQk9BUkQgICAgICAgICAgICAgICA9IDIyOwotICAgIHN0YXRpYyBmaW5hbCBpbnQgTE9OR19QUkVTU19FTlRFUiAgICAgICAgICAgICAgID0gMjM7Ci0gICAgc3RhdGljIGZpbmFsIGludCBQUkVWRU5UX1RPVUNIX0lEICAgICAgICAgICAgICAgPSAyNDsKLSAgICBzdGF0aWMgZmluYWwgaW50IFdFQkNPUkVfTkVFRF9UT1VDSF9FVkVOVFMgICAgICA9IDI1OworICAgIHN0YXRpYyBmaW5hbCBpbnQgU1lOQ19TQ1JPTExfVE9fTVNHX0lEICAgICAgICAgICAgICA9IDEzOworICAgIHN0YXRpYyBmaW5hbCBpbnQgTkVXX1BJQ1RVUkVfTVNHX0lEICAgICAgICAgICAgICAgICA9IDE0OworICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX1RFWFRfRU5UUllfTVNHX0lEICAgICAgICAgICA9IDE1OworICAgIHN0YXRpYyBmaW5hbCBpbnQgV0VCQ09SRV9JTklUSUFMSVpFRF9NU0dfSUQgICAgICAgICA9IDE2OworICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX1RFWFRGSUVMRF9URVhUX01TR19JRCAgICAgICA9IDE3OworICAgIHN0YXRpYyBmaW5hbCBpbnQgTU9WRV9PVVRfT0ZfUExVR0lOICAgICAgICAgICAgICAgICA9IDE5OworICAgIHN0YXRpYyBmaW5hbCBpbnQgQ0xFQVJfVEVYVF9FTlRSWSAgICAgICAgICAgICAgICAgICA9IDIwOworICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRCAgICAgICA9IDIxOworICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX0NMSVBCT0FSRCAgICAgICAgICAgICAgICAgICA9IDIyOworICAgIHN0YXRpYyBmaW5hbCBpbnQgTE9OR19QUkVTU19DRU5URVIgICAgICAgICAgICAgICAgICA9IDIzOworICAgIHN0YXRpYyBmaW5hbCBpbnQgUFJFVkVOVF9UT1VDSF9JRCAgICAgICAgICAgICAgICAgICA9IDI0OworICAgIHN0YXRpYyBmaW5hbCBpbnQgV0VCQ09SRV9ORUVEX1RPVUNIX0VWRU5UUyAgICAgICAgICA9IDI1OwogICAgIC8vIG9iaj1SZWN0IGluIGRvYyBjb29yZGluYXRlcwotICAgIHN0YXRpYyBmaW5hbCBpbnQgSU5WQUxfUkVDVF9NU0dfSUQgICAgICAgICAgICAgID0gMjY7Ci0gICAgCisgICAgc3RhdGljIGZpbmFsIGludCBJTlZBTF9SRUNUX01TR19JRCAgICAgICAgICAgICAgICAgID0gMjY7CisgICAgc3RhdGljIGZpbmFsIGludCBSRVFVRVNUX0tFWUJPQVJEICAgICAgICAgICAgICAgICAgID0gMjc7CisKICAgICBzdGF0aWMgZmluYWwgU3RyaW5nW10gSGFuZGxlckRlYnVnU3RyaW5nID0gewotICAgICAgICAiUkVNRU1CRVJfUEFTU1dPUkQiLCAvLyA9IDE7Ci0gICAgICAgICJORVZFUl9SRU1FTUJFUl9QQVNTV09SRCIsIC8vID0gMjsKLSAgICAgICAgIlNXSVRDSF9UT19TSE9SVFBSRVNTIiwgLy8gPSAzOwotICAgICAgICAiU1dJVENIX1RPX0xPTkdQUkVTUyIsIC8vID0gNDsKLSAgICAgICAgIjUiLAotICAgICAgICAiVVBEQVRFX1RFWFRfRU5UUllfQURBUFRFUiIsIC8vID0gNjsKLSAgICAgICAgIlNXSVRDSF9UT19FTlRFUiIsIC8vID0gNzsKLSAgICAgICAgIlJFU1VNRV9XRUJDT1JFX1VQREFURSIsIC8vID0gODsKKyAgICAgICAgIlJFTUVNQkVSX1BBU1NXT1JEIiwgLy8gICAgICAgICAgICAgID0gMTsKKyAgICAgICAgIk5FVkVSX1JFTUVNQkVSX1BBU1NXT1JEIiwgLy8gICAgICAgID0gMjsKKyAgICAgICAgIlNXSVRDSF9UT19TSE9SVFBSRVNTIiwgLy8gICAgICAgICAgID0gMzsKKyAgICAgICAgIlNXSVRDSF9UT19MT05HUFJFU1MiLCAvLyAgICAgICAgICAgID0gNDsKKyAgICAgICAgIlJFTEVBU0VfU0lOR0xFX1RBUCIsIC8vICAgICAgICAgICAgID0gNTsKKyAgICAgICAgIlJFUVVFU1RfRk9STV9EQVRBIiwgLy8gICAgICAgICAgICAgID0gNjsKKyAgICAgICAgIlNXSVRDSF9UT19DTElDSyIsIC8vICAgICAgICAgICAgICAgID0gNzsKKyAgICAgICAgIlJFU1VNRV9XRUJDT1JFX1VQREFURSIsIC8vICAgICAgICAgID0gODsKICAgICAgICAgIjkiLAogICAgICAgICAiU0NST0xMX1RPX01TR19JRCIsIC8vICAgICAgICAgICAgICAgPSAxMDsKICAgICAgICAgIlNDUk9MTF9CWV9NU0dfSUQiLCAvLyAgICAgICAgICAgICAgID0gMTE7CkBAIC0zODIsMzEgKzUwMSw0MCBAQAogICAgICAgICAiVVBEQVRFX1RFWFRfRU5UUllfTVNHX0lEIiwgLy8gICAgICAgPSAxNTsKICAgICAgICAgIldFQkNPUkVfSU5JVElBTElaRURfTVNHX0lEIiwgLy8gICAgID0gMTY7CiAgICAgICAgICJVUERBVEVfVEVYVEZJRUxEX1RFWFRfTVNHX0lEIiwgLy8gICA9IDE3OwotICAgICAgICAiRElEX0ZJUlNUX0xBWU9VVF9NU0dfSUQiLCAvLyAgICAgICAgPSAxODsKLSAgICAgICAgIlJFQ09NUFVURV9GT0NVU19NU0dfSUQiLCAvLyAgICAgICAgID0gMTk7Ci0gICAgICAgICJOT1RJRllfRk9DVVNfU0VUX01TR19JRCIsIC8vICAgICAgICA9IDIwOwotICAgICAgICAiTUFSS19OT0RFX0lOVkFMSURfSUQiLCAvLyAgICAgICAgICAgPSAyMTsKKyAgICAgICAgIjE4IiwgLy8gICAgICAgID0gMTg7CisgICAgICAgICJNT1ZFX09VVF9PRl9QTFVHSU4iLCAvLyAgICAgICAgICAgICA9IDE5OworICAgICAgICAiQ0xFQVJfVEVYVF9FTlRSWSIsIC8vICAgICAgICAgICAgICAgPSAyMDsKKyAgICAgICAgIlVQREFURV9URVhUX1NFTEVDVElPTl9NU0dfSUQiLCAvLyAgID0gMjE7CiAgICAgICAgICJVUERBVEVfQ0xJUEJPQVJEIiwgLy8gICAgICAgICAgICAgICA9IDIyOwotICAgICAgICAiTE9OR19QUkVTU19FTlRFUiIsIC8vICAgICAgICAgICAgICAgPSAyMzsKKyAgICAgICAgIkxPTkdfUFJFU1NfQ0VOVEVSIiwgLy8gICAgICAgICAgICAgID0gMjM7CiAgICAgICAgICJQU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B0byBtYWtlIHRoaXMgcHVibGljLCBidXQgbmVlZCB0byBjaGFuZ2UgdGhlIEFQSSBmaWxlLgorICAgIHB1YmxpYyAvKnN0YXRpYyovIGNsYXNzIEhpdFRlc3RSZXN1bHQgewogICAgICAgICAvKioKICAgICAgICAgICogRGVmYXVsdCBIaXRUZXN0UmVzdWx0LCB3aGVyZSB0aGUgdGFyZ2V0IGlzIHVua25vd24KICAgICAgICAgICovCkBAIC01NDMsOCArNjc0LDcgQEAKICAgICBwcml2YXRlIEV4dGVuZGVkWm9vbUNvbnRyb2xzIG1ab29tQ29udHJvbHM7CiAgICAgcHJpdmF0ZSBSdW5uYWJsZSBtWm9vbUNvbnRyb2xSdW5uYWJsZTsKIAotICAgIHByaXZhdGUgWm9vbUJ1dHRvbnNDb250cm9sbGVyIG1ab29tQnV0dG9uc0NvbnRyb2xsZXI7IAotICAgIHByaXZhdGUgSW1hZ2VWaWV3IG1ab29tT3ZlcnZpZXdCdXR0b247CisgICAgcHJpdmF0ZSBab29tQnV0dG9uc0NvbnRyb2xsZXIgbVpvb21CdXR0b25zQ29udHJvbGxlcjsKIAogICAgIC8vIFRoZXNlIGtlZXAgdHJhY2sgb2YgdGhlIGNlbnRlciBwb2ludCBvZiB0aGUgem9vbS4gIFRoZXkgYXJlIHVzZWQgdG8KICAgICAvLyBkZXRlcm1pbmUgdGhlIHBvaW50IGFyb3VuZCB3aGljaCB3ZSBzaG91bGQgem9vbS4KQEAgLTU2NywxMSArNjk3LDExIEBACiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHpvb21PdXQoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICB1cGRhdGVab29tQnV0dG9uc0VuYWJsZWQoKTsKICAgICAgICAgfQogICAgIH07Ci0gICAgCisKICAgICAvKioKICAgICAgKiBDb25zdHJ1Y3QgYSBuZXcgV2ViVmlldyB3aXRoIGEgQ29udGV4dCBvYmplY3QuCiAgICAgICogQH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25zLCBjb250YWluZXIpOwotICAgICAgICBtWm9vbU92ZXJ2aWV3QnV0dG9uID0KLSAgICAgICAgICAgICAgICAoSW1hZ2VWaWV3KSBjb250YWluZXIuZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuem9vbV9wYWdlX292ZXJ2aWV3KTsKLSAgICAgICAgbVpvb21PdmVydmlld0J1dHRvbi5zZXRPbkNsaWNrTGlzdGVuZXIoCi0gICAgICAgICAgICBuZXcgVmlldy5PbkNsaWNrTGlzdGVuZXIoKSB7Ci0gICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKLSAgICAgICAgICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgem9vbVNjcm9sbE91dCgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobUxvZ0V2ZW50KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDaGVja2luLnVwZGF0ZVN0YXRzKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGVja2luLlN0YXRzLlRhZy5CUk9XU0VSX1pPT01fT1ZFUlZJRVcsIDEsIDAuMCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9KTsKICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgdXBkYXRlWm9vbUJ1dHRvbnNFbmFibGVkKCkgewogICAgICAgICBib29sZWFuIGNhblpvb21JbiA9IG1BY3R1YWxTY2FsZSA8IG1NYXhab29tU2NhbGU7Ci0gICAgICAgIGJvb2xlYW4gY2FuWm9vbU91dCA9IG1BY3R1YWxTY2FsZSA+IG1NaW5ab29tU2NhbGU7CisgICAgICAgIGJvb2xlYW4gY2FuWm9vbU91dCA9IG1BY3R1YWxTY2FsZSA+IG1N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gd2hlcmUgdGhlIGNvbnRlbnQgb2YgV2ViVmlldyBzaG91bGQgcmVuZGVyCi0gICAgICogdG8uCisgICAgICogdG8uICBOb3RlIHRoYXQgdGhpcyBleGNsdWRlcyBtVGl0bGVCYXIsIGlmIHRoZXJlIGlzIG9uZS4KICAgICAgKi8KICAgICBwcml2YXRlIGludCBnZXRWaWV3SGVpZ2h0KCkgewotICAgICAgICBpZiAoIWlzSG9yaXpvbnRhbFNjcm9sbEJhckVuYWJsZWQoKSB8fCBtT3ZlcmxheUhvcml6b250YWxTY3JvbGxiYXIpIHsKLSAgICAgICAgICAgIHJldHVybiBnZXRIZWlnaHQoKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBnZXRIZWlnaHQoKSAtIGdldEhvcml6b250YWxTY3JvbGxiYXJIZWlnaHQoKTsKKyAgICAgICAgaW50IGhlaWdodCA9IGdldEhlaWdodCgpOworICAgICAgICBpZiAoaXNIb3Jpem9udGFsU2Nyb2xsQmFyRW5hYmxlZCgpICYmICFtT3ZlcmxheUhvcml6b250YWxTY3JvbGxiYXIpIHsKKyAgICAgICAgICAgIGhlaWdodCAtPSBnZXRIb3Jpem9udGFsU2Nyb2xsYmFySGVpZ2h0KCk7CiAgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGhlaWdodCAtIGdldFZpc2libGVUaXRsZUhlaWdodCgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtODk5LDcgKzEwMzQsNyBAQAogICAgICAgICBjbGVhclRleHRFbnRyeSgpOwogICAgICAgICBpZiAobVdlYlZpZXdDb3JlICE9IG51bGwpIHsKICAgICAgICAgICAgIC8vIFNldCB0aGUgaGFuZGxlcnMgdG8gbnVsbCBiZWZvcmUgZGVzdHJveWluZyBXZWJWaWV3Q29yZSBzbyBubwotICAgICAgICAgICAgLy8gbW9yZSBtZXNzYWdlcyB3aWxsIGJlIHBvc3RlZC4gCisgICAgICAgICAgICAvLyBtb3JlIG1lc3NhZ2VzI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BpcyBjYWxsZWQsIHRoZSByZXN0IHdpbGwgYmUgc2V0CiAgICAgICAgICAgICAgICAgLy8gY29ycmVjdGx5CiAgICAgICAgICAgICAgICAgbUFjdHVhbFNjYWxlID0gc2NhbGU7CisgICAgICAgICAgICAgICAgZmxvYXQgbGFzdFNjYWxlID0gYi5nZXRGbG9hdCgibGFzdFNjYWxlIiwgLTEuMGYpOworICAgICAgICAgICAgICAgIGlmIChsYXN0U2NhbGUgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG1Jblpvb21PdmVydmlldyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG1MYXN0U2NhbGUgPSBsYXN0U2NhbGU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KQEAgLTEwNzksMTAgKzEyMzUsMTAgQEAKIAogICAgIC8qKgogICAgICAqIFJlc3RvcmUgdGhlIHN0YXRlIG9mIHRoaXMgV2ViVmlldyBmcm9tIHRoZSBnaXZlbiBtYXAgdXNlZCBpbgotICAgICAqIHtAbGluayBhbmRyb2lkLmFwcC5BY3Rpdml0eSNvblJlc3RvcmVJbnN0YW5jZVN0YXRlfS4gVGhpcyBtZXRob2Qgc2hvdWxkIAotICAgICAqIGJlIGNhbGxlZCB0byByZXN0b3JlIHRoZSBzdGF0ZSBvZiB0aGUgV2ViVmlldyBiZWZvcmUgdXNpbmcgdGhlIG9iamVjdC4gSWYgCi0gICAgICogaXQgaXMgY2FsbGVkIGFmdGVyIHRoZSBXZWJWaWV3IGhhcyBoYWQgYSBjaGFuY2UgdG8gYnVpbGQgc3RhdGUgKGxvYWQgCi0gICAgICogcGFnZXMsIGNyZWF0ZSBhIGJhY2svZm9yd2FyZCBsa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gSGl0VGVzdFJlc3VsdCgpOwotCi0gICAgICAgIGlmIChuYXRpdmVVcGRhdGVGb2N1c05vZGUoKSkgewotICAgICAgICAgICAgRm9jdXNOb2RlIG5vZGUgPSBtRm9jdXNOb2RlOwotICAgICAgICAgICAgaWYgKG5vZGUubUlzVGV4dEZpZWxkIHx8IG5vZGUubUlzVGV4dEFyZWEpIHsKKyAgICAgICAgaWYgKG5hdGl2ZUhhc0N1cnNvck5vZGUoKSkgeworICAgICAgICAgICAgaWYgKG5hdGl2ZUN1cnNvcklzVGV4dElucHV0KCkpIHsKICAgICAgICAgICAgICAgICByZXN1bHQuc2V0VHlwZShIaXRUZXN0UmVzdWx0LkVESVRfVEVYVF9UWVBFKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobm9kZS5tVGV4dCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHRleHQgPSBub2RlLm1UZXh0OwotICAgICAgICAgICAgICAgIGlmICh0ZXh0LnN0YXJ0c1dpdGgoU0NIRU1FX1RFTCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnNldFR5cGUoSGl0VGVzdFJlc3VsdC5QSE9ORV9UWVBFKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnNldEV4dHJhKHRleHQuc3Vic3RyaW5nKFNDSEVNRV9URUwubGVuZ3RoKCkpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRleHQuc3RhcnRzV2l0aChTQ0hFTUVfTUFJTFRPKSkgewotICAgICAgICAgICAgICAgICAgICByZXN1bHQuc2V0VHlwZShIaXRUZXN0UmVzdWx0LkVNQUlMX1RZUEUpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQuc2V0RXh0cmEodGV4dC5zdWJzdHJpbmcoU0NIRU1FX01BSUxUTy5sZW5ndGgoKSkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGV4dC5zdGFydHNXaXRoKFNDSEVNRV9HRU8pKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zZXRUeXBlKEhpdFRlc3RSZXN1bHQuR0VPX1RZUEUpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQuc2V0RXh0cmEoVVJMRGVjb2Rlci5kZWNvZGUodGV4dAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdWJzdHJpbmcoU0NIRU1FX0dFTy5sZW5ndGgoKSkpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5vZGUubUlzQW5jaG9yKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zZXRUeXBlKEhpdFRlc3RSZXN1bHQuU1JDX0FOQ0hPUl9UWVBFKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnNldEV4dHJhKHRleHQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgdGV4dCA9IG5hdGl2ZUN1cnNvclRleHQoKTsKKyAgICAgICAgICAgICAgICBpZiAodGV4dCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0LnN0YXJ0c1dpdGgoU0NIRU1FX1RFTCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zZXRUeXBlKEhpdFRlc3RSZXN1bHQuUEhPTkVfVFlQRSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuc2V0RXh0cmEodGV4dC5zdWJzdHJpbmcoU0NIRU1FX1RFTC5sZW5ndGgoKSkpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRleHQuc3RhcnRzV2l0aChTQ0hFTUVfTUFJTFRPKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnNldFR5cGUoSGl0VGVzdFJlc3VsdC5FTUFJTF9UWVBFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zZXRFeHRyYSh0ZXh0LnN1YnN0cmluZyhTQ0hFTUVfTUFJTFRPLmxlbmd0aCgpKSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGV4dC5zdGFydHNXaXRoKFNDSEVNRV9HRU8pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuc2V0VHlwZShIaXRUZXN0UmVzdWx0LkdFT19UWVBFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zZXRFeHRyYShVUkxEZWNvZGVyLmRlY29kZSh0ZXh0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdWJzdHJpbmcoU0NIRU1FX0dFTy5sZW5ndGgoKSkpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuYXRpdmVDdXJzb3JJc0FuY2hvcigpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuc2V0VHlwZShIaXRUZXN0UmVzdWx0LlNSQ19BTkNIT1JfVFlQRSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuc2V0RXh0cmEodGV4dCk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTE1MjEsMTIgKzE2NzgsMTIgQEAKICAgICAgICAgaWYgKHR5cGUgPT0gSGl0VGVzdFJlc3VsdC5VTktOT1dOX1RZUEUKICAgICAgICAgICAgICAgICB8fCB0eXBlID09IEhpdFRlc3RSZXN1bHQuU1JDX0FOQ0hPUl9UWVBFKSB7CiAgICAgICAgICAgICAvLyBOb3cgY2hlY2sgdG8gc2VlIGlmIGl0IGlzIGFuIGltYWdlLgotICAgICAgICAgICAgaW50IGNvbnRlbnRYID0gdmlld1RvQ29udGVudCgoaW50KSBtTGFzdFRvdWNoWCArIG1TY3JvbGxYKTsKLSAgICAgICAgICAgIGludCBjb250ZW50WSA9IHZpZXdUb0NvbnRlbnQoKGludCkgbUxhc3RUb3VjaFkgKyBtU2Nyb2xsWSk7CisgICAgICAgICAgICBpbnQgY29udGVudFggPSB2aWV3VG9Db250ZW50WCgoaW50KSBtTGFzdFRvdWNoWCArIG1TY3JvbGxYKTsKKyAgICAgICAgICAgIGludCBjb250ZW50WSA9IHZpZXdUb0NvbnRlbnRZKChpbnQpIG1MYXN0VG91Y2hZICsgbVNjcm9sbFkpOwogICAgICAgICAgICAgU3RyaW5nIHRleHQgPSBuYXRpdmVJbWFnZVVSSShjb250ZW50WCwgY29udGVudFkpOwogICAgICAgICAgICAgaWYgKHRleHQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHJlc3VsdC5zZXRUeXBlKHR5cGUgPT0gSGl0VGVzdFJlc3VsdC5VTktOT1dOX1RZUEUgPyAKLSAgICAgICAgICAgICAgICAgICAgICAgIEhpdFRlc3RSZXN1bHQuSU1BR0VfVFlQRSA6IAorICAgICAgICAgICAgICAgIHJlc3VsdC5zZXRUeXBlKHR5cGUgPT0gSGl0VGVzdFJlc3VsdC5VTktOT1dOX1RZUEUgPworICAgICAgICAgICAgICAgICAgICAgICAgSGl0VGVzdFJlc3VsdC5JTUFHRV9UWVBFIDoKICAgICAgICAgICAgICAgICAgICAgICAgIEhpdFRlc3RSZXN1bHQuU1JDX0lNQUdFX0FOQ0hPUl9UWVBFKTsKICAgICAgICAgICAgICAgICByZXN1bHQuc2V0RXh0cmEodGV4dCk7CiAgICAgICAgICAgICB9CkBAIC0xNTM4LDM3ICsxNjk1LDM1IEBACiAgICAgICogUmVxdWVzdCB0aGUgaHJlZiBvZiBhbiBhbmNob3IgZWxlbWVudCBkdWUgdG8gZ2V0Rm9jdXNOb2RlUGF0aCByZXR1cm5pbmcKICAgICAgKiAiaHJlZi4iIElmIGhyZWZNc2cgaXMgbnVsbCwgdGhpcyBtZXRob2QgcmV0dXJucyBpbW1lZGlhdGVseSBhbmQgZG9lcyBub3QKICAgICAgKiBkaXNwYXRjaCBocmVmTXNnIHRvIGl0cyB0YXJnZXQuCi0gICAgICogCisgICAgICoKICAgICAgKiBAcGFy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IGluCisgICAgICAgIHJldHVybiBwaW5Mb2MoeSAtIHRpdGxlSCwgZ2V0Vmlld0hlaWdodCgpLAorICAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVWZXJ0aWNhbFNjcm9sbFJhbmdlKCkpICsgdGl0bGVIOwogICAgIH0KIAotICAgIC8qcGFja2FnZSovIGludCB2aWV3VG9Db250ZW50KGludCB4KSB7CisgICAgLyoqCisgICAgICogQSB0aXRsZSBiYXIgd2hpY2ggaXMgZW1iZWRkZWQgaW4gdGhpcyBXZWJWaWV3LCBhbmQgc2Nyb2xscyBhbG9uZyB3aXRoIGl0CisgICAgICogdmVydGljYWxseSwgYnV0IG5vdCBob3Jpem9udGFsbHkuCisgICAgICovCisgICAgcHJpdmF0ZSBWaWV3IG1UaXRsZUJhcjsKKworICAgIC8qKgorICAgICAqIEFkZCBvciByZW1vdmUgYSB0aXRsZSBiYXIgdG8gYmUgZW1iZWRkZWQgaW50byB0aGUgV2ViVmlldywgYW5kIHNjcm9sbAorICAgICAqIGFsb25nIHdpdGggaXQgdmVydGljYWxseSwgd2hpbGUgcmVtYWluaW5nIGluIHZpZXcgaG9yaXpvbnRhbGx5LiBQYXNzCisgICAgICogbnVsbCB0byByZW1vdmUgdGhlIHRpdGxlIGJhciBmcm9tIHRoZSBXZWJWaWV3LCBhbmQgcmV0dXJuIHRvIGRyYXdpbmcKKyAgICAgKiB0aGUgV2ViVmlldyBub3JtYWxseSB3aXRob3V0IHRyYW5zbGF0aW5nIHRvIGFjY291bnQgZm9yIHRoZSB0aXRsZSBiYXIuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRFbWJlZGRlZFRpdGxlQmFyKFZpZXcgdikgeworICAgICAgICBpZiAobVRpdGxlQmFyID09IHYpIHJldHVybjsKKyAgICAgICAgaWYgKG1UaXRsZUJhciAhPSBudWxsKSB7CisgICAgICAgICAgICByZW1vdmVWaWV3KG1UaXRsZUJhcik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG51bGwgIT0gdikgeworICAgICAgICAgICAgYWRkVmlldyh2LCBuZXcgQWJzb2x1dGVMYXlvdXQuTGF5b3V0UGFyYW1zKAorICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLkZJTExfUEFSRU5ULAorICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCwgMCwgMCkpOworICAgICAgICB9CisgICAgICAgIG1UaXRsZUJhciA9IHY7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2l2ZW4gYW4geCBjb29yZGluYXRlIGluIHZpZXcgc3BhY2UsIGNvbnZlcnQgaXQgdG8gY29udGVudCBzcGFjZS4gIEFsc28KKyAgICAgKiBtYXkgYmUgdXNlZCBmb3IgYWJzb2x1dGUgaGVpZ2h0cyAoc3VjaCBhcyBmb3IgdGhlIFdlYlRleHRWaWV3J3MKKyAgICAgKiB0ZXh0U2l6ZSwgd2hpY2ggaXMgdW5hZmZlY3RlZCBieSB0aGUgaGVpZ2h0IG9mIHRoZSB0aXRsZSBiYXIpLgorICAgICAqLworICAgIC8qcGFja2FnZSovIGludCB2aWV3VG9Db250ZW50WChpbnQgeCkgewogICAgICAgICByZXR1cm4gTWF0aC5yb3VuZCh4ICogbUludkFjdHVhbFNjYWxlKTsKICAgICB9CiAKLSAgICBwcml2YXRlIGludCBjb250ZW50VG9WaWV3KGludCB4KSB7Ci0gICAgICAgIHJldHVybiBNYXRoLnJvdW5kKHggKiBtQWN0dWFsU2NhbGUpOworICAgIC8qKgorICAgICAqIEdpdmVuIGEgeSBjb29yZGluYXRlIGluIHZpZXcgc3BhY2UsIGNvbnZlcnQgaXQgdG8gY29udGVudCBzcGFjZS4KKyAgICAgKiBUYWtlcyBpbnRvIGFjY291bnQgdGhlIGhlaWdodCBvZiB0aGUgdGl0bGUgYmFyIGlmIHRoZXJlIGlzIG9uZQorICAgICAqIGVtYmVkZGVkI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bnRvIGFjY291bnQgdGhlIGhlaWdodCBvZiB0aGUgdGl0bGUgYmFyLgorICAgICAqLworICAgIC8qcGFja2FnZSovIGludCBjb250ZW50VG9WaWV3WShpbnQgeSkgeworICAgICAgICByZXR1cm4gY29udGVudFRvVmlld0RpbWVuc2lvbih5KSArIGdldFRpdGxlSGVpZ2h0KCk7CiAgICAgfQogCiAgICAgLy8gQ2FsbGVkIGJ5IEpOSSB0byBpbnZhbGlkYXRlIHRoZSBWaWV3LCBnaXZlbiByZWN0YW5nbGUgY29vcmRpbmF0ZXMgaW4KICAgICAvLyBjb250ZW50IHNwYWNlCiAgICAgcHJpdmF0ZSB2b2lkIHZpZXdJbnZhbGlkYXRlKGludCBsLCBpbnQgdCwgaW50IHIsIGludCBiKSB7Ci0gICAgICAgIGludmFsaWRhdGUoY29udGVudFRvVmlldyhsKSwgY29udGVudFRvVmlldyh0KSwgY29udGVudFRvVmlldyhyKSwKLSAgICAgICAgICAgICAgICBjb250ZW50VG9WaWV3KGIpKTsKKyAgICAgICAgaW52YWxpZGF0ZShjb250ZW50VG9WaWV3WChsKSwgY29udGVudFRvVmlld1kodCksIGNvbnRlbnRUb1ZpZXdYKHIpLAorICAgICAgICAgICAgICAgIGNvbnRlbnRUb1ZpZXdZKGIpKTsKICAgICB9CiAKICAgICAvLyBDYWxsZWQgYnkgSk5JIHRvIGludmFsaWRhdGUgdGhlIFZpZXcgYWZ0ZXIgYSBkZWxheSwgZ2l2ZW4gcmVjdGFuZ2xlCiAgICAgLy8gY29vcmRpbmF0ZXMgaW4gY29udGVudCBzcGFjZQogICAgIHByaXZhdGUgdm9pZCB2aWV3SW52YWxpZGF0ZURlbGF5ZWQobG9uZyBkZWxheSwgaW50IGwsIGludCB0LCBpbnQgciwgaW50IGIpIHsKLSAgICAgICAgcG9zdEludmFsaWRhdGVEZWxheWVkKGRlbGF5LCBjb250ZW50VG9WaWV3KGwpLCBjb250ZW50VG9WaWV3KHQpLAotICAgICAgICAgICAgICAgIGNvbnRlbnRUb1ZpZXcociksIGNvbnRlbnRUb1ZpZXcoYikpOworICAgICAgICBwb3N0SW52YWxpZGF0ZURlbGF5ZWQoZGVsYXksIGNvbnRlbnRUb1ZpZXdYKGwpLCBjb250ZW50VG9WaWV3WSh0KSwKKyAgICAgICAgICAgICAgICBjb250ZW50VG9WaWV3WChyKSwgY29udGVudFRvVmlld1koYikpOwogICAgIH0KIAogICAgIHByaXZhdGUgUmVjdCBjb250ZW50VG9WaWV3KFJlY3QgeCkgewotICAgICAgICByZXR1cm4gbmV3IFJlY3QoY29udGVudFRvVmlldyh4LmxlZnQpLCBjb250ZW50VG9WaWV3KHgudG9wKQotICAgICAgICAgICAgICAgICwgY29udGVudFRvVmlldyh4LnJpZ2h0KSwgY29udGVudFRvVmlldyh4LmJvdHRvbSkpOworICAgICAgICByZXR1cm4gbmV3IFJlY3QoY29udGVudFRvVmlld1goeC5sZWZ0KSwgY29udGVudFRvVmlld1koeC50b3ApCisgICAgICAgICAgICAgICAgLCBjb250ZW50VG9WaWV3WCh4LnJpZ2h0KSwgY29udGVudFRvVmlld1koeC5ib3R0b20pKTsKKyAgICB9CisKKyAgICAvLyBzdG9wIHRoZSBzY3JvbGwgYW5pbWF0aW9uLCBhbmQgZG9uJ3QgbGV0IGEgc3Vic2VxdWVudCBmbGluZyBhZGQKKyAgICAvLyB0byB0aGUgZXhpc3RpbmcgdmVsb2NpdHkKKyAgICBwcml2YXRlIHZvaWQgYWJvcnRBbmltYXRpb24oKSB7CisgICAgICAgIG1TY3JvbGxlci5hYm9ydEFuaW1hdGlvbigpOworICAgICAgICBtTGFzdFZlbG9jaXR5ID0gMDsKICAgICB9CiAKICAgICAvKiBjYWxsIGZyb20gd2ViY29yZXZpZXcuZHJhdygpLCBzbyB3ZSdyZSBzdGlsbCBleGVjdXRpbmcgaW4gdGhlIFVJIHRocmVhZApAQCAtMTYzNyw3ICsxODY5LDcgQEAKICAgICAgICAgaWYgKCh3IHwgaCkgPT0gMCkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIC8vIGRvbid0IGFib3J0IGEgc2Nyb2xsIGFuaW1hdGlvbiBpZiB3ZSBkaWRuJ3QgY2hhbmdlIGFueXRoaW5nCiAgICAgICAgIGlmIChtQ29udGVudFdpZHRoICE9IHcgfHwgbUNvbnRlbnRIZWlnaHQgIT0gaCkgewogICAgICAgICAgICAgLy8gcmVjb3JkIG5ldyBkaW1lbnNpb25zCkBAIC0xNjUzLDcgKzE4ODUsNyBAQAogICAgICAgICAgICAgICAgIG1TY3JvbGxZID0gcGluTG9jWShtU2Nyb2xsWSk7CiAgICAgICAgICAgICAgICAgLy8gYW5kcm9pZC51dGlsLkxvZy5kKCJza2lhIiwgInJlY29yZE5ld0NvbnRlbnRTaXplIC0KICAgICAgICAgICAgICAgICAvLyBhYm9ydEFuaW1hdGlvbiIpOwotICAgICAgICAgICAgICAgIG1TY3JvbGxlci5hYm9ydEFuaW1hdGlvbigpOyAvLyBqdXN0IGluIGNhc2UKKyAgICAgICAgICAgICAgICBhYm9ydEFuaW1hdGlvbigpOyAvLyBqdXN0IGluIGNhc2UKICAgICAgICAgICAgICAgICBpZiAob2xkWCAhPSBtU2Nyb2xsWCB8fCBvbGRZICE9IG1TY3JvbGxZKSB7CiAgICAgICAgICAgICAgICAgICAgIHNlbmRPdXJWaXNpYmxlUmVjdCgpOwogICAgICAgICAgICAgICAgIH0KQEAgLTE2OTcsNyArMTkyOSwxMCBAQAogICAgICAgICAgICAgICAgIG1BY3R1YWxTY2FsZSA9IHNjYWxlOwogICAgICAgICAgICAgICAgIG1JbnZBY3R1YWxTY2FsZSA9IDEgLyBzY2FsZTsKIAotICAgICAgICAgICAgICAgIC8vIGFzIHdlIGRvbid0IGhhdmUgYW5pbWF0aW9uIGZvciBzY2FsaW5nLCBkb24ndCBkbyBhbmltYXRpb24gCisgICAgICAgICAgICAgICAgLy8gU2NhbGUgYWxsIHRoZSBjaGlsZCB2aWV3cworICAgICAgICAgICAgICAgIG1WaWV3TWFuYWdlci5zY2FsZUFsbCgpOworCisgICAgICAgICAgICAgICAgLy8gYXMgd2UgZG9uJ3QgaGF2ZSBhbmltYXRpb24gZm9yIHNjYWxpbmcsIGRvbid0IGRvIGFuaW1hdGlvbgogICAgICAgICAgICAgICAgIC8vIGZvciBzY3JvbGxpbmcsIGFzIGl0IGNhdXNlcyB3ZWlyZCBpbnRlcm1lZGlhdGUgc3RhdGUKICAgICAgICAgICAgICAgICAvLyAgICAgICAgcGluU2Nyb2xsVG8oTWF0aC5yb3VuZChzeCksIE1hdGgucm91bmQoc3kpKTsKICAgICAgICAgICAgICAgICBtU2Nyb2xsWCA9IHBpbkxvY1goTWF0aC5yb3VuZChzeCkpOwpAQCAtMTcxOCwxOCArMTk1MywyMSBAQAogICAgIHByaXZhdGUgUmVjdCBzZW5kT3VyVmlzaWJsZVJlY3QoKSB7CiAgICAgICAgIFJlY3QgcmVjdCA9IG5ldyBSZWN0KCk7CiAgICAgICAgIGNhbGNPdXJDb250ZW50VmlzaWJsZVJlY3QocmVjdCk7Ci0gICAgICAgIGlmIChtRmluZElzVXApIHsKLSAgICAgICAgICAgIHJlY3QuYm90dG9tIC09IHZpZXdUb0NvbnRlbnQoRklORF9IRUlHSFQpOwotICAgICAgICB9CiAgICAgICAgIC8vIFJlY3QuZXF1YWxzKCkgY2hlY2tzIGZvciBudWxsIGlucHV0LgogICAgICAgICBpZiAoIXJlY3QuZXF1YWxzKG1MYXN0VmlzaWJsZVJlY3RTZW50KSkgeworICAgICAgICAgICAgUG9pbnQgcG9zID0gbmV3IFBvaW50KHJlY3QubGVmdCwgcmVjdC50b3ApOwogICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlNFVF9TQ1JPTExfT0ZGU0VULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QubGVmdCwgcmVjdC50b3ApOworICAgICAgICAgICAgICAgICAgICBuYXRpdmVNb3ZlR2VuZXJhdGlvbigpLCAwLCBwb3MpOwogICAgICAgICAgICAgbUxhc3RWaXNpYmxlUmVjdFNlbnQgPSByZWN0OwogICAgICAgICB9CiAgICAgICAgIFJlY3QgZ2xvYmFsUmVjdCA9IG5ldyBSZWN0KCk7CiAgICAgICAgIGlmIChnZXRHbG9iYWxWaXNpYmxlUmVjdChnbG9iYWxSZWN0KQogICAgICAgICAgICAgICAgICYmICFnbG9iYWxSZWN0LmVxdWFscyhtTGFzdEdsb2JhbFJlY3QpKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInNlbmRPdXJWaXNpYmxlUmVjdD0oIiArIGdsb2JhbFJlY3QubGVmdCArICIsIgorICAgICAgICAgICAgICAgICAgICAgICAgKyBnbG9iYWxSZWN0LnRvcCArICIscj0iICsgZ2xvYmFsUmVjdC5yaWdodCArICIsYj0iCisgICAgICAgICAgICAgICAgICAgICAgICArIGdsb2JhbFJlY3QuYm90dG9tKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIC8vIFRPRE86IHRoZSBnbG9iYWwgb2Zmc2V0IGlzIG9ubHkgdXNlZCBieSB3aW5kb3dSZWN0KCkKICAgICAgICAgICAgIC8vIGluIENocm9tZUNsaWVudEFuZHJvaWQgOyBvdGhlciBjbGllbnRzIHN1Y2ggYXMgdG91Y2gKICAgICAgICAgICAgIC8vIGFuZCBtb3VzZSBldmVudHMgY291bGQgcmV0dXJuIHZpZXcgKyBzY3JlZW4gcmVsYXRpdmUgcG9pbnRzLgpAQCAtMTc0NCwxNSArMTk4MiwyNiBAQAogICAgICAgICBQb2ludCBwID0gbmV3IFBvaW50KCk7CiAgICAgICAgIGdldEdsb2JhbFZpc2libGVSZWN0KHIsIHApOwogICAgICAgICByLm9mZnNldCgtcC54LCAtcC55KTsKKyAgICAgICAgaWYgKG1GaW5kSXNVcCkgeworICAgICAgICAgICAgci5ib3R0b20gLT0gRklORF9IRUlHSFQ7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvLyBTZXRzIHIgdG8gYmUgb3VyIHZpc2libGUgcmVjdGFuZ2xlIGluIGNvbnRlbnQgY29vcmRpbmF0ZXMKICAgICBwcml2YXRlIHZvaWQgY2FsY091ckNvbnRlbnRWaXNpYmxlUmVjdChSZWN0IHIpIHsKICAgICAgICAgY2FsY091clZpc2libGVSZWN0KHIpOwotICAgICAgICByLmxlZnQgPSB2aWV3VG9Db250ZW50KHIubGVmdCk7Ci0gICAgICAgIHIudG9wID0gdmlld1RvQ29udGVudChyLnRvcCk7Ci0gICAgICAgIHIucmlnaHQgPSB2aWV3VG9Db250ZW50KHIucmlnaHQpOwotICAgICAgICByLmJvdHRvbSA9IHZpZXdUb0NvbnRlbnQoci5ib3R0b20pOworICAgICAgICByLmxlZnQgPSB2aWV3VG9Db250ZW50WChyLmxlZnQpOworICAgICAgICByLnRvcCA9IHZpZXdUb0NvbnRlbnRZKHIudG9wKTsKKyAgICAgICAgci5yaWdodCA9IHZpZXdUb0NvbnRlbnRYKHIucmlnaHQpOworICAgICAgICByLmJvdHRvbSA9IHZpZXdUb0NvbnRlbnRZKHIuYm90dG9tKTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgVmlld1NpemVEYXRhIHsKKyAgICAgICAgaW50IG1XaWR0aDsKKyAgICAgICAgaW50IG1IZWlnaHQ7CisgICAgICAgIGludCBtVGV4dFdyYXBXaWR0aDsKKyAgICAgICAgZmxvYXQgbVNjYWxlOworICAgICAgICBib29sZWFuIG1JZ25vcmVIZWlnaHQ7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xNzYyLDcgKzIwMTEsOCBAQAogICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBuZXcgdmFsdWVzIHdlcmUgc2VudAogICAgICAqLwogICAgIHByaXZhdGUgYm9vbGVhbiBzZW5kVmlld1NpemVab29tKCkgewotICAgICAgICBpbnQgbmV3V2l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gT3RoZXJ3aXNlIHdlIG1heSBnZXQgYQorICAgICAgICAgICAgLy8gZmFrZWQgc2Nyb2xsYmFyIHNvbWV0aW1lcy4KKyAgICAgICAgICAgIHJldHVybiBnZXRWaWV3V2lkdGgoKTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBjb250ZW50VG9WaWV3KG1Db250ZW50V2lkdGgpOworICAgICAgICAgICAgcmV0dXJuIGNvbnRlbnRUb1ZpZXdEaW1lbnNpb24obUNvbnRlbnRXaWR0aCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTE4MDMsNyArMjA2NiwxNCBAQAogICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7CiAgICAgICAgICAgICByZXR1cm4gbUhpc3RvcnlIZWlnaHQ7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpbnQgaGVpZ2h0ID0gY29udGVudFRvVmlldyhtQ29udGVudEhlaWdodCk7CisgICAgICAgICAgICBpbnQgaGVpZ2h0OworICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlIHRvIGF2b2lkIHJvdW5kaW5nIGVycm9yLiBPdGhlcndpc2Ugd2UgbWF5IGdldCBhCisgICAgICAgICAgICAvLyBmYWtlZCBzY3JvbGxiYXIgc29tZXRpbWVzLgorICAgICAgICAgICAgaWYgKG1MYXN0SGVpZ2h0U2VudCA9PSBtQ29udGVudEhlaWdodCkgeworICAgICAgICAgICAgICAgIGhlaWdodCA9IGdldFZpZXdIZWlnaHQoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaGVpZ2h0ID0gY29udGVudFRvVmlld0RpbWVuc2lvbihtQ29udGVudEhlaWdodCk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAobUZpbmRJc1VwKSB7CiAgICAgICAgICAgICAgICAgaGVpZ2h0ICs9IEZJTkRfSEVJR0hUOwogICAgICAgICAgICAgfQpAQCAtMTgxMSw2ICsyMDgxLDI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bWF0ZSwgMCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTIxMTgsOCArMjQ4NCw4IEBACiAgICAgICAgICAgICAvLyBzYXZlZCBzY3JvbGwgcG9zaXRpb24sIGl0IGlzIG9rIHRvIHNraXAgdGhpcy4KICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQotICAgICAgICBpbnQgdnggPSBjb250ZW50VG9WaWV3KGN4KTsKLSAgICAgICAgaW50IHZ5ID0gY29udGVudFRvVmlldyhjeSk7CisgICAgICAgIGludCB2eCA9IGNvbnRlbnRUb1ZpZXdYKGN4KTsKKyAgICAgICAgaW50IHZ5ID0gY29udGVudFRvVmlld1koY3kpOwogLy8gICAgICAgIExvZy5kKExPR1RBRywgImNvbnRlbnQgc2Nyb2xsVG8gWyIgKyBjeCArICIgIiArIGN5ICsgIl0gdmlldz1bIiArCiAvLyAgICAgICAgICAgICAgICAgICAgICB2eCArICIgIiArIHZ5ICsgIl0iKTsKICAgICAgICAgcGluU2Nyb2xsVG8odngsIHZ5LCBmYWxzZSwgMCk7CkBAIC0yMTM3LDggKzI1MDMsOCBAQAogICAgICAgICAgICAgLy8gaXMgdXNlZCBpbiB0aGUgdmlldyBzeXN0ZW0uCiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLSAgICAgICAgaW50IHZ4ID0gY29udGVudFRvVmlldyhjeCk7Ci0gICAgICAgIGludCB2eSA9IGNvbnRlbnRUb1ZpZXcoY3kpOworICAgICAgICBpbnQgdnggPSBjb250ZW50VG9WaWV3WChjeCk7CisgICAgICAgIGludCB2eSA9IGNvbnRlbnRUb1ZpZXdZKGN5KTsKICAgICAgICAgcGluU2Nyb2xsVG8odngsIHZ5LCB0cnVlLCAwKTsKICAgICB9CiAKQEAgLTIxNTUsMTIgKzI1MjEsMTIgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChtSGVpZ2h0Q2FuTWVhc3VyZSkgewotICAgICAgICAgICAgaWYgKGdldE1lYXN1cmVkSGVpZ2h0KCkgIT0gY29udGVudFRvVmlldyhtQ29udGVudEhlaWdodCkKKyAgICAgICAgICAgIGlmIChnZXRNZWFzdXJlZEhlaWdodCgpICE9IGNvbnRlbnRUb1ZpZXdEaW1lbnNpb24obUNvbnRlbnRIZWlnaHQpCiAgICAgICAgICAgICAgICAgICAgICYmIHVwZGF0ZUxheW91dCkgewogICAgICAgICAgICAgICAgIHJlcXVlc3RMYXlvdXQoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIGlmIChtV2lkdGhDYW5NZWFzdXJlKSB7Ci0gICAgICAgICAgICBpZiAoZ2V0TWVhc3VyZWRXaWR0aCgpICE9IGNvbnRlbnRUb1ZpZXcobUNvbnRlbnRXaWR0aCkKKyAgICAgICAgICAgIGlmIChnZXRNZWFzdXJlZFdpZHRoKCkgIT0gY29udGVudFRvVmlld0RpbWVuc2lvbihtQ29udGVudFdpZHRoKQogICAgICAgICAgICAgICAgICAgICAmJiB1cGRhdGVMYXlvdXQpIHsKICAgICAgICAgICAgICAgICByZXF1ZXN0TGF5b3V0KCk7CiAgICAgICAgICAgICB9CkBAIC0yMjAxLDYgKzI1NjcsMTYgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiBHZXRzIHRoZSBjaHJvbWUgaGFuZGxlci4KKyAgICAgKiBAcmV0dXJuIHRoZSBjdXJyZW50IFdlYkNocm9tZUNsaWVudCBpbnN0YW5jZS4KKyAgICAgKgorICAgICAqIEBoaWRlIEFQSSBjb3VuY2lsIGFwcHJvdmFsLgorICAgICAqLworICAgIHB1YmxpYyBXZWJDaHJvbWVDbGllbnQgZ2V0V2ViQ2hyb21lQ2xpZW50KCkgeworICAgICAgICByZXR1cm4gbUNhbGxiYWNrUHJveHkuZ2V0V2ViQ2hyb21lQ2xpZW50KCk7CisgICAgfQorCisgICAgLyoqCiAgICAgICogU2V0IHRoZSBQaWN0dXJlIGxpc3RlbmVyLiBUaGlzIGlzIGFuIGludGVyZmFjZSB1c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aXMgaXMgZXNwZWNpYWxseSBpbXBvcnRhbnQgZm9yIHBhc3N3b3JkIGZpZWxkcywgd2hpY2ggYXJlCisgICAgICogZHJhd24gYnkgdGhlIFdlYlRleHRWaWV3LCBzaW5jZSBpdCBjb252ZXlzIG1vcmUgaW5mb3JtYXRpb24gdGhhbiB3aGF0CisgICAgICogd2Via2l0IGRyYXdzLiAgVGh1cyB3ZSBuZWVkIHRvIHJlcG9zaXRpb24gaXQgdG8gc2hvdyBpbiB0aGUgY29ycmVjdAorICAgICAqIHBsYWNlLgorICAgICAqLworICAgIHByaXZhdGUgYm9vbGVhbiBtTmVlZFRvQWRqdXN0V2ViVGV4dFZpZXc7CisKKyAgICBwcml2YXRlIHZvaWQgZHJhd0NvcmVBbmRDdXJzb3JSaW5nKENhbnZhcyBjYW52YXMsIGludCBjb2xvciwKKyAgICAgICAgYm9vbGVhbiBkcmF3Q3Vyc29yUmluZykgewogICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7CiAgICAgICAgICAgICBjYW52YXMuc2NhbGUobUFjdHVhbFNjYWxlLCBtQWN0dWFsU2NhbGUpOwogICAgICAgICAgICAgY2FudmFzLmRyYXdQaWN0dXJlKG1IaXN0b3J5UGljdHVyZSk7CkBAIC0yMzYxLDQxICsyNzY0LDU4IEBACiAgICAgICAgIH0KIAogICAgICAgICBib29sZWFuIGFuaW1hdGVab29tID0gbVpvb21TY2FsZSAhPSAwOwotICAgICAgICBib29sZWFuIGFuaW1hdGVTY3JvbGwgPSAhbVNjcm9sbGVyLmlzRmluaXNoZWQoKSAKKyAgICAgICAgYm9vbGVhbiBhbmltYXRlU2Nyb2xsID0gIW1TY3JvbGxlci5pc0ZpbmlzaGVkKCkKICAgICAgICAgICAgICAgICB8fCBtVmVsb2NpdHlUcmFja2VyICE9IG51bGw7CiAgICAgICAgIGlmIChhbmltYXRlWm9vbSkgewogICAgICAgICAgICAgZmxvYXQgem9vbVNjYWxlOwogICAgICAgICAgICAgaW50IGludGVydmFsID0gKGludCkgKFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpIC0gbVpvb21TdGFydCk7CiAgICAgICAgICAgICBpZiAoaW50ZXJ2YWwgPCBaT09NX0FOSU1BVElPTl9MRU5HVEgpIHsKICAgICAgICAgICAgICAgICBmbG9hdCByYXRpbyA9IChmbG9hdCkgaW50ZXJ2YWwgLyBaT09NX0FOSU1BVElPTl9MRU5HVEg7Ci0gICAgICAgICAgICAgICAgem9vbVNjYWxlID0gMS4wZiAvIChtSW52SW5pdGlhbFpvb21TY2FsZSAKKyAgICAgICAgICAgICAgICB6b29tU2NhbGUgPSAxLjBmIC8gKG1JbnZJbml0aWFsWm9vbVNjYWxlCiAgICAgICAgICAgICAgICAgICAgICAgICArIChtSW52RmluYWxab29tU2NhbGUgLSBtSW52SW5pdGlhbFpvb21TY2FsZSkgKiByYXRpbyk7CiAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICB6b29tU2NhbGUgPSBtWm9vbVNjYWxlOwogICAgICAgICAgICAgICAgIC8vIHNldCBtWm9vbVNjYWxlIHRvIGJlIDAgYXMgd2UgaGF2ZSBkb25lIGFuaW1hdGlvbgogICAgICAgICAgICAgICAgIG1ab29tU2NhbGUgPSAwOworICAgICAgICAgICAgICAgIGlmIChtTmVlZFRvQWRqdXN0V2ViVGV4dFZpZXcpIHsKKyAgICAgICAgICAgICAgICAgICAgbU5lZWRUb0FkanVzdFdlYlRleHRWaWV3ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRUZXh0U2l6ZShUeXBlZFZhbHVlLkNPTVBMRVhfVU5JVF9QWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VG9WaWV3RGltZW5zaW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUZvY3VzQ2FuZGlkYXRlVGV4dFNpemUoKSkpOworICAgICAgICAgICAgICAgICAgICBSZWN0IGJvdW5kcyA9IG5hdGl2ZUZvY3VzQ2FuZGlkYXRlTm9kZUJvdW5kcygpOworICAgICAgICAgICAgICAgICAgICBSZWN0IHZCb3ggPSBjb250ZW50VG9WaWV3KGJvdW5kcyk7CisgICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRSZWN0KHZCb3gubGVmdCwgdkJveC50b3AsIHZCb3gud2lkdGgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2Qm94LmhlaWdodCgpKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgaXQgaXMgYSBwYXNzd29yZCBmaWVsZCwgc3RhcnQgZHJhd2luZyB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gV2ViVGV4dFZpZXcgb25jZSBhZ2Fpbi4KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzQ2FuZGlkYXRlSXNQYXNzd29yZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVGV4dFZpZXcuc2V0SW5QYXNzd29yZCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZsb2F0IHNjYWxlID0gKG1BY3R1YWxTY2FsZSAtIHpvb21TY2FsZSkgKiBtSW52QWN0dWFsU2NhbGU7Ci0gICAgICAgICAgICBmbG9hdCB0eCA9IHNjYWxlICogKG1ab29tQ2VudGVyWCArIG1TY3JvbGxYKTsKLSAgICAgICAgICAgIGZsb2F0IHR5ID0gc2NhbGUgKiAobVpvb21DZW50ZXJZICsgbVNjcm9sbFkpOwotCi0gICAgICAgICAgICAvLyB0aGlzIGJsb2NrIHBpbnMgdGhlIHRyYW5zbGF0ZSB0byAibGVnYWwiIGJvdW5kcy4gVGhpcyBtYWtlcyB0aGUKLSAgICAgICAgICAgIC8vIGFuaW1hdGlvbiBhIGJpdCBub24tb2J2aW91cywgYnV0IGl0IG1lYW5zIHdlIHdvbid0IHBvcCB3aGVuIHRoZQotICAgICAgICAgICAgLy8gInJlYWwiIHpvb20gdGFrZXMgZWZmZWN0Ci0gICAgICAgICAgICBpZiAodHJ1ZSkgewotICAgICAgICAgICAgICAgLy8gY2FudmFzLnRyYW5zbGF0ZShtU2Nyb2xsWCwgbVNjcm9sbFkpOwotICAgICAgICAgICAgICAgIHR4IC09IG1TY3JvbGxYOwotICAgICAgICAgICAgICAgIHR5IC09IG1TY3JvbGxZOwotICAgICAgICAgICAgICAgIHR4ID0gLXBpbkxvYygtTWF0aC5yb3VuZCh0eCksIGdldFZpZXdXaWR0aCgpLCBNYXRoCi0gICAgICAgICAgICAgICAgICAgICAgICAucm91bmQobUNvbnRlbnRXaWR0aCAqIHpvb21TY2FsZSkpOwotICAgICAgICAgICAgICAgIHR5ID0gLXBpbkxvYygtTWF0aC5yb3VuZCh0eSksIGdldFZpZXdIZWlnaHQoKSwgTWF0aAotICAgICAgICAgICAgICAgICAgICAgICAgLnJvdW5kKG1Db250ZW50SGVpZ2h0ICogem9vbVNjYWxlKSk7Ci0gICAgICAgICAgICAgICAgdHggKz0gbVNjcm9sbFg7Ci0gICAgICAgICAgICAgICAgdHkgKz0gbVNjcm9sbFk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBmbG9hdCBzY2FsZSA9IHpvb21TY2FsZSAqIG1JbnZJbml0aWFsWm9vbVNjYWxlOworICAgICAgICAgICAgaW50IHR4ID0gTWF0aC5yb3VuZChzY2FsZSAqIChtSW5pdGlhbFNjcm9sbFggKyBtWm9vbUNlbnRlclgpCisgICAgICAgICAgICAgICAgICAgIC0gbVpvb21DZW50ZXJYKTsKKyAgICAgICAgICAgIHR4ID0gLXBpbkxvYyh0eCwgZ2V0Vmlld1dpZHRoKCksIE1hdGgucm91bmQobUNvbnRlbnRXaWR0aAorICAgICAgICAgICAgICAgICAgICAqIHpvb21TY2FsZSkpICsgbVNjcm9sbFg7CisgICAgICAgICAgICBpbnQgdHkgPSBNYXRoLnJvdW5kKHNjYWxlICogKG1Jbml0aWFsU2Nyb2xsWSArIG1ab29tQ2VudGVyWSkKKyAgICAgICAgICAgICAgICAgICAgLSBtWm9vbUNlbnRlclkpOworICAgICAgICAgICAgdHkgPSAtcGluTG9jKHR5LCBnZXRWaWV3SGVpZ2h0KCksIE1hdGgucm91bmQobUNvbnRlbnRIZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgKiB6b29tU2NhbGUpKSArIG1TY3JvbGxZOwogICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSh0eCwgdHkpOwogICAgICAgICAgICAgY2FudmFzLnNjYWxlKHpvb21TY2FsZSwgem9vbVNjYWxlKTsKKyAgICAgICAgICAgIGlmIChpbkVkaXRpbmdNb2RlKCkgJiYgIW1OZWVkVG9BZGp1c3RXZWJUZXh0VmlldworICAgICAgICAgICAgICAgICAgICAmJiBtWm9vbVNjYWxlICE9IDApIHsKKyAgICAgICAgICAgICAgICAvLyBUaGUgV2ViVGV4dFZpZXcgaXMgdXAuICBLZWVwIHRyYWNrIG9mIHRoaXMgc28gd2UgY2FuIGFkanVzdAorICAgICAgICAgICAgICAgIC8vIGl0cyBzaXplIGFuZCBwbGFjZW1lbnQgd2hlbiB3ZSBmaW5pc2ggem9vbWluZworICAgICAgICAgICAgICAgIG1OZWVkVG9BZGp1c3RXZWJUZXh0VmlldyA9IHRydWU7CisgICAgICAgICAgICAgICAgLy8gSWYgaXQgaXMgaW4gcGFzc3dvcmQgbW9kZSwgdHVybiBpdCBvZmYgc28gaXQgZG9lcyBub3QgZHJhdworICAgICAgICAgICAgICAgIC8vIG1pc3BsYWNlZC4KKyAgICAgICAgICAgICAgICBpZiAobmF0aXZlRm9jdXNDYW5kaWRhdGVJc1Bhc3N3b3JkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEluUGFzc3dvcmQoZmFsc2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIGNhbnZhcy5zY2FsZShtQWN0dWFsU2NhbGUsIG1BY3R1YWxTY2FsZSk7CiAgICAgICAgIH0KQEAgLTI0MDgsMTAgKzI4MjgsMTAgQEAKICAgICAgICAgICAgIGlmIChtVG91Y2hTZWxlY3Rpb24pIHsKICAgICAgICAgICAgICAgICBuYXRpdmVEcmF3U2VsZWN0aW9uUmVnaW9uKGNhbnZhcyk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG5hdGl2ZURyYXdTZWxlY3Rpb24oY2FudmFzLCBtU2VsZWN0WCwgbVNlbGVjdFksIAorICAgICAgICAgICAgICAgIG5hdGl2ZURyYXdTZWxlY3Rpb24oY2FudmFzLCBtU2VsZWN0WCwgbVNlbGVjdFksCiAgICAgICAgICAgICAgICAgICAgICAgICBtRXh0ZW5kU2VsZWN0aW9uKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChkcmF3Rm9jdXMpIHsKKyAgICAgICAgfSBlbHNlIGlmIChkcmF3Q3Vyc29yUmluZykgewogICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfU0hPUlRQUkVTU19TVEFSVF9NT0RFKSB7CiAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX1NIT1JUUFJFU1NfTU9ERTsKICAgICAgICAgICAgICAgICBIaXRUZXN0UmVzdWx0IGhpdFRlc3QgPSBnZXRIaXRUZXN0UmVzdWx0KCk7CkBAIC0yNDIyLDcgKzI4NDIsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPTkdfUFJFU1NfVElNRU9VVCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgbmF0aXZlRHJhd0ZvY3VzUmluZyhjYW52YXMpOworICAgICAgICAgICAgbmF0aXZlRHJhd0N1cnNvclJpbmcoY2F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9IGhlaWdodCkgewogICAgICAgICAgICAgcmV0dXJuIGhhbGZTY2FsZTsKICAgICAgICAgfQotICAgICAgICBmbG9hdCBwYXJ0ID0gKGhlaWdodCAtIG1Db250ZW50SGVpZ2h0ICogbVpvb21TY3JvbGxMaW1pdCkgIAorICAgICAgICBmbG9hdCBwYXJ0ID0gKGhlaWdodCAtIG1Db250ZW50SGVpZ2h0ICogbVpvb21TY3JvbGxMaW1pdCkKICAgICAgICAgICAgICAgICAvIChoZWlnaHQgKiAoMSAtIG1ab29tU2Nyb2xsTGltaXQpKTsKICAgICAgICAgcmV0dXJuIGhhbGZTY2FsZSAqIHBhcnQgKyBub1NjYWxlICogKDEuMGYgLSBwYXJ0KTsKICAgICB9Ci0gICAgCisKICAgICBwcml2YXRlIGZsb2F0IHNjcm9sbFpvb21NYWdTY2FsZShmbG9hdCBpbnZTY2FsZSkgewogICAgICAgICByZXR1cm4gKGludlNjYWxlICogMiArIG1JbnZBY3R1YWxTY2FsZSkgLyAzOwogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgdm9pZCBzY3JvbGxab29tRHJhdyhDYW52YXMgY2FudmFzKSB7Ci0gICAgICAgIGZsb2F0IGludlNjYWxlID0gbVpvb21TY3JvbGxJbnZMaW1pdDsgCisgICAgICAgIGZsb2F0IGludlNjYWxlID0gbVpvb21TY3JvbGxJbnZMaW1pdDsKICAgICAgICAgaW50IGVsYXBzZWQgPSAwOwogICAgICAgICBpZiAobVRvdWNoTW9kZSAhPSBTQ1JPTExfWk9PTV9PVVQpIHsKLSAgICAgICAgICAgIGVsYXBzZWQgPSAoaW50KSBNYXRoLm1pbihTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAKKyAgICAgICAgICAgIGVsYXBzZWQgPSAoaW50KSBNYXRoLm1pbihTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKQogICAgICAgICAgICAgICAgIC0gbVpvb21TY3JvbGxTdGFydCwgU0NST0xMX1pPT01fRFVSQVRJT04pOwotICAgICAgICAgICAgZmxvYXQgdHJhbnNpdGlvblNjYWxlID0gKG1ab29tU2Nyb2xsSW52TGltaXQgLSBtSW52QWN0dWFsU2NhbGUpIAorICAgICAgICAgICAgZmxvYXQgdHJhbnNpdGlvblNjYWxlID0gKG1ab29tU2Nyb2xsSW52TGltaXQgLSBtSW52QWN0dWFsU2NhbGUpCiAgICAgICAgICAgICAgICAgICAgICogZWxhcHNlZCAvIFNDUk9MTF9aT09NX0RVUkFUSU9OOwogICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gU0NST0xMX1pPT01fQU5JTUFUSU9OX09VVCkgewogICAgICAgICAgICAgICAgIGludlNjYWxlID0gbUludkFjdHVhbFNjYWxlICsgdHJhbnNpdGlvblNjYWxlOwpAQCAtMjU0NSwyMSArMjk2MywyMyBAQAogICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gU0NST0xMX1pPT01fQU5JTUFUSU9OX0lOKSB7CiAgICAgICAgICAgICAgICAgc2V0SG9yaXpvbnRhbFNjcm9sbEJhckVuYWJsZWQodHJ1ZSk7CiAgICAgICAgICAgICAgICAgc2V0VmVydGljYWxTY3JvbGxCYXJFbmFibGVkKHRydWUpOwotICAgICAgICAgICAgICAgIHVwZGF0ZVRleHRFbnRyeSgpOwotICAgICAgICAgICAgICAgIHNjcm9sbFRvKChpbnQpIChzY3JvbGxGcmFtZS5jZW50ZXJYKCkgKiBtQWN0dWFsU2NhbGUpIAotICAgICAgICAgICAgICAgICAgICAgICAgLSAod2lkdGggPj4gMSksIChpbnQpIChzY3JvbGxGcmFtZS5jZW50ZXJZKCkgCisgICAgICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CisgICAgICAgICAgICAgICAgc2Nyb2xsVG8oKGludCkgKHNjcm9sbEZyYW1lLmNlbnRlclgoKSAqIG1BY3R1YWxTY2FsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIC0gKHdpZHRoID4+IDEpLCAoaW50KSAoc2Nyb2xsRnJhbWUuY2VudGVyWSgpCiAgICAgICAgICAgICAgICAgICAgICAgICAqIG1BY3R1YWxTY2FsZSkgLSAoaGVpZ2h0ID4+IDEpKTsKICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOworICAgICAgICAgICAgICAgIC8vIFNob3cgYWxsIHRoZSBjaGlsZCB2aWV3cyBvbmNlIHdlIGFyZSBkb25lLgorICAgICAgICAgICAgICAgIG1WaWV3TWFuYWdlci5zaG93QWxsKCk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBTQ1JPTExfWk9PTV9PVVQ7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgZmxvYXQgbmV3WCA9IHNjcm9sbFpvb21YKHNjYWxlKTsKICAgICAgICAgZmxvYXQgbmV3WSA9IHNjcm9sbFpvb21ZKHNjYWxlKTsKLSAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAic2Nyb2xsWm9vbURyYXcgc2NhbGU9IiArIHNjYWxlICsgIiArICgiICsgbmV3WAogICAgICAgICAgICAgICAgICAgICArICIsICIgKyBuZXdZICsgIikgbVpvb21TY3JvbGw9KCIgKyBtWm9vbVNjcm9sbFggKyAiLCAiCi0gICAgICAgICAgICAgICAgICAgICsgbVpvb21TY3JvbGxZICsgIikiICsgIiBpbnZTY2FsZT0iICsgaW52U2NhbGUgKyAiIHNjYWxlPSIgCisgICAgICAgICAgICAgICAgICAgICsgbVpvb21TY3JvbGxZICsgIikiICsgIiBpbnZTY2FsZT0iICsgaW52U2NhbGUgKyAiIHNjYWxlPSIKICAgICAgICAgICAgICAgICAgICAgKyBzY2FsZSk7CiAgICAgICAgIH0KICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZShuZXdYLCBuZXdZKTsKQEAgLTI2MDMsOCArMzAyMyw4IEBACiAgICAgICAgIH0KICAgICAgICAgY2FudmFzLnNjYWxlKGhhbGZTY2FsZSwgaGFsZlNjYWxlLCBtWm9vbVNjcm9sbFggKyB3aWR0aCAqIGhhbGZYCiAgICAgICAgICAgICAgICAgLCBtWm9vbVNjcm9sbFkgKyBoZWlnaHQgKiBoYWxmWSk7Ci0gICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgIExvZy52KExPR1RBRywgInNjcm9sbFpvb21EcmF3IGhhbGZTY2FsZT0iICsgaGFsZlNjYWxlICsgIiB3L2g9KCIgCisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJzY3JvbGxab29tRHJhdyBoYWxmU2NhbGU9IiArIGhhbGZTY2FsZSArICIgdy9oPSgiCiAgICAgICAgICAgICAgICAgICAgICsgd2lkdGggKyAiLCAiICsgaGVpZ2h0ICsgIikgaGFsZj0oIiArIGhhbGZYICsgIiwgIgogICAgICAgICAgICAgICAgICAgICArIGhhbGZZICsgIikiKTsKICAgICAgICAgfQpAQCAtMjYzMiwxNCArMzA1MiwxNyBAQAogICAgICAgICAgICAgICAgICwgTWF0aC5tYXgoMCwgKGludCkgKCh4IC0gbGVmdCkgLyBzY2FsZSkpKTsKICAgICAgICAgbVpvb21TY3JvbGxZID0gTWF0aC5taW4obUNvbnRlbnRIZWlnaHQgLSBoZWlnaHQKICAgICAgICAgICAgICAgICAsIE1hdGgubWF4KDAsIChpbnQpICgoeSAtIHRvcCkgLyBzY2FsZSkpKTsKLSAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgeworICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiem9vbVNjcm9sbFRhcCBzY2FsZT0iICsgc2NhbGUgKyAiICsgKCIgKyBsZWZ0CiAgICAgICAgICAgICAgICAgICAgICsgIiwgIiArIHRvcCArICIpIG1ab29tU2Nyb2xsPSgiICsgbVpvb21TY3JvbGxYICsgIiwgIgogICAgICAgICAgICAgICAgICAgICArIG1ab29tU2Nyb2xsWSArICIpIiArICIgeD0iICsgeCArICIgeT0iICsgeSk7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIGJvb2xlYW4gY2FuWm9vbVNjcm9sbE91dCgpIHsKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGNhblpvb21TY3JvbGxPdXQoKSB7CiAgICAgICAgIGlmIChtQ29udGVudFdpZHRoID09IDAgfHwgbUNvbnRlbnRIZWlnaHQgPT0gMCkgewogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CkBAIC0yNjQ5LDcgKzMwNzIsNyBAQAogICAgICAgICBmbG9hdCB5ID0gKGZsb2F0KSBoZWlnaHQgLyAoZmxvYXQpIG1Db250ZW50SGVpZ2h0OwogICAgICAgICBtWm9vbVNjcm9sbExpbWl0ID0gTWF0aC5tYXgoREVGQVVMVF9NSU5fWk9PTV9TQ0FMRSwgTWF0aC5taW4oeCwgeSkpOwogICAgICAgICBtWm9vbVNjcm9sbEludkxpbWl0ID0gMS4wZiAvIG1ab29tU2Nyb2xsTGltaXQ7Ci0gICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgImNhblpvb21TY3JvbGxPdXQiCiAgICAgICAgICAgICAgICAgICAgICsgIiBtSW52QWN0dWFsU2NhbGU9IiArIG1JbnZBY3R1YWxTY2FsZQogICAgICAgICAgICAgICAgICAgICArICIgbVpvb21TY3JvbGxMaW1pdD0iICsgbVpvb21TY3JvbGxMaW1pdApAQCAtMjY2NCw3ICszMDg3LDcgQEAKICAgICAgICAgcmV0dXJuIG1Db250ZW50V2lkdGggPj0gd2lkdGggKiBsaW1pdAogICAgICAgICAgICAgICAgIHx8IG1Db250ZW50SGVpZ2h0ID49IGhlaWdodCAqIGxpbWl0OwogICAgIH0KLSAgICAgICAgCisKICAgICBwcml2YXRlIHZvaWQgc3RhcnRab29tU2Nyb2xsT3V0KCkgewogICAgICAgICBzZXRIb3Jpem9udGFsU2Nyb2xsQmFyRW5hYmxlZChmYWxzZSk7CiAgICAgICAgIHNldFZlcnRpY2FsU2Nyb2xsQmFyRW5hYmxlZChmYWxzZSk7CkBAIC0yNjg2LDM0ICszMTA5LDM5IEBACiAgICAgICAgIG1MYXN0VG91Y2hYID0gaGFsZlc7CiAgICAgICAgIGludCBoYWxmSCA9IGhlaWdodCA+PiAxOwogICAgICAgICBtTGFzdFRvdWNoWSA9IGhhbGZIOwotICAgICAgICBtU2Nyb2xsZXIuYWJvcnRBbmltYXRpb24oKTsKKyAgICAgICAgYWJvcnRBbmltYXRpb24oKTsKICAgICAgICAgbVpvb21TY3JvbGxTdGFydCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwogICAgICAgICBSZWN0IHpvb21GcmFtZSA9IHNjcm9sbFpvb21GcmFtZSh3aWR0aCwgaGVpZ2h0CiAgICAgICAgICAgICAgICAgLCBzY3JvbGxab29tTWFnU2NhbGUobVpvb21TY3JvbGxJbnZMaW1pdCkpOwotICAgICAgICBtWm9vbVNjcm9sbFggPSBNYXRoLm1heCgwLCAoaW50KSAoKG1TY3JvbGxYICsgaGFsZlcpICogbUludkFjdHVhbFNjYWxlKSAKKyAgICAgICAgbVpvb21TY3JvbGxYID0gTWF0aC5tYXgoMCwgKGludCkgKChtU2Nyb2xsWCArIGhhbGZXKSAqIG1JbnZBY3R1YWxTY2FsZSkKICAgICAgICAgICAgICAgICAtICh6b29tRnJhbWUud2lkdGgoKSA+PiAxKSk7Ci0gICAgICAgIG1ab29tU2Nyb2xsWSA9IE1hdGgubWF4KDAsIChpbnQpICgobVNjcm9sbFkgKyBoYWxmSCkgKiBtSW52QWN0dWFsU2NhbGUpIAorICAgICAgICBtWm9vbVNjcm9sbFkgPSBNYXRoLm1heCgwLCAoaW50KSAoKG1TY3JvbGxZICsgaGFsZkgpICogbUludkFjdHVhbFNjYWxlKQogICAgICAgICAgICAgICAgIC0gKHpvb21GcmFtZS5oZWlnaHQoKSA+PiAxKSk7CiAgICAgICAgIHNjcm9sbFRvKDAsIDApOyAvLyB0cmlnZ2VycyBpbnZhbCwgc3RhcnRzIGFuaW1hdGlvbgogICAgICAgICBjbGVhclRleHRFbnRyeSgpOwotICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICBMb2cudihMT0dUQUcsICJzdGFydFpvb21TY3JvbGxPdXQgbVpvb21TY3JvbGw9KCIgCisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJzdGFydFpvb21TY3JvbGxPdXQgbVpvb21TY3JvbGw9KCIKICAgICAgICAgICAgICAgICAgICAgKyBtWm9vbVNjcm9sbFggKyAiLCAiICsgbVpvb21TY3JvbGxZICsiKSIpOwogICAgICAgICB9CiAgICAgfQotICAgIAotICAgIHByaXZhdGUgdm9pZCB6b29tU2Nyb2xsT3V0KCkgeworCisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCB6b29tU2Nyb2xsT3V0KCkgewogICAgICAgICBpZiAoY2FuWm9vbVNjcm9sbE91dCgpID09IGZhbHNlKSB7CiAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIC8vIEhpZGUgdGhlIGNoaWxkIHZpZXdzIHdoaWxlIGluIHRoaXMgbW9kZS4KKyAgICAgICAgbVZpZXdNYW5hZ2VyLmhpZGVBbGwoKTsKICAgICAgICAgc3RhcnRab29tU2Nyb2xsT3V0KCk7CiAgICAgICAgIG1Ub3VjaE1vZGUgPSBTQ1JPTExfWk9PTV9BTklNQVRJT05fT1VUOwogICAgICAgICBpbnZhbGlkYXRlKCk7CiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIG1vdmVab29tU2Nyb2xsV2luZG93KGZsb2F0IHgsIGZsb2F0IHkpIHsKLSAgICAgICAgaWYgKE1hdGguYWJzKHggLSBtTGFzdFpvb21TY3JvbGxSYXdYKSA8IDEuNWYgCisgICAgICAgIGlmIChNYXRoLmFicyh4IC0gbUxhc3Rab29tU2Nyb2xsUmF3WCkgPCAxLjVmCiAgICAgICAgICAgICAgICAgJiYgTWF0aC5hYnMoeSAtIG1MYXN0Wm9vbVNjcm9sbFJhd1kpIDwgMS41ZikgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CkBAIC0yNzI1LDEyICszMTUzLDEyIEBACiAgICAgICAgIGludCBoZWlnaHQgPSBnZXRWaWV3SGVpZ2h0KCk7CiAgICAgICAgIGludCBtYXhab29tWCA9IG1Db250ZW50V2lkdGggLSB3aWR0aDsKICAgICAgICAgaWYgKG1heFpvb21YID4gMCkgewotICAgICAgICAgICAgaW50IG1heFNjcmVlblggPSB3aWR0aCAtIChpbnQpIE1hdGguY2VpbCh3aWR0aCAKKyAgICAgICAgICAgIGludCBtYXhTY3JlZW5YID0gd2lkdGggLSAoaW50KSBNYXRoLmNlaWwod2lkdGgKICAgICAgICAgICAgICAgICAgICAgKiBtWm9vbVNjcm9sbExpbWl0KSAtIFNDUk9MTF9aT09NX0ZJTkdFUl9CVUZGRVI7Ci0gICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAibW92ZVpvb21TY3JvbGxXaW5kb3ctWCIgCisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm1vdmVab29tU2Nyb2xsV2luZG93LVgiCiAgICAgICAgICAgICAgICAgICAgICAgICArICIgbWF4U2NyZWVuWD0iICsgbWF4U2NyZWVuWCArICIgd2lkdGg9IiArIHdpZHRoCi0gICAgICAgICAgICAgICAgICAgICAgICArICIgbVpvb21TY3JvbGxMaW1pdD0iICsgbVpvb21TY3JvbGxMaW1pdCArICIgeD0iICsgeCk7IAorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1ab29tU2Nyb2xsTGltaXQ9IiArIG1ab29tU2Nyb2xsTGltaXQgKyAiIHg9IiArIHgpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgeCArPSBtYXhTY3JlZW5YICogbUxhc3RTY3JvbGxYIC8gbWF4Wm9vbVggLSBtTGFzdFRvdWNoWDsKICAgICAgICAgICAgIHggKj0gTWF0aC5tYXgobWF4Wm9vbVggLyBtYXhTY3JlZW5YLCBtWm9vbVNjcm9sbEludkxpbWl0KTsKQEAgLTI3MzgsMTIgKzMxNjYsMTIgQEAKICAgICAgICAgfQogICAgICAgICBpbnQgbWF4Wm9vbVkgPSBtQ29udGVudEhlaWdodCAtIGhlaWdodDsKICAgICAgICAgaWYgKG1heFpvb21ZID4gMCkgewotICAgICAgICAgICAgaW50IG1heFNjcmVlblkgPSBoZWlnaHQgLSAoaW50KSBNYXRoLmNlaWwoaGVpZ2h0IAorICAgICAgICAgICAgaW50IG1heFNjcmVlblkgPSBoZWlnaHQgLSAoaW50KSBNYXRoLmNlaWwoaGVpZ2h0CiAgICAgICAgICAgICAgICAgICAgICogbVpvb21TY3JvbGxMaW1pdCkgLSBTQ1JPTExfWk9PTV9GSU5HRVJfQlVGRkVSOwotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm1vdmVab29tU2Nyb2xsV2luZG93LVkiIAorICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKKyAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJtb3ZlWm9vbVNjcm9sbFdpbmRvdy1ZIgogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1heFNjcmVlblk9IiArIG1heFNjcmVlblkgKyAiIGhlaWdodD0iICsgaGVpZ2h0Ci0gICAgICAgICAgICAgICAgICAgICAgICArICIgbVpvb21TY3JvbGxMaW1pdD0iICsgbVpvb21TY3JvbGxMaW1pdCArICIgeT0iICsgeSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1ab29tU2Nyb2xsTGltaXQ9IiArIG1ab29tU2Nyb2xsTGltaXQgKyAiIHk9IiArIHkpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgeSArPSBtYXhTY3JlZW5ZICogbUxhc3RTY3JvbGxZIC8gbWF4Wm9vbVkgLSBtTGFzdFRvdWNoWTsKICAgICAgICAgICAgIHkgKj0gTWF0aC5tYXgobWF4Wm9vbVkgLyBtYXhTY3JlZW5ZLCBtWm9vbVNjcm9sbEludkxpbWl0KTsKQEAgLTI3NTIsMTIgKzMxODAsMTIgQEAKICAgICAgICAgaWYgKG9sZFggIT0gbVpvb21TY3JvbGxYIHx8IG9sZFkgIT0gbVpvb21TY3JvbGxZKSB7CiAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAibW92ZVpvb21TY3JvbGxXaW5kb3ciIAotICAgICAgICAgICAgICAgICAgICArICIgc2Nyb2xsVG89KCIgKyBtWm9vbVNjcm9sbFggKyAiLCAiICsgbVpvb21TY3JvbGxZICsgIikiIAotICAgICAgICAgICAgICAgICAgICArICIgbUxhc3RUb3VjaD0oIiArIG1MYXN0VG91Y2hYICsgIiwgIiArIG1MYXN0VG91Y2hZICsgIikiIAotICAgICAgICAgICAgICAgICAgICArICIgbWF4Wm9vbT0oIiArIG1heFpvb21YICsgIiwgIiArIG1heFpvb21ZICsgIikiIAotICAgICAgICAgICAgICAgICAgICArICIgbGFzdD0oIittTGFzdFNjcm9sbFgrIiwgIittTGFzdFNjcm9sbFkrIikiIAorICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAibW92ZVpvb21TY3JvbGxXaW5kb3ciCisgICAgICAgICAgICAgICAgICAgICsgIiBzY3JvbGxUbz0oIiArIG1ab29tU2Nyb2xsWCArICIsICIgKyBtWm9vbVNjcm9sbFkgKyAiKSIKKyAgICAgICAgICAgICAgICAgICAgKyAiIG1MYXN0VG91Y2g9KCIgKyBtTGFzdFRvdWNoWCArICIsICIgKyBtTGFzdFRvdWNoWSArICIpIgorICAgICAgICAgICAgICAgICAgICArICIgbWF4Wm9vbT0oIiArIG1heFpvb21YICsgIiwgIiArIG1heFpvb21ZICsgIikiCisgICAgICAgICAgICAgICAgICAgICsgIiBsYXN0PSgiK21MYXN0U2Nyb2xsWCsiLCAiK21MYXN0U2Nyb2xsWSsiKSIKICAgICAgICAgICAgICAgICAgICAgKyAiIHg9IiArIHggKyAiIHk9IiArIHkpOwogICAgICAgICB9CiAgICAgfQpAQCAtMjgwMiw3ICszMjMwLDcgQEAKICAgICAvLyBTaG91bGQgb25seSBiZSBjYWxsZWQgaW4gVUkgdGhyZWFkCiAgICAgdm9pZCBzd2l0Y2hPdXREcmF3SGlzdG9yeSgpIHsKICAgICAgICAgaWYgKG51bGwgPT0gbVdlYlZpZXdDb3JlKSByZXR1cm47IC8vIENhbGxiYWNrUHJveHkgbWF5IHRyaWdnZXIgdGhpcwotICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7CisgICAgICAgIGlmIChtRHJhd0hpc3RvcnkgJiYgbVdlYlZpZXdDb3JlLnBpY3R1cmVSZWFkeSgpKSB7CiAgICAgICAgICAgICBtRHJhd0hpc3RvcnkgPSBmYWxzZTsKICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKICAgICAgICAgICAgIGludCBvbGRTY3JvbGxYID0gbVNjcm9sbFg7CkBAIC0yODE4LDcyICszMjQ2LDI5IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICAvKioKLSAgICAgKiAgQ2xhc3MgcmVwcmVzZW50aW5nIHRoZSBub2RlIHdoaWNoIGlzIGZvY3VzZWQuCi0gICAgICovCi0gICAgcHJpdmF0ZSBjbGFzcyBGb2N1c05vZGUgewotICAgICAgICBwdWJsaWMgRm9jdXNOb2RlKCkgewotICAgICAgICAgICAgbUJvdW5kcyA9IG5ldyBSZWN0KCk7Ci0gICAgICAgIH0KLSAgICAgICAgLy8gT25seSB0byBiZSBjYWxsZWQgYnkgSk5JCi0gICAgICAgIHByaXZhdGUgdm9pZCBzZXRBbGwoYm9vbGVhbiBpc1RleHRGaWVsZCwgYm9vbGVhbiBpc1RleHRBcmVhLCBib29sZWFuIAotICAgICAgICAgICAgICAgIGlzUGFzc3dvcmQsIGJvb2xlYW4gaXNBbmNob3IsIGJvb2xlYW4gaXNSdGxUZXh0LCBpbnQgbWF4TGVuZ3RoLCAKLSAgICAgICAgICAgICAgICBpbnQgdGV4dFNpemUsIGludCBib3VuZHNYLCBpbnQgYm91bmRzWSwgaW50IGJvdW5kc1JpZ2h0LCBpbnQgCi0gICAgICAgICAgICAgICAgYm91bmRzQm90dG9tLCBpbnQgbm9kZVBvaW50ZXIsIGludCBmcmFtZVBvaW50ZXIsIFN0cmluZyB0ZXh0LCAKLSAgICAgICAgICAgICAgICBTdHJpbmcgbmFtZSwgaW50IHJvb3RUZXh0R2VuZXJhdGlvbikgewotICAgICAgICAgICAgbUlzVGV4dEZpZWxkICAgICAgICA9IGlzVGV4dEZpZWxkOwotICAgICAgICAgICAgbUlzVGV4dEFyZWEgICAgICAgICA9IGlzVGV4dEFyZWE7Ci0gICAgICAgICAgICBtSXNQYXNzd29yZCAgICAgICAgID0gaXNQYXNzd29yZDsKLSAgICAgICAgICAgIG1Jc0FuY2hvciAgICAgICAgICAgPSBpc0FuY2hvcjsKLSAgICAgICAgICAgIG1Jc1J0bFRleHQgICAgICAgICAgPSBpc1J0bFRleHQ7Ci0KLSAgICAgICAgICAgIG1NYXhMZW5ndGggICAgICAgICAgPSBtYXhMZW5ndGg7Ci0gICAgICAgICAgICBtVGV4dFNpemUgICAgICAgICAgID0gdGV4dFNpemU7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIG1Cb3VuZHMuc2V0KGJvdW5kc1gsIGJvdW5kc1ksIGJvdW5kc1JpZ2h0LCBib3VuZHNCb3R0b20pOwotICAgICAgICAgICAgCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIG1Ob2RlUG9pbnRlciAgICAgICAgPSBub2RlUG9pbnRlcjsKLSAgICAgICAgICAgIG1GcmFtZVBvaW50ZXIgICAgICAgPSBmcmFtZVBvaW50ZXI7Ci0gICAgICAgICAgICBtVGV4dCAgICAgICAgICAgICAgID0gdGV4dDsKLSAgICAgICAgICAgIG1OYW1lICAgICAgICAgICAgICAgPSBuYW1lOwotICAgICAgICAgICAgbVJvb3RUZXh0R2VuZXJhdGlvbiA9IHJvb3RUZXh0R2VuZXJhdGlvbjsKLSAgICAgICAgfQotICAgICAgICBwdWJsaWMgYm9vbGVhbiAgbUlzVGV4dEZpZWxkOwotICAgICAgICBwdWJsaWMgYm9vbGVhbiAgbUlzVGV4dEFyZWE7Ci0gICAgICAgIHB1YmxpYyBib29sZWFuICBtSXNQYXNzd29yZDsKLSAgICAgICAgcHVibGljIGJvb2xlYW4gIG1Jc0FuY2hvcjsKLSAgICAgICAgcHVibGljIGJvb2xlYW4gIG1Jc1J0bFRleHQ7Ci0KLSAgICAgICAgcHVibGljIGludCAgICAgIG1TZWxlY3Rpb25TdGFydDsKLSAgICAgICAgcHVibGljIGludCAgICAgIG1TZWxlY3Rpb25FbmQ7Ci0gICAgICAgIHB1YmxpYyBpbnQgICAgICBtTWF4TGVuZ3RoOwotICAgICAgICBwdWJsaWMgaW50ICAgICAgbVRleHRTaXplOwotICAgICAgICAKLS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AgICAgICAgQWJzb2x1dGVMYXlvdXQuTGF5b3V0UGFyYW1zIGxwID0gKEFic29sdXRlTGF5b3V0LkxheW91dFBhcmFtcykKLSAgICAgICAgICAgICAgICBtVGV4dEVudHJ5LmdldExheW91dFBhcmFtcygpOwotICAgICAgICBpZiAobHAgIT0gbnVsbCkgewotICAgICAgICAgICAgLy8gVGFrZSB0aGUgbGFzdCB0b3VjaCBhbmQgYWRqdXN0IGZvciB0aGUgbG9jYXRpb24gb2YgdGhlCi0gICAgICAgICAgICAvLyBUZXh0RGlhbG9nLgotICAgICAgICAgICAgZmxvYXQgeCA9IG1MYXN0VG91Y2hYICsgKGZsb2F0KSAobVNjcm9sbFggLSBscC54KTsKLSAgICAgICAgICAgIGZsb2F0IHkgPSBtTGFzdFRvdWNoWSArIChmbG9hdCkgKG1TY3JvbGxZIC0gbHAueSk7Ci0gICAgICAgICAgICBtVGV4dEVudHJ5LmZha2VUb3VjaEV2ZW50KHgsIHkpOworCisgICAgICAgIGlmIChpc1RleHRWaWV3KSB7CisgICAgICAgICAgICBpbW0uc2hvd1NvZnRJbnB1dChtV2ViVGV4dFZpZXcsIDApOworICAgICAgICAgICAgLy8gTm93IHdlIG5lZWQgdG8gZmFrZSBhIHRvdWNoIGV2ZW50IHRvIHBsYWNlIHRoZSBjdXJzb3Igd2hlcmUgdGhlCisgICAgICAgICAgICAvLyB1c2VyIHRvdWNoZWQuCisgICAgICAgICAgICBBYnNvbHV0ZUxheW91dC5MYXlvdXRQYXJhbXMgbHAgPSAoQWJzb2x1dGVMYXlvdXQuTGF5b3V0UGFyYW1zKQorICAgICAgICAgICAgICAgICAgICBtV2ViVGV4dFZpZXcuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICBpZiAobHAgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIC8vIFRha2UgdGhlIGxhc3QgdG91Y2ggYW5kIGFkanVzdCBmb3IgdGhlIGxvY2F0aW9uIG9mIHRoZQorICAgICAgICAgICAgICAgIC8vIFdlYlRleHRWaWV3LgorICAgICAgICAgICAgICAgIGZsb2F0IHggPSBtTGFzdFRvdWNoWCArIChmbG9hdCkgKG1TY3JvbGxYIC0gbHAueCk7CisgICAgICAgICAgICAgICAgZmxvYXQgeSA9IG1MYXN0VG91Y2hZICsgKGZsb2F0KSAobVNjcm9sbFkgLSBscC55KTsKKyAgICAgICAgICAgICAgICBtV2ViVGV4dFZpZXcuZmFrZVRvdWNoRXZlbnQoeCwgeSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUluWm9vbU92ZXJ2aWV3KSB7CisgICAgICAgICAgICAgICAgLy8gaWYgaW4gem9vbSBvdmVydmlldyBtb2RlLCBjYWxsIGRvRG91YmxlVGFwKCkgdG8gYnJpbmcgaXQgYmFjaworICAgICAgICAgICAgICAgIC8vIHRvIG5vcm1hbCBtb2RlIHNvIHRoYXQgdXNlciBjYW4gZW50ZXIgdGV4dC4KKyAgICAgICAgICAgICAgICBkb0RvdWJsZVRhcCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgeyAvLyB1c2VkIGJ5IHBsdWdpbnMKKyAgICAgICAgICAgIGltbS5zaG93U29mdElucHV0KHRoaXMsIDApOwogICAgICAgICB9CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVRleHRFbnRyeSgpIHsKLSAgICAgICAgaWYgKG1UZXh0RW50cnkgPT0gbnVsbCkgewotICAgICAgICAgICAgbVRleHRFbnRyeSA9IG5ldyBUZXh0RGlhbG9nKG1Db250ZXh0LCBXZWJWaWV3LnRoaXMpOwotICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZSBvdXIgZ2VuZXJhdGlvbiBudW1iZXIuCi0gICAgICAgICAgICBtVGV4dEdlbmVyYXRpb24gPSAwOwotICAgICAgICB9Ci0gICAgICAgIC8vIElmIHdlIGRvIG5vdCBoYXZlIGZvY3VzLCBkbyBub3RoaW5nIHVudGlsIHdlIGdhaW4g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FzRm9jdXMoKSAmJiAobnVsbCA9PSBtV2ViVGV4dFZpZXcgfHwgIW1XZWJUZXh0Vmlldy5oYXNGb2N1cygpKQorICAgICAgICAgICAgICAgIHx8IChtVG91Y2hNb2RlID49IEZJUlNUX1NDUk9MTF9aT09NCiAgICAgICAgICAgICAgICAgJiYgbVRvdWNoTW9kZSA8PSBMQVNUX1NDUk9MTF9aT09NKSkgewotICAgICAgICAgICAgbU5lZWRzVXBkYXRlVGV4dEVudHJ5ID0gdHJ1ZTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgICAgICBib29sZWFuIGFscmVhZHlUaGVyZSA9IGluRWRpdGluZ01vZGUoKTsKLSAgICAgICAgaWYgKDAgPT0gbU5hdGl2ZUNsYXNzIHx8ICFuYXRpdmVVcGRhdGVGb2N1c05vZGUoKSkgeworICAgICAgICAvLyBpbkVkaXRpbmdNb2RlIGNhbiBvbmx5IHJldHVybiB0cnVlIGlmIG1XZWJUZXh0VmlldyBpcyBub24tbnVsbCwKKyAgICAgICAgLy8gc28gd2UgY2FuIHNhZmVseSBjYWxsIHJlbW92ZSgpIGlmIChhbHJlYWR5VGhlcmUpCisgICAgICAgIGlmICgwID09IG1OYXRpdmVDbGFzcyB8fCAhbmF0aXZlRm9jdXNDYW5kaWRhdGVJc1RleHRJbnB1dCgpKSB7CiAgICAgICAgICAgICBpZiAoYWxyZWFkeVRoZXJlKSB7Ci0gICAgICAgICAgICAgICAgbVRleHRFbnRyeS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICBtV2ViVGV4dFZpZXcucmVtb3ZlKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLSAgICAgICAgRm9jdXNOb2RlIG5vZGUgPSBtRm9jdXNOb2RlOwotICAgICAgICBpZiAoIW5vZGUubUlzVGV4dEZpZWxkICYmICFub2RlLm1Jc1RleHRBcmVhKSB7Ci0gICAgICAgICAgICBpZiAoYWxyZWFkeVRoZ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duaXplZC4KLSAgICAgICAgICAgIGlmIChub2RlLm1UZXh0ICE9IG51bGwgJiYgIW5vZGUubVRleHQuZXF1YWxzKHNwYW5uYWJsZS50b1N0cmluZygpKQotICAgICAgICAgICAgICAgICAgICAmJiBub2RlLm1Sb290VGV4dEdlbmVyYXRpb24gPT0gbVRleHRHZW5lcmF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgbVRleHRFbnRyeS5zZXRUZXh0QW5kS2VlcFNlbGVjdGlvbihub2RlLm1UZXh0KTsKKyAgICAgICAgICAgIGlmICh0ZXh0ICE9IG51bGwgJiYgIXRleHQuZXF1YWxzKHNwYW5uYWJsZS50b1N0cmluZygpKQorICAgICAgICAgICAgICAgICAgICAmJiBuYXRpdmVUZXh0R2VuZXJhdGlvbigpID09IG1UZXh0R2VuZXJhdGlvbikgeworICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRUZXh0QW5kS2VlcFNlbGVjdGlvbih0ZXh0KTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbihzcGFubmFibGUsIHN0YXJ0LCBlbmQpOwogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgU3RyaW5nIHRleHQgPSBub2RlLm1UZXh0OwotICAgICAgICAgICAgc2V0VGV4dEVudHJ5UmVjdCh4LCB5LCB3aWR0aCwgaGVpZ2h0KTsKLSAgICAgICAgICAgIG1UZXh0RW50cnkuc2V0R3Jhdml0eShub2RlLm1Jc1J0bFRleHQgPyBHcmF2aXR5LlJJR0hUIDogCi0gICAgICAgICAgICAgICAgICAgIEdyYXZpdHkuTk9fR1JBVklUWSk7CisgICAgICAgICAgICBSZWN0IHZCb3ggPSBjb250ZW50VG9WaWV3KGJvdW5kcyk7CisgICAgICAgICAgICBtV2ViVGV4dFZpZXcuc2V0UmVjdCh2Qm94LmxlZnQsIHZCb3gudG9wLCB2Qm94LndpZHRoKC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ICAgIGlmIChtV2ViVmlld0NvcmUuZ2V0U2V0dGluZ3MoKS5nZXRTYXZlRm9ybURhdGEoKQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgbm9kZS5tTmFtZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIEhhc2hNYXAgZGF0YSA9IG5ldyBIYXNoTWFwKCk7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGEucHV0KCJ0ZXh0Iiwgbm9kZS5tVGV4dCk7CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBuYW1lICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZSB1cGRhdGUgPSBtUHJpdmF0ZUhhbmRsZXIub2J0YWluTWVzc2FnZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVEVfVEVYVF9FTlRSWV9BREFQVEVSLCBub2RlLm1Ob2RlUG9pbnRlciwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhKTsKLSAgICAgICAgICAgICAgICAgICAgVXBkYXRlVGV4dEVudHJ5QWRhcHRlciB1cGRhdGVyID0gbmV3IFVwZGF0ZVRleHRFbnRyeUFkYXB0ZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5tTmFtZSwgZ2V0VXJsKCksIHVwZGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVRVUVTVF9GT1JNX0RBVEEsIG5vZGVQb2ludGVyKTsKKyAgICAgICAgICAgICAgICAgICAgUmVxdWVzdEZvcm1EYXRhIHVwZGF0ZXIgPSBuZXcgUmVxdWVzdEZvcm1EYXRhKG5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0VXJsKCksIHVwZGF0ZSk7CiAgICAgICAgICAgICAgICAgICAgIFRocmVhZCB0ID0gbmV3IFRocmVhZCh1cGRhdGVyKTsKICAgICAgICAgICAgICAgICAgICAgdC5zdGFydCgpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1UZXh0RW50cnkuc2V0TWF4TGVuZ3RoKG1heExlbmd0aCk7CisgICAgICAgICAgICBtV2ViVGV4dFZpZXcuc2V0TWF4TGVuZ3RoKG1heExlbmd0aCk7CiAgICAgICAgICAgICBBdXRvQ29tcGxldGVBZGFwdGVyIGFkYXB0ZXIgPSBudWxsOwotICAgICAgICAgICAgbVRleHRFbnRyeS5zZXRBZGFwdGVyQ3VzdG9tKGFkYXB0ZXIpOwotICAgICAgICAgICAgbVRleHRFbnRyeS5zZXRTaW5nbGVMaW5lKG5vZGUubUlzVGV4dEZpZWxkKTsKLSAgICAgICAgICAgIG1UZXh0RW50cnkuc2V0SW5QYXNzd29yZChub2RlLm1Jc1Bhc3N3b3JkKTsKKyAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRBZGFwdGVyQ3VzdG9tKGFkYXB0ZXIpOworICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldFNpbmdsZUxpbmUoaXNUZXh0RmllbGQpOworICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEluUGFzc3dvcmQobmF0aXZlRm9jdXNDYW5kaWRhdGVJc1Bhc3N3b3JkKCkpOwogICAgICAgICAgICAgaWYgKG51bGwgPT0gdGV4dCkgewotICAgICAgICAgICAgICAgIG1UZXh0RW50cnkuc2V0VGV4dCgiIiwgMCwgMCk7CisgICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldFRleHQoIiIsIDAsIDApOworICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInJlYnVpbGRXZWJUZXh0VmlldyBudWxsID09IHRleHQiKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIC8vIENoYW5nZSB0byB0cnVlIHRvIGVuYWJsZSB0aGUgb2xkIHN0eWxlIGJ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gICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtVGV4dEVudHJ5LnNldFRleHQodGV4dCwgMCwgMCk7CisgICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRUZXh0KHRleHQsIDAsIDApOworICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAicmVidWlsZFdlYlRleHRWaWV3ICFpc1RleHRGaWVsZCIpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgbVRleHRFbnRyeS5yZXF1ZXN0Rm9jdXMoKTsKKyAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5yZXF1ZXN0Rm9jdXMoKTsKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgY2xhc3MgVXBkYXRlVGV4dEVudHJ5QWRhcHRlciBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKKyAgICAvKgorICAgICAqIFRoaXMgY2xhc3MgcmVxdWVzdHMgYW4gQWRhcHRlciBmb3IgdGhlIFdlYlRleHRWaWV3IHdoaWNoIHNob3dzIHBhc3QKKyAgICAgKiBlbnRyaWVzIHN0b3JlZCBpbiB0aGUgZGF0YWJhc2UuICBJdCBpcyBhIFJ1bm5hYmxlIHNvIHRoYXQgaXQgY2FuIGJlIGRvbmUKKyAgICAgKiBpbiBpdHMgb3duIHRocmVhZCwgd2l0aG91dCBzbG93aW5nIGRvd24gdGhlIFVJLgorICAgICAqLworICAgIHByaXZhdGUgY2xhc3MgUmVxdWVzdEZvcm1EYXRhIGltcGxlbWVudHMgUnVubmFibGUgewogICAgICAgICBwcml2YXRlIFN0cmluZyBtTmFtZTsKICAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbVVybDsKICAgICAgICAgcHJpdmF0ZSBNZXNzYWdlIG1VcGRhdGVNZXNzYWdlOwogCi0gICAgICAgIHB1YmxpYyBVcGRhdGVUZXh0RW50cnlBZGFwdGVyKFN0cmluZyBuYW1lLCBTdHJpbmcgdXJsLCBNZXNzYWdlIG1zZykgeworICAgICAgICBwdWJsaWMgUmVxdWVzdEZvcm1EYXRhKFN0cmluZyBuYW1lLCBTdHJpbmcgdXJsLCBNZXNzYWdlIG1zZykgewogICAgICAgICAgICAgbU5hbWUgPSBuYW1lOwogICAgICAgICAgICAgbVVybCA9IHVybDsKICAgICAgICAgICAgIG1VcGRhdGVNZXNzYWdlID0gbXNnOwpAQCAtMzA0NCwyOSArMzQ2MCwyMSBAQAogICAgICAgICAgICAgaWYgKHBhc3RFbnRyaWVzLnNpemUoKSA+IDApIHsKICAgICAgICAgICAgICAgICBBdXRvQ29tcGxldGVBZGFwdGVyIGFkYXB0ZXIgPSBuZXcKICAgICAgICAgICAgICAgICAgICAgICAgIEF1dG9Db21wbGV0ZUFkYXB0ZXIobUNvbnRleHQsIHBhc3RFbnRyaWVzKTsKLSAgICAgICAgICAgICAgICAoKEhhc2hNYXApIG1VcGRhdGVNZXNzYWdlLm9iaikucHV0KCJhZGFwdGVyIiwgYWRhcHRlcik7CisgICAgICAgICAgICAgICAgbVVwZGF0ZU1lc3NhZ2Uub2JqID0gYWRhcHRlcjsKICAgICAgICAgICAgICAgICBtVXBkYXRlTWVzc2FnZS5zZW5kVG9UYXJnZXQoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBzZXRUZXh0RW50cnlSZWN0KGludCB4LCBpbnQgeSwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7Ci0gICAgICAgIHggPSBjb250ZW50VG9WaWV3KHgpOwotICAgICAgICB5ID0gY29udGVudFRvVmlldyh5KTsKLSAgICAgICAgd2lkdGggPSBjb250ZW50VG9WaWV3KHdpZHRoKTsKLSAgICAgICAgaGVpZ2h0ID0gY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AgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChtU2hpZnRJc1ByZXNzZWQgPT0gZmFsc2UgJiYgbmF0aXZlRm9jdXNOb2RlV2FudHNLZXlFdmVudHMoKSA9PSBmYWxzZQotICAgICAgICAgICAgICAgICYmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfTEVGVCAKKyAgICAgICAgaWYgKG1TaGlmdElzUHJlc3NlZCA9PSBmYWxzZSAmJiBuYXRpdmVDdXJzb3JXYW50c0tleUV2ZW50cygpID09IGZhbHNlCisgICAgICAgICAgICAgICAgJiYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9TSElGVF9MRUZUCiAgICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX1NISUZUX1JJR0hUKSkgewogICAgICAgICAgICAgbUV4dGVuZFNlbGVjdGlvbiA9IGZhbHNlOwogICAgICAgICAgICAgbVNoaWZ0SXNQcmVzc2VkID0gdHJ1ZTsKLSAgICAgICAgICAgIGlmIChuYXRpdmVVcGRhdGVGb2N1c05vZGUoKSkgewotICAgICAgICAgICAgICAgIEZvY3VzTm9kZSBub2RlID0gbUZvY3VzTm9kZTsKLSAgICAgICAgICAgICAgICBtU2VsZWN0WCA9IGNvbnRlbnRUb1ZpZXcobm9kZS5tQm91bmRzLmxlZnQpOwotICAgICAgICAgICAgICAgIG1TZWxlY3RZID0gY29udGVudFRvVmlldyhub2RlLm1Cb3VuZHMudG9wKTsKKyAgICAgICAgICAgIGlmIChuYXRpdmVIYXNDdXJzb3JOb2RlKCkpIHsKKyAgICAgICAgICAgICAgICBSZWN0IHJlY3QgPSBuYXRpdmVDdXJzb3JOb2RlQm91bmRzKCk7CisgICAgICAgICAgICAgICAgbVNlbGVjdFggPSBjb250ZW50VG9WaWV3WChyZWN0LmxlZnQpOworICAgICAgICAgICAgICAgIG1TZWxlY3RZID0gY29udGVudFRvVmlld1kocmVjdC50b3ApOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBtU2VsZWN0WCA9IG1TY3JvbGxYICsgKGludCkgbUxhc3RUb3VjaFg7CiAgICAgICAgICAgICAgICAgbVNlbGVjdFkgPSBtU2Nyb2xsWSArIChpbnQpIG1MYXN0VG91Y2hZOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaW50IGNvbnRlbnRYID0gdmlld1RvQ29udGVudCgoaW50KSBtTGFzdFRvdWNoWCArIG1TY3JvbGxYKTsKLSAgICAgICAgICAgIGludCBjb250ZW50WSA9IHZpZXdUb0NvbnRlbnQoKGludCkgbUxhc3RUb3VjaFkgKyBtU2Nyb2xsWSk7Ci0gICAgICAgICAgICBuYXRpdmVDbGVhckZvY3VzKGNvbnRlbnRYLCBjb250ZW50WSk7CisgICAgICAgICAgICBuYXRpdmVIaWRlQ3Vyc29yKCk7CiAgICAgICAgfQogCiAgICAgICAgIGlmIChrZXlDb2RlID49IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUAogICAgICAgICAgICAgICAgICYmIGtleUNvZGUgPD0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUKSB7CiAgICAgICAgICAgICAvLyBhbHdheXMgaGFuZGxlIHRoZSBuYXZpZ2F0aW9uIGtleXMgaW4gdGhlIFVJIHRocmVhZAogICAgICAgICAgICAgc3dpdGNoT3V0RHJhd0hpc3RvcnkoKTsKLSAgICAgICAgICAgIGlmIChuYXZIYW5kbGVkS2V5KGtleUNvZGUsIDEsIGZhbHNlLCBldmVudC5nZXRFdmVudFRpbWUoKSkpIHsKKyAgICAgICAgICAgIGlmIChuYXZIYW5kbGVkS2V5KGtleUNvZGUsIDEsIGZhbHNlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgZmFsc2UpKSB7CiAgICAgICAgICAgICAgICAgcGxheVNvdW5kRWZmZWN0KGtleUNvZGVUb1NvdW5kc0VmZmVjdChrZXlDb2RlKSk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICB9CkBAIC0zMTIyLDEzICszNTI4LDEyIEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSCi0gICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSKSB7CisgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVIpIHsKICAgICAgICAgICAgIHN3aXRjaE91dERyYXdIaXN0b3J5KCk7CiAgICAgICAgICAgICBpZiAoZXZlbnQuZ2V0UmVwZWF0Q291bnQoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgbUdvdEVudGVyRG93biA9IHRydWU7CisgICAgICAgICAgICAgICAgbUdvdENlbnRlckRvd24gPSB0cnVlOwogICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobVByaXZhdGVIYW5kbGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAub2J0YWluTWVzc2FnZShMT05HX1BSRVNTX0VOVEVSKSwgTE9OR19QUkVTU19USU1FT1VUKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC5vYnRhaW5NZXNzYWdlKExPTkdfUFJFU1NfQ0VOVEVSKSwgTE9OR19QUkVTU19USU1FT1VUKTsKICAgICAgICAgICAgICAgICAvLyBBbHJlYWR5IGNoZWNrZWQgbU5hdGl2ZUNsYXNzLCBzbyB3ZSBkbyBub3QgbmVlZCB0byBjaGVjayBpdAogICAgICAgICAgICAgICAgIC8vIGFnYWluLgogICAgICAgICAgICAgICAgIG5hdGl2ZVJlY29yZEJ1dHRvbnMoaGFzRm9jdXMoKSAmJiBoYXNXaW5kb3dGb2N1cygpLCB0cnVlLCB0cnVlKTsKQEAgLTMxMzgsNiArMzU0MywxNSBAQAogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAKKyAgICAgICAgaWYgKGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9TSElGVF9MRUZUCisgICAgICAgICAgICAgICAgJiYga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX1NISUZUX1JJR0hUKSB7CisgICAgICAgICAgICAvLyB0dXJuIG9mZiBjb3B5IHNlbGVjdCBpZiBhIHNoaWZ0LWtleSBjb21ibyBpcyBwcmVzc2VkCisgICAgICAgICAgICBtRXh0ZW5kU2VsZWN0aW9uID0gbVNoaWZ0SXNQcmVzc2VkID0gZmFsc2U7CisgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9TRUxFQ1RfTU9ERSkgeworICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9JTklUX01PREU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKwogICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5nZXROYXZEdW1wKCkpIHsKICAgICAgICAgICAgIHN3aXRjaCAoa2V5Q29kZSkgewogICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV80OgpAQCAtMzE2Niw4ICszNTgwLDMwIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAorICAgICAgICBpZiAobmF0aXZlQ3Vyc29ySXNQbHVnaW4oKSkgeworICAgICAgICAgICAgbmF0aXZlVXBkYXRlUGx1Z2luUmVjZWl2ZXNFdmVudHMoKTsKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgfSBlbHNlIGlmIChuYXRpdmVDdXJzb3JJc1RleHRJbnB1dCgpKSB7CisgICAgICAgICAgICAvLyBUaGlzIG1lc3NhZ2Ugd2lsbCBwdXQgdGhlIG5vZGUgaW4gZm9jdXMsIGZvciB0aGUgRE9NJ3Mgbm90aW9uCisgICAgICAgICAgICAvLyBvZiBmb2N1cywgYW5kIG1ha2UgdGhlIGZvY3VzY29udHJvbGxlciBhY3RpdmUKKyAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5DTElDSywgbmF0aXZlQ3Vyc29yRnJhbWVQb2ludGVyKCksCisgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUN1cnNvck5vZGVQb2ludGVyKCkpOworICAgICAgICAgICAgLy8gVGhpcyB3aWxsIGJyaW5nIHVwIHRoZSBXZWJUZXh0VmlldyBhbmQgcHV0IGl0IGluIGZvY3VzLCBmb3IKKyAgICAgICAgICAgIC8vIG91ciB2aWV3IHN5c3RlbSdzIG5vdGlvbiBvZiBmb2N1cworICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CisgICAgICAgICAgICAvLyBOb3cgd2UgbmVlZCB0byBwYXNzIHRoZSBldmVudCB0byBpdAorICAgICAgICAgICAgcmV0dXJuIG1XZWJUZXh0Vmlldy5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOworICAgICAgICB9IGVsc2UgaWYgKG5hdGl2ZUhhc0ZvY3VzTm9kZSgpKSB7CisgICAgICAgICAgICAvLyBJbiB0aGlzIGNhc2UsIHRoZSBjdXJzb3IgaXMgbm90IG9uIGEgdGV4dCBpbnB1dCwgYnV0IHRoZSBmb2N1cworICAgICAgICAgICAgLy8gbWlnaHQgYmUuICBDaGVjayBpdCwgYW5kIGlmIHNvLCBoYW5kIG92ZXIgdG8gdGhlIFdlYlRleHRWaWV3LgorICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CisgICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1XZWJUZXh0Vmlldy5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKICAgICAgICAgLy8gVE9ETzogc2hvdWxkIHdlIHBhc3Mg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LRVlDT0RFX1NISUZUX1JJR0hUKSB7CiAgICAgICAgICAgICBpZiAoY29tbWl0Q29weSgpKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CkBAIC0zMjM0LDU1ICszNjY5LDMwIEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSCi0gICAgICAgICAgICAgICAgfHwga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSKSB7CisgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVIpIHsKICAgICAgICAgICAgIC8vIHJlbW92ZSB0aGUgbG9uZyBwcmVzcyBtZXNzYWdlIGZpcnN0Ci0gICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTE9OR19QUkVTU19FTlRFUik7Ci0gICAgICAgICAgICBtR290RW50ZXJEb3duID0gZmFsc2U7CisgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTE9OR19QUkVTU19DRU5URVIpOworICAgICAgICAgICAgbUdvdENlbnRlckRvd24gPSBmYWxzZTsKIAotICAgICAgICAgICAgaWYgKEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVIgPT0ga2V5Q29kZSkgewotICAgICAgICAgICAgICAgIGlmIChtU2hpZnRJc1ByZXNzZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5zdXBwb3J0Wm9vbSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0RPVUJMRUNMSUNLX01PREUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHpvb21TY3JvbGxPdXQoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJUT1VDSF9ET1VCTEVDTElDS19NT0RFIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKG1Qcml2YXRlSGFuZGxlcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub2J0YWluTWVzc2FnZShTV0lUQ0hfVE9fRU5URVIpLCBUQVBfVElNRU9VVCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9VQkxFQ0xJQ0tfTU9ERTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVNoaWZ0SXNQcmVzc2VkKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBSZWN0IHZpc2libGVSZWN0ID0gc2VuZE91clZpc2libGVSZWN0KCk7Ci0gICAgICAgICAgICAvLyBOb3RlIHRoYXQgc2VuZE91clZpc2libGVSZWN0IGNhbGxzIHZpZXdUb0NvbnRlbnQsIHNvIHRoZQotICAgICAgICAgICAgLy8gY29vcmRpbmF0ZXMgc2hvdWxkIGJlIGluIGNvbnRlbnQgY29vcmRpbmF0ZXMuCi0gICAgICAgICAgICBpZiAobmF0aXZlVXBkYXRlRm9jdXNOb2RlKCkpIHsKLSAgICAgICAgICAgICAgICBpZiAoUmVjdC5pbnRlcnNlY3RzKG1Gb2N1c05vZGUubUJvdW5kcywgdmlzaWJsZVJlY3QpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldEZvbGxvd2VkTGluayh0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlNFVF9GSU5BTF9GT0NVUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudEh1Yi5CTE9DS19GT0NVU19DSEFOR0VfVU5USUxfS0VZX1VQLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBXZWJWaWV3Q29yZS5Gb2N1c0RhdGEobUZvY3VzRGF0YSkpOwotICAgICAgICAgICAgICAgICAgICBwbGF5U291bmRFZmZlY3QoU291bmRFZmZlY3RDb25zdGFudHMuQ0xJQ0spOwotICAgICAgICAgICAgICAgICAgICBpZiAoIW1DYWxsYmFja1Byb3h5LnVpT3ZlcnJpZGVVcmxMb2FkaW5nKG1Gb2N1c05vZGUubVRleHQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyB1c2UgQ0xJQ0sgaW5zdGVhZCBvZiBLRVlfRE9XTi9LRVlfVVAgc28gdGhhdCB3ZSBjYW4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRyaWdnZXIgbW91c2UgY2xpY2sgZXZlbnRzCi0gICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuQ0xJQ0spOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZ2V0U2V0dGluZ3MoKS5zdXBwb3J0Wm9vbSgpCisgICAgICAgICAgICAgICAgICAgICYmIG1Ub3VjaE1vZGUgPT0gVE9VQ0hfRE9VQkxFQ0xJQ0tfTU9ERSkgeworICAgICAgICAgICAgICAgIHpvb21TY3JvbGxPdXQoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtUHJpdmF0ZUhhbmRsZXIKKyAgICAgICAgICAgICAgICAgICAgICAgIC5vYnRhaW5NZXNzYWdlKFNXSVRDSF9UT19DTElDSyksIFRBUF9USU1FT1VUKTsKKyAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJUT1VDSF9ET1VCTEVDTElDS19NT0RFIik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9ET1VCTEVDTElDS19NT0RFOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gQnViYmxlIHVwIHRoZSBrZXkgZXZlbnQgYXMgV2ViVmlldyBkb2Vzbid0IGhhbmRsZSBpdAotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KIAogICAgICAgICAvLyBUT0RPOiBzaG91bGQgd2UgcGFzcyBhbGwgdGhlIGtleXMgdG8gRE9NIG9yIGNoZWNrIHRoZSBtZXRhIHRhZwotICAgICAgICBpZiAobmF0aXZlRm9jdXNOb2RlV2FudHNLZXlFdmVudHMoKSB8fCB0cnVlKSB7CisgICAgICAgIGlmIChuYXRpdmVDdXJzb3JXYW50c0tleUV2ZW50cygpIHx8IHRydWUpIHsKICAgICAgICAgICAgIC8vIHBhc3MgdGhlIGtleSB0byBET00KICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5LRVlfVVAsIGV2ZW50KTsKICAgICAgICAgICAgIC8vIHJldHVybiB0cnVlIGFzIERPTSBoYW5kbGVzIHRoZSBrZXkKQEAgLTMyOTIsMTYgKzM3MDIsMTQgQEAKICAgICAgICAgLy8gQnViYmxlIHVwIHRoZSBrZXkgZXZlbnQgYXMgV2ViVmlldyBkb2Vzbid0IGhhbmRsZSBpdAogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQGhpZGUKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBlbXVsYXRlU2hpZnRIZWxkKCkgewogICAgICAgICBtRXh0ZW5kU2VsZWN0aW9uID0gZmFsc2U7CiAgICAgICAgIG1TaGlmdElzUHJlc3NlZCA9IHRydWU7Ci0gICAgICAgIGludCBjb250ZW50WCA9IHZpZXdUb0NvbnRlbnQoKGludCkgbUxhc3RUb3VjaFggKyBtU2Nyb2xsWCk7Ci0gICAgICAgIGludCBjb250ZW50WSA9IHZpZXdUb0NvbnRlbnQoKGludCkgbUxhc3RUb3VjaFkgKyBtU2Nyb2xsWSk7Ci0gICAgICAgIG5hdGl2ZUNsZWFyRm9jdXMoY29udGVudFgsIGNvbnRlbnRZKTsKKyAgICAgICAgbmF0aXZlSGlkZUN1cnNvcigpOwogICAgIH0KIAogICAgIHByaXZhdGUgYm9vbGVhbiBjb21taXRDb3B5KCkgewpAQCAtMzM0OSwxNiArMzc1NywxMyBAQAogICAgICAgICAvLyBDbGVhbiB1cCB0aGUgem9vbSBjb250cm9sbGVyCiAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0VmlzaWJsZShmYWxzZSk7CiAgICAgfQotICAgIAorCiAgICAgLy8gSW1wbGVtZW50YXRpb24gZm9yIE9uSGllcmFyY2h5Q2hhbmdlTGlzdGVuZXIKICAgICBwdWJsaWMgdm9pZCBvbkNoaWxkVmlld0FkZGVkKFZpZXcgcGFyZW50LCBWaWV3IGNoaWxkKSB7fQotICAgIAorCiAgICAgcHVibGljIHZvaWQgb25DaGlsZFZpZXdSZW1vdmVkKFZpZXcgcCwgVmlldyBjaGlsZCkgewogICAgICAgICBpZiAoY2hpbGQgPT0gdGhpcykgewotICAgICAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSkgewotICAgICAgICAgICAgICAgIG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5KSB7Ci0gICAgICAgICAgICAgICAgICAgIHVwZGF0ZVRleHRFbnRyeSgpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBkcmF3aW5nIHRoZSBjdXJzb3IgcmluZworICAgICAgICAgICAgICAgIG1EcmF3Q3Vyc29yUmluZyA9IHRydWU7CiAgICAgICAgICAgICAgICAgaWYgKG1OYXRpdmVDbGFzcyAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVJlY29yZEJ1dHRvbnModHJ1ZSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuU0VUX0FDVElWRSwgMSwgMCk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIC8vIElmIG91ciB3aW5kb3cgZ2FpbmVkIGZvY3VzLCBidXQgd2UgZG8gbm90IGhhdmUgaXQsIGRvIG5vdAotICAgICAgICAgICAgICAgIC8vIGRyYXcgdGhlIGZvY3VzIHJpbmcuCi0gICAgICAgICAgICAgICAgbURyYXdGb2N1c1JpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAvLyBkcmF3IHRoZSBjdXJzb3IgcmluZy4KKyAgICAgICAgICAgICAgICBtRHJhd0N1cnNvclJpbmcgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAvLyBXZSBkbyBub3QgY2FsbCBuYXRpdmVSZWNvcmRCdXR0b25zIGhlcmUgYmVjYXVzZSB3ZSBhc3N1bWUKICAgICAgICAgICAgICAgICAvLyB0aGF0IHdoZW4gd2UgbG9zdCBmb2N1cywgb3Igd2luZG93IGZvY3VzLCBpdCBnb3QgY2FsbGVkIHdpdGgKICAgICAgICAgICAgICAgICAvLyBmYWxzZSBmb3IgdGhlIGZpcnN0IHBhcmFtZXRlcgpAQCAtMzM5OSwzOSArMzgwMyw0OSBAQAogICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpICYmICFtWm9vbUJ1dHRvbnNDb250cm9sbGVyLmlzVmlzaWJsZSgpKSB7CiAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgKiBUaGUgem9vbSBjb250cm9scyBjb21lIGluIHRoZWlyIG93biB3aW5kb3csIHNvIG91ciB3aW5kb3cKLSAgICAgICAgICAgICAgICAgKiBsb3NlcyBmb2N1cy4gT3VyIHBvbGljeSBpcyB0byBub3QgZHJhdyB0aGUgZm9jdXMgcmluZyBpZgorICAgICAgICAgICAgICAgICAqIGxvc2VzIGZvY3VzLiBPdXIgcG9saWN5IGlzIHRvIG5vdCBkcmF3IHRoZSBjdXJzb3IgcmluZyBpZgogICAgICAgICAgICAgICAgICAqIG91ciB3aW5kb3cgaXMgbm90IGZvY3VzZWQsIGJ1dCB0aGlzIGlzIGFuIGV4Y2VwdGlvbiBzaW5jZQogICAgICAgICAgICAgICAgICAqIHRoZSB1c2VyIGNhbiBzdGlsbCBuYXZpZ2F0ZSB0aGUgd2ViIHBhZ2Ugd2l0aCB0aGUgem9vbQogICAgICAgICAgICAgICAgICAqIGNvbnRyb2xzIHNob3dpbmcuCiAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgLy8gSWYgb3VyIHdpbmRvdyBoYXMgbG9zdCBmb2N1cywgc3RvcCBkcmF3aW5nIHRoZSBmb2N1cyByaW5nCi0gICAgICAgICAgICAgICAgbURyYXdGb2N1c1JpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAvLyBJZiBvdXIgd2luZG93IGhhcyBsb3N0IGZvY3VzLCBzdG9wIGRyYXdpbmcgdGhlIGN1cnNvciByaW5nCisgICAgICAgICAgICAgICAgbURyYXdDdXJzb3JSaW5nID0gZmFsc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AgICBtRHJhd0N1cnNvclJpbmcgPSB0cnVlOwogICAgICAgICAgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICBuYXRpdmVSZWNvcmRCdXR0b25zKHRydWUsIGZhbHNlLCB0cnVlKTsKICAgICAgICAgICAgICAgICB9CkBAIC0zNDQyLDEyICszODU2LDEzIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBXaGVuIHdlIGxvc3QgZm9jdXMsIHVubGVzcyBmb2N1cyB3ZW50IHRvIHRoZSBUZXh0VmlldyAod2hpY2ggaXMKLSAgICAgICAgICAgIC8vIHRydWUgaWYgd2UgYXJlIGluIGVkaXRpbmcgbW9kZSksIHN0b3AgZHJhd2luZyB0aGUgZm9jdXMgcmluZy4KKyAgICAgICAgICAgIC8vIHRydWUgaWYgd2UgYXJlIGluIGVkaXRpbmcgbW9kZSksIHN0b3AgZHJhd2luZyB0aGUgY3Vyc29yIHJpbmcuCiAgICAgICAgICAgICBpZiAoIWluRWRpdGluZ01vZGUoKSkgewotICAgICAgICAgICAgICAgIG1EcmF3Rm9jdXNSaW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgbURyYXdDdXJzb3JSaW5nID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgaWYgKG1OYXRpdmVDbGFzcyAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVJlY29yZEJ1dHRvbnMoZmFsc2UsIGZhbHNlLCB0cnVlKTsKICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2V0Rm9jdXNDb250cm9sbGVySW5hY3RpdmUoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1Hb3RLZXlEb3duID0gZmFsc2U7CiAgICAgICAgIH0KQEAgLTM0NTksMTMgKzM4NzQsMTYgQEAKICAgICBwcm90ZWN0ZWQgdm9pZCBvblNpemVDaGFuZ2VkKGludCB3LCBpbnQgaCwgaW50IG93LCBpbnQgb2gpIHsKICAgICAgICAgc3VwZXIub25TaXplQ2hhbmdlZCh3LCBoLCBvdywgb2gpOwogICAgICAgICAvLyBDZW50ZXIgem9vbWluZyB0byB0aGUgY2VudGVyIG9mIHRoZSBzY3JlZW4uCi0gICAgICAgIG1ab29tQ2VudGVyWCA9IGdldFZpZXdXaWR0aCgpICogLjVmOwotICAgICAgICBtWm9vbUNlbnRlclkgPSBnZXRWaWV3SGVpZ2h0KCkgKiAuNWY7CisgICAgICAgIGlmIChtWm9vbVNjYWxlID09IDApIHsgLy8gdW5sZXNzIHdlJ3JlIGFscmVhZHkgem9vbWluZworICAgICAgICAgICAgbVpvb21DZW50ZXJYID0gZ2V0Vmlld1dpZHRoKCkgKiAuNWY7CisgICAgICAgICAgICBtWm9vbUNlbnRlclkgPSBnZXRWaWV3SGVpZ2h0KCkgKiAuNWY7CisgICAgICAgIH0KIAogICAgICAgICAvLyB1cGRhdGUgbU1pblpvb21TY2FsZSBpZiB0aGUgbWluaW11bSB6b29tIHNjYWxlIGlzIG5vdCBmaXhlZAogICAgICAgICBpZiAoIW1NaW5ab29tU2NhbGVGaXhlZCkgewogICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IChmbG9hdCkgZ2V0Vmlld1dpZHRoKCkKLSAgICAgICAgICAgICAgICAgICAgLyBNYXRoLm1heChaT09NX09VVF9XSURUSCwgbUNvbnRlbnRXaWR0aCk7CisgICAgICAgICAgICAgICAgICAgIC8gKG1EcmF3SGlzdG9yeSA/IG1IaXN0b3J5UGljdHVyZS5nZXRXaWR0aCgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtWm9vbU92ZXJ2aWV3V2lkdGgpOwogICAgICAgICB9CiAKICAgICAgICAgLy8gd2UgYWx3YXlzIGZvcmNlLCBpbiBjYXNlIG91ciBoZWlnaHQgY2hhbmdlZCwgaW4gd2hpY2ggY2FzZSB3ZSBzdGlsbApAQCAtMzQ3NiwxMCArMzg5NCwxMSBAQAogICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCB2b2lkIG9uU2Nyb2xsQ2hhbmdlZChpbnQgbCwgaW50IHQsIGludCBvbGRsLCBpbnQgb2xkdCkgewogICAgICAgICBzdXBlci5vblNjcm9sbENoYW5nZWQobCwgdCwgb2xkbCwgb2xkdCk7CisKICAgICAgICAgc2VuZE91clZpc2libGVSZWN0KCk7CiAgICAgfQotICAgIAotICAgIAorCisKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBkaXNwYXRjaEtleUV2ZW50KEtleUV2ZW50IGV2ZW50KSB7CiAgICAgICAgIGJvb2xlYW4gZGlzcGF0Y2ggPSB0cnVlOwpAQCAtMzUyMyw3ICszOTQyLDcgQEAKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCi0gICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgZXYgKyAiIGF0ICIgKyBldi5nZXRFdmVudFRpbWUoKSArICIgbVRvdWNoTW9kZT0iCiAgICAgICAgICAgICAgICAgICAgICsgbVRvdWNoTW9kZSk7CiAgICAgICAgIH0KQEAgLTM1NDgsMTIgKzM5NjcsMTIgQEAKICAgICAgICAgaWYgKG1Gb3J3YXJkVG91Y2hFdmVudHMgJiYgbVRvdWNoTW9kZSAhPSBTQ1JPTExfWk9PTV9PVVQKICAgICAgICAgICAgICAgICAmJiBtVG91Y2hNb2RlICE9IFNDUk9MTF9aT09NX0FOSU1BVElPTl9JTgogICAgICAgICAgICAgICAgICYmIG1Ub3VjaE1vZGUgIT0gU0NST0xMX1pPT01fQU5JTUFUSU9OX09VVAotICAgICAgICAgICAgICAgICYmIChhY3Rpb24gIT0gTW90aW9uRXZlbnQuQUNUSU9OX01PVkUgfHwgCisgICAgICAgICAgICAgICAgJiYgKGFjdGlvbiAhPSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRUaW1lIC0gbUxhc3RTZW50VG91Y2hUaW1lID4gVE9VQ0hfU0VOVF9JTlRFUlZBTCkpIHsKICAgICAgICAgICAgIFdlYlZpZXdDb3JlLlRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBXZWJWaWV3Q29yZS5Ub3VjaEV2ZW50RGF0YSgpOwogICAgICAgICAgICAgdGVkLm1BY3Rpb24gPSBhY3Rpb247Ci0gICAgICAgICAgICB0ZWQubVggPSB2aWV3VG9Db250ZW50KChpbnQpIHggKyBtU2Nyb2xsWCk7Ci0gICAgICAgICAgICB0ZWQubVkgPSB2aWV3VG9Db250ZW50KChpbnQpIHkgKyBtU2Nyb2xsWSk7CisgICAgICAgICAgICB0ZWQubVggPSB2aWV3VG9Db250ZW50WCgoaW50KSB4ICsgbVNjcm9sbFgpOworICAgICAgICAgICAgdGVkLm1ZID0gdmlld1RvQ29udGVudFkoKGludCkgeSArIG1TY3JvbGxZKTsKICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5UT1VDSF9FVkVOVCwgdGVkKTsKICAgICAgICAgICAgIG1MYXN0U2VudFRvdWNoVGltZSA9IGV2ZW50VGltZTsKICAgICAgICAgfQpAQCAtMzU3Miw2ICszOTkxLDkgQEAKICAgICAgICAgICAgICAgICAgICAgbUxhc3RTY3JvbGxZID0gbVpvb21TY3JvbGxZOwogICAgICAgICAgICAgICAgICAgICAvLyBJZiB0d28gdGFwcyBhcmUgY2xvc2UsIGlnbm9yZSB0aGUgZmlyc3QgdGFwCiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghbVNjcm9sbGVyLmlzRmluaXNoZWQoKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBzdG9wIHRoZSBjdXJyZW50IHNjcm9sbCBhbmltYXRpb24sIGJ1dCBpZiB0aGlzIGlzCisgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzdGFydCBvZiBhIGZsaW5nLCBhbGxvdyBpdCB0byBhZGQgdG8gdGhlIGN1cnJlbnQKKyAgICAgICAgICAgICAgICAgICAgLy8gZmxpbmcncyB2ZWxvY2l0eQogICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsZXIuYWJvcnRBbmltYXRpb24oKTsKICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0RSQUdfU1RBUlRfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKFJFU1VNRV9XRUJDT1JFX1VQREFURSk7CkBAIC0zNTc5LDIyICs0MDAxLDM0IEBACiAgICAgICAgICAgICAgICAgICAgIG1TZWxlY3RYID0gbVNjcm9sbFggKyAoaW50KSB4OwogICAgICAgICAgICAgICAgICAgICBtU2VsZWN0WSA9IG1TY3JvbGxZICsgKGludCkgeTsKICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX1NFTEVDVF9NT0RFOwotICAgICAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJzZWxlY3Q9IiArIG1TZWxlY3RYICsgIiwiICsgbVNlbGVjdFkpOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG5hdGl2ZU1vdmVTZWxlY3Rpb24odmlld1RvQ29udGVudChtU2VsZWN0WCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIHZpZXdUb0NvbnRlbnQobVNlbGVjdFkpLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIG5hdGl2ZU1vdmVTZWxlY3Rpb24odmlld1RvQ29udGVudFgobVNlbGVjdFgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXdUb0NvbnRlbnRZKG1TZWxlY3RZKSwgZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICBtVG91Y2hTZWxlY3Rpb24gPSBtRXh0ZW5kU2VsZWN0aW9uID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1Qcml2YXRlSGFuZGxlci5oYXNNZXNzYWdlcyhSRUxFQVNFX1NJTkdMRV9UQVApKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhSRUxFQVNFX1NJTkdMRV9UQVApOworICAgICAgICAgICAgICAgICAgICBpZiAoZGVsdGFYICogZGVsdGFYICsgZGVsdGFZICogZGVsdGFZIDwgbURvdWJsZVRhcFNsb3BTcXVhcmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9ET1VCTEVfVEFQX01PREU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb21taXQgdGhlIHNob3J0IHByZXNzIGFjdGlvbiBmb3IgdGhlIHByZXZpb3VzIHRhcAorICAgICAgICAgICAgICAgICAgICAgICAgZG9TaG9ydFByZXNzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb250aW51ZSwgbVRvdWNoTW9kZSBzaG91bGQgYmUgc3RpbGwgVE9VQ0hfSU5JVF9NT0RFCisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfSU5JVF9NT0RFOwogICAgICAgICAgICAgICAgICAgICBtUHJldmVudERyYWcgPSBtRm9yd2FyZFRvdWNoRXZlbnRzOworICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRIdWIuVVBEQVRFX0ZSQU1FX0NBQ0hFX0lGX0xPQURJTkcpOwogICAgICAgICAgICAgICAgICAgICBpZiAobUxvZ0V2ZW50ICYmIGV2ZW50VGltZSAtIG1MYXN0VG91Y2hVcFRpbWUgPCAxMDAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UX0xPR19ET1VCTEVfVEFQX0RVUkFUSU9OLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXZlbnRUaW1lIC0gbUxhc3RUb3VjaFVwVGltZSksIGV2ZW50VGltZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgLy8gVHJpZ2dlciB0aGUgbGluawotICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERSkgeworICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVRvdWNoTW9kZSA9PSBUT1VDSF9ET1VCTEVfVEFQX01PREUpIHsKICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtUHJpdmF0ZUhhbmRsZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub2J0YWluTWVzc2FnZShTV0lUQ0hfVE9fU0hPUlRQUkVTUyksIFRBUF9USU1FT1VUKTsKICAgICAgICAgICAgICAgICB9CkBAIC0zNjA3LDcgKzQwNDEsNyBAQAogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRTogewotICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0RPTkVfTU9ERSAKKyAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9ET05FX01PREUKICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1Ub3VjaE1vZGUgPT0gU0NST0xMX1pPT01fQU5JTUFUSU9OX0lOCiAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtVG91Y2hNb2RlID09IFNDUk9MTF9aT09NX0FOSU1BVElPTl9PVVQpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gbm8gZHJhZ2dpbmcgZHVyaW5nIHNjcm9sbCB6b29tIGFuaW1hdGlvbgpAQCAtMzYyNCwxMSArNDA1OCwxMSBAQAogICAgICAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9TRUxFQ1RfTU9ERSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFggPSBtU2Nyb2xsWCArIChpbnQpIHg7CiAgICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0WSA9IG1TY3JvbGxZICsgKGludCkgeTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAieHRlbmQ9IiArIG1TZWxlY3RYICsgIiwiICsgbVNlbGVjdFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlTW92ZVNlbGVjdGlvbih2aWV3VG9Db250ZW50KG1TZWxlY3RYKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIHZpZXdUb0NvbnRlbnQobVNlbGVjdFkpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZU1vdmVTZWxlY3Rpb24odmlld1RvQ29udGVudFgobVNlbGVjdFgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXdUb0NvbnRlbnRZKG1TZWxlY3RZKSwgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMzY0MCw3ICs0MDc0LDggQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfU0hPUlRQUkVTU19NT0RFCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVRvdWNoTW9kZSA9PSBUT1VDSF9TSE9SVFBSRVNTX1NUQVJUX01PREUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhTV0lUQ0hfVE9fTE9OR1BSRVNTKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERSkgeworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfSU5JVF9NT0RFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVRvdWNoTW9kZSA9PSBUT1VDSF9ET1VCTEVfVEFQX01PREUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhTV0lUQ0hfVE9fU0hPUlRQUkVTUyk7CiAgICAgICAgICAgICAgICAgICAgIH0KIApAQCAtMzY1NywyMiArNDA5MiwxNCBAQAogCiAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9EUkFHX01PREU7CiAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXdDb3JlLnBhdXNlVXBkYXRlKG1XZWJWaWV3Q29yZSk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBjb250ZW50WCA9IHZpZXdUb0NvbnRlbnQoKGludCkgeCArIG1TY3JvbGxYKTsKLSAgICAgICAgICAgICAgICAgICAgaW50IGNvbnRlbnRZID0gdmlld1RvQ29udGVudCgoaW50KSB5ICsgbVNjcm9sbFkpOwotICAgICAgICAgICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVGV4dEVudHJ5LnVwZGF0ZUNhY2hlZFRleHRmaWVsZCgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG5hdGl2ZUNsZWFyRm9jdXMoY29udGVudFgsIGNvbnRlbnRZKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIHRoZSB6b29tIGFuY2hvciBpZiB0aGVyZSBpcyBhbnkKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1ab29tU2NhbGUgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZW5kTWVzc2FnZShFdmVudEh1Yi5TRVRfU05BUF9BTkNIT1IsIDAsIDApOworICAgICAgICAgICAgICAgICAgICBpZiAoIW1EcmFnRnJvbVRleHRJbnB1dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlSGlkZUN1cnNvcigpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIFdlYlNldHRpbmdzIHNldHRpbmdzID0gZ2V0U2V0dGluZ3MoKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLnN1cHBvcnRab29tKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzZXR0aW5ncy5nZXRCdWlsdEluWm9vbUNvbnRyb2xzKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhbVpvb21CdXR0b25zQ29udHJvbGxlci5pc1Zpc2libGUoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChjYW5ab29tU2Nyb2xsT3V0KCkgfHwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGNhblpvb21TY3JvbGxPdXQoKSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA8IG1NYXhab29tU2NhbGUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldFZpc2libGUodHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTM2OTgsNyArNDEyNSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldmVyc2UgZGlyZWN0aW9uIG1lYW5zIGxvY2sgaW4gdGhlIHNuYXAgbW9kZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYXggPiBNQVhfU0xPUEVfRk9SX0RJQUcgKiBheSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobVNuYXBQb3NpdGl2ZSAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobVNuYXBQb3NpdGl2ZSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFYIDwgLW1NaW5Mb2NrU25hcFJldmVyc2VEaXN0YW5jZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghbVNuYXBQb3NpdGl2ZSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFYID4gbU1pbkxvY2tTbmFwUmV2ZXJzZURpc3RhbmNlKSkpIHsKQEAgLTM3MTIsOSArNDEzOSw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldmVyc2UgZGlyZWN0aW9uIG1lYW5zIGxvY2sgaW4gdGhlIHNuYXAgbW9kZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYXkgPiBNQVhfU0xPUEVfRk9SX0RJQUcgKiBheCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobVNuYXBQb3NpdGl2ZSAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobVNuYXBQb3NpdGl2ZSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFZIDwgLW1NaW5Mb2NrU25hcFJldmVyc2VEaXN0YW5jZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghbVNuYXBQb3NpdGl2ZSAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghbVNuYXBQb3NpdGl2ZSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFZID4gbU1pbkxvY2tTbmFwUmV2ZXJzZURpc3RhbmNlKSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNuYXBTY3JvbGxNb2RlID0gU05BUF9ZX0xPQ0s7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtMzc2Miw3ICs0MTg5LDIzIEBACiAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9VUDogewogICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hVcFRpbWUgPSBldmVudFRpbWU7CiAgICAgICAgICAgICAgICAgc3dpdGNoIChtVG91Y2hNb2RlKSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgVE9VQ0hfRE9VQkxFX1RBUF9NT0RFOiAvLyBkb3VibGUgdGFwCisgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoU1dJVENIX1RPX1NIT1JUUFJFU1MpOworICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0RPTkVfTU9ERTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvRG91YmxlVGFwKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBUT1VDSF9JTklUX01PREU6IC8vIHRhcAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEVOQUJMRV9ET1VCTEVUQVBfWk9PTSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhTV0lUQ0hfVE9fU0hPUlRQUkVTUyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtUHJldmVudERyYWcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUxFQVNFX1NJTkdMRV9UQVApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdDb25maWd1cmF0aW9uLmdldERvdWJsZVRhcFRpbWVvdXQoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCiAgICAgICAgICAgICAgICAgICAgIGNhc2UgVE9VQ0hfU0hPUlRQUkVTU19TVEFSVF9NT0RFOgogICAgICAgICAgICAgICAgICAgICBjYXNlIFRPVUNIX1NIT1JUUFJFU1NfTU9ERToKICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhTV0lUQ0hfVE9fU0hPUlRQUkVTUyk7CkBAIC0zNzc5LDcgKzQyMjIsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm8gYWN0aW9uIGR1cmluZyBzY3JvbGwgYW5pbWF0aW9uCiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBTQ1JPTExfWk9PTV9PVVQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIkFDVElPTl9VUCBTQ1JPTExfWk9PTV9PVVQiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZXZlbnRUaW1lIC0gbUxhc3RUb3VjaFRpbWU9IgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoZXZlbnRUaW1lIC0gbUxhc3RUb3VjaFRpbWUpKTsKQEAgLTM4MDQsNiArNDI0Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9GbGluZygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RWZWxvY2l0eSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3Q29yZS5yZXN1bWVVcGRhdGUobVdlYlZpZXdDb3JlKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICBjYXNlIFRPVUNIX0RSQUdfU1RBUlRfTU9ERToKQEAgLTM4MzcsMTggKzQyODEsMTMgQEAKICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoU1dJVENIX1RPX1NIT1J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VIpOworICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKFNXSVRDSF9UT19DTElDSyk7CiAgICAgICAgICAgICBtVHJhY2tiYWxsRG93biA9IHRydWU7Ci0gICAgICAgICAgICBpZiAobU5hdGl2ZUNsYXNzICE9IDApIHsKLSAgICAgICAgICAgICAgICBuYXRpdmVSZWNvcmRCdXR0b25zKGhhc0ZvY3VzKCkgJiYgaGFzV2luZG93Rm9jdXMoKSwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodGltZSAtIG1MYXN0Rm9jdXNUaW1lIDw9IFRSQUNLQkFMTF9USU1FT1VUCi0gICAgICAgICAgICAgICAgICAgICYmICFtTGFzdEZvY3VzQm91bmRzLmVxdWFscyhuYXRpdmVHZXRGb2N1c1JpbmdCb3VuZHMoKSkpIHsKLSAgICAgICAgICAgICAgICBuYXRpdmVTZWxlY3RCZXN0QXQobUxhc3RGb2N1c0JvdW5kcyk7CisgICAgICAgICAgICBuYXRpdmVSZWNvcmRCdXR0b25zKGhhc0ZvY3VzKCkgJiYgaGFzV2luZG93Rm9jdXMoKSwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgICBpZiAodGltZSAtIG1MYXN0Q3Vyc29yVGltZSA8PSBUUkFDS0JBTExfVElNRU9VVAorICAgICAgICAgICAgICAgICAgICAmJiAhbUxhc3RDdXJzb3JCb3VuZHMuZXF1YWxzKG5hdGl2ZUdldEN1cnNvclJpbmdCb3VuZHMoKSkpIHsKKyAgICAgICAgICAgICAgICBuYXRpdmVTZWxlY3RCZXN0QXQobUxhc3RDdXJzb3JCb3VuZHMpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgeworICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblRyYWNrYmFsbEV2ZW50IGRvd24gZXY9IiArIGV2Ci0gICAgICAgICAgICAgICAgICAgICAgICArICIgdGltZT0iICsgdGltZSAKLSAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtTGFzdEZvY3VzVGltZT0iICsgbUxhc3RGb2N1c1RpbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHRpbWU9IiArIHRpbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtTGFzdEN1cnNvclRpbWU9IiArIG1MYXN0Q3Vyc29yVGltZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoaXNJblRvdWNoTW9kZSgpKSByZXF1ZXN0Rm9jdXNGcm9tVG91Y2goKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsgLy8gbGV0IGNvbW1vbiBjb2RlIGluIG9uS2V5RG93biBhdCBpdAotICAgICAgICB9IAorICAgICAgICB9CiAgICAgICAgIGlmIChldi5nZXRBY3Rpb24oKSA9PSBNb3Rpb25FdmVudC5BQ1RJT05fVVApIHsKLSAgICAgICAgICAgIC8vIExPTkdfUFJFU1NfRU5URVIgaXMgc2V0IGluIGNvbW1vbiBvbktleURvd24KLSAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhMT05HX1BSRVNTX0VOVEVSKTsKKyAgICAgICAgICAgIC8vIExPTkdfUFJFU1NfQ0VOVEVSIGlzIHNldCBpbiBjb21tb24gb25LZXlEb3duCisgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTE9OR19QUkVTU19DRU5URVIpOwogICAgICAgICAgICAgbVRyYWNrYmFsbERvd24gPSBmYWxzZTsKICAgICAgICAgICAgIG1UcmFja2JhbGxVcFRpbWUgPSB0aW1lOwogICAgICAgICAgICAgaWYgKG1TaGlmdElzUHJlc3NlZCkgewpAQCAtMzkyNCw0MiArNDM2NCw0MiBAQAogICAgICAgICAgICAgICAgICAgICBtRXh0ZW5kU2VsZWN0aW9uID0gdHJ1ZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm9uVHJhY2tiYWxsRXZlbnQgdXAgZXY9IiArIGV2Ci0gICAgICAgICAgICAgICAgICAgICAgICArICIgdGltZT0iICsgdGltZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiB0aW1lPSIgKyB0aW1lCiAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBmYWxzZTsgLy8gbGV0IGNvbW1vbiBjb2RlIGluIG9uS2V5VXAgYXQgaXQKICAgICAgICAgfQogICAgICAgICBpZiAobU1hcFRyYWNrYmFsbFRvQXJyb3dLZXlzICYmIG1TaGlmdElzUHJlc3NlZCA9PSBmYWxzZSkgewotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgTG9nLnYoTE9HVEFHLCAib25UcmFja2JhbGxFdmVudCBnbWFpbCBxdWl0Iik7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgTG9nLnYoTE9HVEFHLCAib25UcmFja2JhbGxFdmVudCBnbWFpbCBxdWl0Iik7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KLSAgICAgICAgLy8gbm8gbW92ZSBpZiB3ZSdyZSBzdGlsbCB3YWl0aW5nIG9uIFNXSVRDSF9UT19FTlRFUiB0aW1lb3V0CisgICAgICAgIC8vIG5vIG1vdmUgaWYgd2UncmUgc3RpbGwgd2FpdGluZyBvbiBTV0lUQ0hfVE9fQ0xJQ0sgdGltZW91dAogICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9ET1VCTEVDTElDS19NT0RFKSB7Ci0gICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSBMb2cudihMT0dUQUcsICJvblRyYWNrYmFsbEV2ZW50IDIgY2xpY2sgcXVpdCIpOworICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIExvZy52KExPR1RBRywgIm9uVHJhY2tiYWxsRXZlbnQgMiBjbGljayBxdWl0Iik7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogICAgICAgICBpZiAobVRyYWNrYmFsbERvd24pIHsKLSAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIExvZy52KExPR1RBRywgIm9uVHJhY2tiYWxsRXZlbnQgZG93biBxdWl0Iik7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgTG9nLnYoTE9HVEFHLCAib25UcmFja2JhbGxFdmVudCBkb3duIHF1aXQiKTsKICAgICAgICAgICAgIHJldHVybiB0cnVlOyAvLyBkaXNjYXJkIG1vdmUgaWYgdHJhY2tiYWxsIGlzIGRvd24KICAgICAgICAgfQogICAgICAgICBpZiAodGltZSAtIG1UcmFja2JhbGxVcFRpbWUgPCBUUkFDS0JBTExfVElNRU9VVCkgewotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgTG9nLnYoTE9HVEFHLCAib25UcmFja2JhbGxFdmVudCB1cCB0aW1lb3V0IHF1aXQiKTsKKyAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSBMb2cudihMT0dUQUcsICJvblRyYWNrYmFsbEV2ZW50IHVwIHRpbWVvdXQgcXVpdCIpOwogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICAgICAgLy8gVE9ETzogYWx0ZXJuYXRpdmVseSB3ZSBjYW4gZG8gcGFubmluZyBhcyB0b3VjaCBkb2VzCiAgICAgICAgIHN3aXRjaE91dERyYXdIaXN0b3J5KCk7CiAgICAgICAgIGlmICh0aW1lIC0gbVRyYWNrYmFsbExhc3RUaW1lID4gVFJBQ0tCQUxMX1RJTUVPVVQpIHsKLSAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblRyYWNrYmFsbEV2ZW50IHRpbWU9IiAKKyAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAib25UcmFja2JhbGxFdmVudCB0aW1lPSIKICAgICAgICAgICAgICAgICAgICAgICAgICsgdGltZSArICIgbGFzdD0iICsgbVRyYWNrYmFsbExhc3RUaW1lKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1UcmFja2JhbGxGaXJzdFRpbWUgPSB0aW1lOwogICAgICAgICAgICAgbVRyYWNrYmFsbFhNb3ZlID0gbVRyYWNrYmFsbFlNb3ZlID0gMDsKICAgICAgICAgfQogICAgICAgICBtVHJhY2tiYWxsTGFzdFRpbWUgPSB0aW1lOwotICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7CisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CiAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblRyYWNrYmFsbEV2ZW50IGV2PSIgKyBldiArICIgdGltZT0iICsgdGltZSk7CiAgICAgICAgIH0KICAgICAgICAgbVRyYWNrYmFsbFJlbWFpbnNYICs9IGV2LmdldFgoKTsKQEAgLTM5NjcsNyArNDQwNyw3IEBACiAgICAgICAgIGRvVHJhY2tiYWxsKHRpbWUpOwogICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICB9Ci0gICAgCisKICAgICB2b2lkIG1vdmVTZWxlY3Rpb24oZmxvYXQgeFJhdGUsIGZsb2F0IHlSYXRlKSB7CiAgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgPT0gMCkKICAgICAgICAgICAgIHJldHVybjsKQEAgLTM5ODEsOCArNDQyMSw4IEBACiAgICAgICAgICAgICAgICAgLCBtU2VsZWN0WCkpOwogICAgICAgICBtU2VsZWN0WSA9IE1hdGgubWluKG1heFksIE1hdGgubWF4KG1TY3JvbGxZIC0gU0VMRUNUX0NVUlNPUl9PRkZTRVQKICAgICAgICAgICAgICAgICAsIG1TZWxlY3RZKSk7Ci0gICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgIExvZy52KExPR1RBRywgIm1vdmVTZWxlY3Rpb24iIAorICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAibW92ZVNlbGVjdGlvbiIKICAgICAgICAgICAgICAgICAgICAgKyAiIG1TZWxlY3RYPSIgKyBtU2VsZWN0WAogICAgICAgICAgICAgICAgICAgICArICIgbVNlbGVjdFk9IiArIG1TZWxlY3RZCiAgICAgICAgICAgICAgICAgICAgICsgIiBtU2Nyb2xsWD0iICsgbVNjcm9sbFgKQEAgLTM5OTEsMTMgKzQ0MzEsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgKyAiIHlSYXRlPSIgKyB5UmF0ZQogICAgICAgICAgICAgICAgICAgICApOwogICAgICAgICB9Ci0gICAgICAgIG5hdGl2ZU1vdmVTZWxlY3Rpb24odmlld1RvQ29udGVudChtU2VsZWN0WCkKLSAgICAgICAgICAgICAgICAsIHZpZXdUb0NvbnRlbnQobVNlbGVjdFkpLCBtRXh0ZW5kU2VsZWN0aW9uKTsKKyAgICAgICAgbmF0aXZlTW92ZVNlbGVjdGlvbih2aWV3VG9Db250ZW50WChtU2VsZWN0WCksCisgICAgICAgICAgICAgICAgdmlld1RvQ29udGVudFkobVNlbGVjdFkpLCBtRXh0ZW5kU2VsZWN0aW9uKTsKICAgICAgICAgaW50IHNjcm9sbFggPSBtU2VsZWN0WCA8IG1TY3JvbGxYID8g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gICAgICAgIGZsb2F0IHlSYXRlID0gbVRyYWNrYmFsbFJlbWFpbnNZICogMTAwMCAvIGVsYXBzZWQ7CiAgICAgICAgIGlmIChtU2hpZnRJc1ByZXNzZWQpIHsKICAgICAgICAgICAgIG1vdmVTZWxlY3Rpb24oeFJhdGUsIHlSYXRlKTsKQEAgLTQwNjQsNyArNDUwNCw3IEBACiAgICAgICAgIGZsb2F0IGF4ID0gTWF0aC5hYnMoeFJhdGUpOwogICAgICAgICBmbG9hdCBheSA9IE1hdGguYWJzKHlSYXRlKTsKICAgICAgICAgZmxvYXQgbWF4QSA9IE1hdGgubWF4KGF4LCBheSk7Ci0gICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgImRvVHJhY2tiYWxsIGVsYXBzZWQ9IiArIGVsYXBzZWQKICAgICAgICAgICAgICAgICAgICAgKyAiIHhSYXRlPSIgKyB4UmF0ZQogICAgICAgICAgICAgICAgICAgICArICIgeVJhdGU9IiArIHlSYXRlCkBAIC00MDgxLDkgKzQ1MjEsOSBAQAogICAgICAgICAgICAgaW50IG1heFdIID0gTWF0aC5tYXgod2lkdGgsIGhlaWdodCk7CiAgICAgICAgICAgICBtWm9vbVNjcm9sbFggKz0gc2NhbGVUcmFja2JhbGxYKHhSYXRlLCBtYXhXSCk7CiAgICAgICAgICAgICBtWm9vbVNjcm9sbFkgKz0gc2NhbGVUcmFja2JhbGxZKHlSYXRlLCBtYXhXSCk7Ci0gICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgImRvVHJhY2tiYWxsIFNDUk9MTF9aT09NX09VVCIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtWm9vbVNjcm9sbFg9IiArIG1ab29tU2Nyb2xsWCAKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtWm9vbVNjcm9sbFg9IiArIG1ab29tU2Nyb2xsWAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1ab29tU2Nyb2xsWT0iICsgbVpvb21TY3JvbGxZKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1ab29tU2Nyb2xsWCA9IE1hdGgubWluKHdpZHRoLCBNYXRoLm1heCgwLCBtWm9vbVNjcm9sbFgpKTsKQEAgLTQxMDEsMTggKzQ1NDEsMTggQEAKICAgICAgICAgaW50IG9sZFNjcm9sbFggPSBtU2Nyb2xsWDsKICAgICAgICAgaW50IG9sZFNjcm9sbFkgPSBtU2Nyb2xsWTsKICAgICAgICAgaWYgKGNvdW50ID4gMCkgewotICAgICAgICAgICAgaW50IHNlbGVjdEtleUNvZGUgPSBheCA8IGF5ID8gbVRyYWNrYmFsbFJlbWFpbnNZIDwgMCA/IAotICAgICAgICAgICAgICAgICAgICBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAgOiBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTiA6IAorICAgICAgICAgICAgaW50IHNlbGVjdEtleUNvZGUgPSBheCA8IGF5ID8gbVRyYWNrYmFsbFJlbWFpbnNZIDwgMCA/CisgICAgICAgICAgICAgICAgICAgIEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCA6IEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOIDoKICAgICAgICAgICAgICAgICAgICAgbVRyYWNrYmFsbFJlbWFpbnNYIDwgMCA/IEtleUV2ZW50LktFWUNPREVfRFBBRF9MRUZUIDoKICAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUOwogICAgICAgICAgICAgY291bnQgPSBNYXRoLm1pbihjb3VudCwgVFJBQ0tCQUxMX01PVkVfQ09VTlQpOwotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgImRvVHJhY2tiYWxsIGtleUNvZGU9IiArIHNlbGVjdEtleUNvZGUgCisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgImRvVHJhY2tiYWxsIGtleUNvZGU9IiArIHNlbGVjdEtleUNvZGUKICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBjb3VudD0iICsgY291bnQKICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtVHJhY2tiYWxsUmVtYWluc1g9IiArIG1UcmFja2JhbGxSZW1haW5zWAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1UcmFja2JhbGxSZW1haW5zWT0iICsgbVRyYWNrYmFsbFJlbWFpbnNZKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChuYXZIYW5kbGVkS2V5KHNlbGVjdEtleUNvZGUsIGNvdW50LCBmYWxzZSwgdGltZSkpIHsKKyAgICAgICAgICAgIGlmIChuYXZIYW5kbGVkS2V5KHNlbGVjdEtleUNvZGUsIGNvdW50LCBmYWxzZSwgdGltZSwgZmFsc2UpKSB7CiAgICAgICAgICAgICAgICAgcGxheVNvdW5kRWZmZWN0KGtleUNvZGVUb1NvdW5kc0VmZmVjdChzZWxlY3RLZXlDb2RlKSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtVHJhY2tiYWxsUmVtYWluc1ggPSBtVHJhY2tiYWxsUmVtYWluc1kgPSAwOwpAQCAtNDEyMCwxMiArNDU2MCwxMiBAQAogICAgICAgICBpZiAoY291bnQgPj0gVFJBQ0tCQUxMX1NDUk9MTF9DT1VOVCkgewogICAgICAgICAgICAgaW50IHhNb3ZlID0gc2NhbGVUcmFja2JhbGxYKHhSYXRlLCB3aWR0aCk7CiAgICAgICAgICAgICBpbnQgeU1vdmUgPSBzY2FsZVRyYWNrYmFsbFkoeVJhdGUsIGhlaWdodCk7Ci0gICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7CisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgImRvVHJhY2tiYWxsIHBpblNjcm9sbEJ5IgogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGNvdW50PSIgKyBjb3VudAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHhNb3ZlPSIgKyB4TW92ZSArICIgeU1vdmU9IiArIHlNb3ZlCi0gICAgICAgICAgICAgICAgICAgICAgICArICIgbVNjcm9sbFgtb2xkU2Nyb2xsWD0iICsgKG1TY3JvbGxYLW9sZFNjcm9sbFgpIAotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1TY3JvbGxZLW9sZFNjcm9sbFk9IiArIChtU2Nyb2xsWS1vbGRTY3JvbGxZKSAKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtU2Nyb2xsWC1vbGRTY3JvbGxYPSIgKyAobVNjcm9sbFgtb2xkU2Nyb2xsWCkKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtU2Nyb2xsWS1vbGRTY3JvbGxZPSIgKyAobVNjcm9sbFktb2xkU2Nyb2xsWSkKICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoTWF0aC5hYnMobVNjcm9sbFggLSBvbGRTY3JvbGxYKSA+IE1hdGguYWJzKHhNb3ZlKSkgewpAQCAtNDEzOCwyNCArNDU3OCwyOSBAQAogICAgICAgICAgICAgICAgIHBpblNjcm9sbEJ5KHhNb3ZlLCB5TW92ZSwgdHJ1ZSwgMCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtVXNlclNjcm9sbCA9IHRydWU7Ci0gICAgICAgIH0gCi0gICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5VTkJMT0NLX0ZPQ1VTKTsgICAgICAgIAorICAgICAgICB9CisgIC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SBnZXRWaWV3SGVpZ2h0KCksIDApOworICAgICAgICBpbnQgbWF4WSA9IGNvbXB1dGVNYXhTY3JvbGxZKCk7CiAKICAgICAgICAgbVZlbG9jaXR5VHJhY2tlci5jb21wdXRlQ3VycmVudFZlbG9jaXR5KDEwMDAsIG1NYXhpbXVtRmxpbmcpOwogICAgICAgICBpbnQgdnggPSAoaW50KSBtVmVsb2NpdHlUcmFja2VyLmdldFhWZWxvY2l0eSgpOwpAQCAtNDE2OCwxMiArNDYxMyw0MCBAQAogICAgICAgICAgICAgICAgIHZ4ID0gMDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBpZiAodHJ1ZSAvKiBFTUcgcmVsZWFzZTogbWFrZSBvdXIgZmxpbmcgbW9yZSBsaWtlIE1hcHMnICovKSB7CiAgICAgICAgICAgICAvLyBtYXBzIGN1dHMgdGhlaXIgdmVsb2NpdHkgaW4gaGFsZgogICAgICAgICAgICAgdnggPSB2eCAqIDMgLyA0OwogICAgICAgICAgICAgdnkgPSB2eSAqIDMgLyA0OwogICAgICAgICB9CisgICAgICAgIGlmICgobWF4WCA9PSAwICYmIHZ5ID09IDApIHx8IChtYXhZID09IDAgJiYgdnggPT0gMCkpIHsKKyAgICAgICAgICAgIFdlYlZpZXdDb3JlLnJlc3VtZVVwZGF0ZShtV2ViVmlld0NvcmUpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGZsb2F0IGN1cnJlbnRWZWxvY2l0eSA9IG1TY3JvbGxlci5nZXRDdXJyVmVsb2NpdHkoKTsKKyAgICAgICAgaWYgKG1MYXN0VmVsb2NpdHkgPiAwICYmIGN1cnJlbnRWZWxvY2l0eSA+IDApIHsKKyAgICAgICAgICAgIGZsb2F0IGRlbHRhUiA9IChmbG9hdCkgKE1hdGguYWJzKE1hdGguYXRhbjIobUxhc3RWZWxZLCBtTGFzdFZlbFgpCisgICAgICAgICAgICAgICAgICAgIC0gTWF0aC5hdGFuMih2eSwgdngpKSk7CisgICAgICAgICAgICBmaW5hbCBmbG9hdCBjaXJjbGUgPSAoZmxvYXQpIChNYXRoLlBJKSAqIDIuMGY7CisgICAgICAgICAgICBpZiAoZGVsdGFSID4gY2lyY2xlICogMC45ZiB8fCBkZWx0YVIgPCBjaXJjbGUgKiAwLjFmKSB7CisgICAgICAgICAgICAgICAgdnggKz0gY3VycmVudFZlbG9jaXR5ICogbUxhc3RWZWxYIC8gbUxhc3RWZWxvY2l0eTsKKyAgICAgICAgICAgICAgICB2eSArPSBjdXJyZW50VmVsb2NpdHkgKiBtTGFzdFZlbFkgLyBtTGFzdFZlbG9jaXR5OworICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgImRvRmxpbmcgdng9ICIgKyB2eCArICIgdnk9IiArIHZ5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKKyAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkb0ZsaW5nIG1pc3NlZCAiICsgZGVsdGFSIC8gY2lyY2xlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkb0ZsaW5nIHN0YXJ0IGxhc3Q9IiArIG1MYXN0VmVsb2NpdHkKKyAgICAgICAgICAgICAgICAgICAgKyAiIGN1cnJlbnQ9IiArIGN1cnJlbnRWZWxvY2l0eQorICAgICAgICAgICAgICAgICAgICArICIgdng9IiArIHZ4ICsgIiB2eT0iICsgdnkKKyAgICAgICAgICAgICAgICAgICAgKyAiIG1heFg9IiArIG1heFggKyAiIG1heFk9IiArIG1heFkKKyAgICAgICAgICAgICAgICAgICAgKyAiIG1TY3JvbGxYPSIgKyBtU2Nyb2xs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AgICAgICAgICAgICAgICBtTGFzdFNjYWxlID0gc2NhbGU7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfSBlbHNlIHsKQEAgLTQyMjksNyArNDcwNyw3IEBACiAgICAgICAgIH0KICAgICAgICAgaWYgKG1ab29tQ29udHJvbHMgPT0gbnVsbCkgewogICAgICAgICAgICAgbVpvb21Db250cm9scyA9IGNyZWF0ZVpvb21Db250cm9scygpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgKiBuZWVkIHRvIGJlIHNldCB0byBWSVNJQkxFIGZpcnN0IHNvIHRoYXQgZ2V0TWVhc3VyZWRIZWlnaHQoKSBpbgogICAgICAgICAgICAgICoge0BsaW5rICNvblNpemVDaGFuZ2VkKCl9IGNhbiByZXR1cm4gdGhlIG1lYXN1cmVkIHZhbHVlIGZvciBwcm9wZXIKQEAgLTQyMzgsNyArNDcxNiw3IEBACiAgICAgICAgICAgICBtWm9vbUNvbnRyb2xzLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKICAgICAgICAgICAgIG1ab29tQ29udHJvbFJ1bm5hYmxlID0gbmV3IFJ1bm5hYmxlKCkgewogICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAgICAgLyogRG9uJ3QgZGlzbWlzcyB0aGUgY29udHJvbHMgaWYgdGhlIHVzZXIgaGFzCiAgICAgICAgICAgICAgICAgICAgICAqIGZvY3VzIG9uIHRoZW0uIFdhaXQgYW5kIGNoZWNrIGFnYWluIGxhdGVyLgogICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTQyOTAsNyArNDc2OCw3IEBACiAgICAgLyoqCiAgICAgICogR2V0cyB0aGUge0BsaW5rIFpvb21CdXR0b25zQ29udHJvbGxlcn0gd2hpY2ggY2FuIGJlIHVzZWQgdG8gYWRkCiAgICAgICogYWRkaXRpb25hbCBidXR0b25zIHRvIHRoZSB6b29tIGNvbnRyb2xzIHdpbmRvdy4KLSAgICAgKiAKKyAgICAgKgogICAgICAqIEByZXR1cm4gVGhlIGluc3RhbmNlIG9mIHtAbGluayBab29tQnV0dG9uc0NvbnRyb2xsZXJ9IHVzZWQgYnkgdGhpcyBjbGFzcywKICAgICAgKiAgICAgICAgIG9yIG51bGwgaWYgaXQgaXMgdW5hdmFpbGFibGUuCiAgICAgICogQGhpZGUKQEAgLTQzMDYsNyArNDc4NCwxOCBAQAogICAgIHB1YmxpYyBib29sZWFuIHpvb21JbigpIHsKICAgICAgICAgLy8gVE9ETzogYWx0ZXJuYXRpdmVseSB3ZSBjYW4gZGlzYWxsb3cgdGhpcyBkdXJpbmcgZHJhdyBoaXN0b3J5IG1vZGUKICAgICAgICAgc3dpdGNoT3V0RHJhd0hpc3RvcnkoKTsKLSAgICAgICAgcmV0dXJuIHpvb21XaXRoUHJldmlldyhtQWN0dWFsU2NhbGUgKiAxLjI1Zik7CisgICAgICAgIC8vIENlbnRlciB6b29taW5nIHRvIHRoZSBjZW50ZXIgb2YgdGhlIHNjcmVlbi4KKyAgICAgICAgaWYgKG1Jblpvb21PdmVydmlldykgeworICAgICAgICAgICAgLy8gaWYgaW4gb3ZlcnZpZXcgbW9kZSwgYnJpbmcgaXQgYmFjayB0byBub3JtYWwgbW9kZQorICAgICAgICAgICAgbUxhc3RUb3VjaFggPSBnZXRWaWV3V2lkdGgoKSAqIC41ZjsKKyAgICAgICAgICAgIG1MYXN0VG91Y2hZID0gZ2V0Vmlld0hlaWdodCgpICogLjVmOworICAgICAgICAgICAgZG9Eb3VibGVUYXAoKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVpvb21DZW50ZXJYID0gZ2V0Vmlld1dpZHRoKCkgKiAuNWY7CisgICAgICAgICAgICBtWm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WY7CisgICAgICAgICAgICByZXR1cm4gem9vbVdpdGhQcmV2aWV3KHNjYWxlKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCB1cGRhdGVTZWxlY3Rpb24oKSB7CkBAIC00MzI0LDIzICs0ODI0LDgxIEBACiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgLy8gbUxhc3RUb3VjaFggYW5kIG1MYXN0VG91Y2hZIGFyZSB0aGUgcG9pbnQgaW4gdGhlIGN1cnJlbnQgdmlld3BvcnQKLSAgICAgICAgaW50IGNvbnRlbnRYID0gdmlld1RvQ29udGVudCgoaW50KSBtTGFzdFRvdWNoWCArIG1TY3JvbGxYKTsKLSAgICAgICAgaW50IGNvbnRlbnRZID0gdmlld1RvQ29udGVudCgoaW50KSBtTGFzdFRvdWNoWSArIG1TY3JvbGxZKTsKKyAgICAgICAgaW50IGNvbnRlbnRYID0gdmlld1RvQ29udGVudFgoKGludCkgbUxhc3RUb3VjaFggKyBtU2Nyb2xsWCk7CisgICAgICAgIGludCBjb250ZW50WSA9IHZpZXdUb0NvbnRlbnRZKChpbnQpIG1MYXN0VG91Y2hZICsgbVNjcm9sbFkpOwogICAgICAgICBSZWN0IHJlY3QgPSBuZXcgUmVjdChjb250ZW50WCAtIG1OYXZTbG9wLCBjb250ZW50WSAtIG1OYXZTbG9wLAogICAgICAgICAgICAgICAgIGNvbnRlbnRYICsgbU5hdlNsb3AsIGNvbnRlbnRZICsgbU5hdlNsb3ApOwotICAgICAgICAvLyBJZiB3ZSB3ZXJlIGFscmVhZHkgZm9jdXNlZCBvbiBhIHRleHRmaWVsZCwgdXBkYXRlIGl0cyBjYWNoZS4KLSAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSkgewotICAgICAgICAgICAgbVRleHRFbnRyeS51cGRhdGVDYWNoZWRUZXh0ZmllbGQoKTsKLSAgICAgICAgfQogICAgICAgICBuYXRpdmVTZWxlY3RCZXN0QXQocmVjdCk7CiAgICAgfQogCisgICAgLyoqCisgICAgICogU2Nyb2xsIHRoZSBmb2N1c2VkIHRleHQgZmllbGQvYXJlYSB0byBtYXRjaCB0aGUgV2ViVGV4dFZpZXcKKyAgICAgKiBAcGFyYW0geCBOZXcgeCBwb3NpdGlvbiBvZiB0aGUgV2ViVGV4dFZpZXcgaW4gdmlldyBjb29yZGluYXRlcworICAgICAqIEBwYXJhbSB5IE5ldyB5IHBvc2l0aW9uIG9mIHRoZSBXZWJUZXh0VmlldyBpbiB2aWV3IGNvb3JkaW5hdGVzCisgICAgICovCisgICAgLypwYWNrYWdlKi8gdm9pZCBzY3JvbGxGb2N1c2VkVGV4dElucHV0KGludCB4LCBpbnQgeSkgeworICAgICAgICBpZiAoIWluRWRpdGluZ01vZGUoKSB8fCBtV2ViVmlld0NvcmUgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5TQ1JPTExfVEVYVF9JTlBVVCwgdmlld1RvQ29udGVudFgoeCksCisgICAgICAgICAgICAgICAgdmlld1RvQ29udGVudFkoeSkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCBvdXIgc3RhcnRpbmcgcG9pbnQgYW5kIHRpbWUgZm9yIGEgZHJhZyBmcm9tIHRoZSBXZWJUZXh0Vmlldy4KKyAgICAgKi8KKyAgICAvKnBhY2thZ2UqLyB2b2lkIGluaXRpYXRlVGV4dEZpZWxkRHJhZyhmbG9hdCB4LCBmbG9hdCB5LCBsb25nIGV2ZW50VGltZSkgeworICAgICAgICBpZiAoIWluRWRpdGluZ01vZGUoKSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG1MYXN0VG91Y2hYID0geCArIChmbG9hdCkgKG1XZWJUZXh0Vmlldy5nZXRMZWZ0KCkgLSBtU2Nyb2xsWCk7CisgICAgICAgIG1MYXN0VG91Y2hZID0geSArICh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sdCA9IG9uVG91Y2hFdmVudChldmVudCk7CisgICAgICAgIG1EcmFnRnJvbVRleHRJbnB1dCA9IGZhbHNlOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIERvIGEgdG91Y2ggdXAgZnJvbSBhIFdlYlRleHRWaWV3LiAgVGhpcyB3aWxsIGJlIGhhbmRsZWQgYnkgd2Via2l0IHRvCisgICAgICogY2hhbmdlIHRoZSBzZWxlY3Rpb24uCisgICAgICogQHBhcmFtIGV2ZW50IE1vdGlvbkV2ZW50IGluIHRoZSBXZWJUZXh0VmlldydzIGNvb3JkaW5hdGVzLgorICAgICAqLworICAgIC8qcGFja2FnZSovIHZvaWQgdG91Y2hVcE9uVGV4dEZpZWxkKE1vdGlvbkV2ZW50IGV2ZW50KSB7CisgICAgICAgIGlmICghaW5FZGl0aW5nTW9kZSgpKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaW50IHggPSB2aWV3VG9Db250ZW50WCgoaW50KSBldmVudC5nZXRYKCkgKyBtV2ViVGV4dFZpZXcuZ2V0TGVmdCgpKTsKKyAgICAgICAgaW50IHkgPSB2aWV3VG9Db250ZW50WSgoaW50KSBldmVudC5nZXRZKCkgKyBtV2ViVGV4dFZpZXcuZ2V0VG9wKCkpOworICAgICAgICBuYXRpdmVUZXh0SW5wdXRNb3Rpb25VcCh4LCB5KTsKKyAgICB9CisKICAgICAvKnBhY2thZ2UqLyB2b2lkIHNob3J0UHJlc3NPblRleHRGaWVsZCgpIHsKICAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSkgewotICAgICAgICAgICAgVmlldyB2ID0gbVRleHRFbnRyeTsKLSAgICAgICAgICAgIGludCB4ID0gdmlld1RvQ29udGVudCgodi5nZXRMZWZ0KCkgKyB2LmdldFJpZ2h0KCkpID4+IDEpOwotICAgICAgICAgICAgaW50IHkgPSB2aWV3VG9Db250ZW50KCh2LmdldFRvcCgpICsgdi5nZX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gY29udGVudFksIG1OYXZTbG9wKSkgewogICAgICAgICAgICAgaWYgKG1Mb2dFdmVudCkgewogICAgICAgICAgICAgICAgIENoZWNraW4udXBkYXRlU3RhdHMobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCiAgICAgICAgICAgICAgICAgICAgICAgICBDaGVja2luLlN0YXRzLlRhZy5CUk9XU0VSX1NOQVBfQ0VOVEVSLCAxLCAwLjApOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIGlmIChuYXRpdmVVcGRhdGVGb2N1c05vZGUoKSAmJiAhbUZvY3VzTm9kZS5tSXNUZXh0RmllbGQKLSAgICAgICAgICAgICAgICAmJiAhbUZvY3VzTm9kZS5tSXNUZXh0QXJlYSkgeworICAgICAgICBpZiAobmF0aXZlSGFzQ3Vyc29yTm9kZSgpICYmICFuYXRpdmVDdXJzb3JJc1RleHRJbnB1dCgpKSB7CiAgICAgICAgICAgICBwbGF5U291bmRFZmZlY3QoU291bmRFZmZlY3RDb25zdGFudHMuQ0xJQ0spOwogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIGRvRG91YmxlVGFwKCkgeworICAgICAgICBpZiAobVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCkuZ2V0VXNlV2lkZVZpZXdQb3J0KCkgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBtWm9vbUNlbnRlclggPSBtTGFzdFRvdWNoWDsKKyAgICAgICAgbVpvb21DZW50ZXJZID0gbUxhc3RUb3VjaFk7CisgICAgICAgIG1Jblpvb21PdmVydmlldyA9ICFtSW5ab29tT3ZlcnZpZXc7CisgICAgICAgIC8vIHJlbW92ZSB0aGUgem9vbSBjb250cm9sIGFmdGVyIGRvdWJsZSB0YXAKKyAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7CisgICAgICAgICAgICBpZiAobVpvb21CdXR0b25zQ29udHJvbGxlci5pc1Zpc2libGUoKSkgeworICAgICAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0VmlzaWJsZShmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobVpvb21Db250cm9sUnVubmFibGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVDYWxsYmFja3MobVpvb21Db250cm9sUnVubmFibGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1ab29tQ29udHJvbHMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1ab29tQ29udHJvbHMuaGlkZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtSW5ab29tT3ZlcnZpZXcpIHsKKyAgICAgICAgICAgIHpvb21XaXRoUHJldmlldygoZmxvYXQpIGdldFZpZXdXaWR0aCgpIC8gbVpvb21PdmVydmlld1dpZHRoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIG1MYXN0VG91Y2hYIGFuZCBtTGFzdFRvdWNoWSBhcmUgdGhlIHBvaW50IGluIHRoZSBjdXJyZW50IHZpZXdwb3J0CisgICAgICAgICAgICBpbnQgY29udGVudFggPSB2aWV3VG9Db250ZW50WCgoaW50KSBtTGFzdFRvdWNoWCArIG1TY3JvbGxYKTsKKyAgICAgICAgICAgIGludCBjb250ZW50WSA9IHZpZXdUb0NvbnRlbnRZKChpbnQpIG1MYXN0VG91Y2hZICsgbVNjcm9sbFkpOworICAgICAgICAgICAgaW50IGxlZnQgPSBuYXRpdmVHZXRCbG9ja0xlZnRFZGdlKGNvbnRlbnRYLCBjb250ZW50WSwgbUFjdHVhbFNjYWxlKTsKKyAgICAgICAgICAgIGlmIChsZWZ0ICE9IE5PX0xFRlRFREdFKSB7CisgICAgICAgICAgICAgICAgLy8gYWRkIGEgNXB0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ICAgcHNkLm1TdGF0ZSA9IHN0YXRlOworICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuUExVR0lOX1NUQVRFLCBwc2QpOworICAgIH0KKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIHJlcXVlc3RGb2N1cyhpbnQgZGlyZWN0aW9uLCBSZWN0IHByZXZpb3VzbHlGb2N1c2VkUmVjdCkgewogICAgICAgICBib29sZWFuIHJlc3VsdCA9IGZhbHNlOwogICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpKSB7Ci0gICAgICAgICAgICByZXN1bHQgPSBtVGV4dEVudHJ5LnJlcXVlc3RGb2N1cyhkaXJlY3Rpb24sIHByZXZpb3VzbHlGb2N1c2VkUmVjdCk7CisgICAgICAgICAgICByZXN1bHQgPSBtV2ViVGV4dFZpZXcucmVxdWVzdEZvY3VzKGRpcmVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNseUZvY3VzZWRSZWN0KTsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIHJlc3VsdCA9IHN1cGVyLnJlcXVlc3RGb2N1cyhkaXJlY3Rpb24sIHByZXZpb3VzbHlGb2N1c2VkUmVjdCk7CiAgICAgICAgICAgICBpZiAobVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCkuZ2V0TmVlZEluaXRpYWxGb2N1cygpKSB7CkBAIC00Mzk4LDggKzUwMDIsOCBAQAogICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG1OYXRpdmVDbGFzcyAhPSAwICYmICFuYXRpdmVVcGRhdGVGb2N1c05vZGUoKSkgewotICAgICAgICAgICAgICAgICAgICBuYXZIYW5kbGVkS2V5KGZha2VLZXlEaXJlY3Rpb24sIDEsIHRydWUsIDApOworIC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zZy53aGF0IDwgUkVNRU1CRVJfUEFTU1dPUkQgfHwgbXNnLndoYXQgCi0gICAgICAgICAgICAgICAgICAgICAgICA+IElOVkFMX1JFQ1RfTVNHX0lEID8gSW50ZWdlci50b1N0cmluZyhtc2cud2hhdCkgCisgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgbXNnLndoYXQgPCBSRU1FTUJFUl9QQVNTV09SRCB8fCBtc2cud2hhdAorICAgICAgICAgICAgICAgICAgICAgICAgPiBJTlZBTF9SRUNUX01TR19JRCA/IEludGVnZXIudG9TdHJpbmcobXNnLndoYXQpCiAgICAgICAgICAgICAgICAgICAgICAgICA6IEhhbmRsZXJEZWJ1Z1N0cmluZ1ttc2cud2hhdCAtIFJFTUVNQkVSX1BBU1NXT1JEXSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CkBAIC00NTY3LDYgKzUxNzgsOCBAQAogICAgICAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9JTklUX01PREUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9TSE9SVFBSRVNTX1NUQVJUX01PREU7CiAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVTZWxlY3Rpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0RPVUJMRV9UQVBfTU9ERSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0RPTkVfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CkBAIC00NTc0LDIzICs1MTg3LDQ5IEBACiAgICAgICAgICAgICAgICAgICAgIGlmICghbVByZXZlbnREcmFnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybUxvbmdDbGljaygpOwotICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlVGV4dEVudHJ5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZWJ1aWxkV2ViVGV4dFZpZXcoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2FzZSBTV0lUQ0hfVE9fRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIExvZy52KExPR1RBRywgIlNXSVRDSF9UT19FTlRFUiIpOworICAgICAgICAgICAgICAgIGNhc2UgUkVMRUFTRV9TSU5HTEVfVEFQOiB7CisgICAgICAgICAgICAgICAgICAgIGlmICghbVByZXZlbnREcmFnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOworICAgICAgICAgICAgICAgICAgICAgICAgZG9TaG9ydFByZXNzKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgU1dJVENIX1RPX0NMSUNLOgorICAgICAgICAgICAgICAgICAgICAvLyBUaGUgdXNlciBjbGlja2VkIHdpdGggdGhlIHRyYWNrYmFsbCwgYW5kIGRpZCBub3QgY2xpY2sgYQorICAgICAgICAgICAgICAgICAgICAvLyBzZWNvbmQgdGltZSwgc28gcGVyZm9ybSB0aGUgYWN0aW9uIG9mIGEgdHJhY2tiYWxsIHNpbmdsZQorICAgICAgICAgICAgICAgICAgICAvLyBjbGljawogICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOwotICAgICAgICAgICAgICAgICAgICBvbktleVVwKEtleUV2ZW50LktFWUNPREVfRU5URVIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIG5ldyBLZXlFdmVudChLZXlFdmVudC5BQ1RJT05fVVAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIEtleUV2ZW50LktFWUNPREVfRU5URVIpKTsKKyAgICAgICAgICAgICAgICAgICAgUmVjdCB2aXNpYmxlUmVjdCA9IHNlbmRPdXJWaXNpYmxlUmVjdCgpOworICAgICAgICAgICAgICAgICAgICAvLyBOb3RlIHRoYXQgc2VuZE91clZpc2libGVSZWN0IGNhbGxzIHZpZXdUb0NvbnRlbnQsIHNvIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBjb29yZGluYXRlcyBzaG91bGQgYmUgaW4gY29udGVudCBjb29yZGluYXRlcy4KKyAgICAgICAgICAgICAgICAgICAgaWYgKCFuYXRpdmVDdXJzb3JJbnRlcnNlY3RzKHZpc2libGVSZWN0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0Rm9sbG93ZWRMaW5rKHRydWUpOworICAgICAgICAgICAgICAgICAgICBuYXRpdmVVcGRhdGVQbHVnaW5SZWNlaXZlc0V2ZW50cygpOworICAgICAgICAgICAgICAgICAgICBXZWJWaWV3Q29yZS5DdXJzb3JEYXRhIGRhdGEgPSBjdXJzb3JEYXRhKCk7CisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5TRVRfTU9WRV9NT1VTRSwgZGF0YSk7CisgICAgICAgICAgICAgICAgICAgIHBsYXlTb3VuZEVmZmVjdChTb3VuZEVmZmVjdENvbnN0YW50cy5DTElDSyk7CisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNUZXh0SW5wdXQgPSBuYXRpdmVDdXJzb3JJc1RleHRJbnB1dCgpOworICAgICAgICAgICAgICAgICAgICBpZiAoaXNUZXh0SW5wdXQgfHwgIW1DYWxsYmFja1Byb3h5LnVpT3ZlcnJpZGVVcmxMb2FkaW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVDdXJzb3JUZXh0KCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuQ0xJQ0ssIGRhdGEubUZyYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVDdXJzb3JOb2RlUG9pbnRlcigpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoaXNUZXh0SW5wdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlYnVpbGRXZWJUZXh0VmlldygpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgU0NST0xMX0JZX01TR19JRDoKICAgICAgICAgICAgICAgICAgICAgc2V0Q29udGVudFNjcm9sbEJ5KG1zZy5hcmcxLCBtc2cuYXJnMiwgKEJvb2xlYW4pIG1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNZTkNfU0NST0xMX1RPX01TR19JRDoKICAgICAgICAgICAgICAgICAgICAgaWYgKG1Vc2VyU2Nyb2xsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB1c2VyIGhhcyBzY3JvbGxlZCBleHBsaWNpdGx5LCBkb24ndCBzeW5jIHRoZSAKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHVzZXIgaGFzIHNjcm9sbGVkIGV4cGxpY2l0bHksIGRvbid0IHN5bmMgdGhlCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzY3JvbGwgcG9zaXRpb24gYW55IG1vcmUKICAgICAgICAgICAgICAgICAgICAgICAgIG1Vc2VyU2Nyb2xsID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTQ1OTksNyArNTIzOCw3IEBACiAgICAgICAgICAgICAgICAgY2FzZSBTQ1JPTExfVE9fTVNHX0lEOgogICAgICAgICAgICAgICAgICAgICBpZiAoc2V0Q29udGVudFNjcm9sbFRvKG1zZy5hcmcxLCBtc2cuYXJnMikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHdlIGNhbid0IHNjcm9sbCB0byB0aGUgZXhhY3QgcG9zaXRpb24gZHVlIHRvIHBpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlbmQgYSBtZXNzYWdlIHRvIFdlYkNvcmUgdG8gcmUtc2Nyb2xsIHdoZW4gd2UgZ2V0IGEgCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZW5kIGEgbWVzc2FnZSB0byBXZWJDb3JlIHRvIHJlLXNjcm9sbCB3aGVuIHdlIGdldCBhCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBuZXcgcGljdHVyZQogICAgICAgICAgICAgICAgICAgICAgICAgbVVzZXJTY3JvbGwgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5TWU5DX1NDUk9MTCwKQEAgLTQ2MDksMjQgKzUyNDgsNTcgQEAKICAgICAgICAgICAgICAgICBjYXNlIFNQQVdOX1NDUk9MTF9UT19NU0dfSUQ6CiAgICAgICAgICAgICAgICAgICAgIHNwYXduQ29udGVudFNjcm9sbFRvKG1zZy5hcmcxLCBtc2cuYXJnMik7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgTkVXX1BJQ1RVUkVfTVNHX0lEOgorICAgICAgICAgICAgICAgIGNhc2UgTkVXX1BJQ1RVUkVfTVNHX0lEOiB7CisgICAgICAgICAgICAgICAgICAgIFdlYlNldHRpbmdzIHNldHRpbmdzID0gbVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCk7CiAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGxlZCBmb3IgbmV3IGNvbnRlbnQKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgV2ViVmlld0NvcmUuRHJhd0RhdGEgZHJhdyA9IAorICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdmlld1dpZHRoID0gZ2V0Vmlld1dpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFdlYlZpZXdDb3JlLkRyYXdEYXRhIGRyYXcgPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3Q29yZS5EcmF3RGF0YSkgbXNnLm9iajsKICAgICAgICAgICAgICAgICAgICAgZmluYWwgUG9pbnQgdmlld1NpemUgPSBkcmF3Lm1WaWV3UG9pbnQ7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtWm9vbVNjYWxlID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXNlIHRoZSBzYW1lIGxvZ2ljIGluIHNlbmRWaWV3U2l6ZVpvb20oKSB0byBtYWtlIHN1cmUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBtWm9vbVNjYWxlIGhhcyBtYXRjaGVkIHRoZSB2aWV3U2l6ZSBzbyB0aGF0IHdlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBjYW4gY2xlYXIgbVpvb21TY2FsZQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1hdGgucm91bmQoZ2V0Vmlld1dpZHRoKCkgLyBtWm9vbVNjYWxlKSA9PSB2aWV3U2l6ZS54KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21TY2FsZSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlNFVF9TTkFQX0FOQ0hPUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDApOworICAgICAgICAgICAgICAgICAgICBib29sZWFuIHVzZVdpZGVWaWV3cG9ydCA9IHNldHRpbmdzLmdldFVzZVdpZGVWaWV3UG9ydCgpOworICAgICAgICAgICAgICAgICAgICBXZWJWaWV3Q29yZS5SZXN0b3JlU3RhdGUgcmVzdG9yZVN0YXRlID0gZHJhdy5tUmVzdG9yZVN0YXRlOworICAgICAgICAgICAgICAgICAgICBpZiAocmVzdG9yZVN0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Jblpvb21PdmVydmlldyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RTY2FsZSA9IHJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN0b3JlU3RhdGUubU1pblNjYWxlID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdG9yZVN0YXRlLm1Nb2JpbGVTaXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcmF3Lm1NaW5QcmVmV2lkdGggPiBkcmF3Lm1WaWV3UG9pbnQueCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IChmbG9hdCkgdmlld1dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gZHJhdy5tTWluUHJlZldpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gbURlZmF1bHRTY2FsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGVGaXhlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gREVGQVVMVF9NSU5fWk9PTV9TQ0FMRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gcmVzdG9yZVN0YXRlLm1NaW5TY2FsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbU1pblpvb21TY2FsZUZpeGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gKGZsb2F0KSBnZXRWaWV3V2lkdGgoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIE1hdGgubWF4KFpPT01fT1VUX1dJRFRILCBkcmF3Lm1XaWR0aEhlaWdodC54KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN0b3JlU3RhdGUubU1heFNjYWxlID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWF4Wm9vbVNjYWxlID0gREVGQVVMVF9NQVhfWk9PTV9TQ0FMRTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1heFpvb21TY2FsZSA9IHJlc3RvcmVTdGF0ZS5tTWF4U2NhbGU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUobUxhc3RTY2FsZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q29udGVudFNjcm9sbFRvKHJlc3RvcmVTdGF0ZS5tU2Nyb2xsWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVN0YXRlLm1TY3JvbGxZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChFTkFCTEVfRE9VQkxFVEFQX1pPT00gJiYgdXNlV2lkZVZpZXdwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHNldHRpbmdzLmdldExvYWRXaXRoT3ZlcnZpZXdNb2RlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKHJlc3RvcmVTdGF0ZS5tTW9iaWxlU2l0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBtTWluWm9vbVNjYWxlIDwgbURlZmF1bHRTY2FsZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBBcyB3ZSBhcmUgb24gYSBuZXcgcGFnZSwgcmVtb3ZlIHRoZSBXZWJUZXh0Vmlldy4gVGhpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgbmVjZXNzYXJ5IGZvciBwYWdlIGxvYWRzIGRyaXZlbiBieSB3ZWJraXQsIGFuZCBpbgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFydGljdWxhciB3aGVuIHRoZSB1c2VyIHdhcyBvbiBhIHBhc3N3b3JkIGZpZWxkLCBzbworICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIFdlYlRleHRWaWV3IHdhcyB2aXNpYmxlLgorICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJUZXh0RW50cnkoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAvLyBXZSB1cGRhdGUgdGhlIGxheW91dCAoaS5lLiByZXF1ZXN0IGEgbGF5b3V0IGZyb20gdGhlCiAgICAgICAgICAgICAgICAgICAgIC8vIHZpZXcgc3lzdGVtKSBpZiB0aGUgbGFzdCB2aWV3IHNpemUgdGhhdCB3ZSBzZW50IHRvCkBAIC00NjM0LDkgKzUzMDYsOSBAQAogICAgICAgICAgICAgICAgICAgICAvLyByZWNlaXZlZCBpbiB0aGUgZml4ZWQgZGltZW5zaW9uLgogICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHVwZGF0ZUxheW91dCA9IHZpZXdTaXplLnggPT0gbUxhc3RXaWR0aFNlbnQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2aWV3U2l6ZS55ID09IG1MYXN0SGVpZ2h0U2VudDsKLSAgICAgICAgICAgICAgICAgICAgcmVjb3JkTmV3Q29udGVudFNpemUoZHJhdy5tV2lkdGhIZWlnaHQueCwgCisgICAgICAgICAgICAgICAgICAgIHJlY29yZE5ld0NvbnRlbnRTaXplKGRyYXcubVdpZHRoSGVpZ2h0LngsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhdy5tV2lkdGhIZWlnaHQueSwgdXBkYXRlTGF5b3V0KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCBiID0gZHJhdy5tSW52YWxSZWdpb24uZ2V0Qm91bmRzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJORVdfUElDVFVSRV9NU0dfSUQgeyIgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLmxlZnQrIiwiK2IudG9wKyIsIitiLnJpZ2h0KyIsIitiLmJvdHRvbSsifSIpOwpAQCAtNDY0NSwxMTQgKzUzMTcsNzYgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKG1QaWN0dXJlTGlzdGVuZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVBpY3R1cmVMaXN0ZW5lci5vbk5ld1BpY3R1cmUoV2ViVmlldy50aGlzLCBjYXB0dXJlUGljdHVyZSgpKTsKICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodXNlV2lkZVZpZXdwb3J0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtWm9vbU92ZXJ2aWV3V2lkdGggPSBNYXRoLm1heChkcmF3Lm1NaW5QcmVmV2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXcubVZpZXdQb2ludC54KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoIW1NaW5ab29tU2NhbGVGaXhlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IChmbG9hdCkgdmlld1dpZHRoIC8gbVpvb21PdmVydmlld1dpZHRoOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICghbURyYXdIaXN0b3J5ICYmIG1Jblpvb21PdmVydmlldykgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZml0IHRoZSBjb250ZW50IHdpZHRoIHRvIHRoZSBjdXJyZW50IHZpZXcuIElnbm9yZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHJvdW5kaW5nIGVycm9yIGNhc2UuCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMoKHZpZXdXaWR0aCAqIG1JbnZBY3R1YWxTY2FsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtWm9vbU92ZXJ2aWV3V2lkdGgpID4gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldE5ld1pvb21TY2FsZSgoZmxvYXQpIHZpZXdXaWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyBtWm9vbU92ZXJ2aWV3V2lkdGgsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgY2FzZSBXRUJDT1JFX0lOSVRJQUxJWkVEX01TR19JRDoKICAgICAgICAgICAgICAgICAgICAgLy8gbmF0aXZlQ3JlYXRlIHNldHMgbU5hdGl2ZUNsYXNzIHRvIGEgbm9uLXplcm8gdmFsdWUKICAgICAgICAgICAgICAgICAgICAgbmF0aXZlQ3JlYXRlKG1zZy5hcmcxKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBVUERBVEVfVEVYVEZJRUxEX1RFWFRfTVNHX0lEOgogICAgICAgICAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhhdCB0aGUgdGV4dGZpZWxkIGlzIGN1cnJlbnRseSBmb2N1c2VkCi0gICAgICAgICAgICAgICAgICAgIC8vIGFuZCByZXByZXNlbnRpbmcgdGhlIHNhbWUgbm9kZSBhcyB0aGUgcG9pbnRlci4gIAotICAgICAgICAgICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpICYmIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXh0RW50cnkuaXNTYW1lVGV4dEZpZWxkKG1zZy5hcmcxKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBhbmQgcmVwcmVzZW50aW5nIHRoZSBzYW1lIG5vZGUgYXMgdGhlIHBvaW50ZXIuCisgICAgICAgICAgICAgICAgICAgIGlmIChpbkVkaXRpbmdNb2RlKCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVGV4dFZpZXcuaXNTYW1lVGV4dEZpZWxkKG1zZy5hcmcxKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5nZXREYXRhKCkuZ2V0Qm9vbGVhbigicGFzc3dvcmQiKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uYWJsZSB0ZXh0ID0gKFNwYW5uYWJsZSkgbVRleHRFbnRyeS5nZXRUZXh0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Bhbm5hYmxlIHRleHQgPSAoU3Bhbm5hYmxlKSBtV2ViVGV4dFZpZXcuZ2V0VGV4dCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCA9IFNlbGVjdGlvbi5nZXRTZWxlY3Rpb25TdGFydCh0ZXh0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZW5kID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvbkVuZCh0ZXh0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV4dEVudHJ5LnNldEluUGFzc3dvcmQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEluUGFzc3dvcmQodHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVzdG9yZSB0aGUgc2VsZWN0aW9uLCB3aGljaCBtYXkgaGF2ZSBiZWVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcnVpbmVkIGJ5IHNldEluUGFzc3dvcmQuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Bhbm5hYmxlIHB3b3JkID0gKFNwYW5uYWJsZSkgbVRleHRFbnRyeS5nZXRUZXh0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3Bhbm5hYmxlIHB3b3JkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTcGFubmFibGUpIG1XZWJUZXh0Vmlldy5nZXRUZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbihwd29yZCwgc3RhcnQsIGVuZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgdGV4dCBlbnRyeSBoYXMgY3JlYXRlZCBtb3JlIGV2ZW50cywgaWdub3JlCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIG9uZS4KICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobXNnLmFyZzIgPT0gbVRleHRHZW5lcmF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRleHRFbnRyeS5zZXRUZXh0QW5kS2VlcFNlbGVjdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVGV4dFZpZXcuc2V0VGV4dEFuZEtlZXBTZWxlY3Rpb24oCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3RyaW5nKSBtc2cub2JqKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIERJRF9GSVJTVF9MQVlPVVRfTVNHX0lEOgotICAgICAgICAgICAgICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG1XZWJUZXh0Vmlldy5pc1NhbWVUZXh0RmllbGQobXNnLmFyZzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbXNnLmFyZzIgPT0gbVRleHRHZW5lcmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3Q29yZS5UZXh0U2VsZWN0aW9uRGF0YSB0RGF0YQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IChXZWJWaWV3Q29yZS5UZXh0U2VsZWN0aW9uRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRTZWxlY3Rpb25Gcm9tV2ViS2l0KHREYXRhLm1TdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdERhdGEubUVuZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLS8vIERvIG5vdCByZXNldCB0aGUgZm9jdXMgb3IgY2xlYXIgdGhlIHRleHQ7IHRoZSB1c2VyIG1heSBoYXZlIGFscmVhZHkKLS8vIG5hdmlnYXRlZCBvciBlbnRlcmVkIHRleHQgYXQgdGhpcyBwb2ludC4gVGhlIGZvY3VzIHNob3VsZCBoYXZlIGdvdHRlbiAKLS8vIHJlc2V0LCBpZiBuZWVkIGJlLCB3aGVuIHRoZSBmb2N1cyBjYWNoZSB3YXMgYnVpbHQuIFNpbWlsYXJseSwgdGhlIHRleHQKLS8vIHZpZXcgc2hvdWxkIGFscmVhZHkgYmUgdG9ybiBkb3duIGFuZCByZWJ1aWx0IGlmIG5lZWRlZC4KLS8vICAgICAgICAgICAgICAgICAgICBuYXRpdmVSZXNldEZvY3VzKCk7Ci0vLyAgICAgICAgICAgICAgICAgICAgY2xlYXJUZXh0RW50cnkoKTsKLSAgICAgICAgICAgICAgICAgICAgSGFzaE1hcCBzY2FsZUxpbWl0ID0gKEhhc2hNYXApIG1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIGludCBtaW5TY2FsZSA9IChJbnRlZ2VyKSBzY2FsZUxpbWl0LmdldCgibWluU2NhbGUiKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1pblNjYWxlID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSBERUZBVUxUX01JTl9aT09NX1NDQUxFOwotICAgICAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gKGZsb2F0KSAobWluU2NhbGUgLyAxMDAuMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGludCBtYXhTY2FsZSA9IChJbnRlZ2VyKSBzY2FsZUxpbWl0LmdldCgibWF4U2NhbGUiKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1heFNjYWxlID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1NYXhab29tU2NhbGUgPSBERUZBVUxUX01BWF9aT09NX1NDQUxFOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbU1heFpvb21TY2FsZSA9IChmbG9hdCkgKG1heFNjYWxlIC8gMTAwLjApOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIC8vIElmIGhpc3RvcnkgUGljdHVyZSBpcyBkcmF3biwgZG9uJ3QgdXBkYXRlIHpvb21XaWR0aAotICAgICAgICAgICAgICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpbnQgd2lkdGggPSBnZXRWaWV3V2lkdGgoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHdpZHRoID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGludCBpbml0aWFsU2NhbGUgPSBtc2cuYXJnMTsKLSAgICAgICAgICAgICAgICAgICAgaW50IHZpZXdwb3J0V2lkdGggPSBtc2cuYXJnMjsKLSAgICAgICAgICAgICAgICAgICAgLy8gc3RhcnQgYSBuZXcgcGFnZSB3aXRoIERFRkFVTFRfU0NBTEUgem9vbSBzY2FsZS4KLSAgICAgICAgICAgICAgICAgICAgZmxvYXQgc2NhbGUgPSBtRGVmYXVsdFNjYWxlOwotICAgICAgICAgICAgICAgICAgICBpZiAobUluaXRpYWxTY2FsZSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gbUluaXRpYWxTY2FsZSAvIDEwMC4wZjsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCkuZ2V0VXNlV2lkZVZpZXdQb3J0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmb3JjZSB2aWV3U2l6ZUNoYW5nZWQgYnkgc2V0dGluZyBtTGFzdFdpZHRoU2VudAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFdpZHRoU2VudCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5pdGlhbFNjYWxlID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB2aWV3cG9ydFdpZHRoIGlzIGRlZmluZWQgYW5kIGl0IGlzIHNtYWxsZXIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGFuIHRoZSB2aWV3IHdpZHRoLCB6b29tIGluIHRvIGZpbGwgdGhlIHZpZXcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmlld3BvcnRXaWR0aCA+IDAgJiYgdmlld3BvcnRXaWR0aCA8IHdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gKGZsb2F0KSB3aWR0aCAvIHZpZXdwb3J0V2lkdGg7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZSA9IGluaXRpYWxTY2FsZSAvIDEwMC4wZjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUoc2NhbGUsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBNQVJLX05PREVfSU5WQUxJRF9JRDoKLSAgICAgICAgICAgICAgICAgICAgbmF0aXZlTWFya05vZGVJbnZhbGlkKG1zZy5hcmcxKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBOT1RJRllfRk9DVVNfU0VUX01TR19JRDoKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1OYXRpdmVDbGFzcyAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVOb3RpZnlGb2N1c1NldChpbkVkaXRpbmdNb2RlKCkpOworICAgICAgICAgICAgICAgIGNhc2UgTU9WRV9PVVRfT0ZfUExVR0lOOgorICAgICAgICAgICAgICAgICAgICBpZiAobmF0aXZlUGx1Z2luRWF0c05hdktleSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuYXZIYW5kbGVkS2V5KG1zZy5hcmcxLCAxLCBmYWxzZSwgMCwgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBVUERBVEVfVEVYVF9FTlRSWV9NU0dfSUQ6Ci0gICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgaXMgc2VudCBhZnRlciBmaW5pc2hpbmcgcmVzaXplIGluIFdlYlZpZXdDb3JlLiBNYWtlIAorICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIHNlbnQgYWZ0ZXIgZmluaXNoaW5nIHJlc2l6ZSBpbiBXZWJWaWV3Q29yZS4gTWFrZQogICAgICAgICAgICAgICAgICAgICAvLyBzdXJlIHRoZSB0ZXh0IGVkaXQgYm94IGlzIHN0aWxsIG9uIHRoZSAgc2NyZWVuLgotICAgICAgICAgICAgICAgICAgICBib29sZWFuIGFscmVhZHlUaGVyZSA9IGluRWRpdGluZ01vZGUoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGFscmVhZHlUaGVyZSAmJiBuYXRpdmVVcGRhdGVGb2N1c05vZGUoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgRm9jdXNOb2RlIG5vZGUgPSBtRm9jdXNOb2RlOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5vZGUubUlzVGV4dEZpZWxkIHx8IG5vZGUubUlzVGV4dEFyZWEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV4dEVudHJ5LmJyaW5nSW50b1ZpZXcoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSAmJiBuYXRpdmVDdXJzb3JJc1RleHRJbnB1dCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVGV4dFZpZXcuYnJpbmdJbnRvVmlldygpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdXBkYXRlVGV4dEVudHJ5KCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgUkVDT01QVVRFX0ZPQ1VTX01TR19JRDoKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1OYXRpdmVDbGFzcyAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVSZWNvbXB1dGVGb2N1cygpOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBDTEVBUl9URVhUX0VOVFJZOgorICAgICAgICAgICAgICAgICAgICBjbGVhclRleHRFbnRyeSgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIElOVkFMX1JFQ1RfTVNHX0lEOiB7CiAgICAgICAgICAgICAgICAgICAgIFJlY3QgciA9IChSZWN0KW1zZy5vYmo7CkBAIC00NzY1LDE3ICs1Mzk5LDE1IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX1RFWFRfRU5UUllfQURBUFRFUjoKLSAgICAgICAgICAgICAgICAgICAgSGFzaE1hcCBkYXRhID0gKEhhc2hNYXApIG1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtVGV4dEVudHJ5LmlzU2FtZVRleHRGaWVsZChtc2cuYXJnMSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEF1dG9Db21wbGV0ZUFkYXB0ZXIgYWRhcHRlciA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChBdXRvQ29tcGxldGVBZGFwdGVyKSBkYXRhLmdldCgiYWRhcHRlciIpOwotICAgICAgICAgICAgICAgICAgICAgICAgbVRleHRFbnRyeS5zZXRBZGFwdGVyQ3VzdG9tKGFkYXB0ZXIpOworICAgICAgICAgICAgICAgIGNhc2UgUkVRVUVTVF9GT1JNX0RBVEE6CisgICAgICAgICAgICAgICAgICAgIEF1dG9Db21wbGV0ZUFkYXB0ZXIgYWRhcHRlciA9IChBdXRvQ29tcGxldGVBZGFwdGVyKSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICBpZiAobVdlYlRleHRWaWV3LmlzU2FtZVRleHRGaWVsZChtc2cuYXJnMSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRBZGFwdGVyQ3VzdG9tKGFkYXB0ZXIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX0NMSVBCT0FSRDoKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHN0ciA9IChTdHJpbmcpIG1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIlVQREFURV9DTElQQk9BUkQgIiArIHN0cik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKQEAgLTQ3OTAsMTIgKzU0MjIsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lVXBkYXRlKG1XZWJWaWV3Q29yZSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgY2FzZSBMT05HX1BSRVNTX0VOVEVSOgorICAgICAgICAgICAgICAgIGNhc2UgTE9OR19QUkVTU19DRU5URVI6CiAgICAgICAgICAgICAgICAgICAgIC8vIGFzIHRoaXMgaXMgc2hhcmVkIGJ5IGtleWRvd24gYW5kIHRyYWNrYmFsbGRvd24sIHJlc2V0IGFsbAogICAgICAgICAgICAgICAgICAgICAvLyB0aGUgc3RhdGVzCi0gICAgICAgICAgICAgICAgICAgIG1Hb3RFbnRlckRvd24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgbUdvdENlbnRlckRvd24gPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgbVRyYWNrYmFsbERvd24gPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgLy8gTE9OR19QUkVTU19FTlRFUiBpcyBzZW50IGFzIGEgZGVsYXllZCBtZXNzYWdlLiBJZiB3ZQorICAgICAgICAgICAgICAgICAgICAvLyBMT05HX1BSRVNTX0NFTlRFUiBpcyBzZW50IGFzIGEgZGVsYXllZCBtZXNzYWdlLiBJZiB3ZQogICAgICAgICAgICAgICAgICAgICAvLyBzd2l0Y2ggdG8gd2luZG93cyBvdmVydmlldywgdGhlIFdlYlZpZXcgd2lsbCBiZQogICAgICAgICAgICAgICAgICAgICAvLyB0ZW1wb3JhcmlseSByZW1vdmVkIGZyb20gdGhlIHZpZXcgc3lzdGVtLiBJbiB0aGF0IGNhc2UsCiAgICAgICAgICAgICAgICAgICAgIC8vIGRvIG5vdGhpbmcuCkBAIC00ODE3LDYgKzU0NDksMTQgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAorICAgICAgICAgICAgICAgIGNhc2UgUkVRVUVTVF9LRVlCT0FSRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5hcmcxID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVTb2Z0S2V5Ym9hcmQoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlTb2Z0S2V5Ym9hcmQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9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VsbAogICAgICAgICAvLyB3aGVyZSB0aGUgaW5pdGlhbCBzZWxlY3Rpb24gaXMuCiAgICAgICAgIHByaXZhdGUgaW50ICAgICAgICAgbVNlbGVjdGlvbjsKIApAQCAtNDg1NCwxNCArNTQ5MCwxNCBAQAogICAgICAgICB9CiAKICAgICAgICAgLyoqCi0gICAgICAgICAqICBTdWJjbGFzcyBBcnJheUFkYXB0ZXIgc28gd2UgY2FuIGRpc2FibGUgT3B0aW9uR3JvdXBMYWJlbHMsIAorICAgICAgICAgKiAgU3ViY2xhc3MgQXJyYXlBZGFwdGVyIHNvIHdlIGNhbiBkaXNhYmxlIE9wdGlvbkdyb3VwTGFiZWxzLAogICAgICAgICAgKiAgYW5kIGFsbG93IGZpbHRlcmluZy4KICAgICAgICAgICovCiAgICAgICAgIHByaXZhdGUgY2xhc3MgTXlBcnJheUxpc3RBZGFwdGVyIGV4dGVuZHMgQXJyYXlBZGFwdGVyPENvbnRhaW5lcj4gewogICAgICAgICAgICAgcHVibGljIE15QXJyYXlMaXN0QWRhcHRlcihDb250ZXh0IGNvbnRleHQsIENvbnRhaW5lcltdIG9iamVjdHMsIGJvb2xlYW4gbXVsdGlwbGUpIHsKLSAgICAgICAgICAgICAgICBzdXBlcihjb250ZXh0LCAKKyAgICAgICAgICAgICAgICBzdXBlcihjb250ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxlID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuc2VsZWN0X2RpYWxvZ19tdWx0aWNob2ljZSA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuc2VsZWN0X2RpYWxvZ19zaW5nbGVjaG9pY2UsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LnNlbGVjdF9kaWFsb2dfc2luZ2xlY2hvaWNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iamVjdHMpOwogICAgICAgICAgICAgfQogCkBAIC00OTE5LDcgKzU1NTUsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgcHJpdmF0ZSBJbnZva2VMaXN0Qm94KFN0cmluZ1tdIGFycmF5LCBib29sZWFuW10gZW5hYmxlZCwgaW50IAorICAgICAgICBwcml2YXRlIEludm9rZUxpc3RCb3goU3RyaW5nW10gYXJyYXksIGJvb2xlYW5bXSBlbmFibGVkLCBpbnQKICAgICAgICAgICAgICAgICBzZWxlY3Rpb24pIHsKICAgICAgICAgICAgIG1TZWxlY3Rpb24gPSBzZWxlY3Rpb247CiAgICAgICAgICAgICBtTXVsdGlwbGUgPSBmYWxzZTsKQEAgLTQ5ODIsMzEgKzU2MTgsMzYgQEAKICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewogICAgICAgICAgICAgZmluYWwgTGlzdFZpZXcgbGlzdFZpZXcgPSAoTGlzdFZpZXcpIExheW91dEluZmxhdGVyLmZyb20obUNvbnRleHQpCiAgICAgICAgICAgICAgICAgICAgIC5pbmZsYXRlKGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LnNlbGVjdF9kaWFsb2csIG51bGwpOwotICAgICAgICAgICAgZmluYWwgTXlBcnJheUxpc3RBZGFwdGVyIGFkYXB0ZXIgPSBuZXcgCisgICAgICAgICAgICBmaW5hbCBNeUFycmF5TGlzdEFkYXB0ZXIgYWRhcHRlciA9IG5ldwogICAgICAgICAgICAgICAgICAgICBNeUFycmF5TGlzdEFkYXB0ZXIobUNvbnRleHQsIG1Db250YWluZXJzLCBtTXVsdGlwbGUpOwogICAgICAgICAgICAgQWxlcnREaWFsb2cuQnVpbGRlciBiID0gbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIobUNvbnRleHQpCiAgICAgICAgICAgICAgICAgICAgIC5zZXRWaWV3KGxpc3RWaWV3KS5zZXRDYW5jZWxhYmxlKHRydWUpCiAgICAgICAgICAgICAgICAgICAgIC5zZXRJbnZlcnNlQmFja2dyb3VuZEZvcmNlZCh0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmIChtTXVsdGlwbGUpIHsKICAgICAgICAgICAgICAgICBiLnNldFBvc2l0aXZlQnV0dG9uKGFuZHJvaWQuUi5zdHJpbmcub2ssIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DbGlja0xpc3RlbmVyKCkgewogICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKERpYWxvZ0ludGVyZmFjZSBkaWFsb2csIGludCB3aGljaCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudEh1Yi5MSVNUQk9YX0NIT0lDRVMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudEh1Yi5MSVNUQk9YX0NIT0lDRVMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkYXB0ZXIuZ2V0Q291bnQoKSwgMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFZpZXcuZ2V0Q2hlY2tlZEl0ZW1Qb3NpdGlvbnMoKSk7CiAgICAgICAgICAgICAgICAgICAgIH19KTsKLSAgICAgICAgICAgICAgICBiLnNldE5lZ2F0aXZlQnV0dG9uKGFuZHJvaWQuUi5zdHJpbmcuY2FuY2VsLCBudWxsKTsKKyAgICAgICAgICAgICAgICBiLnNldE5lZ2F0aXZlQnV0dG9uKGFuZHJvaWQuUi5zdHJpbmcuY2FuY2VsLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soRGlhbG9nSW50ZXJmYWNlIGRpYW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b2N1cyBQYXNzIHRydWUgaWYgdGhlICJtb3VzZSIgY3Vyc29yIGlzIG5vdyBvdmVyIGEgbm9kZQorICAgICAqICAgICAgICAgICAgICAgICAgICB3aGljaCB3YW50cyBrZXkgZXZlbnRzLCBidXQgaXQgaXMgbm90IHRoZSBmb2N1cy4gVGhpcworICAgICAqICAgICAgICAgICAgICAgICAgICB3aWxsIG1ha2UgdGhlIHZpc3VhbCBhcHBlYXIgYXMgdGhvdWdoIG5vdGhpbmcgaXMgaW4KKyAgICAgKiAgICAgICAgICAgICAgICAgICAgZm9jdXMuICBSZW1vdmUgdGhlIFdlYlRleHRWaWV3LCBpZiBwcmVzZW50LCBhbmQgc3RvcAorICAgICAqICAgICAgICAgICAgICAgICAgICBkcmF3aW5nIHRoZSBibGlua2luZyBjYXJldC4KKyAgICAgKiBjYWxsZWQgYnkgSk5JCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHNlbmRNb3ZlTW91c2VJZkxhdGVzdChib29sZWFuIHJlbW92ZUZvY3VzKSB7CisgICAgICAgIGlmIChyZW1vdmVGb2N1cykgeworICAgICAgICAgICAgY2xlYXJUZXh0RW50cnkoKTsKKyAgICAgICAgICAgIHNldEZvY3VzQ29udHJvbGxlckluYWN0aXZlKCk7CisgICAgICAgIH0KKyAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlNFVF9NT1ZFX01PVVNFX0lGX0xBVEVTVCwKKyAgICAgICAgICAgICAgICBjdXJzb3JEYXRhKCkpOwogICAgIH0KIAogICAgIC8vIGNhbGxlZCBieSBKTkkKLSAgICBwcml2YXRlIHZvaWQgc2V0Rm9jdXNEYXRhKGludCBtb3ZlR2VuZXJhdGlvbiwgaW50IGJ1aWxkR2VuZXJhdGlvbiwKLSAgICAgICAgICAgIGludCBmcmFtZSwgaW50IG5vZGUsIGludCB4LCBpbnQgeSwgYm9vbGVhbiBpZ25vcmVOdWxsRm9jdXMpIHsKLSAgICAgICAgbUZ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W4odmlld0N1cnNvclJpbmdCb3VuZHMucmlnaHQgLSB2aXNSZWN0LnJpZ2h0LAorICAgICAgICAgICAgICAgIG1heFhTY3JvbGwpOwogICAgICAgICBpZiAobWF4SCA+IDApIHsKICAgICAgICAgICAgIHBpblNjcm9sbEJ5KG1heEgsIDAsIHRydWUsIDApOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbWF4SCA9IE1hdGgubWF4KHZpZXdGb2N1cy5sZWZ0IC0gdmlzUmVjdC5sZWZ0LCAtbWF4WFNjcm9sbCk7CisgICAgICAgICAgICBtYXhIID0gTWF0aC5tYXgodmlld0N1cnNvclJpbmdCb3VuZHMubGVmdCAtIHZpc1JlY3QubGVmdCwKKyAgICAgICAgICAgICAgICAgICAgLW1heFhTY3JvbGwpOwogICAgICAgICAgICAgaWYgKG1heEggPCAwKSB7CiAgICAgICAgICAgICAgICAgcGluU2Nyb2xsQnkobWF4SCwgMCwgdHJ1ZSwgMCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgaWYgKG1MYXN0Rm9jdXNCb3VuZHMuaXNFbXB0eSgpKSByZXR1cm4ga2V5SGFuZGxlZDsKLSAgICAgICAgaWYgKG1MYXN0Rm9jdXNCb3VuZHMuZXF1YWxzKGNvbnRlbnRGb2N1cykpIHJldHVybiBrZXlIYW5kbGVkOwotICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICBMb2cudihMT0dUQUcsICJuYXZIYW5kbGVkS2V5IGNvbnRlbnRGb2N1cz0iICsgY29udGVudEZvY3VzKTsKKyAgICAgICAgaWYgKG1MYXN0Q3Vyc29yQm91bmRzLmlzRW1wdHkoKSkgcmV0dXJuIGtleUhhbmRsZWQ7CisgICAgICAgIGlmIChtTGFzdEN1cnNvckJvdW5kcy5lcXVhbHMoY29udGVudEN1cnNvclJpbmdCb3VuZHMpKSB7CisgICAgICAgICAgICByZXR1cm4ga2V5SGFuZGxlZDsKICAgICAgICAg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50UXVvdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgZXN0aW1hdGVkU2l6ZSkgeworICAgICAgICAvLyBJbmZvcm0gdGhlIGNhbGxiYWNrIHByb3h5IG9mIHRoZSBxdW90YSBvdmVyZmxvdy4gU2VuZCBhbiBvYmplY3QKKyAgICAgICAgLy8gdGhhdCBlbmNhcHN1bGF0ZXMgYSBjYWxsIHRvIHRoZSBuYXRpdmVTZXREYXRhYmFzZVF1b3RhIG1ldGhvZCB0bworICAgICAgICAvLyBhd2FrZW4gdGhlIHNsZWVwaW5nIHdlYmNvcmUgdGhyZWFkIHdoZW4gYSBkZWNpc2lvbiBmcm9tIHRoZQorICAgICAgICAvLyBjbGllbnQgdG8gYWxsb3cgb3IgZGVueSBxdW90YSBpcyBhdmFpbGFibGUuCisgICAgICAgIG1DYWxsYmFja1Byb3h5Lm9uRXhjZWVkZWREYXRhYmFzZVF1b3RhKHVybCwgZGF0YWJhc2VJZGVudGlmaWVyLAorICAgICAgICAgICAgICAgIGN1cnJlbnRRdW90YSwgZXN0aW1hdGVkU2l6ZSwgZ2V0VXNlZFF1b3RhKCksCisgICAgICAgICAgICAgICAgbmV3IFdlYlN0b3JhZ2UuUXVvdGFVcGRhdGVyKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgdXBkYXRlUXVvdGEobG9uZyBxdW90YSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldE5ld1N0b3JhZ2VMaW1pdChxdW90YSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogTm90aWZ5IHRoZSBicm93c2VyIHRoYXQgdGhlIGFwcGNhY2hlIGhhcyBleGNlZWRlZCBpdHMgbWF4IHNpemUuCisgICAgICogQHBhcmFtIHNwYWNlTmVlZGVkIGlzIHRoZSBhbW91bnQgb2YgZGlzayBzcGFj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gICAgICogb3JpZ2luLgorICAgICAqIEBwYXJhbSBvcmlnaW4gVGhlIG9yaWdpbiBmb3Igd2hpY2ggR2VvbG9jYXRpb24gcGVybWlzc2lvbnMgYXJlIHByb3ZpZGVkLgorICAgICAqIEBwYXJhbSBhbGxvdyBXaGV0aGVyIEdlb2xvY2F0aW9uIHBlcm1pc3Npb25zIGFyZSBhbGxvd2VkLgorICAgICAqIEBwYXJhbSByZW1lbWJlciBXaGV0aGVyIHRoaXMgZGVjaXNpb24gc2hvdWxkIGJlIHJlbWVtYmVyZWQgYmV5b25kIHRoZQorICAgICAqICAgICBsaWZlIG9mIHRoZSBjdXJyZW50IHBhZ2UuCisgICAgICovCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuYXRpdmVHZW9sb2NhdGlvblBlcm1pc3Npb25zUHJvdmlkZShTdHJpbmcgb3JpZ2luLCBib29sZWFuIGFsbG93LCBib29sZWFuIHJlbWVtYmVyKTsKKwogICAgIC8vIEV2ZW50SHViIGZvciBwcm9jZXNzaW5nIG1lc3NhZ2VzCiAgICAgcHJpdmF0ZSBmaW5hbCBFdmVudEh1YiBtRXZlbnRIdWI7CiAgICAgLy8gV2ViQ29yZSB0aHJlYWQgaGFuZGxlcgpAQCAtNDQ3LDcgKzU1OSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYWNoZU1hbmFnZXIuZW5kQ2FjaGVUcmFuc2FjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FjaGVNYW5hZ2VyLnN0YXJ0Q2FjaGVUcmFuc2FjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2VEZWxheWVkKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYnRhaW5NZXNzYWdlKENBQ0hFX1RJQ0tFUiksIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYnRhaW5NZXNzYWdlKENBQ0hFX1RJQ0tFUiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENBQ0hFX1RJQ0tFUl9JTlRFUlZBTCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC00NzIsMzYgKzU4NCw2NCBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgc3RhdGljIGNsYXNzIEZvY3VzRGF0YSB7Ci0gICAgICAgIEZvY3VzRGF0YSgpIHt9Ci0gICAgICAgIEZvY3VzRGF0YShGb2N1c0RhdGEgZCkgewotICAgICAgICAgICAgbU1vdmVHZW5lcmF0aW9uID0gZC5tTW92ZUdlbmVyYXRpb247Ci0gICAgICAgICAgICBtQnVpbGRHZW5lcmF0aW9uID0gZC5tQnVpbGRHZW5lcmF0aW9uOwotICAgICAgICAgICAgbUZyYW1lID0gZC5tRnJhbWU7Ci0gICAgICAgICAgICBtTm9kZSA9IGQubU5vZGU7Ci0gICAgICAgICAgICBtWCA9IGQubVg7Ci0gICAgICAgICAgICBtWSA9IGQubVk7Ci0gICAgICAgICAgICBtSWdub3JlTnVsbEZvY3VzID0gZC5tSWdub3JlTnVsbEZvY3VzOworICAgIHN0YXRpYyBjbGFzcyBCYXNlVXJsRGF0YSB7CisgICAgICAgIFN0cmluZyBtQmFzZVVybDsKKyAgICAgICAgU3RyaW5nIG1EYXRhOworICAgICAgICBTdHJpbmcgbU1pbWVUeXBlOworICAgICAgICBTdHJpbmcgbUVuY29kaW5nOworICAgICAgICBTdHJpbmcgbUZhaWxVcmw7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEN1cnNvckRhdGEgeworICAgICAgICBDdXJzb3JEYXRhKCkge30KKyAgICAgICAgQ3Vyc29yRGF0YShpbnQgZnJhbWUsIGludCBub2RlLCBpbnQgeCwgaW50IHkpIHsKKyAgICAgICAgICAgIG1GcmFtZSA9IGZyYW1lOworICAgICAgICAgICAgbVggPSB4OworICAgICAgICAgICAgbVkgPSB5OwogICAgICAgICB9CiAgICAgICAgIGludCBtTW92ZUdlbmVyYXRpb247Ci0gICAgICAgIGludCBtQnVpbGRHZW5lcmF0aW9uOwogICAgICAgICBpbnQgbUZyYW1lOwotICAgICAgICBpbnQgbU5vZGU7CiAgICAgICAgIGludCBtWDsKICAgICAgICAgaW50IG1ZOwotICAgICAgICBib29sZWFuIG1JZ25vcmVOdWxsRm9jdXM7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEpTSW50ZXJmYWNlRGF0YSB7CisgICAgICAgIE9iamVjdCBtT2JqZWN0OworICAgICAgICBTdHJpbmcgbUludGVyZmFjZU5hbWU7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEpTS2V5RGF0YSB7CisgICAgICAgIFN0cmluZyBtQ3VycmVudFRleHQ7CisgICAgICAgIEtleUV2ZW50IG1FdmVudDsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgUG9zdFVybERhdGEgeworICAgICAgICBTdHJpbmcgbVVybDsKKyAgICAgICAgYnl0ZVtdIG1Qb3N0RGF0YTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgUmVwbGFjZVRleHREYXRhIHsKKyAgICAgICAgU3RyaW5nIG1SZXBsYWNlOworICAgICAgICBpbnQgbU5ld1N0YXJ0OworICAgICAgICBpbnQgbU5ld0VuZDsKKyAgICAgICAgaW50IG1UZXh0R2VuZXJhdGlvbjsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgVGV4dFNlbGVjdGlvbkRhdGEgeworICAgICAgICBwdWJsaWMgVGV4dFNlbGVjdGlvbkRhdGEoaW50IHN0YXJ0LCBpbnQgZW5kKSB7CisgICAgICAgICAgICBtU3RhcnQgPSBzdGFydDsKKyAgICAgICAgICAgIG1FbmQgPSBlbmQ7CisgICAgICAgIH0KKyAgICAgICAgaW50IG1TdGFydDsKKyAgICAgICAgaW50IG1FbmQ7CiAgICAgfQogCiAgICAgc3RhdGljIGNsYXNzIFRvdWNoVXBEYXRhIHsKICAgICAgICAgaW50IG1Nb3ZlR2VuZXJhdGlvbjsKLSAgICAgICAgaW50IG1CdWlsZEdlbmVyYXRpb247CiAgICAgICAgIGludCBtRnJhbWU7CiAgICAgICAgIGludCBtTm9kZTsKICAgICAgICAgaW50IG1YOwogICAgICAgICBpbnQgbVk7Ci0gICAgICAgIGludCBtU2l6ZTsKLSAgICAgICAgYm9vbGVhbiBtSXNDbGljazsKLSAgICAgICAgYm9vbGVhbiBtUmV0cnk7CiAgICAgfQogCiAgICAgc3RhdGljIGNsYXNzIFRvdWNoRXZlbnREYXRhIHsKQEAgLTUxMCw3ICs2NTAsMjEgQEAKICAgICAgICAgaW50IG1ZOwogICAgIH0KIAorICAgIHN0YXRpYyBjbGFzcyBQbHVnaW5TdGF0ZURhdGEgeworICAgICAgICBpbnQgbUZyYW1lOworICAgICAgICBpbnQgbU5vZGU7CisgICAgICAgIGludCBtU3RhdGU7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEdlb2xvY2F0aW9uUGVybWlzc2lvbnNEYXRhIHsKKyAgICAgICAgU3RyaW5nIG1PcmlnaW47CisgICAgICAgIGJvb2xlYW4gbUFsbG93OworICAgICAgICBib29sZWFuIG1SZW1lbWJlcjsKKyAgICB9CisKICAgICAgICAgc3RhdGljIGZpbmFsIFN0cmluZ1tdIEhhbmRsZXJEZWJ1Z1N0cmluZyA9IHsKKyAgICAgICAgICAgICJVUERBVEVfRlJBTUVfQ0FDSEVfSUZfTE9BRElORyIsIC8vID0gOTgKKyAgICAgICAgICAgICJTQ1JPTExfVEVYVF9JTlBVVCIsIC8vID0gOTkKICAgICAgICAgICAgICJMT0FEX1VSTCIsIC8vID0gMTAwOwogICAgICAgICAgICAgIlNUT1BfTE9BRElORyIsIC8vID0gMTAxOwogICAgICAgICAgICAgIlJFTE9BRCIsIC8vID0gMTAyOwpAQCAtNTM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9JTlBVVCA9IDk5OwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IExPQURfVVJMID0gMTAwOwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IFNUT1BfTE9BRElORyA9IDEwMTsKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBSRUxPQUQgPSAxMDI7CkBAIC01ODAsMjYgKzczOCwyNCBAQAogICAgICAgICBzdGF0aWMgZmluYWwgaW50IENMSUNLID0gMTE4OwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IFNFVF9ORVRXT1JLX1NUQVRFID0gMTE5OwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IERPQ19IQVNfSU1BR0VTID0gMTIwOwotICAgICAgICBzdGF0aWMgZmluYWwgaW50IFNFVF9TTkFQX0FOQ0hPUiA9IDEyMTsKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBERUxFVEVfU0VMRUNUSU9OID0gMTIyOwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IExJU1RCT1hfQ0hPSUNFUyA9IDEyMzsKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBTSU5HTEVfTElTVEJPWF9DSE9JQ0UgPSAxMjQ7CisgICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgTUVTU0FHRV9SRUxBWSA9IDEyNTsKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBTRVRfQkFDS0dST1VORF9DT0xPUiA9IDEyNjsKLSAgICAgICAgc3RhdGljIGZpbmFsIGludCBVTkJMT0NLX0ZPQ1VTID0gMTI3OworICAgICAgICBzdGF0aWMgZmluYWwgaW50IFBMVUdJTl9TVEFURSA9IDEyNzsgLy8gcGx1Z2luIG5vdGlmaWNhdGlvbnMKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBTQVZFX0RPQ1VNRU5UX1NUQVRFID0gMTI4OwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IEdFVF9TRUxFQ1RJT04gPSAxMjk7CiAgICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgV0V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gICAgICAgLy8gR2VvbG9jYXRpb24KKyAgICAgICAgc3RhdGljIGZpbmFsIGludCBHRU9MT0NBVElPTl9QRVJNSVNTSU9OU19QUk9WSURFID0gMTgwOworCiAgICAgICAgIC8vIHByaXZhdGUgbWVzc2FnZSBpZHMKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERFU1RST1kgPSAgICAgMjAwOwotICAgICAgICAKLSAgICAgICAgLy8gZmxhZyB2YWx1ZXMgcGFzc2VkIHRvIG1lc3NhZ2UgU0VUX0ZJTkFMX0ZPQ1VTCi0gICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgTk9fRk9DVVNfQ0hBTkdFX0JMT0NLID0gMDsKLSAgICAgICAgc3RhdGljIGZpbmFsIGludCBCTE9DS19GT0NVU19DSEFOR0VfVU5USUxfS0VZX1VQID0gMTsKIAogICAgICAgICAvLyBQcml2YXRlIGhhbmRsZXIgZm9yIFdlYkNvcmUgbWVzc2FnZXMuCiAgICAgICAgIHByaXZhdGUgSGFuZGxlciBtSGFuZGxlcjsKQEAgLTY1NCwxMCArODIxLDE0IEBACiAgICAgICAgICAgICBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgewogICAgICAgICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCBtc2cud2hhdCA8IExPQURfVVJMIHx8IG1zZy53aGF0IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+IFRPVUNIX0VWRU5UID8gSW50ZWdlci50b1N0cmluZyhtc2cud2hhdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBIYW5kbGVyRGVidWdTdHJpbmdbbXNnLndoYXQgLSBMT0FEX1VSTF0pOworICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFV19DT1JFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsIChtc2cud2hhdCA8IFVQREFURV9GUkFNRV9DQUNIRV9JRl9MT0FESU5HCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1zZy53aGF0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID4gRlJFRV9NRU1PUlkgPyBJbnRlZ2VyLnRvU3RyaW5nKG1zZy53aGF0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEhhbmRsZXJEZWJ1Z1N0cmluZ1ttc2cud2hhdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gVVBEQVRFX0ZSQU1FX0NBQ0hFX0lGX0xPQURJTkddKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgYXJnMT0iICsgbXNnLmFyZzEgKyAiIGFyZzI9IiArIG1zZy5hcmcyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBvYmo9IiArIG1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV0VCS0lUX0RSQVc6CkBAIC02NzIsMjAgKzg0MywyNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OYXRpdmVDbGFzcyA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX0ZSQU1FX0NBQ0hFX0lGX0xPQURJTkc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlVXBkYXRlRnJhbWVDYWNoZUlmTG9hZGluZygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNDUk9MTF9URVhUX0lOUFVUOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNjcm9sbEZvY3VzZWRUZXh0SW5wdXQobXNnLmFyZzEsIG1zZy5hcmcyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKwogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBMT0FEX1VSTDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2FkVXJsKChTdHJpbmcpIG1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFBPU1RfVVJMOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSGFzaE1hcCBwYXJhbSA9IChIYXNoTWFwKSBtc2cub2JqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyB1cmwgPSAoU3RyaW5nKSBwYXJhbS5nZXQoInVybCIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBkYXRhID0gKGJ5dGVbXSkgcGFyYW0uZ2V0KCJkYXRhIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJyb3dzZXJGcmFtZS5wb3N0VXJsKHVybCwgZGF0YSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUG9zdFVybERhdGEgcGFyYW0gPSAoUG9zdFVybERhdGEpIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJyb3dzZXJGcmFtZS5wb3N0VXJsKHBhcmFtLm1VcmwsIHBhcmFtLm1Qb3N0RGF0YSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIExPQURfREFUQToKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBIYXNoTWFwIGxvYWRQYXJhbXMgPSAoSGFzaE1hcCkgbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYmFzZVVybCA9IChTdHJpbmcpIGxvYWRQYXJhbXMuZ2V0KCJiYXNlVXJsIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZVVybERhdGEgbG9hZFBhcmFtcyA9IChCYXNlVXJsRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYmFzZVVybCA9IGxvYWRQYXJhbXMubUJhc2VVcmw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJhc2VVcmwgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaSA9IGJhc2VVcmwuaW5kZXhPZignOicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+IDApIHsKQEAgLTY5OCw3ICs4NzUsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd2UgYXV0b21hdGljYWxseSBhZGQgdGhlIHNjaGVtZSBvZiB0aGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJhc2VVcmwgZm9yIGxvY2FsIGFjY2VzcyBhcyBsb25nIGFzIGl0IGlzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBub3QgaHR0cChzKS9mdHAocykvYWJvdXQvamF2YXNjcmlwdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2NoZW1lID0gYmFzZVVybC5zdWJzdHJpbmcoMCwgaSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjaGVtZS5zdGFydHNXaXRoKCJodHRwIikgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIXNjaGVtZS5zdGFydHNXaXRoKCJmdHAiKSAmJgpAQCAtNzA5LDE2ICs4ODYsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnJvd3NlckZyYW1lLmxvYWREYXRhKGJhc2VVcmwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3RyaW5nKSBsb2FkUGFyYW1zLmdldCgiZGF0YSIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFN0cmluZykgbG9hZFBhcmFtcy5nZXQoIm1pbWVUeXBlIiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3RyaW5nKSBsb2FkUGFyYW1zLmdldCgiZW5jb2RpbmciKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTdHJpbmcpIGxvYWRQYXJhbXMuZ2V0KCJmYWlsVXJsIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9hZFBhcmFtcy5tRGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvYWRQYXJhbXMubU1pbWVUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9hZFBhcmFtcy5tRW5jb2RpbmcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2FkUGFyYW1zLm1GYWlsVXJsKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTVE9QX0xPQURJTkc6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIFdlYkNvcmUgaGFzIGNvbW1pdHRlZCB0aGUgbG9hZCwgYnV0IG5vdCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmaW5pc2hlZCB0aGUgZmlyc3QgbGF5b3V0IHlldCwgd2UgbmVlZCB0byBzZXQgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmlyc3QgbGF5b3V0IGRvbmUgdG8gdHJpZ2dlciB0aGUgaW50ZXJwcmV0ZWQgc2lkZSBzeW5jIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBXZWJDb3JlIGhhcyBjb21taXR0ZWQgdGhlIGxvYWQsIGJ1dCBub3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmaW5pc2hlZCB0aGUgZmlyc3QgbGF5b3V0IHlldCwgd2UgbmVlZCB0byBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmaXJzdCBsYXlvdXQgZG9uZSB0byB0cmlnZ2VyIHRoZSBpbnRlcnByZXRlZCBzaWRlIHN5bmMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cCB3aXRoIG5hdGl2ZSBzaWRlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Ccm93c2VyRnJhbWUuY29tbWl0dGVkKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFtQnJvd3NlckZyYW1lLmZpcnN0TGF5b3V0RG9uZSgpKSB7CkBAIC03NDEsMjAgKzkxOCwyNCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENMSUNLOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlQ2xpY2sobXNnLmFyZzEsIG1zZy5hcmcyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBWSUVXX1NJWkVfQ0hBTkdFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWV3U2l6ZUNoYW5nZWQobXNnLmFyZzEsIG1zZy5hcmcyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChGbG9hdCkgbXNnLm9iaikuZmxvYXRWYWx1ZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVklFV19TSVpFX0NIQU5HRUQ6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlZpZXdTaXplRGF0YSBkYXRhID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3LlZpZXdTaXplRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWV3U2l6ZUNoYW5nZWQoZGF0YS5tV2lkdGgsIGRhdGEubUhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubVRleHRXcmFwV2lkdGgsIGRhdGEubVNjYWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tSWdub3JlSGVpZ2h0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQorICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTRVRfU0NST0xMX09GRlNFVDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBub3RlOiB0aGVzZSBhcmUgaW4gZG9jdW1lbnQgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAoaW52LXpvb20pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0U2Nyb2xsT2Zmc2V0KG1zZy5hcmcxLCBtc2cuYXJnMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUG9pbnQgcHQgPSAoUG9pbnQpIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0U2Nyb2xsT2Zmc2V0KG1zZy5hcmcxLCBwdC54LCBwdC55KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTRVRfR0xPQkFMX0JPVU5EUzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWN0IHIgPSAoUmVjdCkgbXNnLm9iajsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVTZXRHbG9iYWxCb3VuZHMoci5sZWZ0LCByLnRvcCwgci53aWR0aCgpLApAQCAtNzY1LDcgKzk0Niw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgaXQgaXMgYSBzdGFuZGFyZCBsb2FkIGFuZCB0aGUgbG9hZCBpcyBub3QKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb21taXR0ZWQgeWV0LCB3ZSBpbnRlcnByZXQgQkFDSyBhcyBSRUxPQUQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1Ccm93c2VyRnJhbWUuY29tbWl0dGVkKCkgJiYgbXNnLmFyZzEgPT0gLTEgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtQnJvd3NlckZyYW1lLmxvYWRUeXBlKCkgPT0gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobUJyb3dzZXJGcmFtZS5sb2FkVHlwZSgpID09CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyRnJhbWUuRlJBTUVfTE9BRFRZUEVfU1RBTkRBUkQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ccm93c2VyRnJhbWUucmVsb2FkKHRydWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC04MDIsNiArOTgzLDI0IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIE9OX1BBVVNFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVBhdXNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgT05fUkVTVU1FOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVJlc3VtZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEZSRUVfTUVNT1JZOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyQ2FjaGUoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUZyZWVNZW1vcnkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBQTFVHSU5fU1RBVEU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGx1Z2luU3RhdGVEYXRhIHBzZCA9IChQbHVnaW5TdGF0ZURhdGEpIG1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlVXBkYXRlUGx1Z2luU3RhdGUocHNkLm1GcmFtZSwgcHNkLm1Ob2RlLCBwc2QubVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKwogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTRVRfTkVUV09SS19TVEFURToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQnJvd3NlckZyYW1lLnNKYXZhQnJpZGdlID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiTm8gV2ViVmlldyAiICsKQEAgLTgxMiwxMCArMTAxMSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ0xFQVJfQ0FDSEU6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJyb3dzZXJGcmFtZS5jbGVhckNhY2hlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5hcmcxID09IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FjaGVNYW5hZ2VyLnJlbW92ZUFsbENhY2hlRmlsZXMoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJDYWNoZShtc2cuYXJnMSA9PSAxKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTEVBUl9ISVNUT1JZOgpAQCAtODIzLDI5ICsxMDE5LDIxIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZShtQnJvd3NlckZyYW1lLm1OYXRpdmVGcmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgUkVQTEFDRV9URVhUOiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBIYXNoTWFwIGpNYXAgPSAoSGFzaE1hcCkgbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb2N1c0RhdGEgZkRhdGEgPSAoRm9jdXNEYXRhKSBqTWFwLmdldCgiZm9jdXNEYXRhIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJlcGxhY2UgPSAoU3RyaW5nKSBqTWFwLmdldCgicmVwbGFjZSIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdTdGFydCA9IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChJbnRlZ2VyKSBqTWFwLmdldCgic3RhcnQiKSkuaW50VmFsdWUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmV3RW5kID0gCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKEludGVnZXIpIGpNYXAuZ2V0KCJlbmQiKSkuaW50VmFsdWUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVSZXBsYWNlVGV4dGZpZWxkVGV4dChmRGF0YS5tRnJhbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmRGF0YS5tTm9kZSwgZkRhdGEubVgsIGZEYXRhLm1ZLCBtc2cuYXJnMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5hcmcyLCByZXBsYWNlLCBuZXdTdGFydCwgbmV3RW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgUkVQTEFDRV9URVhUOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlcGxhY2VUZXh0RGF0YSByZXAgPSAoUmVwbGFjZVRleHREYXRhKSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVJlcGxhY2VUZXh0ZmllbGRUZXh0KG1zZy5hcmcxLCBtc2cuYXJnMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcC5tUmVwbGFjZSwgcmVwLm1OZXdTdGFydCwgcmVwLm1OZXdFbmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXAubVRleHRHZW5lcmF0aW9uKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBQQVNTX1RPX0pTOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSGFzaE1hcCBqc01hcCA9IChIYXNoTWFwKSBtc2cub2JqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvY3VzRGF0YSBmRGF0ID0gKEZvY3VzRGF0YSkganNNYXAuZ2V0KCJmb2N1c0RhdGEiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBLZXlFdmVudCBldnQgPSAoS2V5RXZlbnQpIGpzTWFwLmdldCgiZXZlbnQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU0tleURhdGEganNEYXRhID0gKEpTS2V5RGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBLZXlFdmVudCBldnQgPSBqc0RhdGEubUV2ZW50OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBrZXlDb2RlID0gZXZ0LmdldEtleUNvZGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQga2V5VmFsdWUgPSBldnQuZ2V0VW5pY29kZUNoYXIoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZ2VuZXJhdGlvbiA9IG1zZy5hcmcxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhc3NUb0pzKGZEYXQubUZyYW1lLCBmRGF0Lm1Ob2RlLCBmRGF0Lm1YLCBmRGF0Lm1ZLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTdHJpbmcpIGpzTWFwLmdldCgiY3VycmVudFRleHQiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXNzVG9KcyhnZW5lcmF0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNEYXRhLm1DdXJyZW50VGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlWYWx1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2dC5pc0Rvd24oKSwKQEAgLTg1NSw4ICsxMDQzLDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTQVZFX0RPQ1VNRU5UX1NUQVRFOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRm9jdXNEYXRhIGZEYXQgPSAoRm9jdXNEYXRhKSBtc2cub2JqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNhdmVEb2N1bWVudFN0YXRlKGZEYXQubUZyYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJzb3JEYXRhIGNEYXQgPSAoQ3Vyc29yRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVTYXZlRG9jdW1lbnRTdGF0ZShjRGF0Lm1GcmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKQEAgLTg2OCwxMSArMTA1Niw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFRPVUNIX1VQOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoVXBEYXRhIHRvdWNoVXBEYXRhID0gKFRvdWNoVXBEYXRhKSBtc2cub2JqOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVRvdWNoVXAodG91Y2hVcERhdGEubU1vdmVHZW5lcmF0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG91Y2hVcERhdGEubUJ1aWxkR2VuZXJhdGlvbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdWNoVXBEYXRhLm1GcmFtZSwgdG91Y2hVcERhdGEubU5vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3VjaFVwRGF0YS5tWCwgdG91Y2hVcERhdGEubVksIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG91Y2hVcERhdGEubVNpemUsIHRvdWNoVXBEYXRhLm1Jc0NsaWNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG91Y2hVcERhdGEubVJldHJ5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdWNoVXBEYXRhLm1YLCB0b3VjaFVwRGF0YS5tWSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVE9VQ0hfRVZFTlQ6IHsKQEAgLTg4NSwxMyArMTA3MCwxNCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNFVF9BQ1RJVkU6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0Rm9jdXNDb250cm9sbGVyQWN0aXZlKG1zZy5hcmcxID09IDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEFERF9KU19JTlRFUkZBQ0U6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSGFzaE1hcCBtYXAgPSAoSGFzaE1hcCkgbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3Qgb2JqID0gbWFwLmdldCgib2JqZWN0Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGludGVyZmFjZU5hbWUgPSAoU3RyaW5nKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwLmdldCgiaW50ZXJmYWNlTmFtZSIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ccm93c2VyRnJhbWUuYWRkSmF2YXNjcmlwdEludGVyZmFjZShvYmosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcmZhY2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU0ludGVyZmFjZURhdGEganNEYXRhID0gKEpTSW50ZXJmYWNlRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnJvd3NlckZyYW1lLmFkZEphdmFzY3JpcHRJbnRlcmZhY2UoanNEYXRhLm1PYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc0RhdGEubUludGVyZmFjZU5hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFJFUVVFU1RfRVhUX1JFUFJFU0VOVEFUSU9OOgpAQCAtOTAzLDM1ICsxMDg5LDI3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJyb3dzZXJGcmFtZS5kb2N1bWVudEFzVGV4dCgoTWVzc2FnZSkgbXNnLm9iaik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU0VUX0ZJTkFMX0ZPQ1VTOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvY3VzRGF0YSBmaW5hbERhdGEgPSAoRm9jdXNEYXRhKSBtc2cub2JqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldEZpbmFsRm9jdXMoZmluYWxEYXRhLm1GcmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbERhdGEubU5vZGUsIGZpbmFsRGF0YS5tWCwgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWxEYXRhLm1ZLCBtc2cuYXJnMSAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBFdmVudEh1Yi5OT19GT0NVU19DSEFOR0VfQkxPQ0spOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTRVRfTU9WRV9NT1VTRToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJzb3JEYXRhIGN1cnNvckRhdGEgPSAoQ3Vyc29yRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVNb3ZlTW91c2UoY3Vyc29yRGF0YS5tRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yRGF0YS5tWCwgY3Vyc29yRGF0YS5tWSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVU5CTE9DS19GT0NVUzoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVVbmJsb2NrRm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU0VUX01PVkVfTU9VU0VfSUZfTEFURVNUOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEN1cnNvckRhdGEgY0RhdGEgPSAoQ3Vyc29yRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVNb3ZlTW91c2VJZkxhdGVzdChjRGF0YS5tTW92ZUdlbmVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjRGF0YS5tRnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjRGF0YS5tWCwgY0RhdGEubVkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNFVF9LSVRfRk9DVVM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRm9jdXNEYXRhIGZvY3VzRGF0YSA9IChGb2N1c0RhdGEpIG1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0S2l0Rm9jdXMoZm9jdXNEYXRhLm1Nb3ZlR2VuZXJhdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzRGF0YS5tQnVpbGRHZW5lcmF0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9jdXNEYXRhLm1GcmFtZSwgZm9jdXNEYXRhLm1Ob2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9jdXNEYXRhLm1YLCBmb2N1c0RhdGEubVksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2N1c0RhdGEubUlnbm9yZU51bGxGb2N1cyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgUkVRVUVTVF9GT0NVU19IUkVGOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFJFUVVFU1RfQ1VSU09SX0hSRUY6IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZXNzYWdlIGhyZWZNc2cgPSAoTWVzc2FnZSkgbXNnLm9iajsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmVzID0gbmF0aXZlUmV0cmlldmVIcmVmKG1zZy5hcmcxLCBtc2cuYXJnMik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHJlZk1zZy5nZXREYXRhKCkucHV0U3RyaW5nKCJ1cmwiLCByZXMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhyZWZNc2cuc2VuZFRvVGFyZ2V0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX0NBQ0hFX0FORF9URVhUX0VOVFJZOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVVwZGF0ZUZyYW1lQ2FjaGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRTogdGhpcyBzaG91bGQgcHJvdmlkZSBhIG1pbmltYWwgcmVjdGFuZ2xlCkBAIC05NDgsMjQgKzExMjYsMTcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZVJlc3VsdC5zZW5kVG9UYXJnZXQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTRVRfU05BUF9BTkNIT1I6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0U25hcEFuY2hvcihtc2cuYXJnMSwgbXNnLmFyZzIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBERUxFVEVfU0VMRUNUSU9OOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvY3VzRGF0YSBkZWxEYXRhID0gKEZvY3VzRGF0YSkgbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVEZWxldGVTZWxlY3Rpb24oZGVsRGF0YS5tRnJhbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsRGF0YS5tTm9kZSwgZGVsRGF0YS5tWCwgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsRGF0YS5tWSwgbXNnLmFyZzEsIG1zZy5hcmcyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0U2VsZWN0aW9uRGF0YSBkZWxldGVTZWxlY3Rpb25EYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IChUZXh0U2VsZWN0aW9uRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVEZWxldGVTZWxlY3Rpb24oZGVsZXRlU2VsZWN0aW9uRGF0YS5tU3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVTZWxlY3Rpb25EYXRhLm1FbmQsIG1zZy5hcmcxKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTRVRfU0VMRUNUSU9OOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvY3VzRGF0YSBzZWxEYXRhID0gKEZvY3VzRGF0YSkgbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVTZXRTZWxlY3Rpb24oc2VsRGF0YS5tRnJhbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsRGF0YS5tTm9kZSwgc2VsRGF0YS5tWCwgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsRGF0YS5tWSwgbXNnLmFyZzEsIG1zZy5hcmcyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVTZXRTZWxlY3Rpb24obXNnLmFyZzEsIG1zZy5hcmcyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBMSVNUQk9YX0NIT0lDRVM6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3BhcnNlQm9vbGVhbkFycmF5IGNob2ljZXMgPSAoU3BhcnNlQm9vbGVhbkFycmF5KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLm9iajsKQEAgLTk3NCwxOCArMTE0NSwxOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGMgPSAwOyBjIDwgY2hvaWNlc1NpemU7IGMrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9pY2VzQXJyYXlbY10gPSBjaG9pY2VzLmdldChjKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2VuZExpc3RCb3hDaG9pY2VzKGNob2ljZXNBcnJheSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2VuZExpc3RCb3hDaG9pY2VzKGNob2ljZXNBcnJheSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob2ljZXNTaXplKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTSU5HTEVfTElTVEJPWF9DSE9JQ0U6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2VuZExpc3RCb3hDaG9pY2UobXNnLmFyZzEpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNFVF9CQUNLR1JPVU5EX0NPTE9SOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldEJhY2tncm91bmRDb2xvcihtc2cuYXJnMSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgR0VUX1NFTEVDVElPTjoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc3RyID0gbmF0aXZlR2V0U2VsZWN0aW9uKChSZWdpb24pIG1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2Uub2J0YWluKG1XZWJWaWV3Lm1Qcml2YXRlSGFuZGxlcgpAQCAtMTAwNSwyNiArMTE3NiwzOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUR1bXBOYXZUcmVlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU0VUX0pTX0ZMQUdTOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldEpzRmxhZ3MoKFN0cmluZyltc2cub2JqKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBHRU9MT0NBVElPTl9QRVJNSVNTSU9OU19QUk9WSURFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdlb2xvY2F0aW9uUGVybWlzc2lvbnNEYXRhIGRhdGEgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEdlb2xvY2F0aW9uUGVybWlzc2lvbnNEYXRhKSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUdlb2xvY2F0aW9uUGVybWlzc2lvbnNQcm92aWRlKGRhdGEubU9yaWdpbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubUFsbG93LCBkYXRhLm1SZW1lbWJlcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU1lOQ19TQ1JPTEw6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYmtpdFNjcm9sbFggPSBtc2cuYXJnMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2Via2l0U2Nyb2xsWSA9IG1zZy5hcmcyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFJFRlJFU0hfUExVR0lOUzoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVSZWZyZXNoUGx1Z2lucyhtc2cuYXJnMSAhPSAwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU1BMSVRfUElDVFVSRV9TRVQ6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU3BsaXRDb250ZW50KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNwbGl0UGljdHVyZUlzU2NoZWR1bGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ0xFQVJfQ09OVEVOVDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbGVhciB0aGUgdmlldyBzbyB0aGF0IG9uRHJhdygpIHdpbGwgZHJhdyBub3RoaW5nCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnV0IHdoaXRlIGJhY2tncm91bmQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAoU2VlIHB1YmxpYyBtZXRob2QgV2ViVmlldy5jbGVhclZpZXcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlQ2xlYXJDb250ZW50KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9SRUxBWToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobXNnLm9iaiBpbnN0YW5jZW9mIE1lc3NhZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChNZXNzYWdlKSBtc2cub2JqKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9OwpAQCAtMTA2Niw2ICsxMjUwLDE4IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAorICAgICAgICBwcml2YXRlIHN5bmNocm9uaXplZCBib29sZWFuIGhhc01lc3NhZ2VzKGludCB3aGF0KSB7CisgICAgICAgICAgICBpZiAobUJsb2NrTWVzc2FnZXMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobU1lc3NhZ2VzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJoYXNNZXNzYWdlcygpIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhpcyBjYXNlLiIpOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1IYW5kbGVyLmhhc01lc3NhZ2VzKHdoYXQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKICAgICAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBzZW5kTWVzc2FnZURlbGF5ZWQoTWVzc2FnZSBtc2csIGxvbmcgZGVsYXkpIHsKICAgICAgICAgICAgIGlmIChtQmxvY2tNZXNzYWdlcykgewogICAgICAgICAgICAgICAgIHJldHVybjsKQEAgLTExMTQsNyArMTMxMCw3IEBACiAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAKICAgICB2b2lkIHN0b3BMb2FkaW5nKCkgewotICAgICAgICBpZiAoTE9HV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KCk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQgbG9hZFVybChTdHJpbmcgdXJsKSB7Ci0gICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIExvZy52KExPR1RBRywgIiBDT1JFIGxvYWRVcmwgIiArIHVybCk7CisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXX0NPUkUpIExvZy52KExPR1RBRywgIiBDT1JFIGxvYWRVcmwgIiArIHVybCk7CiAgICAgICAgIG1Ccm93c2VyRnJhbWUubG9hZFVybCh1cmwpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBrZXkoS2V5RXZlbnQgZXZ0LCBib29sZWFuIGlzRG93bikgewotICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7CisgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXX0NPUkUpIHsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgIkNPUkUga2V5IGF0ICIgKyBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSArICIsICIKICAgICAgICAgICAgICAgICAgICAgKyBldnQpOwogICAgICAgICB9Ci0gICAgICAgIGlmICghbmF0aXZlS2V5KGV2dC5nZXRLZXlDb2RlKCksIGV2dC5nZXRVbmljb2RlQ2hhcigpLAorICAgICAgICBpbnQga2V5Q29kZSA9IGV2dC5nZXRLZXlDb2RlKCk7CisgICAgICAgIGlmICghbmF0aXZlS2V5KGtleUNvZGUsIGV2dC5nZXRVbmljb2RlQ2hhcigpLAogICAgICAgICAgICAgICAgIGV2dC5nZXRSZXBlYXRDb3VudCgpLCBldnQuaXNTaGlmdFByZXNzZWQoKSwgZXZ0LmlzQWx0UHJlc3NlZCgpLAotICAgICAgICAgICAgICAgIGlzRG93bikpIHsKKyAgICAgICAgICAgICAgICBldnQuaXNTeW1QcmVzc2VkKCksCisgICAgICAgICAgICAgICAgaXNEb3duKSAmJiBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfRU5URVIpIHsKKyAgICAgICAgICAgIGlmIChrZXlDb2RlID49IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUAorICAgICAgICAgICAgICAgICAgICAmJiBrZXlDb2RlIDw9IEtleUV2ZW50LktFWUNPREVfRFBBRF9SSUdIVCkgeworICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXX0NPUkUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAia2V5OiBhcnJvdyB1bnVzZWQgYnkgcGx1Z2luOiAiICsga2V5Q29kZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsICYmIGV2dC5pc0Rvd24oKSkgeworICAgICAgICAgICAgICAgICAgICBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2ViVmlldy5NT1ZFX09VVF9PRl9QTFVHSU4sIGtleUNvZGUpLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CiAgICAgICAgICAgICAvLyBidWJibGUgdXAgdGhlIGV2ZW50IGhhbmRsaW5nCisgICAgICAgICAgICAvLyBidXQgZG8gbm90IGJ1YmJsZSB1cCB0aGUgRU5URVIga2V5LCB3aGljaCB3b3VsZCBvcGVuIHRoZSBzZWFyY2gKKyAgICAgICAgICAgIC8vIGJhciB3aXRob3V0IGFueSB0ZXh0LgogICAgICAgICAgICAgbUNhbGxiYWNrUHJveHkub25VbmhhbmRsZWRLZXlFdmVudChldnQpOwogICAgICAgICB9CiAgICAgfQpAQCAtMTIxMCwyMSArMTQ0MSwyNSBAQAogICAgIC8vIFRoZXNlIHZhbHVlcyBhcmUgdXNlZCB0byBhdm9pZCByZXF1ZXN0aW5nIGEgbGF5b3V0IGJhc2VkIG9uIG9sZCB2YWx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WaWV3cG9ydFdpZHRoIHx8IG1WaWV3cG9ydFdpZHRoID09IC0xKSkgewotICAgICAgICAgICAgaW50IHdpZHRoID0gbVZpZXdwb3J0V2lkdGg7CisgICAgICAgIGludCB3aWR0aCA9IHc7CisgICAgICAgIGlmIChtU2V0dGluZ3MuZ2V0VXNlV2lkZVZpZXdQb3J0KCkpIHsKICAgICAgICAgICAgIGlmIChtVmlld3BvcnRXaWR0aCA9PSAtMSkgewotICAgICAgICAgICAgICAgIGlmIChtU2V0dGluZ3MuZ2V0TGF5b3V0QWxnb3JpdGhtKCkgPT0gCisgICAgICAgICAgICAgICAgaWYgKG1TZXR0aW5ncy5nZXRMYXlvdXRBbGdvcml0aG0oKSA9PQogICAgICAgICAgICAgICAgICAgICAgICAgV2ViU2V0dGluZ3MuTGF5b3V0QWxnb3JpdGhtLk5PUk1BTCkgewotICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IFdlYlZpZXcuWk9PTV9PVVRfV0lEVEg7CisgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gREVGQVVMVF9WSUVXUE9SVF9XSURUSDsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAgICAgKiBpZiBhIHBhZ2UncyBtaW5pbXVtIHByZWZlcnJlZCB3aWR0aCBpcyB3aWRlciB0aGFuIHRoZQpAQCAtMTIzOCwyMiArMTQ3MywyNCBAQAogICAgICAgICAgICAgICAgICAgICAgKiBJbiB0aGUgd29yc2UgY2FzZSwgdGhlIG5hdGl2ZSB3aWR0aCB3aWxsIGJlIGFkanVzdGVkIHdoZW4KICAgICAgICAgICAgICAgICAgICAgICogbmV4dCB6b29tIG9yIHNjcmVlbiBvcmllbnRhdGlvbiBjaGFuZ2UgaGFwcGVucy4KICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIHdpZHRoID0gTWF0aC5tYXgodywgbmF0aXZlR2V0Q29udGVudE1pblByZWZXaWR0aCgpKTsKKyAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBNYXRoLm1heCh3LCBNYXRoLm1heChERUZBVUxUX1ZJRVdQT1JUX1dJRFRILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUdldENvbnRlbnRNaW5QcmVmV2lkdGgoKSkpOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgd2lkdGggPSBNYXRoLm1heCh3LCBtVmlld3BvcnRXaWR0aCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBuYXRpdmVTZXRTaXplKHdpZHRoLCBNYXRoLnJvdW5kKChmbG9hdCkgd2lkdGggKiBoIC8gdyksIHcsIHNjYWxlLAotICAgICAgICAgICAgICAgICAgICB3LCBoKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIG5hdGl2ZVNldFNpemUodywgaCwgdywgc2NhbGUsIHcsIGgpOwogICAgICAgICB9CisgICAgICAgIG5hdGl2ZVNldFNpemUod2lkdGgsIHdpZHRoID09IHcgPyBoIDogTWF0aC5yb3VuZCgoZmxvYXQpIHdpZHRoICogaCAvIHcpLAorICAgICAgICAgICAgICAgIHRleHR3cmFwV2lkdGgsIHNjYWxlLCB3LCBoLCBpZ25vcmVIZWlnaHQpOwogICAgICAgICAvLyBSZW1lbWJlciB0aGUgY3VycmVudCB3aWR0aCBhbmQgaGVpZ2h0CiAgICAgICAgIGJvb2xlYW4gbmVlZEludmFsaWRhdGUgPSAobUN1cnJlbnRWaWV3V2lkdGggPT0gMCk7CiAgICAgICAgIG1DdXJyZW50Vmlld1dpZHRoID0gdzsKICAgICAgICAgbUN1cnJlbnRWaWV3SGVpZ2h0ID0gaDsKKyAgICAgICAgbUN1cnJlbnRWaWV3U2NhbGUgPSBzY2FsZTsKICAgICAgICAgaWYgKG5lZWRJbnZhbGlkYXRlKSB7CiAgICAgICAgICAgICAvLyBlbnN1cmUge0BsaW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xlOworICAgICAgICBpbnQgbVNjcm9sbFg7CisgICAgICAgIGludCBtU2Nyb2xsWTsKKyAgICAgICAgYm9vbGVhbiBtTW9iaWxlU2l0ZTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgRHJhd0RhdGEgeworICAgICAgICBEcmF3RGF0YSgpIHsKICAgICAgICAgICAgIG1JbnZhbFJlZ2lvbiA9IG5ldyBSZWdpb24oKTsKICAgICAgICAgICAgIG1XaWR0aEhlaWdodCA9IG5ldyBQb2ludCgpOwogICAgICAgICB9Ci0gICAgICAgIHB1YmxpYyBSZWdpb24gbUludmFsUmVnaW9uOwotICAgICAgICBwdWJsaWMgUG9pbnQgbVZpZXdQb2ludDsKLSAgICAgICAgcHVibGljIFBvaW50IG1XaWR0aEhlaWdodDsKKyAgICAgICAgUmVnaW9uIG1JbnZhbFJlZ2lvbjsKKyAgICAgICAgUG9pbnQgbVZpZXdQb2ludDsKKyAgICAgICAgUG9pbnQgbVdpZHRoSGVpZ2h0OworICAgICAgICBpbnQgbU1pblByZWZXaWR0aDsKKyAgICAgICAgUmVzdG9yZVN0YXRlIG1SZXN0b3JlU3RhdGU7IC8vIG9ubHkgbm9uLW51bGwgaWYgaXQgaXMgZm9yIHRoZSBmaXJzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGljdHVyZSBzZXQgYWZ0ZXIgdGhlIGZpcnN0IGxheW91dAogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgdm9pZCB3ZWJraXREcmF3KCkgewogICAgICAgICBtRHJhd0lzU2NoZWR1bGVkID0gZmFsc2U7CiAgICAgICAgIERyYXdEYXRhIGRyYXcgPSBuZXcgRHJhd0RhdGEoKTsKLSAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgTG9nLnYoTE9HVEFHLCAid2Via2l0RHJhdyBzdGFydCIpOwotICAgICAgICBpZiAobmF0aXZlUmVjb3JkQ29udGVudChkcmF3Lm1JbnZhbFJlZ2lvbiwgZHJhdy5tV2lkdGhIZWlnaHQpIAorICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFV19DT1JFKSBMb2cudihMT0dUQUcsICJ3ZWJraXREcmF3IHN0YXJ0Iik7CisgICAgICAgIGlmIChuYXRpdmVSZWNvcmRDb250ZW50KGRyYXcubUludmFsUmVnaW9uLCBkcmF3Lm1XaWR0aEhlaWdodCkKICAgICAgICAgICAgICAgICA9PSBmYWxzZSkgewotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgTG9nLnYoTE9HVEFHLCAid2Via2l0RHJhdyBhYm9ydCIpOworICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVdfQ09SRSkgTG9nLnYoTE9HVEFHLCAid2Via2l0RHJhdyBhYm9ydCIpOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CiAgICAgICAgICAgICAvLyBTZW5kIHRoZSBuYXRpdmUgdmlldyBzaXplIHRoYXQgd2FzIHVzZWQgZHVyaW5nIHRoZSBtb3N0IHJlY2VudAogICAgICAgICAgICAgLy8gbGF5b3V0LgogICAgICAgICAgICAgZHJhdy5tVmlld1BvaW50ID0gbmV3IFBvaW50KG1DdXJyZW50Vmlld1dpZHRoLCBtQ3VycmVudFZpZXdIZWlnaHQpOwotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgTG9nLnYoTE9HVEFHLCAid2Via2l0RHJhdyBORVdfUElDVFVSRV9NU0dfSUQiKTsKKyAgICAgICAgICAgIGlmIChXZWJWaWV3LkVOQUJMRV9ET1VCTEVUQVBfWk9PTSAmJiBtU2V0dGluZ3MuZ2V0VXNlV2lkZVZpZXdQb3J0KCkpIHsKKyAgICAgICAgICAgICAgICBkcmF3Lm1NaW5QcmVmV2lkdGggPSBNYXRoLm1heCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3cG9ydFdpZHRoID09IC0xID8gREVGQVVMVF9WSUVXUE9SVF9XSURUSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChtVmlld3BvcnRXaWR0aCA9PSAwID8gbUN1cnJlbnRWaWV3V2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1WaWV3cG9ydFdpZHRoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUdldENvbnRlbnRNaW5QcmVmV2lkdGgoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVJlc3RvcmVTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZHJhdy5tUmVzdG9yZVN0YXRlID0gbVJlc3RvcmVTdGF0ZTsKKyAgICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlID0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXX0NPUkUpIExvZy52KExPR1RBRywgIndlYmtpdERyYXcgTkVXX1BJQ1RVUkVfTVNHX0lEIik7CiAgICAgICAgICAgICBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCiAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuTkVXX1BJQ1RVUkVfTVNHX0lELCBkcmF3KS5zZW5kVG9UYXJnZXQoKTsKICAgICAgICAgICAgIGlmIChtV2Via2l0U2Nyb2xsWCAhPSAwIHx8IG1XZWJraXRTY3JvbGxZICE9IDApIHsKQEAgLTEzMTIsOSArMTU5Miw2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBtV2Via2l0U2Nyb2xsWSkuc2VuZFRvVGFyZ2V0KCk7CiAgICAgICAgICAgICAgICAgbVdlYmtpdFNjcm9sbFggPSBtV2Via2l0U2Nyb2xsWSA9IDA7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBuYXRpdmVTbmFwVG9BbmNob3IoKSBuZWVkcyB0byBiZ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ICAgIG1FdmVudEh1Yi5zZW5kTWVzc2FnZShNZXNzYWdlLm9idGFpbihudWxsLCBFdmVudEh1Yi5XRUJLSVRfRFJBVykpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLy8gY2FsbGVkIGJ5IEpOSQogICAgIHByaXZhdGUgdm9pZCBjb250ZW50U2Nyb2xsQnkoaW50IGR4LCBpbnQgZHksIGJvb2xlYW4gYW5pbWF0ZSkgewogICAgICAgICBpZiAoIW1Ccm93c2VyRnJhbWUuZmlyc3RMYXlvdXREb25lKCkpIHsKQEAgLTE0NDIsOSArMTcyMywxNCBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7Ci0gICAgICAgICAgICBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCi0gICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuU0NST0xMX0JZX01TR19JRCwgZHgsIGR5LCAKLSAgICAgICAgICAgICAgICAgICAgbmV3IEJvb2xlYW4oYW5pbWF0ZSkpLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuU0NST0xMX0JZX01TR19JRCwgZHgsIGR5LCBuZXcgQm9vbGVhbihhbmltYXRlKSk7CisgICAgICAgICAgICBpZiAobURyYXdJc1NjaGVkdWxlZCkgeworICAgICAgICAgICAgICAgIG1FdmVudEh1Yi5zZW5kTWVzc2FnZShNZXNzYWdlLm9idGFpbihudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRIdWIuTUVTU0FHRV9SRUxBWSwgbXNnKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIApAQCAtMTQ2MSw4ICsxNzQ3LDE0IEBACiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgaWYgKG1XZWJWaWV3ICE9IG51bGwpIHsKLSAgICAgICAgICAgIE1lc3NhZ2Uub2J0YWluKG1XZWJWaWV3Lm1Qcml2YXRlSGFuZGxlciwKLSAgICAgICAgICAgICAgICAgICAgV2ViVmlldy5TQ1JPTExfVE9fTVNHX0lELCB4LCB5KS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNDUk9MTF9UT19NU0dfSUQsIHgsIHkpOworICAgICAgICAgICAgaWYgKG1EcmF3SXNTY2hlZHVsZWQpIHsKKyAgICAgICAgICAgICAgICBtRXZlbnRIdWIuc2VuZE1lc3NhZ2UoTWVzc2FnZS5vYnRhaW4obnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50SHViLk1FU1NBR0VfUkVMQVksIG1zZykpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtc2cuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTE0NzksMjQgKzE3NzEsMTQgQEAKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCkgewotICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLAotICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNQQVdOX1NDUk9MTF9UT19NU0dfSUQsIHgsIHkpLnNlbmRUb1RhcmdldCgpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gY2FsbGVkIGJ5IEpOSQotICAgIHByaXZhdGUgdm9pZCBzZW5kTWFya05vZGVJbnZhbGlkKGludCBub2RlKSB7Ci0gICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7Ci0gICAgICAgICAgICBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCi0gICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuTUFSS19OT0RFX0lOVkFMSURfSUQsIG5vZGUsIDApLnNlbmRUb1RhcmdldCgpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gY2FsbGVkIGJ5IEpOSQotICAgIHByaXZhdGUgdm9pZCBzZW5kTm90aWZ5Rm9jdXNTZXQoKSB7Ci0gICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7Ci0gICAgICAgICAgICBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCi0gICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuTk9USUZZX0ZPQ1VTX1NFVF9NU0dfSUQpLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCisgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuU1BBV05fU0NST0xMX1RPX01TR19JRCwgeCwgeSk7CisgICAgICAgICAgICBpZiAobURyYXdJc1NjaGVkdWxlZCkgeworICAgICAgICAgICAgICAgIG1FdmVudEh1Yi5zZW5kTWVzc2FnZShNZXNzYWdlLm9idGFpbihudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRIdWIuTUVTU0FHRV9SRUxBWSwgbXNnKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIApAQCAtMTUxMSwxNCArMTc5Myw2IEB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pOworICAgICAgICBpZiAobVJlc3RvcmVkU2NhbGUgPiAwKSB7CisgICAgICAgICAgICBpZiAobVJlc3RvcmVkU2NyZWVuV2lkdGhTY2FsZSA+IDApIHsKKyAgICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZXN0b3JlZFNjcmVlbldpZHRoU2NhbGUgLyAxMDAuMGY7CisgICAgICAgICAgICAgICAgLy8gMCB3aWxsIHRyaWdnZXIgV2ViVmlldyB0byB0dXJuIG9uIHpvb20gb3ZlcnZpZXcgbW9kZQorICAgICAgICAgICAgICAgIG1SZXN0b3JlU3RhdGUubVZpZXdTY2FsZSA9IDA7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIE1lc3NhZ2Uub2J0YWluKG1XZWJWaWV3Lm1Qcml2YXRlSGFuZGxlciwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuRElEX0ZJUlNUX0xBWU9VVF9NU0dfSUQsIG1WaWV3cG9ydEluaXRpYWxTY2FsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3cG9ydFdpZHRoLCBzY2FsZUxpbWl0KS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUgPSBtUmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1SZXN0b3JlZFNjYWxlIC8gMTAwLjBmOwogICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKG1WaWV3cG9ydEluaXRpYWxTY2FsZSA+IDApIHsKKyAgICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUgPSBtUmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG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RiYWNrIGFmdGVyIHRoZSBmaXJzdCBsYXlvdXQKLSAgICAgICAgICAgIGlmIChtQ3VycmVudFZpZXdXaWR0aCAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtRHJhd0lzU2NoZWR1bGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRXZlbnRIdWIucmVtb3ZlTWVzc2FnZXMoRXZlbnRIdWIuV0VCS0lUX0RSQVcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1EcmF3SXNTY2hlZHVsZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtRXZlbnRIdWIuc2VuZE1lc3NhZ2VBdEZyb250T2ZRdWV1ZShNZXNzYWdlLm9idGFpbihudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50SHViLldFQktJVF9EUkFXKSk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBpZiAobVdlYlZpZXcubUhlaWdodENhbk1lYXN1cmUpIHsKKyAgICAgICAgICAgIC8vIFRyaWNrIHRvIGVuc3VyZSB0aGF0IHRoZSBQaWN0dXJlIGhhcyB0aGUgZXhhY3QgaGVpZ2h0IGZvciB0aGUKKyAgICAgICAgICAgIC8vIGNvbnRlbnQgYnkgZm9yY2luZyB0byBsYXlvdXQgd2l0aCAwIGhlaWdodCBhZnRlciB0aGUgcGFnZSBpcworICAgICAgICAgICAgLy8gcmVhZHksIHdoaWNoIGlzIGluZGljYXRlZCBieSBkaWRGaXJzdExheW91dC4gVGhpcyBpcyBlc3NlbnRpYWwgdG8KKyAgICAgICAgICAgIC8vIGdldCByaWQgb2YgdGhlIHdoaXRlIHNwYWNlIGluIHRoZSBHTWFpbCB3aGljaCB1c2VzIFdlYlZpZXcgZm9yCisgICAgICAgICAgICAvLyBtZXNzYWdlIHZpZXcuCisgICAgICAgICAgICBtV2ViV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gc2VudCBmcm9tIFdlYlZpZXcKKyAgICAgICAgICAgICAgICAvLyB0byBXZWJWaWV3Q29yZQorICAgICAgICAgICAgICAgIG1XZWJWaWV3Lm1MYXN0V2lkdGhTZW50ID0gMDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgV2ViVmlldy5WaWV3U2l6ZURhdGEgZGF0YSA9IG5ldyBXZWJWaWV3LlZpZXdTaXplRGF0YSgpOworICAgICAgICAgICAgICAgIC8vIG1WaWV3U2NhbGUgYXMgMCBtZWFucyBpdCBpcyBpbiB6b29tIG92ZXJ2aWV3IG1vZGUuIFNvIHdlIGRvbid0CisgICAgICAgICAgICAgICAgLy8ga25vdyB0aGUgZXhhY3Qgc2NhbGUuIElmIG1SZXN0b3JlZFNjYWxlIGlzIG5vbi16ZXJvLCB1c2UgaXQ7CisgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlIGp1c3QgdXNlIG1UZXh0V3JhcFNjYWxlIGFzIHRoZSBpbml0aWFsIHNjYWxlLgorICAgICAgICAgICAgICAgIGRhdGEubVNjYWxlID0gbVJlc3RvcmVTdGF0ZS5tVmlld1NjYWxlID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgID8gKG1SZXN0b3JlZFNjYWxlID4gMCA/IG1SZXN0b3JlZFNjYWxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbVJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIDogbVJlc3RvcmVTdGF0ZS5tVmlld1NjYWxlOworICAgICAgICAgICAgICAgIGRhdGEubVdpZHRoID0gTWF0aC5yb3VuZCh3ZWJWaWV3V2lkdGggLyBkYXRhLm1TY2FsZSk7CisgICAgICAgICAgICAgICAgZGF0YS5tSGVpZ2h0ID0gbUN1cnJlbnRWaWV3SGVpZ2h0ICogZGF0YS5tV2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIC8gbUN1cnJlbnRWaWV3V2lkdGg7CisgICAgICAgICAgICAgICAgZGF0YS5tVGV4dFdyYXBXaWR0aCA9IE1hdGgucm91bmQod2ViVmlld1dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAvIG1SZXN0b3JlU3RhdGUubVRleHRXcmFwU2NhbGUpOworICAgICAgICAgICAgICAgIGRhdGEubUlnbm9yZUhlaWdodCA9IGZhbHNlOworICAgICAgICAgICAgICAgIG1FdmVudEh1Yi5zZW5kTWVzc2FnZUF0RnJvbnRPZlF1ZXVlKE1lc3NhZ2Uub2J0YWluKG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBFdmVudEh1Yi5WSUVXX1NJWkVfQ0hBTkdFRCwgZGF0YSkpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtMTY1MSw2ICsxOTc2LDE3IEBACiAgICAgfQogCiAgICAgLy8gY2FsbGVkIGJ5IEpOSQorICAgIHByaXZhdGUgdm9pZCByZXN0b3JlU2NyZWVuV2lkdGhTY2FsZShpbnQgc2NhbGUpIHsKKyAgICAgICAgaWYgKCFXZWJWaWV3LkVOQUJMRV9ET1VCTEVUQVBfWk9PTSB8fCAhbVNldHRpbmdzLmdldFVzZVdpZGVWaWV3UG9ydCgpKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAobUJyb3dzZXJGcmFtZS5maXJzdExheW91dERvbmUoKSA9PSBmYWxzZSkgeworICAgICAgICAgICAgbVJlc3RvcmVkU2NyZWVuV2lkdGhTY2FsZSA9IHNjYWxlOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gY2FsbGVkIGJ5IEpOSQogICAgIHByaXZhdGUgdm9pZCBuZWVkVG91Y2hFdmVudHMoYm9vbGVhbiBuZWVkKSB7CiAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CiAgICAgICAgICAgICBNZXNzYWdlLm9idGFpbihtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIsCkBAIC0xNjY0LDE1ICsyMDAwLDM5IEBACiAgICAgICAgICAgICBTdHJpbmcgdGV4dCwgaW50IHRleHRHZW5lcmF0aW9uKSB7CiAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CiAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IE1lc3NhZ2Uub2J0YWluKG1XZWJWaWV3Lm1Qcml2YXRlSGFuZGxlciwKLSAgICAgICAgICAgICAgICAgICAgV2ViVmlldy5VUERBVEVfVEVYVEZJRUxEX1RFWFRfTVNHX0lELCBwdHIsIAorICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlVQREFURV9URVhURklFTERfVEVYVF9NU0dfSUQsIHB0ciwKICAgICAgICAgICAgICAgICAgICAgdGV4dEdlbmVyYXRpb24sIHRleHQpOwogICAgICAgICAgICAgbXNnLmdldERhdGEoKS5wdXRCb29sZWFuKCJwYXNzd29yZCIsIGNoYW5nZVRvUGFzc3dvcmQpOwogICAgICAgICAgICAgbXNnLnNlbmRUb1RhcmdldCgpOwogICAgICAgICB9CiAgICAgfQogCisgICAgLy8gY2FsbGVkIGJ5IEpOSQorICAgIHByaXZhdGUgdm9pZCB1cGRhdGVUZXh0U2VsZWN0aW9uKGludCBwb2ludGVyLCBpbnQgc3RhcnQsIGludCBlbmQsCisgICAgICAgICAgICBpbnQgdGV4dEdlbmVyYXRpb24pIHsKKyAgICAgICAgaWYgKG1XZWJWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIE1lc3NhZ2Uub2J0YWluKG1XZWJWaWV3Lm1Qcml2YXRlSGFuZGxlciwKKyAgICAgICAgICAgICAgICBXZWJWaWV3LlVQREFURV9URVhUX1NFTEVDVElPTl9NU0dfSUQsIHBvaW50ZXIsIHRleHRHZW5lcmF0aW9uLAorICAgICAgICAgICAgICAgIG5ldyBUZXh0U2VsZWN0aW9uRGF0YShzdGFydCwgZW5kKSkuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgIH0KKyAgICB9CisKK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QXJyYXksIHNlbGVjdGlvbik7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICB9CisKKyAgICAvLyBjYWxsZWQgYnkgSk5JCisgICAgcHJpdmF0ZSB2b2lkIHJlcXVlc3RLZXlib2FyZChib29sZWFuIHNob3dLZXlib2FyZCkgeworICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLAorICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlJFUVVFU1RfS0VZQk9BUkQsIHNob3dLZXlib2FyZCA/IDEgOiAwLCAwKQorICAgICAgICAgICAgICAgICAgICAuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBUaGlzIGNsYXNzIGxvb2tzIGxpa2UgYSBTdXJmYWNlVmlldyB0byBuYXRpdmUgY29kZS4gSW4gamF2YSwgd2UgY2FuCisgICAgLy8gYXNzdW1lIHRoZSBwYXNzZWQgaW4gU3VyZmFjZVZpZXcgaXMgdGhpcyBjbGFzcyBzbyB3ZSBjYW4gdGFsayB0byB0aGUKKyAgICAvLyBWaWV3TWFuYWdlciB0aHJvdWdoIHRoZSBDaGlsZFZpZXcuCisgICAgcHJpdmF0ZSBjbGFzcyBTdXJmYWNlVmlld1Byb3h5IGV4dGVuZHMgU3VyZmFjZVZpZXcKKyAgICAgICAgICAgIGltcGxlbWVudHMgU3VyZmFjZUhvbGRlci5DYWxsYmFjayB7CisgICAgICAgIHByaXZhdGUgZmluYWwgVmlld01hbmFnZXIuQ2hpbGRWaWV3IG1DaGlsZFZpZXc7CisgICAgICAgIHByaXZhdGUgaW50IG1Qb2ludGVyOworICAgICAgICBwcml2YXRlIGZpbmFsIGJvb2xlYW4gbUlzRml4ZWRTaXplOworICAgICAgICBTdXJmYWNlVmlld1Byb3h5KENvbnRleHQgY29udGV4dCwgVmlld01hbmFnZXIuQ2hpbGRWaWV3IGNoaWxkVmlldywKKyAgICAgICAgICAgICAgICBpbnQgcG9pbnRlciwgaW50IHBpeGVsRm9ybWF0LCBib29sZWFuIGlzRml4ZWRTaXplKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0KTsKKyAgICAgICAgICAgIHNldFdpbGxOb3REcmF3KGZhbHNlKTsgLy8gdGhpcyBwcmV2ZW50cyB0aGUgYmxhY2sgYm94IGFydGlmYWN0CisgICAgICAgICAgICBnZXRIb2xkZXIoKS5hZGRDYWxsYmFjayh0aGlzKTsKKyAgICAgICAgICAgIGdldEhvbGRlcigpLnNldEZvcm1hdChwaXhlbEZvcm1hdCk7CisgICAgICAgICAgICBtQ2hpbGRWaWV3ID0gY2hpbGRWaWV3OworICAgICAgICAgICAgbUNoaWxkVmlldy5tVmlldyA9IHRoaXM7CisgICAgICAgICAgICBtUG9pbnRlciA9IHBvaW50ZXI7CisgICAgICAgICAgICBtSXNGaXhlZFNpemUgPSBpc0ZpeGVkU2l6ZTsKKyAgICAgICAgfQorICAgICAgICB2b2lkIGRlc3Ryb3koKSB7CisgICAgICAgICAgICBtUG9pbnRlciA9IDA7CisgICAgICAgICAgICBtQ2hpbGRWaWV3LnJlbW92ZVZpZXcoKTsKKyAgICAgICAgfQorICAgICAgICB2b2lkIGF0dGFjaChpbnQgeCwgaW50IHksIGludCB3aWR0aCwgaW50IGhlaWdodCkgeworICAgICAgICAgICAgbUNoaWxkVmlldy5hdHRhY2hWaWV3KHgsIHksIHdpZHRoLCBoZWlnaHQpOworCisgICAgICAgICAgICBpZiAobUlzRml4ZWRTaXplKSB7CisgICAgICAgICAgICAgICAgZ2V0SG9sZGVyKCkuc2V0Rml4ZWRTaXplKHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gU3VyZmFjZUhvbGRlci5DYWxsYmFjayBtZXRob2RzCisgICAgICAgIHB1YmxpYyB2b2lkIHN1cmZhY2VDcmVhdGVkKFN1cmZhY2VIb2xkZXIgaG9sZGVyKSB7CisgICAgICAgICAgICBpZiAobVBvaW50ZXIgIT0gMCkgeworICAgICAgICAgICAgICAgIG5hdGl2ZVN1cmZhY2VDaGFuZ2VkKG1Qb2ludGVyLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgdm9pZCBzdXJmYWNlQ2hhbmdlZChTdXJmYWNlSG9sZGVyIGhvbGRlciwgaW50IGZvcm1hdCwgaW50IHdpZHRoLAorICAgICAgICAgICAgICAgIGludCBoZWlnaHQpIHsKKyAgICAgICAgICAgIGlmIChtUG9pbnRlciAhPSAwKSB7CisgICAgICAgICAgICAgICAgbmF0aXZlU3VyZmFjZUNoYW5nZWQobVBvaW50ZXIsIDEsIGZvcm1hdCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcHVibGljIHZvaWQgc3VyZmFjZURlc3Ryb3llZChTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworICAgICAgICAgICAgaWYgKG1Qb2ludGVyICE9IDApIHsKKyAgICAgICAgICAgICAgICBuYXRpdmVTdXJmYWNlQ2hhbmdlZChtUG9pbnRlciwgMiwgMCwgMCwgMCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBQbHVnaW5XaWRnZXQgZnVuY3Rpb25zIGZvciBtYWludGluZyBTdXJmYWNlVmlld3MgZm9yIHRoZSBTdXJmYWNlIGRyYXdpbmcKKyAgICAvLyBtb2RlbC4KKyAgICBwcml2YXRlIFN1cmZhY2VWaWV3IGNyZWF0ZVN1cmZhY2UoaW50IG5hdGl2ZVBvaW50ZXIsIGludCBwaXhlbEZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBpc0ZpeGVkU2l6ZSkgeworICAgICAgICBpZiAobVdlYlZpZXcgPT0gbnVsbCkgeworICAgICAgICAg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Q2FjaGVFbmNvZGluZ0NvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKQEAgLTIzMCw2ICsyNDAsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0xPQ0FUSU9OX0NPTCk7CiAgICAgICAgICAgICAgICAgbUNhY2hlQ29udGVudExlbmd0aENvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9DT05URU5UTEVOR1RIX0NPTCk7CisgICAgICAgICAgICAgICAgbUNhY2hlQ29udGVudERpc3Bvc2l0aW9uQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0NPTlRFTlRESVNQT1NJVElPTl9DT0wpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTMyMCwxMSArMzMyLDEyIEBACiAgICAgICAgICAgICAgICAgICAgICsgIiBURVhULCAiICsgQ0FDSEVfRklMRV9QQVRIX0NPTCArICIgVEVYVCwgIgogICAgICAgICAgICAgICAgICAgICArIENBQ0hFX0xBU1RfTU9ESUZZX0NPTCArICIgVEVYVCwgIiArIENBQ0hFX0VUQUdfQ09MCiAgICAgICAgICAgICAgICAgICAgICsgIiBURVhULCAiICsgQ0FDSEVfRVhQSVJFU19DT0wgKyAiIElOVEVHRVIsICIKKyAgICAgICAgICAgICAgICAgICAgKyBDQUNIRV9FWFBJUkVTX1NUUklOR19DT0wgKyAiIFRFWFQsICIKICAgICAgICAgICAgICAgICAgICAgKyBDQUNIRV9NSU1FVFlQRV9DT0wgKyAiIFRFWFQsICIgKyBDQUNIRV9FTkNPRElOR19DT0wKICAgICAgICAgICAgICAgICAgICAgKyAiIFRFWFQsIiArIENBQ0hFX0hUVFBfU1RBVFVTX0NPTCArICIgSU5URUdFUiwgIgogICAgICAgICAgICAgICAgICAgICArIENBQ0hFX0xPQ0FUSU9OX0NPTCArICIgVEVYVCwgIiArIENBQ0hFX0NPTlRFTlRMRU5HVEhfQ09MCi0gICAgICAgICAgICAgICAgICAgICsgIiBJTlRFR0VSLCAiICsgIiBVTklRVUUgKCIgKyBDQUNIRV9VUkxfQ09MCi0gICAgICAgICAgICAgICAgICAgICsgIikgT04gQ09ORkxJQ1QgUkVQTEFDRSk7Iik7CisgICAgICAgICAgICAgICAgICAgICsgIiBJTlRFR0VSLCAiICsgQ0FDSEVfQ09OVEVOVERJU1BPU0lUSU9OX0NPTCArICIgVEVYVCwgIgorICAgICAgICAgICAgICAgICAgICArICIgVU5JUVVFICgiICsgQ0FDSEVfVVJMX0NPTCArICIpIE9OIENPTkZMSUNUIFJFUExBQ0UpOyIpOwogICAgICAgICAgICAgbUNhY2hlRGF0YWJhc2UuZXhlY1NRTCgiQ1JFQVRFIElOREVYIGNhY2hlVXJsSW5kZXggT04gY2FjaGUgKCIKICAgICAgICAgICAgICAgICAgICAgKyBDQUNIRV9VUkxfQ09MICsgIikiKTsKICAgICAgICAgfQpAQCAtNTM3LDggKzU1MCw4IEBACiAgICAgICAgIH0KIAogICAgICAgICBDdXJzb3IgY3Vyc29yID0gbUNhY2hlRGF0YWJhc2UucmF3UXVlcnkoIlNFTEVDVCBmaWxlcGF0aCwgbGFzdG1vZGlmeSwgZXRhZywgZXhwaXJlcywgIgotICAgICAgICAgICAgICAgICAgICArICJtaW1ldHlwZSwgZW5jb2RpbmcsIGh0dHBzdGF0dXMsIGxvY2F0aW9uLCBjb250ZW50bGVuZ3RoICIKLSAgICAgICAgICAgICAgICAgICAgKyAiRlJPTSBjYWNoZSBXSEVSRSB1cmwgPSA/IiwKKyAgICAgICAgICAgICAgICAgICAgKyAiZXhwaXJlc3N0cmluZywgbWltZXR5cGUsIGVuY29kaW5nLCBodHRwc3RhdHVzLCBsb2NhdGlvbiwgY29udGVudGxlbmd0aCwgIgorICAgICAgICAgICAgICAgICAgICArICJjb250ZW50ZGlzcG9zaXRpb24gRlJPTSBjYWNoZSBXSEVSRSB1cmwgPSA/IiwKICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW10geyB1cmwgfSk7CiAKICAgICAgICAgdHJ5IHsKQEAgLTU0OCwxMSArNTYxLDEzIEBACiAgICAgICAgICAgICAgICAgcmV0Lmxhc3RNb2RpZmllZCA9IGN1cnNvci5nZXRTdHJpbmcoMSk7CiAgICAgICAgICAgICAgICAgcmV0LmV0YWcgPSBjdXJzb3IuZ2V0U3RyaW5nKDIpOwogICAgICAgICAgICAgICAgIHJldC5leHBpcmVzID0gY3Vyc29yLmdldExvbmcoMyk7Ci0gICAgICAgICAgICAgICAgcmV0Lm1pbWVUeXBlID0gY3Vyc29yLmdldFN0cmluZyg0KTsKLSAgICAgICAgICAgICAgICByZXQuZW5jb2RpbmcgPSBjdXJzb3IuZ2V0U3RyaW5nKDUpOwotICAgICAgICAgICAgICAgIHJldC5odHRwU3RhdHVzQ29kZSA9IGN1cnNvci5nZXRJbnQoNik7Ci0gICAgICAgICAgICAgICAgcmV0LmxvY2F0aW9uID0gY3Vyc29yLmdldFN0cmluZyg3KTsKLSAgICAgICAgICAgICAgICByZXQuY29udGVudExlbmd0aCA9IGN1cnNvci5nZXRMb25nKDgpOworICAgICAgICAgICAgICAgIHJldC5leHBpcmVzU3RyaW5nID0gY3Vyc29yLmdldFN0cmluZyg0KTsKKyAgICAgICAgICAgICAgICByZXQubWltZVR5cGUgPSBjdXJzb3IuZ2V0U3RyaW5nKDUpOworICAgICAgICAgICAgICAgIHJldC5lbmNvZGluZyA9IGN1cnNvci5nZXRTdHJpbmcoNik7CisgICAgICAgICAgICAgICAgcmV0Lmh0dHBTdGF0dXNDb2RlID0gY3Vyc29yLmdldEludCg3KTsKKyAgICAgICAgICAgICAgICByZXQubG9jYXRpb24gPSBjdXJzb3IuZ2V0U3RyaW5nKDgpOworICAgICAgICAgICAgICAgIHJldC5jb250ZW50TGVuZ3RoID0gY3Vyc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lZCgpOwotCi0gICAgLy8gaW5uZXIgY2xhc3NlcwotCi0gICAgLyoqCi0gICAgICogSW1wbGVtZW50cyB0aGUgaHR0cCByZXF1ZXN0Ci0gICAgICovCi0gICAgY2xhc3MgQ29ubmVjdGlvbiBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKLSAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgewotICAgICAgICAgICAgYm9vbGVhbiBwcm9ibGVtID0gZmFsc2U7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgIlJFUVVFU1QgOiAiICsgbU1ldGhvZC5nZXRSZXF1ZXN0TGluZSgpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbVJlc3BvbnNlID0gbUNsaWVudC5leGVjdXRlKG1NZXRob2QpOwotICAgICAgICAgICAgICAgIGlmIChtUmVzcG9uc2UgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAicmVzcG9uc2UgKHN0YXR1cyBsaW5lKTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtUmVzcG9uc2UuZ2V0U3RhdHVzTGluZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtUmVzcG9uc2VMaW5lID0gIiIgKyBtUmVzcG9uc2UuZ2V0U3RhdHVzTGluZSgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJwcm9ibGVtLCByZXNwb25zZSA9PSBudWxsIik7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcHJvYmxlbSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJDb25uZWN0aW9uIElPIGV4Y2VwdGlvbiAiLCBlKTsKLSAgICAgICAgICAgICAgICBwcm9ibGVtID0gdHJ1ZTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJDb25uZWN0aW9uIHJ1bnRpbWUgZXhjZXB0aW9uICIsIGUpOwotICAgICAgICAgICAgICAgIHByb2JsZW0gPSB0cnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIXByb2JsZW0pIHsKLSAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJSZXF1ZXN0IGNvbXBsZXRlICgiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICsgbU1ldGhvZC5nZXRSZXF1ZXN0TGluZSgpICsgIikiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uRmFpbGVkTG9jay5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgbUNvbm5lY3Rpb25GYWlsZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uRmFpbGVkTG9jay51bmxvY2soKTsKLSAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJSZXF1ZXN0IEZBSUxFRCAoIgotICAgICAgICAgICAgICAgICAgICAgICAgICArIG1NZXRob2QuZ2V0UmVxdWVzdExpbmUoKSArICIpIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIFdlIGFib3J0IHRoZSBleGVjdXRpb24gaW4gb3JkZXIgdG8gc2h1dGRvd24gYW5kIHJlbGVhc2UKLSAgICAgICAgICAgICAgICAvLyB0aGUgdW5kZXJseWluZyBjb25uZWN0aW9uCi0gICAgICAgICAgICAgICAgbU1ldGhvZC5hYm9ydCgpOwotICAgICAgICAgICAgICAgIGlmIChtUG9zdEVudGl0eSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZXJlIGlzIGEgcG9zdCBlbnRpdHksIHdlIG5lZWQgdG8gd2FrZSBpdCB1cCBmcm9tCi0gICAgICAgICAgICAgICAgICAgIC8vIGEgcG90ZW50aWFsIGRlYWRsb2NrCi0gICAgICAgICAgICAgICAgICAgIG1Qb3N0RW50aXR5LnNpZ25hbE91dHB1dFN0cmVhbSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIHNpbXBsZSBidWZmZXIgY2xhc3MgaW1wbGVtZW50aW5nIGEgcHJvZHVjZXIvY29uc3VtZXIgbW9kZWwKLSAgICAgKi8KLSAgICBjbGFzcyBCdWZmZXIgewotICAgICAgICBwcml2YXRlIERhdGFQYWNrZXQgbVBhY2tldDsKLSAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1FbXB0eSA9IHRydWU7Ci0gICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBwdXQoRGF0YVBhY2tldCBwYWNrZXQpIHsKLSAgICAgICAgICAgIHdoaWxlICghbUVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgd2FpdCgpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgIkludGVycnVwdGVkRXhjZXB0aW9uIHdoaWxlIHB1dHRpbmcgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgImEgRGF0YVBhY2tldCBpbiB0aGUgQnVmZmVyOiAiICsgZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtUGFja2V0ID0gcGFja2V0OwotICAgICAgICAgICAgbUVtcHR5ID0gZmFsc2U7Ci0gICAgICAgICAgICBub3RpZnkoKTsKLSAgICAgICAgfQotICAgICAgICBwdWJsaWMgc3luY2hyb25pemVkIERhdGFQYWNrZXQgZ2V0KCkgewotICAgICAgICAgICAgd2hpbGUgKG1FbXB0eSkgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHdhaXQoKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiSW50ZXJydXB0ZWRFeGNlcHRpb24gd2hpbGUgZ2V0dGluZyAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgImEgRGF0YVBhY2tldCBpbiB0aGUgQnVmZmVyOiAiICsgZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtRW1wdHkgPSB0cnVlOwotICAgICAgICAgICAgbm90aWZ5KCk7Ci0gICAgICAgICAgICByZXR1cm4gbVBhY2tldDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIHV0aWxpdHkgY2xhc3MgdXNlZCB0byBibG9jayB1bnRpbCB0aGUgcGFja2V0IGlzIHNpZ25hbGVkIGFzIGJlaW5nCi0gICAgICogY29uc3VtZWQKLSAgICAgKi8KLSAgICBjbGFzcyBTaWduYWxDb25zdW1lZCB7Ci0gICAgICAgIHByaXZhdGUgYm9vbGVhbiBtQ29uc3VtZWQgPSBmYWxzZTsKLSAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHdhaXRVbnRpbFBhY2tldENvbnN1bWVkKCkgewotICAgICAgICAgICAgd2hpbGUgKCFtQ29uc3VtZWQpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICB3YWl0KCk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiSW50ZXJydXB0ZWRFeGNlcHRpb24gd2hpbGUgd2FpdGluZyAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAidW50aWwgYSBEYXRhUGFja2V0IGlzIGNvbnN1bWVkOiAiICsgZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQ29uc3VtZWQgPSBmYWxzZTsKLSAgICAgICAgICAgIG5vdGlmeSgpOwotICAgICAgICB9Ci0gICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBwYWNrZXRDb25zdW1lZCgpIHsKLSAgICAgICAgICAgIHdoaWxlIChtQ29uc3VtZWQpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICB3YWl0KCk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiSW50ZXJydXB0ZWRFeGNlcHRpb24gd2hpbGUgaW5kaWNhdGluZyAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJ0aGF0IHRoZSBEYXRhUGFja2V0IGhhcyBiZWVuIGNvbnN1bWVkOiAiICsgZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQ29uc3VtZWQgPSB0cnVlOwotICAgICAgICAgICAgbm90aWZ5KCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBVdGlsaXR5IGNsYXNzIGVuY2Fwc3VsYXRpbmcgYSBwYWNrZXQgb2YgZGF0YQotICAgICAqLwotICAgIGNsYXNzIERhdGFQYWNrZXQgewotICAgICAgICBwcml2YXRlIGJ5dGVbXSBtQ29udGVudDsKLSAgICAgICAgcHJpdmF0ZSBpbnQgbUxlbmd0aDsKLSAgICAgICAgcHVibGljIERhdGFQYWNrZXQoYnl0ZVtdIGNvbnRlbnQsIGludCBsZW5ndGgpIHsKLSAgICAgICAgICAgIG1Db250ZW50ID0gY29udGVudDsKLSAgICAgICAgICAgIG1MZW5ndGggPSBsZW5ndGg7Ci0gICAgICAgIH0KLSAgICAgICAgcHVibGljIGJ5dGVbXSBnZXRCeXRlcygpIHsKLSAgICAgICAgICAgIHJldHVybiBtQ29udGVudDsKLSAgICAgICAgfQotICAgICAgICBwdWJsaWMgaW50IGdldExlbmd0aCgpIHsKLSAgICAgICAgICAgIHJldHVybiBtTGVuZ3RoOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogSHR0cEVudGl0eSBjbGFzcyB0byB3cml0ZSB0aGUgYnl0ZXMgcmVjZWl2ZWQgYnkgdGhlIEMrKyB0aHJlYWQKLSAgICAgKiBvbiB0aGUgY29ubmVjdGlvbiBvdXRwdXRzdH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bnRlbnRMZW5ndGg7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgSGVhZGVyIGdldENvbnRlbnRUeXBlKCkgewotICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgSGVhZGVyIGdldENvbnRlbnRFbmNvZGluZygpIHsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIElucHV0U3RyZWFtIGdldENvbnRlbnQoKSB0aHJvd3MgSU9FeGNlcHRpb24gewotICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCB3cml0ZVRvKGZpbmFsIE91dHB1dFN0cmVhbSBvdXQpIHRocm93cyBJT0V4Y2VwdGlvbiB7Ci0gICAgICAgICAgICAvLyBXZSBzaWduYWwgdGhhdCB0aGUgb3V0cHV0c3RyZWFtIGlzIGF2YWlsYWJsZQotICAgICAgICAgICAgbVN0cmVhbWluZ1JlYWR5TG9jay5sb2NrKCk7Ci0gICAgICAgICAgICBtT3V0cHV0U3RyZWFtID0gb3V0OwotICAgICAgICAgICAgbVN0cmVhbWluZ1JlYWR5LnNpZ25hbCgpOwotICAgICAgICAgICAgbVN0cmVhbWluZ1JlYWR5TG9jay51bmxvY2soKTsKLQotICAgICAgICAgICAgLy8gV2UgdGhlbiBsb29wIHdhaXRpbmcgb24gbWVzc2FnZXMgdG8gcHJvY2Vzcy4KLSAgICAgICAgICAgIGJvb2xlYW4gZmluaXNoZWQgPSBmYWxzZTsKLSAgICAgICAgICAgIHdoaWxlICghZmluaXNoZWQpIHsKLSAgICAgICAgICAgICAgICBEYXRhUGFja2V0IHBhY2tldCA9IG1CdWZmZXIuZ2V0KCk7Ci0gICAgICAgICAgICAgICAgaWYgKHBhY2tldCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmlzaGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB3cml0ZShwYWNrZXQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtU2lnbmFsLnBhY2tldENvbnN1bWVkKCk7Ci0gICAgICAgICAgICAgICAgbUNvbm5lY3Rpb25GYWlsZWRMb2NrLmxvY2soKTsKLSAgICAgICAgICAgICAgICBpZiAobUNvbm5lY3Rpb25GYWlsZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgInN0b3BwaW5nIGxvb3Agb24gZXJyb3IiKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5pc2hlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uRmFpbGVkTG9jay51bmxvY2soKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiZmx1c2hpbmcgdGhlIG91dHB1dHN0cmVhbS4uLiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbU91dHB1dFN0cmVhbS5mbHVzaCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGJvb2xlYW4gaXNTdHJlYW1pbmcoKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIGNvbnN1bWVDb250ZW50KCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKLSAgICAgICAgICAgIC8vIE5vdGhpbmcgdG8gcmVsZWFzZQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gbG9jYWwgbWV0aG9kcwotCi0gICAgICAgIHByaXZhdGUgdm9pZCB3cml0ZShEYXRhUGFja2V0IHBhY2tldCkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBpZiAobU91dHB1dFN0cmVhbSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJOTyBPVVRQVVQgU1RSRUFNICEhISIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbU91dHB1dFN0cmVhbS53cml0ZShwYWNrZXQuZ2V0Qnl0ZXMoKSwgMCwgcGFja2V0LmdldExlbmd0aCgpKTsKLSAgICAgICAgICAgICAgICBtT3V0cHV0U3RyZWFtLmZsdXNoKCk7Ci0gICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiZXhjOiAiICsgZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uRmFpbGVkTG9jay5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgbUNvbm5lY3Rpb25GYWlsZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uRmFpbGVkTG9jay51bmxvY2soKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzUmVhZHkoKSB7Ci0gICAgICAgICAgICBtU3RyZWFtaW5nUmVhZHlMb2NrLmxvY2soKTsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1PdXRwdXRTdHJlYW0gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtU3RyZWFtaW5nUmVhZHkuYXdhaXQoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiSW50ZXJydXB0ZWRFeGNlcHRpb24gaW4gIgotICAgICAgICAgICAgICAgICAgICAgICAgICArICJTdHJlYW1FbnRpdHk6OmlzUmVhZHkoKSA6ICIsIGUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgbVN0cmVhbWluZ1JlYWR5TG9jay51bmxvY2soKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtT3V0cHV0U3RyZWFtID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNpZ25hbE91dHB1dFN0cmVhbSgpIHsKLSAgICAgICAgICAgIG1TdHJlYW1pbmdSZWFkeUxvY2subG9jaygpOwotICAgICAgICAgICAgbVN0cmVhbWluZ1JlYWR5LnNpZ25hbCgpOwotICAgICAgICAgICAgbVN0cmVhbWluZ1JlYWR5TG9jay51bmxvY2soKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIEluaXRpYWxpemUgbUJyaWRnZVRocmVhZCB1c2luZyB0aGUgVExTIHZhbHVlIG9mCi0gICAgICogVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS4gQ2FsbGVkIG9uIHN0YXJ0IHVwIG9mIHRoZSBuYXRpdmUgY2hpbGQKLSAgICAgKiB0aHJlYWQuCi0gICAgICovCi0gICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIGluaXRDaGlsZFRocmVhZCgpIHsK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yBzeW5jaHJvbml6ZWQgU3RyaW5nIGdldFJlc3BvbnNlTGluZSgpIHsKLSAgICAgICAgcmV0dXJuIG1SZXNwb25zZUxpbmU7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogV2FpdCBmb3IgdGhlIHJlcXVlc3QgdGhyZWFkIGNvbXBsZXRpb24KLSAgICAgKiAodW5sZXNzIGFscmVhZHkgZmluaXNoZWQpCi0gICAgICovCi0gICAgcHJpdmF0ZSB2b2lkIHdhaXRVbnRpbENvbm5lY3Rpb25GaW5pc2hlZCgpIHsKLSAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgIndhaXRVbnRpbENvbm5lY3Rpb25GaW5pc2hlZCgiCi0gICAgICAgICAgICAgICAgICArIG1Db25uZWN0aW9uRmluaXNoZWQgKyAiKSIpOwotICAgICAgICB9Ci0gICAgICAgIGlmICghbUNvbm5lY3Rpb25GaW5pc2hlZCkgewotICAgICAgICAgICAgaWYgKG1IdHRwVGhyZWFkICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBtSHR0cFRocmVhZC5qb2luKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uRmluaXNoZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBpZiAoTE9HVl9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiaHR0cCB0aHJlYWQgam9pbmVkIik7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJpbnRlcnJ1cHRlZDogIiArIGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiPj4+IFRyeWluZyB0byBqb2luIG9uIG1IdHRwVGhyZWFkICIgKwotICAgICAgICAgICAgICAgICAgICAgICJ3aGVuIGl0IGRvZXMgbm90IGV4aXN0ISIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gSGVhZGVycyBoYW5kbGluZwotCi0gICAgLyoqCi0gICAgICogUmVjZWl2ZSBhbGwgaGVhZGVycyBmcm9tIHRoZSBzZXJ2ZXIgYW5kIHBvcHVsYXRlCi0gICAgICogbVJlc3BvbnNlSGVhZGVycy4KLSAgICAgKiBAcmV0dXJuIFRydWUgaWYgaGVhZGVycyBhcmUgc3VjY2Vzc2Z1bGx5IHJlY2VpdmVkLCBGYWxzZSBvbgotICAgICAqICAgICAgICAgY29ubmVjdGlvbiBlcnJvci4KLSAgICAgKi8KLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gcGFyc2VIZWFkZXJzKCkgewotICAgICAgICBtQ29ubmVjdGlvbkZhaWxlZExvY2subG9jaygpOwotICAgICAgICBpZiAobUNvbm5lY3Rpb25GYWlsZWQpIHsKLSAgICAgICAgICAgIG1Db25uZWN0aW9uRmFpbGVkTG9jay51bmxvY2soKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotICAgICAgICBtQ29ubmVjdGlvbkZhaWxlZExvY2sudW5sb2NrKCk7Ci0gICAgICAgIHdhaXRVbnRpbENvbm5lY3Rpb25GaW5pc2hlZCgpOwotICAgICAgICBtUmVzcG9uc2VIZWFkZXJzID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBTdHJpbmdbXT4oKTsKLSAgICAgICAgaWYgKG1SZXNwb25zZSA9PSBudWxsKQotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotCi0gICAgICAgIE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GUgcmVzcG9uc2UgaGVhZGVyLCBub24tbnVsbCwgY2FzZS1pbnNlbnNpdGl2ZS4KLSAgICAgKiBAcmV0dXJuIFRoZSB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggdGhlIHJlc3BvbnNlIGhlYWRlciwgb3IgbnVsbCBpZgotICAgICAqICAgICAgICAgbm90IHNldCBvciBlcnJvci4KLSAgICAgKi8KLSAgICBwdWJsaWMgc3luY2hyb25pemVkIFN0cmluZyBnZXRSZXNwb25zZUhlYWRlcihTdHJpbmcgbmFtZSkgewotICAgICAgICBpZiAobVJlc3BvbnNlSGVhZGVycyAhPSBudWxsKSB7Ci0gICAgICAgICAgICBTdHJpbmdbXSB2YWx1ZSA9IG1SZXNwb25zZUhlYWRlcnMuZ2V0KG5hbWUudG9Mb3dlckNhc2UoKSk7Ci0gICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZVtIRUFERVJTX01BUF9JTkRFWF9WQUxVRV07Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJnZXRSZXNwb25zZUhlYWRlcigpIGNhbGxlZCBidXQgIgotICAgICAgICAgICAgICAgICAgICAgICsgInJlc3BvbnNlIG5vdCByZWNlaXZlZCIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBSZXR1cm4gYWxsIHJlc3BvbnNlIGhlYWRlcnMsIHNlcGFyYXRlZCBieSBDUi1MRiBsaW5lIGVuZGluZ3MsIGFuZAotICAgICAqIGVuZGluZyB3aXRoIGEgdHJhaWxpbmcgYmxhbmsgbGluZS4gVGhpcy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FsaWZpZWQgVVJMLgotICAgICAqIEByZXR1cm4gQSBzdHJpbmcgY29udGFpbmluZyB0aGUgY29va2llIGZvciB0aGUgVVJMIGlmIGl0IGV4aXN0cywKLSAgICAgKiAgICAgICAgIG9yIG51bGwgaWYgbm90LgotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGdldENvb2tpZUZvclVybChTdHJpbmcgdXJsKSB7Ci0gICAgICAgIC8vIEdldCB0aGUgY29va2llIGZvciB0aGlzIFVSTCwgc2V0IGFzIGEgaGVhZGVyCi0gICAgICAgIHJldHVybiBDb29raWVNYW5hZ2VyLmdldEluc3RhbmNlKCkuZ2V0Q29va2llKHVybCk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogU2V0IHRoZSBjb29raWUgZm9yIHRoZSBnaXZlbiBVUkwuCi0gICAgICogQHBhcmFtIHVybCAgICBUaGUgZnVsbHkgcXVhbGlmaWVkIFVSTC4KLSAgICAgKiBAcGFyYW0gY29va2llIFRoZSBuZXcgY29va2llIHZhbHVlLgotICAgICAqIEByZXR1cm4gQSBzdHJpbmcgY29udGFpbmluZyB0aGUgY29va2llIGZvciB0aGUgVVJMIGlmIGl0IGV4aXN0cywKLSAgICAgKiAgICAgICAgIG9yIG51bGwgaWYgbm90LgotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzZXRDb29raWVGb3JVcmwoU3RyaW5nIHVybCwgU3RyaW5nIGNvb2tpZSkgewotICAgICAgICAvLyBHZXQgdGhlIGNvb2tpZSBmb3IgdGhpcyBVUkwsIHNldCBhcyBhIGhlYWRlcgotICAgICAgICBDb29raWVNYW5hZ2VyLmdldEluc3RhbmNlKCkuc2V0Q29va2llKHVybCwgY29va2llKTsKLSAgICB9Ci0KLSAgICAvLyBDYWNoZSBoYW5kbGluZwotCi0gICAgLyoqCi0gICAgICogUGVyZm9ybSBhIHJlcXVlc3QgdXNpbmcgTG9jYWxTZXJ2ZXIgaWYgcG9zc2libGUuIE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gICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJTYXZpbmcgaW50byBjYWNoZSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUNhY2hlUmVzdWx0LnNldEVuY29kaW5nKGVuY29kaW5nKTsKLSAgICAgICAgICAgIG1DYWNoZVJlc3VsdFVybCA9IHVybDsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKExPR1ZfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJDb3VsZG4ndCBjcmVhdGUgbUNhY2hlUmVzdWx0Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBBZGQgZGF0YSBmcm9tIHRoZSByZXNwb25zZSBib2R5IHRvIHRoZSBDYWNoZVJlc3VsdCBjcmVhdGVkIHdpdGgKLSAgICAgKiBjcmVhdGVDYWNoZVJlc3VsdCgpLgotICAgICAqIEBwYXJhbSBkYXRhICBBIGJ5dGUgYXJyYXkgb2YgdGhlIG5leHQgc2VxdWVudGlhbCBieXRlcyBpbiB0aGUKLSAgICAgKiAgICAgICAgICAgICAgcmVzcG9uc2UgYm9keS4KLSAgICAgKiBAcGFyYW0gYnl0ZXMgVGhlIG51bWJlciBvZiBieXRlcyB0byB3cml0ZSBmcm9tIHRoZSBzdGFydCBvZgotICAgICAqICAgICAgICAgICAgICB0aGUgYXJyYXkuCi0gICAgICogQHJldHVybiBUcnVlIGlmIGFsbCBieXRlcyBzdWNjZXNzZnVsbHkgd3JpdHRlbiwgZmFsc2Ugb24gZmFpbHVyZS4KLSAgICAgKi8KLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gYXBwZW5kQ2FjaGVSZXN1bHQoYnl0ZVtdIGRhdGEsIGludCBieXRlcykgewotICAgICAgICBpZiAobUNhY2hlUmVz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IExvZy5pKExPR19UQUcsICJGYWlsZWQgdG8gY29ubmVjdCBJbnB1dFN0cmVhbTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICArIGlucHV0RXhjZXB0aW9uKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLy8gTm90IHVuZXhwZWN0ZWQuIEZvciBleGFtcGxlLCA0MDQgcmVzcG9uc2UgcmV0dXJuIGhlYWRlcnMsCi0gICAgICAgICAgICAgICAgLy8gYW5kIHNvbWV0aW1lcyBhIGJvZHkgd2l0aCBhIGRldGFpbGVkIGVycm9yLgotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1Cb2R5SW5wdXRTdHJlYW0gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIE5vIGVycm9yIHN0cmVhbSBlaXRoZXIuIFRyZWF0IGFzIGEgMCBieXRlIHJlc3BvbnNlLgotICAgICAgICAgICAgICAgIGlmIChMT0dWX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgIk5vIElucHV0U3RyZWFtIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiAwOyAvLyBFT0YuCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaW50IHJldDsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGludCBnb3QgPSBtQm9keUlucHV0U3RyZWFtLnJlYWQoYnVmKTsKLSAgICAgICAgICAgIGlmIChnb3QgPiAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gR290IHNvbWUgYnl0ZXMsIG5vdCBFT0YuCi0gICAgICAgICAgICAgICAgcmV0ID0gZ290OwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBFT0YuCi0gICAgICAgICAgICAgICAgbUJvZHlJbnB1dFN0cmVhbS5jbG9zZSgpOwotICAgICAgICAgICAgICAgIHJldCA9IDA7Ci0gICAgICAgICA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ibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgKChUcmFuc2l0aW9uRHJhd2FibGUpIGQpLnN0YXJ0VHJhbnNpdGlvbihWaWV3Q29uZmlndXJhdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRMb25nUHJlc3NUaW1lb3V0KCkpOworICAgICAgICAgICAgICAgICAgICAoKFRyYW5zaXRpb25EcmF3YWJsZSkgZCkuc3RhcnRUcmFuc2l0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdDb25maWd1cmF0aW9uLmdldExvbmdQcmVzc1RpbWVvdXQoKSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgKChUcmFuc2l0aW9uRHJhd2FibGUpIGQpLnJlc2V0VHJhbnNpdGlvbigpOwogICAgICAgICAgICAgICAgIH0KQEAgLTE3MzIsMTggKzE3MzcsMjkgQEAKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvbktleURvd24oaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50KSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBvbktleVVwKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgewogICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSOgogICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6Ci0gICAgICAgICAgICBpZiAoaXNQcmVzc2VkKCkgJiYgbVNlbGVjdGVkUG9zaXRpb24gPj0gMCAmJiBtQWRhcHRlciAhPSBudWxsICYmCisgICAgICAgICAgICBpZiAoIWlzRW5hYmxlZCgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoaXNDbGlja2FibGUoKSAmJiBpc1ByZXNzZWQoKSAmJgorICAgICAgICAgICAgICAgICAgICBtU2VsZWN0ZWRQb3NpdGlvbiA+PSAwICYmIG1BZGFwdGVyICE9IG51bGwgJiYKICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdGVkUG9zaXRpb24gPCBtQWRhcHRlci5nZXRDb3VudCgpKSB7CisKICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IHZpZXcgPSBnZXRDaGlsZEF0KG1TZWxlY3RlZFBvc2l0aW9uIC0gbUZpcnN0UG9zaXRpb24pOwogICAgICAgICAgICAgICAgIHBlcmZvcm1JdGVtQ2xpY2sodmlldywgbVNlbGVjdGVkUG9zaXRpb24sIG1TZWxlY3RlZFJvd0lkKTsKICAgICAgICAgICAgICAgICBzZXRQcmVzc2VkKGZhbHNlKTsKICAgICAgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsKSB2aWV3LnNldFByZXNzZWQoZmFsc2UpOwogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHN1cGVyLm9uS2V5VXAoa2V5Q29kZSwgZXZlbnQpOwogICAgIH0KQEAgLTE4OTIsNiArMTkwOCwxMiBAQAogCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaEV2ZW50KE1vdGlvbkV2ZW50IGV2KSB7CisgICAgICAgIGlmICghaXNFbmFibGVkKCkpIHsKKyAgICAgICAgICAgIC8vIEEgZGlzYWJsZWQgdmlldyB0aGF0IGlzIGNsaWNrYWJsZSBzdGlsbCBjb25zdW1lcyB0aGUgdG91Y2gKKyAgICAgICAgICAgIC8vIGV2ZW50cywgaXQganVzdCBkb2Vzbid0IHJlc3BvbmQgdG8gdGhlbS4KKyAgICAgICAgICAgIHJldHVybiBpc0NsaWNrYWJsZSgpIHx8IGlzTG9uZ0NsaWNrYWJsZSgpOworICAgICAgICB9CisKICAgICAgICAgaWYgKG1GYXN0U2Nyb2xsZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgYm9vbGVhbiBpbnRlcmNlcHRlZCA9IG1GYXN0U2Nyb2xsZXIub25Ub3VjaEV2ZW50KGV2KTsKICAgICAgICAgICAgIGlmIChpbnRlcmNlcHRlZCkgewpAQCAtMTk3NCw3ICsxOTk2LDEwIEBACiAgICAgICAgICAgICAgICAgaWYgKHkgIT0gbUxhc3RZKSB7CiAgICAgICAgICAgICAgICAgICAgIGRlbHRhWSAtPSBtTW90aW9uQ29ycmVjdGlvbjsKICAgICAgICAgICAgICAgICAgICAgaW50IGluY3JlbWVudGFsRGVsdGFZID0gbUxhc3RZICE9IEludGVnZXIuTUlOX1ZBTFVFID8geSAtIG1MYXN0WSA6IGRlbHRhWTsKLSAgICAgICAgICAgICAgICAgICAgdHJhY2tNb3Rpb25TY3JvbGwoZGVsdGFZLCBpbmNyZW1lbnRhbERlbHRhWSk7CisgICAgICAgICAgICAgICAgICAgIC8vIE5vIG5lZWQgdG8gZG8gYWxsIHRoaXMgd29yayBpZiB3ZSdyZSBub3QgZ29pbmcgdG8gbW92ZSBhbnl3YXkKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluY3JlbWVudGFsRGVsdGFZICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrTW90aW9uU2Nyb2xsKGRlbHRhWSwgaW5jcmVtZW50YWxEZWx0YVkpOworICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgdG8gc2VlIGlmIHdlIGhhdmUgYnVtcGVkIGludG8gdGhlIHNjcm9sbCBsaW1pdAogICAgICAgICAgICAgICAgICAgICBWaWV3IG1vdGlvblZpZXcgPSB0aGlzLmdldENoaWxkQXQobU1vdGlvblBvc2l0aW9uIC0gbUZpcnN0UG9zaXRpb24pOwpAQCAtMjA0MSw3ICsyMDY2LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVNlbGVjdG9yICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRHJhd2FibGUgZCA9IG1TZWxlY3Rvci5nZXRDdXJyZW50KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkICE9IG51bGwgJiYgZCBpbnN0YW5jZW9mIFRyYW5zaXRpb25EcmF3YWJsZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChUcmFuc2l0aW9uRHJhd2FibGUpZCkucmVzZXRUcmFuc2l0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFRyYW5zaXRpb25EcmF3YWJsZSkgZCkucmVzZXRUcmFuc2l0aW9uKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zdERlbGF5ZWQobmV3IFJ1bm5hYmxlKCkgewpAQCAtMjA2NSwxNSArMjA5MCwyNyBAQAogICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX1JFU1Q7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIFRPVUNIX01PREVfU0NST0xMOgotICAgICAgICAgICAgICAgIGZpbmFsIFZlbG9jaXR5VHJhY2tlciB2ZWxvY2l0eVRyYWNrZXIgPSBtVmVsb2NpdHlUcmFja2VyOwotICAgICAgICAgICAgICAgIHZlbG9jaXR5VHJhY2tlci5jb21wdXRlQ3VycmVudFZlbG9jaXR5KDEwMDAsIG1NYXhpbXVtVmVsb2NpdHkpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBpbml0aWFsVmVsb2NpdHkgPSAoaW50KSB2ZWxvY2l0eVRyYWNrZXIuZ2V0WVZlbG9jaXR5KCk7Ci0gICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKGluaXRpYWxWZWxvY2l0eSkgPiBtTWluaW11bVZlbG9jaXR5ICYmIChnZXRDaGlsZENvdW50KCkgPiAwKSkgewotICAgICAgICAgICAgICAgICAgICBpZiAobUZsaW5nUnVubmFibGUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZsaW5nUnVubmFibGUgPSBuZXcgRmxpbmdSdW5uYWJsZSgpOworICAgICAgICAgICAgICAgIGZpbmFsIGludCBjaGlsZENvdW50ID0gZ2V0Q2hpbGRDb3VudCgpOworICAgICAgICAgICAgICAgIGlmIChjaGlsZENvdW50ID4gMCkgeworICAgICAgICAgICAgICAgICAgICBpZiAobUZpcnN0UG9zaXRpb24gPT0gMCAmJiBnZXRDaGlsZEF0KDApLmdldFRvcCgpID49IG1MaXN0UGFkZGluZy50b3AgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmlyc3RQb3NpdGlvbiArIGNoaWxkQ291bnQgPCBtSXRlbUNvdW50ICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q2hpbGRBdChjaGlsZENvdW50IC0gMSkuZ2V0Qm90dG9tKCkgPD0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldEhlaWdodCgpIC0gbUxpc3RQYWRkaW5nLmJvdHRvbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX01PREVfUkVTVDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydFNjcm9sbFN0YXRlQ2hhbmdlKE9uU2Nyb2xsTGlzdGVuZXIuU0NST0xMX1NUQVRFX0lETEUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgVmVsb2NpdHlUcmFja2VyIHZlbG9jaXR5VHJhY2tlciA9IG1WZWxvY2l0eVRyYWNrZXI7CisgICAgICAgICAgICAgICAgICAgICAgICB2ZWxvY2l0eVRyYWNrZXIuY29tcHV0ZUN1cnJlbnRWZWxvY2l0eSgxMDAwLCBtTWF4aW11bVZlbG9jaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBpbml0aWFsVmVsb2NpdHkgPSAoaW50KSB2ZWxvY2l0eVRyYWNrZXIuZ2V0WVZlbG9jaXR5KCk7CisgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMoaW5pdGlhbFZlbG9jaXR5KSA+IG1NaW5pbXVtVmVsb2NpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUZsaW5nUnVubmFibGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmxpbmdSdW5uYWJsZSA9IG5ldyBGbGluZ1J1bm5hYmxlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydFNjcm9sbFN0YXRlQ2hhbmdlKE9uU2Nyb2xsTGlzdGVuZXIuU0NST0xMX1NUQVRFX0ZMSU5HKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmxpbmdSdW5uYWJsZS5zdGFydCgtaW5pdGlhbFZlbG9jaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXBvcnRTY3JvbGxTdGF0ZUNoYW5nZShPblNjcm9sbExpc3RlbmVyLlNDUk9MTF9TVEFURV9GTElORyk7Ci0gICAgICAgICAgICAgICAgICAgIG1GbGluZ1J1bm5hYmxlLnN0YXJ0KC1pbml0aWFsVmVsb2NpdHkpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9NT0RFX1JFU1Q7CiAgICAgICAgICAgICAgICAgICAgIH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GVyLiBCYXNpY2FsbHkKICAgICAgKiAgICAgICAgY2hhcmFjdGVycyBpbiB0aGUgYWxwaGFiZXQgd2lsbCBzaG93IHVwIGFzIHByZXZpZXcgbGV0dGVycy4KQEAgLTEwNCw3ICsxMDQsNyBAQAogICAgIHB1YmxpYyBPYmplY3RbXSBnZXRTZWN0aW9ucygpIHsKICAgICAgICAgcmV0dXJuIG1BbHBoYWJldEFycmF5OwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFNldHMgYSBuZXcgY3Vyc29yIGFzIHRoZSBkYXRhIHNldCBhbmQgcmVzZXRzIHRoZSBjYWNoZSBvZiBpbmRpY2VzLgogICAgICAqIEBwYXJhbSBjdXJzb3IgdGhlIG5ldyBjdXJzb3IgdG8gdXNlIGFzIHRoZSBkYXRhIHNldApAQCAtMTI0LDkgKzEyNCwxNiBAQAogICAgICAqIERlZmF1bHQgaW1wbGVtZW50YXRpb24gY29tcGFyZXMgdGhlIGZpcnN0IGNoYXJhY3RlciBvZiB3b3JkIHdpdGggbGV0dGVyLgogICAgICAqLwogICAgIHByb3RlY3RlZCBpbnQgY29tcGFyZShTdHJpbmcgd29yZCwgU3RyaW5nIGxldHRlcikgewotICAgICAgICByZXR1cm4gbUNvbGxhdG9yLmNvbXBhcmUod29yZC5zdWJzdHJpbmcoMCwgMSksIGxldHRlcik7CisgICAgICAgIGZpbmFsIFN0cmluZyBmaXJzdExldHRlcjsKKyAgICAgICAgaWYgKHdvcmQubGVuZ3RoKCkgPT0gMCkgeworICAgICAgICAgICAgZmlyc3RMZXR0ZXIgPSAiICI7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmaXJzdExldHRlciA9IHdvcmQuc3Vic3RyaW5nKDAsIDEpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG1Db2xsYXRvci5jb21wYXJlKGZpcnN0TGV0dGVyLCBsZXR0ZXIpOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFBlcmZvcm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GVyKTsKICAgICAgICAgICAgIGlmIChkaWZmICE9IDApIHsKLSAgICAgICAgICAgICAgICAvLyBDb21tZW50aW5nIG91dCBhcHByb3hpbWF0aW9uIGNvZGUgYmVjYXVzZSBpdCBkb2Vzbid0IHdvcmsgZm9yIGNlcnRhaW4gCisgICAgICAgICAgICAgICAgLy8gVE9ETzogQ29tbWVudGluZyBvdXQgYXBwcm94aW1hdGlvbiBjb2RlIGJlY2F1c2UgaXQgZG9lc24ndCB3b3JrIGZvciBjZXJ0YWluCiAgICAgICAgICAgICAgICAgLy8gbGlzdHMgd2l0aCBjdXN0b20gY29tcGFyYXRvcnMKICAgICAgICAgICAgICAgICAvLyBFbnRlciBhcHByb3hpbWF0aW9uIGluIGhhc2ggaWYgYSBiZXR0ZXIgc29sdXRpb24gZG9lc24ndCBleGlzdAogICAgICAgICAgICAgICAgIC8vIFN0cmluZyBzdGFydGluZ0xldHRlciA9IENoYXJhY3Rlci50b1N0cmluZyhnZXRGaXJzdExldHRlcihjdXJOYW1lKSk7CkBAIC0yNTksOSArMjY2LDkgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gaTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICByZXR1cm4gMDsgLy8gRG9uJ3QgcmVjb2duaXplIHRoZSBsZXR0ZXIgLSBmYWxscyB1bmRlciB6ZXJvJ3RoIHNlY3Rpb24gICAgCisgICAgICAgIHJldHVybiAwOyAvLyBEb24ndCByZWNvZ25pemUgdGhlIGxldHRlciAtIGZhbGxzIHVuZGVyIHplcm8ndGggc2VjdGlvbgogICAgIH0KLSAgICAKKwogICAgIC8qCiAgICAgICogQGhpZGUKICAgICAgKi8KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dpZGdldC9BdXRvQ29tcGxldGVUZXh0Vmlldy5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2V0L0F1dG9Db21wbGV0ZVRleHRWaWV3LmphdmEKaW5kZXggMDJkNz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hdXRvLWNvbXBsZXRlIGRyb3AtZG93biBsaXN0LjwvcD4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIHRoZSB2ZXJ0aWNhbCBvZmZzZXQKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldERyb3BEb3duVmVydGljYWxPZmZzZXQoKSB7CisgICAgICAgIHJldHVybiBtRHJvcERvd25WZXJ0aWNhbE9mZnNldDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogPHA+U2V0cyB0aGUgaG9yaXpvbnRhbCBvZmZzZXQgdXNlZCBmb3IgdGhlIGF1dG8tY29tcGxldGUgZHJvcC1kb3duIGxpc3QuPC9wPgorICAgICAqIAorICAgICAqIEBwYXJhbSBvZmZzZXQgdGhlIGhvcml6b250YWwgb2Zmc2V0CisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0RHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0KGludCBvZmZzZXQpIHsKKyAgICAgICAgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCA9IG9mZnNldDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogPHA+R2V0cyB0aGUgaG9yaXpvbnRhbCBvZmZzZXQgdXNlZCBmb3IgdGhlIGF1dG8tY29tcGxldGUgZHJvcC1kb3duIGxpc3QuPC9wPgorICAgICAqIAorICAgICAqIEByZXR1cm4gdGhlIGhvcml6b250YWwgb2Zmc2V0CisgICAgICovCisgICAgcHVibGljIGludCBnZXREcm9wRG93bkhvcml6b250YWxPZmZzZXQoKSB7CisgICAgICAgIHJldHVybiBtRHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0OworICAgIH0KKworICAgICAvKioKICAgICAgKiA8cD5TZXRzIHRoZSBhbmltYXRpb24gc3R5bGUgb2YgdGhlIGF1dG8tY29tcGxldGUgZHJvcC1kb3duIGxpc3QuPC9wPgogICAgICAqCiAgICAgICogPHA+SWYgdGhlIGRyb3AtZG93biBpcyBzaG93aW5nLCBjYWxsaW5nIHRoaXM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wCi0gICAgICAgICAgICAgICAgICAgIHRvcE9mZnNldCA9IE1hdGgubWluKHRvcE9mZnNldCwgbGFzdEJvdHRvbSAtIGVuZCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIE1vdmUgZXZlcnl0aGluZyB1cAotICAgICAgICAgICAgICAgIG9mZnNldENoaWxkcmVuVG9wQW5kQm90dG9tKC10b3BPZmZzZXQpOwotICAgICAgICAgICAgICAgIGlmIChsYXN0UG9zaXRpb24gPCBtSXRlbUNvdW50IC0gMSkgewotICAgICAgICAgICAgICAgICAgICAvLyBGaWxsIHRoZSBnYXAgdGhhdCB3YXMgb3BlbmVkIGJlbG93IHRoZSBsYXN0IHBvc2l0aW9uIHdpdGggbW9yZSByb3dzLCBpZgotICAgICAgICAgICAgICAgICAgICAvLyBwb3NzaWJsZQotICAgICAgICAgICAgICAgICAgICBmaWxsRG93bihsYXN0UG9zaXRpb24gKyAxLCBsYXN0Q2hpbGQuZ2V0Qm90dG9tKCkgKyBtRGl2aWRlckhlaWdodCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIENsb3NlIHVwIHRoZSByZW1haW5pbmcgZ2FwCi0gICAgICAgICAgICAgICAgICAgIGFkanVzdFZpZXdzVXBPckRvd24oKTsKKyAgICAgICAgICAgIGlmICh0b3BPZmZzZXQgPiAwKSB7CisgICAgICAgICAgICAgICAgaWYgKGxhc3RQb3NpdGlvbiA8IG1JdGVtQ291bnQgLSAxIHx8IGxhc3RCb3R0b20gPiBlbmQpICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsYXN0UG9zaXRpb24gPT0gbUl0ZW1Db3VudCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHB1bGwgdGhlIGJvdHRvbSB0b28gZmFyIHVwCisgICAgICAgICAgICAgICAgICAgICAgICB0b3BPZmZzZXQgPSBNYXRoLm1pbih0b3BPZmZzZXQsIGxhc3RCb3R0b20gLSBlbmQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIE1vdmUgZXZlcnl0aGluZyB1cAorICAgICAgICAgICAgICAgICAgICBvZmZzZXRDaGlsZHJlblRvcEFuZEJvdHRvbSgtdG9wT2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RQb3NpdGlvbiA8IG1JdGVtQ291bnQgLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaWxsIHRoZSBnYXAgdGhhdCB3YXMgb3BlbmVkIGJlbG93IHRoZSBsYXN0IHBvc2l0aW9uIHdpdGggbW9yZSByb3dzLCBpZgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gcG9zc2libGUKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbGxEb3duKGxhc3RQb3NpdGlvbiArIDEsIGxhc3RDaGlsZC5nZXRCb3R0b20oKSArIG1EaXZpZGVySGVpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIENsb3NlIHVwIHRoZSByZW1haW5pbmcgZ2FwCisgICAgICAgICAgICAgICAgICAgICAgICBhZGp1c3RWaWV3c1VwT3JEb3duKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxhc3RQb3NpdGlvbiA9PSBtSXRlbUNvdW50IC0gMSkgeworICAgICAgICAgICAgICAgICAgICBhZGp1c3RWaWV3c1VwT3JEb3duKCk7ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTE0MjgsNyArMTQzMiw4IEBACiAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiVGhlIGNvbnRlbnQgb2YgdGhlIGFkYXB0ZXIgaGFzIGNoYW5nZWQgYnV0ICIKICAgICAgICAgICAgICAgICAgICAgICAgICsgIkxpc3RWaWV3IGRpZCBub3QgcmVjZWl2ZSBhIG5vdGlmaWNhdGlvbi4gTWFrZSBzdXJlIHRoZSBjb250ZW50IG9mICIKICAgICAgICAgICAgICAgICAgICAgICAgICsgInlvdXIgYWRhcHRlciBpcyBub3QgbW9kaWZpZWQgZnJvbSBhIGJhY2tncm91bmQgdGhyZWFkLCBidXQgb25seSAiCi0gICAgICAgICAgICAgICAgICAgICAgICArICJmcm9tIHRoZSBVSSB0aHJlYWQuIik7CisgICAgICAgICAgICAgICAgICAgICAgICArICJmcm9tIHRoZSBVSSB0aHJlYWQuIFtpbiBMaXN0VmlldygiICsgZ2V0SWQoKSArICIsICIgKyBnZXRDbGFzcygpIAorICAgICAgICAgICAgICAgICAgICAgICAgKyAiKSB3aXRoIEFkYXB0ZXIoIiArIG1BZGFwdGVyLmdldENsYXNzKCkgKyAiKV0iKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgc2V0U2VsZWN0ZWRQb3NpdGlvbkludChtTmV4dFNlbGVjdGVkUG9zaXRpb24pOwpAQCAtMzI2NCwxMiArMzI2OSwxMyBAQAogICAgICAgICBpZiAobUNob2ljZU1vZGUgPT0gQ0hPSUNFX01PREVfTVVMVElQTEUpIHsKICAgICAgICAgICAgIG1DaGVja1N0YXRlcy5wdXQocG9zaXRpb24sIHZhbHVlKTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIENsZWFyIHRoZSBvbGQgdmFsdWU6IGlmIHNvbWV0aGluZyB3YXMgc2VsZWN0ZWQgYW5kIHZhbHVlID09IGZhbHNlCi0gICAgICAgICAgICAvLyB0aGVuIGl0IGlzIHVuc2VsZWN0ZWQKLSAgICAgICAgICAgIG1DaGVja1N0YXRlcy5jbGVhcigpOwotICAgICAgICAgICAgLy8gSWYgdmFsdWUgPT0gdHJ1ZSwgc2VsZWN0IHRoZSBhcHByb3ByaWF0ZSBwb3NpdGlvbgorICAgICAgICAgICAgLy8gQ2xlYXIgYWxsIHZhbHVlcyBpZiB3ZSdyZSBjaGVja2luZy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gbWVkaWEgY2FuIGJlIHBhdXNlZCBhbmQgc2Vla2VkLCBhbmQgc28gd2UgZG9uJ3QgZGlzYWJsZQorICAgICAgICAgICAgLy8gdGhlIGJ1dHRvbnMuCisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgLyoqCiAgICAgICogU2hvdyB0aGUgY29udHJvbGxlciBvbiBzY3JlZW4uIEl0IHdpbGwgZ28gYXdheQogICAgICAqIGF1dG9tYXRpY2FsbHkgYWZ0ZXIgJ3RpbWVvdXQnIG1pbGxpc2Vjb25kcyBvZiBpbmFjdGl2aXR5LgogICAgICAqIEBwYXJhbSB0aW1lb3V0IFRoZSB0aW1lb3V0IGluIG1pbGxpc2Vjb25kcy4gVXNlIDAgdG8gc2hvdwpAQCAtMjU5LDYgKzI4MiwxMCBAQAogCiAgICAgICAgIGlmICghbVNob3dpbmcgJiYgbUFuY2hvciAhPSBudWxsKSB7CiAgICAgICAgICAgICBzZXRQcm9ncmVzcygpOworICAgICAgICAgICAgaWYgKG1QYXVzZUJ1dHRvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVBhdXNlQnV0dG9uLnJlcXVlc3RGb2N1cygpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGlzYWJsZVVuc3VwcG9ydGVkQnV0dG9ucygpOwogCiAgICAgICAgICAgICBpbnQgW10gYW5jaG9ycG9zID0gbmV3IGludFsyXTsKICAgICAgICAgICAgIG1BbmNob3IuZ2V0TG9jYXRpb25PblNjcmVlbihhbmNob3Jwb3MpOwpAQCAtMzkyLDYgKzQxOSw5IEBACiAgICAgICAgICAgICAgICAga2V5Q29kZSA9PSAgS2V5RXZlbnQuS0VZQ09ERV9TUEFDRSkpIHsKICAgICAgICAgICAgIGRvUGF1c2VSZXN1bWUoKTsKICAgICAgICAgICAgIHNob3coc0RlZmF1bHRUaW1lb3V0KTsKKyAgICAgICAgICAgIGlmIChtUGF1c2VCdXR0b24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1QY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3IEBACiBwYWNrYWdlIGFuZHJvaWQud2lkZ2V0OwogCiBpbXBvcnQgYW5kcm9pZC5jb250ZW50LkNvbnRleHQ7CitpbXBvcnQgYW5kcm9pZC5oYXJkd2FyZS5TZW5zb3JNYW5hZ2VyOwogaW1wb3J0IGFuZHJvaWQudmlldy5WaWV3Q29uZmlndXJhdGlvbjsKIGltcG9ydCBhbmRyb2lkLnZpZXcuYW5pbWF0aW9uLkFuaW1hdGlvblV0aWxzOwogaW1wb3J0IGFuZHJvaWQudmlldy5hbmltYXRpb24uSW50ZXJwb2xhdG9yOwpAQCAtNzksOSArODAsOSBAQAogICAgICAgICBtRmluaXNoZWQgPSB0cnVlOwogICAgICAgICBtSW50ZXJwb2xhdG9yID0gaW50ZXJwb2xhdG9yOwogICAgICAgICBmbG9hdCBwcGkgPSBjb250ZXh0LmdldFJlc291cmNlcygpLmdldERpc3BsYXlNZXRyaWNzKCkuZGVuc2l0eSAqIDE2MC4wZjsKLSAgICAgICAgbURlY2VsZXJhdGlvbiA9IDkuOGYgICAvLyBnIChtL3NeMikKLSAgICAgICAgICAgICAgICAgICAgICAqIDM5LjM3ZiAvLyBpbmNoL21ldGVyCi0gICAgICAgICAgICAgICAgICAgICAgKiBwcGkgICAgLy8gcGl4ZWxzIHBlciBpbmNoCisgICAgICAgIG1EZWNlbGVyYXRpb24gPSBTZW5zb3JNYW5hZ2VyLkdSQVZJVFlfRUFSVEggICAvLyBnIChtL3NeMikKKyAgICAgICAgICAgICAgICAgICAgICAqIDM5LjM3ZiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluY2gvbWV0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAqIHBwaSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBpeGVscyBwZXIgaW5jaAogICAgICAgICAgICAgICAgICAgICAgICogVmlld0NvbmZpZ3VyYXRpb24uZ2V0U2Nyb2xsRnJpY3Rpb24oKTsKICAgICB9CiAgICAgCkBAIC0xMzIsNiArMTMzLDE3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dldFZpZXdCaW5kZXIoKQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFZpZXdCaW5kZXIoVmlld0JpbmRlciB2aWV3QmluZGVyKSB7CisgICAgICAgIG1WaWV3QmluZGVyID0gdmlld0JpbmRlcjsKKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQgYmluZFZpZXcoVmlldyB2aWV3LCBDb250ZXh0IGNvbnRleHQsIEN1cnNvciBjdXJzb3IsIGludFtdIGZyb20sIGludFtdIHRvKSB7CisgICAgICAgIGZpbmFsIFZpZXdCaW5kZXIgYmluZGVyID0gbVZpZXdCaW5kZXI7CisgICAgICAgIAogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHRvLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICBWaWV3IHYgPSB2aWV3LmZpbmRWaWV3QnlJZCh0b1tpXSk7CiAgICAgICAgICAgICBpZiAodiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHRleHQgPSBjdXJzb3IuZ2V0U3RyaW5nKGZyb21baV0pOwotICAgICAgICAgICAgICAgIGlmICh0ZXh0ID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgdGV4dCA9ICIiOworICAgICAgICAgICAgICAgIGJvb2xlYW4gYm91bmQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoYmluZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYm91bmQgPSBiaW5kZXIuc2V0Vmlld1ZhbHVlKHYsIGN1cnNvciwgZnJvbVtpXSk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICh2IGluc3RhbmNlb2YgVGV4dFZpZXcpIHsKLSAgICAgICAgICAgICAgICAgICAgKChUZXh0Vmlldykgdikuc2V0VGV4dCh0ZXh0KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHYgaW5zdGFuY2VvZiBJbWFnZVZpZXcpIHsKLSAgICAgICAgICAgICAgICAgICAgc2V0Vmlld0ltYWdlKChJbWFnZVZpZXcpIHYsIHRleHQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlNpbXBsZUN1cnNvckFkYXB0ZXIgY2FuIGJpbmQgdmFsdWVzIG9ubHkgdG8iICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIFRleHRWaWV3IGFuZCBJbWFnZVZpZXchIik7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKCFib3VuZCkgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdGV4dCA9IGN1cnNvci5nZXRTdHJpbmcoZnJvbVtpXSk7CisgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRleHQgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodiBpbnN0YW5jZW9mIFRleHRWaWV3KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRWaWV3VGV4dCgoVGV4dFZpZXcpIHYsIHRleHQpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHYgaW5zdGFuY2VvZiBJbWFnZVZpZXcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFZpZXdJbWFnZSgoSW1hZ2VWaWV3KSB2LCB0ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlNpbXBsZUN1cnNvclRyZWVBZGFwdGVyIGNhbiBiaW5kIHZhbHVlcyIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG9ubHkgdG8gVGV4dFZpZXcgYW5kIEltYWdlVmlldyEiKTsKKyAgICAgICAgICAgICAgICA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hvc3QgbXVzdCBoYXZlIGEgVGFiV2lkZ2V0IHdob3NlIGlkIGF0dHJpYnV0ZSBpcyAnYW5kcm9pZC5SLmlkLnRhYnMnIik7CiAgICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIC8vIEtleUxpc3RlbmVyIHRvIGF0dGFjaCB0byBhbGwgdGFicy4gRGV0ZWN0cyBub24tbmF2aWdhdGlvbiBrZXlzIAorCisgICAgICAgIC8vIEtleUxpc3RlbmVyIHRvIGF0dGFjaCB0byBhbGwgdGFicy4gRGV0ZWN0cyBub24tbmF2aWdhdGlvbiBrZXlzCiAgICAgICAgIC8vIGFuZCByZWxheXMgdGhlbSB0byB0aGUgdGFiIGNvbnRlbnQuCiAgICAgICAgIG1UYWJLZXlMaXN0ZW5lciA9IG5ldyBPbktleUxpc3RlbmVyKCkgewogICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gb25LZXkoVmlldyB2LCBpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKQEAgLTExNCwxNCArMTE0LDE0IEBACiAgICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV046CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9FTlRFUjoKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgbVRhYkNvbnRlbnQucmVxdWVzdEZvY3VzKFZpZXcuRk9DVVNfRk9SV0FSRCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1UYWJDb250ZW50LmRpc3BhdGNoS2V5RXZlbnQoZXZlbnQpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgfTsKLSAgICAgICAgCisKICAgICAgICAgbVRhYldpZGdldC5zZXRUYWJTZWxlY3Rpb25MaXN0ZW5lcihuZXcgVGF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CBtQ3VycmVudFZpZXcuaXNGb2N1c2VkKCkpIHsKKyAgICAgICAgICAgIGlmIChtQ3VycmVudFZpZXcgIT0gbnVsbCAmJiAoIW1DdXJyZW50Vmlldy5oYXNGb2N1cygpIHx8IG1DdXJyZW50Vmlldy5pc0ZvY3VzZWQoKSkpIHsKICAgICAgICAgICAgICAgICBtVGFiV2lkZ2V0LmdldENoaWxkVGFiVmlld0F0KG1DdXJyZW50VGFiKS5yZXF1ZXN0Rm9jdXMoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMjgzLDcgKzI4NCw3IEBACiAgICAgICAgICAgICBwbGF5U291bmRFZmZlY3QoU291bmRFZmZlY3RDb25zdGFudHMuTkFWSUdBVElPTl9VUCk7CiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gaGFuZGxlZDsgICAgICAgIAorICAgICAgICByZXR1cm4gaGFuZGxlZDsKICAgICB9CiAKIApAQCAtMzEyLDcgKzMxMyw3IEBACiAgICAgICAgIC8vIENhbGwgdGhlIHRhYiB3aWRnZXQncyBmb2N1c0N1cnJlbnRUYWIoKSwgaW5zdGVhZCBvZiBqdXN0CiAgICAgICAgIC8vIHNlbGVjdGluZyB0aGUgdGFiLgogICAgICAgICBtVGFiV2lkZ2V0LmZvY3VzQ3VycmVudFRhYihtQ3VycmVudFRhYik7Ci0gICAgICAgIAorCiAgICAgICAgIC8vIHRhYiBjb250ZW50CiAgICAgICAgIG1DdXJyZW50VmlldyA9IHNwZWMubUNvbnRlbnRTdHJhdGVneS5nZXRDb250ZW50VmlldygpOwogCkBAIC0zNjcsNyArMzY4LDcgQEAKICAgICBwdWJsaWMgaW50ZXJmYWNlIFRhYkNvbnRlbnRGYWN0b3J5IHsKICAgICAgICAgLyoqCiAgICAgICAgICAqIENhbGxiYWNrIHRvIG1ha2UgdGhlIHRhYiBjb250ZW50cwotICAgICAgICAgKiAKKyAgICAgICAgICoKICAgICAgICAgICog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LSAxKSB7CisgICAgICAgICAgICByZXR1cm4gbVNlbGVjdGVkVGFiOworICAgICAgICB9IGVsc2UgaWYgKGkgPj0gbVNlbGVjdGVkVGFiKSB7CisgICAgICAgICAgICByZXR1cm4gaSArIDE7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gaTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHByaXZhdGUgdm9pZCBpbml0VGFiV2lkZ2V0KCkgewogICAgICAgICBzZXRPcmllbnRhdGlvbihMaW5lYXJMYXlvdXQuSE9SSVpPTlRBTCk7CisgICAgICAgIG1Hcm91cEZsYWdzIHw9IEZMQUdfVVNFX0NISUxEX0RSQVdJTkdfT1JERVI7CisKICAgICAgICAgbUJvdHRvbUxlZnRTdHJpcCA9IG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldERyYXdhYmxlKAogICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUudGFiX2JvdHRvbV9sZWZ0KTsKICAgICAgICAgbUJvdHRvbVJpZ2h0U3RyaXAgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXREcmF3YWJsZSgKQEAgLTE1Niw3ICsxNzEsNyBAQAogICAgICAgICB9CiAgICAgICAgIHN1cGVyLmNoaWxkRHJhd2FibGVTdGF0ZUNoYW5nZWQoY2hpbGQpOwogICAgIH0KLSAgICAKKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoRHJhdyhDYW52YXMgY2FudmFzKSB7CiAgICAgICAgIHN1cGVyLmRpc3BhdGNoRHJhdyhjYW52YXMpOwpAQCAtMTY5LDE3ICsxODQsMTcgQEAKICAgICAgICAgfQogCiAgICAgICAgIFZpZXcgc2VsZWN0ZWRDaGlsZCA9IGdldENoaWxkVGFiVmlld0F0KG1TZWxlY3RlZFRhYik7Ci0gICAgICAgIAorCiAgICAgICAgIG1Cb3R0b21MZWZ0U3RyaXAuc2V0U3RhdGUoc2VsZWN0ZWRDaGlsZC5nZXREcmF3YWJsZVN0YXRlKCkpOwogICAgICAgICBtQm90dG9tUmlnaHRTdHJpcC5zZXRTdGF0ZShzZWxlY3RlZENoaWxkLmdldERyYXdhYmxlU3RhdGUoKSk7Ci0gICAgICAgIAorCiAgICAgICAgIGlmIChtU3RyaXBNb3ZlZCkgewogICAgICAgICAgICAgUmVjdCBzZWxCb3VuZHMgPSBuZXcgUmVjdCgpOyAvLyBCb3VuZHMgb2YgdGhlIHNlbGVjdGVkIHRhYiBpbmRpY2F0b3IKICAgICAgICAgICAgIHNlbEJvdW5kcy5sZWZ0ID0gc2VsZWN0ZWRDaGlsZC5nZXRMZWZ0KCk7CiAgICAgICAgICAgICBzZWxCb3VuZHMucmlnaHQgPSBzZWxlY3RlZENoaWxkLmdldFJpZ2h0KCk7CiAgICAgICAgICAgICBmaW5hbCBpbnQgbXlIZWlnaHQgPSBnZXRIZWlnaHQoKTsKICAgICAgICAgICAgIG1Cb3R0b21MZWZ0U3RyaXAuc2V0Qm91bmRzKAotICAgICAgICAgICAgICAgICAgICBNYXRoLm1pbigwLCBzZWxCb3VuZHMubGVmdCAKKyAgICAgICAgICAgICAgICAgICAgTWF0aC5taW4oMCwgc2VsQm91bmRzLmxlZnQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbUJvdHRvbUxlZnRTdHJpcC5nZXRJbnRyaW5zaWNXaWR0aCgpKSwKICAgICAgICAgICAgICAgICAgICAgbXlIZWlnaHQgLSBtQm90dG9tTGVmdFN0cmlwLmdldEludHJpbnNpY0hlaWdodCgpLAogICAgICAgICAgICAgICAgICAgICBzZWxCb3VuZHMubGVmdCwKQEAgLTE4NywxMiArMjAyLDEyIEBACiAgICAgICAgICAgICBtQm90dG9tUmlnaHRTdHJpcC5zZXRCb3VuZHMoCiAgICAgICAgICAgICAgICAgICAgIHNlbEJvdW5kcy5yaWdodCwKICAgICAgICAgICAgICAgICAgICAgbXlIZWlnaHQgLSB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2VsZWN0aW5nIHRoZSB0YWIgcHJvZ3JhbW1hdGljYWxseSwgd2UnbGwgbmVlZCB0byBtYWtlIHN1cmUKICAgICAgKiBmb2N1cyBrZWVwcyB1cC4KLSAgICAgKiAKLSAgICAgKiAgQHBhcmFtIGluZGV4IFRoZSB0YWIgdGhhdCB5b3Ugd2FudCBmb2N1c2VkIChoaWdobGlnaHRlZCBpbiBvcmFuZ2UpIAorICAgICAqCisgICAgICogIEBwYXJhbSBpbmRleCBUaGUgdGFiIHRoYXQgeW91IHdhbnQgZm9jdXNlZCAoaGlnaGxpZ2h0ZWQgaW4gb3JhbmdlKQogICAgICAqICBhbmQgc2VsZWN0ZWQgKHRhYiBicm91Z2h0IHRvIHRoZSBmcm9udCBvZiB0aGUgd2lkZ2V0KQotICAgICAqICAKKyAgICAgKgogICAgICAqICBAc2VlICNzZXRDdXJyZW50VGFiCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgZm9jdXNDdXJyZW50VGFiKGludCBpbmRleCkgewpAQCAtMjU0LDE4ICsyNjksMTggQEAKIAogICAgICAgICAvLyBzZXQgdGhlIHRhYgogICAgICAgICBzZXRDdXJyZW50VGFiKGluZGV4KTsKLSAgICAgICAgCisKICAgICAgICAgLy8gY2hhbmdlIHRoZSBmb2N1cyBpZiBhcHBsaWNhYmxlLgogICAgICAgICBpZiAob2xkVGFiICE9IGluZGV4KSB7CiAgICAgICAgICAgICBnZXRDaGlsZFRhYlZpZXdBdChpbmRleCkucmVxdWVzdEZvY3VzKCk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgdm9pZCBzZXRFbmFibGVkKGJvb2xlYW4gZW5hYmxlZCkgewogICAgICAgICBzdXBlci5zZXRFbmFibGVkKGVuYWJsZWQpOwogICAgICAgICBpbnQgY291bnQgPSBnZXRUYWJDb3VudCgpOwotICAgICAgICAKKwogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpK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vTWFuYWdlci5TVFJFQU1fTVVTSUMpOwogICAgICAgICAgICAgbU1lZGlhUGxheWVyLnNldFNjcmVlbk9uV2hpbGVQbGF5aW5nKHRydWUpOwogICAgICAgICAgICAgbU1lZGlhUGxheWVyLnByZXBhcmVBc3luYygpOworICAgICAgICAgICAgLy8gd2UgZG9uJ3Qgc2V0IHRoZSB0YXJnZXQgc3RhdGUgaGVyZSBlaXRoZXIsIGJ1dCBwcmVzZXJ2ZSB0aGUKKyAgICAgICAgICAgIC8vIHRhcmdldCBzdGF0ZSB0aGF0IHdhcyB0aGVyZSBiZWZvcmUuCisgICAgICAgICAgICBtQ3VycmVudFN0YXRlID0gU1RBVEVfUFJFUEFSSU5HOwogICAgICAgICAgICAgYXR0YWNoTWVkaWFDb250cm9sbGVyKCk7CiAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmFibGUgdG8gb3BlbiBjb250ZW50OiAiICsgbVVyaSwgZXgpOworICAgICAgICAgICAgbUN1cnJlbnRTdGF0ZSA9IFNUQVRFX0VSUk9SOworICAgICAgICAgICAgbVRhcmdldFN0YXRlID0gU1RBVEVfRVJST1I7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiBleCkgewogICAgICAgICAgICAgTG9nLncoVEFHLCAiVW5hYmxlIHRvIG9wZW4gY29udGVudDogIiArIG1VcmksIGV4KTsKKyAgICAgICAgICAgIG1DdXJyZW50U3RhdGUgPSBTVEFURV9FUlJPUjsKKyAgICAgICAgICAgIG1UYXJnZXRTdGF0ZSA9IFNUQVRFX0VSUk9SOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgfQpAQCAtMjIyLDcgKzI0NSw3IEBACiAgICAgICAgICAgICBWaWV3IGFuY2hvclZpZXcgPSB0aGlzLmdldFBhcmVudCgpIGluc3RhbmNlb2YgVmlldyA/CiAgICAgICAgICAgICAgICAgICAgIChWaWV3KXRoaXMuZ2V0UGFyZW50KCkgOiB0aGlzOwogICAgICAgICAgICAgbU1lZGlhQ29udHJvbGxlci5zZXRBbmNob3JWaWV3KGFuY2hvclZpZXcpOwotICAgICAgICAgICAgbU1lZGlhQ29udHJvbGxlci5zZXRFbmFibGVkKG1Jc1ByZXBhcmVkKTsKKyAgICAgICAgICAgIG1NZWRpYUNvbnRyb2xsZXIuc2V0RW5hYmxlZChpc0luUGxheWJhY2tTdGF0ZSgpKTsKICAgICAgICAgfQogICAgIH0KICAgICAKQEAgLTIzOSw4ICsyNjIsMjMgQEAKICAgICAKICAgICBNZWRpYVBsYXllci5PblByZXBhcmVkTGlzdGVuZXIgbVByZXBhcmVkTGlzdGVuZXIgPSBuZXcgTWVkaWFQbGF5ZXIuT25QcmVwYXJlZExpc3RlbmVyKCkgewogICAgICAgICBwdWJsaWMgdm9pZCBvblByZXBhcmVkKE1lZGlhUGxheWVyIG1wKSB7Ci0gICAgICAgICAgICAvLyBicmllZmx5IHNob3cgdGhlIG1lZGlhY29udHJvbGxlcgotICAgICAgICAgICAgbUlzUHJlcGFyZWQgPSB0cnVlOworICAgICAgICAgICAgbUN1cnJlbnRTdGF0ZSA9IFNUQVRFX1BSRVBBUkVEOworCisgICAgICAgICAgICAvLyBHZXQgdGhlIGNhcGFiaWxpdGllcyBvZiB0aGUgcGxheWVyIGZvciB0aGlzIHN0cmVhbQorICAgICAgICAgICAgTWV0YWRhdGEgZGF0YSA9IG1wLmdldE1ldGFkYXRhKE1lZGlhUGxheWVyLk1FVEFEQVRBX0FMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVkaWFQbGF5ZXIuQllQQVNTX01FVEFEQVRBX0ZJTFRFUik7CisKKyAgICAgICAgICAgIGlmIChkYXRhICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQ2FuUGF1c2UgPSAhZGF0YS5oYXMoTWV0YWRhdGEuUEFVU0VfQVZBSUxBQkxFKQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZGF0YS5nZXRCb29sZWFuKE1ldGFkYXRhLlBBVVNFX0FWQUlMQUJMRSk7CisgICAgICAgICAgICAgICAgbUNhblNlZWtCYWNrID0gIWRhdGEuaGFzKE1ldGFkYXRhLlNFRUtfQkFDS1dBUkRfQVZBSUxBQkxFKQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZGF0YS5nZXRCb29sZWFuKE1ldGFkYXRhLlNFRUtfQkFDS1dBUkRfQVZBSUxBQkxFKTsKKyAgICAgICAgICAgICAgICBtQ2FuU2Vla0ZvcndhcmQgPSAhZGF0YS5oYXMoTWV0YWRhdGEuU0VFS19GT1JXQVJEX0FWQUlMQUJMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGRhdGEuZ2V0Qm9vbGVhbihNZXRhZGF0YS5TRUVLX0ZPUldBUkRfQVZBSUxBQkxFKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUNhblBhdXNlID0gbUNhblNlZWtGb3J3YXJkID0gbUNhblNlZWtGb3J3YXJkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgaWYgKG1PblByZXBhcmVkTGlzdGVuZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIG1PblByZXBhcmVkTGlzdGVuZXIub25QcmVwYXJlZChtTWVkaWFQbGF5ZXIpOwogICAgICAgICAgICAgfQpAQCAtMjQ5LDYgKzI4NywxMSBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgbVZpZGVvV2lkdGggPSBtcC5nZXRWaWRlb1dpZHRoKCk7CiAgICAgICAgICAgICBtVmlkZW9IZWlnaHQgPSBtcC5nZXRWaWRlb0hlaWdodCgpOworCisgICAgICAgICAgICBpbnQgc2Vla1RvUG9zaXRpb24gPSBtU2Vla1doZW5QcmVwYXJlZDsgIC8vIG1TZWVrV2hlblByZXBhcmV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worICAgICAgICAgICAgICAgICAgICBpZiAobVRhcmdldFN0YXRlID09IFNUQVRFX1BMQVlJTkcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU3RhcnRXaGVuUHJlcGFyZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtTWVkaWFDb250cm9sbGVyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWVkaWFDb250cm9sbGVyLnNob3coKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghaXNQbGF5aW5nKCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAobVNlZWtXaGVuUHJlcGFyZWQgIT0gMCB8fCBnZXRDdXJyZW50UG9zaXRpb24oKSA+IDApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNlZWtUb1Bvc2l0aW9uICE9IDAgfHwgZ2V0Q3VycmVudFBvc2l0aW9uKCkgPiAwKSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAobU1lZGlhQ29udHJvbGxlciAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTaG93IHRoZSBtZWRpYSBjb250cm9scyB3aGVuIHdlJ3JlIHBhdXNlZCBpbnRvIGEgdmlkZW8gYW5kIG1ha2UgJ2VtIHN0aWNrLgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1lZGlhQ29udHJvbGxlci5zaG93KDApOwpAQCAtMjc3LDEzICszMTUsOCBAQAogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAvLyBXZSBkb24ndCBrbm93IHRoZSB2aWRlbyBzaXplIHlldCwgYnV0IHNob3VsZCBzdGFydCBhbnl3YXkuCiAgICAgICAgICAgICAgICAgLy8gVGhlIHZpZGVvIHNpemUgbWlnaHQgYmUgcmVwb3J0ZWQgdG8gdXMgbGF0ZXIuCi0gICAgICAgICAgICAgICAgaWYgKG1TZWVrV2hlblByZXBhcmVkICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbU1lZGlhUGxheWVyLnNlZWtUbyhtU2Vla1doZW5QcmVwYXJlZCk7Ci0gICAgICAgICAgICAgICAgICAgIG1TZWVrV2hlblByZXBhcmVkID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG1TdGFydFdoZW5QcmVwYXJlZCkgeworICAgICAgICAgICAgICAgIGlmIChtVGFyZ2V0U3RhdGUgPT0gU1RBVEVfUExBWUlORykgewogICAgICAgICAgICAgICAgICAgICBzdGFydCgpOwotICAgICAgICAgICAgICAgICAgICBtU3RhcnRXaGVuUHJlcGFyZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTI5Miw3ICszMjUsOCBAQAogICAgIHByaXZhdGUgTWVkaWFQbGF5ZXIuT25Db21wbGV0aW9uTGlzdGVuZXIgbUNvbXBsZXRpb25MaXN0ZW5lciA9CiAgICAgICAgIG5ldyBNZWRpYVBsYXllci5PbkNvbXBsZXRpb25MaXN0ZW5lcigpIHsKICAgICAgICAgcHVibGljIHZvaWQgb25Db21wbGV0aW9uKE1lZGlhUGxheWVyIG1wKSB7Ci0gICAgICAgICAgICBtSXNQbGF5YmFja0NvbXBsZXRlZCA9IHRydWU7CisgICAgICAgICAgICBtQ3VycmVudFN0YXRlID0gU1RBVEVfUExBWUJBQ0tfQ09NUExFVEVEOworICAgICAgICAgICAgbVRhcmdldFN0YXRlID0gU1RBVEVfUExBWUJBQ0tfQ09NUExFVEVEOwogICAgICAgICAgICAgaWYgKG1NZWRpYUNvbnRyb2xsZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIG1NZWRpYUNvbnRyb2xsZXIuaGlkZSgpOwogICAgICAgICAgICAgfQpAQCAtMzA2LDYgKzM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QgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBtTWVkaWFQbGF5ZXIuc2Vla1RvKG1TZWVrV2hlblByZXBhcmVkKTsKLSAgICAgICAgICAgICAgICAgICAgbVNlZWtXaGVuUHJlcGFyZWQgPSAwOworICAgICAgICAgICAgICAgICAgICBzZWVrVG8obVNlZWtXaGVuUHJlcGFyZWQpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoIW1Jc1BsYXliYWNrQ29tcGxldGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXJ0KCk7Ci0gICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICBzdGFydCgpOwogICAgICAgICAgICAgICAgIGlmIChtTWVkaWFDb250cm9sbGVyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgbU1lZGlhQ29udHJvbGxlci5zaG93KCk7CiAgICAgICAgICAgICAgICAgfQpAQCAtNDI3LDE3ICs0NjIsMjggQEAKICAgICAgICAgICAgIC8vIGFmdGVyIHdlIHJldHVybiBmcm9tIHRoaXMgd2UgY2FuJ3QgdXNlIHRoZSBzdXJmYWNlIGFueSBtb3JlCiAgICAgICAgICAgICBtU3VyZmFjZUhvbGRlciA9IG51bGw7CiAgICAgICAgICAgICBpZiAobU1lZGlhQ29udHJvbGxlciAhPSBudWxsKSBtTWVkaWFDb250cm9sbGVyLmhpZGUoKTsKLSAgICAgICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5yZXNldCgpOwotICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgbU1lZGlhUGxheWVyID0gbnVsbDsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJlbGVhc2UodHJ1ZSk7CiAgICAgICAgIH0KICAgICB9OwogCisgICAgLyoKKyAgICAgKiByZWxlYXNlIHRoZSBtZWRpYSBwbGF5ZXIgaW4gYW55IHN0YXRlCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlbGVhc2UoYm9vbGVhbiBjbGVhcnRhcmdldHN0YXRlKSB7CisgICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbU1lZGlhUGxheWVyLnJlc2V0KCk7CisgICAgICAgICAgICBtTWVkaWFQbGF5ZXIucmVsZWFzZSgpOworICAgICAgICAgICAgbU1lZGlhUGxheWVyID0gbnVsbDsKKyAgICAgICAgICAgIG1DdXJyZW50U3RhdGUgPSBTVEFURV9JRExFOworICAgICAgICAgICAgaWYgKGNsZWFydGFyZ2V0c3RhdGUpIHsKKyAgICAgICAgICAgICAgICBtVGFyZ2V0U3RhdGUgID0gU1RBVEVfSURMRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikgewotICAgICAgICBpZiAobUlzUHJlcGFyZWQgJiYgbU1lZGlhUGxheWVyICE9IG51bGwgJiYgbU1lZGlhQ29udHJvbGxlciAhPSBudWxsKSB7CisgICAgICAgIGlmIChpc0luUGxheWJhY2tTdGF0ZSgpICYmIG1NZWRpYUNvbnRyb2xsZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgdG9nZ2xlTWVkaWFDb250cm9sc1Zpc2libGl0eSgpOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBmYWxzZTsKQEAgLTQ0NSw3ICs0OTEsNyBAQAogICAgIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIG9uVHJhY2tiYWxsRXZlbnQoTW90aW9uRXZlbnQgZXYpIHsKLSAgICAgICAgaWYgKG1Jc1ByZXBhcmVkICYmIG1NZWRpYVBsYXllciAhPSBudWxsICYmIG1NZWRpYUNvbnRyb2xsZXIgIT0gbnVsbCkgeworICAgICAgICBpZiAoaXNJblBsYXliYWNrU3RhdGUoKSAmJiBtTWVkaWFDb250cm9sbGVyICE9IG51bGwpIHsKICAgICAgICAgICAgIHRvZ2dsZU1lZGlhQ29udHJvbHNWaXNpYmxpdHkoKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gZmFsc2U7CkBAIC00NTQsMTUgKzUwMCwxMyBAQAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIG9uS2V5RG93bihpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpCiAgICAgewotICAgICAgICBpZiAobUlzUHJlcGFyZWQgJiYKLSAgICAgICAgICAgICAgICBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfQkFDSyAmJgotICAgICAgICAgICAgICAgIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfVVAgJiYKLSAgICAgICAgICAgICAgICBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfVk9MVU1FX0RPV04gJiYKLSAgICAgICAgICAgICAgICBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfTUVOVSAmJgotICAgICAgICAgICAgICAgIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9DQUxMICYmCi0gICAgICAgICAgICAgICAga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0VORENBTEwgJiYKLSAgICAgICAgICAgICAgICBtTWVkaWFQbGF5ZXIgIT0gbnVsbCAmJgotICAgICAgICAgICAgICAgIG1NZWRpYUNvbnRyb2xsZXIgIT0gbnVsbCkgeworICAgICAgICBib29sZWFuIGlzS2V5Q29kZVN1cHBvcnRlZCA9IGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9CQUNLICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX1ZPTFVNRV9VUCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9WT0xVTUVfRE9XTiAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9NRU5VICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0NBTEwgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfRU5EQ0FMTDsKKyAgICAgICAgaWYgKGlzSW5QbGF5YmFja1N0YXRlKCkgJiYgaXNLZXlDb2RlU3VwcG9ydGVkICYmIG1NZWRpYUNvbnRyb2xsZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9IRUFEU0VUSE9PSyB8fAogICAgICAgICAgICAgICAgICAgICBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfTUVESUFfUExBWV9QQVVTRSkgewogICAgICAgICAgICAgICAgIGlmIChtTWVkaWFQbGF5ZXIuaXNQbGF5aW5nKCkpIHsKQEAgLTQ5NCwyNiArNTM4LDI2IEBACiAgICAgfQogICAgIAogICAgIHB1YmxpYyB2b2lkIHN0YXJ0KCkgewotICAgICAgICBtSXNQbGF5YmFja0NvbXBsZXRlZCA9IGZhbHNlOwotICAgICAgICBpZiAobU1lZGlhUGxheWVyICE9IG51bGwgJiYgbUlzUHJlcGFyZWQpIHsKLSAgICAgICAgICAgICAgICBtTWVkaWFQbGF5ZXIuc3RhcnQoKTsKLSAgICAgICAgICAgICAgICBtU3RhcnRXaGVuUHJlcGFyZWQgPSBmYWxzZTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIG1TdGFydFdoZW5QcmVwYXJlZCA9IHRydWU7CisgICAgICAgIGlmIChpc0luUGxheWJhY2tTdGF0ZSgpKSB7CisgICAgICAgICAgICBtTWVkaWFQbGF5ZXIuc3RhcnQoKTsKKyAgICAgICAgICAgIG1DdXJyZW50U3RhdGUgPSBTVEFURV9QTEFZSU5HOwogICAgICAgICB9CisgICAgICAgIG1UYXJnZXRTdGF0ZSA9IFNUQVRFX1BMQVlJTkc7CiAgICAgfQogICAgIAogICAgIHB1YmxpYyB2b2lkIHBhdXNlKCkgewotICAgICAgICBpZiAobU1lZGlhUGxheWVyICE9IG51bGwgJiYgbUlzUHJlcGFyZWQpIHsKKyAgICAgICAgaWYgKGlzSW5QbGF5YmFja1N0YXRlKCkpIHsKICAgICAgICAgICAgIGlmIChtTWVkaWFQbGF5ZXIuaXNQbGF5aW5nKCkpIHsKICAgICAgICAgICAgICAgICBtTWVkaWFQbGF5ZXIucGF1c2UoKTsKKyAgICAgICAgICAgICAgICBtQ3VycmVudFN0YXRlID0gU1RBVEVfUEFVU0VEOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIG1TdGFydFdoZW5QcmVwYXJlZCA9IGZhbHNlOworICAgICAgICBtVGFyZ2V0U3RhdGUgPSBTVEFURV9QQVVTRUQ7CiAgICAgfQogICAgIAorICAgIC8vIGNhY2hlIGR1cmF0aW9uIGFzIG1EdXJhdGlvbiBmb3IgZmFzdGVyIGFjY2VzcwogICAgIHB1YmxpYyBpbnQgZ2V0RHVyYXRpb24oKSB7Ci0gICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgIT0gbnVsbCAmJiBtSXNQcmVwYXJlZCkgeworICAgICAgICBpZiAoaXNJblBsYXliYWNrU3RhdGUoKSkgewogICAgICAgICAgICAgaWYgKG1EdXJhdGlvbiA+IDApIHsKICAgICAgICAgICAgICAgICByZXR1cm4gbUR1cmF0aW9uOwogICAgICAgICAgICAgfQpAQCAtNTI1LDI1ICs1NjksMjMgQEAKICAgICB9CiAgICAgCiAgICAgcHVibGljIGludCBnZXRDdXJyZW50UG9zaXRpb24oKSB7Ci0gICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgIT0gbnVsbCAmJiBtSXNQcmVwYXJlZCkgeworICAgICAgICBpZiAoaXNJblBsYXliYWNrU3RhdGUoKSkgewogICAgICAgICAgICAgcmV0dXJuIG1NZWRpYVBsYXllci5nZXRDdXJyZW50UG9zaXRpb24oKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gMDsKICAgICB9CiAgICAgCiAgICAgcHVibGljIHZvaWQgc2Vla1RvKGludCBtc2VjKSB7Ci0gICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgIT0gbnVsbCAmJiBtSXNQcmVwYXJlZCkgeworICAgICAgICBpZiAoaXNJblBsYXliYWNrU3RhdGUoKSkgewogICAgICAgICAgICAgbU1lZGlhUGxheWVyLnNlZWtUbyhtc2VjKTsKKyAgICAgICAgICAgIG1TZWVrV2hlblByZXBhcmVkID0gMDsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIG1TZWVrV2hlblByZXBhcmVkID0gbXNlYzsKICAgICAgICAgfQogICAgIH0gICAgCiAgICAgICAgICAgICAKICAgICBwdWJsaWMgYm9vbGVhbiBpc1BsYXlpbmcoKSB7Ci0gICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgIT0gbnVsbCAmJiBtSXNQcmVwYXJlZCkgewotICAgICAgICAgICAgcmV0dXJuIG1NZWRpYVBsYXllci5pc1BsYXlpbmcoKTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIHJldHVybiBpc0luUGxheWJhY2tTdGF0ZSgpICYmIG1NZWRpYVBsYXllci5pc1BsYXlpbmcoKTsKICAgICB9CiAgICAgCiAgICAgcHVibGljIGludCBnZXRCdWZmZXJQZXJjZW50YWdlKCkgewpAQCAtNTUyLDQgKzU5NCwyMyBAQAogICAgICAgICB9CiAgICAgICAgIHJldHVybiAwOwogICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBpc0luUGxheWJhY2tTdGF0ZSgpIHsKK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kLmludGVybmFsLlIuc3RyaW5nLmNob29zZUFjdGl2aXR5KTsKICAgICAgICAgfQotICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUsIHRhcmdldCwgdGl0bGUsIGZhbHNlKTsKKyAgICAgICAgUGFyY2VsYWJsZVtdIHBhID0gaW50ZW50LmdldFBhcmNlbGFibGVBcnJheUV4dHJhKEludGVudC5FWFRSQV9JTklUSUFMX0lOVEVOVFMpOworICAgICAgICBJbnRlbnRbXSBpbml0aWFsSW50ZW50cyA9IG51bGw7CisgICAgICAgIGlmIChwYSAhPSBudWxsKSB7CisgICAgICAgICAgICBpbml0aWFsSW50ZW50cyA9IG5ldyBJbnRlbnRbcGEubGVuZ3RoXTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxwYS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIGlmICghKHBhW2ldIGluc3RhbmNlb2YgSW50ZW50KSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudygiQ2hvb3NlQWN0aXZpdHkiLCAiSW5pdGlhbCBpbnRlbnQgIyIgKyBpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG5vdCBhbiBJbnRlbnQ6ICIgKyBwYVtpXSk7CisgICAgICAgICAgICAgICAgICAgIGZpbmlzaCgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGluaXRpYWxJbnRlbnRzW2ldID0gKEludGVudClwYVtpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUsIHRhcmdldCwgdGl0bGUsIGluaXRpYWxJbnRlbnRzLCBmYWxzZSk7CiAgICAgfQogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL2FwcC9OZXRJbml0aWF0ZWRBY3Rpdml0eS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nRlbnRbXSBpbml0aWFsSW50ZW50cywgYm9vbGVhbiBhbHdheXNVc2VPcHRpb24pIHsKICAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKICAgICAgICAgbVBtID0gZ2V0UGFja2FnZU1hbmFnZXIoKTsKICAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChudWxsKTsKQEAgLTg2LDcgKzg4LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5jbGVhckRlZmF1bHRIaW50KTsKICAgICAgICAgICAgIG1DbGVhckRlZmF1bHRIaW50LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKICAgICAgICAgfQotICAgICAgICBtQWRhcHRlciA9IG5ldyBSZXNvbHZlTGlzdEFkYXB0ZXIodGhpcywgaW50ZW50KTsKKyAgICAgICAgbUFkYXB0ZXIgPSBuZXcgUmVzb2x2ZUxpc3RBZGFwdGVyKHRoaXMsIGludGVudCwgaW5pdGlhbEludGVudHMpOwogICAgICAgICBpZiAobUFkYXB0ZXIuZ2V0Q291bnQoKSA+IDEpIHsKICAgICAgICAgICAgIGFwLm1BZGFwdGVyID0gbUFkYXB0ZXI7CiAgICAgICAgIH0gZWxzZSBpZiAobUFkYXB0ZXIuZ2V0Q291bnQoKSA9PSAxKSB7CkBAIC0xODUsMTIgKzE4NywxNiBAQAogICAgIHByaXZhdGUgZmluYWwgY2xhc3MgRGlzcGxheVJlc29sdmVJbmZvIHsKICAgICAgICAgUmVzb2x2ZUluZm8gcmk7CiAgICAgICAgIENoYXJTZXF1ZW5jZSBkaXNwbGF5TGFiZWw7CisgICAgICAgIERyYXdhYmxlIGRpc3BsYXlJY29uOwogICAgICAgICBDaGFyU2VxdWVuY2UgZXh0ZW5kZWRJbmZvOworICAgICAgICBJbnRlbnQgb3JpZ0ludGVudDsKIAotICAgICAgICBEaXNwbGF5UmVzb2x2ZUluZm8oUmVzb2x2ZUluZm8gcHJpLCBDaGFyU2VxdWVuY2UgcExhYmVsLCBDaGFyU2VxdWVuY2UgcEluZm8pIHsKKyAgICAgICAgRGlzcGxheVJlc29sdmVJbmZvKFJlc29sdmVJbmZvIHByaSwgQ2hhclNlcXVlbmNlIHBMYWJlbCwKKyAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgcEluZm8sIEludGVudCBwT3JpZ0ludGVudCkgewogICAgICAgICAgICAgcmkgPSBwcmk7CiAgICAgICAgICAgICBkaXNwbGF5TGFiZWwgPSBwTGFiZWw7CiAgICAgICAgICAgICBleHRlbmRlZEluZm8gPSBwSW5mbzsKKyAgICAgICAgICAgIG9yaWdJbnRlbnQgPSBwT3JpZ0ludGVudDsKICAgICAgICAgfQogICAgIH0KIApAQCAtMjAwLDcgKzIwNiw4IEBACiAKICAgICAgICAgcHJpdmF0ZSBMaXN0PERpc3BsYXlSZXNvbHZlSW5mbz4gbUxpc3Q7CiAKLSAgICAgICAgcHVibGljIFJlc29sdmVMaXN0QWRhcHRlcihDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgcHVibGljIFJlc29sdmVMaXN0QWRhcHRlcihDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQsCisgICAgICAgICAgICAgICAgSW50ZW50W10gaW5pdGlhbEludGVudHMpIHsKICAgICAgICAgICAgIG1JbnRlbnQgPSBuZXcgSW50ZW50KGludGVudCk7CiAgICAgICAgICAgICBtSW50ZW50LnNldENvbXBvbmVudChudWxsKTsKICAgICAgICAgICAgIG1JbmZsYXRlciA9IChMYXlvdXRJbmZsYXRlciljb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5MQVlPVVRfSU5GTEFURVJfU0VSVklDRSk7CkBAIC0yMzQsOSArMjQxLDM5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFJlc29sdmVJbmZvLkRpc3BsYXlOYW1lQ29tcGFyYXRvcihtUG0pOwogICAgICAgICAgICAgICAgICAgICBDb2xsZWN0aW9ucy5zb3J0KHJMaXN0LCByQ29tcGFyYXRvcik7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIG1MaXN0ID0gbmV3IEFycmF5TGlzdDxEaXNwbGF5UmVzb2x2ZUluZm8+KCk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLy8gRmlyc3QgcHV0IHRoZSBpbml0aWFsIGl0ZW1zIGF0IHRoZSB0b3AuCisgICAgICAgICAgICAgICAgaWYgKGluaXRpYWxJbnRlbnRzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPGluaXRpYWxJbnRlbnRzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBJbnRlbnQgaWkgPSBpbml0aWFsSW50ZW50c1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBBY3Rpdml0eUluZm8gYWkgPSBpaS5yZXNvbHZlQWN0aXZpdHlJbmZvKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRQYWNrYWdlTWFuYWdlcigpLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhaSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoIlJlc29sdmVyQWN0aXZpdHkiLCAiTm8gYWN0aXZpdHkgZm91bmQgZm9yICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgaWkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgUmVzb2x2ZUluZm8gcmkgPSBuZXcgUmVzb2x2ZUluZm8oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJpLmFjdGl2aXR5SW5mbyA9IGFpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpIGluc3RhbmNlb2YgTGFiZWxlZEludGVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExhYmVsZWRJbnRlbnQgbGkgPSAoTGFiZWxlZEludGVudClpaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByaS5yZXNvbHZlUGFja2FnZU5hbWUgPSBsaS5nZXRTb3VyY2VQYWNrYWdlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmkubGFiZWxSZXMgPSBsaS5nZXRMYWJlbFJlc291cmNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmkubm9uTG9jYWxpemVkTGFiZWwgPSBsaS5nZXROb25Mb2NhbGl6ZWRMYWJlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpLmljb24gPSBsaS5nZXRJY29uUmVzb3VyY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1MaXN0LmFkZChuZXcgRGlzcGxheVJlc29sdmVJbmZvKHJpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByaS5sb2FkTGFiZWwoZ2V0UGFja2FnZU1hbmFnZXIoKSksIG51bGwsIGlpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgZm9yIGFwcGxpY2F0aW9ucyB3aXRoIHNhbWUgbmFtZSBhbmQgdXNlIGFwcGxpY2F0aW9uIG5hbWUgb3IKICAgICAgICAgICAgICAgICAvLyBwYWNrYWdlIG5hbWUgaWYgbmVjZXNzYXJ5Ci0gICAgICAgICAgICAgICAgbUxpc3QgPSBuZXcgQXJyYXlMaXN0PERpc3BsYXlSZXNvbHZlSW5mbz4oKTsKICAgICAgICAgICAgICAgICByMCA9IHJMaXN0LmdldCgwKTsKICAgICAgICAgICAgICAgICBpbnQgc3RhcnQgPSAwOwogICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSByMExhYmVsID0gIHIwLmxvYWRMYWJlbChtUG0pOwpAQCAtMjY4LDcgKzMwNSw3IEBACiAgICAgICAgICAgICBpbnQgbnVtID0gZW5kIC0gc3RhcnQrMTsKICAgICAgICAgICAgIGlmIChudW0gPT0gMSkgewogICAgICAgICAgICAgICAgIC8vIE5vIGR1cGxpY2F0ZSBsYWJlbHMuIFVzZSBsYWJlbCBmb3IgZW50cnkgYXQgc3RhcnQKLSAgICAgICAgICAgICAgICBtTGlzdC5hZGQobmV3IERpc3BsYXlSZXNvbHZlSW5mbyhybywgcm9MYWJlbCwgbnVsbCkpOworICAgICAgICAgICAgICAgIG1MaXN0LmFkZChuZXcgRGlzcGxheVJlc29sdmVJbmZvKHJvLCByb0xhYmVsLCBudWxsLCBudWxsKSk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNlUGtnID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHN0YXJ0QXBwID0gcm8uYWN0aXZpdHlJbmZvLmFwcGxpY2F0aW9uSW5mby5sb2FkTGFiZWwobVBtKTsKQEAgLTI5OCwxMSArMzM1LDExIEBACiAgICAgICAgICAgICAgICAgICAgIGlmICh1c2VQa2cpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFVzZSBhcHBsaWNhdGlvbiBuYW1lIGZvciBhbGwgZW50cmllcyBmcm9tIHN0YXJ0IHRvIGVuZC0xCiAgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdC5hZGQobmV3IERpc3BsYXlSZXNvbHZlSW5mbyhhZGQsIHJvTGFiZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZC5hY3Rpdml0eUluZm8ucGFja2FnZU5hbWUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkLmFjdGl2aXR5SW5mby5wYWNrYWdlTmFtZSwgbnVsbCkpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gVXNlIHBhY2thZ2UgbmFtZSBmb3IgYWxsIGVudHJpZXMgZnJvbSBzdGFydCB0byBlbmQtMQogICAgICAgICAgICAgICAgICAgICAgICAgbUxpc3QuYWRkKG5ldyBEaXNwbGF5UmVzb2x2ZUluZm8oYWRkLCByb0xhYmVsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGQuYWN0aXZpdHlJbmZvLmFwcGxpY2F0aW9uSW5mby5sb2FkTGFiZWwobVBtKSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGQuYWN0aXZpdHlJbmZvLmFwcGxpY2F0aW9uSW5mby5sb2FkTGFiZWwobVBtKSwgbnVsbCkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQpAQCAtMzIxLDEwICszNTgsMTMgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQobUludGVudCk7CisgICAgICAgICAgICBEaXNwbGF5UmVzb2x2ZUluZm8gZHJpID0gbUxpc3QuZ2V0KHBvc2l0aW9uKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoZHJpLm9yaWdJbnRlbnQgIT0gbnVsbAorICAgICAgICAgICAgICAgICAgICA/IGRyaS5vcmlnSW50ZW50IDogbUludGVudCk7CiAgICAgICAgICAgICBpbnRlbnQuYWRkRmxhZ3MoSW50ZW50LkZMQUdfQUNUSVZJVFlfRk9SV0FSRF9SRVNVTFQKICAgICAgICAgICAgICAgICAgICAgfEludGVudC5GTEFHX0FDVElWSVRZX1BSRVZJT1VTX0lTX1RPUCk7Ci0gICAgICAgICAgICBBY3Rpdml0eUluZm8gYWkgPSBtTGlzdC5nZXQocG9zaXRpb24pLnJpLmFjdGl2aXR5SW5mbzsKKyAgICAgICAgICAgIEFjdGl2aXR5SW5mbyBhaSA9IGRyaS5yaS5hY3Rpdml0eUluZm87CiAgICAgICAgICAgICBpbnRlbnQuc2V0Q29tcG9uZW50KG5ldyBDb21wb25lbnROYW1lKAogICAgICAgICAgICAgICAgICAgICBhaS5hcHBsaWNhdGlvbkluZm8ucGFja2FnZU5hbWUsIGFpLm5hbWUpKTsKICAgICAgICAgICAgIHJldHVybiBpbnRlbnQ7CkBAIC0zNjUsNyArNDA1LDEwIEBACiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHRleHQyLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGljb24uc2V0SW1hZ2VEcmF3YWJsZShpbmZvLnJpLmxvYWRJY29uKG1QbSkpOworICAgICAgICAgICAgaWYgKGluZm8uZGlzcGxheUljb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluZm8uZGlzcGxheUljb24gPSBpbmZvLnJpLmxvYWRJY29uKG1QbSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpY29uLnNldEltYWdlRHJhd2FibGUoaW5mby5kaXNwbGF5SWNvbik7CiAgICAgICAgIH0KICAgICB9CiAKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC9hcHAvU2h1dGRvd25UaHJlYWQuamF2YSBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC9hcHAvU2h1dGRvd25UaHJlYWQuamF2YQppbmRleCA3N2Q2ZTIwLi45ZTFmMzI1IDEwMDY0N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CBJQmx1ZXRvb3RoIGJsdWV0b290aCA9CisgICAgICAgICAgICAgICAgSUJsdWV0b290aC5TdHViLmFzSW50ZXJmYWNlKFNlcnZpY2VNYW5hZ2VyLmNoZWNrU2VydmljZSgKICAgICAgICAgICAgICAgICAgICAgICAgIENvbnRleHQuQkxVRVRPT1RIX1NFUlZJQ0UpKTsKICAgICAgICAgCiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBibHVldG9vdGhPZmYgPSBibHVldG9vdGggPT0gbnVsbCB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZXRvb3RoLmdldEJsdWV0b290aFN0YXRlKCkgPT0gQmx1ZXRvb3RoRGV2aWNlLkJMVUVUT09USF9TVEFURV9PRkY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVldG9vdGguZ2V0Qmx1ZXRvb3RoU3RhdGUoKSA9PSBCbHVldG9vdGhBZGFwdGVyLlNUQVRFX09GRjsKICAgICAgICAgICAgIGlmICghYmx1ZXRvb3RoT2ZmKSB7CiAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRGlzYWJsaW5nIEJsdWV0b290aC4uLiIpOwogICAgICAgICAgICAgICAgIGJsdWV0b290aC5kaXNhYmxlKGZhbHNlKTsgIC8vIGRpc2FibGUgYnV0IGRvbid0IHBlcnNpc3QgbmV3IHN0YXRlCkBAIC0yMTMsNyArMjEzLDcgQEAKICAgICAgICAgICAgIGlmICghYmx1ZXRvb3RoT2ZmKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgYmx1ZXRvb3RoT2ZmID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVldG9vdGguZ2V0Qmx1ZXRvb3RoU3RhdGUoKSA9PSBCbHVldG9vdGhEZXZpY2UuQkxVRVRPT1RIX1NUQVRFX09GRjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVldG9vdGguZ2V0Qmx1ZXRvb3RoU3RhdGUoKS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ZXJ5KFNZTkNfU1RBVEVfVEFCTEUsIEFDQ09VTlRfUFJPSkVDVElPTiwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgYWNjb3VudE5hbWUgPSBjLmdldFN0cmluZygwKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgYWNjb3VudFR5cGUgPSBjLmdldFN0cmluZygxKTsKKyAgICAgICAgICAgICAgICBBY2NvdW50IGFjY291bnQgPSBuZXcgQWNjb3VudChhY2NvdW50TmFtZSwgYWNjb3VudFR5cGUpOworICAgICAgICAgICAgICAgIGlmICghQXJyYXlVdGlscy5jb250YWlucyhhY2NvdW50cywgYWNjb3VudCkpIHsKKyAgICAgICAgICAgICAgICAgICAgZGIuZGVsZXRlKFNZTkNfU1RBVEVfVEFCTEUsIFNFTEVDVF9CWV9BQ0NPVU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXXthY2NvdW50TmFtZSwgYWNjb3VudFR5cGV9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgIH0KKyAgICB9Cit9ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL29zL0JhdHRlcnlTdGF0c0ltcGwuamF2YSBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC9vcy9CYXR0ZXJ5U3RhdHNJbXBsLmphdmEKaW5kZXggYTQ0OWU1Zi4uMmRhNzJkZiAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL29z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KCkKICAgICAgKi8KLSAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGludm9rZVN0YXRpY01haW4oU3RyaW5nIGNsYXNzTmFtZSwgU3RyaW5nW10gYXJndikgCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBpbnZva2VTdGF0aWNNYWluKFN0cmluZyBjbGFzc05hbWUsIFN0cmluZ1tdIGFyZ3YpCiAgICAgICAgICAgICB0aHJvd3MgWnlnb3RlSW5pdC5NZXRob2RBbmRBcmdzQ2FsbGVyIHsKLSAgICAgICAgCisKICAgICAgICAgLy8gV2Ugd2FudCB0byBiZSBmYWlybHkgYWdncmVzc2l2ZSBhYm91dCBoZWFwIHV0aWxpemF0aW9uLCB0byBhdm9pZAogICAgICAgICAvLyBob2xkaW5nIG9uIHRvIGEgbG90IG9mIG1lbW9yeSB0aGF0IGlzbid0IG5lZWRlZC4KICAgICAgICAgVk1SdW50aW1lLmdldFJ1bnRpbWUoKS5zZXRUYXJnZXRIZWFwVXRpbGl6YXRpb24oMC43NWYpOwotICAgICAgICAKKwogICAgICAgICBDbGFzczw/PiBjbDsKIAogICAgICAgICB0cnkgewpAQCAtMTc4LDcgKzE3OCw3IEBACiAKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIHZvaWQgbWFpbihTdHJpbmdbXSBhcmd2KSB7CiAgICAgICAgIGNvbW1vbkluaXQoKTsKLSAgICAgICAgCisKICAgICAgICAgLyoKICAgICAgICAgICogTm93IHRoYXQgd2UncmUgcnVubmluZyBpbiBpbnRlcnByZXRlZCBjb2RlLCBjYWxsIGJhY2sgaW50byBuYXRpdmUgY29kZQogICAgICAgICAgKiB0byBydW4gdGhlIHN5c3RlbS4KQEAgLTE4Nyw3ICsxODcsNyBAQAogCiAgICAgICAgIGlmIChDb25maWcuTE9HVikgTG9nLmQoVEFHLCAiTGVhdmluZyBSdW50aW1lSW5pdCEiKTsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIG5hdGl2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c2FtcGxpbmcgcHJvZmlsZXIuCisgKi8KK3B1YmxpYyBjbGFzcyBTYW1wbGluZ1Byb2ZpbGVySW50ZWdyYXRpb24geworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIFRBRyA9ICJTYW1wbGluZ1Byb2ZpbGVySW50ZWdyYXRpb24iOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgYm9vbGVhbiBlbmFibGVkOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIEV4ZWN1dG9yIHNuYXBzaG90V3JpdGVyOworICAgIHN0YXRpYyB7CisgICAgICAgIGVuYWJsZWQgPSAiMSIuZXF1YWxzKFN5c3RlbVByb3BlcnRpZXMuZ2V0KCJwZXJzaXN0LnNhbXBsaW5nX3Byb2ZpbGVyIikpOworICAgICAgICBpZiAoZW5hYmxlZCkgeworICAgICAgICAgICAgc25hcHNob3RXcml0ZXIgPSBFeGVjdXRvcnMubmV3U2luZ2xlVGhyZWFkRXhlY3V0b3IoKTsKKyAgICAgICAgICAgIExvZy5pKFRBRywgIlByb2ZpbGVyIGlzIGVuYWJsZWQuIik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzbmFwc2hvdFdyaXRlciA9IG51bGw7CisgICAgICAgICAgICBMb2cuaShUQUcsICJQcm9maWxlciBpcyBkaXNhYmxlZC4iKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIElzIHByb2ZpbGluZyBlbmFibGVkPworICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBpc0VuYWJsZWQoKSB7CisgICAgICAgIHJldHVybiBlbmFibGVkOworICAgIH0KKworICAgIC8qKgorICAgICAqIFN0YXJ0cyB0aGUgcHJvZmlsZXIgaWYgcHJvZmlsaW5nIGlzIGVuYWJsZWQuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyB2b2lkIHN0YXJ0KCkgeworICAgICAgICBpZiAoIWVuYWJsZWQpIHJldHVybjsKKyAgICAgICAgU2FtcGxpbmdQcm9maWxlci5nZXRJbnN0YW5jZSgpLnN0YXJ0KDEwKTsKKyAgICB9CisKKyAgICAvKiogV2hldGhlciBvciBub3Qgd2UndmUgY3JlYXRlZCB0aGUgc25hcHNob3RzIGRpci4gKi8KKyAgICBzdGF0aWMgYm9vbGVhbiBkaXJNYWRlID0gZmFsc2U7CisKKyAgICAvKiogV2hldGhlciBvciBub3QgYSBzbmFwc2hvdCBpcyBiZWluZyBwZXJzaXN0ZWQuICovCisgICAgc3RhdGljIHZvbGF0aWxlIGJvb2xlYW4gcGVuZGluZzsKKworICAgIC8qKgorICAgICAqIFdyaXRlcyBhIHNuYXBzaG90IHRvIHRoZSBTRCBjYXJkIGlmIHByb2ZpbGluZyBpcyBlbmFibGVkLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgdm9pZCB3cml0ZVNuYXBzaG90KGZpbmFsIFN0cmluZyBuYW1lKSB7CisgICAgICAgIGlmICghZW5hYmxlZCkgcmV0dXJuOworCisgICAgICAgIGlmICghcGVuZGluZykgeworICAgICAgICAgICAgcGVuZGluZyA9IHRydWU7CisgICAgICAgICAgICBzbmFwc2hvdFdyaXRlci5leGVjdXRlKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBkaXIgPSAiL3NkY2FyZC9zbmFwc2hvdHMiOworICAgICAgICAgICAgICAgICAgICBpZiAoIWRpck1hZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VEaXJlY3RvcnkoZGlyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpck1hZGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVNuYXBzaG90KGRpciwgbmFtZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwZW5kaW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFdyaXRlcyB0aGUgenlnb3RlJ3Mgc25hcHNob3QgdG8gaW50ZXJuYWwgc3RvcmFnZSBpZiBwcm9maWxpbmcgaXMgZW5hYmxlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIHZvaWQgd3JpdGVaeWdvdGVTbmFwc2hvdCgpIHsKKyAgICAgICAgaWYgKCFlbmFibGVkKSByZXR1cm47CisKKyAgICAgICAgU3RyaW5nIGRpciA9ICIvZGF0YS96eWdvdGUvc25hcHNob3RzIjsKKyAgICAgICAgbWFrZURpcmVjdG9yeShkaXIpOworICAgICAgICB3cml0ZVNuYXBzaG90KGRpciwgInp5Z290ZSIpOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgd3JpdGVTbmFwc2hvdChTdHJpbmcgZGlyLCBTdHJpbmcgbmFtZSkgeworICAgICAgICBieXRlW10gc25hcHNob3QgPSBTYW1wbGluZ1Byb2ZpbGVyLmdldEluc3RhbmNlKCkuc25hcHNob3QoKTsKKyAgICAgICAgaWYgKHNuYXBzaG90ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIFdlIHVzZSB0aGUgY3VycmVudCB0aW1lIGFzIGEgdW5pcXVlIElELiBXZSBjYW4ndCB1c2UgYSBjb3VudGVyCisgICAgICAgICAqIGJlY2F1c2UgcHJvY2Vzc2VzIHJlc3RhcnQuIFRoaXMgY291bGQgcmVzdWx0IGluIHNvbWUgb3ZlcmxhcCBpZgorICAgICAgICAgKiB3ZSBjYXB0dXJlIHR3byBzbmFwc2hvdHMgaW4gcmFwaWQgc3VjY2Vzc2lvbi4KKyAgICAgICAgICovCisgICAgICAgIGxvbmcgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgU3RyaW5nIHBhdGggPSBkaXIgKyAiLyIgKyBuYW1lLnJlcGxhY2UoJzonLCAnLicpICsgIi0iCisgICAgICAgICAgICAgICAgKyBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSArICIuc25hcHNob3QiOworICAgICAgICB0cnkgeworICAgICAgICAgICAgLy8gVHJ5IHRvIG9wZW4gdGhlIGZpbGUgYSBmZXcgdGltZXMuIFRoZSBTRCBjYXJkIG1heSBub3QgYmUgbW91bnRlZC4KKyAgICAgICAgICAgIEZpbGVPdXRwdXRTdHJlYW0gb3V0OworICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgb3V0ID0gbmV3IEZpbGVPdXRwdXRTdHJlYW0ocGF0aCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgrK2NvdW50ID4gMykgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IG9wZW4gIiArIHBhdGggKyAiLiIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAvLyBTbGVlcCBmb3IgYSBiaXQgYW5kIHRoZW4gdHJ5IGFnYWluLgorICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgVGhyZWFkLnNsZWVwKDI1MDApOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlMSkgeyAvKiBpZ25vcmUgKi8gfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoc25hcHNob3QpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBvdXQuY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxvbmcgZWxhcHNlZCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7CisgICAgICAgICAgICBMb2cuaShUQUcsICJXcm90ZSBzbmFwc2hvdCBmb3IgIiArIG5hbWUKKyAgICAgICAgICAgICAgICAgICAgKyAiIGluICIgKyBlbGFwc2VkICsgIm1zLiIpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciB3cml0aW5nIHNuYXBzaG90LiIsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBtYWtlRGlyZWN0b3J5KFN0cmluZyBkaXIpIHsKKyAgICAgICAgbmV3IEZpbGUoZGlyKS5ta2RpcnMoKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvb3MvWnlnb3RlSW5pdC5qYXZhIGIvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL29zL1p5Z290ZUluaXQuamF2YQppbmRleCA5NDE0OWUxLi40MDRjNTEzIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvb3MvWnlnb3RlSW5pdC5qYXZhCisrKyBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC9vcy9aeWdvdGVJbml0LmphdmEKQEAgLTE5LDcgKzE5L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AgICAgICogQ29udmVydHMgdmFyaW91cyBmYWlsaW5nIGV4Y2VwdGlvbnMgaW50byBSdW50aW1lRXhjZXB0aW9ucywgd2l0aApAQCAtMTczLDcgKzE5Miw3IEBACiAgICAgICogUnVudGltZUV4Y2VwdGlvbiBvbiBmYWlsdXJlLgogICAgICAqLwogICAgIHByaXZhdGUgc3RhdGljIFp5Z290ZUNvbm5lY3Rpb24gYWNjZXB0Q29tbWFuZFBlZXIoKSB7Ci0gICAgICAgIHRyeSB7ICAgICAgICAgICAgCisgICAgICAgIHRyeSB7CiAgICAgICAgICAgICByZXR1cm4gbmV3IFp5Z290ZUNvbm5lY3Rpb24oc1NlcnZlclNvY2tldC5hY2NlcHQoKSk7CiAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKQEAgLTIzMiw3ICsyNTEsNyBAQAogICAgICAqLwogICAgIHByaXZhdGUgc3RhdGljIHZvaWQgcHJlbG9hZENsYXNzZXMoKSB7CiAgICAgICAgIGZpbmFsIFZNUnVudGltZSBydW50aW1lID0gVk1SdW50aW1lLmdldFJ1bnRpbWUoKTsKLSAgICAgICAgCisKICAgICAgICAgSW5wdXRTdHJlYW0gaXMgPSBaeWdvdGVJbml0LmNsYXNzLmdldENsYXNzTG9hZGVyKCkuZ2V0UmVzb3VyY2VBc1N0cmVhbSgKICAgICAgICAgICAgICAgICBQUkVMT0FERURfQ0xBU1NFUyk7CiAgICAgICAgIGlmIChpcyA9PSBudWxsKSB7CkBAIC0yNDAsNyArMjU5LDcgQEAKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIExvZy5pKFRBRywgIlByZWxvYWRpbmcgY2xhc3Nlcy4uLiIpOwogICAgICAgICAgICAgbG9uZyBzdGFydFRpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICA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nVnLmNhY2hlUmVnaXN0ZXJNYXAoc3RyKSkgeworICAgICAgICAgICAgICAgIGlmIChmYWlsZWQgPT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgZmFpbGVkID0gc3RyOworICAgICAgICAgICAgICAgIGZhaWx1cmUrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGxvbmcgZGVsdGEgPSBTeXN0ZW0ubmFub1RpbWUoKSAtIHN0YXJ0VGltZTsKKworICAgICAgICBpZiAoZmFpbHVyZSA9PSBSRUdJU1RFUl9NQVBfTUVUSE9EUy5sZW5ndGgpIHsKKyAgICAgICAgICAgIGlmIChSRUdJU1RFUl9NQVBfTUVUSE9EUy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLAorICAgICAgICAgICAgICAgICAgICAiUmVnaXN0ZXIgbWFwIGNhY2hpbmcgZmFpbGVkIChwcmVjaXNlIEdDIG5vdCBlbmFibGVkPykiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIExvZy5pKFRBRywgIlJlZ2lzdGVyIG1hcCBjYWNoZTogZm91bmQgIiArCisgICAgICAgICAgICAoUkVHSVNURVJfTUFQX01FVEhPRFMubGVuZ3RoIC0gZmFpbHVyZSkgKyAiIG9mICIgKworICAgICAgICAgICAgUkVHSVNURVJfTUFQX01FVEhPRFMubGVuZ3RoICsgIiBtZXRob2RzIGluICIgKworICAgICAgICAgICAgKGRlbHRhIC8gMTAwMDAwMEwpICsgIm1zIik7CisgICAgICAgIGlmIChmYWlsdXJlID4gMCkgeworICAgICAgICAgICAgTG9nLmkoVEFHLCAiICBGaXJzdCBmYWlsdXJlOiAiICsgZmFpbGVkKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgogICAgICAqIExvYWQgaW4gY29tbW9ubHkgdXNlZCByZXNvdXJjZXMsIHNvIHRoZXkgY2FuIGJlIHNoYXJlZ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KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkNyZWF0ZShTdXJmYWNlSG9sZGVyIHN1cmZhY2VIb2xkZXIpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uQ3JlYXRlKHN1cmZhY2VIb2xkZXIpOworICAgICAgICAgICAgSW50ZW50RmlsdGVyIGZpbHRlciA9IG5ldyBJbnRlbnRGaWx0ZXIoSW50ZW50LkFDVElPTl9XQUxMUEFQRVJfQ0hBTkdFRCk7CisgICAgICAgICAgICBtUmVjZWl2ZXIgPSBuZXcgV2FsbHBhcGVyT2JzZXJ2ZXIoKTsKKyAgICAgICAgICAgIHJlZ2lzdGVyUmVjZWl2ZXIobVJlY2VpdmVyLCBmaWx0ZXIpOworICAgICAgICAgICAgdXBkYXRlV2FsbHBhcGVyKCk7CisgICAgICAgICAgICBzdXJmYWNlSG9sZGVyLnNldFNpemVGcm9tTGF5b3V0KCk7CisgICAgICAgICAgICAvL3NldFRvdWNoRXZlbnRzRW5hYmxlZCh0cnVlKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkRlc3Ryb3koKSB7CisgICAgICAgICAgICBzdXBlci5vbkRlc3Ryb3koKTsKKyAgICAgICAgICAgIHVucmVnaXN0ZXJSZWNlaXZlcihtUmVjZWl2ZXIpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uVmlzaWJpbGl0eUNoYW5nZWQoYm9vbGVhbiB2aXNpYmxlKSB7CisgICAgICAgICAgICBkcmF3RnJhbWUoKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldmVudCkgeworICAgICAgICAgICAgc3VwZXIub25Ub3VjaEV2ZW50KGV2ZW50KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbk9mZnNldHNDaGFuZ2VkKGZsb2F0IHhPZmZzZXQsIGZsb2F0IHlPZmZzZXQsCisgICAgICAgICAgICAgICAgaW50IHhQaXhlbHMsIGludCB5UGl4ZWxzKSB7CisgICAgICAgICAgICBtWE9mZnNldCA9IHhPZmZzZXQ7CisgICAgICAgICAgICBtWU9mZnNldCA9IHlPZmZzZXQ7CisgICAgICAgICAgICBkcmF3RnJhbWUoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvblN1cmZhY2VDaGFuZ2VkKFN1cmZhY2VIb2xkZXIgaG9sZGVyLCBpbnQgZm9ybWF0LCBpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uU3VyZmFjZUNoYW5nZWQoaG9sZGVyLCBmb3JtYXQsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgZHJhd0ZyYW1lKCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25TdXJmYWNlQ3JlYXRlZChTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworICAgICAgICAgICAgc3VwZXIub25TdXJmYWNlQ3JlYXRlZChob2xkZXIpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU3VyZmFjZURlc3Ryb3llZChTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworICAgICAgICAgICAgc3VwZXIub25TdXJmYWNlRGVzdHJveWVkKGhvbGRlcik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHZvaWQgZHJhd0ZyYW1lKCkgeworICAgICAgICAgICAgU3VyZmFjZUhvbGRlciBzaCA9IGdldFN1cmZhY2VIb2xkZXIoKTsKKyAgICAgICAgICAgIENhbnZhcyBjID0gc2gubG9ja0NhbnZhcygpOworICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgZnJhbWUgPSBzaC5nZXRTdXJmYWNlRnJhbWUoKTsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIERyYXdhYmxlIGJhY2tncm91bmQgPSBtQmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGR3ID0gZnJhbWUud2lkdGgoKTsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGRoID0gZnJhbWUuaGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBidyA9IG1CYWNrZ3JvdW5kLmdldEludHJpbnNpY1dpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBiaCA9IG1CYWNrZ3JvdW5kLmdldEludHJpbnNpY0hlaWdodCgpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgYXZhaWx3ID0gYnctZHc7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBhdmFpbGggPSBiaC1kaDsKKyAgICAgICAgICAgICAgICAgICAgaW50IHhQaXhlbHMgPSBhdmFpbHcgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAtKGludCkoYXZhaWx3Km1YT2Zmc2V0Ky41ZikgOiAtKGF2YWlsdy8yKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHlQaXhlbHMgPSBhdmFpbGggPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAtKGludCkoYXZhaWxoKm1ZT2Zmc2V0Ky41ZikgOiAtKGF2YWlsaC8yKTsKKyAgICAgICAgICAgICAgICAgICAgYy50cmFuc2xhdGUoeFBpeGVscywgeVBpeGVscyk7CisgICAgICAgICAgICAgICAgICAgIGMuZHJhd0NvbG9yKDB4ZmYwMDAwMDApOworICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLmRyYXcoYyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNoLnVubG9ja0NhbnZhc0FuZFBvc3QoYyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHVwZGF0ZVdhbGxwYXBlcigpIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgICAgICBtQmFja2dyb3VuZCA9IG1XYWxscGFwZXJNYW5hZ2VyLmdldERyYXdhYmxlKCk7CisgICAgICAgICAgICAgICAgbUJvdW5kcy5sZWZ0ID0gbUJvdW5kcy50b3AgPSAwOworICAgICAgICAgICAgICAgIG1Cb3VuZHMucmlnaHQgPSBtQmFja2dyb3VuZC5nZXRJbnRyaW5zaWNXaWR0aCgpOworICAgICAgICAgICAgICAgIG1Cb3VuZHMuYm90dG9tID0gbUJhY2tncm91bmQuZ2V0SW50cmluc2ljSGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgbUJhY2tncm91bmQuc2V0Qm91bmRzKG1Cb3VuZHMpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3ZpZXcvQmFzZUlXaW5kb3cuamF2YSBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC92aWV3L0Jhc2VJV2luZG93LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZjRmNjI5NwotLS0gL2Rldi9udWxsCisrKyBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC92aWV3L0Jhc2VJV2luZG93LmphdmEKQEAgLTAsMCArMSw5NSBAQAorcGFja2FnZSBjb20uYW5kcm9pZC5pbnRlcm5hbC52aWV3OworCitpbXB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cHRpb24gZXgpIHsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIG9uRGlzcGF0Y2hQb2ludGVyKE1vdGlvbkV2ZW50IGV2ZW50LCBsb25nIGV2ZW50VGltZSwKKyAgICAgICAgICAgIGJvb2xlYW4gY2FsbFdoZW5Eb25lKSB7CisgICAgICAgIGV2ZW50LnJlY3ljbGUoKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaFBvaW50ZXIoTW90aW9uRXZlbnQgZXZlbnQsIGxvbmcgZXZlbnRUaW1lLAorICAgICAgICAgICAgYm9vbGVhbiBjYWxsV2hlbkRvbmUpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChldmVudCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgZXZlbnQgPSBtU2Vzc2lvbi5nZXRQZW5kaW5nUG9pbnRlck1vdmUodGhpcyk7CisgICAgICAgICAgICAgICAgb25EaXNwYXRjaFBvaW50ZXIoZXZlbnQsIGV2ZW50VGltZSwgZmFsc2UpOworICAgICAgICAgICAgfSBlbHNlIGlmIChjYWxsV2hlbkRvbmUpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW9uRGlzcGF0Y2hQb2ludGVyKGV2ZW50LCBldmVudFRpbWUsIHRydWUpKSB7CisgICAgICAgICAgICAgICAgICAgIG1TZXNzaW9uLmZpbmlzaEtleSh0aGlzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG9uRGlzcGF0Y2hQb2ludGVyKGV2ZW50LCBldmVudFRpbWUsIGZhbHNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBvbkRpc3BhdGNoVHJhY2tiYWxsKE1vdGlvbkV2ZW50IGV2ZW50LCBsb25nIGV2ZW50VGltZSwKKyAgICAgICAgICAgIGJvb2xlYW4gY2FsbFdoZW5Eb25lKSB7CisgICAgICAgIGV2ZW50LnJlY3ljbGUoKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaFRyYWNrYmFsbChNb3Rpb25FdmVudCBldmVudCwgbG9uZyBldmVudFRpbWUsCisgICAgICAgICAgICBib29sZWFuIGNhbGxXaGVuRG9uZSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKGV2ZW50ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBldmVudCA9IG1TZXNzaW9uLmdldFBlbmRpbmdUcmFja2JhbGxNb3ZlKHRoaXMpOworICAgICAgICAgICAgICAgIG9uRGlzcGF0Y2hUcmFja2JhbGwoZXZlbnQsIGV2ZW50VGltZSwgZmFsc2UpOworICAgICAgICAgICAgfSBlbHNlIGlmIChjYWxsV2hlbkRvbmUpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW9uRGlzcGF0Y2hUcmFja2JhbGwoZXZlbnQsIGV2ZW50VGltZSwgdHJ1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgbVNlc3Npb24uZmluaXNoS2V5KHRoaXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgb25EaXNwYXRjaFRyYWNrYmFsbChldmVudCwgZXZlbnRUaW1lLCBmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hBcHBWaXNpYmlsaXR5KGJvb2xlYW4gdmlzaWJsZSkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoR2V0TmV3U3V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gYWJzdHJhY3Qgdm9pZCBvblJlbGF5b3V0Q29udGFpbmVyKCk7CisgICAgcHVibGljIGFic3RyYWN0IGJvb2xlYW4gb25BbGxvd0xvY2tDYW52YXMoKTsKKyAgICAKKyAgICBwdWJsaWMgaW50IGdldFJlcXVlc3RlZFdpZHRoKCkgeworICAgICAgICByZXR1cm4gbVJlcXVlc3RlZFdpZHRoOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgaW50IGdldFJlcXVlc3RlZEhlaWdodCgpIHsKKyAgICAgICAgcmV0dXJuIG1SZXF1ZXN0ZWRIZWlnaHQ7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBpbnQgZ2V0UmVxdWVzdGVkRm9ybWF0KCkgeworICAgICAgICByZXR1cm4gbVJlcXVlc3RlZEZvcm1hdDsKKyAgICB9CisgICAgCisgICAgcHVibGljIGludCBnZXRSZXF1ZXN0ZWRUeXBlKCkgeworICAgICAgICByZXR1cm4gbVJlcXVlc3RlZFR5cGU7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGFkZENhbGxiYWNrKENhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobUNhbGxiYWNrcykgeworICAgICAgICAgICAgLy8gVGhpcyBpcyBhIGxpbmVhciBzZWFyY2gsIGJ1dCBpbiBwcmFjdGljZSB3ZSdsbCAKKyAgICAgICAgICAgIC8vIGhhdmUgb25seSBhIGNvdXBsZSBjYWxsYmFja3MsIHNvIGl0IGRvZXNuJ3QgbWF0dGVyLgorICAgICAgICAgICAgaWYgKG1DYWxsYmFja3MuY29udGFpbnMoY2FsbGJhY2spID09IGZhbHNlKSB7ICAgICAgCisgICAgICAgICAgICAgICAgbUNhbGxiYWNrcy5hZGQoY2FsbGJhY2spOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcmVtb3ZlQ2FsbGJhY2soQ2FsbGJhY2sgY2FsbGJhY2spIHsKKyAgIC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UkRXQVJFOgorICAgICAgICBjYXNlIFNVUkZBQ0VfVFlQRV9HUFU6CisgICAgICAgICAgICAvLyB0aGVzZSBhcmUgZGVwcmVjYXRlZCwgdHJlYXQgYXMgIk5PUk1BTCIKKyAgICAgICAgICAgIHR5cGUgPSBTVVJGQUNFX1RZUEVfTk9STUFMOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgc3dpdGNoICh0eXBlKSB7CisgICAgICAgIGNhc2UgU1VSRkFDRV9UWVBFX05PUk1BTDoKKyAgICAgICAgY2FzZSBTVVJGQUNFX1RZUEVfUFVTSF9CVUZGRVJTOgorICAgICAgICAgICAgaWYgKG1SZXF1ZXN0ZWRUeXBlICE9IHR5cGUpIHsKKyAgICAgICAgICAgICAgICBtUmVxdWVzdGVkVHlwZSA9IHR5cGU7CisgICAgICAgICAgICAgICAgb25VcGRhdGVTdXJmYWNlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBDYW52YXMgbG9ja0NhbnZhcygpIHsKKyAgICAgICAgcmV0dXJuIGludGVybmFsTG9ja0NhbnZhcyhudWxsKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ2FudmFzIGxvY2tDYW52YXMoUmVjdCBkaXJ0eSkgeworICAgICAgICByZXR1cm4gaW50ZXJuYWxMb2NrQ2FudmFzKGRpcnR5KTsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIENhbnZhcyBpbnRlcm5hbExvY2tDYW52YXMoUmVjdCBkaXJ0eSkgeworICAgICAgICBpZiAobVR5cGUgPT0gU1VSRkFDRV9UWVBFX1BVU0hfQlVGRkVSUykgeworICAgICAgICAgICAgdGhyb3cgbmV3IEJhZFN1cmZhY2VUeXBlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAiU3VyZmFjZSB0eXBlIGlzIFNVUkZBQ0VfVFlQRV9QVVNIX0JVRkZFUlMiKTsKKyAgICAgICAgfQorICAgICAgICBtU3VyZmFjZUxvY2subG9jaygpOworCisgICAgICAgIGlmIChERUJVRykgTG9nLmkoVEFHLCAiTG9ja2luZyBjYW52YXMuLiwiKTsKKworICAgICAgICBDYW52YXMgYyA9IG51bGw7CisgICAgICAgIGlmIChvbkFsbG93TG9ja0NhbnZhcygpKSB7CisgICAgICAgICAgICBSZWN0IGZyYW1lID0gZGlydHkgIT0gbnVsbCA/IGRpcnR5IDogbVN1cmZhY2VGcmFtZTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgYyA9IG1TdXJmYWNlLmxvY2tDYW52YXMoZnJhbWUpOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFeGNlcHRpb24gbG9ja2luZyBzdXJmYWNlIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoREVCVUcpIExvZy5pKFRBRywgIlJldHVybmVkIGNhbnZhczogIiArIGMpOworICAgICAgICBpZiAoYyAhPSBudWxsKSB7CisgICAgICAgICAgICBtTGFzdExvY2tUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICByZXR1cm4gYzsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gSWYgdGhlIFN1cmZhY2UgaXMgbm90IHJlYWR5IHRvIGJlIGRyYXduLCB0aGVuIHJldHVybiBudWxsLAorICAgICAgICAvLyBidXQgdGhyb3R0bGUgY2FsbHMgdG8gdGhpcyBmdW5jdGlvbiBzbyBpdCBpc24ndCBjYWxsZWQgbW9yZQorICAgICAgICAvLyB0aGFuIGV2ZXJ5IDEwMG1zLgorICAgICAgICBsb25nIG5vdyA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICBsb25nIG5leHRUaW1lID0gbUxhc3RMb2NrVGltZSArIDEwMDsKKyAgICAgICAgaWYgKG5leHRUaW1lID4gbm93KSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIFRocmVhZC5zbGVlcChuZXh0VGltZS1ub3cpOworICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgfQorICAgICAgICAgICAgbm93ID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgIH0KKyAgICAgICAgbUxhc3RMb2NrVGltZSA9IG5vdzsKKyAgICAgICAgbVN1cmZhY2VMb2NrLnVubG9jaygpOworICAgICAgICAKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdW5sb2NrQ2FudmFzQW5kUG9zdChDYW52YXMgY2FudmFzKSB7CisgICAgICAgIG1TdXJmYWNlLnVubG9ja0NhbnZhc0FuZFBvc3QoY2FudmFzKTsKKyAgICAgICAgbVN1cmZhY2VMb2NrLnVubG9jaygpOworICAgIH0KKworICAgIHB1YmxpYyBTdXJmYWNlIGdldFN1cmZhY2UoKSB7CisgICAgICAgIHJldHVybiBtU3VyZmFjZTsKKyAgICB9CisKKyAgICBwdWJsaWMgUmVjdCBnZXRTdXJmYWNlRnJhbWUoKSB7CisgICAgICAgIHJldHVybiBtU3VyZmFjZUZyYW1lOworICAgIH0KK307CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvd2lkZ2V0L0NvbnRhY3RIZWFkZXJXaWRnZXQuamF2YSBiL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC93aWRnZXQvQ29udGFjdEhlYWRlcldpZGdldC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjRkZDI4OWMKLS0tIC9kZXYvbnVsbAorKysgYi9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvd2lkZ2V0L0NvbnRh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ZGdldChDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgdGhpcyhjb250ZXh0LCBudWxsKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ29udGFjdEhlYWRlcldpZGdldChDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycykgeworICAgICAgICB0aGlzKGNvbnRleHQsIGF0dHJzLCAwKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ29udGFjdEhlYWRlcldpZGdldChDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycywgaW50IGRlZlN0eWxlKSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQsIGF0dHJzLCBkZWZTdHlsZSk7CisKKyAgICAgICAgbUNvbnRlbnRSZXNvbHZlciA9IG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpOworCisgICAgICAgIExheW91dEluZmxhdGVyIGluZmxhdGVyID0KKyAgICAgICAgICAgIChMYXlvdXRJbmZsYXRlcikgbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LkxBWU9VVF9JTkZMQVRFUl9TRVJWSUNFKTsKKyAgICAgICAgaW5mbGF0ZXIuaW5mbGF0ZShSLmxheW91dC5jb250YWN0X2hlYWRlciwgdGhpcyk7CisKKyAgICAgICAgbURpc3BsYXlOYW1lVmlldyA9IChUZXh0VmlldykgZmluZFZpZXdCeUlkKFIuaWQubmFtZSk7CisgICAgICAgIG1EaXNwbGF5TmFtZVZpZXcuc2V0T25Mb25nQ2xpY2tMaXN0ZW5lcih0aGlzKTsKKworICAgICAgICBtUGhvbmV0aWNOYW1lVmlldyA9IChUZXh0VmlldykgZmluZFZpZXdCeUlkKFIuaWQucGhvbmV0aWNfbmFtZSk7CisKKyAgICAgICAgbVN0YXJyZWRWaWV3ID0gKENoZWNrQm94KWZpbmRWaWV3QnlJZChSLmlkLnN0YXIpOworICAgICAgICBtU3RhcnJlZFZpZXcuc2V0T25DbGlja0xpc3RlbmVyKHRoaXMpOworCisgICAgICAgIG1QaG90b1ZpZXcgPSAoSW1hZ2VWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnBob3RvKTsKKyAgICAgICAgbVBob3RvVmlldy5zZXRPbkNsaWNrTGlzdGVuZXIodGhpcyk7CisgICAgICAgIG1QaG90b1ZpZXcuc2V0T25Mb25nQ2xpY2tMaXN0ZW5lcih0aGlzKTsKKworICAgICAgICBtUHJlc2VuY2VWaWV3ID0gKEltYWdlVmlldykgZmluZFZpZXdCeUlkKFIuaWQucHJlc2VuY2UpOworCisgICAgICAgIG1TdGF0dXNWaWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnN0YXR1cyk7CisKKyAgICAgICAgLy8gU2V0IHRoZSBwaG90byB3aXRoIGEgcmFuZG9tICJubyBjb250YWN0IiBpbWFnZQorICAgICAgICBsb25nIG5vdyA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOworICAgICAgICBpbnQgbnVtID0gKGludCkgbm93ICYgMHhmOworICAgICAgICBpZiAobnVtIDwgOSkgeworICAgICAgICAgICAgLy8gTGVhbmluZyBpbiBmcm9tIHJpZ2h0LCBjb21tb24KKyAgICAgICAgICAgIG1Ob1Bob3RvUmVzb3VyY2UgPSBSLmRyYXdhYmxlLmljX2NvbnRhY3RfcGljdHVyZTsKKyAgICAgICAgfSBlbHNlIGlmIChudW0gPCAxNCkgeworICAgICAgICAgICAgLy8gTGVhbmluZyBpbiBmcm9tIGxlZnQgdW5jb21tb24KKyAgICAgICAgICAgIG1Ob1Bob3RvUmVzb3VyY2UgPSBSLmRyYXdhYmxlLmljX2NvbnRhY3RfcGljdHVyZV8yOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gQ29taW5nIGluIGZyb20gdGhlIHRvcCwgcmFyZQorICAgICAgICAgICAgbU5vUGhvdG9SZXNvdXJjZSA9IFIuZHJhd2FibGUuaWNfY29udGFjdF9waWN0dXJlXzM7CisgICAgICAgIH0KKworICAgICAgICBtUXVlcnlIYW5kbGVyID0gbmV3IFF1ZXJ5SGFuZGxlcihtQ29udGVudFJlc29sdmVyKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgdGhlIGdpdmVuIHtAbGluayBDb250YWN0SGVhZGVyTGlzdGVuZXJ9IHRvIGhhbmRsZSBoZWFkZXIgZXZlbnRzLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldENvbnRhY3RIZWFkZXJMaXN0ZW5lcihDb250YWN0SGVhZGVyTGlzdGVuZXIgbGlzdGVuZXIpIHsKKyAgICAgICAgbUxpc3RlbmVyID0gbGlzdGVuZXI7CisgICAgfQorCisgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBvbkxvbmdDbGljayhWaWV3IHYpIHsKKyAgICAgICAgc3dpdGNoICh2LmdldElkKCkpIHsKKyAgICAgICAgICAgIGNhc2UgUi5pZC5waG90bzoKKyAgICAgICAgICAgICAgICBwZXJmb3JtUGhvdG9Mb25nQ2xpY2soKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIGNhc2UgUi5pZC5uYW1lOgorICAgICAgICAgICAgICAgIHBlcmZvcm1EaXNwbGF5TmFtZUxvbmdDbGljaygpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcGVyZm9ybVBob3RvTG9uZ0NsaWNrKCkgeworICAgICAgICBpZiAobUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1MaXN0ZW5lci5vblBob3RvTG9uZ0NsaWNrKG1QaG90b1ZpZXcpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHBlcmZvcm1EaXNwbGF5TmFtZUxvbmdDbGljaygpIHsKKyAgICAgICAgaWYgKG1MaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICBtTGlzdGVuZXIub25EaXNwbGF5TmFtZUxvbmdDbGljayhtRGlzcGxheU5hbWVWaWV3KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgUXVlcnlIYW5kbGVyIGV4dGVuZHMgQXN5bmNRdWVyeUhhbmRsZXIgeworCisgICAgICAgIHB1YmxpYyBRdWVyeUhhbmRsZXIoQ29udGVudFJlc29sdmVyIGNyKSB7CisgICAgICAgICAgICBzdXBlcihjcik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25RdWVyeUNvbXBsZXRlKGludCB0b2tlbiwgT2JqZWN0IGNvb2tpZSwgQ3Vyc29yIGN1cnNvcikgeworICAgICAgICAgICAgdHJ5eworICAgICAgICAgICAgICAgIGlmICh0b2tlbiA9PSBUT0tFTl9DT05UQUNUX0lORk8pIHsKKyAgICAgICAgICAgICAgICAgICAgYmluZENvbnRhY3RJbmZvKGN1cnNvcik7CisgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuID09IFRPS0VOX1NPQ0lBTCkgeworICAgICAgICAgICAgICAgICAgICBiaW5kU29jaWFsKGN1cnNvcik7CisgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUdXJuIG9uL29mZiBzaG93aW5nIG9mIHRoZSBzdGFyIGVsZW1lbnQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2hvd1N0YXIoYm9vbGVhbiBzaG93U3RhcikgeworICAgICAgICBtU3RhcnJlZFZpZXcuc2V0VmlzaWJpbGl0eShzaG93U3RhciA/IFZpZXcuVklTSUJMRSA6IFZpZXcuR09ORSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogTWFudWFsbHkgc2V0IHRoZSBzdGFycmVkIHN0YXRlIG9mIHRoaXMgaGVhZGVyIHdpZGdldC4gVGhpcyBkb2Vzbid0IGNoYW5nZQorICAgICAqIHRoZSB1bmRlcmx5aW5nIHtAbGluayBDb250YWN0c30gdmFsdWUsIG9ubHkgdGhlIFVJIHN0YXRlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFN0YXJlZChib29sZWFuIHN0YXJyZWQpIHsKKyAgICAgICAgbVN0YXJyZWRWaWV3LnNldENoZWNrZWQoc3RhcnJlZCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogTWFudWFsbHkgc2V0IHRoZSBwcmVzZW5jZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRQcmVzZW5jZShpbnQgcHJlc2VuY2UpIHsKKyAgICAgICAgbVByZXNlbmNlVmlldy5zZXRJbWFnZVJlc291cmNlKFByZXNlbmNlLmdldFByZXNlbmNlSWNvblJlc291cmNlSWQocHJlc2VuY2UpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBNYW51YWxseSBzZXQgdGhlIGNvbnRhY3QgdXJpCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0Q29udGFjdFVyaShVcmkgdXJpKSB7CisgICAgICAgIG1Db250YWN0VXJpID0gdXJpOworICAgIH0KKworICAgIC8qKgorICAgICAqIE1hbnVhbGx5IHNldCB0aGUgcGhvdG8gdG8gZGlzcGxheSBpbiB0aGUgaGVhZGVyLiBUaGlzIGRvZXNuJ3QgY2hhbmdlIHRoZQorICAgICAqIHVuZGVybHlpbmcge0BsaW5rIENvbnRhY3RzfSwgb25seSB0aGUgVUkgc3RhdGUuCisgICAgIC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dG8gaGlkZSB0aGUge0BsaW5rIENvbnRhY3RzI0NPTlRFTlRfSVRFTV9UWVBFfQorICAgICAqIHByb2ZpbGUgaWNvbi4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRFeGNsdWRlTWltZXMoU3RyaW5nW10gZXhjbHVkZU1pbWVzKSB7CisgICAgICAgIG1FeGNsdWRlTWltZXMgPSBleGNsdWRlTWltZXM7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29udmVuaWVuY2UgbWV0aG9kIGZvciBiaW5kaW5nIGFsbCBhdmFpbGFibGUgZGF0YSBmcm9tIGFuIGV4aXN0aW5nCisgICAgICogY29udGFjdC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjb250YWN0SWQgdGhlIGNvbnRhY3QgaWQgb2YgdGhlIGNvbnRhY3Qgd2hvc2UgaW5mbyBzaG91bGQgYmUgZGlzcGxheWVkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGJpbmRGcm9tQ29udGFjdElkKGxvbmcgY29udGFjdElkKSB7CisgICAgICAgIG1Db250YWN0SWQgPSBjb250YWN0SWQ7CisgICAgICAgIG1Db250YWN0VXJpID0gQ29udGVudFVyaXMud2l0aEFwcGVuZGVkSWQoQ29udGFjdHMuQ09OVEVOVF9VUkksIG1Db250YWN0SWQpOworCisgICAgICAgIGJpbmRDb250YWN0VXJpKG1Db250YWN0VXJpKTsKKyAgICAgICAgYmluZFNvY2lhbFVyaShDb250ZW50VXJpcy53aXRoQXBwZW5kZWRJZChBY3Rpdml0aWVzLkNPTlRFTlRfQ09OVEFDVF9TVEFUVVNfVVJJLCBtQ29udGFjdElkKSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29udmVuaWVuY2UgbWV0aG9kIGZvciBiaW5kaW5nIHtAbGluayBDb250YWN0c30gaGVhZGVyIGRldGFpbHMgZnJvbSBhCisgICAgICoge0BsaW5rIENvbnRhY3RzI0NPTlRFTlRfVVJJfSByZWZlcmVuY2UuCisgICAgICov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BvZiB0aGVtIHdpbGwgYmUgY2hvc2VuIHRvIGJpbmQgdG8uCisgICAgICovCisgICAgcHVibGljIHZvaWQgYmluZEZyb21FbWFpbChTdHJpbmcgZW1haWxBZGRyZXNzKSB7CisgICAgICAgIEN1cnNvciBjID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGMgPSBtQ29udGVudFJlc29sdmVyLnF1ZXJ5KFVyaS53aXRoQXBwZW5kZWRQYXRoKEVtYWlsLkNPTlRFTlRfRklMVEVSX0VNQUlMX1VSSSwgVXJpCisgICAgICAgICAgICAgICAgICAgIC5lbmNvZGUoZW1haWxBZGRyZXNzKSksIEVNQUlMX0xPT0tVUF9QUk9KRUNUSU9OLCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChjICE9IG51bGwgJiYgYy5tb3ZlVG9GaXJzdCgpKSB7CisgICAgICAgICAgICAgICAgbG9uZyBjb250YWN0SWQgPSBjLmdldExvbmcoRU1BSUxfTE9PS1VQX0NPTlRBQ1RfSURfQ09MVU1OX0lOREVYKTsKKyAgICAgICAgICAgICAgICBiaW5kRnJvbUNvbnRhY3RJZChjb250YWN0SWQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzZXREaXNwbGF5TmFtZShlbWFpbEFkZHJlc3MsIG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGMuY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnZlbmllbmNlIG1ldGhvZCBmb3IgYmluZGluZyBhbGwgYXZhaWxhYmxlIGRhdGEgZnJvbSBhbiBleGlzdGluZworICAgICAqIGNvbnRhY3QuCisgICAgICoKKyAgICAgKiBAcGFyYW0gbnVtYmVyIFRoZSBwaG9uZSBudW1iZXIgdXNlZCB0byBkbyBhIHJldmVyc2UgbG9va3VwIGluCisgICAgICogdGhlIGNvbnRhY3RzIGRhdGFiYXNlLiBJZiBtb3JlIHRoYW4gb25lIGNvbnRhY3QgY29udGFpbnMgdGhpcyBwaG9uZQorICAgICAqIG51bWJlciwgb25lIG9mIHRoZW0gd2lsbCBiZSBjaG9zZW4gdG8gYmluZCB0by4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBiaW5kRnJvbVBob25lTnVtYmVyKFN0cmluZyBudW1iZXIpIHsKKyAgICAgICAgQ3Vyc29yIGMgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgYyA9IG1Db250ZW50UmVzb2x2ZXIucXVlcnkoVXJpLndpdGhBcHBlbmRlZFBhdGgoUGhvbmVMb29rdXAuQ09OVEVOVF9GSUxURVJfVVJJLCBudW1iZXIpLAorICAgICAgICAgICAgICAgICAgICBQSE9ORV9MT09LVVBfUFJPSkVDVElPTiwgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICBpZiAoYyAhPSBudWxsICYmIGMubW92ZVRvRmlyc3QoKSkgeworICAgICAgICAgICAgICAgIGxvbmcgY29udGFjdElkID0gYy5nZXRMb25nKFBIT05FX0xPT0tVUF9DT05UQUNUX0lEX0NPTFVNTl9JTkRFWCk7CisgICAgICAgICAgICAgICAgYmluZEZyb21Db250YWN0SWQoY29udGFjdElkKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2V0RGlzcGxheU5hbWUobnVtYmVyLCBudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBCaW5kIHRoZSBjb250YWN0IGRldGFpbHMgcHJvdmlkZWQgYnkgdGhlIGdpdmVuIHtAbGluayBDdXJzb3J9LgorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIGJpbmRDb250YWN0SW5mbyhDdXJzb3IgYykgeworICAgICAgICBpZiAoYyA9PSBudWxsIHx8ICFjLm1vdmVUb0ZpcnN0KCkpIHJldHVybjsKKworICAgICAgICAvLyBUT0RPOiBCcmluZyBiYWNrIHBob25ldGljIG5hbWUKKyAgICAgICAgZmluYWwgU3RyaW5nIGRpc3BsYXlOYW1lID0gYy5nZXRTdHJpbmcoSEVBREVSX0RJU1BMQVlfTkFNRV9DT0xVTU5fSU5ERVgpOworICAgICAgICBmaW5hbCBTdHJpbmcgcGhvbmV0aWNOYW1lID0gbnVsbDsKKyAgICAgICAgdGhpcy5zZXREaXNwbGF5TmFtZShkaXNwbGF5TmFtZSwgbnVsbCk7CisKKyAgICAgICAgZmluYWwgYm9vbGVhbiBzdGFycmVkID0gYy5nZXRJbnQoSEVBREVSX1NUQVJSRURfQ09MVU1OX0lOREVYKSAhPSAwOworICAgICAgICBtU3RhcnJlZFZpZXcuc2V0Q2hlY2tlZChzdGFycmVkKTsKKworICAgICAgICAvL1NldCB0aGUgcGhvdG8KKyAgICAgICAgQml0bWFwIHBob3RvQml0bWFwID0gbG9hZENvbnRhY3RQaG90byhjLmdldExvbmcoSEVBREVSX1BIT1RPX0lEX0NPTFVNTl9JTkRFWCksIG51bGwpOworICAgICAgICBpZiAocGhvdG9CaXRtYXAgPT0gbnVsbCkgeworICAgICAgICAgICAgcGhvdG9CaXRtYXAgPSBsb2FkUGxhY2Vob2xkZXJQaG90byhudWxsKTsKKyAgICAgICAgfQorICAgICAgICBtUGhvdG9WaWV3LnNldEltYWdlQml0bWFwKHBob3RvQml0bWFwKTsKKworICAgICAgICAvL1NldCB0aGUgcHJlc2VuY2Ugc3RhdHVzCisgICAgICAgIGludCBwcmVzZW5jZSA9IGMuZ2V0SW50KEhFQURFUl9QUkVTRU5DRV9TVEFUVVNfQ09MVU1OX0lOREVYKTsKKyAgICAgICAgbVByZXNlbmNlVmlldy5zZXRJbWFnZVJlc291cmNlKFByZXNlbmNlLmdldFByZXNlbmNlSWNvblJlc291cmNlSWQocHJlc2VuY2UpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBCaW5kIHRoZSBzb2NpYWwgZGF0YSBwcm92aWRlZCBieSB0aGUgZ2l2ZW4ge0BsaW5rIEN1cnNvcn0uCisgICAgICovCisgICAgcHJvdGVjdGVkIHZvaWQgYmluZFNvY2lhbChDdXJzb3IgYykgeworICAgICAgICBpZiAoYyA9PSBudWxsIHx8ICFjLm1vdmVUb0ZpcnN0KCkpIHJldHVybjsKKyAgICAgICAgZmluYWwgU3RyaW5nIHN0YXR1cyA9IGMuZ2V0U3RyaW5nKFNPQ0lBTF9USVRMRV9DT0xVTU5fSU5ERVgpOworICAgICAgICB0aGlzLnNldFNvY2lhbFNuaXBwZXQoc3RhdHVzKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdmlldykgeworICAgICAgICAvLyBNYWtlIHN1cmUgdGhlcmUgaXMgYSBjb250YWN0CisgICAgICAgIGlmIChtQ29udGFjdFVyaSA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBzd2l0Y2ggKHZpZXcuZ2V0SWQoKSkgeworICAgICAgICAgICAgY2FzZSBSLmlkLnN0YXI6IHsKKyAgICAgICAgICAgICAgICAvLyBUb2dnbGUgInN0YXJyZWQiIHN0YXRlCisgICAgICAgICAgICAgICAgZmluYWwgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSBuZXcgQ29udGVudFZhbHVlcygxKTsKKyAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KENvbnRhY3RzLlNUQVJSRUQsIG1TdGFycmVkVmlldy5pc0NoZWNrZWQoKSk7CisgICAgICAgICAgICAgICAgbUNvbnRlbnRSZXNvbHZlci51cGRhdGUobUNvbnRhY3RVcmksIHZhbHVlcywgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIFIuaWQucGhvdG86IHsKKyAgICAgICAgICAgICAgICAvLyBQaG90byBsYXVuY2hlcyBjb250YWN0IGRldGFpbCBhY3Rpb24KKyAgICAgICAgICAgICAgICBmaW5hbCBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnRzLlNIT1dfT1JfQ1JFQVRFX0NPTlRBQ1QsIG1Db250YWN0VXJpKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBSZWN0IHRhcmdldCA9IGdldFRhcmdldFJlY3Qodmlldyk7CisgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEludGVudHMuRVhUUkFfVEFSR0VUX1JFQ1QsIHRhcmdldCk7CisgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKEludGVudHMuRVhUUkFfTU9ERSwgSW50ZW50cy5NT0RFX1NNQUxMKTsKKyAgICAgICAgICAgICAgICBpZiAobUV4Y2x1ZGVNaW1lcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIEV4Y2x1ZGUgc3BlY2lmaWMgTUlNRS10eXBlcyB3aGVuIHJlcXVlc3RlZAorICAgICAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoSW50ZW50cy5FWFRSQV9FWENMVURFX01JTUVTLCBtRXhjbHVkZU1pbWVzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUNvbnRleHQuc3RhcnRBY3Rpdml0eShpbnRlbnQpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBSZWN0IGdldFRhcmdldFJlY3QoVmlldyBhbmNob3IpIHsKKyAgICAgICAgZmluYWwgaW50W10gbG9jYXRpb24gPSBuZXcgaW50WzJdOworICAgICAgICBhbmNob3IuZ2V0TG9jYXRpb25PblNjcmVlbihsb2NhdGlvbik7CisKKyAgICAgICAgZmluYWwgUmVjdCByZWN0ID0gbmV3IFJlY3QoKTsKKyAgICAgICAgcmVjdC5sZWZ0ID0gbG9jYXRpb25bMF07CisgICAgICAgIHJlY3QudG9wID0gbG9jYXRpb25bMV07CisgICAgICAgIHJlY3QucmlnaHQgPSByZWN0LmxlZnQgKyBhbmNob3IuZ2V0V2lkdGgoKTsKKyAgICAgICAgcmVjdC5ib3R0b20gPSByZWN0LnRvcCArIGFuY2hvci5nZXRIZWlnaHQoKTsKKyAgICAgICAgcmV0dXJuIHJlY3Q7CisgICAgfQorCisgICAgcHJpdmF0ZSBCaXRtYXAgbG9hZENvbnRhY3RQaG90byhsb25nIHBob3RvSWQsIEJpdG1hcEZhY3RvcnkuT3B0aW9ucyBvcHRpb25zKSB7CisgICAgICAgIEN1cnNvciBwaG90b0N1cnNvciA9IG51bGw7CisgICAgICAgIEJpdG1hcCBwaG90b0JtID0gbnVsbDsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgcGhvdG9DdXJzb3IgPSBtQ29udGVudFJlc29sdmVyLnF1ZXJ5KAorICAgICAgICAgICAgICAgICAgICBDb250ZW50VXJpcy53aXRoQXBwZW5kZWRJZChEYXRhLkNPTlRFTlRfVVJJLCBwaG90b0lkKSwKKyAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgUGhvdG8uUEhPVE8gfSwKKyAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCk7CisKKyAgICAgICAgICAgIGlmIChwaG90b0N1cnNvciAhPSBudWxsICYmIHBob3RvQ3Vyc29yLm1vdmVUb0ZpcnN0KCkgJiYgIXBob3RvQ3Vyc29yLmlzTnVsbCgwKSkgeworICAgICAgICAgICAgICAgIGJ5dGVbXSBwaG90b0RhdGEgPSBwaG90b0N1cnNvci5nZXRCbG9iKDApOworICAgICAgICAgICAgICAgIHBob3RvQm0gPSBCaXRtYXBGYWN0b3J5LmRlY29kZUJ5dGVBcnJheShwaG90b0RhdGEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBwaG90b0RhdGEubGVuZ3RoLCBvcHRpb25zKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChwaG90b0N1cnNvciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcGhvdG9DdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBwaG90b0JtOworICAgIH0KKworICAgIHByaXZhdGUgQml0bWFwIGxvYWRQbGFjZWhvbGRlclBob3RvKEJpdG1hcEZhY3RvcnkuT3B0aW9ucyBvcHRpb25zKSB7CisgICAgICAgIGlmIChtTm9QaG90b1Jlc291cmNlID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHJldHVybiBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKG1Db250ZXh0LmdldFJlc291cmNlcygpLAorICAgICAgICAgICAgICAgIG1Ob1Bob3RvUmVzb3VyY2UsIG9wdGlvbnMpOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC93aWRnZXQvTG9ja1BhdHRlcm5VdGlscy5qYXZhIGIvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3dpZGdldC9Mb2NrUGF0dGVyblV0aWxzLmphdmEKaW5kZXggZjBiMzExYy4uNTgwNTZiZCAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3dpZGdldC9Mb2NrUGF0dGVyblV0aWxzLmphdmEKKysrIGIvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3dpZGdldC9Mb2NrUGF0dGVyblV0aWxzLmphdmEKQEAgLTMxNiwyMCArMzE2LDE0IEBACiAKICAgICAvKioKICAgICA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byBkaXNwbGF5IHRvIHRoZSB1c2VyLgotICAgICAqIAorICAgICAqCiAgICAgICogQHBhcmFtIHN0YXJ0IHRoZSBzdGFydCBvZiB0aGUgcmFuZ2UgKGluY2x1c2l2ZSkKICAgICAgKiBAcGFyYW0gZW5kIHRoZSBlbmQgb2YgdGhlIHJhbmdlIChpbmNsdXNpdmUpCiAgICAgICogQHBhcmFtIGRpc3BsYXllZFZhbHVlcyB0aGUgdmFsdWVzIGRpc3BsYXllZCB0byB0aGUgdXNlci4KQEAgLTE3NCw3ICsxNzQsNyBAQAogICAgICAgICBtQ3VycmVudCA9IHN0YXJ0OwogICAgICAgICB1cGRhdGVWaWV3KCk7CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgc2V0Q3VycmVudChpbnQgY3VycmVudCkgewogICAgICAgICBtQ3VycmVudCA9IGN1cnJlbnQ7CiAgICAgICAgIHVwZGF0ZVZpZXcoKTsKQEAgLTE4Nyw3ICsxODcsNyBAQAogICAgIHB1YmxpYyB2b2lkIHNldFNwZWVkKGxvbmcgc3BlZWQpIHsKICAgICAgICAgbVNwZWVkID0gc3BlZWQ7CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKICAgICAgICAgdmFsaWRhdGVJbnB1dChtVGV4dCk7CiAgICAgICAgIGlmICghbVRleHQuaGFzRm9jdXMoKSkgbVRleHQucmVxdWVzdEZvY3VzKCk7CkBAIC0xOTksMTUgKzE5OSwxNSBAQAogICAgICAgICAgICAgY2hhbmdlQ3VycmVudChtQ3VycmVudCAtIDEpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHJpdmF0ZSBTdHJpbmcgZm9ybWF0TnVtYmVyKGludCB2YWx1ZSkgewogICAgICAgICByZXR1cm4gKG1Gb3JtYXR0ZXIgIT0gbnVsbCkKICAgICAgICAgICAgICAgICA/IG1Gb3JtYXR0ZXIudG9TdHJpbmcodmFsdWUpCiAgICAgICAgICAgICAgICAgOiBTdHJpbmcudmFsdWVPZih2YWx1ZSk7CiAgICAgfQotIAotICAgIHByaXZhdGUgdm9pZCBjaGFuZ2VDdXJyZW50KGludCBjdXJyZW50KSB7Ci0gICAgICAgIAorCisgICAgcHJvdGVjdGVkIHZvaWQgY2hhbmdlQ3VycmVudChpbnQgY3VycmVudCkgeworCiAgICAgICAgIC8vIFdyYXAgYXJvdW5kIHRoZSB2YWx1ZXMgaWYgd2UgZ28gcGFzdCB0aGUgc3RhcnQgb3IgZW5kCiAgICAgICAgIGlmIChjdXJyZW50ID4gbUVuZCkgewogICAgICAgICAgICAgY3VycmVudCA9IG1TdGFydDsKQEAgLTIxOSwxNSArMjE5LDE1IEBACiAgICAgICAgIG5vdGlmeUNoYW5nZSgpOwogICAgICAgICB1cGRhdGVWaWV3KCk7CiAgICAgfQotICAgIAotICAgIHByaXZhdGUgdm9pZCBub3RpZnlDaGFuZ2UoKSB7CisKKyAgICBwcm90ZWN0ZWQgdm9pZCBub3RpZnlDaGFuZ2UoKSB7CiAgICAgICAgIGlmIChtTGlzdGVuZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgbUxpc3RlbmVyLm9uQ2hhbmdlZCh0aGlzLCBtUHJldmlvdXMsIG1DdXJyZW50KTsKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCB1cGRhdGVWaWV3KCkgewotICAgICAgICAKKyAgICBwcm90ZWN0ZWQgdm9pZCB1cGRhdGVWaWV3KCkgeworCiAgICAgICAgIC8qIElmIHdlIGRvbid0IGhhdmUgZGlzcGxheWVkIHZhbHVlcyB0aGVuIHVzZSB0aGUKICAgICAgICAgICogY3VycmVudCBudW1iZXIgZWxzZSBmaW5kIHRoZSBjb3JyZWN0IHZhbHVlIGluIHRoZQogICAgICAgICAgKiBkaXNwbGF5ZWQgdmFsdWVzIGZvciB0aGUgY3VycmVudCBudW1iZXIuCkBAIC0yMzksNyArMjM5LDcgQEAKICAgICAgICAgfQogICAgICAgICBtVGV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GlzdGVuZXIgewogCiAgICAgICAgIC8vIFhYWCBUaGlzIGRvZXNuJ3QgYWxsb3cgZm9yIHJhbmdlIGxpbWl0cyB3aGVuIGNvbnRyb2xsZWQgYnkgYQpAQCAtMzM5LDEyICszMzksMTIgQEAKICAgICAgICAgcHVibGljIGludCBnZXRJbnB1dFR5cGUoKSB7CiAgICAgICAgICAgICByZXR1cm4gSW5wdXRUeXBlLlRZUEVfQ0xBU1NfTlVNQkVSOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwcm90ZWN0ZWQgY2hhcltdIGdldEFjY2VwdGVkQ2hhcnMoKSB7CiAgICAgICAgICAgICByZXR1cm4gRElHSVRfQ0hBUkFDVEVSUzsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIENoYXJTZXF1ZW5jZSBmaWx0ZXIoQ2hhclNlcXVlbmNlIHNvdXJjZSwgaW50IHN0YXJ0LCBpbnQgZW5kLAogICAgICAgICAgICAgICAgIFNwYW5uZWQgZGVzdCwgaW50IGRzdGFydCwgaW50IGRlbmQpIHsKQEAgLTM4MSwyMSArMzgxLDIxIEBACiAgICAgICAgICAgICByZXR1cm4gSW50ZWdlci5wYXJzZUludChzdHIpOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRGlzcGxheWVkVmFsdWVzLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICAvKiBEb24ndCBmb3JjZSB0aGUgdXNlciB0byB0eXBlIGluIGphbiB3aGVuIGphIHdpbGwgZG8gKi8KICAgICAgICAgICAgICAgICBzdHIgPSBzdHIudG9Mb3dlckNhc2UoKTsKICAgICAgICAgICAgICAgICBpZiAobURpc3BsYXllZFZhbHVlc1tpXS50b0xvd2VyQ2FzZSgpLnN0YXJ0c1dpdGgoc3RyKSkgewogICAgICAgICAgICAgICAgICAgICByZXR1cm4gbVN0YXJ0ICsgaTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgLyogVGhlIHVzZXIgbWlnaHQgaGF2ZSB0eXBlZCBpbiBhIG51bWJlciBpbnRvIHRoZSBtb250aCBmaWVsZCBpLmUuCiAgICAgICAgICAgICAgKiAxMCBpbnN0ZWFkIG9mIE9DVCBzbyBzdXBwb3J0IHRoYXQgdG9vLgogICAgICAgICAgICAgICovCiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIHJldHVybiBJbnRlZ2VyLnBhcnNlSW50KHN0cik7CiAgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgLyogSWdub3JlIGFzIGlmIGl0J3Mgbm90IGEgbnVtYmVyIHdlIGRvbid0IGNhcmUgKi8KICAgICAgICAgICAgIH0KICAgICAgICAgfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2NvbS9nb29nbGUvYW5kcm9pZC9nZGF0YS9jbGllbnQvUXVlcnlQYXJhbXNJbXBsLmphdmEgYi9jb3JlL2phdmEvY29tL2dvb2dsZS9hbmRyb2lkL2dkYXRhL2NsaWVudC9RdWVyeVBhcmFtc0ltcGwuamF2YQppbmRleCBlMjdiMzZmLi5mYmUwZDIyIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvY29tL2dvb2dsZS9hbmRyb2lkL2dkYXRhL2NsaWVudC9RdWVyeVBhcmFtc0ltcGwuamF2YQorKysgYi9jb3JlL2phdmEvY29tL2dvb2dsZS9hbmRyb2lkL2dkYXRhL2NsaWVudC9RdWVyeVBhcmFtc0ltcGwuamF2YQpAQCAtNjAsNiArNjAsOCBAQAogICAgICAgICAgICAgc2IuYXBwZW5kKCc/Jyk7CiAgICAgICAgIH0KICAgICAgICAgZm9yIChTd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Jlc29sdmVyKCk7CisgICAgICAgIG1HRGF0YVZlcnNpb24gPSBnZGF0YVZlcnNpb247CisgICAgfQorCisKKyAgICBwdWJsaWMgdm9pZCBjbG9zZSgpIHsKKyAgICAgICAgbUh0dHBDbGllbnQuY2xvc2UoKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIChub24tSmF2YWRvYykKKyAgICAgKiBAc2VlIEdEYXRhQ2xpZW50I2VuY29kZVVyaShqYXZhLmxhbmcuU3RyaW5nKQorICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgZW5jb2RlVXJpKFN0cmluZyB1cmkpIHsKKyAgICAgICAgU3RyaW5nIGVuY29kZWRVcmk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBlbmNvZGVkVXJpID0gVVJMRW5jb2Rlci5lbmNvZGUodXJpLCAiVVRGLTgiKTsKKyAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiB1ZWUpIHsKKyAgICAgICAgICAgIC8vIHNob3VsZCBub3QgaGFwcGVuLgorICAgICAgICAgICAgTG9nLmUoIkpha2FydGFHRGF0YUNsaWVudCIsCisgICAgICAgICAgICAgICAgICAiVVRGLTggbm90IHN1cHBvcnRlZCAtLSBzaG91bGQgbm90IGhhcHBlbi4gICIKKyAgICAgICAgICAgICAgICAgICsgIlVzaW5nIGRlZmF1bHQgZW5jb2RpbmcuIiwgdWVlKTsKKyAgICAgICAgICAgIGVuY29kZWRVcmkgPSBVUkxFbmNvZGVyLmVuY29kZSh1cmkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBlbmNvZGVkVXJpOworICAgIH0KKworICAgIC8qCisgICAgICogKG5vbi1KYXZhZG9jKQorICAgICAqIEBzZWUgY29tLmdvb2dsZS53aXJlbGVzcy5nZGF0YS5jbGllbnQuR0RhdGFDbGllbnQjY3JlYXRlUXVlcnlQYXJhbXMoKQorICAgICAqLworICAgIHB1YmxpYyBRdWVyeVBhcmFtcyBjcmVhdGVRdWVyeVBhcmFtcygpIHsKKyAgICAgICAgcmV0dXJuIG5ldyBRdWVyeVBhcmFtc0ltcGwoKTsKKyAgICB9CisKKyAgICAvLyBmb2xsb3dzIHJlZGlyZWN0cworICAgIHByaXZhdGUgSW5wdXRTdHJlYW0gY3JlYXRlQW5kRXhlY3V0ZU1ldGhvZChIdHRwUmVxdWVzdENyZWF0b3IgY3JlYXRvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVyaVN0cmluZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGF1dGhUb2tlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGVUYWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwcm90b2NvbFZlcnNpb24pCisgICAgICAgIHRocm93cyBIdHRwRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgSHR0cFJlc3BvbnNlIHJlc3BvbnNlID0gbnVsbDsKKyAgICAgICAgaW50IHN0YXR1cyA9IDUwMDsKKyAgICAgICAgaW50IHJlZGlyZWN0c0xlZnQgPSBNQVhfUkVESVJFQ1RTOworICAgICAgICAKKyAgICAgICAgVVJJIHVyaTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHVyaSA9IG5ldyBVUkkodXJpU3RyaW5nKTsKKyAgICAgICAgfSBjYXRjaCAoVVJJU3ludGF4RXhjZXB0aW9uIHVzZSkgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiVW5hYmxlIHRvIHBhcnNlICIgKyB1cmlTdHJpbmcgKyAiIGFzIFVSSS4iLCB1c2UpOworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJVbmFibGUgdG8gcGFyc2UgIiArIHVyaVN0cmluZyArICIgY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FibGUsIGl0IGlzIHBvc3NpYmxlIHRvIGNvbnN0cnVjdAorICAgICAgICAgICAgLy8gYSBjbGllbnQgdGhhdCBoYXMgYW4gZW1wdHkgdmVyc2lvbiBmaWVsZCwgdG8gd29yayB3aXRoIDEuMCBzZXJ2aWNlcy4gCisgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KG1HRGF0YVZlcnNpb24pKSB7CisgICAgICAgICAgICAgICAgcmVxdWVzdC5hZGRIZWFkZXIoIkdEYXRhVmVyc2lvbiIsIG1HRGF0YVZlcnNpb24pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBpZiB3ZSBoYXZlIGEgcGFzc2VkIGRvd24gZVRhZyB2YWx1ZSwgd2UgbmVlZCB0byBhZGQgc2V2ZXJhbCBoZWFkZXJzCisgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGVUYWcpKSB7IAorICAgICAgICAgICAgICAgIFN0cmluZyBtZXRob2QgPSByZXF1ZXN0LmdldE1ldGhvZCgpOworICAgICAgICAgICAgICAgIEhlYWRlciBvdmVycmlkZU1ldGhvZEhlYWRlciA9IHJlcXVlc3QuZ2V0Rmlyc3RIZWFkZXIoWF9IVFRQX01FVEhPRF9PVkVSUklERSk7CisgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlTWV0aG9kSGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbWV0aG9kID0gb3ZlcnJpZGVNZXRob2RIZWFkZXIuZ2V0VmFsdWUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCJHRVQiLmVxdWFscyhtZXRob2QpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgbm9uZSBtYXRjaCBoZWFkZXIsIGlmIHRoZSByZXNvdXJjZSBpcyBub3QgY2hhbmdlZAorICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIHJlcXVlc3Qgd2lsbCByZXN1bHQgaW4gYSAzMDQgbm93LgorICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFkZEhlYWRlcigiSWYtTm9uZS1NYXRjaCIsIGVUYWcpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIkRFTEVURSIuZXF1YWxzKG1ldGhvZCkgCisgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAiUFVUIi5lcXVhbHMobWV0aG9kKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBub3cgd2Ugc2VuZCBhbiBpZi1tYXRjaCwgYnV0IG9ubHkgaWYgdGhlIHBhc3NlZCBpbiBlVGFnIGlzIGEgc3Ryb25nIGVUYWcKKyAgICAgICAgICAgICAgICAgICAgLy8gYXMgdGhpcyBvbmx5IG1ha2VzIHNlbnNlIGZvciBhIHN0cm9uZyBlVGFnCisgICAgICAgICAgICAgICAgICAgIGlmICghZVRhZy5zdGFydHNXaXRoKCJXLyIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFkZEhlYWRlcigiSWYtTWF0Y2giLCBlVGFnKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKExPQ0FMX0xPR1YpIHsKKyAgICAgICAgICAgICAgICBmb3IgKEhlYWRlciBoIDogcmVxdWVzdC5nZXRBbGxIZWFkZXJzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCBoLmdldE5hbWUoKSArICI6ICIgKyBoLmdldFZhbHVlKCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJFeGVjdXRpbmcgIiArIHJlcXVlc3QuZ2V0UmVxdWVzdExpbmUoKS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmVzcG9uc2UgPSBudWxsOworCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gbUh0dHBDbGllbnQuZXhlY3V0ZShyZXF1ZXN0KTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGlvZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlVuYWJsZSB0byBleGVjdXRlIEhUVFAgcmVxdWVzdC4iICsgaW9lKTsKKyAgICAgICAgICAgICAgICB0aHJvdyBpb2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0YXR1c0xpbmUgc3RhdHVzTGluZSA9IHJlc3BvbnNlLmdldFN0YXR1c0xpbmUoKTsKKyAgICAgICAgICAgIGlmIChzdGF0dXNMaW5lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJTdGF0dXNMaW5lIGlzIG51bGwuIik7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJTdGF0dXNMaW5lIGlzIG51bGwgLS0gc2hvdWxkIG5vdCBoYXBwZW4uIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsIHJlc3BvbnNlLmdldFN0YXR1c0xpbmUoKS50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICBmb3IgKEhlYWRlciBoIDogcmVzcG9uc2UuZ2V0QWxsSGVhZGVycygpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgaC5nZXROYW1lKCkgKyAiOiAiICsgaC5nZXRWYWx1ZSgpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzdGF0dXMgPSBzdGF0dXNMaW5lLmdldFN0YXR1c0NvZGUoKTsKKworICAgICAgICAgICAgSHR0cEVudGl0eSBlbnRpdHkgPSByZXNwb25zZS5nZXRFbnRpdHkoKTsKKworICAgICAgICAgICAgaWYgKChzdGF0dXMgPj0gMjAwKSAmJiAoc3RhdHVzIDwgMzAwKSAmJiBlbnRpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIElucHV0U3RyZWFtIGluID0gQW5kcm9pZEh0dHBDbGllbnQuZ2V0VW5nemlwcGVkQ29udGVudChlbnRpdHkpOworICAgICAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICAgICAgaW4gPSBsb2dJbnB1dFN0cmVhbUNvbnRlbnRzKGluKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGluOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBUT0RPOiBoYW5kbGUgMzAxLCAzMDc/CisgICAgICAgICAgICAvLyBUT0RPOiBsZXQgdGhlIGh0dHAgY2xpZW50IGhhbmRsZSB0aGUgcmVkaXJlY3RzLCBpZiB3ZSBjYW4gYmUgc3VyZSB3ZSdsbCBuZXZlciBnZXQgYQorICAgICAgICAgICAgLy8gcmVkaXJlY3Qgb24gUE9TVC4KKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gMzAyKSB7CisgICAgICAgICAgICAgICAgLy8gY29uc3VtZSB0aGUgY29udGVudCwgc28gdGhlIGNvbm5lY3Rpb24gY2FuIGJlIGNsb3NlZC4KKyAgICAgICAgICAgICAgICBlbnRpdHkuY29uc3VtZUNvbnRlbnQoKTsKKyAgICAgICAgICAgICAgICBIZWFkZXIgbG9jYXRpb24gPSByZXNwb25zZS5nZXRGaXJzdEhlYWRlcigiTG9jYXRpb24iKTsKKyAgICAgICAgICAgICAgICBpZiAobG9jYXRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJSZWRpcmVjdCByZXF1ZXN0ZWQgYnV0IG5vIExvY2F0aW9uICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAic3BlY2lmaWVkLiIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkZvbGxvd2luZyByZWRpcmVjdCB0byAiICsgbG9jYXRpb24uZ2V0VmFsdWUoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHVyaSA9IG5ldyBVUkkobG9jYXRpb24uZ2V0VmFsdWUoKSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoVVJJU3ludGF4RXhjZXB0aW9uIHVzZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJVbmFibGUgdG8gcGFyc2UgIiArIGxvY2F0aW9uLmdldFZhbHVlKCkgKyAiIGFzIFVSSS4iLCB1c2UpOworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJVbmFibGUgdG8gcGFyc2UgIiArIGxvY2F0aW9uLmdldFZhbHVlKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGFzIFVSSS4iKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLS1yZWRpcmVjdHNMZWZ0OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgTG9nLnYoVEFHLCAiUmVjZWl2ZWQgIiArIHN0YXR1cyArICIgc3RhdHVzIGNvZGUuIik7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nIGVycm9yTWVzc2FnZSA9IG51bGw7CisgICAgICAgIEh0dHBFbnRpdHkgZW50aXR5ID0gcmVzcG9uc2UuZ2V0RW50aXR5KCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT0gbnVsbCAmJiBlbnRpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIElucHV0U3RyZWFtIGluID0gQW5kcm9pZEh0dHBDbGllbnQuZ2V0VW5nemlwcGVkQ29udGVudChlbnRpdHkpOworICAgICAgICAgICAgICAgIEJ5dGVBcnJheU91dHB1dFN0cmVhbSBiYW9zID0gbmV3IEJ5dGVBcnJheU91dHB1dFN0cmVhbSgpOworICAgICAgICAgICAgICAgIGJ5dGVbXSBidWYgPSBuZXcgYnl0ZVs4MTkyXTsKKyAgICAgICAgICAgICAgICBpbnQgYnl0ZXNSZWFkID0gLTE7CisgICAgICAgICAgICAgICAgd2hpbGUgKChieXRlc1JlYWQgPSBpbi5yZWFkKGJ1ZikpICE9IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIGJhb3Mud3JpdGUoYnVmLCAwLCBieXRlc1JlYWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBUT0RPOiB1c2UgYXBwcm9wcmlhdGUgZW5jb2RpbmcsIHBpY2tlZCB1cCBmcm9tIENvbnRlbnQtVHlwZS4KKyAgICAgICAgICAgICAgICBlcnJvck1lc3NhZ2UgPSBuZXcgU3RyaW5nKGJhb3MudG9CeXRlQXJyYXkoKSk7CisgICAgICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLlZFUkJPU0UpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgZXJyb3JNZXNzYWdlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoZW50aXR5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBlbnRpdHkuY29uc3VtZUNvbnRlbnQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBTdHJpbmcgZXhjZXB0aW9uTWVzc2FnZSA9ICJSZWNlaXZlZCAiICsgc3RhdHVzICsgIiBzdGF0dXMgY29kZSI7CisgICAgICAgIGlmIChlcnJvck1lc3NhZ2UgIT0gbnVsbCkgeworICAgICAgICAgICAgZXhjZXB0aW9uTWVzc2FnZSArPSAoIjogIiArIGVycm9yTWVzc2FnZSk7CisgICAgICAgIH0KKyAgICAgICAgdGhyb3cgbmV3IEh0dHBFeGNlcHRpb24oZXhjZXB0aW9uTWVzc2FnZSwgc3RhdHVzLCBudWxsIC8qIElucHV0U3RyZWFtICovKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIChub24tSmF2YWRvYykKKyAgICAgKiBAc2VlIEdEYXRhQ2xpZW50I2dldEZlZWRBc1N0cmVhbShqYXZhLmxhbmcuU3RyaW5nLCBqYXZhLmxhbmcuU3RyaW5nKQorICAgICAqLworICAgIHB1YmxpYyBJbnB1dFN0cmVhbSBnZXRGZWVkQXNTdHJlYW0oU3RyaW5nIGZlZWRVcmwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXV0aFRva2VuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGVUYWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcHJvdG9jb2xWZXJzaW9uKQorIC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V3IFN0cmluZyhidWYsIDAsIHRvdGFsUmVjZWl2ZWQsICJVVEYtOCIpKTsKKyAgICAgICAgYmluLnJlc2V0KCk7CisgICAgICAgIHJldHVybiBiaW47CisgICAgfQorCisgICAgcHVibGljIElucHV0U3RyZWFtIGdldE1lZGlhRW50cnlBc1N0cmVhbShTdHJpbmcgbWVkaWFFbnRyeVVybCwgU3RyaW5nIGF1dGhUb2tlbiwgU3RyaW5nIGVUYWcsIFN0cmluZyBwcm90b2NvbFZlcnNpb24pCisgICAgICAgICAgICB0aHJvd3MgSHR0cEV4Y2VwdGlvbiwgSU9FeGNlcHRpb24geworCisgICAgICAgIElucHV0U3RyZWFtIGluID0gY3JlYXRlQW5kRXhlY3V0ZU1ldGhvZChuZXcgR2V0UmVxdWVzdENyZWF0b3IoKSwgbWVkaWFFbnRyeVVybCwgYXV0aFRva2VuLCBlVGFnLCBwcm90b2NvbFZlcnNpb24pOworCisgICAgICAgIGlmIChpbiAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gaW47CisgICAgICAgIH0KKyAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJVbmFibGUgdG8gYWNjZXNzIG1lZGlhIGVudHJ5LiIpOworICAgIH0KKworICAgIC8qIChub24tSmF2YWRvYykKKyAgICAqIEBzZWUgR0RhdGFDbGllbnQjY3JlYXRlRW50cnkKKyAgICAqLworICAgIHB1YmxpYyBJbnB1dFN0cmVhbSBjcmVhdGVFbnRyeShTdHJpbmcgZmVlZFVybCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGF1dGhUb2tlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHByb3RvY29sVmVyc2lvbiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdEYXRhU2VyaWFsaXplciBlbnRyeSkKKyAgICAgICAgdGhyb3dzIEh0dHBFeGNlcHRpb24sIElPRXhjZXB0aW9uIHsKKworICAgICAgICBIdHRwRW50aXR5IGVudGl0eSA9IGNyZWF0ZUVudGl0eUZvckVudHJ5KGVudHJ5LCBHRGF0YVNlcmlhbGl6ZXIuRk9STUFUX0NSRUFURSk7CisgICAgICAgIElucHV0U3RyZWFtIGluID0gY3JlYXRlQW5kRXhlY3V0ZU1ldGhvZCgKKyAgICAgICAgICAgICAgICBuZXcgUG9zdFJlcXVlc3RDcmVhdG9yKG51bGwgLyogb3ZlcnJpZGUgKi8sIGVudGl0eSksCisgICAgICAgICAgICAgICAgZmVlZFVybCwKKyAgICAgICAgICAgICAgICBhdXRoVG9rZW4sCisgICAgICAgICAgICAgICAgbnVsbCwKKyAgICAgICAgICAgICAgICBwcm90b2NvbFZlcnNpb24pOworICAgICAgICBpZiAoaW4gIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGluOworICAgICAgICB9CisgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiVW5hYmxlIHRvIGNyZWF0ZSBlbnRyeS4iKTsKKyAgICB9CisKKyAgICAvKiAobm9uLUphdmFkb2MpCisgICAgICogQHNlZSBHRGF0YUNsaWVudCN1cGRhdGVFbnRyeQorICAgICAqLworICAgIHB1YmxpYyBJbnB1dFN0cmVhbSB1cGRhdGVFbnRyeShTdHJpbmcgZWRpdFVyaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGF1dGhUb2tlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGVUYWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwcm90b2NvbFZlcnNpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRGF0YVNlcmlhbGl6ZXIgZW50cnkpCisgICAgICAgIHRocm93cyBIdHRwRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEh0dHBFbnRpdHkgZW50aXR5ID0gY3JlYXRlRW50aXR5Rm9yRW50cnkoZW50cnksIEdEYXRhU2VyaWFsaXplci5GT1JNQVRfVVBEQVRFKTsKKyAgICAgICAgZmluYWwgU3RyaW5nIG1ldGhvZCA9IGVudHJ5LmdldFN1cHBvcnRzUGFydGlhbCgpID8gIlBBVENIIiA6ICJQVVQiOworICAgICAgICBJbnB1dFN0cmVhbSBpbiA9IGNyZWF0ZUFuZEV4ZWN1dGVNZXRob2QoCisgICAgICAgICAgICAgICAgbmV3IFBvc3RSZXF1ZXN0Q3JlYXRvcihtZXRob2QsIGVudGl0eSksCisgICAgICAgICAgICAgICAgZWRpdFVyaSwKKyAgICAgICAgICAgICAgICBhdXRoVG9rZW4sCisgICAgICAgICAgICAgICAgZVRhZywKKyAgICAgICAgICAgICAgICBwcm90b2NvbFZlcnNpb24pOworICAgICAgICBpZiAoaW4gIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGluOworICAgICAgICB9CisgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiVW5hYmxlIHRvIHVwZGF0ZSBlbnRyeS4iKTsKKyAgICB9CisKKyAgICAvKiAobm9uLUphdmFkb2MpCisgICAgICogQHNlZSBHRGF0YUNsaWVudCNkZWxldGVFbnRyeQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGRlbGV0ZUVudHJ5KFN0cmluZyBlZGl0VXJpLCBTdHJpbmcgYXV0aFRva2VuLCBTdHJpbmcgZVRhZykKKyAgICAgICAgdGhyb3dzIEh0dHBFeGNlcHRpb24sIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKFN0cmluZ1V0aWxzLmlzRW1wdHkoZWRpdFVyaSkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJ5b3UgbXVzdCBzcGVjaWZ5IGFuIG5vbi1lbXB0eSBlZGl0IHVybCIpOworICAgICAgICB9CisgICAgICAgIElucHV0U3RyZWFtIGluID0KKyAgICAgICAgICAgIGNyZWF0ZUFuZEV4ZWN1dGVNZXRob2QoCisgICAgICAgICAgICAgICAgICAgIG5ldyBQb3N0UmVxdWVzdENyZWF0b3IoIkRFTEVURSIsIG51bGwgLyogZW50aXR5ICovKSwKKyAgICAgICAgICAgICAgICAgICAgZWRpdFVyaSwKKyAgICAgICAgICAgICAgICAgICAgYXV0aFRva2VuLAorICAgICAgICAgICAgICAgICAgICBlVGFnLAorICAgICAgICAgICAgICAgICAgICBudWxsIC8qIHByb3RvY29sVmVyc2lvbiwgbm90IHJlcXVpcmVkIGZvciBhIGRlbGV0ZSAqLyk7CisgICAgICAgIGlmIChpbiA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oIlVuYWJsZSB0byBkZWxldGUgZW50cnkuIik7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGluLmNsb3NlKCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGlvZSkgeworICAgICAgICAgICAgLy8gaWdub3JlCisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgSW5wdXRTdHJlYW0gdXBkYXRlTWVkaWFFbnRyeShTdHJpbmcgZWRpdFVyaSwgU3RyaW5nIGF1dGhUb2tlbiwgU3RyaW5nIGVUYWcsCisgICAgICAgICAgICBTdHJpbmcgcHJvdG9jb2xWZXJzaW9uLCBJbnB1dFN0cmVhbSBtZWRpYUVudHJ5SW5wdXRTdHJlYW0sIFN0cmluZyBjb250ZW50VHlwZSkKKyAgICAgICAgdGhyb3dzIEh0dHBFeGNlcHRpb24sIElPRXhjZXB0aW9uIHsKKyAgICAgICAgSW5wdXRTdHJlYW0gaW4gPSBjcmVhdGVBbmRFeGVjdXRlTWV0aG9kKAorICAgICAgICAgICAgICAgIG5ldyBNZWRpYVB1dFJlcXVlc3RDcmVhdG9yKG1lZGlhRW50cnlJbnB1dFN0cmVhbSwgY29udGVudFR5cGUpLAorICAgICAgICAgICAgICAgIGVkaXRVcmksCisgICAgICAgICAgICAgICAgYXV0aFRva2VuLAorICAgICAgICAgICAgICAgIGVUYWcsCisgICAgICAgICAgICAgICAgcHJvdG9jb2xWZXJzaW9uKTsKKyAgICAgICAgaWYgKGluICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBpbjsKKyAgICAgICAgfQorICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oIlVuYWJsZSB0byB3cml0ZSBtZWRpYSBlbnRyeS4iKTsKKyAgICB9CisKKyAgICBwcml2YXRlIEh0dHBFbnRpdHkgY3JlYXRlRW50aXR5Rm9yRW50cnkoR0RhdGFTZXJpYWxpemVyIGVudHJ5LCBpbnQgZm9ybWF0KSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBCeXRlQXJyYXlPdXRwdXRTdHJlYW0gYmFvcyA9IG5ldyBCeXRlQXJyYXlPdXRwdXRTdHJlYW0oKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGVudHJ5LnNlcmlhbGl6ZShiYW9zLCBmb3JtYXQpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIlVuYWJsZSB0byBzZXJpYWxpemUgZW50cnkuIiwgaW9lKTsKKyAgICAgICAgICAgIHRocm93IGlvZTsKKyAgICAgICAgfSBjYXRjaCAoUGFyc2VFeGNlcHRpb24gcGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIlVuYWJsZSB0byBzZXJpYWxpemUgZW50cnkuIiwgcGUpOworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJVbmFibGUgdG8gc2VyaWFsaXplIGVudHJ5OiAiICsgcGUuZ2V0TWVzc2FnZSgpKTsKKyAgICAgICAgfQorCisgICAgICAgIGJ5dGVbXSBlbnRyeUJ5dGVzID0gYmFvcy50b0J5dGVBcnJheSgpOworCisgICAgICAgIGlmIChlbnRyeUJ5dGVzICE9IG51bGwgJiYgTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlNlcmlhbGl6ZWQgZW50cnk6ICIgKyBuZXcgU3RyaW5nKGVudHJ5Qnl0ZXMsICJVVEYtOCIpKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkRW5jb2RpbmdFeGNlcHRpb24gdWVlKSB7CisgICAgICAgICAgICAgICAgLy8gc2hvdWxkIG5vdCBoYXBwZW4KKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJVVEYtOCBzaG91bGQgYmUgc3VwcG9ydGVkISIsCisgICAgICAgICAgICAgICAgICAgICAgICB1ZWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQWJzdHJhY3RIdHRwRW50aXR5IGVudGl0eSA9IEFuZHJvaWRIdHRwQ2xpZW50LmdldENvbXByZXNzZWRFbnRpdHkoZW50cnlCeXRlcywgbVJlc29sdmVyKTsKKyAgICAgICAgZW50aXR5LnNldENvbnRlbnRUeXBlKGVudHJ5LmdldENvbnRlbnRUeXBlKCkpOworICAgICAgICByZXR1cm4gZW50aXR5OworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbm5lY3RzIHRvIGEgR0RhdGEgc2VydmVyIChzcGVjaWZpZWQgYnkgdGhlIGJhdGNoVXJsKSBhbmQgc3VibWl0cyBhCisgICAgICogYmF0Y2ggZm9yIHByb2Nlc3NpbmcuICBUaGUgcmVzcG9uc2UgZnJvbSB0aGUgc2VydmVyIGlzIHJldHVybmVkIGFzIGFuCisgICAgICoge0BsaW5rIElucHV0U3RyZWFtfS4gIFRoZSBjYWxsZXIgaXMgcmVzcG9uc2libGUgZm9yIGNhbGxpbmcKKyAgICAgKiB7QGxpbmsgSW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ICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7CisgICAgICAgIGlmIChmZWVkVXJsLmNvbnRhaW5zKCI/IikpIHsKKyAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzYi5hcHBlbmQoJz8nKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKFN0cmluZyBwYXJhbSA6IHBhcmFtcykgeworICAgICAgICAgICAgaWYgKGZpcnN0KSB7CisgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCcmJyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzYi5hcHBlbmQocGFyYW0pOworICAgICAgICAgICAgc2IuYXBwZW5kKCc9Jyk7CisgICAgICAgICAgICBTdHJpbmcgdmFsdWUgPSBtUGFyYW1zLmdldChwYXJhbSk7CisgICAgICAgICAgICBTdHJpbmcgZW5jb2RlZFZhbHVlID0gbnVsbDsKKworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBlbmNvZGVkVmFsdWUgPSBVUkxFbmNvZGVyLmVuY29kZSh2YWx1ZSwgIlVURi04Iik7CisgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIHVlZSkgeworICAgICAgICAgICAgICAgIC8vIHNob3VsZCBub3QgaGFwcGVuLgorICAgICAgICAgICAgICAgIExvZy53KCJRdWVyeVBhcmFtc0ltcGwiLAorICAgICAgICAgICAgICAgICAgICAgICJVVEYtOCBub3Qgc3VwcG9ydGVkIC0tIHNob3VsZCBub3QgaGFwcGVuLiAgIgorICAgICAgICAgICAgICAgICAgICAgICsgIlVzaW5nIGRlZmF1bHQgZW5jb2RpbmcuIiwgdWVlKTsKKyAgICAgICAgICAgICAgICBlbmNvZGVkVmFsdWUgPSBVUkxFbmNvZGVyLmVuY29kZSh2YW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JpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJhb3Mud3JpdGUoYmxvYiwgMCwgYmxvYi5sZW5ndGgpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogCi0gICAgICAgICAgICAgICAgICAgICAgICBieXRlW10gYnVmZmVyID0gbmV3IGJ5dGVbMjU2XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW4gPSBpcy5yZWFkKGJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAobGVuID49IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW9zLndyaXRlKGJ1ZmZlciwgMCwgbGVuKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW4gPSBpcy5yZWFkKGJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byBsb2FkIHBhcnQgZGF0YSIsIGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgYy5jbG9zZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE1tc0V4Y2VwdGlvbihlKTsKLSAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWxlZCB0byBjbG9zZSBzdHJlYW0iLCBlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIElnbm9yZQorICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcyA9IG1Db250ZW50UmVzb2x2ZXIub3BlbklucHV0U3RyZWFtKHBhcnRVUkkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIGJ1ZmZlciA9IG5ldyBieXRlWzI1Nl07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbiA9IGlzLnJlYWQoYnVmZmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAobGVuID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFvcy53cml0ZShidWZmZXIsIDAsIGxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbiA9IGlzLnJlYWQoYnVmZmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRmFpbGVkIHRvIGxvYWQgcGFydCBkYXRhIiwgZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYy5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBNbXNFeGNlcHRpb24oZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcy5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsZWQgdG8gY2xvc2Ugc3RyZWFtIiwgZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gSWdub3JlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHBhcnQuc2V0RGF0YShiYW9zLnRvQnl0ZUFycmF5KCkpOwpAQCAtNzE5LDI5ICs3MzQsMzcgQEAKICAgICAgICAgSW5wdXRTdHJlYW0gaXMgPSBudWxsOwogCiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBvcyA9IG1Db250ZW50UmVzb2x2ZXIub3Blbk91dHB1dFN0cmVhbSh1cmkpOwogICAgICAgICAgICAgYnl0ZVtdIGRhdGEgPSBwYXJ0LmdldERhdGEoKTsKLSAgICAgICAgICAgIGlmIChkYXRhID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBVcmkgZGF0YVVyaSA9IHBhcnQuZ2V0RGF0YVVyaSgpOwotICAgICAgICAgICAgICAgIGlmICgoZGF0YVVyaSA9PSBudWxsKSB8fCAoZGF0YVVyaSA9PSB1cmkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNhbid0IGZpbmQgZGF0YSBmb3IgdGhpcyBwYXJ0LiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlzID0gbUNvbnRlbnRSZXNvbHZlci5vcGVuSW5wdXRTdHJlYW0oZGF0YVVyaSk7Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgaWYgKExPQ0FMX0xPR1YpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiU2F2aW5nIGRhdGEgdG86ICIgKyB1cmkpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGJ5dGVbXSBidWZmZXIgPSBuZXcgYnl0ZVsyNTZdOwotICAgICAgICAgICAgICAgIGZvciAoaW50IGxlbiA9IDA7IChsZW4gPSBpcy5yZWFkKGJ1ZmZlcikpICE9IC0xOyApIHsKLSAgICAgICAgICAgICAgICAgICAgb3Mud3JpdGUoYnVmZmVyLCAwLCBsZW4pOworICAgICAgICAgICAgaWYgKCJ0ZXh0L3BsYWluIi5lcXVhbHMoY29udGVudFR5cGUpIHx8ICJhcHBsaWNhdGlvbi9zbWlsIi5lcXVhbHMoY29udGVudFR5cGUpKSB7CisgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyBjdiA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICAgICAgY3YucHV0KFRlbGVwaG9ueS5NbXMuUGFydC5URVhULCBuZXcgRW5jb2RlZFN0cmluZ1ZhbHVlKGRhdGEpLmdldFN0cmluZygpKTsKKyAgICAgICAgICAgICAgICBpZiAobUNvbnRlbnRSZXNvbHZlci51cGRhdGUodXJpLCBjdiwgbnVsbCwgbnVsbCkgIT0gMSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTW1zRXhjZXB0aW9uKCJ1bmFibGUgdG8gdXBkYXRlICIgKyB1cmkudG9TdHJpbmcoKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HVikgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJTYXZpbmcgZGF0YSB0bzogIiArIHVyaSk7CisgICAgICAgICAgICAgICAgb3MgPSBtQ29udGVudFJlc29sdmVyLm9wZW5PdXRwdXRTdHJlYW0odXJpKTsKKyAgICAgICAgICAgICAgICBpZiAoZGF0YSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIFVyaSBkYXRhVXJpID0gcGFydC5nZXREYXRhVXJpKCk7CisgICAgICAgICAgICAgICAgICAgIGlmICgoZGF0YVVyaSA9PSBudWxsKSB8fCAoZGF0YVVyaSA9PSB1cmkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJDYW4ndCBmaW5kIGRhdGEgZm9yIHRoaXMgcGFydC4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpcyA9IG1Db250ZW50UmVzb2x2ZXIub3BlbklucHV0U3RyZWFtKGRhdGFVcmkpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChMT0NBTF9MT0dWKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJTYXZpbmcgZGF0YSB0bzogIiArIHVyaSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBieXRlW10gYnVmZmVyID0gbmV3IGJ5dGVbMjU2XTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbGVuID0gMDsgKGxlbiA9IGlzLnJlYWQoYnVmZmVyKSkgIT0gLTE7ICkgeworICAgICAgICAgICAgICAgICAgICAgICAgb3Mud3JpdGUoYnVmZmVyLCAwLCBsZW4pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKExPQ0FMX0xPR1YpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIlNhdmluZyBkYXRhIHRvOiAiICsgdXJpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBvcy53cml0ZShkYXRhKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3Mud3JpdGUoZGF0YSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsZW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Z2VzdCk7CiAgICAgICAgICAgICByZXR1cm4gc0NhY2hlZFJ1bGVzOwogICAgICAgICB9CiAKLSAgICAgICAgLy8gR2V0IGFsbCB0aGUgR3NlcnZpY2VzIHNldHRpbmdzIHdpdGggbmFtZXMgc3RhcnRpbmcgd2l0aCAidXJsOiIuCisgICAgICAgIGlmIChMT0NBTF9MT0dWKSBMb2cudihUQUcsICJTY2FubmluZyBmb3IgR3NlcnZpY2VzIFwidXJsOipcIiBydWxlcyIpOwogICAgICAgICBDdXJzb3IgY3Vyc29yID0gcmVzb2x2ZXIucXVlcnkoU2V0dGluZ3MuR3NlcnZpY2VzLkNPTlRFTlRfVVJJLAogICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXSB7CiAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLkdzZXJ2aWNlcy5OQU1FLApAQCAtMjEwLDE2ICsyMTUsMTggQEAKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBjdXJzb3IuZ2V0U3RyaW5nKDApLnN1YnN0cmluZyg0KTsgIC8vICJ1cmw6WCIKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHZhbHVlID0gY3Vyc29yLmdldFN0cmluZygxKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09IG51bGwgfHwgdmFsdWUubGVuZ3RoKCkgPT0gMCkgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIGlmIChMT0NBTF9MT0dWKSBMb2cudihUQUcsICIgIFJ1bGUgIiArIG5hbWUgKyAiOiAiICsgdmFsdWUpOwogICAgICAgICAgICAgICAgICAgICBydWxlcy5hZGQobmV3IFJ1bGUobmFtZSwgdmFsdWUpKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChSdWxlRm9ybWF0RXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gT29wcywgR3NlcnZpY2VzIGhhcyBhbiBpbnZhbGlkIHJ1bGUhICBTa2lwIGl0LgotICAg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BpbnRlcnByZXRlci1vbmx5CisgICAgICogZm9yIG5vbi1zZWxlY3RlZCBtZXRob2RzLgorICAgICAqLworICAgIHByb3BlcnR5X2dldCgiZGFsdmlrLnZtLmppdC5pbmNsdWRlbWV0aG9kIiwgcHJvcEJ1ZiwgIiIpOworICAgIGlmIChzdHJsZW4ocHJvcEJ1ZikgPiAwKSB7CisgICAgICAgIG9wdC5vcHRpb25TdHJpbmcgPSAiLVhpbmNsdWRlc2VsZWN0ZWRtZXRob2QiOworICAgICAgICBtT3B0aW9ucy5hZGQob3B0KTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIEVuYWJsZSBwcm9maWxlIGNvbGxlY3Rpb24gb24gSklUJ2VkIGNvZGUuCisgICAgICovCisgICAgcHJvcGVydHlfZ2V0KCJkYWx2aWsudm0uaml0LnByb2ZpbGUiLCBwcm9wQnVmLCAiIik7CisgICAgaWYgKHN0cmxlbihwcm9wQnVmKSA+IDApIHsKKyAgICAgICAgb3B0Lm9wdGlvblN0cmluZyA9ICItWGppdHByb2ZpbGUiOworICAgICAgICBtT3B0aW9ucy5hZGQob3B0KTsKKyAgICB9CisjZW5kaWYKKwogICAgIGlmIChleGVjdXRpb25Nb2RlID09IGtFTUludFBvcnRhYmxlKSB7CiAgICAgICAgIG9wdC5vcHRpb25TdHJpbmcgPSAiLVhpbnQ6cG9ydGFibGUiOwogICAgICAgICBtT3B0aW9ucy5hZGQob3B0KTsKICAgICB9IGVsc2UgaWYgKGV4ZWN1dGlvbk1vZGUgPT0ga0VNSW50RmFzdCkgewogICAgICAgICBvcHQub3B0aW9uU3RyaW5nID0gIi1YaW50OmZhc3QiOwogICAgICAgICBtT3B0aW9ucy5hZGQob3B0KTsKKyNpZiBkZWZpbmVkKFdJVEhfSklUKQorICAgIH0gZWxzZSBpZiAoZXhlY3V0aW9uTW9kZSA9PSBrRU1KaXRDb21waWxlcikgeworICAgICAgICBvcHQub3B0aW9uU3RyaW5nID0gIi1YaW50OmppdCI7CisgICAgICAg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QoU2tQYWludCogcGFpbnQpIHsKKyAgICAvLyBsb29rcyBiZXN0IHdlIGRlY2lkZWQKKyAgICBwYWludC0+c2V0SGludGluZyhTa1BhaW50OjprU2xpZ2h0X0hpbnRpbmcpOworICAgIC8vIHV0ZjE2IGlzIHJlcXVpcmVkIGZvciBqYXZhCisgICAgcGFpbnQtPnNldFRleHRFbmNvZGluZyhTa1BhaW50OjprVVRGMTZfVGV4dEVuY29kaW5nKTsKK30KKwogY2xhc3MgU2tQYWludEdsdWUgewogcHVibGljOgogCkBAIC01Nyw4ICs2NCw3IEBACiAKICAgICBzdGF0aWMgU2tQYWludCogaW5pdChKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eikgewogICAgICAgICBTa1BhaW50KiBvYmogPSBuZXcgU2tQYWludCgpOwotICAgICAgICAvLyB1dGYxNiBpcyByZXF1aXJlZCBmb3IgamF2YQotICAgICAgICBvYmotPnNldFRleHRFbmNvZGluZyhTa1BhaW50OjprVVRGMTZfVGV4dEVuY29kaW5nKTsKKyAgICAgICAgZGVmYXVsdFNldHRpbmdzRm9yQW5kcm9pZChvYmopOwogICAgICAgICByZXR1cm4gb2JqOwogICAgIH0KIApAQCAtNjksOCArNzUsNyBAQAogIAogICAgIHN0YXRpYyB2b2lkIHJlc2V0KEpOSUVudiogZW52LCBqb2JqZWN0IGNsYXp6LCBTa1BhaW50KiBvYmopIHsKICAgICAgICAgb2JqLT5yZXNldCgpOwotICAgICAgICAvLyB1dGYxNiBpcyByZXF1aXJlZCBmb3IgamF2YQotICAgICAgICBvYmotPnNldFRleHRFbmNvZGluZyhTa1BhaW50OjprVVRGMTZfVGV4dEVuY29kaW5nKTsKKyAgICAgICAgZGVmYXVsdFNldHRpbmdzRm9yQW5kcm9pZChvYmopOwogICAgIH0KICAKICAgICBzdGF0aWMgdm9pZCBhc3NpZ24oSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIGRzdCwgY29uc3QgU2tQYWludCogc3JjKSB7Cm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gdG8gdXNlIGEgbW9yZSBzb3BoaXN0aWNhdGVkIHZlcnRleAogICAgIC8vIGNhY2hlIG9mIHNvbWUgc29ydC4KLSAgICAKKwogICAgIGludCBtaW5JbmRleCA9IDY1NTM2OwogICAgIGludCBtYXhJbmRleCA9IC0xOwogICAgIGZvcihpbnQgaSA9IDA7IGkgPCBpbmRleENvdW50OyBpKyspIHsKQEAgLTExMCwxOCArMTEwLDE4IEBACiAgICAgICAgICAgICBtYXhJbmRleCA9IGluZGV4OwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgaWYgKCBtYXhJbmRleCAqIDMgPiBwb3NpdGlvbnNMZW5ndGgpIHsKICAgICAgICAgcmV0dXJuIC0xOwogICAgIH0KLSAgICAKKwogICAgIHRyYW5zZm9ybWVkSW5kZXhDb3VudCA9IG1heEluZGV4IC0gbWluSW5kZXggKyAxOwogICAgIHBUcmFuc2Zvcm1lZCA9IChmbG9hdCopIG1hbGxvY0hlbHBlci5hbGxvYyh0cmFuc2Zvcm1lZEluZGV4Q291bnQgKiA0ICogc2l6ZW9mKGZsb2F0KSk7Ci0gICAgCisKICAgICBpZiAocFRyYW5zZm9ybWVkID09IDAgKSB7CiAgICAgICAgIHJldHVybiAtMjsKICAgICB9Ci0gICAgCisKICAgICAvLyBUcmFuc2Zvcm0gdGhlIHZlcnRpY2VzCiAgICAgewogICAgICAgICBjb25zdCBmbG9hdCogcFNyYyA9IHBQb3NpdGlvbnMgKyAzICogbWluSW5kZXg7CkBAIC0xMzAsOSArMTMwLDkgQEAKICAgICAgICAgICAgIG14NHRyYW5zZm9ybShwU3JjWzBdLCBwU3JjWzFdLCBwU3JjWzJdLCAxLjBmLCBwV1MsICBwRHN0KTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8vIENsaXAgdGhlIHRyaWFuZ2xlcwotICAgIAorCiAgICAgUG9seSBwb2x5OwogICAgIGZsb2F0KiBwRGVzdCA9ICYgcG9seS52ZXJ0WzBdLnN4OwogICAg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ybWFsaXplUGxhbmUoZik7CiAgICAgZis9IDQ7CiAKLSAgICAvLyBsZWZ0ICAgIAorICAgIC8vIGxlZnQKICAgICBmWzBdID0gbTMgICsgbVswXTsKICAgICBmWzFdID0gbTcgICsgbVs0XTsKICAgICBmWzJdID0gbTExICsgbVs4XTsKQEAgLTM5NiwyMCArMzk2LDIwIEBACiAgICAgRmxvYXRBcnJheUhlbHBlciBtdnAoZW52LCBtdnBfcmVmLCBtdnBPZmZzZXQsIDE2KTsKICAgICBGbG9hdEFycmF5SGVscGVyIHNwaGVyZXMoZW52LCBzcGhlcmVzX3JlZiwgc3BoZXJlc09mZnNldCwgc3BoZXJlc0NvdW50ICogNCk7CiAgICAgSW50QXJyYXlIZWxwZXIgcmVzdWx0cyhlbnYsIHJlc3VsdHNfcmVmLCByZXN1bHRzT2Zmc2V0LCByZXN1bHRzQ2FwYWNpdHkpOwotICAgIAorCiAgICAgYm9vbCBpbml0aWFsaXplZE9LID0gbXZwLmNoZWNrKCkgJiYgc3BoZXJlcy5jaGVjaygpICYmIHJlc3VsdHMuY2hlY2soKTsKICAgICAgICAgaWYgKCEgaW5pdGlhbGl6ZWRPSykgewogICAgICAgICByZXR1cm4gLTE7CiAgICAgfQotICAgIAorCiAgICAgbXZwLmJpbmQoKTsKICAgICBzcGhlcmVzLmJpbmQoKTsKICAgICByZXN1bHRzLmJpbmQoKTsKLSAgICAgICAgCisKICAgICBjb21wdXRlRnJ1c3R1bShtdnAubURhdGEsIGZydXN0dW0pOwotICAgIAorCiAgICAgLy8gQ3VsbCB0aGUgc3BoZXJlcwotICAgIAorCiAgICAgcFNwaGVyZSA9IHNwaGVyZXMubURhdGE7CiAgICAgcFJlc3VsdHMgPSByZXN1bHRzLm1EYXRhOwogICAgIG91dHB1dENvdW50ID0gMDsKQEAgLTQzNiwyNyArNDM2LDI3IEBACiAgICAgICAgIGpmbG9hdEFycmF5IHdzX3JlZiwgamludCB3c09mZnNldCwKICAgICAgICAgamZsb2F0QXJyYXkgcG9zaXRpb25zX3JlZiwgamludCBwb3NpdGlvbnNPZmZzZXQsCiAgICAgICAgIGpjaGFyQXJyYXkgaW5kaWNlc19yZWYsIGppbnQgaW5kaWNlc09mZnNldCwgamludCBpbmRleENvdW50KSB7Ci0gICAgCisKICAgICBGbG9hdEFycmF5SGVscGVyIHdzKGVudiwgd3NfcmVmLCB3c09mZnNldCwgMTYpOwogICAgIEZsb2F0QXJyYXlIZWxwZXIgcG9zaXRpb25zKGVudiwgcG9zaXRpb25zX3JlZiwgcG9zaXRpb25zT2Zmc2V0LCAwKTsKICAgICBVbnNpZ25lZFNob3J0QXJyYXlIZWxwZXIgaW5kaWNlcyhlbnYsIGluZGljZXNfcmVmLCBpbmRpY2VzT2Zmc2V0LCAwKTsKLSAgICAKKwogICAgIGJvb2wgY2hlY2tPSyA9IHdzLmNoZWNrKCkgJiYgcG9zaXRpb25zLmNoZWNrKCkgJiYgaW5kaWNlcy5jaGVjaygpOwogICAgIGlmICghIGNoZWNrT0spIHsKICAgICAgICAgLy8gUmV0dXJuIHZhbHVlIHdpbGwgYmUgaWdub3JlZCwgYmVjYXVzZSBhbiBleGNlcHRpb24gaGFzIGJlZW4gdGhyb3duLgogICAgICAgICByZXR1cm4gLTE7CiAgICAgfQotICAgIAorCiAgICAgaWYgKGluZGljZXMubUxlbmd0aCA8IGluZGV4Q291bnQpIHsKICAgICAgICAgZW52LT5UaHJvd05ldyhnSUFFQ2xhc3MsICJsZW5ndGggPCBvZmZzZXQgKyBpbmRleENvdW50Iik7CiAgICAgICAgIC8vIFJldHVybiB2YWx1ZSB3aWxsIGJlIGlnbm9yZWQsIGJlY2F1c2UgYW4gZXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bi4KICAgICAgICAgcmV0dXJuIC0xOwogICAgIH0KLSAgICAKKwogICAgIHdzLmJpbmQoKTsKICAgICBwb3NpdGlvbnMuYmluZCgpOwogICAgIGluZGljZXMuYmluZCgpOwotICAgICAgICAKKwogICAgIHJldHVybiB2aXN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gaW50IFJGQ09NTV9TT19TTkRCVUYgPSA3MCAqIDEwMjQ7ICAvLyA3MCBLQiBzZW5kIGJ1ZmZlcgorCitzdGF0aWMgc3RydWN0IGFzb2NrZXQgKmdldF9zb2NrZXREYXRhKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iaikgeworICAgIHN0cnVjdCBhc29ja2V0ICpzID0KKyAgICAgICAgICAgIChzdHJ1Y3QgYXNvY2tldCAqKSBlbnYtPkdldEludEZpZWxkKG9iaiwgZmllbGRfbVNvY2tldERhdGEpOworICAgIGlmICghcykKKyAgICAgICAgam5pVGhyb3dFeGNlcHRpb24oZW52LCAiamF2YS9pby9JT0V4Y2VwdGlvbiIsICJudWxsIHNvY2tldERhdGEiKTsKKyAgICByZXR1cm4gczsKK30KKworc3RhdGljIHZvaWQgaW5pdFNvY2tldEZyb21GZE5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmosIGppbnQgZmQpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKworICAgIHN0cnVjdCBhc29ja2V0ICpzID0gYXNvY2tldF9pbml0KGZkKTsKKworICAgIGlmICghcykgeworICAgICAgICBMT0dWKCJhc29ja2V0X2luaXQoKSBmYWlsZWQsIHRocm93aW5nIik7CisgICAgICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBlcnJubyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBlbnYtPlNldEludEZpZWxkKG9iaiwgZmllbGRfbVNvY2tldERhdGEsIChqaW50KXMpOworCisgICAgcmV0dXJuOworI2VuZGlmCisgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIEVOT1NZUyk7Cit9CisKK3N0YXRpYyB2b2lkIGluaXRTb2NrZXROYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqKSB7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisKKyAgICBpbnQgZmQ7CisgICAgaW50IGxtID0gMDsKKyAgICBpbnQgc25kYnVmOworICAgIGpib29sZWFuIGF1dGg7CisgICAgamJvb2xlYW4gZW5jcnlwdDsKKyAgICBqaW50IHR5cGU7CisKKyAgICB0eXBlID0gZW52LT5HZXRJbnRGaWVsZChvYmosIGZpZWxkX21UeXBlKTsKKworICAgIHN3aXRjaCAodHlwZSkgeworICAgIGNhc2UgVFlQRV9SRkNPTU06CisgICAgICAgIGZkID0gc29ja2V0KFBGX0JMVUVUT09USCwgU09DS19TVFJFQU0sIEJUUFJPVE9fUkZDT01NKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBUWVBFX1NDTzoKKyAgICAgICAgZmQgPSBzb2NrZXQoUEZfQkxVRVRPT1RILCBTT0NLX1NFUVBBQ0tFVCwgQlRQUk9UT19TQ08pOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFRZUEVfTDJDQVA6CisgICAgICAgIGZkID0gc29ja2V0KFBGX0JMVUVUT09USCwgU09DS19TRVFQQUNLRVQsIEJUUFJPVE9fTDJDQVApOworICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICBqbmlUaHJvd0lPRXhjZXB0aW9uKGVudiwgRU5PU1lTKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmIChmZCA8IDApIHsKKyAgICAgICAgTE9HVigic29ja2V0KCkgZmFpbGVkLCB0aHJvd2luZyIpOworICAgICAgICBqbmlUaHJvd0lPRXhjZXB0aW9uKGVudiwgZXJybm8pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgYXV0aCA9IGVudi0+R2V0Qm9vbGVhbkZpZWxkKG9iaiwgZmllbGRfbUF1dGgpOworICAgIGVuY3J5cHQgPSBlbnYtPkdldEJvb2xlYW5GaWVsZChvYmosIGZpZWxkX21FbmNyeXB0KTsKKworICAgIC8qIGtlcm5lbCBkb2VzIG5vdCB5ZXQgc3VwcG9ydCBMTSBmb3IgU0NPICovCisgICAgc3dpdGNoICh0eXBlKSB7CisgICAgY2FzZSBUWVBFX1JGQ09NTToKKyAgICAgICAgbG0gfD0gYXV0aCA/IFJGQ09NTV9MTV9BVVRIIDogMDsKKyAgICAgICAgbG0gfD0gZW5jcnlwdD8gUkZDT01NX0xNX0VOQ1JZUFQgOiAwOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFRZUEVfTDJDQVA6CisgICAgICAgIGxtIHw9IGF1dGggPyBMMkNBUF9MTV9BVVRIIDogMDsKKyAgICAgICAgbG0gfD0gZW5jcnlwdD8gTDJDQVBfTE1fRU5DUllQVCA6IDA7CisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGlmIChsbSkgeworICAgICAgICBpZiAoc2V0c29ja29wdChmZCwgU09MX1JGQ09NTSwgUkZDT01NX0xNLCAmbG0sIHNpemVvZihsbSkpKSB7CisgICAgICAgICAgICBMT0dWKCJzZXRzb2Nrb3B0KFJGQ09NTV9MTSkgZmFpbGVkLCB0aHJvd2luZyIpOworICAgICAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIGVycm5vKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmICh0eXBlID09IFRZUEVfUkZDT01NKSB7CisgICAgICAgIHNuZGJ1ZiA9IFJGQ09NTV9TT19TTkRCVUY7CisgICAgICAgIGlmIChzZXRzb2Nrb3B0KGZkLCBTT0xfU09DS0VULCBTT19TTkRCVUYsICZzbmRidWYsIHNpemVvZihzbmRidWYpKSkgeworICAgICAgICAgICAgTE9HVigic2V0c29ja29wdChTT19TTkRCVUYpIGZhaWxlZCwgdGhyb3dpbmciKTsKKyAgICAgICAgICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBlcnJubyk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisKKyAgICBMT0dWKCIuLi5mZCAlZCBjcmVhdGVkICglcywgbG0gPSAleCkiLCBmZCwgVFlQRV9BU19TVFIodHlwZSksIGxtKTsKKworICAgIGluaXRTb2NrZXRGcm9tRmROYXRpdmUoZW52LCBvYmosIGZkKTsKKyAgICByZXR1cm47CisjZW5kaWYKKyAgICBqbmlUaHJvd0lPRXhjZXB0aW9uKGVudiwgRU5PU1lTKTsKK30KKworc3RhdGljIHZvaWQgY29ubmVjdE5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmopIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKworICAgIGludCByZXQ7CisgICAgamludCB0eXBlOworICAgIGNvbnN0IGNoYXIgKmNfYWRkcmVzczsKKyAgICBqc3RyaW5nIGFkZHJlc3M7CisgICAgYmRhZGRyX3QgYmRhZGRyZXNzOworICAgIHNvY2tsZW5fdCBhZGRyX3N6OworICAgIHN0cnVjdCBzb2NrYWRkciAqYWRkcjsKKyAgICBzdHJ1Y3QgYXNvY2tldCAqcyA9IGdldF9zb2NrZXREYXRhKGVudiwgb2JqKTsKKworICAgIGlmICghcykKKyAgICAgICAgcmV0dXJuOworCisgICAgdHlwZSA9IGVudi0+R2V0SW50RmllbGQob2JqLCBmaWVsZF9tVHlwZSk7CisKKyAgICAvKiBwYXJzZSBhZGRyZXNzIGludG8gYmRhZGRyZXNzICovCisgICAgYWRkcmVzcyA9IChqc3RyaW5nKSBlbnYtPkdldE9iamVjdEZpZWxkKG9iaiwgZmllbGRfbUFkZHJlc3MpOworICAgIGNfYWRkcmVzcyA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgTlVMTCk7CisgICAgaWYgKGdldF9iZGFkZHIoY19hZGRyZXNzLCAmYmRhZGRyZXNzKSkgeworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOworICAgICAgICBqbmlUaHJvd0lPRXhjZXB0aW9uKGVudiwgRUlOVkFMKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOworCisgICAgc3dpdGNoICh0eXBlKSB7CisgICAgY2FzZSBUWVBFX1JGQ09NTToKKyAgICAgICAgc3RydWN0IHNvY2thZGRyX3JjIGFkZHJfcmM7CisgICAgICAgIGFkZHIgPSAoc3RydWN0IHNvY2thZGRyICopJmFkZHJfcmM7CisgICAgICAgIGFkZHJfc3ogPSBzaXplb2YoYWRkcl9yYyk7CisKKyAgICAgICAgbWVtc2V0KGFkZHIsIDAsIGFkZHJfc3opOworICAgICAgICBhZGRyX3JjLnJjX2ZhbWlseSA9IEFGX0JMVUVUT09USDsKKyAgICAgICAgYWRkcl9yYy5yY19jaGFubmVsID0gZW52LT5HZXRJbnRGaWVsZChvYmosIGZpZWxkX21Qb3J0KTsKKyAgICAgICAgbWVtY3B5KCZhZGRyX3JjLnJjX2JkYWRkciwgJmJkYWRkcmVzcywgc2l6ZW9mKGJkYWRkcl90KSk7CisKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBUWVBFX1NDTzoKKyAgICAgICAgc3RydWN0IHNvY2thZGRyX3NjbyBhZGRyX3NjbzsKKyAgICAgICAgYWRkciA9IChzdHJ1Y3Qgc29ja2FkZHIgKikmYWRkcl9zY287CisgICAgICAgIGFkZHJfc3ogPSBzaXplb2YoYWRkcl9zY28pOworCisgICAgICAgIG1lbXNldChhZGRyLCAwLCBhZGRyX3N6KTsKKyAgICAgICAgYWRkcl9zY28uc2NvX2ZhbWlseSA9IEFGX0JMVUVUT09USDsKKyAgICAgICAgbWVtY3B5KCZhZGRyX3Njby5zY29fYmRhZGRyLCAmYmRhZGRyZXNzLCBzaXplb2YoYmRhZGRyX3QpKTsKKworICAgICAgICBicmVhazsKKyAgICBjYXNlIFRZUEVfTDJDQVA6CisgICAgICAgIHN0cnVjdCBzb2NrYWRkcl9sMiBhZGRyX2wyOworICAgICAgICBhZGRyID0gKHN0cnVjdCBzb2NrYWRkciAqKSZhZGRyX2wyOworICAgICAgICBhZGRyX3N6ID0gc2l6ZW9mKGFkZHJfbDIpOworCisgICAgICAgIG1lbXNldChhZGRyLCAwLCBhZGRyX3N6KTsKKyAgICAgICAgYWRkcl9sMi5sMl9mYW1pbHkgPSBBRl9CTFVFVE9PVEg7CisgICAgICAgIGFkZHJfbDIubDJfcHNtID0gZW52LT5HZXRJbnRGaWVsZChvYmosIGZpZWxkX21Qb3J0KTsKKyAgICAgICAgbWVtY3B5KCZhZGRyX2wyLmwyX2JkYWRkciwgJmJkYWRkcmVzcywgc2l6ZW9mKGJkYWRkcl90KSk7CisKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIEVOT1NZUyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICByZXQgPSBhc29ja2V0X2Nvbm5lY3QocywgYWRkciwgYWRkcl9zeiwgLTEpOworICAgIExPR1YoIi4uLmNvbm5lY3QoJWQsICVzKSA9ICVkIChlcnJubyAlZCkiLAorICAgICAgICAgICAgcy0+ZmQsIFRZUEVfQVNfU1RSKHR5cGUpLCByZXQsIGVycm5vKTsKKworICAgIGlmIChyZXQpCisgICAgICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBlcnJubyk7CisKKyAgICByZXR1cm47CisjZW5kaWYKKyAgICBqbmlUaHJvd0lPRXhjZXB0aW9uKGVudiwgRU5PU1lTKTsKK30KKworc3RhdGljIHZvaWQgYmluZExpc3Rlbk5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmopIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKworICAgIGppbnQgdHlwZTsKKyAgICBzb2NrbGVuX3QgYWRkcl9zejsKKyAgICBzdHJ1Y3Qgc29ja2FkZHIgKmFkZHI7CisgICAgYmRhZGRyX3QgYmRhZGRyID0gKkJEQUREUl9BTlk7CisgICAgc3RydWN0IGFzb2NrZXQgKnMgPSBnZXRfc29ja2V0RGF0YShlbnYsIG9iaik7CisKKyAgICBpZiAoIXMpCisgICAgICAgIHJldHVybjsKKworICAgIHR5cGUgPSBlbnYtPkdldEludEZpZWxkKG9iaiwgZmllbGRfbVR5cGUpOworCisgICAgc3dpdGNoICh0eXBlKSB7CisgICAgY2FzZSBUWVBFX1JGQ09NTToKKyAgICAgICAgc3RydWN0IHNvY2thZGRyX3JjIGFkZHJfcmM7CisgICAgICAgIGFkZHIgPSAoc3RydWN0IHNvY2thZGRyICopJmFkZHJfcmM7CisgICAgICAgIGFkZHJfc3ogPSBzaXplb2YoYWRkcl9yYyk7CisKKyAgICAgICAgbWVtc2V0KGFkZHIsIDAsIGFkZHJfc3opOworICAgICAgICBhZGRyX3JjLnJjX2ZhbWlseSA9IEFGX0JMVUVUT09USDsKKyAgICAgICAgYWRkcl9yYy5yY19jaGFubmVsID0gZW52LT5HZXRJbnRGaWVsZChvYmosIGZpZWxkX21Qb3J0KTsKKyAgICAgICAgbWVtY3B5KCZhZGRyX3JjLnJjX2JkYWRkciwgJmJkYWRkciwgc2l6ZW9mKGJkYWRkcl90KSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgVFlQRV9TQ086CisgICAgICAgIHN0cnVjdCBzb2NrYWRkcl9zY28gYWRkcl9zY287CisgICAgICAgIGFkZHIgPSAoc3RydWN0IHNvY2thZGRyICopJmFkZHJfc2NvOworICAgICAgICBhZGRyX3N6ID0gc2l6ZW9mKGFkZHJfc2NvKTsKKworICAgICAgICBtZW1zZXQoYWRkciwgMCwgYWRkcl9zeik7CisgICAgICAgIGFkZHJfc2NvLnNjb19mYW1pbHkgPSBBRl9CTFVFVE9PVEg7CisgICAgICAgIG1lbWNweSgmYWRkcl9zY28uc2NvX2JkYWRkciwgJmJkYWRkciwgc2l6ZW9mKGJkYWRkcl90KSk7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgVFlQRV9MMkNBUDoKKyAgICAgICAgc3RydWN0IHNvY2thZGRyX2wyIGFkZHJfbDI7CisgICAgICAgIGFkZHIgPSAoc3RydWN0IHNvY2thZGRyICopJmFkZHJfbDI7CisgICAgICAgIGFkZHJfc3ogPSBzaXplb2YoYWRkcl9sMik7CisKKyAgICAgICAgbWVtc2V0KGFkZHIsIDAsIGFkZHJfc3opOworICAgICAgICBhZGRyX2wyLmwyX2ZhbWlseSA9IEFGX0JMVUVUT09USDsKKyAgICAgICAgYWRkcl9sMi5sMl9wc20gPSBlbnYtPkdldEludEZpZWxkKG9iaiwgZmllbGRfbVBvcnQpOworICAgICAgICBtZW1jcHkoJmFkZHJfbDIubDJfYmRhZGRyLCAmYmRhZGRyLCBzaXplb2YoYmRhZGRyX3QpKTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIEVOT1NZUyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoYmluZChzLT5mZCwgYWRkciwgYWRkcl9zeikpIHsKKyAgICAgICAgTE9HVigiLi4uYmluZCglZCkgZ2F2ZSBlcnJubyAlZCIsIHMtPmZkLCBlcnJubyk7CisgICAgICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBlcnJubyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAobGlzdGVuKHMtPmZkLCAxKSkgeworICAgICAgICBMT0dWKCIuLi5saXN0ZW4oJWQpIGdhdmUgZXJybm8gJWQiLCBzLT5mZCwgZXJybm8pOworICAgICAgICBqbmlUaHJvd0lPRXhjZXB0aW9uKGVudiwgZXJybm8pOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgTE9HVigiLi4uYmluZExpc3Rlbk5hdGl2ZSglZCkgc3VjY2VzcyIsIHMtPmZkKTsKKworICAgIHJldHVybjsKKworI2VuZGlmCisgICAgam5pVGhyb3dJT0V4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cl9zY287CisgICAgICAgIGFkZHJfc3ogPSBzaXplb2YoYWRkcl9zY28pOworICAgICAgICBiZGFkZHIgPSAmYWRkcl9zY28uc2NvX2JkYWRkcjsKKyAgICAgICAgbWVtc2V0KGFkZHIsIDAsIGFkZHJfc3opOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFRZUEVfTDJDQVA6CisgICAgICAgIHN0cnVjdCBzb2NrYWRkcl9sMiBhZGRyX2wyOworICAgICAgICBhZGRyID0gKHN0cnVjdCBzb2NrYWRkciAqKSZhZGRyX2wyOworICAgICAgICBhZGRyX3N6ID0gc2l6ZW9mKGFkZHJfbDIpOworICAgICAgICBiZGFkZHIgPSAmYWRkcl9sMi5sMl9iZGFkZHI7CisgICAgICAgIG1lbXNldChhZGRyLCAwLCBhZGRyX3N6KTsKKyAgICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIEVOT1NZUyk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGZkID0gYXNvY2tldF9hY2NlcHQocywgYWRkciwgJmFkZHJfc3osIHRpbWVvdXQpOworCisgICAgTE9HVigiLi4uYWNjZXB0KCVkLCAlcykgPSAlZCAoZXJybm8gJWQpIiwKKyAgICAgICAgICAgIHMtPmZkLCBUWVBFX0FTX1NUUih0eXBlKSwgZmQsIGVycm5vKTsKKworICAgIGlmIChmZCA8IDApIHsKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIGVycm5vKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgLyogQ29ubmVjdGVkIC0gcmV0dXJuIG5ldyBCbHVldG9vdGhTb2NrZXQgKi8KKyAgICBhdXRoID0gZW52LT5HZXRCb29sZWFuRmllbGQob2JqLCBmaWVsZF9tQXV0aCk7CisgICAgZW5jcnlwdCA9IGVudi0+R2V0Qm9vbGVhbkZpZWxkKG9iaiwgZmllbGRfbUVuY3J5cHQpOworCisgICAgZ2V0X2JkYWRkcl9hc19zdHJpbmcoYmRhZGRyLCBhZGRyX2NzdHIpOworCisgICAgYWRkcl9qc3RyID0gZW52LT5OZXdTdHJpbmdVVEYoYWRkcl9jc3RyKTsKKyAgICByZXR1cm4gZW52LT5OZXdPYmplY3QoY2xhc3NfQmx1ZXRvb3RoU29ja2V0LCBtZXRob2RfQmx1ZXRvb3RoU29ja2V0X2N0b3IsCisgICAgICAgICAgICB0eXBlLCBmZCwgYXV0aCwgZW5jcnlwdCwgYWRkcl9qc3RyLCAtMSk7CisKKyNlbmRpZgorICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBFTk9TWVMpOworICAgIHJldHVybiBOVUxMOworfQorCitzdGF0aWMgamludCBhdmFpbGFibGVOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqKSB7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisKKyAgICBpbnQgYXZhaWxhYmxlOworICAgIHN0cnVjdCBhc29ja2V0ICpzID0gZ2V0X3NvY2tldERhdGEoZW52LCBvYmopOworCisgICAgaWYgKCFzKQorICAgICAgICByZXR1cm4gLTE7CisKKyAgICBpZiAoaW9jdGwocy0+ZmQsIEZJT05SRUFELCAmYXZhaWxhYmxlKSA8IDApIHsKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIGVycm5vKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIHJldHVybiBhdmFpbGFibGU7CisKKyNlbmRpZgorICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBFTk9TWVMpOworICAgIHJldHVybiAtMTsKK30KKworLyoqIGpiIG11c3Qgbm90IGJlIG51bGwuIG9mZnNldCBhbmQgb2Zmc2V0K2xlbmd0aCBtdXN0IGJlIHdpdGhpbiBhcnJheSAqLworc3RhdGljIGppbnQgcmVhZE5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmosIGpieXRlQXJyYXkgamIsIGppbnQgb2Zmc2V0LAorICAgICAgICBqaW50IGxlbmd0aCkgeworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworCisgICAgaW50IHJldDsKKyAgICBqYnl0ZSAqYjsKKyAgICBzdHJ1Y3QgYXNvY2tldCAqcyA9IGdldF9zb2NrZXREYXRhKGVudiwgb2JqKTsKKworICAgIGlmICghcykKKyAgICAgICAgcmV0dXJuIC0xOworCisgICAgYiA9IGVudi0+R2V0Qnl0ZUFycmF5RWxlbWVudHMoamIsIE5VTEwpOworICAgIGlmIChiID09IE5VTEwpIHsKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIEVJTlZBTCk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICByZXQgPSBhc29ja2V0X3JlYWQocywgJmJbb2Zmc2V0XSwgbGVuZ3RoLCAtMSk7CisgICAgaWYgKHJldCA8IDApIHsKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIGVycm5vKTsKKyAgICAgICAgZW52LT5SZWxlYXNlQnl0ZUFycmF5RWxlbWVudHMoamIsIGIsIEpOSV9BQk9SVCk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBlbnYtPlJlbGVhc2VCeXRlQXJyYXlFbGVtZW50cyhqYiwgYiwgMCk7CisgICAgcmV0dXJuIChqaW50KXJldDsKKworI2VuZGlmCisgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIEVOT1NZUyk7CisgICAgcmV0dXJuIC0xOworfQorCisvKiogamIgbXVzdCBub3QgYmUgbnVsbC4gb2Zmc2V0IGFuZCBvZmZzZXQrbGVuZ3RoIG11c3QgYmUgd2l0aGluIGFycmF5ICovCitzdGF0aWMgamludCB3cml0ZU5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmosIGpieXRlQXJyYXkgamIsIGppbnQgb2Zmc2V0LAorICAgICAgICBqaW50IGxlbmd0aCkgeworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworCisgICAgaW50IHJldDsKKyAgICBqYnl0ZSAqYjsKKyAgICBzdHJ1Y3QgYXNvY2tldCAqcyA9IGdldF9zb2NrZXREYXRhKGVudiwgb2JqKTsKKworICAgIGlmICghcykKKyAgICAgICAgcmV0dXJuIC0xOworCisgICAgYiA9IGVudi0+R2V0Qnl0ZUFycmF5RWxlbWVudHMoamIsIE5VTEwpOworICAgIGlmIChiID09IE5VTEwpIHsKKyAgICAgICAgam5pVGhyb3dJT0V4Y2VwdGlvbihlbnYsIEVJTlZBTCk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICByZXQgPSBhc29ja2V0X3dyaXRlKHMsICZiW29mZnNldF0sIGxlbmd0aCwgLTEpOworICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBlcnJubyk7CisgICAgICAgIGVudi0+UmVsZWFzZUJ5dGVBcnJheUVsZW1lbnRzKGpiLCBiLCBKTklfQUJPUlQpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgZW52LT5SZWxlYXNlQnl0ZUFycmF5RWxlbWVudHMoamIsIGIsIEpOSV9BQk9SVCk7ICAvLyBubyBuZWVkIHRvIGNvbW1pdAorICAgIHJldHVybiAoamludClyZXQ7CisKKyNlbmRpZgorICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBFTk9TWVMpOworICAgIHJldHVybiAtMTsKK30KKworc3RhdGljIHZvaWQgYWJvcnROYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqKSB7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisgICAgc3RydWN0IGFzb2NrZXQgKnMgPSBnZXRfc29ja2V0RG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SAgICBMT0dWKF9fRlVOQ1RJT05fXyk7Ci19Ci0KLXN0YXRpYyBqaW50IGFkZFNlcnZpY2VSZWNvcmROYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYnl0ZUFycmF5IHJlY29yZCkgewotICAgIExPR1YoX19GVU5DVElPTl9fKTsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIGlmIChjb25uICE9IE5VTEwpIHsKLSAgICAgICAgamJ5dGUqIGNfcmVjb3JkID0gZW52LT5HZXRCeXRlQXJyYXlFbGVtZW50cyhyZWNvcmQsIE5VTEwpOwotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPSBkYnVzX2Z1bmNfYXJncyhlbnYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJMVUVaX0RCVVNfQkFTRV9QQVRILAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBZGRTZXJ2aWNlUmVjb3JkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0FSUkFZLCBEQlVTX1RZUEVfQllURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNfcmVjb3JkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPkdldEFycmF5TGVuZ3RoKHJlY29yZCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKLSAgICAgICAgZW52LT5SZWxlYXNlQnl0ZUFycmF5RWxlbWVudHMocmVjb3JkLCBjX3JlY29yZCwgSk5JX0FCT1JUKTsKLSAgICAgICAgcmV0dXJuIHJlcGx5ID8gZGJ1c19yZXR1cm5zX3VpbnQzMihlbnYsIHJlcGx5KSA6IC0xOwotICAgIH0KLSNlbmRpZgotICAgIHJldHVybiAtMTsKLX0KLQotc3RhdGljIGppbnQgYWRkU2VydmljZVJlY29yZEZyb21YbWxOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyByZWNvcmQpIHsKLSAgICBMT0dWKF9fRlVOQ1RJT05fXyk7Ci0jaWZkZWYgSEFWRV9CTFVFVE9PVEgKLSAgICBpZiAoY29ubiAhPSBOVUxMKSB7Ci0gICAgICAgIGNvbnN0IGNoYXIgKmNfcmVjb3JkID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhyZWNvcmQsIE5VTEwpOwotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPSBkYnVzX2Z1bmNfYXJncyhlbnYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJMVUVaX0RCVVNfQkFTRV9QQVRILAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBZGRTZXJ2aWNlUmVjb3JkRnJvbVhNTCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX3JlY29yZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhyZWNvcmQsIGNfcmVjb3JkKTsKLSAgICAgICAgcmV0dXJuIHJlcGx5ID8gZGJ1c19yZXR1cm5zX3VpbnQzMihlbnYsIHJlcGx5KSA6IC0xOwotICAgIH0KLSNlbmRpZgotICAgIHJldHVybiAtMTsKLX0KLQotc3RhdGljIHZvaWQgdXBkYXRlU2VydmljZVJlY29yZE5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYnl0ZUFycmF5IHJlY29yZCkgewotICAgIExPR1YoX19GVU5DVElPTl9fKTsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIGlmIChjb25uICE9IE5VTEwpIHsKLSAgICAgICAgamJ5dGUqIGNfcmVjb3JkID0gZW52LT5HZXRCeXRlQXJyYXlFbGVtZW50cyhyZWNvcmQsIE5VTEwpOwotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPSBkYnVzX2Z1bmNfYXJncyhlbnYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJMVUVaX0RCVVNfQkFTRV9QQVRILAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVcGRhdGVTZXJ2aWNlUmVjb3JkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1VJTlQzMiwgJmhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0FSUkFZLCBEQlVTX1RZUEVfQllURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNfcmVjb3JkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPkdldEFycmF5TGVuZ3RoKHJlY29yZCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKLSAgICAgICAgZW52LT5SZWxlYXNlQnl0ZUFycmF5RWxlbWVudHMocmVjb3JkLCBjX3JlY29yZCwgSk5JX0FCT1JUKTsKLSAgICB9Ci0jZW5kaWYKLX0KLQotc3RhdGljIHZvaWQgdXBkYXRlU2VydmljZVJlY29yZEZyb21YbWxOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBoYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIHJlY29yZCkgewotICAgIExPR1YoX19GVU5DVElPTl9fKTsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIGlmIChjb25uICE9IE5VTEwpIHsKLSAgICAgICAgY29uc3QgY2hhciAqY19yZWNvcmQgPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHJlY29yZCwgTlVMTCk7Ci0gICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9IGRidXNfZnVuY19hcmdzKGVudiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkxVRVpfREJVU19CQVNFX1BBVEgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQ0xBU1NfTkFNRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVwZGF0ZVNlcnZpY2VSZWNvcmRGcm9tWE1MIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1VJTlQzMiwgJmhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfcmVjb3JkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7Ci0gICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKHJlY29yZCwgY19yZWNvcmQpOwotICAgIH0KLSNlbmRpZgotfQotCi0vKiBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCByZW1vdmVTZXJ2aWNlUmVjb3JkTmF0aXZlKGludCBoYW5kbGUpOyAqLwotc3RhdGljIHZvaWQgcmVtb3ZlU2VydmljZVJlY29yZE5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgaGFuZGxlKSB7Ci0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgaWYgKGNvbm4gIT0gTlVMTCkgewotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPSBkYnVzX2Z1bmNfYXJncyhlbnYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJMVUVaX0RCVVNfQkFTRV9QQVRILAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJSZW1vdmVTZXJ2aWNlUmVjb3JkIiwKLSAgICAgIC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vdXRwdXQKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0gZWxzZSB7Ci0gICAgICAgIExPR0UoIiVzOiBzb2NrZXQoUkZDT01NKSBlcnJvcjogc29ja2V0IG5vdCBjcmVhdGVkIiwgX19GVU5DVElPTl9fKTsKLSAgICB9Ci0KLSAgICBpZiAobmF0LT5yZmNvbW1fY29ubmVjdGVkID4gMCkgewotICAgICAgICBlbnYtPlNldEludEZpZWxkKG9iaiwgZmllbGRfbVBvcnQsIHBvcnQpOwotICAgICAgICByZXR1cm4gSk5JX1RSVUU7Ci0gICAgfQotI2VuZGlmCi0gICAgcmV0dXJuIEpOSV9GQUxTRTsKLX0KLQotc3RhdGljIGpib29sZWFuIGNvbm5lY3RBc3luY05hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcywgamludCBwb3J0KSB7Ci0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqKTsKLQotICAgIGlmIChuYXQtPnJmY29tbV9zb2NrIDwgMCkgewotICAgICAgICBMT0dFKCIlczogc29ja2V0KFJGQ09NTSkgZXJyb3I6IHNvY2tldCBub3QgY3JlYXRlZCIsIF9fRlVOQ1RJT05fXyk7Ci0gICAgICAgIHJldHVybiBKTklfRkFMU0U7Ci0gICAgfQotCi0gICAgaWYgKG5hdC0+cmZjb21tX2Nvbm5lY3RlZCkgewotICAgICAgICBMT0dJKCJSRkNPTU0gc29ja2V0OiAlcy4iLAotICAgICAgICAgICAgIChuYXQtPnJmY29tbV9jb25uZWN0ZWQgPiAwKSA/Ci0gICAgICAgICAgICAgImFscmVhZHkgY29ubmVjdGVkIiA6ICJjb25uZWN0aW9uIGlzIGluIHByb2dyZXNzIik7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21Qb3J0LCBwb3J0KTsKLSAgICAgICAgICAgIHJldHVybiBKTklfVFJVRTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChyYyA8IDApIHsKLSAgICAgICAgICAgIGlmIChlcnJubyA9PSBFSU5QUk9HUkVTUyB8fCBlcnJubyA9PSBFQUdBSU4pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBMT0dJKCJSRkNPTU0gYXN5bmMgY29ubmVjdCBpcyBpbiBwcm9ncmVzcyAoJXMpIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlcnJvcihlcnJubykpOwotICAgICAgICAgICAgICAgICAgICBuYXQtPnJmY29tbV9jb25uZWN0ZWQgPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgZW52LT5TZXRJbnRGaWVsZChvYmosIGZpZWxkX21Qb3J0LCBwb3J0KTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpOSV9UUlVFOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIExPR0UoIlJGQ09NTSBhc3luYyBjb25uZWN0IGVycm9yICglZCk6ICVzICglZCkiLAotICAgICAgICAgICAgICAgICAgICAgICAgIG5hdC0+cmZjb21tX3NvY2ssIHN0cmVycm9yKGVycm5vKSwgZXJybm8pOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0gLy8gZmNudGwobmF0LT5yZmNvbW1fc29jayAuLi4pCi0jZW5kaWYKLSAgICByZXR1cm4gSk5JX0ZBTFNFOwotfQotCi1zdGF0aWMgamJvb2xlYW4gaW50ZXJydXB0QXN5bmNDb25uZWN0TmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iaikgewotICAgIC8vV1JJVEVNRQotICAgIHJldHVybiBKTklfVFJVRTsKLX0KLQotc3R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7Ci0gICAgICAgIHRvLnR2X3NlYyA9IHRpbWVvdXRfbXMgLyAxMDAwOwotICAgICAgICB0by50dl91c2VjID0gMTAwMCAqICh0aW1lb3V0X21zICUgMTAwMCk7Ci0gICAgfQotICAgIG4gPSBzZWxlY3QobmF0LT5yZmNvbW1fc29jayArIDEsCi0gICAgICAgICAgICAgICAmcnNldCwKLSAgICAgICAgICAgICAgICZ3c2V0LAotICAgICAgICAgICAgICAgTlVMTCwKLSAgICAgICAgICAgICAgICh0aW1lb3V0X21zIDwgMCA/IE5VTEwgOiAmdG8pKTsKLQotICAgIGlmICh0aW1lb3V0X21zID4gMCkgewotICAgICAgICBqaW50IHJlbWFpbmluZyA9IHRvLnR2X3NlYyoxMDAwICsgdG8udHZfdXNlYy8xMDAwOwotICAgICAgICBMT0dJKCJSZW1haW5pbmcgdGltZSAlbGRtcyIsIChsb25nKXJlbWFpbmluZyk7Ci0gICAgICAgIGVudi0+U2V0SW50RmllbGQob2JqLCBmaWVsZF9tVGltZW91dFJlbWFpbmluZ01zLAotICAgICAgICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZyk7Ci0gICAgfQotCi0gICAgaWYgKG4gPD0gMCkgewotICAgICAgICBpZiAobiA8IDApICB7Ci0gICAgICAgICAgICBMT0dFKCJzZWxlY3QoKSBvbiBSRkNPTU0gc29ja2V0OiAlcyAoJWQpIiwKLSAgICAgICAgICAgICAgICAgc3RyZXJyb3IoZXJybm8pLAotICAgICAgICAgICAgICAgICBlcnJubyk7Ci0gICAgICAgICAgICByZXR1cm4gLTE7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotICAgIC8qIG4gbXVzdCBiZSBlcXVhbCB0byAxIGFuZCBlaXRoZXIgcnNldCBvciB3c2V0IG11c3QgaGF2ZSB0aGUKLSAgICAgICBmaWxlIGRlc2NyaXB0b3Igc2V0LiAqLwotICAgIExPR0koInNlbGVjdCgpIHJldHVybmVkICVkLiIsIG4pOwotICAgIGlm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vY2ssIGZhbHNlKTsKLSAgICByZXR1cm4gbnNrOwotfQotI2VuZGlmIC8qSEFWRV9CTFVFVE9PVEgqLwotCi1zdGF0aWMgam9iamVjdCBhY2NlcHROYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgbmV3c29jaywgamludCB0aW1lb3V0TXMpIHsKLSAgICBMT0dWKF9fRlVOQ1RJT05fXyk7Ci0jaWZkZWYgSEFWRV9CTFVFVE9PVEgKLSAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmopOwotICAgIGlmIChuYXQtPnJmY29tbV9zb2NrIDwgMCkgewotICAgICAgICBMT0dFKCJzb2NrZXQoUkZDT01NKSBlcnJvcjogc29ja2V0IG5vdCBjcmVhdGVkIik7Ci0gICAgICAgIHJldHVybiBKTklfRkFMU0U7Ci0gICAgfQotCi0gICAgaWYgKG5ld3NvY2sgPT0gTlVMTCkgewotICAgICAgICBMT0dFKCIlczogbmV3c29jayA9IE5VTExcbiIsIF9fRlVOQ1RJT05fXyk7Ci0gICAgICAgIHJldHVybiBKTklfRkFMU0U7Ci0gICAgfQotCi0gICAgaW50IG5zayA9IC0xOwotICAgIGlmICh0aW1lb3V0TXMgPCAwKSB7Ci0gICAgICAgIC8qIGJsb2NrIHVudGlsIGFjY2VwdCgpIHN1Y2NlZWRzICovCi0gICAgICAgIG5zayA9IGRvX2FjY2VwdChlbnYsIG9iaiwgbmF0LT5yZmNvbW1fc29jaywKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ld3NvY2ssIGZpZWxkX21BZGRyZXNzLCBmYWxzZSk7Ci0gICAgICAgIGlmIChuc2sgPCAwKSB7Ci0gICAgICAgICAgICByZXR1cm4gTlVMTDsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIHsKLSAgICAgICAgLyogd2FpdCB3aXRoIGEgdGltZW91dCAqLwotCi0gICAgICAgIHN0cnVjdCBwb2xsZmQgZmRzOwotICAgICAgICBmZHMuZmQgPSBuYXQtPnJmY29tbV9zb2NrOwotICAgICAgICBmZHMuZXZlbnRzID0gUE9MTElOIHwgUE9MTFBSSSB8IFBPTExPVVQgfCBQT0xMRVJSOwotCi0gICAgICAgIGVudi0+U2V0SW50RmllbGQob2JqLCBmaWVsZF9tQWNjZXB0VGltZW91dFJlbWFpbmluZ01zLCAwKTsKLSAgICAgICAgaW50IG4gPSBwb2xsKCZmZHMsIDEsIHRpbWVvdXRNcyk7Ci0gICAgICAgIGlmIChuIDw9IDApIHsKLSAgICAgICAgICAgIGlmIChuIDwgMCkgIHsKLSAgICAgICAgICAgICAgICBMT0dFKCJsaXN0ZW5pbmcgcG9sbCgpIG9uIFJGQ09NTSBzb2NrZXQ6ICVzICglZCkiLAotICAgICAgICAgICAgICAgICAgICAgc3RyZXJyb3IoZXJybm8pLAotICAgICAgICAgICAgICAgICAgICAgZXJybm8pOwotICAgICAgICAgICAgICAgIGVudi0+U2V0SW50RmllbGQob2JqLCBmaWVsZF9tQWNjZXB0VGltZW91dFJlbWFpbmluZ01zLCB0aW1lb3V0TXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgTE9HSSgibGlzdGVuaW5nIHBvbGwoKSBvbiBSRkNPTU0gc29ja2V0IHRpbWVkIG91dCIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0KLQotICAgICAgICBMT0dJKCJsaXN0ZW5pbmcgcG9sbCgpIG9uIFJGQ09NTSBzb2NrZXQgcmV0dXJuZWQgJWQiLCBuKTsKLSAgICAgICAgaWYgKGZkcy5mZCA9PSBuYXQtPnJmY29tbV9zb2NrKSB7Ci0gICAgICAgICAgICBpZiAoZmRzLnJldmVudHMgJiAoUE9MTElOIHwgUE9MTFBSSSB8IFBPTExPVVQpKSB7Ci0gICAgICAgICAgICAgIC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29uc3QgY2hhciAqbWVtYmVyLAogICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKm10eXBlKSB7CiAgICAgamZpZWxkSUQgZmllbGQgPSBlbnYtPkdldEZpZWxkSUQoY2xhenosIG1lbWJlciwgbXR5cGUpOwpAQCAtMzMyLDYgKzM2OSw0NCBAQAogICAgIHJldHVybiByZXQ7CiB9CiAKK3N0YXRpYyB2b2lkIHNldF9vYmplY3RfYXJyYXlfZWxlbWVudChKTklFbnYgKmVudiwgam9iamVjdEFycmF5IHN0ckFycmF5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKnZhbHVlLCBpbnQgaW5kZXgpIHsKKyAgICBqc3RyaW5nIG9iajsKKyAgICBvYmogPSBlbnYtPk5ld1N0cmluZ1VURih2YWx1ZSk7CisgICAgZW52LT5TZXRPYmplY3RBcnJheUVsZW1lbnQoc3RyQXJyYXksIGluZGV4LCBvYmopOworICAgIGVudi0+RGVsZXRlTG9jYWxSZWYob2JqKTsKK30KKworam9iamVjdEFycmF5IGRidXNfcmV0dXJuc19hcnJheV9vZl9vYmplY3RfcGF0aChKTklFbnYgKmVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5KSB7CisKKyAgICBEQnVzRXJyb3IgZXJyOworICAgIGNoYXIgKipsaXN0OworICAgIGludCBpLCBsZW47CisgICAgam9iamVjdEFycmF5IHN0ckFycmF5ID0gTlVMTDsKKworICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKKyAgICBpZiAoZGJ1c19tZXNzYWdlX2dldF9hcmdzIChyZXBseSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZXJyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9BUlJBWSwgREJVU19UWVBFX09CSkVDVF9QQVRILAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZsaXN0LCAmbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKSkgeworICAgICAgICBqY2xhc3Mgc3RyaW5nQ2xhc3M7CisgICAgICAgIGpzdHJpbmcgY2xhc3NOYW1lU3RyOworCisgICAgICAgIHN0cmluZ0NsYXNzID0gZW52LT5GaW5kQ2xhc3MoImphdmEvbGFuZy9TdHJpbmciKTsKKyAgICAgICAgc3RyQXJyYXkgPSBlbnYtPk5ld09iamVjdEFycmF5KGxlbiwgc3RyaW5nQ2xhc3MsIE5VTEwpOworCisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykKKyAgICAgICAgICAgIHNldF9vYmplY3RfYXJyYXlfZWxlbWVudChlbnYsIHN0ckFycmF5LCBsaXN0W2ldLCBpKTsKKyAgICB9IGVsc2UgeworICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCByZXBseSk7CisgICAgfQorCisgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICByZXR1cm4gc3RyQXJyYXk7Cit9CisKIGpvYmplY3RBcnJheSBkYnVzX3JldHVybnNfYXJyYXlfb2Zfc3RyaW5ncyhKTklFbnYgKmVudiwgREJ1c01lc3NhZ2UgKnJlcGx5KSB7CiAKICAgICBEQnVzRXJyb3IgZXJyOwpAQCAtMzUzLDExICs0MjgsOCBAQAogICAgICAgICBzdHJpbmdDbGFzcyA9IGVudi0+RmluZENsYXNzKCJqYXZhL2xhbmcvU3RyaW5nIik7CiAgICAgICAgIHN0ckFycmF5ID0gZW52LT5OZXdPYmplY3RBcnJheShsZW4sIHN0cmluZ0NsYXNzLCBOVUxMKTsKIAotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgIC8vTE9HVigiJXM6ICAgIGFycmF5WyVkXSA9IFslc10iLCBfX0ZVTkNUSU9OX18sIGks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0aWVzLAorICAgICAgICAgICAgICAgICAgaW50IG1heF9udW1fcHJvcGVydGllcywgaW50ICpwcm9wX2luZGV4LCBwcm9wZXJ0eV92YWx1ZSAqdmFsdWUsIGludCAqbGVuKSB7CisgICAgREJ1c01lc3NhZ2VJdGVyIHByb3BfdmFsLCBhcnJheV92YWxfaXRlcjsKKyAgICBjaGFyICpwcm9wZXJ0eSA9IE5VTEw7CisgICAgdWludDMyX3QgYXJyYXlfdHlwZTsKKyAgICBjaGFyICpzdHJfdmFsOworICAgIGludCBpLCBqLCB0eXBlLCBpbnRfdmFsOworCisgICAgaWYgKGRidXNfbWVzc2FnZV9pdGVyX2dldF9hcmdfdHlwZSgmaXRlcikgIT0gREJVU19UWVBFX1NUUklORykKKyAgICAgICAgcmV0dXJuIC0xOworICAgIGRidXNfbWVzc2FnZV9pdGVyX2dldF9iYXNpYygmaXRlciwgJnByb3BlcnR5KTsKKyAgICBpZiAoIWRidXNfbWVzc2FnZV9pdGVyX25leHQoJml0ZXIpKQorICAgICAgICByZXR1cm4gLTE7CisgICAgaWYgKGRidXNfbWVzc2FnZV9pdGVyX2dldF9hcmdfdHlwZSgmaXRlcikgIT0gREJVU19UWVBFX1ZBUklBTlQpCisgICAgICAgIHJldHVybiAtMTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgIG1heF9udW1fcHJvcGVydGllczsgaSsrKSB7CisgICAgICAgIGlmICghc3RybmNtcChwcm9wZXJ0eSwgcHJvcGVydGllc1tpXS5uYW1lLCBzdHJsZW4ocHJvcGVydHkpKSkKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKyAgICAqcHJvcF9pbmRleCA9IGk7CisgICAgaWYgKGkgPT0gbWF4X251bV9wcm9wZXJ0aWVzKQorICAgICAgICByZXR1cm4gLTE7CisKKyAgICBkYnVzX21lc3NhZ2VfaXRlcl9yZWN1cnNlKCZpdGVyLCAmcHJvcF92YWwpOworICAgIHR5cGUgPSBwcm9wZXJ0aWVzWypwcm9wX2luZGV4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DA7CisgICAgICAgIHZhbHVlLT5hcnJheV92YWwgPSBOVUxMOworICAgICAgICBpZiAoYXJyYXlfdHlwZSA9PSBEQlVTX1RZUEVfT0JKRUNUX1BBVEggfHwKKyAgICAgICAgICAgIGFycmF5X3R5cGUgPT0gREJVU19UWVBFX1NUUklORyl7CisgICAgICAgICAgICBqID0gMDsKKyAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgIGogKys7CisgICAgICAgICAgICB9IHdoaWxlKGRidXNfbWVzc2FnZV9pdGVyX25leHQoJmFycmF5X3ZhbF9pdGVyKSk7CisgICAgICAgICAgICBkYnVzX21lc3NhZ2VfaXRlcl9yZWN1cnNlKCZwcm9wX3ZhbCwgJmFycmF5X3ZhbF9pdGVyKTsKKyAgICAgICAgICAgIC8vIEFsbG9jYXRlICBhbiBhcnJheSBvZiBjaGFyICoKKyAgICAgICAgICAgICpsZW4gPSBqOworICAgICAgICAgICAgY2hhciAqKnRtcCA9IChjaGFyICoqKW1hbGxvYyhzaXplb2YoY2hhciAqKSAqICpsZW4pOworICAgICAgICAgICAgaWYgKCF0bXApCisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgaiA9IDA7CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICBkYnVzX21lc3NhZ2VfaXRlcl9nZXRfYmFzaWMoJmFycmF5X3ZhbF9pdGVyLCAmdG1wW2pdKTsKKyAgICAgICAgICAgICAgIGogKys7CisgICAgICAgICAgICB9IHdoaWxlKGRidXNfbWVzc2FnZV9pdGVyX25leHQoJmFycmF5X3ZhbF9pdGVyKSk7CisgICAgICAgICAgICB2YWx1ZS0+YXJyYXlfdmFsID0gdG1wOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgcmV0dXJuIDA7Cit9CisKK3ZvaWQgY3JlYXRlX3Byb3BfYXJyYXkoSk5JRW52ICplbnYsIGpvYmplY3RBcnJheSBzdHJBcnJheSwgUHJvcGVydGllcyAqcHJvcGVydHksCisgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5X3ZhbHVlICp2YWx1ZSwgaW50IGxlbiwgaW50ICphcnJheV9pbmRleCApIHsKKyAgICBjaGFyICoqcHJvcF92YWwgPSBOVUxMOworICAgIGNoYXIgYnVmWzMyXSA9IHsnXDAnfSwgYnVmMVszMl0gPSB7J1wwJ307CisgICAgaW50IGk7CisKKyAgICBjaGFyICpuYW1lID0gcHJvcGVydHktPm5hbWU7CisgICAgaW50IHByb3BfdHlwZSA9IHByb3BlcnR5LT50eXBlOworCisgICAgc2V0X29iamVjdF9hcnJheV9lbGVtZW50KGVudiwgc3RyQXJyYXksIG5hbWUsICphcnJheV9pbmRleCk7CisgICAgKmFycmF5X2luZGV4ICs9IDE7CisKKyAgICBpZiAocHJvcF90eXBlID09IERCVVNfVFlQRV9VSU5UMzIgfHwgcHJvcF90eXBlID09IERCVVNfVFlQRV9JTlQxNikgeworICAgICAgICBzcHJpbnRmKGJ1ZiwgIiVkIiwgdmFsdWUtPmludF92YWwpOworICAgICAgICBzZXRfb2JqZWN0X2FycmF5X2VsZW1lbnQoZW52LCBzdHJBcnJheSwgYnVmLCAqYXJyYXlfaW5kZXgpOworICAgICAgICAqYXJyYXlfaW5kZXggKz0gMTsKKyAgICB9IGVsc2UgaWYgKHByb3BfdHlwZSA9PSBEQlVTX1RZUEVfQk9PTEVBTikgeworICAgICAgICBzcHJpbnRmKGJ1ZiwgIiVzIiwgdmFsdWUtPmludF92YWwgPyAidHJ1ZSIgOiAiZmFsc2UiKTsKKworICAgICAgICBzZXRfb2JqZWN0X2FycmF5X2VsZW1lbnQoZW52LCBzdHJBcnJheSwgYnVmLCAqYXJyYXlfaW5kZXgpOworICAgICAgICAqYXJyYXlfaW5kZXggKz0gMTsKKyAgICB9IGVsc2UgaWYgKHByb3BfdHlwZSA9PSBEQlVTX1RZUEVfQVJSQVkpIHsKKyAgICAgICAgLy8gV3JpdGUgdGhlIGxlbmd0aCBmaXJzdAorICAgICAgICBzcHJpbnRmKGJ1ZjEsICIlZCIsIGxlbik7CisgICAgICAgIHNldF9vYmplY3RfYXJyYXlfZWxlbWVudChlbnYsIHN0ckFycmF5LCBidWYxLCAqYXJyYXlfaW5kZXgpOworICAgICAgICAqYXJyYXlfaW5kZXggKz0gMTsKKworICAgICAgICBwcm9wX3ZhbCA9IHZhbHVlLT5hcnJheV92YWw7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykgeworICAgICAgICAgICAgc2V0X29iamVjdF9hcnJheV9lbGVtZW50KGVudiwgc3RyQXJyYXksIHByb3BfdmFsW2ldLCAqYXJyYXlfaW5kZXgpOworICAgICAgICAgICAgKmFycmF5X2luZGV4ICs9IDE7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICBzZXRfb2JqZWN0X2FycmF5X2VsZW1lbnQoZW52LCBzdHJBcnJheSwgKGNvbnN0IGNoYXIgKikgdmFsdWUtPnN0cl92YWwsICphcnJheV9pbmRleCk7CisgICAgICAgICphcnJheV9pbmRleCArPSAxOworICAgIH0KK30KKworam9iamVjdEFycmF5IHBhcnNlX3Byb3BlcnRpZXMoSk5JRW52ICplbnYsIERCdXNNZXNzYWdlSXRlciAqaXRlciwgUHJvcGVydGllcyAqcHJvcGVydGllcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGludCBtYXhfbnVtX3Byb3BlcnRpZXMpIHsKKyAgICBEQnVzTWVzc2FnZUl0ZXIgZGljdF9lbnRyeSwgZGljdDsKKyAgICBqb2JqZWN0QXJyYXkgc3RyQXJyYXkgPSBOVUxMOworICAgIHByb3BlcnR5X3ZhbHVlIHZhbHVlOworICAgIGludCBpLCBzaXplID0gMCxhcnJheV9pbmRleCA9IDA7CisgICAgaW50IGxlbiA9IDAsIHByb3BfdHlwZSA9IERCVVNfVFlQRV9JTlZBTElELCBwcm9wX2luZGV4ID0gLTEsIHR5cGU7CisgICAgc3RydWN0IHsKKyAgICAgICAgcHJvcGVydHlfdmFsdWUgdmFsdWU7CisgICAgICAgIGludCBsZW47CisgICAgICAgIGJvb2wgdXNlZDsKKyAgICB9IHZhbHVlc1ttYXhfbnVtX3Byb3BlcnRpZXNdOworICAgIGludCB0LCBqOworCisgICAgamNsYXNzIHN0cmluZ0NsYXNzID0gZW52LT5GaW5kQ2xhc3MoImphdmEvbGFuZy9TdHJpbmciKTsKKyAgICBEQnVzRXJyb3IgZXJyOworICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKKworICAgIGZvciAoaSA9IDA7IGkgPCBtYXhfbnVtX3Byb3BlcnRpZXM7IGkrKykgeworICAgICAgICB2YWx1ZXNbaV0udXNlZCA9IGZhbHNlOworICAgIH0KKworICAgIGlmKGRidXNfbWVzc2FnZV9pdGVyX2dldF9hcmdfdHlwZShpdGVyKSAhPSBEQlVTX1RZUEVfQVJSQVkpCisgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICBkYnVzX21lc3NhZ2VfaXRlcl9yZWN1cnNlKGl0ZXIsICZkaWN0KTsKKyAgICBkbyB7CisgICAgICAgIGxlbiA9IDA7CisgICAgICAgIGlmIChkYnVzX21lc3NhZ2VfaXRlcl9nZXRfYXJnX3R5cGUoJmRpY3QpICE9IERCVVNfVFlQRV9ESUNUX0VOVFJZKQorICAgICAgICAgICAgZ290byBmYWlsdXJlOworICAgICAgICBkYnVzX21lc3NhZ2VfaXRlcl9yZWN1cnNlKCZkaWN0LCAmZGljdF9lbnRyeSk7CisKKyAgICAgICAgaWYgKCFnZXRfcHJvcGVydHkoZGljdF9lbnRyeSwgcHJvcGVydGllcywgbWF4X251bV9wcm9wZXJ0aWVzLCAmcHJvcF9pbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJnZhbHVlLCAmbGVuKSkgeworICAgICAgICAgICAgc2l6ZSArPSAyOworICAgICAgICAgICAgaWYgKHByb3BlcnRpZXNbcHJvcF9pbmRleF0udHlwZSA9PSBEQlVTX1RZUEVfQVJSQVkpCisgICAgICAgICAgICAgICAgc2l6ZSArPSBsZW47CisgICAgICAgICAgICB2YWx1ZXNbcHJvcF9pbmRleF0udmFsdWUgPSB2YWx1ZTsKKyAgICAgICAgICAgIHZhbHVlc1twcm9wX2luZGV4XS5sZW4gPSBsZW47CisgICAgICAgICAgICB2YWx1ZXNbcHJvcF9pbmRleF0udXNlZCA9IHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBnb3RvIGZhaWx1cmU7CisgICAgICAgIH0KKyAgICB9IHdoaWxlKGRidXNfbWVzc2FnZV9pdGVyX25leHQoJmRpY3QpKTsKKworICAgIHN0ckFycmF5ID0gZW52LT5OZXdPYmplY3RBcnJheShzaXplLCBzdHJpbmdDbGFzcywgTlVMTCk7CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgbWF4X251bV9wcm9wZXJ0aWVzOyBpKyspIHsKKyAgICAgICAgaWYgKHZhbHVlc1tpXS51c2VkKSB7CisgICAgICAgICAgICBjcmVhdGVfcHJvcF9hcnJheShlbnYsIHN0ckFycmF5LCAmcHJvcGVydGllc1tpXSwgJnZhbHVlc1tpXS52YWx1ZSwgdmFsdWVzW2ldLmxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhcnJheV9pbmRleCk7CisKKyAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzW2ldLnR5cGUgPT0gREJVU19UWVBFX0FSUkFZICYmIHZhbHVlc1tpXS51c2VkCisgICAgICAgICAgICAgICAgICAgJiYgdmFsdWVzW2ldLnZhbHVlLmFycmF5X3ZhbCAhPSBOVUxMKQorICAgICAgICAgICAgICAgIGZyZWUodmFsdWVzW2ldLnZhbHVlLmFycmF5X3ZhbCk7CisgICAgICAgIH0KKworICAgIH0KKyAgICByZXR1cm4gc3RyQXJyYXk7CisKK2ZhaWx1cmU6CisgICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKQorICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgbWF4X251bV9wcm9wZXJ0aWVzOyBpKyspCisgICAgICAgIGlmIChwcm9wZXJ0aWVzW2ldLnR5cGUgPT0gREJVU19UWVBFX0FSUkFZICYmIHZhbHVlc1tpXS51c2VkID09IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2YWx1ZXNbaV0udmFsdWUuYXJyYXlfdmFsICE9IE5VTEwpCisgICAgICAgICAgICBmcmVlKHZhbHVlc1tpXS52YWx1ZS5hcnJheV92YWwpOworICAgIHJldHVybiBOVUxMOworfQorCitqb2JqZWN0QXJyYXkgcGFyc2VfcHJvcGVydHlfY2hhbmdlKEpOSUVudiAqZW52LCBEQnVzTWVzc2FnZSAqbXNnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgUHJvcGVydGllcyAqcHJvcGVydGllcywgaW50IG1heF9udW1fcHJvcGVydGllcykgeworICAgIERCdXNNZXNzYWdlSXRlciBpdGVyOworICAgIERCdXNFcnJvciBlcnI7CisgICAgam9iamVjdEFycmF5IHN0ckFycmF5ID0gTlVMTDsKKyAgICBqY2xhc3Mgc3RyaW5nQ2xhc3M9IGVudi0+RmluZENsYXNzKCJqYXZhL2xhbmcvU3RyaW5nIik7CisgICAgaW50IGxlbiA9IDAsIHByb3BfaW5kZXggPSAtMTsKKyAgICBpbnQgYXJyYXlfaW5kZXggPSAwLCBzaXplID0gMDsKKyAgICBwcm9wZXJ0eV92YWx1ZSB2YWx1ZTsKKworICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKKyAgICBpZiAoIWRidXNfbWVzc2FnZV9pdGVyX2luaXQobXNnLCAmaXRlcikpCisgICAgICAgIGdvdG8gZmFpbHVyZTsKKworICAgIGlmICghZ2V0X3Byb3BlcnR5KGl0ZXIsIHByb3BlcnRpZXMsIG1heF9udW1fcHJvcGVydGllcywKKyAgICAgICAgICAgICAgICAgICAgICAmcHJvcF9pbmRleCwgJnZhbHVlLCAmbGVuKSkgeworICAgICAgICBzaXplICs9IDI7CisgICAgICAgIGlmIChwcm9wZXJ0aWVzW3Byb3BfaW5kZXhdLnR5cGUgPT0gREJVU19UWVBFX0FSUkFZKQorICAgICAgICAgICAgc2l6ZSArPSBsZW47CisgICAgICAgIHN0ckFycmF5ID0gZW52LT5OZXdPYmplY3RBcnJheShzaXplLCBzdHJpbmdDbGFzcywgTlVMTCk7CisKKyAgICAgICAgY3JlYXRlX3Byb3BfYXJyYXkoZW52LCBzdHJBcnJheSwgJnByb3BlcnRpZXNbcHJvcF9pbmRleF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICZ2YWx1ZSwgbGVuLCAmYXJyYXlfaW5kZXgpOworCisgICAgICAgIGlmIChwcm9wZXJ0aWVzW3Byb3BfaW5kZXhdLnR5cGUgPT0gREJVU19UWVBFX0FSUkFZICYmIHZhbHVlLmFycmF5X3ZhbCAhPSBOVUxMKQorICAgICAgICAgICAgIGZyZWUodmFsdWUuYXJyYXlfdmFsKTsKKworICAgICAgICByZXR1cm4gc3RyQXJyYXk7CisgICAgfQorZmFpbHVyZToKKyAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCBtc2cpOworICAgIHJldHVybiBOVUxMOworfQorCitqb2JqZWN0QXJyYXkgcGFyc2VfYWRhcHRlcl9wcm9wZXJ0eV9jaGFuZ2UoSk5JRW52ICplbnYsIERCdXNNZXNzYWdlICptc2cpIHsKKyAgICByZXR1cm4gcGFyc2VfcHJvcGVydHlfY2hhbmdlKGVudiwgbXNnLCAoUHJvcGVydGllcyAqKSAmYWRhcHRlcl9wcm9wZXJ0aWVzLAorICAgICAgICAgICAgICAgICAgICBzaXplb2YoYWRhcHRlcl9wcm9wZXJ0aWVzKSAvIHNpemVvZihQcm9wZXJ0aWVzKSk7Cit9CisKK2pvYmplY3RBcnJheSBwYXJz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lbnYtPk5ld1N0cmluZ1VURihzR3BzTmlOb3RpZmljYXRpb25Db3B5LnJlcXVlc3Rvcl9pZCk7CisgICAgICAganN0cmluZyB0ZXh0ID0gZW52LT5OZXdTdHJpbmdVVEYoc0dwc05pTm90aWZpY2F0aW9uQ29weS50ZXh0KTsKKyAgICAgICBqc3RyaW5nIGV4dHJhcyA9IGVudi0+TmV3U3RyaW5nVVRGKHNHcHNOaU5vdGlmaWNhdGlvbkNvcHkuZXh0cmFzKTsKKyAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG9iaiwgbWV0aG9kX3JlcG9ydE5pTm90aWZpY2F0aW9uLAorICAgICAgICAgICAgIHNHcHNOaU5vdGlmaWNhdGlvbkNvcHkubm90aWZpY2F0aW9uX2lkLAorICAgICAgICAgICAgIHNHcHNOaU5vdGlmaWNhdGlvbkNvcHkubmlfdHlwZSwKKyAgICAgICAgICAgICBzR3BzTmlOb3RpZmljYXRpb25Db3B5Lm5vdGlmeV9mbGFncywKKyAgICAgICAgICAgICBzR3BzTmlOb3RpZmljYXRpb25Db3B5LnRpbWVvdXQsCisgICAgICAgICAgICAgc0dwc05pTm90aWZpY2F0aW9uQ29weS5kZWZhdWx0X3Jlc3BvbnNlLAorICAgICAgICAgICAgIHJlcUlkLAorICAgICAgICAgICAgIHRleHQsCisgICAgICAgICAgICAgc0dwc05pTm90aWZpY2F0aW9uQ29weS5yZXF1ZXN0b3JfaWRfZW5jb2RpbmcsCisgICAgICAgICAgICAgc0dwc05pTm90aWZpY2F0aW9uQ29weS50ZXh0X2VuY29kaW5nLAorICAgICAgICAgICAgIGV4dHJhcworICAgICAgICk7CisgICAgfQogfQogCi1zdGF0aWMgamludCBhbmRyb2lkX2xvY2F0aW9uX0dwc0xvY2F0aW9uUHJvdmlkZXJfcmVhZF9zdl9zdGF0dXMoSk5JRW52KiBlbnYsIGpvYmplY3Qgb2JqLCAKLSAgICAgICAgamludEFycmF5IHBybkFycmF5LCBqZmxvYXRBcnJheSBz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gICAKLSAgICBwaWQgPSBmb3JrKCk7Ci0gICAgaWYocGlkIDwgMCkgewotICAgICAgICBMT0dFKCItIGZvcmsgZmFpbGVkOiAlcyAtXG4iLCBzdHJlcnJvcihlcnJubykpOwotICAgICAgICByZXR1cm4gLTE7Ci0gICAgfQotCi0gICAgaWYocGlkID09IDApewotICAgICAgICBpbnQgcHRzOwotCi0gICAgICAgIHNldHNpZCgpOwotICAgICAgICAKLSAgICAgICAgcHRzID0gb3BlbihkZXZuYW1lLCBPX1JEV1IpOwotICAgICAgICBpZihwdHMgPCAwKSBleGl0KC0xKTsKLQotICAgICAgICBkdXAyKHB0cywgMCk7Ci0gICAgICAgIGR1cDIocHRzLCAxKTsKLSAgICAgICAgZHVwMihwdHMsIDIpOwotCi0gICAgICAgIGNsb3NlKHB0bSk7Ci0KLSAgICAgICAgZXhlY2woY21kLCBjbWQsIGFyZzAsIGFyZzEsIE5VTEwpOwotICAgICAgICBleGl0KC0xKTsKLSAgICB9IGVsc2UgewotICAgICAgICAqcFByb2Nlc3NJZCA9IChpbnQpIHBpZDsKLSAgICAgICAgcmV0dXJuIHB0bTsKLSAgICB9Ci19Ci0KLQotc3RhdGljIGpvYmplY3QgYW5kcm9pZF9vc19FeGVjX2NyZWF0ZVN1YlByb2Nlc3MoSk5JRW52ICplbnYsIGpvYmplY3QgY2xhenosCi0gICAganN0cmluZyBjbWQsIGpzdHJpbmcgYXJnMCwganN0cmluZyBhcmcxLCBqaW50QXJyYXkgcHJvY2Vzc0lkQXJyYXkpCi17Ci0gICAgY29uc3QgamNoYXIqIHN0ciA9IGNtZCA/IGVudi0+R2V0U3RyaW5nQ3JpdGljYWwoY21kLCAwKSA6IDA7Ci0gICAgU3RyaW5nOCBjbWRfODsKLSAgICBpZiAoc3RyKSB7Ci0gICAgICAgIGNtZF84ID0gU3RyaW5nOChzdHIsIGVudi0+R2V0U3RyaW5nTGVuZ3RoKGNtZCkpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdD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AgICAgICAgICAgaW50KiBwUHJvY0lkID0gKGludCopIGVudi0+R2V0UHJpbWl0aXZlQXJyYXlDcml0aWNhbChwcm9jZXNzSWRBcnJheSwgJmlzQ29weSk7Ci0gICAgICAgICAgICBpZiAocFByb2NJZCkgewotICAgICAgICAgICAgICAgICpwUHJvY0lkID0gcHJvY0lkOwotICAgICAgICAgICAgICAgIGVudi0+UmVsZWFzZVByaW1pdGl2ZUFycmF5Q3JpdGljYWwocHJvY2Vzc0lkQXJyYXksIHBQcm9jSWQsIDApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIAotICAgIGpvYmplY3QgcmVzdWx0ID0gZW52LT5OZXdPYmplY3QoY2xhc3NfZmlsZURlc2NyaXB0b3IsIG1ldGhvZF9maWxlRGVzY3JpcHRvcl9pbml0KTsKLSAgICAKLSAgICBpZiAoIXJlc3VsdCkgewotICAgICAgICBMT0dFKCJDb3VsZG4ndCBjcmVhdGUgYSBGaWxlRGVzY3JpcHRvci4iKTsKLSAgICB9Ci0gICAgZWxzZSB7Ci0gICAgICAgIGVudi0+U2V0SW50RmllbGQocmVzdWx0LCBmaWVsZF9maWxlRGVzY3JpcHRvcl9kZXNjcmlwdG9yLCBwdG0pOwotICAgIH0KLSAgICAKLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi0KLXN0YXRpYyB2b2lkIGFuZHJvaWRfb3NfRXhlY19zZXRQdHlXaW5kb3dTaXplKEpOSUVudiAqZW52LCBqb2JqZWN0IGNsYXp6LAotICAgIGpvYmplY3QgZmlsZURlc2NyaXB0b3IsIGppbnQgcm93LCBqaW50IGNvbCwgamludCB4cGl4ZWwsIGppbnQgeXBpeGVsKQotewotICAgIGludCBmZDsKLSAgICBzdHJ1Y3Qgd2luc2l6ZSBzejsKLQotICAgIGZkID0gam5pR2V0RkRGcm9tRmlsZURlc2NyaXB0b3IoZW52LCBmaWxlRGVzY3JpcHRvcik7Ci0KLSAgICBpZiAoZW52LT5FeGNlcHRpb25P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nQoSk5JRW52ICplbnYsIGpvYmplY3QgY2xhenosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcga2V5SiwgamludCBkZWZKKQoreworICAgIGludCBsZW47CisgICAgY29uc3QgY2hhcioga2V5OworICAgIGNoYXIgYnVmW1BST1BFUlRZX1ZBTFVFX01BWF07CisgICAgamludCByZXN1bHQgPSBkZWZKOworCisgICAgaWYgKGtleUogPT0gTlVMTCkgeworICAgICAgICBqbmlUaHJvd0V4Y2VwdGlvbihlbnYsICJqYXZhL2xhbmcvTnVsbFBvaW50ZXJFeGNlcHRpb24iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAia2V5IG11c3Qgbm90IGJlIG51bGwuIik7CisgICAgICAgIGdvdG8gZXJyb3I7CisgICAgfQorCisgICAga2V5ID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhrZXlKLCBOVUxMKTsKKworICAgIGxlbiA9IHByb3BlcnR5X2dldChrZXksIGJ1ZiwgIiIpOworICAgIGlmIChsZW4gPiAwKSB7CisgICAgICAgIGppbnQgdGVtcDsKKyAgICAgICAgaWYgKHNzY2FuZihidWYsICIlZCIsICZ0ZW1wKSA9PSAxKQorICAgICAgICAgICAgcmVzdWx0ID0gdGVtcDsKKyAgICB9CisKKyAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhrZXlKLCBrZXkpOworCitlcnJvcjoKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitzdGF0aWMgamxvbmcgU3lzdGVtUHJvcGVydGllc19nZXRfbG9uZyhKTklFbnYgKmVudiwgam9iamVjdCBjbGF6eiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBrZXlKLCBqbG9uZyBkZWZKKQoreworICAgIGludCBsZW47CisgICAgY29uc3QgY2hhcioga2V5OworICAgIGNoYXIgYnVmW1BST1BFUlRZX1ZBTFVFX01BWF07CisgICAgamxvbmcgcmVzdWx0ID0gZGVmSjsKKworICAgIGlmIChrZXlKID09IE5VTEwpIHsKKyAgICAgICAgam5pVGhyb3dFeGNlcHRpb24oZW52LCAiamF2YS9sYW5nL051bGxQb2ludGVyRXhjZXB0aW9uIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImtleSBtdXN0IG5vdCBiZSBudWxsLiIpOworICAgICAgICBnb3RvIGVycm9yOworICAgIH0KKworICAgIGtleSA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMoa2V5SiwgTlVMTCk7CisKKyAgICBsZW4gPSBwcm9wZXJ0eV9nZXQoa2V5LCBidWYsICIiKTsKKyAgICBpZiAobGVuID4gMCkgeworICAgICAgICBqbG9uZyB0ZW1wOworICAgICAgICBpZiAoc3NjYW5mKGJ1ZiwgIiVsbGQiLCAmdGVtcCkgPT0gMSkKKyAgICAgICAgICAgIHJlc3VsdCA9IHRlbXA7CisgICAgfQorCisgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoa2V5Siwga2V5KTsKKworZXJyb3I6CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworc3RhdGljIGpib29sZWFuIFN5c3RlbVByb3BlcnRpZXNfZ2V0X2Jvb2xlYW4oSk5JRW52ICplbnYsIGpvYmplY3QgY2xhenosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcga2V5SiwgamJvb2xlYW4gZGVmSikKK3sKKyAgICBpbnQgbGVuOworICAgIGNvbnN0IGNoYXIqIGtleTsKKyAgICBjaGFyIGJ1ZltQUk9QRVJUWV9WQUxVRV9NQVhdOworICAgIGpib29sZWFuIHJlc3VsdCA9IGRlZko7CisKKyAgICBpZiAoa2V5SiA9PSBOVUxMKSB7CisgICAgICAgIGpuaVRocm93RXhjZXB0aW9uKGVudiwgImphdmEvbGFuZy9OdWxsUG9pbnRlckV4Y2VwdGlvbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJrZXkgbXVzdCBub3QgYmUgbnVsbC4iKTsKKyAgICAgICAgZ290byBlcnJvcjsKKyAgICB9CisKKyAgICBrZXkgPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKGtleUosIE5VTEwpOworCisgICAgbGVuID0gcHJvcGVydHlfZ2V0KGtleSwgYnVmLCAiIik7CisgICAgaWYgKGxlbiA9PSAxKSB7CisgICAgICAgIGNoYXIgY2ggPSBidWZbMF07CisgICAgICAgIGlmIChjaCA9PSAnMCcgfHwgY2ggPT0gJ24nKQorICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7CisgICAgICAgIGVsc2UgaWYgKGNoID09ICcxJyB8fCBjaCA9PSAneScpCisgICAgICAgICAgICByZXN1bHQgPSB0cnVlOworICAgIH0gZWxzZSBpZiAobGVuID4gMSkgeworICAgICAgICAgaWYgKCFzdHJjbXAoYnVmLCAibm8iKSB8fCAhc3RyY21wKGJ1ZiwgImZhbHNlIikgfHwgIXN0cmNtcChidWYsICJvZmYiKSkgeworICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7CisgICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcChidWYsICJ5ZXMiKSB8fCAhc3RyY21wKGJ1ZiwgInRydWUiKSB8fCAhc3RyY21wKGJ1ZiwgIm9uIikpIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhrZXlKLCBrZXkpOworCitlcnJvcjoKKyAgICByZXR1cm4gcmVzdWx0OworfQorCiBzdGF0aWMgdm9pZCBTeXN0ZW1Qcm9wZXJ0aWVzX3NldChKTklFbnYgKmVudiwgam9iamVjdCBjbGF6eiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBrZXlKLCBqc3RyaW5nIHZhbEopCiB7CkBAIC05NCw2ICsxODksMTIgQEAKICAgICAgICh2b2lkKikgU3lzdGVtUHJvcGVydGllc19nZXRTI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AKIC8qIFJldHVybnMgdHJ1ZSBvbiBzdWNjZXNzIChldmVuIGlmIGFkYXB0ZXIgaXMgcHJlc2VudCBidXQgZGlzYWJsZWQpLgpAQCAtMTAwLDkxICs5NSw1OCBAQAogICAgIH0KICNlbmRpZgogfQotc3RhdGljIGpvYmplY3RBcnJheSBsaXN0SGVhZHNldHNOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0KSB7Ci0jaWZkZWYgSEFWRV9CTFVFVE9PVEgKLSAgICBMT0dWKF9fRlVOQ1RJT05fXyk7Ci0gICAgaWYgKG5hdCkgewotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPQotICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3MoZW52LCBuYXQtPmNvbm4sICIvb3JnL2JsdWV6L2F1ZGlvIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouYXVkaW8uTWFuYWdlciIsICJMaXN0SGVhZHNldHMiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICByZXR1cm4gcmVwbHkgPyBkYnVzX3JldHVybnNfYXJyYXlfb2Zfc3RyaW5ncyhlbnYsIHJlcGx5KSA6IE5VTEw7Ci0gICAgfQotI2VuZGlmCi0gICAgcmV0dXJuIE5VTEw7Ci19CiAKLXN0YXRpYyBqc3RyaW5nIGNyZWF0ZUhlYWRzZXROYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcykgeworc3RhdGljIGpvYmplY3RBcnJheSBnZXRTaW5rUHJvcGVydGllc05hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgcGF0aCkgewogI2lmZGVmIEhBVkVfQkxVRVRPT1RICiAgICAgTE9HVihfX0ZVTkNUSU9OX18pOwogICAgIGlmIChuYXQpIHsKLSAgICAgICAgY29uc3QgY2hhciAqY19hZGRyZXNzID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBOVUxMKTsKLSAgICAgICAgTE9HVigiLi4uIGFkZHJlc3MgPSAlc1xuIiwgY19hZGRyZXNzKTsKLSAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0KLSAgICAgICAgICAgIGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLCAiL29yZy9ibHVlei9hdWRpbyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LmF1ZGlvLk1hbmFnZXIiLCAiQ3JlYXRlSGVhZHNldCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19hZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOwotICAgICAgICByZXR1cm4gcmVwbHkgPyBkYnVzX3JldHVybnNfc3RyaW5nKGVudiwgcmVwbHkpIDogTlVMTDsKLSAgICB9Ci0jZW5kaWYKLSAgICByZXR1cm4gTlVMTDsKLX0KKyAgICAgICAgREJ1c01lc3NhZ2UgKm1zZywgKnJlcGx5OworICAgICAgICBEQnVzRXJyb3IgZXJyOworICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CiAKLXN0YXRpYyBqc3RyaW5nIHJlbW92ZUhlYWRzZXROYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LCBqc3RyaW5nIHBhdGgpIHsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIExPR1YoX19GVU5DVElPTl9fKTsKLSAgICBpZiAobmF0KSB7CiAgICAgICAgIGNvbnN0IGNoYXIgKmNfcGF0aCA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMocGF0aCwgTlVMTCk7Ci0gICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9Ci0gICAgICAgICAgICBkYnVzX2Z1bmNfYXJncyhlbnYsIG5hdC0+Y29ubiwgIi9vcmcvYmx1ZXovYXVkaW8iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5hdWRpby5NYW5hZ2VyIiwgIlJlbW92ZUhlYWRzZXQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfcGF0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKKyAgICAgICAgcmVwbHkgPSBkYnVzX2Z1bmNfYXJnc190aW1lb3V0KGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0LT5jb25uLCAtMSwgY19wYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkF1ZGlvU2luayIsICJHZXRQcm9wZXJ0aWVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwogICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhwYXRoLCBjX3BhdGgpOwotICAgICAgICByZXR1cm4gcmVwbHkgPyBkYnVzX3JldHVybnNfc3RyaW5nKGVudiwgcmVwbHkpIDogTlVMTDsKKyAgICAgICAgaWYgKCFyZXBseSAmJiBkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgeworICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgcmVwbHkpOworICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0gZWxzZSBpZiAoIXJlcGx5KSB7CisgICAgICAgICAgICBMT0dFKCJEQnVzIHJlcG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SA/IGRidXNfcmV0dXJuc19zdHJpbmcoZW52LCByZXBseSkgOiBOVUxMOwotICAgIH0KLSNlbmRpZgotICAgIHJldHVybiBOVUxMOwotfQogCiBzdGF0aWMgamJvb2xlYW4gY29ubmVjdFNpbmtOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LCBqc3RyaW5nIHBhdGgpIHsKICNpZmRlZiBIQVZFX0JMVUVUT09USAogICAgIExPR1YoX19GVU5DVElPTl9fKTsKICAgICBpZiAobmF0KSB7CiAgICAgICAgIGNvbnN0IGNoYXIgKmNfcGF0aCA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMocGF0aCwgTlVMTCk7Ci0gICAgICAgIHNpemVfdCBwYXRoX3N6ID0gZW52LT5HZXRTdHJpbmdVVEZMZW5ndGgocGF0aCkgKyAxOwotICAgICAgICBjaGFyICpjX3BhdGhfY29weSA9IChjaGFyICopbWFsbG9jKHBhdGhfc3opOyAgLy8gY2FsbGJhY2sgZGF0YQotICAgICAgICBzdHJuY3B5KGNfcGF0aF9jb3B5LCBjX3BhdGgsIHBhdGhfc3opOworICAgICAgICBEQnVzRXJyb3IgZXJyOworICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CiAKLSAgICAgICAgYm9vbCByZXQgPQotICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3NfYXN5bmMoZW52LCBuYXQtPmNvbm4sIC0xLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgb25Db25uZWN0U2lua1Jlc3VsdCwgKHZvaWQgKiljX3BhdGhfY29weSwgbmF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY19wYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5hdWRpby5TaW5rIiwgIkNvbm5lY3QiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotCisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9CisgICAgICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3NfdGltZW91dChlbnYsIG5hdC0+Y29ubiwgLTEsIGNfcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkF1ZGlvU2luayIsICJDb25uZWN0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwogICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhwYXRoLCBjX3BhdGgpOwotICAgICAgICBpZiAoIXJldCkgewotICAgICAgICAgICAgZnJlZShjX3BhdGhfY29weSk7CisKKyAgICAgICAgaWYgKCFyZXBseSAmJiBkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgeworICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgcmVwbHkpOworICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICAgICAgfSBlbHNlIGlmICghcmVwbHkpIHsKKyAgICAgICAgICAgIExPR0UoIkRCdXMgcmVwbHkgaXMgTlVMTCBpbiBmdW5jdGlvbiAlcyIsIF9fRlVOQ1RJT05fXyk7CiAgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBKTklfVFJVRTsKQEAgLTE5OSwxOSArMTYxLDIwIEBACiAgICAgTE9HVihfX0ZVTkNUSU9OX18pOwogICAgIGlmIChuYXQpIHsKICAgICAgICAgY29uc3QgY2hhciAqY19wYXRoID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhwYXRoLCBOVUxMKTsKLSAgICAgICAgc2l6ZV90IHBhdGhfc3ogPSBlbnYtPkdldFN0cmluZ1VURkxlbmd0aChwYXRoKSArIDE7Ci0gICAgICAgIGNoYXIgKmNfcGF0aF9jb3B5ID0gKGNoYXIgKiltYWxsb2MocGF0aF9zeik7ICAvLyBjYWxsYmFjayBkYXRhCi0gICAgICAgIHN0cm5jcHkoY19wYXRoX2NvcHksIGNfcGF0aCwgcGF0aF9zeik7CisgICAgICAgIERCdXNFcnJvciBlcnI7CisgICAgICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKIAotICAgICAgICBib29sIHJldCA9Ci0gICAgICAgICAgICBkYnVzX2Z1bmNfYXJnc19hc3luYyhlbnYsIG5hdC0+Y29ubiwgLTEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBvbkRpc2Nvbm5lY3RTaW5rUmVzdWx0LCAodm9pZCAqKWNfcGF0aF9jb3B5LCBuYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBjX3BhdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LmF1ZGlvLlNpbmsiLCAiRGlzY29ubmVjdCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9CisgICAgICAgICAgICAgIGRidXNfZnVuY19hcmdzX3RpbWVvdXQoZW52LCBuYXQtPmNvbm4sIC0xLCBjX3BhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5BdWRpb1NpbmsiLCAiRGlzY29ubmVjdCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwogICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhwYXRoLCBjX3BhdGgpOwotICAgICAgICBpZiAoIXJldCkgewotICAgICAgICAgICAgZnJlZShjX3BhdGhfY29weSk7CisKKyAgICAgICAgaWYgKCFyZXBseSAmJiBkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgeworICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgcmVwbHkpOworICAgICAgICAgICAgcmV0dXJuIEpOSV9GQU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0U2lua1Jlc3VsdChEQnVzTWVzc2FnZSAqbXNnLCB2b2lkICp1c2VyLCB2b2lkICpuYXREYXRhKSB7Ci0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotCi0gICAgY2hhciAqY19wYXRoID0gKGNoYXIgKil1c2VyOwotICAgIERCdXNFcnJvciBlcnI7Ci0gICAgSk5JRW52ICplbnY7Ci0KLSAgICBpZiAobmF0LT52bS0+R2V0RW52KCh2b2lkKiopJmVudiwgbmF0LT5lbnZWZXIpIDwgMCkgewotICAgICAgICBMT0dFKCIlczogZXJyb3IgZmluZGluZyBFbnYgZm9yIG91ciBWTVxuIiwgX19GVU5DVElPTl9fKTsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKLQotICAgIExPR1YoIi4uLiBwYXRoID0gJXMiLCBjX3BhdGgpOwotICAgIGlmIChkYnVzX3NldF9lcnJvcl9mcm9tX21lc3NhZ2UoJmVyciwgbXNnKSkgewotICAgICAgICAvKiBpZiAoIXN0cmNtcChlcnIubmFtZSwgQkxVRVpfREJVU19CQVNFX0lGQyAiLkVycm9yLkF1dGhlbnRpY2F0aW9uRmFpbGVkIikpICovCi0gICAgICAgIExPR0UoIiVzOiBELUJ1cyBlcnJvcjogJXMgKCVzKVxuIiwgX19GVU5DVElPTl9fLCBlcnIubmFtZSwgZXJyLm1lc3NhZ2UpOwotICAgICAgICBkYnVzX2Vycm9yX2ZyZWUoJmVycik7Ci0gICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25TaW5rRGlzY29ubmVjdGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfcGF0aCkpOwotICAgICAgICBpZiAoZW52LT5FeGNlcHRpb25DaGVjaygpKSB7Ci0gICAgICAgICAgICBMT0dFKCJWTSBFeGNlcHRp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XNzYWdlKTsKLSAgICAgICAgaWYgKHN0cmNtcChlcnIubmFtZSwgIm9yZy5ibHVlei5FcnJvci5Ob3RDb25uZWN0ZWQiKSA9PSAwKSB7Ci0gICAgICAgICAgICAvLyB3ZSB3ZXJlIGFscmVhZHkgZGlzY29ubmVjdGVkLCBzbyByZXBvcnQgZGlzY29ubmVjdAotICAgICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25TaW5rRGlzY29ubmVjdGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX3BhdGgpKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIEFzc3VtZSBpdCBpcyBzdGlsbCBjb25uZWN0ZWQKLSAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uU2lua0Nvbm5lY3RlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW52LT5OZXdTdHJpbmdVVEYoY19wYXRoKSk7Ci0gICAgICAgIH0KLSAgICAgICAgZGJ1c19lcnJvcl9mcmVlKCZlcnIpOwotICAgICAgICBpZiAoZW52LT5FeGNlcHRpb25DaGVjaygpKSB7Ci0gICAgICAgICAgICBMT0dFKCJWTSBFeGNlcHRpb24gb2NjdXJyZWQgaW4gbmF0aXZlIGZ1bmN0aW9uICVzICglczolZCkiLAotICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIF9fRklMRV9fLCBfX0xJTkVfXyk7Ci0gICAgICAgIH0KLSAgICB9IC8vIGVsc2UgSmF2YSBjYWxsYmFjayBpcyB0cmlnZ2VyZWQgYnkgc2lnbmFsIGluIGEyZHBfZXZlbnRfZmlsdGVyCi0KLSAgICBmcmVlKGNfcGF0aCk7Ci19Ci0KIERCdXNIYW5kbGVyUmVzdWx0IGEyZHBfZXZlbnRfZmlsdGVyKERCdXNNZXNzYWdlICptc2csIEpOSUVudiAqZW52KSB7CiAgICAgREJ1c0Vycm9yIGVycjsKIApAQCAtMzI0LDcxICsyMDEsMTkgQEAKIAogICAgIERCdXNIYW5kbGVyUmVzdWx0IHJlc3VsdCA9IERCVVNfSEFORExFUl9SRVNVTFRfTk9UX1lFVF9IQU5ETEVEOwogCi0gICAgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouYXVkaW8uTWFuYWdlciIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkhlYWRzZXRDcmVhdGVkIikpIHsKLSAgICAgICAgY2hhciAqY19wYXRoOwotICAgICAgICBpZiAoZGJ1c19tZXNzYWdlX2dldF9hcmdzKG1zZywgJmVyciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19wYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKSkgewotICAgICAgICAgICAgTE9HVigiLi4uIHBhdGggPSAlcyIsIGNfcGF0aCk7Ci0gICAgICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG5hdC0+bWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZF9vbkhlYWRzZXRDcmVhdGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX3BhdGgpKTsKLSAgICAgICAgfSBlbHNlIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7Ci0gICAgICAgIHJlc3VsdCA9IERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LmF1ZGlvLk1hbmFnZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSGVhZHNldFJlbW92ZWQiKSkgewotICAgICAgICBjaGFyICpjX3BhdGg7Ci0gICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX3BhdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dWKCIuLi4gcGF0aCA9ICVzIiwgY19wYXRoKTsKLSAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uSGVhZHNldFJlbW92ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfcGF0aCkpOwotICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmVzdWx0ID0gREJVU19IQU5ETEVSX1JFU1VMVF9IQU5ETEVEOwotICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX3NpZ25hbChtc2csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouYXVkaW8uU2luayIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDb25uZWN0ZWQiKSkgeworICAgIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywgIm9yZy5ibHVlei5BdWRpb1NpbmsiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUHJvcGVydHlDaGFuZ2VkIikpIHsKKyAgICAgICAgam9iamVjdEFycmF5IHN0cl9hcnJheSA9CisgICAgICAgICAgICAgICAgICAgIHBhcnNlX3Byb3BlcnR5X2NoYW5nZShlbnYsIG1zZywgKFByb3BlcnRpZXMgKikmc2lua19wcm9wZXJ0aWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc2lua19wcm9wZXJ0aWVzKSAvIHNpemVvZihQcm9wZXJ0aWVzKSk7CiAgICAgICAgIGNvbnN0IGNoYXIgKmNfcGF0aCA9IGRidXNfbWVzc2FnZV9nZXRfcGF0aChtc2cpOwotICAgICAgICBMT0dWKCIuLi4gcGF0aCA9ICVzIiwgY19wYXRoKTsKICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZF9vblNpbmtDb25uZWN0ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW52LT5OZXdTdHJpbmdVVEYoY19wYXRoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uU2lua1Byb3BlcnR5Q2hhbmdlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX3BhdGgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cl9hcnJheSk7CiAgICAgICAgIHJlc3VsdCA9IERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LmF1ZGlvLlNpbmsiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGlzY29ubmVjdGVkIikpIHsKLSAgICAgICAgY29uc3QgY2hhciAqY19wYXRoID0gZGJ1c19tZXNzYWdlX2dldF9wYXRoKG1zZyk7Ci0gICAgICAgIExPR1YoIi4uLiBwYXRoID0gJXMiLCBjX3BhdGgpOwotICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG5hdC0+bWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uU2lua0Rpc2Nvbm5lY3RlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX3BhdGgpKTsKLSAgICAgICAgcmVzdWx0ID0gREJVU19IQU5ETEVSX1JFU1VMVF9IQU5ETEVEOwotICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX3NpZ25hbChtc2csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouYXVkaW8uU2luayIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQbGF5aW5nIikpIHsKLSAgICAgICAgY29uc3QgY2hhciAqY19wYXRoID0gZGJ1c19tZXNzYWdlX2dldF9wYXRoKG1zZyk7Ci0gICAgICAgIExPR1YoIi4uLiBwYXRoID0gJXMiLCBjX3BhdGgpOwotICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG5hdC0+bWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uU2lua1BsYXlpbmcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW52LT5OZXdTdHJpbmdVVEYoY19wYXRoKSk7Ci0gICAgICAgIHJlc3VsdCA9IERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LmF1ZGlvLlNpbmsiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU3RvcHBlZCIpKSB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RhdGljIHZvaWQgY2xlYW51cE5hdGl2ZURhdGFOYXRpdmUoSk5JRW52KiBlbnYsIGpvYmplY3Qgb2JqZWN0KSB7Ci0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0KLSAgICAgICAgKG5hdGl2ZV9kYXRhX3QgKillbnYtPkdldEludEZpZWxkKG9iamVjdCwgZmllbGRfbU5hdGl2ZURhdGEpOwotICAgIGlmIChuYXQpIHsKLSAgICAgICAgZnJlZShuYXQpOwotICAgICAgICBuYXQgPSBOVUxMOwotICAgIH0KLSNlbmRpZgotfQotCi1zdGF0aWMganN0cmluZyBnZXROYW1lTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCl7Ci0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKLSAgICBpZiAobmF0KSB7Ci0gICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9IGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLCBuYXQtPmFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQ0xBU1NfTkFNRSwgIkdldE5hbWUiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7Ci0gICAgICAgIHJldHVybiByZXBseSA/IGRidXNfcmV0dXJuc19zdHJpbmcoZW52LCByZXBseSkgOiBOVUxMOwotICAgIH0KLSNlbmRpZgotICAgIHJldHVybiBOVUxMOwotfQotCi1zdGF0aWMganN0cmluZyBnZXRBZGFwdGVyUGF0aE5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3Qp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uYXQtPmNvbm4sIG5hdC0+YWRhcHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQ0xBU1NfTkFNRSwgIkdldERpc2NvdmVyYWJsZVRpbWVvdXQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICByZXR1cm4gcmVwbHkgPyBkYnVzX3JldHVybnNfdWludDMyKGVudiwgcmVwbHkpIDogLTE7Ci0gICAgfQotI2VuZGlmCi0gICAgcmV0dXJuIC0xOwotfQotCi1zdGF0aWMgamJvb2xlYW4gaXNDb25uZWN0ZWROYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LCBqc3RyaW5nIGFkZHJlc3MpIHsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIExPR1YoX19GVU5DVElPTl9fKTsKLSAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOwotICAgIGlmIChuYXQpIHsKLSAgICAgICAgY29uc3QgY2hhciAqY19hZGRyZXNzID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBOVUxMKTsKLSAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0KLSAgICAgICAgICAgIGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLCBuYXQtPmFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsICJJc0Nvbm5lY3RlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19hZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOwotICAgICAgICByZXR1cm4gcmVwbHkgPyBkY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AgREJVU19DTEFTU19OQU1FLCAiRGlzY29ubmVjdFJlbW90ZURldmljZSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKLSAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgY19hZGRyZXNzKTsKLSAgICAgICAgaWYgKHJlcGx5KSBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOwotICAgIH0KLSNlbmRpZgotfQotCi1zdGF0aWMganN0cmluZyBnZXRNb2RlTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCkgewotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7Ci0gICAgaWYgKG5hdCkgewotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPQotICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3MoZW52LCBuYXQtPmNvbm4sIG5hdC0+YWRhcHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQ0xBU1NfTkFNRSwgIkdldE1vZGUiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICByZXR1cm4gcmVwbHkgPyBkYnVzX3JldHVybnNfc3RyaW5nKGVudiwgcmVwbHkpIDogTlVMTDsKLSAgICB9Ci0jZW5kaWYKLSAgICByZXR1cm4gTlVMTDsKLX0KLQotc3RhdGljIGpib29sZWFuIHNldE1vZGVOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LCBqc3RyaW5nIG1vZGUpIHsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIExPR1YoX19GVU5DVElPTl9fKTsKLSAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOwotICAgIGlmIChuYXQpIHsKLSAgICAgICAgY29uc3QgY2hhciAqY19tb2RlID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhtb2RlLCBOVUxMKTsKLSAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0KLSAgICAgICAgICAgIGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLCBuYXQtPmFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsICJTZXRNb2RlIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX21vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7Ci0gICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKG1vZGUsIGNfbW9kZSk7Ci0gICAgICAgIGlmIChyZXBseSkgewotICAgICAgICAgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKLSAgICAgICAgICAgIHJldHVybiBKTklfVFJVRTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOwotICAgIH0KLSNlbmRpZgotICAgIHJldHVybiBKTklfRkFMU0U7Ci19Ci0KLXN0YXRpYyBqYm9vbGVhbiBjcmVhdGVCb25kaW5nTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcywgamludCB0aW1lb3V0X21zKSB7Ci0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKLSAgICBqb2JqZWN0IGV2ZW50TG9vcCA9IGVudi0+R2V0T2JqZWN0RmllbGQob2JqZWN0LCBmaWVsZF9tRXZlbnRMb29wKTsKLSAgICBzdHJ1Y3QgZXZlbnRfbG9vcF9uYXRpdmVfZGF0YV90ICpldmVudExvb3BOYXQgPQotICAgICAgICAgICAgZ2V0X0V2ZW50TG9vcF9uYXRpdmVfZGF0YShlbnYsIGV2ZW50TG9vcCk7Ci0KLSAgICBpZiAobmF0ICYmIGV2ZW50TG9vcE5hdCkgewotICAgICAgICBjb25zdCBjaGFyICpjX2FkZHJlc3MgPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKGFkZHJlc3MsIE5VTEwpOwotICAgICAgICBMT0dWKCIuLi4gYWRkcmVzcyA9ICVzIiwgY19hZGRyZXNzKTsKLSAgICAgICAgY2hhciAqY29udGV4dF9hZGRyZXNzID0gKGNoYXIgKiljYWxsb2MoQlRBRERSX1NJWkUsIHNpemVvZihjaGFyKSk7Ci0gICAgICAgIHN0cmxjcHkoY29udGV4dF9hZGRyZXNzLCBjX2FkZHJlc3MsIEJUQUREUl9TSVpFKTsgIC8vIGZvciBjYWxsYmFjawotICAgICAgICBib29sIHJldCA9IGRidXNfZnVuY19hcmdzX2FzeW5jKGVudiwgbmF0LT5jb25uLCAoaW50KXRpbWVvdXRfbXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DcmVhdGVCb25kaW5nUmVzdWx0LCAvLyBjYWxsYmFjawotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHRfYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudExvb3BOYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0LT5hZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQ0xBU1NfTkFNRSwgIkNyZWF0ZUJvbmRpbmciLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOwotICAgICAgICByZXR1cm4gcmV0ID8gSk5JX1RSVUUgOiBKTklfRkFMU0U7Ci0KLSAgICB9Ci0jZW5kaWYKLSAgICByZXR1cm4gSk5JX0ZBTFNFOwotfQotCi1zdGF0aWMgamJvb2xlYW4gY2FuY2VsQm9uZGluZ1Byb2Nlc3NOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBhZGRyZXNzKSB7Ci0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKLSAgICBpZiAobmF0KSB7Ci0gICAgICAgIGNvbnN0IGNoYXIgKmNfYWRkcmVzcyA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgTlVMTCk7Ci0gICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMiLCBjX2FkZHJlc3MpOwotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPQotICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3NfdGltZW91dChlbnYsIG5hdC0+Y29ubiwgLTEsIG5hdC0+YWRhcHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19DTEFTU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nYsIG5hdC0+Y29ubiwgJmVyciwgbmF0LT5hZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19DTEFTU19OQU1FLCAiUmVtb3ZlQm9uZGluZyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19hZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKLSAgICAgICAgICAgIGlmIChkYnVzX2Vycm9yX2hhc19uYW1lKCZlcnIsCi0gICAgICAgICAgICAgICAgICAgIEJMVUVaX0RCVVNfQkFTRV9JRkMgIi5FcnJvci5Eb2VzTm90RXhpc3QiKSkgewotICAgICAgICAgICAgICAgIExPR1coIiVzOiBXYXJuaW5nOiAlcyAoJXMpIiwgX19GVU5DVElPTl9fLCBlcnIubWVzc2FnZSwKLSAgICAgICAgICAgICAgICAgICAgIGNfYWRkcmVzcyk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gSk5JX1RSVUU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIExPR0UoIiVzOiBELUJ1cyBlcnJvciAlcyAoJXMpIiwgX19GVU5DVElPTl9fLCBlcnIubmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGVyci5tZXNzYWdlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJlc3VsdCA9IEpOSV9UUlVFOwotICAgICAgICB9Ci0KLSAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgY19hZGRyZXNzKTsKLSAgICAgICAgZGJ1c19lcnJvcl9mcmVlKCZlcnIpOwotICAgICAgICBpZiAocmVwbHkpIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7Ci0gICAgf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5hdC0+Y29ubiwgbmF0LT5hZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19DTEFTU19OQU1FLCAiTGlzdENvbm5lY3Rpb25zIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKLSAgICAgICAgLy8gcmV0dXJuIFN0cmluZ1tdCi0gICAgICAgIHJldHVybiByZXBseSA/IGRidXNfcmV0dXJuc19hcnJheV9vZl9zdHJpbmdzKGVudiwgcmVwbHkpIDogTlVMTDsKLSAgICB9Ci0jZW5kaWYKLSAgICByZXR1cm4gTlVMTDsKLX0KLQotc3RhdGljIGpvYmplY3RBcnJheSBsaXN0UmVtb3RlRGV2aWNlc05hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QpIHsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIExPR1YoX19GVU5DVElPTl9fKTsKLSAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOwotICAgIGlmIChuYXQpIHsKLSAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0KLSAgICAgICAgICAgIGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLCBuYXQtPmFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsICJMaXN0UmVtb3RlRGV2aWNlcyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7Ci0gICAgICAgIHJldHVybiByZXBseSA/IGRidXNfcmV0dXJuc19hcnJheV9vZl9zdHJpbmdzKGVudiwgcmVwbHkpIDogTlVMTDsKLSAgICB9Ci0jZW5kaWYKLSAgICByZXR1cm4gTlVMTDsKLX0KLQotc3RhdGljIGpzdHJpbmcgY29tbW9uX0dldChKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsIGNvbnN0IGNoYXI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i0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKLSAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMobmFtZSwgY19uYW1lKTsKLSAgICAgICAgaWYgKHJlcGx5KSB7Ci0gICAgICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOwotICAgICAgICAgICAgcmV0dXJuIEpOSV9UUlVFOwotICAgICAgICB9Ci0gICAgfQotI2VuZGlmCi0gICAgcmV0dXJuIEpOSV9GQUxTRTsKLX0KLQotc3RhdGljIGpzdHJpbmcgY29tbW9uX2dldFJlbW90ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsIGNvbnN0IGNoYXIgKmZ1bmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcykgewotICAgIExPR1YoIiVzOiVzIiwgX19GVU5DVElPTl9fLCBmdW5jKTsKLSNpZmRlZiBIQVZFX0JMVUVUT09USAotICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7Ci0gICAgaWYgKG5hdCkgewotICAgICAgICBjb25zdCBjaGFyICpjX2FkZHJlc3MgPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKGFkZHJlc3MsIE5VTEwpOwotICAgICAgICBEQnVzRXJyb3IgZXJyOwotICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7Ci0KLSAgICAgICAgTE9HVigiLi4uIGFkZHJlc3MgPSAlcyIsIGNfYWRkcmVzcyk7Ci0KLSAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0KLSAgICAgICAgICAgIGRidXNfZnVuY19hcmdzX2Vycm9yKGVudiwgbmF0LT5jb25uLCAmZXJyLCBuYXQtPmFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsIGZ1bmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19hZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOwotICAgICAgICBpZiAocmVwbHkpIHsKLSAgICAgICAgICAgIHJldHVybiBkYnVzX3JldHVybnNfc3RyaW5nKGVudiwgcmVwbHkpOwotICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoZnVuYywgIkdldFJlbW90ZU5hbWUiKSAmJgotICAgICAgICAgICAgICAgIGRidXNfZXJyb3JfaGFzX25hbWUoJmVyciwgIm9yZy5ibHVlei5FcnJvci5SZXF1ZXN0RGVmZXJyZWQiKSkgewotICAgICAgICAgICAgLy8gVGhpcyBlcnJvciBvY2N1cnMgaWYgd2UgcmVxdWVzdCBuYW1lIGR1cmluZyBkZXZpY2UgZGlzY292ZXJ5LAotICAgICAgICAgICAgLy8gaXRzIGZpbmUKLSAgICAgICAgICAgIExPR1YoIi4uLiAlczogJXMiLCBmdW5jLCBlcnIubWVzc2FnZSk7Ci0gICAgICAgICAgICBkYnVzX2Vycm9yX2ZyZWUoJmVycik7Ci0gICAgICAgICAgICByZXR1cm4gTlVMTDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOwotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0KLSAgICB9Ci0jZW5kaWYKLSAgICByZXR1cm4gTlVMTDsKLX0KLQotc3RhdGljIGpzdHJpbmcgZ2V0UmVtb3RlVmVyc2lvbk5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmosIGpzdHJpbmcgYWRkcmVzcykgewotICAgIHJldHVybiBjb21tb25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KnJlcGx5ID0KLSAgICAgICAgICAgIGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLCBuYXQtPmFkYXB0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0NMQVNTX05BTUUsICJHZXRSZW1vdGVGZWF0dXJlcyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19hZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOwotICAgICAgICAvKiBhcnJheSBvZiBEQlVTX1RZUEVfQllURV9BU19TVFJJTkcgKi8KLSAgICAgICAgcmV0dXJuIHJlcGx5ID8gZGJ1c19yZXR1cm5zX2FycmF5X29mX2J5dGVzKGVudiwgcmVwbHkpIDogTlVMTDsKLSAgICB9Ci0jZW5kaWYKLSAgICByZXR1cm4gTlVMTDsKLX0KLQotc3RhdGljIGppbnRBcnJheSBnZXRSZW1vdGVTZXJ2aWNlSGFuZGxlc05hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcywganN0cmluZyBtYXRjaCkgewotI2lmZGVmIEhBVkVfQkxVRVRPT1RICi0gICAgTE9HVihfX0ZVTkNUSU9OX18pOwotICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7Ci0gICAgaWYgKG5hdCkgewotICAgICAgICBqaW50QXJyYXkgaW50QXJyYXkgPSBOVUxMOwotICAgICAgICBjb25zdCBjaGFyICpjX2FkZHJlc3MgPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKGFkZHJlc3MsIE5VTEwpOwotICAgICAgICBjb25zdCBjaGFyICpjX21hdGNoID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhtYXRjaCwgTlVMTCk7Ci0KLSAgICAgICAgTE9HVigiLi4uIGFkZHJlc3MgPSAlcyBtYXRjaCA9ICVzIiwgY19hZGRyZXNzLCBjX21hdGNoKTsKLQotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPQotICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3MoZW52LCBuYXQtPmNvbm4sIG5hdC0+YWRhcHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQ0xBU1NfTkFNRSwgIkdldFJlbW90ZVNlcnZpY2VIYW5kbGVzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19tYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKLSAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgY19hZGRyZXNzKTsKLSAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMobWF0Y2gsIGNfbWF0Y2gpOwotICAgICAgICBpZiAocmVwbHkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIERCdXNFcnJvciBlcnI7Ci0gICAgICAgICAgICBqaW50ICpsaXN0OwotICAgICAgICAgICAgaW50IGksIGxlbjsKLQotICAgICAgICAgICAgZGJ1c19lcnJvcl9pbml0KCZlcnIpOwotICAgICAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9nZXRfYXJncyAocmVwbHksICZlcnIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfQVJSQVksIERCVVNfVFlQRV9VSU5UMzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGlzdCwgJmxlbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKSkgewotICAgICAgICAgICAgICAgIGlmIChsZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgaW50QXJyYXkgPSBlbnYtPk5ld0ludEFycmF5KGxlbik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpbnRBcnJheSkKLSAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+U2V0SW50QXJyYXlSZWdpb24oaW50QXJyYXksIDAsIGxlbiwgbGlzdCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCByZXBseSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGludEFycmF5OwotICAgIH0KLSNlbmRpZgotICAgIHJldHVybiBOVUxMOwotfQotCi1zdGF0aWMgamJ5dGVBcnJheSBnZXRSZW1vdGVTZXJ2aWNlUmVjb3JkTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGFkZHJlc3MsIGppbnQgaGFuZGxlKSB7Ci0jaWZkZWYgSEFWRV9CTFVFVE9PVEgKLSAgICBMT0dWKF9fRlVOQ1RJT05fXyk7Ci0gICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKLSAgICBpZiAobmF0KSB7Ci0gICAgICAgIGNvbnN0IGNoYXIgKmNfYWRkcmVzcyA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgTlVM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bGQob2JqZWN0LCBmaWVsZF9tRXZlbnRMb29wKTsKLSAgICBzdHJ1Y3QgZXZlbnRfbG9vcF9uYXRpdmVfZGF0YV90ICpldmVudExvb3BOYXQgPQotICAgICAgICAgICAgZ2V0X0V2ZW50TG9vcF9uYXRpdmVfZGF0YShlbnYsIGV2ZW50TG9vcCk7Ci0gICAgaWYgKG5hdCAmJiBldmVudExvb3BOYXQpIHsKLSAgICAgICAgY29uc3QgY2hhciAqY19hZGRyZXNzID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBOVUxMKTsKLSAgICAgICAgY2hhciAqY29udGV4dF9hZGRyZXNzID0gKGNoYXIgKiljYWxsb2MoQlRBRERSX1NJWkUsIHNpemVvZihjaGFyKSk7Ci0gICAgICAgIHN0cmxjcHkoY29udGV4dF9hZGRyZXNzLCBjX2FkZHJlc3MsIEJUQUREUl9TSVpFKTsKLQotICAgICAgICBMT0dWKCIuLi4gYWRkcmVzcyA9ICVzIiwgY19hZGRyZXNzKTsKLSAgICAgICAgTE9HVigiLi4uIHV1aWQxNiA9ICUjWCIsIHV1aWQxNik7Ci0KLSAgICAgICAgYm9vbCByZXQgPSBkYnVzX2Z1bmNfYXJnc19hc3luYyhlbnYsIG5hdC0+Y29ubiwgMjAwMDAsICAvLyBtcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgb25HZXRSZW1vdGVTZXJ2aWNlQ2hhbm5lbFJlc3VsdCwgY29udGV4dF9hZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRMb29wTmF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0LT5hZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19DTEFTU19OQU1FLCAiR2V0UmVtb3RlU2VydmljZUNoYW5uZWwiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgIC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MamF2YS9sYW5nL1N0cmluZzspViIpOwotICAgIG1ldGhvZF9vblJlbW90ZURldmljZURpc2Nvbm5lY3RSZXF1ZXN0ZWQgPSBlbnYtPkdldE1ldGhvZElEKGNsYXp6LCAib25SZW1vdGVEZXZpY2VEaXNjb25uZWN0UmVxdWVzdGVkIiwgIihMamF2YS9sYW5nL1N0cmluZzspViIpOwotICAgIG1ldGhvZF9vblJlbW90ZURldmljZURpc2Nvbm5lY3RlZCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvblJlbW90ZURldmljZURpc2Nvbm5lY3RlZCIsICIoTGphdmEvbGFuZy9TdHJpbmc7KVYiKTsKLSAgICBtZXRob2Rfb25Cb25kaW5nQ3JlYXRlZCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvbkJvbmRpbmdDcmVhdGVkIiwgIihMamF2YS9sYW5nL1N0cmluZzspViIpOwotICAgIG1ldGhvZF9vbkJvbmRpbmdSZW1vdmVkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uQm9uZGluZ1JlbW92ZWQiLCAiKExqYXZhL2xhbmcvU3RyaW5nOylWIik7CisgICAgbWV0aG9kX29uUHJvcGVydHlDaGFuZ2VkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uUHJvcGVydHlDaGFuZ2VkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoW0xqYXZhL2xhbmcvU3RyaW5nOylWIik7CisgICAgbWV0aG9kX29uRGV2aWNlUHJvcGVydHlDaGFuZ2VkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvbkRldmljZVByb3BlcnR5Q2hhbmdlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO1tMamF2YS9sYW5nL1N0cmluZzspViIpOworICAgIG1ldGhvZF9vbkRldmljZUZvdW5kID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uRGV2aWNlRm91bmQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO1tMamF2YS9sYW5nL1N0cmluZzspViIpOworICAgIG1ldGhvZF9vbkRldmljZURpc2FwcGVhcmVkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uRGV2aWNlRGlzYXBwZWFyZWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nOylWIik7CisgICAgbWV0aG9kX29uRGV2aWNlQ3JlYXRlZCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvbkRldmljZUNyZWF0ZWQiLCAiKExqYXZhL2xhbmcvU3RyaW5nOylWIik7CisgICAgbWV0aG9kX29uRGV2aWNlUmVtb3ZlZCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvbkRldmljZVJlbW92ZWQiLCAiKExqYXZhL2xhbmcvU3RyaW5nOylWIik7CiAKLSAgICBtZXRob2Rfb25DcmVhdGVCb25kaW5nUmVzdWx0ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uQ3JlYXRlQm9uZGluZ1Jlc3VsdCIsICIoTGphdmEvbGFuZy9TdHJpbmc7SSlWIik7CisgICAgbWV0aG9kX29uQ3JlYXRlUGFpcmVkRGV2aWNlUmVzdWx0ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uQ3JlYXRlUGFpcmVkRGV2aWNlUmVzdWx0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7SSlWIik7CiAKLSAgICBtZXRob2Rfb25QYXNza2V5QWdlbnRSZXF1Z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Zy9TdHJpbmc7TGphdmEvbGFuZy9TdHJpbmc7KVoiKTsKKyAgICBtZXRob2Rfb25BZ2VudENhbmNlbCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvbkFnZW50Q2FuY2VsIiwgIigpViIpOworICAgIG1ldGhvZF9vblJlcXVlc3RQaW5Db2RlID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uUmVxdWVzdFBpbkNvZGUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIpOworICAgIG1ldGhvZF9vblJlcXVlc3RQYXNza2V5ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uUmVxdWVzdFBhc3NrZXkiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIpOworICAgIG1ldGhvZF9vblJlcXVlc3RDb25maXJtYXRpb24gPSBlbnYtPkdldE1ldGhvZElEKGNsYXp6LCAib25SZXF1ZXN0Q29uZmlybWF0aW9uIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztJSSlWIik7CiAKICAgICBmaWVsZF9tTmF0aXZlRGF0YSA9IGVudi0+R2V0RmllbGRJRChjbGF6eiwgIm1OYXRpdmVEYXRhIiwgIkkiKTsKICNlbmRpZgpAQCAtMTU0LDkgKzE0NywxMSBAQAogI2lmZGVmIEhBVkVfQkxVRVRPT1RICiBzdGF0aWMgREJ1c0hhbmRsZXJSZXN1bHQgZXZlbnRfZmlsdGVyKERCdXNDb25uZWN0aW9uICpjb25uLCBEQnVzTWVzc2FnZSAqbXNnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpkYXRhKTsKLXN0YXRpYyBEQnVzSGFuZGxlclJlc3VsdCBhZ2VudF9ldmVudF9maWx0ZXIoREJ1c0Nvbm5lY3Rpb24gKmNvbm4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCdXNNZXNzYWdlICptc2csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKmRhdGEpOworREJ1c0hhbmRsZXJSZXN1bHQgYWdlbnRfZXZlbnRfZmlsdGVyKERCdXNDb25uZWN0aW9uICpjb25uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCdXNNZXNzYWdlICptc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqZGF0YSk7CitzdGF0aWMgaW50IHJlZ2lzdGVyX2FnZW50KG5hdGl2ZV9kYXRhX3QgKm5hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqYWdlbnRfcGF0aCwgY29uc3QgY2hhciAqY2FwYWJpbGl0aWVzKTsKIAogc3RhdGljIGNvbnN0IERCdXNPYmplY3RQYXRoVlRhYmxlIGFnZW50X3Z0YWJsZSA9IHsKICAgICBOVUxMLCBhZ2VudF9ldmVudF9maWx0ZXIsIE5VTEwsIE5VTEwsIE5VTEwsIE5VTEwKQEAgLTE3OCwxMSArMTczLDEyIEBACiAKIHN0YXRpYyBqYm9vbGVhbiBzZXRVcEV2ZW50TG9vcChuYXRpdmVfZGF0YV90ICpuYXQpIHsKICAgICBMT0dWKF9fRlVOQ1RJT05fXyk7Ci0gICAgZGJ1c190aHJlYWRzX2luaXRfZGVmYXVsdCgpOwotICAgIERCdXNFcnJvciBlcnI7Ci0gICAgZGJ1c19lcnJvcl9pbml0KCZlcnIpOwogCiAgICAgaWYgKG5hdCAhPSBOVUxMICYmIG5hdC0+Y29ubiAhPSBOVUxMKSB7CisgICAgICAgIGRidXNfdGhyZWFkc19pbml0X2RlZmF1bHQoKTsKKyAgICAgICAgREJ1c0Vycm9yIGVycjsKKyAgICAgICAgZGJ1c19lcnJvcl9pbml0KCZlcnIpOworCiAgICAgICAgIC8vIEFkZCBhIGZpbHRlciBmb3IgYWxsIGluY29taW5nIG1lc3NhZ2VzCiAgICAgICAgIGlmICghZGJ1c19jb25uZWN0aW9uX2FkZF9maWx0ZXIobmF0LT5jb25uLCBldmVudF9maWx0ZXIsIG5hdCwgTlVMTCkpewogICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKQEAgLTIwNCwxMDggKzIwMCwxNjcgQEAKICAgICAgICAgICAgIHJldHVybiBKTklfRkFMU0U7CiAgICAgICAgIH0KICAgICAgICAgZGJ1c19idXNfYWRkX21hdGNoKG5hdC0+Y29ubiwKLSAgICAgICAgICAgICAgICAidHlwZT0nc2lnbmFsJyxpbnRlcmZhY2U9J29yZy5ibHVlei5hdWRpby5NYW5hZ2VyJyIsCisgICAgICAgICAgICAgICAgInR5cGU9J3NpZ25hbCcsaW50ZXJmYWNlPSciQkxVRVpfREJVU19CQVNFX0lGQyIuRGV2aWNlJyIsCiAgICAgICAgICAgICAgICAgJmVycik7CiAgICAgICAgIGlmIChkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgewogICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1IoJmVycik7CiAgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOwogICAgICAgICB9CiAgICAgICAgIGRidXNfYnVzX2FkZF9tYXRjaChuYXQtPmNvbm4sCi0gICAgICAgICAgICAgICAgInR5cGU9J3NpZ25hbCcsaW50ZXJmYWNlPSdvcmcuYmx1ZXouYXVkaW8uRGV2aWNlJyIsCi0gICAgICAgICAgICAgICAgJmVycik7Ci0gICAgICAgIGlmIChkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgewotICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1IoJmVycik7Ci0gICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOwotICAgICAgICB9Ci0gICAgICAgIGRidXNfYnVzX2FkZF9tYXRjaChuYXQtPmNvbm4sCi0gICAgICAgICAgICAgICAgInR5cGU9J3NpZ25hbCcsaW50ZXJmYWNlPSdvcmcuYmx1ZXouYXVkaW8uU2luayciLAorICAgICAgICAgICAgICAgICJ0eXBlPSdzaWduYWwnLGludGVyZmFjZT0nb3JnLmJsdWV6LkF1ZGlvU2luayciLAogICAgICAgICAgICAgICAgICZlcnIpOwogICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKICAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOwogICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKICAgICAgICAgfQogCi0gICAgICAgIC8vIEFkZCBhbiBvYmplY3QgaGFuZGxlciBmb3IgcGFzc2tleSBhZ2VudCBtZXRob2QgY2FsbHMKLSAgICAgICAgY29uc3QgY2hhciAqcGF0aCA9ICIvYW5kcm9pZC9ibHVldG9vdGgvQWdlbnQiOwotICAgICAgICBpZiAoIWRidXNfY29ubmVjdGlvbl9yZWdpc3Rlcl9vYmplY3RfcGF0aChuYXQtPmNvbm4sIHBhdGgsCi0gICAgICAgICAgICAgICAgJmFnZW50X3Z0YWJsZSwgbmF0KSkgewotICAgICAgICAgICAgTE9HRSgiJXM6IENhbid0IHJlZ2lzdGVyIG9iamVjdCBwYXRoICVzIGZvciBhZ2VudCEiLAotICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIHBhdGgpOworICAgICAgICBjb25zdCBjaGFyICphZ2VudF9wYXRoID0gIi9hbmRyb2lkL2JsdWV0b290aC9hZ2VudCI7CisgICAgICAgIGNvbnN0IGNoYXIgKmNhcGFiaWxpdGllcyA9ICJEaXNwbGF5WWVzTm8iOworICAgICAgICBpZiAocmVnaXN0ZXJfYWdlbnQobmF0LCBhZ2VudF9wYXRoLCBjYXBhYmlsaXRpZXMpIDwgMCkgeworICAgICAgICAgICAgZGJ1c19jb25uZWN0aW9uX3VucmVnaXN0ZXJfb2JqZWN0X3BhdGggKG5hdC0+Y29ubiwgYWdlbnRfcGF0aCk7CiAgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOwogICAgICAgICB9Ci0KLSAgICAgICAgLy8gUmVnaXN0ZXJEZWZhdWx0UGFzc2tleUFnZW50KCkgd2lsbCBmYWlsIHVudGlsIGhjaWQgaXMgdXAsIHNvIGtlZXAKLSAgICAgICAgLy8gdHJ5aW5nIGZvciAxMCBzZWNvbmRzLgotICAgICAgICBpbnQgYXR0ZW1wdDsKLSAgICAgICAgZm9yIChhdHRlbXB0ID0gMDsgYXR0ZW1wdCA8IDEwMDA7IGF0dGVtcHQrKykgewotICAgICAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0gZGJ1c19mdW5jX2FyZ3NfZXJyb3IoTlVMTCwgbmF0LT5jb25uLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICBCTFVFWl9EQlVTX0JBU0VfUEFUSCwKLSAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5TZWN1cml0eSIsICJSZWdpc3RlckRlZmF1bHRQYXNza2V5QWdlbnQiLAotICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmcGF0aCwKLSAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOwotICAgICAgICAgICAgaWYgKHJlcGx5KSB7Ci0gICAgICAgICAgICAgICAgLy8gU3VjY2VzcwotICAgICAgICAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7Ci0gICAgICAgICAgICAgICAgTE9HVigiUmVnaXN0ZXJlZCBhZ2VudCBvbiBhdHRlbXB0ICVkIG9mIDEwMDBcbiIsIGF0dGVtcHQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfSBlbHNlIGlmIChkYnVzX2Vycm9yX2hhc19uYW1lKCZlcnIsCi0gICAgICAgICAgICAgICAgICAgICJvcmcuZnJlZWRlc2t0b3AuREJ1cy5FcnJvci5TZXJ2aWNlVW5rbm93biIpKSB7Ci0gICAgICAgICAgICAgICAgLy8gaGNpZCBpcyBzdGlsbCBkb3duLCByZXRyeQotICAgICAgICAgICAgICAgIGRidXNfZXJyb3JfZnJlZSgmZXJyKTsKLSAgICAgICAgICAgICAgICB1c2xlZXAoMTAwMDApOyAgLy8gMTAgbXMKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gU29tZSBvdGhlciBlcnJvciB3ZSB3ZXJlbid0IGV4cGVjdGluZwotICAgICAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOwotICAgICAgICAgICAgICAgIHJldHVybiBKTklfRkFMU0U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGF0dGVtcHQgPT0gMTAwMCkgewotICAgICAgICAgICAgTE9HRSgiVGltZS1vdXQgdHJ5aW5nIHRvIGNhbGwgUmVnaXN0ZXJEZWZhdWx0UGFzc2tleUFnZW50KCksICIKLSAgICAgICAgICAgICAgICAgImlzIGhjaWQgcnVubmluZz8iKTsKLSAgICAgICAgICAgIHJldHVybiBKTklfRkFMU0U7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBOb3cgcmVnaXN0ZXIgdGhlIEF1dGggYWdlbnQKLSAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0gZGJ1c19mdW5jX2FyZ3NfZXJyb3IoTlVMTCwgbmF0LT5jb25uLCAmZXJyLAotICAgICAgICAgICAgICAgIEJMVUVaX0RCVVNfQkFTRV9QQVRILAotICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouU2VjdXJpdHkiLCAiUmVnaXN0ZXJEZWZhdWx0QXV0aG9yaXphdGlvbkFnZW50IiwKLSAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmcGF0aCwKLSAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7Ci0gICAgICAgIGlmICghcmVwbHkpIHsKLSAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOwotICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKLSAgICAgICAgfQotCi0gICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7CiAgICAgICAgIHJldHVybiBKTklfVFJVRTsKICAgICB9Ci0KICAgICByZXR1cm4gSk5JX0ZBTFNFOwogfQogCisKK2NvbnN0IGNoYXIgKiBnZXRfYWRhcHRlcl9wYXRoKERCdXNDb25uZWN0aW9uICpjb25uKSB7CisgICAgREJ1c01lc3NhZ2UgKm1zZywgKnJlcGx5ID0gTlVMTDsKKyAgICBEQnVzRXJyb3IgZXJyOworICAgIGNvbnN0IGNoYXIgKmRldmljZV9wYXRoID0gTlVMTDsKKyAgICBpbnQgYXR0ZW1wdCA9IDA7CisKKyAgICBmb3IgKGF0dGVtcHQgPSAwOyBhdHRlbXB0IDwgMTAwMCAmJiByZXBseSA9PSBOVUxMOyBhdHRlbXB0ICsrKSB7CisgICAgICAgIG1zZyA9IGRidXNfbWVzc2FnZV9uZXdfbWV0aG9kX2NhbGwoIm9yZy5ibHVleiIsICIvIiwKKyAgICAgICAgICAgICAgIm9yZy5ibHVlei5NYW5hZ2VyIiwgIkRlZmF1bHRBZGFwdGVyIik7CisgICAgICAgIGlmICghbXNnKSB7CisgICAgICAgICAgICBMT0dFKCIlczogQ2FuJ3QgYWxsb2NhdGUgbmV3IG1ldGhvZCBjYWxsIGZvciBnZXRfYWRhcHRlcl9wYXRoISIsCisgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18pOworICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKyAgICAgICAgZGJ1c19tZXNzYWdlX2FwcGVuZF9hcmdzKG1zZywgREJVU19UWVBFX0lOVkFMSUQpOworICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisgICAgICAgIHJlcGx5ID0gZGJ1c19jb25uZWN0aW9uX3NlbmRfd2l0aF9yZXBseV9hbmRfYmxvY2soY29ubiwgbXNnLCAtMSwgJmVycik7CisKKyAgICAgICAgaWYgKCFyZXBseSkgeworICAgICAgICAgICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKSB7CisgICAgICAgICAgICAgICAgaWYgKGRidXNfZXJyb3JfaGFzX25hbWUoJmVyciwKKyAgICAgICAgICAgICAgICAgICAgIm9yZy5mcmVlZGVza3RvcC5EQnVzLkVycm9yLlNlcnZpY2VVbmtub3duIikpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gYmx1ZXRvb3RoZCBpcyBzdGlsbCBkb3duLCByZXRyeQorICAgICAgICAgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKKyAgICAgICAgICAgICAgICAgICAgdXNsZWVwKDEwMDAwKTsgIC8vIDEwIG1zCisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFNvbWUgb3RoZXIgZXJyb3Igd2Ugd2VyZW4ndCBleHBlY3RpbmcKKyAgICAgICAgICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1IoJmVycik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZ290byBmYWlsZWQ7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKGF0dGVtcHQgPT0gMTAwMCkgeworICAgICAgICBMT0dFKCJUaW1lIG91dCB3aGlsZSB0cnlpbmcgdG8gZ2V0IEFkYXB0ZXIgcGF0aCwgaXMgYmx1ZXRvb3RoZCB1cCA/Iik7CisgICAgICAgIGdvdG8gZmFpbGVkOworICAgIH0KKworICAgIGlmICghZGJ1c19tZXNzYWdlX2dldF9hcmdzKHJlcGx5LCAmZXJyLCBEQlVTX1RZUEVfT0JKRUNUX1BBVEgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRldmljZV9wYXRoLCBEQlVTX1RZUEVfSU5WQUxJRCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhZGV2aWNlX3BhdGgpeworICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOworICAgICAgICB9CisgICAgICAgIGdvdG8gZmFpbGVkOworICAgIH0KKyAgICBkYnVzX21lc3NhZ2VfdW5yZWYobXNnKTsKKyAgICByZXR1cm4gZGV2aWNlX3BhdGg7CisKK2ZhaWxlZDoKKyAgICBkYnVzX21lc3NhZ2VfdW5yZWYobXNnKTsKKyAgICByZXR1cm4gTlVMTDsKK30KKworc3RhdGljIGludCByZWdpc3Rlcl9hZ2VudChuYXRpdmVfZGF0YV90ICpuYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKiBhZ2VudF9wYXRoLCBjb25zdCBjaGFyICogY2FwYWJpbGl0aWVzKQoreworICAgIERCdXNNZXNzYWdlICptc2csICpyZXBseTsKKyAgICBEQnVzRXJyb3IgZXJyOworCisgICAgaWYgKCFkYnVzX2Nvbm5lY3Rpb25fcmVnaXN0ZXJfb2JqZWN0X3BhdGgobmF0LT5jb25uLCBhZ2VudF9wYXRoLAorICAgICAgICAgICAgJmFnZW50X3Z0YWJsZSwgbmF0KSkgeworICAgICAgICBMT0dFKCIlczogQ2FuJ3QgcmVnaXN0ZXIgb2JqZWN0IHBhdGggJXMgZm9yIGFnZW50ISIsCisgICAgICAgICAgICAgIF9fRlVOQ1RJT05fXywgYWdlbnRfcGF0aCk7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICBuYXQtPmFkYXB0ZXIgPSBnZXRfYWRhcHRlcl9wYXRoKG5hdC0+Y29ubik7CisgICAgaWYgKG5hdC0+YWRhcHRlciA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgbXNnID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfY2FsbCgib3JnLmJsdWV6IiwgbmF0LT5hZGFwdGVyLAorICAgICAgICAgICJvcmcuYmx1ZXouQWRhcHRlciIsICJSZWdpc3RlckFnZW50Iik7CisgICAgaWYgKCFtc2cpIHsKKyAgICAgICAgTE9HRSgiJXM6IENhbid0IGFsbG9jYXRlIG5ldyBtZXRob2QgY2FsbCBmb3IgYWdlbnQhIiwKKyAgICAgICAgICAgICAgX19GVU5DVElPTl9fKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBkYnVzX21lc3NhZ2VfYXBwZW5kX2FyZ3MobXNnLCBEQlVTX1RZUEVfT0JKRUNUX1BBVEgsICZhZ2VudF9wYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY2FwYWJpbGl0aWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisKKyAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisgICAgcmVwbHkgPSBkYnVzX2Nvbm5lY3Rpb25fc2VuZF93aXRoX3JlcGx5X2FuZF9ibG9jayhuYXQtPmNvbm4sIG1zZywgLTEsICZlcnIpOworICAgIGRidXNfbWVzc2FnZV91bnJlZihtc2cpOworCisgICAgaWYgKCFyZXBseSkgeworICAgICAgICBMT0dFKCIlczogQ2FuJ3QgcmVnaXN0ZXIgYWdlbnQhIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKSB7CisgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICBkYnVzX2Nvbm5lY3Rpb25fZmx1c2gobmF0LT5jb25uKTsKKworICAgIHJldHVybiAwOworfQorCiBzdGF0aWMgdm9pZCB0ZWFyRG93bkV2ZW50TG9vcChuYXRpdmVfZGF0YV90ICpuYXQpIHsKICAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CiAgICAgaWYgKG5hdCAhPSBOVUxMICYmIG5hdC0+Y29ubiAhPSBOVUxMKSB7CiAKKyAgICAgICAgREJ1c01lc3NhZ2UgKm1zZywgKnJlcGx5OwogICAgICAgICBEQnVzRXJyb3IgZXJyOwogICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisgICAgICAgIGNvbnN0IGNoYXIgKiBhZ2VudF9wYXRoID0gIi9hbmRyb2lkL2JsdWV0b290aC9hZ2VudCI7CiAKLSAgICAgICAgY29uc3QgY2hhciAqcGF0aCA9ICIvYW5kcm9pZC9ibHVldG9vdGgvQWdlbnQiOwotICAgICAgICBEQnVzTWVzc2FnZSAqcmVwbHkgPQotICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3MoTlVMTCwgbmF0LT5jb25uLCBCTFVFWl9EQlVTX0JBU0VfUEFUSCwKLSAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5TZWN1cml0eSIsICJVbnJlZ2lzdGVyRGVmYXVsdFBhc3NrZXlBZ2VudCIsCi0gICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZwYXRoLAotICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7Ci0gICAgICAgIGlmIChyZXBseSkgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICAgICAgbXNnID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfY2FsbCgib3JnLmJsdWV6IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXQtPmFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5BZGFwdGVyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5yZWdpc3RlckFnZW50Iik7CisgICAgICAgIGlmIChtc2cgIT0gTlVMTCkgeworICAgICAgICAgICAgZGJ1c19tZXNzYWdlX2FwcGVuZF9hcmdzKG1zZywgREJVU19UWVBFX09CSkVDVF9QQVRILCAmYWdlbnRfcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisgICAgICAgICAgICByZXBseSA9IGRidXNfY29ubmVjdGlvbl9zZW5kX3dpdGhfcmVwbHlfYW5kX2Jsb2NrKG5hdC0+Y29ubiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLCAtMSwgJmVycik7CiAKLSAgICAgICAgcmVwbHkgPQotICAgICAgICAgICAgZGJ1c19mdW5jX2FyZ3MoTlVMTCwgbmF0LT5jb25uLCBCTFVFWl9EQlVTX0JBU0VfUEFUSCwKLSAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5TZWN1cml0eSIsICJVbnJlZ2lzdGVyRGVmYXVsdEF1dGhvcml6YXRpb25BZ2VudCIsCi0gICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZwYXRoLAotICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7Ci0gICAgICAgIGlmIChyZXBseSkgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICAgICAgICAgIGlmICghcmVwbHkpIHsKKyAgICAgICAgICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1IoJmVycik7CisgICAgICAgICAgICAgICAgICAgIGRidXNfZXJyb3JfZnJlZSgmZXJyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYobXNnKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICBMT0dFKCIlczogQ2FuJ3QgY3JlYXRlIG5ldyBtZXRob2QgY2FsbCEiLCBfX0ZVTkNUSU9OX18pOworICAgICAgICB9CiAKLSAgICAgICAgZGJ1c19jb25uZWN0aW9uX3VucmVnaXN0ZXJfb2JqZWN0X3BhdGgobmF0LT5jb25uLCBwYXRoKTsKKyAgICAgICAgZGJ1c19jb25uZWN0aW9uX2ZsdXNoKG5hdC0+Y29ubik7CisgICAgICAgIGRidXNfY29ubmVjdGlvbl91bnJlZ2lzdGVyX29iamVjdF9wYXRoKG5hdC0+Y29ubiwgYWdlbnRfcGF0aCk7CiAKICAgICAgICAgZGJ1c19idXNfcmVtb3ZlX21hdGNoKG5hdC0+Y29ubiwKICAgICAgICAgICAgICAgICAidHlwZT0nc2lnbmFsJyxpbnRlcmZhY2U9J29yZy5ibHVlei5hdWRpby5TaW5rJyIsCkBAIC02NTAsNiArNzA1LDcgQEAKICAgICBuYXRpdmVfZGF0YV90ICpuYXQ7CiAgICAgSk5JRW52ICplbnY7CiAgICAgREJ1c0Vycm9yIGVycjsKKyAgICBEQnVzSGFuZGxlclJlc3VsdCByZXQ7CiAKICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CiAKQEAgLTY2MCwzMjEgKzcxNiwxNzMgQEAKICAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfTk9UX1lFVF9IQU5ETEVEOwogICAgIH0KIAotICAgIExPR1YoIiVzOiBSZWNlaXZlZCBzaWduYWwgJXM6JXMgZnJvbSAlcyIsIF9fRlVOQ1RJT05fXywKLSAgICAgICAgIGRidXNfbWVzc2FnZV9nZXRfaW50ZXJmYWNlKG1zZyksIGRidXNfbWVzc2FnZV9nZXRfbWVtYmVyKG1zZyksCi0gICAgICAgICBkYnVzX21lc3NhZ2VfZ2V0X3BhdGgobXNnKSk7CisgICAgLy8gU1RPUFNISVA6IENoYW5nZSB0byBMT0dWCisgICAgTE9HRSgiJXM6IFJlY2VpdmVkIHNpZ25hbCAlczolcyBmcm9tICVzIiwgX19GVU5DVElPTl9fLAorICAgICAgICBkYnVzX21lc3NhZ2VfZ2V0X2ludGVyZmFjZShtc2cpLCBkYnVzX21lc3NhZ2VfZ2V0X21lbWJlcihtc2cpLAorICAgICAgICBkYnVzX21lc3NhZ2VfZ2V0X3BhdGgobXNnKSk7CiAKKyAgICBlbnYtPlB1c2hMb2NhbEZyYW1lKEVWRU5UX0xPT1BfUkVGUyk7CiAgICAgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouQWRhcHRlciIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlbW90ZURldmljZUZvdW5kIikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGV2aWNlRm91bmQiKSkgewogICAgICAgICBjaGFyICpjX2FkZHJlc3M7Ci0gICAgICAgIGludCBuX2NsYXNzOwotICAgICAgICBzaG9ydCBuX3Jzc2k7Ci0gICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1VJTlQzMiwgJm5fY2xhc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVDE2LCAmbl9yc3NpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKSkgewotICAgICAgICAgICAgTE9HVigiLi4uIGFkZHJlc3MgPSAlcyBjbGFzcyA9ICUjWCByc3NpID0gJWhkIiwgY19hZGRyZXNzLCBuX2NsYXNzLAotICAgICAgICAgICAgICAgICBuX3Jzc2kpOworICAgICAgICBEQnVzTWVzc2FnZUl0ZXIgaXRlcjsKKyAgICAgICAgam9iamVjdEFycmF5IHN0cl9hcnJheSA9IE5VTEw7CisgICAgICAgIGlmIChkYnVzX21lc3NhZ2VfaXRlcl9pbml0KG1zZywgJml0ZXIpKSB7CisgICAgICAgICAgICBkYnVzX21lc3NhZ2VfaXRlcl9nZXRfYmFzaWMoJml0ZXIsICZjX2FkZHJlc3MpOworICAgICAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9pdGVyX25leHQoJml0ZXIpKQorICAgICAgICAgICAgICAgIHN0cl9hcnJheSA9CisgICAgICAgICAgICAgICAgICAgIHBhcnNlX3JlbW90ZV9kZXZpY2VfcHJvcGVydGllcyhlbnYsICZpdGVyKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoc3RyX2FycmF5ICE9IE5VTEwpIHsKICAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uUmVtb3RlRGV2aWNlRm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZF9vbkRldmljZUZvdW5kLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX2FkZHJlc3MpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoamludCluX2NsYXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoanNob3J0KW5fcnNzaSk7Ci0gICAgICAgIH0gZWxzZSBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCBtc2cpOwotICAgICAgICByZXR1cm4gREJVU19IQU5ETEVSX1JFU1VMVF9IQU5ETEVEOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJfYXJyYXkpOworICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7CisgICAgICAgIGdvdG8gc3VjY2VzczsKICAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGlzY292ZXJ5U3RhcnRlZCIpKSB7Ci0gICAgICAgIExPR0koIkRpc2NvdmVyeVN0YXJ0ZWQgc2lnbmFsIHJlY2VpdmVkIik7Ci0gICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwgbWV0aG9kX29uRGlzY292ZXJ5U3RhcnRlZCk7Ci0gICAgICAgIHJldHVybiBEQlVTX0hBTkRMRVJfUkVTVUxUX0hBTkRMRUQ7Ci0gICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouQWRhcHRlciIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRGlzY292ZXJ5Q29tcGxldGVkIikpIHsKLSAgICAgICAgTE9HSSgiRGlzY292ZXJ5Q29tcGxldGVkIHNpZ25hbCByZWNlaXZlZCIpOwotICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG5hdC0+bWUsIG1ldGhvZF9vbkRpc2NvdmVyeUNvbXBsZXRlZCk7Ci0gICAgICAgIHJldHVybiBEQlVTX0hBTkRMRVJfUkVTVUxUX0hBTkRMRUQ7Ci0gICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5BZGFwdGVyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlbW90ZURldmljZURpc2FwcGVhcmVkIikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJEZXZpY2VEaXNhcHBlYXJlZCIpKSB7CiAgICAgICAgIGNoYXIgKmNfYWRkcmVzczsKICAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csICZlcnIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYWRkcmVzcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCkpIHsKICAgICAgICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMiLCBjX2FkZHJlc3MpOwotICAgICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLCBtZXRob2Rfb25SZW1vdGVEZXZpY2VEaXNhcHBlYXJlZCwKKyAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwgbWV0aG9kX29uRGV2aWNlRGlzYXBwZWFyZWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcykpOwogICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKKyAgICAgICAgZ290byBzdWNjZXNzOwogICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX3NpZ25hbChtc2csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouQWRhcHRlciIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJSZW1vdGVDbGFzc1VwZGF0ZWQiKSkgewotICAgICAgICBjaGFyICpjX2FkZHJlc3M7Ci0gICAgICAgIGludCBuX2NsYXNzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouQWRhcHRlciIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRldmljZUNyZWF0ZWQiKSkgeworICAgICAgICBjaGFyICpjX29iamVjdF9wYXRoOwogICAgICAgICBpZiAoZGJ1c19tZXNzYWdlX2dldF9hcmdzKG1zZywgJmVyciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19hZGRyZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9VSU5UMzIsICZuX2NsYXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9PQkpFQ1RfUEFUSCwgJmNfb2JqZWN0X3BhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dWKCIuLi4gYWRkcmVzcyA9ICVzIiwgY19hZGRyZXNzKTsKLSAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwgbWV0aG9kX29uUmVtb3RlQ2xhc3NVcGRhdGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX2FkZHJlc3MpLCAoamludCluX2NsYXNzKTsKLSAgICAgICAgfSBlbHNlIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7Ci0gICAgICAgIHJldHVybiBEQlVTX0hBTkRMRVJfUkVTVUxUX0hBTkRMRUQ7Ci0gICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5BZGFwdGVyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlbW90ZU5hbWVVcGRhdGVkIikpIHsKLSAgICAgICAgY2hhciAqY19hZGRyZXNzOwotICAgICAgICBjaGFyICpjX25hbWU7Ci0gICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfbmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCkpIHsKLSAgICAgICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMsIG5hbWUgPSAlcyIsIGNfYWRkcmVzcywgY19uYW1lKTsKKyAgICAgICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMiLCBjX29iamVjdF9wYXRoKTsKICAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uUmVtb3RlTmFtZVVwZGF0ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfbmFtZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25EZXZpY2VDcmVhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX29iamVjdF9wYXRoKSk7CiAgICAgICAgIH0gZWxzZSBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCBtc2cpOwotICAgICAgICByZXR1cm4gREJVU19IQU5ETEVSX1JFU1VMVF9IQU5ETEVEOworICAgICAgICBnb3RvIHN1Y2Nlc3M7CisgICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJEZXZpY2VSZW1vdmVkIikpIHsKKyAgICAgICAgY2hhciAqY19vYmplY3RfcGF0aDsKKyAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csICZlcnIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfT0JKRUNUX1BBVEgsICZjX29iamVjdF9wYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7CisgICAgICAgICAgIExPR1YoIi4uLiBPYmplY3QgUGF0aCA9ICVzIiwgY19vYmplY3RfcGF0aCk7CisgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25EZXZpY2VSZW1vdmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfb2JqZWN0X3BhdGgpKTsKKyAgICAgICAgfSBlbHNlIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7CisgICAgICAgIGdvdG8gc3VjY2VzczsKICAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVtb3RlTmFtZUZhaWxlZCIpKSB7Ci0gICAgICAgIGNoYXIgKmNfYWRkcmVzczsKLSAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csICZlcnIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCkpIHsKLSAgICAgICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMiLCBjX2FkZHJlc3MpOwotICAgICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25SZW1vdGVOYW1lRmFpbGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX2FkZHJlc3MpKTsKLSAgICAgICAgfSBlbHNlIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7Ci0gICAgICAgIHJldHVybiBEQlVTX0hBTkRMRVJfUkVTVUxUX0hBTkRMRUQ7Ci0gICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5BZGFwdGVyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlbW90ZURldmljZUNvbm5lY3RlZCIpKSB7Ci0gICAgICAgIGNoYXIgKmNfYWRkcmVzczsKLSAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csICZlcnIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCkpIHsKLSAgICAgICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMiLCBjX2FkZHJlc3MpOwotICAgICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25SZW1vdGVEZXZpY2VDb25uZWN0ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcykpOwotICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVtb3RlRGV2aWNlRGlzY29ubmVjdFJlcXVlc3RlZCIpKSB7Ci0gICAgICAgIGNoYXIgKmNfYWRkcmVzczsKLSAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csICZlcnIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCkpIHsKLSAgICAgICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMiLCBjX2FkZHJlc3MpOwotICAgICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25SZW1vdGVEZXZpY2VEaXNjb25uZWN0UmVxdWVzdGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihjX2FkZHJlc3MpKTsKLSAgICAgICAgfSBlbHNlIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7Ci0gICAgICAgIHJldHVybiBEQlVTX0hBTkRMRVJfUkVTVUxUX0hBTkRMRUQ7Ci0gICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5BZGFwdGVyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlbW90ZURldmljZURpc2Nvbm5lY3RlZCIpKSB7Ci0gICAgICAgIGNoYXIgKmNfYWRkcmVzczsKLSAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csICZlcnIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCkpIHsKLSAgICAgICAgICAgIExPR1YoIi4uLiBhZGRyZXNzID0gJXMiLCBjX2FkZHJlc3MpOwotICAgICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25SZW1vdGVEZXZpY2VEaXNjb25uZWN0ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcykpOwotICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQm9uZGluZ0NyZWF0ZWQiKSkgewotICAgICAgICBjaGFyICpjX2FkZHJlc3M7Ci0gICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dWKCIuLi4gYWRkcmVzcyA9ICVzIiwgY19hZGRyZXNzKTsKLSAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uQm9uZGluZ0NyZWF0ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcykpOwotICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQm9uZGluZ1JlbW92ZWQiKSkgewotICAgICAgICBjaGFyICpjX2FkZHJlc3M7Ci0gICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dWKCIuLi4gYWRkcmVzcyA9ICVzIiwgY19hZGRyZXNzKTsKLSAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uQm9uZGluZ1JlbW92ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfYWRkcmVzcykpOwotICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTW9kZUNoYW5nZWQiKSkgewotICAgICAgICBjaGFyICpjX21vZGU7Ci0gICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX21vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dWKCIuLi4gbW9kZSA9ICVzIiwgY19tb2RlKTsKLSAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uTW9kZUNoYW5nZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfbW9kZSkpOwotICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmJsdWV6LkFkYXB0ZXIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmFtZUNoYW5nZWQiKSkgewotICAgICAgICBjaGFyICpjX25hbWU7Ci0gICAgICAgIGlmIChkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCAmZXJyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX25hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dWKCIuLi4gbmFtZSA9ICVzIiwgY19uYW1lKTsKLSAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uTmFtZUNoYW5nZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfbmFtZSkpOwotICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLSAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19zaWduYWwobXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JnLmZyZWVkZXNrdG9wLkRCdXMiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmFtZU93bmVyQ2hhbmdlZCIpKSB7Ci0gICAgICAgIGNoYXIgKmNfbmFtZTsKLSAgICAgICAgY2hhciAqY19vbGRfb3duZXI7Ci0gICAgICAgIGNoYXIgKmNfbmV3X293bmVyOwotICAgICAgICBpZiAoZGJ1c19tZXNzYWdlX2dldF9hcmdzKG1zZywgJmVyciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19uYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX29sZF9vd25lciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19uZXdfb3duZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dWKCIuLi4gbmFtZSA9ICVzIiwgY19uYW1lKTsKLSAgICAgICAgICAgIExPR1YoIi4uLiBvbGRfb3duZXIgPSAlcyIsIGNfb2xkX293bmVyKTsKLSAgICAgICAgICAgIExPR1YoIi4uLiBuZXd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mxlbigiUG93ZXJlZCIpKSkgeworICAgICAgICAgICAgICAgIGpzdHJpbmcgdmFsdWUgPQorICAgICAgICAgICAgICAgICAgICAoanN0cmluZykgZW52LT5HZXRPYmplY3RBcnJheUVsZW1lbnQoc3RyX2FycmF5LCAxKTsKKyAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpjX3ZhbHVlID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyh2YWx1ZSwgTlVMTCk7CisgICAgICAgICAgICAgICAgaWYgKCFzdHJuY21wKGNfdmFsdWUsICJ0cnVlIiwgc3RybGVuKCJ0cnVlIikpKQorICAgICAgICAgICAgICAgICAgICBuYXQtPmFkYXB0ZXIgPSBnZXRfYWRhcHRlcl9wYXRoKG5hdC0+Y29ubik7CisgICAgICAgICAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnModmFsdWUsIGNfdmFsdWUpOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMocHJvcGVydHksIGNfcHJvcGVydHkpOworCisgICAgICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG5hdC0+bWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25Qcm9wZXJ0eUNoYW5nZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJfYXJyYXkpOwogICAgICAgICB9IGVsc2UgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKKyAgICAgICAgZ290byBzdWNjZXNzOworICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX3NpZ25hbChtc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouRGV2aWNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlByb3BlcnR5Q2hhbmdlZCIpKSB7CisgICAgICAgIGpvYmplY3RBcnJheSBzdHJfYXJyYXkgPSBwYXJzZV9yZW1vdGVfZGV2aWNlX3Byb3BlcnR5X2NoYW5nZShlbnYsIG1zZyk7CisgICAgICAgIGlmIChzdHJfYXJyYXkgIT0gTlVMTCkgeworICAgICAgICAgICAgY29uc3QgY2hhciAqcmVtb3RlX2RldmljZV9wYXRoID0gZGJ1c19tZXNzYWdlX2dldF9wYXRoKG1zZyk7CisgICAgICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG5hdC0+bWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uRGV2aWNlUHJvcGVydHlDaGFuZ2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKHJlbW90ZV9kZXZpY2VfcGF0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyX2FycmF5KTsKKyAgICAgICAgfSBlbHNlIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7CisgICAgICAgIGdvdG8gc3VjY2VzczsKICAgICB9CiAKLSAgICByZXR1cm4gYTJkcF9ldmVudF9maWx0ZXIobXNnLCBlbnYpOworICAgIHJldCA9IGEyZHBfZXZlbnRfZmlsdGVyKG1zZywgZW52KTsKKyAgICBlbnYtPlBvcExvY2FsRnJhbWUoTlVMTCk7CisgICAgcmV0dXJuIHJldDsKKworc3VjY2VzczoKKyAgICBlbnYtPlBvcExvY2FsRnJhbWUoTlVMTCk7CisgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKIH0KIAogLy8gQ2FsbGVkIGJ5IGRidXMgZHVyaW5nIFdhaXRGb3JBbmREaXNwYXRjaEV2ZW50TmF0aXZlKCkKLXN0YXRpYyBEQnVzSGFuZGxlclJlc3VsdCBhZ2VudF9ldmVudF9maWx0ZXIoRE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gICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGFkZHJlc3MpLCAoaW50KW1zZyk7Ci0KLSAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfSEFORExFRDsKLQotICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX21ldGhvZF9jYWxsKG1zZywKLSAgICAgICAgICAgICJvcmcuYmx1ZXouUGFzc2tleUFnZW50IiwgIkNhbmNlbCIpKSB7Ci0KLSAgICAgICAgY29uc3QgY2hhciAqYWRhcHRlcjsKLSAgICAgICAgY29uc3QgY2hhciAqYWRkcmVzczsKLSAgICAgICAgaWYgKCFkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmYWRhcHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmFkZHJlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKSkgewotICAgICAgICAgICAgTE9HRSgiJXM6IEludmFsaWQgYXJndW1lbnRzIGZvciBDYW5jZWwoKSBtZXRob2QiLCBfX0ZVTkNUSU9OX18pOwotICAgICAgICAgICAgcmV0dXJuIERCVVNfSEFORExFUl9SRVNVTFRfTk9UX1lFVF9IQU5ETEVEOwotICAgICAgICB9Ci0KLSAgICAgICAgTE9HVigiLi4uIGFkZHJlc3MgPSAlcyIsIGFkZHJlc3MpOwotCi0gICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwgbWV0aG9kX29uUGFzc2tleUFnZW50Q2FuY2VsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGFkZHJlc3MpKTsKKyAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLCBtZXRob2Rfb25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ETEVEOwotICAgICAgICB9Ci0gICAgICAgIGRidXNfY29ubmVjdGlvbl9zZW5kKG5hdC0+Y29ubiwgcmVwbHksIE5VTEwpOwotICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOwotICAgICAgICByZXR1cm4gREJVU19IQU5ETEVSX1JFU1VMVF9IQU5ETEVEOwotICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX21ldGhvZF9jYWxsKG1zZywKLSAgICAgICAgICAgICJvcmcuYmx1ZXouQXV0aG9yaXphdGlvbkFnZW50IiwgIkF1dGhvcml6ZSIpKSB7Ci0gICAgICAgIGNvbnN0IGNoYXIgKmFkYXB0ZXI7Ci0gICAgICAgIGNvbnN0IGNoYXIgKmFkZHJlc3M7Ci0gICAgICAgIGNvbnN0IGNoYXIgKnNlcnZpY2U7CisgICAgICAgICAgICAib3JnLmJsdWV6LkFnZW50IiwgIkF1dGhvcml6ZSIpKSB7CisgICAgICAgIGNoYXIgKm9iamVjdF9wYXRoOwogICAgICAgICBjb25zdCBjaGFyICp1dWlkOwogICAgICAgICBpZiAoIWRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZhZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJnNlcnZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9PQkpFQ1RfUEFUSCwgJm9iamVjdF9wYXRoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmdXVpZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVB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c19tZXNzYWdlX25ld19tZXRob2RfcmV0dXJuKG1zZyk7CiAgICAgICAgICAgICBpZiAoIXJlcGx5KSB7CiAgICAgICAgICAgICAgICAgTE9HRSgiJXM6IENhbm5vdCBjcmVhdGUgbWVzc2FnZSByZXBseVxuIiwgX19GVU5DVElPTl9fKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gREJVU19IQU5ETEVSX1JFU1VMVF9OT1RfWUVUX0hBTkRMRUQ7CisgICAgICAgICAgICAgICAgZ290byBmYWlsdXJlOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZGJ1c19jb25uZWN0aW9uX3NlbmQobmF0LT5jb25uLCByZXBseSwgTlVMTCk7CiAgICAgICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOwpAQCAtOTgzLDY0ICs4OTEsODMgQEAKICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5FcnJvci5SZWplY3RlZCIsICJBdXRob3JpemF0aW9uIHJlamVjdGVkIik7CiAgICAgICAgICAgICBpZiAoIXJlcGx5KSB7CiAgICAgICAgICAgICAgICAgTE9HRSgiJXM6IENhbm5vdCBjcmVhdGUgbWVzc2FnZSByZXBseVxuIiwgX19GVU5DVElPTl9fKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gREJVU19IQU5ETEVSX1JFU1VMVF9OT1RfWUVUX0hBTkRMRUQ7CisgICAgICAgICAgICAgICAgZ290byBmYWlsdXJlOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZGJ1c19jb25uZWN0aW9uX3NlbmQobmF0LT5jb25uLCByZXBseSwgTlVMTCk7CiAgICAgICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBEQlVTX0hBTkRMRVJfUkVTVUxUX0hBTkRMRUQ7CisgICAgICAgIGdvdG8gc3VjY2VzczsKICAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19tZXRob2RfY2FsbChtc2csCi0gICAgICAgICAgICAib3JnLmJsdWV6LkF1dGhvcml6YXRpb25BZ2VudCIsICJDYW5jZWwiKSkgewotICAgICAgICBjb25zdCBjaGFyICphZGFwdGVyOwotICAgICAgICBjb25zdCBjaGFyICphZGRyZXNzOwotICAgICAgICBjb25zdCBjaGFyICpzZXJ2aWNlOwotICAgICAgICBjb25zdCBjaGFyICp1dWlkOworICAgICAgICAgICAgIm9yZy5ibHVlei5BZ2VudCIsICJSZXF1ZXN0UGluQ29kZSIpKSB7CisgICAgICAgIGNoYXIgKm9iamVjdF9wYXRoOwogICAgICAgICBpZiAoIWRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZhZGFwdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmYWRkcmVzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJnNlcnZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZ1dWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfT0JKRUNUX1BBVEgsICZvYmplY3RfcGF0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpKSB7Ci0gICAgICAgICAgICBMT0dFKCIlczogSW52YWxpZCBhcmd1bWVudHMgZm9yIENhbmNlbCgpIG1ldGhvZCIsIF9fRlVOQ1RJT05fXyk7Ci0gICAgICAgICAgICByZXR1cm4gREJVU19IQU5ETEVSX1JFU1VMVF9OT1RfWUVUX0hBTkRMRUQ7CisgICAgICAgICAgICBMT0dFKCIlczogSW52YWxpZCBhcmd1bWVudHMgZm9yIFJlcXVlc3RQaW5Db2RlKC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gICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLCBtZXRob2Rfb25SZXF1ZXN0UGluQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKG9iamVjdF9wYXRoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludChtc2cpKTsKKyAgICAgICAgZ290byBzdWNjZXNzOwogICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX21ldGhvZF9jYWxsKG1zZywKLSAgICAgICAgICAgICJvcmcuYmx1ZXouQXV0aG9yaXphdGlvbkFnZW50IiwgIlJlbGVhc2UiKSkgewotICAgICAgICBMT0dXKCJXZSBhcmUgbm8gbG9uZ2VyIHRoZSBhdXRoIGFnZW50ISIpOworICAgICAgICAgICAgIm9yZy5ibHVlei5BZ2VudCIsICJSZXF1ZXN0UGFzc2tleSIpKSB7CisgICAgICAgIGNoYXIgKm9iamVjdF9wYXRoOworICAgICAgICBpZiAoIWRidXNfbWVzc2FnZV9nZXRfYXJncyhtc2csIE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9PQkpFQ1RfUEFUSCwgJm9iamVjdF9wYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCkpIHsKKyAgICAgICAgICAgIExPR0UoIiVzOiBJbnZhbGlkIGFyZ3VtZW50cyBmb3IgUmVxdWVzdFBhc3NrZXkoKSBtZXRob2QiLCBfX0ZVTkNUSU9OX18pOworICAgICAgICAgICAgZ290byBmYWlsdXJlOworICAgICAgICB9CiAKKyAgICAgICAgZGJ1c19tZXNzYWdlX3JlZihtc2cpOyAgLy8gaW5jcmVtZW50IHJlZmNvdW50IGJlY2F1c2Ugd2UgcGFzcyB0byBqYXZhCisgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwgbWV0aG9kX29uUmVxdWVzdFBhc3NrZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihvYmplY3RfcGF0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQobXNnKSk7CisgICAgICAgIGdvdG8gc3VjY2VzczsKKyAgICB9IGVsc2UgaWYgKGRidXNfbWVzc2FnZV9pc19tZXRob2RfY2FsbChtc2csCisgICAgICAgICAgICAib3JnLmJsdWV6LkFnZW50IiwgIlJlcXVlc3RDb25maXJtYXRpb24iKSkgeworICAgICAgICBjaGFyICpvYmplY3RfcGF0aDsKKyAgICAgICAgdWludDMyX3QgcGFzc2tleTsKKyAgICAgICAgaWYgKCFkYnVzX21lc3NhZ2VfZ2V0X2FyZ3MobXNnLCBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfT0JKRUNUX1BBVEgsICZvYmplY3RfcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1VJTlQzMiwgJnBhc3NrZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKSkgeworICAgICAgICAgICAgTE9HRSgiJXM6IEludmFsaWQgYXJndW1lbnRzIGZvciBSZXF1ZXN0Q29uZmlybWF0aW9uKCkgbWV0aG9kIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIGdvdG8gZmFpbHVyZTsKKyAgICAgICAgfQorCisgICAgICAgIGRidXNfbWVzc2FnZV9yZWYobXNnKTsgIC8vIGluY3JlbWVudCByZWZjb3VudCBiZWNhdXNlIHdlIHBhc3MgdG8gamF2YQorICAgICAgICBlbnYtPkNhbGxWb2lkTWV0aG9kKG5hdC0+bWUsIG1ldGhvZF9vblJlcXVlc3RDb25maXJtYXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihvYmplY3RfcGF0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXNza2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50KG1zZykpOworICAgICAgICBnb3RvIHN1Y2Nlc3M7CisgICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfbWV0aG9kX2NhbGwobXNnLAorICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5BZ2VudCIsICJSZWxlYXNlIikpIHsKICAgICAgICAgLy8gcmVwbHkKICAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfcmV0dXJuKG1zZyk7CiAgICAgICAgIGlmICghcmVwbHkpIHsKICAgICAgICAgICAgIExPR0UoIiVzOiBDYW5ub3QgY3JlYXRlIG1lc3NhZ2UgcmVwbHlcbiIsIF9fRlVOQ1RJT05fXyk7Ci0gICAgICAgICAgICByZXR1cm4gREJVU19IQU5ETEVSX1JFU1VMVF9OT1RfWUVUX0hBTkRMRUQ7CisgICAgICAgICAgICBnb3RvIGZhaWx1cmU7CiAgICAgICAgIH0KICAgICAgICAgZGJ1c19jb25uZWN0aW9uX3NlbmQobmF0LT5jb25uLCByZXBseSwgTlVMTCk7CiAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7Ci0gICAgICAgIHJldHVybiBEQlVTX0hBTkRMRVJfUkVTVUxUX0hBTkRMRUQ7CisgICAgICAgIGdvdG8gc3VjY2VzczsKICAgICB9IGVsc2UgewotICAgICAgICBMT0dWKCIuLi4gaWdub3JlZCIpOworICAgICAgICBMT0dWKCIlczolcyBpcyBpZ25vcmVkIiwgZGJ1c19tZXNzYWdlX2dldF9pbnRlcmZhY2UobXNnKSwgZGJ1c19tZXNzYWdlX2dldF9tZW1iZXIobXNnKSk7CiAgICAgfQogCitmYWlsdXJlOgorICAg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SZW1vdGVTZXJ2aWNlQ2hhbm5lbFJlc3VsdChEQnVzTWVzc2FnZSAqbXNnLCB2b2lkICp1c2VyLCB2b2lkICpuKSB7Cit2b2lkIG9uR2V0RGV2aWNlU2VydmljZUNoYW5uZWxSZXN1bHQoREJ1c01lc3NhZ2UgKm1zZywgdm9pZCAqdXNlciwgdm9pZCAqbikgewogICAgIExPR1YoX19GVU5DVElPTl9fKTsKIAogICAgIGNvbnN0IGNoYXIgKmFkZHJlc3MgPSAoY29uc3QgY2hhciAqKSB1c2VyOwpAQCAtMTEzMywxNCArMTA2MCwxMyBAQAogICAgICAgICAhZGJ1c19tZXNzYWdlX2dldF9hcmdzKG1zZywgJmVyciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5UMzIsICZjaGFubmVsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKSkgewotICAgICAgICAvKiBpZiAoIXN0cmNtcChlcnIubmFtZSwgQkxVRVpfREJVU19CQVNFX0lGQyAiLkVycm9yLkF1dGhlbnRpY2F0aW9uRmFpbGVkIikpICovCiAgICAgICAgIExPR0UoIiVzOiBELUJ1cyBlcnJvcjogJXMgKCVzKVxuIiwgX19GVU5DVElPTl9fLCBlcnIubmFtZSwgZXJyLm1lc3NhZ2UpOwogICAgICAgICBkYnVzX2Vycm9yX2ZyZWUoJmVycik7CiAgICAgfQogCiBkb25lOgogICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZF9vbkdldFJlbW90ZVNlcnZpY2VDaGFubmVsUmVzdWx0LAorICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uR2V0RGV2aWNlU2VydmljZUNoYW5uZWxSZXN1bHQsCiAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihhZGRyZXNzKSwKICAgICAgICAgICAgICAgICAgICA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09USCovCisgICAgcmV0dXJuIHRydWU7Cit9CisKK3N0YXRpYyBjb25zdCBjaGFyICpnZXRfYWRhcHRlcl9wYXRoKEpOSUVudiogZW52LCBqb2JqZWN0IG9iamVjdCkgeworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgZXZlbnRfbG9vcF9uYXRpdmVfZGF0YV90ICpldmVudF9uYXQgPQorICAgICAgICBnZXRfRXZlbnRMb29wX25hdGl2ZV9kYXRhKGVudiwgZW52LT5HZXRPYmplY3RGaWVsZChvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpZWxkX21FdmVudExvb3ApKTsKKyAgICBpZiAoZXZlbnRfbmF0ID09IE5VTEwpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIHJldHVybiBldmVudF9uYXQtPmFkYXB0ZXI7CisjZWxzZQorICAgIHJldHVybiBOVUxMOworI2VuZGlmCit9CisKKy8vIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHdoZW4gdGhlIGFkYXB0ZXIgaXMgZW5hYmxlZC4KK3N0YXRpYyBqYm9vbGVhbiBzZXR1cE5hdGl2ZURhdGFOYXRpdmUoSk5JRW52KiBlbnYsIGpvYmplY3Qgb2JqZWN0KSB7CisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0KKyAgICAgICAgKG5hdGl2ZV9kYXRhX3QgKillbnYtPkdldEludEZpZWxkKG9iamVjdCwgZmllbGRfbU5hdGl2ZURhdGEpOworICAgIGV2ZW50X2xvb3BfbmF0aXZlX2RhdGFfdCAqZXZlbnRfbmF0ID0KKyAgICAgICAgZ2V0X0V2ZW50TG9vcF9uYXRpdmVfZGF0YShlbnYsIGVudi0+R2V0T2JqZWN0RmllbGQob2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWVsZF9tRXZlbnRMb29wKSk7CisgICAgLy8gUmVnaXN0ZXIgYWdlbnQgZm9yIHJlbW90ZSBkZXZpY2VzLgorICAgIGNvbnN0IGNoYXIgKmRldmljZV9hZ2VudF9wYXRoID0gIi9hbmRyb2lkL2JsdWV0b290aC9yZW1vdGVfZGV2aWNlX2FnZW50IjsKKyAgICBzdGF0aWMgY29uc3QgREJ1c09iamVjdFBhdGhWVGFibGUgYWdlbnRfdnRhYmxlID0geworICAgICAgICAgICAgICAgICBOVUxMLCBhZ2VudF9ldmVudF9maWx0ZXIsIE5VTEwsIE5VTEwsIE5VTEwsIE5VTEwgfTsKKworICAgIGlmICghZGJ1c19jb25uZWN0aW9uX3JlZ2lzdGVyX29iamVjdF9wYXRoKG5hdC0+Y29ubiwgZGV2aWNlX2FnZW50X3BhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFnZW50X3Z0YWJsZSwgZXZlbnRfbmF0KSkgeworICAgICAgICBMT0dFKCIlczogQ2FuJ3QgcmVnaXN0ZXIgb2JqZWN0IHBhdGggJXMgZm9yIHJlbW90ZSBkZXZpY2UgYWdlbnQhIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18sIGRldmljZV9hZ2VudF9wYXRoKTsKKyAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICB9CisjZW5kaWYgLypIQVZFX0JMVUVUT09USCovCisgICAgcmV0dXJuIEpOSV9UUlVFOworfQorCitzdGF0aWMgamJvb2xlYW4gdGVhckRvd25OYXRpdmVEYXRhTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCkgeworICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9CisgICAgICAgICAgICAgICAobmF0aXZlX2RhdGFfd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CBvYmplY3QpKSk7CisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIE5VTEw7Cit9CisKKworc3RhdGljIGpib29sZWFuIHN0YXJ0RGlzY292ZXJ5TmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCkgeworICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIERCdXNNZXNzYWdlICptc2cgPSBOVUxMOworICAgIERCdXNNZXNzYWdlICpyZXBseSA9IE5VTEw7CisgICAgREJ1c0Vycm9yIGVycjsKKyAgICBjb25zdCBjaGFyICpuYW1lOworICAgIGpib29sZWFuIHJldCA9IEpOSV9GQUxTRTsKKworICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7CisgICAgaWYgKG5hdCA9PSBOVUxMKSB7CisgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKKyAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisKKyAgICAvKiBDb21wb3NlIHRoZSBjb21tYW5kICovCisgICAgbXNnID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfY2FsbChCTFVFWl9EQlVTX0JBU0VfSUZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0X2FkYXB0ZXJfcGF0aChlbnYsIG9iamVjdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0FEQVBURVJfSUZBQ0UsICJTdGFydERpc2NvdmVyeSIpOworCisgICAgaWYgKG1zZyA9PSBOVUxMKSB7CisgICAgICAgIGlmIChkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgeworICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKKyAgICAgICAgfQorICAgICAgICBnb3RvIGRvbmU7CisgICAgfQorCisgICAgLyogU2VuZCB0aGUgY29tbWFuZC4gKi8KKyAgICByZXBseSA9IGRidXNfY29ubmVjdGlvbl9zZW5kX3dpdGhfcmVwbHlfYW5kX2Jsb2NrKG5hdC0+Y29ubiwgbXNnLCAtMSwgJmVycik7CisgICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKSB7CisgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCBtc2cpOworICAgICAgICAgcmV0ID0gSk5JX0ZBTFNFOworICAgICAgICAgZ290byBkb25lOworICAgIH0KKworICAgIHJldCA9IEpOSV9UUlVFOworZG9uZToKKyAgICBpZiAocmVwbHkpIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7CisgICAgaWYgKG1zZykgZGJ1c19tZXNzYWdlX3VucmVmKG1zZyk7CisgICAgcmV0dXJuIHJldDsKKyNlbHNlCisgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyNlbmRpZgorfQorCitzdGF0aWMgdm9pZCBzdG9wRGlzY292ZXJ5TmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCkgeworICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIERCdXNNZXNzYWdlICptc2cgPSBOVUxMOworICAgIERCdXNNZXNzYWdlICpyZXBseSA9IE5VTEw7CisgICAgREJ1c0Vycm9yIGVycjsKKyAgICBjb25zdCBjaGFyICpuYW1lOworICAgIGpzdHJpbmcgcmV0OworICAgIG5hdGl2ZV9kYXRhX3QgKm5hdDsKKworICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKKworICAgIG5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7CisgICAgaWYgKG5hdCA9PSBOVUxMKSB7CisgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKKyAgICAvKiBDb21wb3NlIHRoZSBjb21tYW5kICovCisgICAgbXNnID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfY2FsbChCTFVFWl9EQlVTX0JBU0VfSUZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0X2FkYXB0ZXJfcGF0aChlbnYsIG9iamVjdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0FEQVBURVJfSUZBQ0UsICJTdG9wRGlzY292ZXJ5Iik7CisgICAgaWYgKG1zZyA9PSBOVUxMKSB7CisgICAgICAgIGlmIChkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkKKyAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SX1dJVEhfTVNHKCZlcnIsIG1zZyk7CisgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKKyAgICAvKiBTZW5kIHRoZSBjb21tYW5kLiAqLworICAgIHJlcGx5ID0gZGJ1c19jb25uZWN0aW9uX3NlbmRfd2l0aF9yZXBseV9hbmRfYmxvY2sobmF0LT5jb25uLCBtc2csIC0xLCAmZXJyKTsKKyAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgaWYoc3RybmNtcChlcnIubmFtZSwgQkxVRVpfREJVU19CQVNFX0lGQyAiLkVycm9yLk5vdEF1dGhvcml6ZWQiLAorICAgICAgICAgICAgICAgICAgIHN0cmxlbihCTFVFWl9EQlVTX0JBU0VfSUZDICIuRXJyb3IuTm90QXV0aG9yaXplZCIpKSA9PSAwKSB7CisgICAgICAgICAgICAvLyBoY2lkIHNlbmRzIHRoaXMgaWYgdGhlcmUgaXMgbm8gYWN0aXZlIGRpc2NvdmVyeSB0byBjYW5jZWwKKyAgICAgICAgICAgIExPR1YoIiVzOiBUaGVyZSB3YXMgbm8gYWN0aXZlIGRpc2NvdmVyeSB0byBjYW5jZWwiLCBfX0ZVTkNUSU9OX18pOworICAgICAgICAgICAgZGJ1c19lcnJvcl9mcmVlKCZlcnIpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTE9HX0FORF9GUkVFX0RCVVNfRVJST1JfV0lUSF9NU0coJmVyciwgbXNnKTsKKyAgICAgICAgfQorICAgIH0KKworZG9uZToKKyAgICBpZiAobXNnKSBkYnVzX21lc3NhZ2VfdW5yZWYobXNnKTsKKyAgICBpZiAocmVwbHkpIGRidXNfbWVzc2FnZV91bnJlZihyZXBseSk7CisjZW5kaWYKK30KKworc3RhdGljIGpib29sZWFuIGNyZWF0ZVBhaXJlZERldmljZU5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcywgamludCB0aW1lb3V0X21zKSB7CisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKKyAgICBqb2JqZWN0IGV2ZW50TG9vcCA9IGVudi0+R2V0T2JqZWN0RmllbGQob2JqZWN0LCBmaWVsZF9tRXZlbnRMb29wKTsKKyAgICBzdHJ1Y3QgZXZlbnRfbG9vcF9uYXRpdmVfZGF0YV90ICpldmVudExvb3BOYXQgPQorICAgICAgICAgICAgZ2V0X0V2ZW50TG9vcF9uYXRpdmVfZGF0YShlbnYsIGV2ZW50TG9vcCk7CisKKyAgICBpZiAobmF0ICYmIGV2ZW50TG9vcE5hdCkgeworICAgICAgICBjb25zdCBjaGFyICpjX2FkZHJlc3MgPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKGFkZHJlc3MsIE5VTEwpOworICAgICAgICBMT0dWKCIuLi4gYWRkcmVzcyA9ICVzIiwgY19hZGRyZXNzKTsKKyAgICAgICAgY2hhciAqY29udGV4dF9hZGRyZXNzID0gKGNoYXIgKiljYWxsb2MoQlRBRERSX1NJWkUsIHNpemVvZihjaGFyKSk7CisgICAgICAgIGNvbnN0IGNoYXIgKmNhcGFiaWxpdGllcyA9ICJEaXNwbGF5WWVzTm8iOworICAgICAgICBjb25zdCBjaGFyICphZ2VudF9wYXRoID0gIi9hbmRyb2lkL2JsdWV0b290aC9yZW1vdGVfZGV2aWNlX2FnZW50IjsKKworICAgICAgICBzdHJsY3B5KGNvbnRleHRfYWRkcmVzcywgY19hZGRyZXNzLCBCVEFERFJfU0laRSk7ICAvLyBmb3IgY2FsbGJhY2sKKyAgICAgICAgYm9vbCByZXQgPSBkYnVzX2Z1bmNfYXJnc19hc3luYyhlbnYsIG5hdC0+Y29ubiwgKGludCl0aW1lb3V0X21zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ3JlYXRlUGFpcmVkRGV2aWNlUmVzdWx0LCAvLyBjYWxsYmFjaworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHRfYWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudExvb3BOYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0X2FkYXB0ZXJfcGF0aChlbnYsIG9iamVjdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19BREFQVEVSX0lGQUNFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDcmVhdGVQYWlyZWREZXZpY2UiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9TVFJJTkcsICZjX2FkZHJlc3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX09CSkVDVF9QQVRILCAmYWdlbnRfcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY2FwYWJpbGl0aWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgY19hZGRyZXNzKTsKKyAgICAgICAgcmV0dXJuIHJldCA/IEpOSV9UUlVFIDogSk5JX0ZBTFNFOworCisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworc3RhdGljIGppbnQgZ2V0RGV2aWNlU2VydmljZUNoYW5uZWxOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBwYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBwYXR0ZXJuLCBqaW50IGF0dHJfaWQpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOworICAgIGpvYmplY3QgZXZlbnRMb29wID0gZW52LT5HZXRPYmplY3RGaWVsZChvYmplY3QsIGZpZWxkX21FdmVudExvb3ApOworICAgIHN0cnVjdCBldmVudF9sb29wX25hdGl2ZV9kYXRhX3QgKmV2ZW50TG9vcE5hdCA9CisgICAgICAgICAgICBnZXRfRXZlbnRMb29wX25hdGl2ZV9kYXRhKGVudiwgZXZlbnRMb29wKTsKKyAgICBpZiAobmF0ICYmIGV2ZW50TG9vcE5hdCkgeworICAgICAgICBjb25zdCBjaGFyICpjX3BhdHRlcm4gPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHBhdHRlcm4sIE5VTEwpOworICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHBhdGgsIE5VTEwpOworICAgICAgICBMT0dWKCIuLi4gcGF0dGVybiA9ICVzIiwgY19wYXR0ZXJuKTsKKyAgICAgICAgTE9HVigiLi4uIGF0dHJfaWQgPSAlI1giLCBhdHRyX2lkKTsKKyAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0KKyAgICAgICAgICAgIGRidXNfZnVuY19hcmdzKGVudiwgbmF0LT5jb25uLCBjX3BhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX0RFVklDRV9JRkFDRSwgIkdldFNlcnZpY2VBdHRyaWJ1dGVWYWx1ZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfU1RSSU5HLCAmY19wYXR0ZXJuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1VJTlQxNiwgJmF0dHJfaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKHBhdHRlcm4sIGNfcGF0dGVybik7CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKHBhdGgsIGNfcGF0aCk7CisgICAgICAgIHJldHVybiByZXBseSA/IGRidXNfcmV0dXJuc19pbnQzMihlbnYsIHJlcGx5KSA6IC0xOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiAtMTsKK30KKworc3RhdGljIGpib29sZWFuIGNhbmNlbERldmljZUNyZWF0aW9uTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGFkZHJlc3MpIHsKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisgICAgamJvb2xlYW4gcmVzdWx0ID0gSk5JX0ZBTFNFOworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKKyAgICBpZiAobmF0KSB7CisgICAgICAgIGNvbnN0IGNoYXIgKmNfYWRkcmVzcyA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMoYWRkcmVzcywgTlVMTCk7CisgICAgICAgIERCdXNFcnJvciBlcnI7CisgICAgICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKKyAgICAgICAgTE9HVigiLi4uIGFkZHJlc3MgPSAlcyIsIGNfYWRkcmVzcyk7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9CisgICAgICAgICAgICBkYnVzX2Z1bmNfYXJnc190aW1lb3V0KGVudiwgbmF0LT5jb25uLCAtMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0X2FkYXB0ZXJfcGF0aChlbnYsIG9iamVjdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQURBUFRFUl9JRkFDRSwgIkNhbmNlbERldmljZUNyZWF0aW9uIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX1NUUklORywgJmNfYWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhhZGRyZXNzLCBjX2FkZHJlc3MpOworICAgICAgICBpZiAoIXJlcGx5KSB7CisgICAgICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgIExPR0UoIkRCdXMgcmVwbHkgaXMgTlVMTCBpbiBmdW5jdGlvbiAlcyIsIF9fRlVOQ1RJT05fXyk7CisgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmVzdWx0ID0gSk5JX1RSVUU7CisgICAgICAgIH0KKyAgICAgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICB9CisjZW5kaWYKKyAgICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitzdGF0aWMgamJvb2xlYW4gcmVtb3ZlRGV2aWNlTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwganN0cmluZyBvYmplY3RfcGF0aCkgeworICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyAgICBqYm9vbGVhbiByZXN1bHQgPSBKTklfRkFMU0U7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOworICAgIGlmIChuYXQpIHsKKyAgICAgICAgY29uc3QgY2hhciAqY19vYmplY3RfcGF0aCA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMob2JqZWN0X3BhdGgsIE5VTEwpOworICAgICAgICBEQnVzRXJyb3IgZXJyOworICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9CisgICAgICAgICAgICBkYnVzX2Z1bmNfYXJnc19lcnJvcihlbnYsIG5hdC0+Y29ubiwgJmVyciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldF9hZGFwdGVyX3BhdGgoZW52LCBvYmplY3QpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19BREFQVEVSX0lGQUNFLCAiUmVtb3ZlRGV2aWNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9PQkpFQ1RfUEFUSCwgJmNfb2JqZWN0X3BhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisgICAgICAgIGlmICghcmVwbHkpIHsKKyAgICAgICAgICAgIGlmIChkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgeworICAgICAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICAgICAgTE9HRSgiREJ1cyByZXBseSBpcyBOVUxMIGluIGZ1bmN0aW9uICVzIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIHJlc3VsdCA9IEpOSV9GQUxTRTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IEpOSV9UUlVFOworICAgICAgICB9CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKG9iamVjdF9wYXRoLCBjX29iamVjdF9wYXRoKTsKKyAgICAgICAgaWYgKHJlcGx5KSBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiByZXN1bHQ7Cit9CisKK3N0YXRpYyBqaW50IGVuYWJsZU5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gYnRfZW5hYmxlKCk7CisjZW5kaWYKKyAgICByZXR1cm4gLTE7Cit9CisKK3N0YXRpYyBqaW50IGRpc2FibGVOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0KSB7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisgICAgcmV0dXJuIGJ0X2Rpc2FibGUoKTsKKyNlbmRpZgorICAgIHJldHVybiAtMTsKK30KKworc3RhdGljIGppbnQgaXNFbmFibGVkTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCkgeworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworICAgIHJldHVybiBidF9pc19lbmFibGVkKCk7CisjZW5kaWYKKyAgICByZXR1cm4gLTE7Cit9CisKK3N0YXRpYyBqYm9vbGVhbiBzZXRQYWlyaW5nQ29uZmlybWF0aW9uTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcywgYm9vbCBjb25maXJtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG5hdGl2ZURhdGEpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOworICAgIGlmIChuYXQpIHsKKyAgICAgICAgREJ1c01lc3NhZ2UgKm1zZyA9IChEQnVzTWVzc2FnZSAqKW5hdGl2ZURhdGE7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseTsKKyAgICAgICAgaWYgKGNvbmZpcm0pIHsKKyAgICAgICAgICAgIHJlcGx5ID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfcmV0dXJuKG1zZyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXBseSA9IGRidXNfbWVzc2FnZV9uZXdfZXJyb3IobXNnLAorICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouRXJyb3IuUmVqZWN0ZWQiLCAiVXNlciByZWplY3RlZCBjb25maXJtYXRpb24iKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghcmVwbHkpIHsKKyAgICAgICAgICAgIExPR0UoIiVzOiBDYW5ub3QgY3JlYXRlIG1lc3NhZ2UgcmVwbHkgdG8gUmVxdWVzdENvbmZpcm1hdGlvbiB0byAiCisgICAgICAgICAgICAgICAgICJELUJ1c1xuIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihtc2cpOworICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICAgICAgfQorCisgICAgICAgIGRidXNfY29ubmVjdGlvbl9zZW5kKG5hdC0+Y29ubiwgcmVwbHksIE5VTEwpOworICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYobXNnKTsKKyAgICAgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICAgICAgcmV0dXJuIEpOSV9UUlVFOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK3N0YXRpYyBqYm9vbGVhbiBzZXRQYXNza2V5TmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwganN0cmluZyBhZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwYXNza2V5LCBpbnQgbmF0aXZlRGF0YSkgeworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7CisgICAgaWYgKG5hdCkgeworICAgICAgICBEQnVzTWVzc2FnZSAqbXNnID0gKERCdXNNZXNzYWdlICopbmF0aXZlRGF0YTsKKyAgICAgICAgREJ1c01lc3NhZ2UgKnJlcGx5ID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfcmV0dXJuKG1zZyk7CisgICAgICAgIGlmICghcmVwbHkpIHsKKyAgICAgICAgICAgIExPR0UoIiVzOiBDYW5ub3QgY3JlYXRlIG1lc3NhZ2UgcmVwbHkgdG8gcmV0dXJuIFBhc3NrZXkgY29kZSB0byAiCisgICAgICAgICAgICAgICAgICJELUJ1c1xuIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihtc2cpOworICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICAgICAgfQorCisgICAgICAgIGRidXNfbWVzc2FnZV9hcHBlbmRfYXJncyhyZXBseSwgREJVU19UWVBFX1VJTlQzMiwgKHVpbnQzMl90ICopJnBhc3NrZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisKKyAgICAgICAgZGJ1c19jb25uZWN0aW9uX3NlbmQobmF0LT5jb25uLCByZXBseSwgTlVMTCk7CisgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihtc2cpOworICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOworICAgICAgICByZXR1cm4gSk5JX1RSVUU7CisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworc3RhdGljIGpib29sZWFuIHNldFBpbk5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsIGpzdHJpbmcgYWRkcmVzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIHBpbiwgaW50IG5hdGl2ZURhdGEpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOworICAgIGlmIChuYXQpIHsKKyAgICAgICAgREJ1c01lc3NhZ2UgKm1zZyA9IChEQnVzTWVzc2FnZSAqKW5hdGl2ZURhdGE7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9IGRidXNfbWVzc2FnZV9uZXdfbWV0aG9kX3JldHVybihtc2cpOworICAgICAgICBpZiAoIXJlcGx5KSB7CisgICAgICAgICAgICBMT0dFKCIlczogQ2Fubm90IGNyZWF0ZSBtZXNzYWdlIHJlcGx5IHRvIHJldHVybiBQSU4gY29kZSB0byAiCisgICAgICAgICAgICAgICAgICJELUJ1c1xuIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihtc2cpOworICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICAgICAgfQorCisgICAgICAgIGNvbnN0IGNoYXIgKmNfcGluID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhwaW4sIE5VTEwpOworCisgICAgICAgIGRidXNfbWVzc2FnZV9hcHBlbmRfYXJncyhyZXBseSwgREJVU19UWVBFX1NUUklORywgJmNfcGluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJVU19UWVBFX0lOVkFMSUQpOworCisgICAgICAgIGRidXNfY29ubmVjdGlvbl9zZW5kKG5hdC0+Y29ubiwgcmVwbHksIE5VTEwpOworICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYobXNnKTsKKyAgICAgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMocGluLCBjX3Bpbik7CisgICAgICAgIHJldHVybiBKTklfVFJVRTsKKyAgICB9CisjZW5kaWYKKyAgICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitzdGF0aWMgamJvb2xlYW4gY2FuY2VsUGFpcmluZ1VzZXJJbnB1dE5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYWRkcmVzcywgaW50IG5hdGl2ZURhdGEpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOworICAgIGlmIChuYXQpIHsKKyAgICAgICAgREJ1c01lc3NhZ2UgKm1zZyA9IChEQnVzTWVzc2FnZSAqKW5hdGl2ZURhdGE7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseSA9IGRidXNfbWVzc2FnZV9uZXdfZXJyb3IobXNnLAorICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouRXJyb3IuQ2FuY2VsZWQiLCAiUGFpcmluZyBVc2VyIElucHV0IHdhcyBjYW5jZWxlZCIpOworICAgICAgICBpZiAoIXJlcGx5KSB7CisgICAgICAgICAgICBMT0dFKCIlczogQ2Fubm90IGNyZWF0ZSBtZXNzYWdlIHJlcGx5IHRvIHJldHVybiBjYW5jZWxVc2VySW5wdXQgdG8iCisgICAgICAgICAgICAgICAgICJELUJVU1xuIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihtc2cpOworICAgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICAgICAgfQorCisgICAgICAgIGRidXNfY29ubmVjdGlvbl9zZW5kKG5hdC0+Y29ubiwgcmVwbHksIE5VTEwpOworICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYobXNnKTsKKyAgICAgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKyAgICAgICAgcmV0dXJuIEpOSV9UUlVFOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK3N0YXRpYyBqb2JqZWN0QXJyYXkgZ2V0RGV2aWNlUHJvcGVydGllc05hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBwYXRoKQoreworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7CisgICAgaWYgKG5hdCkgeworICAgICAgICBEQnVzTWVzc2FnZSAqbXNnLCAqcmVwbHk7CisgICAgICAgIERCdXNFcnJvciBlcnI7CisgICAgICAgIGRidXNfZXJyb3JfaW5pdCgmZXJyKTsKKworICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHBhdGgsIE5VTEwpOworICAgICAgICByZXBseSA9IGRidXNfZnVuY19hcmdzX3RpbWVvdXQoZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXQtPmNvbm4sIC0xLCBjX3BhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfREVWSUNFX0lGQUNFLCAiR2V0UHJvcGVydGllcyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMocGF0aCwgY19wYXRoKTsKKworICAgICAgICBpZiAoIXJlcGx5KSB7CisgICAgICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgIExPR0UoIkRCdXMgcmVwbHkgaXMgTlVMTCBpbiBmdW5jdGlvbiAlcyIsIF9fRlVOQ1RJT05fXyk7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgfQorICAgICAgICBlbnYtPlB1c2hMb2NhbEZyYW1lKFBST1BFUlRJRVNfTlJFRlMpOworCisgICAgICAgIERCdXNNZXNzYWdlSXRlciBpdGVyOworICAgICAgICBqb2JqZWN0QXJyYXkgc3RyX2FycmF5ID0gTlVMTDsKKyAgICAgICAgaWYgKGRidXNfbWVzc2FnZV9pdGVyX2luaXQocmVwbHksICZpdGVyKSkKKyAgICAgICAgICAgc3RyX2FycmF5ID0gIHBhcnNlX3JlbW90ZV9kZXZpY2VfcHJvcGVydGllcyhlbnYsICZpdGVyKTsKKyAgICAgICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsKKworICAgICAgICBlbnYtPlBvcExvY2FsRnJhbWUoTlVMTCk7CisKKyAgICAgICAgcmV0dXJuIHN0cl9hcnJheTsKKyAgICB9CisjZW5kaWYKKyAgICByZXR1cm4gTlVMTDsKK30KKworc3RhdGljIGpvYmplY3RBcnJheSBnZXRBZGFwdGVyUHJvcGVydGllc05hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyAgICBuYXRpdmVfZGF0YV90ICpuYXQgPSBnZXRfbmF0aXZlX2RhdGEoZW52LCBvYmplY3QpOworICAgIGlmIChuYXQpIHsKKyAgICAgICAgREJ1c01lc3NhZ2UgKm1zZywgKnJlcGx5OworICAgICAgICBEQnVzRXJyb3IgZXJyOworICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisKKyAgICAgICAgcmVwbHkgPSBkYnVzX2Z1bmNfYXJnc190aW1lb3V0KGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0LT5jb25uLCAtMSwgZ2V0X2FkYXB0ZXJfcGF0aChlbnYsIG9iamVjdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQURBUFRFUl9JRkFDRSwgIkdldFByb3BlcnRpZXMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEQlVTX1RZUEVfSU5WQUxJRCk7CisgICAgICAgIGlmICghcmVwbHkpIHsKKyAgICAgICAgICAgIGlmIChkYnVzX2Vycm9yX2lzX3NldCgmZXJyKSkgeworICAgICAgICAgICAgICAgIExPR19BTkRfRlJFRV9EQlVTX0VSUk9SKCZlcnIpOworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICAgICAgTE9HRSgiREJ1cyByZXBseSBpcyBOVUxMIGluIGZ1bmN0aW9uICVzIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICB9CisgICAgICAgIGVudi0+UHVzaExvY2FsRnJhbWUoUFJPUEVSVElFU19OUkVGUyk7CisKKyAgICAgICAgREJ1c01lc3NhZ2VJdGVyIGl0ZXI7CisgICAgICAgIGpvYmplY3RBcnJheSBzdHJfYXJyYXkgPSBOVUxMOworICAgICAgICBpZiAoZGJ1c19tZXNzYWdlX2l0ZXJfaW5pdChyZXBseSwgJml0ZXIpKQorICAgICAgICAgICAgc3RyX2FycmF5ID0gcGFyc2VfYWRhcHRlcl9wcm9wZXJ0aWVzKGVudiwgJml0ZXIpOworICAgICAgICBkYnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOworCisgICAgICAgIGVudi0+UG9wTG9jYWxGcmFtZShOVUxMKTsKKyAgICAgICAgcmV0dXJuIHN0cl9hcnJheTsKKyAgICB9CisjZW5kaWYKKyAgICByZXR1cm4gTlVMTDsKK30KKworc3RhdGljIGpib29sZWFuIHNldEFkYXB0ZXJQcm9wZXJ0eU5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsIGpzdHJpbmcga2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICp2YWx1ZSwgamludCB0eXBlKSB7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKKyAgICBpZiAobmF0KSB7CisgICAgICAgIERCdXNNZXNzYWdlICpyZXBseSwgKm1zZzsKKyAgICAgICAgREJ1c01lc3NhZ2VJdGVyIGl0ZXI7CisgICAgICAgIERCdXNFcnJvciBlcnI7CisgICAgICAgIGNvbnN0IGNoYXIgKmNfa2V5ID0gZW52LT5HZXRTdHJpbmdVVEZDaGFycyhrZXksIE5VTEwpOworICAgICAgICBkYnVzX2Vycm9yX2luaXQoJmVycik7CisKKyAgICAgICAgbXNnID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2RfY2FsbChCTFVFWl9EQlVTX0JBU0VfSUZDLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldF9hZGFwdGVyX3BhdGgoZW52LCBvYmplY3QpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfQURBUFRFUl9JRkFDRSwgIlNldFByb3BlcnR5Iik7CisgICAgICAgIGlmICghbXNnKSB7CisgICAgICAgICAgICBMT0dFKCIlczogQ2FuJ3QgYWxsb2NhdGUgbmV3IG1ldGhvZCBjYWxsIGZvciBHZXRQcm9wZXJ0aWVzISIsCisgICAgICAgICAgICAgICAgICBfX0ZVTkNUSU9OX18pOworICAgICAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoa2V5LCBjX2tleSk7CisgICAgICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOworICAgICAgICB9CisKKyAgICAgICAgZGJ1c19tZXNzYWdlX2FwcGVuZF9hcmdzKG1zZywgREJVU19UWVBFX1NUUklORywgJmNfa2V5LCBEQlVTX1RZUEVfSU5WQUxJRCk7CisgICAgICAgIGRidXNfbWVzc2FnZV9pdGVyX2luaXRfYXBwZW5kKG1zZywgJml0ZXIpOworICAgICAgICBhcHBlbmRfdmFyaWFudCgmaXRlciwgdHlwZSwgdmFsdWUpOworCisgICAgICAgIHJlcGx5ID0gZGJ1c19jb25uZWN0aW9uX3NlbmRfd2l0aF9yZXBseV9hbmRfYmxvY2sobmF0LT5jb25uLCBtc2csIC0xLCAmZXJyKTsKKyAgICAgICAgZGJ1c19tZXNzYWdlX3VucmVmKG1zZyk7CisKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMoa2V5LCBjX2tleSk7CisKK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Bqb2JqZWN0IG9iamVjdCwganN0cmluZyBrZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgdmFsdWUpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIHJldHVybiBzZXRBZGFwdGVyUHJvcGVydHlOYXRpdmUoZW52LCBvYmplY3QsIGtleSwgKHZvaWQgKikmdmFsdWUsIERCVVNfVFlQRV9VSU5UMzIpOworI2Vsc2UKKyAgICByZXR1cm4gSk5JX0ZBTFNFOworI2VuZGlmCit9CisKK3N0YXRpYyBqYm9vbGVhbiBzZXRBZGFwdGVyUHJvcGVydHlCb29sZWFuTmF0aXZlKEpOSUVudiAqZW52LCBqb2JqZWN0IG9iamVjdCwganN0cmluZyBrZXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgdmFsdWUpIHsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIHJldHVybiBzZXRBZGFwdGVyUHJvcGVydHlOYXRpdmUoZW52LCBvYmplY3QsIGtleSwgKHZvaWQgKikmdmFsdWUsIERCVVNfVFlQRV9CT09MRUFOKTsKKyNlbHNlCisgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyNlbmRpZgorfQorCitzdGF0aWMgamJvb2xlYW4gc2V0RGV2aWNlUHJvcGVydHlOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LCBqc3RyaW5nIHBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcga2V5LCB2b2lkICp2YWx1ZSwgamludCB0eXBlKSB7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICBMT0dWKF9fRlVOQ1RJT05fXyk7CisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKKyAgICBpZiAobmF0KSB7CisgICAgICA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ZhbHVlKTsKKworICAgICAgICByZXBseSA9IGRidXNfY29ubmVjdGlvbl9zZW5kX3dpdGhfcmVwbHlfYW5kX2Jsb2NrKG5hdC0+Y29ubiwgbXNnLCAtMSwgJmVycik7CisgICAgICAgIGRidXNfbWVzc2FnZV91bnJlZihtc2cpOworCisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ1VURkNoYXJzKGtleSwgY19rZXkpOworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhwYXRoLCBjX3BhdGgpOworICAgICAgICBpZiAoIXJlcGx5KSB7CisgICAgICAgICAgICBpZiAoZGJ1c19lcnJvcl9pc19zZXQoJmVycikpIHsKKyAgICAgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUigmZXJyKTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgTE9HRSgiREJ1cyByZXBseSBpcyBOVUxMIGluIGZ1bmN0aW9uICVzIiwgX19GVU5DVElPTl9fKTsKKyAgICAgICAgICAgIHJldHVybiBKTklfRkFMU0U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIEpOSV9UUlVFOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK3N0YXRpYyBqYm9vbGVhbiBzZXREZXZpY2VQcm9wZXJ0eUJvb2xlYW5OYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIHBhdGgsIGpzdHJpbmcga2V5LCBqaW50IHZhbHVlKSB7CisjaWZkZWYgSEFWRV9CTFVFVE9PVEgKKyAgICByZXR1cm4gc2V0RGV2aWNlUHJvcGVydHlOYXRpdmUoZW52LCBvYmplY3QsIHBhdGgsIGtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZ2YWx1ZSwgREJVU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gIH0KKworICAgICAgICAvLyByZWFkIGV2ZW50IHBheWxvYWQKKyAgICAgICAgbG9nZ2VyX2VudHJ5KiBlbnRyeSA9IChsb2dnZXJfZW50cnkqKSBidWY7CisgICAgICAgIGlmIChlbnRyeS0+bGVuID4gTE9HR0VSX0VOVFJZX01BWF9QQVlMT0FEKSB7CisgICAgICAgICAgICBqbmlUaHJvd0V4Y2VwdGlvbihlbnYsCisgICAgICAgICAgICAgICAgICAgICJqYXZhL2xhbmcvSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIiwKKyAgICAgICAgICAgICAgICAgICAgIlRvbyBtdWNoIGRhdGEgZm9yIGV2ZW50IHBheWxvYWQuIENvcnJ1cHQgZmlsZT8iKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgbGVuID0gcmVhZChmZCwgYnVmICsgc2l6ZW9mKGxvZ2dlcl9lbnRyeSksIGVudHJ5LT5sZW4pOworICAgICAgICBpZiAobGVuID09IDApIHsKKyAgICAgICAgICAgIGJyZWFrOyAvLyBlbmQgb2YgZmlsZQorICAgICAgICB9IGVsc2UgaWYgKGxlbiA8IDApIHsKKyAgICAgICAgICAgIGpuaVRocm93SU9FeGNlcHRpb24oZW52LCBlcnJubyk7CisgICAgICAgIH0gZWxzZSBpZiAoKHNpemVfdCkgbGVuIDwgZW50cnktPmxlbikgeworICAgICAgICAgICAgam5pVGhyb3dFeGNlcHRpb24oZW52LCAiamF2YS9pby9JT0V4Y2VwdGlvbiIsICJFdmVudCBwYXlsb2FkIHRvbyBzaG9ydCIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICAvLyBjcmVhdGUgRXZlbnRMb2ckRXZlbnQgYW5kIGFkZCBpdCB0byB0aGUgY29sbGVjdGlvbgorICAgICAgICBpbnQgYnVmZmVyX3NpemUgPSBzaXplb2YobG9nZ2VyX2VudHJ5KSArIGVudHJ5LT5sZW47CisgICAgICAgIGpieXRlQXJyYXkgY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gIFN1cmZhY2UqIGNvbnN0IHAgPSAoU3VyZmFjZSopZW52LT5HZXRJbnRGaWVsZChjbGF6eiwgc28uc3VyZmFjZSk7Ci0gICAgcmV0dXJuIHNwPFN1cmZhY2U+KHApOworICAgIHNwPFN1cmZhY2U+IHJlc3VsdCgoU3VyZmFjZSopZW52LT5HZXRJbnRGaWVsZChjbGF6eiwgc28uc3VyZmFjZSkpOworICAgIGlmIChyZXN1bHQgPT0gMCkgeworICAgICAgICAvKgorICAgICAgICAgKiBpZiB0aGlzIG1ldGhvZCBpcyBjYWxsZWQgZnJvbSB0aGUgV2luZG93TWFuYWdlcidzIHByb2Nlc3MsIGl0IG1lYW5zCisgICAgICAgICAqIHRoZSBjbGllbnQgaXMgaXMgbm90IHJlbW90ZSwgYW5kIHRoZXJlZm9yZSBpcyBhbGxvd2VkIHRvIGhhdmUKKyAgICAgICAgICogYSBTdXJmYWNlIChkYXRhKSwgc28gd2UgY3JlYXRlIGl0IGhlcmUuIAorICAgICAgICAgKiBJZiB3ZSBkb24ndCBoYXZlIGEgU3VyZmFjZUNvbnRyb2wsIGl0IG1lYW5zIHdlJ3JlIGluIGEgZGlmZmVyZW50CisgICAgICAgICAqIHByb2Nlc3MuCisgICAgICAgICAqLworICAgICAgICAKKyAgICAgICAgU3VyZmFjZUNvbnRyb2wqIGNvbnN0IGNvbnRyb2wgPSAKKyAgICAgICAgICAgIChTdXJmYWNlQ29udHJvbCopZW52LT5HZXRJbnRGaWVsZChjbGF6eiwgc28uc3VyZmFjZUNvbnRyb2wpOworICAgICAgICBpZiAoY29udHJvbCkgeworICAgICAgICAgICAgcmVzdWx0ID0gY29udHJvbC0+Z2V0U3VyZmFjZSgpOworICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSAwKSB7CisgICAgICAgICAgICAgICAgcmVzdWx0LT5pbmNTdHJvbmcoY2xhenopOworICAgICAgICAgICAgICAgIGVudi0+U2V0SW50RmllbGQoY2xhenosIHNvLnN1cmZhY2UsIChpbnQpc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UgbGF5b3V0PSJAbGF5b3V0L2NvbnRhY3RfaGVhZGVyX25hbWUiLz4KKworICAgICAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC9zdGF0dXMiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iZmlsbF9wYXJlbnQiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IjBkaXAiCisgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93ZWlnaHQ9IjEiCisgICAgICAgICAgICBhbmRyb2lkOnRleHRBcHBlYXJhbmNlPSI/YW5kcm9pZDphdHRyL3RleHRBcHBlYXJhbmNlU21hbGwiCisgICAgICAgICAgICBhbmRyb2lkOm1heExpbmVzPSIyIgorICAgICAgICAgICAgYW5kcm9pZDplbGxpcHNpemU9ImVuZCIvPgorICAgICAgICAgICAgICAgIAorICAgIDwvTGluZWFyTGF5b3V0PgorCisgICAgPEltYWdlVmlldworICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL3ByZXNlbmNlIgorICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgYW5kcm9pZDpwYWRkaW5nTGVmdD0iM2RpcCIKKyAgICAgICAgYW5kcm9pZDpwYWRkaW5nUmlnaHQ9IjZkaXAiLz4KKyAgICAgICAgCisgICAgPENoZWNrQm94CisgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvc3RhciIKKyAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKKyAgICAgICAgYW5kcm9pZDpsYXlvdXRfaGVpZ2h0PSJ3cmFwX2NvbnRlbnQiCisgICAgICAgIGFuZHJvaWQ6dmlzaWJpbGl0eT0iZ29uZSIKKyAgICAgICAgc3R5bGU9Ij9hbmRyb2lkOmF0dHIvc3RhclN0eWxlIiAvPgorCis8L0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bmFsIElucHV0U3RyZWFtIGlzID0gcmVzLm9wZW5SYXdSZXNvdXJjZShpZCwgdmFsdWUpOworICAgICAgICAgICAgaXMgPSByZXMub3BlblJhd1Jlc291cmNlKGlkLCB2YWx1ZSk7CiAKICAgICAgICAgICAgIGJtID0gZGVjb2RlUmVzb3VyY2VTdHJlYW0ocmVzLCB2YWx1ZSwgaXMsIG51bGwsIG9wdHMpOwotICAgICAgICAgICAgaXMuY2xvc2UoKTsKLSAgICAgICAgfSBjYXRjaCAoamF2YS5pby5JT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAvKiAgZG8gbm90aGluZy4KICAgICAgICAgICAgICAgICBJZiB0aGUgZXhjZXB0aW9uIGhhcHBlbmVkIG9uIG9wZW4sIGJtIHdpbGwgYmUgbnVsbC4KICAgICAgICAgICAgICAgICBJZiBpdCBoYXBwZW5lZCBvbiBjbG9zZSwgYm0gaXMgc3RpbGwgdmFsaWQuCiAgICAgICAgICAgICAqLworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAoaXMgIT0gbnVsbCkgaXMuY2xvc2UoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBJZ25vcmUKKyAgICAgICAgICAgIH0KICAgICAgICAgfQorCiAgICAgICAgIHJldHVybiBibTsKICAgICB9CiAKQEAgLTQ1MSw2ICs0NTksMTAgQEAKICAgICAgICAgICAgIGJtID0gbmF0aXZlRGVjb2RlU3RyZWFtKGlzLCB0ZW1wU3RvcmFnZSwgb3V0UGFkZGluZywgb3B0cyk7CiAgICAgICAgIH0KIAorICAgICAgICByZXR1cm4gZmluaXNoRGVjb2RlKGJtLCBvdXRQYWRkaW5nLCBvcHRzKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBC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bGU7CiAKQEAgLTEwNSw2ICsxMDcsOTIgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBodWUgY29tcG9uZW50IG9mIGEgY29sb3IgaW50LgorICAgICAqIAorICAgICAqIEByZXR1cm4gQSB2YWx1ZSBiZXR3ZWVuIDAuMGYgYW5kIDEuMGYKKyAgICAgKiAKKyAgICAgKiBAaGlkZSBQZW5kaW5nIEFQSSBjb3VuY2lsCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmbG9hdCBodWUoaW50IGNvbG9yKSB7CisgICAgICAgIGludCByID0gKGNvbG9yID4+IDE2KSAmIDB4RkY7CisgICAgICAgIGludCBnID0gKGNvbG9yID4+IDgpICYgMHhGRjsKKyAgICAgICAgaW50IGIgPSBjb2xvciAmIDB4RkY7CisKKyAgICAgICAgaW50IFYgPSBNYXRoLm1heChiLCBNYXRoLm1heChyLCBnKSk7CisgICAgICAgIGludCB0ZW1wID0gTWF0aC5taW4oYiwgTWF0aC5taW4ociwgZykpOworCisgICAgICAgIGZsb2F0IEg7CisKKyAgICAgICAgaWYgKFYgPT0gdGVtcCkgeworICAgICAgICAgICAgSCA9IDA7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmaW5hbCBmbG9hdCB2dGVtcCA9IChmbG9hdCkgKFYgLSB0ZW1wKTsKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0IGNyID0gKFYgLSByKSAvIHZ0ZW1wOworICAgICAgICAgICAgZmluYWwgZmxvYXQgY2cgPSAoViAtIGcpIC8gdnRlbXA7CisgICAgICAgICAgICBmaW5hbCBmbG9hdCBjYiA9IChWIC0gYikgLyB2dGVtcDsKKworICAgICAgICAgICAgaWYgKHIgPT0gVikgeworICAgICAgICAgICAgICAgIEggPSBjYiAtIGNnOworICAgICAgICAgICAgfSBlbHNlIGlmIChnID09IFYpIHsKKyAgICAgICAgICAgICAgICBIID0gMiArIGNyIC0gY2I7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIEggPSA0ICsgY2cgLSBjcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgSCAvPSA2LmY7CisgICAgICAgICAgICBpZiAoSCA8IDApIHsKKyAgICAgICAgICAgICAgICBIKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gSDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBzYXR1cmF0aW9uIGNvbXBvbmVudCBvZiBhIGNvbG9yIGludC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIEEgdmFsdWUgYmV0d2VlbiAwLjBmIGFuZCAxLjBmCisgICAgICogCisgICAgICogQGhpZGUgUGVuZGluZyBBUEkgY291bmNpbAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgc2F0dXJhdGlvbihpbnQgY29sb3IpIHsKKyAgICAgICAgaW50IHIgPSAoY29sb3IgPj4gMTYpICYgMHhGRjsKKyAgICAgICAgaW50IGcgPSAoY29sb3IgPj4gOCkgJiAweEZGOworICAgICAgICBpbnQgYiA9IGNvbG9yICYgMHhGRjsKKworCisgICAgICAgIGludCBWID0gTWF0aC5tYXgoYiwgTWF0aC5tYXgociwgZykpOworICAgICAgICBpbnQgdGVtcCA9IE1hdGgubWluKGIsIE1hdGgubWluKHIsIGcpKTsKKworICAgICAgICBmbG9hdCBTOworCisgICAgICAgIGlmIChWID09IHRlbXApIHsKKyAgICAgICAgICAgIFMgPSAwOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgUyA9IChWIC0gdGVtcCkgLyAoZmxvYXQpIFY7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gUzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBicmlnaHRuZXNzIGNvbXBvbmVudCBvZiBhIGNvbG9yIGludC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIEEgdmFsdWUgYmV0d2Vlbi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RoVXRpbHMuY29uc3RyYWluKGIsIDAuMGYsIDEuMGYpOworICAgICAgICAKKyAgICAgICAgZmxvYXQgcmVkID0gMC4wZjsKKyAgICAgICAgZmxvYXQgZ3JlZW4gPSAwLjBmOworICAgICAgICBmbG9hdCBibHVlID0gMC4wZjsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIGZsb2F0IGhmID0gKGggLSAoaW50KSBoKSAqIDYuMGY7CisgICAgICAgIGZpbmFsIGludCBpaGYgPSAoaW50KSBoZjsKKyAgICAgICAgZmluYWwgZmxvYXQgZiA9IGhmIC0gaWhmOworICAgICAgICBmaW5hbCBmbG9hdCBwdiA9IGIgKiAoMS4wZiAtIHMpOworICAgICAgICBmaW5hbCBmbG9hdCBxdiA9IGIgKiAoMS4wZiAtIHMgKiBmKTsKKyAgICAgICAgZmluYWwgZmxvYXQgdHYgPSBiICogKDEuMGYgLSBzICogKDEuMGYgLSBmKSk7CisKKyAgICAgICAgc3dpdGNoIChpaGYpIHsKKyAgICAgICAgICAgIGNhc2UgMDogICAgICAgICAvLyBSZWQgaXMgdGhlIGRvbWluYW50IGNvbG9yCisgICAgICAgICAgICAgICAgcmVkID0gYjsKKyAgICAgICAgICAgICAgICBncmVlbiA9IHR2OworICAgICAgICAgICAgICAgIGJsdWUgPSBwdjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMTogICAgICAgICAvLyBHcmVlbiBpcyB0aGUgZG9taW5hbnQgY29sb3IKKyAgICAgICAgICAgICAgICByZWQgPSBxdjsKKyAgICAgICAgICAgICAgICBncmVlbiA9IGI7CisgICAgICAgICAgICAgICAgYmx1ZSA9IHB2OworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgIHJlZCA9IHB2OworICAgICAgICAgICAgICAgIGdyZWVuID0gYjsKKyAgICAgICAgICAgICAgICBibHVlID0gdHY7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDM6ICAgICAgICAgLy8gQmx1ZSBpcyB0aGUgZG9taW5hbnQgY29sb3IKKyAgICAgICAgICAgICAgICByZWQgPSBwdjsKKyAgICAgICAgICAgICAgICBncmVlbiA9IHF2OworICAgICAgICAgICAgICAgIGJsdWUgPSBiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgIHJlZCA9IHR2OworICAgICAgICAgICAgICAgIGdyZWVuID0gcHY7CisgICAgICAgICAgICAgICAgYmx1ZSA9IGI7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDU6ICAgICAgICAgLy8gUmVkIGlzIHRoZSBkb21pbmFudCBjb2xvcgorICAgICAgICAgICAgICAgIHJlZCA9IGI7CisgICAgICAgICAgICAgICAgZ3JlZW4gPSBwdjsKKyAgICAgICAgICAgICAgICBibHVlID0gcXY7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gMHhGRjAwMDAwMCB8ICgoKGludCkgKHJlZCAqIDI1NS4wZikpIDw8IDE2KSB8CisgICAgICAgICAgICAgICAgKCgoaW50KSAoZ3JlZW4gKiAyNTUuMGYpKSA8PCA4KSB8ICgoaW50KSAoYmx1ZSAqIDI1NS4wZikpOworICAgIH0KKworICAgIC8qKgogICAgICAqIENvbnZlcnQgUkdCIGNvbXBvbmVudHMgdG8gSFNWLgogICAgICAqICAgICBoc3ZbMF0gaXMgSHVlIFswIC4uIDM2MCkKICAgICAgKiAgICAgaHN2WzFdIGlzIFNhdHVyYXRpb24gWzAuLi4xXQpAQCAtMTkzLDI1ICszNjIsMjQgQEAKICAgICAgICAgcmV0dXJuIG5hdGl2ZUhTVlRvQ29sb3IoYWxwaGEsIGhzdik7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlUkdCVG9IU1YoaW50IHJlZCwg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UubUVsZW1lbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgc2l6ZSA9IG1UeXBlLm1FbGVtZW50Lm1TaXplOworICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IG1UeXBlLm1WYWx1ZXMubGVuZ3RoOyBjdCsrKSB7CisgICAgICAgICAgICAgICAgaWYobVR5cGUubVZhbHVlc1tjdF0gIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBzaXplICo9IG1UeXBlLm1WYWx1ZXNbY3RdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKChkLmxlbmd0aCAqIDQpIDwgc2l6ZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkFycmF5IHRvbyBzbWFsbCBmb3IgYWxsb2NhdGlvbiB0eXBlLiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9nLmUoInJzIiwgIkFsbG9jIGRhdGEgc2l6ZT0iICsgc2l6ZSk7CisgICAgICAgICAgICBtUlMubkFsbG9jYXRpb25EYXRhKG1JRCwgZCwgc2l6ZSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbVJTLm5BbGxvY2F0aW9uRGF0YShtSUQsIGQsIGQubGVuZ3RoICogNCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZGF0YShmbG9hdFtdIGQpIHsKKyAgICAgICAgaW50IHNpemU7CisgICAgICAgIGlmKG1UeXBlICE9IG51bGwgJiYgbVR5cGUubUVsZW1lbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgc2l6ZSA9IG1UeXBlLm1FbGVtZW50Lm1TaXplOworICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IG1UeXBlLm1WYWx1ZXMubGVuZ3RoOyBjdCsrKSB7CisgICAgICAgICAgICAgICAgaWYobVR5cGUubVZhbHVlc1tjdF0gIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBzaXplICo9IG1UeXBlLm1WYWx1ZXNbY3RdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKChkLmxlbmd0aCAqIDQpIDwgc2l6ZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkFycmF5IHRvbyBzbWFsbCBmb3IgYWxsb2NhdGlvbiB0eXBlLiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9nLmUoInJzIiwgIkFsbG9jIGRhdGEgc2l6ZT0iICsgc2l6ZSk7CisgICAgICAgICAgICBtUlMubkFsbG9jYXRpb25EYXRhKG1JRCwgZCwgc2l6ZSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbVJTLm5BbGxvY2F0aW9uRGF0YShtSUQsIGQsIGQubGVuZ3RoICogNCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3ViRGF0YTFEKGludCBvZmYsIGludCBjb3VudCwgaW50W10gZCkgeworICAgICAgICBtUlMubkFsbG9jYXRpb25TdWJEYXRhMUQobUlELCBvZmYsIGNvdW50LCBkLCBjb3VudCAqIDQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN1YkRhdGExRChpbnQgb2ZmLCBpbnQgY291bnQsIGZsb2F0W10gZCkgeworICAgICAgICBtUlMubkFsbG9jYXRpb25TdWJEYXRhMUQobUlELCBvZmYsIGNvdW50LCBkLCBkLmxlbmd0aCAqIDQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN1YkRhdGEyRChpbnQgeG9mZiwgaW50IHlvZmYsIGludCB3LCBpbnQgaCwgaW50W10gZCkgeworICAgICAgICBtUlMubkFsbG9jYXRpb25TdWJEYXRhMkQobUlELCB4b2ZmLCB5b2ZmLCB3LCBoLCBkLCBkLmxlbmd0aCAqIDQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN1YkRhdGEyRChpbnQgeG9mZiwgaW50IHlvZmYsIGludCB3LCBpbnQgaCwgZmxvYXRbXSBkKSB7CisgICAgICAgIG1SUy5uQWxsb2NhdGlvblN1YkRhdGEyRChtSUQsIHhvZmYsIHlvZmYsIHcsIGgsIGQsIGQubGVuZ3RoICogNCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcmVhZERhdGEoaW50W10gZCkgeworICAgICAgICBtUlMubkFsbG9jYXRpb25SZWFkKG1JRCwgZCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcmVhZERhdGEoZmxvYXRbXSBkKSB7CisgICAgICAgIG1SUy5uQWxsb2NhdGlvblJlYWQobUlELCBkKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkYXRhKE9iamVjdCBvKSB7CisgICAgICAgIG1SUy5uQWxsb2NhdGlvblN1YkRhdGFGcm9tT2JqZWN0KG1JRCwgbVR5cGUsIDAsIG8pOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN1YkRhdGEoaW50IG9mZnNldCwgT2JqZWN0IG8pIHsKKyAgICAgICAgbVJTLm5BbGxvY2F0aW9uU3ViRGF0YUZyb21PYmplY3QobUlELCBtVHlwZSwgb2Zmc2V0LCBvKTsKKyAgICB9CisKKyAgICBwdWJsaWMgY2xhc3MgQWRhcHRlcjFEIGV4dGVuZHMgQmFzZU9iaiB7CisgICAgICAgIEFkYXB0ZXIxRChpbnQgaWQsIFJlbmRlclNjcmlwdCBycykgeworICAgICAgICAgICAgc3VwZXIocnMpOworICAgICAgICAgICAgbUlEID0gaWQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRDb25zdHJhaW50KERpbWVuc2lvbiBkaW0sIGludCB2YWx1ZSkgeworICAgICAgICAgICAgbVJTLm5BZGFwdGVyMURTZXRDb25zdHJhaW50KG1JRCwgZGltLm1JRCwgdmFsdWUpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgZGF0YShpbnRbXSBkKSB7CisgICAgICAgICAgICBtUlMubkFkYXB0ZXIxRERhdGEobUlELCBkKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGRhdGEoZmxvYXRbXSBkKSB7CisgICAgICAgICAgICBtUlMubkFkYXB0ZXIxRERhdGEobUlELCBkKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHN1YkRhdGEoaW50IG9mZiwgaW50IGNvdW50LCBpbnRbXSBkKSB7CisgICAgICAgICAgICBtUlMubkFkYXB0ZXIxRFN1YkRhdGEobUlELCBvZmYsIGNvdW50LCBkKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHN1YkRhdGEoaW50IG9mZiwgaW50IGNvdW50LCBmbG9hdFtdIGQpIHsKKyAgICAgICAgICAgIG1SUy5uQWRhcHRlcjFEU3ViRGF0YShtSUQsIG9mZiwgY291bnQsIGQpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIEFkYXB0ZXIxRCBjcmVhdGVBZGFwdGVyMUQoKSB7CisgICAgICAgIGludCBpZCA9IG1SUy5uQWRhcHRlcjFEQ3JlYXRlKCk7CisgICAgICAgIGlmIChpZCAhPSAwKSB7CisgICAgICAgICAgICBtUlMubkFkYXB0ZXIxREJpbmRBbGxvY2F0aW9uKGlkLCBtSUQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXcgQWRhcHRlcjFEKGlkLCBtUlMpOworICAgIH0KKworCisgICAgcHVibGljIGNsYXNzIEFkYXB0ZXIyRCBleHRlbmRzIEJhc2VPYmogeworICAgICAgICBBZGFwdGVyMkQoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgICAgIHN1cGVyKHJzKTsKKyAgICAgICAgICAgIG1JRCA9IGlkOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0Q29uc3RyYWludChEaW1lbnNpb24gZGltLCBpbnQgdmFsdWUpIHsKKyAgICAgICAgICAg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YXBPcHRpb25zID0gbmV3IEJpdG1hcEZhY3RvcnkuT3B0aW9ucygpOworICAgIHN0YXRpYyB7CisgICAgICAgIG1CaXRtYXBPcHRpb25zLmluU2NhbGVkID0gZmFsc2U7CisgICAgfQorCisgICAgc3RhdGljIHB1YmxpYyBBbGxvY2F0aW9uIGNyZWF0ZVR5cGVkKFJlbmRlclNjcmlwdCBycywgVHlwZSB0eXBlKQorICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKworICAgICAgICBpZih0eXBlLm1JRCA9PSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJCYWQgVHlwZSIpOworICAgICAgICB9CisgICAgICAgIGludCBpZCA9IHJzLm5BbGxvY2F0aW9uQ3JlYXRlVHlwZWQodHlwZS5tSUQpOworICAgICAgICByZXR1cm4gbmV3IEFsbG9jYXRpb24oaWQsIHJzLCB0eXBlKTsKKyAgICB9CisKKyAgICBzdGF0aWMgcHVibGljIEFsbG9jYXRpb24gY3JlYXRlU2l6ZWQoUmVuZGVyU2NyaXB0IHJzLCBFbGVtZW50IGUsIGludCBjb3VudCkKKyAgICAgICAgdGhyb3dzIElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiB7CisKKyAgICAgICAgaW50IGlkID0gcnMubkFsbG9jYXRpb25DcmVhdGVTaXplZChlLm1JRCwgY291bnQpOworICAgICAgICBpZihpZCA9PSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJCYWQgZWxlbWVudC4iKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbmV3IEFsbG9jYXRpb24oaWQsIHJzLCBudWxsKTsKKyAgICB9CisKKyAgICBzdGF0aWMgcHVibGljIEFsbG9jYXRpb24gY3JlYXRlRnJvbUJpdG1hcChSZW5kZXJTY3JpcHQgcnMsIEJpdG1hcCBiLCBFbGVtZW50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gIGludCBhc3NldCA9ICgoQXNzZXRNYW5hZ2VyLkFzc2V0SW5wdXRTdHJlYW0pIGlzKS5nZXRBc3NldEludCgpOworICAgICAgICAgICAgaW50IGFsbG9jYXRpb25JZCA9IHJzLm5BbGxvY2F0aW9uQ3JlYXRlRnJvbUFzc2V0U3RyZWFtKGRzdEZtdC5tSUQsIGdlbk1pcHMsCisgICAgICAgICAgICAgICAgICAgIGFzc2V0KTsKKworICAgICAgICAgICAgcmV0dXJuIG5ldyBBbGxvY2F0aW9uKGFsbG9jYXRpb25JZCwgcnMsIG51bGwpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gSWdub3JlCisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBpZiAoaXMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlzLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBJZ25vcmUKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBzdGF0aWMgcHVibGljIEFsbG9jYXRpb24gY3JlYXRlRnJvbUJpdG1hcFJlc291cmNlQm94ZWQoUmVuZGVyU2NyaXB0IHJzLCBSZXNvdXJjZXMgcmVzLCBpbnQgaWQsIEVsZW1lbnQgZHN0Rm10LCBib29sZWFuIGdlbk1pcHMpCisgICAgICAgIHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24geworCisgICAgICAgIEJpdG1hcCBiID0gQml0bWFwRmFjdG9yeS5kZWNvZGVSZXNvdXJjZShyZXMsIGlkLCBtQml0bWFwT3B0aW9ucyk7CisgICAgICAgIHJldHVybiBjcmVhdGVGcm9tQml0bWFwQm94ZWQocnMsIGIsIGRzdEZtdCwg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SBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCitwYWNrYWdlIGFuZHJvaWQucmVuZGVyc2NyaXB0OworCitpbXBvcnQgYW5kcm9pZC51dGlsLkxvZzsKKworLyoqCisgKiBAaGlkZQorICoKKyAqKi8KK2NsYXNzIEJhc2VPYmogeworCisgICAgQmFzZU9iaihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgbVJTID0gcnM7CisgICAgICAgIG1JRCA9IDA7CisgICAgICAgIG1EZXN0cm95ZWQgPSBmYWxzZTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldElEKCkgeworICAgICAgICByZXR1cm4gbUlEOworICAgIH0KKworICAgIGludCBtSUQ7CisgICAgYm9vbGVhbiBtRGVzdHJveWVkOworICAgIFN0cmluZyBtTmFtZTsKKyAgICBSZW5kZXJTY3JpcHQgbVJTOworCisgICAgcHVibGljIHZvaWQgc2V0TmFtZShTdHJpbmcgcykgdGhyb3dzIElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiwgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uCisgICAgeworICAgICAgICBpZihzLmxlbmd0aCgpIDwgMSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigic2V0TmFtZSBkb2VzIG5vdCBhY2NlcHQgYSB6ZXJvIGxlbmd0aCBzdHJpbmcuIik7CisgICAgICAgIH0KKyAgICAgICAgaWYobU5hbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigic2V0TmFtZSBvYmplY3QgYWxyZWFkeSBoYXMgYSBuYW1lLiIpOworICAgICAgICB9CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGJ5dGVbXSBieXRlcyA9IHMuZ2V0Qnl0ZXMoIlVURi04Iik7CisgICAgICAgICAgICBtUlMubkFzc2lnbk5hbWUobUlELCBieXRlcyk7CisgICAgICAgICAgICBtTmFtZSA9IHM7CisgICAgICAgIH0gY2F0Y2ggKGphdmEuaW8uVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgdGhyb3dzIFRocm93YWJsZQorICAgIHsKKyAgICAgICAgaWYgKCFtRGVzdHJveWVkKSB7CisgICAgICAgICAgICBpZihtSUQgIT0gMCkgeworICAgICAgICAgICAgICAgIG1SUy5uT2JqRGVzdHJveU9PQihtSUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUlEID0gMDsKKyAgICAgICAgICAgIG1EZXN0cm95ZWQgPSB0cnVlOworICAgICAgICAgICAgTG9nLnYoUmVuZGVyU2NyaXB0LkxPR19UQUcsCisgICAgICAgICAgICAgICAgICBnZXRDbGFzcygpICsgIiBhdXRvIGZpbmFsaXppbmcgb2JqZWN0IHdpdGhvdXQgaGF2aW5nIHJlbGVhc2VkIHRoZSBSUyByZWZlcmVuY2UuIik7CisgICAgICAgIH0KKyAgICAgICAgc3VwZXIuZmluYWxpemUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkZXN0cm95KCkgeworICAgICAgICBpZihtRGVzdHJveWVkKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJPYmplY3QgYWxyZWFkeSBkZXN0cm95ZWQuIik7CisgICAgICAgIH0KKyAgICAgICAgbURlc3Ryb3llZCA9IHRydWU7CisgICAgICAgIG1SUy5uT2JqRGVzdHJveShtSUQpOworICAgIH0KKworfQorCmRpZmYgLS1naXQgYS9ncmFwaGljcy9qYXZhL2FuZHJv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VudHJ5WzFdOworICAgICAgICBVU0VSX0k4Lm1FbnRyaWVzWzBdID0gbmV3IEVudHJ5KERhdGFUeXBlLlNJR05FRCwgRGF0YUtpbmQuVVNFUiwgZmFsc2UsIDgsIG51bGwpOworICAgICAgICBVU0VSX0k4LmluaXQocnMpOworCisgICAgICAgIFVTRVJfVTE2Lm1FbnRyaWVzID0gbmV3IEVudHJ5WzFdOworICAgICAgICBVU0VSX1UxNi5tRW50cmllc1swXSA9IG5ldyBFbnRyeShEYXRhVHlwZS5VTlNJR05FRCwgRGF0YUtpbmQuVVNFUiwgZmFsc2UsIDE2LCBudWxsKTsKKyAgICAgICAgVVNFUl9VMTYuaW5pdChycyk7CisKKyAgICAgICAgVVNFUl9JMTYubUVudHJpZXMgPSBuZXcgRW50cnlbMV07CisgICAgICAgIFVTRVJfSTE2Lm1FbnRyaWVzWzBdID0gbmV3IEVudHJ5KERhdGFUeXBlLlNJR05FRCwgRGF0YUtpbmQuVVNFUiwgZmFsc2UsIDE2LCBudWxsKTsKKyAgICAgICAgVVNFUl9JMTYuaW5pdChycyk7CisKKyAgICAgICAgVVNFUl9VMzIubUVudHJpZXMgPSBuZXcgRW50cnlbMV07CisgICAgICAgIFVTRVJfVTMyLm1FbnRyaWVzWzBdID0gbmV3IEVudHJ5KERhdGFUeXBlLlVOU0lHTkVELCBEYXRhS2luZC5VU0VSLCBmYWxzZSwgMzIsIG51bGwpOworICAgICAgICBVU0VSX1UzMi5pbml0KHJzKTsKKworICAgICAgICBVU0VSX0kzMi5tRW50cmllcyA9IG5ldyBFbnRyeVsxXTsKKyAgICAgICAgVVNFUl9JMzIubUVudHJpZXNbMF0gPSBuZXcgRW50cnkoRGF0YVR5cGUuU0lHTkVELCBEYXRhS2luZC5VU0VSLCBmYWxzZSwgMzIsIG51bGwpOworICAgICAgICBVU0VSX0kzMi5pbml0KHJzKTsKKworICAgICAgICBVU0VSX0ZMT0FULm1FbnRyaWVzID0gbmV3IEVudHJ5WzFdOworICAgICAgICB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LaW5kLkJMVUUsIHRydWUsIDQsICJiIik7CisgICAgICAgIFJHQkFfNDQ0NC5tRW50cmllc1szXSA9IG5ldyBFbnRyeShEYXRhVHlwZS5VTlNJR05FRCwgRGF0YUtpbmQuQUxQSEEsIHRydWUsIDQsICJhIik7CisgICAgICAgIFJHQkFfNDQ0NC5pbml0KHJzKTsKKworICAgICAgICBSR0JBXzg4ODgubUVudHJpZXMgPSBuZXcgRW50cnlbNF07CisgICAgICAgIFJHQkFfODg4OC5tRW50cmllc1swXSA9IG5ldyBFbnRyeShEYXRhVHlwZS5VTlNJR05FRCwgRGF0YUtpbmQuUkVELCB0cnVlLCA4LCAiciIpOworICAgICAgICBSR0JBXzg4ODgubUVudHJpZXNbMV0gPSBuZXcgRW50cnkoRGF0YVR5cGUuVU5TSUdORUQsIERhdGFLaW5kLkdSRUVOLCB0cnVlLCA4LCAiZyIpOworICAgICAgICBSR0JBXzg4ODgubUVudHJpZXNbMl0gPSBuZXcgRW50cnkoRGF0YVR5cGUuVU5TSUdORUQsIERhdGFLaW5kLkJMVUUsIHRydWUsIDgsICJiIik7CisgICAgICAgIFJHQkFfODg4OC5tRW50cmllc1szXSA9IG5ldyBFbnRyeShEYXRhVHlwZS5VTlNJR05FRCwgRGF0YUtpbmQuQUxQSEEsIHRydWUsIDgsICJhIik7CisgICAgICAgIFJHQkFfODg4OC5pbml0KHJzKTsKKworICAgICAgICBJTkRFWF8xNi5tRW50cmllcyA9IG5ldyBFbnRyeVsxXTsKKyAgICAgICAgSU5ERVhfMTYubUVudHJpZXNbMF0gPSBuZXcgRW50cnkoRGF0YVR5cGUuVU5TSUdORUQsIERhdGFLaW5kLklOREVYLCBmYWxzZSwgMTYsICJpbmRleCIpOworICAgICAgICBJTkRFWF8xNi5pbml0KHJzKTsKKworICAgICAgICBYWV9GMzIubUVudHJpZXMgPSBuZXcgRW50cnlbMl07CisgICAgICAgIFhZX0YzMi5tRW50cmllc1swXSA9IG5ldyBFbnRyeShEYXRhVHlwZS5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AgIE5PUk1fU1RfWFlaX0YzMi5tRW50cmllc1s0XSA9IG5ldyBFbnRyeShEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuVCwgZmFsc2UsIDMyLCAidCIpOworICAgICAgICBOT1JNX1NUX1hZWl9GMzIubUVudHJpZXNbNV0gPSBuZXcgRW50cnkoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlgsIGZhbHNlLCAzMiwgIngiKTsKKyAgICAgICAgTk9STV9TVF9YWVpfRjMyLm1FbnRyaWVzWzZdID0gbmV3IEVudHJ5KERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5ZLCBmYWxzZSwgMzIsICJ5Iik7CisgICAgICAgIE5PUk1fU1RfWFlaX0YzMi5tRW50cmllc1s3XSA9IG5ldyBFbnRyeShEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuWiwgZmFsc2UsIDMyLCAieiIpOworICAgICAgICBOT1JNX1NUX1hZWl9GMzIuaW5pdChycyk7CisKKyAgICAgICAgcnMubkluaXRFbGVtZW50cyhBXzgubUlELCBSR0JBXzQ0NDQubUlELCBSR0JBXzg4ODgubUlELCBSR0JfNTY1Lm1JRCk7CisgICAgfQorCisKKyAgICBwdWJsaWMgZW51bSBEYXRhVHlwZSB7CisgICAgICAgIEZMT0FUICgwKSwKKyAgICAgICAgVU5TSUdORUQgKDEpLAorICAgICAgICBTSUdORUQgKDIpOworCisgICAgICAgIGludCBtSUQ7CisgICAgICAgIERhdGFUeXBlKGludCBpZCkgeworICAgICAgICAgICAgbUlEID0gaWQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgZW51bSBEYXRhS2luZCB7CisgICAgICAgIFVTRVIgKDApLAorICAgICAgICBSRUQgKDEpLAorICAgICAgICBHUkVFTiAoMiksCisgICAgICAgIEJMVUUgKDMpLAorICAgICAgICBBTFBIQSAoNCksCisgICAgICAgIExVTUlOQU5DRSAoNSksCisgICAgICAgIElOVEVOU0lUWSAoNiksCisgICAgICAgIFggKDcpLAorICAgICAgICBZICg4KSwKKyAgICAgICAgWiAoOSksCisgICAgICAgIFcgKDEwKSwKKyAgICAgICAgUyAoMTEpLAorICAgICAgICBUICgxMiksCisgICAgICAgIFEgKDEzKSwKKyAgICAgICAgUiAoMTQpLAorICAgICAgICBOWCAoMTUpLAorICAgICAgICBOWSAoMTYpLAorICAgICAgICBOWiAoMTcpLAorICAgICAgICBJTkRFWCAoMTgpLAorICAgICAgICBQT0lOVF9TSVpFKDE5KTsKKworICAgICAgICBpbnQgbUlEOworICAgICAgICBEYXRhS2luZChpbnQgaWQpIHsKKyAgICAgICAgICAgIG1JRCA9IGlkOworICAgICAgICB9CisgICAgfQorCisgICAgRWxlbWVudCgpIHsKKyAgICAgICAgc3VwZXIobnVsbCk7CisgICAgICAgIG1JRCA9IDA7CisgICAgICAgIG1TaXplID0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkZXN0cm95KCkgdGhyb3dzIElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiB7CisgICAgICAgIHN1cGVyLmRlc3Ryb3koKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgY3JlYXRlRnJvbUNsYXNzKFJlbmRlclNjcmlwdCBycywgQ2xhc3MgYykgeworICAgICAgICBGaWVsZFtdIGZpZWxkcyA9IGMuZ2V0RmllbGRzKCk7CisgICAgICAgIEJ1aWxkZXIgYiA9IG5ldyBCdWlsZGVyKHJzKTsKKworICAgICAgICBmb3IoRmllbGQgZjogZmllbGRzKSB7CisgICAgICAgICAgICBDbGFzcyBmYyA9IGYuZ2V0VHlwZSgpOworICAgICAgICAgICAgaWYoZmMgPT0gaW50LmNsYXNzKSB7CisgICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5EYXRhVHlwZS5TSUdORUQsIEVsZW1lbnQuRGF0YUtpbmQuVVNFUiwgZmFsc2UsIDMyLCBmLmdldE5hbWUoKSk7CisgICAgICAgICAgICB9IGVsc2UgaWYoZmMgPT0gc2hvcnQuY2xhc3MpIHsKKyAgICAgICAgICAgICAgICBiLmFkZChFbGVtZW50LkRhdGFUeXBlLlNJR05FRCwgRWxlbWVudC5EYXRhS2luZC5VU0VSLCBmYWxzZSwgMTYsIGYuZ2V0TmFtZSgpKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBieXRlLmNsYXNzKSB7CisgICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5EYXRhVHlwZS5TSUdORUQsIEVsZW1lbnQuRGF0YUtpbmQuVVNFUiwgZmFsc2UsIDgsIGYuZ2V0TmFtZSgpKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBmbG9hdC5jbGFzcykgeworICAgICAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuRGF0YVR5cGUuRkxPQVQsIEVsZW1lbnQuRGF0YUtpbmQuVVNFUiwgZmFsc2UsIDMyLCBmLmdldE5hbWUoKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua293biBmaWVsZCB0eXBlIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGIuY3JlYXRlKCk7CisgICAgfQorCisgICAgc3RhdGljIHN5bmNocm9uaXplZCB2b2lkIGludGVybmFsQ3JlYXRlKFJlbmRlclNjcmlwdCBycywgRWxlbWVudCBlKSB7CisgICAgICAgIHJzLm5FbGVtZW50QmVnaW4oKTsKKyAgICAgICAgaW50IGJpdHMgPSAwOworICAgICAgICBmb3IgKGludCBjdD0wOyBjdCA8IGUubUVudHJpZXMubGVuZ3RoOyBjdCsrKSB7CisgICAgICAgICAgICBFbnRyeSBlbiA9IGUubUVudHJpZXNbY3RdOworICAgICAgICAgICAgaWYoZW4ubUVsZW1lbnQgIT0gIG51bGwpIHsKKyAgICAgICAgICAgICAgICAvL3JzLm5FbGVtZW50QWRkKGVuLm1FbGVtZW50Lm1JRCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCBub3JtID0gMDsKKyAgICAgICAgICAgICAgICBpZiAoZW4ubUlzTm9ybWFsaXplZCkgeworICAgICAgICAgICAgICAgICAgICBub3JtID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcnMubkVsZW1lbnRBZGQoZW4ubUtpbmQubUlELCBlbi5tVHlwZS5tSUQsIG5vcm0sIGVuLm1CaXRzLCBlbi5tTmFtZSk7CisgICAgICAgICAgICAgICAgYml0cyArPSBlbi5tQml0czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlLm1JRCA9IHJzLm5FbGVtZW50Q3JlYXRlKCk7CisgICAgICAgIGUubVNpemUgPSAoYml0cyArIDcpID4+IDM7CisgICAgfQorCisgICAgdm9pZCBpbml0KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBtUlMgPSByczsKKyAgICAgICAgaW50ZXJuYWxDcmVhdGUobVJTLCB0aGlzKTsKKyAgICB9CisKKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQnVpbGRlciB7CisgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CisgICAgICAgIEVudHJ5W10gbUVudHJpZXM7CisgICAgICAgIGludCBtRW50cnlDb3VudDsKKworICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgICAgIG1SUyA9IHJzOworICAgICAgICAgICAgbUVudHJ5Q291bnQgPSAwOworICAgICAgICAgICAgbUVudHJpZXMgPSBuZXcgRW50cnlbOF07CisgICAgICAgIH0KKworICAgICAgICB2b2lkIGFkZEVudHJ5KEVudHJ5IGUpIHsKKyAgICAgICAgICAgIGlmKG1FbnRyaWVzLmxlbmd0aCA+PSBtRW50cnlDb3VudCkgeworICAgICAgICAgICAgICAgIEVudHJ5W10gZW4gPSBuZXcgRW50cnlbbUVudHJ5Q291bnQgKyA4XTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1FbnRyaWVzLCAwLCBlbiwgMCwgbUVudHJpZXMubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBtRW50cmllcyA9IGVuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUVudHJpZXNbbUVudHJ5Q291bnRdID0gZTsKKyAgICAgICAgICAgIG1FbnRyeUNvdW50Kys7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBhZGQoRWxlbWVudCBlKSB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKyAgICAgICAgICAgIEVudHJ5IGVuID0gbmV3IEVudHJ5KGUsIGUubVNpemUgKiA4KTsKKyAgICAgICAgICAgIGFkZEVudHJ5KGVuKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkKEVsZW1lbnQuRGF0YVR5cGUgZHQsIEVsZW1lbnQuRGF0YUtpbmQgZGssIGJvb2xlYW4gaXNOb3JtYWxpemVkLCBpbnQgYml0cywgU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgICAgIEVudHJ5IGVuID0gbmV3IEVudHJ5KGR0LCBkaywgaXNOb3JtYWxpemVkLCBiaXRzLCBuYW1lKTsKKyAgICAgICAgICAgIGFkZEVudHJ5KGVuKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkKEVsZW1lbnQuRGF0YVR5cGUgZHQsIEVsZW1lbnQuRGF0YUtpbmQgZGssIGJvb2xlYW4gaXNOb3JtYWxpemVkLCBpbnQgYml0cykgeworICAgICAgICAgICAgYWRkKGR0LCBkaywgaXNOb3JtYWxpemVkLCBiaXRzLCBudWxsKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkRmxvYXQoRWxlbWVudC5EYXRhS2luZCBkaykgeworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBkaywgZmFsc2UsIDMyLCBudWxsKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkRmxvYXQoRWxlbWVudC5EYXRhS2luZCBkaywgU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgZGssIGZhbHNlLCAzMiwgbmFtZSk7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCdWlsZGVyIGFkZEZsb2F0WFkoKSB7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlgsIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlksIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCdWlsZGVyIGFkZEZsb2F0WFkoU3RyaW5nIHByZWZpeCkgeworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5YLCBmYWxzZSwgMzIsIHByZWZpeCArICJ4Iik7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlksIGZhbHNlLCAzMiwgcHJlZml4ICsgInkiKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkRmxvYXRYWVooKSB7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlgsIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlksIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlosIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCdWlsZGVyIGFkZEZsb2F0WFlaKFN0cmluZyBwcmVmaXgpIHsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuWCwgZmFsc2UsIDMyLCBwcmVmaXggKyAieCIpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5ZLCBmYWxzZSwgMzIsIHByZWZpeCArICJ5Iik7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlosIGZhbHNlLCAzMiwgcHJlZml4ICsgInoiKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkRmxvYXRTVCgpIHsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuUywgZmFsc2UsIDMyLCBudWxsKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuVCwgZmFsc2UsIDMyLCBudWxsKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkRmxvYXRTVChTdHJpbmcgcHJlZml4KSB7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlMsIGZhbHNlLCAzMiwgcHJlZml4ICsgInMiKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuVCwgZmFsc2UsIDMyLCBwcmVmaXggKyAidCIpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBhZGRGbG9hdE5vcm0oKSB7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLk5YLCBmYWxzZSwgMzIsIG51bGwpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5OWSwgZmFsc2UsIDMyLCBudWxsKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuTlosIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCdWlsZGVyIGFkZEZsb2F0Tm9ybShTdHJpbmcgcHJlZml4KSB7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLk5YLCBmYWxzZSwgMzIsIHByZWZpeCArICJueCIpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5OWSwgZmFsc2UsIDMyLCBwcmVmaXggKyAibnkiKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuTlosIGZhbHNlLCAzMiwgcHJlZml4ICsgIm56Iik7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCdWlsZGVyIGFkZEZsb2F0UG9pbnRTaXplKCkgeworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5QT0lOVF9TSVpFLCBmYWxzZSwgMzIsIG51bGwpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBhZGRGbG9hdFBvaW50U2l6ZShTdHJpbmcgcHJlZml4KSB7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlBPSU5UX1NJWkUsIGZhbHNlLCAzMiwgcHJlZml4ICsgInBvaW50U2l6ZSIpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBhZGRGbG9hdFJHQigpIHsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuUkVELCBmYWxzZSwgMzIsIG51bGwpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5HUkVFTiwgZmFsc2UsIDMyLCBudWxsKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuQkxVRSwgZmFsc2UsIDMyLCBudWxsKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIgYWRkRmxvYXRSR0IoU3RyaW5nIHByZWZpeCkgeworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5SRUQsIGZhbHNlLCAzMiwgcHJlZml4ICsgInIiKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuR1JFRU4sIGZhbHNlLCAzMiwgcHJlZml4ICsgImciKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuQkxVRSwgZmFsc2UsIDMyLCBwcmVmaXggKyAiYiIpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBhZGRGbG9hdFJHQkEoKSB7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLlJFRCwgZmFsc2UsIDMyLCBudWxsKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuR1JFRU4sIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLkJMVUUsIGZhbHNlLCAzMiwgbnVsbCk7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuRkxPQVQsIERhdGFLaW5kLkFMUEhBLCBmYWxzZSwgMzIsIG51bGwpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBhZGRGbG9hdFJHQkEoU3RyaW5nIHByZWZpeCkgeworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5SRUQsIGZhbHNlLCAzMiwgcHJlZml4ICsgInIiKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuR1JFRU4sIGZhbHNlLCAzMiwgcHJlZml4ICsgImciKTsKKyAgICAgICAgICAgIGFkZChEYXRhVHlwZS5GTE9BVCwgRGF0YUtpbmQuQkxVRSwgZmFsc2UsIDMyLCBwcmVmaXggKyAiYiIpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLkZMT0FULCBEYXRhS2luZC5BTFBIQSwgZmFsc2UsIDMyLCBwcmVmaXggKyAiYSIpOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQnVpbGRlciBhZGRVTm9ybThSR0JBKCkgeworICAgICAgICAgICAgYWRkKERhdGFUeXBlLlVOU0lHTkVELCBEYXRhS2luZC5SRUQsIHRydWUsIDgsIG51bGwpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLlVOU0lHTkVELCBEYXRhS2luZC5HUkVFTiwgdHJ1ZSwgOCwgbnVsbCk7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuVU5TSUdORUQsIERhdGFLaW5kLkJMVUUsIHRydWUsIDgsIG51bGwpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLlVOU0lHTkVELCBEYXRhS2luZC5BTFBIQSwgdHJ1ZSwgOCwgbnVsbCk7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCdWlsZGVyIGFkZFVOb3JtOFJHQkEoU3RyaW5nIHByZWZpeCkgeworICAgICAgICAgICAgYWRkKERhdGFUeXBlLlVOU0lHTkVELCBEYXRhS2luZC5SRUQsIHRydWUsIDgsIHByZWZpeCArICJyIik7CisgICAgICAgICAgICBhZGQoRGF0YVR5cGUuVU5TSUdORUQsIERhdGFLaW5kLkdSRUVOLCB0cnVlLCA4LCBwcmVmaXggKyAiZyIpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLlVOU0lHTkVELCBEYXRhS2luZC5CTFVFLCB0cnVlLCA4LCBwcmVmaXggKyAiYiIpOworICAgICAgICAgICAgYWRkKERhdGFUeXBlLlVOU0lHTkVELCBEYXRhS2luZC5BTFBIQSwgdHJ1ZSwgOCwgcHJlZml4ICsgImEiKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEVsZW1lbnQgY3JlYXRlKCkgeworICAgICAgICAgICAgRWxlbWVudCBlID0gbmV3IEVsZW1lbnQoKTsKKyAgICAgICAgICAgIGUubUVudHJpZXMgPSBuZXcgRW50cnlbbUVudHJ5Q291bnRdOworICAgICAgICAgICAgamF2YS5sYW5nLlN5c3RlbS5hcnJheWNvcHkobUVudHJpZXMsIDAsIGUubUVudHJpZXMsIDAsIG1FbnRyeUNvdW50KTsKKyAgICAgICAgICAgIGUuaW5pdChtUlMpOworICAgICAgICAgICAgcmV0dXJuIGU7CisgICAgICAgIH0KKyAgICB9CisKK30KKwpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9MaWdodC5qYXZhIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjc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XJzY3JpcHQ7CisKK2ltcG9ydCBhbmRyb2lkLnV0aWwuQ29uZmlnOworaW1wb3J0IGFuZHJvaWQudXRpbC5Mb2c7CisKKy8qKgorICogQGhpZGUKKyAqCisgKiovCitwdWJsaWMgY2xhc3MgTGlnaHQgZXh0ZW5kcyBCYXNlT2JqIHsKKyAgICBMaWdodChpbnQgaWQsIFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBzdXBlcihycyk7CisgICAgICAgIG1JRCA9IGlkOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENvbG9yKGZsb2F0IHIsIGZsb2F0IGcsIGZsb2F0IGIpIHsKKyAgICAgICAgbVJTLm5MaWdodFNldENvbG9yKG1JRCwgciwgZywgYik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UG9zaXRpb24oZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICBtUlMubkxpZ2h0U2V0UG9zaXRpb24obUlELCB4LCB5LCB6KTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgeworICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOworICAgICAgICBib29sZWFuIG1Jc01vbm87CisgICAgICAgIGJvb2xlYW4gbUlzTG9jYWw7CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgICAgICBtUlMgPSByczsKKyAgICAgICAgICAgIG1Jc01vbm8gPSBmYWxzZTsKKyAgICAgICAgICAgIG1Jc0xvY2FsID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBsaWdodFNldElzTW9ubyhib29sZWFuIGlzTW9ubykgeworICAgICAgICAgICAgbUlzTW9ubyA9IGlzTW9ubzsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGxpZ2h0U2V0SXNMb2NhbChib29sZWFuIGlzTG9jYWwpIHsKKyAgICAgICAgICAgI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gICAgbU1hdFtpKjQgKyBqXSA9IHY7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbG9hZElkZW50aXR5KCkgeworICAgICAgICBtTWF0WzBdID0gMTsKKyAgICAgICAgbU1hdFsxXSA9IDA7CisgICAgICAgIG1NYXRbMl0gPSAwOworICAgICAgICBtTWF0WzNdID0gMDsKKworICAgICAgICBtTWF0WzRdID0gMDsKKyAgICAgICAgbU1hdFs1XSA9IDE7CisgICAgICAgIG1NYXRbNl0gPSAwOworICAgICAgICBtTWF0WzddID0gMDsKKyAgICAKKyAgICAgICAgbU1hdFs4XSA9IDA7CisgICAgICAgIG1NYXRbOV0gPSAwOworICAgICAgICBtTWF0WzEwXSA9IDE7CisgICAgICAgIG1NYXRbMTFdID0gMDsKKworICAgICAgICBtTWF0WzEyXSA9IDA7CisgICAgICAgIG1NYXRbMTNdID0gMDsKKyAgICAgICAgbU1hdFsxNF0gPSAwOworICAgICAgICBtTWF0WzE1XSA9IDE7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbG9hZChNYXRyaXggc3JjKSB7CisgICAgICAgIG1NYXQgPSBzcmMubU1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBsb2FkUm90YXRlKGZsb2F0IHJvdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICBmbG9hdCBjLCBzOworICAgICAgICBtTWF0WzNdID0gMDsKKyAgICAgICAgbU1hdFs3XSA9IDA7CisgICAgICAgIG1NYXRbMTFdPSAwOworICAgICAgICBtTWF0WzEyXT0gMDsKKyAgICAgICAgbU1hdFsxM109IDA7CisgICAgICAgIG1NYXRbMTRdPSAwOworICAgICAgICBtTWF0WzE1XT0gMTsKKyAgICAgICAgcm90ICo9IChmbG9hdCkoamF2YS5sYW5nLk1hdGguUEkgLyAxODAuMGYpOworICAgICAgICBjID0gKGZsb2F0KWphdmEubGFuZy5NYXRoLmNvcyhyb3QpOworICAgICAgICBzID0gKGZsb2F0KWphdmEubGFuZy5NYXRoLnNpbihyb3QpOworICAgIAorICAgICAgICBmbG9hdCBsZW4gPSAoZmxvYXQpamF2YS5sYW5nLk1hdGguc3FydCh4KnggKyB5KnkgKyB6KnopOworICAgICAgICBpZiAoIShsZW4gIT0gMSkpIHsKKyAgICAgICAgICAgIGZsb2F0IHJlY2lwTGVuID0gMS5mIC8gbGVuOworICAgICAgICAgICAgeCAqPSByZWNpcExlbjsKKyAgICAgICAgICAgIHkgKj0gcmVjaXBMZW47CisgICAgICAgICAgICB6ICo9IHJlY2lwTGVuOworICAgICAgICB9CisgICAgICAgIGZsb2F0IG5jID0gMS4wZiAtIGM7CisgICAgICAgIGZsb2F0IHh5ID0geCAqIHk7CisgICAgICAgIGZsb2F0IHl6ID0geSAqIHo7CisgICAgICAgIGZsb2F0IHp4ID0geiAqIHg7CisgICAgICAgIGZsb2F0IHhzID0geCAqIHM7CisgICAgICAgIGZsb2F0IHlzID0geSAqIHM7CisgICAgICAgIGZsb2F0IHpzID0geiAqIHM7CQkKKyAgICAgICAgbU1hdFsgMF0gPSB4KngqbmMgKyAgYzsKKyAgICAgICAgbU1hdFsgNF0gPSAgeHkqbmMgLSB6czsKKyAgICAgICAgbU1hdFsgOF0gPSAgengqbmMgKyB5czsKKyAgICAgICAgbU1hdFsgMV0gPSAgeHkqbmMgKyB6czsKKyAgICAgICAgbU1hdFsgNV0gPSB5KnkqbmMgKyAgYzsKKyAgICAgICAgbU1hdFsgOV0gPSAgeXoqbmMgLSB4czsKKyAgICAgICAgbU1hdFsgMl0gPSAgengqbmMgLSB5czsKKyAgICAgICAgbU1hdFsgNl0gPSAgeXoqbmMgKyB4czsKKyAgICAgICAgbU1hdFsxMF0gPSB6KnoqbmMgKyAgYzsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBsb2FkU2NhbGUoZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICBsb2FkSWRlbnRpdHkoKTsKKyAgICAgICAgbU1hdFswXSA9IHg7CisgICAgICAgIG1NYXRbNV0gPSB5OworICAgICAgICBtTWF0WzEwXSA9IHo7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGxvYWRUcmFuc2xhdGUoZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICBsb2FkSWRlbnRpdHkoKTsKKyAgICAgICAgbU1hdFsxMl0gPSB4OworICAgICAgICBtTWF0WzEzXSA9IHk7CisgICAgICAgIG1NYXRbMTRdID0gejsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBsb2FkTXVsdGlwbHkoTWF0cml4IGxocywgTWF0cml4IHJocykgeworICAgICAgICBmb3IgKGludCBpPTAgOyBpPDQgOyBpKyspIHsKKyAgICAgICAgICAgIGZsb2F0IHJpMCA9IDA7CisgICAgICAgICAgICBmbG9hdCByaTEgPSAwOworICAgICAgICAgICAgZmxvYXQgcmkyID0gMDsKKyAgICAgICAgICAgIGZsb2F0IHJpMyA9IDA7CisgICAgICAgICAgICBmb3IgKGludCBqPTAgOyBqPDQgOyBqKyspIHsKKyAgICAgICAgICAgICAgICBmbG9hdCByaHNfaWogPSByaHMuZ2V0KGksaik7CisgICAgICAgICAgICAgICAgcmkwICs9IGxocy5nZXQoaiwwKSAqIHJoc19pajsKKyAgICAgICAgICAgICAgICByaTEgKz0gbGhzLmdldChqLDEpICogcmhzX2lqOworICAgICAgICAgICAgICAgIHJpMiArPSBsaHMuZ2V0KGosMikgKiByaHNfaWo7CisgICAgICAgICAgICAgICAgcmkzICs9IGxocy5nZXQoaiwzKSAqIHJoc19pajsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNldChpLDAsIHJpMCk7CisgICAgICAgICAgICBzZXQoaSwxLCByaTEpOworICAgICAgICAgICAgc2V0KGksMiwgcmkyKTsKKyAgICAgICAgICAgIHNldChpLDMsIHJpMyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBsb2FkT3J0aG8oZmxvYXQgbCwgZmxvYXQgciwgZmxvYXQgYiwgZmxvYXQgdCwgZmxvYXQgbiwgZmxvYXQgZikgeworICAgICAgICBsb2FkSWRlbnRpdHkoKTsKKyAgICAgICAgbU1hdFswXSA9IDIgLyAociAtIGwpOworICAgICAgICBtTWF0WzVdID0gMiAvICh0IC0gYik7CisgICAgICAgIG1NYXRbMTBdPSAtMiAvIChmIC0gbik7CisgICAgICAgIG1NYXRbMTJdPSAtKHIgKyBsKSAvIChyIC0gbCk7CisgICAgICAgIG1NYXRbMTNdPSAtKHQgKyBiKSAvICh0IC0gYik7CisgICAgICAgIG1NYXRbMTRdPSAtKGYgKyBuKSAvIChmIC0gbik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgbG9hZEZydXN0dW0oZmxvYXQgbCwgZmxvYXQgciwgZmxvYXQgYiwgZmxvYXQgdCwgZmxvYXQgbiwgZmxvYXQgZikgeworICAgICAgICBsb2FkSWRlbnRpdHkoKTsKKyAgICAgICAgbU1hdFswXSA9IDIgKiBuIC8gKHIgLSBsKTsKKyAgICAgICAgbU1hdFs1XSA9IDIgKiBuIC8gKHQgLSBiKTsKKyAgICAgICAgbU1hdFs4XSA9IChyICsgbCkgLyAociAtIGwpOworICAgICAgICBtTWF0WzldID0gKHQgKyBiKSAvICh0IC0gYik7CisgICAgICAgIG1NYXRbMTBdPSAtKGYgKyBuKSAvIChmIC0gbik7CisgICAgICAgIG1NYXRbMTFdPSAtMTsKKyAgICAgICAgbU1hdFsxNF09IC0yKmYqbiAvIChmIC0gbik7CisgICAgICAgIG1NYXRbMTVdPSAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG11bHRpcGx5KE1hdHJpeCByaHMpIHsKKyAgICAgICAgTWF0cml4IHRtcCA9IG5ldyBNYXRyaXgoKTsKKyAgICAgICAgdG1wLmxvYWRNdWx0aXBseSh0aGlzLCByaHMpOworICAgICAgICBsb2FkKHRtcCk7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIHJvdGF0ZShmbG9hd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ZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICovCisKK3BhY2thZ2UgYW5kcm9pZC5yZW5kZXJzY3JpcHQ7CisKKworaW1wb3J0IGFuZHJvaWQudXRpbC5Db25maWc7CitpbXBvcnQgYW5kcm9pZC51dGlsLkxvZzsKKworCisvKioKKyAqIEBoaWRlCisgKgorICoqLworcHVibGljIGNsYXNzIFByb2dyYW1GcmFnbWVudCBleHRlbmRzIEJhc2VPYmogeworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IE1BWF9TTE9UID0gMjsKKworICAgIHB1YmxpYyBlbnVtIEVudk1vZGUgeworICAgICAgICBSRVBMQUNFICgwKSwKKyAgICAgICAgTU9EVUxBVEUgKDEpLAorICAgICAgICBERUNBTCAoMik7CisKKyAgICAgICAgaW50IG1JRDsKKyAgICAgICAgRW52TW9kZShpbnQgaWQpIHsKKyAgICAgICAgICAgIG1JRCA9IGlkOworICAgICAgICB9CisgICAgfQorCisKKyAgICBQcm9ncmFtRnJhZ21lbnQoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgc3VwZXIocnMpOworICAgICAgICBtSUQgPSBpZDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBiaW5kVGV4dHVyZShBbGxvY2F0aW9uIHZhLCBpbnQgc2xvdCkKKyAgICAgICAgdGhyb3dzIElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiB7CisgICAgICAgIGlmKChzbG90IDwgMCkgfHwgKHNsb3QgPj0gTUFYX1NMT1QpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJTbG90IElEIG91dCBvZiByYW5nZS4iKTsKKyAgICAgICAgfQorCisgICAgICAgIG1SUy5uUHJvZ3JhbUZyYWdtZW50QmluZFRleHR1cmUobUlELCBzbG90LCB2YS5tSUQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGJpbmRTYW1wbGVyKFNhbXBsZXIgdnMsIGludCBzbG90KQorICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKyAgICAgICAgaWYoKHNsb3QgPCAwKSB8fCAoc2xvdCA+PSBNQVhfU0xPVCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlNsb3QgSUQgb3V0IG9mIHJhbmdlLiIpOworICAgICAgICB9CisKKyAgICAgICAgbVJTLm5Qcm9ncmFtRnJhZ21lbnRCaW5kU2FtcGxlcihtSUQsIHNsb3QsIHZzLm1JRCk7CisgICAgfQorCisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgeworICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOworICAgICAgICBFbGVtZW50IG1JbjsKKyAgICAgICAgRWxlbWVudCBtT3V0OworICAgICAgICBib29sZWFuIG1Qb2ludFNwcml0ZUVuYWJsZTsKKworICAgICAgICBwcml2YXRlIGNsYXNzIFNsb3QgeworICAgICAgICAgICAgVHlwZSBtVHlwZTsKKyAgICAgICAgICAgIEVudk1vZGUgbUVudjsKKyAgICAgICAgICAgIGJvb2xlYW4gbVRleEVuYWJsZTsKKworICAgICAgICAgICAgU2xvdCgpIHsKKyAgICAgICAgICAgICAgICBtVGV4RW5hYmxlID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgU2xvdFtdIG1TbG90czsKKworICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMsIEVsZW1lbnQgaW4sIEVsZW1lbnQgb3V0KSB7CisgICAgICAgICAgICBtUlMgPSByczsKKyAgICAgICAgICAgIG1JbiA9IGluOworICAgICAgICAgICAgbU91dCA9IG91dDsKKyAgICAgICAgICAgIG1TbG90cyA9IG5ldyBTbG90W01BWF9TTE9UXTsKKyAgICAgICAgICAgIG1Qb2ludFNwcml0ZUVuYWJsZSA9IGZhbHNlOworICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IE1BWF9TTE9UOyBjdCsrKSB7CisgICAgICAgICAgICAgICAgbVNsb3RzW2N0XSA9IG5ldyBTbG90KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRUeXBlKGludCBzbG90LCBUeXBlIHQpCisgICAgICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGlmKChzbG90IDwgMCkgfHwgKHNsb3QgPj0gTUFYX1NMT1QpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiU2xvdCBJRCBvdXQgb2YgcmFuZ2UuIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1TbG90c1tzbG90XS5tVHlwZSA9IHQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRUZXhFbmFibGUoYm9vbGVhbiBlbmFibGUsIGludCBzbG90KQorICAgICAgICAgICAgdGhyb3dzIElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiB7CisgICAgICAgICAgICBpZigoc2xvdCA8IDApIHx8IChzbG90ID49IE1BWF9TTE9UKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlNsb3QgSUQgb3V0IG9mIHJhbmdlLiIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtU2xvdHNbc2xvdF0ubVRleEVuYWJsZSA9IGVuYWJsZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFRleEVudk1vZGUoRW52TW9kZSBlbnYsIGludCBzbG90KQorICAgICAgICAgICAgdGhyb3dzIElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiB7CisgICAgICAgICAgICBpZigoc2xvdCA8IDApIHx8IChzbG90ID49IE1BWF9TTE9UKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlNsb3QgSUQgb3V0IG9mIHJhbmdlLiIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtU2xvdHNbc2xvdF0ubUVudiA9IGVudjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFBvaW50U3ByaXRlVGV4Q29vcmRpbmF0ZVJlcGxhY2VtZW50KGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgICAgICBtUG9pbnRTcHJpdGVFbmFibGUgPSBlbmFibGU7CisgICAgICAgIH0KKworICAgICAgICBzdGF0aWMgc3luY2hyb25pemVkIFByb2dyYW1GcmFnbWVudCBpbnRlcm5hbENyZWF0ZShSZW5kZXJTY3JpcHQgcnMsIEJ1aWxkZXIgYikgeworICAgICAgICAgICAgaW50IGluSUQgPSAwOworICAgICAgICAgICAgaW50IG91dElEID0gMDsKKyAgICAgICAgICAgIGlmIChiLm1JbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW5JRCA9IGIubUluLm1JRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChiLm1PdXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dElEID0gYi5tT3V0Lm1JRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtRnJhZ21lbnRCZWdpbihpbklELCBvdXRJRCwgYi5tUG9pbnRTcHJpdGVFbmFibGUpOworICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IE1BWF9TTE9UOyBjdCsrKSB7CisgICAgICAgICAgICAgICAgaWYoYi5tU2xvdHNbY3RdLm1UZXhFbmFibGUpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xv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CisgICAgICAgIEdSRUFURVIgKDMpLAorICAgICAgICBHRVFVQUwgKDQpLAorICAgICAgICBFUVVBTCAoNSksCisgICAgICAgIE5PVEVRVUFMICg2KTsKKworICAgICAgICBpbnQgbUlEOworICAgICAgICBEZXB0aEZ1bmMoaW50IGlkKSB7CisgICAgICAgICAgICBtSUQgPSBpZDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBlbnVtIEJsZW5kU3JjRnVuYyB7CisgICAgICAgIFpFUk8gKDApLAorICAgICAgICBPTkUgKDEpLAorICAgICAgICBEU1RfQ09MT1IgKDIpLAorICAgICAgICBPTkVfTUlOVVNfRFNUX0NPTE9SICgzKSwKKyAgICAgICAgU1JDX0FMUEhBICg0KSwKKyAgICAgICAgT05FX01JTlVTX1NSQ19BTFBIQSAoNSksCisgICAgICAgIERTVF9BTFBIQSAoNiksCisgICAgICAgIE9ORV9NSU5VU19EU1RfQUxQQSAoNyksCisgICAgICAgIFNSQ19BTFBIQV9TQVRVUkFURSAoOCk7CisKKyAgICAgICAgaW50IG1JRDsKKyAgICAgICAgQmxlbmRTcmNGdW5jKGludCBpZCkgeworICAgICAgICAgICAgbUlEID0gaWQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgZW51bSBCbGVuZERzdEZ1bmMgeworICAgICAgICBaRVJPICgwKSwKKyAgICAgICAgT05FICgxKSwKKyAgICAgICAgU1JDX0NPTE9SICgyKSwKKyAgICAgICAgT05FX01JTlVTX1NSQ19DT0xPUiAoMyksCisgICAgICAgIFNSQ19BTFBIQSAoNCksCisgICAgICAgIE9ORV9NSU5VU19TUkNfQUxQSEEgKDUpLAorICAgICAgICBEU1RfQUxQSEEgKDYpLAorICAgICAgICBPTkVfTUlOVVNfRFNUX0FMUEEgKDcpOworCisgICAgICAgIGludCBtSUQ7CisgICAgICAgIEJsZW5kRHN0RnVuYyhpbnQgaWQpIHsKKyAgICAgICAgICAgIG1JRCA9IGlkOworICAgICAgICB9CisgICAgfQorCisKKyAgICBQcm9ncmFtU3RvcmUoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgc3VwZXIocnMpOworICAgICAgICBtSUQgPSBpZDsKKyAgICB9CisKKworCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBCdWlsZGVyIHsKKyAgICAgICAgUmVuZGVyU2NyaXB0IG1SUzsKKyAgICAgICAgRWxlbWVudCBtSW47CisgICAgICAgIEVsZW1lbnQgbU91dDsKKyAgICAgICAgRGVwdGhGdW5jIG1EZXB0aEZ1bmM7CisgICAgICAgIGJvb2xlYW4gbURlcHRoTWFzazsKKyAgICAgICAgYm9vbGVhbiBtQ29sb3JNYXNrUjsKKyAgICAgICAgYm9vbGVhbiBtQ29sb3JNYXNrRzsKKyAgICAgICAgYm9vbGVhbiBtQ29sb3JNYXNrQjsKKyAgICAgICAgYm9vbGVhbiBtQ29sb3JNYXNrQTsKKyAgICAgICAgQmxlbmRTcmNGdW5jIG1CbGVuZFNyYzsKKyAgICAgICAgQmxlbmREc3RGdW5jIG1CbGVuZERzdDsKKyAgICAgICAgYm9vbGVhbiBtRGl0aGVyOworCisKKworICAgICAgICBwdWJsaWMgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMsIEVsZW1lbnQgaW4sIEVsZW1lbnQgb3V0KSB7CisgICAgICAgICAgICBtUlMgPSByczsKKyAgICAgICAgICAgIG1JbiA9IGluOworICAgICAgICAgICAgbU91dCA9IG91dDsKKyAgICAgICAgICAgIG1EZXB0aEZ1bmMgPSBEZXB0aEZ1bmMuQUxXQVlTOworICAgICAgICAgICAgbURlcHRoTWFzayA9IGZhbHNlOworICAgICAgICAgICAgbUNvbG9yTWFza1IgPSB0cnVlOworICAgICAgICAgICAgbUNvbG9yTWFza0cgPSB0cnVlOworICAgICAgICAgICAgbUNvbG9yTWFza0IgPSB0cnVlOworICAgICAgICAgICAgbUNvbG9yTWFza0EgPSB0cnVlOworICAgICAgICAgICAgbUJsZW5kU3JjID0gQmxlbmRTcmNGdW5jLk9ORTsKKyAgICAgICAgICAgIG1CbGVuZERzdCA9IEJsZW5kRHN0RnVuYy5aRVJPOworCisKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldERlcHRoRnVuYyhEZXB0aEZ1bmMgZnVuYykgeworICAgICAgICAgICAgbURlcHRoRnVuYyA9IGZ1bmM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXREZXB0aE1hc2soYm9vbGVhbiBlbmFibGUpIHsKKyAgICAgICAgICAgIG1EZXB0aE1hc2sgPSBlbmFibGU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRDb2xvck1hc2soYm9vbGVhbiByLCBib29sZWFuIGcsIGJvb2xlYW4gYiwgYm9vbGVhbiBhKSB7CisgICAgICAgICAgICBtQ29sb3JNYXNrUiA9IHI7CisgICAgICAgICAgICBtQ29sb3JNYXNrRyA9IGc7CisgICAgICAgICAgICBtQ29sb3JNYXNrQiA9IGI7CisgICAgICAgICAgICBtQ29sb3JNYXNrQSA9IGE7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRCbGVuZEZ1bmMoQmxlbmRTcmNGdW5jIHNyYywgQmxlbmREc3RGdW5jIGRzdCkgeworICAgICAgICAgICAgbUJsZW5kU3JjID0gc3JjOworICAgICAgICAgICAgbUJsZW5kRHN0ID0gZHN0OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0RGl0aGVyRW5hYmxlKGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgICAgICBtRGl0aGVyID0gZW5hYmxlOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIHN5bmNocm9uaXplZCBQcm9ncmFtU3RvcmUgaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBCdWlsZGVyIGIpIHsKKyAgICAgICAgICAgIGludCBpbklEID0gMDsKKyAgICAgICAgICAgIGludCBvdXRJRCA9IDA7CisgICAgICAgICAgICBpZiAoYi5tSW4gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluSUQgPSBiLm1Jbi5tSUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYi5tT3V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXRJRCA9IGIubU91dC5tSUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVCZWdpbihpbklELCBvdXRJRCk7CisgICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aEZ1bmMoYi5tRGVwdGhGdW5jLm1JRCk7CisgICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aE1hc2soYi5tRGVwdGhNYXNrKTsKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtRnJhZ21lbnRTdG9yZUNvbG9yTWFzayhiLm1Db2xvck1hc2tSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIubUNvbG9yTWFza0csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYi5tQ29sb3JNYXNrQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLm1Db2xvck1hc2tBKTsKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtRnJhZ21lbnRTdG9yZUJsZW5kRnVuYyhiLm1CbGVuZFNyYy5tSUQsIGIubUJsZW5kRHN0Lm1JRCk7CisgICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVEaXRoZXIoYi5tRGl0aGVyKTsKKworICAgICAgICAgICAgaW50IGlkID0gcnMublByb2dyYW1GcmFnbWVudFN0b3JlQ3JlYXRlKCk7CisgICAgICAgICAgICByZXR1cm4gbmV3IFByb2dyYW1TdG9yZShpZCwgcnMpOworICAgICAgICB9CisKKyAgICAgIC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gQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICovCisKK3BhY2thZ2UgYW5kcm9pZC5yZW5kZXJzY3JpcHQ7CisKKworaW1wb3J0IGFuZHJvaWQudXRpbC5Db25maWc7CitpbXBvcnQgYW5kcm9pZC51dGlsLkxvZzsKKworCisvKioKKyAqIEBoaWRlCisgKgorICoqLworcHVibGljIGNsYXNzIFByb2dyYW1WZXJ0ZXggZXh0ZW5kcyBCYXNlT2JqIHsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBNQVhfTElHSFQgPSA4OworCisgICAgUHJvZ3JhbVZlcnRleChpbnQgaWQsIFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBzdXBlcihycyk7CisgICAgICAgIG1JRCA9IGlkOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGJpbmRBbGxvY2F0aW9uKE1hdHJpeEFsbG9jYXRpb24gdmEpIHsKKyAgICAgICAgbVJTLm5Qcm9ncmFtVmVydGV4QmluZEFsbG9jYXRpb24obUlELCB2YS5tQWxsb2MubUlEKTsKKyAgICB9CisKKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQnVpbGRlciB7CisgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CisgICAgICAgIEVsZW1lbnQgbUluOworICAgICAgICBFbGVtZW50IG1PdXQ7CisgICAgICAgIExpZ2h0W10gbUxpZ2h0czsKKyAgICAgICAgaW50IG1MaWdodENvdW50OworICAgICAgICBib29sZWFuIG1UZXh0dXJlTWF0cml4RW5hYmxlOworCisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzLCBFbGVtZW50IGluLCBFbGVtZW50IG91dCkgeworICAgICAgICAgICAgbVJTID0gcnM7CisgICAgICAgICAgICBtSW4gPSBpbjsKKyAgICAgICAgICAgIG1PdXQgPSBvdXQ7CisgICAgICAgICAgICBtTGlnaHRzID0gbmV3IExpZ2h0W01BWF9MSUdIVF07CisgICAgICAgICAgICBtTGlnaHRDb3VudCA9IDA7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRUZXh0dXJlTWF0cml4RW5hYmxlKGJvb2xlYW4gZW5hYmxlKSB7CisgICAgICAgICAgICBtVGV4dHVyZU1hdHJpeEVuYWJsZSA9IGVuYWJsZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZExpZ2h0KExpZ2h0IGwpIHRocm93cyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24geworICAgICAgICAgICAgaWYobUxpZ2h0Q291bnQgPj0gTUFYX0xJR0hUKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTWF4IGxpZ2h0IGNvdW50IGV4Y2VlZGVkLiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUxpZ2h0c1ttTGlnaHRDb3VudF0gPSBsOworICAgICAgICAgICAgbUxpZ2h0Q291bnQrKzsKKyAgICAgICAgfQorCisKKworICAgICAgICBzdGF0aWMgc3luY2hyb25pemVkIFByb2dyYW1WZXJ0ZXggaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBCdWlsZGVyIGIpIHsKKyAgICAgICAgICAgIGludCBpbklEID0gMDsKKyAgICAgICAgICAgIGludCBvdXRJRCA9IDA7CisgICAgICAgICAgICBpZiAoYi5tSW4gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluSUQgPSBiLm1Jbi5tSUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYi5tT3V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXRJRCA9IGIubU91dC5tSUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBycy5uUHJvZ3JhbVZlcnRleEJlZ2luKGluSUQsIG91dElEKTsKKyAgICAgICAgICAgIGZvcihpbnQgY3Q9MDsgY3QgPCBiLm1MaWdodENvdW50OyBjdCsrKSB7CisgICAgICAgICAgICAgICAgcnMublByb2dyYW1WZXJ0ZXhBZGRMaWdodChiLm1MaWdodHNbY3RdLm1JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBycy5uUHJvZ3JhbVZlcnRleFNldFRleHR1cmVNYXRyaXhFbmFibGUoYi5tVGV4dHVyZU1hdHJpeEVuYWJsZSk7CisgICAgICAgICAgICBpbnQgaWQgPSBycy5uUHJvZ3JhbVZlcnRleENyZWF0ZSgpOworICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9ncmFtVmVydGV4KGlkLCBycyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgUHJvZ3JhbVZlcnRleCBjcmVhdGUoKSB7CisgICAgICAgICAgICByZXR1cm4gaW50ZXJuYWxDcmVhdGUobVJTLCB0aGlzKTsKKyAgICAgICAgfQorICAgIH0KKworCisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIE1hdHJpeEFsbG9jYXRpb24geworICAgICAgICBzdGF0aWMgZmluYWwgaW50IE1PREVMVklFV19PRkZTRVQgPSAwOworICAgICAgICBzdGF0aWMgZmluYWwgaW50IFBST0pFQ1RJT05fT0ZGU0VUID0gMTY7CisgICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgVEVYVFVSRV9PRkZTRVQgPSAzMjsKKworICAgICAgICBNYXRyaXggbU1vZGVsOworICAgICAgICBNYXRyaXggbVByb2plY3Rpb247CisgICAgICAgIE1hdHJpeCBtVGV4dHVyZTsKKworICAgICAgICBwdWJsaWMgQWxsb2NhdGlvbiBtQWxsb2M7CisKKyAgICAg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NYXQpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgbG9hZFRleHR1cmUoTWF0cml4IG0pIHsKKyAgICAgICAgICAgIG1UZXh0dXJlID0gbTsKKyAgICAgICAgICAgIG1BbGxvYy5zdWJEYXRhMUQoVEVYVFVSRV9PRkZTRVQsIDE2LCBtLm1NYXQpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0dXBPcnRob1dpbmRvdyhpbnQgdywgaW50IGgpIHsKKyAgICAgICAgICAgIG1Qcm9qZWN0aW9uLmxvYWRPcnRobygwLHcsIGgsMCwgLTEsMSk7CisgICAgICAgICAgICBtQWxsb2Muc3ViRGF0YTFEKFBST0pFQ1RJT05fT0ZGU0VULCAxNiwgbVByb2plY3Rpb24ubU1hdCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXR1cE9ydGhvTm9ybWFsaXplZChpbnQgdywgaW50IGgpIHsKKyAgICAgICAgICAgIC8vIHJhbmdlIC0xLDEgaW4gdGhlIG5hcnJvdyBheGlzLgorICAgICAgICAgICAgaWYodyA+IGgpIHsKKyAgICAgICAgICAgICAgICBmbG9hdCBhc3BlY3QgPSAoKGZsb2F0KXcpIC8gaDsKKyAgICAgICAgICAgICAgICBtUHJvamVjdGlvbi5sb2FkT3J0aG8oLWFzcGVjdCxhc3BlY3QsICAtMSwxLCAgLTEsMSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZsb2F0IGFzcGVjdCA9ICgoZmxvYXQpaCkgLyB3OworICAgICAgICAgICAgICAgIG1Qcm9qZWN0aW9uLmxvYWRPcnRobygtMSwxLCAtYXNwZWN0LGFzcGVjdCwgIC0xLDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChQUk9KRUNUSU9OX09GRlNFVCwgMTYsIG1Qcm9qZWN0aW9uLm1NYXQpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0dXBQcm9qZWN0aW9uTm9ybWFsaXplZChpbnQgdywgaW50IGgpIHsKKyAgICAgICAgICAgIC8vIHJhbmdlIC0xLDEgaW4gdGhlIG5hcnJvdyBheGlzIGF0IHogPSAwLgorICAgICAgICAgICAgTWF0cml4IG0xID0gbmV3IE1hdHJpeCgpOworICAgICAgICAgICAgTWF0cml4IG0yID0gbmV3IE1hdHJpeCgpOworCisgICAgICAgICAgICBpZih3ID4gaCkgeworICAgICAgICAgICAgICAgIGZsb2F0IGFzcGVjdCA9ICgoZmxvYXQpdykgLyBoOworICAgICAgICAgICAgICAgIG0xLmxvYWRGcnVzdHVtKC1hc3BlY3QsYXNwZWN0LCAgLTEsMSwgIDEsMTAwKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZmxvYXQgYXNwZWN0ID0gKChmbG9hdCloKSAvIHc7CisgICAgICAgICAgICAgICAgbTEubG9hZEZydXN0dW0oLTEsMSwgLWFzcGVjdCxhc3BlY3QsIDEsMTAwKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbTIubG9hZFJvdGF0ZSgxODAsIDAsIDEsIDApOworICAgICAgICAgICAgbTEubG9hZE11bHRpcGx5KG0xLCBtMik7CisKKyAgICAgICAgICAgIG0yLmxvYWRTY2FsZSgtMiwgMiwgMSk7CisgICAgICAgICAgICBtMS5sb2FkTXVsdGlwbHkobTEsIG0yKTsKKworICAgICAgICAgICAgbTIubG9hZFRyYW5zbGF0ZSgwLCAwLCAyKTsKKyAgICAgICAgICAgIG0xLmxvYWRNdWx0aXBseShtMSwgbTIpOworCisgICAgICAgICAgICBtUHJvamVjdGlvbiA9IG0xOworICAgICAgICAgICAgbUFsbG9jLnN1YkRhdGExRChQUk9KRUNUSU9OX09GRlNFVCwgMTYsIG1Qcm9qZWN0aW9uLm1NYXQpOworICAgICAgICB9CisKKyAgICB9CisKK30KKwpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmR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ICAgc3VwZXIoY29udGV4dCk7CisgICAgICAgIGluaXQoKTsKKyAgICAgICAgTG9nLnYoUmVuZGVyU2NyaXB0LkxPR19UQUcsICJSU1N1cmZhY2VWaWV3Iik7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RhbmRhcmQgVmlldyBjb25zdHJ1Y3Rvci4gSW4gb3JkZXIgdG8gcmVuZGVyIHNvbWV0aGluZywgeW91CisgICAgICogbXVzdCBjYWxsIHtAbGluayAjc2V0UmVuZGVyZXJ9IHRvIHJlZ2lzdGVyIGEgcmVuZGVyZXIuCisgICAgICovCisgICAgcHVibGljIFJTU3VyZmFjZVZpZXcoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgYXR0cnMpOworICAgICAgICBpbml0KCk7CisgICAgICAgIExvZy52KFJlbmRlclNjcmlwdC5MT0dfVEFHLCAiUlNTdXJmYWNlVmlldyIpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0KCkgeworICAgICAgICAvLyBJbnN0YWxsIGEgU3VyZmFjZUhvbGRlci5DYWxsYmFjayBzbyB3ZSBnZXQgbm90aWZpZWQgd2hlbiB0aGUKKyAgICAgICAgLy8gdW5kZXJseWluZyBzdXJmYWNlIGlzIGNyZWF0ZWQgYW5kIGRlc3Ryb3llZAorICAgICAgICBTdXJmYWNlSG9sZGVyIGhvbGRlciA9IGdldEhvbGRlcigpOworICAgICAgICBob2xkZXIuYWRkQ2FsbGJhY2sodGhpcyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgaXMgcGFydCBvZiB0aGUgU3VyZmFjZUhvbGRlci5DYWxsYmFjayBpbnRlcmZhY2UsIGFuZCBpcworICAgICAqIG5vdCBub3JtYWxseSBjYWxsZWQgb3Igc3ViY2xhc3NlZCBieSBjbGllbnRzIG9mIFJTU3VyZmFjZVZpZXcuCisgICAgICovCisgICAgcHVibGljIHZva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0ZSB3aXRoIHRoZSBSZW5kZXJlciBvbiB0aGUgcmVuZGVyaW5nIHRocmVhZC4KKyAgICAgKiBNdXN0IG5vdCBiZSBjYWxsZWQgYmVmb3JlIGEgcmVuZGVyZXIgaGFzIGJlZW4gc2V0LgorICAgICAqIEBwYXJhbSByIHRoZSBydW5uYWJsZSB0byBiZSBydW4gb24gdGhlIEdMIHJlbmRlcmluZyB0aHJlYWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgcXVldWVFdmVudChSdW5uYWJsZSByKSB7CisgICAgICAgIExvZy52KFJlbmRlclNjcmlwdC5MT0dfVEFHLCAicXVldWVFdmVudCIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgbWV0aG9kIGlzIHVzZWQgYXMgcGFydCBvZiB0aGUgVmlldyBjbGFzcyBhbmQgaXMgbm90IG5vcm1hbGx5CisgICAgICogY2FsbGVkIG9yIHN1YmNsYXNzZWQgYnkgY2xpZW50cyBvZiBSU1N1cmZhY2VWaWV3LgorICAgICAqIE11c3Qgbm90IGJlIGNhbGxlZCBiZWZvcmUgYSByZW5kZXJlciBoYXMgYmVlbiBzZXQuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25EZXRhY2hlZEZyb21XaW5kb3coKSB7CisgICAgICAgIHN1cGVyLm9uRGV0YWNoZWRGcm9tV2luZG93KCk7CisgICAgfQorCisgICAgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgcHVibGljIFJlbmRlclNjcmlwdCBjcmVhdGVSZW5kZXJTY3JpcHQoYm9vbGVhbiB1c2VEZXB0aCkgeworICAgICAgICBTdXJmYWNlIHN1ciA9IG51bGw7CisgICAgICAgIHdoaWxlICgoc3VyID09IG51bGwpIHx8IChtU3VyZmFjZUhvbGRlciA9PSBudWxsKSkgeworICAgICAgIC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bgorICAgIHsKKyAgICAgICAgaWYocy5sZW5ndGgoKSA8IDEpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImZpbGVPcGVuIGRvZXMgbm90IGFjY2VwdCBhIHplcm8gbGVuZ3RoIHN0cmluZy4iKTsKKyAgICAgICAgfQorCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBieXRlW10gYnl0ZXMgPSBzLmdldEJ5dGVzKCJVVEYtOCIpOworICAgICAgICAgICAgaW50IGlkID0gbkZpbGVPcGVuKGJ5dGVzKTsKKyAgICAgICAgICAgIHJldHVybiBuZXcgRmlsZShpZCk7CisgICAgICAgIH0gY2F0Y2ggKGphdmEuaW8uVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihlKTsKKyAgICAgICAgfQorICAgIH0KKworCisgICAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKyAgICAvLyBSb290IHN0YXRlCisKKyAgICBwdWJsaWMgdm9pZCBjb250ZXh0QmluZFJvb3RTY3JpcHQoU2NyaXB0IHMpIHsKKyAgICAgICAgaW50IGlkID0gMDsKKyAgICAgICAgaWYocyAhPSBudWxsKSB7CisgICAgICAgICAgICBpZCA9IHMubUlEOworICAgICAgICB9CisgICAgICAgIG5Db250ZXh0QmluZFJvb3RTY3JpcHQoaWQpOworICAgIH0KKworICAgIC8vcHVibGljIHZvaWQgY29udGV4dEJpbmRTYW1wbGVyKFNhbXBsZXIgcywgaW50IHNsb3QpIHsKKyAgICAgICAgLy9uQ29udGV4dEJpbmRTYW1wbGVyKHMubUlEKTsKKyAgICAvL30KKworICAgIHB1YmxpYyB2b2lkIGNvbnRleHRCaW5kUHJvZ3J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DEpLAorICAgICAgICBMSU5FQVJfTUlQX0xJTkVBUiAoMiksCisgICAgICAgIFdSQVAgKDMpLAorICAgICAgICBDTEFNUCAoNCk7CisKKyAgICAgICAgaW50IG1JRDsKKyAgICAgICAgVmFsdWUoaW50IGlkKSB7CisgICAgICAgICAgICBtSUQgPSBpZDsKKyAgICAgICAgfQorICAgIH0KKworICAgIFNhbXBsZXIoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgc3VwZXIocnMpOworICAgICAgICBtSUQgPSBpZDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgeworICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOworICAgICAgICBWYWx1ZSBtTWluOworICAgICAgICBWYWx1ZSBtTWFnOworICAgICAgICBWYWx1ZSBtV3JhcFM7CisgICAgICAgIFZhbHVlIG1XcmFwVDsKKyAgICAgICAgVmFsdWUgbVdyYXBSOworCisgICAgICAgIHB1YmxpYyBCdWlsZGVyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICAgICAgbVJTID0gcnM7CisgICAgICAgICAgICBtTWluID0gVmFsdWUuTkVBUkVTVDsKKyAgICAgICAgICAgIG1NYWcgPSBWYWx1ZS5ORUFSRVNUOworICAgICAgICAgICAgbVdyYXBTID0gVmFsdWUuV1JBUDsKKyAgICAgICAgICAgIG1XcmFwVCA9IFZhbHVlLldSQVA7CisgICAgICAgICAgICBtV3JhcFIgPSBWYWx1ZS5XUkFQOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0TWluKFZhbHVlIHYpIHsKKyAgICAgICAgICAgIG1NaW4gPSB2OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0TWFnKFZhbHVlIHYpIHsKKyAgICAgICAgICAgIG1NYWcgPSB2OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0V3JhcFMoVmFsdWUgdikgeworICAgICAgICAgICAgbVdyYXBTID0gdjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFdyYXBUKFZhbHVlIHYpIHsKKyAgICAgICAgICAgIG1XcmFwVCA9IHY7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRXcmFwUihWYWx1ZSB2KSB7CisgICAgICAgICAgICBtV3JhcFIgPSB2OworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIHN5bmNocm9uaXplZCBTYW1wbGVyIGludGVybmFsQ3JlYXRlKFJlbmRlclNjcmlwdCBycywgQnVpbGRlciBiKSB7CisgICAgICAgICAgICBycy5uU2FtcGxlckJlZ2luKCk7CisgICAgICAgICAgICBycy5uU2FtcGxlclNldCgwLCBiLm1NaW4ubUlEKTsKKyAgICAgICAgICAgIHJzLm5TYW1wbGVyU2V0KDEsIGIubU1hZy5tSUQpOworICAgICAgICAgICAgcnMublNhbXBsZXJTZXQoMiwgYi5tV3JhcFMubUlEKTsKKyAgICAgICAgICAgIHJzLm5TYW1wbGVyU2V0KDMsIGIubVdyYXBULm1JRCk7CisgICAgICAgICAgICBycy5uU2FtcGxlclNldCg0LCBiLm1XcmFwUi5tSUQpOworICAgICAgICAgICAgaW50IGlkID0gcnMublNhbXBsZXJDcmVhdGUoKTsKKyAgICAgICAgICAgIHJldHVybiBuZXcgU2FtcGxlcihpZCwgcnMpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFNhbXBsZXIgY3JlYXRlKCkgeworICAgICAgICAgICAgcmV0dXJuIGludGVybmFsQ3JlYXRlKG1SUywgdGhpcyk7CisgICAgICAgIH0KKyAgICB9CisKK30KKwpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9TY3JpcHQuamF2YSBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvU2NyaXB0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5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4dGVuZHMgQmFzZU9iaiB7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgTUFYX1NMT1QgPSAxNjsKKworICAgIGJvb2xlYW4gbUlzUm9vdDsKKyAgICBUeXBlW10gbVR5cGVzOworICAgIGJvb2xlYW5bXSBtV3JpdGFibGU7CisKKyAgICBTY3JpcHQoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgc3VwZXIocnMpOworICAgICAgICBtSUQgPSBpZDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBiaW5kQWxsb2NhdGlvbihBbGxvY2F0aW9uIHZhLCBpbnQgc2xvdCkgeworICAgICAgICBtUlMublNjcmlwdEJpbmRBbGxvY2F0aW9uKG1JRCwgdmEubUlELCBzbG90KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRDbGVhckNvbG9yKGZsb2F0IHIsIGZsb2F0IGcsIGZsb2F0IGIsIGZsb2F0IGEpIHsKKyAgICAgICAgbVJTLm5TY3JpcHRTZXRDbGVhckNvbG9yKG1JRCwgciwgZywgYiwgYSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Q2xlYXJEZXB0aChmbG9hdCBkKSB7CisgICAgICAgIG1SUy5uU2NyaXB0U2V0Q2xlYXJEZXB0aChtSUQsIGQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENsZWFyU3RlbmNpbChpbnQgc3RlbmNpbCkgeworICAgICAgICBtUlMublNjcmlwdFNldENsZWFyU3RlbmNpbChtSUQsIHN0ZW5jaWwpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFRpbWVab25lKFN0cmluZyB0aW1lWm9uZSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgbVJTLm5TY3JpcHRTZXRUaW1lWm9uZShtSUQsIHRpbWVab25lLmdldEJ5dGVzKCJVVEYtOCIpKTsKKyAgICAgICAgfSBjYXRjaCAoamF2YS5pby5VbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBCdWlsZGVyIHsKKyAgICAgICAgUmVuZGVyU2NyaXB0IG1SUzsKKyAgICAgICAgYm9vbGVhbiBtSXNSb290ID0gZmFsc2U7CisgICAgICAgIFR5cGVbXSBtVHlwZXM7CisgICAgICAgIFN0cmluZ1tdIG1OYW1lczsKKyAgICAgICAgYm9vbGVhbltdIG1Xcml0YWJsZTsKKworICAgICAgICBCdWlsZGVyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICAgICAgbVJTID0gcnM7CisgICAgICAgICAgICBtVHlwZXMgPSBuZXcgVHlwZVtNQVhfU0xPVF07CisgICAgICAgICAgICBtTmFtZXMgPSBuZXcgU3RyaW5nW01BWF9TTE9UXTsKKyAgICAgICAgICAgIG1Xcml0YWJsZSA9IG5ldyBib29sZWFuW01BWF9TTE9UXTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFR5cGUoVHlwZSB0LCBpbnQgc2xvdCkgeworICAgICAgICAgICAgbVR5cGVzW3Nsb3RdID0gdDsKKyAgICAgICAgICAgIG1OYW1lc1tzbG90XSA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRUeXBlKFR5cGUgdCwgU3RyaW5nIG5hbWUsIGludCBzbG90KSB7CisgICAgICAgICAgICBtVHlwZXNbc2xvdF0gPSB0OworICAgICAgICAgICAgbU5hbWVzW3Nsb3RdID0gbmFtZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFR5cGUoYm9vbGVhbiB3cml0YWJsZSwgaW50IHNsb3QpIHsKKyAgICAgICAgICAgIG1Xcml0YWJsZVtzbG90XSA9IHdyaXRhYmxlOworICAgICAgICB9CisKKyAgICAgICAgdm9pZCB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ICAgcHVibGljIHZvaWQgc2V0U2NyaXB0KFJlc291cmNlcyByZXNvdXJjZXMsIGludCBpZCkgeworICAgICAgICAgICAgSW5wdXRTdHJlYW0gaXMgPSByZXNvdXJjZXMub3BlblJhd1Jlc291cmNlKGlkKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgc2V0U2NyaXB0KGlzKTsKKyAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICBpcy5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2goSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSZXNvdXJjZXMuTm90Rm91bmRFeGNlcHRpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFNjcmlwdChJbnB1dFN0cmVhbSBpcykgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIGJ5dGVbXSBidWYgPSBuZXcgYnl0ZVsxMDI0XTsKKyAgICAgICAgICAgIGludCBjdXJyZW50UG9zID0gMDsKKyAgICAgICAgICAgIHdoaWxlKHRydWUpIHsKKyAgICAgICAgICAgICAgICBpbnQgYnl0ZXNMZWZ0ID0gYnVmLmxlbmd0aCAtIGN1cnJlbnRQb3M7CisgICAgICAgICAgICAgICAgaWYgKGJ5dGVzTGVmdCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBidWYyID0gbmV3IGJ5dGVbYnVmLmxlbmd0aCAqIDJdOworICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGJ1ZiwgMCwgYnVmMiwgMCwgYnVmLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIGJ1ZiA9IGJ1ZjI7CisgICAgICAgICAgICAgICAgICAgIGJ5dGVzTGVmdCA9IGJ1Zi5sZW5ndGggLSBjdXJyZW50UG9zOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgYnl0ZXNSZWFkID0gaXMucmVhZChidWYsIGN1cnJlbnRQb3MsIGJ5dGVzTGVmdCk7CisgICAgICAgICAgICAgICAgaWYgKGJ5dGVzUmVhZCA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjdXJyZW50UG9zICs9IGJ5dGVzUmVhZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Qcm9ncmFtID0gYnVmOworICAgICAgICAgICAgbVByb2dyYW1MZW5ndGggPSBjdXJyZW50UG9zOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIHN5bmNocm9uaXplZCBTY3JpcHRDIGludGVybmFsQ3JlYXRlKEJ1aWxkZXIgYikgeworICAgICAgICAgICAgYi5tUlMublNjcmlwdENCZWdpbigpOworICAgICAgICAgICAgYi50cmFuc2ZlckNyZWF0ZSgpOworCisgICAgICAgICAgICBmb3IgKEVudHJ5PFN0cmluZyxJbnRlZ2VyPiBlOiBiLm1JbnREZWZpbmVzLmVudHJ5U2V0KCkpIHsKKyAgICAgICAgICAgICAgICBiLm1SUy5uU2NyaXB0Q0FkZERlZmluZUkzMihlLmdldEtleSgpLCBlLmdldFZhbHVlKCkuaW50VmFsdWUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IgKEVudHJ5PFN0cmluZyxGbG9hdD4gZTogYi5tRmxvYXREZWZpbmVzLmVudHJ5U2V0KCkpIHsKKyAgICAgICAgICAgICAgICBiLm1SUy5uU2NyaXB0Q0FkZERlZmluZUYoZS5nZXRLZXkoKSwgZS5nZXRWYWx1ZSgpLmZsb2F0VmFsdWUoKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGIubVJTLm5TY3JpcHRDU2V0U2NyaXB0KGIubVByb2dyYW0sIDAsIGIubVByb2dyYW1MZW5ndGgpOworCisgICAgICAgICAgICBpbnQgaWQgPSBiLm1SUy5uU2NyaXB0Q0NyZWF0ZSgpOworICAgICAgICAgICAgU2NyaXB0QyBvYmogPSBuZXcgU2NyaXB0QyhpZCwgYi5tUlMpOworICAgICAgICAgICAgYi50cmFuc2Zlck9iamVjdChvYmopOworCisgICAgICAgICAgICByZXR1cm4gb2JqOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgYWRkRGVmaW5lKFN0cmluZyBuYW1lLCBpbnQgdmFsdWUpIHsKKyAgICAgICAgICAgIG1JbnREZWZpbmVzLnB1dChuYW1lLCB2YWx1ZSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBhZGREZWZpbmUoU3RyaW5nIG5hbWUsIGZsb2F0IHZhbHVlKSB7CisgICAgICAgICAgICBtRmxvYXREZWZpbmVzLnB1dChuYW1lLCB2YWx1ZSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGFrZXMgdGhlIGFsbCBwdWJsaWMgc3RhdGljIGZpbmFsIGZpZWxkcyBmb3IgYSBjbGFzcywgYW5kIGFkZHMgZGVmaW5lcworICAgICAgICAgKiBmb3IgdGhlbSwgdXNpbmcgdGhlIG5hbWUgb2YgdGhlIGZpZWxkIGFzIHRoZSBuYW1lIG9mIHRoZSBkZWZpbmUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBhZGREZWZpbmVzKENsYXNzIGNsKSB7CisgICAgICAgICAgICBhZGREZWZpbmVzKGNsLmdldEZpZWxkcygpLCAoTW9kaWZpZXIuU1RBVElDIHwgTW9kaWZpZXIuRklOQUwgfCBNb2RpZmllci5QVUJMSUMpLCBudWxsKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBUYWtlcyB0aGUgYWxsIHB1YmxpYyBmaWVsZHMgZm9yIGFuIG9iamVjdCwgYW5kIGFkZHMgZGVmaW5lcworICAgICAgICAgKiBmb3IgdGhlbSwgdXNpbmcgdGhlIG5hbWUgb2YgdGhlIGZpZWxkIGFzIHRoZSBuYW1lIG9mIHRoZSBkZWZpbmUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBhZGREZWZpbmVzKE9iamVjdCBvKSB7CisgICAgICAgICAgICBhZGREZWZpbmVzKG8uZ2V0Q2xhc3MoKS5nZXRGaWVsZHMoKSwgTW9kaWZpZXIuUFVCTElDLCBvKTsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgYWRkRGVmaW5lcyhGaWVsZFtdIGZpZWxkcywgaW50IG1hc2ssIE9iamVjdCBvKSB7CisgICAgICAgICAgICBmb3IgKEZpZWxkIGY6IGZpZWxkcykgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoZi5nZXRNb2RpZmllcnMoKSAmIG1hc2spID09IG1hc2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIENsYXNzIHQgPSBmLmdldFR5cGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ID09IGludC5jbGFzcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnREZWZpbmVzLnB1dChmLmdldE5hbWUoKSwgZi5nZXRJbnQobykpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodCA9PSBmbG9hdC5jbGFzcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GbG9hdERlZmluZXMucHV0KGYuZ2V0TmFtZSgpLCBmLmdldEZsb2F0KG8pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogRG8gd2Ugd2FudCB0aGlzIGxvZz8KKyAg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xlTWVzaEJpbmRJbmRleChtSUQsIGEubUlEKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQWxsb2NhdGlvbiBjcmVhdGVWZXJ0ZXhBbGxvY2F0aW9uKGludCBzbG90KSB7CisgICAgICAgIHJldHVybiBBbGxvY2F0aW9uLmNyZWF0ZVR5cGVkKG1SUywgbVZlcnRleFR5cGVzW3Nsb3RdKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQWxsb2NhdGlvbiBjcmVhdGVJbmRleEFsbG9jYXRpb24oKSB7CisgICAgICAgIHJldHVybiBBbGxvY2F0aW9uLmNyZWF0ZVR5cGVkKG1SUywgbUluZGV4VHlwZSk7CisgICAgfQorCisgICAgcHVibGljIFR5cGUgZ2V0VmVydGV4VHlwZShpbnQgc2xvdCkgeworICAgICAgICByZXR1cm4gbVZlcnRleFR5cGVzW3Nsb3RdOworICAgIH0KKworICAgIHB1YmxpYyBUeXBlIGdldEluZGV4VHlwZSgpIHsKKyAgICAgICAgcmV0dXJuIG1JbmRleFR5cGU7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBCdWlsZGVyIHsKKyAgICAgICAgUmVuZGVyU2NyaXB0IG1SUzsKKworICAgICAgICBjbGFzcyBFbnRyeSB7CisgICAgICAgICAgICBUeXBlIHQ7CisgICAgICAgICAgICBFbGVtZW50IGU7CisgICAgICAgICAgICBpbnQgc2l6ZTsKKyAgICAgICAgfQorCisgICAgICAgIGludCBtVmVydGV4VHlwZUNvdW50OworICAgICAgICBFbnRyeVtdIG1WZXJ0ZXhUeXBlczsKKyAgICAgICAgRW50cnkgbUluZGV4VHlwZTsKKyAgICAgICAgLy9FbnRyeSBtQmF0Y2hUeXBlOworICAgICAgICBQcmltaXRpdmUgbVByaW1pdGl2ZTsKKworCisgICAgICAgIHB1YmxpYyBCdWlsZGVyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICAgICAgbVJTID0gcnM7CisgICAgICAgICAgICBtVmVydGV4VHlwZUNvdW50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hUeXBlQ291bnQ7CisgICAgICAgICAgICBtVmVydGV4VHlwZXNbbVZlcnRleFR5cGVDb3VudF0gPSBuZXcgRW50cnkoKTsKKyAgICAgICAgICAgIG1WZXJ0ZXhUeXBlc1ttVmVydGV4VHlwZUNvdW50XS5lID0gZTsKKyAgICAgICAgICAgIG1WZXJ0ZXhUeXBlc1ttVmVydGV4VHlwZUNvdW50XS5zaXplID0gc2l6ZTsKKyAgICAgICAgICAgIG1WZXJ0ZXhUeXBlQ291bnQrKzsKKyAgICAgICAgICAgIHJldHVybiBhZGRlZEluZGV4OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0SW5kZXhUeXBlKFR5cGUgdCkgeworICAgICAgICAgICAgbUluZGV4VHlwZS50ID0gdDsKKyAgICAgICAgICAgIG1JbmRleFR5cGUuZSA9IG51bGw7CisgICAgICAgICAgICBtSW5kZXhUeXBlLnNpemUgPSAwOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0SW5kZXhUeXBlKEVsZW1lbnQgZSwgaW50IHNpemUpIHsKKyAgICAgICAgICAgIG1JbmRleFR5cGUudCA9IG51bGw7CisgICAgICAgICAgICBtSW5kZXhUeXBlLmUgPSBlOworICAgICAgICAgICAgbUluZGV4VHlwZS5zaXplID0gc2l6ZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFByaW1pdGl2ZShQcmltaXRpdmUgcCkgeworICAgICAgICAgICAgbVByaW1pdGl2ZSA9IHA7CisgICAgICAgIH0KKworCisgICAgICAgIFR5cGUgbmV3VHlwZShFbGVtZW50IGUsIGludCBzaXplKSB7CisgICAgICAgICAgICBUeXBlLkJ1aWxkZXIgdGIgPSBuZXcgVHlwZS5CdWlsZGVyKG1SUywgZSk7CisgICAgICAgICAgICB0Yi5hZGQoRGltZW5zaW9uLlgsIHNpemUpOworICAgICAgICAgICAgcmV0dXJuIHRiLmNyZWF0ZSgpOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIHN5bmNocm9uaXplZCBTaW1wbGVNZXNoIGludGVybmFsQ3JlYXRlKFJlbmRlclNjcmlwdCBycywgQnVpbGRlciBiKSB7CisgICAgICAgICAgICBUeXBlW10gdG9EZXN0cm95ID0gbmV3IFR5cGVbMThdOworICAgICAgICAgICAgaW50IHRvRGVzdHJveUNvdW50ID0gMDsKKworICAgICAgICAgICAgaW50IGluZGV4SUQgPSAwOworICAgICAgICAgICAgaWYoYi5tSW5kZXhUeXBlLnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluZGV4SUQgPSBiLm1JbmRleFR5cGUudC5tSUQ7CisgICAgICAgICAgICB9IGVsc2UgaWYoYi5tSW5kZXhUeXBlLnNpemUgIT0gMCkgeworICAgICAgICAgICAgICAgIGIubUluZGV4VHlwZS50ID0gYi5uZXdUeXBlKGIubUluZGV4VHlwZS5lLCBiLm1JbmRleFR5cGUuc2l6ZSk7CisgICAgICAgICAgICAgICAgaW5kZXhJRCA9IGIubUluZGV4VHlwZS50Lm1JRDsKKyAgICAgICAgICAgICAgICB0b0Rlc3Ryb3lbdG9EZXN0cm95Q291bnQrK10gPSBiLm1JbmRleFR5cGUudDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50W10gSURzID0gbmV3IGludFtiLm1WZXJ0ZXhUeXBlQ291bnRdOworICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IGIubVZlcnRleFR5cGVDb3VudDsgY3QrKykgeworICAgICAgICAgICAgICAgIGlmKGIubVZlcnRleFR5cGVzW2N0XS50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgSURzW2N0XSA9IGIubVZlcnRleFR5cGVzW2N0XS50Lm1JRDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBiLm1WZXJ0ZXhUeXBlc1tjdF0udCA9IGIubmV3VHlwZShiLm1WZXJ0ZXhUeXBlc1tjdF0uZSwgYi5tVmVydGV4VHlwZXNbY3RdLnNpemUpOworICAgICAgICAgICAgICAgICAgICBJRHNbY3RdID0gYi5tVmVydGV4VHlwZXNbY3RdLnQubUlEOworICAgICAgICAgICAgICAgICAgICB0b0Rlc3Ryb3lbdG9EZXN0cm95Q291bnQrK10gPSBiLm1WZXJ0ZXhUeXBlc1tjdF0udDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCBpZCA9IHJzLm5TaW1wbGVNZXNoQ3JlYXRlKDAsIGluZGV4SUQsIElEcywgYi5tUHJpbWl0aXZlLm1JRCk7CisgICAgICAgICAgICBmb3IoaW50IGN0PTA7IGN0IDwgdG9EZXN0cm95Q291bnQ7IGN0KyspIHsKKyAgICAgICAgICAgICAgICB0b0Rlc3Ryb3lbY3RdLmRlc3Ryb3koKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG5ldyBTaW1wbGVNZXNoKGlkLCBycyk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgU2ltcGxlTWVzaCBjcmVhdGUoKSB7CisgICAgICAgICAgICBMb2cuZSgicnMiLCAiU2ltcGxlTWVzaCBjcmVhdGUiKTsKKyAgICAgICAgICAgIFNpbXBsZU1lc2ggc20gPSBpbnRlcm5hbENyZWF0ZShtUlMsIHRoaXMpOworICAgICAgICAgICAgc20ubVZlcnRleFR5cGVzID0gbmV3IFR5cGVbbVZlcnRleFR5cGVDb3VudF07CisgICAgICAgICAgICBmb3IoaW50IGN0PTA7IGN0IDwgbVZlcnRleFR5cGVDb3VudDsgY3QrKykgeworICAgICAgICAgICAgICAgIHNtLm1WZXJ0ZXhUeXBlc1tjdF0gPSBtVmVydGV4VHlwZXNbY3RdLnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzbS5tSW5kZXhUeXBlID0gbUluZGV4VHlwZS50OworICAgICAgICAgICAgc20ubVByaW1pdGl2ZSA9IG1QcmltaXRpdmU7CisgICAgICAgICAgICByZXR1cm4gc207CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIFRyaWFuZ2xlTWVzaEJ1aWxkZXIgeworICAgICAgICBmbG9hdCBtVnR4RGF0YVtdOworICAgICAgICBpbnQgbVZ0eENvdW50OworICAgICAgICBpbnQgbUluZGV4RGF0YVtdOworICAgICAgICBpbnQgbUluZGV4Q291bnQ7CisgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CisgICAgICAgIEVsZW1lbnQgbUVsZW1lbnQ7CisKKyAgICAgICAgaW50IG1WdHhTaXplOworICAgICAgICBib29sZWFuIG1Ob3JtOworICAgICAgICBib29sZWFuIG1UZXg7CisKKyAgICAgICAgcHVibGljIFRyaWFuZ2xlTWVzaEJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzLCBpbnQgdnR4U2l6ZSwgYm9vbGVhbiBub3JtLCBib29sZWFuIHRleCkgeworICAgICAgICAgICAgbVJTID0gcnM7CisgICAgICAgICAgICBtVnR4Q291bnQgPSAwOworICAgICAgICAgICAgbUluZGV4Q291bnQgPSAwOworICAgICAgICAgICAgbVZ0eERhdGEgPSBuZXcgZmxvYXRbMTI4XTsKKyAgICAgICAgICAgIG1JbmRleERhdGEgPSBuZXcgaW50WzEyOF07CisgICAgICAgICAgICBtVnR4U2l6ZSA9IHZ0eFNpemU7CisgICAgICAgICAgICBtTm9ybSA9IG5vcm07CisgICAgICAgICAgICBtVGV4ID0gdGV4OworCisgICAgICAgICAgICBpZih2dHhTaXplIDwgMiB8fCB2dHhTaXplID4gMykgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlZlcnRleCBzaXplIG91dCBvZiByYW5nZS4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBtYWtlU3BhY2UoaW50IGNvdW50KSB7CisgICAgICAgICAgICBpZigobVZ0eENvdW50ICsgY291bnQpID49IG1WdHhEYXRhLmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGZsb2F0IHRbXSA9IG5ldyBmbG9hdFttVnR4RGF0YS5sZW5ndGggKiAyXTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1WdHhEYXRhLCAwLCB0LCAwLCBtVnR4RGF0YS5sZW5ndGgpOworICAgICAgICAgICAgICAgIG1WdHhEYXRhID0gdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZF9YWShmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgICAgICBpZigobVZ0eFNpemUgIT0gMikgfHwgbU5vcm0gfHwgbVRleCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImFkZCBtaXN0bWF0Y2ggd2l0aCBkZWNsYWlyZWQgY29tcG9uZW50cy4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1ha2VTcGFjZSgyKTsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHg7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB5OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgYWRkX1hZWihmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6KSB7CisgICAgICAgICAgICBpZigobVZ0eFNpemUgIT0gMykgfHwgbU5vcm0gfHwgbVRleCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImFkZCBtaXN0bWF0Y2ggd2l0aCBkZWNsYWlyZWQgY29tcG9uZW50cy4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1ha2VTcGFjZSgzKTsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHg7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB5OworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gejsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZF9YWV9TVChmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCBzLCBmbG9hdCB0KSB7CisgICAgICAgICAgICBpZigobVZ0eFNpemUgIT0gMikgfHwgbU5vcm0gfHwgIW1UZXgpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJhZGQgbWlzdG1hdGNoIHdpdGggZGVjbGFpcmVkIGNvbXBvbmVudHMuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtYWtlU3BhY2UoNCk7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB4OworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0geTsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHM7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB0OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgYWRkX1hZWl9TVChmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6LCBmbG9hdCBzLCBmbG9hdCB0KSB7CisgICAgICAgICAgICBpZigobVZ0eFNpemUgIT0gMykgfHwgbU5vcm0gfHwgIW1UZXgpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJhZGQgbWlzdG1hdGNoIHdpdGggZGVjbGFpcmVkIGNvbXBvbmVudHMuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtYWtlU3BhY2UoNSk7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB4OworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0geTsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHo7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBzOworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gdDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZF9YWVpfU1RfTk9STShmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6LCBmbG9hdCBzLCBmbG9hdCB0LCBmbG9hdCBueCwgZmxvYXQgbnksIGZsb2F0IG56KSB7CisgICAgICAgICAgICBpZigobVZ0eFNpemUgIT0gMykgfHwgIW1Ob3JtIHx8ICFtVGV4KSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiYWRkIG1pc3RtYXRjaCB3aXRoIGRlY2xhaXJlZCBjb21wb25lbnRzLiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbWFrZVNwYWNlKDgpOworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0geDsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHk7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSB6OworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gczsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IHQ7CisgICAgICAgICAgICBtVnR4RGF0YVttVnR4Q291bnQrK10gPSBueDsKKyAgICAgICAgICAgIG1WdHhEYXRhW21WdHhDb3VudCsrXSA9IG55OworICAgICAgICAgICAgbVZ0eERhdGFbbVZ0eENvdW50KytdID0gbno7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBhZGRUcmlhbmdsZShpbnQgaWR4MSwgaW50IGlkeDIsIGludCBpZHgzKSB7CisgICAgICAgICAgICBpZigobUluZGV4Q291bnQgKyAzKSA+PSBtSW5kZXhEYXRhLmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGludCB0W10gPSBuZXcgaW50W21JbmRleERhdGEubGVuZ3RoICogMl07CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtSW5kZXhEYXRhLCAwLCB0LCAwLCBtSW5kZXhEYXRhLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgbUluZGV4RGF0YSA9IHQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtSW5kZXhEYXRhW21JbmRleENvdW50KytdID0gaWR4MTsKKyAgICAgICAgICAgIG1JbmRleERhdGFbbUluZGV4Q291bnQrK10gPSBpZHgyOworICAgICAgICAgICAgbUluZGV4RGF0YVttSW5kZXhDb3VudCsrXSA9IGlkeDM7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgU2ltcGxlTWVzaCBjcmVhdGUoKSB7CisgICAgICAgICAgICBFbGVtZW50LkJ1aWxkZXIgYiA9IG5ldyBFbGVtZW50LkJ1aWxkZXIobVJTKTsKKyAgICAgICAgICAgIGludCBmbG9hdENvdW50ID0gbVZ0eFNpemU7CisgICAgICAgICAgICBpZihtVnR4U2l6ZSA9PSAyKSB7CisgICAgICAgICAgICAgICAgYi5hZGRGbG9hdFhZKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGIuYWRkRmxvYXRYWVooKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKG1UZXgpIHsKKyAgICAgICAgICAgICAgICBmbG9hdENvdW50ICs9IDI7CisgICAgICAgICAgICAgICAgYi5hZGRGbG9hdFNUKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihtTm9ybSkgeworICAgICAgICAgICAgICAgIGZsb2F0Q291bnQgKz0gMzsKKyAgICAgICAgICAgICAgICBiLmFkZEZsb2F0Tm9ybSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUVsZW1lbnQgPSBiLmNyZWF0ZSgpOworCisgICAgICAgICAgICBCdWlsZGVyIHNtYiA9IG5ldyBCdWlsZGV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cGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCitwYWNrYWdlIGFuZHJvaWQucmVuZGVyc2NyaXB0OworCitpbXBvcnQgamF2YS5sYW5nLnJlZmxlY3QuRmllbGQ7CisKKy8qKgorICogQGhpZGUKKyAqCisgKiovCitwdWJsaWMgY2xhc3MgVHlwZSBleHRlbmRzIEJhc2VPYmogeworICAgIERpbWVuc2lvbltdIG1EaW1lbnNpb25zOworICAgIGludFtdIG1WYWx1ZXM7CisgICAgRWxlbWVudCBtRWxlbWVudDsKKyAgICBwcml2YXRlIGludCBtTmF0aXZlQ2FjaGU7CisgICAgQ2xhc3MgbUphdmFDbGFzczsKKworCisgICAgVHlwZShpbnQgaWQsIFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBzdXBlcihycyk7CisgICAgICAgIG1JRCA9IGlkOworICAgICAgICBtTmF0aXZlQ2FjaGUgPSAwOworICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgdGhyb3dzIFRocm93YWJsZSB7CisgICAgICAgIGlmKG1OYXRpdmVDYWNoZSAhPSAwKSB7CisgICAgICAgICAgICBtUlMublR5cGVGaW5hbERlc3Ryb3kodGhpcyk7CisgICAgICAgICAgICBtTmF0aXZlQ2FjaGUgPSAwOworICAgICAgICB9CisgICAgICAgIHN1cGVyLmZpbmFsaXplKCk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBUeXBlIGNyZWF0ZUZyb21DbGFzcyhSZW5kZXJTY3JpcHQgcnMsIENsYXNzIGMsIGludCBzaXplKSB7CisgICAgICAgIEVsZW1lbnQgZSA9IEVsZW1lbnQuY3JlYXRlRnJvbUNsYXNzKHJzLCBjKTsKKyAgICAgICAgQnVpbGRlciBiID0gbmV3IEJ1aWxkZXIocnMsIGUpOworICAgICAgICBiLmFkZChEaW1lbnNpb24uWCwgc2l6ZSk7CisgICAgICAgIFR5cGUgdCA9IGIuY3JlYXRlKCk7CisgICAgICAgIGUuZGVzdHJveSgpOworCisgICAgICAgIC8vIG5hdGl2ZSBmaWVsZHMKKyAgICAgICAgeworICAgICAgICAgICAgRmllbGRbXSBmaWVsZHMgPSBjLmdldEZpZWxkcygpOworICAgICAgICAgICAgaW50W10gYXJUeXBlcyA9IG5ldyBpbnRbZmllbGRzLmxlbmd0aF07CisgICAgICAgICAgICBpbnRbXSBhckJpdHMgPSBuZXcgaW50W2ZpZWxkcy5sZW5ndGhdOworCisgICAgICAgICAgICBmb3IoaW50IGN0PTA7IGN0IDwgZmllbGRzLmxlbmd0aDsgY3QrKykgeworICAgICAgICAgICAgICAgIEZpZWxkIGYgPSBmaWVsZHNbY3RdOworICAgICAgICAgICAgICAgIENsYXNzIGZjID0gZi5nZXRUeXBlKCk7CisgICAgICAgICAgICAgICAgaWYoZmMgPT0gaW50LmNsYXNzKSB7CisgICAgICAgICAgICAgICAgICAgIGFyVHlwZXNbY3RdID0gRWxlbWVudC5EYXRhVHlwZS5TSUdORUQubUlEOworICAgICAgICAgICAgICAgICAgICBhckJpdHNbY3RdID0gMzI7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGZjID09IHNob3J0LmNsYXNzKSB7CisgICAgICAgICAgICAgICAgICAgIGFyVHlwZXNbY3RdID0gRWxlbWVudC5EYXRhVHlwZS5TSUdORUQubUlEOworICAgICAgICAgICAgICAgICAgICBhckJpdHNbY3RdID0gMTY7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGZjID09IGJ5dGUuY2xhc3MpIHsKKyAgICAgICAgICAgICAgICAgICAgYXJUeXBlc1tjdF0gPSBFbGVtZW50LkRhdGFUeXBlLlNJR05FRC5tSUQ7CisgICAgICAgICAgICAgICAgICAgIGFyQml0c1tjdF0gPSA4OworICAgICAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBmbG9hdC5jbGFzcykgeworICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuRkxPQVQubUlEOworICAgICAgICAgICAgICAgICAgICBhckJpdHNbY3RdID0gMzI7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rb3duIGZpZWxkIHR5cGUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBycy5uVHlwZVNldHVwRmllbGRzKHQsIGFyVHlwZXMsIGFyQml0cywgZmllbGRzKTsKKyAgICAgICAgfQorICAgICAgICB0Lm1KYXZhQ2xhc3MgPSBjOworICAgICAgICByZXR1cm4gdDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFR5cGUgY3JlYXRlRnJvbUNsYXNzKFJlbmRlclNjcmlwdCBycywgQ2xhc3MgYywgaW50IHNpemUsIFN0cmluZyBzY3JpcHROYW1lKSB7CisgICAgICAgIFR5cGUgdCA9IGNyZWF0ZUZyb21DbGFzcyhycywgYywgc2l6ZSk7CisgICAgICAgIHQuc2V0TmFtZShzY3JpcHROYW1lKTsKKyAgICAgICAgcmV0dXJuIHQ7CisgICAgfQorCisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgeworICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOworICAgICAgICBFbnRyeVtdIG1FbnRyaWVzOworICAgICAgICBpbnQgbUVudHJ5Q291bnQ7CisgICAgICAgIEVsZW1lbnQgbUVsZW1lbnQ7CisKKyAgICAgICAgY2xhc3MgRW50cnkgeworICAgICAgICAgICAgRGltZW5zaW9uIG1EaW07CisgICAgICAgICAgICBpbnQgbVZhbHVlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIoUmVuZGVyU2NyaXB0IHJzLCBFbGVtZW50IGUpIHsKKyAgICAgICAgICAgIG1SUyA9IHJzOworICAgICAgICAgICAgbUVudHJpZXMgPSBuZXcgRW50cnlbNF07CisgICAgICAgICAgICBtRWxlbWVudCA9IGU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBhZGQoRGltZW5zaW9uIGQsIGludCB2YWx1ZSkgeworICAgICAgICAgICAgaWYobUVudHJpZXMubGVuZ3RoID49IG1FbnRyeUNvdW50KSB7CisgICAgICAgICAgICAgICAgRW50cnlbXSBlbiA9IG5ldyBFbnRyeVttRW50cnlDb3VudCArIDhdOworICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkobUVudHJpZXMsIDAsIGVuLCAwLCBtRW50cmllcy5sZW5ndGgpOworICAgICAgICAgICAgICAgIG1FbnRyaWVzID0gZW47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRW50cmllc1ttRW50cnlDb3VudF0gPSBuZXcgRW50cnkoKTsKKyAgICAgICAgICAgIG1FbnRyaWVzW21FbnRyeUNvdW50XS5tRGltID0gZDsKKyAgICAgICAgICAgIG1FbnRyaWVzW21FbnRyeUNvdW50XS5tVmFsdWUgPSB2YWx1ZTsKKyAgICAgICAgICAgIG1FbnRyeUNvdW50Kys7CisgICAgICAgIH0KKworICAgICAgICBzdGF0aWMgc3luY2hyb25pemVkIFR5cGUgaW50ZXJuYWxDcmVhdGUoUmVuZGVyU2NyaXB0IHJzLCBCdWlsZGVyIGIpIHsKKyAgICAgICAgICAgIHJzLm5UeXBlQmVnaW4oYi5tRWxlbWVudC5tSUQpOworICAgICAgICAgICAgZm9yIChpbnQgY3Q9MDsgY3QgPCBiLm1FbnRyeUNvdW50OyBjdCsrKSB7CisgICAgICAgICAgICAgICAgRW50cnkgZW4gPSBiLm1FbnRyaWVzW2N0XTsKKyAgICAgICAgICAgICAgICBycy5uVHlwZUFkZChlbi5tRGltLm1JRCwgZW4ubVZhbHVlKTsKKyAgICAgICAgICAgIH0K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gICBMT0dfQVBJKCJuQXNzaWduTmFtZSwgY29uKCVwKSwgb2JqKCVwKSIsIGNvbiwgKHZvaWQgKilvYmopOworCisgICAgamludCBsZW4gPSBfZW52LT5HZXRBcnJheUxlbmd0aChzdHIpOworICAgIGpieXRlICogY3B0ciA9IChqYnl0ZSAqKSBfZW52LT5HZXRQcmltaXRpdmVBcnJheUNyaXRpY2FsKHN0ciwgMCk7CisgICAgcnNBc3NpZ25OYW1lKGNvbiwgKHZvaWQgKilvYmosIChjb25zdCBjaGFyICopY3B0ciwgbGVuKTsKKyAgICBfZW52LT5SZWxlYXNlUHJpbWl0aXZlQXJyYXlDcml0aWNhbChzdHIsIGNwdHIsIEpOSV9BQk9SVCk7Cit9CisKK3N0YXRpYyB2b2lkCituT2JqRGVzdHJveShKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgb2JqKQoreworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIm5PYmpEZXN0cm95LCBjb24oJXApIG9iaiglcCkiLCBjb24sICh2b2lkICopb2JqKTsKKyAgICByc09iakRlc3Ryb3koY29uLCAodm9pZCAqKW9iaik7Cit9CisKK3N0YXRpYyB2b2lkCituT2JqRGVzdHJveU9PQihKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgb2JqKQoreworICAgIC8vIFRoaXMgZnVuY3Rpb24gb25seSBkaWZmZXJzIGZyb20gbk9iakRlc3Ryb3kgaW4gdGhhdCBpdCBjYWxscyB0aGUKKyAgICAvLyBzcGVjaWFsIE91dCBPZiBCYW5kIHZlcnNpb24gb2YgT2JqRGVzdHJveSB3aGljaCBpcyB0aHJlYWQgc2FmZS4KKyAgICBSc0NvbnRleHQgY29uID0gKFJzQ29udGV4dCkoX2Vudi0+R2V0SW50RmllbGQoX3RoaXMsIGdDb250ZXh0SWQpKTsKKyA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pZAorbkNvbnRleHREZXN0cm95KEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBjb24pCit7CisgICAgTE9HX0FQSSgibkNvbnRleHREZXN0cm95LCBjb24oJXApIiwgKFJzQ29udGV4dCljb24pOworICAgIHJldHVybiByc0NvbnRleHREZXN0cm95KChSc0NvbnRleHQpY29uKTsKK30KKworCitzdGF0aWMgdm9pZAorbkVsZW1lbnRCZWdpbihKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMpCit7CisgICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CisgICAgTE9HX0FQSSgibkVsZW1lbnRCZWdpbiwgY29uKCVwKSIsIGNvbik7CisgICAgcnNFbGVtZW50QmVnaW4oY29uKTsKK30KKworCitzdGF0aWMgdm9pZAorbkVsZW1lbnRBZGQoSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBqaW50IGtpbmQsIGppbnQgdHlwZSwgamludCBub3JtLCBqaW50IGJpdHMsIGpzdHJpbmcgbmFtZSkKK3sKKyAgICBSc0NvbnRleHQgY29uID0gKFJzQ29udGV4dCkoX2Vudi0+R2V0SW50RmllbGQoX3RoaXMsIGdDb250ZXh0SWQpKTsKKyAgICBjb25zdCBjaGFyKiBuID0gTlVMTDsKKyAgICBpZiAobmFtZSkgeworICAgICAgICBuID0gX2Vudi0+R2V0U3RyaW5nVVRGQ2hhcnMobmFtZSwgTlVMTCk7CisgICAgfQorICAgIExPR19BUEkoIm5FbGVtZW50QWRkLCBjb24oJXApLCBraW5kKCVpKSwgdHlwZSglaSksIG5vcm0oJWkpLCBiaXRzKCVpKSIsIGNvbiwga2luZCwgdHlwZSwgbm9ybSwgYml0cyk7CisgICAgcnNFbGVtZW50QWRkKGNvbiwgKFJzRGF0YUtpbmQpa2luZCwgKFJzRGF0YVR5cGUpdHlwZSwgbm9ybSAhPSAwLCAoc2l6ZV90K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ciA9IFNGX0xvYWRGbG9hdDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJTX1RZUEVfVU5TSUdORUQ6CisgICAgICAgIGNhc2UgUlNfVFlQRV9TSUdORUQ6CisgICAgICAgICAgICBzd2l0Y2godGZjW2N0XS5iaXRzKSB7CisgICAgICAgICAgICBjYXNlIDMyOiAgICB0ZmNbY3RdLnB0ciA9IFNGX0xvYWRJbnQ7ICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDE2OiAgICB0ZmNbY3RdLnB0ciA9IFNGX0xvYWRTaG9ydDsgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDg6ICAgICB0ZmNbY3RdLnB0ciA9IFNGX0xvYWRCeXRlOyAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB0Yy0+c2l6ZSArPSA0OworICAgIH0KKworICAgIF9lbnYtPlJlbGVhc2VJbnRBcnJheUVsZW1lbnRzKF90eXBlcywgZlR5cGUsIEpOSV9BQk9SVCk7CisgICAgX2Vudi0+UmVsZWFzZUludEFycmF5RWxlbWVudHMoX2JpdHMsIGZCaXRzLCBKTklfQUJPUlQpOworfQorCisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK3N0YXRpYyBqaW50CituQWxsb2NhdGlvbkNyZWF0ZVR5cGVkKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBlKQoreworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIm5BbGxvY2F0aW9uQ3JlYXRlVHlwZWQsIGNvbiglcCksIGUoJXApIiwgY29uLCAoUnNFbGVtZW50KWUpOworICAgIHJldHVybiAoamludCkgcnNBbGxvY2F0aW9uQ3JlYXRlVHlwZWQoY29uLCAoUnNFbGVtZW50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ICAgU2tCaXRtYXAgY29uc3QgKiBuYXRpdmVCaXRtYXAgPQorICAgICAgICAgICAgKFNrQml0bWFwIGNvbnN0ICopX2Vudi0+R2V0SW50RmllbGQoamJpdG1hcCwgZ05hdGl2ZUJpdG1hcElEKTsKKyAgICBjb25zdCBTa0JpdG1hcCYgYml0bWFwKCpuYXRpdmVCaXRtYXApOworICAgIFNrQml0bWFwOjpDb25maWcgY29uZmlnID0gYml0bWFwLmdldENvbmZpZygpOworCisgICAgUnNFbGVtZW50IGUgPSBTa0JpdG1hcFRvUHJlZGVmaW5lZChjb25maWcpOworICAgIGlmIChlKSB7CisgICAgICAgIGJpdG1hcC5sb2NrUGl4ZWxzKCk7CisgICAgICAgIGNvbnN0IGludCB3ID0gYml0bWFwLndpZHRoKCk7CisgICAgICAgIGNvbnN0IGludCBoID0gYml0bWFwLmhlaWdodCgpOworICAgICAgICBjb25zdCB2b2lkKiBwdHIgPSBiaXRtYXAuZ2V0UGl4ZWxzKCk7CisgICAgICAgIGppbnQgaWQgPSAoamludClyc0FsbG9jYXRpb25DcmVhdGVGcm9tQml0bWFwKGNvbiwgdywgaCwgKFJzRWxlbWVudClkc3RGbXQsIGUsIGdlbk1pcHMsIHB0cik7CisgICAgICAgIGJpdG1hcC51bmxvY2tQaXhlbHMoKTsKKyAgICAgICAgcmV0dXJuIGlkOworICAgIH0KKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludAorbkFsbG9jYXRpb25DcmVhdGVGcm9tQXNzZXRTdHJlYW0oSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzLCBqaW50IGRzdEZtdCwgamJvb2xlYW4gZ2VuTWlwcywgamludCBuYXRpdmVfYXNzZXQpCit7CisgICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CisKKyAgICBBc3NldCogYXNzZXQgPSByZWludGVycHJldF9jYXN0PEFzc2V0Kj4obmF0aXZ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hdGUoSk5JRW52ICpfZW52LCBqb2JqZWN0IF90aGlzKQoreworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIm5BZGFwdGVyMURDcmVhdGUsIGNvbiglcCkiLCBjb24pOworICAgIHJldHVybiAoamludClyc0FkYXB0ZXIxRENyZWF0ZShjb24pOworfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitzdGF0aWMgdm9pZAorbkFkYXB0ZXIyREJpbmRBbGxvY2F0aW9uKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBhZGFwdGVyLCBqaW50IGFsbG9jKQoreworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIm5BZGFwdGVyMkRCaW5kQWxsb2NhdGlvbiwgY29uKCVwKSwgYWRhcHRlciglcCksIGFsbG9jKCVwKSIsIGNvbiwgKFJzQWRhcHRlcjJEKWFkYXB0ZXIsIChSc0FsbG9jYXRpb24pYWxsb2MpOworICAgIHJzQWRhcHRlcjJEQmluZEFsbG9jYXRpb24oY29uLCAoUnNBZGFwdGVyMkQpYWRhcHRlciwgKFJzQWxsb2NhdGlvbilhbGxvYyk7Cit9CisKK3N0YXRpYyB2b2lkCituQWRhcHRlcjJEU2V0Q29uc3RyYWludChKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgYWRhcHRlciwgamludCBkaW0sIGppbnQgdmFsdWUpCit7CisgICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CisgICAgTE9HX0FQSSgibkFkYXB0ZXIyRFNldENvbnN0cmFpbnQsIGNvbiglcCksIGF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gZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIm5BZGFwdGVyMkRDcmVhdGUsIGNvbiglcCkiLCBjb24pOworICAgIHJldHVybiAoamludClyc0FkYXB0ZXIyRENyZWF0ZShjb24pOworfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitzdGF0aWMgdm9pZAorblNjcmlwdEJpbmRBbGxvY2F0aW9uKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBzY3JpcHQsIGppbnQgYWxsb2MsIGppbnQgc2xvdCkKK3sKKyAgICBSc0NvbnRleHQgY29uID0gKFJzQ29udGV4dCkoX2Vudi0+R2V0SW50RmllbGQoX3RoaXMsIGdDb250ZXh0SWQpKTsKKyAgICBMT0dfQVBJKCJuU2NyaXB0QmluZEFsbG9jYXRpb24sIGNvbiglcCksIHNjcmlwdCglcCksIGFsbG9jKCVwKSwgc2xvdCglaSkiLCBjb24sIChSc1NjcmlwdClzY3JpcHQsIChSc0FsbG9jYXRpb24pYWxsb2MsIHNsb3QpOworICAgIHJzU2NyaXB0QmluZEFsbG9jYXRpb24oY29uLCAoUnNTY3JpcHQpc2NyaXB0LCAoUnNBbGxvY2F0aW9uKWFsbG9jLCBzbG90KTsKK30KKworc3RhdGljIHZvaWQKK25TY3JpcHRTZXRDbGVhckNvbG9yKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBzY3JpcHQsIGpmbG9hdCByLCBqZmxvYXQgZywgamZsb2F0IGIsIGpmbG9hdCBhKQoreworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIm5TY3JpcHRTZXRDbGVhckNvbG9yLCBjb24oJXApLCBzKCVwKSwgciglZiksIGcoJWYpLCBiKCVmKSwgYSglZikiLCBjb24sICh2b2lkICopc2NyaXB0LCByLCBnLCBiLCBhKT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CBvZmZzZXQsIGppbnQgbGVuZ3RoKQoreworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIiEhISBuU2NyaXB0Q1NldFNjcmlwdCwgY29uKCVwKSIsIGNvbik7CisgICAgamludCBfZXhjZXB0aW9uID0gMDsKKyAgICBqaW50IHJlbWFpbmluZzsKKyAgICBqYnl0ZSogc2NyaXB0X2Jhc2UgPSAwOworICAgIGpieXRlKiBzY3JpcHRfcHRyOworICAgIGlmICghc2NyaXB0UmVmKSB7CisgICAgICAgIF9leGNlcHRpb24gPSAxOworICAgICAgICAvL19lbnYtPlRocm93TmV3KElBRUNsYXNzLCAic2NyaXB0ID09IG51bGwiKTsKKyAgICAgICAgZ290byBleGl0OworICAgIH0KKyAgICBpZiAob2Zmc2V0IDwgMCkgeworICAgICAgICBfZXhjZXB0aW9uID0gMTsKKyAgICAgICAgLy9fZW52LT5UaHJvd05ldyhJQUVDbGFzcywgIm9mZnNldCA8IDAiKTsKKyAgICAgICAgZ290byBleGl0OworICAgIH0KKyAgICBpZiAobGVuZ3RoIDwgMCkgeworICAgICAgICBfZXhjZXB0aW9uID0gMTsKKyAgICAgICAgLy9fZW52LT5UaHJvd05ldyhJQUVDbGFzcywgImxlbmd0aCA8IDAiKTsKKyAgICAgICAgZ290byBleGl0OworICAgIH0KKyAgICByZW1haW5pbmcgPSBfZW52LT5HZXRBcnJheUxlbmd0aChzY3JpcHRSZWYpIC0gb2Zmc2V0OworICAgIGlmIChyZW1haW5pbmcgPCBsZW5ndGgpIHsKKyAgICAgICAgX2V4Y2VwdGlvbiA9IDE7CisgICAgICAgIC8vX2Vudi0+VGhyb3dOZXcoSUFFQ2xhc3MsICJsZW5ndGggPiBzY3JpcHQubGVuZ3RoIC0gb2Zmc2V0Iik7CisgICAgICAgIGdvdG8gZXhpdDsKKyAgICB9CisgICAgc2NyaXB0X2Jh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bVZlcnRleFNldFRleHR1cmVNYXRyaXhFbmFibGUoY29uLCBlbmFibGUpOworfQorCitzdGF0aWMgdm9pZAorblByb2dyYW1WZXJ0ZXhBZGRMaWdodChKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgbGlnaHQpCit7CisgICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CisgICAgTE9HX0FQSSgiblByb2dyYW1WZXJ0ZXhBZGRMaWdodCwgY29uKCVwKSwgbGlnaHQoJXApIiwgY29uLCAoUnNMaWdodClsaWdodCk7CisgICAgcnNQcm9ncmFtVmVydGV4QWRkTGlnaHQoY29uLCAoUnNMaWdodClsaWdodCk7Cit9CisKK3N0YXRpYyBqaW50CituUHJvZ3JhbVZlcnRleENyZWF0ZShKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMpCit7CisgICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CisgICAgTE9HX0FQSSgiblByb2dyYW1WZXJ0ZXhDcmVhdGUsIGNvbiglcCkiLCBjb24pOworICAgIHJldHVybiAoamludClyc1Byb2dyYW1WZXJ0ZXhDcmVhdGUoY29uKTsKK30KKworCisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitzdGF0aWMgdm9pZAorbkNvbnRleHRCaW5kUm9vdFNjcmlwdChKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgc2NyaXB0KQoreworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworICAgIExPR19BUEkoIm5Db250ZXh0QmluZ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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworc3RhdGljIGNvbnN0IGNoYXIgKmNsYXNzUGF0aE5hbWUgPSAiYW5kcm9pZC9yZW5kZXJzY3JpcHQvUmVuZGVyU2NyaXB0IjsKKworc3RhdGljIEpOSU5hdGl2ZU1ldGhvZCBtZXRob2RzW10gPSB7Cit7Il9uSW5pdCIsICAgICAgICAgICAgICAgICAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopX25Jbml0IH0sCit7Im5Jbml0RWxlbWVudHMiLCAgICAgICAgICAgICAgICAgICIoSUlJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkluaXRFbGVtZW50cyB9LAorCit7Im5EZXZpY2VDcmVhdGUiLCAgICAgICAgICAgICAgICAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkRldmljZUNyZWF0ZSB9LAoreyJuRGV2aWNlRGVzdHJveSIsICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5EZXZpY2VEZXN0cm95IH0sCit7Im5Db250ZXh0Q3JlYXRlIiwgICAgICAgICAgICAgICAgICIoSUxhbmRyb2lkL3ZpZXcvU3VyZmFjZTtJWilJIiwgICAgICAgICAodm9pZCopbkNvbnRleHRDcmVhdGUgfSwKK3sibkNvbnRleHREZXN0cm95IiwgICAgICAgICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dERlc3Ryb3kgfSwKK3sibkFzc2lnbk5hbWUiLCAgICAgICAgICAgICAgICAgICAgIihJW0IpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQXNzaWduTmFtZSB9LAoreyJuT2JqRGVzdHJveSIsICAgICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5PYmpEZXN0cm95IH0sCit7Im5PYmpEZXN0cm95T09CIiwgICAgICAgICAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbk9iakRlc3Ryb3lPT0IgfSwKKworeyJuRmlsZU9wZW4iLCAgICAgICAgICAgICAgICAgICAgICAiKFtCKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5GaWxlT3BlbiB9LAorCit7Im5FbGVtZW50QmVnaW4iLCAgICAgICAgICAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkVsZW1lbnRCZWdpbiB9LAoreyJuRWxlbWVudEFkZCIsICAgICAgICAgICAgICAgICAgICAiKElJSUlMamF2YS9sYW5nL1N0cmluZzspViIsICAgICAgICAgICAgKHZvaWQqKW5FbGVtZW50QWRkIH0sCit7Im5FbGVtZW50Q3JlYXRlIiwgICAgICAgICAgICAgICAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkVsZW1lbnRDcmVhdGUgfSwKKworeyJuVHlwZUJlZ2luIiwgICAgICAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UeXBlQmVnaW4gfSwKK3siblR5cGVBZGQiLCAgICAgICAgICAgICAgICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluVHlwZUFkZCB9LAoreyJuVHlwZUNyZWF0ZSIsICAgICAgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UeXBlQ3JlYXRlIH0sCit7Im5UeXBlRmluYWxEZXN0cm95IiwgICAgICAgICAgICAgICIoTGFuZHJvaWQvcmVuZG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2NhdGlvblVwbG9hZFRvVGV4dHVyZSB9LAoreyJuQWxsb2NhdGlvblVwbG9hZFRvQnVmZmVyT2JqZWN0IiwiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uVXBsb2FkVG9CdWZmZXJPYmplY3QgfSwKK3sibkFsbG9jYXRpb25EYXRhIiwgICAgICAgICAgICAgICAgIihJW0lJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvbkRhdGFfaSB9LAoreyJuQWxsb2NhdGlvbkRhdGEiLCAgICAgICAgICAgICAgICAiKElbRkkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uRGF0YV9mIH0sCit7Im5BbGxvY2F0aW9uU3ViRGF0YTFEIiwgICAgICAgICAgICIoSUlJW0lJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25TdWJEYXRhMURfaSB9LAoreyJuQWxsb2NhdGlvblN1YkRhdGExRCIsICAgICAgICAgICAiKElJSVtGSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uU3ViRGF0YTFEX2YgfSwKK3sibkFsbG9jYXRpb25TdWJEYXRhMkQiLCAgICAgICAgICAgIihJSUlJSVtJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWxsb2NhdGlvblN1YkRhdGEyRF9pIH0sCit7Im5BbGxvY2F0aW9uU3ViRGF0YTJEIiwgICAgICAgICAgICIoSUlJSUlbRkkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25TdWJEYXRhMkRfZiB9LAoreyJuQWxsb2NhdGlvblJlYWQiLCAgICAgICAgICAgICAgICAiKElbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BbGxvY2F0aW9uUmVhZF9pIH0sCit7Im5BbGxvY2F0aW9uUmVhZCIsICAgICAgICAgICAgICAgICIoSVtGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFsbG9jYXRpb25SZWFkX2YgfSwKK3sibkFsbG9jYXRpb25TdWJEYXRhRnJvbU9iamVjdCIsICAgIihJTGFuZHJvaWQvcmVuZGVyc2NyaXB0L1R5cGU7SUxqYXZhL2xhbmcvT2JqZWN0OylWIiwgICAodm9pZCopbkFsbG9jYXRpb25TdWJEYXRhRnJvbU9iamVjdCB9LAorCit7Im5UcmlhbmdsZU1lc2hCZWdpbiIsICAgICAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblRyaWFuZ2xlTWVzaEJlZ2luIH0sCit7Im5UcmlhbmdsZU1lc2hBZGRWZXJ0ZXhfWFkiLCAgICAgICIoRkYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblRyaWFuZ2xlTWVzaEFkZFZlcnRleF9YWSB9LAoreyJuVHJpYW5nbGVNZXNoQWRkVmVydGV4X1hZWiIsICAgICAiKEZGRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UcmlhbmdsZU1lc2hBZGRWZXJ0ZXhfWFlaIH0sCit7Im5UcmlhbmdsZU1lc2hBZGRWZXJ0ZXhfWFlfU1QiLCAgICIoRkZGRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblRyaWFuZ2xlTWVzaEFkZFZlcnRleF9YWV9TVCB9LAoreyJuVHJpYW5nbGVNZXNoQWRkVmVydGV4X1hZWl9TVCIsICAiKEZGRkZGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UcmlhbmdsZU1lc2hBZGRWZXJ0ZXhfWFlaX1NUIH0sCit7Im5UcmlhbmdsZU1lc2hBZGRWZXJ0ZXhfWFlaX1NUX05PUk0iLCAgIihGRkZGRkZGRilWIiwgICAgICAgICAgICAgICAgICAgICAodm9pZCopblRyaWFuZ2xlTWVzaEFkZFZlcnRleF9YWVpfU1RfTk9STSB9LAoreyJuVHJpYW5nbGVNZXNoQWRkVHJpYW5nbGUiLCAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UcmlhbmdsZU1lc2hBZGRUcmlhbmdsZSB9LAoreyJuVHJpYW5nbGVNZXNoQ3JlYXRlIiwgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5UcmlhbmdsZU1lc2hDcmVhdGUgfSwKKworeyJuQWRhcHRlcjFEQmluZEFsbG9jYXRpb24iLCAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMURCaW5kQWxsb2NhdGlvbiB9LAoreyJuQWRhcHRlcjFEU2V0Q29uc3RyYWludCIsICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMURTZXRDb25zdHJhaW50IH0sCit7Im5BZGFwdGVyMUREYXRhIiwgICAgICAgICAgICAgICAgICIoSVtJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxRERhdGFfaSB9LAoreyJuQWRhcHRlcjFERGF0YSIsICAgICAgICAgICAgICAgICAiKElbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMUREYXRhX2YgfSwKK3sibkFkYXB0ZXIxRFN1YkRhdGEiLCAgICAgICAgICAgICAgIihJSUlbSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjFEU3ViRGF0YV9pIH0sCit7Im5BZGFwdGVyMURTdWJEYXRhIiwgICAgICAgICAgICAgICIoSUlJW0YpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIxRFN1YkRhdGFfZiB9LAoreyJuQWRhcHRlcjFEQ3JlYXRlIiwgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMURDcmVhdGUgfSwKKworeyJuQWRhcHRlcjJEQmluZEFsbG9jYXRpb24iLCAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRCaW5kQWxsb2NhdGlvbiB9LAoreyJuQWRhcHRlcjJEU2V0Q29uc3RyYWludCIsICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRTZXRDb25zdHJhaW50IH0sCit7Im5BZGFwdGVyMkREYXRhIiwgICAgICAgICAgICAgICAgICIoSVtJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIyRERhdGFfaSB9LAoreyJuQWRhcHRlcjJERGF0YSIsICAgICAgICAgICAgICAgICAiKElbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkREYXRhX2YgfSwKK3sibkFkYXB0ZXIyRFN1YkRhdGEiLCAgICAgICAgICAgICAgIihJSUlJSVtJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjJEU3ViRGF0YV9pIH0sCit7Im5BZGFwdGVyMkRTdWJEYXRhIiwgICAgICAgICAgICAgICIoSUlJSUlbRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkFkYXB0ZXIyRFN1YkRhdGFfZiB9LAoreyJuQWRhcHRlcjJEQ3JlYXRlIiwgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRDcmVhdGUgfSwKKworeyJuU2NyaXB0QmluZEFsbG9jYXRpb24iLCAgICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRCaW5kQWxsb2NhdGlvbiB9LAoreyJuU2NyaXB0U2V0Q2xlYXJDb2xvciIsICAgICAgICAgICAiKElGRkZGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRDbGVhckNvbG9yIH0sCit7Im5TY3JpcHRTZXRDbGVhckRlcHRoIiwgICAgICAgICAgICIoSUYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldENsZWFyRGVwdGggfSwKK3siblNjcmlwdFNldENsZWFyU3RlbmNpbCIsICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0Q2xlYXJTdGVuY2lsIH0sCit7Im5TY3JpcHRTZXRUaW1lWm9uZSIsICAgICAgICAgICAgICIoSVtCKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFRpbWVab25lIH0sCit7Im5TY3JpcHRTZXRUeXBlIiwgICAgICAgICAgICAgICAgICIoSVpMamF2YS9sYW5nL1N0cmluZztJKVYiLCAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFR5cGUgfSwKK3siblNjcmlwdFNldFJvb3QiLCAgICAgICAgICAgICAgICAgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0Um9vdCB9LAorCit7Im5TY3JpcHRDQmVnaW4iLCAgICAgICAgICAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdENCZWdpbiB9LAoreyJuU2NyaXB0Q1NldFNjcmlwdCIsICAgICAgICAgICAgICAiKFtCSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDU2V0U2NyaXB0IH0sCit7Im5TY3JpcHRDQ3JlYXRlIiwgICAgICAgICAgICAgICAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdENDcmVhdGUgfSwKK3siblNjcmlwdENBZGREZWZpbmVJMzIiLCAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztJKVYiLCAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q0FkZERlZmluZUkzMiB9LAoreyJuU2NyaXB0Q0FkZERlZmluZUYiLCAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0YpViIsICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDQWRkRGVmaW5lRiB9LAorCit7Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZUJlZ2luIiwgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlQmVnaW4gfSwKK3siblByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhGdW5jIiwgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aEZ1bmMgfSwKK3siblByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhNYXNrIiwgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aE1hc2sgfSwKK3siblByb2dyYW1GcmFnbWVudFN0b3JlQ29sb3JNYXNrIiwgIihaWlpaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVDb2xvck1hc2sgfSwKK3siblByb2dyYW1GcmFnbWVudFN0b3JlQmxlbmRGdW5jIiwgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVCbGVuZEZ1bmMgfSwKK3siblByb2dyYW1GcmFnbWVudFN0b3JlRGl0aGVyIiwgICAgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVEaXRoZXIgfSwKK3siblByb2dyYW1GcmFnbWVudFN0b3JlQ3JlYXRlIiwgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVDcmVhdGUgfSwKKworeyJuUHJvZ3JhbUZyYWdtZW50QmVnaW4iLCAgICAgICAgICAiKElJWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRCZWdpbiB9LAoreyJuUHJvZ3JhbUZyYWdtZW50QmluZFRleHR1cmUiLCAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRCaW5kVGV4dHVyZSB9LAoreyJuUHJvZ3JhbUZyYWdtZW50QmluZFNhbXBsZXIiLCAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRCaW5kU2FtcGxlciB9LAoreyJuUHJvZ3JhbUZyYWdtZW50U2V0U2xvdCIsICAgICAgICAiKElaSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTZXRTbG90IH0sCit7Im5Qcm9ncmFtRnJhZ21lbnRDcmVhdGUiLCAgICAgICAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudENyZWF0ZSB9LAorCit7Im5Qcm9ncmFtVmVydGV4QmluZEFsbG9jYXRpb24iLCAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1WZXJ0ZXhCaW5kQWxsb2NhdGlvbiB9LAoreyJuUHJvZ3JhbVZlcnRleEJlZ2luIiwgICAgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtVmVydGV4QmVnaW4gfSwKK3siblByb2dyYW1WZXJ0ZXhTZXRUZXh0dXJlTWF0cml4RW5hYmxlIiwgICAiKFopViIsICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVZlcnRleFNldFRleHR1cmVNYXRyaXhFbmFibGUgfSwKK3siblByb2dyYW1WZXJ0ZXhBZGRMaWdodCIsICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVZlcnRleEFkZExpZ2h0IH0sCit7Im5Qcm9ncmFtVmVydGV4Q3JlYXRlIiwgICAgICAgICAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1WZXJ0ZXhDcmVhdGUgfSwKKworeyJuTGlnaHRCZWdpbiIsICAgICAgICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5MaWdodEJlZ2luIH0sCit7Im5MaWdodFNldElzTW9ubyIsICAgICAgICAgICAgICAgICIoWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkxpZ2h0U2V0SXNNb25vIH0sCit7Im5MaWdodFNldElzTG9jYWwiLCAgICAgICAgICAgICAgICIoWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkxpZ2h0U2V0SXNMb2NhbCB9LAoreyJuTGlnaHRDcmVhdGUiLCAgICAgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5MaWdodENyZWF0ZSB9LAoreyJuTGlnaHRTZXRDb2xvciIsICAgICAgICAgICAgICAgICAiKElGRkYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5MaWdodFNldENvbG9yIH0sCit7Im5MaWdodFNldFBvc2l0aW9uIiwgICAgICAgICAgICAgICIoSUZGRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkxpZ2h0U2V0UG9zaXRpb24gfSwKKworeyJuQ29udGV4dEJpbmRSb290U2NyaXB0IiwgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFJvb3RTY3JpcHQgfSwKK3sibkNvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50U3RvcmUiLCIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRQcm9ncmFtRnJhZ21lbnRTdG9yZSB9LAoreyJuQ29udGV4dEJpbmRQcm9ncmFtRnJhZ21lbnQiLCAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1GcmFnbWVudCB9LAoreyJuQ29udGV4dEJpbmRQcm9ncmFtVmVydGV4IiwgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1WZXJ0ZXggfSwKKworeyJuU2FtcGxlckJlZ2luIiwgICAgICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TYW1wbGVyQmVnaW4gfSwKK3siblNhbXBsZXJTZXQiLCAgICAgICAgICAgICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2FtcGxlclNldCB9LAoreyJuU2FtcGxlckNyZWF0ZSIsICAgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TYW1wbGVyQ3JlYXRlIH0sCisKK3siblNpbXBsZU1lc2hDcmVhdGUiLCAgICAgICAgICAgICAgIihJSVtJSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2ltcGxlTWVzaENyZWF0ZSB9LAoreyJuU2ltcGxlTWVzaEJpbmRWZXJ0ZXgiLCAgICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TaW1wbGVNZXNoQmluZFZlcnRleCB9LAoreyJuU2ltcGxlTWVzaEJpbmRJbmRleCIsICAgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TaW1wbGVNZXNoQmluZEluZGV4IH0sCisKK307CisKK3N0YXRpYyBpbnQgcmVnaXN0ZXJGdW5jcyhKTklFbnYgKl9lbnYpCit7CisgICAgcmV0dXJuIGFuZHJvaWQ6OkFuZHJvaWRSdW50aW1lOjpyZWdpc3Rlck5hdGl2ZU1ldGhvZHMoCisgICAgICAgICAgICBfZW52LCBjbGFzc1BhdGhOYW1lLCBtZXRob2RzLCBORUxFTShtZXRob2RzKSk7Cit9CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitqaW50IEpOSV9PbkxvYWQoSmF2YVZNKiB2bSwgdm9pZCogcmVzZXJ2ZWQpCit7CisgICAgSk5JRW52KiBlbnYgPSBOVUxMOworICAgIGppbnQgcmVzdWx0ID0g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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgQkJpbmRlciA6IHB1YmxpYyBJQmluZGVyCit7CitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICBCQmluZGVyKCk7CisKKyAgICB2aXJ0dWFsIGNvbnN0IFN0cmluZzE2JiBnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkgY29uc3Q7CisgICAgdmlydHVhbCBib29sICAgICAgICBpc0JpbmRlckFsaXZlKCkgY29uc3Q7CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBwaW5nQmluZGVyKCk7CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBkdW1wKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiYgYXJncyk7CisKKyAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHRyYW5zYWN0KCAgIHVpbnQzMl90IGNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQYXJjZWwmIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwKTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgbGlua1RvRGVhdGgoY29uc3Qgc3A8RGVhdGhSZWNpcGllbnQ+JiByZWNpcGllbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBjb29raWUgPSBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwKTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgdW5saW5rVG9EZWF0aCggIGNvbnN0IHdwPERlYXRoUmVjaXBpZW50PiYgcmVjaXBpZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIGNvb2tpZSA9IE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdwPERlYXRoUmVjaXBpZW50Piogb3V0UmVjaXBpZW50ID0gTlVMTCk7CisKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgIGF0dGFjaE9iamVjdCggICBjb25zdCB2b2lkKiBvYmplY3RJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY2xlYW51cENvb2tpZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmplY3RfY2xlYW51cF9mdW5jIGZ1bmMpOworICAgIHZpcnR1YWwgdm9pZCogICAgICAgZmluZE9iamVjdChjb25zdCB2b2lkKiBvYmplY3RJRCkgY29uc3Q7CisgICAgdmlydHVhbCB2b2lkICAgICAgICBkZXRhY2hPYmplY3QoY29uc3Qgdm9pZCogb2JqZWN0SUQpOworCisgICAgdmlydHVhbCBCQmluZGVyKiAgICBsb2NhbEJpbmRlcigpOworCitwcm90ZWN0ZWQ6CisgICAgdmlydHVhbCAgICAgICAgICAgICB+QkJpbmRlcigpOworCisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBvblRyYW5zYWN0KCB1aW50MzJfdCBjb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUGFyY2VsJiBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsKiByZXBseSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCk7CisKK3ByaXZhdGU6CisgICAgICAgICAgICAgICAgICAgICAgICBCQmluZGVyKGNvbnN0IEJCaW5kZXImIG8pOworICAgICAgICAgICAgQkJpbmRlciYgICAgb3BlcmF0b3I9KGNvbnN0IEJCaW5kZXImIG8pOworCisgICAgY2xhc3MgRXh0cmFzOworCisgICAgICAgICAgICBFeHRyYXMqICAgICBtRXh0cmFzOworICAgICAgICAgICAgdm9pZCogICAgICAgbVJlc2VydmVkMDsKKyAgICBzdGF0aWMgIFN0cmluZzE2ICAgIHNFbXB0eURlc2NyaXB0b3I7Cit9OworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworY2xhc3MgQnBSZWZCYXNlIDogcHVibGljIHZpcnR1YWwgUmVmQmFzZQoreworcHJvdGVjdGVkOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJwUmVmQmFzZShjb25zdCBzcDxJQmluZGVyPiYgbyk7CisgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfkJwUmVmQmFzZSgpOworICAgIHZpcnR1YWwgdm9pZCAgICAgICAgICAgIG9uRmlyc3RSZWYoKTsKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBvbkxhc3RTdHJvbmdSZWYoY29uc3Qgdm9pZCogaWQpOworICAgIHZpcnR1YWwgYm9vbCAgICAgICAgICAgIG9uSW5jU3Ryb25nQXR0ZW1wdGVkKHVpbnQzMl90IGZsYWdzLCBjb25zdCB2b2lkKiBpZCk7CisKKyAgICBpbmxpbmUgIElCaW5kZXIqICAgICAgICByZW1vdGUoKSAgICAgICAgICAgICAgICB7IHJldHVybiBtUmVtb3RlOyB9CisgICAgaW5saW5lICBJQmluZGVyKiAgICAgICAgcmVtb3RlKCkgY29uc3QgICAgICAgICAgeyByZXR1cm4gbVJlbW90ZTsgfQorCitwcml2YXRlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJwUmVmQmFzZSh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sICAgICAgICBpc0JpbmRlckFsaXZlKCkgY29uc3Q7CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBwaW5nQmluZGVyKCk7CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBkdW1wKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiYgYXJncyk7CisKKyAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHRyYW5zYWN0KCAgIHVpbnQzMl90IGNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQYXJjZWwmIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwKTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgbGlua1RvRGVhdGgoY29uc3Qgc3A8RGVhdGhSZWNpcGllbnQ+JiByZWNpcGllbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBjb29raWUgPSBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwKTsKKyAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHVubGlua1RvRGVhdGgoICBjb25zdCB3cDxEZWF0aFJlY2lwaWVudD4mIHJlY2lwaWVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBjb29raWUgPSBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cDxEZWF0aFJlY2lwaWVudD4qIG91dFJlY2lwaWVudCA9IE5VTEwpOworCisgICAgdmlydHVhbCB2b2lkICAgICAgICBhdHRhY2hPYmplY3QoICAgY29uc3Qgdm9pZCogb2JqZWN0SUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIGNsZWFudXBDb29raWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqZWN0X2NsZWFudXBfZnVuYyBmdW5jKTsKKyAgICB2aXJ0dWFsIHZvaWQqICAgICAgIGZpbmRPYmplY3QoY29uc3Qgdm9pZCogb2JqZWN0SUQpIGNvbnN0OworICAgIHZpcnR1YWwgdm9pZCAgICAgICAgZGV0YWNoT2JqZWN0KGNvbnN0IHZvaWQqIG9iamVjdElEKTsKKworICAgIHZpcnR1YWwgQnBCaW5kZXIqICAgcmVtb3RlQmluZGVyKCk7CisKKyAgICAgICAgICAgIHN0YXR1c190ICAgIHNldENvbnN0YW50RGF0YShjb25zdCB2b2lkKiBkYXRhLCBzaXplX3Qgc2l6ZSk7CisgICAgICAgICAgICB2b2lkICAgICAgICBzZW5kT2JpdHVhcnkoKTsKKworICAgIGNsYXNzIE9iamVjdE1hbmFnZXIKKyAgICB7CisgICAgcHVibGljOgorICAgICAgICAgICAgICAgICAgICBPYmplY3RNYW5hZ2VyKCk7CisgICAgICAgICAgICAgICAgICAgIH5PYmplY3RNYW5hZ2VyKCk7CisKKyAgICAgICAgdm9pZCAgICAgICAgYXR0YWNoKCBjb25zdCB2b2lkKiBvYmplY3RJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY2xlYW51cENvb2tpZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBJQmluZGVyOjpvYmplY3RfY2xlYW51cF9mdW5jIGZ1bmMpOworICAgICAgICB2b2lkKiAgICAgICBmaW5kKGNvbnN0IHZvaWQqIG9iamVjdElEKSBjb25zdDsKKyAgICAgICAgdm9pZCAgICAgICAgZGV0YWNoKGNvbnN0IHZvaWQqIG9iamVjdElEKTsKKworICAgICAgICB2b2lkICAgICAgICBraWxsKCk7CisKKyAgICBwcml2YXRlOgorICAgICAgICAgICAgICAgICAgICBPYmplY3RNYW5hZ2VyKGNvbnN0IE9iamVjdE1hbmFnZXImKTsKKyAgICAgICAgT2JqZWN0TWFuYWdlciYgb3BlcmF0b3I9KGNvbnN0IE9iamVjdE1hbmFnZXImKTsKKworICAgICAgICBzdHJ1Y3QgZW50cnlfdAorICAgICAgICB7CisgICAgICAgICAgICB2b2lkKiBvYmplY3Q7CisgICAgICAgICAgICB2b2lkKiBjbGVhbnVwQ29va2llOworICAgICAgICAgICAgSUJpbmRlcjo6b2JqZWN0X2NsZWFudXBfZnVuYyBmdW5jOworICAgICAgICB9OworCisgICAgICAgIEtleWVkVmVjdG9yPGNvbnN0IHZvaWQqLCBlbnRyeV90PiBtT2JqZWN0czsKKyAgICB9OworCitwcm90ZWN0ZWQ6CisgICAgdmlydHVhbCAgICAgICAgICAgICB+QnBCaW5kZXIoKTsKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgIG9uRmlyc3RSZWYoKTsKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgIG9uTGFzdFN0cm9uZ1JlZihjb25zdCB2b2lkKiBpZCk7CisgICAgdmlydHVhbCBib29sICAgICAgICBvbkluY1N0cm9uZ0F0dGVtcHRlZCh1aW50MzJfdCBmbGFncywgY29uc3Qgdm9pZCogaWQpOworCitwcml2YXRlOgorICAgIGNvbnN0ICAgaW50MzJfdCAgICAgICAgICAgICBtSGFuZGxlOworCisgICAgc3RydWN0IE9iaXR1YXJ5IHsKKyAgICAgICAgd3A8RGVhdGhSZWNpcGllbnQ+IHJlY2lwaWVudDsKKyAgICAgICAgdm9pZCogY29va2llOworICAgICAgICB1aW50MzJfdCBmbGFnczsKKyAgICB9OworCisgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgIHJlcG9ydE9uZURlYXRoKGNvbnN0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IDA7CisKKyAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICB0cmFuc2FjdCggICB1aW50MzJfdCBjb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFBhcmNlbCYgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCkgPSAwOworCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgYWxsb3dzIHlvdSB0byBhZGQgZGF0YSB0aGF0IGlzIHRyYW5zcG9ydGVkIHRocm91Z2gKKyAgICAgKiBJUEMgYWxvbmcgd2l0aCB5b3VyIElCaW5kZXIgcG9pbnRlci4gIFdoZW4gaW1wbGVtZW50aW5nIGEgQmluZGVyCisgICAgICogb2JqZWN0LCBvdmVycmlkZSBpdCB0byB3cml0ZSB5b3VyIGRlc2lyZWQgZGF0YSBpbiB0byBAYSBvdXREYXRhLgorICAgICAqIFlvdSBjYW4gdGhlbiBjYWxsIGdldENvbnN0YW50RGF0YSgpIG9uIHlvdXIgSUJpbmRlciB0byByZXRyaWV2ZQorICAgICAqIHRoYXQgZGF0YSwgZnJvbSBhbnkgcHJvY2Vzcy4gIFlvdSBNVVNUIHJldHVybiB0aGUgbnVtYmVyIG9mIGJ5dGVzCisgICAgICogd3JpdHRlbiBpbiB0byB0aGUgcGFyY2VsIChpbmNsdWRpbmcgcGFkZGluZykuCisgICAgICovCisgICAgY2xhc3MgRGVhdGhSZWNpcGllbnQgOiBwdWJsaWMgdmlydHVhbCBSZWZCYXNlCisgICAgeworICAgIHB1YmxpYzoKKyAgICAgICAgdmlydHVhbCB2b2lkIGJpbmRlckRpZWQoY29uc3Qgd3A8SUJpbmRlcj4mIHdobykgPSAwOworICAgIH07CisKKyAgICAvKioKKyAgICAgKiBSZWdpc3RlciB0aGUgQGEgcm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IGEgd2VhayByZWZlcmVuY2UgdG8gdGhlIGRlYWQKKyAgICAgKiBiaW5kZXIuICBZb3Ugc2hvdWxkIG5vdCB0cnkgdG8gcHJvbW90ZSB0aGlzIHRvIGEgc3Ryb25nIHJlZmVyZW5jZS4KKyAgICAgKiAoTm9yIHNob3VsZCB5b3UgbmVlZCB0bywgYXMgdGhlcmUgaXMgbm90aGluZyB1c2VmdWwgeW91IGNhbgorICAgICAqIGRpcmVjdGx5IGRvIHdpdGggaXQgbm93IHRoYXQgaXQgaGFzIHBhc3NlZCBvbi4pCisgICAgICovCisgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgbGlua1RvRGVhdGgoY29uc3Qgc3A8RGVhdGhSZWNpcGllbnQ+JiByZWNpcGllbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY29va2llID0gTlVMTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyA9IDApID0gMDsKKworICAgIC8qKgorICAgICAqIFJlbW92ZSBhIHByZXZpb3VzbHkgcmVnaXN0ZXJlZCBkZWF0aCBub3RpZmljYXRpb24uCisgICAgICogVGhlIEBhIHJlY2lwaWVudCB3aWxsIG5vIGxvbmdlciBiZSBjYWxsZWQgaWYgdGhpcyBvYmplY3QKKyAgICAgKiBkaWVzLiAgVGhlIEBhIGNvb2tpZSBpcyBvcHRpb25hbC4gIElmIG5vbi1OVUxMLCB5b3UgY2FuCisgICAgICogc3VwcGx5IGEgTlVMTCBAYSByZWNpcGllbnQsIGFuZCB0aGUgcmVjaXBpZW50IHByZXZpb3VzbHkKKyAgICAgKiBhZGRlZCB3aXRoIHRoYXQgY29va2llIHdpbGwgYmUgdW5saW5rZWQuCisgICAgICovCisgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgdW5saW5rVG9EZWF0aCggIGNvbnN0IHdwPERlYXRoUmVjaXBpZW50PiYgcmVjaXBpZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBjb29raWUgPSBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyA9IDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdwPERlYXRoUmVjaXBpZW50Piogb3V0UmVjaXBpZW50ID0gTlVMTCkgPSAwOworCisgICAgdmlydHVhbCBib29sICAgICAgICAgICAgY2hlY2tTdWJjbGFzcyhjb25zdCB2b2lkKiBzdWJjbGFzc0lEKSBjb25zdDsKKworICAgIHR5cGVkZWYgdm9pZCAoKm9iamVjdF9jbGVhbnVwX2Z1bmMpKGNvbnN0IHZvaWQqIGlkLCB2b2lkKiBvYmosIHZvaWQqIGNsZWFudXBDb29raWUpOworCisgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgYXR0YWNoT2JqZWN0KCAgIGNvbnN0IHZvaWQqIG9iamVjdElELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIGNsZWFudXBDb29raWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iamVjdF9jbGVhbnVwX2Z1bmMgZnVuYykgPSAwOworICAgIHZpcnR1YWwgdm9pZCogICAgICAgICAgIGZpbmRPYmplY3QoY29uc3Qgdm9pZCogb2JqZWN0SUQpIGNvbnN0ID0gMDsKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBkZXRhY2hPYmplY3QoY29uc3Qgdm9pZCogb2JqZWN0SUQpID0gMDsKKworICAgIHZpcnR1YWwgQkJpbmRlciogICAgICAgIGxvY2FsQmluZGVyKCk7CisgICAgdmlydHVhbCBCcEJpbmRlciogICAgICAgcmVtb3RlQmluZGVyKCk7CisKK3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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworI2RlZmluZSBERUNMQVJFX01FVEFfSU5URVJGQUNFKElOVEVSRkFDRSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHN0YXRpYyBjb25zdCBTdHJpbmcxNiBkZXNjcmlwdG9yOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHN0YXRpYyBzcDxJIyNJTlRFUkZBQ0U+IGFzSW50ZXJmYWNlKGNvbnN0IHNwPElCaW5kZXI+JiBvYmopOyAgICAgICAgXAorICAgIHZpcnR1YWwgY29uc3QgU3RyaW5nMTYmIGdldEludGVyZmFjZURlc2NyaXB0b3IoKSBjb25zdDsgICAgICAgICAgICAgXAorICAgIEkjI0lOVEVSRkFDRSgpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHZpcnR1YWwgfkkjI0lOVEVSRkFDRSgpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCisKKyNkZWZpbmUgSU1QTEVNRU5UX01FVEFfSU5URVJGQUNFKElOVEVSRkFDRSwgTkFNRSkgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBjb25zdCBTdHJpbmcxNiBJIyNJTlRFUkZBQ0U6OmRlc2NyaXB0b3IoTkFNRSk7ICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBjb25zdCBTdHJpbmcxNiYgSSMjSU5URVJGQUNFOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkgY29uc3QgeyAgICAgIFwKKyAgICAgICAgcmV0dXJuIEkjI0lOVEVSRkFDRTo6ZGVzY3JpcHRvcjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBzcDxJIyNJTlRFUkZBQ0U+IEkjI0lOVEVSRkFDRTo6YXNJbnRlcmZhY2UoY29uc3Qgc3A8SUJpbmRlcj4mIG9iaikgIFwKKyAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgc3A8SSMjSU5URVJGQUNFPiBpbnRyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgaWYgKG9iaiAhPSBOVUxMKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIGludHIgPSBzdGF0aWNfY2FzdDxJIyNJTlRFUkZBQ0UqPiggICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICBvYmotPnF1ZXJ5TG9jYWxJbnRlcmZhY2UoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgIEkjI0lOVEVSRkFDRTo6ZGVzY3JpcHRvcikuZ2V0KCkpOyAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIGlmIChpbnRyID09IE5VTEwpIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICBpbnRyID0gbmV3IEJwIyNJTlRFUkZBQ0Uob2JqKTsgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgcmV0dXJuIGludHI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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nZXRDYWxsaW5nVWlkKCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGludDY0X3QgICAgICAgICAgICAgY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgcmVzdG9yZUNhbGxpbmdJZGVudGl0eShpbnQ2NF90IHRva2VuKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICBmbHVzaENvbW1hbmRzKCk7CisKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgam9pblRocmVhZFBvb2woYm9vbCBpc01haW4gPSB0cnVlKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gU3RvcCB0aGUgbG9jYWwgcHJvY2Vzcy4KKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgc3RvcFByb2Nlc3MoYm9vbCBpbW1lZGlhdGUgPSB0cnVlKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICB0cmFuc2FjdChpbnQzMl90IGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncyk7CisKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgaW5jU3Ryb25nSGFuZGxlKGludDMyX3QgaGFuZGxlKTsKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgZGVjU3Ryb25nSGFuZGxlKGludDMyX3QgaGFuZGxlKTsKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgaW5jV2Vha0hhbmRsZShpbnQzMl90IGhhbmRsZSk7CisgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgIGRlY1dlYWtIYW5kbGUoaW50MzJfdCBoYW5kbGUpOworICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICBhdHRlbXB0SW5jU3Ryb25nSGFuZGxlKGludDMyX3QgaGFuZGxlKTsKKyAgICBzdGF0aWMgIHZvaWQgICAgICAgICAgICAgICAgZXhwdW5nZUhhbmRsZShpbnQzMl90IGhhbmRsZSwgSUJpbmRlciogYmluZGVyKTsKKyAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgcmVxdWVzdERlYXRoTm90aWZpY2F0aW9uKCAgIGludDMyX3QgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQnBCaW5kZXIqIHByb3h5KTsgCisgICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgIGNsZWFyRGVhdGhOb3RpZmljYXRpb24oIGludDMyX3QgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcEJpbmRlciogcHJveHkpOyAKKworICAgIHN0YXRpYyAgdm9pZCAgICAgICAgICAgICAgICBzaHV0ZG93bigpOworICAgIAorcHJpdmF0ZToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVBDVGhyZWFkU3RhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfklQQ1RocmVhZFN0YXRlKCk7CisKKyAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgc2VuZFJlcGx5KGNvbnN0IFBhcmNlbCYgcmVwbHksIHVpbnQzMl90IGZsYWdzKTsKKyAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgd2FpdEZvclJlc3BvbnNlKFBhcmNlbCAqcmVwbHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqYWNxdWlyZVJlc3VsdD1OVUxMKTsKKyAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgdGFsa1dpdGhEcml2ZXIoYm9vbCBkb1JlY2VpdmU9dHJ1ZSk7CisgICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgIHdyaXRlVHJhbnNhY3Rpb25EYXRhKGludDMyX3QgY21kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBiaW5kZXJGbGFncywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFBhcmNlbCYgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QqIHN0YXR1c0J1ZmZlcik7CisgICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgIGV4ZWN1dGVDb21tYW5kKGludDMyX3QgY29tbWFuZCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgY2xlYXJDYWxsZXIoKTsKKyAgICAgICAgICAgIAorICAgIHN0YXRpYyAgdm9pZCAgICAgICAgICAgICAgICB0aHJlYWREZXN0cnVjdG9yKHZvaWQgKnN0KTsKKyAgICBzdGF0aWMgIHZvaWQgICAgICAgICAgICAgICAgZnJlZUJ1ZmZlcihQYXJjZWwqIHBhcmNlbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50OF90KiBkYXRhLCBzaXplX3QgZGF0YVNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90KiBvYmplY3RzLCBzaXplX3Qgb2JqZWN0c1NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY29va2llKTsKKyAgICAKKyAgICBjb25zdCAgIHNwPFByb2Nlc3NTdGF0ZT4gICAgbVByb2Nlc3M7CisgICAgICAgICAgICBWZWN0b3I8QkJpbmRlcio+ICAgIG1QZW5kaW5nU3Ryb25nRGVyZWZzOworICAgICAgICAgICAgVmVjdG9yPFJlZkJhc2U6OndlYWtyZWZfdHlwZSo+IG1QZW5kaW5nV2Vha0RlcmVmczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICBQYXJjZWwgICAgICAgICAgICAgIG1JbjsKKyAgICAgICAgICAgIFBhcmNlbCAgICAgICAgICAgICAgbU91dDsKKyAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgbUxhc3RFcnJvcjsKKyAgICAgICAgICAgIHBpZF90ICAgICAgICAgICAgICAgbUNhbGxpbmdQaWQ7CisgICAgICAgICAgICB1aWRfdCAgICAgICAgICAgICAgIG1DYWxsaW5nVWlkOworfTsKKyAgICAKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisjZW5kaWYgLy8gQU5EUk9JRF9JUENfVEhSRUFEX1NUQVRFX0gKZGlmZiAtLWdpdCBhL2luY2x1ZGUvYmluZGVyL0lQZXJtaXNzaW9uQ29udHJvbGxlci5oIGIvaW5jbHVkZS9iaW5kZXIvSVBlcm1pc3Npb25Db250cm9sbGVyLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZjlkMzcxYgotLS0gL2Rldi9udWxsCisrKyBiL2luY2x1ZGUvYmluZGVyL0lQZXJtaXNzaW9uQ29udHJvbGxlci5oCkBAIC0wLDAgKzEsNTYgQE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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK2NsYXNzIElQZXJtaXNzaW9uQ29udHJvbGxlciA6IHB1YmxpYyBJSW50ZXJmYWNlCit7CitwdWJsaWM6CisgICAgREVDTEFSRV9NRVRBX0lOVEVSRkFDRShQZXJtaXNzaW9uQ29udHJvbGxlcik7CisKKyAgICB2aXJ0dWFsIGJvb2wgICAgICAgICAgICAgICAgY2hlY2tQZXJtaXNzaW9uKGNvbnN0IFN0cmluZzE2JiBwZXJtaXNzaW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBwaWQsIGludDMyX3QgdWlkKSA9IDA7CisgICAgCisgICAgZW51bSB7CisgICAgICAgIENIRUNLX1BFUk1JU1NJT05fVFJBTlNBQ1RJT04gPSBJQmluZGVyOjpGSVJTVF9DQUxMX1RSQU5TQUNUSU9OCisgICAgfTsKK307CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworY2xhc3MgQm5QZXJtaXNzaW9uQ29udHJvbGxlciA6IHB1YmxpYyBCbkludGVyZmFjZTxJUGVybWlzc2lvbkNvbnRyb2xsZXI+Cit7CitwdWJsaWM6CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBvblRyYW5zYWN0KCB1aW50MzJfdCBjb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUGFyY2VsJiBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsKiByZXBseSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCk7Cit9OworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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yZmFjZV9jYXN0PElOVEVSRkFDRT4oc20tPmdldFNlcnZpY2UobmFtZSkpOworICAgICAgICBpZiAoKCpvdXRTZXJ2aWNlKSAhPSBOVUxMKSByZXR1cm4gTk9fRVJST1I7CisgICAgfQorICAgIHJldHVybiBOQU1FX05PVF9GT1VORDsKK30KKworYm9vbCBjaGVja0NhbGxpbmdQZXJtaXNzaW9uKGNvbnN0IFN0cmluZzE2JiBwZXJtaXNzaW9uKTsKK2Jvb2wgY2hlY2tDYWxsaW5nUGVybWlzc2lvbihjb25zdCBTdHJpbmcxNiYgcGVybWlzc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90KiBvdXRQaWQsIGludDMyX3QqIG91dFVpZCk7Citib29sIGNoZWNrUGVybWlzc2lvbihjb25zdCBTdHJpbmcxNiYgcGVybWlzc2lvbiwgcGlkX3QgcGlkLCB1aWRfdCB1aWQpOworCisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworY2xhc3MgQm5TZXJ2aWNlTWFuYWdlciA6IHB1YmxpYyBCbkludGVyZmFjZTxJU2VydmljZU1hbmFnZXI+Cit7CitwdWJsaWM6CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBvblRyYW5zYWN0KCB1aW50MzJfdCBjb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUGFyY2VsJiBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsKiByZXBseSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCk7Cit9OworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK307I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UpIHsKKyAgICAgICAgaWYgKG1GaXJzdCA9PSAwKSB7CisgICAgICAgICAgICBtRmlyc3QgPSBtTGFzdCA9IG5ld05vZGU7CisgICAgICAgICAgICBuZXdOb2RlLT5wcmV2ID0gbmV3Tm9kZS0+bmV4dCA9IDA7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBuZXdOb2RlLT5wcmV2ID0gMDsKKyAgICAgICAgICAgIG5ld05vZGUtPm5leHQgPSBtRmlyc3Q7CisgICAgICAgICAgICBtRmlyc3QtPnByZXYgPSBuZXdOb2RlOworICAgICAgICAgICAgbUZpcnN0ID0gbmV3Tm9kZTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIGluc2VydFRhaWwoTk9ERSogbmV3Tm9kZSkgeworICAgICAgICBpZiAobUxhc3QgPT0gMCkgeworICAgICAgICAgICAgaW5zZXJ0SGVhZChuZXdOb2RlKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG5ld05vZGUtPnByZXYgPSBtTGFzdDsKKyAgICAgICAgICAgIG5ld05vZGUtPm5leHQgPSAwOworICAgICAgICAgICAgbUxhc3QtPm5leHQgPSBuZXdOb2RlOworICAgICAgICAgICAgbUxhc3QgPSBuZXdOb2RlOworICAgICAgICB9CisgICAgfQorCisgICAgTk9ERSogcmVtb3ZlKE5PREUqIG5vZGUpIHsKKyAgICAgICAgaWYgKG5vZGUtPnByZXYgPT0gMCkgICAgbUZpcnN0ID0gbm9kZS0+bmV4dDsKKyAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgbm9kZS0+cHJldi0+bmV4dCA9IG5vZGUtPm5leHQ7CisgICAgICAgIGlmIChub2RlLT5uZXh0ID09IDApICAgIG1MYXN0ID0gbm9kZS0+cHJldjsKKyAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgbm9kZS0+bmV4dC0+cHJldiA9IG5vZGUtPnByZXY7CisgICAgICAgIHJldHVybiBub2RlOworICAgIH0KK307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ICAgc2l6ZV90ICAgICAgICAgICAgICBzaXplIDogMjg7CisgICAgICAgIGludCAgICAgICAgICAgICAgICAgZnJlZSA6IDQ7CisgICAgICAgIG11dGFibGUgY2h1bmtfdCogICAgcHJldjsKKyAgICAgICAgbXV0YWJsZSBjaHVua190KiAgICBuZXh0OworICAgIH07CisKKyAgICBzc2l6ZV90ICBhbGxvYyhzaXplX3Qgc2l6ZSwgdWludDMyX3QgZmxhZ3MpOworICAgIGNodW5rX3QqIGRlYWxsb2Moc2l6ZV90IHN0YXJ0KTsKKyAgICB2b2lkICAgICBkdW1wX2woY29uc3QgY2hhciogd2hhdCwgdWludDMyX3QgZmxhZ3MgPSAwKSBjb25zdDsKKyAgICB2b2lkICAgICBkdW1wX2woU3RyaW5nOCYgcmVzLCBjb25zdCBjaGFyKiB3aGF0LCB1aW50MzJfdCBmbGFncyA9IDApIGNvbnN0OworCisgICAgc3RhdGljIGNvbnN0IGludCAgICBrTWVtb3J5QWxpZ247CisgICAgbXV0YWJsZSBNdXRleCAgICAgICBtTG9jazsKKyAgICBMaW5rZWRMaXN0PGNodW5rX3Q+IG1MaXN0OworICAgIHNpemVfdCAgICAgICAgICAgICAgbUhlYXBTaXplOworfTsKKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitjbGFzcyBNZW1vcnlEZWFsZXIgOiBwdWJsaWMgUmVmQmFzZQoreworcHVibGljOgorCisgICAgZW51bSB7CisgICAgICAgIFJFQURfT05MWSA9IE1lbW9yeUhlYXBCYXNlOjpSRUFEX09OTFksCisgICAgICAgIFBBR0VfQUxJR05FRCA9IEFsbG9jYXRvckludGVyZmFjZTo6UEFHRV9BTElHTkVECisgICAgfTsKKworICAgIC8vIGNyZWF0ZXMgYSBtZW1vcnkgZGVhbGVyIHdpdGggdGhlIFNoYXJlZEhlYXAgYW5kIFNpbXBsZ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AgICAgICAgc2V0RGF0YVNpemUoc2l6ZV90IHNpemUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0RGF0YVBvc2l0aW9uKHNpemVfdCBwb3MpIGNvbnN0OworICAgIHN0YXR1c190ICAgICAgICAgICAgc2V0RGF0YUNhcGFjaXR5KHNpemVfdCBzaXplKTsKKyAgICAKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHNldERhdGEoY29uc3QgdWludDhfdCogYnVmZmVyLCBzaXplX3QgbGVuKTsKKworICAgIHN0YXR1c190ICAgICAgICAgICAgYXBwZW5kRnJvbShQYXJjZWwgKnBhcmNlbCwgc2l6ZV90IHN0YXJ0LCBzaXplX3QgbGVuKTsKKworICAgIGJvb2wgICAgICAgICAgICAgICAgaGFzRmlsZURlc2NyaXB0b3JzKCkgY29uc3Q7CisKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHdyaXRlSW50ZXJmYWNlVG9rZW4oY29uc3QgU3RyaW5nMTYmIGludGVyZmFjZSk7CisgICAgYm9vbCAgICAgICAgICAgICAgICBlbmZvcmNlSW50ZXJmYWNlKGNvbnN0IFN0cmluZzE2JiBpbnRlcmZhY2UpIGNvbnN0OworICAgIGJvb2wgICAgICAgICAgICAgICAgY2hlY2tJbnRlcmZhY2UoSUJpbmRlciopIGNvbnN0OyAgICAKKworICAgIHZvaWQgICAgICAgICAgICAgICAgZnJlZURhdGEoKTsKKworICAgIGNvbnN0IHNpemVfdCogICAgICAgb2JqZWN0cygpIGNvbnN0OworICAgIHNpemVfdCAgICAgICAgICAgICAgb2JqZWN0c0NvdW50KCkgY29uc3Q7CisgICAgCisgICAgc3RhdHVzX3QgICAgICAgICAgICBlcnJvckNoZWNrKCkgY29uc3Q7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRFcnJvcihzdGF0dXNfdCBlcnIpOworICAgIAorICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGUoY29uc3Qgdm9pZCogZGF0YSwgc2l6ZV90IGxlbik7CisgICAgdm9pZCogICAgICAgICAgICAgICB3cml0ZUlucGxhY2Uoc2l6ZV90IGxlbik7CisgICAgc3RhdHVzX3QgICAgICAgICAgICB3cml0ZVVucGFkZGVkKGNvbnN0IHZvaWQqIGRhdGEsIHNpemVfdCBsZW4pOworICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGVJbnQzMihpbnQzMl90IHZhbCk7CisgICAgc3RhdHVzX3QgICAgICAgICAgICB3cml0ZUludDY0KGludDY0X3QgdmFsKTsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHdyaXRlRmxvYXQoZmxvYXQgdmFsKTsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHdyaXRlRG91YmxlKGRvdWJsZSB2YWwpOworICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGVJbnRQdHIoaW50cHRyX3QgdmFsKTsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHdyaXRlQ1N0cmluZyhjb25zdCBjaGFyKiBzdHIpOworICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGVTdHJpbmc4KGNvbnN0IFN0cmluZzgmIHN0cik7CisgICAgc3RhdHVzX3QgICAgICAgICAgICB3cml0ZVN0cmluZzE2KGNvbnN0IFN0cmluZzE2JiBzdHIpOworICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGVTdHJpbmcxNihjb25zdCBjaGFyMTZfdCogc3RyLCBzaXplX3QgbGVuKTsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHdyaXRlU3Ryb25nQmluZGVyKGNvbnN0IHNwPElCaW5kZXI+JiB2YWwpOworICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGVXZWFrQmluZGVyKGNvbnN0IHdwPElCaW5kZXI+JiB2YWwpOworCisgICAgLy8gUGxhY2UgYSBuYXRpdmVfaGFuZGxlIGludG8gdGhlIHBhcmNlbCAodGhlIG5hdGl2ZV9oYW5kbGUncyBmaWxlLQorICAgIC8vIGRlc2NyaXB0b3JzIGFyZSBk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CB2b2lkKiAgICAgICAgIHJlYWRJbnBsYWNlKHNpemVfdCBsZW4pIGNvbnN0OworICAgIGludDMyX3QgICAgICAgICAgICAgcmVhZEludDMyKCkgY29uc3Q7CisgICAgc3RhdHVzX3QgICAgICAgICAgICByZWFkSW50MzIoaW50MzJfdCAqcEFyZykgY29uc3Q7CisgICAgaW50NjRfdCAgICAgICAgICAgICByZWFkSW50NjQoKSBjb25zdDsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHJlYWRJbnQ2NChpbnQ2NF90ICpwQXJnKSBjb25zdDsKKyAgICBmbG9hdCAgICAgICAgICAgICAgIHJlYWRGbG9hdCgpIGNvbnN0OworICAgIHN0YXR1c190ICAgICAgICAgICAgcmVhZEZsb2F0KGZsb2F0ICpwQXJnKSBjb25zdDsKKyAgICBkb3VibGUgICAgICAgICAgICAgIHJlYWREb3VibGUoKSBjb25zdDsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHJlYWREb3VibGUoZG91YmxlICpwQXJnKSBjb25zdDsKKyAgICBpbnRwdHJfdCAgICAgICAgICAgIHJlYWRJbnRQdHIoKSBjb25zdDsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHJlYWRJbnRQdHIoaW50cHRyX3QgKnBBcmcpIGNvbnN0OworCisgICAgY29uc3QgY2hhciogICAgICAgICByZWFkQ1N0cmluZygpIGNvbnN0OworICAgIFN0cmluZzggICAgICAgICAgICAgcmVhZFN0cmluZzgoKSBjb25zdDsKKyAgICBTdHJpbmcxNiAgICAgICAgICAgIHJlYWRTdHJpbmcxNigpIGNvbnN0OworICAgIGNvbnN0IGNoYXIxNl90KiAgICAgcmVhZFN0cmluZzE2SW5wbGFjZShzaXplX3QqIG91dExlbikgY29uc3Q7CisgICAgc3A8SUJpbmRlcj4gICAgICAgICByZWFkU3Ryb25nQmluZGVyKCkgY29uc3Q7CisgICAgd3A8SUJpbmRlcj4gICAgICAgICByZWFkV2Vha0JpbmRlcigpIGNvbnN0OworCisgICAgCisg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kYXRhU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzaXplX3QqIG9iamVjdHMsIHNpemVfdCBvYmplY3RzU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBjb29raWUpOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgY29uc3QgdWludDhfdCogICAgICBpcGNEYXRhKCkgY29uc3Q7CisgICAgc2l6ZV90ICAgICAgICAgICAgICBpcGNEYXRhU2l6ZSgpIGNvbnN0OworICAgIGNvbnN0IHNpemVfdCogICAgICAgaXBjT2JqZWN0cygpIGNvbnN0OworICAgIHNpemVfdCAgICAgICAgICAgICAgaXBjT2JqZWN0c0NvdW50KCkgY29uc3Q7CisgICAgdm9pZCAgICAgICAgICAgICAgICBpcGNTZXREYXRhUmVmZXJlbmNlKGNvbnN0IHVpbnQ4X3QqIGRhdGEsIHNpemVfdCBkYXRhU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90KiBvYmplY3RzLCBzaXplX3Qgb2JqZWN0c0NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWxlYXNlX2Z1bmMgcmVsRnVuYywgdm9pZCogcmVsQ29va2llKTsKKyAgICAKKyAgICB2b2lkICAgICAgICAgICAgICAgIHByaW50KFRleHRPdXRwdXQmIHRvLCB1aW50MzJfdCBmbGFncyA9IDApIGNvbnN0OworICAgICAgICAKK3ByaXZhdGU6CisgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwoY29uc3QgUGFyY2VsJiBvKTsKKyAgICBQYXJjZWwmICAgICAgICAgICAgIG9wZXJhdG9yPShjb25zdCBQYXJjZWwmIG8pOworICAgIAorICAgIHN0YXR1c190ICAgICAgICAgICAgZmluaXNoV3JpdGUoc2l6ZV90IGxlbik7CisgICAgdm9pZCAgICAgICAgICAgICAgICByZWxlYXNlT2JqZWN0cygpOworICAgIHZvaWQgICAgICAgICAgICAgICAgYWNxdWlyZU9iamVjdHMoKTsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIGdyb3dEYXRhKHNpemVfdCBsZW4pOworICAgIHN0YXR1c190ICAgICAgICAgICAgcmVzdGFydFdyaXRlKHNpemVfdCBkZXNpcmVkKTsKKyAgICBzdGF0dXNfdCAgICAgICAgICAgIGNvbnRpbnVlV3JpdGUoc2l6ZV90IGRlc2lyZWQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgZnJlZURhdGFOb0luaXQoKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIGluaXRTdGF0ZSgpOworICAgIHZvaWQgICAgICAgICAgICAgICAgc2NhbkZvckZkcygpIGNvbnN0OworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgdGVtcGxhdGU8Y2xhc3MgVD4KKyAgICBzdGF0dXNfdCAgICAgICAgICAgIHJlYWRBbGlnbmVkKFQgKnBBcmcpIGNvbnN0OworCisgICAgdGVtcGxhdGU8Y2xhc3MgVD4gICBUIHJlYWRBbGlnbmVkKCkgY29uc3Q7CisKKyAgICB0ZW1wbGF0ZTxjbGFzcyBUPgorICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGVBbGlnbmVkKFQgdmFsKTsKKworICAgIHN0YXR1c190ICAgICAgICAgICAgbUVycm9yOworICAgIHVpbnQ4X3QqICAgICAgICAgICAgbURhdGE7CisgICAgc2l6ZV90ICAgICAgICAgICAgICBtRGF0YVNpemU7CisgICAgc2l6ZV90ICAgICAgICAgICAgICBtRGF0YUNhcGFjaXR5OworICAgIG11dGFibGUgc2l6ZV90ICAgICAgbURhdGFQb3M7CisgICAgc2l6ZV90KiAgICAgICAgICAgICBtT2JqZWN0czsKKyAgICBzaXplX3QgICAgICAgICAgICAgIG1PYmplY3RzU2l6ZTsKKyAgICBzaXplX3QgICAgICAgICAgICAgIG1PYmplY3RzQ2FwYWNpdHk7CisgIC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LQorbmFtZXNwYWNlIGFuZHJvaWQgeworCisvLyBHbG9iYWwgdmFyaWFibGVzCitleHRlcm4gaW50ICAgICAgICAgICAgICAgICBtQXJnQzsKK2V4dGVybiBjb25zdCBjaGFyKiBjb25zdCogIG1BcmdWOworZXh0ZXJuIGludCAgICAgICAgICAgICAgICAgbUFyZ0xlbjsKKworY2xhc3MgSVBDVGhyZWFkU3RhdGU7CisKK2NsYXNzIFByb2Nlc3NTdGF0ZSA6IHB1YmxpYyB2aXJ0dWFsIFJlZkJhc2UKK3sKK3B1YmxpYzoKKyAgICBzdGF0aWMgIHNwPFByb2Nlc3NTdGF0ZT4gICAgc2VsZigpOworCisgICAgc3RhdGljICB2b2lkICAgICAgICAgICAgICAgIHNldFNpbmdsZVByb2Nlc3MoYm9vbCBzaW5nbGVQcm9jZXNzKTsKKworICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRDb250ZXh0T2JqZWN0KGNvbnN0IHNwPElCaW5kZXI+JiBvYmplY3QpOworICAgICAgICAgICAgc3A8SUJpbmRlcj4gICAgICAgICBnZXRDb250ZXh0T2JqZWN0KGNvbnN0IHNwPElCaW5kZXI+JiBjYWxsZXIpOworICAgICAgICAKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0Q29udGV4dE9iamVjdChjb25zdCBzcDxJQmluZGVyPiYgb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFN0cmluZzE2JiBuYW1lKTsKKyAgICAgICAgICAgIHNwPElCaW5kZXI+ICAgICAgICAgZ2V0Q29udGV4dE9iamVjdChjb25zdCBTdHJpbmcxNiYgbmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJQmluZGVyPiYgY2FsbGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgc3VwcG9ydHNQcm9jZXNzZXMoKSBjb25zdDsKKworICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICBzdGFydFRocmVhZFBvb2woKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgIHR5cGVkZWYgYm9vbCAoKmNvbnRleHRfY2hlY2tfZnVuYykoY29uc3QgU3RyaW5nMTYmIG5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJQmluZGVyPiYgY2FsbGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogdXNlckRhdGEpOworICAgICAgICAKKyAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgaXNDb250ZXh0TWFuYWdlcih2b2lkKSBjb25zdDsKKyAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgYmVjb21lQ29udGV4dE1hbmFnZXIoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0X2NoZWNrX2Z1bmMgY2hlY2tGdW5jLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogdXNlckRhdGEpOworCisgICAgICAgICAgICBzcDxJQmluZGVyPiAgICAgICAgIGdldFN0cm9uZ1Byb3h5Rm9ySGFuZGxlKGludDMyX3QgaGFuZGxlKTsKKyAgICAgICAgICAgIHdwPElCaW5kZXI+ICAgICAgICAgZ2V0V2Vha1Byb3h5Rm9ySGFuZGxlKGludDMyX3QgaGFuZGxlKTsKKyAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgZXhwdW5nZUhhbmRsZShpbnQzMl90IGhhbmRsZSwgSUJpbmRlciogYmluZGVyKTsKKworICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRBcmdzKGludCBhcmdjLCBjb25zdCBjaGFyKiBjb25zdCBhcmd2W10pOworICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICBnZXRBcmdDKCkgY29uc3Q7CisgICAgICAgICAgICBjb25zdCBjaGFyKiBjb25zdCogIGdldEFyZ1YoKSBjb25zdDsKKworICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRBcmdWMChjb25zdCBjaGFyKiB0eHQpOworCisgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgIHNwYXduUG9vbGVkVGhyZWFkKGJvb2wgaXNNYWluKTsKKyAgICAgICAgICAgIAorcHJpdmF0ZToKKyAgICBmcmllbmQgY2xhc3MgSVBDVGhyZWFkU3RhdGU7CisgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByb2Nlc3NTdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+UHJvY2Vzc1N0YXRlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUHJvY2Vzc1N0YXRlKGNvbnN0IFByb2Nlc3NTdGF0ZSYgbyk7CisgICAgICAgICAgICBQcm9jZXNzU3RhdGUmICAgICAgIG9wZXJhdG9yPShjb25zdCBQcm9jZXNzU3RhdGUmIG8pOworICAgICAgICAgICAgCisgICAgICAgICAgICBzdHJ1Y3QgaGFuZGxlX2VudHJ5IHsKKyAgICAgICAgICAgICAgICBJQmluZGVyKiBiaW5kZXI7CisgICAgICAgICAgICAgICAgUmVmQmFzZTo6d2Vha3JlZl90eXBlKiByZWZzOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaGFuZGxlX2VudHJ5KiAgICAgICBsb29rdXBIYW5kbGVMb2NrZWQoaW50MzJfdCBoYW5kbGUpOworCisgICAgICAgICAgICBpbnQgICAgICAgICAgICAgICAgIG1Ecml2ZXJGRDsKKyAgICAgICAgICAgIHZvaWQqICAgICAgICAgICAgICAgbVZNU3RhcnQ7CisgICAgICAgICAgICAKKyAgICBtdXRhYmxlIE11dGV4ICAgICAgICAgICAgICAgbUxvY2s7ICAvLyBwcm90ZWN0cyBldmVyeXRoaW5nIGJlbG93LgorICAgICAgICAgICAgCisgICAgICAgICAgICBWZWN0b3I8aGFuZGxlX2VudHJ5Pm1IYW5kbGVUb09iamVjdDsKKworICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICBtTWFuYWdlc0NvbnRleHRzOworICAgICAgICAgICAgY29udGV4dF9jaGVja19mdW5jICBtQmluZGVyQ29udGV4dENoZWNrRnVuYzsKKyAgICAgICAgICAgIHZvaWQqICAgICAgICAgICAgICAgbUJpbmRlckNvbnRleHRVc2VyRGF0YTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgS2V5ZWRWZWN0b3I8U3RyaW5nMTYsIHNwPElCaW5kZXI+ID4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHRzOworCisKKyAgICAgICAgICAgIFN0cmluZzggICAgICAgICAgICAgbVJvb3REaXI7CisgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIG1UaHJlYWRQb29sU3RhcnRlZDsKKyAgICB2b2xhdGlsZSBpbnQzMl90ICAgICAgICAgICAgbVRocmVhZFBvb2xTZXE7Cit9OworICAgIAorfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyNlbmRpZiAvLyBBTkRST0lEX1BST0NFU1NfU1RBVEVfSApkaWZmIC0tZ2l0IGEvaW5jbHVkZS9tZWRpYS9BdWRpb1JlY29yZC5oIGIvaW5jbHVkZS9tZWRpYS9BdWRpb1JlY29yZC5oCmluZGV4IDEzZTUxZWUuLjUwM2NiMzEgMTAwNjQ0Ci0tLSBhL2luY2x1ZGUvbWVkaWEvQXVkaW9SZWNvcmQuaAorKysgYi9pbmNsdWRlL21lZGlhL0F1ZGlvUmVjb3JkLmgKQEAgLTI2LDggKzI2LDggQE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cmQuamF2YQogICAgICAqLwogICAgIGVudW0gZXZlbnRfdHlwZSB7CkBAIC02MSw3ICs1MCw3IEBACiAgICAgICAgIEVWRU5UX09WRVJSVU4gPSAxLCAgICAgICAgICAvLyBQQ00gYnVmZmVyIG92ZXJydW4gb2NjdXJlZC4KICAgICAgICAgRVZFTlRfTUFSS0VSID0gMiwgICAgICAgICAgIC8vIFJlY29yZCBoZWFkIGlzIGF0IHRoZSBzcGVjaWZpZWQgbWFya2VyIHBvc2l0aW9uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAoU2VlIHNldE1hcmtlclBvc2l0aW9uKCkpLgotICAgICAgICBFVkVOVF9ORVdfUE9TID0gMywgICAgICAgICAgLy8gUmVjb3JkIGhlYWQgaXMgYXQgYSBuZXcgcG9zaXRpb24gCisgICAgICAgIEVWRU5UX05FV19QT1MgPSAzLCAgICAgICAgICAvLyBSZWNvcmQgaGVhZCBpcyBhdCBhIG5ldyBwb3NpdGlvbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gKFNlZSBzZXRQb3NpdGlvblVwZGF0ZVBlcmlvZCgpKS4KICAgICB9OwogCkBAIC0xMjMsMTEgKzExMiwxMSBAQAogICAgICAqCiAgICAgICogUGFyYW1ldGVyczoKICAgICAgKgotICAgICAqIGlucHV0U291cmNlOiAgICAgICAgU2VsZWN0IHRoZSBhdWRpbyBpbnB1dCB0byByZWNvcmQgdG8gKGUuZy4gQXVkaW9SZWNvcmQ6Ok1JQ19JTlBVVCkuCisgICAgICogaW5wdXRTb3VyY2U6ICAgICAgICBTZWxlY3QgdGhlIGF1ZGlvIGlucHV0IHRvIHJlY29yZCB0byAoZS5nLiBBVURJT19TT1VSQ0VfREVGQVVMVCkuCiAgICAgICogc2FtcGxlUmF0ZTogICAgICAgICBUcmFjayBzYW1wbGluZyByYXRlIGluIEh6LgotICAgICAqIGZvcm1hdDogICAgICAgICAgICAgUENNIHNhbXBsZSBmb3JtYXQgKGUuZyBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVCBmb3Igc2lnbmVkCisgICAgICogZm9ybWF0OiAgICAgICAgICAgICBBdWRpbyBmb3JtYXQgKGUuZyBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVCBmb3Igc2lnbmVkCiAgICAgICogICAgICAgICAgICAgICAgICAgICAxNiBiaXRzIHBlciBzYW1wbGUpLgotICAgICAqIGNoYW5uZWxDb3VudDogICAgICAgTnVtYmVyIG9mIFBDTSBjaGFubmVscyAoZS5nIDIgZm9yIHN0ZXJlbykuCisgICAgICogY2hhbm5lbHM6ICAgICAgICAgICBDaGFubmVsIG1hc2s6IHNlZSBBdWRpb1N5c3RlbTo6YXVkaW9fY2hhbm5lbHMuCiAgICAgICogZnJhbWVDb3VudDogICAgICAgICBUb3RhbCBzaXplIG9mIHRyYWNrIFBDTSBidWZmZXIgaW4gZnJhbWVzLiBUaGlzIGRlZmluZXMgdGhlCiAgICAgICogICAgICAgICAgICAgICAgICAgICBsYXRlbmN5IG9mIHRoZSB0cmFjay4KICAgICAgKiBmbGFnczogICAgICAgICAgICAgIEEgYml0bWFzayBvZiBhY291c3RpYyB2YWx1ZXMgZnJvbSBlbnVtIHJlY29yZF9mbGFncy4gIEl0IGVuYWJsZXMKQEAgLTE0OCw3ICsxMzcsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9SZWNvcmQoaW50IGlucHV0U291cmNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSA9IDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZm9ybWF0ICAgICAgICAgID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQgICAgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMgPSBBdWRpb1N5c3RlbTo6Q0hBTk5FTF9JTl9NT05PLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQgICAgICA9IDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyAgICAgID0gMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmID0gMCwKQEAgLTE2NiwxNCArMTU1LDE0IEBACiAgICAgICogUmV0dXJuZWQgc3RhdHVzIChmcm9tIHV0aWxzL0Vycm9ycy5oKSBjYW4gYmU6CiAgICAgICogIC0gTk9fRVJST1I6IHN1Y2Nlc3NmdWwgaW50aWFsaXphdGlvbgogICAgICAqICAtIElOVkFMSURfT1BFUkFUSU9OOiBBdWRpb1JlY29yZCBpcyBhbHJlYWR5IGludGl0aWFsaXplZCBvciByZWNvcmQgZGV2aWNlIGlzIGFscmVhZHkgaW4gdXNlCi0gICAgICogIC0gQkFEX1ZBTFVFOiBpbnZhbGlkIHBhcmFtZXRlciAoY2hhbm5lbENvdW50LCBmb3JtYXQsIHNhbXBsZVJhdGUuLi4pCisgICAgICogIC0gQkFEX1ZBTFVFOiBpbnZhbGlkIHBhcmFtZXRlciAoY2hhbm5lbHMsIGZvcm1hdCwgc2FtcGxlUmF0ZS4uLikKICAgICAgKiAgLSBOT19JTklUOiBhdWRpbyBzZXJ2ZXIgb3IgYXVkaW8gaGFyZHdhcmUgbm90IGluaXRpYWxpemVkCiAgICAgICogIC0gUEVSTUlTU0lPTl9ERU5JRUQ6IHJlY29yZGluZyBpcyBub3QgYWxsb3dlZCBmb3IgdGhlIHJlcXVlc3RpbmcgcHJvY2VzcwogICAgICAqICovCiAgICAgICAgICAgICBzdGF0dXNfdCAgICBzZXQoaW50IGlucHV0U291cmNlICAgICA9IDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSA9IDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCAgICAgICAgICA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudCAgICA9IDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMgPSBBdWRpb1N5c3RlbTo6Q0hBTk5FTF9JTl9NT05PLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50ICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmID0gMCwKQEAgLTE5OSw2ICsxODgsNyBAQAogCiAgICAgICAgICAgICBpbnQgICAgICAgICBmb3JtYXQoKSBjb25zdDsKICAgICAgICAgICAgIGludCAgICAgICAgIGNoYW5uZWxDb3VudCgpIGNvbnN0OworICAgICAgICAgICAgaW50ICAgICAgICAgY2hhbm5lbHMoKSBjb25zdDsKICAgICAgICAgICAgIHVpbnQzMl90ICAgIGZyYW1lQ291bnQoKSBjb25zdDsKICAgICAgICAgICAgIGludCAgICAgICAgIGZyYW1lU2l6ZSgpIGNvbnN0OwogICAgICAgICAgICAgaW50ICAgICAgICAgaW5wdXRTb3VyY2UoKSBjb25zdDsKQEAgLTIyMiw4ICsyMTIsOCBAQAogCiAgICAgLyogU2V0cyBtYXJrZXIgcG9zaXRpb24uIFdoZW4gcmVjb3JkIHJlYWNoZXMgdGhlIG51bWJlciBvZiBmcmFtZXMgc3BlY2lmaWVkLAogICAgICAqIGEgY2FsbGJhY2sgd2l0aCBldmVudCB0eXBlIEVWRU5UX01BUktFUiBpcyBjYWxsZWQuIENhbGxpbmcgc2V0TWFya2VyUG9zaXRpb24KLSAgICAgKiB3aXRoIG1hcmtlciA9PSAwIGNhbmNlbHMgbWFya2VyIG5vdGlmaWNhdGlvbiBjYWxsYmFjay4gCi0gICAgICog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F0dXNfdCBlcnIpOwordHlwZWRlZiBpbnQgYXVkaW9faW9faGFuZGxlX3Q7CisKK2NsYXNzIElBdWRpb1BvbGljeVNlcnZpY2U7CitjbGFzcyBTdHJpbmc4OwogCiBjbGFzcyBBdWRpb1N5c3RlbQogewogcHVibGljOgogCiAgICAgZW51bSBzdHJlYW1fdHlwZSB7Ci0gICAgICAgIERFRkFVTFQgICAgICAgICA9LTEsCi0gICAgICAgIFZPSUNFX0NBTEwgICAgICA9IDAsCi0gICAgICAgIFNZU1RFTSAgICAgICAgICA9IDEsCi0gICAgICAgIFJJTkcgICAgICAgICAgICA9IDIsCi0gICAgICAgIE1VU0lDICAgICAgICAgICA9IDMsCi0gICAgICAgIEFMQVJNICAgICAgICAgICA9IDQsCi0gICAgICAgIE5PVElGSUNBVElPTiAgICA9IDUsCi0gICAgICAgIEJMVUVUT09USF9TQ08gICA9IDYsCisgICAgICAgIERFRkFVTFQgICAgICAgICAgPS0xLAorICAgICAgICBWT0lDRV9DQUxMICAgICAgID0gMCwKKyAgICAgICAgU1lTVEVNICAgICAgICAgICA9IDEsCisgICAgICAgIFJJTkcgICAgICAgICAgICAgPSAyLAorICAgICAgICBNVVNJQyAgICAgICAgICAgID0gMywKKyAgICAgICAgQUxBUk0gICAgICAgICAgICA9IDQsCisgICAgICAgIE5PVElGSUNBVElPTiAgICAgPSA1LAorICAgICAgICBCTFVFVE9PVEhfU0NPICAgID0gNiwKICAgICAgICAgRU5GT1JDRURfQVVESUJMRSA9IDcsIC8vIFNvdW5kcyB0aGF0IGNhbm5vdCBiZSBtdXRlZCBieSB1c2VyIGFuZCBtdXN0IGJlIHJvdXRlZCB0byBzcGVha2VyCisgICAgICAgIERUTUYgICAgICAgICAgICAgPSA4LAorICAgICAgICBUVFMgICAgICAgICAgICAgID0gOSwKICAgICAgICAgTlVNX1NUUkVBTV9UWVBFUwogICAgIH07CiAKLSAgICBlbnVtIGF1ZGlvX291dHB1dF90eXBlIHsKLSAgICAgICAgQVVESU9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gICAgIFBDTV84X0JJVCwKLSAgICAgICAgSU5WQUxJRF9GT1JNQVQKKyAgICAgICAgSU5WQUxJRF9GT1JNQVQgICAgICA9IC0xLAorICAgICAgICBGT1JNQVRfREVGQVVMVCAgICAgID0gMCwKKyAgICAgICAgUENNICAgICAgICAgICAgICAgICA9IDB4MDAwMDAwMDAsIC8vIG11c3QgYmUgMCBmb3IgYmFja3dhcmQgY29tcGF0aWJpbGl0eQorICAgICAgICBNUDMgICAgICAgICAgICAgICAgID0gMHgwMTAwMDAwMCwKKyAgICAgICAgQU1SX05CICAgICAgICAgICAgICA9IDB4MDIwMDAwMDAsCisgICAgICAgIEFNUl9XQiAgICAgICAgICAgICAgPSAweDAzMDAwMDAwLAorICAgICAgICBBQUMgICAgICAgICAgICAgICAgID0gMHgwNDAwMDAwMCwKKyAgICAgICAgSEVfQUFDX1YxICAgICAgICAgICA9IDB4MDUwMDAwMDAsCisgICAgICAgIEhFX0FBQ19WMiAgICAgICAgICAgPSAweDA2MDAwMDAwLAorICAgICAgICBWT1JCSVMgICAgICAgICAgICAgID0gMHgwNzAwMDAwMCwKKyAgICAgICAgTUFJTl9GT1JNQVRfTUFTSyAgICA9IDB4RkYwMDAwMDAsCisgICAgICAgIFNVQl9GT1JNQVRfTUFTSyAgICAgPSAweDAwRkZGRkZGLAorICAgICAgICAvLyBBbGlhc2VzCisgICAgICAgIFBDTV8xNl9CSVQgICAgICAgICAgPSAoUENNfFBDTV9TVUJfMTZfQklUKSwKKyAgICAgICAgUENNXzhfQklUICAgICAgICAgID0gKFBDTXxQQ01fU1VCXzhfQklUKQorICAgIH07CisKKworICAgIC8vIENoYW5uZWwgbWFzayBkZWZpbml0aW9ucyBtdXN0IGJlIGtlcHQgaW4gc3luYyB3aXRoIEpBVkEgdmFsdWVzIGluIC9tZWRpYS9qYXZhL2FuZHJvaWQvbWVkaWEvQXVkaW9Gb3JtYXQuamF2YQorICAgIGVudW0gYXVkaW9fY2hhbm5lbHMgeworICAgICAgICAvL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OwogCiAgICAgc3RhdGljIGJvb2wgcm91dGVkVG9BMmRwT3V0cHV0KGludCBzdHJlYW1UeXBlKTsKLSAgICAKLSAgICBzdGF0aWMgc3RhdHVzX3QgZ2V0SW5wdXRCdWZmZXJTaXplKHVpbnQzMl90IHNhbXBsZVJhdGUsIGludCBmb3JtYXQsIGludCBjaGFubmVsQ291bnQsIAorCisgICAgc3RhdGljIHN0YXR1c190IGdldElucHV0QnVmZmVyU2l6ZSh1aW50MzJfdCBzYW1wbGVSYXRlLCBpbnQgZm9ybWF0LCBpbnQgY2hhbm5lbENvdW50LAogICAgICAgICBzaXplX3QqIGJ1ZmZTaXplKTsKIAorCisgICAgLy8KKyAgICAvLyBBdWRpb1BvbGljeVNlcnZpY2UgaW50ZXJmYWNlCisgICAgLy8KKworICAgIGVudW0gYXVkaW9fZGV2aWNlcyB7CisgICAgICAgIC8vIG91dHB1dCBkZXZpY2VzCisgICAgICAgIERFVklDRV9PVVRfRUFSUElFQ0UgPSAweDEsCisgICAgICAgIERFVklDRV9PVVRfU1BFQUtFUiA9IDB4MiwKKyAgICAgICAgREVWSUNFX09VVF9XSVJFRF9IRUFEU0VUID0gMHg0LAorICAgICAgICBERVZJQ0VfT1VUX1dJUkVEX0hFQURQSE9ORSA9IDB4OCwKKyAgICAgICAgREVWSUNFX09VVF9CTFVFVE9PVEhfU0NPID0gMHgxMCwKKyAgICAgICAgREVWSUNFX09VVF9CTFVFVE9PVEhfU0NPX0hFQURTRVQgPSAweDIwLAorICAgICAgICBERVZJQ0VfT1VUX0JMVUVUT09USF9TQ09fQ0FSS0lUID0gMHg0MCwKKyAgICAgICAgREVWSUNFX09VVF9CTFVFVE9PVEhfQTJEUCA9IDB4ODAsCisgICAgICAgIERFVklDRV9PVVRfQkxVRVRPT1RIX0EyRFBfSEVBRFBIT05FUyA9IDB4MTAwLAorICAgICAgICBERVZJQ0VfT1VUX0JMVUVUT09USF9BMkRQX1NQRUFLRVIgPSAweDIwMCwKKyAgICAgICAgREV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vdXRwdXQpOworICAgIHN0YXRpYyBhdWRpb19pb19oYW5kbGVfdCBnZXRJbnB1dChpbnQgaW5wdXRTb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0ID0gRk9STUFUX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscyA9IENIQU5ORUxfSU5fTU9OTywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2luX2Fjb3VzdGljcyBhY291c3RpY3MgPSAoYXVkaW9faW5fYWNvdXN0aWNzKTApOworICAgIHN0YXRpYyBzdGF0dXNfdCBzdGFydElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKKyAgICBzdGF0aWMgc3RhdHVzX3Qgc3RvcElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKKyAgICBzdGF0aWMgdm9pZCByZWxlYXNlSW5wdXQoYXVkaW9faW9faGFuZGxlX3QgaW5wdXQpOworICAgIHN0YXRpYyBzdGF0dXNfdCBpbml0U3RyZWFtVm9sdW1lKHN0cmVhbV90eXBlIHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4TWluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNYXgpOworICAgIHN0YXRpYyBzdGF0dXNfdCBzZXRTdHJlYW1Wb2x1bWVJbmRleChzdHJlYW1fdHlwZSBzdHJlYW0sIGludCBpbmRleCk7CisgICAgc3RhdGljIHN0YXR1c190IGdldFN0cmVhbVZvbHVtZUluZGV4KHN0cmVhbV90eXBlIHN0cmVhbSwgaW50ICppbmRleCk7CisKKyAgICBzdGF0aWMgY29uc3Qg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qICAgICAgICAgICAgICAgICAgICAgKGUuZy4gQXVkaW9TeXN0ZW06Ok1VU0lDKS4KICAgICAgKiBzYW1wbGVSYXRlOiAgICAgICAgIFRyYWNrIHNhbXBsaW5nIHJhdGUgaW4gSHouCi0gICAgICogZm9ybWF0OiAgICAgICAgICAgICBQQ00gc2FtcGxlIGZvcm1hdCAoZS5nIEF1ZGlvU3lzdGVtOjpQQ01fMTZfQklUIGZvciBzaWduZWQKKyAgICAgKiBmb3JtYXQ6ICAgICAgICAgICAgIEF1ZGlvIGZvcm1hdCAoZS5nIEF1ZGlvU3lzdGVtOjpQQ01fMTZfQklUIGZvciBzaWduZWQKICAgICAgKiAgICAgICAgICAgICAgICAgICAgIDE2IGJpdHMgcGVyIHNhbXBsZSkuCi0gICAgICogY2hhbm5lbENvdW50OiAgICAgICBOdW1iZXIgb2YgUENNIGNoYW5uZWxzIChlLmcgMiBmb3Igc3RlcmVvKS4KKyAgICAgKiBjaGFubmVsczogICAgICAgICAgIENoYW5uZWwgbWFzazogc2VlIEF1ZGlvU3lzdGVtOjphdWRpb19jaGFubmVscy4KICAgICAgKiBmcmFtZUNvdW50OiAgICAgICAgIFRvdGFsIHNpemUgb2YgdHJhY2sgUENNIGJ1ZmZlciBpbiBmcmFtZXMuIFRoaXMgZGVmaW5lcyB0aGUKICAgICAgKiAgICAgICAgICAgICAgICAgICAgIGxhdGVuY3kgb2YgdGhlIHRyYWNrLgogICAgICAqIGZsYWdzOiAgICAgICAgICAgICAgUmVzZXJ2ZWQgZm9yIGZ1dHVyZSB1c2UuCkBAIC0xMzMsNyArMTMzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvVHJhY2soIGludCBzdHJlYW1UeXBlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCAgICAgICAgICAgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudCAgICAgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxzICAgICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQgICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2tfdCBjYmYgICAgICAgPSAwLApAQCAtMTUyLDcgKzE1Miw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1RyYWNrKCBpbnQgc3RyZWFtVHlwZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCAgICAgICAgICA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hhbm5lbENvdW50ICAgID0gMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVscyAgICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciA9IDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyAgICAgID0gMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmICAgICAgPSAwLApAQCAtMTY5LDEzICsxNjksMTMgQEAKICAgICAgKiBSZXR1cm5lZCBzdGF0dXMgKGZyb20gdXRpbHMvRXJyb3JzLmgpIGNhbiBiZToKICAgICAgKiAgLSBOT19FUlJPUjogc3VjY2Vzc2Z1bCBpbnRpYWxpemF0aW9uCiAgICAgICogIC0gSU5WQUxJRF9PUEVSQVRJT046IEF1ZGlvVHJhY2sgaXMgYWxyZWFkeSBpbnRpdGlhbGl6ZWQKLSAgICAgKiAgLSBCQURfVkFMVUU6IGludmFsaWQgcGFyYW1ldGVyIChjaGFubmVsQ291bnQsIGZvcm1hdCwgc2FtcGxlUmF0ZS4uLikKKyAgICAgKiAgLSBCQURfVkFMVUU6IGludmFsaWQgcGFyYW1ldGVyIChjaGFubmVscywgZm9ybWF0LCBzYW1wbGVSYXRlLi4uKQogICAgICAqICAtIE5PX0lOSVQ6IGF1ZGlvIHNlcnZlciBvciBhdWRpbyBoYXJkd2FyZSBub3QgaW5pdGlhbGl6ZWQKICAgICAgKiAqLwogICAgICAgICAgICAgc3RhdHVzX3QgICAgc2V0KGludCBzdHJlYW1UeXBlICAgICAgPS0xLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQgICAgICAgICAgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQgICAgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVscyAgICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50ICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzICAgICAgPSAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmICAgICAgPSAwLApAQCAtMzMwLDYgKzMzMCwxNiBAQAogICAgICAqLwogICAgICAgICAgICAgc3RhdHVzX3QgICAgcmVsb2FkKCk7CiAKKyAgICAvKiByZXR1cm5zIGEgaGFuZGxlIG9uIHRoZSBhdWRpbyBvdXRwdXQ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ICAgICAgIHVpbnQzMl90IGZsYWdzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJTWVtb3J5PiYgc2hhcmVkQnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb3V0cHV0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzKSA9IDA7CiAKICAgICB2aXJ0dWFsIHNwPElBdWRpb1JlY29yZD4gb3BlblJlY29yZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGlkX3QgcGlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5wdXRTb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudCwKQEAgLTgzLDE5ICs4NCwxNCBAQAogICAgIC8qIHNldC9nZXQgc3RyZWFtIHR5cGUgc3RhdGUuIFRoaXMgd2lsbCBwcm9iYWJseSBiZSB1c2VkIGJ5CiAgICAgICogdGhlIHByZWZlcmVuY2UgcGFuZWwsIG1vc3RseS4KICAgICAgKi8KLSAgICB2aXJ0dWFsICAgICBzdGF0dXNfdCAgICBzZXRTdHJlYW1Wb2x1bWUoaW50IHN0cmVhbSwgZmxvYXQgdmFsdWUpID0gMDsKKyAgICB2aXJ0dWFsICAgICBzdGF0dXNfdCAgICBzZXRTdHJlYW1Wb2x1bWUoaW50IHN0cmVhbSwgZmxvYXQgdmFsdWUsIGludCBvdXRwdXQpID0gMDsKICAgICB2aXJ0dWFsICAgICBzdGF0dXNfdCAgICBzZXRTdHJlYW1NdXRlKGludCBzdHJlYW0sIGJvb2w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VkKCkgY29uc3QgPSAwOworICAgIHZpcnR1YWwgaW50IG9wZW5PdXRwdXQodWludDMyX3QgKnBEZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBTYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcEZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcExhdGVuY3lNcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzKSA9IDA7CisgICAgdmlydHVhbCBpbnQgb3BlbkR1cGxpY2F0ZU91dHB1dChpbnQgb3V0cHV0MSwgaW50IG91dHB1dDIpID0gMDsKKyAgICB2aXJ0dWFsIHN0YXR1c190IGNsb3NlT3V0cHV0KGludCBvdXRwdXQpID0gMDsKKyAgICB2aXJ0dWFsIHN0YXR1c190IHN1c3BlbmRPdXRwdXQoaW50IG91dHB1dCkgPSAwOworICAgIHZpcnR1YWwgc3RhdHVzX3QgcmVzdG9yZU91dHB1dChpbnQgb3V0cHV0KSA9IDA7CisKKyAgICB2aXJ0dWFsIGludCBvcGVuSW5wdXQodWludDMyX3QgKnBEZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBTYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcEZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBhY291c3RpY3MpID0gMDsKKyAgICB2aXJ0dWFsIHN0YXR1c190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1BVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6b3V0cHV0X2ZsYWdzIGZsYWdzID0gQXVkaW9TeXN0ZW06Ok9VVFBVVF9GTEFHX0lORElSRUNUKSA9IDA7CisgICAgdmlydHVhbCBzdGF0dXNfdCBzdGFydE91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQsIEF1ZGlvU3lzdGVtOjpzdHJlYW1fdHlwZSBzdHJlYW0pID0gMDsKKyAgICB2aXJ0dWFsIHN0YXR1c190IHN0b3BPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0LCBBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtKSA9IDA7CisgICAgdmlydHVhbCB2b2lkIHJlbGVhc2VPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KSA9IDA7CisgICAgdmlydHVhbCBhdWRpb19pb19oYW5kbGVfdCBnZXRJbnB1dChpbnQgaW5wdXRTb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0ID0gQXVkaW9TeXN0ZW06OkZPUk1BVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcyBhY291c3RpY3MgPSAoQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcykwKSA9IDA7CisgICAgdmlydHVhbCBzdGF0dX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AgICAgICAvLyBhdWRpbyBkYXRhLiBPdGhlcndpc2UgcmV0dXJuIGEgZnVsbCBidWZmZXIgb2YgYXVkaW8gZGF0YSBvbiBlYWNoCisgICAgICAgIC8vIGNhbGxiYWNrLgorICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIG9wZW4oCisgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwgaW50IGNoYW5uZWxDb3VudCwKKyAgICAgICAgICAgICAgICBpbnQgZm9ybWF0PUF1ZGlvU3lzdGVtOjpQQ01fMTZfQklULAorICAgICAgICAgICAgICAgIGludCBidWZmZXJDb3VudD1ERUZBVUxUX0FVRElPU0lOS19CVUZGRVJDT1VOVCwKKyAgICAgICAgICAgICAgICBBdWRpb0NhbGxiYWNrIGNiID0gTlVMTCwKKyAgICAgICAgICAgICAgICB2b2lkICpjb29raWUgPSBOVUxMKSA9IDA7CisKICAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICBzdGFydCgpID0gMDsKICAgICAgICAgdmlydHVhbCBzc2l6ZV90ICAgICB3cml0ZShjb25zdCB2b2lkKiBidWZmZXIsIHNpemVfdCBzaXplKSA9IDA7CiAgICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgc3RvcCgpID0gMDsKQEAgLTg4LDYgKzExMiwyNiBAQAogICAgIHZpcnR1YWwgcGxheWVyX3R5cGUgcGxheWVyVHlwZSgpID0gMDsKICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHNldE5vdGlmeUNhbGxiYWNrKHZvaWQqIGNvb2tpZSwgbm90aWZ5X2NhbGxiYWNrX2Ygbm90aWZ5RnVuYykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db29raWUgPSBjb29raWU7IG1Ob3RpZnkgPSBub3RpZnlGdW5jOyB9CisgICAgLy8gSW52b2tlIGEgZ2VuZXJpYyBtZXRob2Qgb24gdGhlIHBsYXllciBieSB1c2luZyBvcGFxdWUgcGFyY2VscworICAgIC8vIGZvciB0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vc3RhZ2VmcmlnaHQvTWVkaWFEZWJ1Zy5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmM4YThmMDBlNwotLS0gL2Rldi9udWxsCisrKyBiL2luY2x1ZGUvbWVkaWEvc3RhZ2VmcmlnaHQvTWVkaWFEZWJ1Zy5oCkBAIC0wLDAgKzEsMjAgQEAKKyNpZm5kZWYgTUVESUFfREVCVUdfSF8KKworI2RlZmluZSBNRURJQV9ERUJVR19IXworCisjaW5jbHVkZSA8Y3V0aWxzL2xvZy5oPgorCisjZGVmaW5lIExJVEVSQUxfVE9fU1RSSU5HX0lOVEVSTkFMKHgpICAgICN4CisjZGVmaW5lIExJVEVSQUxfVE9fU1RSSU5HKHgpIExJVEVSQUxfVE9fU1RSSU5HX0lOVEVSTkFMKHgpCisKKyNkZWZpbmUgQ0hFQ0tfRVEoeCx5KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBMT0dfQUxXQVlTX0ZBVEFMX0lGKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICh4KSAhPSAoeSksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIF9fRklMRV9fICI6IiBMSVRFUkFMX1RPX1NUUklORyhfX0xJTkVfXykgIiAiICN4ICIgIT0gIiAjeSkKKworI2RlZmluZSBDSEVDSyh4KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIExPR19BTFdBWVNfRkFUQUxfSUYoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgISh4KSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgX19GSUxFX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KKyAgICAgICAgUmVhZE9wdGlvbnMoKTsKKworICAgICAgICAvLyBSZXNldCBldmVyeXRoaW5nIGJhY2sgdG8gZGVmYXVsdHMuCisgICAgICAgIHZvaWQgcmVzZXQoKTsKKworICAgICAgICB2b2lkIHNldFNlZWtUbyhpbnQ2NF90IHRpbWVfdXMpOworICAgICAgICB2b2lkIGNsZWFyU2Vla1RvKCk7CisgICAgICAgIGJvb2wgZ2V0U2Vla1RvKGludDY0X3QgKnRpbWVfdXMpIGNvbnN0OworCisgICAgICAgIHZvaWQgc2V0TGF0ZUJ5KGludDY0X3QgbGF0ZW5lc3NfdXMpOworICAgICAgICBpbnQ2NF90IGdldExhdGVCeSgpIGNvbnN0OworCisgICAgcHJpdmF0ZToKKyAgICAgICAgZW51bSBPcHRpb25zIHsKKyAgICAgICAgICAgIGtTZWVrVG9fT3B0aW9uICAgICAgPSAxLAorICAgICAgICB9OworCisgICAgICAgIHVpbnQzMl90IG1PcHRpb25zOworICAgICAgICBpbnQ2NF90IG1TZWVrVGltZVVzOworICAgICAgICBpbnQ2NF90IG1MYXRlbmVzc1VzOworICAgIH07CisKK3Byb3RlY3RlZDoKKyAgICB2aXJ0dWFsIH5NZWRpYVNvdXJjZSgpOworCitwcml2YXRlOgorICAgIE1lZGlhU291cmNlKGNvbnN0IE1lZGlhU291cmNlICYpOworICAgIE1lZGlhU291cmNlICZvcGVyYXRvcj0oY29uc3QgTWVkaWFTb3VyY2UgJik7Cit9OworCit9ICAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYgIC8vIE1FRElBX1NPVVJDRV9IXwpkaWZmIC0tZ2l0IGEvaW5jbHVkZS9tZWRpYS9zdGFnZWZyaWdodC9NZXRhRGF0YS5oIGIvaW5jbHVkZS9tZWRpYS9zdGFnZWZyaWdodC9NZXRhRGF0YS5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmFiYjQ1YTkKLS0tIC9kZXYvbnVsbAorKysg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4KKyNpbmNsdWRlIDx1dGlscy9LZXllZFZlY3Rvci5oPgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2VudW0geworICAgIGtLZXlNSU1FVHlwZSAgICAgICAgICA9ICdtaW1lJywKKyAgICBrS2V5V2lkdGggICAgICAgICAgICAgPSAnd2lkdCcsCisgICAga0tleUhlaWdodCAgICAgICAgICAgID0gJ2hlaWcnLAorICAgIGtLZXlDaGFubmVsQ291bnQgICAgICA9ICcjY2huJywKKyAgICBrS2V5U2FtcGxlUmF0ZSAgICAgICAgPSAnc3J0ZScsCisgICAga0tleUJpdFJhdGUgICAgICAgICAgID0gJ2JydGUnLAorICAgIGtLZXlFU0RTICAgICAgICAgICAgICA9ICdlc2RzJywKKyAgICBrS2V5QVZDQyAgICAgICAgICAgICAgPSAnYXZjYycsCisgICAga0tleVRpbWVVbml0cyAgICAgICAgID0gJyN0aW0nLAorICAgIGtLZXlUaW1lU2NhbGUgICAgICAgICA9ICdzY2FsJywKKyAgICBrS2V5V2FudHNOQUxGcmFnbWVudHMgPSAnTkFMZicsCisgICAga0tleUlzU3luY0ZyYW1lICAgICAgID0gJ3N5bmMnLAorICAgIGtLZXlEdXJhdGlvbiAgICAgICAgICA9ICdkdXJhJywKKyAgICBrS2V5Q29sb3JGb3JtYXQgICAgICAgPSAnY29sZicsCisgICAga0tleVBsYXRmb3JtUHJpdmF0ZSAgID0gJ3ByaXYnLAorICAgIGtLZXlEZWNvZGVyQ29tcG9uZW50ICA9ICdkZWNDJywKKyAgICBrS2V5QnVmZmVySUQgICAgICAgICAgPSAnYmZJRCcsCisgICAga0tleU1heElucHV0U2l6ZSAgICAgID0gJ2lucFMnLAorfTsKKworZW51bSB7CisgICAga1R5cGVFU0RTICAgICAgICA9ICdlc2RzJywKKyAgICBrVHlwZUFWQ0MgICAgICAgID0gJ2F2Y2MnLAorfTsKKworY2xhc3MgTWV0YURhdGEgOiBwdWJsaWMgUmVmQmFzZSB7CitwdWJsaWM6CisgICAgTWV0YURhdGEoKTsKKyAgICBNZXRhRGF0YShjb25zdCBNZXRhRGF0YSAmZnJvbSk7CisKKyAgICBlbnVtIFR5cGUgeworICAgICAgICBUWVBFX05PTkUgICAgID0gJ25vbmUnLAorICAgICAgICBUWVBFX0NfU1RSSU5HID0gJ2NzdHInLAorICAgICAgICBUWVBFX0lOVDMyICAgID0gJ2luMzInLAorICAgICAgICBUWVBFX0ZMT0FUICAgID0gJ2Zsb2EnLAorICAgICAgICBUWVBFX1BPSU5URVIgID0gJ3B0ciAnLAorICAgIH07CisKKyAgICB2b2lkIGNsZWFyKCk7CisgICAgYm9vbCByZW1vdmUodWludDMyX3Qga2V5KTsKKworICAgIGJvb2wgc2V0Q1N0cmluZyh1aW50MzJfdCBrZXksIGNvbnN0IGNoYXIgKnZhbHVlKTsKKyAgICBib29sIHNldEludDMyKHVpbnQzMl90IGtleSwgaW50MzJfdCB2YWx1ZSk7CisgICAgYm9vbCBzZXRGbG9hdCh1aW50MzJfdCBrZXksIGZsb2F0IHZhbHVlKTsKKyAgICBib29sIHNldFBvaW50ZXIodWludDMyX3Qga2V5LCB2b2lkICp2YWx1ZSk7CisKKyAgICBib29sIGZpbmRDU3RyaW5nKHVpbnQzMl90IGtleSwgY29uc3QgY2hhciAqKnZhbHVlKTsKKyAgICBib29sIGZpbmRJbnQzMih1aW50MzJfdCBrZXksIGludDMyX3QgKnZhbHVlKTsKKyAgICBib29sIGZpbmRGbG9hdCh1aW50MzJfdCBrZXksIGZsb2F0ICp2YWx1ZSk7CisgICAgYm9vbCBmaW5kUG9pbnRlcih1aW50MzJfdCBrZXksIHZvaWQgKip2YWx1ZSk7CisKKyAgICBib29sIHNldERhdGEodWludDMyX3Qga2V5LCB1aW50MzJfdCB0eXBlLCBjb25zdCB2b2lkICpkYXRhLCBzaXplX3Qgc2l6ZSk7CisKKyAgICBib29sIGZpbmREYXRhKHVpbnQzMl90IGtleSwgdWludDMyX3QgKnR5cGUsCisgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICoqZGF0YSwgc2l6ZV90ICpzaXplKSBjb25zdDsKKworcHJvdGVjdGVkOgorICAgIHZpcnR1YWwgfk1ldGFEYXRhKCk7CisKK3ByaXZhdGU6CisgICAgc3RydWN0IHR5cGVkX2RhdGEgeworICAgICAgICB0eXBlZF9kYXRhKCk7CisgICAgICAgIH50eXBlZF9kYXRhKCk7CisKKyAgICAgICAgdHlwZWRfZGF0YShjb25zdCBNZXRhRGF0YTo6dHlwZWRfZGF0YSAmKTsKKyAgICAgICAgdHlwZWRfZGF0YSAmb3BlcmF0b3I9KGNvbnN0IE1ldGFEYXRhOjp0eXBlZF9kYXRhICYpOworCisgICAgICAgIHZvaWQgY2xlYXIoKTsKKyAgICAgICAgdm9pZCBzZXREYXRhKHVpbnQzMl90IHR5cGUsIGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBzaXplKTsKKyAgICAgICAgdm9pZCBnZXREYXRhKHVpbnQzMl90ICp0eXBlLCBjb25zdCB2b2lkICoqZGF0YSwgc2l6ZV90ICpzaXplKSBjb25zdDsKKworICAgIHByaXZhdGU6CisgICAgICAgIHVpbnQzMl90IG1UeXBlOworICAgICAgICBzaXplX3QgbVNpemU7CisKKyAgICAgICAgdW5pb24geworICAgICAgICAgICAgdm9pZCAqZXh0X2RhdGE7CisgICAgICAgICAgICBmbG9hdCByZXNlcnZvaXI7CisgICAgICAgIH0gdTsKKworICAgICAgICBib29sIHVzZXNSZXNlcnZvaXIoKSBjb25zdCB7CisgICAgICAgICAgICByZXR1cm4gbVNpemUgPD0gc2l6ZW9mKHUucmVzZXJ2b2lyKTsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgYWxsb2NhdGVTdG9yYWdlKHNpemVfdCBzaXplKTsKKyAgICAgICAgdm9pZCBmcmVlU3RvcmFnZSgpOworCisgICAgICAgIHZvaWQgKnN0b3JhZ2UoKSB7CisgICAgICAgICAgICByZXR1cm4gdXNlc1Jlc2Vydm9pcigpID8gJnUucmVzZXJ2b2ly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WN0ZWQ6CisgICAgdmlydHVhbCB+T01YQ29kZWMoKTsKKworcHJpdmF0ZToKKyAgICBlbnVtIFN0YXRlIHsKKyAgICAgICAgREVBRCwKKyAgICAgICAgTE9BREVELAorICAgICAgICBMT0FERURfVE9fSURMRSwKKyAgICAgICAgSURMRV9UT19FWEVDVVRJTkcsCisgICAgICAgIEVYRUNVVElORywKKyAgICAgICAgRVhFQ1VUSU5HX1RPX0lETEUsCisgICAgICAgIElETEVfVE9fTE9BREVELAorICAgICAgICBSRUNPTkZJR1VSSU5HLAorICAgICAgICBFUlJPUgorICAgIH07CisKKyAgICBlbnVtIHsKKyAgICAgICAga1BvcnRJbmRleElucHV0ICA9IDAsCisgICAgICAgIGtQb3J0SW5kZXhPdXRwdXQgPSAxCisgICAgfTsKKworICAgIGVudW0gUG9ydFN0YXR1cyB7CisgICAgICAgIEVOQUJMRUQsCisgICAgICAgIERJU0FCTElORywKKyAgICAgICAgRElTQUJMRUQsCisgICAgICAgIEVOQUJMSU5HLAorICAgICAgICBTSFVUVElOR19ET1dOLAorICAgIH07CisKKyAgICBlbnVtIFF1aXJrcyB7CisgICAgICAgIGtOZWVkc0ZsdXNoQmVmb3JlRGlzYWJsZSAgICAgICAgICAgICA9IDEsCisgICAgICAgIGtXYW50c05BTEZyYWdtZW50cyAgICAgICAgICAgICAgICAgICA9IDIsCisgICAgICAgIGtSZXF1aXJlc0xvYWRlZFRvSWRsZUFmdGVyQWxsb2NhdGlvbiA9IDQsCisgICAgICAgIGtSZXF1aXJlc0FsbG9jYXRlQnVmZmVyT25JbnB1dFBvcnRzICA9IDgsCisgICAgICAgIGtSZXF1aXJlc0ZsdXNoQ29tcGxldGVFbXVsYXRpb24gICAgICA9IDE2LAorICAgICAgICBrUmVxdWlyZXNBbGxvY2F0ZUJ1ZmZlck9uT3V0cHV0UG9ydHMgPSAzMiwKKyAgICAgICAga1JlcXVpcmVzRmx1c2hCZWZvcmVTaHV0ZG93biAgICAgICAgID0gNjQsCisgICAgf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S9pbmNsdWRlL3ByaXZhdGUvbWVkaWEvQXVkaW9UcmFja1NoYXJlZC5oCisrKyBiL2luY2x1ZGUvcHJpdmF0ZS9tZWRpYS9BdWRpb1RyYWNrU2hhcmVkLmgKQEAgLTU1LDE3ICs1NSwxOCBAQAogICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAgICB2b2x1bWVMUjsKICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgIHNhbXBsZVJhdGU7CisgICAgICAgICAgICAgICAgLy8gTk9URTogYXVkaW9fdHJhY2tfY2Jsa190OjpmcmFtZVNpemUgaXMgbm90IGVxdWFsIHRvIEF1ZGlvVHJhY2s6OmZyYW1lU2l6ZSgpIGZvcgorICAgICAgICAgICAgICAgIC8vIDggYml0IFBDTSBkYXRhOiBpbiB0aGlzIGNhc2UsICBtQ2Jsay0+ZnJhbWVTaXplIGlzIGJhc2VkIG9uIGEgc2FtcGxlIHNpemUgb2YKKyAgICAgICAgICAgICAgICAvLyAxNiBiaXQgYmVjYXVzZSBkYXRhIGlzIGNvbnZlcnRlZCB0byAxNiBiaXQgYmVmb3JlIGJlaW5nIHN0b3JlZCBpbiBidWZmZXIKKyAgICAgICAgICAgICAgICB1aW50MzJfdCAgICBmcmFtZVNpemU7CiAgICAgICAgICAgICAgICAgdWludDhfdCAgICAgY2hhbm5lbHM7CiAgICAgICAgICAgICAgICAgdWludDhfdCAgICAgZmxvd0NvbnRyb2xGbGFnOyAvLyB1bmRlcnJ1biAob3V0KSBvciBvdmVycnJ1biAoaW4pIGluZGljYXRpb24KICAgICAgICAgICAgICAgICB1aW50OF90ICAgICBvdXQ7ICAgICAgICAvLyBvdXQgZXF1YWxzIDEgZm9yIEF1ZGlvVHJhY2sgYW5kIDAgZm9yIEF1ZGlvUmVjb3JkCi0gICAgICAgICAgICAgICAgdWludDhfdCAgICAgZm9yY2VSZWFkeTsgCisgICAgICAgICAgICAgICAgdWludDhfdCAgICAgZm9yY2VSZ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CiAgICAgICAgIFVTRVJfQ0xJUF8yICAgICA9IDB4MDQwMCwKQEAgLTEyMSw3ICsxMjMsNyBAQAogICAgICAgICBVU0VSX0NMSVBfQUxMICAgPSAweDNGMDAsCiAgICAgICAgIENMSVBfQUxMICAgICAgICA9IDB4M0YzRiwKICAgICB9OwotICAgIAorCiAgICAgLy8gdGhlIGZpZWxkcyBiZWxvdyBhcmUgYXJyYW5nZWQgdG8gbWluaW1pemUgZC1jYWNoZSB1c2FnZQogICAgIC8vIHdlIGdyb3VwIHRvZ2V0aGVyLCBieSBjYWNoZS1saW5lLCB0aGUgZmllbGRzIG1vc3QgbGlrZWx5IHRvIGJlIHVzZWQKIApAQCAtMTMwLDcgKzEzMiw3IEBACiAgICAgdmVjNF90ICAgICAgICAgIGV5ZTsKICAgICB9OwogICAgIHZlYzRfdCAgICAgICAgICBjbGlwOwotICAgIAorCiAgICAgdWludDMyX3QgICAgICAgIGZsYWdzOwogICAgIHNpemVfdCAgICAgICAgICBpbmRleDsgIC8vIGNhY2hlIHRhZywgYW5kIHZlcnRleCBpbmRleAogICAgIEdMZml4ZWQgICAgICAgICBmb2c7CkBAIC0xNDIsNyArMTQ0LDcgQEAKICAgICB2ZWM0X3QgICAgICAgICAgY29sb3I7CiAgICAgdmVjNF90ICAgICAgICAgIHRleHR1cmVbR0dMX1RFWFRVUkVfVU5JVF9DT1VOVF07CiAgICAgdWludDMyX3QgICAgICAgIHJlc2VydmVkMVs0XTsKLSAgICAKKwogICAgIGlubGluZSB2b2lkIGNsZWFyKCkgewogICAgICAgICBmbGFncyA9IGluZGV4ID0gbG9ja2VkID0gbXJ1ID0gMDsKICAgICB9CkBAIC0xOTksNyArMjAxLDcgQEAKICAgICBHTGVudW0gICAgICAgICAgaW5kaWNlc1R5cGU7CiAgICAgYnVmZmVyX3QgY29uc3QqIGFycmF5X2J1ZmZlcjsKICAgICBidWZmZXJfdCBjb25zdCogZWxlbWVudF9hcnJheV9idWZmZXI7Ci0gICAgCisKICAgICB2b2lkICgqY29tcGlsZUVsZW1lbnRzKShvZ2xlc19jb250ZXh0X3QqLCB2ZXJ0ZXhfdCosIEdMaW50LCBHTHNpemVpKTsKICAgICB2b2lkICgqY29tcGlsZUVsZW1lbnQpKG9nbGVzX2NvbnRleHRfdCosIHZlcnRleF90KiwgR0xpbnQpOwogCkBAIC0yODUsNiArMjg3LDcgQEAKICAgICB2ZWM0X3QgICAgICBub3JtYWxpemVkT2JqUG9zaXRpb247CiAgICAgdmVjNF90ICAgICAgc3BvdERpcjsKICAgICB2ZWM0X3QgICAgICBub3JtYWxpemVkU3BvdERpcjsKKyAgICB2ZWM0X3QgICAgICBvYmpWaWV3ZXI7CiAgICAgR0xmaXhlZCAgICAgc3BvdEV4cDsKICAgICBHTGZpeGVkICAgICBzcG90Q3V0b2ZmOwogICAgIEdMZml4ZWQgICAgIHNwb3RDdXRvZmZDb3NpbmU7CkBAIC00MTAsNyArNDEzLDcgQEAKICAgICBtYXRyaXh4X3QgICAgICAgbWF0cml4OwogICAgIHVpbnQzMl90ICAgICAgICBmbGFnczsKICAgICB1aW50MzJfdCAgICAgICAgb3BzOwotICAgIAorCiAgICAgdW5pb24gewogICAgICAgICBzdHJ1Y3QgewogICAgICAgICAgICAgdm9pZCAoKnBvaW50MikodHJhbnNmb3JtX3QgY29uc3QqIHQsIHZlYzRfdCosIHZlYzRfdCBjb25zdCopOwpAQCAtNTA5LDE3ICs1MTIsMTcgQEAKICAgICBHTGludCAgICAgICB4OwogICAgIEdMaW50ICAgICAgIHk7CiAgICAgR0xzaXplaSAgICAgdzsKLSAgICBHTHNpemVpICAgICBoOyAKKyAgICBHTHNpemVpICAgICBoOwogICAgIHN0cnVjdCB7CiAgICAgICAgIEdMaW50ICAgICAgIHg7CiAgICAgICAgIEdMaW50ICAgICAgIHk7Ci0gICAgfSBzdXJmYWNlcG9ydDsgIAorICAgIH0gc3VyZmFjZXBvcnQ7CiAgICAgc3RydWN0IHsKICAgICAgICAgR0xpbnQgICAgICAgeDsKICAgICAgICAgR0xpbnQgICAgICAgeTsKICAgICAgICAgR0xzaXplaSAgICAgdzsKLSAgICAgICAgR0xzaXplaSAgICAgaDsgCi0gICAgfSBzY2lzc29yOyAgCisgICAgICAgIEdMc2l6ZWkgICAgIGg7CisgICAgfSBzY2lzc29yOwogfTsKIAogLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpAQCAtNTk0LDYgKzU5NywxNCBAQAogICAgIHZvaWQgKCpyZW5kZXJUcmlhbmdsZSkoR0wsIHZlcnRleF90KiwgdmVydGV4X3QqLCB2ZXJ0ZXhfdCopOwogfTsKIAorc3RydWN0IGNvcHliaXRzX2NvbnRleHRfdCB7CisgICAgLy8gQSBoYW5kbGUgdG8gdGhlIGJsaXQgZW5naW5lLCBpZiBpdCBleGlzdHMsIGVsc2UgTlVMTC4KKyAgICBjb3B5Yml0X2RldmljZV90KiAgICAgICBibGl0RW5naW5lOworICAgIGludDMyX3QgICAgICAgICAgICAgICAgIG1pblNjYWxlOworICAgIGludDMyX3QgICAgICAgICAgICAgICAgIG1heFNjYWxlOworICAgIGJ1ZmZlcl9oYW5kbGVfdCAgICAgICAgIGRyYXdTdXJmYWNlQnVmZmVyOworfTsKKwogc3RydWN0IG9nbGVzX2NvbnRleHRfdCB7CiAgICAgY29udGV4dF90ICAgICAgICAgICAgICAgcmFzdGVyaXplcjsKICAgICBhcnJheV9tYWNoaW5lX3QgICAgICAgICBhcnJheXMgICAgICAgICBfX2F0dHJpYnV0ZV9fKChhbGlnbmVkKDMyKSkpOwpAQCAtNjE3LDYgKzYyOCwxNCBAQAogICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIHRyYW5zZm9ybVRleHR1cmVzIDogMTsKICAgICBFR0xTdXJmYWNlTWFuYWdlciogICAgICBzdXJmYWNlTWFuYWdlcjsKICAgICBFR0xCdWZmZXJP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tIHsKKyAgICAgICAgb3BfbmFuZCA9IExIUyAmIH5SSFMsCisgICAgICAgIG9wX2FuZCAgPSBMSFMgJiAgUkhTLAorICAgICAgICBvcF9vciAgID0gTEhTIHwgIFJIUywKKyAgICAgICAgb3BfeG9yICA9IExIUyBeICBSSFMKKyAgICB9OworCisgICAgc3RydWN0IHJlZ2lvbiB7CisgICAgICAgIFJFQ1QgY29uc3QqIHJlY3RzOworICAgICAgICBzaXplX3QgY291bnQ7CisgICAgICAgIFRZUEUgZHg7CisgICAgICAgIFRZUEUgZHk7CisgICAgICAgIGlubGluZSByZWdpb24oY29uc3QgcmVnaW9uJiByaHMpIAorICAgICAgICAgICAgOiByZWN0cyhyaHMucmVjdHMpLCBjb3VudChyaHMuY291bnQpLCBkeChyaHMuZHgpLCBkeShyaHMuZHkpIHsgfQorICAgICAgICBpbmxpbmUgcmVnaW9uKFJFQ1QgY29uc3QqIHIsIHNpemVfdCBjKSAKKyAgICAgICAgICAgIDogcmVjdHMociksIGNvdW50KGMpLCBkeCgpLCBkeSgpIHsgfQorICAgICAgICBpbmxpbmUgcmVnaW9uKFJFQ1QgY29uc3QqIHIsIHNpemVfdCBjLCBUWVBFIGR4LCBUWVBFIGR5KSAKKyAgICAgICAgICAgIDogcmVjdHMociksIGNvdW50KGMpLCBkeChkeCksIGR5KGR5KSB7IH0KKyAgICB9OworCisgICAgY2xhc3MgcmVnaW9uX3Jhc3Rlcml6ZXIgeworICAgICAgICBmcmllbmQgY2xhc3MgcmVnaW9uX29wZXJhdG9yOworICAgICAgICB2aXJ0dWFsIHZvaWQgb3BlcmF0b3IoKShjb25zdCBSRUNUJiByZWN0KSA9IDA7CisgICAgcHVibGljOgorICAgICAgICB2aXJ0dWFsIH5yZWdpb25fcmFzdGVyaXplcigpIHsgfTsKKyAgICB9OworICAgIAorICAgIGlubGluZSByZWdpb25fb3BlcmF0b3IoaW50IG9wLCBjb25zdCByZWdpb24mIGxocywgY29uc3QgcmVnaW9uJiByaHMpIAorICAgICAgICA6IG9wX21hc2sob3ApLCBzcGFubmVyKGxocywgcmhzKSAKKyAgICB7CisgICAgfQorCisgICAgdm9pZCBvcGVyYXRvcigpKHJlZ2lvbl9yYXN0ZXJpemVyJiByYXN0ZXJpemVyKSB7CisgICAgICAgIFJFQ1QgY3VycmVudDsKKyAgICAgICAgZG8geworICAgICAgICAgICAgU3Bhbm5lcklubmVyIHNwYW5uZXJJbm5lcihzcGFubmVyLmxocywgc3Bhbm5lci5yaHMpOworICAgICAgICAgICAgaW50IGluc2lkZSA9IHNwYW5uZXIubmV4dChjdXJyZW50LnRvcCwgY3VycmVudC5ib3R0b20pOworICAgICAgICAgICAgc3Bhbm5lcklubmVyLnByZXBhcmUoaW5zaWRlKTsKKyAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICBUWVBFIGxlZnQsIHJpZ2h0OworICAgICAgICAgICAgICAgIGludCBpbnNpZGUgPSBzcGFubmVySW5uZXIubmV4dChjdXJyZW50LmxlZnQsIGN1cnJlbnQucmlnaHQpOworICAgICAgICAgICAgICAgIGlmICgob3BfbWFzayA+PiBpbnNpZGUpICYgMSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudC5sZWZ0IDwgY3VycmVudC5yaWdodCAmJiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50LnRvcCA8IGN1cnJlbnQuYm90dG9tKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByYXN0ZXJpemVyKGN1cnJlbnQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSB3aGlsZSghc3Bhbm5lcklubmVyLmlzRG9uZSgpKTsgICAgICAgICAgICAKKyAgICAgICAgfSB3aGlsZSghc3Bhbm5lci5pc0RvbmUoKSk7CisgICAgfQorCitwcml2YXRlOiAgICAKKyAgICB1aW50MzJfdCBvcF9tYXNrOworCisgICAgY2xhc3MgU3Bhbm5lckJhc2UKKyAgICB7CisgICAgcHVibGljOgorICAgICAgICBlbnVtIHsKKyAgICAgICAgICAgIGxoc19iZWZvcmVfcmhzICAgPSAwLAorICAgICAgICAgICAgbGhzX2FmdGVyX3JocyAgICA9IDEsCisgICAgICAgICAgICBsaHNfY29pbmNpZGVfcmhzID0gMgorICAgICAgICB9OworCisgICAgcHJvdGVjdGVkOgorICAgICAgICBUWVBFIGxoc19oZWFkOworICAgICAgICBUWVBFIGxoc190YWlsOworICAgICAgICBUWVBFIHJoc19oZWFkOworICAgICAgICBUWVBFIHJoc190YWlsOworCisgICAgICAgIGlubGluZSBpbnQgbmV4dChUWVBFJiBoZWFkLCBUWVBFJiB0YWlsLAorICAgICAgICAgICAgICAgIGJvb2wmIG1vcmVfbGhzLCBib29sJiBtb3JlX3JocykgCisgICAgICAgIHsKKyAgICAgICAgICAgIGludCBpbnNpZGU7CisgICAgICAgICAgICBtb3JlX2xocyA9IGZhbHNlOworICAgICAgICAgICAgbW9yZV9yaHMgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmIChsaHNfaGVhZCA8IHJoc19oZWFkKSB7CisgICAgICAgICAgICAgICAgaW5zaWRlID0gbGhzX2JlZm9yZV9yaHM7CisgICAgICAgICAgICAgICAgaGVhZCA9IGxoc19oZWFkOworICAgICAgICAgICAgICAgIGlmIChsaHNfdGFpbCA8PSByaHNfaGVhZCkgeworICAgICAgICAgICAgICAgICAgICB0YWlsID0gbGhzX3RhaWw7CisgICAgICAgICAgICAgICAgICAgIG1vcmVfbGhzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBsaHNfaGVhZCA9IHJoc19oZWFkOworICAgICAgICAgICAgICAgICAgICB0YWlsID0gcmhzX2hlYWQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChyaHNfaGVhZCA8IGxoc19oZWFkKSB7CisgICAgICAgICAgICAgICAgaW5zaWRlID0gbGhzX2FmdGVyX3JoczsKKyAgICAgICAgICAgICAgICBoZWFkID0gcmhzX2hlYWQ7CisgICAgICAgICAgICAgICAgaWYgKHJoc190YWlsIDw9IGxoc19oZWFkKSB7CisgICAgICAgICAgICAgICAgICAgIHRhaWwgPSByaHNfdGFpbDsKKyAgICAgICAgICAgICAgICAgICAgbW9yZV9yaHMgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJoc19oZWFkID0gbGhzX2hlYWQ7CisgICAgICAgICAgICAgICAgICAgIHRhaWwgPSBsaHNfaGVhZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGluc2lkZSA9IGxoc19jb2luY2lkZV9yaHM7CisgICAgICAgICAgICAgICAgaGVhZCA9IGxoc19oZWFkOworICAgICAgICAgICAgICAgIGlmIChsaHNfdGFpbCA8PSByaHNfdGFpbCkgeworICAgICAgICAgICAgICAgICAgICB0YWlsID0gcmhzX2hlYWQgPSBsaHNfdGFpbDsKKyAgICAgICAgICAgICAgICAgICAgbW9yZV9saHMgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocmhzX3RhaWwgPD0gbGhzX3RhaWwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGFpbCA9IGxoc19oZWFkID0gcmhzX3RhaWw7CisgICAgICAgICAgICAgICAgICAgIG1vcmVfcmhzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gaW5zaWRlOworICAgICAgICB9CisgICAgfTsKKworICAgIGNsYXNzIFNwYW5uZXIgOiBwcm90ZWN0ZWQgU3Bhbm5lckJhc2UgCisgICAgeworICAgICAgICBmcmllbmQgY2xhc3MgcmVnaW9uX29wZXJhdG9yOworICAgICAgICByZWdpb24gbGhzOworICAgICAgICByZWdpb24gcmhzOworCisgICAgcHVibGljOgorICAgICAgICBpbmxpbmUgU3Bhbm5lcihjb25zdCByZWdpb24mIGxocywgY29uc3QgcmVnaW9uJiByaHMpCisgICAgICAgICAgICA6IGxocyhsaHMpLCByaHMocmhzKSAKKyAgICAgICAgeworICAgICAgICAgICAgU3Bhbm5lckJhc2U6Omxoc19oZWFkID0gbGhzLnJlY3RzLT50b3AgICAgICArIGxocy5keTsKKyAgICAgICAgICAgIFNwYW5uZXJCYXNlOjpsaHNfdGFpbCA9IGxocy5yZWN0cy0+Ym90dG9tICAgKyBsaHMuZHk7CisgICAgICAgICAgICBTcGFubmVyQmFzZTo6cmhzX2hlYWQgPSByaHMucmVjdHMtPnRvcCAgICAgICsgcmhzLmR5OworICAgICAgICAgICAgU3Bhbm5lckJhc2U6OnJoc190YWlsID0gcmhzLnJlY3RzLT5ib3R0b20gICArIHJocy5keTsKKyAgICAgICAgfQorCisgICAgICAgIGlubGluZSBib29sIGlzRG9uZSgpIGNvbnN0IHsKKyAgICAgICAgICAgIHJldHVybiAhcmhzLmNvdW50ICYmICFsaHMuY291bnQ7CisgICAgICAgIH0KKworICAgICAgICBpbmxpbmUgaW50IG5leHQoVFlQRSYgdG9wLCBUWVBFJiBib3R0b20pIAorICAgICAgICB7CisgICAgICAgICAgICBib29sIG1vcmVfbGhzID0gZmFsc2U7CisgICAgICAgICAgICBib29sIG1vcmVfcmhzID0gZmFsc2U7CisgICAgICAgICAgICBpbnQgaW5zaWRlID0gU3Bhbm5lckJhc2U6Om5leHQodG9wLCBib3R0b20sIG1vcmVfbGhzLCBtb3JlX3Jocyk7CisgICAgICAgICAgICBpZiAobW9yZV9saHMpIHsKKyAgICAgICAgICAgICAgICBhZHZhbmNlKGxocywgU3Bhbm5lckJhc2U6Omxoc19oZWFkLCBTcGFubmVyQmFzZTo6bGhzX3RhaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1vcmVfcmhzKSB7CisgICAgICAgICAgICAgICAgYWR2YW5jZShyaHMsIFNwYW5uZXJCYXNlOjpyaHNfaGVhZCwgU3Bhbm5lckJhc2U6OnJoc190YWlsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBpbnNpZGU7CisgICAgICAgIH0KKworICAgIHByaXZhdGU6CisgICAgICAgIHN0YXRpYyBpbmxpbmUgCisgICAgICAgIHZvaWQgYWR2YW5jZShyZWdpb24mIHJlZywgVFlQRSYgYVRvcCwgVFlQRSYgYUJvdHRvbSkgeworICAgICAgICAgICAgLy8gZ290IHRvIG5leHQgc3BhbgorICAgICAgICAgICAgc2l6ZV90IGNvdW50ID0gcmVnLmNvdW50OworICAgICAgICAgICAgUkVDVCBjb25zdCAqIHJlY3RzID0gcmVnLnJlY3RzOworICAgICAgICAgICAgUkVDVCBjb25zdCAqIGNvbnN0IGVuZCA9IHJlY3RzICsgY291bnQ7CisgICAgICAgICAgICBjb25zdCBpbnQgdG9wID0gcmVjdHMtPnRvcDsKKyAgICAgICAgICAgIHdoaWxlIChyZWN0cyAhPSBlbmQgJiYgcmVjdHMtPnRvcCA9PSB0b3ApIHsKKyAgICAgICAgICAgICAgICByZWN0cysrOworICAgICAgICAgICAgICAgIGNvdW50LS07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmVjdHMgIT0gZW5kKSB7CisgICAgICAgICAgICAgICAgYVRvcCAgICA9IHJlY3RzLT50b3AgICAgKyByZWcuZHk7CisgICAgICAgICAgICAgICAgYUJvdHRvbSA9IHJlY3RzLT5ib3R0b20gKyByZWcuZHk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGFUb3AgICAgPSBtYXhfdmFsdWU7CisgICAgICAgICAgICAgICAgYUJvdHRvbSA9IG1heF92YWx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJlZy5yZWN0cyA9IHJlY3RzOworICAgICAgICAgICAgcmVnLmNvdW50ID0gY291bnQ7CisgICAgICAgIH0KKyAgICB9OworCisgICAgY2xhc3MgU3Bhbm5lcklubmVyIDogcHJvdGVjdGVkIFNwYW5uZXJCYXNlIAorICAgIHsKKyAgICAgICAgcmVnaW9uIGxoczsKKyAgICAgICAgcmVnaW9uIHJoczsKKyAgICAgICAgCisgICAgcHVibGljOgorICAgICAgICBpbmxpbmUgU3Bhbm5lcklubmVyKGNvbnN0IHJlZ2lvbiYgbGhzLCBjb25zdCByZWdpb24mIHJocykKKyAgICAgICAgICAgIDogbGhzKGxocyksIHJocyhyaHMpIAorICAgICAgICB7CisgICAgICAgIH0KKworICAgICAgICBpbmxpbmUgdm9pZCBwcmVwYXJlKGludCBpbnNpZGUpIHsKKyAgICAgICAgICAgIFNwYW5uZXJCYXNlOjpsaHNfaGVhZCA9IGxocy5yZWN0cy0+bGVmdCAgKyBsaHMuZHg7CisgICAgICAgICAgICBTcGFubmVyQmFzZTo6bGhzX3RhaWwgPSBsaHMucmVjdHMtPnJpZ2h0ICsgbGhzLmR4OworICAgICAgICAgICAgU3Bhbm5lckJhc2U6OnJoc19oZWFkID0gcmhzLnJlY3RzLT5sZWZ0ICArIHJocy5keDsKKyAgICAgICAgICAgIFNwYW5uZXJCYXNlOjpyaHNfdGFpbCA9IHJocy5yZWN0cy0+cmlnaHQgKyByaHMuZHg7CisgICAgICAgICAgICBpZiAoaW5zaWRlID09IFNwYW5uZXJCYXNlOjpsaHNfYmVmb3JlX3JocykgeworICAgICAgICAgICAgICAgIFNwYW5uZXJCYXNlOjpyaHNfaGVhZCA9IG1heF92YWx1ZTsKKyAgICAgICAgICAgICAgICBTcGFubmVyQmFzZTo6cmhzX3RhaWwgPSBtYXhfdmFsdWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGluc2lkZSA9PSBTcGFubmVyQmFzZTo6bGhzX2FmdGVyX3JocykgeworICAgICAgICAgICAgICAgIFNwYW5uZXJCYXNlOjpsaHNfaGVhZCA9IG1heF92YWx1ZTsKKyAgICAgICAgICAgICAgICBTcGFubmVyQmFzZTo6bGhzX3RhaWwgPSBtYXhfdmFsdWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIHVzZSBib3RoIHNwYW5zCisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbmxpbmUgYm9vbCBpc0RvbmUoKSBjb25zdCB7CisgICAgICAgICAgICByZXR1cm4gU3Bhbm5lckJhc2U6Omxoc19oZWFkID09IG1heF92YWx1ZSAmJiAKKyAgICAgICAgICAgICAgICAgICBTcGFubmVyQmFzZTo6cmhzX2hlYWQgPT0gbWF4X3ZhbHVlOworICAgICAgICB9CisKKyAgICAgICAgaW5saW5lIGludCBuZXh0KFRZUEUmIGxlZnQsIFRZUEUmIHJpZ2h0KSAKKyAgICAgICAgeworICAgICAgICAgICAgYm9vbCBtb3JlX2xocyA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCBtb3JlX3JocyA9IGZhbHNlOworICAgICAgICAgICAgaW50IGluc2lkZSA9IFNwYW5uZXJCYXNlOjpuZXh0KGxlZnQsIHJpZ2h0LCBtb3JlX2xocywgbW9yZV9yaHMpOworICAgICAgICAgICAgaWYgKG1vcmVfbGhzKSB7CisgICAgICAgICAgICAgICAgYWR2YW5jZShsaHMsIFNwYW5uZXJCYXNlOjpsaHNfaGVhZCwgU3Bhbm5lckJhc2U6Omxoc190YWlsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtb3JlX3JocykgeworICAgICAgICAgICAgICAgIGFkdmFuY2UocmhzLCBTcGFubmVyQmFzZTo6cmhzX2hlYWQsIFNwYW5uZXJCYXNlOjpyaHNfdGFpbCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gaW5zaWRlOworICAgICAgICB9CisKKyAgICBwcml2YXRlOgorICAgICAgICBzdGF0aWMgaW5saW5lIAorICAgICAgICB2b2lkIGFkdmFuY2UocmVnaW9uJiByZWcsIFRZUEUmIGxlZnQsIFRZUEUmIHJpZ2h0KSB7CisgICAgICAgICAgICBpZiAocmVnLnJlY3RzICYmIHJlZy5jb3VudCkgeworICAgICAgICAgICAgICA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0cnVlISBXZSByZWNvdmVyZWQgYnV0IGl0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAic2hvdWxkbid0IGhhcHBlbi4iICwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVDo6bmFtZSgpLCBtU2hhcmVkU3RhY2stPmlkZW50aXR5KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HVygid2FpdEZvckNvbmRpdGlvbiglcykgdGltZWQgb3V0IChpZGVudGl0eT0lZCkuICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ1BVIG1heSBiZSBwZWdnZWQuIHRyeWluZyBhZ2Fpbi4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFQ6Om5hbWUoKSwgbVNoYXJlZFN0YWNrLT5pZGVudGl0eSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJ3YWl0Rm9yQ29uZGl0aW9uKCVzKSBlcnJvciAoJXMpICIsCisgICAgICAgICAgICAgICAgICAgICAgICBUOjpuYW1lKCksIHN0cmVycm9yKC1lcnIpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBOT19FUlJPUjsKK30KKworCit0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4KK3N0YXR1c190IFNoYXJlZEJ1ZmZlckJhc2U6OnVwZGF0ZUNvbmRpdGlvbihUIHVwZGF0ZSkgeworICAgIFNoYXJlZENsaWVudCYgY2xpZW50KCAqbVNoYXJlZENsaWVudCApOworICAgIE11dGV4OjpBdXRvbG9jayBfbChjbGllbnQubG9jayk7CisgICAgc3NpemVfdCByZXN1bHQgPSB1cGRhdGUoKTsKKyAgICBjbGllbnQuY3YuYnJvYWRjYXN0KCk7ICAgIAorICAgIHJld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sKKworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKK3N0cnVjdCBkaXNwbGF5X2NibGtfdAoreworICAgIHVpbnQxNl90ICAgIHc7CisgICAgdWludDE2X3QgICAgaDsKKyAgICB1aW50OF90ICAgICBmb3JtYXQ7CisgICAgdWludDhfdCAgICAgb3JpZW50YXRpb247CisgICAgdWludDhfdCAgICAgcmVzZXJ2ZWRbMl07CisgICAgZmxvYXQgICAgICAgZnBzOworICAgIGZsb2F0ICAgICAgIGRlbnNpdHk7CisgICAgZmxvYXQgICAgICAgeGRwaTsKKyAgICBmbG9hdCAgICAgICB5ZHBpOworICAgIHVpbnQzMl90ICAgIHBhZFsyXTsKK307CisKK3N0cnVjdCBzdXJmYWNlX2ZsaW5nZXJfY2Jsa190ICAgLy8gNEtCIG1heAoreworICAgIHVpbnQ4X3QgICAgICAgICBjb25uZWN0ZWQ7CisgICAgdWludDhfdCAgICAgICAgIHJlc2VydmVkWzNdOworICAgIHVpbnQzMl90ICAgICAgICBwYWRbN107CisgICAgZGlzcGxheV9jYmxrX3QgIGRpc3BsYXlzW05VTV9ESVNQTEFZX01BWF07Cit9OworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworQ09NUElMRV9USU1FX0FTU0VSVChzaXplb2YoU2hhcmVkQ2xpZW50KSA8PSA0MDk2KQorQ09NUElMRV9USU1FX0FTU0VSVChzaXplb2YoU2hhcmVkQnVmZmVyU3RhY2spID09IDEyOCkKK0NPTVBJTEVfVElNRV9BU1NFUlQoc2l6ZW9mKHN1cmZhY2VfZmxpbmdlcl9jYmxrX3QpIDw9IDQwOTYpCisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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90ICAgICBsOwotICAgIGludDE2X3QgICAgIHQ7Ci0gICAgaW50MTZfdCAgICAgcjsKLSAgICBpbnQxNl90ICAgICBiOwotICAgIHVpbnQxNl90ICAgIHJ1bnNbMTRdOwotfTsKLQotc3RydWN0IGxheWVyX2NibGtfdCAgICAgLy8gKDEyOCBieXRlcykKLXsKLSAgICB2b2xhdGlsZSAgICBpbnQzMl90ICAgICAgICAgICAgIHN3YXBTdGF0ZTsgICAgICAvLyAgNAotICAgIHZvbGF0aWxlICAgIGludDMyX3QgICAgICAgICAgICAgZmxhZ3M7ICAgICAgICAgIC8vICA0Ci0gICAgdm9sYXRpbGUgICAgaW50MzJfdCAgICAgICAgICAgICBpZGVudGl0eTsgICAgICAgLy8gIDQKLSAgICAgICAgICAgICAgICBpbnQzMl90ICAgICAgICAgICAgIHJlc2VydmVkOyAgICAgICAvLyAgNAotICAgICAgICAgICAgICAgIHN1cmZhY2VfaW5mb190ICAgICAgc3VyZmFjZVsyXTsgICAgIC8vIDMyCi0gICAgICAgICAgICAgICAgZmxhdF9yZWdpb25fdCAgICAgICByZWdpb25bMl07ICAgICAgLy8gODAKLQotICAgIHN0YXRpYyBpbmxpbmUgaW50IGJhY2tCdWZmZXIodWludDMyX3Qgc3RhdGUpIHsKLSAgICAgICAgcmV0dXJuICgoc3RhdGUgJiBlSW5kZXgpIF4gKChzdGF0ZSAmIGVGbGlwUmVxdWVzdGVkKT4+MSkpOwotICAgIH0KLSAgICBzdGF0aWMgaW5saW5lIGludCBmcm9udEJ1ZmZlcih1aW50MzJfdCBzdGF0ZSkgewotICAgICAgICByZXR1cm4gMSAtIGJhY2tCdWZmZXIoc3RhdGUpOwotICAgIH0KLX07Ci0KLS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi1zdHJ1Y3QgcGVyX2NsaWVudF9jYmxrX3QgICAvLyA0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X3QgICAgdGFrZVBpY3R1cmUoc2h1dHRlcl9jYWxsYmFjaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhd19jYWxsYmFjaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpwZWdfY2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiB1c2VyKSA9IDA7CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICB0YWtlUGljdHVyZSgpID0gMDsKIAogICAgIC8qKgotICAgICAqIENhbmNlbCBhIHBpY3R1cmUgdGhhdCB3YXMgc3RhcnRlZCB3aXRoIHRha2VQaWN0dXJlLiAgWW91IG1heSBjYW5jZWwgYW55Ci0gICAgICogb2YgdGhlIHNodXR0ZXIsIHJhdywgb3IganBlZyBjYWxsYmFja3MuICBDYWxsaW5nIHRoaXMgbWV0aG9kIHdoZW4gbm8KLSAgICAgKiBwaWN0dXJlIGlzIGJlaW5nIHRha2VuIGlzIGEgbm8tb3AuCisgICAgICogQ2FuY2VsIGEgcGljdHVyZSB0aGF0IHdhcyBzdGFydGVkIHdpdGggdGFrZVBpY3R1cmUuICBDYWxsaW5nIHRoaXMKKyAgICAgKiBtZXRob2Qgd2hlbiBubyBwaWN0dXJlIGlzIGJlaW5nIHRha2VuIGlzIGEgbm8tb3AuCiAgICAgICovCi0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBjYW5jZWxQaWN0dXJlKGJvb2wgY2FuY2VsX3NodXR0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgY2FuY2VsX3JhdywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBjYW5jZWxfanBlZykgPSAwOworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgY2FuY2VsUGljdHVyZSgpID0gMDsKIAogICAgIC8qKiBTZXQgdGhlIGNhbWVyYSBwYXJhbWV0ZXJzLiAqL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y2x1ZGVkRGV2aWNlKGNvbnN0IGNoYXIqIGRldmljZU5hbWUpOworCiAgICAgLy8gc3BlY2lhbCB0eXBlIGNvZGVzIHdoZW4gZGV2aWNlcyBhcmUgYWRkZWQvcmVtb3ZlZC4KICAgICBlbnVtIHsKICAgICAgICAgREVWSUNFX0FEREVEID0gMHgxMDAwMDAwMCwKQEAgLTgyLDEwICs5NCw5IEBACiAgICAgdmlydHVhbCBib29sIGdldEV2ZW50KGludDMyX3QqIG91dERldmljZUlkLCBpbnQzMl90KiBvdXRUeXBlLAogICAgICAgICAgICAgaW50MzJfdCogb3V0U2NhbmNvZGUsIGludDMyX3QqIG91dEtleWNvZGUsIHVpbnQzMl90ICpvdXRGbGFncywKICAgICAgICAgICAgIGludDMyX3QqIG91dFZhbHVlLCBuc2Vjc190KiBvdXRXaGVuKTsKLSAgICAKKwogcHJvdGVjdGVkOgogICAgIHZpcnR1YWwgfkV2ZW50SHViKCk7Ci0gICAgdmlydHVhbCB2b2lkIG9uRmlyc3RSZWYoKTsKICAgICAKIHByaXZhdGU6CiAgICAgYm9vbCBvcGVuUGxhdGZvcm1JbnB1dCh2b2lkKTsKQEAgLTEwOCwxNyArMTE5LDE4IEBACiAgICAgICAgIFN0cmluZzggICAgICAgICBrZXlsYXlvdXRGaWxlbmFtZTsKICAgICAgICAgZGV2aWNlX3QqICAgICAgIG5leHQ7CiAgICAgICAgIAotICAgICAgICBkZXZpY2VfdChpbnQzMl90IF9pZCwgY29uc3QgY2hhciogX3BhdGgpOworICAgICAgICBkZXZpY2VfdChpbnQzMl90IF9pZCwgY29uc3QgY2hhciogX3BhdGgsIGNvbnN0IGNoYXIqIG5hbWUpOwogICAgICAgICB+ZGV2aWNlX3QoKTsKICAgICB9OwogCiAgICAgZGV2aWNlX3QqIGdldERldmljZShpbnQzMl90IGRldmljZUlkKSBjb25zdDsKKyAgICBib29sIGhhc0tleWNvZGUoZGV2aWNlX3QqIGRldmljZSwgaW50IGtleWNvZGUpIGNvbnN0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RSAgICA9IDMKKyAgICB9OworICAgIAogICAgIGVudW0geyAvLyBjb21wb25lbnRzCiAgICAgICAgIEFMUEhBICAgICAgICAgICAgICAgPSAxLAogICAgICAgICBSR0IgICAgICAgICAgICAgICAgID0gMiwKQEAgLTk1LDIwICsxMDIsMzMgQEAKICAgICAgICAgWV9DQl9DUl9JICAgICAgICAgICA9IDgsCiAgICAgfTsKIAorICAgIHN0cnVjdCBzemluZm8geworICAgICAgICB1aW50OF90IGg7CisgICAgICAgIHVpbnQ4X3QgbDsKKyAgICB9OworICAgIAogICAgIGlubGluZSBQaXhlbEZvcm1hdEluZm8oKSA6IHZlcnNpb24oc2l6ZW9mKFBpeGVsRm9ybWF0SW5mbykpIHsgfQogICAgIHNpemVfdCBnZXRTY2FubGluZVNpemUodW5zaWduZWQgaW50IHdpZHRoKSBjb25zdDsKKyAgICBzaXplX3QgZ2V0U2l6ZShzaXplX3QgY2kpIGNvbnN0IHsgCisgICAgICAgIHJldHVybiAoY2kgPD0gMykgPyAoY2luZm9bY2ldLmggLSBjaW5mb1tjaV0ubCkgOiAwOworICAgIH0KICAgICBzaXplX3QgICAgICB2ZXJzaW9uOwogICAgIFBpeGVsRm9ybWF0IGZvcm1hdDsKICAgICBzaXplX3QgICAgICBieXRlc1BlclBpeGVsOwogICAgIHNpemVfdCAgICAgIGJpdHNQZXJQaXhlbDsKLSAgICB1aW50OF90ICAgICBoX2FscGhhOwotICAgIHVpbnQ4X3QgICAgIGxfYWxwaGE7Ci0gICAgdWludDhfdCAgICAgaF9yZWQ7Ci0gICAgdWludDhfdCAgICAgbF9yZWQ7Ci0gICAgdWludDhfdCAgICAgaF9ncmVlbjsKLSAgICB1aW50OF90ICAgICBsX2dyZWVuOwotICAgIHVpbnQ4X3QgICAgIGhfYmx1ZTsKLSAgICB1aW50OF90ICAgICBsX2JsdWU7CisgICAgdW5pb24geworICAgICAgICBzemluZm8gICAgICBjaW5mb1s0XTsKKyAgICAgICAgc3RydWN0IHsKKyAgICAgIC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BSZWN0JiByaHMpOwogICAgIGV4cGxpY2l0ICAgICAgICAgICAgUmVnaW9uKGNvbnN0IFBhcmNlbCYgcGFyY2VsKTsKICAgICBleHBsaWNpdCAgICAgICAgICAgIFJlZ2lvbihjb25zdCB2b2lkKiBidWZmZXIpOwpAQCAtNDgsNjUgKzQ1LDc4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgUmVnaW9uJiBvcGVyYXRvciA9IChjb25zdCBSZWdpb24mIHJocyk7CiAKLSAgICBpbmxpbmUgIGJvb2wgICAgICAgIGlzRW1wdHkoKSBjb25zdCAgICAgeyByZXR1cm4gbVJlZ2lvbi5pc0VtcHR5KCk7IH0KLSAgICBpbmxpbmUgIGJvb2wgICAgICAgIGlzUmVjdCgpIGNvbnN0ICAgICAgeyByZXR1cm4gbVJlZ2lvbi5pc1JlY3QoKTsgfQorICAgIGlubGluZSAgYm9vbCAgICAgICAgaXNFbXB0eSgpIGNvbnN0ICAgICB7IHJldHVybiBtQm91bmRzLmlzRW1wdHkoKTsgIH0KKyAgICBpbmxpbmUgIGJvb2wgICAgICAgIGlzUmVjdCgpIGNvbnN0ICAgICAgeyByZXR1cm4gbVN0b3JhZ2UuaXNFbXB0eSgpOyB9CiAKLSAgICAgICAgICAgIFJlY3QgICAgICAgIGJvdW5kcygpIGNvbnN0OworICAgIGlubGluZSAgUmVjdCAgICAgICAgZ2V0Qm91bmRzKCkgY29uc3QgICB7IHJldHVybiBtQm91bmRzOyB9CisgICAgaW5saW5lICBSZWN0ICAgICAgICBib3VuZHMoKSBjb25zdCAgICAgIHsgcmV0dXJuIGdldEJvdW5kcygpOyB9CiAKLSAgICAgICAgICAgIGNvbnN0IFNrUmVnaW9uJiB0b1NrUmVnaW9uKCkgY29uc3Q7Ci0KKyAgICAgICAgICAgIC8vIHRoZSByZWdpb24gYmVjb21lcyBpdHMgYm91bmRzCisgICAgICAgICAgICBSZWdpb24mICAgICBtYWtlQm91bmRzU2VsZigpOworICAgIAogICAgICAgICAgICAgdm9pZCAgICAgICAgY2xlYXIoKTsKICAgICAgICAgICAgIHZvaWQgICAgICAgIHNldChjb25zdCBSZWN0JiByKTsKKyAgICAgICAgICAgIHZvaWQgICAgICAgIHNldCh1aW50MzJfdCB3LCB1aW50MzJfdCBoKTsKICAgICAgICAgCiAgICAgICAgICAgICBSZWdpb24mICAgICBvclNlbGYoY29uc3QgUmVjdCYgcmhzKTsKICAgICAgICAgICAgIFJlZ2lvbiYgICAgIGFuZFNlbGYoY29uc3QgUmVjdCYgcmhzKTsKKyAgICAgICAgICAgIFJlZ2lvbiYgICAgIHN1YnRyYWN0U2VsZihjb25zdCBSZWN0JiByaHMpOwogCiAgICAgICAgICAgICAvLyBib29sZWFuIG9wZXJhdG9ycywgYXBwbGllZCBvbiB0aGlzCiAgICAgICAgICAgICBSZWdpb24mICAgICBvclNlbGYoY29uc3QgUmVnaW9uJiByaHMpOwogICAgICAgICAgICAgUmVnaW9uJiAgICAgYW5kU2VsZihjb25zdCBSZWdpb24mIHJocyk7CiAgICAgICAgICAgICBSZWdpb24mICAgICBzdWJ0cmFjdFNlbGYoY29uc3QgUmVnaW9uJiByaHMpOwogCisgICAgICAgICAgICAvLyBib29sZWFuIG9wZXJhdG9ycworICAgIGNvbnN0ICAgUmVnaW9uICAgICAgbWVyZ2UoY29uc3QgUmVjdCYgcmhzKSBjb25zdDsKKyAgICBjb25zdCAgIFJlZ2lvbiAgICAgIGludGVyc2VjdChjb25zdCBSZWN0JiByaHMpIGNvbnN0OworICAgIGNvbnN0ICAgUmVnaW9uICAgICAgc3VidHJhY3QoY29uc3QgUmVjdCYgcmhzKSBjb25zdDsKKworICAgICAgICAgICAgLy8gYm9vbGVhbiBvcGVyYXRvcnMKKyAgICBjb25zdCAgIFJlZ2lvbiAgICAgIG1lcmdlKGNvbnN0IFJlZ2lvbiYgcmhzKSBjb25zdDsKKyAgICBjb25zdCAgIFJlZ2lvbiAgICAgIGludGVyc2VjdChjb25zdCBSZWdpb24mIHJocykgY29uc3Q7CisgICAgY29uc3QgICBSZWdpb24gICAgICBzdWJ0cmFjdChjb25zdCBSZWdpb24mIHJocykgY29uc3Q7CisKICAgICAgICAgICAgIC8vIHRoZXNlIHRyYW5zbGF0ZSByaHMgZmlyc3QKICAgICAgICAgICAgIFJlZ2lvbiYgICAgIHRyYW5zbGF0ZVNlbGYoaW50IGR4LCBpbnQgZHkpOwogICAgICAgICAgICAgUmVnaW9uJiAgICAgb3JTZWxmKGNvbnN0IFJlZ2lvbiYgcmhzLCBpbnQgZHgsIGludCBkeSk7CiAgICAgICAgICAgICBSZWdpb24mICAgICBhbmRTZWxmKGNvbnN0IFJlZ2lvbiYgcmhzLCBpbnQgZHgsIGludCBkeSk7CiAgICAgICAgICAgICBSZWdpb24mICAgICBzdWJ0cmFjdFNlbGYoY29uc3QgUmVnaW9uJiByaHMsIGludCBkeCwgaW50IGR5KTsKIAotICAgICAgICAgICAgLy8gYm9vbGVhbiBvcGVyYXRvcnMKLSAgICAgICAgICAgIFJlZ2lvbiAgICAgIG1lcmdlKGNvbnN0IFJlZ2lvbiYgcmhzKSBjb25zdDsKLSAgICAgICAgICAgIFJlZ2lvbiAgICAgIGludGVyc2VjdChjb25zdCBSZWdpb24mIHJocykgY29uc3Q7Ci0gICAgICAgICAgICBSZWdpb24gICAgICBzdWJ0cmFjdChjb25zdCBSZWdpb24mIHJocykgY29uc3Q7Ci0KICAgICAgICAgICAgIC8vIHRoZXNlIHRyYW5zbGF0ZSByaHMgZmlyc3QKLSAgICAgICAgICAgIFJlZ2lvbiAgICAgIHRyYW5zbGF0ZShpbnQgZHgsIGludCBkeSkgY29uc3Q7Ci0gICAgICAgICAgICBSZWdpb24gICAgICBtZXJnZShjb25zdCBSZWdpb24mIHJocywgaW50IGR4LCBpbnQgZHkpIGNvbnN0OwotICAgICAgICAgICAgUmVnaW9uICAgICAgaW50ZXJzZWN0KGNvbnN0IFJlZ2lvbiYgcmhzLCBpbnQgZHgsIGludCBkeSkgY29uc3Q7Ci0gICAgICAgICAgICBSZWdpb24gICAgICBzdWJ0cmFjdChjb25zdCBSZWdpb24mIHJocywgaW50IGR4LCBpbnQgZHkpIGNvbnN0OworICAgIGNvbnN0ICAgUmVnaW9uICAgICAgdHJhbnNsYXRlKGludCBkeCwgaW50IGR5KSBjb25zdDsKKyAgICBjb25zdCAgIFJlZ2lvbiAgICAgIG1lcmdlKGNvbnN0IFJlZ2lvbiYgcmhzLCBpbnQgZHgsIGludCBkeSkgY29uc3Q7CisgICAgY29uc3QgICBSZWdpb24gICAgICBpbnRlcnNlY3QoY29uc3QgUmVnaW9uJiByaHMsIGludCBkeCwgaW50IGR5KSBjb25zdDsKKyAgICBjb25zdCAgIFJlZ2lvbiAgICAgIHN1YnRyYWN0KGNvbnN0IFJlZ2lvbiYgcmhzLCBpbnQgZHgsIGludCBkeSkgY29uc3Q7CiAKICAgICAvLyBjb252ZW5pZW5jZSBvcGVyYXRvcnMgb3ZlcmxvYWRzCi0gICAgaW5saW5lICBSZWdpb24gICAgICBvcGVyYXRvciB8IChjb25zdCBSZWdpb24mIHJocykgY29uc3Q7Ci0gICAgaW5saW5lICBSZWdpb24gICAgICBvcGVyYXRvciAmIChjb25zdCBSZWdpb24mIHJocykgY29uc3Q7Ci0gICAgaW5saW5lICBSZWdpb24gICAgICBvcGVyYXRvciAtIChjb25zdCBSZWdpb24mIHJocykgY29uc3Q7Ci0gICAgaW5saW5lICBSZWdpb24gICAgICBvcGVyYXRvciArIChjb25zdCBQb2ludCYgcHQpIGNvbnN0OworICAgIGlubGluZSAgY29uc3QgUmVnaW9uICAgICAgb3BlcmF0b3IgfCAoY29uc3QgUmVnaW9uJiByaHMpIGNvbnN0OworICAgIGlubGluZSAgY29uc3QgUmVnaW9uICAgICAgb3BlcmF0b3IgJiAoY29uc3QgUmVnaW9uJiByaHMpIGNvbnN0OworICAgIGlubGluZSAgY29uc3QgUmVnaW9uICAgICAgb3BlcmF0b3IgLSAoY29uc3QgUmVnaW9uJiByaHMpI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lCiB7Ci0KIHB1YmxpYzoKLSAgICBzdHJ1Y3QgU3VyZmFjZUluZm8gewotICAgICAgICB1aW50MzJfdCAgICB3OwotICAgICAgICB1aW50MzJfdCAgICBoOwotICAgICAgICB1aW50MzJfdCAgICBicHI7Ci0gICAgICAgIFBpeGVsRm9ybWF0IGZvcm1hdDsKLSAgICAgICAgdm9pZCogICAgICAgYml0czsKLSAgICAgICAgdm9pZCogICAgICAgYmFzZTsKLSAgICAgICAgdWludDMyX3QgICAgcmVzZXJ2ZWRbMl07Ci0gICAgfTsKLQotICAgIGJvb2wgICAgICAgIGlzVmFsaWQoKSBjb25zdCB7IHJldHVybiB0aGlzICYmIG1Ub2tlbj49MCAmJiBtQ2xpZW50IT0wOyB9CisgICAgc3RhdGljIGJvb2wgaXNWYWxpZChjb25zdCBzcDxTdXJmYWNlQ29udHJvbD4mIHN1cmZhY2UpIHsKKyAgICAgICAgcmV0dXJuIChzdXJmYWNlICE9IDApICYmIHN1cmZhY2UtPmlzVmFsaWQoKTsKKyAgICB9CisgICAgYm9vbCBpc1ZhbGlkKCkgeworICAgICAgICByZXR1cm4gbVRva2VuPj0wICYmIG1DbGllbnQhPTA7CisgICAgfQorICAgIHN0YXRpYyBib29sIGlzU2FtZVN1cmZhY2UoCisgICAgICAgICAgICBjb25zdCBzcDxTdXJmYWNlQ29udHJvbD4mIGxocywgY29uc3Qgc3A8U3VyZmFjZUNvbnRyb2w+JiByaHMpOworICAgICAgICAKICAgICBTdXJmYWNlSUQgICBJRCgpIGNvbnN0ICAgICAgeyByZXR1cm4gbVRva2VuOyB9Ci0KLSAgICBzdGF0dXNfdCAgICBsb2NrKFN1cmZhY2VJbmZvKiBpbmZvLCBib29sIGJsb2NraW5nID0gdHJ1ZSk7Ci0gICAgc3RhdHVzX3QgICAgbG9jayhTdXJmYWNlSW5mbyogaW5mbywgUmVnaW9uKiBkaXJ0eSwgYm9vbCBibG9ja2luZyA9IHRydWUpOwotICAgIHN0YXR1c190ICAgIHVubG9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9yIHRlc3RpbmcKICAgICBmcmllbmQgY2xhc3MgVGVzdDsKICAgICBjb25zdCBzcDxJU3VyZmFjZT4mIGdldElTdXJmYWNlKCkgY29uc3QgeyByZXR1cm4gbVN1cmZhY2U7IH0KKyAgICAKIAorICAgIGZyaWVuZCBjbGFzcyBTdXJmYWNlOworCisgICAgU3VyZmFjZUNvbnRyb2woCisgICAgICAgICAgICBjb25zdCBzcDxTdXJmYWNlQ29tcG9zZXJDbGllbnQ+JiBjbGllbnQsCisgICAgICAgICAgICBjb25zdCBzcDxJU3VyZmFjZT4mIHN1cmZhY2UsCisgICAgICAgICAgICBjb25zdCBJU3VyZmFjZUZsaW5nZXJDbGllbnQ6OnN1cmZhY2VfZGF0YV90JiBkYXRhLAorICAgICAgICAgICAgdWludDMyX3QgdywgdWludDMyX3QgaCwgUGl4ZWxGb3JtYXQgZm9ybWF0LCB1aW50MzJfdCBmbGFncyk7CisKKyAgICB+U3VyZmFjZUNvbnRyb2woKTsKKworICAgIHN0YXR1c190IHZhbGlkYXRlKFNoYXJlZENsaWVudCBjb25zdCogY2JsaykgY29uc3Q7CisgICAgdm9pZCBkZXN0cm95KCk7CisgICAgCisgICAgc3A8U3VyZmFjZUNvbXBvc2VyQ2xpZW50PiAgIG1DbGllbnQ7CisgICAgc3A8SVN1cmZhY2U+ICAgICAgICAgICAgICAgIG1TdXJmYWNlOworICAgIFN1cmZhY2VJRCAgICAgICAgICAgICAgICAgICBtVG9rZW47CisgICAgdWludDMyX3QgICAgICAgICAgICAgICAgICAgIG1JZGVudGl0eTsKKyAgICB1aW50MzJfdCAgICAgICAgICAgICAgICAgICAgbVdpZHRoOworICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICBtSGVpZ2h0OworICAgIFBpeGVsRm9ybWF0ICAgICAgICAgICAgICAgICBtRm9ybWF0OworICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICBtRmxhZ3M7CisgICAgbXV0YWJsZSBNdXRleCAgICAgICAgICAgICAgIG1Mb2NrOworICAgIAorICAgIG11dGFibGUgc3A8U3VyZmFjZT4gICAgICAgICBtU3VyZmFjZURhdGE7Cit9OworICAgIAorLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK2NsYXNzIFN1cmZhY2UgCisgICAgOiBwdWJsaWMgRUdMTmF0aXZlQmFzZTxhbmRyb2lkX25hdGl2ZV93aW5kb3dfdCwgU3VyZmFjZSwgUmVmQmFzZT4KK3sKK3B1YmxpYzoKKyAgICBzdHJ1Y3QgU3VyZmFjZUluZm8geworICAgICAgICB1aW50MzJfdCAgICB3OworICAgICAgICB1aW50MzJfdCAgICBoOworICAgICAgICB1aW50MzJfdCAgICBzOworICAgICAgICB1aW50MzJfdCAgICB1c2FnZTsKKyAgICAgICAgUGl4ZWxGb3JtYXQgZm9ybWF0OworICAgICAgICB2b2lkKiAgICAgICBiaXRzOworICAgICAgICB1aW50MzJfdCAgICByZXNlcnZlZFsyXTsKKyAgICB9OworCisgICAgU3VyZmFjZShjb25zdCBQYXJjZWwmIGRhdGEpOworCisgICAgc3RhdGljIGJvb2wgaXNWYWxpZChjb25zdCBzcDxTdXJmYWNlPiYgc3VyZmFjZSkgeworICAgICAgICByZXR1cm4gKHN1cmZhY2UgIT0gMCkgJiYgc3VyZmFjZS0+aXNWYWxpZCgpOworICAgIH0KKworICAgIHN0YXRpYyBib29sIGlzU2FtZVN1cmZhY2UoCisgICAgICAgICAgICBjb25zdCBzcDxTdXJmYWNlPiYgbGhzLCBjb25zdCBzcDxTdXJmYWNlPiYgcmhzKTsKKworICAgIGJvb2wgICAgICAgIGlzVmFsaWQoKTsKKyAgICBTdXJmYWNlSUQgICBJRCgpIGNvbnN0ICAgICAgICAgIHsgcmV0dXJuIG1Ub2tlbjsgfQorICAgIHVpbnQzMl90ICAgIGdldEZsYWdzKCkgY29uc3QgICAgeyBy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gICAgICAgICBtU3VyZmFjZUhlYXBCYXNlWzJdOworICAgIEJ1ZmZlck1hcHBlciYgICAgICAgICAgICAgICBtQnVmZmVyTWFwcGVyOworICAgIFNoYXJlZEJ1ZmZlckNsaWVudCogICAgICAgICBtU2hhcmVkQnVmZmVyQ2xpZW50OworCisgICAgLy8gcHJvdGVjdGVkIGJ5IG1TdXJmYWNlTG9jaworICAgIFJlY3QgICAgICAgICAgICAgICAgICAgICAgICBtU3dhcFJlY3RhbmdsZTsKKyAgICB1aW50MzJfdCAgICAgICAgICAgICAgICAgICAgbVVzYWdlOworICAgIGludDMyX3QgICAgICAgICAgICAgICAgICAgICBtVXNhZ2VDaGFuZ2VkOworICAgIAorICAgIC8vIHByb3RlY3RlZCBieSBtU3VyZmFjZUxvY2suIFRoZXNlIGFyZSBhbHNvIHVzZWQgZnJvbSBsb2NrL3VubG9jaworICAgIC8vIGJ1dCBpbiB0aGF0IGNhc2UsIHRoZXkgbXVzdCBiZSBjYWxsZWQgZm9ybSB0aGUgc2FtZSB0aHJlYWQuCisgICAgc3A8U3VyZmFjZUJ1ZmZlcj4gICAgICAgICAgIG1CdWZmZXJzWzJdOwogICAgIG11dGFibGUgUmVnaW9uICAgICAgICAgICAgICBtRGlydHlSZWdpb247Ci0gICAgbXV0YWJsZSBSZWN0ICAgICAgICAgICAgICAgIG1Td2FwUmVjdGFuZ2xlOwotICAgIG11dGFibGUgdWludDhfdCAgICAgICAgICAgICBtQmFja2J1ZmZlckluZGV4OworCisgICAgLy8gbXVzdCBiZSB1c2VkIGZyb20gdGhlIGxvY2svdW5sb2NrIHRocmVhZAorICAgIHNwPFN1cmZhY2VCdWZmZXI+ICAgICAgICAgICBtTG9ja2VkQnVmZmVyOworICAgIHNwPFN1cmZhY2VCdWZmZXI+ICAgICAgICAgICBtUG9zdGVkQnVmZmVyOworICAgIG11dGFibGUgUmVnaW9uICAgICAgICAgICAgICBtT2xkRGlydHlSZWdpb247CisgICAgYm9vbCAgICAgICAgICAgICA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AgU29ydGVkVmVjdG9yPGxheWVyX3N0YXRlX3Q+ICAgICAgICAgbVN0YXRlczsKQEAgLTE2NCwxMiArMTQ2LDkgQEAKICAgICAgICAgICAgICAgICAvLyB0aGVzZSBkb24ndCBuZWVkIHRvIGJlIHByb3RlY3RlZCBiZWNhdXNlIHRoZXkgbmV2ZXIgY2hhbmdlCiAgICAgICAgICAgICAgICAgLy8gYWZ0ZXIgYXNzaWdubWVudAogICAgICAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgICAgICAgICBtU3RhdHVzOwotICAgICAgICAgICAgICAgIHBlcl9jbGllbnRfY2Jsa190KiAgICAgICAgICBtQ29udHJvbDsKLSAgICAgICAgICAgICAgICBzcDxJTWVtb3J5PiAgICAgICAgICAgICAgICAgbUNvbnRyb2xNZW1vcnk7CisgICAgICAgICAgICAgICAgU2hhcmVkQ2xpZW50KiAgICAgICAgICAgICAgIG1Db250cm9sOworICAgICAgICAgICAgICAgIHNwPElNZW1vcnlIZWFwPiAgICAgICAgICAgICBtQ29udHJvbE1lbW9yeTsKICAgICAgICAgICAgICAgICBzcDxJU3VyZmFjZUZsaW5nZXJDbGllbnQ+ICAgbUNsaWVudDsKLSAgICAgICAgICAgICAgICBzcDxJTWVtb3J5SGVhcD4gICAgICAgICAgICAgbVN1cmZhY2VIZWFwOwotICAgICAgICAgICAgICAgIHVpbnQ4X3QqICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZUhlYXBCYXNlOwotICAgICAgICAgICAgICAgIHZvaWQqICAgICAgICAgICAgICAgICAgICAgICBtR0w7CiAgICAgICAgICAgICAgICAgU3VyZmFjZUZsaW5nZXJTeW5jaHJvKiAgICAgIG1TaWduYWxTZXJ2ZXI7CiB9OwogCmRpZmYgLS1naXQgYS9pbmNsdWRlL3VpL2VnbC9hbmRyb2lkX25hdGl2ZXMuaCBiL2luY2x1ZGUvdWkvZWdsL2FuZHJvaWRfbmF0aXZlcy5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ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1vbi5tYWdpYyA9IEFORFJPSURfTkFUSVZFX1dJTkRPV19NQUdJQzsKKyAgICAgICAgY29tbW9uLnZlcnNpb24gPSBzaXplb2YoYW5kcm9pZF9uYXRpdmVfd2luZG93X3QpOworICAgICAgICBtZW1zZXQoY29tbW9uLnJlc2VydmVkLCAwLCBzaXplb2YoY29tbW9uLnJlc2VydmVkKSk7CisgICAgfQorI2VuZGlmCisgICAgCisgICAgc3RydWN0IGFuZHJvaWRfbmF0aXZlX2Jhc2VfdCBjb21tb247CisKKyAgICAvKiBmbGFncyBkZXNjcmliaW5nIHNvbWUgYXR0cmlidXRlcyBvZiB0aGlzIHN1cmZhY2Ugb3IgaXRzIHVwZGF0ZXIgKi8KKyAgICBjb25zdCB1aW50MzJfdCBmbGFnczsKKyAgICAKKyAgICAvKiBtaW4gc3dhcCBpbnRlcnZhbCBzdXBwb3J0ZWQgYnkgdGhpcyB1cGRhdGVkICovCisgICAgY29uc3QgaW50ICAgbWluU3dhcEludGVydmFsOworCisgICAgLyogbWF4IHN3YXAgaW50ZXJ2YWwgc3VwcG9ydGVkIGJ5IHRoaXMgdXBkYXRlZCAqLworICAgIGNvbnN0IGludCAgIG1heFN3YXBJbnRlcnZhbDsKKworICAgIC8qIGhvcml6b250YWwgYW5kIHZlcnRpY2FsIHJlc29sdXRpb24gaW4gRFBJICovCisgICAgY29uc3QgZmxvYXQgeGRwaTsKKyAgICBjb25zdCBmbG9hdCB5ZHBpOworCisgICAgLyogU29tZSBzdG9yYWdlIHJlc2VydmVkIGZvciB0aGUgT0VNJ3MgZHJpdmVyLiAqLworICAgIGludHB0cl90ICAgIG9lbVs0XTsKKyAgICAgICAgCisKKyAgICAvKgorICAgICAqIFNldCB0aGUgc3dhcCBpbnRlcnZhbCBmb3IgdGhpcyBzdXJmYWNlLgorICAgICAqIAorICAgICAqIFJldHVybnMgMCBvbiBzdWNjZXNzIG9yIC1lcnJubyBvbiBlcnJvci4KKyAgICAgKi8KKyAgICBpbnQgICAgICgq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isgKi8KKworc3RhdGljIGlubGluZSBpbnQgbmF0aXZlX3dpbmRvd19zZXRfdXNhZ2UoCisgICAgICAgIGFuZHJvaWRfbmF0aXZlX3dpbmRvd190KiB3aW5kb3csIGludCB1c2FnZSkKK3sKKyAgICByZXR1cm4gd2luZG93LT5wZXJmb3JtKHdpbmRvdywgTkFUSVZFX1dJTkRPV19TRVRfVVNBR0UsIHVzYWdlKTsKK30KKworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworLyogRklYTUU6IHRoaXMgaXMgbGVnYWN5IGZvciBwaXhtYXBzICovCit0eXBlZGVmIHN0cnVjdCBlZ2xfbmF0aXZlX3BpeG1hcF90Cit7CisgICAgaW50MzJfdCAgICAgdmVyc2lvbjsgICAgLyogbXVzdCBiZSAzMiAqLworICAgIGludDMyX3QgICAgIHdpZHRoOworICAgIGludDMyX3QgICAgIGhlaWdodDsKKyAgICBpbnQzMl90ICAgICBzdHJpZGU7CisgICAgdWludDhfdCogICAgZGF0YTsKKyAgICB1aW50OF90ICAgICBmb3JtYXQ7CisgICAgdWludDhfdCAgICAgcmZ1WzNdOworICAgIHVuaW9uIHsKKyAgICAgICAgdWludDMyX3QgICAgY29tcHJlc3NlZEZvcm1hdDsKKyAgICAgICAgaW50MzJfdCAgICAgdnN0cmlkZTsKKyAgICB9OworICAgIGludDMyX3QgICAgIHJlc2VydmVkOworfSBlZ2xfbmF0aXZlX3BpeG1hcF90OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZmRlZiBfX2NwbHVzcGx1cworfQorI2VuZGlmCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCis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NvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQYXJjZWwmIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwKTsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgbGlua1RvRGVhdGgoY29uc3Qgc3A8RGVhdGhSZWNpcGllbnQ+JiByZWNpcGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBjb29raWUgPSBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwKTsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgdW5saW5rVG9EZWF0aCggIGNvbnN0IHdwPERlYXRoUmVjaXBpZW50PiYgcmVjaXBpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIGNvb2tpZSA9IE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdwPERlYXRoUmVjaXBpZW50Piogb3V0UmVjaXBpZW50ID0gTlVMTCk7Ci0KLSAgICB2aXJ0dWFsIHZvaWQgICAgICAgIGF0dGFjaE9iamVjdCggICBjb25zdCB2b2lkKiBvYmplY3RJRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY2xlYW51cENvb2tpZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmplY3RfY2xlYW51cF9mdW5jIGZ1bmMpOwotICAgIHZpcnR1YWwgdm9pZCogICAgICAgZmluZE9iamVjdChjb25zdCB2b2lkKiBvYmplY3RJRCkgY29uc3Q7Ci0gICAgdmlydHVhbCB2b2lkICAgICAgICBkZXRhY2hPYmplY3QoY29uc3Qgdm9pZCogb2JqZWN0SUQpOwotCi0gICAgdmlydHVhbCBCQmluZGVyKiAgICBsb2NhbEJpbmRlcigpOwotCi1wcm90ZWN0ZWQ6Ci0gICAgdmlydHVhbCAgICAgICAgICAgICB+QkJpbmRlcigpOwotCi0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBvblRyYW5zYWN0KCB1aW50MzJfdCBjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUGFyY2VsJiBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsKiByZXBseSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCk7Ci0KLXByaXZhdGU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBCQmluZGVyKGNvbnN0IEJCaW5kZXImIG8pOwotICAgICAgICAgICAgQkJpbmRlciYgICAgb3BlcmF0b3I9KGNvbnN0IEJCaW5kZXImIG8pOwotCi0gICAgY2xhc3MgRXh0cmFzOwotCi0gICAgICAgICAgICBFeHRyYXMqICAgICBtRXh0cmFzOwotICAgICAgICAgICAgdm9pZCogICAgICAgbVJlc2VydmVkMDsKLX07Ci0KLS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi1jbGFzcyBCcFJlZkJhc2UgOiBwdWJsaWMgdmlydHVhbCBSZWZCYXNlCi17Ci1wcm90ZWN0ZWQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQnBSZWZCYXNlKGNvbnN0IHNwPElCaW5kZXI+JiBvKT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NvbnN0IHNwPERlYXRoUmVjaXBpZW50PiYgcmVjaXBpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY29va2llID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCk7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCAgICB1bmxpbmtUb0RlYXRoKCAgY29uc3Qgd3A8RGVhdGhSZWNpcGllbnQ+JiByZWNpcGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY29va2llID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3A8RGVhdGhSZWNpcGllbnQ+KiBvdXRSZWNpcGllbnQgPSBOVUxMKTsKLQotICAgIHZpcnR1YWwgdm9pZCAgICAgICAgYXR0YWNoT2JqZWN0KCAgIGNvbnN0IHZvaWQqIG9iamVjdElELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIG9iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiBjbGVhbnVwQ29va2llLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iamVjdF9jbGVhbnVwX2Z1bmMgZnVuYyk7Ci0gICAgdmlydHVhbCB2b2lkKiAgICAgICBmaW5kT2JqZWN0KGNvbnN0IHZvaWQqIG9iamVjdElEKSBjb25zdDsKLSAgICB2aXJ0dWFsIHZvaWQgICAgICAgIGRldGFjaE9iamVjdChjb25zdCB2b2lkKiBvYmplY3RJRCk7Ci0KLSAgICB2aXJ0dWFsIEJwQmluZGVyKiAgIHJlbW90ZUJpbmRlcigpOwotCi0gICAgICAgICAgICBzdGF0dXNfdCAgICBzZXRDb25zdGFudERhdGEoY29uc3Qgdm9pZCogZGF0YSwgc2l6ZV90IHNpemUpOwotICAgICAgICAgICAgdm9pZCAgICAgICAgc2VuZE9iaXR1YXJ5KCk7Ci0KLSAgICBjbGFzcyBPYmplY3RNYW5hZ2VyCi0gICAgewotICAgIHB1YmxpYzoKLSAgICAgICAgICAgICAgICAgICAgT2JqZWN0TWFuYWdlcigpOwotICAgICAgICAgICAgICAgICAgICB+T2JqZWN0TWFuYWdlcigpOwotCi0gICAgICAgIHZvaWQgICAgICAgIGF0dGFjaCggY29uc3Qgdm9pZCogb2JqZWN0SUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogb2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIGNsZWFudXBDb29raWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSUJpbmRlcjo6b2JqZWN0X2NsZWFudXBfZnVuYyBmdW5jKTsKLSAgICAgICAgdm9pZCogICAgICAgZmluZChjb25zdCB2b2lkKiBvYmplY3RJRCkgY29uc3Q7Ci0gICAgICAgIHZvaWQgICAgICAgIGRldGFjaChjb25zdCB2b2lkKiBvYmplY3RJRCk7Ci0KLSAgICAgICAgdm9pZCAgICAgICAga2lsbCgpOwotCi0gICAgcHJpdmF0ZToKLSAgICAgICAgICAgICAgICAgICAgT2JqZWN0TWFuYWdlcihjb25zdCBPYmplY3RNYW5hZ2VyJik7Ci0gICAgICAgIE9iamVjdE1hbmFnZXImIG9wZXJhdG9yPShjb25zdCBPYmplY3RNYW5hZ2VyJik7Ci0KLSAgICAgICAgc3RydWN0IGVudHJ5X3QKLSAgICAgICAgewotICAgICAgICAgICAgdm9pZCogb2JqZWN0OwotICAgICAgICAgICAgdm9pZCogY2xlYW51cENvb2tpZTsKLSAgICAgICAgICAgIElCaW5kZXI6Om9iamVjdF9jbGVhbnVwX2Z1bmMgZnVuYzsKLSAgICAgICAgfTsKLQotICAgICAgICBLZXllZFZlY3Rvcjx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gYnkgdGhpcyBJQmluZGVyCi0gICAgICogb2JqZWN0LgotICAgICAqLwotICAgIHZpcnR1YWwgU3RyaW5nMTYgICAgICAgIGdldEludGVyZmFjZURlc2NyaXB0b3IoKSBjb25zdCA9IDA7Ci0KLSAgICB2aXJ0dWFsIGJvb2wgICAgICAgICAgICBpc0JpbmRlckFsaXZlKCkgY29uc3QgPSAwOwotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHBpbmdCaW5kZXIoKSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgZHVtcChpbnQgZmQsIGNvbnN0IFZlY3RvcjxTdHJpbmcxNj4mIGFyZ3MpID0gMDsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHRyYW5zYWN0KCAgIHVpbnQzMl90IGNvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUGFyY2VsJiBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbCogcmVwbHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSAwKSA9IDA7Ci0KLSAgICAvKioKLSAgICAgKiBUaGlzIG1ldGhvZCBhbGxvd3MgeW91IHRvIGFkZCBkYXRhIHRoYXQgaXMgdHJhbnNwb3J0ZWQgdGhyb3VnaAotICAgICAqIElQQyBhbG9uZyB3aXRoIHlvdXIgSUJpbmRlciBwb2ludGVyLiAgV2hlbiBpbXBsZW1lbnRpbmcgYSBCaW5kZXIKLSAgICAgKiBvYmplY3QsIG92ZXJyaWRlIGl0IHRvIHdyaXRlIHlvdXIgZGVzaXJlZCBkYXRhIGluIHRvIEBhIG91dERhdGEuCi0gICAgICogWW91IGNhbiB0aGVuIGNhbGwgZ2V0Q29uc3RhbnREYXRhKCkgb24geW91ciBJQmluZGVyIHRvIHJldHJpZXZlCi0gICAgICogdGhhdCBkYX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gKiBUaGUgQGEgcmVjaXBpZW50IHdpbGwgbm8gbG9uZ2VyIGJlIGNhbGxlZCBpZiB0aGlzIG9iamVjdAotICAgICAqIGRpZXMuICBUaGUgQGEgY29va2llIGlzIG9wdGlvbmFsLiAgSWYgbm9uLU5VTEwsIHlvdSBjYW4KLSAgICAgKiBzdXBwbHkgYSBOVUxMIEBhIHJlY2lwaWVudCwgYW5kIHRoZSByZWNpcGllbnQgcHJldmlvdXNseQotICAgICAqIGFkZGVkIHdpdGggdGhhdCBjb29raWUgd2lsbCBiZSB1bmxpbmtlZC4KLSAgICAgKi8KLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICB1bmxpbmtUb0RlYXRoKCAgY29uc3Qgd3A8RGVhdGhSZWNpcGllbnQ+JiByZWNpcGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIGNvb2tpZSA9IE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3A8RGVhdGhSZWNpcGllbnQ+KiBvdXRSZWNpcGllbnQgPSBOVUxMKSA9IDA7Ci0KLSAgICB2aXJ0dWFsIGJvb2wgICAgICAgICAgICBjaGVja1N1YmNsYXNzKGNvbnN0IHZvaWQqIHN1YmNsYXNzSUQpIGNvbnN0OwotCi0gICAgdHlwZWRlZiB2b2lkICgqb2JqZWN0X2NsZWFudXBfZnVuYykoY29uc3Qgdm9pZCogaWQsIHZvaWQqIG9iaiwgdm9pZCogY2xlYW51cENvb2tpZSk7Ci0KLSAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBhdHRhY2hPYmplY3QoICAgY29uc3Qgdm9pZCogb2JqZWN0SUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIG9iamVjdCwKL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BcCi0gICAgU3RyaW5nMTYgSSMjSU5URVJGQUNFOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkgY29uc3QgeyAgICAgICAgICAgICBcCi0gICAgICAgIHJldHVybiBJIyNJTlRFUkZBQ0U6OmRlc2NyaXB0b3I7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgc3A8SSMjSU5URVJGQUNFPiBJIyNJTlRFUkZBQ0U6OmFzSW50ZXJmYWNlKGNvbnN0IHNwPElCaW5kZXI+JiBvYmopICBcCi0gICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIHNwPEkjI0lOVEVSRkFDRT4gaW50cjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIGlmIChvYmogIT0gTlVMTCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICBpbnRyID0gc3RhdGljX2Nhc3Q8SSMjSU5URVJGQUNFKj4oICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgb2JqLT5xdWVyeUxvY2FsSW50ZXJmYWNlKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICBJIyNJTlRFUkZBQ0U6OmRlc2NyaXB0b3IpLmdldCgpKTsgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICBpZiAoaW50ciA9PSBOVUxMKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgaW50ciA9IG5ldyBCcCMjSU5URVJGQUNFKG9iaik7ICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIHJldHVybiBpbnRyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0KLS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLS8vIE5vIHVzZXItc2VydmljYWJsZSBwYXJ0cyBhZnRlciB0aGlzLi4uCi0KLXRlbXBsYXRlPHR5cGVuYW1lIElOVEVSRkFDRT4KLWlubGluZSBzcDxJSW50ZXJmYWNlPiBCbkludGVyZmFjZTxJTlRFUkZBQ0U+OjpxdWVyeUxvY2FsSW50ZXJmYWNlKAotICAgICAgICBjb25zdCBTdHJpbmcxNiYgX2Rlc2NyaXB0b3IpCi17Ci0gICAgaWYgKF9kZXNjcmlwdG9yID09IElOVEVSRkFDRTo6ZGVzY3JpcHRvcikgcmV0dXJuIHRoaXM7Ci0gICAgcmV0dXJuIE5VTEw7Ci19Ci0KLXRlbXBsYXRlPHR5cGVuYW1lIElOVEVSRkFDRT4KLWlubGluZSBTdHJpbmcxNiBCbkludGVyZmFjZTxJTlRFUkZBQ0U+OjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkgY29uc3QKLXsKLSAgICByZXR1cm4gSU5URVJGQUNFOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCk7Ci19Ci0KLXRlbXBsYXRlPHR5cGVuYW1lIElOVEVSRkFDRT4KLUlCaW5kZXIqIEJuSW50ZXJmYWNl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AgICAgICAgICAgICBmbHVzaENvbW1hbmRzKCk7Ci0KLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgam9pblRocmVhZFBvb2woYm9vbCBpc01haW4gPSB0cnVlKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgLy8gU3RvcCB0aGUgbG9jYWwgcHJvY2Vzcy4KLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgc3RvcFByb2Nlc3MoYm9vbCBpbW1lZGlhdGUgPSB0cnVlKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICB0cmFuc2FjdChpbnQzMl90IGhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncyk7Ci0KLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgaW5jU3Ryb25nSGFuZGxlKGludDMyX3QgaGFuZGxlKTsKLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgZGVjU3Ryb25nSGFuZGxlKGludDMyX3QgaGFuZGxlKTsKLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgaW5jV2Vha0hhbmRsZShpbnQzMl90IGhhbmRsZSk7Ci0gICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgIGRlY1dlYWtIYW5kbGUoaW50MzJfdCBoYW5kbGUpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICBhdHRlbXB0SW5jU3Ryb25nSGFuZGxlKGludDMyX3QgaGFuZGxlKTsKLSAgICBzdGF0aWMgIHZvaWQgICAgICAgICAgICAgICAgZXhwdW5nZUhhbmRsZShpbnQzMl90IGhhbmRsZSwgSUJpbmRlciogYmluZGVyKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgcmVxdWVzdERlYXRoTm90aWZpY2F0aW9uKCAgIGludDMyX3QgaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQnBCaW5kZXIqIHByb3h5KTsgCi0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgIGNsZWFyRGVhdGhOb3RpZmljYXRpb24oIGludDMyX3QgaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcEJpbmRlciogcHJveHkpOyAKLQotICAgIHN0YXRpYyAgdm9pZCAgICAgICAgICAgICAgICBzaHV0ZG93bigpOwotICAgIAotcHJpdmF0ZToKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVBDVGhyZWFkU3RhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfklQQ1RocmVhZFN0YXRlKCk7Ci0KLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgc2VuZFJlcGx5KGNvbnN0IFBhcmNlbCYgcmVwbHksIHVpbnQzMl90IGZsYWdzKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgd2FpdEZvclJlc3BvbnNlKFBhcmNlbCAqcmVwbHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqYWNxdWlyZVJlc3VsdD1OVUxMKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgdGFsa1dpdGhEcml2ZXIoYm9vbCBkb1JlY2VpdmU9dHJ1ZSk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgIHdyaXRlVHJhbnNhY3Rpb25EYXRhKGludDMyX3QgY21kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBiaW5kZXJGbGFncywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBoYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFBhcmNlbCYgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QqIHN0YXR1c0J1ZmZlcik7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgIGV4ZWN1dGVDb21tYW5kKGludDMyX3QgY29tbWFuZCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgY2xlYXJDYWxsZXIoKTsKLSAgICAgICAgICAgIAotICAgIHN0YXRpYyAgdm9pZCAgICAgICAgICAgICAgICB0aHJlYWREZXN0cnVjdG9yKHZvaWQgKnN0KTsKLSAgICBzdGF0aWMgIHZvaWQgICAgICAgICAgICAgICAgZnJlZUJ1ZmZlcihQYXJjZWwqIHBhcmNlbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50OF90KiBkYXRhLCBzaXplX3QgZGF0YVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90KiBvYmplY3RzLCBzaXplX3Qgb2JqZWN0c1NpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY29va2llKTsKLSAgICAKLSAgICBjb25zdCAgIHNwPFByb2Nlc3NTdGF0ZT4gICAgbVByb2Nlc3M7Ci0gICAgICAgICAgICBWZWN0b3I8QkJpbmRlcio+ICAgIG1QZW5kaW5nU3Ryb25nRGVyZWZzOwotICA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ZSB7CisgICAgcHVibGljOgorICAgICAgICBleHBsaWNpdCBfTm9kZShjb25zdCBUJiB2YWwpIDogbVZhbCh2YWwpIHt9CisgICAgICAgIH5fTm9kZSgpIHt9CisgICAgICAgIGlubGluZSBUJiBnZXRSZWYoKSB7IHJldHVybiBtVmFsOyB9CisgICAgICAgIGlubGluZSBjb25zdCBUJiBnZXRSZWYoKSBjb25zdCB7IHJldHVybiBtVmFsOyB9CisgICAgICAgIGlubGluZSBfTm9kZSogZ2V0UHJldigpIGNvbnN0IHsgcmV0dXJuIG1wUHJldjsgfQorICAgICAgICBpbmxpbmUgX05vZGUqIGdldE5leHQoKSBjb25zdCB7IHJldHVybiBtcE5leHQ7IH0KKyAgICAgICAgaW5saW5lIHZvaWQgc2V0VmFsKGNvbnN0IFQmIHZhbCkgeyBtVmFsID0gdmFsOyB9CisgICAgICAgIGlubGluZSB2b2lkIHNldFByZXYoX05vZGUqIHB0cikgeyBtcFByZXYgPSBwdHI7IH0KKyAgICAgICAgaW5saW5lIHZvaWQgc2V0TmV4dChfTm9kZSogcHRyKSB7IG1wTmV4dCA9IHB0cjsgfQorICAgIHByaXZhdGU6CisgICAgICAgIGZyaWVuZCBjbGFzcyBMaXN0OworICAgICAgICBmcmllbmQgY2xhc3MgX0xpc3RJdGVyYXRvcjsKKyAgICAgICAgVCAgICAgICAgICAgbVZhbDsKKyAgICAgICAgX05vZGUqICAgICAgbXBQcmV2OworICAgICAgICBfTm9kZSogICAgICBtcE5leHQ7CisgICAgfTsKIAotICAgIExpc3Qodm9pZCkgeworICAgIC8qCisgICAgICogSXRlcmF0b3IgZm9yIHdhbGtpbmcgdGhyb3VnaCB0aGUgbGlzdC4KKyAgICAgKi8KKyAgICAKKyAgICB0ZW1wbGF0ZSA8dHlwZW5hbWUgVFlQRT4KKyAgICBzdHJ1Y3QgQ09OU1RfSVRFUkFUT1IgeworICAgICAgICB0eXBlZGVmIF9Ob2RlIGNvbnN0ICogTm9kZVB0cjsKKyAgICAgICAgd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bXBsZW1lbnRhdGlvbiwgdGhlIGl0ZXJhdG9ycyBjYW4gYmUgY29udmVydGVkCisgICAgICAgIC8vIGlmIHRoZSBub2RlcyBjYW4gYmUgY29udmVydGVkCisgICAgICAgIHRlbXBsYXRlPHR5cGVuYW1lIFY+IGV4cGxpY2l0IAorICAgICAgICBfTGlzdEl0ZXJhdG9yKGNvbnN0IFYmIHJocykgOiBtcE5vZGUocmhzLm1wTm9kZSkge30KKyAgICAgICAgCisKKyAgICAgICAgLyoKKyAgICAgICAgICogRGVyZWZlcmVuY2Ugb3BlcmF0b3IuICBVc2VkIHRvIGdldCBhdCB0aGUganVpY3kgaW5zaWRlcy4KKyAgICAgICAgICovCisgICAgICAgIF9UeXBlJiBvcGVyYXRvciooKSBjb25zdCB7IHJldHVybiBtcE5vZGUtPmdldFJlZigpOyB9CisgICAgICAgIF9UeXBlKiBvcGVyYXRvci0+KCkgY29uc3QgeyByZXR1cm4gJihtcE5vZGUtPmdldFJlZigpKTsgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIEl0ZXJhdG9yIGNvbXBhcmlzb24uCisgICAgICAgICAqLworICAgICAgICBpbmxpbmUgYm9vbCBvcGVyYXRvcj09KGNvbnN0IF9JdGVyJiByaWdodCkgY29uc3QgeyAKKyAgICAgICAgICAgIHJldHVybiBtcE5vZGUgPT0gcmlnaHQubXBOb2RlOyB9CisgICAgICAgIAorICAgICAgICBpbmxpbmUgYm9vbCBvcGVyYXRvciE9KGNvbnN0IF9JdGVyJiByaWdodCkgY29uc3QgeyAKKyAgICAgICAgICAgIHJldHVybiBtcE5vZGUgIT0gcmlnaHQubXBOb2RlOyB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogaGFuZGxlIGNvbXBhcmlzb25zIGJldHdlZW4gaXRlcmF0b3IgYW5kIGNvbnN0X2l0ZXJhdG9yCisgICAgICAgICAqLworICAgICAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBPVEhFUj4KKyAgICAgICAgaW5saW5lIGJvb2wgb3BlcmF0b3I9PShjb25zdCBPVEhFUiYgcmlnaHQpIGNvbnN0IHsgCisgICAgICAgICAgICByZXR1cm4gbXBOb2RlID09IHJpZ2h0Lm1wTm9kZTsgfQorICAgICAgICAKKyAgICAgICAgdGVtcGxhdGU8dHlwZW5hbWUgT1RIRVI+CisgICAgICAgIGlubGluZSBib29sIG9wZXJhdG9yIT0oY29uc3QgT1RIRVImIHJpZ2h0KSBjb25zdCB7IAorICAgICAgICAgICAgcmV0dXJuIG1wTm9kZSAhPSByaWdodC5tcE5vZGU7IH0KKworICAgICAgICAvKgorICAgICAgICAgKiBJbmNyL2RlY3IsIHVzZWQgdG8gbW92ZSB0aHJvdWdoIHRoZSBsaXN0LgorICAgICAgICAgKi8KKyAgICAgICAgaW5saW5lIF9JdGVyJiBvcGVyYXRvcisrKCkgeyAgICAgLy8gcHJlLWluY3JlbWVudAorICAgICAgICAgICAgbXBOb2RlID0gbXBOb2RlLT5nZXROZXh0KCk7CisgICAgICAgICAgICByZXR1cm4gKnRoaXM7CisgICAgICAgIH0KKyAgICAgICAgY29uc3QgX0l0ZXIgb3BlcmF0b3IrKyhpbnQpIHsgICAgLy8gcG9zdC1pbmNyZW1lbnQKKyAgICAgICAgICAgIF9JdGVyIHRtcCgqdGhpcyk7CisgICAgICAgICAgICBtcE5vZGUgPSBtcE5vZGUtPmdldE5leHQoKTsKKyAgICAgICAgICAgIHJldHVybiB0bXA7CisgICAgICAgIH0KKyAgICAgICAgaW5saW5lIF9JdGVyJiBvcGVyYXRvci0tKCkgeyAgICAgLy8gcHJlLWluY3JlbWVudAorICAgICAgICAgICAgbXBOb2RlID0gbXBOb2RlLT5nZXRQcmV2KCk7CisgICAgICAgICAgICByZXR1cm4gKnRoaXM7CisgICAgICAgIH0KKyAgICAgICAgY29uc3QgX0l0ZXIgb3BlcmF0b3ItLShpbnQpIHsgICAvLyBwb3N0LWluY3JlbWVudAorICAgICAgICAgICAgX0l0ZXIgdG1wKCp0aGlzKTsKKyAg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c2l6ZV90ICAgICAgICAgICAgICBkYXRhQXZhaWwoKSBjb25zdDsKLSAgICBzaXplX3QgICAgICAgICAgICAgIGRhdGFQb3NpdGlvbigpIGNvbnN0OwotICAgIHNpemVfdCAgICAgICAgICAgICAgZGF0YUNhcGFjaXR5KCkgY29uc3Q7Ci0gICAgCi0gICAgc3RhdHVzX3QgICAgICAgICAgICBzZXREYXRhU2l6ZShzaXplX3Qgc2l6ZSk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBzZXREYXRhUG9zaXRpb24oc2l6ZV90IHBvcykgY29uc3Q7Ci0gICAgc3RhdHVzX3QgICAgICAgICAgICBzZXREYXRhQ2FwYWNpdHkoc2l6ZV90IHNpemUpOwotICAgIAotICAgIHN0YXR1c190ICAgICAgICAgICAgc2V0RGF0YShjb25zdCB1aW50OF90KiBidWZmZXIsIHNpemVfdCBsZW4pOwotCi0gICAgc3RhdHVzX3QgICAgICAgICAgICBhcHBlbmRGcm9tKFBhcmNlbCAqcGFyY2VsLCBzaXplX3Qgc3RhcnQsIHNpemVfdCBsZW4pOwotCi0gICAgYm9vbCAgICAgICAgICAgICAgICBoYXNGaWxlRGVzY3JpcHRvcnMoKSBjb25zdDsKLQotICAgIHN0YXR1c190ICAgICAgICAgICAgd3JpdGVJbnRlcmZhY2VUb2tlbihjb25zdCBTdHJpbmcxNiYgaW50ZXJmYWNlKTsKLSAgICBib29sICAgICAgICAgICAgICAgIGVuZm9yY2VJbnRlcmZhY2UoY29uc3QgU3RyaW5nMTYmIGludGVyZmFjZSkgY29uc3Q7Ci0gICAgICAgICAgICAKLSAgICB2b2lkICAgICAgICAgICAgICAgIGZyZWVEYXRhKCk7Ci0KLSAgICBjb25zdCBzaXplX3QqICAgICAgIG9iamVjdHMoKSBjb25zdDsKLSAgICBzaXplX3QgICAgICAgICAgICAgIG9iamVjdHNDb3VudCgpIGNvbnN0OwotICAgIAotICAgIHN0YXR1c190ICAgICAgICAgICAgZXJyb3JDaGVjaygpIGNvbnN0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emVfdCBhbXQpOwotICAgIAotICAgIHN0YXR1c190ICAgICAgICAgICAgcmVhZCh2b2lkKiBvdXREYXRhLCBzaXplX3QgbGVuKSBjb25zdDsKLSAgICBjb25zdCB2b2lkKiAgICAgICAgIHJlYWRJbnBsYWNlKHNpemVfdCBsZW4pIGNvbnN0OwotICAgIGludDMyX3QgICAgICAgICAgICAgcmVhZEludDMyKCkgY29uc3Q7Ci0gICAgc3RhdHVzX3QgICAgICAgICAgICByZWFkSW50MzIoaW50MzJfdCAqcEFyZykgY29uc3Q7Ci0gICAgaW50NjRfdCAgICAgICAgICAgICByZWFkSW50NjQoKSBjb25zdDsKLSAgICBzdGF0dXNfdCAgICAgICAgICAgIHJlYWRJbnQ2NChpbnQ2NF90ICpwQXJnKSBjb25zdDsKLSAgICBmbG9hdCAgICAgICAgICAgICAgIHJlYWRGbG9hdCgpIGNvbnN0OwotICAgIHN0YXR1c190ICAgICAgICAgICAgcmVhZEZsb2F0KGZsb2F0ICpwQXJnKSBjb25zdDsKLSAgICBkb3VibGUgICAgICAgICAgICAgIHJlYWREb3VibGUoKSBjb25zdDsKLSAgICBzdGF0dXNfdCAgICAgICAgICAgIHJlYWREb3VibGUoZG91YmxlICpwQXJnKSBjb25zdDsKLQotICAgIGNvbnN0IGNoYXIqICAgICAgICAgcmVhZENTdHJpbmcoKSBjb25zdDsKLSAgICBTdHJpbmc4ICAgICAgICAgICAgIHJlYWRTdHJpbmc4KCkgY29uc3Q7Ci0gICAgU3RyaW5nMTYgICAgICAgICAgICByZWFkU3RyaW5nMTYoKSBjb25zdDsKLSAgICBjb25zdCBjaGFyMTZfdCogICAgIHJlYWRTdHJpbmcxNklucGxhY2Uoc2l6ZV90KiBvdXRMZW4pIGNvbnN0OwotICAgIHNwPElCaW5kZXI+ICAgICAgICAgcmVhZFN0cm9uZ0JpbmRlcigpIGNvbnN0OwotICAgIHdwPElCaW5kZXI+ICAgICAgICAgcmVhZFdlYWtCaW5kZXIoKSBjb25zdDsKLQotICA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kYXRhLCBzaXplX3QgZGF0YVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90KiBvYmplY3RzLCBzaXplX3Qgb2JqZWN0c1NpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogY29va2llKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIAotICAgIGNvbnN0IHVpbnQ4X3QqICAgICAgaXBjRGF0YSgpIGNvbnN0OwotICAgIHNpemVfdCAgICAgICAgICAgICAgaXBjRGF0YVNpemUoKSBjb25zdDsKLSAgICBjb25zdCBzaXplX3QqICAgICAgIGlwY09iamVjdHMoKSBjb25zdDsKLSAgICBzaXplX3QgICAgICAgICAgICAgIGlwY09iamVjdHNDb3VudCgpIGNvbnN0OwotICAgIHZvaWQgICAgICAgICAgICAgICAgaXBjU2V0RGF0YVJlZmVyZW5jZShjb25zdCB1aW50OF90KiBkYXRhLCBzaXplX3QgZGF0YVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNpemVfdCogb2JqZWN0cywgc2l6ZV90IG9iamVjdHNDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVsZWFzZV9mdW5jIHJlbEZ1bmMsIHZvaWQqIHJlbENvb2tpZSk7Ci0gICAgCi0gICAgdm9pZCAgICAgICAgICAgICAgICBwcmludChUZXh0T3V0cHV0JiB0bywgdWludDMyX3QgZmxhZ3MgPSAwKSBjb25zdDsKLSAgICAKLXByaXZhdGU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwoY29uc3QgUGFyY2VsJiBvKTsKLSAgICBQYXJjZWwmICAgICAgICAgICAgIG9wZXJhdG9yPShjb25zdCBQYXJjZWwmIG8pOwotICAgIAotICAgIHN0YXR1c190ICAgICAgICAgICAgZmluaXNoV3JpdGUoc2l6ZV90IGxlbik7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICByZWxlYXNlT2JqZWN0cygpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgYWNxdWlyZU9iamVjdHMoKTsKLSAgICBzdGF0dXNfdCAgICAgICAgICAgIGdyb3dEYXRhKHNpemVfdCBsZW4pOwotICAgIHN0YXR1c190ICAgICAgICAgICAgcmVzdGFydFdyaXRlKHNpemVfdCBkZXNpcmVkKTsKLSAgICBzdGF0dXNfdCAgICAgICAgICAgIGNvbnRpbnVlV3JpdGUoc2l6ZV90IGRlc2lyZWQpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgZnJlZURhdGFOb0luaXQoKTsKLSAgICB2b2lkICAgICAgICAgICAgICAgIGluaXRTdGF0ZSgpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgc2NhbkZvckZkcygpIGNvbnN0OwotICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgc3RhdHVzX3QgICAgICAgICAgICBtRXJyb3I7Ci0gICAgdWludDhfdCogICAgICAgICAgICBtRGF0YTsKLSAgICBzaXplX3QgICAgICAgICAgICAgIG1EYXRhU2l6ZTsKLSAgICBzaXplX3QgICAgICAgICAgICAgIG1EYXRhQ2FwYWNpdHk7Ci0gICAgbXV0YWJsZSBzaXplX3QgICAgICBtRGF0YVBvczsKLSAgICBzaXplX3QqICAgICAgICAgICAgIG1PYmplY3RzOwotICAgIHNpemVfdCAgICAgICAgICAgICAgbU9iamVjdHNTaXplOwotICAgIHNpemVfdCAgICAgICAgICAgICAgbU9iamVjdHNDYXBhY2l0eTsKLSAgICBtdXRhYmxlIHNpemVfdCAgICAgIG1OZXh0T2JqZWN0SGludDsKLQotICAgIG11dGFibGUgYm9vbCAgICAgICAgbUZkc0tub3duOwotICAgIG11dGFibGUgYm9vbCAgICAgICAgbUhhc0ZkczsKLSAgICAKLSAgICByZWxlYXNlX2Z1bmMgICAgICAgIG1Pd25lcjsKLSAgICB2b2lkKiAgICAgICAgICAgICAgIG1Pd25lckNvb2tp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ci0gICAgICAgICAgICBzcDxJQmluZGVyPiAgICAgICAgIGdldENvbnRleHRPYmplY3QoY29uc3QgU3RyaW5nMTYmIG5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SUJpbmRlcj4mIGNhbGxlcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIHN1cHBvcnRzUHJvY2Vzc2VzKCkgY29uc3Q7Ci0KLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgc3RhcnRUaHJlYWRQb29sKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAKLSAgICB0eXBlZGVmIGJvb2wgKCpjb250ZXh0X2NoZWNrX2Z1bmMpKGNvbnN0IFN0cmluZzE2JiBuYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SUJpbmRlcj4mIGNhbGxlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXJEYXRhKTsKLSAgICAgICAgCi0gICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIGlzQ29udGV4dE1hbmFnZXIodm9pZCkgY29uc3Q7Ci0gICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIGJlY29tZUNvbnRleHRNYW5hZ2VyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dF9jaGVja19mdW5jIGNoZWNrRnVuYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXJEYXRhKTsKLQotICAgICAgICAgICAgc3A8SUJpbmRlcj4gICAgICAgICBnZXRTdHJvbmdQcm94eUZvckhhbmRsZShpbnQzMl90IGhhbmRsZSk7Ci0gICAgICAgICAgICB3cDxJQmluZGVyPiAgICAgICAgIGdldFdlYWtQcm94eUZvckhhbmRsZShpbnQzMl90IGhhbmRsZSk7Ci0gICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgIGV4cHVuZ2VIYW5kbGUoaW50MzJfdCBoYW5kbGUsIElCaW5kZXIqIGJpbmRlcik7Ci0KLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0QXJncyhpbnQgYXJnYywgY29uc3QgY2hhciogY29uc3QgYXJndltdKTsKLSAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgZ2V0QXJnQygpIGNvbnN0OwotICAgICAgICAgICAgY29uc3QgY2hhciogY29uc3QqICBnZXRBcmdWKCkgY29uc3Q7Ci0KLSAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0QXJnVjAoY29uc3QgY2hhciogdHh0KTsKLQotICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICBzcGF3blBvb2xlZFRocmVhZChib29sIGlzTWFpbik7Ci0gICAgICAgICAgICAKLXByaXZhdGU6Ci0gICAgZnJpZW5kIGNsYXNzIElQQ1RocmVhZFN0YXRlOwotICAgIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9jZXNzU3RhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgflByb2Nlc3NTdGF0ZSgpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByb2Nlc3NTdGF0ZShjb25zdCBQcm9jZXNzU3RhdGUmIG8pOwotICAgICAgICAgICAgUHJvY2Vzc1N0YXRlJiAgICAgICBvcGVyYXRvcj0oY29uc3QgUHJvY2Vzc1N0YXRlJiBvKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgc3RydWN0IGhhbmRsZV9lbnRyeSB7Ci0gICAgICAgICAgICAgICAgSUJpbmRlciogYmluZGVyOwotICAgICAgICAgICAgICAgIFJlZkJhc2U6OndlYWtyZWZfdHlwZSogcmVmczsKLSAgICAgICAgICAgIH07Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGhhbmRsZV9lbnRyeSogICAgICAgbG9va3VwSGFuZGxlTG9ja2VkKGludDMyX3QgaGFuZGxlKTsKLQotICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICBtRHJpdmVyRkQ7Ci0gICAgICAgICAgICB2b2lkKiAgICAgICAgICAgICAgIG1WTVN0YXJ0OwotICAgICAgICAgICAgCi0gICAgbXV0YWJsZSBNdXRleCAgICAgICAgICAgICAgIG1Mb2NrOyAgLy8gcHJvdGVjdHMgZXZlcnl0aGluZyBiZWxvdy4KLSAgICAgICAgICAgIAotICAgICAgICAgICAgVmVjdG9yPGhhbmRsZV9lbnRyeT5tSGFuZGxlVG9PYmplY3Q7Ci0KLSAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgbU1hbmFnZXNDb250ZXh0czsKLSAgICAgICAgICAgIGNvbnRleHRfY2hlY2tfZnVuYyAgbUJpbmRlckNvbnRleHRDaGVja0Z1bmM7Ci0gICAgICAgICAgICB2b2lkKiAgICAgICAgICAgICAgIG1CaW5kZXJDb250ZXh0VXNlckRhdGE7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIEtleWVkVmVjdG9yPFN0cmluZzE2LCBzcDxJQmluZGVyPiA+Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0czsKLQotCi0gICAgICAgICAgICBTdHJpbmc4ICAgICAgICAgICAgIG1Sb290RGlyOwotICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICBtVGhyZWFkUG9vbFN0YXJ0ZWQ7Ci0gICAgdm9sYXRpbGUgaW50MzJfdCAgICAgICAgICAgIG1UaHJlYWRQb29sU2VxOwotfTsKLSAgICAKLX07IC8vIG5hbWVzcGFjZSBhbmRyb2lkCi0KLS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0jZW5kaWY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kKikpOworICAgIAorICAgIC8vCisgICAgLy8gUGFzcyB0aGlzIHRvIHRoZSBzb3J0IHJvdXRpbmUgdG8gZG8gYW4gYXNjZW5kaW5nIGFscGhhYmV0aWNhbCBzb3J0LgorICAgIC8vCisgICAgc3RhdGljIGludCBjbXBBc2NlbmRpbmdBbHBoYShjb25zdCB2b2lkKiBwc3RyMSwgY29uc3Qgdm9pZCogcHN0cjIpOworICAgIAorICAgIC8vCisgICAgLy8gR2V0IHRoZSAjb2YgaXRlbXMgaW4gdGhlIGFycmF5LgorICAgIC8vCisgICAgaW5saW5lIGludCBzaXplKHZvaWQpIGNvbnN0IHsgcmV0dXJuIG1DdXJyZW50OyB9CisKKyAgICAvLworICAgIC8vIFJldHVybiBlbnRyeSBOLgorICAgIC8vIFtzaG91bGQgdXNlIG9wZXJhdG9yW10gaGVyZV0KKyAgICAvLworICAgIGNvbnN0IGNoYXIqIGdldEVudHJ5KGludCBpZHgpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuICh1bnNpZ25lZChpZHgpID49IHVuc2lnbmVkKG1DdXJyZW50KSkgPyBOVUxMIDogbUFycmF5W2lkeF07CisgICAgfQorCisgICAgLy8KKyAgICAvLyBTZXQgZW50cnkgTiB0byBzcGVjaWZpZWQgc3RyaW5nLgorICAgIC8vIFtzaG91bGQgdXNlIG9wZXJhdG9yW10gaGVyZV0KKyAgICAvLworICAgIHZvaWQgc2V0RW50cnkoaW50IGlkeCwgY29uc3QgY2hhciogc3RyKTsKKworcHJpdmF0ZToKKyAgICBpbnQgICAgIG1NYXg7CisgICAgaW50ICAgICBtQ3VycmVudDsKKyAgICBjaGFyKiogIG1BcnJheTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTElCU19VVElMU19TVFJJTkdfQVJSQVlfSApkaWZmIC0tZ2l0IGEvaW5jbHVkZS91dGlscy9UZXh0T3V0cHV0LmggYi9pbmNsdWRlL3V0aWxzL1RleHRPdXRwdX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ICAgbmV3KGQpIFRZUEUoKnMpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAqZCA9ICpzOworICAgICAgICAgICAgICAgICpkID0gKnM7ICAgCiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoIXRyYWl0czxUWVBFPjo6aGFzX3RyaXZpYWxfZHRvcikgewogICAgICAgICAgICAgICAgIHMtPn5UWVBFKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICB9IGVsc2UgewotICAgICAgICBtZW1tb3ZlKGQscyxuKnNpemVvZihUWVBFKSk7CiAgICAgfQogfQogCiB0ZW1wbGF0ZTx0eXBlbmFtZSBUWVBFPiBpbmxpbmUKIHZvaWQgbW92ZV9iYWNrd2FyZF90eXBlKFRZUEUqIGQsIGNvbnN0IFRZUEUqIHMsIHNpemVfdCBuID0gMSkgewotICAgIGlmICghdHJhaXRzPFRZUEU+OjpoYXNfdHJpdmlhbF9jb3B5IHx8ICF0cmFpdHM8VFlQRT46Omhhc190cml2aWFsX2R0b3IpIHsKKyAgICBpZiAoKHRyYWl0czxUWVBFPjo6aGFzX3RyaXZpYWxfZHRvciAmJiB0cmFpdHM8VFlQRT46Omhhc190cml2aWFsX2NvcHkpIAorICAgICAgICAgICAgfHwgdHJhaXRzPFRZUEU+OjpoYXNfdHJpdmlhbF9tb3ZlKSAKKyAgICB7CisgICAgICAgIG1lbW1vdmUoZCxzLG4qc2l6ZW9mKFRZUEUpKTsKKyAgICB9IGVsc2UgewogICAgICAgICB3aGlsZSAobi0tKSB7CiAgICAgICAgICAgICBpZiAoIXRyYWl0czxUWVBFPjo6aGFzX3RyaXZpYWxfY29weSkgewogICAgICAgICAgICAgICAgIG5ldyhkKSBUWVBFKCpzKTsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgKmQgPSAqczsKKyAgICAgICAgICAgICAgICAqZCA9ICpzOyAgIAogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWY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uc2lnbmVkIGNoYXIqIGJ1ZiwgbG9uZyB2YWwpIHsKLSAgICAgICAgYnVmWzBdID0gKHVuc2lnbmVkIGNoYXIpIHZhbDsKLSAgICAgICAgYnVmWzFdID0gKHVuc2lnbmVkIGNoYXIpICh2YWwgPj4gOCk7Ci0gICAgICAgIGJ1ZlsyXSA9ICh1bnNpZ25lZCBjaGFyKSAodmFsID4+IDE2KTsKLSAgICAgICAgYnVmWzNdID0gKHVuc2lnbmVkIGNoYXIpICh2YWwgPj4gMjQpOwotICAgIH0KLQotICAgIC8qIGRlZmluZWQgZm9yIFppcCBhcmNoaXZlcyAqLwotICAgIGVudW0gewotICAgICAgICBrQ29tcHJlc3NTdG9yZWQgICAgID0gMCwgICAgICAgIC8vIG5vIGNvbXByZXNzaW9uCi0gICAgICAgIC8vIHNocnVuayAgICAgICAgICAgPSAxLAotICAgICAgICAvLyByZWR1Y2VkIDEgICAgICAgID0gMiwKLSAgICAgICAgLy8gcmVkdWNlZCAyICAgICAgICA9IDMsCi0gICAgICAgIC8vIHJlZHVjZWQgMyAgICAgICAgPSA0LAotICAgICAgICAvLyByZWR1Y2VkIDQgICAgICAgID0gNSwKLSAgICAgICAgLy8gaW1wbG9kZWQgICAgICAgICA9IDYsCi0gICAgICAgIC8vIHRva2VuaXplZCAgICAgICAgPSA3LAotICAgICAgICBrQ29tcHJlc3NEZWZsYXRlZCAgID0gOCwgICAgICAgIC8vIHN0YW5kYXJkIGRlZmxhdGUKLSAgICAgICAgLy8gRGVmbGF0ZTY0ICAgICAgICA9IDksCi0gICAgICAgIC8vIGxpYiBpbXBsb2RlZCAgICAgPSAxMCwKLSAgICAgICAgLy8gcmVzZXJ2ZWQgICAgICAgICA9IDExLAotICAgICAgICAvLyBiemlwMiAgICAgICAgICAgID0gMTIsCi0gICAgfTsKLQotICAgIC8qCi0gICAgICogRGVsZXRpb24gZmxhZy4gIElmIHNldCwgdGhlIGVudHJ5IHdpbGwgYmUgcmVtb3ZlZCBvbiB0aGUg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ICAgICAgICAgIGtTaWduYXR1cmUgICAgICA9IDB4MDQwMzRiNTAsCi0gICAgICAgICAgICBrTEZITGVuICAgICAgICAgPSAzMCwgICAgICAgLy8gTG9jYWxGaWxlSGRyIGxlbiwgZXhjbC4gdmFyIGZpZWxkcwotICAgICAgICB9OwotCi0gICAgICAgIHZvaWQgZHVtcCh2b2lkKSBjb25zdDsKLSAgICB9OwotCi0gICAgLyoKLSAgICAgKiBFdmVyeSBlbnRyeSBpbiB0aGUgWmlwIGFyY2hpdmUgaGFzIG9uZSBvZiB0aGVzZSBpbiB0aGUgImNlbnRyYWwKLSAgICAgKiBkaXJlY3RvcnkiIGF0IHRoZSBlbmQgb2YgdGhlIGZpbGUuCi0gICAgICovCi0gICAgY2xhc3MgQ2VudHJhbERpckVudHJ5IHsKLSAgICBwdWJsaWM6Ci0gICAgICAgIENlbnRyYWxEaXJFbnRyeSh2b2lkKSA6Ci0gICAgICAgICAgICBtVmVyc2lvbk1hZGVCeSgwKSwKLSAgICAgICAgICAgIG1WZXJzaW9uVG9FeHRyYWN0KDApLAotICAgICAgICAgICAgbUdQQml0RmxhZygwKSwKLSAgICAgICAgICAgIG1Db21wcmVzc2lvbk1ldGhvZCgwKSwKLSAgICAgICAgICAgIG1MYXN0TW9kRmlsZVRpbWUoMCksCi0gICAgICAgICAgICBtTGFzdE1vZEZpbGVEYXRlKDApLAotICAgICAgICAgICAgbUNSQzMyKDApLAotICAgICAgICAgICAgbUNvbXByZXNzZWRTaXplKDApLAotICAgICAgICAgICAgbVVuY29tcHJlc3NlZFNpemUoMCksCi0gICAgICAgICAgICBtRmlsZU5hbWVMZW5ndGgoMCksCi0gICAgICAgICAgICBtRXh0cmFGaWVsZExlbmd0aCgwKSwKLSAgICAgICAgICAgIG1GaWxlQ29tbWVudExlbmd0aCgwKSwKLSAgICAgICAgICAgIG1EaXNrTnVtYmVyU3RhcnQoMCksCi0gICAgICAgICAgICBtSW50ZXJuYWxBdHRycygwKSwKLSAgICAgICAgICAg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UpIGNvbnN0OwotCi0gICAgLyoKLSAgICAgKiBHZXQgdGhlIE50aCBlbnRyeSBpbiB0aGUgYXJjaGl2ZS4KLSAgICAgKgotICAgICAqIFRoaXMgd2lsbCByZXR1cm4gYW4gZW50cnkgdGhhdCBpcyBwZW5kaW5nIGRlbGV0aW9uLgotICAgICAqLwotICAgIGludCBnZXROdW1FbnRyaWVzKHZvaWQpIGNvbnN0IHsgcmV0dXJuIG1FbnRyaWVzLnNpemUoKTsgfQotICAgIFppcEVudHJ5KiBnZXRFbnRyeUJ5SW5kZXgoaW50IGlkeCkgY29uc3Q7Ci0KLXByaXZhdGU6Ci0gICAgLyogdGhlc2UgYXJlIHByaXZhdGUgYW5kIG5vdCBkZWZpbmVkICovCi0gICAgWmlwRmlsZShjb25zdCBaaXBGaWxlJiBzcmMpOwotICAgIFppcEZpbGUmIG9wZXJhdG9yPShjb25zdCBaaXBGaWxlJiBzcmMpOwotCi0gICAgY2xhc3MgRW5kT2ZDZW50cmFsRGlyIHsKLSAgICBwdWJsaWM6Ci0gICAgICAgIEVuZE9mQ2VudHJhbERpcih2b2lkKSA6Ci0gICAgICAgICAgICBtRGlza051bWJlcigwKSwKLSAgICAgICAgICAgIG1EaXNrV2l0aENlbnRyYWxEaXIoMCksCi0gICAgICAgICAgICBtTnVtRW50cmllcygwKSwKLSAgICAgICAgICAgIG1Ub3RhbE51bUVudHJpZXMoMCksCi0gICAgICAgICAgICBtQ2VudHJhbERpclNpemUoMCksCi0gICAgICAgICAgICBtQ2VudHJhbERpck9mZnNldCgwKSwKLSAgICAgICAgICAgIG1Db21tZW50TGVuKDApLAotICAgICAgICAgICAgbUNvbW1lbnQoTlVMTCkKLSAgICAgICAgICAgIHt9Ci0gICAgICAgIHZpcnR1YWwgfkVuZE9mQ2VudHJhbERpcih2b2lkKSB7Ci0gICAgICAgICAgICBkZWxldGVbXSBtQ29tbWVudDsKLSAgICAgICAgfQotCi0gICAgICAgIHN0YXR1c190IHJlYWRCdWYoY29uc3QgdW5zaWduZWQgY2hhciogYnVmLCBpbnQgbGVuKTsKLSAgICAgICAgc3RhdHVzX3Qgd3JpdGUoRklMRSogZnApOwotCi0gICAgICAgIC8vdW5zaWduZWQgbG9uZyAgIG1TaWduYXR1cmU7Ci0gICAgICAgIHVuc2lnbmVkIHNob3J0ICBtRGlza051bWJlcjsKLSAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1EaXNrV2l0aENlbnRyYWxEaXI7Ci0gICAgICAgIHVuc2lnbmVkIHNob3J0ICBtTnVtRW50cmllczsKLSAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1Ub3RhbE51bUVudHJpZXM7Ci0gICAgICAgIHVuc2lnbmVkIGxvbmcgICBtQ2VudHJhbERpclNpemU7Ci0gICAgICAgIHVuc2lnbmVkIGxvbmcgICBtQ2VudHJhbERpck9mZnNldDsgICAgICAvLyBvZmZzZXQgZnJvbSBmaXJzdCBkaXNrCi0gICAgICAgIHVuc2lnbmVkIHNob3J0ICBtQ29tbWVudExlbjsKLSAgICAgICAgdW5zaWduZWQgY2hhciogIG1Db21tZW50OwotCi0gICAgICAgIGVudW0gewotICAgICAgICAgICAga1NpZ25hdHVyZSAgICAgID0gMHgwNjA1NGI1MCwKLSAgICAgICAgICAgIGtFT0NETGVuICAgICAgICA9IDIyLCAgICAgICAvLyBFbmRPZkNlbnRyYWxEaXIgbGVuLCBleGNsLiBjb21tZW50Ci0KLSAgICAgICAgICAgIGtNYXhDb21tZW50TGVuICA9IDY1NTM1LCAgICAvLyBsb25nZXN0IHBvc3NpYmxlIGluIHVzaG9ydAotICAgICAgICAgICAga01heEVPQ0RTZWFyY2ggID0ga01heENvbW1lbnRMZW4gKyBFbmRPZkNlbnRyYWxEaXI6OmtFT0NETGVuLAotCi0gICAgICAgIH07Ci0KLSAgICAgICAgdm9pZCBkdW1wKHZvaWQpIGNvbnN0OwotICAgIH07Ci0KLQotICAgIC8qIHJlYWQgYWxsIGVudHJpZXMgaW4gdGhlIGNlbnRyYWw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ICByZXR1cm4gZmFsc2U7Ci0KLSAgICAgICAgICAgIG1lbWNweSh0bXAsIG1BcnJheSwgbUN1cnJlbnQgKiBzaXplb2YoY2hhciopKTsKLSAgICAgICAgICAgIGRlbGV0ZVtdIG1BcnJheTsKLSAgICAgICAgICAgIG1BcnJheSA9IHRtcDsKLSAgICAgICAgfQotCi0gICAgICAgIGludCBsZW4gPSBzdHJsZW4oc3RyKTsKLSAgICAgICAgbUFycmF5W21DdXJyZW50XSA9IG5ldyBjaGFyW2xlbisxXTsKLSAgICAgICAgbWVtY3B5KG1BcnJheVttQ3VycmVudF0sIHN0ciwgbGVuKzEpOwotICAgICAgICBtQ3VycmVudCsrOwotCi0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIC8vCi0gICAgLy8gRGVsZXRlIGFuIGVudHJ5LgotICAgIC8vCi0gICAgdm9pZCBlcmFzZShpbnQgaWR4KSB7Ci0gICAgICAgIGlmIChpZHggPCAwIHx8IGlkeCA+PSBtQ3VycmVudCkKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgZGVsZXRlW10gbUFycmF5W2lkeF07Ci0gICAgICAgIGlmIChpZHggPCBtQ3VycmVudC0xKSB7Ci0gICAgICAgICAgICBtZW1tb3ZlKCZtQXJyYXlbaWR4XSwgJm1BcnJheVtpZHgrMV0sCi0gICAgICAgICAgICAgICAgKG1DdXJyZW50LTEgLSBpZHgpICogc2l6ZW9mKGNoYXIqKSk7Ci0gICAgICAgIH0KLSAgICAgICAgbUN1cnJlbnQtLTsKLSAgICB9Ci0KLSAgICAvLwotICAgIC8vIFNvcnQgdGhlIGFycmF5LgotICAgIC8vCi0gICAgdm9pZCBzb3J0KGludCAoKmNvbXBhcmUpKGNvbnN0IHZvaWQqLCBjb25zdCB2b2lkKikpIHsKLSAgICAgICAgcXNvcnQobUFycmF5LCBtQ3VycmVudCwgc2l6ZW9mKGNoYXIqKSwgY29tcGFyZSk7Ci0gICAgfQotCi0gICAgLy8KLSAgICA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AgICAgICBwdGhyZWFkX211dGV4X2luaXQoJm1NdXRleCwgTlVMTCk7CisgICAgfQorfQoraW5saW5lIE11dGV4Ojp+TXV0ZXgoKSB7CisgICAgcHRocmVhZF9tdXRleF9kZXN0cm95KCZtTXV0ZXgpOworfQoraW5saW5lIHN0YXR1c190IE11dGV4Ojpsb2NrKCkgeworICAgIHJldHVybiAtcHRocmVhZF9tdXRleF9sb2NrKCZtTXV0ZXgpOworfQoraW5saW5lIHZvaWQgTXV0ZXg6OnVubG9jaygpIHsKKyAgICBwdGhyZWFkX211dGV4X3VubG9jaygmbU11dGV4KTsKK30KK2lubGluZSBzdGF0dXNfdCBNdXRleDo6dHJ5TG9jaygpIHsKKyAgICByZXR1cm4gLXB0aHJlYWRfbXV0ZXhfdHJ5bG9jaygmbU11dGV4KTsKK30KKworI2VuZGlmIC8vIEhBVkVfUFRIUkVBRFMKKwogLyoKICAqIEF1dG9tYXRpYyBtdXRleC4gIERlY2xhcmUgb25lIG9mIHRoZXNlIGF0IHRoZSB0b3Agb2YgYSBmdW5jdGlvbi4KICAqIFdoZW4gdGhlIGZ1bmN0aW9uIHJldHVybnMsIGl0IHdpbGwgZ28gb3V0IG9mIHNjb3BlLCBhbmQgcmVsZWFzZSB0aGUKQEAgLTIyNSw2ICsyNzUsNyBAQAogIAogdHlwZWRlZiBNdXRleDo6QXV0b2xvY2sgQXV0b011dGV4OwogCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCiAgKiBDb25kaXRpb24gdmFyaWFibGUgY2xhc3MuICBUaGUgaW1wbGVtZW50YXRpb24gaXMgc3lzdGVtLWRlcGVuZGVudC4KQEAgLTI0MCw5ICsyOTEsNiBAQAogICAgIH5Db25kaXRpb24oKTsKICAgICAvLyBXYWl0IG9uIHRoZSBjb25kaXRpb24gdmFyaWFibGUuICBMb2NrIHRoZSBtdXRleCBiZWZvcmUgY2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SBtU2VydmljZUNvbW1hbmQuZXhlY3V0ZShTZXJ2aWNlQ29tbWFuZC5QVVRfS0VZLAotICAgICAgICAgICAgICAgICAgICBuYW1lc3BhY2UgKyAiICIgKyBrZXluYW1lICsgIiAiICsgdmFsdWUpOworICAgICAgICAgICAgICAgICAgICBuYW1lc3BhY2UgKyAiXDAiICsga2V5bmFtZSArICJcMCIgKyB2YWx1ZSk7CiAgICAgICAgICAgICByZXR1cm4gKHJlc3VsdCAhPSBudWxsKSA/IHJlc3VsdC5yZXR1cm5Db2RlIDogLTE7CiAgICAgICAgIH0KIAogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIFN0cmluZyBnZXQoU3RyaW5nIG5hbWVzcGFjZSwgU3RyaW5nIGtleW5hbWUpIHsKICAgICAgICAgICAgIFJlcGx5IHJlc3VsdCA9IG1TZXJ2aWNlQ29tbWFuZC5leGVjdXRlKFNlcnZpY2VDb21tYW5kLkdFVF9LRVksCi0gICAgICAgICAgICAgICAgICAgIG5hbWVzcGFjZSArICIgIiArIGtleW5hbWUpOworICAgICAgICAgICAgICAgICAgICBuYW1lc3BhY2UgKyAiXDAiICsga2V5bmFtZSArICJcMCIpOwogICAgICAgICAgICAgcmV0dXJuIChyZXN1bHQgIT0gbnVsbCkgPyAoKHJlc3VsdC5yZXR1cm5Db2RlICE9IDApID8gbnVsbCA6CiAgICAgICAgICAgICAgICAgICAgIG5ldyBTdHJpbmcocmVzdWx0LmRhdGEsIDAsIHJlc3VsdC5sZW4pKSA6IG51bGw7CiAgICAgICAgIH0KQEAgLTEyMCw3ICsxMTksNyBAQAogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIGludCByZW1vdmUoU3RyaW5nIG5hbWVzcGFjZSwgU3RyaW5nIGtleW5hbWUpIHsKICAgICAgICAgICAgIFJlcGx5IHJlc3VsdCA9IG1TZXJ2aWNlQ29tbWFuZC5leGVjdXRlKFNlcnZpY2VDb21tYW5kLlJFTU9WRV9LRVks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AgICAgICAgICAoKCgoaW50KSBidWZbMl0pICYgMHhmZikgPDwgOCkgfAorICAgICAgICAgICAgICAgICgoKGludCkgYnVmWzNdKSAmIDB4ZmYpOwogCiAgICAgICAgIGlmICghcmVhZEJ5dGVzKGJ1ZiwgNCkpIHJldHVybiBudWxsOwotICAgICAgICByZXBseS5yZXR1cm5Db2RlID0gKCgoaW50KSBidWZbMF0pICYgMHhmZikgfAotICAgICAgICAgICAgICAgICgoKChpbnQpIGJ1ZlsxXSkgJiAweGZmKSA8PCA4KSB8Ci0gICAgICAgICAgICAgICAgKCgoKGludCkgYnVmWzJdKSAmIDB4ZmYpIDw8IDE2KSB8Ci0gICAgICAgICAgICAgICAgKCgoKGludCkgYnVmWzNdKSAmIDB4ZmYpIDw8IDI0KTsKKyAgICAgICAgcmVwbHkucmV0dXJuQ29kZSA9ICgoKChpbnQpIGJ1ZlswXSkgJiAweGZmKSA8PCAyNCkgfAorICAgICAgICAgICAgICAgICgoKChpbnQpIGJ1ZlsxXSkgJiAweGZmKSA8PCAxNikgfAorICAgICAgICAgICAgICAgICgoKChpbnQpIGJ1ZlsyXSkgJiAweGZmKSA8PCA4KSB8CisgICAgICAgICAgICAgICAgKCgoaW50KSBidWZbM10pICYgMHhmZik7CiAKICAgICAgICAgaWYgKHJlcGx5LmxlbiA+IEJVRkZFUl9MRU5HVEgpIHsKICAgICAgICAgICAgIExvZy5lKG1UYWcsImludmFsaWQgcmVwbHkgbGVuZ3RoICgiICsgcmVwbHkubGVuICsgIikiKTsKQEAgLTE0NSwxNSArMTQ2LDE1IEBACiAgICAgICAgIGJ5dGVbXSBkYXRhID0gKF9kYXRhID09IG51bGwpID8gbmV3IGJ5dGVbMF0gOiBfZGF0YS5nZXRCeXRlcygpOwogICAgICAgICBpbnQgbGVuID0gZGF0YS5sZW5ndGg7CiAgICAgICAgIC8vIHRoZSBsZW5ndGggb2YgZGF0YQotICAgICAgICBidWZbMF0gPSAoYnl0ZSkgKGxlbiAmIDB4ZmYpO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sKKyAgICBTdHJpbmc4IGtleTsKKyAgICBzdGF0dXNfdCBzdGF0dXMgPSBOT19FUlJPUjsKIAotICAgIGlmICgha2V5IHx8ICF2YWx1ZSkKLSAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisgICAgTE9HVigic2V0UGFyYW1ldGVycygpICVzIiwga2V5VmFsdWVQYWlycy5zdHJpbmcoKSk7CiAKLSAgICBpZiAoc3RyY21wKGtleSwgImEyZHBfc2lua19hZGRyZXNzIikgPT0gMCkgewotICAgICAgICByZXR1cm4gbU91dHB1dC0+c2V0QWRkcmVzcyh2YWx1ZSk7Ci0gICAgfQotICAgIGlmIChzdHJjbXAoa2V5LCAiYmx1ZXRvb3RoX2VuYWJsZWQiKSA9PSAwKSB7Ci0gICAgICAgIG1PdXRwdXQtPnNldEJsdWV0b290aEVuYWJsZWQoc3RyY21wKHZhbHVlLCAidHJ1ZSIpID09IDApOworICAgIGtleSA9ICJibHVldG9vdGhfZW5hYmxlZCI7CisgICAgaWYgKHBhcmFtLmdldChrZXksIHZhbHVlKSA9PSBOT19FUlJPUikgeworICAgICAgICBtQmx1ZXRvb3RoRW5hYmxlZCA9ICh2YWx1ZSA9PSAidHJ1ZSIpOworICAgICAgICBpZiAobU91dHB1dCkgeworICAgICAgICAgICAgbU91dHB1dC0+c2V0Qmx1ZXRvb3RoRW5hYmxlZChtQmx1ZXRvb3RoRW5hYmxlZCk7CisgICAgICAgIH0KKyAgICAgICAgcGFyYW0ucmVtb3ZlKGtleSk7CiAgICAgfQogCi0gICAgcmV0dXJuIDA7CisgICAgaWYgKHBhcmFtLnNpemUoKSkgeworICAgICAgICBzdGF0dXNfdCBod1N0YXR1cyA9IG1IYXJkd2FyZUludGVyZmFjZS0+c2V0UGFyYW1ldGVycyhwYXJhbS50b1N0cmluZygpKTsKKyAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgc3RhdHVzID0gaHdTdGF0dXM7CisgICAgICAgIH0KKyAgICB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MmRwRGV2aWNlKChBdWRpb1N5c3RlbTo6YXVkaW9fZGV2aWNlcylkZXZpY2UpKSB7CisgICAgICAgICAgICBtRGV2aWNlID0gZGV2aWNlOworICAgICAgICAgICAgc3RhdHVzID0gTk9fRVJST1I7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzdGF0dXMgPSBCQURfVkFMVUU7CisgICAgICAgIH0KKyAgICAgICAgcGFyYW0ucmVtb3ZlKGtleSk7CisgICAgfQorCisgICAgaWYgKHBhcmFtLnNpemUoKSkgeworICAgICAgICBzdGF0dXMgPSBCQURfVkFMVUU7CisgICAgfQorICAgIHJldHVybiBzdGF0dXM7Cit9CisKK1N0cmluZzggQTJkcEF1ZGlvSW50ZXJmYWNlOjpBMmRwQXVkaW9TdHJlYW1PdXQ6OmdldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5cykKK3sKKyAgICBBdWRpb1BhcmFtZXRlciBwYXJhbSA9IEF1ZGlvUGFyYW1ldGVyKGtleXMpOworICAgIFN0cmluZzggdmFsdWU7CisgICAgU3RyaW5nOCBrZXkgPSBTdHJpbmc4KCJhMmRwX3NpbmtfYWRkcmVzcyIpOworCisgICAgaWYgKHBhcmFtLmdldChrZXksIHZhbHVlKSA9PSBOT19FUlJPUikgeworICAgICAgICB2YWx1ZSA9IG1BMmRwQWRkcmVzczsKKyAgICAgICAgcGFyYW0uYWRkKGtleSwgdmFsdWUpOworICAgIH0KKyAgICBrZXkgPSBBdWRpb1BhcmFtZXRlcjo6a2V5Um91dGluZzsKKyAgICBpZiAocGFyYW0uZ2V0KGtleSwgdmFsdWUpID09IE5PX0VSUk9SKSB7CisgICAgICAgIHBhcmFtLmFkZEludChrZXksIChpbnQpbURldmljZSk7CisgICAgfQorCisgICAgTE9HVigiQTJkcEF1ZGlvU3RyZWFtT3V0OjpnZXRQYXJhbWV0ZXJzKCkgJXMiLCBwYXJhbS50b1N0cmluZygpLnN0cmluZygpKTsKKyAgICByZXR1cm4gcGF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pbmc4JiBrZXlWYWx1ZVBhaXJzKTsKKyAgICB2aXJ0dWFsIFN0cmluZzggICAgIGdldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5cyk7CisKKyAgICB2aXJ0dWFsIHNpemVfdCAgICAgIGdldElucHV0QnVmZmVyU2l6ZSh1aW50MzJfdCBzYW1wbGVSYXRlLCBpbnQgZm9ybWF0LCBpbnQgY2hhbm5lbENvdW50KTsKIAogICAgIC8vIGNyZWF0ZSBJL08gc3RyZWFtcwogICAgIHZpcnR1YWwgQXVkaW9TdHJlYW1PdXQqIG9wZW5PdXRwdXRTdHJlYW0oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQ9MCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudD0wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlPTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZm9ybWF0PTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpjaGFubmVscz0wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqc2FtcGxlUmF0ZT0wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzPTApOworICAgIHZpcnR1YWwgICAgdm9pZCAgICAgICAgY2xvc2VPdXRwdXRTdHJlYW0oQXVkaW9TdHJlYW1PdXQqIG91dCk7CiAKICAgICB2aXJ0dWFsIEF1ZGlvU3RyZWFtSW4qIG9wZW5JbnB1dFN0cmVhbSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0U291cmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hhbm5lbENvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKmNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqc2FtcGxlUmF0ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcyBhY291c3RpY3MpOworICAgIHZpcnR1YWwgICAgdm9pZCAgICAgICAgY2xvc2VJbnB1dFN0cmVhbShBdWRpb1N0cmVhbUluKiBpbik7CisvLyAgICBzdGF0aWMgQXVkaW9IYXJkd2FyZUludGVyZmFjZSogY3JlYXRlQTJkcEludGVyZmFjZSgpOwogCiBwcm90ZWN0ZWQ6Ci0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBkb1JvdXRpbmcoKTsKICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKTsKIAogcHJpdmF0ZToKQEAgLTcxLDE5ICs3NywyMiBAQAogICAgIHB1YmxpYzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBMmRwQXVkaW9TdHJlYW1PdXQoKTsKICAgICAgICAgdmlydHVhbCAgICAgICAgICAgICB+QTJkcEF1ZGlvU3RyZWFtT3V0KCk7Ci0gICAgICAgICAgICAgICAgc3RhdHVzX3QgICAgc2V0KGludCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUpOworICAgICAgICAgICAgICAgIHN0YXR1c190ICAgIHNldCh1aW50MzJfdCBkZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqcEZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBSYXRlKTsKICAgICAgICAgdmlydHVhbCB1aW50MzJfdCAgICBzYW1wbGVSYXRlKCkgY29uc3QgeyByZXR1cm4gNDQxMDA7IH0KICAgICAgICAgLy8gU0JDIGNvZGVjIHdhbnRzIGEgbXVsdGlwbGUgb2YgNTEyCiAgICAgICAgIHZpcnR1YWwgc2l6ZV90ICAgICAgYnVmZmVyU2l6ZSgpIGNvbnN0IHsgcmV0dXJuIDUxMiAqIDIwOyB9Ci0gICAgICAgIHZpcnR1YWwgaW50ICAgICAgICAgY2hhbm5lbENvdW50KCkgY29uc3QgeyByZXR1cm4gMjsgfQorICAgICAgICB2aXJ0dWFsIHVpbnQzMl90ICAgIGNoYW5uZWxzKCkgY29uc3QgeyByZXR1cm4gQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX1NURVJFTzsgfQogICAgICAgICB2aXJ0dWFsIGludCAgICAgICAgIGZvcm1hdCgpIGNvbnN0IHsgcmV0dXJuIEF1ZGlvU3lzdGVtOjpQQ01fMTZfQklUOyB9CiAgICAgICAgIHZpcnR1YWwgdWludDMyX3QgICAgbGF0ZW5jeSgpIGNvbnN0IHsgcmV0dXJuICgoMTAwMCpidWZmZXJTaXplKCkpL2ZyYW1lU2l6ZSgpKS9zYW1wbGVSYXRlKCkgKyAyMDA7IH0KLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXRWb2x1bWUoZmxvYXQgdm9sdW1lKSB7IHJldHVybiBJTlZBTElEX09QRVJBVElPTjsgfQorICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHNldFZvbHVtZShmbG9hdCBsZWZ0LCBmbG9hdCByaWdodCkgeyByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047IH0KICAgICAgICAgdmlydHVhbCBzc2l6ZV90ICAgICB3cml0ZShjb25zdCB2b2lkKiBidWZmZXIsIHNpemVfdCBieXRlcyk7CiAgICAgICAgICAgICAgICAgc3RhdHVzX3QgICAgc3RhbmRieSgpOwogICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKTsKKyAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXRQYXJhbWV0ZXJzKGNvbnN0IFN0cmluZzgmIGtleVZhbHVlUGFpcnMpOworICAgICAgICB2aXJ0dWFsIFN0cmluZzggICAgIGdldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5cyk7CiAKICAgICBwcml2YXRlOgogICAgICAgICBmcmllbmQgY2xhc3MgQTJkcEF1ZGlvSW50ZXJmYWNlOwpAQCAtMTAyLDExICsxMTEsMTkgQEAKICAgICAgICAgICAgICAgICB2b2lkKiAgICAgICBtRGF0YTsKICAgICAgICAgICAgICAgICBNdXRleCAgICAgICBtTG9jazsKICAgICAgICAgICAgICAgICBib29sICAgICAgICBtQmx1ZXRvb3RoRW5hYmxlZDsKKyAgICAgICAgICAgICAgICB1aW50MzJfdCAgICBtRGV2aWNlOworICAgICAgICAgICAgICAgIGJvb2wgICAgICAgIG1DbG9zaW5nOwogICAgIH07CiAKKyAgICBmcmllbmQgY2xhc3MgQTJkcEF1ZGlvU3RyZWFtT3V0OworCiAgICAgQTJkcEF1ZGlvU3RyZWFtT3V0KiAgICAgbU91dHB1dDsKKyAgICBBdWRpb0hhcmR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3RlbTo6UENNXzE2X0JJVDsKKyAgICAgICAgfQorICAgICAgICBpZiAoY2hhbm5lbHMgIT0gMCAmJiAqY2hhbm5lbHMgIT0gMCkgeworICAgICAgICAgICAgbENoYW5uZWxzID0gKmNoYW5uZWxzOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbENoYW5uZWxzID0gQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX1NURVJFTzsKKyAgICAgICAgfQorICAgICAgICBpZiAoc2FtcGxlUmF0ZSAhPSAwICYmICpzYW1wbGVSYXRlICE9IDApIHsKKyAgICAgICAgICAgIGxSYXRlID0gKnNhbXBsZVJhdGU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBsUmF0ZSA9IDQ0MTAwOworICAgICAgICB9CisgICAgICAgIGlmIChzdGF0dXMpICpzdGF0dXMgPSBOT19FUlJPUjsKICAgICB9CisgICAgTE9HVigib3Blbk91dHB1dFN0cmVhbSgpLCBvdXRGaW5hbCAlcCIsIG91dEZpbmFsKTsKKworICAgIEF1ZGlvU3RyZWFtT3V0RHVtcCAqZHVtT3V0cHV0ID0gbmV3IEF1ZGlvU3RyZWFtT3V0RHVtcCh0aGlzLCBtT3V0cHV0cy5zaXplKCksIG91dEZpbmFsLAorICAgICAgICAgICAgZGV2aWNlcywgbEZvcm1hdCwgbENoYW5uZWxzLCBsUmF0ZSk7CisgICAgbU91dHB1dHMuYWRkKGR1bU91dHB1dCk7CisKKyAgICByZXR1cm4gZHVtT3V0cHV0OwogfQogCit2b2lkIEF1ZGlvRHVtcEludGVyZmFjZTo6Y2xvc2VPdXRwdXRTdHJlYW0oQXVkaW9TdHJlYW1PdXQqIG91dCkKK3sKKyAgICBBdWRpb1N0cmVhbU91dER1bXAgKmR1bXBPdXQgPSAoQXVkaW9TdHJlYW1PdXREdW1wICopb3V0OworCisgICAgaWYgKG1PdXRwdXRzLmluZGV4T2YoZHVtcE91dCkgPCAwKSB7CisgICAgICAgIExPR1coIkF0dGVtcH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1bXBJbnRlcmZhY2UgKmludGVyZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TdHJlYW1PdXQqIGZpbmFsU3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlKQorICAgIDogbUludGVyZmFjZShpbnRlcmZhY2UpLCBtSWQoaWQpLAorICAgICAgbVNhbXBsZVJhdGUoc2FtcGxlUmF0ZSksIG1Gb3JtYXQoZm9ybWF0KSwgbUNoYW5uZWxzKGNoYW5uZWxzKSwgbUxhdGVuY3koMCksIG1EZXZpY2UoZGV2aWNlcyksCisgICAgICBtQnVmZmVyU2l6ZSgxMDI0KSwgbUZpbmFsU3RyZWFtKGZpbmFsU3RyZWFtKSwgbU91dEZpbGUoMCksIG1GaWxlQ291bnQoMCkKIHsKLSAgICBtRmluYWxTdHJlYW0gPSBmaW5hbFN0cmVhbTsKLSAgICBtT3V0RmlsZSA9IDA7CisgICAgTE9HVigiQXVkaW9TdHJlYW1PdXREdW1wIENvbnN0cnVjdG9yICVwLCBtSW50ZXJmYWNlICVwLCBtRmluYWxTdHJlYW0gJXAiLCB0aGlzLCBtSW50ZXJmYWNlLCBtRmluYWxTdHJlYW0pOwogfQogCiAKIEF1ZGlvU3RyZWFtT3V0RHVtcDo6fkF1ZGlvU3RyZWFtT3V0RHVtcCgpCiB7CisgICAgTE9HVigiQXVkaW9TdHJlYW1PdXREdW1wIGRlc3RydWN0b3IiKTsK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VZhbHVlUGFpcnMpOworICAgIFN0cmluZzggdmFsdWU7CisgICAgaW50IHZhbHVlSW50OworICAgIHN0YXR1c190IHN0YXR1cyA9IE5PX0VSUk9SOworCisgICAgaWYgKHBhcmFtLmdldEludChTdHJpbmc4KCJzZXRfaWQiKSwgdmFsdWVJbnQpID09IE5PX0VSUk9SKSB7CisgICAgICAgIG1JZCA9IHZhbHVlSW50OworICAgIH0KKworICAgIGlmIChwYXJhbS5nZXRJbnQoU3RyaW5nOCgiZm9ybWF0IiksIHZhbHVlSW50KSA9PSBOT19FUlJPUikgeworICAgICAgICBpZiAobU91dEZpbGUgPT0gMCkgeworICAgICAgICAgICAgbUZvcm1hdCA9IHZhbHVlSW50OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc3RhdHVzID0gSU5WQUxJRF9PUEVSQVRJT047CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKHBhcmFtLmdldEludChTdHJpbmc4KCJjaGFubmVscyIpLCB2YWx1ZUludCkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgaWYgKHZhbHVlSW50ID09IEF1ZGlvU3lzdGVtOjpDSEFOTkVMX09VVF9TVEVSRU8gfHwgdmFsdWVJbnQgPT0gQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX01PTk8pIHsKKyAgICAgICAgICAgIG1DaGFubmVscyA9IHZhbHVlSW50OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc3RhdHVzID0gQkFEX1ZBTFVFOworICAgICAgICB9CisgICAgfQorICAgIGlmIChwYXJhbS5nZXRJbnQoU3RyaW5nOCgic2FtcGxpbmdfcmF0ZSIpLCB2YWx1ZUludCkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgaWYgKHZhbHVlSW50ID4gMCAmJiB2YWx1ZUludCA8PSA0ODAwMCkgeworICAgICAgICAgICAgaWYgKG1PdXRGaWxlID09IDApIHsKKyAgICAgICAgICAgICAgICBtU2FtcGxlUmF0ZSA9IHZhbHVlSW50Owor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orICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N0cmVhbUluKiBmaW5hbFN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSkKKyAgICA6IG1JbnRlcmZhY2UoaW50ZXJmYWNlKSwgbUlkKGlkKSwKKyAgICAgIG1TYW1wbGVSYXRlKHNhbXBsZVJhdGUpLCBtRm9ybWF0KGZvcm1hdCksIG1DaGFubmVscyhjaGFubmVscyksIG1EZXZpY2UoZGV2aWNlcyksCisgICAgICBtQnVmZmVyU2l6ZSgxMDI0KSwgbUZpbmFsU3RyZWFtKGZpbmFsU3RyZWFtKSwgbUluRmlsZSgwKQoreworICAgIExPR1YoIkF1ZGlvU3RyZWFtSW5EdW1wIENvbnN0cnVjdG9yICVwLCBtSW50ZXJmYWNlICVwLCBtRmluYWxTdHJlYW0gJXAiLCB0aGlzLCBtSW50ZXJmYWNlLCBtRmluYWxTdHJlYW0pOworfQorCisKK0F1ZGlvU3RyZWFtSW5EdW1wOjp+QXVkaW9TdHJlYW1JbkR1bXAoKQoreworICAgIENsb3NlKCk7Cit9CisKK3NzaXplX3QgQXVkaW9TdHJlYW1JbkR1bXA6OnJlYWQodm9pZCogYnVmZmVyLCBzc2l6ZV90IGJ5dGVzKQoreworICAgIGlmIChtRmluYWxTdHJlYW0pIHsKKyAgICAgICAgcmV0dXJuIG1GaW5hbFN0cmVhbS0+cmVhZChidWZmZXIsIGJ5dGVzKTsKKyAgICB9CisKKyAgICB1c2xlZXAoKGJ5dGVzICogMTAwMDAwMCkgLyBmcmFtZVNpemUoKSAvIHNhbXBsZVJhdGUoKSk7CisKKyAgICBpZighbUluRmlsZSkgeworICAgICAgICBjaGFyIG5hbWVbMjU1XTsKKyAgICAgICAgc3RyY3B5KG5hbWUsICIvc2RjYXJkL211c2ljL3NpbmU0NDAiKTsKKyAgICAgICAgaWYgKGNoYW5uZWxzKCkgPT0gQXVkaW9TeXN0ZW06OkNIQU5ORUxfSU5fTU9OTykgeworICAgICAgICAgICAgc3RyY2F0KG5hbWUsICJfbW8iKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHN0cmNhdChuYW1lLCAiX3N0Iik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZvcm1hdCgpID09IEF1ZGlvU3lzdGVtOjpQQ01fMTZfQklUKSB7CisgICAgICAgICAgICBzdHJjYXQobmFtZSwgIl8xNmIiKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHN0cmNhdChuYW1lLCAiXzhiIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHNhbXBsZVJhdGUoKSA8IDE2MDAwKSB7CisgICAgICAgICAgICBzdHJjYXQobmFtZSwgIl84ayIpOworICAgICAgICB9IGVsc2UgaWYgKHNhbXBsZVJhdGUoKSA8IDMyMDAwKSB7CisgICAgICAgICAgICBzdHJjYXQobmFtZSwgIl8yMmsiKTsKKyAgICAgICAgfSBlbHNlIGlmIChzYW1wbGVSYXRlKCkgPCA0ODAwMCkgeworICAgICAgICAgICAgc3RyY2F0KG5hbWUsICJfNDRrIik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzdHJjYXQobmFtZSwgIl80OGsiKTsKKyAgICAgICAgfQorICAgICAgICBzdHJjYXQobmFtZSwgIi53YXYiKTsKKyAgICAgICAgbUluRmlsZSA9IGZvcGVuKG5hbWUsICJyYiIpOworICAgICAgICBMT0dWKCJPcGVuaW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b3IuaD4KIAogI2luY2x1ZGUgPGhhcmR3YXJlX2xlZ2FjeS9BdWRpb0hhcmR3YXJlQmFzZS5oPgogCiBuYW1lc3BhY2UgYW5kcm9pZCB7CiAKLSNkZWZpbmUgRkxJTkdFUl9EVU1QX05BTUUgIi9kYXRhL0ZsaW5nZXJPdXQucGNtIiAvLyBuYW1lIG9mIGZpbGUgdXNlZCBmb3IgZHVtcAorI2RlZmluZSBBVURJT19EVU1QX1dBVkVfSERSX1NJWkUgNDQKKworY2xhc3MgQXVkaW9EdW1wSW50ZXJmYWNlOwogCiBjbGFzcyBBdWRpb1N0cmVhbU91dER1bXAgOiBwdWJsaWMgQXVkaW9TdHJlYW1PdXQgewogcHVibGljOgotICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TdHJlYW1PdXREdW1wKCBBdWRpb1N0cmVhbU91dCogRmluYWxTdHJlYW0pOworICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TdHJlYW1PdXREdW1wKEF1ZGlvRHVtcEludGVyZmFjZSAqaW50ZXJmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3RyZWFtT3V0KiBmaW5hbFN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZGV2aWNlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgfkF1ZGlvU3RyZWFtT3V0RHVtcCgpOwotICAgICAgICAgICAg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ICAgIHVpbnQzMl90IG1DaGFubmVsczsgICAgICAgICAgICAgICAgIC8vIG91dHB1dCBjb25maWd1cmF0aW9uCisgICAgdWludDMyX3QgbUxhdGVuY3k7ICAgICAgICAgICAgICAgICAgLy8KKyAgICB1aW50MzJfdCBtRGV2aWNlOyAgICAgICAgICAgICAgICAgICAvLyBjdXJyZW50IGRldmljZSB0aGlzIG91dHB1dCBpcyByb3V0ZWQgdG8KKyAgICBzaXplX3QgIG1CdWZmZXJTaXplOwogICAgIEF1ZGlvU3RyZWFtT3V0ICAgICAgKm1GaW5hbFN0cmVhbTsKLSAgICBGSUxFICAgICAgICAgICAgICAgICptT3V0RmlsZTsgICAgIC8vIG91dHB1dCBmaWxlCisgICAgRklMRSAgICAgICAgICAgICAgICAqbU91dEZpbGU7ICAgICAgLy8gb3V0cHV0IGZpbGUKKyAgICBpbnQgICAgICAgICAgICAgICAgIG1GaWxlQ291bnQ7CiB9OwogCitjbGFzcyBBdWRpb1N0cmVhbUluRHVtcCA6IHB1YmxpYyBBdWRpb1N0cmVhbUluIHsKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3RyZWFtSW5EdW1wKEF1ZGlvRHVtcEludGVyZmFjZSAqaW50ZXJmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3RyZWFtSW4qIGZpbmFsU3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB+QXVkaW9TdHJlYW1JbkR1bXAoKTsKKworICAgIHZpcnR1YWwgdWludDMyX3QgICAgc2FtcGxlUmF0ZSgpIGNvbnN0OworICAgIHZpcnR1YWwgc2l6ZV90ICAgICAgYnVmZmVyU2l6ZSgpIGNvbnN0OworICAgIHZpcnR1YWwgdWludDMyX3QgICAgY2hhbm5lbHMoKSBjb25zdDsKKyAgICB2aXJ0dWFsIGludCAgICAgICAgIGZvcm1hdCgpIGNvbnN0OworCisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXRHYWluKGZsb2F0IGdhaW4pOworICAgIHZpcnR1YWwgc3NpemVfdCAgICAgcmVhZCh2b2lkKiBidWZmZXIsIHNzaXplX3QgYnl0ZXMpOworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc3RhbmRieSgpOworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc2V0UGFyYW1ldGVycyhjb25zdCBTdHJpbmc4JiBrZXlWYWx1ZVBhaXJzKTsKKyAgICB2aXJ0dWFsIFN0cmluZzggICAgIGdldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5cyk7CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBkdW1wKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiYgYXJncyk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBDbG9zZSh2b2lkKTsKKyAgICBBdWRpb1N0cmVhbUluKiAgICAgZmluYWxTdHJlYW0oKSB7IHJldHVybiBtRmluYWxTdHJlYW07IH0KKyAgICB1aW50MzJfdCAgICAgICAgICAgIGRldmljZSgpIHsgcmV0dXJuIG1EZXZpY2U7IH0KKworcHJpdmF0ZToKKyAgICBBdWRpb0R1bXBJbnRlcmZhY2UgKm1JbnRlcmZhY2U7CisgICAgaW50ICAgICAgICAgICAgICAgICAgbUlkOworICAgIHVpbnQzMl90IG1TYW1wbGVSYXRlOyAgICAgICAgICAgICAgIC8vCisgICAgdWludDMyX3QgbUZvcm1hdDsgICAgICAgICAgICAgICAgICAgLy8KKyAgICB1aW50MzJfdCBtQ2hhbm5lbHM7ICAgICAgICAgICAgICAgICAvLyBvdXRwdXQgY29uZmlndXJhdGlvbgorICAgIHVpbnQzMl90IG1EZXZpY2U7ICAgICAgICAgICAgICAgICAgIC8vIGN1cnJlbnQgZGV2aWNlIHRoaXMgb3V0cHV0IGlzIHJvdXRlZCB0bworICAgIHNpemVfdCAgbUJ1ZmZlclNpemU7CisgICAgQXVkaW9TdHJlYW1JbiAgICAgICptRmluYWxTdHJlYW07CisgICAgRklMRSAgICAgICAgICAgICAgICAqbUluRmlsZTsgICAgICAvLyBvdXRwdXQgZmlsZQorfTsKIAogY2xhc3MgQXVkaW9EdW1wSW50ZXJmYWNlIDogcHVibGljIEF1ZGlvSGFyZHdhcmVCYXNlCiB7CkBAIC01NiwxMCArMTE2LDEzIEBACiBwdWJsaWM6CiAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb0R1bXBJbnRlcmZhY2UoQXVkaW9IYXJkd2FyZUludGVyZmFjZSogaHcpOwogICAgIHZpcnR1YWwgQXVkaW9TdHJlYW1PdXQqIG9wZW5PdXRwdXRTdHJlYW0oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQ9MCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudD0wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlPTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZm9ybWF0PTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpjaGFubmVscz0wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqc2FtcGxlUmF0ZT0wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzPTApOworICAgIHZpcnR1YWwgICAgdm9pZCAgICAgICAgY2xvc2VPdXRwdXRTdHJlYW0oQXVkaW9TdHJlYW1PdXQqIG91dCk7CisKICAgICB2aXJ0dWFsICAgICAgICAgICAgIH5BdWRpb0R1bXBJbnRlcmZhY2UoKTsKIAogICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgaW5pdENoZWNrKCkKQEAgLTc1LDIxICsxMzgsMjUgQEAKICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIGdldE1pY011dGUoYm9vbCogc3RhdGUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3JldHVybiBtRmluYWxJbnRlcmZhY2UtPmdldE1pY011dGUoc3RhdGUpO30KIAotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc2V0UGFyYW1ldGVyKGNvbnN0IGNoYXIqIGtleSwgY29uc3QgY2hhciogdmFsdWUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAge3JldHVybiBtRmluYWxJbnRlcmZhY2UtPnNldFBhcmFtZXRlcihrZXksIHZhbHVlKTt9CisgICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXRQYXJhbWV0ZXJzKGNvbnN0IFN0cmluZzgmIGtleVZhbHVlUGFpcnMpOworICAgIHZpcnR1YWwgU3RyaW5nOCAgICAgZ2V0UGFyYW1ldGVycyhjb25zdCBTdHJpbmc4JiBrZXlzKTsKIAotICAgIHZpcnR1YWwgQXVkaW9TdHJlYW1Jbiogb3BlbklucHV0U3RyZWFtKGludCBpbnB1dFNvdXJjZSwgaW50IGZvcm1hdCwgaW50IGNoYW5uZWxDb3VudCwKLSAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsIHN0YXR1c190ICpzdGF0dXMsIEF1ZGlvU3lzdGVtOjphdWRpb19pbl9hY291c3RpY3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mFja1RocmVhZHMudmFsdWVBdChpKS0+ZHVtcChmZCwgYXJncyk7CisgICAgICAgIH0KKworICAgICAgICAvLyBkdW1wIHJlY29yZCB0aHJlYWRzCisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbVJlY29yZFRocmVhZHMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgIG1SZWNvcmRUaHJlYWRzLnZhbHVlQXQoaSktPmR1bXAoZmQsIGFyZ3MpOworICAgICAgICB9CiAKICAgICAgICAgaWYgKG1BdWRpb0hhcmR3YXJlKSB7CiAgICAgICAgICAgICBtQXVkaW9IYXJkd2FyZS0+ZHVtcFN0YXRlKGZkLCBhcmdzKTsKQEAgLTM1Myw2ICsyNTYsNyBAQAogICAgIHJldHVybiBOT19FUlJPUjsKIH0KIAorCiAvLyBJQXVkaW9GbGluZ2VyIGludGVyZmFjZQogCiAKQEAgLTM2NSw5ICsyNjksMTAgQEAKICAgICAgICAgaW50IGZyYW1lQ291bnQsCiAgICAgICAgIHVpbnQzMl90IGZsYWdzLAogICAgICAgICBjb25zdCBzcDxJTWVtb3J5PiYgc2hhcmVkQnVmZmVyLAorICAgICAgICBpbnQgb3V0cHV0LAogICAgICAgICBzdGF0dXNfdCAqc3RhdHVzKQogewotICAgIHNwPE1peGVyVGhyZWFkOjpUcmFjaz4gdHJhY2s7CisgICAgc3A8UGxheWJhY2tUaHJlYWQ6OlRyYWNrPiB0cmFjazsKICAgICBzcDxUcmFja0hhbmRsZT4gdHJhY2tIYW5kbGU7CiAgICAgc3A8Q2xpZW50PiBjbGllbnQ7CiAgICAgd3A8Q2xpZW50PiB3Y2xpZW50OwpAQCAtMzgxLDYgKzI4NiwxMiBAQAogCiAgICAgewogICAgICAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgICAgICBQbGF5YmFja1RocmVhZCAqdGhyZWFkID0gY2hlY2tQbGF5YmFja1RocmVhZF9sKG91dHB1dCk7CisgICAgICAgIGlmICh0aHJlYWQgPT0gTlVMTCkgeworICAgICAgICAgICAgTE9HRSgidW5rbm93biBvdXRwdXQgdGhyZWFkIik7CisgICAgICAgICAgICBsU3RhdHVzID0gQkFEX1ZBTFVFOworICAgICAgICAgICAgZ290byBFeGl0OworICAgICAgICB9CiAKICAgICAgICAgd2NsaWVudCA9IG1DbGllbnRzLnZhbHVlRm9yKHBpZCk7CiAKQEAgLTM5MCwxNiArMzAxLDggQEAKICAgICAgICAgICAgIGNsaWVudCA9IG5ldyBDbGllbnQodGhpcywgcGlkKTsKICAgICAgICAgICAgIG1DbGllbnRzLmFkZChwaWQsIGNsaWVudCk7CiAgICAgICAgIH0KLSNpZmRlZiBXSVRIX0EyRFAKLSAgICAgICAgaWYgKGlzQTJkcEVuYWJsZWQoKSAmJiBBdWRpb1N5c3RlbTo6cm91dGVkVG9BMmRwT3V0cHV0KHN0cmVhbVR5cGUpKSB7Ci0gICAgICAgICAgICB0cmFjayA9IG1BMmRwTWl4ZXJUaHJlYWQtPmNyZWF0ZVRyYWNrX2woY2xpZW50LCBzdHJlYW1UeXBlLCBzYW1wbGVSYXRlLCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgIGNoYW5uZWxDb3VudCwgZnJhbWVDb3VudCwgc2hhcmVkQnVmZmVyLCAmbFN0YXR1cyk7ICAgICAgICAgICAgCi0gICAgICAgIH0gZWxzZSAKLSNlbmRpZgotICAgICAgICB7Ci0gICAgICAgICAgICB0cmFjayA9IG1IYXJkd2FyZU1peGVyVGhyZWFkLT5jcmVhdGVUcmFja19sKGNsaWVudCwgc3RyZWFtVHlwZSwgc2FtcGxlUmF0ZSwgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICBjaGFubmVsQ291bnQsIGZyYW1lQ291bnQsIHNoYXJlZEJ1ZmZlciwgJmxTdGF0dXMpOyAgICAgICAgICAgIAotICAgICAgICB9CisgICAgICAgIHRyYWNrID0gdGhyZWFkLT5jcmVhdGVUcmFja19sKGNsaWVudCwgc3RyZWFtVHl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GV4OjpBdXRvbG9jayBfbChtTG9jayk7CiAKQEAgLTgwMSw2ICs2NzcsMzYgQEAKICAgICB9CiB9CiAKK3ZvaWQgQXVkaW9GbGluZ2VyOjphdWRpb0NvbmZpZ0NoYW5nZWQoaW50IGV2ZW50LCBjb25zdCBzcDxUaHJlYWRCYXNlPiYgdGhyZWFkLCB2b2lkICpwYXJhbTIpIHsKKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgIGludCBpb0hhbmRsZSA9IDA7CisKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1QbGF5YmFja1RocmVhZHMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgaWYgKG1QbGF5YmFja1RocmVhZHMudmFsdWVBdChpKSA9PSB0aHJlYWQpIHsKKyAgICAgICAgICAgIGlvSGFuZGxlID0gbVBsYXliYWNrVGhyZWFkcy5rZXlBdChpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIGlmIChpb0hhbmRsZSA9PSAwKSB7CisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbVJlY29yZFRocmVhZHMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChtUmVjb3JkVGhyZWFkcy52YWx1ZUF0KGkpID09IHRocmVhZCkgeworICAgICAgICAgICAgICAgIGlvSGFuZGxlID0gbVJlY29yZFRocmVhZHMua2V5QXQoaSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpZiAoaW9IYW5kbGUgIT0gMCkgeworICAgICAgICBzaXplX3Qgc2l6ZSA9IG1Ob3RpZmljYXRpb25DbGllbnRzLnNpemUoKTsKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKKyAgICAgICAgICAgIHNwPElCaW5kZXI+IGJpbmRlciA9IG1Ob3RpZmljYXRpb25DbGllbnRzL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AgICAgICAgbUhhcmR3YXJlTWl4ZXJUaHJlYWQtPnNldFN0cmVhbU11dGUoQXVkaW9TeXN0ZW06Ok1VU0lDLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHVzbGVlcChtSGFyZHdhcmVNaXhlclRocmVhZC0+bGF0ZW5jeSgpKjEwMDApOwotICAgICAgICAgICAgICAgICAgICAgICAgbUhhcmR3YXJlU3RhdHVzID0gQVVESU9fSFdfU0VUX1JPVVRJTkc7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQXVkaW9IYXJkd2FyZS0+c2V0Um91dGluZyhBdWRpb1N5c3RlbTo6TU9ERV9OT1JNQUwsIG1TYXZlZFJvdXRlIHwgQXVkaW9TeXN0ZW06OlJPVVRFX1NQRUFLRVIpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUhhcmR3YXJlU3RhdHVzID0gQVVESU9fSFdfSURMRTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlbGF5IHRyYWNrIHN0YXJ0IHNvIHRoYXQgYXVkaW8gaGFyZHdhcmUgaGFzIHRpbWUgdG8gc2l3dGNoIHJvdXRlcwotICAgICAgICAgICAgICAgICAgICAgICAgdXNsZWVwKGtTdGFydFNsZWVwVGltZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUZvcmNlZFJvdXRlID0gQXVkaW9TeXN0ZW06OlJPVVRFX1NQRUFLRVI7Ci0gICAgICAgICAgICAgICAgbVJvdXRlUmVzdG9yZVRpbWUgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgTE9HVigibUZvcmNlZFNwZWFrZXJDb3VudCBpbmNyZW1lbnRlZCB0byAlZCIsIG1Gb3JjZWRTcGVha2VyQ291bnQpOwotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgQUNUSVZFX1RSQUNLX1JFTU9WRUQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIEF1dG9NdXRleCBsb2NrKG1IYXJkd2FyZUxvY2spOwotICAgICAgICAgICAgaWYgKG1Gb3JjZWRTcGVha2VyQ291bnQgPiAwKXsKLSAgICAgICAgICAgICAgICBpZiAoLS1tRm9yY2VkU3BlYWtlckNvdW50ID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbVJvdXRlUmVzdG9yZVRpbWUgPSBzeXN0ZW1UaW1lKCkgKyBtaWxsaXNlY29uZHMoa1N0b3BTbGVlcFRpbWUvMTAwMCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIExPR1YoIm1Gb3JjZWRTcGVha2VyQ291bnQgZGVjcmVtZW50ZWQgdG8gJWQiLCBtRm9yY2VkU3BlYWtlckNvdW50KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgTE9HRSgibUZvcmNlZFNwZWFrZXJDb3VudCBpcyBhbHJlYWR5IHplcm8iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBicmVhazsKLSAgICBjYXNlIENIRUNLX1JPVVRFX1JFU1RPUkVfVElNRToKLSAgICBjYXNlIEZPUkNFX1JPVVRFX1JFU1RPUkU6Ci0gICAgICAgIGlmIChtUm91dGVSZXN0b3JlVGltZSkgewotICAgICAgICAgICAgQXV0b011dGV4IGxvY2sobUhhcmR3YXJlTG9jayk7Ci0gICAgICAgICAgICBpZiAobVJvdXRlUmVzdG9yZVRpbWUgJiYgCi0gICAgICAgICAgICAgICAoc3lzdGVtVGltZSgpID4gbVJvdXRlUmVzdG9yZVRpbWUgfHwgY29tbWFuZCA9PSBGT1JDRV9ST1VURV9SRVNUT1JFKSkgewotICAgICAgICAgICAgICAgIG1IYXJkd2FyZU1peGVyVGhyZWFkLT5zZXRTdHJlYW1NdXRlKEF1ZGlvU3lzdGVtOjpNVVNJQywgbU11c2ljTXV0ZVNhdmVkKTsKLSAgICAgICAgICAgICAgICBtRm9yY2VkUm91dGUgPSA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RW5hYmxlZCkgewotICAgICAgICAgICAgICAgIHNldEEyZHBFbmFibGVkX2woZmFsc2UpOwotICAgICAgICAgICAgICAgIG1BMmRwU3VwcHJlc3NlZCA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgTE9HVigibUEyZHBEaXNhYmxlQ291bnQgaW5jcmVtZW50ZWQgdG8gJWQiLCBtQTJkcERpc2FibGVDb3VudCk7Ci0gICB9IGVsc2UgewotICAgICAgICBpZiAobUEyZHBEaXNhYmxlQ291bnQgPiAwKSB7Ci0gICAgICAgICAgICBpZiAoLS1tQTJkcERpc2FibGVDb3VudCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1BMmRwU3VwcHJlc3NlZCkgewotICAgICAgICAgICAgICAgICAgICBzZXRBMmRwRW5hYmxlZF9sKHRydWUpOwotICAgICAgICAgICAgICAgICAgICBtQTJkcFN1cHByZXNzZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBMT0dWKCJtQTJkcERpc2FibGVDb3VudCBkZWNyZW1lbnRlZCB0byAlZCIsIG1BMmRwRGlzYWJsZUNvdW50KTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIExPR1YoIm1BMmRwRGlzYWJsZUNvdW50IGlzIGFscmVhZHkgemVybyIpOwotICAgICAgICB9CisgICAgLy8ga2VlcCBhIHN0cm9uZyByZWYgb24gb3Vyc2VsZiBzbyB0aGF0IHdlIHdhbnQgZ2V0CisgICAgLy8gZGVzdHJveWVkIGluIHRoZSBtaWRkbGUgb2YgcmVxdWVzdEV4aXRBbmRXYWl0KCkKKyAgICBzcCA8VGhyZWFkQmFzZT4gc3Ryb25nTWUgPSB0aGlzOworCisgICAgTE9HVigiVGhyZWFkQmFzZTo6ZXhpdCIpOworICAgIHsKKyAgICAgICAgQXV0b011dGV4IGxvY2soJm1Mb2NrKTsKKyAgICAgICAgcmVxdWV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cHV0IGF1ZGlvIGhhcmR3YXJlIGludG8gc3RhbmRieSBhZnRlciBzaG9ydCBkZWxheQotICAgICAgICAgICAgaWYgVU5MSUtFTFkoIWFjdGl2ZVRyYWNrcy5zaXplKCkgJiYgc3lzdGVtVGltZSgpID4gc3RhbmRieVRpbWUpIHsKLSAgICAgICAgICAgICAgICAvLyB3YWl0IHVudGlsIHdlIGhhdmUgc29tZXRoaW5nIHRvIGRvLi4uCi0gICAgICAgICAgICAgICAgTE9HVigiQXVkaW8gaGFyZHdhcmUgZW50ZXJpbmcgc3RhbmRieSwgb3V0cHV0ICVkXG4iLCBtT3V0cHV0VHlwZSk7Ci0gICAgICAgICAgICAgICAgaWYgKCFtU3RhbmRieSkgewotICAgICAgICAgICAgICAgICAgICBtT3V0cHV0LT5zdGFuZGJ5KCk7Ci0gICAgICAgICAgICAgICAgICAgIG1TdGFuZGJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCi0jaWZkZWYgV0lUSF9BMkRQCi0gICAgICAgICAgICAgICAgaWYgKG91dHB1dFRyYWNrQWN0aXZlKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1BdWRpb0ZsaW5nZXItPm1Mb2NrLnVubG9jaygpOwotICAgICAgICAgICAgICAgICAgICBtT3V0cHV0VHJhY2stPnN0b3AoKTsKLSAgICAgICAgICAgICAgICAgICAgbUF1ZGlvRmxpbmdlci0+bUxvY2subG9jaygpOwotICAgICAgICAgICAgICAgICAgICBvdXRwdXRUcmFja0FjdGl2ZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSNlbmRpZgotICAgICAgICAgICAgICAgIGlmIChtT3V0cHV0VHlwZSA9PSBBdWRpb1N5c3RlbTo6QVVESU9fT1VUUFVUX0hBUkRXQVJFKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1BdWRpb0ZsaW5nZXItPmhhbmRsZUZvcmNlZFNwZWFrZXJSb3V0ZShGT1JDRV9ST1VURV9SRVNUT1JFKTsKLSAgICAgICAgICAgICAgICB9ICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIC8vIHdlJ3JlIGFib3V0IHRvIHdhaXQsIGZsdXNoIHRoZSBiaW5kZXIgY29tbWFuZCBidWZmZXIKLSAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5mbHVzaENvbW1hbmRzKCk7Ci0gICAgICAgICAgICAgICAgbUF1ZGlvRmxpbmdlci0+bVdhaXRXb3JrQ1Yud2FpdChtQXVkaW9GbGluZ2VyLT5tTG9jayk7Ci0gICAgICAgICAgICAgICAgTE9HVigiQXVkaW8gaGFyZHdhcmUgZXhpdGluZyBzdGFuZGJ5LCBvdXRwdXQgJWRcbiIsIG1PdXRwdXRUeXBlKTsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBpZiAobU1hc3Rlck11dGUgPT0gZmFsc2UpIHsKLSAgICAgICAgICAgICAgICAgICAgY2hhciB2YWx1ZVtQUk9QRVJUWV9WQUxVRV9NQVhdOwotICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eV9nZXQoInJvLmF1ZGlvLnNpbGVudCIsIHZhbHVlLCAiMCIpOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXRvaSh2YWx1ZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExPR0QoIlNpbGVuY2UgaXMgZ29sZGVuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZXRNYXN0ZXJNdXRlKHRydWUpOwotICAgICAgICAgICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgc3RhbmRieVRpbWUgPSBzeXN0ZW1UaW1lKCkgKyBrU3RhbmRieVRpbWVJbk5zZWNzOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBGb3JjZWQg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eSgpIHx8IHRyYWNrLT5pc1N0b3BwZWQoKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICF0cmFjay0+aXNQYXVzZWQoKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8vTE9HVigidHJhY2sgJWQgdT0lMDh4LCBzPSUwOHggW09LXSIsIHRyYWNrLT5uYW1lKCksIGNibGstPnVzZXIsIGNibGstPnNlcnZlcik7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gY29tcHV0ZSB2b2x1bWUgZm9yIHRoaXMgdHJhY2sKLSAgICAgICAgICAgICAgICAgICAgaW50MTZfdCBsZWZ0LCByaWdodDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRyYWNrLT5pc011dGVkKCkgfHwgbU1hc3Rlck11dGUgfHwgdHJhY2stPmlzUGF1c2luZygpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gcmlnaHQgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYWNrLT5pc1BhdXNpbmcoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoInBhdXNlZCglZCkiLCB0cmFjay0+bmFtZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+c2V0UGF1c2VkKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB0eXBlVm9sdW1lID0gbVN0cmVhbVR5cGVzW3RyYWNrLT50eXBlKCldLnZvbHVtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHYgPSBtTWFzdGVyVm9sdW1lICogdHlwZVZvbHVtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHZfY2xhbXBlZCA9IHYgKiBjYmxrLT52b2x1bWVbMF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodl9jbGFtcGVkID4gTUFYX0dBSU4pIHZfY2xhbXBlZCA9IE1BWF9HQUlOOwotICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA9IGludDE2X3Qodl9jbGFtcGVkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZfY2xhbXBlZCA9IHYgKiBjYmxrLT52b2x1bWVbMV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodl9jbGFtcGVkID4gTUFYX0dBSU4pIHZfY2xhbXBlZCA9IE1BWF9HQUlOOwotICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSBpbnQxNl90KHZfY2xhbXBlZCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAvLyBYWFg6IHRoZXNlIHRoaW5ncyBET04nVCBuZWVkIHRvIGJlIGRvbmUgZWFjaCB0aW1lCi0gICAgICAgICAgICAgICAgICAgIG1BdWRpb01peGVyLT5zZXRCdWZmZXJQcm92aWRlcih0cmFjayk7Ci0gICAgICAgICAgICAgICAgICAgIG1BdWRpb01peGVyLT5lbmFibGUoQXVkaW9NaXhlcjo6TUlYSU5HKTsKLQotICAgICAgICAgICAgICAgICAgICBpbnQgcGFyYW07Ci0gICAgICAgICAgICAgICAgICAgIGlmICggdHJhY2stPm1GaWxsaW5nVXBTdGF0dXMgPT0gVHJhY2s6OkZTX0ZJTExFRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm8gcmFtcCBmb3IgdGhlIGZpcnN0IHZvbHVtZSBzZXR0aW5nCi0gICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+bUZpbGxpbmdVcFN0YXR1cyA9IFRyYWNrOjpGU19BQ1RJVkU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2stPm1TdGF0ZSA9PSBUcmFja0Jhc2U6OlJFU1VNSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2stPm1TdGF0ZSA9IFRyYWNrQmFzZTo6QUNUSVZFOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtID0gQXVkaW9NaXhlcjo6UkFNUF9WT0xVTUU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtID0gQXVkaW9NaXhlcjo6Vk9MVU1FOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0gPSBBdWRpb01peGVyOjpSQU1QX1ZPTFVNRTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtQXVkaW9NaXhlci0+c2V0UGFyYW1ldGVyKHBhcmFtLCBBdWRpb01peGVyOjpWT0xVTUUwLCBsZWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPnNldFBhcmFtZXRlcihwYXJhbSwgQXVkaW9NaXhlcjo6Vk9MVU1FMSwgcmlnaHQpOwotICAgICAgICAgICAgICAgICAgICBtQXVkaW9NaXhlci0+c2V0UGFyYW1ldGVyKAotICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9NaXhlcjo6VFJBQ0ssCi0gICAgICAgICAgICAgICAgICAgICAgICBBdWRpb01peGVyOjpGT1JNQVQsIHRyYWNrLT5mb3JtYXQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1BdWRpb01peGVyLT5zZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICBBdWRpb01peGVyOjpUUkFDSywKLSAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OkNIQU5ORUxfQ09VTlQsIHRyYWNrLT5jaGFubmVsQ291bnQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1BdWRpb01peGVyLT5zZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICBBdWRpb01peGVyOjpSRVNBTVBMRSwKLSAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OlNBTVBMRV9SQVRFLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50KGNibGstPnNhbXBsZVJhdGUpKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyByZXNldCByZXRyeSBjb3VudAotICAgICAgICAgICAgICAgICAgICB0cmFjay0+bVJldHJ5Q291bnQgPSBrTWF4VHJhY2tSZXRyaWVzOwotICAgICAgICAgICAgICAgICAgICBlbmFibGVkVHJhY2tzKys7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy9MT0dWKCJ0cmFjayAlZCB1PSUwOHgsIHM9JTA4eCBbTk9UIFJFQURZXSIsIHRyYWNrLT5uYW1lKCksIGNibGstPnVzZXIsIGNibGstPnNlcnZlcik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0cmFjay0+aXNTdG9wcGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrLT5yZXNldCgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0cmFjay0+aXNUZXJtaW5hdGVkKCkgfHwgdHJhY2stPmlzU3RvcHBlZCgpIHx8IHRyYWNrLT5pc1BhdXNlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIGNvbnN1bWVkIGFsbCB0aGUgYnVmZmVycyBvZiB0aGlzIHRyYWNrLgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIGl0IGZyb20gdGhlIGxpc3Qgb2YgYWN0aXZlIHRyYWNrcy4KLSAgICAgICAgICAgICAgICAgICAgICAgIExPR1YoInJlbW92ZSglZCkgZnJvbSBhY3RpdmUgbGlzdCIsIHRyYWNrLT5uYW1lKCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2tzVG9SZW1vdmUuYWRkKHRyYWNrKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vIGJ1ZmZlcnMgZm9yIHRoaXMgdHJhY2suIEdpdmUgaXQgYSBmZXcgY2hhbmNlcyB0bwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmlsbCBhIGJ1ZmZlciwgdGhlbiByZW1vdmUgaXQgZnJvbSBhY3RpdmUgbGlzdC4KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgtLSh0cmFjay0+bVJldHJ5Q291bnQpIDw9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0dWKCJCVUZGRVIgVElNRU9VVDogcmVtb3ZlKCVkKSBmcm9tIGFjdGl2ZSBsaXN0IiwgdHJhY2stPm5hbWUoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2tzVG9SZW1vdmUuYWRkKHRyYWNrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAvLyBMT0dWKCJkaXNhYmxlKCVkKSIsIHRyYWNrLT5uYW1lKCkpOwotICAgICAgICAgICAgICAgICAgICBtQXVkaW9NaXhlci0+ZGlzYWJsZShBdWRpb01peGVyOjpNSVhJTkcpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gcmVtb3ZlIGFsbCB0aGUgdHJhY2tzIHRoYXQgbmVlZCB0byBiZS4uLgotICAgICAgICAgICAgY291bnQgPSB0cmFja3NUb1JlbW92ZS5zaXplKCk7Ci0gICAgICAgICAgICBpZiAoVU5MSUtFTFkoY291bnQpKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaT0wIDsgaTxjb3VudCA7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxUcmFjaz4mIHRyYWNrID0gdHJhY2tzVG9SZW1vdmVbaV07Ci0gICAgICAgICAgICAgICAgICAgIHJlbW92ZUFjdGl2ZVRyYWNrX2wodHJhY2spOwotICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2stPmlzVGVybWluYXRlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVHJhY2tzLnJlbW92ZSh0cmFjayk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVUcmFja05hbWVfbCh0cmFjay0+bU5hbWUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGlmIChMSUtFTFkoZW5hYmxlZFRyYWNrcykpIHsKLSAgICAgICAgICAgIC8vIG1peCBidWZmZXJzLi4uCi0gICAgICAgICAgICBtQXVkaW9NaXhlci0+cHJvY2VzcyhjdXJCdWYpOwotCi0jaWZkZWYgV0lUSF9BMkRQCi0gICAgICAgICAgICBpZiAobU91dHB1dFRyYWNrICE9IE5VTEwgJiYgbUF1ZGlvRmxpbmdlci0+aXNBMmRwRW5hYmxlZCgpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFvdXRwdXRUcmFja0FjdGl2ZSkgewotICAgICAgICAgICAgICAgICAgICBMT0dWKCJzdGFydGluZyBvdXRwdXQgdHJhY2sgaW4gbWl4ZXIgZm9yIG91dHB1dCAlZCIsIG1PdXRwdXRUeXBlKTsKLSAgICAgICAgICAgICAgICAgICAgbU91dHB1dFRyYWNrLT5zdGFydCgpOwotICAgICAgICAgICAgICAgICAgICBvdXRwdXRUcmFja0FjdGl2ZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1PdXRwdXRUcmFjay0+d3JpdGUoY3VyQnVmLCBtRnJhbWVDb3VudCk7Ci0gICAgICAgICAgICB9Ci0jZW5kaWYKLQotICAgICAgICAgICAgLy8gb3V0cHV0IGF1ZGlvIHRvIGhhcmR3YXJlCi0gICAgICAgICAgICBtTGFzdFd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0gICAgICAgICAgICAgICAgICAgICAgICBtT3V0cHV0VHJhY2stPnN0b3AoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFRyYWNrQWN0aXZlID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGFuZGJ5VGltZSA9IHN5c3RlbVRpbWUoKSArIGtTdGFuZGJ5VGltZUluTnNlY3M7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0jZW5kaWYKLSAgICAgICAgICAgIC8vIFRoZXJlIHdhcyBub3RoaW5nIHRvIG1peCB0aGlzIHJvdW5kLCB3aGljaCBtZWFucyBhbGwKLSAgICAgICAgICAgIC8vIGFjdGl2ZSB0cmFja3Mgd2VyZSBsYXRlLiBTbGVlcCBhIGxpdHRsZSBiaXQgdG8gZ2l2ZQotICAgICAgICAgICAgLy8gdGhlbSBhbm90aGVyIGNoYW5jZS4gSWYgd2UncmUgdG9vIGxhdGUsIHRoZSBhdWRpbwotICAgICAgICAgICAgLy8gaGFyZHdhcmUgd2lsbCB6ZXJvLWZpbGwgZm9yIHVzLgotICAgICAgICAgICAgLy9MT0dWKCJubyBidWZmZXJzIC0gdXNsZWVwKCVsdSkiLCBzbGVlcFRpbWUpOwotICAgICAgICAgICAgdXNsZWVwKHNsZWVwVGltZSk7Ci0gICAgICAgICAgICBpZiAoc2xlZXBUaW1lIDwga01heEJ1ZmZlclJlY292ZXJ5SW5Vc2VjcykgewotICAgICAgICAgICAgICAgIHNsZWVwVGltZSArPSBrQnVmZmVyUmVjb3ZlcnlJblVzZWNzOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gZmluYWxseSBsZXQgZ28gb2YgYWxsIG91ciB0cmFja3MsIHdpdGhvdXQgdGhlIGxvY2sgaGVsZAotICAgICAgICAvLyBzaW5jZSB3ZSBjYW4ndCBnd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IFNvcnRlZFZlY3RvciA8IHdwPFRyYWNrPiA+JiBhY3RpdmVUcmFja3MpCi17Ci0gICAgc2l6ZV90IHNpemUgPSBtVHJhY2tzLnNpemUoKTsKLSAgICBMT0dWICgiTWl4ZXJUaHJlYWQ6OmdldFRyYWNrc19sKCkgZm9yIG91dHB1dCAlZCwgbVRyYWNrcy5zaXplICVkLCBtQWN0aXZlVHJhY2tzLnNpemUgJWQiLCBtT3V0cHV0VHlwZSwgIG1UcmFja3Muc2l6ZSgpLCBtQWN0aXZlVHJhY2tzLnNpemUoKSk7Ci0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKLSAgICAgICAgc3A8VHJhY2s+IHQgPSBtVHJhY2tzW2ldOwotICAgICAgICBpZiAoQXVkaW9TeXN0ZW06OnJvdXRlZFRvQTJkcE91dHB1dCh0LT5tU3RyZWFtVHlwZSkpIHsKLSAgICAgICAgICAgIHRyYWNrcy5hZGQodCk7Ci0gICAgICAgICAgICBpbnQgaiA9IG1BY3RpdmVUcmFja3MuaW5kZXhPZih0KTsKLSAgICAgICAgICAgIGlmIChqID49IDApIHsKLSAgICAgICAgICAgICAgICB0ID0gbUFjdGl2ZVRyYWNrc1tqXS5wcm9tb3RlKCk7Ci0gICAgICAgICAgICAgICAgaWYgKHQgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBhY3RpdmVUcmFja3MuYWRkKHQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBzaXplID0gYWN0aXZlVHJhY2tzLnNpemUoKTsKLSAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHNpemU7IGkrKykgewotICAgICAgICByZW1vdmVBY3RpdmVUcmFja19sKGFjdGl2ZVRyYWNrc1tpXSk7Ci0gICAgfQotICAgIA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aXZlVHJhY2tzLnNpemUoKSAmJiBzeXN0ZW1UaW1lKCkgPiBzdGFuZGJ5VGltZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TdXNwZW5kZWQpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW1TdGFuZGJ5KSB7CisgICAgICAgICAgICAgICAgICAgIExPR1YoIkF1ZGlvIGhhcmR3YXJlIGVudGVyaW5nIHN0YW5kYnksIG1peGVyICVwLCBtU3VzcGVuZGVkICVkXG4iLCB0aGlzLCBtU3VzcGVuZGVkKTsKKyAgICAgICAgICAgICAgICAgICAgbU91dHB1dC0+c3RhbmRieSgpOworICAgICAgICAgICAgICAgICAgICBtU3RhbmRieSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG1CeXRlc1dyaXR0ZW4gPSAwOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICghYWN0aXZlVHJhY2tzLnNpemUoKSAmJiBtQ29uZmlnRXZlbnRzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgICAgICAvLyB3ZSdyZSBhYm91dCB0byB3YWl0LCBmbHVzaCB0aGUgYmluZGVyIGNvbW1hbmQgYnVmZmVyCisgICAgICAgICAgICAgICAgICAgIElQQ1RocmVhZFN0YXRlOjpzZWxmKCktPmZsdXNoQ29tbWFuZHMoKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoZXhpdFBlbmRpbmcoKSkgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gd2FpdCB1bnRpbCB3ZSBoYXZlIHNvbWV0aGluZyB0byBkby4uLgorICAgICAgICAgICAgICAgICAgICBMT0dWKCJNaXhlclRocmVhZCAlcCBUSUQgJWQgZ29pbmcgdG8gc2xlZXBcbiIsIHRoaXMsIGdldHRpZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7CisgICAgICAgICAgICAgICAgICAgIExPR1YoIk1peGVyVGhyZWFkICVwIFRJRCAlZCB3YWtpbmcgdXBcbiIsIHRoaXMsIGdldHRpZCgpKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAobU1hc3Rlck11dGUgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgdmFsdWVbUFJPUEVSVFlfVkFMVUVfTUFYXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5X2dldCgicm8uYXVkaW8uc2lsZW50IiwgdmFsdWUsICIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXRvaSh2YWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0dEKCJTaWxlbmNlIGlzIGdvbGRlbiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldE1hc3Rlck11dGUodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBzdGFuZGJ5VGltZSA9IHN5c3RlbVRpbWUoKSArIGtTdGFuZGJ5VGltZUluTnNlY3M7CisgICAgICAgICAgICAgICAgICAgIHNsZWVwVGltZSA9IDA7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZW5hYmxlZFRyYWNrcyA9IHByZXBhcmVUcmFja3NfbChhY3RpdmVUcmFja3MsICZ0cmFja3NUb1JlbW92ZSk7CisgICAgICAgfQorCisKKyAgICAgICAgLy8gb3V0cHV0IGF1ZGlvIHRvIGhhcmR3YXJlCisgICAgICAgIGlmIChtU3VzcGVuZGVkKSB7CisgICAgICAgICAgICB1c2xlZXAoa01heEJ1ZmZlclJlY292ZXJ5SW5Vc2Vjcyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoTElLRUxZKGVuYWJsZWRUcmFja3MpKSB7CisgICAgICAgICAgICAgICAgLy8gbWl4IGJ1ZmZlcnMuLi4KKyAgICAgICAgICAgICAgICBtQXVkaW9NaXhlci0+cHJvY2VzcyhjdXJCdWYpOworICAgICAgICAgICAgICAgIHNsZWVwVGltZSA9IDA7CisgICAgICAgICAgICAgICAgc3RhbmRieVRpbWUgPSBzeXN0ZW1UaW1lKCkgKyBrU3RhbmRieVRpbWVJbk5zZWNzOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzbGVlcFRpbWUgKz0ga0J1ZmZlclJlY292ZXJ5SW5Vc2VjczsKKyAgICAgICAgICAgICAgICAvLyBUaGVyZSB3YXMgbm90aGluZyB0byBtaXggdGhpcyByb3VuZCwgd2hpY2ggbWVhbnMgYWxsCisgICAgICAgICAgICAgICAgLy8gYWN0aXZlIHRyYWNrcyB3ZXJlIGxhdGUuIFNsZWVwIGEgbGl0dGxlIGJpdCB0byBnaXZlCisgICAgICAgICAgICAgICAgLy8gdGhlbSBhbm90aGVyIGNoYW5jZS4gSWYgd2UncmUgdG9vIGxhdGUsIHdyaXRlIDBzIHRvIGF1ZGlvCisgICAgICAgICAgICAgICAgLy8gaGFyZHdhcmUgdG8gYXZvaWQgdW5kZXJydW4uCisgICAgICAgICAgICAgICAgaWYgKHNsZWVwVGltZSA8IGtNYXhCdWZmZXJSZWNvdmVyeUluVXNlY3MpIHsKKyAgICAgICAgICAgICAgICAgICAgdXNsZWVwKGtCdWZmZXJSZWNvdmVyeUluVXNlY3MpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1lbXNldCAoY3VyQnVmLCAwLCBtaXhCdWZmZXJTaXplKTsKKyAgICAgICAgICAgICAgICAgICAgc2xlZXBUaW1lID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBzbGVlcFRpbWUgPT0gMCBtZWFucyBQQ00gZGF0YSB3ZXJlIHdyaXR0ZW4gdG8gbU1peEJ1ZmZlcltdCisgICAgICAgICAgICBpZiAoc2xlZXBUaW1lID09IDApIHsKKyAgICAgICAgICAgICAgICBtTGFzdFdyaXRlVGltZSA9IHN5c3RlbVRpbWUoKTsKKyAgICAgICAgICAgICAgICBtSW5Xcml0ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgaW50IGJ5dGVzV3JpdHRlbiA9IChpbnQpbU91dHB1dC0+d3JpdGUoY3VyQnVmLCBtaXhCdWZmZXJTaXplKTsKKyAgICAgICAgICAgICAgICBpZiAoYnl0ZXNXcml0dGVuID4gMCkgbUJ5dGVzV3JpdHRlbiArPSBieXRlc1dyaXR0ZW47CisgICAgICAgICAgICAgICAgbU51bVdyaXRlcysrOworICAgICAgICAgICAgICAgIG1JbldyaXRlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgbVN0YW5kYnkgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBuc2Vjc190IGRlbHRhID0gc3lzdGVtVGltZSgpIC0gbUxhc3RXcml0ZVRpbWU7CisgICAgICAgICAgICAgICAgaWYgKGRlbHRhID4gbWF4UGVyaW9kKSB7CisgICAgICAgICAgICAgICAgICAgIExPR1coIndyaXRlIGJsb2NrZWQgZm9yICVsbHUgbXNlY3MiLCBuczJtcyhkZWx0YSkpOworICAgICAgICAgICAgICAgICAgICBtTnVtRGVsYXllZFdyaXRlcysrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGZpbmFsbHkgbGV0IGdvIG9mIGFsbCBvdXIgdHJhY2tzLCB3aXRob3V0IHRoZSBsb2NrIGhlbGQKKyAgICAgICAgLy8gc2luY2Ugd2UgY2FuJ3QgZ3VhcmFudGVlIHRoZSBkZXN0cnVjdG9ycyB3b24ndCBhY3F1aXJlIHRoYXQKKyAgICAgICAgLy8gc2FtZSBsb2NrLgorICAgICAgICB0cmFja3NUb1JlbW92ZS5jbGVhcigpOworICAgIH0KKworICAgIGlmICghbVN0YW5kYnkpIHsKKyAgICAgICAgbU91dHB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ZXNzaW5nIGl0CisgICAgICAgIG1BdWRpb01peGVyLT5zZXRBY3RpdmVUcmFjayh0cmFjay0+bmFtZSgpKTsKKyAgICAgICAgaWYgKGNibGstPmZyYW1lc1JlYWR5KCkgJiYgKHRyYWNrLT5pc1JlYWR5KCkgfHwgdHJhY2stPmlzU3RvcHBlZCgpKSAmJgorICAgICAgICAgICAgICAgICF0cmFjay0+aXNQYXVzZWQoKSkKKyAgICAgICAgeworICAgICAgICAgICAgLy9MT0dWKCJ0cmFjayAlZCB1PSUwOHgsIHM9JTA4eCBbT0tdIiwgdHJhY2stPm5hbWUoKSwgY2Jsay0+dXNlciwgY2Jsay0+c2VydmVyKTsKKworICAgICAgICAgICAgLy8gY29tcHV0ZSB2b2x1bWUgZm9yIHRoaXMgdHJhY2sKKyAgICAgICAgICAgIGludDE2X3QgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICBpZiAodHJhY2stPmlzTXV0ZWQoKSB8fCBtTWFzdGVyTXV0ZSB8fCB0cmFjay0+aXNQYXVzaW5nKCkgfHwKKyAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZXNbdHJhY2stPnR5cGUoKV0ubXV0ZSkgeworICAgICAgICAgICAgICAgIGxlZnQgPSByaWdodCA9IDA7CisgICAgICAgICAgICAgICAgaWYgKHRyYWNrLT5pc1BhdXNpbmcoKSkgeworICAgICAgICAgICAgICAgICAgICB0cmFjay0+c2V0UGF1c2VkKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmbG9hdCB0eXBlVm9sdW1lID0gbVN0cmVhbVR5cGVzW3RyYWNrLT50eXBlKCldLnZvbHVtZTsKKyAgICAgICAgICAgICAgICBmbG9hdCB2ID0gbU1hc3RlclZvbHVtZSAqIHR5cGVWb2x1bWU7CisgICAgICAgICAgICAgICAgZmxvYXQgdl9jbGFtcGVkID0gdiAqIGNibGstPnZvbHVtZVswXTsKKyAgICAgICAgICAgICAgICBpZiAodl9jbGFtcGVkID4gTUFYX0dBSU4pIHZfY2xhbXBlZCA9IE1BWF9HQUlOOworICAgICAgICAgICAgICAgIGxlZnQgPSBpbnQxNl90KHZfY2xhbXBlZCk7CisgICAgICAgICAgICAgICAgdl9jbGFtcGVkID0gdiAqIGNibGstPnZvbHVtZVsxXTsKKyAgICAgICAgICAgICAgICBpZiAodl9jbGFtcGVkID4gTUFYX0dBSU4pIHZfY2xhbXBlZCA9IE1BWF9HQUlOOworICAgICAgICAgICAgICAgIHJpZ2h0ID0gaW50MTZfdCh2X2NsYW1wZWQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBYWFg6IHRoZXNlIHRoaW5ncyBET04nVCBuZWVkIHRvIGJlIGRvbmUgZWFjaCB0aW1lCisgICAgICAgICAgICBtQXVkaW9NaXhlci0+c2V0QnVmZmVyUHJvdmlkZXIodHJhY2spOworICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPmVuYWJsZShBdWRpb01peGVyOjpNSVhJTkcpOworCisgICAgICAgICAgICBpbnQgcGFyYW0gPSBBdWRpb01peGVyOjpWT0xVTUU7CisgICAgICAgICAgICBpZiAodHJhY2stPm1GaWxsaW5nVXBTdGF0dXMgPT0gVHJhY2s6OkZTX0ZJTExFRCkgeworICAgICAgICAgICAgICAgIC8vIG5vIHJhbXAgZm9yIHRoZSBmaXJzdCB2b2x1bWUgc2V0dGluZworICAgICAgICAgICAgICAgIHRyYWNrLT5tRmlsbGluZ1VwU3RhdHVzID0gVHJhY2s6OkZTX0FDVElWRTsKKyAgICAgICAgICAgICAgICBpZiAodHJhY2stPm1TdGF0ZSA9PSBUcmFja0Jhc2U6OlJFU1VNSU5HKSB7CisgICAgICAgICAgICAgICAgICAgIHRyYWNrLT5tU3RhdGUgPSBUcmFja0Jhc2U6OkFDVElWRTsKKyAgICAgICAgICAgICAgICAgICAgcGFyYW0gPSBBdWRpb01peGVyOjpSQU1QX1ZPTFVNRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKGNibGstPnNlcnZlciAhPSAwKSB7CisgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHRyYWNrIGlzIHN0b3BwZWQgYmVmb3JlIHRoZSBmaXJzdCBmcmFtZSB3YXMgbWl4ZWQsCisgICAgICAgICAgICAgICAgLy8gZG8gbm90IGFwcGx5IHJhbXAKKyAgICAgICAgICAgICAgICBwYXJhbSA9IEF1ZGlvTWl4ZXI6OlJBTVBfVk9MVU1FOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtQXVkaW9NaXhlci0+c2V0UGFyYW1ldGVyKHBhcmFtLCBBdWRpb01peGVyOjpWT0xVTUUwLCBsZWZ0KTsKKyAgICAgICAgICAgIG1BdWRpb01peGVyLT5zZXRQYXJhbWV0ZXIocGFyYW0sIEF1ZGlvTWl4ZXI6OlZPTFVNRTEsIHJpZ2h0KTsKKyAgICAgICAgICAgIG1BdWRpb01peGVyLT5zZXRQYXJhbWV0ZXIoCisgICAgICAgICAgICAgICAgQXVkaW9NaXhlcjo6VFJBQ0ssCisgICAgICAgICAgICAgICAgQXVkaW9NaXhlcjo6Rk9STUFULCB0cmFjay0+Zm9ybWF0KCkpOworICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPnNldFBhcmFtZXRlcigKKyAgICAgICAgICAgICAgICBBdWRpb01peGVyOjpUUkFDSywKKyAgICAgICAgICAgICAgICBBdWRpb01peGVyOjpDSEFOTkVMX0NPVU5ULCB0cmFjay0+Y2hhbm5lbENvdW50KCkpOworICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPnNldFBhcmFtZXRlcigKKyAgICAgICAgICAgICAgICBBdWRpb01peGVyOjpSRVNBTVBMRSwKKyAgICAgICAgICAgICAgICBBdWRpb01peGVyOjpTQU1QTEVfUkFURSwKKyAgICAgICAgICAgICAgICBpbnQoY2Jsay0+c2FtcGxlUmF0ZSkpOworCisgICAgICAgICAgICAvLyByZXNldCByZXRyeSBjb3VudAorICAgICAgICAgICAgdHJhY2stPm1SZXRyeUNvdW50ID0ga01heFRyYWNrUmV0cmllczsKKyAgICAgICAgICAgIGVuYWJsZWRUcmFja3MrKzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vTE9HVigidHJhY2sgJWQgdT0lMDh4LCBzPSUwOHggW05PVCBSRUFEWV0iLCB0cmFjay0+bmFtZSgpLCBjYmxrLT51c2VyLCBjYmxrLT5zZXJ2ZXIpOworICAgICAgICAgICAgaWYgKHRyYWNrLT5pc1N0b3BwZWQoKSkgeworICAgICAgICAgICAgICAgIHRyYWNrLT5yZXNldCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHRyYWNrLT5pc1Rlcm1pbmF0ZWQoKSB8fCB0cmFjay0+aXNTdG9wcGVkKCkgfHwgdHJhY2stPmlzUGF1c2VkKCkpIHsKKyAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIGNvbnN1bWVkIGFsbCB0aGUgYnVmZmVycyBvZiB0aGlzIHRyYWNrLgorICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBpdCBmcm9tIHRoZSBsaXN0IG9mIGFjdGl2ZSB0cmFja3MuCisgICAgICAgICAgICAgICAgdHJhY2tzVG9SZW1vdmUtPmFkZCh0cmFjayk7CisgICAgICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPmRpc2FibGUoQXVkaW9NaXhlcjo6TUlYSU5HKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gTm8gYnVmZmVycyBmb3IgdGhpcyB0cmFjay4gR2l2ZSBpdCBhIGZldyBjaGFuY2VzIHRvCisgICAgICAgICAgICAgICAgLy8gZmlsbCBhIGJ1ZmZlciwgdGhlbiByZW1vdmUgaXQgZnJvbSBhY3RpdmUgbGlzdC4KKyAgICAgICAgICAgICAgICBpZiAoLS0odHJhY2stPm1SZXRyeUNvdW50KSA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIExPR1YoIkJVRkZFUiBUSU1FT1VUOiByZW1vdmUoJWQpIGZyb20gYWN0aXZlIGxpc3QiLCB0cmFjay0+bmFtZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgdHJhY2tzVG9SZW1vdmUtPmFkZCh0cmFjayk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIEZvciB0cmFja3MgdXNpbmcgc3RhdGljIHNoYXJlZCBtZW1vcnkgYnVmZmVyLCBtYWtlIHN1cmUgdGhhdCB3ZSBoYXZlCisgICAgICAgICAgICAgICAgLy8gd3JpdHRlbiBlbm91Z2ggZGF0YSB0byBhdWRpbyBoYXJkd2FyZSBiZWZvcmUgZGlzYWJsaW5nIHRoZSB0cmFjaworICAgICAgICAgICAgICAgIC8vIE5PVEU6IHRoaXMgY29uZGl0aW9uIHdpdGggYXJyaXZlIGJlZm9yZSB0cmFjay0+bVJldHJ5Q291bnQgPD0gMCBzbyB3ZQorICAgICAgICAgICAgICAgIC8vIGRvbid0IGNhcmUgYWJvdXQgY29kZSByZW1vdmluZyB0cmFjayBmcm9tIGFjdGl2ZSBsaXN0IGFib3ZlLgorICAgICAgICAgICAgICAgIGlmICgodHJhY2stPm1TaGFyZWRCdWZmZXIgPT0gMCkgfHwgKG1CeXRlc1dyaXR0ZW4gPj0gbU1pbkJ5dGVzVG9Xcml0ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPmRpc2FibGUoQXVkaW9NaXhlcjo6TUlYSU5HKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBlbmFibGVkVHJhY2tzKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLy8gcmVtb3ZlIGFsbCB0aGUgdHJhY2tzIHRoYXQgbmVlZCB0byBiZS4uLgorICAgIGNvdW50ID0gdHJhY2tzVG9SZW1vdmUtPnNpemUoKTsKKyAgICBpZiAoVU5MSUtFTFkoY291bnQpKSB7CisgICAgICAgIGZvciAoc2l6ZV90IGk9MCA7IGk8Y291bnQgOyBpKyspIHsKKyAgICAgICAgICAgIGNvbnN0IHNwPFRyYWNrPiYgdHJhY2sgPSB0cmFja3NUb1JlbW92ZS0+aXRlbUF0KGkpOworICAgICAgICAgICAgbUFjdGl2ZVRyYWNrcy5yZW1vdmUodHJhY2spOworICAgICAgICAgICAgaWYgKHRyYWNrLT5pc1Rlcm1pbmF0ZWQoKSkgeworICAgICAgICAgICAgICAgIG1UcmFja3MucmVtb3ZlKHRyYWNrKTsKKyAgICAgICAgICAgICAgICBkZWxldGVUcmFja05hbWVfbCh0cmFjay0+bU5hbWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGVuYWJsZWRUcmFja3M7Cit9CisKK3ZvaWQgQXVkaW9GbGluZ2VyOjpNaXhlclRocmVhZDo6Z2V0VHJhY2tzKAorICAgICAgICBTb3J0ZWRWZWN0b3IgPCBzcDxUcmFjaz4gPiYgdHJhY2tzLAorICAgICAgICBTb3J0ZWRWZWN0b3IgPCB3cDxUcmFjaz4gPiYgYWN0aXZlVHJhY2tzLAorICAgICAgICBpbnQgc3RyZWFtVHlwZSkKK3sKKyAgICBMT0dWICgiTWl4ZXJUaHJlYWQ6OmdldFRyYWNrcygpIG1peGVyICVwLCBtVHJhY2tzLnNpemUgJWQsIG1BY3RpdmVUcmFja3Muc2l6ZSAlZCIsIHRoaXMsICBtVHJhY2tzLnNpemUoKSwgbUFjdGl2ZVRyYWNrcy5zaXplKCkpOworICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisgICAgc2l6ZV90IHNpemUgPSBtVHJhY2tzLnNpemUoKTsKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHNpemU7IGkrKykgeworICAgICAgICBzcDxUcmFjaz4gdCA9IG1UcmFja3NbaV07CisgICAgICAgIGlmICh0LT50eXBlKCkgPT0gc3RyZWFtVHlwZSkgeworICA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ChwYXJhbS5nZXRJbnQoU3RyaW5nOChBdWRpb1BhcmFtZXRlcjo6a2V5U2FtcGxpbmdSYXRlKSwgdmFsdWUpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICByZWNvbmZpZyA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBhcmFtLmdldEludChTdHJpbmc4KEF1ZGlvUGFyYW1ldGVyOjprZXlGb3JtYXQpLCB2YWx1ZSkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVCkgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJBRF9WQUxVRTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmVjb25maWcgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChwYXJhbS5nZXRJbnQoU3RyaW5nOChBdWRpb1BhcmFtZXRlcjo6a2V5Q2hhbm5lbHMpLCB2YWx1ZSkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBBdWRpb1N5c3RlbTo6Q0hBTk5FTF9PVVRfU1RFUkVPKSB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gQkFEX1ZBTFVFOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZWNvbmZpZyA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBhcmFtLmdldEludChTdHJpbmc4KEF1ZGlvUGFyYW1ldGVyOjprZXlGcmFtZUNvdW50KSwgdmFsdWUpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAvLyBkbyBub3QgYWNjZXB0IGZyYW1lIGNvdW50IGNoYW5nZXMgaWYgdHJhY2tzIGFyZSBvcGVuIGFzIHRoZSB0cmFjayBidWZmZXIKKyAgICAgICAgICAgIC8vIHNpemUgZGVwZW5kcyBvbiBmcmFtZSBjb3VudCBhbmQgY29ycmVjdCBiZWhhdmlvciB3b3VsZCBub3QgYmUgZ2FyYW50aWVkCisgICAgICAgICAgICAvLyBpZiBmcmFtZSBjb3VudCBpcyBjaGFuZ2VkIGFmdGVyIHRyYWNrIGNyZWF0aW9uCisgICAgICAgICAgICBpZiAoIW1UcmFja3MuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gSU5WQUxJRF9PUEVSQVRJT047CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJlY29uZmlnID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICBzdGF0dXMgPSBtT3V0cHV0LT5zZXRQYXJhbWV0ZXJzKGtleVZhbHVlUGFpcik7CisgICAgICAgICAgICBpZiAoIW1TdGFuZGJ5ICYmIHN0YXR1cyA9PSBJTlZBTElEX09QRVJBVElPTikgeworICAgICAgICAgICAgICAgbU91dHB1dC0+c3RhbmRieSgpOworICAgICAgICAgICAgICAgbVN0YW5kYnkgPSB0cnVlOworICAgICAgICAgICAgICAgbUJ5dGVzV3JpdHRlbiA9IDA7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBtT3V0cHV0LT5zZXRQYXJhbWV0ZXJzKGtleVZhbHVlUGFpcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SICYmIHJlY29uZmlnKSB7CisgICAgICAgICAgICAgICAgZGVsZXRlIG1BdWRpb01peGVyOworICAgICAgICAgICAgICAgIHJlYWRPdXRwdXRQYXJhbWV0ZXJzKCk7CisgICAgICAgICAgICAgICAgbUF1ZGlvTWl4ZXIgPSBuZXcgQXVkaW9NaXhlcihtRnJhbWVDb3VudCwgbVNhbXBsZVJhdGUpOworICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbVRyYWNrcy5zaXplKCkgOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IG5hbWUgPSBnZXRUcmFja05hbWVfbCgpOworICAgICAgICAgICAgICAgICAgICBpZiAobmFtZSA8IDApIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBtVHJhY2tzW2ldLT5tTmFtZSA9IG5hbWU7CisgICAgICAgICAgICAgICAgICAgIC8vIGxpbWl0IHRyYWNrIHNhbXBsZSByYXRlIHRvIDIgeCBuZXcgb3V0cHV0IHNhbXBsZSByYXRlCisgICAgICAgICAgICAgICAgICAgIGlmIChtVHJhY2tzW2ldLT5tQ2Jsay0+c2FtcGxlUmF0ZSA+IDIgKiBzYW1wbGVSYXRlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFja3NbaV0tPm1DYmxrLT5zYW1wbGVSYXRlID0gMiAqIHNhbXBsZVJhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZW5kQ29uZmlnRXZlbnRfbChBdWRpb1N5c3RlbTo6T1VUUFVUX0NPTkZJR19DSEFOR0VEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtUGFyYW1TdGF0dXMgPSBzdGF0dXM7CisgICAgICAgIG1QYXJhbUNvbmQuc2lnbmFsKCk7CisgICAgICAgIG1XYWl0V29ya0NWLndhaXQobUxvY2spOworICAgIH0KKyAgICByZXR1cm4gcmVjb25maWc7Cit9CisKK3N0YXR1c190IEF1ZGlvRmxpbmdlcjo6TWl4ZXJUaHJlYWQ6OmR1bXBJbnRlcm5hbHMoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKQoreworICAgIGNvbnN0IHNpemVfdCBTSVpFID0gMjU2OworICAgIGNoYXIgYnVmZmVyW1NJWkVdOworICAgIFN0cmluZzggcmVzdWx0OworCisgICAgUGxheWJhY2tUaHJlYWQ6OmR1bXBJ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dCBtaXhCdWZmZXJTaXplID0gbUZyYW1lQ291bnQqbUZyYW1lU2l6ZTsKKworICAgIHdoaWxlICghZXhpdFBlbmRpbmcoKSkKKyAgICB7CisgICAgICAgIHByb2Nlc3NDb25maWdFdmVudHMoKTsKKworICAgICAgICB7IC8vIHNjb3BlIGZvciB0aGUgbUxvY2sKKworICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKworICAgICAgICAgICAgaWYgKGNoZWNrRm9yTmV3UGFyYW1ldGVyc19sKCkpIHsKKyAgICAgICAgICAgICAgICBtaXhCdWZmZXJTaXplID0gbUZyYW1lQ291bnQqbUZyYW1lU2l6ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gcHV0IGF1ZGlvIGhhcmR3YXJlIGludG8gc3RhbmRieSBhZnRlciBzaG9ydCBkZWxheQorICAgICAgICAgICAgaWYgVU5MSUtFTFkoKCFtQWN0aXZlVHJhY2tzLnNpemUoKSAmJiBzeXN0ZW1UaW1lKCkgPiBzdGFuZGJ5VGltZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TdXNwZW5kZWQpIHsKKyAgICAgICAgICAgICAgICAvLyB3YWl0IHVudGlsIHdlIGhhdmUgc29tZXRoaW5nIHRvIGRvLi4uCisgICAgICAgICAgICAgICAgaWYgKCFtU3RhbmRieSkgeworICAgICAgICAgICAgICAgICAgICBMT0dWKCJBdWRpbyBoYXJkd2FyZSBlbnRlcmluZyBzdGFuZGJ5LCBtaXhlciAlcFxuIiwgdGhpcyk7CisgICAgICAgICAgICAgICAgICAgIG1PdXRwdXQtPnN0YW5kYnkoKTsKKyAgICAgICAgICAgICAgICAgICAgbVN0YW5kYnkgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBtQnl0ZXNXcml0dGVuID0gMDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIW1BY3RpdmVUcmFja3Muc2l6ZSgpICYmIG1Db25maWdFdmVudHMuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIGFib3V0IHRvIHdhaXQsIGZsdXNoIHRoZSBiaW5kZXIgY29tbWFuZCBidWZmZXIKKyAgICAgICAgICAgICAgICAgICAgSVBDVGhyZWFkU3RhdGU6OnNlbGYoKS0+Zmx1c2hDb21tYW5kcygpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChleGl0UGVuZGluZygpKSBicmVhazsKKworICAgICAgICAgICAgICAgICAgICBMT0dWKCJEaXJlY3RPdXRwdXRUaHJlYWQgJXAgVElEICVkIGdvaW5nIHRvIHNsZWVwXG4iLCB0aGlzLCBnZXR0aWQoKSk7CisgICAgICAgICAgICAgICAgICAgIG1XYWl0V29ya0NWLndhaXQobUxvY2spOworICAgICAgICAgICAgICAgICAgICBMT0dWKCJEaXJlY3RPdXRwdXRUaHJlYWQgJXAgVElEICVkIHdha2luZyB1cCBpbiBhY3RpdmUgbW9kZVxuIiwgdGhpcywgZ2V0dGlkKCkpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChtTWFzdGVyTXV0ZSA9PSBmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhciB2YWx1ZVtQUk9QRVJUWV9WQUxVRV9NQVhdOworICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlfZ2V0KCJyby5hdWRpby5zaWxlbnQiLCB2YWx1ZSwgIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdG9pKHZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPR0QoIlNpbGVuY2UgaXMgZ29sZGVuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0TWFzdGVyTXV0ZSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHN0YW5kYnlUaW1lID0gc3lzdGVtVGltZSgpICsga1N0YW5kYnlUaW1lSW5Oc2VjczsKKyAgICAgICAgICAgICAgICAgICAgc2xlZXBUaW1lID0gMDsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBmaW5kIG91dCB3aGljaCB0cmFja3MgbmVlZCB0byBiZSBwcm9jZXNzZWQKKyAgICAgICAgICAgIGlmIChtQWN0aXZlVHJhY2tzLnNpemUoKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgc3A8VHJhY2s+IHQgPSBtQWN0aXZlVHJhY2tzWzBdLnByb21vdGUoKTsKKyAgICAgICAgICAgICAgICBpZiAodCA9PSAwKSBjb250aW51ZTsKKworICAgICAgICAgICAgICAgIFRyYWNrKiBjb25zdCB0cmFjayA9IHQuZ2V0KCk7CisgICAgICAgICAgICAgICAgYXVkaW9fdHJhY2tfY2Jsa190KiBjYmxrID0gdHJhY2stPmNibGsoKTsKKworICAgICAgICAgICAgICAgIC8vIFRoZSBmaXJzdCB0aW1lIGEgdHJhY2sgaXMgYWRkZWQgd2Ugd2FpdAorICAgICAgICAgICAgICAgIC8vIGZvciBhbGwgaXRzIGJ1ZmZlcnMgdG8gYmUgZmlsbGVkIGJlZm9yZSBwcm9jZXNzaW5nIGl0CisgICAgICAgICAgICAgICAgaWYgKGNibGstPmZyYW1lc1JlYWR5KCkgJiYgKHRyYWNrLT5pc1JlYWR5KCkgfHwgdHJhY2stPmlzU3RvcHBlZCgpKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgIXRyYWNrLT5pc1BhdXNlZCgpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy9MT0dWKCJ0cmFjayAlZCB1PSUwOHgsIHM9JTA4eCBbT0tdIiwgdHJhY2stPm5hbWUoKSwgY2Jsay0+dXNlciwgY2Jsay0+c2VydmVyKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBjb21wdXRlIHZvbHVtZSBmb3IgdGhpcyB0cmFjaworICAgICAgICAgICAgICAgICAgICBmbG9hdCBsZWZ0LCByaWdodDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRyYWNrLT5pc011dGVkKCkgfHwgbU1hc3Rlck11dGUgfHwgdHJhY2stPmlzUGF1c2luZygpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZXNbdHJhY2stPnR5cGUoKV0ubXV0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA9IHJpZ2h0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0cmFjay0+aXNQYXVzaW5nKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+c2V0UGF1c2VkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB0eXBlVm9sdW1lID0gbVN0cmVhbVR5cGVzW3RyYWNrLT50eXBlKCldLnZvbHVtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHYgPSBtTWFzdGVyVm9sdW1lICogdHlwZVZvbHVtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHZfY2xhbXBlZCA9IHYgKiBjYmxrLT52b2x1bWVbMF07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodl9jbGFtcGVkID4gTUFYX0dBSU4pIHZfY2xhbXBlZCA9IE1BWF9HQUlOOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA9IHZfY2xhbXBlZC9NQVhfR0FJTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZfY2xhbXBlZCA9IHYgKiBjYmxrLT52b2x1bWVbMV07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodl9jbGFtcGVkID4gTUFYX0dBSU4pIHZfY2xhbXBlZCA9IE1BWF9HQUlOOworICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSB2X2NsYW1wZWQvTUFYX0dBSU47CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAobGVmdCAhPSBtTGVmdFZvbHVtZSB8fCByaWdodCAhPSBtUmlnaHRWb2x1bWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1PdXRwdXQtPnNldFZvbHVtZShsZWZ0LCByaWdodCk7CisgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gbUxlZnRWb2x1bWU7CisgICAgICAgICAgICAgICAgICAgICAgICByaWdodCA9IG1SaWdodFZvbHVtZTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICh0cmFjay0+bUZpbGxpbmdVcFN0YXR1cyA9PSBUcmFjazo6RlNfRklMTEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+bUZpbGxpbmdVcFN0YXR1cyA9IFRyYWNrOjpGU19BQ1RJVkU7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2stPm1TdGF0ZSA9PSBUcmFja0Jhc2U6OlJFU1VNSU5HKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2stPm1TdGF0ZSA9IFRyYWNrQmFzZTo6QUNUSVZFOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gcmVzZXQgcmV0cnkgY291bnQKKyAgICAgICAgICAgICAgICAgICAgdHJhY2stPm1SZXRyeUNvdW50ID0ga01heFRyYWNrUmV0cmllczsKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZlVHJhY2sgPSB0OworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vTE9HVigidHJhY2sgJWQgdT0lMDh4LCBzPSUwOHggW05PVCBSRUFEWV0iLCB0cmFjay0+bmFtZSgpLCBjYmxrLT51c2VyLCBjYmxrLT5zZXJ2ZXIpOworICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2stPmlzU3RvcHBlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+cmVzZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2stPmlzVGVybWluYXRlZCgpIHx8IHRyYWNrLT5pc1N0b3BwZWQoKSB8fCB0cmFjay0+aXNQYXVzZWQoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgaGF2ZSBjb25zdW1lZCBhbGwgdGhlIGJ1ZmZlcnMgb2YgdGhpcyB0cmFjay4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBpdCBmcm9tIHRoZSBsaXN0IG9mIGFjdGl2ZSB0cmFja3MuCisgICAgICAgICAgICAgICAgICAgICAgICB0cmFja1RvUmVtb3ZlID0gdHJhY2s7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBObyBidWZmZXJzIGZvciB0aGlzIHRyYWNrLiBHaXZlIGl0IGEgZmV3IGNoYW5jZXMgdG8KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZpbGwgYSBidWZmZXIsIHRoZW4gcmVtb3ZlIGl0IGZyb20gYWN0aXZlIGxpc3QuCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoLS0odHJhY2stPm1SZXRyeUNvdW50KSA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTE9HVigiQlVGRkVSIFRJTUVPVVQ6IHJlbW92ZSglZCkgZnJvbSBhY3RpdmUgbGlzdCIsIHRyYWNrLT5uYW1lKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrVG9SZW1vdmUgPSB0cmFjazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRm9yIHRyYWNrcyB1c2luZyBzdGF0aWMgc2hhcmVkIG1lbXJ5IGJ1ZmZlciwgbWFrZSBzdXJlIHRoYXQgd2UgaGF2ZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gd3JpdHRlbiBlbm91Z2ggZGF0YSB0byBhdWRpbyBoYXJkd2FyZSBiZWZvcmUgZGlzYWJsaW5nIHRoZSB0cmFjaworICAgICAgICAgICAgICAgICAgICAgICAgLy8gTk9URTogdGhpcyBjb25kaXRpb24gd2l0aCBhcnJpdmUgYmVmb3JlIHRyYWNrLT5tUmV0cnlDb3VudCA8PSAwIHNvIHdlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBjYXJlIGFib3V0IGNvZGUgcmVtb3ZpbmcgdHJhY2sgZnJvbSBhY3RpdmUgbGlzdCBhYm92ZS4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodHJhY2stPm1TaGFyZWRCdWZmZXIgIT0gMCkgJiYgKG1CeXRlc1dyaXR0ZW4gPCBtTWluQnl0ZXNUb1dyaXRlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVRyYWNrID0gdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIHJlbW92ZSBhbGwgdGhlIHRyYWNrcyB0aGF0IG5lZWQgdG8gYmUuLi4KKyAgICAgICAgICAgIGlmIChVTkxJS0VMWSh0cmFja1RvUmVtb3ZlICE9IDApKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2ZVRyYWNrcy5yZW1vdmUodHJhY2tUb1JlbW92ZSk7CisgICAgICAgICAgICAgICAgaWYgKHRyYWNrVG9SZW1vdmUtPmlzVGVybWluYXRlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIG1UcmFja3MucmVtb3ZlKHRyYWNrVG9SZW1vdmUpOworICAgICAgICAgICAgICAgICAgICBkZWxldGVUcmFja05hbWVfbCh0cmFja1RvUmVtb3ZlLT5tTmFtZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgIH0KKworICAgICAgICAvLyBvdXRwdXQgYXVkaW8gdG8gaGFyZHdhcmUKKyAgICAgICAgaWYgKG1TdXNwZW5kZWQpIHsKKyAgICAgICAgICAgIHVzbGVlcChrTWF4QnVmZmVyUmVjb3ZlcnlJblVzZWNzKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmIChhY3RpdmVUcmFjayAhPSAwKSB7CisgICAgICAgICAgICAgICAgQXVkaW9CdWZmZXJQcm92aWRlcjo6QnVmZmVyIGJ1ZmZlcjsKKyAgICAgICAgICAgICAgICBzaXplX3QgZnJhbWVDb3VudCA9IG1GcmFtZUNvdW50OworICAgICAgICAgICAgICAgIGN1ckJ1ZiA9IChpbnQ4X3QgKiltTWl4QnVmZmVyOworICAgICAgICAgICAgICAgIC8vIG91dHB1dCBhdWRpbyB0byBoYXJkd2FyZQorICAgICAgICAgICAgICAgIHdoaWxlKGZyYW1lQ291bnQpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmZyYW1lQ291bnQgPSBmcmFtZUNvdW50OworICAgICAgICAgICAgICAgICAgICBhY3RpdmVUcmFjay0+Z2V0TmV4dEJ1ZmZlcigmYnVmZmVyKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKFVOTElLRUxZKGJ1ZmZlci5yYXcgPT0gMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1lbXNldChjdXJCdWYsIDAsIGZyYW1lQ291bnQgKiBtRnJhbWVTaXplKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1lbWNweShjdXJCdWYsIGJ1ZmZlci5yYXcsIGJ1ZmZlci5mcmFtZUNvdW50ICogbUZyYW1lU2l6ZSk7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQgLT0gYnVmZmVyLmZyYW1lQ291bnQ7CisgICAgICAgICAgICAgICAgICAgIGN1ckJ1ZiArPSBidWZmZXIuZnJhbWVDb3VudCAqIG1GcmFtZVNpemU7CisgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVRyYWNrLT5yZWxlYXNlQnVmZmVyKCZidWZmZXIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzbGVlcFRpbWUgPSAwOworICAgICAgICAgICAgICAgIHN0YW5kYnlUaW1lID0gc3lzdGVtVGltZSgpICsga1N0YW5kYnlUaW1lSW5Oc2VjczsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2xlZXBUaW1lICs9IGtCdWZmZXJSZWNvdmVyeUluVXNlY3M7CisgICAgICAgICAgICAgICAgaWYgKHNsZWVwVGltZSA8IGtNYXhCdWZmZXJSZWNvdmVyeUluVXNlY3MpIHsKKyAgICAgICAgICAgICAgICAgICAgdXNsZWVwKGtCdWZmZXJSZWNvdmVyeUluVXNlY3MpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1lbXNldCAobU1peEJ1ZmZlciwgMCwgbUZyYW1lQ291bnQgKiBtRnJhbWVTaXplKTsKKyAgICAgICAgICAgICAgICAgICAgc2xlZXBUaW1lID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIHNsZWVwVGltZSA9PSAwIG1lYW5zIFBDTSBkYXRhIHdlcmUgd3JpdHRlbiB0byBtTWl4QnVmZmVyW10KKyAgICAgICAgICAgIGlmIChzbGVlcFRpbWUgPT0gMCkgeworICAgICAgICAgICAgICAgIG1MYXN0V3JpdGVUaW1lID0gc3lzdGVtVGltZSgpOworICAgICAgICAgICAgICAgIG1JbldyaXRlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBpbnQgYnl0ZXNXcml0dGVuID0gKGludCltT3V0cHV0LT53cml0ZShtTWl4QnVmZmVyLCBtaXhCdWZmZXJTaXplKTsKKyAgICAgICAgICAgICAgICBpZiAoYnl0ZXNXcml0dGVuKSBtQnl0ZXNXcml0dGVuICs9IGJ5dGVzV3JpdHRlbjsKKyAgICAgICAgICAgICAgICBtTnVtV3JpdGVzKys7CisgICAgICAgICAgICAgICAgbUluV3JpdGUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBtU3RhbmRieSA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gZmluYWxseSBsZXQgZ28gb2YgcmVtb3ZlZCB0cmFjaywgd2l0aG91dCB0aGUgbG9jayBoZWxkCisgICAgICAgIC8vIHNpbmNlIHdlIGNhbid0IGd1YXJhbnRlZSB0aGUgZGVzdHJ1Y3RvcnMgd29uJ3QgYWNxdWlyZSB0aGF0CisgICAgICAgIC8vIHNhbWUgbG9jay4KKyAgICAgICAgdHJhY2tUb1JlbW92ZS5jbGVhcigpOworICAgICAgICBhY3RpdmVUcmFjay5jbGVhcigpOworICAgIH0KKworICAgIGlmICghbVN0YW5kYnkpIHsKKyAgICAgICAgbU91dHB1dC0+c3RhbmRieSgpOworICAgIH0KKyAgICBzZW5kQ29uZmlnRXZlbnQoQXVkaW9TeXN0ZW06Ok9VVFBVVF9DTE9TRUQpOworICAgIHByb2Nlc3NDb25maWdFdmVudHMoKTsKKworICAgIExPR1YoIkRpcmVjdE91dHB1dFRocmVhZCAlcCBleGl0aW5nIiwgdGhpcyk7CisgICAgcmV0dXJuIGZhbHNlOworfQorCisvLyBnZXRUcmFja05hbWVfbCgpIG11c3QgYmUgY2FsbGVkIHdpdGggVGhyZWFkQmFzZTo6bUxvY2sgaGVsZAoraW50IEF1ZGlvRmxpbmdlcjo6RGlyZWN0T3V0cHV0VGhyZWFkOjpnZXRUcmFja05hbWVfbCgpCit7CisgICAgcmV0dXJuIDA7Cit9CisKKy8vIGRlbGV0ZVRyYWNrTmFtZ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kCisgICAgICAgICAgICAvLyBpZiBmcmFtZSBjb3VudCBpcyBjaGFuZ2VkIGFmdGVyIHRyYWNrIGNyZWF0aW9uCisgICAgICAgICAgICBpZiAoIW1UcmFja3MuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gSU5WQUxJRF9PUEVSQVRJT047CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJlY29uZmlnID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICBzdGF0dXMgPSBtT3V0cHV0LT5zZXRQYXJhbWV0ZXJzKGtleVZhbHVlUGFpcik7CisgICAgICAgICAgICBpZiAoIW1TdGFuZGJ5ICYmIHN0YXR1cyA9PSBJTlZBTElEX09QRVJBVElPTikgeworICAgICAgICAgICAgICAgbU91dHB1dC0+c3RhbmRieSgpOworICAgICAgICAgICAgICAgbVN0YW5kYnkgPSB0cnVlOworICAgICAgICAgICAgICAgbUJ5dGVzV3JpdHRlbiA9IDA7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBtT3V0cHV0LT5zZXRQYXJhbWV0ZXJzKGtleVZhbHVlUGFpcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SICYmIHJlY29uZmlnKSB7CisgICAgICAgICAgICAgICAgcmVhZE91dHB1dFBhcmFtZXRlcnMoKTsKKyAgICAgICAgICAgICAgICBzZW5kQ29uZmlnRXZlbnRfbChBdWRpb1N5c3RlbTo6T1VUUFVUX0NPTkZJR19DSEFOR0VEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtUGFyYW1TdGF0dXMgPSBzdGF0dXM7CisgICAgICAgIG1QYXJhbUNvbmQuc2lnbmFsKCk7CisgICAgICAgIG1XYWl0V29ya0NWLndhaXQobUxvY2spOworICAgIH0KKyAgICByZXR1c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1dFRyYWNrczsKKworICAgIHdoaWxlICghZXhpdFBlbmRpbmcoKSkKKyAgICB7CisgICAgICAgIHByb2Nlc3NDb25maWdFdmVudHMoKTsKKworICAgICAgICBlbmFibGVkVHJhY2tzID0gMDsKKyAgICAgICAgeyAvLyBzY29wZSBmb3IgdGhlIG1Mb2NrCisKKyAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisKKyAgICAgICAgICAgIGlmIChjaGVja0Zvck5ld1BhcmFtZXRlcnNfbCgpKSB7CisgICAgICAgICAgICAgICAgbWl4QnVmZmVyU2l6ZSA9IG1GcmFtZUNvdW50Km1GcmFtZVNpemU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNvbnN0IFNvcnRlZFZlY3Rvcjwgd3A8VHJhY2s+ID4mIGFjdGl2ZVRyYWNrcyA9IG1BY3RpdmVUcmFja3M7CisKKyAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbU91dHB1dFRyYWNrcy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIG91dHB1dFRyYWNrcy5hZGQobU91dHB1dFRyYWNrc1tpXSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIHB1dCBhdWRpbyBoYXJkd2FyZSBpbnRvIHN0YW5kYnkgYWZ0ZXIgc2hvcnQgZGVsYXkKKyAgICAgICAgICAgIGlmIFVOTElLRUxZKCghYWN0aXZlVHJhY2tzLnNpemUoKSAmJiBzeXN0ZW1UaW1lKCkgPiBzdGFuZGJ5VGltZSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtU3VzcGVuZGVkKSB7CisgICAgICAgICAgICAgICAgaWYgKCFtU3RhbmRieSkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG91dHB1dFRyYWNrcy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0VHJhY2tzW2ldLT5zdG9wKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbVN0YW5kYnkgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBtQnl0ZXNXcml0dGVuID0gMDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIWFjdGl2ZVRyYWNrcy5zaXplKCkgJiYgbUNvbmZpZ0V2ZW50cy5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gd2UncmUgYWJvdXQgdG8gd2FpdCwgZmx1c2ggdGhlIGJpbmRlciBjb21tYW5kIGJ1ZmZlcgorICAgICAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5mbHVzaENvbW1hbmRzKCk7CisgICAgICAgICAgICAgICAgICAgIG91dHB1dFRyYWNrcy5jbGVhcigpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChleGl0UGVuZGluZygpKSBicmVhazsKKworICAgICAgICAgICAgICAgICAgICBMT0dWKCJEdXBsaWNhdGluZ1RocmVhZCAlcCBUSUQgJWQgZ29pbmcgdG8gc2xlZXBcbiIsIHRoaXMsIGdldHRpZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7CisgICAgICAgICAgICAgICAgICAgIExPR1YoIkR1cGxpY2F0aW5nVGhyZWFkICVwIFRJRCAlZCB3YWtpbmcgdXBcbiIsIHRoaXMsIGdldHRpZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1NYXN0ZXJNdXRlID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIHZhbHVlW1BST1BFUlRZX1ZBTFVFX01BWF07CisgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eV9nZXQoInJvLmF1ZGlvLnNpbGVudCIsIHZhbHVlLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0b2kodmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTE9HRCgiU2lsZW5jZSBpcyBnb2xkZW4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRNYXN0ZXJNdXRlKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgc3RhbmRieVRpbWUgPSBzeXN0ZW1UaW1lKCkgKyBrU3RhbmRieVRpbWVJbk5zZWNzOworICAgICAgICAgICAgICAgICAgICBzbGVlcFRpbWUgPSBrQnVmZmVyUmVjb3ZlcnlJblVzZWNzOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGVuYWJsZWRUcmFja3MgPSBwcmVwYXJlVHJhY2tzX2woYWN0aXZlVHJhY2tzLCAmdHJhY2tzVG9SZW1vdmUpOworICAgICAgIH0KKworICAgICAgICBib29sIG11c3RTbGVlcCA9IHRydWU7CisgICAgICAgIGlmIChMSUtFTFkoZW5hYmxlZFRyYWNrcykpIHsKKyAgICAgICAgICAgIC8vIG1peCBidWZmZXJzLi4uCisgICAgICAgICAgICBtQXVkaW9NaXhlci0+cHJvY2VzcyhjdXJCdWYpOworICAgICAgICAgICAgaWYgKCFtU3VzcGVuZGVkKSB7CisgICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBvdXRwdXRUcmFja3Muc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0cHV0VHJhY2tzW2ldLT53cml0ZShjdXJCdWYsIG1GcmFtZUNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgbXVzdFNsZWVwID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1TdGFuZGJ5ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgbUJ5dGVzV3JpdHRlbiArPSBtaXhCdWZmZXJTaXplOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gZmx1c2ggcmVtYWluaW5nIG92ZXJmbG93IGJ1ZmZlcnMgaW4gb3V0cHV0IHRyYWNrcworICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBvdXRwdXRUcmFja3Muc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBpZiAob3V0cHV0VHJhY2tzW2ldLT5pc0FjdGl2ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIG91dHB1dFRyYWNrc1tpXS0+d3JpdGUoY3VyQnVmLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhbmRieVRpbWUgPSBzeXN0ZW1UaW1lKCkgKyBrU3RhbmRieVRpbWVJbk5zZWNzOworICAgICAgICAgICAgICAgICAgICBtdXN0U2xlZXAgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKG11c3RTbGVlcCkgeworLy8gICAgICAgICAgICBMT0dWKCJ0aHJlYWRMb29wKCkgc2xlZXBpbmcgJWQiLCBzbGVlcFRpbWUpOworICAgICAgICAgICAgdXNsZWVwKHNsZWVwVGltZSk7CisgICAgICAgICAgICBpZiAoc2xlZXBUaW1lIDwga01heEJ1ZmZlclJlY292ZXJ5SW5Vc2VjcykgeworICAgICAgICAgICAgICAgIHNsZWVwVGltZSArPSBrQnVmZmVyUmVjb3ZlcnlJblVzZWNzOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc2xlZXBUaW1lID0ga0J1ZmZlclJlY292ZXJ5SW5Vc2VjczsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGZpbmFsbHkgbGV0IGdvIG9mIGFsbCBvdXIgdHJhY2tzLCB3aXRob3V0IHRoZSBsb2NrIGhlbGQKKyAgICAgICAgLy8gc2luY2Ugd2UgY2FuJ3QgZ3VhcmFudGVlIHRoZSBkZXN0cnVjdG9ycyB3b24ndCBhY3F1aXJlIHRoYXQKKyAgICAgICAgLy8gc2FtZSBsb2NrLgorICAgICAgICB0cmFja3NUb1JlbW92ZS5jbGVhcigpOworICAgICAgICBvdXRwdXRUcmFja3MuY2xlYXIoKTsKKyAgICB9CisKKyAgICB7IC8vIHNjb3BlIGZvciB0aGUgbUxvY2sKKworICAgICAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgICAgICBpZiAoIW1TdGFuZGJ5KSB7CisgICAgICAgICAgICBMT0dWKCJEdXBsaWNhdGluZ1RocmVhZCgpIGV4aXRpbmcgb3V0IG9mIHN0YW5kYnkiKTsKKyAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbU91dHB1dFRyYWNrcy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIG1PdXRwdXRUcmFja3NbaV0tPmRlc3Ryb3koKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHNlbmRDb25maWdFdmVudChBdWRpb1N5c3RlbTo6T1VUUFVUX0NMT1NFRCk7CisgICAgcHJvY2Vzc0NvbmZpZ0V2ZW50cygpOworCisgICAgcmV0dXJuIGZhbHNlOworfQorCit2b2lkIEF1ZGlvRmxpbmdlcjo6RHVwbGljYXRpbmdUaHJlYWQ6OmFkZE91dHB1dFRyYWNrKE1peGVyVGhyZWFkICp0aHJlYWQpCit7CisgICAgaW50IGZyYW1lQ291bnQgPSAoMyAqIG1GcmFtZUNvdW50ICogbVNhbXBsZVJhdGUpIC8gdGhyZWFkLT5zYW1wbGVSYXRlKCk7CisgICAgT3V0cHV0VHJhY2sgKm91dHB1dFRyYWNrID0gbmV3IE91dHB1dFRyYWNrKChUaHJlYWRCYXNlICopdGhyZWFkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2FtcGxlUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNoYW5uZWxDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVDb3VudCk7CisgICAgaWYgKG91dHB1dFRyYWNrLT5jYmxrKCkgIT0gTlVMTCkgeworICAgICAgICB0aHJlYWQtPnNldFN0cmVhbVZvbHVtZShBdWRpb1N5c3RlbTo6TlVNX1NUUkVBTV9UWVBFUywgMS4wZik7CisgICAgICAgIG1PdXRwdXRUcmFja3MuYWRkKG91dHB1dFRyYWNrKTsKKyAgICAgICAgTE9HVigiYWRkT3V0cHV0VHJhY2soKSB0cmFjayAlcCwgb24gdGhyZWFkICVwIiwgb3V0cHV0VHJhY2ssIHRocmVhZCk7CisgICAgfQorfQorCit2b2lkIEF1ZGlvRmxpbmdlcjo6RHVwbGljYXRpbmdUaHJlYWQ6OnJlbW92ZU91dHB1dFRyYWNrKE1peGVyVGhyZWFkICp0aHJlYWQpCit7CisgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1PdXRwdXRUcmFja3Muc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgaWYgKG1PdXRwdXRUcmFja3NbaV0tPnRocmVhZCgpID09IChUaHJlYWRCYXNlICopdGhyZWFkKSB7CisgICAgICAgICAgICBtT3V0cHV0VHJhY2tzW2ldLT5kZXN0cm95KCk7CisgICAgICAgICAgICBtT3V0cHV0VHJhY2tzLnJlbW92ZUF0KGkpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorICAgIExPR1YoInJlbW92ZU91dHB1dFRyYWNrKCk6IHVua29ud24gdGhyZWFkOiAlcCIsIHRocmVhZCk7Cit9CisKKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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SW5CdWZmZXItPmZyYW1lQ291bnQgPSBzdGFydEZyYW1lczsKLSAgICAgICAgICAgICAgICBwSW5CdWZmZXItPmkxNiA9IHBJbkJ1ZmZlci0+bUJ1ZmZlcjsKLSAgICAgICAgICAgICAgICBtZW1zZXQocEluQnVmZmVyLT5yYXcsIDAsIHN0YXJ0RnJhbWVzICogY2hhbm5lbHMgKiBzaXplb2YoaW50MTZfdCkpOwotICAgICAgICAgICAgICAgIG1CdWZmZXJRdWV1ZS5hZGQocEluQnVmZmVyKTsgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIExPR1cgKCJPdXRwdXRUcmFjazo6d3JpdGUoKSBubyBtb3JlIGJ1ZmZlcnMiKTsKKworICAgIHVpbnQzMl90IHdhaXRUaW1lTGVmdE1zID0gbVdhaXRUaW1lTXM7CisKKyAgICBpZiAoIW1BY3RpdmUpIHsKKyAgICAgICAgc3RhcnQoKTsKKyAgICAgICAgc3A8VGhyZWFkQmFzZT4gdGhyZWFkID0gbVRocmVhZC5wcm9tb3RlKCk7CisgICAgICAgIGlmICh0aHJlYWQgIT0gMCkgeworICAgICAgICAgICAgTWl4ZXJUaHJlYWQgKm1peGVyVGhyZWFkID0gKE1peGVyVGhyZWFkICopdGhyZWFkLmdldCgpOworICAgICAgICAgICAgaWYgKG1DYmxrLT5mcmFtZUNvdW50ID4gZnJhbWVzKXsKKyAgICAgICAgICAgICAgICBpZiAobUJ1ZmZlclF1ZXVlLnNpemUoKSA8IGtNYXhPdmVyRmxvd0J1ZmZlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3RhcnRGcmFtZXMgPSAobUNibGstPmZyYW1lQ291bnQgLSBmcmFtZXMpOworICAgICAgICAgICAgICAgICAgICBwSW5CdWZmZXIgPSBuZXcgQnVmZmVyOworICAgICAgICAgICAgICAgICAgICBwSW5CdWZmZXItPm1CdWZmZXIgPSBuZXcgaW50MTZfdFtzdGFydEZyYW1lcyAqIGNoYW5uZWxzXTsKKyAgICAgICAgICAgICAgICAgICAgcEluQnVmZmVyLT5mcmFtZUNvdW50ID0gc3RhcnRGcmFtZXM7CisgICAgICAgICAgICAgICAgICAgIHBJbkJ1ZmZlci0+aTE2ID0gcEluQnVmZmVyLT5tQnVmZmVyOworICAgICAgICAgICAgICAgICAgICBtZW1zZXQocEluQnVmZmVyLT5yYXcsIDAsIHN0YXJ0RnJhbWVzICogY2hhbm5lbHMgKiBzaXplb2YoaW50MTZfdCkpOworICAgICAgICAgICAgICAgICAgICBtQnVmZmVyUXVldWUuYWRkKHBJbkJ1ZmZlcik7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HVyAoIk91dHB1dFRyYWNrOjp3cml0ZSgpICVwIG5vIG1vcmUgYnVmZmVycyBpbiBxdWV1ZSIsIHRoaXMpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgfSAgICAgICAgCisgICAgICAgIH0KICAgICB9CiAKLSAgICB3aGlsZSAoMSkgeyAKKyAgICB3aGlsZSAod2FpdFRpbWVMZWZ0TXMpIHsKICAgICAgICAgLy8gRmlyc3Qgd3JpdGUgcGVuZGluZyBidWZmZXJzLCB0aGVuIG5ldyBkYXRhCiAgICAgICAgIGlmIChtQnVmZmVyUXVldWUuc2l6ZSgpKSB7CiAgICAgICAgICAgICBwSW5CdWZmZXIgPSBtQnVmZmVyUXVldWUuaXRlbUF0KDApOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgcEluQnVmZmVyID0gJmluQnVmZmVyOwogICAgICAgICB9Ci0gCisKICAgICAgICAgaWYgKHBJbkJ1ZmZlci0+ZnJhbWVDb3VudCA9PSAwKSB7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBpZiAobU91dEJ1ZmZlci5mcmFtZUNvdW50ID09IDApIHsKICAgICAgICAgICAgIG1PdXRCdWZmZXIuZnJhbWVDb3VudCA9IHBJbkJ1ZmZlci0+ZnJhbWVDb3VudDsKLSAgICAgICAgICAgIGlmIChvYnRhaW5CdWZmZXIoJm1PdXRCdWZmZXIpID09IChzdGF0dXNfdClBdWRpb1RyYWNrOjpOT19NT1JFX0JVRkZFUlMpIHsKKyAgICAgICAgICAgIG5zZWNzX3Qgc3RhcnRUaW1lID0gc3lzdGVtVGltZSgpOworICAgICAgICAgICAgaWYgKG9idGFpbkJ1ZmZlcigmbU91dEJ1ZmZlciwgd2FpdFRpbWVMZWZ0TXMpID09IChzdGF0dXNfdClBdWRpb1RyYWNrOjpOT19NT1JFX0JVRkZFUlMpIHsKKyAgICAgICAgICAgICAgICBMT0dWICgiT3V0cHV0VHJhY2s6OndyaXRlKCkgJXAgbm8gbW9yZSBvdXRwdXQgYnVmZmVycyIsIHRoaXMpOworICAgICAgICAgICAgICAgIG91dHB1dEJ1ZmZlckZ1bGwgPSB0cnVlOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgdWludDMyX3Qgd2FpdFRpbWVNcyA9ICh1aW50MzJfdCluczJtcyhzeXN0ZW1UaW1lKCkgLSBzdGFydFRpbWUpOworLy8gICAgICAgICAgICBMT0dWKCJPdXRwdXRUcmFjazo6d3JpdGUoKSB3YWl0VGltZU1zICVkIHdhaXRUaW1lTGVmdE1zICVkIiwgd2FpdFRpbWVNcywgd2FpdFRpbWVMZWZ0TXMpCisgICAgICAgICAgICBpZiAod2FpdFRpbWVMZWZ0TXMgPj0gd2FpdFRpbWVNcykgeworICAgICAgICAgICAgICAgIHdhaXRUaW1lTGVmdE1zIC09IHdhaXRUaW1lTXM7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHdhaXRUaW1lTGVmdE1zID0gMDsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgdWludDMyX3Qgb3V0RnJhbWVzID0gcEluQnV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Jlc3VsdDsKICAgICBhdWRpb190cmFja19jYmxrX3QqIGNibGsgPSBtQ2JsazsKICAgICB1aW50MzJfdCBmcmFtZXNSZXEgPSBidWZmZXItPmZyYW1lQ291bnQ7CiAKLSAgICBMT0dWKCJPdXRwdXRUcmFjazo6b2J0YWluQnVmZmVyIHVzZXIgJWQsIHNlcnZlciAlZCIsIGNibGstPnVzZXIsIGNibGstPnNlcnZlcik7CisvLyAgICBMT0dWKCJPdXRwdXRUcmFjazo6b2J0YWluQnVmZmVyIHVzZXIgJWQsIHNlcnZlciAlZCIsIGNibGstPnVzZXIsIGNibGstPnNlcnZlcik7CiAgICAgYnVmZmVyLT5mcmFtZUNvdW50ICA9IDA7Ci0gICAgCisKICAgICB1aW50MzJfdCBmcmFtZXNBdmFpbCA9IGNibGstPmZyYW1lc0F2YWlsYWJsZSgpOwogCisKICAgICBpZiAoZnJhbWVzQXZhaWwgPT0gMCkgewotICAgICAgICByZXR1cm4gQXVkaW9UcmFjazo6Tk9fTU9SRV9CVUZGRVJTOworICAgICAgICBNdXRleDo6QXV0b2xvY2sgX2woY2Jsay0+bG9jayk7CisgICAgICAgIGdvdG8gc3RhcnRfbG9vcF9oZXJlOworICAgICAgICB3aGlsZSAoZnJhbWVzQXZhaWwgPT0gMCkgeworICAgICAgICAgICAgYWN0aXZlID0gbUFjdGl2ZTsKKyAgICAgICAgICAgIGlmIChVTkxJS0VMWSghYWN0aXZlKSkgeworICAgICAgICAgICAgICAgIExPR1YoIk5vdCBhY3RpdmUgYW5kIE5PX01PUkVfQlVGRkVSUyIpOworICAgICAgICAgICAgICAgIHJldHVybiBBdWRpb1RyYWNrOjpOT19NT1JFX0JVRkZFUlM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXN1bHQgPSBjYmxrLT5jdi53YWl0UmVsYXRpdmUoY2Jsay0+bG9jaywgbWlsbGlzZWNvbmRzKHdhaXRUaW1lTXMpKTsKKyAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gTk9fRV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SZWNvcmRUaHJlYWQ6OnRocmVhZExvb3AoKQorewogICAgIEF1ZGlvQnVmZmVyUHJvdmlkZXI6OkJ1ZmZlciBidWZmZXI7Ci0gICAgaW50IGluQnVmZmVyU2l6ZSA9IDA7Ci0gICAgaW50IGluRnJhbWVDb3VudCA9IDA7Ci0gICAgQXVkaW9TdHJlYW1JbiogaW5wdXQgPSAwOworICAgIHNwPFJlY29yZFRyYWNrPiBhY3RpdmVUcmFjazsKIAotICAgIG1BY3RpdmUgPSAwOwotICAgIAogICAgIC8vIHN0YXJ0IHJlY29yZGluZwogICAgIHdoaWxlICghZXhpdFBlbmRpbmcoKSkgewotICAgICAgICBpZiAoIW1BY3RpdmUpIHsKLSAgICAgICAgICAgIG1Mb2NrLmxvY2soKTsKLSAgICAgICAgICAgIGlmICghbUFjdGl2ZSAmJiAhZXhpdFBlbmRpbmcoKSkgewotICAgICAgICAgICAgICAgIExPR1YoIkF1ZGlvUmVjb3JkVGhyZWFkOiBsb29wIHN0b3BwaW5nIik7Ci0gICAgICAgICAgICAgICAgaWYgKGlucHV0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBpbnB1dDsKLSAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtUmVjb3JkVHJhY2suY2xlYXIoKTsKLSAgICAgICAgICAgICAgICBtU3RvcHBlZC5zaWduYWwoKTsKIAorICAgICAgICBwcm9jZXNzQ29uZmlnRXZlbnRzKCk7CisKKyAgICAgICAgeyAvLyBzY29wZSBmb3IgbUxvY2sKKyAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisgICAgICAgICAgICBjaGVja0Zvck5ld1BhcmFtZXRlcnNfbCgpOworICAgICAgICAgICAgaWYgKG1BY3RpdmVUcmFjayA9PSAwICYmIG1Db25maWdFdmVudHMuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgaWYgKCFtU3RhbmRieSkgeworICAgICAgICAgICAgICAgICAgICBtSW5wdXQtPnN0YW5kYnkoKTsKKyAgICAgICAgICAgICAgICAgICAgbVN0YW5kYnkgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChleGl0UGVuZGluZygpKSBicmVhazsKKworICAgICAgICAgICAgICAgIExPR1YoIlJlY29yZFRocmVhZDogbG9vcCBzdG9wcGluZyIpOworICAgICAgICAgICAgICAgIC8vIGdvIHRvIHNsZWVwCiAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7Ci0gICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBMT0dWKCJBdWRpb1JlY29yZFRocmVhZDogbG9vcCBzdGFydGluZyIpOwotICAgICAgICAgICAgICAgIGlmIChtUmVjb3JkVHJhY2sgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBpbnB1dCA9IG1BdWRpb0hhcmR3YXJlLT5vcGVuSW5wdXRTdHJlYW0oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVjb3JkVHJhY2stPmlucHV0U291cmNlKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVjb3JkVHJhY2stPmZvcm1hdCgpLCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1SZWNvcmRUcmFjay0+Y2hhbm5lbENvdW50KCksIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJlY29yZFRyYWNrLT5zYW1wbGVSYXRlKCksIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1TdGFydFN0YXR1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChBdWRpb1N5c3RlbTo6YXVkaW9faW5fYWNvdXN0aWNzKShtUmVjb3JkVHJhY2stPm1GbGFncyA+PiAxNikpOwotICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW5CdWZmZXJTaXplID0gaW5wdXQtPmJ1ZmZlclNpemUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGluRnJhbWVDb3VudCA9IGluQnVmZmVyU2l6ZS9pbnB1dC0+ZnJhbWVTaXplKCk7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgTE9HVigiUmVjb3JkVGhyZWFkOiBsb29wIHN0YXJ0aW5nIik7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUFjdGl2ZVRyYWNrICE9IDApIHsKKyAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVRyYWNrLT5tU3RhdGUgPT0gVHJhY2tCYXNlOjpQQVVTSU5HKSB7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVUcmFjay5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICBtU3RhcnRTdG9wQ29uZC5icm9hZGNhc3QoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1BY3RpdmVUcmFjay0+bVN0YXRlID09IFRyYWNrQmFzZTo6UkVTVU1JTkcpIHsKKyAgICAgICAgICAgICAgICAgICAgbVJzbXBJbkluZGV4ID0gbUZyYW1lQ291bnQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChtUmVxQ2hhbm5lbENvdW50ICE9IG1BY3RpdmVUcmFjay0+Y2hhbm5lbENvdW50KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVUcmFjay5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVRyYWNrLT5tU3RhdGUgPSBUcmFja0Jhc2U6OkFDVElWRTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtU3RhcnRTdG9wQ29uZC5icm9hZGNhc3QoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVN0YW5kYnkgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQWN0aXZlVHJhY2sgIT0gMCkgeworICAgICAgICAgICAgYnVmZmVyLmZyYW1lQ291bnQgPSBtRnJhbWVDb3VudDsKKyAgICAgICAgICAgIGlmIChMSUtFTFkobUFjdGl2ZVRyYWNrLT5nZXROZXh0QnVmZmVyKCZidWZmZXIpID09IE5PX0VSUk9SKSkgeworICAgICAgICAgICAgICAgIHNpemVfdCBmcmFtZXNPdXQgPSBidWZmZXIuZnJhbWVDb3VudDsKKyAgICAgICAgICAgICAgICBpZiAobVJlc2FtcGxlciA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIG5vIHJlc2FtcGxpbmcKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGZyYW1lc091dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGZyYW1lc0luID0gbUZyYW1lQ291bnQgLSBtUnNtcEluSW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnJhbWVzSW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ4X3QgKnNyYyA9IChpbnQ4X3QgKiltUnNtcEluQnVmZmVyICsgbVJzbXBJbkluZGV4ICogbUZyYW1lU2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ4X3QgKmRzdCA9IGJ1ZmZlci5pOCArIChidWZmZXIuZnJhbWVDb3VudCAtIGZyYW1lc091dCkgKiBtQWN0aXZlVHJhY2stPm1DYmxrLT5mcmFtZVNpemU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZyYW1lc0luID4gZnJhbWVzT3V0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZXNJbiA9IGZyYW1lc091dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUnNtcEluSW5kZXggKz0gZnJhbWVzSW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzT3V0IC09IGZyYW1lc0luOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQ2hhbm5lbENvdW50ID09IG1SZXFDaGFubmVsQ291bnQgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZvcm1hdCAhPSBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoZHN0LCBzcmMsIGZyYW1lc0luICogbUZyYW1lU2l6ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MTZfdCAqc3JjMTYgPSAoaW50MTZfdCAqKXNyYzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MTZfdCAqZHN0MTYgPSAoaW50MTZfdCAqKWRzdDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DaGFubmVsQ291bnQgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGZyYW1lc0luLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHN0MTYrKyA9ICpzcmMxNjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHN0MTYrKyA9ICpzcmMxNisrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGZyYW1lc0luLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHN0MTYrKyA9IChpbnQxNl90KSgoKGludDMyX3QpKnNyYzE2ICsgKGludDMyX3QpKihzcmMxNiArIDEpKSA+PiAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMxNiArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZyYW1lc091dCAmJiBtRnJhbWVDb3VudCA9PSBtUnNtcEluSW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzc2l6ZV90IGJ5dGVzUmVhZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnJhbWVzT3V0ID09IG1GcmFtZUNvdW50ICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtQ2hhbm5lbENvdW50ID09IG1SZXFDaGFubmVsQ291bnQgfHwgbUZvcm1hdCAhPSBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXNSZWFkID0gbUlucHV0LT5yZWFkKGJ1ZmZlci5yYXcsIG1JbnB1dEJ5dGVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzT3V0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlYWQgPSBtSW5wdXQtPnJlYWQobVJzbXBJbkJ1ZmZlciwgbUlucHV0Qnl0ZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUnNtcEluSW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0dFKCJFcnJvciByZWFkaW5nIGF1ZGlvIGlucHV0Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsZWVwKDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUnNtcEluSW5kZXggPSBtRnJhbWVDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzT3V0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmZyYW1lQ291bnQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1TdGFydFN0YXR1cyA9IE5PX0lOSVQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChtU3RhcnRTdGF0dXMgIT1OT19FUlJPUikgewotICAgICAgICAgICAgICAgICAgICBMT0dXKCJyZWNvcmQgc3RhcnQgZmFpbGVkLCBzdGF0dXMgJWQiLCBtU3RhcnRTdGF0dXMpOwotICAgICAgICAgICAgICAgICAgICBtQWN0aXZlID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIG1SZWNvcmRUcmFjay5jbGVhcigpOyAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1XYWl0V29ya0NWLnNpZ25hbCgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUxvY2sudW5sb2NrKCk7Ci0gICAgICAgIH0gZWxzZSBpZiAobVJlY29yZFRyYWNrICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcmVzYW1wbGluZwogCi0gICAgICAgICAgICBidWZmZXIuZnJhbWVDb3VudCA9IGluRnJhbWVDb3VudDsKLSAgICAgICAgICAgIGlmIChMSUtFTFkobVJlY29yZFRyYWNrLT5nZXROZXh0QnVmZmVyKCZidWZmZXIpID09IE5PX0VSUk9SICYmCi0gICAgICAgICAgICAgICAgICAgICAgIChpbnQpYnVmZmVyLmZyYW1lQ291bnQgPT0gaW5GcmFtZUNvdW50KSkgewotICAgICAgICAgICAgICAgIExPR1YoIkF1ZGlvUmVjb3JkVGhyZWFkIHJlYWQ6ICVkIGZyYW1lcyIsIGJ1ZmZlci5mcmFtZUNvdW50KTsKLSAgICAgICAgICAgICAgICBzc2l6ZV90IGJ5dGVzUmVhZCA9IGlucHV0LT5yZWFkKGJ1ZmZlci5yYXcsIGluQnVmZmVyU2l6ZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGJ5dGVzUmVhZCA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgTE9HRSgiRXJyb3IgcmVhZGluZyBhdWRpbyBpbnB1dCIpOwotICAgICAgICAgICAgICAgICAgICBzbGVlcCgxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbVJlY29yZFRyYWNrLT5yZWxlYXNlQnVmZmVyKCZidWZmZXIpOwotICAgICAgICAgICAgICAgIG1SZWNvcmRUcmFjay0+b3ZlcmZsb3coKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbWVtc2V0KG1Sc21wT3V0QnVmZmVyLCAwLCBmcmFtZXNPdXQgKiAyICogc2l6ZW9mKGludDMyX3QpKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gYWx0ZXIgb3V0cHV0IGZyYW1lIGNvdW50IGFzIGlmIHdlIHdlcmUgZXhwZWN0aW5nIHN0ZXJlbyBzYW1wbGVzCisgICAgICAgICAgICAgICAgICAgIGlmIChtQ2hhbm5lbENvdW50ID09IDEgJiYgbVJlcUNoYW5uZWxDb3VudCA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZXNPdXQgPj49IDE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbVJlc2FtcGxlci0+cmVzYW1wbGUobVJzbXBPdXRCdWZmZXIsIGZyYW1lc091dCwgdGhpcyk7CisgICAgICAgICAgICAgICAgICAgIC8vIGRpdGhlckFuZENsYW1wKCkgd29ya3MgYXMgbG9uZyBhcyBhbGwgYnVmZmVycyByZXR1cm5lZCBieSBtQWN0aXZlVHJhY2stPmdldE5leHRCdWZmZXIoKQorICAgICAgICAgICAgICAgICAgICAvLyBhcmUgMzIgYml0IGFsaWduZWQgd2hpY2ggc2hvdWxkIGJlIGFsd2F5cyB0cnVlLgorICAgICAgICAgICAgICAgICAgICBpZiAobUNoYW5uZWxDb3VudCA9PSAyICYmIG1SZXFDaGFubmVsQ291bnQgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9NaXhlcjo6ZGl0aGVyQW5kQ2xhbXAobVJzbXBPdXRCdWZmZXIsIG1Sc21wT3V0QnVmZmVyLCBmcmFtZXNPdXQpOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHJlc2FtcGxlciBhbHdheXMgb3V0cHV0cyBzdGVyZW8gc2FtcGxlczogZG8gcG9zdCBzdGVyZW8gdG8gbW9ubyBjb252ZXJzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQxNl90ICpzcmMgPSAoaW50MTZfdCAqKW1Sc21wT3V0QnVmZmVyOworICAgICAgICAgICAgICAgICAgICAgICAgaW50MTZfdCAqZHN0ID0gYnVmZmVyLmkxNjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChmcmFtZXNPdXQtLSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IChpbnQxNl90KSgoKGludDMyX3QpKnNyYyArIChpbnQzMl90KSooc3JjICsgMSkpID4+IDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYyArPSAyOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgQX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bWVDb3VudDsKKyAgICBidWZmZXItPmZyYW1lQ291bnQgPSAwOworfQorCitib29sIEF1ZGlvRmxpbmdlcjo6UmVjb3JkVGhyZWFkOjpjaGVja0Zvck5ld1BhcmFtZXRlcnNfbCgpCit7CisgICAgYm9vbCByZWNvbmZpZyA9IGZhbHNlOworCisgICAgd2hpbGUgKCFtTmV3UGFyYW1ldGVycy5pc0VtcHR5KCkpIHsKKyAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gTk9fRVJST1I7CisgICAgICAgIFN0cmluZzgga2V5VmFsdWVQYWlyID0gbU5ld1BhcmFtZXRlcnNbMF07CisgICAgICAgIEF1ZGlvUGFyYW1ldGVyIHBhcmFtID0gQXVkaW9QYXJhbWV0ZXIoa2V5VmFsdWVQYWlyKTsKKyAgICAgICAgaW50IHZhbHVlOworICAgICAgICBpbnQgcmVxRm9ybWF0ID0gbUZvcm1hdDsKKyAgICAgICAgaW50IHJlcVNhbXBsaW5nUmF0ZSA9IG1SZXFTYW1wbGVSYXRlOworICAgICAgICBpbnQgcmVxQ2hhbm5lbENvdW50ID0gbVJlcUNoYW5uZWxDb3VudDsKKworICAgICAgICBtTmV3UGFyYW1ldGVycy5yZW1vdmVBdCgwKTsKKworICAgICAgICBpZiAocGFyYW0uZ2V0SW50KFN0cmluZzgoQXVkaW9QYXJhbWV0ZXI6OmtleVNhbXBsaW5nUmF0ZSksIHZhbHVlKSA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgcmVxU2FtcGxpbmdSYXRlID0gdmFsdWU7CisgICAgICAgICAgICByZWNvbmZpZyA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBhcmFtLmdldEludChTdHJpbmc4KEF1ZGlvUGFyYW1ldGVyOjprZXlGb3JtYXQpLCB2YWx1ZSkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIHJlcUZvcm1hdCA9IHZhbHVlOworICAgICAgICAgICAgcmVjb25maWcgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmIChwYXJhbS5nZXRJbnQoU3RyaW5nOChBdWRpb1BhcmFtZXRlcjo6a2V5Q2hhbm5lbHMpLCB2YWx1ZSkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIHJlcUNoYW5uZWxDb3VudCA9IEF1ZGlvU3lzdGVtOjpwb3BDb3VudCh2YWx1ZSk7CisgICAgICAgICAgICByZWNvbmZpZyA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBhcmFtLmdldEludChTdHJpbmc4KEF1ZGlvUGFyYW1ldGVyOjprZXlGcmFtZUNvdW50KSwgdmFsdWUpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAvLyBkbyBub3QgYWNjZXB0IGZyYW1lIGNvdW50IGNoYW5nZXMgaWYgdHJhY2tzIGFyZSBvcGVuIGFzIHRoZSB0cmFjayBidWZmZXIKKyAgICAgICAgICAgIC8vIHNpemUgZGVwZW5kcyBvbiBmcmFtZSBjb3VudCBhbmQgY29ycmVjdCBiZWhhdmlvciB3b3VsZCBub3QgYmUgZ2FyYW50aWVkCisgICAgICAgICAgICAvLyBpZiBmcmFtZSBjb3VudCBpcyBjaGFuZ2VkIGFmdGVyIHRyYWNrIGNyZWF0aW9uCisgICAgICAgICAgICBpZiAobUFjdGl2ZVRyYWNrICE9IDApIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBJTlZBTElEX09QRVJBVElPTjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmVjb25maWcgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIHN0YXR1cyA9IG1JbnB1dC0+c2V0UGFyYW1ldGVycyhrZXlWYWx1ZVBhaXIpOworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJTlZBTElEX09QRVJBVElPTikgeworICAgICAgICAgICAgICAgbUlucHV0LT5zdGFuZGJ5KCk7CisgICAgICAgICAgICAgICBzdGF0dXMgPSBtSW5wdXQtPnNldFBhcmFtZXRlcnMoa2V5VmFsdWVQYWlyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChyZWNvbmZpZykgeworICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gQkFEX1ZBTFVFICYmCisgICAgICAgICAgICAgICAgICAgIHJlcUZvcm1hdCA9PSBtSW5wdXQtPmZvcm1hdCgpICYmIHJlcUZvcm1hdCA9PSBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVCAmJgorICAgICAgICAgICAgICAgICAgICAoKGludCltSW5wdXQtPnNhbXBsZVJhdGUoKSA8PSAyICogcmVxU2FtcGxpbmdSYXRlKSAmJgorICAgICAgICAgICAgICAgICAgICAoQXVkaW9TeXN0ZW06OnBvcENvdW50KG1JbnB1dC0+Y2hhbm5lbHMoKSkgPCAzKSAmJiAocmVxQ2hhbm5lbENvdW50IDwgMykpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gTk9fRVJST1I7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVhZElucHV0UGFyYW1ldGVycygpOworICAgICAgICAgICAgICAgICAgICBzZW5kQ29uZmlnRXZlbnRfbChBdWRpb1N5c3RlbTo6SU5QVVRfQ09ORklHX0NIQU5HRUQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtUGFyYW1TdGF0dXMgPSBzdGF0dXM7CisgICAgICAgIG1QYXJhbUNvbmQuc2lnbmFsKCk7CisgICAgICAgIG1XYWl0V29ya0NWLndhaXQobUxvY2spOworICAgIH0KKyAgICByZXR1cm4gcmVjb25maWc7Cit9CisKK1N0cmluZzggQXVkaW9GbGluZ2VyOjpSZWNvcmRUaHJlYWQ6OmdldFBhcmFtZXRlcnMo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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcExhdGVuY3lNcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MpCit7CisgICAgc3RhdHVzX3Qgc3RhdHVzOworICAgIFBsYXliYWNrVGhyZWFkICp0aHJlYWQgPSBOVUxMOworICAgIG1IYXJkd2FyZVN0YXR1cyA9IEFVRElPX0hXX09VVFBVVF9PUEVOOworICAgIHVpbnQzMl90IHNhbXBsaW5nUmF0ZSA9IHBTYW1wbGluZ1JhdGUgPyAqcFNhbXBsaW5nUmF0ZSA6IDA7CisgICAgdWludDMyX3QgZm9ybWF0ID0gcEZvcm1hdCA/ICpwRm9ybWF0IDogMDsKKyAgICB1aW50MzJfdCBjaGFubmVscyA9IHBDaGFubmVscyA/ICpwQ2hhbm5lbHMgOiAwOworICAgIHVpbnQzMl90IGxhdGVuY3kgPSBwTGF0ZW5jeU1zID8gKnBMYXRlbmN5TXMgOiAwOworCisgICAgTE9HVigib3Blbk91dHB1dCgpLCBEZXZpY2UgJXgsIFNhbXBsaW5nUmF0ZSAlZCwgRm9ybWF0ICVkLCBDaGFubmVscyAleCwgZmxhZ3MgJXgiLAorICAgICAgICAgICAgcERldmljZXMgPyAqcERldmljZXMgOiAwLAorICAgICAgICAgICAgc2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgZm9ybWF0LAorICAgICAgICAgICAgY2hhbm5lbHMsCisgICAgICAgICAgICBmbGFncyk7CisKKyAgICBpZiAocERldmljZXMgPT0gTlVMTCB8fCAqcERldmljZXMgPT0gMCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKworICAgIEF1ZGlvU3RyZWFtT3V0ICpvdXRwdXQgPSBtQXVkaW9IYXJkd2FyZS0+b3Blbk91dHB1dFN0cmVhbSgqcERldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCAqKSZmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnN0YXR1cyk7CisgICAgTE9HVigib3Blbk91dHB1dCgpIG9wZW5PdXRwdXRTdHJlYW0gcmV0dXJuZWQgb3V0cHV0ICVwLCBTYW1wbGluZ1JhdGUgJWQsIEZvcm1hdCAlZCwgQ2hhbm5lbHMgJXgsIHN0YXR1cyAlZCIsCisgICAgICAgICAgICBvdXRwdXQsCisgICAgICAgICAgICBzYW1wbGluZ1JhdGUsCisgICAgICAgICAgICBmb3JtYXQsCisgICAgICAgICAgICBjaGFubmVscywKKyAgICAgICAgICAgIHN0YXR1cyk7CisKKyAgICBtSGFyZHdhcmVTdGF0dXMgPSBBVURJT19IV19JRExFOworICAgIGlmIChvdXRwdXQgIT0gMCkgeworICAgICAgICBpZiAoKGZsYWdzICYgQXVkaW9TeXN0ZW06Ok9VVFBVVF9GTEFHX0RJUkVDVCkgfHwKKyAgICAgICAgICAgIChmb3JtYXQgIT0gQXVkaW9TeXN0ZW06OlBDTV8xNl9CSVQpIHx8CisgICAgICAgICAgICAoY2hhbm5lbHMgIT0gQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX1NURVJFTykpIHsKKyAgICAgICAgICAgIHRocmVhZCA9IG5ldyBEaXJlY3RPdXRwdXRUaHJlYWQodGhpcywgb3V0cHV0KTsKKyAgICAgICAgICAgIExPR1YoIm9wZW5PdXRwdXQoKSBjcmVhdGVkIGRpcmVjdCBvdXRwdXQ6IElEICVkIHRocmVhZCAlcCIsIChtTmV4dFRocmVhZEl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VPdXRwdXQoaW50IG91dHB1dCkKK3sKKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgIFBsYXliYWNrVGhyZWFkICp0aHJlYWQgPSBjaGVja1BsYXliYWNrVGhyZWFkX2wob3V0cHV0KTsKKworICAgIGlmICh0aHJlYWQgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgIH0KKworICAgIExPR1YoInJlc3RvcmVPdXRwdXQoKSAlZCIsIG91dHB1dCk7CisKKyAgICB0aHJlYWQtPnJlc3RvcmUoKTsKKworICAgIHJldHVybiBOT19FUlJPUjsKK30KKworaW50IEF1ZGlvRmxpbmdlcjo6b3BlbklucHV0KHVpbnQzMl90ICpwRGV2aWNlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBTYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcENoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBhY291c3RpY3MpCit7CisgICAgc3RhdHVzX3Qgc3RhdHVzOworICAgIFJlY29yZFRocmVhZCAqdGhyZWFkID0gTlVMTDsKKyAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSBwU2FtcGxpbmdSYXRlID8gKnBTYW1wbGluZ1JhdGUgOiAwOworICAgIHVpbnQzMl90IGZvcm1hdCA9IHBGb3JtYXQgPyAqcEZvcm1hdCA6IDA7CisgICAgdWludDMyX3QgY2hhbm5lbHMgPSBwQ2hhbm5lbHMgPyAqcENoYW5uZWxzIDogMDsKKyAgICB1aW50MzJfdCByZXFTYW1wbGluZ1JhdGUgPSBzYW1wbGluZ1JhdGU7CisgICAgdWludDMyX3QgcmVxRm9ybWF0ID0gZm9ybWF0OworICAgIHVpbnQzMl90IHJlcUNoYW5uZWxzID0gY2hhbm5lbHM7CisKKyAgICBpZiAocERldmljZXMgPT0gTlVMTCB8fCAqcERldmljZXMgPT0gMCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKworICAgIEF1ZGlvU3RyZWFtSW4gKmlucHV0ID0gbUF1ZGlvSGFyZHdhcmUtPm9wZW5JbnB1dFN0cmVhbSgqcERldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCAqKSZmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnN0YXR1cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcylhY291c3RpY3MpOworICAgIExPR1YoIm9wZW5JbnB1dCgpIG9wZW5JbnB1dFN0cmVhbSByZXR1cm5lZCBpbnB1dCAlcCwgU2FtcGxpbmdSYXRlICVkLCBGb3JtYXQgJWQsIENoYW5uZWxzICV4LCBhY291c3RpY3MgJXgsIHN0YXR1cyAlZCIsCisgICAgICAgICAgICBpbnB1dCwKKyAgICAgICAgICAgIHNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgIGZvcm1hdCwKKyAgICAgICAgICAgIGNoYW5uZWxzLAorICAgICAgICAgICAgYWNvdXN0aWNzLAorICAgICAgICAgICAgc3RhdHVzKTsKKworICAgIC8vIElmIHRoZSBpbnB1dCBjb3VsZCB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AgICAgJnNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhdHVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChBdWRpb1N5c3RlbTo6YXVkaW9faW5fYWNvdXN0aWNzKWFjb3VzdGljcyk7CisgICAgfQorCisgICAgaWYgKGlucHV0ICE9IDApIHsKKyAgICAgICAgIC8vIFN0YXJ0IHJlY29yZCB0aHJlYWQKKyAgICAgICAgdGhyZWFkID0gbmV3IFJlY29yZFRocmVhZCh0aGlzLCBpbnB1dCwgcmVxU2FtcGxpbmdSYXRlLCByZXFDaGFubmVscyk7CisgICAgICAgIG1SZWNvcmRUaHJlYWRzLmFkZCgrK21OZXh0VGhyZWFkSWQsIHRocmVhZCk7CisgICAgICAgIExPR1YoIm9wZW5JbnB1dCgpIGNyZWF0ZWQgcmVjb3JkIHRocmVhZDogSUQgJWQgdGhyZWFkICVwIiwgbU5leHRUaHJlYWRJZCwgdGhyZWFkKTsKKyAgICAgICAgaWYgKHBTYW1wbGluZ1JhdGUpICpwU2FtcGxpbmdSYXRlID0gcmVxU2FtcGxpbmdSYXRlOworICAgICAgICBpZiAocEZvcm1hdCkgKnBGb3JtYXQgPSBmb3JtYXQ7CisgICAgICAgIGlmIChwQ2hhbm5lbHMpICpwQ2hhbm5lbHMgPSByZXFDaGFubmVsczsKKworICAgICAgICBpbnB1dC0+c3RhbmRieSgpOworICAgIH0KKworICAgIHJldHVybiBtTmV4dFRocmVhZElkOworfQorCitzdGF0dXNfdCBBdWRpb0ZsaW5nZXI6OmNsb3NlSW5wdXQoaW50IGlucHV0KQoreworICAgIC8vIGtlZXAgc3Ryb25nIHJlZmVyZW5jZSBvbiB0aGUgcmVjb3JkIHRocmVhZCBzbyB0aGF0CisgICAgLy8gaXQgaXMgbm90IGRlc3Ryb3llZCB3aGlsZSBleGl0KCkgaXMgZXhlY3V0ZWQKKyAgICBzcCA8UmVjb3JkVGhyZWFkPiB0aHJlYWQ7CisgICAgeworICAgICAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgICAgICB0aHJlYWQgPSBjaGVja1JlY29yZFRocmVhZF9sKGlucHV0KTsKKyAgICAgICAgaWYgKHRocmVhZCA9PSBOVUxMKSB7CisgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgICAgICB9CisKKyAgICAgICAgTE9HVigiY2xvc2VJbnB1dCgpICVkIiwgaW5wdXQpOworICAgICAgICBtUmVjb3JkVGhyZWFkcy5yZW1vdmVJdGVtKGlucHV0KTsKKyAgICB9CisgICAgdGhyZWFkLT5leGl0KCk7CisKKyAgICBtQXVkaW9IYXJkd2FyZS0+Y2xvc2VJbnB1dFN0cmVhbSh0aHJlYWQtPmdldElucHV0KCkpOworCisgICAgcmV0dXJuIE5PX0VSUk9SOworfQorCitzdGF0dXNfdCBBdWRpb0ZsaW5nZXI6OnNldFN0cmVhbU91dHB1dCh1aW50MzJfdCBzdHJlYW0sIGludCBvdXRwdXQpCit7CisgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKyAgICBNaXhlclRocmVhZCAqZHN0VGhyZWFkID0gY2hlY2tNaXhlclRocmVhZF9sKG91dHB1dCk7CisgICAgaWYgKGRzdFRocmVhZCA9PSBOVUxMKSB7CisgICAgICAgIExPR1coInNldFN0cmVhbU91dHB1dCgpIGJhZCBvdXRwdXQgaWQgJWQiLCBvdXRwdXQpOworICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgIH0KKworICAgIExPR1YoInNldFN0cmVhbU91dHB1dCgpIHN0cmVhbSAlZCB0byBvdXRwdXQgJWQiLCBzdHJlYW0sIG91dHB1dCk7CisKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1QbGF5YmFja1RocmVhZHMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgUGxheWJhY2tUaHJlYWQgKnRocmVhZCA9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50MzJfdCAqcERldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcFNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwTGF0ZW5jeU1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MpOworCisgICAgdmlydHVhbCBpbnQgb3BlbkR1cGxpY2F0ZU91dHB1dChpbnQgb3V0cHV0MSwgaW50IG91dHB1dDIpOworCisgICAgdmlydHVhbCBzdGF0dXNfdCBjbG9zZU91dHB1dChpbnQgb3V0cHV0KTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3VzcGVuZE91dHB1dChpbnQgb3V0cHV0KTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgcmVzdG9yZU91dHB1dChpbnQgb3V0cHV0KTsKKworICAgIHZpcnR1YWwgaW50IG9wZW5JbnB1dCh1aW50MzJfdCAqcERldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBTYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBGb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBhY291c3RpY3MpOworCisgICAgdmlydHVhbCBzdGF0dXNfdCBjbG9zZUlucHV0KGludCBpbnB1dCk7CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IHNldFN0cmVhbU91dHB1dCh1aW50MzJfdCBzdHJlYW0sIGludCBvdXRwdXQpOworCiAgICAgLy8gSUJpbmRlcjo6RGVhdGhSZWNpcGllbnQKICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICBiaW5kZXJEaWVkKGNvbnN0IHdwPElCaW5kZXI+JiB3aG8pOwogCkBAIC0xMzksNyArMTU4LDcgQEAKICAgICAvLyByZWNvcmQgaW50ZXJmYWNlCiAgICAgdmlydHVhbCBzcDxJQXVkaW9SZWNvcmQ+IG9wZW5SZWNvcmQoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpZF90IHBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0U291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5wdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQsCkBAIC0xNTYsMjcgKzE3NSw3IEBACiBwcml2YXRlOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvRmxpbmdlcigpOwogICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgIH5BdWRpb0ZsaW5nZXIoKTsKLSAgICAKLSAgICB2b2lkICAgICAgICAgICAgICAgICAgICBzZXRPdXRwdXQoaW50IG91dHB1dFR5cGUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGRvU2V0T3V0cHV0KGludCBvdXRwdXRUeXBlKTsKIAotI2lmZGVmIFdJVEhfQTJEUAotICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIHNldEEyZHBFbmFibGVkX2woYm9vbCBlbmFibGUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGNoZWNrQTJkcEVuYWJsZWRDaGFuZ2VfbCgpOwotI2VuZGlmCi0gICAgc3RhdGljIGJvb2wgICAgICAgICAgICA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0gTWl4ZXJUaHJlYWQgLS0tCi0gICAgY2xhc3MgTWl4ZXJUaHJlYWQgOiBwdWJsaWMgVGhyZWFkIHsKKyAgICBjbGFzcyBUaHJlYWRCYXNlIDogcHVibGljIFRocmVhZCB7CiAgICAgcHVibGljOgotICAgICAgICAKLSAgICAgICAgLy8gLS0tIFRyYWNrIC0tLQorICAgICAgICBUaHJlYWRCYXNlIChjb25zdCBzcDxBdWRpb0ZsaW5nZXI+JiBhdWRpb0ZsaW5nZXIpOworICAgICAgICB2aXJ0dWFsICAgICAgICAgICAgIH5UaHJlYWRCYXNlKCk7CiAKICAgICAgICAgLy8gYmFzZSBmb3IgcmVjb3JkIGFuZCBwbGF5YmFjawogICAgICAgICBjbGFzcyBUcmFja0Jhc2UgOiBwdWJsaWMgQXVkaW9CdWZmZXJQcm92aWRlciwgcHVibGljIFJlZkJhc2UgewpAQCAtMjMwLDcgKzIzMiw3IEBACiAgICAgICAgICAgICAgICAgLy8gVGhlIHVwcGVyIDE2IGJpdHMgYXJlIHVzZWQgZm9yIHRyYWNrLXNwZWNpZmljIGZsYWdzLgogICAgICAgICAgICAgfTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcmFja0Jhc2UoY29uc3Qgc3A8TWl4ZXJUaHJlYWQ+JiBtaXhlclRocmVhZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJhY2tCYXNlKGNvbnN0IHdwPFRocmVhZEJhc2U+JiB0aHJlYWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8Q2xpZW50PiYgY2xpZW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCwKQEAgLTI0MywxMSArMjQ1LDE1IEBACiAgICAgICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHN0YXJ0KCkgPSAwOwogICAgICAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICBzdG9wKCkgPSAwOwogICAgICAgICAgICAgICAgICAgICBzcDxJTWVtb3J5PiBnZXRDYmxrKCkgY29uc3Q7CisgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3RyYWNrX2NibGtfdCogY2JsaygpIGNvbnN0IHsgcmV0dXJuIG1DYmxrOyB9CiAKICAgICAgICAgcHJvdGVjdGVkOgotICAgICAgICAgICAgZnJpZW5kIGNsYXNzIE1peGVyVGhyZWFkOworICAgICAgICAgICAgZnJpZW5kIGNsYXNzIFRocmVhZEJhc2U7CiAgICAgICAgICAgICBmcmllbmQgY2xhc3MgUmVjb3JkSGFuZGxlOwotICAgICAgICAgICAgZnJpZW5kIGNsYXNzIEF1ZGlvUmVjb3JkVGhyZWFkOworICAgICAgICAgICAgZnJpZW5kIGNsYXNzIFBsYXliYWNrVGhyZWFkOworICAgICAgICAgICAgZnJpZW5kIGNsYXNzIFJlY29yZFRocmVhZDsKKyAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBNaXhlclRocmVhZDsKKyAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBEaXJlY3RPdXRwdXRUaHJlYWQ7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJhY2tCYXNlKGNvbnN0IFRyYWNrQmFzZSYpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcmFja0Jhc2UmIG9wZXJhdG9yID0gKGNvbnN0IFRyYWNrQmFzZSYpOwpAQCAtMjU1LDEwICsyNjEsNiBAQAogICAgICAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBnZXROZXh0QnVmZmVyKEF1ZGlvQnVmZmVyUHJvdmlkZXI6OkJ1ZmZlciogYnVmZmVyKSA9IDA7CiAgICAgICAgICAgICB2aXJ0dWFsIHZvaWQgcmVsZWFzZUJ1ZmZlcihBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlcik7CiAKLSAgICAgICAgICAgIGF1ZGlvX3RyYWNrX2NibGtfdCogY2JsaygpIGNvbnN0IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbUNibGs7Ci0gICAgICAgICAgICB9Ci0KICAgICAgICAgICAgIGludCBmb3JtYXQoKSBjb25zdCB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1Gb3JtYXQ7CiAgICAgICAgICAgICB9CkBAIC0yNjksMTAgKzI3MSw2IEBACiAKICAgICAgICAgICAgIHZvaWQqIGdldEJ1ZmZlcih1aW50MzJfdCBvZmZzZXQsIHVpbnQzMl90IGZyYW1lcykgY29uc3Q7CiAKLSAgICAgICAgICAgIGludCBuYW1lKCkgY29uc3QgewotICAgICAgICAgICAgICAgIHJldHVybiBtTmFtZTsKLSAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgYm9vbCBpc1N0b3BwZWQoKSBjb25zdCB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1TdGF0ZSA9PSBTVE9QUEVEOwogICAgICAgICAgICAgfQpAQCAtMjg0LDE0ICsyODIsMTMgQEAKICAgICAgICAgICAgIGJvb2wgc3RlcCgpOwogICAgICAgICAgICAgdm9pZCByZXNldCgpOwogCi0gICAgICAgICAgICBzcDxNaXhlclRocmVhZD4gICAgIG1NaXhlclRocmVhZDsKKyAgICAgICAgICAgIHdwPFRocmVhZEJhc2U+ICAgICAgbVRocmVhZDsKICAgICAgICAgICAgIHNwPENsaWVudD4gICAgICAgICAgbUNsaWVudDsKICAgICAgICAgICAgIHNwPElNZW1vcnk+ICAgICAgICAgbUNibGtNZW1vcnk7CiAgICAgICAgICAgICBhdWRpb190cmFja19jYmxrX3QqIG1DYmxrOwogICAgICAgICAgICAgdm9pZCogICAgICAgICAgICAgICBtQnVmZmVyOwogICAgICAgICAgICAgdm9pZCogICAgICAgICAgICAgICBtQnVmZmVyRW5kOwogICAgICAgICAgICAgdWludDMyX3QgICAgICAgICAgICBtRnJhbWVDb3VudDsKLSAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgbU5hbWU7CiAgICAgICAgICAgICAvLyB3ZSBkb24ndCByZWFsbHkgbmVlZCBhIGxvY2sgZm9yIHRoZXNlCiAgICAgICAgICAgICBpbnQgICAgICAgICAgICAgICAgIG1TdGF0ZTsKICAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgbUNsaWVudFRpZDsKQEAgLTI5OSwxMCArMjk2LDY5IEBACiAgICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIG1GbGFnczsKICAgICAgICAgfTsKIAorICAgICAgICBjbGFzcyBDb25maWdFdmVudCB7CisgICAgICAgIHB1YmxpYzoKKyAgICAgICAgICAgIENvbmZpZ0V2ZW50KCkgOiBtRXZlbnQoMCksIG1QYXJhbSgwKSB7fQorCisgICAgICAgICAgICBpbnQgbUV2ZW50OworICAgICAgICAgICAgaW50IG1QYXJhbTsKKyAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAgICBzYW1wbGVSYXRlKCkgY29uc3Q7CisgICAgICAgICAgICAgICAgICAgIGludCAgICAgICAgIGNoYW5uZWxDb3VudCgpIGNvbnN0OworICAgICAgICAgICAgICAgICAgICBpbnQgICAgICAgICBmb3JtYXQoKSBjb25zdDsKKyAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICAgICAgZnJhbWVDb3VudCgpIGNvbnN0OworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICB3YWtlVXAoKSAgICB7IG1XYWl0V29ya0NWLmJyb2FkY2FzdCgpOyB9CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGV4aXQoKTsKKyAgICAgICAgdmlydHVhbCAgICAgYm9vbCAgICAgICAgY2hlY2tGb3JOZXdQYXJhbWV0ZXJzX2woKSA9IDA7CisgICAgICAgIHZpcnR1YWwgICAgIHN0YXR1c190ICAgIHNldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5VmFsdWVQYWlycyk7CisgICAgICAgIHZpcnR1YWwgICAgIFN0cmluZzggICAgIGdldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5cykgPSAwOworICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICBhdWRpb0NvbmZpZ0NoYW5nZWQoaW50IGV2ZW50LCBpbnQgcGFyYW0gPSAwKSA9IDA7CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHNlbmRDb25maWdFdmVudChpbnQgZXZlbnQsIGludCBwYXJhbSA9IDApOworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBzZW5kQ29uZmlnRXZlbnRfbChpbnQgZXZlbnQsIGludCBwYXJhbSA9IDApOworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBwcm9jZXNzQ29uZmlnRXZlbnRzKCk7CisKKyAgICAgICAgbXV0YWJsZSAgICAgTXV0ZXggICAgICAgICAgICAgICAgICAgbUxvY2s7CisKKyAgICBwcm90ZWN0ZWQ6CisKKyAgICAgICAgZnJpZW5kIGNsYXNzIFRyYWNrOworICAgICAgICBmcmllbmQgY2xhc3MgVHJhY2tCYXNlOworICAgICAgICBmcmllbmQgY2xhc3MgUGxheWJhY2tUaHJlYWQ7CisgICAgICAgIGZyaWVuZCBjbGFzcyBNaXhlclRocmVhZDsKKyAgICAgICAgZnJpZW5kIGNsYXNzIERpcmVjdE91dHB1dFRocmVhZDsKKyAgICAgICAgZnJpZW5kIGNsYXNzIER1cGxpY2F0aW5nVGhyZWFkOworICAgICAgICBmcmllbmQgY2xhc3MgUmVjb3JkVGhyZWFkOworICAgICAgICBmcmllbmQgY2xhc3MgUmVjb3JkVHJhY2s7CisKKyAgICAgICAgICAgICAgICAgICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Y7CisgICAgICAgICAgICAgICAgICAgIHNwPEF1ZGlvRmxpbmdlcj4gICAgICAgIG1BdWRpb0ZsaW5nZXI7CisgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIG1TYW1wbGVSYXRlOworICAgICAgICAgICAgICAgICAgICBzaXplX3QgICAgICAgICAgICAgICAgICBtRnJhbWVDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgbUNoYW5uZWxDb3VudDsKKyAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgbUZvcm1hdDsKKyAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgICAgICAgICAgICAgICAgbUZyYW1lU2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgbVBhcmFtQ29uZDsKKyAgICAgICAgICAgICAgICAgICAgVmVjdG9yPFN0cmluZzg+ICAgICAgICAgbU5ld1BhcmFtZXRlcnM7CisgICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgICAgIG1QYXJhbVN0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgVmVjdG9yPENvbmZpZ0V2ZW50ICo+ICAgbUNvbmZpZ0V2ZW50czsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgbVN0YW5kYnk7CisgICAgfTsKKworICAgIC8vIC0tLSBQbGF5YmFja1RocmVhZCAtLS0KKyAgICBjbGFzcyBQbGF5YmFja1RocmVhZCA6IHB1YmxpYyBUaHJlYWRCYXNlIHsKKyAgICBwdWJsaWM6CisKKyAgICAgICAgZW51bSB0eXBlIHsKKyAgICAgICAgICAgIE1JWEVSLAorICAgICAgICAgICAgRElSRUNULAorICAgICAgICAgICAgRFVQTElDQVRJTkcKKyAgICAgICAgfTsKKwogICAgICAgICAvLyBwbGF5YmFjayB0cmFjawogICAgICAgICBjbGFzcyBUcmFjayA6IHB1YmxpYyBUcmFja0Jhc2UgewogICAgICAgICBwdWJsaWM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRyYWNrKCAgY29uc3Qgc3A8TWl4ZXJUaHJlYWQ+JiBtaXhlclRocmVhZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJhY2soICBjb25zdCB3cDxUaHJlYWRCYXNlPiYgdGhyZWFkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPENsaWVudD4mIGNsaWVudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RyZWFtVHlwZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLApAQCAtMzIxLDYgKzM3Nyw5IEBACiAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGRlc3Ryb3koKTsKICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgbXV0ZShib29sKTsKICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgc2V0Vm9sdW1lKGZsb2F0IGxlZnQsIGZsb2F0IHJpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgaW50IG5hbWUoKSBjb25zdCB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbU5hbWU7CisgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICBpbnQgdHlwZSgpIGNvbnN0IHsKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtU3RyZWFtVHlwZTsKQEAgLTMyOCwyOSArMzg3LDI1IEBACiAKIAogICAgICAgICBwcm90ZWN0ZWQ6Ci0gICAgICAgICAgICBmcmllbmQgY2xhc3MgTWl4ZXJUaHJlYWQ7CisgICAgICAgICAgICBmcmllbmQgY2xhc3MgVGhyZWFkQmFzZTsKICAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBBdWRpb0ZsaW5nZXI7Ci0gICAgICAgICAgICBmcmllbmQgY2xhc3MgQXVkaW9GbGluZ2VyOjpUcmFja0hhbmRsZTsKKyAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBUcmFja0hhbmRsZTsKKyAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBQbGF5YmFja1RocmVhZDsKKyAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBNaXhlclRocmVhZDsKKyAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBEaXJlY3RPdXRwdXRUaHJlYWQ7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJhY2soY29uc3QgVHJhY2smKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJhY2smIG9wZXJhdG9yID0gKGNvbnN0IFRyYWNrJik7CiAKICAgICAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0TmV4dEJ1ZmZlcihBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlcik7Ci0KLSAgICAgICAgICAgIGJvb2wgaXNNdXRlZCgpIGNvbnN0IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gKG1NdXRlIHx8IG1NaXhlclRocmVhZC0+bVN0cmVhbVR5cGVzW21TdHJlYW1UeXBlXS5tdXRlKTsKLSAgICAgICAgICAgIH0KLQorICAgICAgICAgICAgYm9vbCBpc011dGVkKCkgeyByZXR1cm4gbU11dGU7IH0KICAgICAgICAgICAgIGJvb2wgaXNQYXVzaW5nKCkgY29uc3QgewogICAgICAgICAgICAgICAgIHJldHVybiBtU3RhdGUgPT0gUEFVU0lORzsKICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgYm9vbCBpc1BhdXNlZCgpIGNvbnN0IHsKICAgICAgICAgICAgICAgICByZXR1cm4gbVN0YXRlID09IFBBVVNFRDsKICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgYm9vbCBpc1JlYWR5KCkgY29uc3Q7Ci0KICAgICAgICAgICAgIHZvaWQgc2V0UGF1c2VkKCkgeyBtU3RhdGUgPSBQQVVTRUQ7IH0KICAgICAgICAgICAgIHZvaWQgcmVzZXQoKTsKIApAQCAtMzY0LDU0ICs0MTksMjAgQEAKICAgICAgICAgICAgIHNwPElNZW1vcnk+ICAgICAgICAgbVNoYXJlZEJ1ZmZlcjsKICAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgbVJlc2V0RG9uZTsKICAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgbVN0cmVhbVR5cGU7CisgICAgICAgICAgICBpbnQgICAgICAgICAgICAgICAgIG1OYW1lOwogICAgICAgICB9OyAgLy8gZW5kIG9mIFRyYWNrCiAKLSAgICAgICAgLy8gcmVjb3JkIHRyYWNrCi0gICAgICAgIGNsYXNzIFJlY29yZFRyYWNrIDogcHVibGljIFRyYWNrQmFzZSB7Ci0gICAgICAgIHB1YmxpYzoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVjb3JkVHJhY2soY29uc3Qgc3A8TWl4ZXJUaHJlYWQ+JiBtaXhlclRocmVhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxDbGllbnQ+JiBjbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0U291cmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hhbm5lbENvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgflJlY29yZFRyYWNrKCk7Ci0KLSAgICAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc3RhcnQoKTsKLSAgICAgICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgc3RvcCgpOwotCi0gICAgICAgICAgICAgICAgICAgIGJvb2wgICAgICAgIG92ZXJmbG93KCkgeyBib29sIHRtcCA9IG1PdmVyZmxvdzsgbU92ZXJmbG93ID0gZmFsc2U7IHJldHVybiB0bXA7IH0KLSAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgc2V0T3ZlcmZsb3coKSB7IGJvb2wgdG1wID0gbU92ZXJmbG93OyBtT3ZlcmZsb3cgPSB0cnVlOyByZXR1cm4gdG1wOyB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgaW5wdXRTb3VyY2UoKSBjb25zdCB7IHJldHVybiBtSW5wdXRTb3VyY2U7IH0KLQotICAgICAgICBwcml2YXRlOgotICAgICAgICAgICAgZnJpZW5kIGNsYXNzIEF1ZGlvRmxpbmdlcjsKLSAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBBdWRpb0ZsaW5nZXI6OlJlY29yZEhhbmRsZTsKLSAgICAgICAgICAgIGZyaWVuZCBjbGFzcyBBdWRpb0ZsaW5nZXI6OkF1ZGlvUmVjb3JkVGhyZWFkOwotICAgICAgICAgICAgZnJpZW5kIGNsYXNzIE1peGVyVGhyZWFkOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlY29yZFRyYWNrKGNvbnN0IFRyYWNrJik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlY29yZFRyYWNrJiBvcGVyYXRvciA9IChjb25zdCBUcmFjayYpOwotCi0gICAgICAgICAgICB2aXJ0dWFsIHN0YXR1c190IGdldE5leHRCdWZmZXIoQXVkaW9CdWZmZXJQcm92aWRlcjo6QnVmZmVyKiBidWZmZXIpOwotCi0gICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIG1PdmVyZmxvdzsKLSAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgbUlucHV0U291cmNlOwotICAgICAgICB9OwogCiAgICAgICAgIC8vIHBsYXliYWNrIHRyYWNrCiAgICAgICAgIGNsYXNzIE91dHB1dFRyYWNrIDogcHVibGljIFRyYWNrIHsKICAgICAgICAgcHVibGljOgotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGNsYXNzIEJ1ZmZlcjogcHVibGljIEF1ZGlvQnVmZmVyUHJvdmlkZXI6OkJ1ZmZlciB7CiAgICAgICAgICAgICBwdWJsaWM6CiAgICAgICAgICAgICAgICAgaW50MTZfdCAqbUJ1ZmZlcjsKICAgICAgICAgICAgIH07Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT3V0cHV0VHJhY2soICBjb25zdCBzcDxNaXhlclRocmVhZD4mIG1peGVyVGhyZWFkLAorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE91dHB1dFRyYWNrKCAgY29uc3Qgd3A8VGhyZWFkQmFzZT4mIHRocmVhZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudCwKQEAgLTQyMCwzNSArNDQxLDM1IEBACiAKICAgICAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc3RhcnQoKTsKICAgICAgICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgc3RvcCgpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICB3cml0ZShpbnQxNl90KiBkYXRhLCB1aW50MzJfdCBmcmFtZXMpOworICAgICAgICAgICAgICAgICAgICBib29sICAgICAgICB3cml0ZShpbnQxNl90KiBkYXRhLCB1aW50MzJfdCBmcmFtZXMpOwogICAgICAgICAgICAgICAgICAgICBib29sICAgICAgICBidWZmZXJRdWV1ZUVtcHR5KCkgeyByZXR1cm4gKG1CdWZmZXJRdWV1ZS5zaXplKCkgPT0gMCkgPyB0cnVlIDogZmFsc2U7IH0KKyAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgaXNBY3RpdmUoKSB7IHJldHVybiBtQWN0aXZlOyB9CisgICAgICAgICAgICB3cDxUaHJlYWRCYXNlPiYgICAgIHRocmVhZCgpICB7IHJldHVybiBtVGhyZWFkOyB9CiAKICAgICAgICAgcHJpdmF0ZToKIAotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICBvYnRhaW5CdWZmZXIoQXVkaW9CdWZmZXJQcm92aWRlcjo6QnVmZmVyKiBidWZmZXIpOworICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICBvYnRhaW5CdWZmZXIoQXVkaW9CdWZmZXJQcm92aWRlcjo6QnVmZmVyKiBidWZmZXIsIHVpbnQzMl90IHdhaXRUaW1lTXMpOwogICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICBjbGVhckJ1ZmZlclF1ZXVlKCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHNwPE1peGVyVGhyZWFkPiAgICAgICAgICAgICBtT3V0cHV0TWl4ZXJUaHJlYWQ7CisKKyAgICAgICAgICAgIC8vIE1heGltdW0gbnVtYmVyIG9mIHBlbmRpbmcgYnVmZmVycyBhbGxvY2F0ZWQgYnkgT3V0cHV0VHJhY2s6OndyaXRlKCkKKyAgICAgICAgICAgIHN0YXRpYyBjb25zdCB1aW50OF90IGtNYXhPdmVyRmxvd0J1ZmZlcnMgPSAzOworCiAgICAgICAgICAgICBWZWN0b3IgPCBCdWZmZXIqID4gICAgICAgICAgbUJ1ZmZlclF1ZXVlOwogICAgICAgICAgICAgQXVkaW9CdWZmZXJQcm92aWRlcjo6QnVmZmVyIG1PdXRCdWZmZXI7Ci0gICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgICAgICAgICAgbUZyYW1lc1dyaXR0ZW47Ci0gICAgICAgICAgICAKLSAgICAgICAgIH07ICAvLyBlbmQgb2YgT3V0cHV0VHJhY2sKKyAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICBtV2FpdFRpbWVNczsKKyAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZlOwogCi0gICAgICAgIE1peGVyVGhyZWFkIChjb25zdCBzcDxBdWRpb0ZsaW5nZXI+JiBhdWRpb0ZsaW5nZXIsIEF1ZGlvU3RyZWFtT3V0KiBvdXRwdXQsIGludCBvdXRwdXRUeXBlKTsKLSAgICAgICAgdmlydHVhbCAgICAgICAgICAgICB+TWl4ZXJUaHJlYWQoKTsKKyAgICAgICAgfTsgIC8vIGVuZCBvZiBPdXRwdXRUcmFjaworCisgICAgICAgIFBsYXliYWNrVGhyZWFkIChjb25zdCBzcDxBdWRpb0ZsaW5nZXI+JiBhdWRpb0ZsaW5nZXIsIEF1ZGlvU3RyZWFtT3V0KiBvdXRwdXQpOworICAgICAgICB2aXJ0dWFsICAgICAgICAgICAgIH5QbGF5YmFja1RocmVhZCgpOwogCiAgICAgICAgIHZpcnR1YWwgICAgIHN0YXR1c190ICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKTsKIAogICAgICAgICAvLyBUaHJlYWQgdmlydHVhbHMKLSAgICAgICAgdmlydHVhbCAgICAgYm9vbCAgICAgICAgdGhyZWFkTG9vcCgpOwogICAgICAgICB2aXJ0dWFsICAgICBzdGF0dXNfdCAgICByZWFkeVRvUnVuKCk7CiAgICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIG9uRmlyc3RSZWYoKTsKIAotICAgICAgICB2aXJ0dWFsICAgICB1aW50MzJfdCAgICBzYW1wbGVSYXRlKCkgY29uc3Q7Ci0gICAgICAgIHZpcnR1YWwgICAgIGludCAgICAgICAgIGNoYW5uZWxDb3VudCgpIGNvbnN0OwotICAgICAgICB2aXJ0dWFsICAgICBpbnQgICAgICAgICBmb3JtYXQoKSBjb25zdDsKLSAgICAgICAgdmlydHVhbCAgICAgc2l6ZV90ICAgICAgZnJhbWVDb3VudCgpIGNvbnN0OwogICAgICAgICB2aXJ0dWFsICAgICB1aW50MzJfdCAgICBsYXRlbmN5KCkgY29uc3Q7CiAKICAgICAgICAgdmlydHVhbCAgICAgc3RhdHVzX3QgICAgc2V0TWFzdGVyVm9sdW1lKGZsb2F0IHZhbHVlKTsKQEAgLTQ2Myw5ICs0ODQsOCBAQAogICAgICAgICB2aXJ0dWFsICAgICBmbG9hdCAgICAgICBzdHJlYW1Wb2x1bWUoaW50IHN0cmVhbSkgY29uc3Q7CiAgICAgICAgIHZpcnR1YWwgICAgIGJvb2wgICAgICAgIHN0cmVhbU11dGUoaW50IHN0cmVhbSkgY29uc3Q7CiAKLSAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgaXNNdXNpY0FjdGl2ZV9sKCkgY29uc3Q7Ci0gICAgICAgIAotICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgaXNNdXNpY0FjdGl2ZSgpIGNvbnN0OworCiAgICAgICAgICAgICAgICAgICAgIHNwPFRyYWNrPiAgIGNyZWF0ZVRyYWNrX2woCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxBdWRpb0ZsaW5nZXI6OkNsaWVudD4mIGNsaWVudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdHJlYW1UeXBlLApAQCAtNDc1LDEzICs0OTUsMTUgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICpzdGF0dXMpOwotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgZ2V0VHJhY2tzX2woU29ydGVkVmVjdG9yIDwgc3A8VHJhY2s+ID4mIHRyYWNrcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNvcnRlZFZlY3RvciA8IHdwPFRyYWNrPiA+JiBhY3RpdmVUcmFja3MpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBwdXRUcmFja3NfbChTb3J0ZWRWZWN0b3IgPCBzcDxUcmFjaz4gPiYgdHJhY2tzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU29ydGVkVmVjdG9yIDwgd3A8VHJhY2s+ID4mIGFjdGl2ZVRyYWNrcyk7Ci0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHNldE91cHV0VHJhY2soT3V0cHV0VHJhY2sgKnRyYWNrKSB7IG1PdXRwdXRUcmFjayA9IHRyYWNrOyB9Ci0gICAgICAgICAgICAgICAgICAgIAorCisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3RyZWFtT3V0KiBnZXRPdXRwdXQoKSB7IHJldHVybiBtT3V0cHV0OyB9CisKKyAgICAgICAgdmlydHVhbCAgICAgaW50ICAgICAgICAgdHlwZSgpIGNvbnN0IHsgcmV0dXJuIG1UeXBlOyB9CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHN1c3BlbmQoKSB7IG1TdXNwZW5kZWQrKzsgfQorICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICByZXN0b3JlKCkgeyBpZiAobVN1c3BlbmRlZCkgbVN1c3BlbmRlZC0tOyB9CisgICAgICAgIHZpcnR1YWwgICAgIFN0cmluZzggICAgIGdldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5cyk7CisgICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIGF1ZGlvQ29uZmlnQ2hhbmdlZChpbnQgZXZlbnQsIGludCBwYXJhbSA9IDApOworCiAgICAgICAgIHN0cnVjdCAgc3RyZWFtX3R5cGVfdCB7CiAgICAgICAgICAgICBzdHJlYW1fdHlwZV90KCkKICAgICAgICAgICAgICAgICA6ICAgdm9sdW1lKDEuMGYpLApAQCAtNDkyLDU2ICs1MTQsMTE1IEBACiAgICAgICAgICAgICBib29sICAgICAgICBtdXRlOwogICAgICAgICB9OwogCisgICAgcHJvdGVjdGVkOgorICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UeXBlOworICAgICAgICBpbnQxNl90KiAgICAgICAgICAgICAgICAgICAgICAgIG1NaXhCdWZmZXI7CisgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN1c3BlbmRlZDsKKyAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnl0ZXNXcml0dGVuOworICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYXN0ZXJNdXRlOworICAgICAgICBTb3J0ZWRWZWN0b3I8IHdwPFRyYWNrPiA+ICAgICAgIG1BY3RpdmVUcmFja3M7CisKICAgICBwcml2YXRlOgogCi0KICAgICAgICAgZnJpZW5kIGNsYXNzIEF1ZGlvRmxpbmdlcjsKKyAgICAgICAgZnJpZW5kIGNsYXNzIE91dHB1dFRyYWNrOwogICAgICAgICBmcmllbmQgY2xhc3MgVHJhY2s7CiAgICAgICAgIGZyaWVuZCBjbGFzcyBUcmFja0Jhc2U7Ci0gICAgICAgIGZyaWVuZCBjbGFzcyBSZWNvcmRUcmFjazsKLSAgICAgICAgCi0gICAgICAgIE1peGVyVGhyZWFkKGNvbnN0IENsaWVudCYpOwotICAgICAgICBNaXhlclRocmVhZCYgb3BlcmF0b3IgPSAoY29uc3QgTWl4ZXJUaHJlYWQmKTsKLSAgCisgICAgICAgIGZyaWVuZCBjbGFzcyBNaXhlclRocmVhZDsKKyAgICAgICAgZnJpZW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8U3RyaW5nMTY+JiBhcmdzKTsKICAgICAgICAgc3RhdHVzX3QgICAgZHVtcFRyYWNrcyhpbnQgZmQsIGNvbnN0IFZlY3RvcjxTdHJpbmcxNj4mIGFyZ3MpOwotICAgICAgICAKLSAgICAgICAgc3A8QXVkaW9GbGluZ2VyPiAgICAgICAgICAgICAgICBtQXVkaW9GbGluZ2VyOyAgICAgICAKLSAgICAgICAgU29ydGVkVmVjdG9yPCB3cDxUcmFjaz4gPiAgICAgICBtQWN0aXZlVHJhY2tzOworCiAgICAgICAgIFNvcnRlZFZlY3Rvcjwgc3A8VHJhY2s+ID4gICAgICAgbVRyYWNrczsKLSAgICAgICAgc3RyZWFtX3R5cGVfdCAgICAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZXNbQXVkaW9TeXN0ZW06Ok5VTV9TVFJFQU1fVFlQRVNdOwotICAgICAgICBBdWRpb01peGVyKiAgICAgICAgICAgICAgICAgICAgIG1BdWRpb01peGVyOworICAgICAgICAvLyBtU3RyZWFtVHlwZXNbXSB1c2VzIDEgYWRkaXRpb25uYWwgc3RyZWFtIHR5cGUgaW50ZXJuYWxseSBmb3IgdGhlIE91dHB1dFRyYWNrIHVzZWQgYnkgRHVwbGljYXRpbmdUaHJlYWQKKyAgICAgICAgc3RyZWFtX3R5cGVfdCAgICAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZXNbQXVkaW9TeXN0ZW06Ok5VTV9TVFJFQU1fVFlQRVMgKyAxXTsKICAgICAgICAgQXVkaW9TdHJlYW1PdXQqICAgICAgICAgICAgICAgICBtT3V0cHV0OwotICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1PdXRwdXRUeXBlOwotICAgICAgICB1aW50MzJfdCAgICAgICAgICAgICAgICAgICAgICAgIG1TYW1wbGVSYXRlOwotICAgICAgICBzaXplX3QgICAgICAgICAgICAgICAgICAgICAgICAgIG1GcmFtZUNvdW50OwotICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DaGFubmVsQ291bnQ7Ci0gICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZvcm1hdDsKLSAgICAgICAgaW50MTZfdCogICAgICAgICAgICAgICAgICAgICAgICBtTWl4QnVmZmVyOwogICAgICAgICBmbG9hdCAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYXN0ZXJWb2x1bWU7Ci0gICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hc3Rlck11dGU7CiAgICAgICAgIG5zZWNzX3QgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RXcml0ZVRpbWU7CiAgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU51bVdyaXRlczsKICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTnVtRGVsYXllZFdyaXRlczsKLSAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhbmRieTsKICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW5Xcml0ZTsKLSAgICAgICAgc3AgPE91dHB1dFRyYWNrPiAgICAgICAgICAgICAgICBtT3V0cHV0VHJhY2s7CisgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1pbkJ5dGVzVG9Xcml0ZTsKICAgICB9OwogCi0gICAgCisgICAgY2xhc3MgTWl4ZXJUaHJlYWQgOiBwdWJsaWMgUGxheWJhY2tUaHJlYWQgeworICAgIHB1YmxpYzoKKyAgICAgICAgTWl4ZXJUaHJlYWQgKGNvbnN0IHNwPEF1ZGlvRmxpbmdlcj4mIGF1ZGlvRmxpbmdlciwgQXVkaW9TdHJlYW1PdXQqIG91dHB1dCk7CisgICAgICAgIHZpcnR1YWwgICAgICAgICAgICAgfk1peGVyVGhyZWFkKCk7CisKKyAgICAgICAgLy8gVGhyZWFkIHZpcnR1YWxzCisgICAgICAgIHZpcnR1YWwgICAgIGJvb2wgICAgICAgIHRocmVhZExvb3AoKTsKKworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBnZXRUcmFja3MoU29ydGVkVmVjdG9yIDwgc3A8VHJhY2s+ID4mIHRyYWNrcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU29ydGVkVmVjdG9yIDwgd3A8VHJhY2s+ID4mIGFjdGl2ZVRyYWNrcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0cmVhbVR5cGUpOworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBwdXRUcmFja3MoU29ydGVkVmVjdG9yIDwgc3A8VHJhY2s+ID4mIHRyYWNrcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU29ydGVkVmVjdG9yIDwgd3A8VHJhY2s+ID4mIGFjdGl2ZVRyYWNrcyk7CisgICAgICAgIHZpcnR1YWwgICAgIGludCAgICAgICAgIGdldFRyYWNrTmFtZV9sKCk7CisgICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIGRlbGV0ZVRyYWNrTmFtZV9sKGludCBuYW1lKTsKKyAgICAgICAgdmlydHVhbCAgICAgYm9vbCAgICAgICAgY2hlY2tGb3JOZXdQYXJhbWV0ZXJzX2woKTsKKyAgICAgICAgdmlydHVhbCAgICAgc3RhdHVzX3QgICAgZHVtcEludGVybmFscyhpbnQgZmQsIGNvbnN0IFZlY3RvcjxTdHJpbmcxNj4mIGFyZ3MpOworCisgICAgcHJvdGVjdGVkOgorICAgICAgICBzaXplX3QgcHJlcGFyZVRyYWNrc19sKGNvbnN0IFNvcnRlZFZlY3Rvcjwgd3A8VHJhY2s+ID4mIGFjdGl2ZVRyYWNrcywgVmVjdG9yPCBzcDxUcmFjaz4gPiAqdHJhY2tzVG9SZW1vdmUpOworCisgICAgICAgIEF1ZGlvTWl4ZXIqICAgICAgICAgICAgICAgICAgICAgbUF1ZGlvTWl4ZXI7CisgICAgfTsKKworICAgIGNsYXNzIERpcmVjdE91dHB1dFRocmVhZCA6IHB1YmxpYyBQbGF5YmFja1RocmVhZCB7CisgICAgcHVibGljOgorCisgICAgICAgIERpcmVjdE91dHB1dFRocmVhZCAoY29uc3Qgc3A8QXVkaW9GbGluZ2VyPiYgYXVkaW9GbGluZ2VyLCBBdWRpb1N0cmVhbU91dCogb3V0cHV0KTsKKyAgICAgICAgfkRpcmVjdE91dHB1dFRocmVhZCgpOworCisgICAgICAgIC8vIFRocmVhZCB2aXJ0dWFscworICAgICAgICB2aXJ0dWFsICAgICBib29sICAgICAgICB0aHJlYWRMb29wKCk7CisKKyAgICAgICAgdmlydHVhbCAgICAgaW50ICAgICAgICAgZ2V0VHJhY2tOYW1lX2woKTsKKyAgICAgICAgdmlydHVhbCAgICAgdm9pZCAgICAgICAgZGVsZXRlVHJhY2tOYW1lX2woaW50IG5hbWUpOworICAgICAgICB2aXJ0dWFsICAgICBib29sICAgICAgICBjaGVja0Zvck5ld1BhcmFtZXRlcnNfbCgpOworCisgICAgcHJpdmF0ZToKKyAgICAgICAgZmxvYXQgbUxlZnRWb2x1bWU7CisgICAgICAgIGZsb2F0IG1SaWdodFZvbHVtZTsKKyAgICB9OworCisgICAgY2xhc3MgRHVwbGljYXRpbmdUaHJlYWQgOiBwdWJsaWMgTWl4ZXJUaHJlYWQgeworICAgIHB1YmxpYzoKKyAgICAgICAgRHVwbGljYXRpbmdUaHJlYWQgKGNvbnN0IHNwPEF1ZGlvRmxpbmdlcj4mIGF1ZGlvRmxpbmdlciwgTWl4ZXJUaHJlYWQqIG1haW5UaHJlYWQpOworICAgICAgICB+RHVwbGljYXRpbmdUaHJlYWQoKTsKKworICAgICAgICAvLyBUaHJlYWQgdmlydHVhbHMKKyAgICAgICAgdmlydHVhbCAgICAgYm9vbCAgICAgICAgdGhyZWFkTG9vcCgpOworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBhZGRPdXRwdXRUcmFjayhNaXhlclRocmVhZCogdGhyZ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VhbCAgICAgICAgICAgICB+VHJhY2tIYW5kbGUoKTsKICAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICBzdGFydCgpOwogICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHN0b3AoKTsKQEAgLTU1MywyMCArNjM0LDkxIEBACiAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3Qgb25UcmFuc2FjdCgKICAgICAgICAgICAgIHVpbnQzMl90IGNvZGUsIGNvbnN0IFBhcmNlbCYgZGF0YSwgUGFyY2VsKiByZXBseSwgdWludDMyX3QgZmxhZ3MpOwogICAgIHByaXZhdGU6Ci0gICAgICAgIHNwPE1peGVyVGhyZWFkOjpUcmFjaz4gbVRyYWNrOworICAgICAgICBzcDxQbGF5YmFja1RocmVhZDo6VHJhY2s+IG1UcmFjazsKICAgICB9OwogCiAgICAgZnJpZW5kIGNsYXNzIENsaWVudDsKLSAgICBmcmllbmQgY2xhc3MgTWl4ZXJUaHJlYWQ6OlRyYWNrOworICAgIGZyaWVuZCBjbGFzcyBQbGF5YmFja1RocmVhZDo6VHJhY2s7CiAKIAogICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHJlbW92ZUNsaWVudChwaWRfdCBwaWQpOwogCiAKKyAgICAvLyByZWNvcmQgdGhyZWFkCisgICAgY2xhc3MgUmVjb3JkVGhyZWFkIDogcHVibGljIFRocmVhZEJhc2UsIHB1YmxpYyBBdWRpb0J1ZmZlclByb3ZpZGVyCisgICAgeworICAgIHB1YmxpYzoKKworICAgICAgICAvLyByZWNvcmQgdHJhY2sKKyAgICAgICAgY2xhc3MgUmVjb3JkVHJhY2sgOiBwdWJsaWMgVHJhY2tCYXNlIHsKKyAgICAgICAgcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWNvcmRUcmFjayhjb25zdCB3cDxUaHJlYWRCYXNlPiYgdGhyZWFkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPENsaWVudD4mIGNsaWVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH5SZWNvcmRUcmFjaygpOworCisgICAgICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHN0YXJ0KCk7CisgICAgICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHN0b3AoKTsKKworICAgICAgICAgICAgICAgICAgICBib29sICAgICAgICBvdmVyZmxvdygpIHsgYm9vbCB0bXAgPSBtT3ZlcmZsb3c7IG1PdmVyZmxvdyA9IGZhbHNlOyByZXR1cm4gdG1wOyB9CisgICAgICAgICAgICAgICAgICAgIGJvb2wgICAgICAgIHNldE92ZXJmbG93KCkgeyBib29sIHRtcCA9IG1PdmVyZmxvdzsgbU92ZXJmbG93ID0gdHJ1ZTsgcmV0dXJuIHRtcDsgfQorCisgICAgICAgIHByaXZhdGU6CisgICAgICAgICAgICBmcmllbmQgY2xhc3MgQXVkaW9GbGluZ2VyOworICAgICAgICAgICAgZnJpZW5kIGNsYXNzIFJlY29yZFRocmVhZDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWNvcmRUcmFjayhjb25zdCBSZWNvcmRUcmFjayYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWNvcmRUcmFjayYgb3BlcmF0b3IgPSAoY29uc3QgUmVjb3JkVHJhY2smKTsKKworICAgICAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBnZXROZXh0QnVmZmVyKEF1ZGlvQnVmZmVyUHJvdmlkZXI6OkJ1ZmZlciogYnVmZmVyKTsKKworICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICBtT3ZlcmZsb3c7CisgICAgICAgIH07CisKKworICAgICAgICAgICAgICAgIFJlY29yZFRocmVhZChjb25zdCBzcDxBdWRpb0ZsaW5nZXI+JiBhdWRpb0ZsaW5nZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N0cmVhbUluICppbnB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscyk7CisgICAgICAgICAgICAgICAgflJlY29yZFRocmVhZCgpOworCisgICAgICAgIHZpcnR1YWwgYm9vbCAgICAgICAgdGhyZWFkTG9vcCgpOworICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHJlYWR5VG9SdW4oKSB7IHJldHVybiBOT19FUlJPUjsgfQorICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIG9uRmlyc3RSZWYoKTsKKworICAgICAgICAgICAgICAgIHN0YXR1c190ICAgIHN0YXJ0KFJlY29yZFRyYWNrKiByZWNvcmRUcmFjayk7CisgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgc3RvcChSZWNvcmRUcmFjayogcmVjb3JkVHJhY2spOworICAgICAgICAgICAgICAgIHN0YXR1c190ICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKTsKKyAgICAgICAgICAgICAgICBBdWRpb1N0cmVhbUluKiBnZXRJbnB1dCgpIHsgcmV0dXJuIG1JbnB1dDsgfQorCisgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgZ2V0TmV4dEJ1ZmZlcihBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlcik7CisgICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgcmVsZWFzZUJ1ZmZlcihBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlcik7CisgICAgICAgIHZpcnR1YWwgYm9vbCAgICAgICAgY2hlY2tGb3JOZXdQYXJhbWV0ZXJzX2woKTsKKyAgICAgICAgdmlydHVhbCBTdHJpbmc4ICAgICBnZXRQYXJhbWV0ZXJzKGNvbnN0IFN0cmluZzgmIGtleXMpOworICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIGF1ZGlvQ29uZmlnQ2hhbmdlZChpbnQgZXZlbnQsIGludCBwYXJhbSA9IDApOworICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHJlYWRJbnB1dFBhcmFtZXRlcnMoKTsKKworICAgIHByaXZhdGU6CisgICAgICAgICAgICAgICAgUmVjb3JkVGhyZWFkKCk7CisgICAgICAgICAgICAgICAgQXVkaW9TdHJlYW1JbiAgICAgICAgICAgICAgICAgICAgICAgKm1JbnB1dDsKKyAgICAgICAgICAgICAgICBzcDxSZWNvcmRUcmFjaz4gICAgICAgICAgICAgICAgICAgICBtQWN0aXZlVHJhY2s7CisgICAgICAgICAgICAgICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0U3RvcENvbmQ7CisgICAgICAgICAgICAgICAgQXVkaW9SZXNhbXBsZXIgICAgICAgICAgICAgICAgICAgICAgKm1SZXNhbXBsZXI7CisgICAgICAgICAgICAgICAgaW50MzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKm1Sc21wT3V0QnVmZmVyOworICAgICAgICAgICAgICAgIGludDE2X3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICptUnNtcEluQnVmZmVyOworICAgICAgICAgICAgICAgIHNpemVfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sc21wSW5JbmRleDsKKyAgICAgICAgICAgICAgICBzaXplX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW5wdXRCeXRlczsKKyAgICAgICAgICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVxQ2hhbm5lbENvdW50OworICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1SZXFTYW1wbGVSYXRlOworICAgIH07CiAKICAgICBjbGFzcyBSZWNvcmRIYW5kbGUgOiBwdWJsaWMgYW5kcm9pZDo6Qm5BdWRpb1JlY29yZCB7CiAgICAgcHVibGljOgotICAgICAgICBSZWNvcmRIYW5kbGUoY29uc3Qgc3A8TWl4ZXJUaHJlYWQ6OlJlY29yZFRyYWNrPiYgcmVjb3JkVHJhY2spOworICAgICAgICBSZWNvcmRIYW5kbGUoY29uc3Qgc3A8UmVjb3JkVGhyZWFkOjpSZWNvcmRUcmFjaz4mIHJlY29yZFRyYWNrKTsKICAgICAgICAgdmlydHVhbCAgICAgICAgICAgICB+UmVjb3JkSGFuZGxlKCk7CiAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc3RhcnQoKTsKICAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICBzdG9wKCk7CkBAIC01NzQsNjYgKzcyNiwzMSBAQAogICAgICAgICB2aXJ0dWFsIHN0YXR1c190IG9uVHJhbnNhY3QoCiAgICAgICAgICAgICB1aW50MzJfdCBjb2RlLCBjb25zdCBQYXJjZWwmIGRhdGEsIFBhcmNlbCogcmVwbHksIHVpbnQzMl90IGZsYWdzKTsKICAgICBwcml2YXRlOgotICAgICAgICBzcDxNaXhlclRocmVhZDo6UmVjb3JkVHJhY2s+IG1SZWNvcmRUcmFjazsKKyAgICAgICAgc3A8UmVjb3JkVGhyZWFkOjpSZWNvcmRUcmFjaz4gbVJlY29yZFRyYWNrOwogICAgIH07CiAKLSAgICAvLyByZWNvcmQgdGhyZWFkCi0gICAgY2xhc3MgQXVkaW9SZWNvcmRUaHJlYWQgOiBwdWJsaWMgVGhyZWFkCi0gICAgewotICAgIHB1YmxpYzoKLSAgICAgICAgQXVkaW9SZWNvcmRUaHJlYWQoQXVkaW9IYXJkd2FyZUludGVyZmFjZSogYXVkaW9IYXJkd2FyZSwgY29uc3Qgc3A8QXVkaW9GbGluZ2VyPiYgYXVkaW9GbGluZ2VyKTsKLSAgICAgICAgdmlydHVhbCAgICAgICAgICAgICB+QXVkaW9SZWNvcmRUaHJlYWQoKTsKLSAgICAgICAgdmlydHVhbCBib29sICAgICAgICB0aHJlYWRMb29wKCk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgcmVhZHlUb1J1bigpIHsgcmV0dXJuIE5PX0VSUk9SOyB9Ci0gICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgb25GaXJzdFJlZigpIHt9CisgICAgZnJpZW5kIGNsYXNzIFJlY29yZFRocmVhZDsKKyAgICBmcmllbmQgY2xhc3MgUGxheWJhY2tUaHJlYWQ7CiAKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICBzdGFydChNaXhlclRocmVhZDo6UmVjb3JkVHJhY2sqIHJlY29yZFRyYWNrKTsKLSAgICAgICAgICAgICAgICB2b2lkICAgICAgICBzdG9wKE1peGVyVGhyZWFkOjpSZWNvcmRUcmFjayogcmVjb3JkVHJhY2spOwotICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGV4aXQoKTsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICBkdW1wKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiYgYXJncyk7CiAKLSAgICBwcml2YXRlOgotICAgICAgICAgICAgICAgIEF1ZGlvUmVjb3JkVGhyZWFkKCk7Ci0gICAgICAgICAgICAgICAgQXVkaW9IYXJkd2FyZUludGVyZmFjZSAgICAgICAgICAgICAgKm1BdWRpb0hhcmR3YXJlOwotICAgICAgICAgICAgICAgIHNwPEF1ZGlvRmxpbmdlcj4gICAgICAgICAgICAgICAgICAgIG1BdWRpb0ZsaW5nZXI7Ci0gICAgICAgICAgICAgICAgc3A8TWl4ZXJUaHJlYWQ6OlJlY29yZFRyYWNrPiAgICAgICAgbVJlY29yZFRyYWNrOwotICAgICAgICAgICAgICAgIE11dGV4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Mb2NrOwotICAgICAgICAgICAgICAgIENvbmRpdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1XYWl0V29ya0NWOwotICAgICAgICAgICAgICAgIENvbmRpdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TdG9wcGVkOwotICAgICAgICAgICAgICAgIHZvbGF0aWxlIGJvb2wgICAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmU7Ci0gICAgICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0U3RhdHVzOwotICAgIH07Ci0KLSAgICBmcmllbmQgY2xhc3MgQXVkaW9SZWNvcmRUaHJlYWQ7Ci0gICAgZnJpZW5kIGNsYXNzIE1peGVyVGhyZWFkOwotCi0gICAgICAgICAgICAgICAgc3RhdHVzX3QgICAgc3RhcnRSZWNvcmQoTWl4ZXJUaHJlYWQ6OlJlY29yZFRyYWNrKiByZWNvcmRUcmFjayk7Ci0gICAgICAgICAgICAgICAgdm9pZCAgICAgICAgc3RvcFJlY29yZChNaXhlclRocmVhZDo6UmVjb3JkVHJhY2sqIHJlY29yZFRyYWNrKTsKLQotICAgIG11dGFibGUgICAgIE11dGV4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IYXJkd2FyZUxvY2s7CiAgICAgbXV0YWJsZSAgICAgTXV0ZXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxvY2s7Ci0gICAgbXV0YWJsZSAgICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Y7CiAKICAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8IHBpZF90LCB3cDxDbGllbnQ+ID4gICAgIG1DbGllbnRzOwogCi0gICAgICAgICAgICAgICAgc3A8TWl4ZXJUaHJlYWQ+ICAgICAgICAgICAgICAgICAgICAgbUEyZHBNaXhlclRocmVhZDsKLSAgICAgICAgICAgICAgICBzcDxNaXhlclRocmVhZD4gICAgICAgICAgICAgICAgICAgICBtSGFyZHdhcmVNaXhlclRocmVhZDsKKyAgICAgICAgICAgICAgICBtdXRhYmxlICAgICBNdXRleCAgICAgICAgICAgICAgICAgICBtSGFyZHdhcmVMb2NrOwogICAgICAgICAgICAgICAgIEF1ZGlvSGFyZHdhcmVJbnRlcmZhY2UqICAgICAgICAgICAgIG1BdWRpb0hhcmR3YXJlOwotICAgICAgICAgICAgICAgIEF1ZGlvSGFyZHdhcmVJbnRlcmZhY2UqICAgICAgICAgICAgIG1BMmRwQXVkaW9JbnRlcmZhY2U7Ci0gICAgICAgICAgICAgICAgc3A8QXVkaW9SZWNvcmRUaHJlYWQ+ICAgICAgICAgICAgICAgbUF1ZGlvUmVjb3JkVGhyZWFkOwotICAgICAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BMmRwRW5hYmxlZDsKLSAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm90aWZ5QTJkcENoYW5nZTsKICAgICBtdXRhYmxlICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGFyZHdhcmVTdGF0dXM7Ci0gICAgICAgICAgICAgICAgU29ydGVkVmVjdG9yPCB3cDxJQmluZGVyPiA+ICAgICAgICAgbU5vdGlmaWNhdGlvbkNsaWVudHM7Ci0gICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZvcmNlZFNwZWFrZXJDb3VudDsKLSAgICAgICAgICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQTJkcERpc2FibGVDb3VudDsKIAotICAgICAgICAgICAgICAgIC8vIHRydWUgaWYgQTJEUCBzaG91bGQgcmVzdW1lIHdoZW4gbUEyZHBEaXNhYmxlQ291bnQgcmV0dXJucyB0byB6ZXJvCi0gICAgICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUEyZHBTdXBwcmVzc2VkOwotICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TYXZlZFJvdXRlOwotICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Gb3JjZWRSb3V0ZTsKLSAgICAgICAgICAgICAgICBuc2Vjc190ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVSZXN0b3JlVGltZTsKLSAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTXVzaWNNdXRlU2F2ZWQ7CisKKyAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8IGludCwgc3A8UGxheWJhY2tUaHJlYWQ+ID4gIG1QbGF5YmFja1RocmVhZHM7CisgICAgICAgICAgICAgICAgUGxheWJhY2tUaHJlYWQ6OnN0cmVhbV90eXBlX3QgICAgICAgbVN0cmVhbVR5cGVzW0F1ZGlvU3lzdGVtOjpOVU1fU1RSRUFNX1RZUEVTXTsKKyAgICAgICAgICAgICAgICBmbG9hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWFzdGVyVm9sdW1lOworICAgICAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYXN0ZXJNdXRlOworCisgICAgICAgICAgICAgICAgRGVmYXVsdEtleWVkVmVjdG9yPCBpbnQsIHNwPFJlY29yZFRocmVhZD4gPiAgICBtUmVjb3JkVGhyZWFkczsKKworICAgICAgICAgICAgICAgIFNvcnRlZFZlY3Rvcjwgc3A8SUJpbmRlcj4gPiAgICAgICAgIG1Ob3RpZmljYXRp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5kYnkoKTsKICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKTsKKyAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHNldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5VmFsdWVQYWlycyk7CisgICAgdmlydHVhbCBTdHJpbmc4ICAgICBnZXRQYXJhbWV0ZXJzKGNvbnN0IFN0cmluZzgmIGtleXMpOwogCiBwcml2YXRlOgogICAgIEF1ZGlvSGFyZHdhcmVHZW5lcmljICptQXVkaW9IYXJkd2FyZTsKICAgICBNdXRleCAgIG1Mb2NrOwogICAgIGludCAgICAgbUZkOworICAgIHVpbnQzMl90IG1EZXZpY2U7CiB9OwogCiBjbGFzcyBBdWRpb1N0cmVhbUluR2VuZXJpYyA6IHB1YmxpYyBBdWRpb1N0cmVhbUluIHsKQEAgLTY3LDI0ICs3MSwyOCBAQAogICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc2V0KAogICAgICAgICAgICAgQXVkaW9IYXJkd2FyZUdlbmVyaWMgKmh3LAogICAgICAgICAgICAgaW50IG1GZCwKLSAgICAgICAgICAgIGludCBmb3JtYXQsCi0gICAgICAgICAgICBpbnQgY2hhbm5lbENvdW50LAotICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKKyAgICAgICAgICAgIHVpbnQzMl90IGRldmljZXMsCisgICAgICAgICAgICBpbnQgKnBGb3JtYXQsCisgICAgICAgICAgICB1aW50MzJfdCAqcENoYW5uZWxzLAorICAgICAgICAgICAgdWludDMyX3QgKnBSYXRlLAogICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcyBhY291c3RpY3MpOwogCi0gICAgdWludDMyX3QgICAgc2FtcGxlUmF0ZSgpIGNvbnN0IHsgcmV0dXJuIDgwMDA7IH0KKyAgICB2aXJ0dWFsIHVpbnQzMl90ICAgIHNhb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MSwyOCArMTA5LDI3IEBACiAgICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXRNaWNNdXRlKGJvb2wgc3RhdGUpOwogICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgZ2V0TWljTXV0ZShib29sKiBzdGF0ZSk7CiAKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHNldFBhcmFtZXRlcihjb25zdCBjaGFyKiBrZXksIGNvbnN0IGNoYXIqIHZhbHVlKQotICAgICAgICAgICAgeyByZXR1cm4gTk9fRVJST1I7IH0KLQogICAgIC8vIGNyZWF0ZSBJL08gc3RyZWFtcwogICAgIHZpcnR1YWwgQXVkaW9TdHJlYW1PdXQqIG9wZW5PdXRwdXRTdHJlYW0oCi0gICAgICAgICAgICBpbnQgZm9ybWF0PTAsCi0gICAgICAgICAgICBpbnQgY2hhbm5lbENvdW50PTAsCi0gICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlPTAsCisgICAgICAgICAgICB1aW50MzJfdCBkZXZpY2VzLAorICAgICAgICAgICAgaW50ICpmb3JtYXQ9MCwKKyAgICAgICAgICAgIHVpbnQzMl90ICpjaGFubmVscz0wLAorICAgICAgICAgICAgdWludDMyX3QgKnNhbXBsZVJhdGU9MCwKICAgICAgICAgICAgIHN0YXR1c190ICpzdGF0dXM9MCk7CisgICAgdmlydHVhbCAgICB2b2lkICAgICAgICBjbG9zZU91dHB1dFN0cmVhbShBdWRpb1N0cmVhbU91dCogb3V0KTsKIAogICAgIHZpcnR1YWwgQXVkaW9TdHJlYW1Jbiogb3BlbklucHV0U3RyZWFtKAotICAgICAgICAgICAgaW50IGlucHV0U291cmNlLAotICAgICAgICAgICAgaW50IGZvcm1hdCwKLSAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQsCi0gICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAorICAgICAgICAgICAgdWludDMyX3QgZGV2aWNlcywKKyAgICAgICAgICAgIGludCAqZm9ybWF0LAorICAgICAgICAgICA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ljTXV0ZShib29sKiBzdGF0ZSkgeyAqc3RhdGUgPSBtTWljTXV0ZSA7IHJldHVybiBOT19FUlJPUjsgfQogCi0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXRQYXJhbWV0ZXIoY29uc3QgY2hhcioga2V5LCBjb25zdCBjaGFyKiB2YWx1ZSkKLSAgICAgICAgICAgIHsgcmV0dXJuIE5PX0VSUk9SOyB9Ci0KICAgICAvLyBjcmVhdGUgSS9PIHN0cmVhbXMKICAgICB2aXJ0dWFsIEF1ZGlvU3RyZWFtT3V0KiBvcGVuT3V0cHV0U3RyZWFtKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZm9ybWF0PTAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQ9MCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZT0wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmZvcm1hdD0wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqY2hhbm5lbHM9MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnNhbXBsZVJhdGU9MCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cz0wKTsKKyAgICB2aXJ0dWFsICAgIHZvaWQgICAgICAgIGNsb3NlT3V0cHV0U3RyZWFtKEF1ZGlvU3RyZWFtT3V0KiBvdXQpOwogCiAgICAgdmlydHVhbCBBdWRpb1N0cmVhbUluKiBvcGVuSW5wdXRTdHJlYW0oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dFNvdXJjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZGV2aWNlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICpmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpjaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnNhbXBsZVJhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICpzdGF0dXMsCi0JCQkJQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcyBhY291c3RpY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6YXVkaW9faW5fYWNvdXN0aWNzIGFjb3VzdGljcyk7CisgICAgdmlydHVhbCAgICB2b2lkICAgICAgICBjbG9zZUlucHV0U3RyZWFtKEF1ZGlvU3RyZWFtSW4qIGluKTsKIAogcHJvdGVjdGVkOgotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgZG9Sb3V0aW5nKCkgeyByZXR1cm4gTk9fRVJST1I7IH0KICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKTsKIAogICAgICAgICAgICAgYm9vbCAgICAgICAgbU1pY011dGU7CmRpZmYgLS1naXQgYS9saWJzL2F1ZGlvZmxpbmdlci9BdWRpb01peGVyLmNwcCBiL2xpYnMvYXVkaW9mbGluZ2VyL0F1ZGlvTWl4ZXIuY3BwCmluZGV4IGIwMmVmY2MuLjE5YTQ0MmEgMTAwNjQ0Ci0tLSBhL2xpYnMvYXVkaW9mbGlu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GV2aWNlQ29ubmVjdGlvblN0YXRlKEF1ZGlvU3lzdGVtOjphdWRpb19kZXZpY2VzIGRldmljZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmRldmljZV9jb25uZWN0aW9uX3N0YXRlIHN0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpkZXZpY2VfYWRkcmVzcykKK3sKKworICAgIExPR1YoInNldERldmljZUNvbm5lY3Rpb25TdGF0ZSgpIGRldmljZTogJXgsIHN0YXRlICVkLCBhZGRyZXNzICVzIiwgZGV2aWNlLCBzdGF0ZSwgZGV2aWNlX2FkZHJlc3MpOworCisgICAgLy8gY29ubmVjdC9kaXNjb25uZWN0IG9ubHkgMSBkZXZpY2UgYXQgYSB0aW1lCisgICAgaWYgKEF1ZGlvU3lzdGVtOjpwb3BDb3VudChkZXZpY2UpICE9IDEpIHJldHVybiBCQURfVkFMVUU7CisKKyAgICBpZiAoc3RybGVuKGRldmljZV9hZGRyZXNzKSA+PSBNQVhfREVWSUNFX0FERFJFU1NfTEVOKSB7CisgICAgICAgIExPR0UoInNldERldmljZUNvbm5lY3Rpb25TdGF0ZSgpIGludmFsaWQgYWRkcmVzczogJXMiLCBkZXZpY2VfYWRkcmVzcyk7CisgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgfQorCisgICAgLy8gaGFuZGxlIG91dHB1dCBkZXZpY2VzCisgICAgaWYgKEF1ZGlvU3lzdGVtOjppc091dHB1dERldmljZShkZXZpY2UpKSB7CisgICAgICAgIHN3aXRjaCAoc3RhdGUpCisgICAgICAgIHsKKyAgICAgICAgLy8gaGFuZGxlIG91dHB1dCBkZXZpY2UgY29ubmVjdGlvbgorICAgICAgICBjYXNlIEF1ZGlvU3lzdGVtOjpERVZJQ0VfU1RBVEVfQVZBSUxBQkxFOgorICAgICAgICAgICAgaWYgKG1BdmFpbGFibGVPdXRwdXREZXZpY2VzICYgZGV2aWNlKSB7CisgICAgICAgICAgICAgICAgTE9HVygic2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKCkgZGV2aWNlIGFscmVhZHkgY29ubmVjdGVkOiAleCIsIGRldmljZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTE9HVigic2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKCkgY29ubmVjdGluZyBkZXZpY2UgJXgiLCBkZXZpY2UpOworCisgICAgICAgICAgICAvLyByZWdpc3RlciBuZXcgZGV2aWNlIGFzIGF2YWlsYWJsZQorICAgICAgICAgICAgbUF2YWlsYWJsZU91dHB1dERldmljZXMgfD0gZGV2aWNlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIC8vIGhhbmRsZSBvdXRwdXQgZGV2aWNlIGRpc2Nvbm5lY3Rpb24KKyAgICAgICAgY2FzZSBBdWRpb1N5c3RlbTo6REVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFOgorICAgICAgICAgICAgaWYgKCEobUF2YWlsYWJsZU91dHB1dERldmljZXMgJiBkZXZpY2UpKSB7CisgICAgICAgICAgICAgICAgTE9HVygic2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKCkgZGV2aWNlIG5vdCBjb25uZWN0ZWQ6ICV4IiwgZGV2aWNlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047CisgICAgICAgICAgICB9CisgICAgICAgICAgICBMT0dWKCJzZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoKSBkaXNjb25uZWN0aW5nIGRldmljZSAleCIsIGRldmljZSk7CisgICAgICAgICAgICAvLyByZW1vdmUgZGV2aWNlIGZyb20gYXZhaWxhYmxlIG91dHB1dCBkZXZpY2VzCisgICAgICAgICAgICBtQXZhaWxhYmxlT3V0cHV0RGV2aWNlcyAmPSB+ZGV2aWNlOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIExPR0UoInNldERldmljZUNvbm5lY3Rpb25TdGF0ZSgpIGludmFsaWQgc3RhdGU6ICV4Iiwgc3RhdGUpOworICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgfQorICAgIC8vIGhhbmRsZSBpbnB1dCBkZXZpY2VzCisgICAgaWYgKEF1ZGlvU3lzdGVtOjppc0lucHV0RGV2aWNlKGRldmljZSkpIHsKKyAgICAgICAgc3dpdGNoIChzdGF0ZSkKKyAgICAgICAgeworICAgICAgICAvLyBoYW5kbGUgaW5wdXQgZGV2aWNlIGNvbm5lY3Rpb24KKyAgICAgICAgY2FzZSBBdWRpb1N5c3RlbTo6REVWSUNFX1NUQVRFX0FWQUlMQUJMRToKKyAgICAgICAgICAgIGlmIChtQXZhaWxhYmxlSW5wdXREZXZpY2VzICYgZGV2aWNlKSB7CisgICAgICAgICAgICAgICAgTE9HVygic2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKCkgZGV2aWNlIGFscmVhZHkgY29ubmVjdGVkOiAlZCIsIGRldmljZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUF2YWlsYWJsZUlucHV0RGV2aWNlcyB8PSBkZXZpY2U7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAvLyBoYW5kbGUgaW5wdXQgZGV2aWNlIGRpc2Nvbm5lY3Rpb24KKyAgICAgICAgY2FzZSBBdWRpb1N5c3RlbTo6REVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFOgorICAgICAgICAgICAgaWYgKCEobUF2YWlsYWJsZUlucHV0RGV2aWNlcyAmIGRldmljZSkpIHsKKyAgICAgICAgICAgICAgICBMT0dXKCJzZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoKSBkZXZpY2Ugbm90IGNvbm5lY3RlZDogJWQiLCBkZXZpY2UpOworICAgICAgICAgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1BdmFpbGFibGVJbnB1dERldmljZXMgJj0gfmRldmljZTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMT0dFKCJzZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoKSBpbnZhbGlkIHN0YXRlOiAleCIsIHN0YXRlKTsKKyAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgIH0KKworICAgIExPR1coInNldERldmljZUNvbm5lY3Rpb25TdGF0ZSgpIGludmFsaWQgZGV2aWNlOiAleCIsIGRldmljZSk7CisgICAgcmV0dXJuIEJBRF9WQUxVRTsKK30KKworQXVkaW9TeXN0ZW06OmRldmljZV9jb25uZWN0aW9uX3N0YXRlIEF1ZGlvUG9saWN5TWFuYWdlckdlbmVyaWM6OmdldERldmljZUNvbm5lY3Rpb25TdGF0ZShBdWRpb1N5c3RlbTo6YXVkaW9fZGV2aWNlcyBkZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmRldmljZV9hZGRyZXNzKQoreworICAgIEF1ZGlvU3lzdGVtOjpkZXZpY2VfY29ubmVjdGlvbl9zdGF0ZSBzdGF0ZSA9IEF1ZGlvU3lzdGVtOjpERVZJQ0VfU1RBVEVfVU5BVkFJTEFCTEU7CisgICAgU3RyaW5nOCBhZGRyZXNzID0gU3RyaW5nOChkZXZpY2VfYWRkcmVzcyk7CisgICAgaWYgKEF1ZGlvU3lzdGVtOjppc091dHB1dERldmljZShkZXZpY2UpKSB7CisgICAgICAgIGlmIChkZXZpY2UgJ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JnZXRPdXRwdXQoKSBvcGVuaW5nIHRlc3Qgb3V0cHV0Iik7CisgICAgICAgICAgICBBdWRpb091dHB1dERlc2NyaXB0b3IgKm91dHB1dERlc2MgPSBuZXcgQXVkaW9PdXRwdXREZXNjcmlwdG9yKCk7CisgICAgICAgICAgICBvdXRwdXREZXNjLT5tRGV2aWNlID0gbVRlc3REZXZpY2U7CisgICAgICAgICAgICBvdXRwdXREZXNjLT5tU2FtcGxpbmdSYXRlID0gbVRlc3RTYW1wbGluZ1JhdGU7CisgICAgICAgICAgICBvdXRwdXREZXNjLT5tRm9ybWF0ID0gbVRlc3RGb3JtYXQ7CisgICAgICAgICAgICBvdXRwdXREZXNjLT5tQ2hhbm5lbHMgPSBtVGVzdENoYW5uZWxzOworICAgICAgICAgICAgb3V0cHV0RGVzYy0+bUxhdGVuY3kgPSBtVGVzdExhdGVuY3lNczsKKyAgICAgICAgICAgIG91dHB1dERlc2MtPm1GbGFncyA9IChBdWRpb1N5c3RlbTo6b3V0cHV0X2ZsYWdzKShtRGlyZWN0T3V0cHV0ID8gQXVkaW9TeXN0ZW06Ok9VVFBVVF9GTEFHX0RJUkVDVCA6IDApOworICAgICAgICAgICAgb3V0cHV0RGVzYy0+bVJlZkNvdW50W3N0cmVhbV0gPSAwOworICAgICAgICAgICAgbVRlc3RPdXRwdXRzW21DdXJPdXRwdXRdID0gbXBDbGllbnRJbnRlcmZhY2UtPm9wZW5PdXRwdXQoJm91dHB1dERlc2MtPm1EZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvdXRwdXREZXNjLT5tU2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3V0cHV0RGVzYy0+bUZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm91dHB1dERlc2MtPm1DaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm91dHB1dERlc2MtPm1MYXRlbmN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXREZXNjLT5tRmxhZ3MpOworICAgICAgICAgICAgaWYgKG1UZXN0T3V0cHV0c1ttQ3VyT3V0cHV0XSkgeworICAgICAgICAgICAgICAgIEF1ZGlvUGFyYW1ldGVyIG91dHB1dENtZCA9IEF1ZGlvUGFyYW1ldGVyKCk7CisgICAgICAgICAgICAgICAgb3V0cHV0Q21kLmFkZEludChTdHJpbmc4KCJzZXRfaWQiKSxtQ3VyT3V0cHV0KTsKKyAgICAgICAgICAgICAgICBtcENsaWVudEludGVyZmFjZS0+c2V0UGFyYW1ldGVycyhtVGVzdE91dHB1dHNbbUN1ck91dHB1dF0sb3V0cHV0Q21kLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIG1PdXRwdXRzLmFkZChtVGVzdE91dHB1dHNbbUN1ck91dHB1dF0sIG91dHB1dERlc2MpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBtVGVzdE91dHB1dHNbbUN1ck91dHB1dF07CisgICAgfQorI2VuZGlmIC8vQVVESU9fUE9MSUNZX1RFU1QKKyAgICBpZiAoKGZsYWdzICYgQXVkaW9TeXN0ZW06Ok9VVFBVVF9GTEFHX0RJUkVDVCkgfHwKKyAgICAgICAgKGZvcm1hdCAhPSAwICYmICFBdWRpb1N5c3RlbTo6aXNMaW5lYXJQQ00oZm9ybWF0KSkgfHwKKyAgICAgICAgKGNoYW5uZWxzICE9IDAgJiYgY2hhbm5lbHMgIT0gQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX01PTk8gJiYgY2hhbm5lbHMgIT0gQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX1NURVJFTykpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcmV0dXJuIG1IYXJkd2FyZU91dHB1dDsKK30KKworc3R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pb19pb19oYW5kbGVfdCBvdXRwdXQpCit7CisgICAgTE9HVigicmVsZWFzZU91dHB1dCgpICVkIiwgb3V0cHV0KTsKKyAgICBzc2l6ZV90IGluZGV4ID0gbU91dHB1dHMuaW5kZXhPZktleShvdXRwdXQpOworICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgTE9HVygicmVsZWFzZU91dHB1dCgpIHJlbGVhc2luZyB1bmtub3duIG91dHB1dCAlZCIsIG91dHB1dCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyNpZmRlZiBBVURJT19QT0xJQ1lfVEVTVAorICAgIGludCB0ZXN0SW5kZXggPSB0ZXN0T3V0cHV0SW5kZXgob3V0cHV0KTsKKyAgICBpZiAodGVzdEluZGV4ICE9IDApIHsKKyAgICAgICAgQXVkaW9PdXRwdXREZXNjcmlwdG9yICpvdXRwdXREZXNjID0gbU91dHB1dHMudmFsdWVBdChpbmRleCk7CisgICAgICAgIGlmIChvdXRwdXREZXNjLT5yZWZDb3VudCgpID09IDApIHsKKyAgICAgICAgICAgIG1wQ2xpZW50SW50ZXJmYWNlLT5jbG9zZU91dHB1dChvdXRwdXQpOworICAgICAgICAgICAgZGVsZXRlIG1PdXRwdXRzLnZhbHVlQXQoaW5kZXgpOworICAgICAgICAgICAgbU91dHB1dHMucmVtb3ZlSXRlbShvdXRwdXQpOworICAgICAgICAgICAgbVRlc3RPdXRwdXRzW3Rlc3RJbmRleF0gPSAwOworICAgICAgICB9CisgICAgfQorI2VuZGlmIC8vQVVESU9fUE9MSUNZX1RFU1QKK30KKworYXVkaW9faW9faGFuZGxlX3QgQXVkaW9Qb2xpY3lNYW5hZ2VyR2VuZXJpYzo6Z2V0SW5wdXQoaW50IGlucHV0U291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6YXVkaW9faW5fYWNvdXN0aWNzIGFjb3VzdGljcykKK3sKKyAgICBhdWRpb19pb19oYW5kbGVfdCBpbnB1dCA9IDA7CisgICAgdWludDMyX3QgZGV2aWNlOworCisgICAgTE9HVigiZ2V0SW5wdXQoKSBpbnB1dFNvdXJjZSAlZCwgc2FtcGxpbmdSYXRlICVkLCBmb3JtYXQgJWQsIGNoYW5uZWxzICV4LCBhY291c3RpY3MgJXgiLCBpbnB1dFNvdXJjZSwgc2FtcGxpbmdSYXRlLCBmb3JtYXQsIGNoYW5uZWxzLCBhY291c3RpY3MpOworCisgICAgQXVkaW9JbnB1dERlc2NyaXB0b3IgKmlucHV0RGVzYyA9IG5ldyBBdWRpb0lucHV0RGVzY3JpcHRvcigpOworICAgIGlucHV0RGVzYy0+bURldmljZSA9IEF1ZGlvU3lzdGVtOjpERVZJQ0VfSU5fQlVJTFRJTl9NSUM7CisgICAgaW5wdXREZXNjLT5tU2FtcGxpbmdSYXRlID0gc2FtcGxpbmdSYXRlOworICAgIGlucHV0RGVzYy0+bUZvcm1hdCA9IGZvcm1hdDsKKyAgICBpbnB1dERlc2MtPm1DaGFubmVscyA9IGNoYW5uZWxzOworICAgIGlucHV0RGVzYy0+bUFjb3VzdGljcyA9IGFjb3VzdGljczsKKyAgICBpbnB1dERlc2MtPm1SZWZDb3VudCA9IDA7CisgICAgaW5wdXQgPSBtcENsaWVudEludGVyZmFjZS0+b3BlbklucHV0KCZpbnB1dERlc2MtPm1EZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaW5wdXREZXNjLT5tU2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmlucHV0RGVzYy0+bUZvcm1hdCwKKyAgICAgICAgIC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kgdW5rbm93IGlucHV0ICVkIiwgaW5wdXQpOworICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgIH0KKyAgICBBdWRpb0lucHV0RGVzY3JpcHRvciAqaW5wdXREZXNjID0gbUlucHV0cy52YWx1ZUF0KGluZGV4KTsKKworI2lmZGVmIEFVRElPX1BPTElDWV9URVNUCisgICAgaWYgKG1UZXN0SW5wdXQgPT0gMCkKKyNlbmRpZiAvL0FVRElPX1BPTElDWV9URVNUCisgICAgeworICAgICAgICAvLyByZWZ1c2UgMiBhY3RpdmUgQXVkaW9SZWNvcmQgY2xpZW50cyBhdCB0aGUgc2FtZSB0aW1lCisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbUlucHV0cy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgaWYgKG1JbnB1dHMudmFsdWVBdChpKS0+bVJlZkNvdW50ID4gMCkgeworICAgICAgICAgICAgICAgIExPR1coInN0YXJ0SW5wdXQoKSBpbnB1dCAlZCwgb3RoZXIgaW5wdXQgJWQgYWxyZWFkeSBzdGFydGVkIiwgaW5wdXQsIG1JbnB1dHMua2V5QXQoaSkpOworICAgICAgICAgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGlucHV0RGVzYy0+bVJlZkNvdW50ID0gMTsKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKK3N0YXR1c190IEF1ZGlvUG9saWN5TWFuYWdlckdlbmVyaWM6OnN0b3BJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCkKK3sKKyAgICBMT0dWKCJzdG9wSW5wdXQoKSBpbnB1dCAlZCIsIGlucHV0KTsKKyAgICBzc2l6ZV90IGluZGV4ID0gbUlucHV0cy5pbmRleE9mS2V5KGlucHV0KTsKKyAgICBpZiAoaW5kZXggPCAwKSB7CisgICAgICAgIExPR1coInN0b3BJbnB1dCgpIHVua25vdyBpbnB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mb3V0cHV0RGVzYy0+bUZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvdXRwdXREZXNjLT5tQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3V0cHV0RGVzYy0+bUxhdGVuY3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXREZXNjLT5tRmxhZ3MpOworCisgICAgaWYgKG1IYXJkd2FyZU91dHB1dCA9PSAwKSB7CisgICAgICAgIExPR0UoIkZhaWxlZCB0byBpbml0aWFsaXplIGhhcmR3YXJlIG91dHB1dCBzdHJlYW0sIHNhbXBsaW5nUmF0ZTogJWQsIGZvcm1hdCAlZCwgY2hhbm5lbHMgJWQiLAorICAgICAgICAgICAgICAgIG91dHB1dERlc2MtPm1TYW1wbGluZ1JhdGUsIG91dHB1dERlc2MtPm1Gb3JtYXQsIG91dHB1dERlc2MtPm1DaGFubmVscyk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgbU91dHB1dHMuYWRkKG1IYXJkd2FyZU91dHB1dCwgb3V0cHV0RGVzYyk7CisgICAgfQorCisjaWZkZWYgQVVESU9fUE9MSUNZX1RFU1QKKyAgICBBdWRpb1BhcmFtZXRlciBvdXRwdXRDbWQgPSBBdWRpb1BhcmFtZXRlcigpOworICAgIG91dHB1dENtZC5hZGRJbnQoU3RyaW5nOCgic2V0X2lkIiksIDApOworICAgIG1wQ2xpZW50SW50ZXJmYWNlLT5zZXRQYXJhbWV0ZXJzKG1IYXJkd2FyZU91dHB1dCwgb3V0cHV0Q21kLnRvU3RyaW5nKCkpOworCisgICAgbVRlc3REZXZpY2UgPSBBdWRpb1N5c3RlbTo6REVWSUNFX09VVF9TUEVBS0VSOworICAgIG1UZXN0U2FtcGxpbmdSYXRlID0gNDQxMDA7CisgICAgbVRlc3RGb3JtYXQgPSBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVDsKKyAgICBtVGVzdENoYW5u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ICAgfQorICAgbUlucHV0cy5jbGVhcigpOworfQorCisjaWZkZWYgQVVESU9fUE9MSUNZX1RFU1QKK2Jvb2wgQXVkaW9Qb2xpY3lNYW5hZ2VyR2VuZXJpYzo6dGhyZWFkTG9vcCgpCit7CisgICAgTE9HVigiZW50ZXJpbmcgdGhyZWFkTG9vcCgpIik7CisgICAgd2hpbGUgKCFleGl0UGVuZGluZygpKQorICAgIHsKKyAgICAgICAgU3RyaW5nOCBjb21tYW5kOworICAgICAgICBpbnQgdmFsdWVJbnQ7CisgICAgICAgIFN0cmluZzggdmFsdWU7CisKKyAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKyAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdFJlbGF0aXZlKG1Mb2NrLCBtaWxsaXNlY29uZHMoNTApKTsKKworICAgICAgICBjb21tYW5kID0gbXBDbGllbnRJbnRlcmZhY2UtPmdldFBhcmFtZXRlcnMoMCwgU3RyaW5nOCgidGVzdF9jbWRfcG9saWN5IikpOworICAgICAgICBBdWRpb1BhcmFtZXRlciBwYXJhbSA9IEF1ZGlvUGFyYW1ldGVyKGNvbW1hbmQpOworCisgICAgICAgIGlmIChwYXJhbS5nZXRJbnQoU3RyaW5nOCgidGVzdF9jbWRfcG9saWN5IiksIHZhbHVlSW50KSA9PSBOT19FUlJPUiAmJgorICAgICAgICAgICAgdmFsdWVJbnQgIT0gMCkgeworICAgICAgICAgICAgTE9HVigiVGVzdCBjb21tYW5kICVzIHJlY2VpdmVkIiwgY29tbWFuZC5zdHJpbmcoKSk7CisgICAgICAgICAgICBTdHJpbmc4IHRhcmdldDsKKyAgICAgICAgICAgIGlmIChwYXJhbS5nZXQoU3RyaW5nOCgidGFyZ2V0IiksIHRhcmdldCkgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICB0YXJnZXQgPSAiTWFuYWdlciI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocGFyYW0uZ2V0SW50KFN0cmluZzgoInRlc3RfY21kX3BvbGljeV9vdXRwdXQiKSwgdmFsdWVJbnQpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgcGFyYW0ucmVtb3ZlKFN0cmluZzgoInRlc3RfY21kX3BvbGljeV9vdXRwdXQiKSk7CisgICAgICAgICAgICAgICAgbUN1ck91dHB1dCA9IHZhbHVlSW50OworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBhcmFtLmdldChTdHJpbmc4KCJ0ZXN0X2NtZF9wb2xpY3lfZGlyZWN0IiksIHZhbHVlKSA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIHBhcmFtLnJlbW92ZShTdHJpbmc4KCJ0ZXN0X2NtZF9wb2xpY3lfZGlyZWN0IikpOworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PSAiZmFsc2UiKSB7CisgICAgICAgICAgICAgICAgICAgIG1EaXJlY3RPdXRwdXQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlID09ICJ0cnVlIikgeworICAgICAgICAgICAgICAgICAgICBtRGlyZWN0T3V0cHV0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocGFyYW0uZ2V0SW50KFN0cmluZzgoInRlc3RfY21kX3BvbGljeV9pbnB1dCIpLCB2YWx1ZUludCkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICBwYXJhbS5yZW1vdmUoU3RyaW5nOCgidGVzdF9jbWRfcG9saWN5X2lucHV0IikpOworICAgICAgICAgICAgICAgIG1UZXN0SW5wdXQgPSB2YWx1ZUludDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBhcmFtLmdldChTdHJpbmc4KCJ0ZXN0X2NtZF9wb2xpY3lfZm9ybWF0IiksIHZhbHVlKSA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIHBhcmFtLnJlbW92ZShTdHJpbmc4KCJ0ZXN0X2NtZF9wb2xpY3lfZm9ybWF0IikpOworICAgICAgICAgICAgICAgIGludCBmb3JtYXQgPSBBdWRpb1N5c3RlbTo6SU5WQUxJRF9GT1JNQVQ7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09ICJQQ00gMTYgYml0cyIpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gQXVkaW9TeXN0ZW06OlBDTV8xNl9CSVQ7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA9PSAiUENNIDggYml0cyIpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gQXVkaW9TeXN0ZW06OlBDTV84X0JJVDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlID09ICJDb21wcmVzc2VkIE1QMyIpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gQXVkaW9TeXN0ZW06Ok1QMzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGZvcm1hdCAhPSBBdWRpb1N5c3RlbTo6SU5WQUxJRF9GT1JNQVQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRhcmdldCA9PSAiTWFuYWdlciIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UZXN0Rm9ybWF0ID0gZm9ybWF0OworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1UZXN0T3V0cHV0c1ttQ3VyT3V0cHV0XSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1BhcmFtZXRlciBvdXRwdXRQYXJhbSA9IEF1ZGlvUGFyYW1ldGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRQYXJhbS5hZGRJbnQoU3RyaW5nOCgiZm9ybWF0IiksIGZvcm1hdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtcENsaWVudEludGVyZmFjZS0+c2V0UGFyYW1ldGVycyhtVGVzdE91dHB1dHNbbUN1ck91dHB1dF0sIG91dHB1dFBhcmFtLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBhcmFtLmdldChTdHJpbmc4KCJ0ZXN0X2NtZF9wb2xpY3lfY2hhbm5lbHMiKSwgdmFsdWUpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgcGFyYW0ucmVtb3ZlKFN0cmluZzgoInRlc3RfY21kX3BvbGljeV9jaGFubmVscyIpKTsKKyAgICAgICAgICAgICAgICBpbnQgY2hhbm5lbHMgPSAwOworCisgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09ICJDaGFubmVscyBTdGVyZW8iKSB7CisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxzID0gIEF1ZGlvU3lzdGVtOjpDSEFOTkVMX09VVF9TVEVSRU87CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA9PSAiQ2hhbm5lbHMgTW9ubyIpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhbm5lbHMgPSAgQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX01PTk87CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChjaGFubmVscyAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0YXJnZXQgPT0gIk1hbmFnZXIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVGVzdENoYW5uZWxzID0gY2hhbm5lbHM7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVRlc3RPdXRwdXRzW21DdXJPdXRwdXRdICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvUGFyYW1ldGVyIG91dHB1dFBhcmFtID0gQXVkaW9QYXJhbWV0ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFBhcmFtLmFkZEludChTdHJpbmc4KCJjaGFubmVscyIpLCBjaGFubmVscyk7CisgICAgICAgICAgICAgICAgICAgICAgICBtcENsaWVudEludGVyZmFjZS0+c2V0UGFyYW1ldGVycyhtVGVzdE91dHB1dHNbbUN1ck91dHB1dF0sIG91dHB1dFBhcmFtLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBhcmFtLmdldEludChTdHJpbmc4KCJ0ZXN0X2NtZF9wb2xpY3lfc2FtcGxlUmF0ZSIpLCB2YWx1ZUludCkgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICBwYXJhbS5yZW1vdmUoU3RyaW5nOCgidGVzdF9jbWRfcG9saWN5X3NhbXBsZVJhdGUiKSk7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlSW50ID49IDAgJiYgdmFsdWVJbnQgPD0gOTYwMDApIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHNhbXBsaW5nUmF0ZSA9IHZhbHVlSW50OworICAgICAgICAgICAgICAgICAgICBpZiAodGFyZ2V0ID09ICJNYW5hZ2VyIikgeworICAgICAgICAgICAgICAgICAgICAgICAgbVRlc3RTYW1wbGluZ1JhdGUgPSBzYW1wbGluZ1JhdGU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVRlc3RPdXRwdXRzW21DdXJPdXRwdXRdICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvUGFyYW1ldGVyIG91dHB1dFBhcmFtID0gQXVkaW9QYXJhbWV0ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFBhcmFtLmFkZEludChTdHJpbmc4KCJzYW1wbGluZ19yYXRlIiksIHNhbXBsaW5nUmF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtcENsaWVudEludGVyZmFjZS0+c2V0UGFyYW1ldGVycyhtVGVzdE91dHB1dHNbbUN1ck91dHB1dF0sIG91dHB1dFBhcmFtLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocGFyYW0uZ2V0KFN0cmluZzgoInRlc3RfY21kX3BvbGljeV9yZW9wZW4iKSwgdmFsdWUpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgcGFyYW0ucmVtb3ZlKFN0cmluZzgoInRlc3RfY21kX3BvbGljeV9yZW9wZW4iKSk7CisKKyAgICAgICAgICAgICAgICBtcENsaWVudEludGVyZmFjZS0+Y2xvc2VPdXRwdXQobUhhcmR3YXJlT3V0cHV0KTsKKyAgICAgICAgICAgICAgICBkZWxldGUgbU91dHB1dHMudmFsdWVGb3IobUhhcmR3YXJlT3V0cHV0KTsKKyAgICAgICAgICAgICAgICBtT3V0cHV0cy5yZW1vdmVJdGVtKG1IYXJkd2FyZU91dHB1dCk7CisKKyAgICAgICAgICAgICAgICBBdWRpb091dHB1dERlc2NyaXB0b3IgKm91dHB1dERlc2MgPSBuZXcgQXVkaW9PdXRwdXREZXNjcmlwdG9yKCk7CisgICAgICAgICAgICAgICAgb3V0cHV0RGVzYy0+bURldmljZSA9ICh1aW50MzJfdClBdWRpb1N5c3RlbTo6REVWSUNFX09VVF9TUEVBS0VSOworICAgICAgICAgICAgICAgIG1IYXJkd2FyZU91dHB1dCA9IG1wQ2xpZW50SW50ZXJmYWNlLT5vcGVuT3V0cHV0KCZvdXRwdXREZXNjLT5tRGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm91dHB1dERlc2MtPm1TYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3V0cHV0RGVzYy0+bUZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvdXRwdXREZXNjLT5tQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3V0cHV0RGVzYy0+bUxhdGVuY3ksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXREZXNjLT5tRmxhZ3MpOworICAgICAgICAgICAgICAgIGlmIChtSGFyZHdhcmVPdXRwdXQgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBMT0dFKCJGYWlsZWQgdG8gcmVvcGVuIGhhcmR3YXJlIG91dHB1dCBzdHJlYW0sIHNhbXBsaW5nUmF0ZTogJWQsIGZvcm1hdCAlZCwgY2hhbm5lbHMgJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dERlc2MtPm1TYW1wbGluZ1JhdGUsIG91dHB1dERlc2MtPm1Gb3JtYXQsIG91dHB1dERlc2MtPm1DaGFubmVscyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9QYXJhbWV0ZXIgb3V0cHV0Q21kID0gQXVkaW9QYXJhbWV0ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0cHV0Q21kLmFkZEludChTdHJpbmc4KCJzZXRfaWQiKSwgMCk7CisgICAgICAgICAgICAgICAgICAgIG1wQ2xpZW50SW50ZXJmYWNlLT5zZXRQYXJhbWV0ZXJzKG1IYXJkd2FyZU91dHB1dCwgb3V0cHV0Q21kLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICBtT3V0cHV0cy5hZGQobUhhcmR3YXJlT3V0cHV0LCBvdXRwdXREZXNjKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgbXBDbGllbnRJbnRlcmZhY2UtPnNldFBhcmFtZXRlcnMoMCwgU3RyaW5nOCgidGVzdF9jbWRfcG9saWN5PSIpKTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MpOworICAgICAgICB2aXJ0dWFsIHZvaWQgc2V0UGhvbmVTdGF0ZShpbnQgc3RhdGUpOworICAgICAgICB2aXJ0dWFsIHZvaWQgc2V0UmluZ2VyTW9kZSh1aW50MzJfdCBtb2RlLCB1aW50MzJfdCBtYXNrKTsKKyAgICAgICAgdmlydHVhbCB2b2lkIHNldEZvcmNlVXNlKEF1ZGlvU3lzdGVtOjpmb3JjZV91c2UgdXNhZ2UsIEF1ZGlvU3lzdGVtOjpmb3JjZWRfY29uZmlnIGNvbmZpZyk7CisgICAgICAgIHZpcnR1YWwgQXVkaW9TeXN0ZW06OmZvcmNlZF9jb25maWcgZ2V0Rm9yY2VVc2UoQXVkaW9TeXN0ZW06OmZvcmNlX3VzZSB1c2FnZSk7CisgICAgICAgIHZpcnR1YWwgdm9pZCBzZXRTeXN0ZW1Qcm9wZXJ0eShjb25zdCBjaGFyKiBwcm9wZXJ0eSwgY29uc3QgY2hhciogdmFsdWUpOworICAgICAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IGdldE91dHB1dChBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtOjpvdXRwdXRfZmxhZ3MgZmxhZ3MpOworICAgICAgICB2aXJ0dWFsIHN0YXR1c190IHN0YXJ0T3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCwgQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlIHN0cmVhbSk7CisgICAgICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3RvcE91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQsIEF1ZGlvU3lzdGVtOjpzdHJlYW1fdHlwZSBzdHJlYW0pOworICAgICAgICB2aXJ0dWFsIHZvaWQgcmVsZWFzZU91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQpOworICAgICAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IGdldElucHV0KGludCBpbnB1dFNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6YXVkaW9faW5fYWNvdXN0aWNzIGFjb3VzdGljcyk7CisgICAgICAgIC8vIGluZGljYXRlcyB0byB0aGUgYXVkaW8gcG9saWN5IG1hbmFnZXIgdGhhdCB0aGUgaW5wdXQgc3RhcnRzIGJlaW5nIHVzZWQuCisgICAgICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3RhcnRJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCk7CisgICAgICAgIC8vIGluZGljYXRlcyB0byB0aGUgYXVkaW8gcG9saWN5IG1hbmFnZXIgdGhhdCB0aGUgaW5wdXQgc3RvcHMgYmVpbmcgdXNlZC4KKyAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBzdG9wSW5wdXQoYXVkaW9faW9faGFuZGxlX3QgaW5wdXQpOworICAgICAgICB2aXJ0dWFsIHZvaWQgcmVsZWFzZUlucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKKyAgICAgICAgdmlydHVhbCB2b2lkIGluaXRTdHJlYW1Wb2x1bWUoQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlIHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNaW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4TWF4KTsKKyAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBzZXRTdHJlYW1Wb2x1bWVJbmRleChBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtLCBpbnQgaW5kZXgpOworICAgICAgICB2aXJ0dWFsIHN0YXR1c190IGdldFN0cmVhbVZvbHVtZUluZGV4KEF1ZGlvU3lzdGVtOjpzdHJlYW1fdHlwZSBzdHJlYW0sIGludCAqaW5kZXgpOworCitwcml2YXRlOgorCisgICAgICAgIGVudW0gcm91dGluZ19zdHJhdGVneSB7CisgICAgICAgICAgICBTVFJBVEVHWV9NRURJQSwKKyAgICAgICAgICAgIFNUUkFURUdZX1BIT05FLAorICAgICAgICAgICAgU1RSQVRFR1lfU09OSUZJQ0FUSU9OLAorICAgICAgICAgICAgU1RSQVRFR1lfRFRNRiwKKyAgICAgICAgICAgIE5VTV9TVFJBVEVHSUVTCisgICAgICAgIH07CisKKyAgICAgICAgLy8gZGVzY3JpcHRvciBmb3IgYXVkaW8gb3V0cHV0cy4gVXNlZCB0byBtYWludGFpbiBjdXJyZW50IGNvbmZpZ3VyYXRpb24gb2YgZWFjaCBvcGVuZWQgYXVkaW8gb3V0cHV0CisgICAgICAgIC8vIGFuZCBrZWVwIHRyYWNrIG9mIHRoZSB1c2FnZSBvZiB0aGlzIG91dHB1dCBieSBlYWNoIGF1ZGlvIHN0cmVhbSB0eXBlLgorICAgICAgICBjbGFzcyBBdWRpb091dHB1dERlc2NyaXB0b3IKKyAgICAgICAgeworICAgICAgICBwdWJsaWM6CisgICAgICAgICAgICBBdWRpb091dHB1dERlc2NyaXB0b3IoKTsKKworCisgICAgICAgICAgICB1aW50MzJfdCBkZXZpY2UoKTsKKyAgICAgICAgICAgIHZvaWQgY2hhbmdlUmVmQ291bnQoQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlLCBpbnQgZGVsdGEpOworICAgICAgICAgICAgYm9vbCBpc1VzZWRCeVN0cmVhbShBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtKSB7IHJldHVybiBtUmVmQ291bnRbc3RyZWFtXSA+IDAgPyB0cnVlIDogZmFsc2U7IH0KKyAgICAgICAgICAgIHVpbnQzMl90IHJlZkNvdW50KCk7CisKKyAgICAgICAgICAgIHVpbnQzMl90IG1TYW1wbGluZ1JhdGU7ICAgICAgICAgICAgIC8vCisgICAgICAgICAgICB1aW50MzJfdCBtRm9ybWF0OyAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgdWludDMyX3QgbUNoYW5uZWxzOyAgICAgICAgICAgICAgICAgLy8gb3V0cHV0IGNvbmZpZ3VyYXRpb24KKyAgICAgICAgICAgIHVpbnQzMl90IG1MYXRlbmN5OyAgICAgICAgICAgICAgICAgIC8vCisgICAgICAgICAgICBBdWRpb1N5c3RlbTo6b3V0cHV0X2ZsYWdzIG1GbGFnczsgICAvLworICAgICAgICAgICAgdWludDMyX3QgbURldmljZTsgICAgICAgICAgICAgICAgICAgLy8gY3VycmVudCBkZXZpY2UgdGhpcyBvdXRwdXQgaXMgcm91dGVkIHRvCisgICAgICAgICAgICB1aW50MzJfdCBtUmVmQ291bnRbQXVkaW9TeXN0ZW06Ok5VTV9TVFJFQU1fVFlQRVNdOyAvLyBudW1iZXIgb2Ygc3RyZWFtcyBvZiBlYWNoIHR5cGUgdXNpbmcgdGhpcyBvdXRwdXQKKyAgICAgICAgfTsKKworICAgICAgICAvLyBkZXNjcmlwdG9yIGZvciBhdWRpbyBpbnB1dHMuIFVzZWQgdG8gbWFpbnRhaW4gY3VycmVudCBjb25maWd1cmF0aW9uIG9mIGVhY2ggb3BlbmVkIGF1ZGlvIGlucHV0CisgICAgICAgIC8vIGFuZCBrZWVwIHRyYWNrIG9mIHRoZSB1c2FnZSBvZiB0aGlzIGlucHV0LgorICAgICAgICBjbGFzcyBBdWRpb0lucHV0RGVzY3JpcHRvcgorICAgICAgICB7CisgICAgICAgIHB1YmxpYzoKKyAgICAgICAgICAgIEF1ZGlvSW5wdXREZXNjcmlwdG9yKCk7CisKKyAgICAgICAgICAgIHVpbnQzMl90IG1TYW1wbGluZ1JhdGU7ICAgICAgICAgICAgICAgICAgICAgLy8KKyAgICAgICAgICAgIHVpbnQzMl90IG1Gb3JtYXQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5wdXQgY29uZmlndXJhdGlvbgorICAgICAgICAgICAgdWludDMyX3QgbUNoYW5uZWxzOyAgICAgICAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcyBtQWNvdXN0aWNzOyAvLworICAgICAgICAgICAgdWludDMyX3QgbURldmljZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjdXJyZW50IGRldmljZSB0aGlzIGlucHV0IGlzIHJvdXRlZCB0bworICAgICAgICAgICAgdWludDMyX3QgbVJlZkNvdW50OyAgICAgICAgICAgICAgICAgICAgICAgICAvLyBudW1iZXIgb2YgQXVkaW9SZWNvcmQgY2xpZW50cyB1c2luZyB0aGlzIG91dHB1dAorICAgICAgICB9OworCisgICAgICAgIC8vIHN0cmVhbSBkZXNjcmlwdG9yIHVzZWQgZm9yIHZvbHVtZSBjb250cm9sCisgICAgICAgIGNsYXNzIFN0cmVhbURlc2NyaXB0b3IKKyAgICAgICAgeworICAgICAgICBwdWJ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VkaW9faW9faGFuZGxlX3QsIEF1ZGlvSW5wdXREZXNjcmlwdG9yICo+IG1JbnB1dHM7ICAgICAvLyBsaXN0IG9mIGlucHV0IGRlc2NyaXB0b3JzCisgICAgICAgIHVpbnQzMl90IG1BdmFpbGFibGVPdXRwdXREZXZpY2VzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYml0IGZpZWxkIG9mIGFsbCBhdmFpbGFibGUgb3V0cHV0IGRldmljZXMKKyAgICAgICAgdWludDMyX3QgbUF2YWlsYWJsZUlucHV0RGV2aWNlczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBiaXQgZmllbGQgb2YgYWxsIGF2YWlsYWJsZSBpbnB1dCBkZXZpY2VzCisgICAgICAgIGludCBtUGhvbmVTdGF0ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3VycmVudCBwaG9uZSBzdGF0ZQorICAgICAgICB1aW50MzJfdCAgICAgICAgICAgICAgICAgbVJpbmdlck1vZGU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGN1cnJlbnQgcmluZ2VyIG1vZGUKKyAgICAgICAgQXVkaW9TeXN0ZW06OmZvcmNlZF9jb25maWcgbUZvcmNlVXNlW0F1ZGlvU3lzdGVtOjpOVU1fRk9SQ0VfVVNFXTsgICAvLyBjdXJyZW50IGZvcmNlZCB1c2UgY29uZmlndXJhdGlvbgorCisgICAgICAgIFN0cmVhbURlc2NyaXB0b3IgbVN0cmVhbXNbQXVkaW9TeXN0ZW06Ok5VTV9TVFJFQU1fVFlQRVNdOyAgICAgICAgICAgLy8gc3RyZWFtIGRlc2NyaXB0b3JzIGZvciB2b2x1bWUgY29udHJvbAorCisjaWZkZWYgQVVESU9fUE9MSUNZX1RFU1QKKyAgICAgICAgTXV0ZXggICBtTG9jazsKKyAgICAgICAgQ29uZGl0aW9uIG1XYWl0V29ya0NWOworCisgICAgICAgIGludC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worICAgIH0KKyAgICBpZiAoIUF1ZGlvU3lzdGVtOjppc091dHB1dERldmljZShkZXZpY2UpICYmICFBdWRpb1N5c3RlbTo6aXNJbnB1dERldmljZShkZXZpY2UpKSB7CisgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgfQorICAgIGlmIChzdGF0ZSAhPSBBdWRpb1N5c3RlbTo6REVWSUNFX1NUQVRFX0FWQUlMQUJMRSAmJiBzdGF0ZSAhPSBBdWRpb1N5c3RlbTo6REVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFKSB7CisgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgfQorCisgICAgTE9HVigic2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKCkgdGlkICVkIiwgZ2V0dGlkKCkpOworICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisgICAgcmV0dXJuIG1wUG9saWN5TWFuYWdlci0+c2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKGRldmljZSwgc3RhdGUsIGRldmljZV9hZGRyZXNzKTsKK30KKworQXVkaW9TeXN0ZW06OmRldmljZV9jb25uZWN0aW9uX3N0YXRlIEF1ZGlvUG9saWN5U2VydmljZTo6Z2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKEF1ZGlvU3lzdGVtOjphdWRpb19kZXZpY2VzIGRldmljZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MpCit7CisgICAgaWYgKG1wUG9saWN5TWFuYWdlciA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiBBdWRpb1N5c3RlbTo6REVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFOworICAgIH0KKyAgICBpZiAoIWNoZWNrUGVybWlzc2lvbigpKSB7CisgICAgICAgIHJldHVybiBBdWRpb1N5c3RlbTo6REVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFOworICAgIH0KKyAgICByZXR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5VTEwpIHsKKyAgICAgICAgcmV0dXJuIEF1ZGlvU3lzdGVtOjpGT1JDRV9OT05FOworICAgIH0KKyAgICBpZiAoIWNoZWNrUGVybWlzc2lvbigpKSB7CisgICAgICAgIHJldHVybiBBdWRpb1N5c3RlbTo6Rk9SQ0VfTk9ORTsKKyAgICB9CisgICAgaWYgKHVzYWdlIDwgMCB8fCB1c2FnZSA+PSBBdWRpb1N5c3RlbTo6TlVNX0ZPUkNFX1VTRSkgeworICAgICAgICByZXR1cm4gQXVkaW9TeXN0ZW06OkZPUkNFX05PTkU7CisgICAgfQorICAgIHJldHVybiBtcFBvbGljeU1hbmFnZXItPmdldEZvcmNlVXNlKHVzYWdlKTsKK30KKworYXVkaW9faW9faGFuZGxlX3QgQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRPdXRwdXQoQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlIHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06Om91dHB1dF9mbGFncyBmbGFncykKK3sKKyAgICBpZiAobXBQb2xpY3lNYW5hZ2VyID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgIExPR1YoImdldE91dHB1dCgpIHRpZCAlZCIsIGdldHRpZCgpKTsKKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgIHJldHVybiBtcFBvbGljeU1hbmFnZXItPmdldE91dHB1dChzdHJlYW0sIHNhbXBsaW5nUmF0ZSwgZm9ybWF0LCBjaGFubmVscywgZmxhZ3MpOworfQorCitzdGF0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uYWdlci0+cmVsZWFzZU91dHB1dChvdXRwdXQpOworfQorCithdWRpb19pb19oYW5kbGVfdCBBdWRpb1BvbGljeVNlcnZpY2U6OmdldElucHV0KGludCBpbnB1dFNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmF1ZGlvX2luX2Fjb3VzdGljcyBhY291c3RpY3MpCit7CisgICAgaWYgKG1wUG9saWN5TWFuYWdlciA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgIHJldHVybiBtcFBvbGljeU1hbmFnZXItPmdldElucHV0KGlucHV0U291cmNlLCBzYW1wbGluZ1JhdGUsIGZvcm1hdCwgY2hhbm5lbHMsIGFjb3VzdGljcyk7Cit9CisKK3N0YXR1c190IEF1ZGlvUG9saWN5U2VydmljZTo6c3RhcnRJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCkKK3sKKyAgICBpZiAobXBQb2xpY3lNYW5hZ2VyID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuIE5PX0lOSVQ7CisgICAgfQorICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisgICAgcmV0dXJuIG1wUG9saWN5TWFuYWdlci0+c3RhcnRJbnB1dChpbnB1dCk7Cit9CisKK3N0YXR1c190IEF1ZGlvUG9saWN5U2VydmljZTo6c3RvcElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KQoreworICAgIGlmIChtcFBvbGljeU1hbmFnZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICB9CisgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKyAgICByZXR1cm4gbXBQb2xpY3lNYW5hZ2VyLT5zdG9wSW5wdXQoaW5wdXQpOworfQorCit2b2lkIEF1ZGlvUG9saWN5U2VydmljZTo6cmVsZWFzZUlucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KQoreworICAgIGlmIChtcFBvbGljeU1hbmFnZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisgICAgbXBQb2xpY3lNYW5hZ2VyLT5yZWxlYXNlSW5wdXQoaW5wdXQpOworfQorCitzdGF0dXNfdCBBdWRpb1BvbGljeVNlcnZpY2U6OmluaXRTdHJlYW1Wb2x1bWUoQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlIHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4TWluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNYXgpCit7CisgICAgaWYgKG1wUG9saWN5TWFuYWdlciA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiBOT19JTklUOworICAgIH0KKyAgICBpZiAoIWNoZWNrUGVybWlzc2lvbigpKSB7CisgICAgICAgIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsKKyAgICB9CisgICAgaWYgKHN0cmVhbSA8IDAgfHwgc3RyZWFtID49IEF1ZGlvU3lzdGVtOjpOVU1fU1RSRUFNX1RZUEVTKSB7CisgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgfQorICAgIG1wUG9saWN5TWFuYWdlci0+aW5pdFN0cmVhbVZvbHVtZShzdHJlYW0sIGluZGV4TWluLCBpbmRleE1heCk7CisgICAgcmV0dXJuIE5PX0VSUk9SOworfQorCit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gIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsKKyAgICB9CisKKyAgICByZXR1cm4gYWYtPnJlc3RvcmVPdXRwdXQob3V0cHV0KTsKK30KKworYXVkaW9faW9faGFuZGxlX3QgQXVkaW9Qb2xpY3lTZXJ2aWNlOjpvcGVuSW5wdXQodWludDMyX3QgKnBEZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcFNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBGb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGFjb3VzdGljcykKK3sKKyAgICBzcDxJQXVkaW9GbGluZ2VyPiBhZiA9IEF1ZGlvU3lzdGVtOjpnZXRfYXVkaW9fZmxpbmdlcigpOworICAgIGlmIChhZiA9PSAwKSB7CisgICAgICAgIExPR1coIm9wZW5JbnB1dCgpIGNvdWxkIG5vdCBnZXQgQXVkaW9GbGluZ2VyIik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHJldHVybiBhZi0+b3BlbklucHV0KHBEZXZpY2VzLCBwU2FtcGxpbmdSYXRlLCAodWludDMyX3QgKilwRm9ybWF0LCBwQ2hhbm5lbHMsIGFjb3VzdGljcyk7Cit9CisKK3N0YXR1c190IEF1ZGlvUG9saWN5U2VydmljZTo6Y2xvc2VJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCkKK3sKKyAgICBzcDxJQXVkaW9GbGluZ2VyPiBhZiA9IEF1ZGlvU3lzdGVtOjpnZXRfYXVkaW9fZmxpbmdlcigpOworICAgIGlmIChhZiA9PSAwKSByZXR1cm4gUEVSTUlTU0lPTl9ERU5JRUQ7CisKKyAgICByZXR1cm4gYWYtPmNsb3NlSW5wdXQoaW5wdXQpOworf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lYWQ6Om9uRmlyc3RSZWYoKQoreworICAgIGNvbnN0IHNpemVfdCBTSVpFID0gMjU2OworICAgIGNoYXIgYnVmZmVyW1NJWkVdOworCisgICAgc25wcmludGYoYnVmZmVyLCBTSVpFLCAiQXVkaW9Db21tYW5kVGhyZWFkIik7CisKKyAgICBydW4oYnVmZmVyLCBBTkRST0lEX1BSSU9SSVRZX0FVRElPKTsKK30KKworYm9vbCBBdWRpb1BvbGljeVNlcnZpY2U6OkF1ZGlvQ29tbWFuZFRocmVhZDo6dGhyZWFkTG9vcCgpCit7CisgICAgbnNlY3NfdCB3YWl0VGltZSA9IElOVDY0X01BWDsKKworICAgIG1Mb2NrLmxvY2soKTsKKyAgICB3aGlsZSAoIWV4aXRQZW5kaW5nKCkpCisgICAgeworICAgICAgICB3aGlsZSghbUF1ZGlvQ29tbWFuZHMuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICBuc2Vjc190IGN1clRpbWUgPSBzeXN0ZW1UaW1lKCk7CisgICAgICAgICAgICAvLyBjb21tYW5kcyBhcmUgc29ydGVkIGJ5IGluY3JlYXNpbmcgdGltZSBzdGFtcDogZXhlY3V0ZSB0aGVtIGZyb20gaW5kZXggMCBhbmQgdXAKKyAgICAgICAgICAgIGlmIChtQXVkaW9Db21tYW5kc1swXS0+bVRpbWUgPD0gY3VyVGltZSkgeworICAgICAgICAgICAgICAgIEF1ZGlvQ29tbWFuZCAqY29tbWFuZCA9IG1BdWRpb0NvbW1hbmRzWzBdOworICAgICAgICAgICAgICAgIG1BdWRpb0NvbW1hbmRzLnJlbW92ZUF0KDApOworICAgICAgICAgICAgICAgIHN3aXRjaCAoY29tbWFuZC0+bUNvbW1hbmQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIFNUQVJUX1RPTkU6IHsKKyAgICAgICAgICAgICAgICAgICAgbUxvY2sudW5sb2NrKCk7CisgICAgICAgICAgICAgICAgICAgIFRvbmVEYXRhICpkYXRhID0gKFRvbmVEYXRhICopY29tbWFuZC0+bVBhcmFtOworICAgICAgICAgICAgICAgICAgICBMT0dWKCJBdWRpb0NvbW1hbmRUaHJlYWQoKSBwcm9jZXNzaW5nIHN0YXJ0IHRvbmUgJWQgb24gc3RyZWFtICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLT5tVHlwZSwgZGF0YS0+bVN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtcFRvbmVHZW5lcmF0b3IgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBtcFRvbmVHZW5lcmF0b3I7CisgICAgICAgICAgICAgICAgICAgIG1wVG9uZUdlbmVyYXRvciA9IG5ldyBUb25lR2VuZXJhdG9yKGRhdGEtPm1TdHJlYW0sIDEuMCk7CisgICAgICAgICAgICAgICAgICAgIG1wVG9uZUdlbmVyYXRvci0+c3RhcnRUb25lKGRhdGEtPm1UeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGRhdGE7CisgICAgICAgICAgICAgICAgICAgIG1Mb2NrLmxvY2soKTsKKyAgICAgICAgICAgICAgICAgICAgfWJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU1RPUF9UT05FOiB7CisgICAgICAgICAgICAgICAgICAgIG1Mb2NrLnVubG9jaygpOworICAgICAgICAgICAgICAgICAgICBMT0dWKCJBdWRpb0NvbW1hbmRUaHJlYWQoKSBwcm9jZXNzaW5nIHN0b3AgdG9uZSIpOworICAgICAgICAgICAgICAgICAgICBpZiAobXBUb25lR2VuZXJhdG9yICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1wVG9uZUdlbmVyYXRvci0+c3RvcFRvbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBtcFRvbmVHZW5lcmF0b3I7CisgICAgICAgICAgICAgICAgICAgICAgICBtcFRvbmVHZW5lcmF0b3IgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1Mb2NrLmxvY2soKTsKKyAgICAgICAgICAgICAgICAgICAgfWJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgU0VUX1ZPTFVNRTogeworICAgICAgICAgICAgICAgICAgICBWb2x1bWVEYXRhICpkYXRhID0gKFZvbHVtZURhdGEgKiljb21tYW5kLT5tUGFyYW07CisgICAgICAgICAgICAgICAgICAgIExPR1YoIkF1ZGlvQ29tbWFuZFRocmVhZCgpIHByb2Nlc3Npbmcgc2V0IHZvbHVtZSBzdHJlYW0gJWQsIHZvbHVtZSAlZiwgb3V0cHV0ICVkIiwgZGF0YS0+bVN0cmVhbSwgZGF0YS0+bVZvbHVtZSwgZGF0YS0+bUlPKTsKKyAgICAgICAgICAgICAgICAgICAgY29tbWFuZC0+bVN0YXR1cyA9IEF1ZGlvU3lzdGVtOjpzZXRTdHJlYW1Wb2x1bWUoZGF0YS0+bVN0cmVhbSwgZGF0YS0+bVZvbHVtZSwgZGF0YS0+bUlPKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQtPm1XYWl0U3RhdHVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kLT5tQ29uZC5zaWduYWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XYWl0V29ya0NWLndhaXQobUxvY2spOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBkYXRhOworICAgICAgICAgICAgICAgICAgICB9YnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBTRVRfUEFSQU1FVEVSUzogeworICAgICAgICAgICAgICAgICAgICAgUGFyYW1ldGVyc0RhdGEgKmRhdGEgPSAoUGFyYW1ldGVyc0RhdGEgKiljb21tYW5kLT5tUGFyYW07CisgICAgICAgICAgICAgICAgICAgICBMT0dWKCJBdWRpb0NvbW1hbmRUaHJlYWQoKSBwcm9jZXNzaW5nIHNldCBwYXJhbWV0ZXJzIHN0cmluZyAlcywgaW8gJWQiLCBkYXRhLT5tS2V5VmFsdWVQYWlycy5zdHJpbmcoKSwgZGF0YS0+bUlPKTsKKyAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQtPm1TdGF0dXMgPSBBdWRpb1N5c3RlbTo6c2V0UGFyYW1ldGVycyhkYXRhLT5tSU8sIGRhdGEtPm1LZXlWYWx1ZVBhaXJzKTsKKyAgICAgICAgICAgICAgICAgICAgIGlmIChjb21tYW5kLT5tV2FpdFN0YXR1cykgeworICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQtPm1Db25kLnNpZ25hbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgIG1XYWl0V29ya0NWLndhaXQobUxvY2spOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGRhdGE7CisgICAgICAgICAgICAgICAgICAgICB9YnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgTE9HVygiQXVkaW9Db21tYW5kVGhyZWFkKCkgdW5rbm93biBjb21tYW5kICVkIiwgY29tbWFuZC0+bUNvbW1hbmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZWxldGUgY29tbWFuZDsKKyAgICAgICAgICAgICAgICB3YWl0VGltZSA9IElOVDY0X01BWDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgd2FpdFRpbWUgPSBtQXVkaW9Db21tYW5kc1swXS0+bVRpbWUgLSBjdXJUaW1lOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIExPR1YoIkF1ZGlvQ29tbWFuZFRocmVhZCgpIGdvaW5nIHRvIHNsZWVwIik7CisgICAgICAgIG1XYWl0V29ya0NWLndhaXRSZWxhdGl2ZShtTG9jaywgd2FpdFRpbWUpOworICAgICAgICBMT0dWKCJBdWRpb0NvbW1hbmRUaHJlYWQoKSB3YWtpbmcgdXA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ICAgICAgICAgIGZvciAoc2l6ZV90IGsgPSAwOyBrIDwgcGFyYW0yLnNpemUoKTsgaysrKSB7CisgICAgICAgICAgICAgICAgICBTdHJpbmc4IGtleTI7CisgICAgICAgICAgICAgICAgICBTdHJpbmc4IHZhbHVlMjsKKyAgICAgICAgICAgICAgICAgIHBhcmFtMi5nZXRBdChrLCBrZXkyLCB2YWx1ZTIpOworICAgICAgICAgICAgICAgICAgaWYgKGtleTIgPT0ga2V5KSB7CisgICAgICAgICAgICAgICAgICAgICAgcGFyYW0yLnJlbW92ZShrZXkyKTsKKyAgICAgICAgICAgICAgICAgICAgICBMT0dWKCJGaWx0ZXJpbmcgb3V0IHBhcmFtZXRlciAlcyIsIGtleTIuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gaWYgYWxsIGtleXMgaGF2ZSBiZWVuIGZpbHRlcmVkIG91dCwgcmVtb3ZlIHRoZSBjb21tYW5kLgorICAgICAgICAgICAgLy8gb3RoZXJ3aXNlLCB1cGRhdGUgdGhlIGtleSB2YWx1ZSBwYWlycworICAgICAgICAgICAgaWYgKHBhcmFtMi5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIHJlbW92ZWRDb21tYW5kcy5hZGQoY29tbWFuZDIpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBkYXRhMi0+bUtleVZhbHVlUGFpcnMgPSBwYXJhbTIudG9TdHJpbmcoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIFNFVF9WT0xVTUU6IHsKKyAgICAgICAgICAgIFZvbHVtZURhdGEgKmRhdGEgPSAoVm9sdW1lRGF0YSAqKWNvbW1hbmQtPm1QYXJhbTsKKyAgICAgICAgICAgIFZvbHVtZURhdGEgKmRhdGEyID0gKFZvbHVtZURhdGEgKiljb21tYW5kMi0+bVBhcmFtOworICAgICAgICAgICAgaWYgKGRhdGEtPm1JTyAhPSBkYXRhMi0+bUlPKSBicmVhazsKKyAgICAgICAgICAgIGlmIChkYXRhLT5tU3RyZWFtICE9IGRhdGEyLT5tU3RyZWFtKSBicmVhazsKKyAgICAgICAgICAgIExPR1YoIkZpbHRlcmluZyBvdXQgdm9sdW1lIGNvbW1hbmQgb24gb3V0cHV0ICVkIGZvciBzdHJlYW0gJWQiLCBkYXRhLT5tSU8sIGRhdGEtPm1TdHJlYW0pOworICAgICAgICAgICAgcmVtb3ZlZENvbW1hbmRzLmFkZChjb21tYW5kMik7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGNhc2UgU1RBUlRfVE9ORToKKyAgICAgICAgY2FzZSBTVE9QX1RPTkU6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIHJlbW92ZSBmaWx0ZXJlZCBjb21tYW5kcworICAgIGZvciAoc2l6ZV90IGogPSAwOyBqIDwgcmVtb3ZlZENvbW1hbmRzLnNpemUoKTsgaisrKSB7CisgICAgICAgIC8vIHJlbW92ZWQgY29tbWFuZHMgYWx3YXlzIGhhdmUgdGltZSBzdGFtcHMgZ3JlYXRlciB0aGFuIGN1cnJlbnQgY29tbWFuZAorICAgICAgICBmb3IgKHNpemVfdCBrID0gaSArIDE7IGsgPCBtQXVkaW9Db21tYW5kcy5zaXplKCk7IGsrKykgeworICAgICAgICAgICAgaWYgKG1BdWRpb0NvbW1hbmRzW2tdID09IHJlbW92ZWRDb21tYW5kc1tqXSkgeworICAgICAgICAgICAgICAgIExPR1YoInN1cHByZXNzaW5nIGNvbW1hbmQ6ICVkIiwgbUF1ZGlvQ29tbWFuZHNba10tPm1Db21tYW5kKTsKKyAgICAgICAgICAgICAgICBtQXVkaW9Db21tYW5kcy5yZW1vdmVBdChrKTsKKyAgICAgICAgICAgICAgICBicmVhazsKK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IGRldmljZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MpOworICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0UGhvbmVTdGF0ZShpbnQgc3RhdGUpOworICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0UmluZ2VyTW9kZSh1aW50MzJfdCBtb2RlLCB1aW50MzJfdCBtYXNrKTsKKyAgICB2aXJ0dWFsIHN0YXR1c190IHNldEZvcmNlVXNlKEF1ZGlvU3lzdGVtOjpmb3JjZV91c2UgdXNhZ2UsIEF1ZGlvU3lzdGVtOjpmb3JjZWRfY29uZmlnIGNvbmZpZyk7CisgICAgdmlydHVhbCBBdWRpb1N5c3RlbTo6Zm9yY2VkX2NvbmZpZyBnZXRGb3JjZVVzZShBdWRpb1N5c3RlbTo6Zm9yY2VfdXNlIHVzYWdlKTsKKyAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IGdldE91dHB1dChBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsaW5nUmF0ZSA9IDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0ID0gQXVkaW9TeXN0ZW06OkZPUk1BVF9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6b3V0cHV0X2ZsYWdzIGZsYWdzID0gQXVkaW9TeXN0ZW06Ok9VVFBVVF9GTEFHX0lORElSRUNUKTsKKyAgICB2aXJ0dWFsIHN0YXR1c190IHN0YXJ0T3V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RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNaW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleE1heCk7CisgICAgdmlydHVhbCBzdGF0dXNfdCBzZXRTdHJlYW1Wb2x1bWVJbmRleChBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtLCBpbnQgaW5kZXgpOworICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0U3RyZWFtVm9sdW1lSW5kZXgoQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlIHN0cmVhbSwgaW50ICppbmRleCk7CisKKyAgICB2aXJ0dWFsICAgICBzdGF0dXNfdCAgICBvblRyYW5zYWN0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQYXJjZWwmIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbCogcmVwbHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzKTsKKworICAgIC8vIElCaW5kZXI6OkRlYXRoUmVjaXBpZW50CisgICAgdmlydHVhbCAgICAgdm9pZCAgICAgICAgYmluZGVyRGllZChjb25zdCB3cDxJQmluZGVyPiYgd2hvKTsKKworICAgIC8vCisgICAgLy8gQXVkaW9Qb2xpY3lDbGllbnRJbnRlcmZhY2UKKyAgICAvLworICAgIHZpcnR1YWwgYXVkaW9faW9faGFuZGxlX3Qgb3Blbk91dHB1dCh1aW50MzJfdCAqcERldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcFNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwTGF0ZW5jeU1zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06Om91dHB1dF9mbGFncyBmbGFncyk7CisgICAgdmlydHVhbCBhdWRpb19pb19oYW5kbGVfdCBvcGVuRHVwbGljYXRlT3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dDEsIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dDIpOworICAgIHZpcnR1YWwgc3RhdHVzX3QgY2xvc2VPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KTsKKyAgICB2aXJ0dWFsIHN0YXR1c190IHN1c3BlbmRPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KTsKKyAgICB2aXJ0dWFsIHN0YXR1c190IHJlc3RvcmVPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KTsKKyAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IG9wZW5JbnB1dCh1aW50MzJfdCAqcERldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcFNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGFjb3VzdGljcyk7CisgICAgdmlydHVhbCBzdGF0dXNfdCBjbG9zZUlucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKKyAgICB2aXJ0dWFsIHN0YXR1c190IHNldFN0cmVhbVZvbHVtZShBdWRpb1N5c3RlbTo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gICB2b2lkICAgICAgICBleGl0KCk7CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHN0YXJ0VG9uZUNvbW1hbmQoaW50IHR5cGUgPSAwLCBpbnQgc3RyZWFtID0gMCk7CisgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHN0b3BUb25lQ29tbWFuZCgpOworICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICB2b2x1bWVDb21tYW5kKGludCBzdHJlYW0sIGZsb2F0IHZvbHVtZSwgaW50IG91dHB1dCwgaW50IGRlbGF5TXMgPSAwKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgICAgcGFyYW1ldGVyc0NvbW1hbmQoaW50IGlvSGFuZGxlLCBjb25zdCBTdHJpbmc4JiBrZXlWYWx1ZVBhaXJzLCBpbnQgZGVsYXlNcyA9IDApOworICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBpbnNlcnRDb21tYW5kX2woQXVkaW9Db21tYW5kICpjb21tYW5kLCBpbnQgZGVsYXlNcyA9IDApOworCisgICAgcHJpdmF0ZToKKyAgICAgICAgLy8gZGVzY3JpcHRvciBmb3IgcmVxdWVzdGVkIHRvbmUgcGxheWJhY2sgZXZlbnQKKyAgICAgICAgY2xhc3MgQXVkaW9Db21tYW5kIHsKKyAgICAgICAgcHVibGljOgorICAgICAgICAgICAgaW50IG1Db21tYW5kOyAgIC8vIFNUQVJUX1RPTkUsIFNUT1BfVE9ORSAuLi4KKyAgICAgICAgICAgIG5zZWNzX3QgbVRpbWU7ICAvLyB0aW1lIHN0YW1wCisgICAgICAgICAgICBDb25kaXRpb24gbUNvbmQ7IC8vIGNvbmRpdGlvbiBmb3Igc3RhdHVzIHJldHVybgorICAgICAgICAgICAgc3RhdHVzX3QgbVN0YXR1czsgLy8gY29tbWFuZCBzdGF0dXMKKyAgICAgICAgICAgIGJvb2wgbVdhaXRTdGF0dXM7IC8vIHRydWUgaWYgY2FsbGVyIGlzIHdhaXRpbmcgZm9yIHN0YXR1cworICAgICAgICAgICAgdm9pZCAqbVBhcmFtOyAgICAgLy8gY29tbWFuZCBwYXJhbWV0ZXIgKFRvbmVEYXRhLCBWb2x1bWVEYXRhLCBQYXJhbWV0ZXJzRGF0YSkKKyAgICAgICAgfTsKKworICAgICAgICBjbGFzcyBUb25lRGF0YSB7CisgICAgICAgIHB1YmxpYzoKKyAgICAgICAgICAgIGludCBtVHlwZTsgICAgICAvLyB0b25lIHR5cGUgKFNUQVJUX1RPTkUgb25seSkKKyAgICAgICAgICAgIGludCBtU3RyZWFtOyAgICAvLyBzdHJlYW0gdHlwZSAoU1RBUlRfVE9ORSBvbmx5KQorICAgICAgICB9OworCisgICAgICAgIGNsYXNzIFZvbHVtZURhdGEgeworICAgICAgICBwdWJsaWM6CisgICAgICAgICAgICBpbnQgbVN0cmVhbTsKKyAgICAgICAgICAgIGZsb2F0IG1Wb2x1bWU7CisgICAgICAgICAgICBpbnQgbUlPOworICAgICAgICB9OworICAgICAgICBjbGFzcyBQYXJhbWV0ZXJzRGF0YSB7CisgICAgICAgIHB1YmxpYzoKKyAgICAgICAgICAgIGludCBtSU87CisgICAgICAgICAgICBTdHJpbmc4IG1LZXlWYWx1ZVBhaXJzOworICAgICAgICB9OworCisKKyAgICAgICAgTXV0ZXggICBtTG9jazsKKyAgICAgICAgQ29uZGl0aW9uIG1XYWl0V29ya0NWOworICAgICAgICBWZWN0b3IgPEF1ZGlvQ29tbWFuZCAqPiBtQXVkaW9Db21tYW5kczsgLy8gbGlzdCBvZiBwZW5kaW5nIGNvbW1hbmRzCisgICAgICAgIFRvbmVHZW5lcmF0b3IgKm1wVG9uZUdlbmVyYXRvcjsgICAgIC8vIHRoZSB0b25lIGdlbmVyYXRvcgorICAgIH07CisKKyAgICAvLyBJbnRlcm5hbCBkdW1wIHV0aWxpdGllcy4KKyAgICBzdGF0dXNfdCBkdW1wUGVybWlzc2lvbkRlbmlhbChpbnQgZmQsIGNvbnN0IFZlY3RvcjxTdHJp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dG9yOworfQorCitzdGF0dXNfdCBCQmluZGVyOjp0cmFuc2FjdCgKKyAgICB1aW50MzJfdCBjb2RlLCBjb25zdCBQYXJjZWwmIGRhdGEsIFBhcmNlbCogcmVwbHksIHVpbnQzMl90IGZsYWdzKQoreworICAgIGRhdGEuc2V0RGF0YVBvc2l0aW9uKDApOworCisgICAgc3RhdHVzX3QgZXJyID0gTk9fRVJST1I7CisgICAgc3dpdGNoIChjb2RlKSB7CisgICAgICAgIGNhc2UgUElOR19UUkFOU0FDVElPTjoKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHBpbmdCaW5kZXIoKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGVyciA9IG9uVHJhbnNhY3QoY29kZSwgZGF0YSwgcmVwbHksIGZsYWdzKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGlmIChyZXBseSAhPSBOVUxMKSB7CisgICAgICAgIHJlcGx5LT5zZXREYXRhUG9zaXRpb24oMCk7CisgICAgfQorCisgICAgcmV0dXJuIGVycjsKK30KKworc3RhdHVzX3QgQkJpbmRlcjo6bGlua1RvRGVhdGgoCisgICAgY29uc3Qgc3A8RGVhdGhSZWNpcGllbnQ+JiByZWNpcGllbnQsIHZvaWQqIGNvb2tpZSwgdWludDMyX3QgZmxhZ3MpCit7CisgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOworfQorCitzdGF0dXNfdCBCQmluZGVyOjp1bmxpbmtUb0RlYXRoKAorICAgIGNvbnN0IHdwPERlYXRoUmVjaXBpZW50PiYgcmVjaXBpZW50LCB2b2lkKiBjb29raWUsIHVpbnQzMl90IGZsYWdzLAorICAgIHdwPERlYXRoUmVjaXBpZW50Piogb3V0UmVjaXBpZW50KQoreworICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKK30KKworc3RhdHVzX3QgQkJpbmRlcjo6ZHVtcChpbnQgZmQsIGNvbnN0IFZlY3RvcjxTdHJpbmcxNj4mIGFyZ3MpCit7CisgICAgcmV0dXJuIE5PX0VSUk9SOworfQorCit2b2lkIEJCaW5kZXI6OmF0dGFjaE9iamVjdCgKKyAgICBjb25zdCB2b2lkKiBvYmplY3RJRCwgdm9pZCogb2JqZWN0LCB2b2lkKiBjbGVhbnVwQ29va2llLAorICAgIG9iamVjdF9jbGVhbnVwX2Z1bmMgZnVuYykKK3sKKyAgICBFeHRyYXMqIGUgPSBtRXh0cmFzOworCisgICAgaWYgKCFlKSB7CisgICAgICAgIGUgPSBuZXcgRXh0cmFzOworICAgICAgICBpZiAoYW5kcm9pZF9hdG9taWNfY21weGNoZygwLCByZWludGVycHJldF9jYXN0PGludDMyX3Q+KGUpLAorICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8dm9sYXRpbGUgaW50MzJfdCo+KCZtRXh0cmFzKSkgIT0gMCkgeworICAgICAgICAgICAgZGVsZXRlIGU7CisgICAgICAgICAgICBlID0gbUV4dHJhczsKKyAgICAgICAgfQorICAgICAgICBpZiAoZSA9PSAwKSByZXR1cm47IC8vIG91dCBvZiBtZW1vcnkKKyAgICB9CisKKyAgICBBdXRvTXV0ZXggX2woZS0+bUxvY2spOworICAgIGUtPm1PYmplY3RzLmF0dGFjaChvYmplY3RJRCwgb2JqZWN0LCBjbGVhbnVwQ29va2llLCBmdW5jKTsKK30KKwordm9pZCogQkJpbmRlcjo6ZmluZE9iamVjdChjb25zdCB2b2lkKiBvYmplY3RJRCkgY29uc3QKK3sKKyAgICBFeHRyYXMqIGUgPSBtRXh0cmFzOworICAgIGlmICghZSkgcmV0dXJuIE5VTEw7CisKKyAgICBBdXRvTXV0ZXggX2woZS0+bUxvY2spOworICAgIHJldHVybiBlLT5tT2JqZWN0cy5maW5kKG9iamVjdElEKTsKK30KKwordm9pZCBCQmluZGVyOjpkZXRhY2hPYmplY3QoY29uc3Qgdm9pZCogb2JqZWN0SUQpCit7CisgICAgRXh0cmFzKiBlID0gbUV4dHJhczsKKyAgICBpZiAoIWUpIHJldHVybjsKKworICAgIEF1dG9NdXRleCBfbChlLT5tTG9jayk7CisgICAgZS0+bU9iamVjdHMuZGV0YWNoKG9iamVjdElEKTsKK30KKworQkJpbmRlciogQkJpbmRlcjo6bG9jYWxCaW5kZXIoKQoreworICAgIHJldHVybiB0aGlzOworfQorCitCQmluZGVyOjp+QkJpbmRlcigpCit7CisgICAgaWYgKG1FeHRyYXMpIGRlbGV0ZSBtRXh0cmFzOworfQorCisKK3N0YXR1c190IEJCaW5kZXI6Om9uVHJhbnNhY3QoCisgICAgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLCBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncykKK3sKKyAgICBzd2l0Y2ggKGNvZGUpIHsKKyAgICAgICAgY2FzZSBJTlRFUkZBQ0VfVFJBTlNBQ1RJT046CisgICAgICAgICAgICByZXBseS0+d3JpdGVTdHJpbmcxNihnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworCisgICAgICAgIGNhc2UgRFVNUF9UUkFOU0FDVElPTjogeworICAgICAgICAgICAgaW50IGZkID0gZGF0YS5yZWFkRmlsZURlc2NyaXB0b3IoKTsKKyAgICAgICAgICAgIGludCBhcmdjID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIFZlY3RvcjxTdHJpbmcxNj4gYXJnczsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgYXJnYyAmJiBkYXRhLmRhdGFBdmFpbCgpID4gMDsgaSsrKSB7CisgICAgICAgICAgICAgICBhcmdzLmFkZChkYXRhLnJlYWRTdHJpbmcxNigpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBkdW1wKGZkLCBhcmdzKTsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuIFVO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bnVtQXJnczsgaSsrKSB7CisgICAgICAgIHNlbmQud3JpdGVTdHJpbmcxNihhcmdzW2ldKTsKKyAgICB9CisgICAgc3RhdHVzX3QgZXJyID0gdHJhbnNhY3QoRFVNUF9UUkFOU0FDVElPTiwgc2VuZCwgJnJlcGx5KTsKKyAgICByZXR1cm4gZXJyOworfQorCitzdGF0dXNfdCBCcEJpbmRlcjo6dHJhbnNhY3QoCisgICAgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLCBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncykKK3sKKyAgICAvLyBPbmNlIGEgYmluZGVyIGhhcyBkaWVkLCBpdCB3aWxsIG5ldmVyIGNvbWUgYmFjayB0byBsaWZlLgorICAgIGlmIChtQWxpdmUpIHsKKyAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gSVBDVGhyZWFkU3RhdGU6OnNlbGYoKS0+dHJhbnNhY3QoCisgICAgICAgICAgICBtSGFuZGxlLCBjb2RlLCBkYXRhLCByZXBseSwgZmxhZ3MpOworICAgICAgICBpZiAoc3RhdHVzID09IERFQURfT0JKRUNUKSBtQWxpdmUgPSAwOworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIHJldHVybiBERUFEX09CSkVDVDsKK30KKworc3RhdHVzX3QgQnBCaW5kZXI6OmxpbmtUb0RlYXRoKAorICAgIGNvbnN0IHNwPERlYXRoUmVjaXBpZW50PiYgcmVjaXBpZW50LCB2b2lkKiBjb29raWUsIHVpbnQzMl90IGZsYWdzKQoreworICAgIE9iaXR1YXJ5IG9iOworICAgIG9iLnJlY2lwaWVudCA9IHJlY2lwaWVudDsKKyAgICBvYi5jb29raWUgPSBjb29raWU7CisgICAgb2IuZmxhZ3MgPSBmbGFnczsKKworICAgIExPR19BTFdBWVNfRkFUQUxfSUYocmVjaXBpZW50ID09IE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAibGlua1RvRGVhdGgoKTogcmVjaXBpZW50IG11c3QgYmUgbm9uLU5VTEwiKTsKKworICAgIHsKKyAgICAgICAgQXV0b011dGV4IF9sKG1Mb2NrKTsKKworICAgICAgICBpZiAoIW1PYml0c1NlbnQpIHsKKyAgICAgICAgICAgIGlmICghbU9iaXR1YXJpZXMpIHsKKyAgICAgICAgICAgICAgICBtT2JpdHVhcmllcyA9IG5ldyBWZWN0b3I8T2JpdHVhcnk+OworICAgICAgICAgICAgICAgIGlmICghbU9iaXR1YXJpZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PX01FTU9SWTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgTE9HVigiUmVxdWVzdGluZyBkZWF0aCBub3RpZmljYXRpb246ICVwIGhhbmRsZSAlZFxuIiwgdGhpcywgbUhhbmRsZSk7CisgICAgICAgICAgICAgICAgZ2V0V2Vha1JlZnMoKS0+aW5jV2Vhayh0aGlzKTsKKyAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZSogc2VsZiA9IElQQ1RocmVhZFN0YXRlOjpzZWxmKCk7CisgICAgICAgICAgICAgICAgc2VsZi0+cmVxdWVzdERlYXRoTm90aWZpY2F0aW9uKG1IYW5kbGUsIHRoaXMpOworICAgICAgICAgICAgICAgIHNlbGYtPmZsdXNoQ29tbWFuZHMoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNzaXplX3QgcmVzID0gbU9iaXR1YXJpZXMtPmFkZChvYik7CisgICAgICAgICAgICByZXR1cm4gcmVzID49IChzc2l6ZV90KU5PX0VSUk9SID8gKHN0YXR1c190KU5PX0VSUk9SIDogcmVzOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIERFQURfT0JKRUNUOworfQorCitzdGF0dXNfdCBCcEJpbmRlcjo6dW5saW5rVG9EZWF0aCgKKyAgICBjb25zdCB3cDxEZWF0aFJlY2lwaWVudD4mIHJlY2lwaWVudCwgdm9pZCogY29va2llLCB1aW50MzJfdCBmbGFncywKKyAgICB3cDxEZWF0aFJlY2lwaWVudD4qIG91dFJlY2lwaWVudCkKK3sKKyAgICBBdXRvTXV0ZXggX2wobUxvY2spOworCisgICAgaWYgKG1PYml0c1NlbnQpIHsKKyAgICAgICAgcmV0dXJuIERFQURfT0JKRUNUOworICAgIH0KKworICAgIGNvbnN0IHNpemVfdCBOID0gbU9iaXR1YXJpZXMgPyBtT2JpdHVhcmllcy0+c2l6ZSgpIDogMDsKKyAgICBmb3IgKHNpemVfdCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgIGNvbnN0IE9iaXR1YXJ5JiBvYml0ID0gbU9iaXR1YXJpZXMtPml0ZW1BdChpKTsKKyAgICAgICAgaWYgKChvYml0LnJlY2lwaWVudCA9PSByZWNpcGllbnQKKyAgICAgICAgICAgICAgICAgICAgfHwgKHJlY2lwaWVudCA9PSBOVUxMICYmIG9iaXQuY29va2llID09IGNvb2tpZSkpCisgICAgICAgICAgICAgICAgJiYgb2JpdC5mbGFncyA9PSBmbGFncykgeworICAgICAgICAgICAgY29uc3QgdWludDMyX3QgYWxsRmxhZ3MgPSBvYml0LmZsYWdzfGZsYWdzOworICAgICAgICAgICAgaWYgKG91dFJlY2lwaWVudCAhPSBOVUxMKSB7CisgICAgICAgICAgICAgICAgKm91dFJlY2lwaWVudCA9IG1PYml0dWFyaWVzLT5pdGVtQXQoaSkucmVjaXBpZW50OworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU9iaXR1YXJpZXMtPnJlbW92ZUF0KGkpOworICAgICAgICAgICAgaWYgKG1PYml0dWFyaWVzLT5zaXplKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIExPR1YoIkNsZWFyaW5nIGRlYXRoIG5vdGlmaWNhdGlvbjogJXAgaGFuZGxlICVkXG4iLCB0aGlzLCBtSGFuZGxlKTsKKyAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZSogc2VsZiA9IElQQ1RocmVhZFN0YXRlOjpzZWxmKCk7CisgICAgICAgICAgICAgICA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G1Mb2NrLnVubG9jaygpOworCisgICAgTE9HVigiUmVwb3J0aW5nIGRlYXRoIG9mIHByb3h5ICVwIGZvciAlZCByZWNpcGllbnRzXG4iLAorICAgICAgICB0aGlzLCBvYml0cyA/IG9iaXRzLT5zaXplKCkgOiAwKTsKKworICAgIGlmIChvYml0cyAhPSBOVUxMKSB7CisgICAgICAgIGNvbnN0IHNpemVfdCBOID0gb2JpdHMtPnNpemUoKTsKKyAgICAgICAgZm9yIChzaXplX3QgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgcmVwb3J0T25lRGVhdGgob2JpdHMtPml0ZW1BdChpKSk7CisgICAgICAgIH0KKworICAgICAgICBkZWxldGUgb2JpdHM7CisgICAgfQorfQorCit2b2lkIEJwQmluZGVyOjpyZXBvcnRPbmVEZWF0aChjb25zdCBPYml0dWFyeSYgb2JpdCkKK3sKKyAgICBzcDxEZWF0aFJlY2lwaWVudD4gcmVjaXBpZW50ID0gb2JpdC5yZWNpcGllbnQucHJvbW90ZSgpOworICAgIExPR1YoIlJlcG9ydGluZyBkZWF0aCB0byByZWNpcGllbnQ6ICVwXG4iLCByZWNpcGllbnQuZ2V0KCkpOworICAgIGlmIChyZWNpcGllbnQgPT0gTlVMTCkgcmV0dXJuOworCisgICAgcmVjaXBpZW50LT5iaW5kZXJEaWVkKHRoaXMpOworfQorCisKK3ZvaWQgQnBCaW5kZXI6OmF0dGFjaE9iamVjdCgKKyAgICBjb25zdCB2b2lkKiBvYmplY3RJRCwgdm9pZCogb2JqZWN0LCB2b2lkKiBjbGVhbnVwQ29va2llLAorICAgIG9iamVjdF9jbGVhbnVwX2Z1bmMgZnVuYykKK3sKKyAgICBBdXRvTXV0ZXggX2wobUxvY2spOworICAgIExPR1YoIkF0dGFjaGluZyBvYmplY3QgJXAgdG8gYmluZGVyICVwIChtYW5hZ2VyPSVwKSIsIG9iamVjdCwgdGhpcywgJm1PYmplY3RzKTsKKyAgICBtT2JqZWN0cy5hdHRhY2gob2JqZWN0S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JpbmRlcik7CisgICAgdm9pZCBkdW1wX2hlYXBzKCk7CisKK3ByaXZhdGU6CisgICAgLy8gRm9yIElNZW1vcnkuY3BwCisgICAgc3RydWN0IGhlYXBfaW5mb190IHsKKyAgICAgICAgc3A8SU1lbW9yeUhlYXA+IGhlYXA7CisgICAgICAgIGludDMyX3QgICAgICAgICBjb3VudDsKKyAgICB9OworCisgICAgdm9pZCBmcmVlX2hlYXAoY29uc3Qgd3A8SUJpbmRlcj4mIGJpbmRlcik7IAorCisgICAgTXV0ZXggbUhlYXBDYWNoZUxvY2s7CisgICAgS2V5ZWRWZWN0b3I8IHdwPElCaW5kZXI+LCBoZWFwX2luZm9fdCA+IG1IZWFwQ2FjaGU7Cit9OworCitzdGF0aWMgc3A8SGVhcENhY2hlPiBnSGVhcENhY2hlID0gbmV3IEhlYXBDYWNoZSgpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitlbnVtIHsKKyAgICBIRUFQX0lEID0gSUJpbmRlcjo6RklSU1RfQ0FMTF9UUkFOU0FDVElPTgorfTsKKworY2xhc3MgQnBNZW1vcnlIZWFwIDogcHVibGljIEJwSW50ZXJmYWNlPElNZW1vcnlIZWFwPgoreworcHVibGljOgorICAgIEJwTWVtb3J5SGVhcChjb25zdCBzcDxJQmluZGVyPiYgaW1wbCk7CisgICAgdmlydHVhbCB+QnBNZW1vcnlIZWFwKCk7CisKKyAgICB2aXJ0dWFsIGludCBnZXRIZWFwSUQoKSBjb25zdDsKKyAgICB2aXJ0dWFsIHZvaWQqIGdldEJhc2UoKSBjb25zdDsKKyAgICB2aXJ0dWFsIHNpemVfdCBnZXRTaXplKCkgY29uc3Q7CisgICAgdmlydHVhbCB1aW50MzJfdCBnZXRGbGFncygpIGNvbnN0OworCitwcml2YXRlOgorICAgIGZyaWVuZCBjbGFzcyBJTWVtb3J5OworICAgIGZyaWVuZCBjbGFzcyBI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pemVfdCogb2Zmc2V0LCBzaXplX3QqIHNpemUpIGNvbnN0Cit7CisgICAgaWYgKG1IZWFwID09IDApIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU1lbW9yeTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgaWYgKHJlbW90ZSgpLT50cmFuc2FjdChHRVRfTUVNT1JZLCBkYXRhLCAmcmVwbHkpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICBzcDxJQmluZGVyPiBoZWFwID0gcmVwbHkucmVhZFN0cm9uZ0JpbmRlcigpOworICAgICAgICAgICAgc3NpemVfdCBvID0gcmVwbHkucmVhZEludDMyKCk7CisgICAgICAgICAgICBzaXplX3QgcyA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICAgICAgaWYgKGhlYXAgIT0gMCkgeworICAgICAgICAgICAgICAgIG1IZWFwID0gaW50ZXJmYWNlX2Nhc3Q8SU1lbW9yeUhlYXA+KGhlYXApOworICAgICAgICAgICAgICAgIGlmIChtSGVhcCAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIG1PZmZzZXQgPSBvOworICAgICAgICAgICAgICAgICAgICBtU2l6ZSA9IHM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIGlmIChvZmZzZXQpICpvZmZzZXQgPSBtT2Zmc2V0OworICAgIGlmIChzaXplKSAqc2l6ZSA9IG1TaXplOworICAgIHJldHVybiBtSGVhcDsKK30KKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK0lNUExFTUVOVF9NRVRBX0lOVEVSRkFDRShNZW1vcnksICJhbmRyb2lkLnV0aWxzLklNZW1vcnkiKTsKKworQm5NZW1vcnk6OkJuTWVtb3J5KCkgeworfQorCitCbk1lbW9yeTo6fkJuTWVtb3J5KCkgeyAKK30KKworc3RhdHVzX3QgQm5NZW1vcnk6Om9uVHJhbnNhY3QoCisgICAgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLCBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncykKK3sKKyAgICBzd2l0Y2goY29kZSkgeworICAgICAgICBjYXNlIEdFVF9NRU1PUlk6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVtb3J5LCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBzc2l6ZV90IG9mZnNldDsKKyAgICAgICAgICAgIHNpemVfdCBzaXplOworICAgICAgICAgICAgcmVwbHktPndyaXRlU3Ryb25nQmluZGVyKCBnZXRNZW1vcnkoJm9mZnNldCwgJnNpemUpLT5hc0JpbmRlcigpICk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihvZmZzZXQpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2l6ZSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gQkJpbmRlcjo6b25UcmFuc2FjdChjb2RlLCBkYXRhLCByZXBseSwgZmxhZ3MpOworICAgIH0KK30KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitCcE1lbW9yeUhlYXA6OkJwTWVtb3J5SGVhcChjb25zdCBzcDxJQmluZGVyPiYgaW1wbCkKKyAgICA6IEJwSW50ZXJmYWNlPElNZW1vcnlIZWFwPihpbXBsKSwKKyAgICAgICAgbUhlYXBJZCgtMSksIG1CYXNlKE1BUF9GQUlMRUQpLCBtU2l6ZSgwKSwgbUZsYWdzKDApLCBtUmVhbEhlYXAoZmFsc2UpCit7Cit9CisKK0JwTWVtb3J5SGVhcDo6fkJwTWVtb3J5SGVhcCgpIHsKKyAgICBpZiAobUhlYXBJZCAhPSAtMSkgeworICAgICAgICBjbG9zZShtSGVhcElkKTsKKyAgICAgICAgaWYgKG1SZWFsSGVhcCkgeworICAgICAgICAgICAgLy8gYnkgY29uc3RydWN0aW9uIHdlJ3JlIHRoZSBsYXN0IG9uZQorICAgICAgICAgICAgaWYgKG1CYXNlICE9IE1BUF9GQUlMRUQpIHsKKyAgICAgICAgICAgICAgICBzcDxJQmluZGVyPiBiaW5kZXIgPSBjb25zdF9jYXN0PEJwTWVtb3J5SGVhcCo+KHRoaXMpLT5hc0JpbmRlcigpOworCisgICAgICAgICAgICAgICAgaWYgKFZFUkJPU0UpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HRCgiVU5NQVBQSU5HIGJpbmRlcj0lcCwgaGVhcD0lcCwgc2l6ZT0lZCwgZmQ9JWQiLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaW5kZXIuZ2V0KCksIHRoaXMsIG1TaXplLCBtSGVhcElkKTsKKyAgICAgICAgICAgICAgICAgICAgQ2FsbFN0YWNrIHN0YWNrOworICAgICAgICAgICAgICAgICAgICBzdGFjay51cGRhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhY2suZHVtcCgiY2FsbHN0YWNrIik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbXVubWFwKG1CYXNlLCBtU2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyByZW1vdmUgZnJvbSBsaXN0IG9ubHkgaWYgaXQgd2FzIG1hcHBlZCBiZWZvcmUKKyAgICAgICAgICAgIHNwPElCaW5kZXI+IGJpbmRlciA9IGNvbnN0X2Nhc3Q8QnBNZW1vcnlIZWFwKj4odGhpcyktPmFzQmluZGVyKCk7CisgICAgICAgICAgICBmcmVlX2hlYXAoYmluZGVyKTsK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gICAgICAvLyBjYWxsaW5nIHRyYW5zYWN0KCkgZnJvbSBtdWx0aXBsZSB0aHJlYWRzLCBidXQgdGhhdCdzIG5vdCBhIHByb2JsZW0sCisgICAgICAgIC8vIG9ubHkgbW1hcCBiZWxvdyBtdXN0IGJlIGluIHRoZSBjcml0aWNhbCBzZWN0aW9uLgorICAgICAgICAKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU1lbW9yeUhlYXA6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIHN0YXR1c190IGVyciA9IHJlbW90ZSgpLT50cmFuc2FjdChIRUFQX0lELCBkYXRhLCAmcmVwbHkpOworICAgICAgICBpbnQgcGFyY2VsX2ZkID0gcmVwbHkucmVhZEZpbGVEZXNjcmlwdG9yKCk7CisgICAgICAgIHNzaXplX3Qgc2l6ZSA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICB1aW50MzJfdCBmbGFncyA9IHJlcGx5LnJlYWRJbnQzMigpOworCisgICAgICAgIExPR0VfSUYoZXJyLCAiYmluZGVyPSVwIHRyYW5zYWN0aW9uIGZhaWxlZCBmZD0lZCwgc2l6ZT0lbGQsIGVycj0lZCAoJXMpIiwKKyAgICAgICAgICAgICAgICBhc0JpbmRlcigpLmdldCgpLCBwYXJjZWxfZmQsIHNpemUsIGVyciwgc3RyZXJyb3IoLWVycikpOworCisgICAgICAgIGludCBmZCA9IGR1cCggcGFyY2VsX2ZkICk7CisgICAgICAgIExPR0VfSUYoZmQ9PS0xLCAiY2Fubm90IGR1cCBmZD0lZCwgc2l6ZT0lbGQsIGVycj0lZCAoJXMpIiwKKyAgICAgICAgICAgICAgICBwYXJjZWxfZmQsIHNpemUsIGVyciwgc3RyZXJyb3IoZXJybm8pKTsKKworICAgICAgICBpbnQgYWNjZXNzID0gUFJPVF9SRUFEOworICAgICAgICBpZiAoIShmbGFncyAmIFJFQURfT05MWSkpIHsKKyAgICAgICAgICAgIGFjY2VzcyB8PSBQUk9UX1dSSVRFOworICAgICAgICB9CisKKyAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKyAgICAgICAgaWYgKG1IZWFwSWQgPT0gLTEpIHsKKyAgICAgICAgICAgIG1SZWFsSGVhcCA9IHRydWU7CisgICAgICAgICAgICBtQmFzZSA9IG1tYXAoMCwgc2l6ZSwgYWNjZXNzLCBNQVBfU0hBUkVELCBmZCwgMCk7CisgICAgICAgICAgICBpZiAobUJhc2UgPT0gTUFQX0ZBSUxFRCkgeworICAgICAgICAgICAgICAgIExPR0UoImNhbm5vdCBtYXAgQnBNZW1vcnlIZWFwIChiaW5kZXI9JXApLCBzaXplPSVsZCwgZmQ9JWQgKCVzKSIsCisgICAgICAgICAgICAgICAgICAgICAgICBhc0JpbmRlcigpLmdldCgpLCBzaXplLCBmZCwgc3RyZXJyb3IoZXJybm8pKTsKKyAgICAgICAgICAgICAgICBjbG9zZShmZCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChmbGFncyAmIE1BUF9PTkNFKSB7CisgICAgICAgICAgICAgICAgICAgIC8vTE9HRCgicGlubmluZyBoZWFwIChiaW5kZXI9JXAsIHNpemU9JWQsIGZkPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgIGFzQmluZGVyKCkuZ2V0KCksIHNpemUsIGZkKTsKKyAgICAgICAgICAgICAgICAgICAgcGluX2hlYXAoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVNpemUgPSBzaXplOworICAgICAgICAgICAgICAgIG1GbGFncyA9IGZsYWdzOworICAgICAgICAgICAgICAgIGFuZHJvaWRfYXRvbWljX3dyaXRlKGZkLCAmbUhlYXBJZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK2ludCBCcE1lbW9yeUhlYXA6OmdldEhlYXBJRCgpIGNvbn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VJbnQzMihnZXRTaXplKCkpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZ2V0RmxhZ3MoKSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICByZXR1cm4gQkJpbmRlcjo6b25UcmFuc2FjdChjb2RlLCBkYXRhLCByZXBseSwgZmxhZ3MpOworICAgIH0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitIZWFwQ2FjaGU6OkhlYXBDYWNoZSgpCisgICAgOiBEZWF0aFJlY2lwaWVudCgpCit7Cit9CisKK0hlYXBDYWNoZTo6fkhlYXBDYWNoZSgpCit7Cit9CisKK3ZvaWQgSGVhcENhY2hlOjpiaW5kZXJEaWVkKGNvbnN0IHdwPElCaW5kZXI+JiBiaW5kZXIpCit7CisgICAgLy9MT0dEKCJiaW5kZXJEaWVkIGJpbmRlcj0lcCIsIGJpbmRlci51bnNhZmVfZ2V0KCkpOworICAgIGZyZWVfaGVhcChiaW5kZXIpOyAKK30KKworc3A8SU1lbW9yeUhlYXA+IEhlYXBDYWNoZTo6ZmluZF9oZWFwKGNvbnN0IHNwPElCaW5kZXI+JiBiaW5kZXIpIAoreworICAgIE11dGV4OjpBdXRvbG9jayBfbChtSGVhcENhY2hlTG9jayk7CisgICAgc3NpemVfdCBpID0gbUhlYXBDYWNoZS5pbmRleE9mS2V5KGJpbmRlcik7CisgICAgaWYgKGk+PTApIHsKKyAgICAgICAgaGVhcF9pbmZvX3QmIGluZm8gPSBtSGVhcENhY2hlLmVkaXRWYWx1ZUF0KGkpOworICAgICAgICBMT0dEX0lGKFZFUkJPU0UsCisgICAgICAgICAgICAgICAgImZvdW5kIGJpbmRlcj0lcCwgaGVhcD0lcCwgc2l6ZT0lZCwgZmQ9JWQsIGNvdW50PSVkIiwgCisgICAgICAgICAgICAgICAgYmluZGVyLmdldCgpLCBpbmZvLmhlYXAuZ2V0KCksCisgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QnBNZW1vcnlIZWFwKj4oaW5mby5oZWFwLmdldCgpKS0+bVNpemUsCisgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QnBNZW1vcnlIZWFwKj4oaW5mby5oZWFwLmdldCgpKS0+bUhlYXBJZCwKKyAgICAgICAgICAgICAgICBpbmZvLmNvdW50KTsKKyAgICAgICAgYW5kcm9pZF9hdG9taWNfaW5jKCZpbmZvLmNvdW50KTsKKyAgICAgICAgcmV0dXJuIGluZm8uaGVhcDsKKyAgICB9IGVsc2UgeworICAgICAgICBoZWFwX2luZm9fdCBpbmZvOworICAgICAgICBpbmZvLmhlYXAgPSBpbnRlcmZhY2VfY2FzdDxJTWVtb3J5SGVhcD4oYmluZGVyKTsKKyAgICAgICAgaW5mby5jb3VudCA9IDE7CisgICAgICAgIC8vTE9HRCgiYWRkaW5nIGJpbmRlcj0lcCwgaGVhcD0lcCwgY291bnQ9JWQiLAorICAgICAgICAvLyAgICAgIGJpbmRlci5nZXQoKSwgaW5mby5oZWFwLmdldCgpLCBpbmZvLmNvdW50KTsKKyAgICAgICAgbUhlYXBDYWNoZS5hZGQoYmluZGVyLCBpbmZvKTsKKyAgICAgICAgcmV0dXJuIGluZm8uaGVhcDsKKyAgICB9Cit9CisKK3ZvaWQgSGVhcENhY2hlOjpwaW5faGVhcChjb25zdCBzcDxJQmluZGVyPiYgYmluZGVyKSAKK3sKKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobUhlYXBDYWNoZUxvY2spOworICAgIHNzaXplX3QgaSA9IG1IZWFwQ2FjaGUuaW5kZXhPZktleShiaW5kZXIpOworICAgIGlmIChpPj0wKSB7CisgICAgICAgIGhlYXBfaW5mb190JiBpbmZvKG1IZWFwQ2FjaGUuZWRpdFZhbHVlQXQoaSkpOworICAgICAgICBhbmRyb2lkX2F0b21pY19pbmMoJmluZm8uY291bnQpOworICAgICAgICBiaW5kZXItPmxpbmtUb0RlYXRoKHRoaXMpOworICAgIH0gZWxzZSB7CisgICAgICAgIExPR0UoInBpbl9oZWFwIGJpbmRlcj0lcCBub3QgZm91bmQhISEiLCBiaW5kZXIuZ2V0KCkpOworICAgIH0gICAgCit9CisKK3ZvaWQgSGVhcENhY2hlOjpmcmVlX2hlYXAoY29uc3Qgc3A8SUJpbmRlcj4mIGJpbmRlcikgIHsKKyAgICBmcmVlX2hlYXAoIHdwPElCaW5kZXI+KGJpbmRlcikgKTsKK30KKwordm9pZCBIZWFwQ2FjaGU6OmZyZWVfaGVhcChjb25zdCB3cDxJQmluZGVyPiYgYmluZGVyKSAKK3sKKyAgICBzcDxJTWVtb3J5SGVhcD4gcmVsOworICAgIHsKKyAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1IZWFwQ2FjaGVMb2NrKTsKKyAgICAgICAgc3NpemVfdCBpID0gbUhlYXBDYWNoZS5pbmRleE9mS2V5KGJpbmRlcik7CisgICAgICAgIGlmIChpPj0wKSB7CisgICAgICAgICAgICBoZWFwX2luZm9fdCYgaW5mbyhtSGVhcENhY2hlLmVkaXRWYWx1ZUF0KGkpKTsKKyAgICAgICAgICAgIGludDMyX3QgYyA9IGFuZHJvaWRfYXRvbWljX2RlYygmaW5mby5jb3VudCk7CisgICAgICAgICAgICBpZiAoYyA9PSAxKSB7CisgICAgICAgICAgICAgICAgTE9HRF9JRihWRVJCT1NFLAorICAgICAgICAgICAgICAgICAgICAgICAgInJlbW92aW5nIGJpbmRlcj0lcCwgaGVhcD0lcCwgc2l6ZT0lZCwgZmQ9JWQsIGNvdW50PSVkIiwgCisgICAgICAgICAgICAgICAgICAgICAgICBiaW5kZXIudW5zYWZlX2dldCgpLCBpbmZvLmhlYXAuZ2V0KCksCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxCcE1lbW9yeUhlYXAqPihpbmZvLmhlYXAuZ2V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TjoKKyAgICAgICAgY2FzZSBCUl9SRVBMWTogeworICAgICAgICAgICAgb3V0IDw8ICI6ICIgPDwgaW5kZW50OworICAgICAgICAgICAgY21kID0gKGNvbnN0IGludDMyX3QgKilwcmludEJpbmRlclRyYW5zYWN0aW9uRGF0YShvdXQsIGNtZCk7CisgICAgICAgICAgICBvdXQgPDwgZGVkZW50OworICAgICAgICB9IGJyZWFrOworICAgICAgICAKKyAgICAgICAgY2FzZSBCUl9BQ1FVSVJFX1JFU1VMVDogeworICAgICAgICAgICAgY29uc3QgaW50MzJfdCByZXMgPSAqY21kKys7CisgICAgICAgICAgICBvdXQgPDwgIjogIiA8PCByZXMgPDwgKHJlcyA/ICIgKFNVQ0NFU1MpIiA6ICIgKEZBSUxVUkUpIik7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIAorICAgICAgICBjYXNlIEJSX0lOQ1JFRlM6CisgICAgICAgIGNhc2UgQlJfQUNRVUlSRToKKyAgICAgICAgY2FzZSBCUl9SRUxFQVNFOgorICAgICAgICBjYXNlIEJSX0RFQ1JFRlM6IHsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgYiA9ICpjbWQrKzsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgYyA9ICpjbWQrKzsKKyAgICAgICAgICAgIG91dCA8PCAiOiB0YXJnZXQ9IiA8PCAodm9pZCopYiA8PCAiIChjb29raWUgIiA8PCAodm9pZCopYyA8PCAiKSI7CisgICAgICAgIH0gYnJlYWs7CisgICAgCisgICAgICAgIGNhc2UgQlJfQVRURU1QVF9BQ1FVSVJFOiB7CisgICAgICAgICAgICBjb25zdCBpbnQzMl90IHAgPSAqY21kKys7CisgICAgICAgICAgICBjb25zdCBpbnQzMl90IGIgPSAqY21kKys7CisgICAgICAgICAgICBjb25zdCBpbnQzMl90IGMgPSAqY21kKys7CisgICAgICAgICAgICBvdXQgPDwgIjogdGFyZ2V0PSIgPDwgKHZvaWQqKWIgPDwgIiAoY29va2llICIgPDwgKHZvaWQqKWMKKyAgICAgICAgICAgICAgICA8PCAiKSwgcHJpPSIgPDwgcDsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEJSX0RFQURfQklOREVSOgorICAgICAgICBjYXNlIEJSX0NMRUFSX0RFQVRIX05PVElGSUNBVElPTl9ET05FOiB7CisgICAgICAgICAgICBjb25zdCBpbnQzMl90IGMgPSAqY21kKys7CisgICAgICAgICAgICBvdXQgPDwgIjogZGVhdGggY29va2llICIgPDwgKHZvaWQqKWM7CisgICAgICAgIH0gYnJlYWs7CisgICAgfQorICAgIAorICAgIG91dCA8PCBlbmRsOworICAgIHJldHVybiBjbWQ7Cit9CisKK3N0YXRpYyBjb25zdCB2b2lkKiBwcmludENvbW1hbmQoVGV4dE91dHB1dCYgb3V0LCBjb25zdCB2b2lkKiBfY21kKQoreworICAgIHN0YXRpYyBjb25zdCBpbnQzMl90IE4gPSBzaXplb2Yoa0NvbW1hbmRTdHJpbmdzKS9zaXplb2Yoa0NvbW1hbmRTdHJpbmdzWzBdKTsKKyAgICAKKyAgICBjb25zdCBpbnQzMl90KiBjbWQgPSAoY29uc3QgaW50MzJfdCopX2NtZDsKKyAgICBpbnQzMl90IGNvZGUgPSAqY21kKys7CisgICAgaWYgKGNvZGUgPCAwIHx8IGNvZGUgPj0gTikgeworICAgICAgICBvdXQgPDwgIlVua25vd24gY29tbWFuZDogIiA8PCBjb2RlIDw8IGVuZGw7CisgICAgICAgIHJldHVybiBjbWQ7CisgICAgfQorICAgIAorICAgIG91dCA8PCBrQ29tbWFuZFN0cmluZ3NbY29kZV07CisgICAgc3dpdGNoIChjb2RlKSB7CisgICAgICAgIGNhc2UgQkNfVFJBTlNBQ1RJT046CisgICAgICAgIGNhc2UgQkNfUkVQTFk6IHsKKyAgICAgICAgICAgIG91dCA8PCAiOiAiIDw8IGluZGVudDsKKyAgICAgICAgICAgIGNtZCA9IChjb25zdCBpbnQzMl90ICopcHJpbnRCaW5kZXJUcmFuc2FjdGlvbkRhdGEob3V0LCBjbWQpOworICAgICAgICAgICAgb3V0IDw8IGRlZGVudDsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgCisgICAgICAgIGNhc2UgQkNfQUNRVUlSRV9SRVNVTFQ6IHsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgcmVzID0gKmNtZCsrOworICAgICAgICAgICAgb3V0IDw8ICI6ICIgPDwgcmVzIDw8IChyZXMgPyAiIChTVUNDRVNTKSIgOiAiIChGQUlMVVJFKSIpOworICAgICAgICB9IGJyZWFrOworICAgICAgICAKKyAgICAgICAgY2FzZSBCQ19GUkVFX0JVRkZFUjogeworICAgICAgICAgICAgY29uc3QgaW50MzJfdCBidWYgPSAqY21kKys7CisgICAgICAgICAgICBvdXQgPDwgIjogYnVmZmVyPSIgPDwgKHZvaWQqKWJ1ZjsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgCisgICAgICAgIGNhc2UgQkNfSU5DUkVGUzoKKyAgICAgICAgY2FzZSBCQ19BQ1FVSVJFOgorICAgICAgICBjYXNlIEJDX1JFTEVBU0U6CisgICAgICAgIGNhc2UgQkNfREVDUkVGUzogeworICAgICAgICAgICAgY29uc3QgaW50MzJfdCBkID0gKmNtZCsrOworICAgICAgICAgICAgb3V0IDw8ICI6IGRlc2NyaXB0b3I9IiA8PCAodm9pZCopZDsKKyAgICAgICAgfSBicmVhazsKKyAgICAKKyAgICAgICAgY2FzZSBCQ19JTkNSRUZTX0RPTkU6CisgICAgICAgIGNhc2UgQkNfQUNRVUlSRV9ET05FOiB7CisgICAgICAgICAgICBjb25zdCBpbnQzMl90IGIgPSAqY21kKys7CisgICAgICAgICAgICBjb25zdCBpbnQzMl90IGMgPSAqY21kKys7CisgICAgICAgICAgICBvdXQgPDwgIjogdGFyZ2V0PSIgPDwgKHZvaWQqKWIgPDwgIiAoY29va2llICIgPDwgKHZvaWQqKWMgPDwgIikiOworICAgICAgICB9IGJyZWFrOworICAgICAgICAKKyAgICAgICAgY2FzZSBCQ19BVFRFTVBUX0FDUVVJUkU6IHsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgcCA9ICpjbWQrKzsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgZCA9ICpjbWQrKzsKKyAgICAgICAgICAgIG91dCA8PCAiOiBkZWNyaXB0b3I9IiA8PCAodm9pZCopZCA8PCAiLCBwcmk9IiA8PCBwOworICAgICAgICB9IGJyZWFrOworICAgICAgICAKKyAgICAgICAgY2FzZSBCQ19SRVFVRVNUX0RFQVRIX05PVElGSUNBVElPTjoKKyAgICAgICAgY2FzZSBCQ19DTEVBUl9ERUFUSF9OT1RJRklDQVRJT046IHsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgaCA9ICpjbWQrKzsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgYyA9ICpjbWQrKzsKKyAgICAgICAgICAgIG91dCA8PCAiOiBoYW5kbGU9IiA8PCBoIDw8ICIgKGRlYXRoIGNvb2tpZSAiIDw8ICh2b2lkKiljIDw8ICIpIjsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEJDX0RFQURfQklOREVSX0RPTkU6IHsKKyAgICAgICAgICAgIGNvbnN0IGludDMyX3QgYyA9ICpjbWQrKzsKKyAgICAgICAgICAgIG91dCA8PCAiOiBkZWF0aCBjb29raWUgIiA8PCAodm9pZCopYzsKKyAgICAgICAgfSBicmVhazsKKyAgICB9CisgICAgCisgICAgb3V0IDw8IGVuZGw7CisgICAgcmV0dXJuIGNtZDsKK30KKyNlbmRpZgorCitzdGF0aWMgcHRocmVhZF9tdXRleF90IGdUTFNNdXRleCA9IFBUSFJFQURfTVVURVhfSU5JVElBTElaRVI7CitzdGF0aWMgYm9vbCBnSGF2ZVRMUyA9IGZhbHNlOworc3RhdGljIHB0aHJlYWRfa2V5X3QgZ1RMUyA9IDA7CitzdGF0aWMgYm9vbCBnU2h1dGRvd24gPSBmYWxzZTsKKworSVBDVGhyZWFkU3RhdGUqIElQQ1RocmV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QoKTsKK30KKwordm9pZCBJUENUaHJlYWRTdGF0ZTo6Zmx1c2hDb21tYW5kcygpCit7CisgICAgaWYgKG1Qcm9jZXNzLT5tRHJpdmVyRkQgPD0gMCkKKyAgICAgICAgcmV0dXJuOworICAgIHRhbGtXaXRoRHJpdmVyKGZhbHNlKTsKK30KKwordm9pZCBJUENUaHJlYWRTdGF0ZTo6am9pblRocmVhZFBvb2woYm9vbCBpc01haW4pCit7CisgICAgTE9HX1RIUkVBRFBPT0woIioqKiogVEhSRUFEICVwIChQSUQgJWQpIElTIEpPSU5JTkcgVEhFIFRIUkVBRCBQT09MXG4iLCAodm9pZCopcHRocmVhZF9zZWxmKCksIGdldHBpZCgpKTsKKworICAgIG1PdXQud3JpdGVJbnQzMihpc01haW4gPyBCQ19FTlRFUl9MT09QRVIgOiBCQ19SRUdJU1RFUl9MT09QRVIpOworICAgIAorICAgIHN0YXR1c190IHJlc3VsdDsKKyAgICBkbyB7CisgICAgICAgIGludDMyX3QgY21kOworICAgICAgICAKKyAgICAgICAgLy8gV2hlbiB3ZSd2ZSBjbGVhcmVkIHRoZSBpbmNvbWluZyBjb21tYW5kIHF1ZXVlLCBwcm9jZXNzIGFueSBwZW5kaW5nIGRlcmVmcworICAgICAgICBpZiAobUluLmRhdGFQb3NpdGlvbigpID49IG1Jbi5kYXRhU2l6ZSgpKSB7CisgICAgICAgICAgICBzaXplX3QgbnVtUGVuZGluZyA9IG1QZW5kaW5nV2Vha0RlcmVmcy5zaXplKCk7CisgICAgICAgICAgICBpZiAobnVtUGVuZGluZyA+IDApIHsKKyAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG51bVBlbmRpbmc7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBSZWZCYXNlOjp3ZWFrcmVmX3R5cGUqIHJlZnMgPSBtUGVuZGluZ1dlYWtEZXJlZnNbaV07CisgICAgICAgICAgICAgICAgICAgIHJlZnMtPmRlY1dlYWsobVByb2Nlc3MuZ2V0KCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtUGVuZGluZ1dlYWtEZXJlZnMuY2xlYXIoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbnVtUGVuZGluZyA9IG1QZW5kaW5nU3Ryb25nRGVyZWZzLnNpemUoKTsKKyAgICAgICAgICAgIGlmIChudW1QZW5kaW5nID4gMCkgeworICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbnVtUGVuZGluZzsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIEJCaW5kZXIqIG9iaiA9IG1QZW5kaW5nU3Ryb25nRGVyZWZzW2ldOworICAgICAgICAgICAgICAgICAgICBvYmotPmRlY1N0cm9uZyhtUHJvY2Vzcy5nZXQoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1QZW5kaW5nU3Ryb25nRGVyZWZzLmNsZWFyKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBub3cgZ2V0IHRoZSBuZXh0IGNvbW1hbmQgdG8gYmUgcHJvY2Vzc2VkLCB3YWl0aW5nIGlmIG5lY2Vzc2FyeQorICAgICAgICByZXN1bHQgPSB0YWxrV2l0aERyaXZlcigpOworICAgICAgICBpZiAocmVzdWx0ID49IE5PX0VSUk9SKSB7CisgICAgICAgICAgICBzaXplX3QgSU4gPSBtSW4uZGF0YUF2YWlsKCk7CisgICAgICAgICAgICBpZiAoSU4gPCBzaXplb2YoaW50MzJfdCkpIGNvbnRpbnVlOworICAgICAgICAgICAgY21kID0gbUluLnJlYWRJbnQzMigpOworICAgICAgICAgICAgSUZfTE9HX0NPTU1BTkRTKCkgeworICAgICAgICAgICAgICAgIGFsb2cgPDwgIlByb2Nlc3NpbmcgdG9wLWxldmVsIENvbW1hbmQ6ICIKKyAgICAgICAgICAgICAgICAgICAgPDwgZ2V0UmV0dXJuU3RyaW5nKGNtZCkgPDwgZW5kbDsKKyAgICAgICA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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvZGUsIGNvbnN0IFBhcmNlbCYgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncykKK3sKKyAgICBzdGF0dXNfdCBlcnIgPSBkYXRhLmVycm9yQ2hlY2soKTsKKworICAgIGZsYWdzIHw9IFRGX0FDQ0VQVF9GRFM7CisKKyAgICBJRl9MT0dfVFJBTlNBQ1RJT05TKCkgeworICAgICAgICBUZXh0T3V0cHV0OjpCdW5kbGUgX2IoYWxvZyk7CisgICAgICAgIGFsb2cgPDwgIkJDX1RSQU5TQUNUSU9OIHRociAiIDw8ICh2b2lkKilwdGhyZWFkX3NlbGYoKSA8PCAiIC8gaGFuZCAiCisgICAgICAgICAgICA8PCBoYW5kbGUgPDwgIiAvIGNvZGUgIiA8PCBUeXBlQ29kZShjb2RlKSA8PCAiOiAiCisgICAgICAgICAgICA8PCBpbmRlbnQgPDwgZGF0YSA8PCBkZWRlbnQgPDwgZW5kbDsKKyAgICB9CisgICAgCisgICAgaWYgKGVyciA9PSBOT19FUlJPUikgeworICAgICAgICBMT0dfT05FV0FZKCI+Pj4+IFNFTkQgZnJvbSBwaWQgJWQgdWlkICVkICVzIiwgZ2V0cGlkKCksIGdldHVpZCgpLAorICAgICAgICAgICAgKGZsYWdzICYgVEZfT05FX1dBWSkgPT0gMCA/ICJSRUFEIFJFUExZIiA6ICJPTkUgV0FZIik7CisgICAgICAgIGVyciA9IHdyaXRlVHJhbnNhY3Rpb25EYXRhKEJDX1RSQU5TQUNUSU9OLCBmbGFncywgaGFuZGxlLCBjb2RlLCBkYXRhLCBOVUxMKTsKKyAgICB9CisgICAgCisgICAgaWYgKGVyciAhPSBOT19FUlJPUikgeworICAgICAgICBpZiAocmVwbHkpIHJlcGx5LT5zZXRFcnJvcihlcnIpOworICAgICAgICByZXR1cm4gKG1MYXN0RXJyb3IgPSBlcnIpOworICAgIH0KKyAgICAKKyAgICBpZiAoKGZsYWdzICYgVEZfT05FX1dBWSkgPT0gMCkgeworICAgICAgICBpZiAocmVwbHkpIHsKKyAgICAgICAgICAgIGVyciA9IHdhaXRGb3JSZXNwb25zZShyZXBseSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBQYXJjZWwgZmFrZVJlcGx5OworICAgICAgICAgICAgZXJyID0gd2FpdEZvclJlc3BvbnNlKCZmYWtlUmVwbHkpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBJRl9MT0dfVFJBTlNBQ1RJT05TKCkgeworICAgICAgICAgICAgVGV4dE91dHB1dDo6QnVuZGxlIF9iKGFsb2cpOworICAgICAgICAgICAgYWxvZyA8PCAiQlJfUkVQTFkgdGhyICIgPDwgKHZvaWQqKXB0aHJlYWRfc2VsZigpIDw8ICIgLyBoYW5kICIKKyAgICAgICAgICAgICAgICA8PCBoYW5kbGUgPDwgIjogIjsKKyAgICAgICAgICAgIGlmIChyZXBseSkgYWxvZyA8PCBpbmRlbnQgPDwgKnJlcGx5IDw8IGRlZGVudCA8PCBlbmRsOworICAgICAgICAgICAgZWxzZSBhbG9nIDw8ICIobm9uZSByZXF1ZXN0ZWQpIiA8PCBlbmRsOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgZXJyID0gd2FpdEZvclJlc3BvbnNlKE5VTEwsIE5VTEwpOworICAgIH0KKyAgICAKKyAgICByZXR1cm4gZXJyOworfQorCit2b2lkIElQQ1RocmVhZFN0YXRlOjppbmNTdHJvbmdIYW5kbGUoaW50MzJfdCBoYW5kbGUpCit7CisgICAgTE9HX1JFTU9URVJFRlMoIklQQ1RocmVhZFN0YXRlOjppbmNTdHJvbmdIYW5kbGUoJWQpXG4iLCBoYW5kbGUpOworICAgIG1PdXQud3JpdGVJbnQzMihCQ19BQ1FVSVJFKTsKKyAgICBtT3V0LndyaXRlSW50MzIoaGFuZGxlKTsKK30KKwordm9pZCBJUENUa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0gbUluLmVycm9yQ2hlY2soKTsKKyAgICAgICAgaWYgKGVyciA8IE5PX0VSUk9SKSBicmVhazsKKyAgICAgICAgaWYgKG1Jbi5kYXRhQXZhaWwoKSA9PSAwKSBjb250aW51ZTsKKyAgICAgICAgCisgICAgICAgIGNtZCA9IG1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgCisgICAgICAgIElGX0xPR19DT01NQU5EUygpIHsKKyAgICAgICAgICAgIGFsb2cgPDwgIlByb2Nlc3Npbmcgd2FpdEZvclJlc3BvbnNlIENvbW1hbmQ6ICIKKyAgICAgICAgICAgICAgICA8PCBnZXRSZXR1cm5TdHJpbmcoY21kKSA8PCBlbmRsOworICAgICAgICB9CisKKyAgICAgICAgc3dpdGNoIChjbWQpIHsKKyAgICAgICAgY2FzZSBCUl9UUkFOU0FDVElPTl9DT01QTEVURToKKyAgICAgICAgICAgIGlmICghcmVwbHkgJiYgIWFjcXVpcmVSZXN1bHQpIGdvdG8gZmluaXNoOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIAorICAgICAgICBjYXNlIEJSX0RFQURfUkVQTFk6CisgICAgICAgICAgICBlcnIgPSBERUFEX09CSkVDVDsKKyAgICAgICAgICAgIGdvdG8gZmluaXNoOworCisgICAgICAgIGNhc2UgQlJfRkFJTEVEX1JFUExZOgorICAgICAgICAgICAgZXJyID0gRkFJTEVEX1RSQU5TQUNUSU9OOworICAgICAgICAgICAgZ290byBmaW5pc2g7CisgICAgICAgIAorICAgICAgICBjYXNlIEJSX0FDUVVJUkVfUkVTVUxUOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIExPR19BU1NFUlQoYWNxdWlyZVJlc3VsdCAhPSBOVUxMLCAiVW5leHBlY3RlZCBickFDUVVJUkVfUkVTVUxUIik7CisgICAgICAgICAgICAgICAgY29uc3QgaW50MzJfdCByZXN1bHQgPSBtSW4ucmVhZEludDMyKCk7CisgICAgICAgICAgICAgICAgaWYgKCFhY3F1aXJlUmVzdWx0KSBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAqYWNxdWlyZVJlc3VsdCA9IHJlc3VsdCA/IE5PX0VSUk9SIDogSU5WQUxJRF9PUEVSQVRJT047CisgICAgICAgICAgICB9CisgICAgICAgICAgICBnb3RvIGZpbmlzaDsKKyAgICAgICAgCisgICAgICAgIGNhc2UgQlJfUkVQTFk6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYmluZGVyX3RyYW5zYWN0aW9uX2RhdGEgdHI7CisgICAgICAgICAgICAgICAgZXJyID0gbUluLnJlYWQoJnRyLCBzaXplb2YodHIpKTsKKyAgICAgICAgICAgICAgICBMT0dfQVNTRVJUKGVyciA9PSBOT19FUlJPUiwgIk5vdCBlbm91Z2ggY29tbWFuZCBkYXRhIGZvciBiclJFUExZIik7CisgICAgICAgICAgICAgICAgaWYgKGVyciAhPSBOT19FUlJPUikgZ290byBmaW5pc2g7CisKKyAgICAgICAgICAgICAgICBpZiAocmVwbHkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCh0ci5mbGFncyAmIFRGX1NUQVRVU19DT0RFKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXBseS0+aXBjU2V0RGF0YVJlZmVyZW5jZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQ4X3QqPih0ci5kYXRhLnB0ci5idWZmZXIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyLmRhdGFfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IHNpemVfdCo+KHRyLmRhdGEucHRyLm9mZnNldHMpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyLm9mZnNldHNfc2l6ZS9zaXplb2Yoc2l6ZV90KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmVlQnVmZmVyLCB0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVyciA9ICpzdGF0aWNfY2FzdDxjb25zdCBzdGF0dXNfdCo+KHRyLmRhdGEucHRyLmJ1ZmZlcik7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmVlQnVmZmVyKE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4odHIuZGF0YS5wdHIuYnVmZmVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ci5kYXRhX3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCBzaXplX3QqPih0ci5kYXRhLnB0ci5vZmZzZXRzKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ci5vZmZzZXRzX3NpemUvc2l6ZW9mKHNpemVfdCksIHRoaXMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZnJlZUJ1ZmZlcihOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4odHIuZGF0YS5wdHIuYnVmZmVyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyLmRhdGFfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3Qgc2l6ZV90Kj4odHIuZGF0YS5wdHIub2Zmc2V0cyksCisgICAgICAgICAgICAgICAgICAgICAgICB0ci5vZmZzZXRzX3NpemUvc2l6ZW9mKHNpemVfdCksIHRoaXMpOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBnb3RvIGZpbmlzaDsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZXJyID0gZ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Iud3JpdGVfc2l6ZSA9IG91dEF2YWlsOworICAgIGJ3ci53cml0ZV9idWZmZXIgPSAobG9uZyB1bnNpZ25lZCBpbnQpbU91dC5kYXRhKCk7CisKKyAgICAvLyBUaGlzIGlzIHdoYXQgd2UnbGwgcmVhZC4KKyAgICBpZiAoZG9SZWNlaXZlICYmIG5lZWRSZWFkKSB7CisgICAgICAgIGJ3ci5yZWFkX3NpemUgPSBtSW4uZGF0YUNhcGFjaXR5KCk7CisgICAgICAgIGJ3ci5yZWFkX2J1ZmZlciA9IChsb25nIHVuc2lnbmVkIGludCltSW4uZGF0YSgpOworICAgIH0gZWxzZSB7CisgICAgICAgIGJ3ci5yZWFkX3NpemUgPSAwOworICAgIH0KKyAgICAKKyAgICBJRl9MT0dfQ09NTUFORFMoKSB7CisgICAgICAgIFRleHRPdXRwdXQ6OkJ1bmRsZSBfYihhbG9nKTsKKyAgICAgICAgaWYgKG91dEF2YWlsICE9IDApIHsKKyAgICAgICAgICAgIGFsb2cgPDwgIlNlbmRpbmcgY29tbWFuZHMgdG8gZHJpdmVyOiAiIDw8IGluZGVudDsKKyAgICAgICAgICAgIGNvbnN0IHZvaWQqIGNtZHMgPSAoY29uc3Qgdm9pZCopYndyLndyaXRlX2J1ZmZlcjsKKyAgICAgICAgICAgIGNvbnN0IHZvaWQqIGVuZCA9ICgoY29uc3QgdWludDhfdCopY21kcykrYndyLndyaXRlX3NpemU7CisgICAgICAgICAgICBhbG9nIDw8IEhleER1bXAoY21kcywgYndyLndyaXRlX3NpemUpIDw8IGVuZGw7CisgICAgICAgICAgICB3aGlsZSAoY21kcyA8IGVuZCkgY21kcyA9IHByaW50Q29tbWFuZChhbG9nLCBjbWRzKTsKKyAgICAgICAgICAgIGFsb2cgPDwgZGVkZW50OworICAgICAgICB9CisgICAgICAgIGFsb2cgPDwgIlNpemUgb2YgcmVjZWl2ZSBidWZmZXI6ICIgPDwgYndyLnJlYWRfc2l6ZQorICAgICAgICAgICAgPDwgIiwgbmVlZFJlYWQ6ICIgPDwgbmVlZFJlYWQgPDwgIiwgZG9SZWNlaXZlOiAiIDw8IGRvUmVjZWl2ZSA8PCBlbmRsOworICAgIH0KKyAgICAKKyAgICAvLyBSZXR1cm4gaW1tZWRpYXRlbHkgaWYgdGhlcmUgaXMgbm90aGluZyB0byBkby4KKyAgICBpZiAoKGJ3ci53cml0ZV9zaXplID09IDApICYmIChid3IucmVhZF9zaXplID09IDApKSByZXR1cm4gTk9fRVJST1I7CisgICAgCisgICAgYndyLndyaXRlX2NvbnN1bWVkID0gMDsKKyAgICBid3IucmVhZF9jb25zdW1lZCA9IDA7CisgICAgc3RhdHVzX3QgZXJyOworICAgIGRvIHsKKyAgICAgICAgSUZfTE9HX0NPTU1BTkRTKCkgeworICAgICAgICAgICAgYWxvZyA8PCAiQWJvdXQgdG8gcmVhZC93cml0ZSwgd3JpdGUgc2l6ZSA9ICIgPDwgbU91dC5kYXRhU2l6ZSgpIDw8IGVuZGw7CisgICAgICAgIH0KKyNpZiBkZWZpbmVkKEhBVkVfQU5EUk9JRF9PUykKKyAgICAgICAgaWYgKGlvY3RsKG1Qcm9jZXNzLT5tRHJpdmVyRkQsIEJJTkRFUl9XUklURV9SRUFELCAmYndyKSA+PSAwKQorICAgICAgICAgICAgZXJyID0gTk9fRVJST1I7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGVyciA9IC1lcnJubzsKKyNlbHNlCisgICAgICAgIGVyciA9IElOVkFMSURfT1BFUkFUSU9OOworI2VuZGlmCisgICAgICAgIElGX0xPR19DT01NQU5EUygpIHsKKyAgICAgICAgICAgIGFsb2cgPDwgIkZpbmlzaGVkIHJlYWQvd3JpdGUsIHdyaXRlIHNpemUgPSAiIDw8IG1PdXQuZGF0YVNpemUoKSA8PCBlbmRsOworICAgICAgICB9CisgICAgfSB3aGlsZSAoZXJyID09IC1FSU5UUik7CisgICAgCisgICAgSUZfTE9HX0NPTU1BTkRTKCkgeworICAgICAgICBhbG9nIDw8ICJPdXIgZXJyOiAiIDw8ICh2b2lkKillcnIgPDwgIiwgd3JpdGUgY29uc3VtZWQ6ICIKKyAgICAgICAgICAgIDw8IGJ3ci53cml0ZV9jb25zdW1lZCA8PCAiIChvZiAiIDw8IG1PdXQuZGF0YVNpemUoKQorCQkJPDwgIiksIHJlYWQgY29uc3VtZWQ6ICIgPDwgYndyLnJlYWRfY29uc3VtZWQgPDwgZW5kbDsKKyAgICB9CisKKyAgICBpZiAoZXJyID49IE5PX0VSUk9SKSB7CisgICAgICAgIGlmIChid3Iud3JpdGVfY29uc3VtZWQgPiAwKSB7CisgICAgICAgICAgICBpZiAoYndyLndyaXRlX2NvbnN1bWVkIDwgKHNzaXplX3QpbU91dC5kYXRhU2l6ZSgpKQorICAgICAgICAgICAgICAgIG1PdXQucmVtb3ZlKDAsIGJ3ci53cml0ZV9jb25zdW1lZCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgbU91dC5zZXREYXRhU2l6ZSgwKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoYndyLnJlYWRfY29uc3VtZWQgPiAwKSB7CisgICAgICAgICAgICBtSW4uc2V0RGF0YVNpemUoYndyLnJlYWRfY29uc3VtZWQpOworICAgICAgICAgICAgbUluLnNldERhdGFQb3NpdGlvbigwKTsKKyAgICAgICAgfQorICAgICAgICBJRl9MT0dfQ09NTUFORFMoKSB7CisgICAgICAgICAgICBUZXh0T3V0cHV0OjpCdW5kbGUgX2IoYWxvZyk7CisgICAgICAgICAgICBhbG9nIDw8ICJSZW1haW5pbmcgZGF0YSBzaXplOiAiIDw8IG1PdXQuZGF0YVNpemUoKSA8PCBlbmRsOworICAgICAgICAgICAgYWxvZyA8PCAiUmVjZWl2ZWQgY29tbWFuZHMgZnJvbSBkcml2ZXI6ICIgPDwgaW5kZW50OworICAgICAgICAgICAgY29uc3Qgdm9pZCogY21kcyA9IG1Jbi5kYXRhKCk7CisgICAgICAgICAgICBjb25zdCB2b2lkKiBlbmQgPSBtSW4uZGF0YSgpICsgbUluLmRhdGFTaXplKCk7CisgICAgICAgICAgICBhbG9nIDw8IEhleER1bXAoY21kcywgbUluLmRhdGFTaXplKCkpIDw8IGVuZGw7CisgICAgICAgICAgICB3aGlsZSAoY21kcyA8IGVuZCkgY21kcyA9IHByaW50UmV0dXJuQ29tbWFuZChhbG9nLCBjbWRzKTsKKyAgICAgICAgICAgIGFsb2cgPDwgZGVkZW50OworICAgICAgICB9CisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9CisgICAgCisgICAgcmV0dXJuIGVycjsKK30KKworc3RhdHVzX3QgSVBDVGhyZWFkU3RhdGU6OndyaXRlVHJhbnNhY3Rpb25EYXRhKGludDMyX3QgY21kLCB1aW50MzJfdCBiaW5kZXJGbGFncywKKyAgICBpbnQzMl90IGhhbmRsZSwgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLCBzdGF0dXNfdCogc3RhdHVzQnVmZmVyKQoreworICAgIGJpbmRlcl90cmFuc2FjdGlvbl9kYXRhIHRyOworCisgICAgdHIudGFyZ2V0LmhhbmRsZSA9IGhhbmRsZTsKKyAgICB0ci5jb2RlID0gY29kZTsKKyAgICB0ci5mbGFncyA9IGJpbmRlckZsYWdzOworICAgIAorICAgIGNvbnN0IHN0YXR1c190IGVyciA9IGRhdGEuZXJyb3JDaGVjaygpOworICAgIGlmIChlcnIgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgdHIuZGF0YV9zaXplID0gZGF0YS5pcGNEYXRhU2l6ZSgpOworICAgICAgICB0ci5kYXRhLnB0ci5idWZmZXIgPSBkYXRhLmlwY0RhdGEoKTsKKyAgICAgICAgdHIub2Zmc2V0c19zaXplID0gZGF0YS5pcGNPYmplY3RzQ291bnQoKSpzaXplb2Yoc2l6ZV90KTsKKyAgICAgICAgdHIuZGF0YS5wdHIub2Zmc2V0cyA9IGRhdGEuaXBjT2JqZWN0cygpOworICAgIH0gZWxzZSBpZiAoc3RhdHVzQnVmZmVyKSB7CisgICAgICAgIHRyLmZsYWdzIHw9IFRGX1NUQVRVU19DT0RFOworICAgICAgICAqc3RhdHVzQnVmZmVyID0gZXJyOworICAgICAgICB0ci5kYXRhX3NpemUgPSBzaXplb2Yoc3RhdHVzX3QpOworICAgICAgICB0ci5kYXRhLnB0ci5idWZmZXIgPSBzdGF0dXNCdWZmZXI7CisgICAgICAgIHRyLm9mZnNldHNfc2l6ZSA9IDA7CisgICAgICAgIHRyLmRhdGEucHRyLm9mZnNldHMgPSBOVUxMOworICAgIH0gZWxzZSB7CisgICAgICAgIHJldHVybiAobUxhc3RFcnJvciA9IGVycik7CisgICAgfQorICAgIAorICAgIG1PdXQud3JpdGVJbnQzMihjbWQpOworICAgIG1PdXQud3JpdGUoJnRyLCBzaXplb2YodHIpKTsKKyAgICAKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKK3NwPEJCaW5kZXI+IHRoZV9jb250ZXh0X29iamVjdDsKKwordm9pZCBzZXRUaGVDb250ZXh0T2JqZWN0KHNwPEJCaW5kZXI+IG9iaikKK3sKKyAgICB0aGVfY29udGV4dF9vYmplY3QgPSBvYmo7Cit9CisKK3N0YXR1c190IElQQ1RocmVhZFN0YXRlOjpleGVjdXRlQ29tbWFuZChpbnQzMl90IGNtZCkKK3sKKyAgICBCQmluZGVyKiBvYmo7CisgICAgUmVmQmFzZTo6d2Vha3JlZl90eXBlKiByZWZzOworICAgIHN0YXR1c190IHJlc3VsdCA9IE5PX0VSUk9SOworICAgIAorICAgIHN3aXRjaCAoY21kKSB7CisgICAgY2FzZSBCUl9FUlJPUjoKKyAgICAgICAgcmVzdWx0ID0gbUluLnJlYWRJbnQzMigpOworICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgY2FzZSBCUl9PSzoKKyAgICAgICAgYnJlYWs7CisgICAgICAgIAorICAgIGNhc2UgQlJfQUNRVUlSRToKKyAgICAgICAgcmVmcyA9IChSZWZCYXNlOjp3ZWFrcmVmX3R5cGUqKW1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgb2JqID0gKEJCaW5kZXIqKW1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgTE9HX0FTU0VSVChyZWZzLT5yZWZCYXNlKCkgPT0gb2JqLAorICAgICAgICAgICAgICAgICAgICJCUl9BQ1FVSVJFOiBvYmplY3QgJXAgZG9lcyBub3QgbWF0Y2ggY29va2llICVwIChleHBlY3RlZCAlcCkiLAorICAgICAgICAgICAgICAgICAgIHJlZnMsIG9iaiwgcmVmcy0+cmVmQmFzZSgpKTsKKyAgICAgICAgb2JqLT5pbmNTdHJvbmcobVByb2Nlc3MuZ2V0KCkpOworICAgICAgICBJRl9MT0dfUkVNT1RFUkVGUygpIHsKKyAgICAgICAgICAgIExPR19SRU1PVEVSRUZTKCJCUl9BQ1FVSVJFIGZyb20gZHJpdmVyIG9uICVwIiwgb2JqKTsKKyAgICAgICAgICAgIG9iai0+cHJpbnRSZWZzKCk7CisgICAgICAgIH0KKyAgICAgICAgbU91dC53cml0ZUludDMyKEJDX0FDUVVJUkVfRE9ORSk7CisgICAgICAgIG1PdXQud3JpdGVJbnQzMigoaW50MzJfdClyZWZzKTsKKyAgICAgICAgbU91dC53cml0ZUludDMyKChpbnQzMl90KW9iaik7CisgICAgICAgIGJyZWFrOworICAgICAgICAKKyAgICBjYXNlIEJSX1JFTEVBU0U6CisgICAgICAgIHJlZnMgPSAoUmVmQmFzZTo6d2Vha3JlZl90eXBlKiltSW4ucmVhZEludDMyKCk7CisgICAgICAgIG9iaiA9IChCQmluZGVyKiltSW4ucmVhZEludDMyKCk7CisgICAgICAgIExPR19BU1NFUlQocmVmcy0+cmVmQmFzZSgpID09IG9iaiwKKyAgICAgICAgICAgICAgICAgICAiQlJfUkVMRUFTRTogb2JqZWN0ICVwIGRvZXMgbm90IG1hdGNoIGNvb2tpZSAlcCAoZXhwZWN0ZWQgJXApIiwKKyAgICAgICAgICAgICAgICAgICByZWZzLCBvYmosIHJlZnMtPnJlZkJhc2UoKSk7CisgICAgICAgIElGX0xPR19SRU1PVEVSRUZTKCkgeworICAgICAgICAgICAgTE9HX1JFTU9URVJFRlMoIkJSX1JFTEVBU0UgZnJvbSBkcml2ZXIgb24gJXAiLCBvYmopOworICAgICAgICAgICAgb2JqLT5wcmludFJlZnMoKTsKKyAgICAgICAgfQorICAgICAgICBtUGVuZGluZ1N0cm9uZ0RlcmVmcy5wdXNoKG9iaik7CisgICAgICAgIGJyZWFrOworICAgICAgICAKKyAgICBjYXNlIEJSX0lOQ1JFRlM6CisgICAgICAgIHJlZnMgPSAoUmVmQmFzZTo6d2Vha3JlZl90eXBlKiltSW4ucmVhZEludDMyKCk7CisgICAgICAgIG9iaiA9IChCQmluZGVyKiltSW4ucmVhZEludDMyKCk7CisgICAgICAgIHJlZnMtPmluY1dlYWsobVByb2Nlc3MuZ2V0KCkpOworICAgICAgICBtT3V0LndyaXRlSW50MzIoQkNfSU5DUkVGU19ET05FKTsKKyAgICAgICAgbU91dC53cml0ZUludDMyKChpbnQzMl90KXJlZnMpOworICAgICAgICBtT3V0LndyaXRlSW50MzIoKGludDMyX3Qpb2JqKTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIAorICAgIGNhc2UgQlJfREVDUkVGUzoKKyAgICAgICAgcmVmcyA9IChSZWZCYXNlOjp3ZWFrcmVmX3R5cGUqKW1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgb2JqID0gKEJCaW5kZXIqKW1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgLy8gTk9URTogVGhpcyBhc3NlcnRpb24gaXMgbm90IHZhbGlkLCBiZWNhdXNlIHRoZSBvYmplY3QgbWF5IG5vCisgICAgICAgIC8vIGxvbmdlciBleGlzdCAodGh1cyB0aGUgKEJCaW5kZXIqKWNhc3QgYWJvdmUgcmVzdWx0aW5nIGluIGEgZGlmZmVyZW50CisgICAgICAgIC8vIG1lbW9yeSBhZGRyZXNzKS4KKyAgICAgICAgLy9MT0dfQVNTRVJUKHJlZnMtPnJlZkJhc2UoKSA9PSBvYmosCisgICAgICAgIC8vICAgICAgICAgICAiQlJfREVDUkVGUzogb2JqZWN0ICVwIGRvZXMgbm90IG1hdGNoIGNvb2tpZSAlcCAoZXhwZWN0ZWQgJXApIiwKKyAgICAgICAgLy8gICAgICAgICAgIHJlZnMsIG9iaiwgcmVmcy0+cmVmQmFzZSgpKTsKKyAgICAgICAgbVBlbmRpbmdXZWFrRGVyZWZzLnB1c2gocmVmcyk7CisgICAgICAgIGJyZWFrOworICAgICAgICAKKyAgICBjYXNlIEJSX0FUVEVNUFRfQUNRVUlSRToKKyAgICAgICAgcmVmcyA9IChSZWZCYXNlOjp3ZWFrcmVmX3R5cGUqKW1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgb2JqID0gKEJCaW5kZXIqKW1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgIAorICAgICAgICB7CisgICAgICAgICAgICBjb25zdCBib29sIHN1Y2Nlc3MgPSByZWZzLT5hdHRlbXB0SW5jU3Ryb25nKG1Qcm9jZXNzLmdldCgpKTsKKyAgICAgICAgICAgIExPR19BU1NFUlQoc3VjY2VzcyAmJiByZWZzLT5yZWZCYXNlKCkgPT0gb2JqLAorICAgICAgICAgICAgICAgICAgICAgICAiQlJfQVRURU1QVF9BQ1FVSVJFOiBvYmplY3QgJXAgZG9lcyBub3QgbWF0Y2ggY29va2llICVwIChleHBlY3RlZCAlcCkiLAorICAgICAgICAgICAgICAgICAgICAgICByZWZzLCBvYmosIHJlZnMtPnJlZkJhc2UoKSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1PdXQud3JpdGVJbnQzMihCQ19BQ1FVSVJFX1JFU1VMVCk7CisgICAgICAgICAgICBtT3V0LndyaXRlSW50MzIoKGludDMyX3Qpc3VjY2Vzcyk7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgCisgICAgY2FzZSBCUl9UUkFOU0FDVElPTjoKKyAgICAgICAgeworICAgICAgICAgICAgYmluZGVyX3RyYW5zYWN0aW9uX2RhdGEgdHI7CisgICAgICAgICAgICByZXN1bHQgPSBtSW4ucmVhZCgmdHIsIHNpemVvZih0cikpOworICAgICAgICAgICAgTE9HX0FTU0VSVChyZXN1bHQgPT0gTk9fRVJST1IsCisgICAgICAgICAgICAgICAgIk5vdCBlbm91Z2ggY29tbWFuZCBkYXRhIGZvciBiclRSQU5TQUNUSU9OIik7CisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE5PX0VSUk9SKSBicmVhazsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgUGFyY2VsIGJ1ZmZlcjsKKyAgICAgICAgICAgIGJ1ZmZlci5pcGNTZXREYXRhUmVmZXJlbmNlKAorICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDhfdCo+KHRyLmRhdGEucHRyLmJ1ZmZlciksCisgICAgICAgICAgICAgICAgdHIuZGF0YV9zaXplLAorICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3Qgc2l6ZV90Kj4odHIuZGF0YS5wdHIub2Zmc2V0cyksCisgICAgICAgICAgICAgICAgdHIub2Zmc2V0c19zaXplL3NpemVvZihzaXplX3QpLCBmcmVlQnVmZmVyLCB0aGlzKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY29uc3QgcGlkX3Qgb3JpZ1BpZCA9IG1DYWxsaW5nUGlkOworICAgICAgICAgICAgY29uc3QgdWlkX3Qgb3JpZ1VpZCA9IG1DYWxsaW5nVWlkOworICAgICAgICAgICAgCisgICAgICAgICAgICBtQ2FsbGluZ1BpZCA9IHRyLnNlbmRlcl9waWQ7CisgICAgICAgICAgICBtQ2FsbGluZ1VpZCA9IHRyLnNlbmRlcl9ldWlkOworICAgICAgICAgICAgCisgICAgICAgICAgICAvL0xPR0koIj4+Pj4gVFJBTlNBQ1QgZnJvbSBwaWQgJWQgdWlkICVkXG4iLCBtQ2FsbGluZ1BpZCwgbUNhbGxpbmdVaWQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBQYXJjZWwgcmVwbHk7CisgICAgICAgICAgICBJRl9MT0dfVFJBTlNBQ1RJT05TKCkgeworICAgICAgICAgICAgICAgIFRleHRPdXRwdXQ6OkJ1bmRsZSBfYihhbG9nKTsKKyAgICAgICAgICAgICAgICBhbG9nIDw8ICJCUl9UUkFOU0FDVElPTiB0aHIgIiA8PCAodm9pZCopcHRocmVhZF9zZWxmKCkKKyAgICAgICAgICAgICAgICAgICAgPDwgIiAvIG9iaiAiIDw8IHRyLnRhcmdldC5wdHIgPDwgIiAvIGNvZGUgIgorICAgICAgICAgICAgICAgICAgICA8PCBUeXBlQ29kZSh0ci5jb2RlKSA8PCAiOiAiIDw8IGluZGVudCA8PCBidWZmZXIKKyAgICAgICAgICAgICAgICAgICAgPDwgZGVkZW50IDw8IGVuZGwKKyAgICAgICAgICAgICAgICAgICAgPDwgIkRhdGEgYWRkciA9ICIKKyAgICAgICAgICAgICAgICAgICAgPDwgcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4odHIuZGF0YS5wdHIuYnVmZmVyKQorICAgICAgICAgICAgICAgICAgICA8PCAiLCBvZmZzZXRzIGFkZHI9IgorICAgICAgICAgICAgICAgICAgICA8PCByZWludGVycHJldF9jYXN0PGNvbnN0IHNpemVfdCo+KHRyLmRhdGEucHRyLm9mZnNldHMpIDw8IGVuZGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodHIudGFyZ2V0LnB0cikgeworICAgICAgICAgICAgICAgIHNwPEJCaW5kZXI+IGIoKEJCaW5kZXIqKXRyLmNvb2tpZSk7CisgICAgICAgICAgICAgICAgY29uc3Qgc3RhdHVzX3QgZXJyb3IgPSBiLT50cmFuc2FjdCh0ci5jb2RlLCBidWZmZXIsICZyZXBseSwgMCk7CisgICAgICAgICAgICAgICAgaWYgKGVycm9yIDwgTk9fRVJST1IpIHJlcGx5LnNldEVycm9yKGVycm9yKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgY29uc3Qgc3RhdHVzX3QgZXJyb3IgPSB0aGVfY29udGV4dF9vYmplY3QtPnRyYW5zYWN0KHRyLmNvZGUsIGJ1ZmZlciwgJnJlcGx5LCAwKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyb3IgPCBOT19FUlJPUikgcmVwbHkuc2V0RXJyb3IoZXJyb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICAvL0xPR0koIjw8PDwgVFJBTlNBQ1QgZnJvbSBwaWQgJWQgcmVzdG9yZSBwaWQgJWQgdWlkICVkXG4iLAorICAgICAgICAgICAgLy8gICAgIG1DYWxsaW5nUGlkLCBvcmlnUGlkLCBvcmlnVWlkKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKCh0ci5mbGFncyAmIFRGX09ORV9XQVkpID09IDApIHsKKyAgICAgICAgICAgICAgICBMT0dfT05FV0FZKCJTZW5kaW5nIHJlcGx5IHRvICVkISIsIG1DYWxsaW5nUGlkKTsKKyAgICAgICAgICAgICAgICBzZW5kUmVwbHkocmVwbHksIDApOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMT0dfT05FV0FZKCJOT1Qgc2VuZGluZyByZXBseSB0byAlZCEiLCBtQ2FsbGluZ1BpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1DYWxsaW5nUGlkID0gb3JpZ1BpZDsKKyAgICAgICAgICAgIG1DYWxsaW5nVWlkID0gb3JpZ1VpZDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgSUZfTE9HX1RSQU5TQUNUSU9OUygpIHsKKyAgICAgICAgICAgICAgICBUZXh0T3V0cHV0OjpCdW5kbGUgX2IoYWxvZyk7CisgICAgICAgICAgICAgICAgYWxvZyA8PCAiQkNfUkVQTFkgdGhyICIgPDwgKHZvaWQqKXB0aHJlYWRfc2VsZigpIDw8ICIgLyBvYmogIgorICAgICAgICAgICAgICAgICAgICA8PCB0ci50YXJnZXQucHRyIDw8ICI6ICIgPDwgaW5kZW50IDw8IHJlcGx5IDw8IGRlZGVudCA8PCBlbmRsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgCisgICAgY2FzZSBCUl9ERUFEX0JJTkRFUjoKKyAgICAgICAgeworICAgICAgICAgICAgQnBCaW5kZXIgKnByb3h5ID0gKEJwQmluZGVyKiltSW4ucmVhZEludDMyKCk7CisgICAgICAgICAgICBwcm94eS0+c2VuZE9iaXR1YXJ5KCk7CisgICAgICAgICAgICBtT3V0LndyaXRlSW50MzIoQkNfREVBRF9CSU5ERVJfRE9ORSk7CisgICAgICAgICAgICBtT3V0LndyaXRlSW50MzIoKGludDMyX3QpcHJveHkpOworICAgICAgICB9IGJyZWFrOworICAgICAgICAKKyAgICBjYXNlIEJSX0NMRUFSX0RFQVRIX05PVElGSUNBVElPTl9ET05FOgorICAgICAgICB7CisgICAgICAgICAgICBCcEJpbmRlciAqcHJveHkgPSAoQnBCaW5kZXIqKW1Jbi5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHByb3h5LT5nZXRXZWFrUmVmcygpLT5kZWNXZWFrKHByb3h5KTsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgCisgICAgY2FzZSBCUl9GSU5JU0hFRDoKKyAgICAgICAgcmVzdWx0ID0gVElNRURfT1VUOworICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgY2FzZSBCUl9OT09QOgorICAgICAgICBicmVhazsKKyAgICAgICAgCisgICAgY2FzZSBCUl9TUEFXTl9MT09QRVI6CisgICAgICAgIG1Qcm9jZXNzLT5zcGF3blBvb2xlZFRocmVhZChmYWxzZSk7CisgICAgICAgIGJyZWFrOworICAgICAgICAKKyAgICBkZWZhdWx0OgorICAgICAgICBwcmludGYoIioqKiBCQUQgQ09NTUFORCAlZCByZWNlaXZlZCBmc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bXBsKQorICAgIHsKKyAgICB9CisgICAgICAgIAorICAgIHZpcnR1YWwgYm9vbCBjaGVja1Blcm1pc3Npb24oY29uc3QgU3RyaW5nMTYmIHBlcm1pc3Npb24sIGludDMyX3QgcGlkLCBpbnQzMl90IHVpZCkKKyAgICB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElQZXJtaXNzaW9uQ29udHJvbGxlcjo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZVN0cmluZzE2KHBlcm1pc3Npb24pOworICAgICAgICBkYXRhLndyaXRlSW50MzIocGlkKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKHVpZCk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChDSEVDS19QRVJNSVNTSU9OX1RSQU5TQUNUSU9OLCBkYXRhLCAmcmVwbHkpOworICAgICAgICAvLyBmYWlsIG9uIGV4Y2VwdGlvbgorICAgICAgICBpZiAocmVwbHkucmVhZEludDMyKCkgIT0gMCkgcmV0dXJuIDA7CisgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKSAhPSAwOworICAgIH0KK307CisKK0lNUExFTUVOVF9NRVRBX0lOVEVSRkFDRShQZXJtaXNzaW9uQ29udHJvbGxlciwgImFuZHJvaWQub3MuSVBlcm1pc3Npb25Db250cm9sbGVyIik7CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworc3RhdHVzX3QgQm5QZXJtaXNzaW9uQ29udHJvbGxlcjo6b25UcmFuc2FjdCgKKyAgICB1aW50MzJfdCBjb2RlLCBjb25zdCBQYXJjZWwmIGRhdGEsIFBhcmNlbCogcmVwbHksIHVpbnQzMl90IGZsYWdzKQoreworICAgIC8vcHJpbnRmKCJQZXJtaXNzaW9uQ29udHJvbGxlciByZWNlaXZlZDogIik7IGRhdGEucHJpbnQoKTsKKyAgICBzd2l0Y2goY29kZSkgeworICAgICAgICBjYXNlIENIRUNLX1BFUk1JU1NJT05fVFJBTlNBQ1RJT046IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJUGVybWlzc2lvbkNvbnRyb2xsZXIsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIFN0cmluZzE2IHBlcm1pc3Npb24gPSBkYXRhLnJlYWRTdHJpbmcxNigpOworICAgICAgICAgICAgaW50MzJfdCBwaWQgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgaW50MzJfdCB1aWQgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgYm9vbCByZXMgPSBjaGVja1Blcm1pc3Npb24ocGVybWlzc2lvbiwgcGlkLCB1aWQpOworICAgICAgICAgICAgLy8gd3JpdGUgZXhjZXB0aW9uCisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMigwKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHJlcyA/IDEgOiAwKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHJldHVybiBCQmluZGVyOjpvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7CisgICAgfQorfQorCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCmRpZmYgLS1naXQgYS9saWJzL2JpbmRlci9JU2VydmljZU1hbmFnZXIuY3BwIGIvbGlicy9iaW5kZXIvSVNlcnZpY2VNYW5hZ2VyLmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wY2Y0MTU4Ci0tLSAvZGV2L251bGwKKysrIGIvbGlicy9iaW5kZXIvSVNlcnZpY2VNYW5hZ2VyLmNwcApAQCAtMC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AorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpKCh1cHRpbWVNaWxsaXMoKS1zdGFydFRpbWUpLzEwMDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzgocGVybWlzc2lvbikuc3RyaW5nKCksIHVpZCwgcGlkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlczsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gSXMgdGhpcyBhIHBlcm1pc3Npb24gZmFpbHVyZSwgb3IgZGlkIHRoZSBjb250cm9sbGVyIGdvIGF3YXk/CisgICAgICAgICAgICBpZiAocGMtPmFzQmluZGVyKCktPmlzQmluZGVyQWxpdmUoKSkgeworICAgICAgICAgICAgICAgIExPR1coIlBlcm1pc3Npb24gZmFpbHVyZTogJXMgZnJvbSB1aWQ9JWQgcGlkPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzgocGVybWlzc2lvbikuc3RyaW5nKCksIHVpZCwgcGlkKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIE9iamVjdCBpcyBkZWFkIQorICAgICAgICAgICAgZ0RlZmF1bHRTZXJ2aWNlTWFuYWdlckxvY2subG9jaygpOworICAgICAgICAgICAgaWYgKGdQZXJtaXNzaW9uQ29udHJvbGxlciA9PSBwYykgeworICAgICAgICAgICAgICAgIGdQZXJtaXNzaW9uQ29udHJvbGxlciA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBnRGVmYXVsdFNlcnZpY2VNYW5hZ2VyTG9jay51bmxvY2soKTsKKyAgICAgICAgfQorICAgIAorICAgICAgICAvLyBOZWVkIHRvIHJldHJpZXZlIHRoZSBwZXJtaXNzaW9uIGNvbnRyb2xsZXIuCisgICAgICAgIHNwPElCaW5kZXI+IGJpbmRlciA9IGRlZmF1bHRTZXJ2aWNlTWFuYWdlcigpLT5jaGVja1NlcnZpY2UoX3Blcm1pc3Npb24pOworICAgICAgICBpZiAoYmluZGVyID09IE5VTEwpIHsKKyAgICAgICAgICAgIC8vIFdhaXQgZm9yIHRoZSBwZXJtaXNzaW9uIGNvbnRyb2xsZXIgdG8gY29tZSBiYWNrLi4uCisgICAgICAgICAgICBpZiAoc3RhcnRUaW1lID09IDApIHsKKyAgICAgICAgICAgICAgICBzdGFydFRpbWUgPSB1cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICBMT0dJKCJXYWl0aW5nIHRvIGNoZWNrIHBlcm1pc3Npb24gJXMgZnJvbSB1aWQ9JWQgcGlkPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzgocGVybWlzc2lvbikuc3RyaW5nKCksIHVpZCwgcGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNsZWVwKDEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcGMgPSBpbnRlcmZhY2VfY2FzdDxJUGVybWlzc2lvbkNvbnRyb2xsZXI+KGJpbmRlcik7CisgICAgICAgICAgICAvLyBJbnN0YWxsIHRoZSBuZXcgcGVybWlzc2lvbiBjb250cm9sbGVyLCBhbmQgdHJ5IGFnYWluLiAgICAgICAgCisgICAgICAgICAgICBnRGVmYXVsdFNlcnZpY2VNYW5hZ2VyTG9jay5sb2NrKCk7CisgICAgICAgICAgICBnUGVybWlzc2lvbkNvbnRyb2xsZXIgPSBwYzsKKyAgICAgICAgICAgIGdEZWZhdWx0U2VydmljZU1hbmFnZXJMb2NrLnVubG9jaygpOworICAgICAgICB9CisgICAgfQorfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK2NsYXNzIEJwU2VydmljZU1hbmFnZXIgOiBwdWJsaWMgQnBJbnRlcmZhY2U8SVNlcnZpY2VNYW5hZ2VyPgoreworcHVibGljOgorICAgIEJwU2VydmljZU1hbmFnZXIoY29uc3Qgc3A8SUJpbmRlcj4mIGltcGwpCisgICAgICAgIDogQnBJbnRlcmZhY2U8SVNlcnZpY2VNYW5hZ2VyPihpbXBsKQorICAgIHsKKyAgICB9CisgICAgICAgIAorICAgIHZpcnR1YWwgc3A8SUJpbmRlcj4gZ2V0U2VydmljZShjb25zdCBTdHJpbmcxNiYgbmFtZSkgY29uc3QKKyAgICB7CisgICAgICAgIHVuc2lnbmVkIG47CisgICAgICAgIGZvciAobiA9IDA7IG4gPCA1OyBuKyspeworICAgICAgICAgICAgc3A8SUJpbmRlcj4gc3ZjID0gY2hlY2tTZXJ2aWNlKG5hbWUpOworICAgICAgICAgICAgaWYgKHN2YyAhPSBOVUxMKSByZXR1cm4gc3ZjOworICAgICAgICAgICAgTE9HSSgiV2FpdGluZyBmb3Igc2V2aWNlICVzLi4uXG4iLCBTdHJpbmc4KG5hbWUpLnN0cmluZygpKTsKKyAgICAgICAgICAgIHNsZWVwKDEpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKyAgICAKKyAgICB2aXJ0dWFsIHNwPElCaW5kZXI+IGNoZWNrU2VydmljZSggY29uc3QgU3RyaW5nMTYmIG5hbWUpIGNvbnN0CisgICAgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJU2VydmljZU1hbmFnZXI6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVTdHJpbmcxNihuYW1lKTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KENIRUNLX1NFUlZJQ0VfVFJBTlNBQ1RJT04sIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiByZXBseS5yZWFkU3Ryb25nQmluZGVyKCk7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBhZGRTZXJ2aWNlKGNvbnN0IFN0cmluZzE2JiBuYW1lLCBjb25zdCBzcDxJQmluZGVyPiYgc2VydmljZSkKKyAgICB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElTZXJ2aWNlTWFuYWdlcjo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZVN0cmluZzE2KG5hbWUpOworICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKHNlcnZpY2UpOworICAgICAgICBzdGF0dXNfdCBlcnIgPSByZW1vdGUoKS0+dHJhbnNhY3QoQUREX1NFUlZJQ0VfVFJBTlNBQ1RJT04sIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiBlcnIgPT0gTk9fRVJST1IgPyByZXBseS5yZWFkSW50MzIoKSA6IGVycjsKKyAgICB9CisKKyAgICB2aXJ0dWFsIFZlY3RvcjxTdHJpbmcxNj4gbGlzdFNlcnZpY2VzKCkKKyAgICB7CisgICAgICAgIFZlY3RvcjxTdHJpbmcxNj4gcmVzOworICAgICAgICBpbnQgbiA9IDA7CisKKyAgICAgICAgZm9yICg7OykgeworICAgICAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElTZXJ2aWNlTWFuYWdlcjo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgICAgIGRhdGEud3JpdGVJbnQzMihuKyspOworICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gcmVtb3RlKCktPnRyYW5zYWN0KExJU1RfU0VSVklDRVNfVFJBTlNBQ1RJT04sIGRhdGEsICZyZXBseSk7CisgICAgICAgICAgICBpZiAoZXJyICE9IE5PX0VSUk9SKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgcmVz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Z2VyLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBTdHJpbmcxNiB3aGljaCA9IGRhdGEucmVhZFN0cmluZzE2KCk7CisgICAgICAgICAgICBzcDxJQmluZGVyPiBiID0gY29uc3RfY2FzdDxCblNlcnZpY2VNYW5hZ2VyKj4odGhpcyktPmNoZWNrU2VydmljZSh3aGljaCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVTdHJvbmdCaW5kZXIoYik7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGNhc2UgQUREX1NFUlZJQ0VfVFJBTlNBQ1RJT046IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJU2VydmljZU1hbmFnZXIsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIFN0cmluZzE2IHdoaWNoID0gZGF0YS5yZWFkU3RyaW5nMTYoKTsKKyAgICAgICAgICAgIHNwPElCaW5kZXI+IGIgPSBkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKTsKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGFkZFNlcnZpY2Uod2hpY2gsIGIpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZXJyKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgY2FzZSBMSVNUX1NFUlZJQ0VTX1RSQU5TQUNUSU9OOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSVNlcnZpY2VNYW5hZ2VyLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBWZWN0b3I8U3RyaW5nMTY+IGxpc3QgPSBsaXN0U2VydmljZXMoKTsKKyAgICAgICAgICAgIGNvbnN0IHNpemVfdCBOID0gbGlzdC5zaXplKCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihOKTsKKyAgICAgICAgICAgIGZvciAoc2l6ZV90IGk9MDsgaTxOO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jKHNpemVfdCBzaXplLCB1aW50MzJfdCBmbGFncykKK3sKKyAgICBpZiAoc2l6ZSA9PSAwKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICBzaXplID0gKHNpemUgKyBrTWVtb3J5QWxpZ24tMSkgLyBrTWVtb3J5QWxpZ247CisgICAgY2h1bmtfdCogZnJlZV9jaHVuayA9IDA7CisgICAgY2h1bmtfdCogY3VyID0gbUxpc3QuaGVhZCgpOworCisgICAgc2l6ZV90IHBhZ2VzaXplID0gZ2V0cGFnZXNpemUoKTsKKyAgICB3aGlsZSAoY3VyKSB7CisgICAgICAgIGludCBleHRyYSA9IDA7CisgICAgICAgIGlmIChmbGFncyAmIFBBR0VfQUxJR05FRCkKKyAgICAgICAgICAgIGV4dHJhID0gKCAtY3VyLT5zdGFydCAmICgocGFnZXNpemUva01lbW9yeUFsaWduKS0xKSApIDsKKworICAgICAgICAvLyBiZXN0IGZpdAorICAgICAgICBpZiAoY3VyLT5mcmVlICYmIChjdXItPnNpemUgPj0gKHNpemUrZXh0cmEpKSkgeworICAgICAgICAgICAgaWYgKCghZnJlZV9jaHVuaykgfHwgKGN1ci0+c2l6ZSA8IGZyZWVfY2h1bmstPnNpemUpKSB7CisgICAgICAgICAgICAgICAgZnJlZV9jaHVuayA9IGN1cjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChjdXItPnNpemUgPT0gc2l6ZSkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGN1ciA9IGN1ci0+bmV4dDsKKyAgICB9CisKKyAgICBpZiAoZnJlZV9jaHVuaykgeworICAgICAgICBjb25zdCBzaXplX3QgZnJlZV9zaXplID0gZnJlZV9jaHVuay0+c2l6ZTsKKyAgICAgICAgZnJlZV9jaHVuay0+ZnJlZSA9IDA7CisgICAgICAgIGZyZWVfY2h1bmstPnNpemUgPSBzaXplOworICAgICAgICBpZiAoZnJlZV9zaXplID4gc2l6ZSkgeworICAgICAgICAgICAgaW50IGV4dHJhID0gMDsKKyAgICAgICAgICAgIGlmIChmbGFncyAmIFBBR0VfQUxJR05FRCkKKyAgICAgICAgICAgICAgICBleHRyYSA9ICggLWZyZWVfY2h1bmstPnN0YXJ0ICYgKChwYWdlc2l6ZS9rTWVtb3J5QWxpZ24pLTEpICkgOworICAgICAgICAgICAgaWYgKGV4dHJhKSB7CisgICAgICAgICAgICAgICAgY2h1bmtfdCogc3BsaXQgPSBuZXcgY2h1bmtfdChmcmVlX2NodW5rLT5zdGFydCwgZXh0cmEpOworICAgICAgICAgICAgICAgIGZyZWVfY2h1bmstPnN0YXJ0ICs9IGV4dHJhOworICAgICAgICAgICAgICAgIG1MaXN0Lmluc2VydEJlZm9yZShmcmVlX2NodW5rLCBzcGxpdCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIExPR0VfSUYoKGZsYWdzJlBBR0VfQUxJR05FRCkgJiYgCisgICAgICAgICAgICAgICAgICAgICgoZnJlZV9jaHVuay0+c3RhcnQqa01lbW9yeUFsaWduKSYocGFnZXNpemUtMSkpLAorICAgICAgICAgICAgICAgICAgICAiUEFHRV9BTElHTkVEIHJlcXVlc3RlZCwgYnV0IHBhZ2UgaXMgbm90IGFsaWduZWQhISEiKTsKKworICAgICAgICAgICAgY29uc3Qgc3NpemVfdCB0YWlsX2ZyZWUgPSBmcmVlX3NpemUgLSAoc2l6ZStleHRyYSk7CisgICAgICAgICAgICBpZiAodGFpbF9mcmVlID4gMCkgeworICAgICAgICAgICAgICAgIGNodW5rX3QqIHNwbGl0ID0gbmV3IGNodW5rX3QoCisgICAgICAgICAgICAgICAgICAgICAgICBmcmVlX2NodW5rLT5zdGFydCArIGZyZWVfY2h1bmstPnNpemUsIHRhaWxfZnJlZSk7CisgICAgICAgICAgICAgICAgbUxpc3QuaW5zZXJ0QWZ0ZXIoZnJlZV9jaHVuaywgc3BsaXQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiAoZnJlZV9jaHVuay0+c3RhcnQpKmtNZW1vcnlBbGlnbjsKKyAgICB9CisgICAgcmV0dXJuIE5PX01FTU9SWTsKK30KKworU2ltcGxlQmVzdEZpdEFsbG9jYXRvcjo6Y2h1bmtfdCogU2ltcGxlQmVzdEZpdEFsbG9jYXRvcjo6ZGVhbGxvYyhzaXplX3Qgc3RhcnQpCit7CisgICAgc3RhcnQgPSBzdGFydCAvIGtNZW1vcnlBbGlnbjsKKyAgICBjaHVua190KiBjdXIgPSBtTGlzdC5oZWFkKCk7CisgICAgd2hpbGUgKGN1cikgeworICAgICAgICBpZiAoY3VyLT5zdGFydCA9PSBzdGFydCkgeworICAgICAgICAgICAgTE9HX0ZBVEFMX0lGKGN1ci0+ZnJlZSwKKyAgICAgICAgICAgICAgICAiYmxvY2sgYXQgb2Zmc2V0IDB4JTA4bFggb2Ygc2l6ZSAweCUwOGxYIGFscmVhZHkgZnJlZWQiLAorICAgICAgICAgICAgICAgIGN1ci0+c3RhcnQqa01lbW9yeUFsaWduLCBjdXItPnNpemUqa01lbW9yeUFsaWduKTsKKworICAgICAgICAgICAgLy8gbWVyZ2UgZnJlZWQgYmxvY2tzIHRvZ2V0aGVyCisgICAgICAgICAgICBjaHVua190KiBmcmVlZCA9IGN1cjsKKyAgICAgICAgICAgIGN1ci0+ZnJlZSA9IDE7CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgY2h1bmtfdCogY29uc3QgcCA9IGN1ci0+cHJldjsKKyAgICAgICAgICAgICAgICBjaHVua190KiBjb25zdCBuID0gY3VyLT5uZXh0OworICAgICAgICAgICAgICAgIGlmIChwICYmIChwLT5mcmVlIHx8ICFjdXItPnNpemUpKSB7CisgICAgICAgICAgICAgICAgICAgIGZyZWVkID0gcDsKKyAgICAgICAgICAgICAgICAgICAgcC0+c2l6ZSArPSBjdXItPnNpemU7CisgICAgICAgICAgICAgICAgICAgIG1MaXN0LnJlbW92ZShjdXIpOworICAgICAgICAgICAgICAgICAgICBkZWxldGUgY3VyOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjdXIgPSBuOworICAgICAgICAgICAgfSB3aGlsZSAoY3VyICYmIGN1ci0+ZnJlZSk7CisKKyAgICAgICAgICAgICNpZm5kZWYgTkRFQlVHCisgICAgICAgICAgICAgICAgaWYgKCFmcmVlZC0+ZnJlZSkgeworICAgICAgICAgICAgICAgICAgICBkdW1wX2woImRlYWxsb2MgKCFmcmVlZC0+ZnJlZSkiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAjZW5kaWYKKyAgICAgICAgICAgIExPR19GQVRBTF9JRighZnJlZWQtPmZyZWUsCisgICAgICAgICAgICAgICAgImZyZWVkIGJsb2NrIGF0IG9mZnNldCAweCUwOGxYIG9mIHNpemUgMHglMDhsWCBpcyBub3QgZnJlZSEiLAorICAgICAgICAgICAgICAgIGZyZWVkLT5zdGFydCAqIGtNZW1vcnlBbGlnbiwgZnJlZWQtPnNpemUgKiBrTWVtb3J5QWxpZ24pOworCisgICAgICAgICAgICByZXR1cm4gZnJlZWQ7CisgICAgICAgIH0KKyAgICAgICAgY3VyID0gY3VyLT5uZXh0OworICAgIH0KKyAgICByZXR1cm4gMDsKK30KKwordm9pZCBTaW1wbGVCZXN0Rml0QWxsb2NhdG9yOjpkdW1wKGNvbnN0IGNoYXIqIHdoYXQsIHVpbnQzMl90IGZsYWdzKSBjb25zdAoreworICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisgICAgZHVtcF9sKHdoYXQsIGZsYWdzKTsKK30KKwordm9pZCBTaW1wbGVCZXN0Rml0QWxsb2NhdG9yOjpkdW1wX2woY29uc3QgY2hhciogd2hhdCwgdWludDMyX3QgZmxhZ3MpIGNvbnN0Cit7CisgICAgU3RyaW5nOCByZXN1bHQ7CisgICAgZHVtcF9sKHJlc3VsdCwgd2hhdCwgZmxhZ3MpOworICAgIExPR0QoIiVzIiwgcmVzdWx0LnN0cmluZygpKTsKK30KKword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gPyAyIDogMDsKKworICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsICIgICUzdTogJTA4eCB8IDB4JTA4WCB8IDB4JTA4WCB8ICVzICVzXG4iLAorICAgICAgICAgICAgaSwgaW50KGN1ciksIGludChjdXItPnN0YXJ0KmtNZW1vcnlBbGlnbiksCisgICAgICAgICAgICBpbnQoY3VyLT5zaXplKmtNZW1vcnlBbGlnbiksCisgICAgICAgICAgICAgICAgICAgIGludChjdXItPmZyZWUpID8gIkYiIDogIkEiLAorICAgICAgICAgICAgICAgICAgICBlcnJzW25wfHBuXSk7CisgICAgICAgIAorICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CisKKyAgICAgICAgaWYgKCFjdXItPmZyZWUpCisgICAgICAgICAgICBzaXplICs9IGN1ci0+c2l6ZSprTWVtb3J5QWxpZ247CisKKyAgICAgICAgaSsrOworICAgICAgICBjdXIgPSBjdXItPm5leHQ7CisgICAgfQorICAgIHNucHJpbnRmKGJ1ZmZlciwgU0laRSwgIiAgc2l6ZSBhbGxvY2F0ZWQ6ICV1ICgldSBLQilcbiIsIGludChzaXplKSwgaW50KHNpemUvMTAyNCkpOworICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKK30KKyAgICAgICAgCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK1NoYXJlZEhlYXA6OlNoYXJlZEhlYXAoKSAKKyAgICA6IEhlYXBJbnRlcmZhY2UoKSwgTWVtb3J5SGVhcEJhc2UoKSAKK3sgCit9CisKK1NoYXJlZEhlYXA6OlNoYXJlZEhlYXAoc2l6ZV90IHNpemUsIHVpbnQzMl90IGZsYWdzLCBjaGFyIGNvbnN0ICogbmFtZSkKKyAgICA6IE1lbW9yeUhlYXBCYXNlKHNpemUsIGZsYWdzLCBuYW1lKQoreworfQorCitTaGFyZWR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SgpOworICAgICAgICBzaXplID0gKChzaXplICsgcGFnZXNpemUtMSkgJiB+KHBhZ2VzaXplLTEpKTsKKyAgICAgICAgaWYgKG1hcGZkKGZkLCBzaXplKSA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgbURldmljZSA9IGRldmljZTsKKyAgICAgICAgfQorICAgIH0KK30KKworTWVtb3J5SGVhcEJhc2U6Ok1lbW9yeUhlYXBCYXNlKGludCBmZCwgc2l6ZV90IHNpemUsIHVpbnQzMl90IGZsYWdzLCB1aW50MzJfdCBvZmZzZXQpCisgICAgOiBtRkQoLTEpLCBtU2l6ZSgwKSwgbUJhc2UoTUFQX0ZBSUxFRCksIG1GbGFncyhmbGFncyksCisgICAgICBtRGV2aWNlKDApLCBtTmVlZFVubWFwKGZhbHNlKQoreworICAgIGNvbnN0IHNpemVfdCBwYWdlc2l6ZSA9IGdldHBhZ2VzaXplKCk7CisgICAgc2l6ZSA9ICgoc2l6ZSArIHBhZ2VzaXplLTEpICYgfihwYWdlc2l6ZS0xKSk7CisgICAgbWFwZmQoZHVwKGZkKSwgc2l6ZSwgb2Zmc2V0KTsKK30KKworc3RhdHVzX3QgTWVtb3J5SGVhcEJhc2U6OmluaXQoaW50IGZkLCB2b2lkICpiYXNlLCBpbnQgc2l6ZSwgaW50IGZsYWdzLCBjb25zdCBjaGFyKiBkZXZpY2UpCit7CisgICAgaWYgKG1GRCAhPSAtMSkgeworICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047CisgICAgfQorICAgIG1GRCA9IGZkOworICAgIG1CYXNlID0gYmFzZTsKKyAgICBtU2l6ZSA9IHNpemU7CisgICAgbUZsYWdzID0gZmxhZ3M7CisgICAgbURldmljZSA9IGRldmljZTsKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKK3N0YXR1c190IE1lbW9yeUhlYXBCYXNlOjptYXBmZChpbnQgZmQsIHNpemVfdCBzaXplLCB1aW50MzJfdCBvZmZzZXQpCit7CisgICAgaWYgKHNpemUgPT0gMCkgeworICAgICAgICAvLyB0cnkgdG8gZmlndXJlIG91dCB0aGUgc2l6ZSBhdXRvbWF0aWNhbGx5CisjaWYgSEFWRV9BTkRST0lEX09TCisgICAgICAgIC8vIGZpcnN0IHRyeSB0aGUgUE1FTSBpb2N0bAorICAgICAgICBwbWVtX3JlZ2lvbiByZWc7CisgICAgICAgIGludCBlcnIgPSBpb2N0bChmZCwgUE1FTV9HRVRfVE9UQUxfU0laRSwgJnJlZyk7CisgICAgICAgIGlmIChlcnIgPT0gMCkKKyAgICAgICAgICAgIHNpemUgPSByZWcubGVuOworI2VuZGlmCisgICAgICAgIGlmIChzaXplID09IDApIHsgLy8gdHJ5IGZzdGF0CisgICAgICAgICAgICBzdHJ1Y3Qgc3RhdCBzYjsKKyAgICAgICAgICAgIGlmIChmc3RhdChmZCwgJnNiKSA9PSAwKQorICAgICAgICAgICAgICAgIHNpemUgPSBzYi5zdF9zaXplOworICAgICAgICB9CisgICAgICAgIC8vIGlmIGl0IGRpZG4ndCB3b3JrLCBsZXQgbW1hcCgpIGZhaWwuCisgICAgfQorCisgICAgaWYgKChtRmxhZ3MgJiBET05UX01BUF9MT0NBTExZKSA9PSAwKSB7CisgICAgICAgIHZvaWQqIGJhc2UgPSAodWludDhfdCopbW1hcCgwLCBzaXplLAorICAgICAgICAgICAgICAgIFBST1RfUkVBRHxQUk9UX1dSSVRFLCBNQVBfU0hBUkVELCBmZCwgb2Zmc2V0KTsKKyAgICAgICAgaWYgKGJhc2UgPT0gTUFQX0ZBSUxFRCkgeworICAgICAgICAgICAgTE9HRSgibW1hcChmZD0lZCwgc2l6ZT0ldSkgZmFpbGVkICglcykiLAorICAgICAgICAgICAgICAgICAgICBmZCwgdWludDMyX3Qoc2l6ZSksIHN0cmVycm9yKGVycm5vKSk7CisgICAgICAgICAgICBjbG9zZShmZCk7CisgICAgICAgICAgICByZXR1cm4gLWVycm5vOworICAgICAgICB9CisgICAgICAgIC8vTE9HRCgibW1hcChmZD0lZCwgYmFzZT0lcCwgc2l6ZT0lbHUpIiwgZmQsIGJhc2UsIHNpemUpOworICAgICAgICBtQmFzZSA9IGJhc2U7CisgICAgICAgIG1OZWVkVW5tYXAgPSB0cnVlOworICAgIH0gZWxzZSAgeworICAgICAgICBtQmFzZSA9IDA7IC8vIG5vdCBNQVBfRkFJTEVECisgICAgICAgIG1OZWVkVW5tYXAgPSBmYWxzZTsKKyAgICB9CisgICAgbUZEID0gZmQ7CisgICAgbVNpemUgPSBzaXplOworICAgIHJldHVybiBOT19FUlJPUjsKK30KKworTWVtb3J5SGVhcEJhc2U6On5NZW1vcnlIZWFwQmFzZSgpCit7CisgICAgZGlzcG9zZSgpOworfQorCit2b2lkIE1lbW9yeUhlYXBCYXNlOjpkaXNwb3NlKCkKK3sKKyAgICBpbnQgZmQgPSBhbmRyb2lkX2F0b21pY19vcigtMSwgJm1GRCk7CisgICAgaWYgKGZkID49IDApIHsKKyAgICAgICAgaWYgKG1OZWVkVW5tYXApIHsKKyAgICAgICAgICAgIC8vTE9HRCgibXVubWFwKGZkPSVkLCBiYXNlPSVwLCBzaXplPSVsdSkiLCBmZCwgbUJhc2UsIG1TaXplKTsKKyAgICAgICAgICAgIG11bm1hcChtQmFzZSwgbVNpemUpOworICAgICAgICB9CisgICAgICAgIG1CYXNlID0gMDsKKyAgICAgICAgbVNpemUgPSAwOworICAgICAgICBjbG9zZShmZCk7CisgICAgfQorfQorCitpbnQgTWVtb3J5SGVhcEJhc2U6OmdldEhlYXBJRCgpIGNvbnN0IHsKKyAgICByZXR1cm4gbUZEOworfQorCit2b2lkKiBNZW1vcnlIZWFwQmFzZTo6Z2V0QmFzZSgpIGNvbnN0IHsKKyAgICByZXR1cm4gbUJhc2U7Cit9CisKK3NpemVfdCBNZW1vcnlIZWFwQmFzZTo6Z2V0U2l6ZSgpIGNvbnN0IHsKKyAgICByZXR1cm4gbVNpemU7Cit9CisKK3VpbnQzMl90IE1lbW9yeUhlYXBCYXNlOjpnZXRGbGFncygpIGN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orI2VuZGlmCit9CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitNZW1vcnlIZWFwUG1lbTo6TWVtb3J5SGVhcFBtZW0oY29uc3Qgc3A8TWVtb3J5SGVhcEJhc2U+JiBwbWVtSGVhcCwKKyAgICAgICAgdWludDMyX3QgZmxhZ3MpCisgICAgOiBIZWFwSW50ZXJmYWNlKCksIE1lbW9yeUhlYXBCYXNlKCkKK3sKKyAgICBjaGFyIGNvbnN0ICogY29uc3QgZGV2aWNlID0gcG1lbUhlYXAtPmdldERldmljZSgpOworI2lmIEhBVkVfQU5EUk9JRF9PUworICAgIGlmIChkZXZpY2UpIHsKKyAgICAgICAgaW50IGZkID0gb3BlbihkZXZpY2UsIE9fUkRXUik7CisgICAgICAgIExPR0VfSUYoZmQ8MCwgImNvdWxkbid0IG9wZW4gJXMgKCVzKSIsIGRldmljZSwgc3RyZXJyb3IoZXJybm8pKTsKKyAgICAgICAgaWYgKGZkID49IDApIHsKKyAgICAgICAgICAgIGludCBlcnIgPSBpb2N0bChmZCwgUE1FTV9DT05ORUNULCBwbWVtSGVhcC0+aGVhcElEKCkpOworICAgICAgICAgICAgaWYgKGVyciA8IDApIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJQTUVNX0NPTk5FQ1QgZmFpbGVkICglcyksIG1GRD0lZCwgc3ViLWZkPSVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVycm9yKGVycm5vKSwgZmQsIHBtZW1IZWFwLT5oZWFwSUQoKSk7CisgICAgICAgICAgICAgICAgY2xvc2UoZmQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBldmVyeXRoaW5nIHdlbnQgd2VsbC4uLgorICAgICAgICAgICAgICAgIG1QYXJlbnRIZWFwID0gcG1lbUhlYXA7CisgICAgICAgICAgICAgICAgTWVtb3J5SGVhcEJhc2U6OmluaXQoZmQsIAorICAgICAgICAgICAgICAgICAgICAgICAgcG1lbUhlYXAtPmdldEJhc2UoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBtZW1IZWFwLT5nZXRTaXplKCksCisgICAgICAgICAgICAgICAgICAgICAgICBwbWVtSGVhcC0+Z2V0RmxhZ3MoKSB8IGZsYWdzLAorICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyNlbHNlCisgICAgbVBhcmVudEhlYXAgPSBwbWVtSGVhcDsKKyAgICBNZW1vcnlIZWFwQmFzZTo6aW5pdCggCisgICAgICAgICAgICBkdXAocG1lbUhlYXAtPmhlYXBJRCgpKSwKKyAgICAgICAgICAgIHBtZW1IZWFwLT5nZXRCYXNlKCksCisgICAgICAgICAgICBwbWVtSGVhcC0+Z2V0U2l6ZSgpLAorICAgICAgICAgICAgcG1lbUhlYXAtPmdldEZsYWdzKCkgfCBmbGFncywKKyAgICAgICAgICAgIGRldmljZSk7CisjZW5kaWYKK30KKworTWVtb3J5SGVhcFBtZW06On5NZW1vcnlIZWFwUG1lbSgpCit7Cit9CisKK3NwPElNZW1vcnk+IE1lbW9yeUhlYXBQbWVtOjptYXBNZW1vcnkoc2l6ZV90IG9mZnNldCwgc2l6ZV90IHNpemUpCit7CisgICAgc3A8TWVtb3J5UG1lbT4gbWVtb3J5ID0gY3JlYXRlTWVtb3J5KG9mZnNldCwgc2l6ZSk7CisgICAgaWYgKG1lbW9yeSAhPSAwKSB7CisgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7CisgICAgICAgIG1BbGxvY2F0aW9ucy5hZGQobWVtb3J5KTsKKyAgICB9CisgICAgcmV0dXJuIG1lbW9yeTsKK30KKworc3A8TWVtb3J5SGVhcFBtZW06Ok1lbW9yeVBtZW0+IE1lbW9yeUhlYXBQbWVtOjpjcmVhdGVNZW1vcnkoCis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isgICAgICAgIGNhc2UgQklOREVSX1RZUEVfSEFORExFOiB7CisgICAgICAgICAgICBjb25zdCBzcDxJQmluZGVyPiBiID0gcHJvYy0+Z2V0U3Ryb25nUHJveHlGb3JIYW5kbGUob2JqLmhhbmRsZSk7CisgICAgICAgICAgICBpZiAoYiAhPSBOVUxMKSB7CisgICAgICAgICAgICAgICAgTE9HX1JFRlMoIlBhcmNlbCAlcCBhY3F1aXJpbmcgcmVmZXJlbmNlIG9uIHJlbW90ZSAlcCIsIHdobywgYi5nZXQoKSk7CisgICAgICAgICAgICAgICAgYi0+aW5jU3Ryb25nKHdobyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBCSU5ERVJfVFlQRV9XRUFLX0hBTkRMRTogeworICAgICAgICAgICAgY29uc3Qgd3A8SUJpbmRlcj4gYiA9IHByb2MtPmdldFdlYWtQcm94eUZvckhhbmRsZShvYmouaGFuZGxlKTsKKyAgICAgICAgICAgIGlmIChiICE9IE5VTEwpIGIuZ2V0X3JlZnMoKS0+aW5jV2Vhayh3aG8pOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGNhc2UgQklOREVSX1RZUEVfRkQ6IHsKKyAgICAgICAgICAgIC8vIGludGVudGlvbmFsbHkgYmxhbmsgLS0gbm90aGluZyB0byBkbyB0byBhY3F1aXJlIHRoaXMsIGJ1dCB3ZSBkbworICAgICAgICAgICAgLy8gcmVjb2duaXplIGl0IGFzIGEgbGVnaXRpbWF0ZSBvYmplY3QgdHlwZS4KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KKworICAgIExPR0QoIkludmFsaWQgb2JqZWN0IHR5cGUgMHglMDhseCIsIG9iai50eXBlKTsKK30KKwordm9pZCByZWxlYXNlX29iamVjdChjb25zdCBzcDxQcm9jZXNzU3RhdGU+JiBwcm9jLAorICAgIGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCYgb2JqLCBjb25zdCB2b2lkKiB3aG8pCit7CisgICAgc3dpdGNoIChvYmoudHlwZSkgeworICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX0JJTkRFUjoKKyAgICAgICAgICAgIGlmIChvYmouYmluZGVyKSB7CisgICAgICAgICAgICAgICAgTE9HX1JFRlMoIlBhcmNlbCAlcCByZWxlYXNpbmcgcmVmZXJlbmNlIG9uIGxvY2FsICVwIiwgd2hvLCBvYmouY29va2llKTsKKyAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxJQmluZGVyKj4ob2JqLmNvb2tpZSktPmRlY1N0cm9uZyh3aG8pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX1dFQUtfQklOREVSOgorICAgICAgICAgICAgaWYgKG9iai5iaW5kZXIpCisgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8UmVmQmFzZTo6d2Vha3JlZl90eXBlKj4ob2JqLmJpbmRlciktPmRlY1dlYWsod2hvKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgY2FzZSBCSU5ERVJfVFlQRV9IQU5ETEU6IHsKKyAgICAgICAgICAgIGNvbnN0IHNwPElCaW5kZXI+IGIgPSBwcm9jLT5nZXRTdHJvbmdQcm94eUZvckhhbmRsZShvYmouaGFuZGxlKTsKKyAgICAgICAgICAgIGlmIChiICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBMT0dfUkVGUygiUGFyY2VsICVwIHJlbGVhc2luZyByZWZlcmVuY2Ugb24gcmVtb3RlICVwIiwgd2hvLCBiLmdldCgpKTsKKyAgICAgICAgICAgICAgICBiLT5kZWNTdHJvbmcod2hvKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX1dFQUtfSEFORExFOiB7CisgICAgICAgICAgICBjb25zdCB3cDxJQmluZGVyPiBiID0gcHJvYy0+Z2V0V2Vha1Byb3h5Rm9ySGFuZGxlKG9iai5oYW5kbGUpOworICAgICAgICAgICAgaWYgKGIgIT0gTlVMTCkgYi5nZXRfcmVmcygpLT5kZWNXZWFrKHdobyk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgY2FzZSBCSU5ERVJfVFlQRV9GRDogeworICAgICAgICAgICAgaWYgKG9iai5jb29raWUgIT0gKHZvaWQqKTApIGNsb3NlKG9iai5oYW5kbGUpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorCisgICAgTE9HRSgiSW52YWxpZCBvYmplY3QgdHlwZSAweCUwOGx4Iiwgb2JqLnR5cGUpOworfQorCitpbmxpbmUgc3RhdGljIHN0YXR1c190IGZpbmlzaF9mbGF0dGVuX2JpbmRlcigKKyAgICBjb25zdCBzcDxJQmluZGVyPiYgYmluZGVyLCBjb25zdCBmbGF0X2JpbmRlcl9vYmplY3QmIGZsYXQsIFBhcmNlbCogb3V0KQoreworICAgIHJldHVybiBvdXQtPndyaXRlT2JqZWN0KGZsYXQsIGZhbHNlKTsKK30KKworc3RhdHVzX3QgZmxhdHRlbl9iaW5kZXIoY29uc3Qgc3A8UHJvY2Vzc1N0YXRlPiYgcHJvYywKKyAgICBjb25zdCBzcDxJQmluZGVyPiYgYmluZGVyLCBQYXJjZWwqIG91dCkKK3sKKyAgICBmbGF0X2JpbmRlcl9vYmplY3Qgb2JqOworICAgIAorICAgIG9iai5mbGFncyA9IDB4N2YgfCBGTEFUX0JJTkRFUl9GTEFHX0FDQ0VQVFNfRkRTOworICAgIGlmIChiaW5kZXIgIT0gTlVMTCkgeworICAgICAgICBJQmluZGVyICpsb2NhbCA9IGJpbmRlci0+bG9jYWxCaW5kZXIoKTsKKyAgICAgICAgaWYgKCFsb2NhbCkgeworICAgICAgICAgICAgQnBCaW5kZXIgKnByb3h5ID0gYmluZGVyLT5yZW1vdGVCaW5kZXIoKTsKKyAgICAgICAgICAgIGlmIChwcm94eSA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgTE9HRSgibnVsbCBwcm94eSIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29uc3QgaW50MzJfdCBoYW5kbGUgPSBwcm94eSA/IHByb3h5LT5oYW5kbGUoKSA6IDA7CisgICAgICAgICAgICBvYmoudHlwZSA9IEJJTkRFUl9UWVBFX0hBTkRMRTsKKyAgICAgICAgICAgIG9iai5oYW5kbGUgPSBoYW5kbGU7CisgICAgICAgICAgICBvYmouY29va2llID0gTlVMTDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG9iai50eXBlID0gQklOREVSX1RZUEVfQklOREVSOworICAgICAgICAgICAgb2JqLmJpbmRlciA9IGxvY2FsLT5nZXRXZWFrUmVmcygpOworICAgICAgICAgICAgb2JqLmNvb2tpZSA9IGxvY2FsOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgb2JqLnR5cGUgPSBCSU5ERVJfVFlQRV9CSU5ERVI7CisgICAgICAgIG9iai5iaW5kZXIgPSBOVUxMOworICAgICAgICBvYmouY29va2llID0gTlVMTDsKKyAgICB9CisgICAgCisgICAgcmV0dXJuIGZpbmlzaF9mbGF0dGVuX2JpbmRlcihiaW5kZXIsIG9iaiwgb3V0KTsKK30KKworc3RhdHVzX3QgZmxhdHRlbl9iaW5kZXIoY29uc3Qgc3A8UHJvY2Vzc1N0YXRlPiYgcHJvYywKKyAgICBjb25zdCB3cDxJQmluZGVyPiYgYmluZGVyLCBQYXJjZWwqIG91dCkKK3sKKyAgICBmbGF0X2JpbmRlcl9vYmplY3Qgb2JqOworICAgIAorICAgIG9iai5mbGFncyA9IDB4N2YgfCBGTEFUX0JJTkRFUl9GTEFHX0FDQ0VQVFNfRkRTOworICAgIGlmIChiaW5kZXIgIT0gTlVMTCkgeworICAgICAgICBzcDxJQmluZGVyPiByZWFsID0gYmluZGVyLnByb21vdGUoKTsKKyAgICAgICAgaWYgKHJlYWwgIT0gTlVMTCkgeworICAgICAgICAgICAgSUJpbmRlciAqbG9jYWwgPSByZWFsLT5sb2NhbEJpbmRlcigpOworICAgICAgICAgICAgaWYgKCFsb2NhbCkgeworICAgICAgICAgICAgICAgIEJwQmluZGVyICpwcm94eSA9IHJlYWwtPnJlbW90ZUJpbmRlcigpOworICAgICAgICAgICAgICAgIGlmIChwcm94eSA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgIExPR0UoIm51bGwgcHJveHkiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY29uc3QgaW50MzJfdCBoYW5kbGUgPSBwcm94eSA/IHByb3h5LT5oYW5kbGUoKSA6IDA7CisgICAgICAgICAgICAgICAgb2JqLnR5cGUgPSBCSU5ERVJfVFlQRV9XRUFLX0hBTkRMRTsKKyAgICAgICAgICAgICAgICBvYmouaGFuZGxlID0gaGFuZGxlOworICAgICAgICAgICAgICAgIG9iai5jb29raWUgPSBOVUxMOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBvYmoudHlwZSA9IEJJTkRFUl9UWVBFX1dFQUtfQklOREVSOworICAgICAgICAgICAgICAgIG9iai5iaW5kZXIgPSBiaW5kZXIuZ2V0X3JlZnMoKTsKKyAgICAgICAgICAgICAgICBvYmouY29va2llID0gYmluZGVyLnVuc2FmZV9nZXQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmaW5pc2hfZmxhdHRlbl9iaW5kZXIocmVhbCwgb2JqLCBvdXQpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBYWFggSG93IHRvIGRlYWw/ICBJbiBvcmRlciB0byBmbGF0dGVuIHRoZSBnaXZlbiBiaW5kZXIsCisgICAgICAgIC8vIHdlIG5lZWQgdG8gcHJvYmUgaXQgZm9yIGluZm9ybWF0aW9uLCB3aGljaCByZXF1aXJlcyBhIHByaW1hcnkKKyAgICAgICAgLy8gcmVmZXJlbmNlLi4uICBidXQgd2UgZG9uJ3QgaGF2ZSBvbmUuCisgICAgICAgIC8vCisgICAgICAgIC8vIFRoZSBPcGVuQmluZGVyIGltcGxlbWVudGF0aW9uIHVzZXMgYSBkeW5hbWljX2Nhc3Q8PiBoZXJlLAorICAgICAgICAvLyBidXQgd2UgY2FuJ3QgZG8gdGhhdCB3aXRoIHRoZSBkaWZmZXJlbnQgcmVmZXJlbmNlIGNvdW50aW5nCisgICAgICAgIC8vIGltcGxlbWVudGF0aW9uIHdlIGFyZSB1c2luZy4KKyAgICAgICAgTE9HRSgiVW5hYmxlIHRvIHVuZmxhdHRlbiBCaW5kZXIgd2VhayByZWZlcmVuY2UhIik7CisgICAgICAgIG9iai50eXBlID0gQklOREVSX1RZUEVfQklOREVSOworICAgICAgICBvYmouYmluZGVyID0gTlVMTDsKKyAgICAgICAgb2JqLmNvb2tpZSA9IE5VTEw7CisgICAgICAgIHJldHVybiBmaW5pc2hfZmxhdHRlbl9iaW5kZXIoTlVMTCwgb2JqLCBvdXQpOworICAgIAorICAgIH0gZWxzZSB7CisgICAgICAgIG9iai50eXBlID0gQklOREVSX1RZUEVfQklOREVSOworICAgICAgICBvYmouYmluZGVyID0gTlVMTDsKKyAgICAgICAgb2JqLmNvb2tpZSA9IE5VTEw7CisgICAgICAgIHJldHVybiBmaW5pc2hfZmxhdHRlbl9iaW5kZXIoTlVMTCwgb2JqLCBvdXQpOworICAgIH0KK30KKworaW5saW5lIHN0YXRpYyBzdGF0dXNfdCBmaW5pc2hfdW5mbGF0dGVuX2JpbmRlcigKKyAgICBCcEJpbmRlciogcHJveHksIGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCYgZmxhdCwgY29uc3QgUGFyY2VsJiBpbikKK3sKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisgICAgCitzdGF0dXNfdCB1bmZsYXR0ZW5fYmluZGVyKGNvbnN0IHNwPFByb2Nlc3NTdGF0ZT4mIHByb2MsCisgICAgY29uc3QgUGFyY2VsJiBpbiwgc3A8SUJpbmRlcj4qIG91dCkKK3sKKyAgICBjb25zdCBmbGF0X2JpbmRlcl9vYmplY3QqIGZsYXQgPSBpbi5yZWFkT2JqZWN0KGZhbHNlKTsKKyAgICAKKyAgICBpZiAoZmxhdCkgeworICAgICAgICBzd2l0Y2ggKGZsYXQtPnR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgQklOREVSX1RZUEVfQklOREVSOgorICAgICAgICAgICAgICAgICpvdXQgPSBzdGF0aWNfY2FzdDxJQmluZGVyKj4oZmxhdC0+Y29va2llKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmluaXNoX3VuZmxhdHRlbl9iaW5kZXIoTlVMTCwgKmZsYXQsIGluKTsKKyAgICAgICAgICAgIGNhc2UgQklOREVSX1RZUEVfSEFORExFOgorICAgICAgICAgICAgICAgICpvdXQgPSBwcm9jLT5nZXRTdHJvbmdQcm94eUZvckhhbmRsZShmbGF0LT5oYW5kbGUpOworICAgICAgICAgICAgICAgIHJldHVybiBmaW5pc2hfdW5mbGF0dGVuX2JpbmRlcigKKyAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QnBCaW5kZXIqPihvdXQtPmdldCgpKSwgKmZsYXQsIGluKTsKKyAgICAgICAgfSAgICAgICAgCisgICAgfQorICAgIHJldHVybiBCQURfVFlQRTsKK30KKworc3RhdHVzX3QgdW5mbGF0dGVuX2JpbmRlcihjb25zdCBzcDxQcm9jZXNzU3RhdGU+JiBwcm9jLAorICAgIGNvbnN0IFBhcmNlbCYgaW4sIHdwPElCaW5kZXI+KiBvdXQpCit7CisgICAgY29uc3QgZmxhdF9iaW5kZXJfb2JqZWN0KiBmbGF0ID0gaW4ucmVhZE9iamVjdChmYWxzZSk7CisgICAgCisgICAgaWYgKGZsYXQpIHsKKyAgICAgICAgc3dpdGNoIChmbGF0LT50eXBlKSB7CisgICAgICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX0JJTkRFUjoKKyAgICAgICAgICAgICAgICAqb3V0ID0gc3RhdGljX2Nhc3Q8SUJpbmRlcio+KGZsYXQtPmNvb2tpZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZpbmlzaF91bmZsYXR0ZW5fYmluZGVyKE5VTEwsICpmbGF0LCBpbik7CisgICAgICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX1dFQUtfQklOREVSOgorICAgICAgICAgICAgICAgIGlmIChmbGF0LT5iaW5kZXIgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgICAgICBvdXQtPnNldF9vYmplY3RfYW5kX3JlZnMoCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxJQmluZGVyKj4oZmxhdC0+Y29va2llKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PFJlZkJhc2U6OndlYWtyZWZfdHlwZSo+KGZsYXQtPmJpbmRlcikpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICpvdXQgPSBOVUxMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gZmluaXNoX3VuZmxhdHRlbl9iaW5kZXIoTlVMTCwgKmZsYXQsIGluKTsKKyAgICAgICAgICAgIGNhc2UgQklOREVSX1RZUEVfSEFORExFOgorICAgICAgICAgICAgY2FzZSBCSU5ERVJfVFlQRV9XRUFLX0hBTkRMRToKKyAgICAgICAgICAgICAgICAqb3V0ID0gcHJvYy0+Z2V0V2Vha1Byb3h5Rm9ySGFuZGxlKGZsYXQtPmhhbmRsZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZpbmlzaF91bmZsYXR0ZW5fYmluZGVyKAorICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxCcEJpbmRlcio+KG91dC0+dW5zYWZlX2dldCgpKSwgKmZsYXQsIGluKTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gQkFEX1RZUEU7Cit9CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0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hdGFQb3M7Cit9CisKK3NpemVfdCBQYXJjZWw6OmRhdGFDYXBhY2l0eSgpIGNvbnN0Cit7CisgICAgcmV0dXJuIG1EYXRhQ2FwYWNpdHk7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6c2V0RGF0YVNpemUoc2l6ZV90IHNpemUpCit7CisgICAgc3RhdHVzX3QgZXJyOworICAgIGVyciA9IGNvbnRpbnVlV3JpdGUoc2l6ZSk7CisgICAgaWYgKGVyciA9PSBOT19FUlJPUikgeworICAgICAgICBtRGF0YVNpemUgPSBzaXplOworICAgICAgICBMT0dWKCJzZXREYXRhU2l6ZSBTZXR0aW5nIGRhdGEgc2l6ZSBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFTaXplKTsKKyAgICB9CisgICAgcmV0dXJuIGVycjsKK30KKwordm9pZCBQYXJjZWw6OnNldERhdGFQb3NpdGlvbihzaXplX3QgcG9zKSBjb25zdAoreworICAgIG1EYXRhUG9zID0gcG9zOworICAgIG1OZXh0T2JqZWN0SGludCA9IDA7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6c2V0RGF0YUNhcGFjaXR5KHNpemVfdCBzaXplKQoreworICAgIGlmIChzaXplID4gbURhdGFTaXplKSByZXR1cm4gY29udGludWVXcml0ZShzaXplKTsKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6c2V0RGF0YShjb25zdCB1aW50OF90KiBidWZmZXIsIHNpemVfdCBsZW4pCit7CisgICAgc3RhdHVzX3QgZXJyID0gcmVzdGFydFdyaXRlKGxlbik7CisgICAgaWYgKGVyciA9PSBOT19FUlJPUikgeworICAgICAgICBtZW1jcHkoY29uc3RfY2FzdDx1aW50OF90Kj4oZGF0YSgpKSwgYnVmZmVyLCBsZW4pOworICAgICAgICBtRGF0YVNpemUgPSBsZW47CisgICAgICAgIG1GZHNLbm93biA9IGZhbHNlOworICAgIH0KKyAgICByZXR1cm4gZXJyOworfQorCitzdGF0dXNfdCB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k7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsYXN0SW5kZXggPSBpOworICAgICAgICB9CisgICAgfQorICAgIGludCBudW1PYmplY3RzID0gbGFzdEluZGV4IC0gZmlyc3RJbmRleCArIDE7CisKKyAgICAvLyBncm93IGRhdGEKKyAgICBlcnIgPSBncm93RGF0YShsZW4pOworICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICAvLyBhcHBlbmQgZGF0YQorICAgIG1lbWNweShtRGF0YSArIG1EYXRhUG9zLCBkYXRhICsgb2Zmc2V0LCBsZW4pOworICAgIG1EYXRhUG9zICs9IGxlbjsKKyAgICBtRGF0YVNpemUgKz0gbGVuOworCisgICAgaWYgKG51bU9iamVjdHMgPiAwKSB7CisgICAgICAgIC8vIGdyb3cgb2JqZWN0cworICAgICAgICBpZiAobU9iamVjdHNDYXBhY2l0eSA8IG1PYmplY3RzU2l6ZSArIG51bU9iamVjdHMpIHsKKyAgICAgICAgICAgIGludCBuZXdTaXplID0gKChtT2JqZWN0c1NpemUgKyBudW1PYmplY3RzKSozKS8yOworICAgICAgICAgICAgc2l6ZV90ICpvYmplY3RzID0KKyAgICAgICAgICAgICAgICAoc2l6ZV90KilyZWFsbG9jKG1PYmplY3RzLCBuZXdTaXplKnNpemVvZihzaXplX3QpKTsKKyAgICAgICAgICAgIGlmIChvYmplY3RzID09IChzaXplX3QqKTApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTk9fTUVNT1JZOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU9iamVjdHMgPSBvYmplY3RzOworICAgICAgICAgICAgbU9iamVjdHNDYXBhY2l0eSA9IG5ld1NpemU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIGFwcGVuZCBhbmQgYWNxdWlyZSBvYmplY3RzCisgICAgICAgIGludCBpZHggPSBtT2JqZWN0c1NpemU7CisgICAgICAgIGZvciAoaW50IGkgPSBmaXJzdEluZGV4OyBpIDw9IGxhc3RJbmRleDsgaSsrKSB7CisgICAgICAgICAgICBzaXplX3Qgb2ZmID0gb2JqZWN0c1tpXSAtIG9mZnNldCArIHN0YXJ0UG9zOworICAgICAgICAgICAgbU9iamVjdHNbaWR4KytdID0gb2ZmOworICAgICAgICAgICAgbU9iamVjdHNTaXplKys7CisKKyAgICAgICAgICAgIGZsYXRfYmluZGVyX29iamVjdCogZmxhdAorICAgICAgICAgICAgICAgID0gcmVpbnRlcnByZXRfY2FzdDxmbGF0X2JpbmRlcl9vYmplY3QqPihtRGF0YSArIG9mZik7CisgICAgICAgICAgICBhY3F1aXJlX29iamVjdChwcm9jLCAqZmxhdCwgdGhpcyk7CisKKyAgICAgICAgICAgIGlmIChmbGF0LT50eXBlID09IEJJTkRFUl9UWVBFX0ZEKSB7CisgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyBpcyBhIGZpbGUgZGVzY3JpcHRvciwgd2UgbmVlZCB0byBkdXAgaXQgc28gdGhlCisgICAgICAgICAgICAgICAgLy8gbmV3IFBhcmNlbCBub3cgb3ducyBpdHMgb3duIGZkLCBhbmQgY2FuIGRlY2xhcmUgdGhhdCB3ZQorICAgICAgICAgICAgICAgIC8vIG9mZmljaWFsbHkga25vdyB3ZSBoYXZlIGZkcy4KKyAgICAgICAgICAgICAgICBmbGF0LT5oYW5kbGUgPSBkdXAoZmxhdC0+aGFuZGxlKTsKKyAgICAgICAgICAgICAgICBmbGF0LT5jb29raWUgPSAodm9pZCopMTsKKyAgICAgICAgICAgICAgICBtSGFzRmRzID0gbUZkc0tub3duID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBOT19FUlJPUjsKK30KKworYm9vbCBQYXJjZWw6Omhhc0ZpbGVEZXNjcmlwdG9ycygpIGNvbnN0Cit7CisgICAgaWYgKCFtRmRzS25vd24pIHsKKyAgICAgICAgc2NhbkZvckZkcygpOworICAgIH0KKyAgICByZXR1cm4gbUhhc0ZkczsKK30KKworc3RhdHVzX3QgUGFyY2VsOjp3cml0ZUludGVyZmFjZVRva2VuKGNvbnN0IFN0cmluZzE2JiBpbnRlcmZhY2UpCit7CisgICAgLy8gY3VycmVudGx5IHRoZSBpbnRlcmZhY2UgaWRlbnRpZmljYXRpb24gdG9rZW4gaXMganVzdCBpdHMgbmFtZSBhcyBhIHN0cmluZworICAgIHJldHVybiB3cml0ZVN0cmluZzE2KGludGVyZmFjZSk7Cit9CisKK2Jvb2wgUGFyY2VsOjpjaGVja0ludGVyZmFjZShJQmluZGVyKiBiaW5kZXIpIGNvbnN0Cit7CisgICAgcmV0dXJuIGVuZm9yY2VJbnRlcmZhY2UoYmluZGVyLT5nZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOyAKK30KKworYm9vbCBQYXJjZWw6OmVuZm9yY2VJbnRlcmZhY2UoY29uc3QgU3RyaW5nMTYmIGludGVyZmFjZSkgY29uc3QKK3sKKyAgICBjb25zdCBTdHJpbmcxNiBzdHIocmVhZFN0cmluZzE2KCkpOworICAgIGlmIChzdHIgPT0gaW50ZXJmYWNlKSB7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0gZWxzZSB7CisgICAgICAgIExPR1coIioqKiogZW5mb3JjZUludGVyZmFjZSgpIGV4cGVjdGVkICclcycgYnV0IHJlYWQgJyVzJ1xuIiwKKyAgICAgICAgICAgICAgICBTdHJpbmc4KGludGVyZmFjZSkuc3RyaW5nKCksIFN0cmluZzgoc3RyKS5zdHJpbmcoKSk7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9Cit9IAorCitjb25zdCBzaXplX3QqIFBhcmNlbDo6b2JqZWN0cygpIGNvbnN0Cit7CisgICAgcmV0dXJuIG1PYmplY3RzOworfQorCitzaXplX3QgUGFyY2VsOjpvYmplY3RzQ291bnQoKSBjb25zdAoreworICAgIHJldHVybiBtT2JqZWN0c1NpemU7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6Z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sZW4pOworICAgIH0KKworICAgIHN0YXR1c190IGVyciA9IGdyb3dEYXRhKGxlbik7CisgICAgaWYgKGVyciA9PSBOT19FUlJPUikgZ290byByZXN0YXJ0X3dyaXRlOworICAgIHJldHVybiBlcnI7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6d3JpdGUoY29uc3Qgdm9pZCogZGF0YSwgc2l6ZV90IGxlbikKK3sKKyAgICB2b2lkKiBjb25zdCBkID0gd3JpdGVJbnBsYWNlKGxlbik7CisgICAgaWYgKGQpIHsKKyAgICAgICAgbWVtY3B5KGQsIGRhdGEsIGxlbik7CisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9CisgICAgcmV0dXJuIG1FcnJvcjsKK30KKwordm9pZCogUGFyY2VsOjp3cml0ZUlucGxhY2Uoc2l6ZV90IGxlbikKK3sKKyAgICBjb25zdCBzaXplX3QgcGFkZGVkID0gUEFEX1NJWkUobGVuKTsKKworICAgIC8vIHNhbml0eSBjaGVjayBmb3IgaW50ZWdlciBvdmVyZmxvdworICAgIGlmIChtRGF0YVBvcytwYWRkZWQgPCBtRGF0YVBvcykgeworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBpZiAoKG1EYXRhUG9zK3BhZGRlZCkgPD0gbURhdGFDYXBhY2l0eSkgeworcmVzdGFydF93cml0ZToKKyAgICAgICAgLy9wcmludGYoIldyaXRpbmcgJWxkIGJ5dGVzLCBwYWRkZWQgdG8gJWxkXG4iLCBsZW4sIHBhZGRlZCk7CisgICAgICAgIHVpbnQ4X3QqIGNvbnN0IGRhdGEgPSBtRGF0YSttRGF0YVBvczsKKworICAgICAgICAvLyBOZWVkIHRvIHBhZCBhdCBlbmQ/CisgICAgICAgIGlmIChwYWRkZWQgIT0gbGVuKSB7CisjaWYgQllURV9PUkRFUiA9PSBCSUdfRU5ESUFOCisgICAgICAgICAgICBzdGF0aWMgY29uc3QgdWludDMyX3QgbWFza1s0XSA9IHsKKyAgICAgICAgICAgICAgICAweDAwMDAwMDAwLCAweGZmZmZmZjAwLCAweGZmZmYwMDAwLCAweGZmMDAwMDAwCisgICAgICAgICAgICB9OworI2VuZGlmCisjaWYgQllURV9PUkRFUiA9PSBMSVRUTEVfRU5ESUFOCisgICAgICAgICAgICBzdGF0aWMgY29uc3QgdWludDMyX3QgbWFza1s0XSA9IHsKKyAgICAgICAgICAgICAgICAweDAwMDAwMDAwLCAweDAwZmZmZmZmLCAweDAwMDBmZmZmLCAweDAwMDAwMGZmCisgICAgICAgICAgICB9OworI2VuZGlmCisgICAgICAgICAgICAvL3ByaW50ZigiQXBwbHlpbmcgcGFkIG1hc2s6ICVwIHRvICVwXG4iLCAodm9pZCopbWFza1twYWRkZWQtbGVuXSwKKyAgICAgICAgICAgIC8vICAgICpyZWludGVycHJldF9jYXN0PHZvaWQqKj4oZGF0YStwYWRkZWQtNCkpOworICAgICAgICAgICAgKnJlaW50ZXJwcmV0X2Nhc3Q8dWludDMyX3QqPihkYXRhK3BhZGRlZC00KSAmPSBtYXNrW3BhZGRlZC1sZW5dOworICAgICAgICB9CisKKyAgICAgICAgZmluaXNoV3JpdGUocGFkZGVkKTsKKyAgICAgICAgcmV0dXJuIGRhdGE7CisgICAgfQorCisgICAgc3RhdHVzX3QgZXJyID0gZ3Jvd0RhdGEocGFkZGVkKTsKKyAgICBpZiAoZXJyID09IE5PX0VSUk9SKSBnb3RvIHJlc3RhcnRfd3JpdGU7CisgICAgcmV0dXJuIE5VTEw7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6d3JpdGVJbnQzMihpbnQzMl90IHZhbCkKK3sKKyAgICByZXR1cm4gd3JpdGVBbGlnbmVkKHZhbCk7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6d3JpdGVJbnQ2NChpbnQ2NF90IHZhbCkKK3sKKyAgICByZXR1cm4gd3JpdGVBbGlnbmVkKHZhbCk7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6d3JpdGVGbG9hdChmbG9hdCB2YWwpCit7CisgICA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ICAgIHVpbnQ4X3QqIGRhdGEgPSAodWludDhfdCopd3JpdGVJbnBsYWNlKGxlbitzaXplb2YoY2hhcjE2X3QpKTsKKyAgICAgICAgaWYgKGRhdGEpIHsKKyAgICAgICAgICAgIG1lbWNweShkYXRhLCBzdHIsIGxlbik7CisgICAgICAgICAgICAqcmVpbnRlcnByZXRfY2FzdDxjaGFyMTZfdCo+KGRhdGErbGVuKSA9IDA7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0KKyAgICAgICAgZXJyID0gbUVycm9yOworICAgIH0KKyAgICByZXR1cm4gZXJyOworfQorCitzdGF0dXNfdCBQYXJjZWw6OndyaXRlU3Ryb25nQmluZGVyKGNvbnN0IHNwPElCaW5kZXI+JiB2YWwpCit7CisgICAgcmV0dXJuIGZsYXR0ZW5fYmluZGVyKFByb2Nlc3NTdGF0ZTo6c2VsZigpLCB2YWwsIHRoaXMpOworfQorCitzdGF0dXNfdCBQYXJjZWw6OndyaXRlV2Vha0JpbmRlcihjb25zdCB3cDxJQmluZGVyPiYgdmFsKQoreworICAgIHJldHVybiBmbGF0dGVuX2JpbmRlcihQcm9jZXNzU3RhdGU6OnNlbGYoKSwgdmFsLCB0aGlzKTsKK30KKworc3RhdHVzX3QgUGFyY2VsOjp3cml0ZU5hdGl2ZUhhbmRsZShjb25zdCBuYXRpdmVfaGFuZGxlKiBoYW5kbGUpCit7CisgICAgaWYgKCFoYW5kbGUgfHwgaGFuZGxlLT52ZXJzaW9uICE9IHNpemVvZihuYXRpdmVfaGFuZGxlKSkKKyAgICAgICAgcmV0dXJuIEJBRF9UWVBFOworCisgICAgc3RhdHVzX3QgZXJyOworICAgIGVyciA9IHdyaXRlSW50MzIoaGFuZGxlLT5udW1GZHMpOworICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIHJldHVybiBlcnI7CisKKyAgICBlcnIgPSB3cml0ZUludDMyKGhhbmRsZS0+bnVtSW50cyk7CisgICAgaWYgKGVyciAhPSBOT19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cm4gd3JpdGVPYmplY3Qob2JqLCB0cnVlKTsKK30KKworc3RhdHVzX3QgUGFyY2VsOjp3cml0ZU9iamVjdChjb25zdCBmbGF0X2JpbmRlcl9vYmplY3QmIHZhbCwgYm9vbCBudWxsTWV0YURhdGEpCit7CisgICAgY29uc3QgYm9vbCBlbm91Z2hEYXRhID0gKG1EYXRhUG9zK3NpemVvZih2YWwpKSA8PSBtRGF0YUNhcGFjaXR5OworICAgIGNvbnN0IGJvb2wgZW5vdWdoT2JqZWN0cyA9IG1PYmplY3RzU2l6ZSA8IG1PYmplY3RzQ2FwYWNpdHk7CisgICAgaWYgKGVub3VnaERhdGEgJiYgZW5vdWdoT2JqZWN0cykgeworcmVzdGFydF93cml0ZToKKyAgICAgICAgKnJlaW50ZXJwcmV0X2Nhc3Q8ZmxhdF9iaW5kZXJfb2JqZWN0Kj4obURhdGErbURhdGFQb3MpID0gdmFsOworICAgICAgICAKKyAgICAgICAgLy8gTmVlZCB0byB3cml0ZSBtZXRhLWRhdGE/CisgICAgICAgIGlmIChudWxsTWV0YURhdGEgfHwgdmFsLmJpbmRlciAhPSBOVUxMKSB7CisgICAgICAgICAgICBtT2JqZWN0c1ttT2JqZWN0c1NpemVdID0gbURhdGFQb3M7CisgICAgICAgICAgICBhY3F1aXJlX29iamVjdChQcm9jZXNzU3RhdGU6OnNlbGYoKSwgdmFsLCB0aGlzKTsKKyAgICAgICAgICAgIG1PYmplY3RzU2l6ZSsrOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyByZW1lbWJlciBpZiBpdCdzIGEgZmlsZSBkZXNjcmlwdG9yCisgICAgICAgIGlmICh2YWwudHlwZSA9PSBCSU5ERVJfVFlQRV9GRCkgeworICAgICAgICAgICAgbUhhc0ZkcyA9IG1GZHNLbm93biA9IHRydWU7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZmluaXNoV3JpdGUoc2l6ZW9mKGZsYXRfYmluZGVyX29iamVjdCkpOworICAgIH0KKworICAgIGlmICghZW5vdWdoRGF0YSkgeworICAgICAgICBjb25zdCBzdGF0dXNfdCBlcnIgPSBncm93RGF0YShzaXplb2YodmFsKSk7CisgICAgICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIHJldHVybiBlcnI7CisgICAgfQorICAgIGlmICghZW5vdWdoT2JqZWN0cykgeworICAgICAgICBzaXplX3QgbmV3U2l6ZSA9ICgobU9iamVjdHNTaXplKzIpKjMpLzI7CisgICAgICAgIHNpemVfdCogb2JqZWN0cyA9IChzaXplX3QqKXJlYWxsb2MobU9iamVjdHMsIG5ld1NpemUqc2l6ZW9mKHNpemVfdCkpOworICAgICAgICBpZiAob2JqZWN0cyA9PSBOVUxMKSByZXR1cm4gTk9fTUVNT1JZOworICAgICAgICBtT2JqZWN0cyA9IG9iamVjdHM7CisgICAgICAgIG1PYmplY3RzQ2FwYWNpdHkgPSBuZXdTaXplOworICAgIH0KKyAgICAKKyAgICBnb3RvIHJlc3RhcnRfd3JpdGU7Cit9CisKKwordm9pZCBQYXJjZWw6OnJlbW92ZShzaXplX3Qgc3RhcnQsIHNpemVfdCBhbXQpCit7CisgICAgTE9HX0FMV0FZU19GQVRBTCgiUGFyY2VsOjpyZW1vdmUoKSBub3QgeWV0IGltcGxlbWVudGVkISIpOworfQorCitzdGF0dXNfdCBQYXJjZWw6OnJlYWQodm9pZCogb3V0RGF0YSwgc2l6ZV90IGxlbikgY29uc3QKK3sKKyAgICBpZiAoKG1EYXRhUG9zK1BBRF9TSVpFKGxlbikpID49IG1EYXRhUG9zICYmIChtRGF0YVBvcytQQURfU0laRShsZW4pKSA8PSBtRGF0YVNpemUpIHsKKyAgICAgICAgbWVtY3B5KG91dERhdGEsIG1EYXRhK21EYXRhUG9zLCBsZW4pOworICAgICAgICBtRGF0YVBvcyArPSBQQURfU0laRShsZW4pOworICAgICAgICBMT0dWKCJyZWFkIFNldHRpbmcgZGF0YSBwb3Mgb2YgJXAgdG8gJWRcbiIsIHRoaXMsIG1EYXRhUG9zKTsKKy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orVCBQYXJjZWw6OnJlYWRBbGlnbmVkKCkgY29uc3QgeworICAgIFQgcmVzdWx0OworICAgIGlmIChyZWFkQWxpZ25lZCgmcmVzdWx0KSAhPSBOT19FUlJPUikgeworICAgICAgICByZXN1bHQgPSAwOworICAgIH0KKworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK3RlbXBsYXRlPGNsYXNzIFQ+CitzdGF0dXNfdCBQYXJjZWw6OndyaXRlQWxpZ25lZChUIHZhbCkgeworICAgIENPTVBJTEVfVElNRV9BU1NFUlRfRlVOQ1RJT05fU0NPUEUoUEFEX1NJWkUoc2l6ZW9mKFQpKSA9PSBzaXplb2YoVCkpOworCisgICAgaWYgKChtRGF0YVBvcytzaXplb2YodmFsKSkgPD0gbURhdGFDYXBhY2l0eSkgeworcmVzdGFydF93cml0ZToKKyAgICAgICAgKnJlaW50ZXJwcmV0X2Nhc3Q8VCo+KG1EYXRhK21EYXRhUG9zKSA9IHZhbDsKKyAgICAgICAgcmV0dXJuIGZpbmlzaFdyaXRlKHNpemVvZih2YWwpKTsKKyAgICB9CisKKyAgICBzdGF0dXNfdCBlcnIgPSBncm93RGF0YShzaXplb2YodmFsKSk7CisgICAgaWYgKGVyciA9PSBOT19FUlJPUikgZ290byByZXN0YXJ0X3dyaXRlOworICAgIHJldHVybiBlcnI7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6cmVhZEludDMyKGludDMyX3QgKnBBcmcpIGNvbnN0Cit7CisgICAgcmV0dXJuIHJlYWRBbGlnbmVkKHBBcmcpOworfQorCitpbnQzMl90IFBhcmNlbDo6cmVhZEludDMyKCkgY29uc3QKK3sKKyAgICByZXR1cm4gcmVhZEFsaWduZWQ8aW50MzJfdD4oKTsKK30KKworCitzdGF0dXNfdCBQYXJjZWw6OnJlYWRJbnQ2NChpbnQ2NF90ICpwQXJnKSBjb25zdAoreworICAgIHJldHVybiByZWFkQWxpZ25lZChwQXJnKTsKK30KKworCitpbnQ2NF90IFBhcmNlbDo6cmVhZElud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aGFyKiBlb3MgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGNoYXIqPihtZW1jaHIoc3RyLCAwLCBhdmFpbCkpOworICAgICAgICBpZiAoZW9zKSB7CisgICAgICAgICAgICBjb25zdCBzaXplX3QgbGVuID0gZW9zIC0gc3RyOworICAgICAgICAgICAgbURhdGFQb3MgKz0gUEFEX1NJWkUobGVuKzEpOworICAgICAgICAgICAgTE9HVigicmVhZENTdHJpbmcgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOworICAgICAgICAgICAgcmV0dXJuIHN0cjsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKworU3RyaW5nOCBQYXJjZWw6OnJlYWRTdHJpbmc4KCkgY29uc3QKK3sKKyAgICBpbnQzMl90IHNpemUgPSByZWFkSW50MzIoKTsKKyAgICAvLyB3YXRjaCBmb3IgcG90ZW50aWFsIGludCBvdmVyZmxvdyBhZGRpbmcgMSBmb3IgdHJhaWxpbmcgTlVMCisgICAgaWYgKHNpemUgPiAwICYmIHNpemUgPCBJTlQzMl9NQVgpIHsKKyAgICAgICAgY29uc3QgY2hhciogc3RyID0gKGNvbnN0IGNoYXIqKXJlYWRJbnBsYWNlKHNpemUrMSk7CisgICAgICAgIGlmIChzdHIpIHJldHVybiBTdHJpbmc4KHN0ciwgc2l6ZSk7CisgICAgfQorICAgIHJldHVybiBTdHJpbmc4KCk7Cit9CisKK1N0cmluZzE2IFBhcmNlbDo6cmVhZFN0cmluZzE2KCkgY29uc3QKK3sKKyAgICBzaXplX3QgbGVuOworICAgIGNvbnN0IGNoYXIxNl90KiBzdHIgPSByZWFkU3RyaW5nMTZJbnBsYWNlKCZsZW4pOworICAgIGlmIChzdHIpIHJldHVybiBTdHJpbmcxNihzdHIsIGxlbik7CisgICAgTE9HRSgiUmVhZGluZyBhIE5VTEwgc3RyaW5nIG5vdCBzdXBwb3J0ZWQgaGVyZS4iKTsKKyAgICByZXR1cm4gU3RyaW5nMTYoKTsKK30KKworY29uc3QgY2hhcjE2X3QqIFBhcmNlbDo6cmVhZFN0cmluZzE2SW5wbGFjZShzaXplX3QqIG91dExlbikgY29uc3QKK3sKKyAgICBpbnQzMl90IHNpemUgPSByZWFkSW50MzIoKTsKKyAgICAvLyB3YXRjaCBmb3IgcG90ZW50aWFsIGludCBvdmVyZmxvdyBmcm9tIHNpemUrMQorICAgIGlmIChzaXplID49IDAgJiYgc2l6ZSA8IElOVDMyX01BWCkgeworICAgICAgICAqb3V0TGVuID0gc2l6ZTsKKyAgICAgICAgY29uc3QgY2hhcjE2X3QqIHN0ciA9IChjb25zdCBjaGFyMTZfdCopcmVhZElucGxhY2UoKHNpemUrMSkqc2l6ZW9mKGNoYXIxNl90KSk7CisgICAgICAgIGlmIChzdHIgIT0gTlVMTCkgeworICAgICAgICAgICAgcmV0dXJuIHN0cjsKKyAgICAgICAgfQorICAgIH0KKyAgICAqb3V0TGVuID0gMDsKKyAgICByZXR1cm4gTlVMTDsKK30KKworc3A8SUJpbmRlcj4gUGFyY2VsOjpyZWFkU3Ryb25nQmluZGVyKCkgY29uc3QKK3sKKyAgICBzcDxJQmluZGVyPiB2YWw7CisgICAgdW5mbGF0dGVuX2JpbmRlcihQcm9jZXNzU3RhdGU6OnNlbGYoKSwgKnRoaXMsICZ2YWwpOworICAgIHJldHVybiB2YWw7Cit9CisKK3dwPElCaW5kZXI+IFBhcmNlbDo6cmVhZFdlYWtCaW5kZXIoKSBjb25zdAoreworICAgIHdwPElCaW5kZXI+IHZhbDsKKyAgICB1bmZsYXR0ZW5fYmluZGVyKFByb2Nlc3NTdGF0ZTo6c2VsZigpLCAqdGhpcywgJnZhbCk7CisgICAgcmV0dXJuIHZhbDsKK30KKworCituYXRpdmVfaGFuZGxlKiBQYXJjZWw6OnJlYWROYXRpdmVIYW5kbGUoKSBjb25zdAoreworICAgIGludCBudW1GZHMsIG51bUludHM7CisgICAgc3RhdHVzX3QgZXJyOworICAgIGVyciA9IHJlYWRJbnQzMigmbnVtRmRzKTsKKyAgICBpZiAoZXJyICE9IE5PX0VSUk9SKSByZXR1cm4gMDsKKyAgICBlcnIgPSByZWFkSW50MzIoJm51bUludHMpOworICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIHJldHVybiAwOworCisgICAgbmF0aXZlX2hhbmRsZSogaCA9IG5hdGl2ZV9oYW5kbGVfY3JlYXRlKG51bUZkcywgbnVtSW50cyk7CisgICAgZm9yIChpbnQgaT0wIDsgZXJyPT1OT19FUlJPUiAmJiBpPG51bUZkcyA7IGkrKykgeworICAgICAgICBoLT5kYXRhW2ldID0gZHVwKHJlYWRGaWxlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgaWYgKGgtPmRhdGFbaV0gPCAwKSBlcnIgPSBCQURfVkFMVUU7CisgICAgfQorICAgIGVyciA9IHJlYWQoaC0+ZGF0YSArIG51bUZkcywgc2l6ZW9mKGludCkqbnVtSW50cyk7CisgICAgaWYgKGVyciAhPSBOT19FUlJPUikgeworICAgICAgICBuYXRpdmVfaGFuZGxlX2Nsb3NlKGgpOworICAgICAgICBuYXRpdmVfaGFuZGxlX2RlbGV0ZShoKTsKKyAgICAgICAgaCA9IDA7CisgICAgfQorICAgIHJldHVybiBoOworfQorCisKK2ludCBQYXJjZWw6OnJlYWRGaWxlRGVzY3JpcHRvcigpIGNvbnN0Cit7CisgICAgY29uc3QgZmxhdF9iaW5kZXJfb2JqZWN0KiBmbGF0ID0gcmVhZE9iamVjdCh0cnVlKTsKKyAgICBpZiAoZmxhdCkgeworICAgICAgICBzd2l0Y2ggKGZsYXQtPnR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgQklOREVSX1RZUEVfRkQ6CisgICAgICAgICAgICAgICAgLy9MT0dJKCJSZXR1cm5pbmcgZmlsZSBkZXNjcmlwdG9yICVsZCBmcm9tIHBhcmNlbCAlcFxuIiwgZmxhdC0+aGFuZGxlLCB0aGlzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmxhdC0+aGFuZGxlOworICAgICAgICB9ICAgICAgICAKKyAgICB9CisgICAgcmV0dXJuIEJBRF9UWVBFOworfQorCitjb25zdCBmbGF0X2JpbmRlcl9vYmplY3QqIFBhcmNlbDo6cmVhZE9iamVjdChib29sIG51bGxNZXRhRGF0YSkgY29uc3QKK3sKKyAgICBjb25zdCBzaXplX3QgRFBPUyA9IG1EYXRhUG9zOworICAgIGlmICgoRFBPUytzaXplb2YoZmxhdF9iaW5kZXJfb2JqZWN0KSkgPD0gbURhdGFTaXplKSB7CisgICAgICAgIGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCogb2JqCisgICAgICAgICAgICAgICAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCo+KG1EYXRhK0RQT1MpOworICAgICAgICBtRGF0YVBvcyA9IERQT1MgKyBzaXplb2YoZmxhdF9iaW5kZXJfb2JqZWN0KTsKKyAgICAgICAgaWYgKCFudWxsTWV0YURhdGEgJiYgKG9iai0+Y29va2llID09IE5VTEwgJiYgb2JqLT5iaW5kZXIgPT0gTlVMTCkpIHsKKyAgICAgICAgICAgIC8vIFdoZW4gdHJhbnNmZXJyaW5nIGEgTlVMTCBvYmplY3QsIHdlIGRvbid0IHdyaXRlIGl0IGludG8KKyAgICAgICAgICAgIC8vIHRoZSBvYmplY3QgbGlzdCwgc28gd2UgZG9uJ3Qgd2FudCB0byBjaGVjayBmb3IgaXQgd2hlbgorICAgICAgICAgICAgLy8gcmVhZGluZy4KKyAgICAgICAgICAgIExPR1YoInJlYWRPYmplY3QgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOworICAgICAgICAgICAgcmV0dXJuIG9iajsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gRW5zdXJlIHRoYXQgdGhpcyBvYmplY3QgaXMgdmFsaWQuLi4KKyAgICAgICAgc2l6ZV90KiBjb25zdCBPQkpTID0gbU9iamVjdHM7CisgICAgICAgIGNvbnN0IHNpemVfdCBOID0gbU9iamVjdHNTaXplOworICAgICAgICBzaXplX3Qgb3BvcyA9IG1OZXh0T2JqZWN0SGludDsKKyAgICAgICAgCisgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgTE9HVigiUGFyY2VsICVwIGxvb2tpbmcgZm9yIG9iaiBhdCAlZCwgaGludD0lZFxuIiwKKyAgICAgICAgICAgICAgICAgdGhpcywgRFBPUywgb3Bvcyk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIFN0YXJ0IGF0IHRoZSBjdXJyZW50IGhpbnQgcG9zaXRpb24sIGxvb2tpbmcgZm9yIGFuIG9iamVjdCBhdAorICAgICAgICAgICAgLy8gdGhlIGN1cnJlbnQgZGF0YSBwb3NpdGlvbi4KKyAgICAgICAgICAgIGlmIChvcG9zIDwgTikgeworICAgICAgICAgICAgICAgIHdoaWxlIChvcG9zIDwgKE4tMSkgJiYgT0JKU1tvcG9zXSA8IERQT1MpIHsKKyAgICAgICAgICAgICAgICAgICAgb3BvcysrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgb3BvcyA9IE4tMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChPQkpTW29wb3NdID09IERQT1MpIHsKKyAgICAgICAgICAgICAgICAvLyBGb3VuZCBpdCEKKyAgICAgICAgICAgICAgICBMT0dWKCJQYXJjZWwgZm91bmQgb2JqICVkIGF0IGluZGV4ICVkIHdpdGggZm9yd2FyZCBzZWFyY2giLAorICAgICAgICAgICAgICAgICAgICAgdGhpcywgRFBPUywgb3Bvcyk7CisgICAgICAgICAgICAgICAgbU5leHRPYmplY3RIaW50ID0gb3BvcysxOworICAgICAgICAgICAgICAgIExPR1YoInJlYWRPYmplY3QgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOworICAgICAgICAgICAgICAgIHJldHVybiBvYmo7CisgICAgICAgICAgICB9CisgICAgICAgIAorICAgICAgICAgICAgLy8gTG9vayBiYWNrd2FyZHMgZm9yIGl0Li4uCisgICAgICAgICAgICB3aGlsZSAob3BvcyA+IDAgJiYgT0JKU1tvcG9zXSA+IERQT1MpIHsKKyAgICAgICAgICAgICAgICBvcG9zLS07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoT0JKU1tvcG9zXSA9PSBEUE9TKSB7CisgICAgICAgICAgICAgICAgLy8gRm91bmQgaXQhCisgICAgICAgICAgICAgICAgTE9HVigiUGFyY2VsIGZvdW5kIG9iaiAlZCBhdCBpbmRleCAlZCB3aXRoIGJhY2t3YXJkIHNlYXJjaCIsCisgICAgICAgICAgICAgICAgICAgICB0aGlzLCBEUE9TLCBvcG9zKTsKKyAgICAgICAgICAgICAgICBtTmV4dE9iamVjdEhpbnQgPSBvcG9zKzE7CisgICAgICAgICAgICAgICAgTE9HVigicmVhZE9iamVjdCBTZXR0aW5nIGRhdGEgcG9zIG9mICVwIHRvICVkXG4iLCB0aGlzLCBtRGF0YVBvcyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIG9iajsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBMT0dXKCJBdHRlbXB0IHRvIHJlYWQgb2JqZWN0IGZyb20gUGFyY2VsICVwIGF0IG9mZnNldCAlZCB0aGF0IGlzIG5vdCBpbiB0aGUgb2JqZWN0IGxpc3QiLAorICAgICAgICAgICAgIHRoaXMsIERQT1MpOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKwordm9pZCBQYXJjZWw6OmNsb3NlRmlsZURlc2NyaXB0b3JzKCkKK3sKKyAgICBzaXplX3QgaSA9IG1PYmplY3RzU2l6ZTsKKyAgICBpZiAoaSA+IDApIHsKKyAgICAgICAgLy9MT0dJKCJDbG9zaW5nIGZpbGUgZGVzY3JpcHRvcnMgZm9yICVkIG9iamVjdHMuLi4iLCBt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gTk9fRVJST1I7CisgICAgbURhdGEgPSBjb25zdF9jYXN0PHVpbnQ4X3QqPihkYXRhKTsKKyAgICBtRGF0YVNpemUgPSBtRGF0YUNhcGFjaXR5ID0gZGF0YVNpemU7CisgICAgLy9MT0dJKCJzZXREYXRhUmVmZXJlbmNlIFNldHRpbmcgZGF0YSBzaXplIG9mICVwIHRvICVsdSAocGlkPSVkKVxuIiwgdGhpcywgbURhdGFTaXplLCBnZXRwaWQoKSk7CisgICAgbURhdGFQb3MgPSAwOworICAgIExPR1YoInNldERhdGFSZWZlcmVuY2UgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOworICAgIG1PYmplY3RzID0gY29uc3RfY2FzdDxzaXplX3QqPihvYmplY3RzKTsKKyAgICBtT2JqZWN0c1NpemUgPSBtT2JqZWN0c0NhcGFjaXR5ID0gb2JqZWN0c0NvdW50OworICAgIG1OZXh0T2JqZWN0SGludCA9IDA7CisgICAgbU93bmVyID0gcmVsRnVuYzsKKyAgICBtT3duZXJDb29raWUgPSByZWxDb29raWU7CisgICAgc2NhbkZvckZkcygpOworfQorCit2b2lkIFBhcmNlbDo6cHJpbnQoVGV4dE91dHB1dCYgdG8sIHVpbnQzMl90IGZsYWdzKSBjb25zdAoreworICAgIHRvIDw8ICJQYXJjZWwoIjsKKyAgICAKKyAgICBpZiAoZXJyb3JDaGVjaygpICE9IE5PX0VSUk9SKSB7CisgICAgICAgIGNvbnN0IHN0YXR1c190IGVyciA9IGVycm9yQ2hlY2soKTsKKyAgICAgICAgdG8gPDwgIkVycm9yOiAiIDw8ICh2b2lkKillcnIgPDwgIiBcIiIgPDwgc3RyZXJyb3IoLWVycikgPDwgIlwiIjsKKyAgICB9IGVsc2UgaWYgKGRhdGFTaXplKCkgPiAwKSB7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QqIERBVEEgPSBkYXRhKCk7CisgICAgICAgIHRvIDw8IGluZGVudCA8PCBIZXhEdW1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mplY3QqPihkYXRhK29iamVjdHNbaV0pOworICAgICAgICByZWxlYXNlX29iamVjdChwcm9jLCAqZmxhdCwgdGhpcyk7CisgICAgfQorfQorCit2b2lkIFBhcmNlbDo6YWNxdWlyZU9iamVjdHMoKQoreworICAgIGNvbnN0IHNwPFByb2Nlc3NTdGF0ZT4gcHJvYyhQcm9jZXNzU3RhdGU6OnNlbGYoKSk7CisgICAgc2l6ZV90IGkgPSBtT2JqZWN0c1NpemU7CisgICAgdWludDhfdCogY29uc3QgZGF0YSA9IG1EYXRhOworICAgIHNpemVfdCogY29uc3Qgb2JqZWN0cyA9IG1PYmplY3RzOworICAgIHdoaWxlIChpID4gMCkgeworICAgICAgICBpLS07CisgICAgICAgIGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCogZmxhdAorICAgICAgICAgICAgPSByZWludGVycHJldF9jYXN0PGZsYXRfYmluZGVyX29iamVjdCo+KGRhdGErb2JqZWN0c1tpXSk7CisgICAgICAgIGFjcXVpcmVfb2JqZWN0KHByb2MsICpmbGF0LCB0aGlzKTsKKyAgICB9Cit9CisKK3ZvaWQgUGFyY2VsOjpmcmVlRGF0YSgpCit7CisgICAgZnJlZURhdGFOb0luaXQoKTsKKyAgICBpbml0U3RhdGUoKTsKK30KKwordm9pZCBQYXJjZWw6OmZyZWVEYXRhTm9Jbml0KCkKK3sKKyAgICBpZiAobU93bmVyKSB7CisgICAgICAgIC8vTE9HSSgiRnJlZWluZyBkYXRhIHJlZiBvZiAlcCAocGlkPSVkKVxuIiwgdGhpcywgZ2V0cGlkKCkpOworICAgICAgICBtT3duZXIodGhpcywgbURhdGEsIG1EYXRhU2l6ZSwgbU9iamVjdHMsIG1PYmplY3RzU2l6ZSwgbU93bmVyQ29va2llKTsKKyAgICB9IGVsc2UgeworICAgICAgICByZWxlYXNlT2JqZWN0cygpOworICAgICAgICBpZiAobURhdGEpIGZyZWUobURhdGEpOworICAgICAgICBpZiAobU9iamVjdHMpIGZyZWUobU9iamVjdHMpOworICAgIH0KK30KKworc3RhdHVzX3QgUGFyY2VsOjpncm93RGF0YShzaXplX3QgbGVuKQoreworICAgIHNpemVfdCBuZXdTaXplID0gKChtRGF0YVNpemUrbGVuKSozKS8yOworICAgIHJldHVybiAobmV3U2l6ZSA8PSBtRGF0YVNpemUpCisgICAgICAgICAgICA/IChzdGF0dXNfdCkgTk9fTUVNT1JZCisgICAgICAgICAgICA6IGNvbnRpbnVlV3JpdGUobmV3U2l6ZSk7Cit9CisKK3N0YXR1c190IFBhcmNlbDo6cmVzdGFydFdyaXRlKHNpemVfdCBkZXNpcmVkKQoreworICAgIGlmIChtT3duZXIpIHsKKyAgICAgICAgZnJlZURhdGEoKTsKKyAgICAgICAgcmV0dXJuIGNvbnRpbnVlV3JpdGUoZGVzaXJlZCk7CisgICAgfQorICAgIAorICAgIHVpbnQ4X3QqIGRhdGEgPSAodWludDhfdCopcmVhbGxvYyhtRGF0YSwgZGVzaXJlZCk7CisgICAgaWYgKCFkYXRhICYmIGRlc2lyZWQgPiBtRGF0YUNhcGFjaXR5KSB7CisgICAgICAgIG1FcnJvciA9IE5PX01FTU9SWTsKKyAgICAgICAgcmV0dXJuIE5PX01FTU9SWTsKKyAgICB9CisgICAgCisgICAgcmVsZWFzZU9iamVjdHMoKTsKKyAgICAKKyAgICBpZiAoZGF0YSkgeworICAgICAgICBtRGF0YSA9IGRhdGE7CisgICAgICAgIG1EYXRhQ2FwYWNpdHkgPSBkZXNpcmVkOworICAgIH0KKyAgICAKKyAgICBtRGF0YVNpemUgPSBtRGF0YVBvcyA9IDA7CisgICAgTE9HVigicmVzdGFydFdyaXRlIFNldHRpbmcgZGF0YSBzaXplIG9mICVwIHRvICVkXG4iLCB0aGlzLCBtRGF0YVNpemUpOworICAgIExPR1YoInJlc3RhcnRXcml0ZSBTZXR0aW5nIGRhdGEgcG9zIG9mICVwIHRvICVkXG4iLCB0aGlzLCBtRGF0YVBvcyk7CisgICAgICAgIAorICAgIGZyZWUobU9iamVjdHMpOworICAgIG1PYmplY3RzID0gTlVMTDsKKyAgICBtT2JqZWN0c1NpemUgPSBtT2JqZWN0c0NhcGFjaXR5ID0gMDsKKyAgICBtTmV4dE9iamVjdEhpbnQgPSAwOworICAgIG1IYXNGZHMgPSBmYWxzZTsKKyAgICBtRmRzS25vd24gPSB0cnVlOworICAgIAorICAgIHJldHVybiBOT19FUlJPUjsKK30KKworc3RhdHVzX3QgUGFyY2VsOjpjb250aW51ZVdyaXRlKHNpemVfdCBkZXNpcmVkKQoreworICAgIC8vIElmIHNocmlua2luZywgZmlyc3QgYWRqdXN0IGZvciBhbnkgb2JqZWN0cyB0aGF0IGFwcGVhcgorICAgIC8vIGFmdGVyIHRoZSBuZXcgZGF0YSBzaXplLgorICAgIHNpemVfdCBvYmplY3RzU2l6ZSA9IG1PYmplY3RzU2l6ZTsKKyAgICBpZiAoZGVzaXJlZCA8IG1EYXRhU2l6ZSkgeworICAgICAgICBpZiAoZGVzaXJlZCA9PSAwKSB7CisgICAgICAgICAgICBvYmplY3RzU2l6ZSA9IDA7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB3aGlsZSAob2JqZWN0c1NpemUgPiAwKSB7CisgICAgICAgICAgICAgICAgaWYgKG1PYmplY3RzW29iamVjdHNTaXplLTFdIDwgZGVzaXJlZCkKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgb2JqZWN0c1NpemUtLTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBpZiAobU93bmVyKSB7CisgICAgICAgIC8vIElmIHRoZSBzaXplIGlzIGdvaW5nIHRvIHplcm8sIGp1c3QgcmVsZWFzZSB0aGUgb3duZXIncyBkYXRhLgorICAgICAgICBpZiAoZGVzaXJlZCA9PSAwKSB7CisgICAgICAgICAgICBmcmVlRGF0YSgpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgLy8gSWYgdGhlcmUgaXMgYSBkaWZmZXJlbnQgb3duZXIsIHdlIG5lZWQgdG8gdGFrZQorICAgICAgICAvLyBwb3Nlc3Npb24uCisgICAgICAgIHVpbnQ4X3QqIGRhdGEgPSAodWludDhfdCopbWFsbG9jKGRlc2lyZWQpOworICAgICAgICBpZiAoIWRhdGEpIHsKKyAgICAgICAgICAgIG1FcnJvciA9IE5PX01FTU9SWTsKKyAgICAgICAgICAgIHJldHVybiBOT19NRU1PUlk7CisgICAgICAgIH0KKyAgICAgICAgc2l6ZV90KiBvYmplY3RzID0gTlVMTDsKKyAgICAgICAgCisgICAgICAgIGlmIChvYmplY3RzU2l6ZSkgeworICAgICAgICAgICAgb2JqZWN0cyA9IChzaXplX3QqKW1hbGxvYyhvYmplY3RzU2l6ZSpzaXplb2Yoc2l6ZV90KSk7CisgICAgICAgICAgICBpZiAoIW9iamVjdHMpIHsKKyAgICAgICAgICAgICAgICBtRXJyb3IgPSBOT19NRU1PUlk7CisgICAgICAgICAgICAgICAgcmV0dXJuIE5PX01FTU9SWTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gTGl0dGxlIGhhY2sgdG8gb25seSBhY3F1aXJlIHJlZmVyZW5jZXMgb24gb2JqZWN0cworICAgICAgICAgICAgLy8gd2Ugd2lsbCBiZSBrZWVwaW5nLgorICAgICAgICAgICAgc2l6ZV90IG9sZE9iamVjdHNTaXplID0gbU9iamVjdHNTaXplOworICAgICAgICAgICAgbU9iamVjdHNTaXplID0gb2JqZWN0c1NpemU7CisgICAgICAgICAgICBhY3F1aXJlT2JqZWN0cygpOworICAgICAgICAgICAgbU9iamVjdHNTaXplID0gb2xkT2JqZWN0c1NpemU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtRGF0YSkgeworICAgICAgICAgICAgbWVtY3B5KGRhdGEsIG1EYXRhLCBtRGF0YVNpemUgPCBkZXNpcmVkID8gbURhdGFTaXplIDogZGVzaXJlZCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG9iamVjdHMgJiYgbU9iamVjdHMpIHsKKyAgICAgICAgICAgIG1lbWNweShvYmplY3RzLCBtT2JqZWN0cywgb2JqZWN0c1NpemUqc2l6ZW9mKHNpemVfdCkpOworICAgICAgICB9CisgICAgICAgIC8vTE9HSSgiRnJlZWluZyBkYXRhIHJlZiBvZiAlcCAocGlkPSVkKVxuIiwgdGhpcywgZ2V0cGlkKCkpOworICAgICAgICBtT3duZXIodGhpcywgbURhdGEsIG1EYXRhU2l6ZSwgbU9iamVjdHMsIG1PYmplY3RzU2l6ZSwgbU93bmVyQ29va2llKTsKKyAgICAgICAgbU93bmVyID0gTlVMTDsKKworICAgICAgICBtRGF0YSA9IGRhdGE7CisgICAgICAgIG1PYmplY3RzID0gb2JqZWN0czsKKyAgICAgICAgbURhdGFTaXplID0gKG1EYXRhU2l6ZSA8IGRlc2lyZWQpID8gbURhdGFTaXplIDogZGVzaXJlZDsKKyAgICAgICAgTE9HVigiY29udGludWVXcml0ZSBTZXR0aW5nIGRhdGEgc2l6ZSBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFTaXplKTsKKyAgICAgICAgbURhdGFDYXBhY2l0eSA9IGRlc2lyZWQ7CisgICAgICAgIG1PYmplY3RzU2l6ZSA9IG1PYmplY3RzQ2FwYWNpdHkgPSBvYmplY3RzU2l6ZTsKKyAgICAgICAgbU5leHRPYmplY3RIaW50ID0gMDsKKworICAgIH0gZWxzZSBpZiAobURhdGEpIHsKKyAgICAgICAgaWYgKG9iamVjdHNTaXplIDwgbU9iamVjdHNTaXplKSB7CisgICAgICAgICAgICAvLyBOZWVkIHRvIHJlbGVhc2UgcmVmcyBvbiBhbnkgb2JqZWN0cyB3ZSBhcmUgZHJvcHBpbmcuCisgICAgICAgICAgICBjb25zdCBzcDxQcm9jZXNzU3RhdGU+IHByb2MoUHJvY2Vzc1N0YXRlOjpzZWxmKCkpOworICAgICAgICAgICAgZm9yIChzaXplX3QgaT1vYmplY3RzU2l6ZTsgaTxtT2JqZWN0c1NpemU7IGkrKykgeworICAgICAgICAgICAgICAgIGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCogZmxhdAorICAgICAgICAgICAgICAgICAgICA9IHJlaW50ZXJwcmV0X2Nhc3Q8ZmxhdF9iaW5kZXJfb2JqZWN0Kj4obURhdGErbU9iamVjdHNbaV0pOworICAgICAgICAgICAgICAgIGlmIChmbGF0LT50eXBlID09IEJJTkRFUl9UWVBFX0ZEKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHdpbGwgbmVlZCB0byByZXNjYW4gYmVjYXVzZSB3ZSBtYXkgaGF2ZSBsb3BwZWQgb2ZmIHRoZSBvbmx5IEZEcworICAgICAgICAgICAgICAgICAgICBtRmRzS25vd24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVsZWFzZV9vYmplY3QocHJvYywgKmZsYXQsIHRoaXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2l6ZV90KiBvYmplY3RzID0KKyAgICAgICAgICAgICAgICAoc2l6ZV90KilyZWFsbG9jKG1PYmplY3RzLCBvYmplY3RzU2l6ZSpzaXplb2Yoc2l6ZV90KSk7CisgICAgICAgICAgICBpZiAob2JqZWN0cykgeworICAgICAgICAgICAgICAgIG1PYmplY3RzID0gb2JqZWN0czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1PYmplY3RzU2l6ZSA9IG9iamVjdHNTaXplOworICAgICAgICAgICAgbU5leHRPYmplY3RIaW50ID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFdlIG93biB0aGUgZGF0YSwgc28gd2UgY2FuIGp1c3QgZG8gYSByZWFsbG9jKCkuCisgICAgICAgIGlmIChkZXNpcmVkID4gbURhdGFDYXBhY2l0eSkgeworICAgICAgICAgICAgdWludDhfdCogZGF0YSA9ICh1aW50OF90KilyZWFsbG9jKG1EYXRhLCBkZXNpcmVkKTsKKyAgICAgICAgICAgIGlmIChkYXRhKSB7CisgICAgICAgICAgICAgICAgbURhdGEgPSBkYXRhOworICAgICAgICAgICAgICAgIG1EYXRhQ2FwYWNpdHkgPSBkZXNpcmVkOworICAgICAgICAgICAgfSBlbHNlIGlmIChkZXNpcmVkID4gbURhdGFDYXBhY2l0eSkgeworICAgICAgICAgICAgICAgIG1FcnJvciA9IE5PX01FTU9SWTsKKyAgICAgICAgICAgICAgICByZXR1cm4gTk9fTUVNT1JZOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbURhdGFTaXplID0gZGVzaXJlZDsKKyAgICAgICAgICAgIExPR1YoImNvbnRpbnVlV3JpdGUgU2V0dGluZyBkYXRhIHNpemUgb2YgJXAgdG8gJWRcbiIsIHRoaXMsIG1EYXRhU2l6ZSk7CisgICAgICAgICAgICBpZiAobURhdGFQb3MgPiBkZXNpcmVkKSB7CisgICAgICAgICAgICAgICAgbURhdGFQb3MgPSBkZXNpcmVkOworICAgICAgICAgICAgICAgIExPR1YoImNvbnRpbnVlV3JpdGUgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgIH0gZWxzZSB7CisgICAgICAgIC8vIFRoaXMgaXMgdGhlIGZpcnN0IGRhdGEuICBFYXN5IQorICAgICAgICB1aW50OF90KiBkYXRhID0gKHVpbnQ4X3QqKW1hbGxvYyhkZXNpcmVkKTsKKyAgICAgICAgaWYgKCFkYXRhKSB7CisgICAgICAgICAgICBtRXJyb3IgPSBOT19NRU1PUlk7CisgICAgICAgICAgICByZXR1cm4gTk9fTUVNT1JZOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZighKG1EYXRhQ2FwYWNpdHkgPT0gMCAmJiBtT2JqZWN0cyA9PSBOVUxMCisgICAgICAgICAgICAgJiYgbU9iamVjdHNDYXBhY2l0eSA9PSAwKSkgeworICAgICAgICAgICAgTE9HRSgiY29udGludWVXcml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jpiZWNvbWVDb250ZXh0TWFuYWdlcihjb250ZXh0X2NoZWNrX2Z1bmMgY2hlY2tGdW5jLCB2b2lkKiB1c2VyRGF0YSkKK3sKKyAgICBpZiAoIW1NYW5hZ2VzQ29udGV4dHMpIHsKKyAgICAgICAgQXV0b011dGV4IF9sKG1Mb2NrKTsKKyAgICAgICAgbUJpbmRlckNvbnRleHRDaGVja0Z1bmMgPSBjaGVja0Z1bmM7CisgICAgICAgIG1CaW5kZXJDb250ZXh0VXNlckRhdGEgPSB1c2VyRGF0YTsKKyAgICAgICAgaWYgKG1Ecml2ZXJGRCA+PSAwKSB7CisgICAgICAgICAgICBpbnQgZHVtbXkgPSAwOworI2lmIGRlZmluZWQoSEFWRV9BTkRST0lEX09TKQorICAgICAgICAgICAgc3RhdHVzX3QgcmVzdWx0ID0gaW9jdGwobURyaXZlckZELCBCSU5ERVJfU0VUX0NPTlRFWFRfTUdSLCAmZHVtbXkpOworI2Vsc2UKKyAgICAgICAgICAgIHN0YXR1c190IHJlc3VsdCA9IElOVkFMSURfT1BFUkFUSU9OOworI2VuZGlmCisgICAgICAgICAgICBpZiAocmVzdWx0ID09IDApIHsKKyAgICAgICAgICAgICAgICBtTWFuYWdlc0NvbnRleHRzID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdWx0ID09IC0xKSB7CisgICAgICAgICAgICAgICAgbUJpbmRlckNvbnRleHRDaGVja0Z1bmMgPSBOVUxMOworICAgICAgICAgICAgICAgIG1CaW5kZXJDb250ZXh0VXNlckRhdGEgPSBOVUxMOworICAgICAgICAgICAgICAgIExPR0UoIkJpbmRlciBpb2N0bCB0byBiZWNvbWUgY29udGV4dCBtYW5hZ2VyIGZhaWxlZDogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkcml2ZXIsIG91ciBvbmx5IHdvcmxkIG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KTsKKworUnNDb250ZXh0IHJzQ29udGV4dENyZWF0ZShSc0RldmljZSwgdm9pZCAqLCB1aW50MzJfdCB2ZXJzaW9uLCBib29sIHVzZURlcHRoKTsKK3ZvaWQgcnNDb250ZXh0RGVzdHJveShSc0NvbnRleHQpOwordm9pZCByc09iakRlc3Ryb3lPT0IoUnNDb250ZXh0LCB2b2lkICopOworCisjZGVmaW5lIFJTX01BWF9URVhUVVJFIDIKKworZW51bSBSc0RhdGFUeXBlIHsKKyAgICBSU19UWVBFX0ZMT0FULAorICAgIFJTX1RZUEVfVU5TSUdORUQsCisgICAgUlNfVFlQRV9TSUdORUQKK307CisKK2VudW0gUnNEYXRhS2luZCB7CisgICAgUlNfS0lORF9VU0VSLAorICAgIFJTX0tJTkRfUkVELAorICAgIFJTX0tJTkRfR1JFRU4sCisgICAgUlNfS0lORF9CTFVFLAorICAgIFJTX0tJTkRfQUxQSEEsCisgICAgUlNfS0lORF9MVU1JTkFOQ0UsCisgICAgUlNfS0lORF9JTlRFTlNJVFksCisgICAgUlNfS0lORF9YLAorICAgIFJTX0tJTkRfWSwKKyAgICBSU19LSU5EX1osCisgICAgUlNfS0lORF9XLAorICAgIFJTX0tJTkRfUywKKyAgICBSU19LSU5EX1QsCisgICAgUlNfS0lORF9RLAorICAgIFJTX0tJTkRfUiwKKyAgICBSU19LSU5EX05YLAorICAgIFJTX0tJTkRfTlksCisgICAgUlNfS0lORF9OWiwKKyAgICBSU19LSU5EX0lOREVYLAorICAgIFJTX0tJTkRfUE9JTlRfU0laRQorfTsKKworZW51bSBSc0VsZW1lbnRQcmVkZWZpbmVkIHsKKyAgICBSU19FTEVNRU5UX1VTRVJfVTgsCisgICAgUlNfRUxFTUVOVF9VU0VSX0k4LAorICAgIFJTX0VMRU1FTlRfVVNFUl9VMTYsCisgICAgUlNfRUxFTUVOVF9VU0VSX0kxNiwKKyAgICBSU19FTEVNRU5UX1VTRVJfVTMyLAorICAgIFJTX0VMRU1FTlRfVVNFUl9JMzIs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cG9zeCxwb3N5OworICAgIGludCBjOworICAgIGludCBzcmNJZHg7CisgICAgaW50IGRzdElkeDsKKworICAgIGNvdW50ID0gbG9hZEkzMihjb24sIDAsIDEpOworICAgIHRvdWNoID0gbG9hZEkzMihjb24sIDAsIDIpOworICAgIHggPSBsb2FkSTMyKGNvbiwgMCwgMyk7CisgICAgeSA9IGxvYWRJMzIoY29uLCAwLCA0KTsKKworICAgIHJhdGUgPSA0OworICAgIG1heExpZmUgPSAoY291bnQgLyByYXRlKSAtIDE7CisgICAgbGlmZVNoaWZ0ID0gMDsKKyAgICB7CisgICAgICAgIGxpZmUgPSBtYXhMaWZlOworICAgICAgICB3aGlsZSAobGlmZSA+IDI1NSkgeworICAgICAgICAgICAgbGlmZSA9IGxpZmUgPj4gMTsKKyAgICAgICAgICAgIGxpZmVTaGlmdCArKzsKKyAgICAgICAgfQorICAgIH0KKworICAgIGRyYXdSZWN0KGNvbiwgMCwgMjU2LCAwLCA1MTIpOworICAgIGNvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50KGNvbiwgTkFNRURfUGdtRnJhZ1BhcnRzKTsKKworICAgIGlmICh0b3VjaCkgeworICAgICAgICBuZXdQYXJ0ID0gbG9hZEkzMihjb24sIDIsIDApOworICAgICAgICBmb3IgKGN0Mj0wOyBjdDI8cmF0ZTsgY3QyKyspIHsKKyAgICAgICAgICAgIGR4ID0gc2NyaXB0UmFuZChjb24sIDB4MTAwMDApIC0gMHg4MDAwOworICAgICAgICAgICAgZHkgPSBzY3JpcHRSYW5kKGNvbiwgMHgxMDAwMCkgLSAweDgwMDA7CisKKyAgICAgICAgICAgIGlkeCA9IG5ld1BhcnQgKiA1ICsgMTsKKyAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMiwgaWR4LCBkeCk7CisgICAgICAgICAgICBzdG9yZUkzMihjb24sIDIsIGlkeCArIDEsIGR5KTsKKyAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMiwgaWR4ICsgMiwgbWF4TGlmZSk7CisgICAgICAgICAgICBzdG9yZUkzMihjb24sIDIsIGlkeCArIDMsIHggPDwgMTYpOworICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAyLCBpZHggKyA0LCB5IDw8IDE2KTsKKworICAgICAgICAgICAgbmV3UGFydCsrOworICAgICAgICAgICAgaWYgKG5ld1BhcnQgPj0gY291bnQpIHsKKyAgICAgICAgICAgICAgICBuZXdQYXJ0ID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBzdG9yZUkzMihjb24sIDIsIDAsIG5ld1BhcnQpOworICAgIH0KKworICAgIGRyYXdDb3VudCA9IDA7CisgICAgZm9yIChjdD0wOyBjdCA8IGNvdW50OyBjdCsrKSB7CisgICAgICAgIHNyY0lkeCA9IGN0ICogNSArIDE7CisKKyAgICAgICAgZHggPSBsb2FkSTMyKGNvbiwgMiwgc3JjSWR4KTsKKyAgICAgICAgZHkgPSBsb2FkSTMyKGNvbiwgMiwgc3JjSWR4ICsgMSk7CisgICAgICAgIGxpZmUgPSBsb2FkSTMyKGNvbiwgMiwgc3JjSWR4ICsgMik7CisgICAgICAgIHBvc3ggPSBsb2FkSTMyKGNvbiwgMiwgc3JjSWR4ICsgMyk7CisgICAgICAgIHBvc3kgPSBsb2FkSTMyKGNvbiwgMiwgc3JjSWR4ICsgNCk7CisKKyAgICAgICAgaWYgKGxpZmUpIHsKKyAgICAgICAgICAgIGlmIChwb3N5IDwgKDQ4MCA8PCAxNikpIHsKKyAgICAgICAgICAgICAgICBkc3RJZHggPSBkcmF3Q291bnQgKiA5OworICAgICAgICAgICAgICAgIGMgPSAweGZmYWZjZiB8ICgobGlmZSA+PiBsaWZlU2hpZnQpIDw8IDI0KTsKKworICAgICAgICAgICAgICAgIHN0b3JlVTMyKGNvbiwgMSwgZHN0SWR4LCBjKTsKKyAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDEsIHBvc3gpOworICAgICAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMSwgZHN0SWR4ICsgMiwgcG9zeSk7CisKKyAgICAgICAgICAgICAgICBzdG9yZVUzMihjb24sIDEsIGRzdElkeCArIDMsIGMpOworICAgICAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMSwgZHN0SWR4ICsgNCwgcG9zeCArIDB4MTAwMDApOworICAgICAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMSwgZHN0SWR4ICsgNSwgcG9zeSArIGR5ICogNCk7CisKKyAgICAgICAgICAgICAgICBzdG9yZVUzMihjb24sIDEsIGRzdElkeCArIDYsIGMpOworICAgICAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMSwgZHN0SWR4ICsgNywgcG9zeCAtIDB4MTAwMDApOworICAgICAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMSwgZHN0SWR4ICsgOCwgcG9zeSArIGR5ICogNCk7CisgICAgICAgICAgICAgICAgZHJhd0NvdW50ICsrOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAoZHkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGR5ID0gKC1keSkgPj4gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBvc3ggPSBwb3N4ICsgZHg7CisgICAgICAgICAgICBwb3N5ID0gcG9zeSArIGR5OworICAgICAgICAgICAgZHkgPSBkeSArIDB4NDAwOworICAgICAgICAgICAgbGlmZSAtLTsKKworICAgICAgICAgICAgLy9zdG9yZUkzMihjb24sIDIsIHNyY0lkeCwgZHgpOworICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAyLCBzcmNJZHggKyAxLCBkeSk7CisgICAgICAgICAgICBzdG9yZUkzMihjb24sIDIsIHNyY0lkeCArIDIsIGxpZmUpOworICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAyLCBzcmNJZHggKyAzLCBwb3N4KTsKKyAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMiwgc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UQgPSAtMTsKKyAgICB9CisKKyAgICAvKgorICAgIGlmIChmb2N1c0lEICE9IGxhc3RGb2N1c0lEKSB7CisgICAgICAgIGlmIChsYXN0Rm9jdXNJRCA+PSAwKSB7CisgICAgICAgICAgICB1cGxvYWRUb1RleHR1cmUoY29uLCBlbnYtPnRleFtsYXN0Rm9jdXNJRF0sIDEpOworICAgICAgICB9CisgICAgICAgIGlmIChmb2N1c0lEID49IDApIHsKKyAgICAgICAgICAgIHVwbG9hZFRvVGV4dHVyZShjb24sIGVudi0+dGV4W2ZvY3VzSURdLCAwKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAqLworICAgIGxhc3RGb2N1cyA9IGZvY3VzSUQ7CisKKyAgICBpbnQgdHJpYW5nbGVPZmZzZXRzQ291bnQgPSBQb3MtPnRyaWFuZ2xlT2Zmc2V0Q291bnQ7CisKKyAgICBpbnQgaW1nSWQgPSAwOworICAgIGZvciAoaW1nSWQ9MTsgaW1nSWQgPD0gaW1nQ291bnQ7IGltZ0lkKyspIHsKKyAgICAgICAgZmxvYXQgcG9zID0gZm9jdXNQb3MgKyBpbWdJZCArIDAuNGY7CisgICAgICAgIGludCBvZmZzZXQgPSAoaW50KWZsb29yZihwb3MgKiAyLmYpOworICAgICAgICBwb3MgPSBwb3MgLSAwLjc1ZjsKKworICAgICAgICBvZmZzZXQgPSBvZmZzZXQgKyB0cmlhbmdsZU9mZnNldHNDb3VudCAvIDI7CisgICAgICAgIGlmICghKChvZmZzZXQgPCAwKSB8fCAob2Zmc2V0ID49IHRyaWFuZ2xlT2Zmc2V0c0NvdW50KSkpIHsKKyAgICAgICAgICAgIGludCBzdGFydCA9IG9mZnNldCAtMjsKKyAgICAgICAgICAgIGludCBlbmQgPSBvZmZzZXQgKyAyOworCisgICAgICAgICAgICBpZiAoc3RhcnQgPCAwKSB7CisgICAgICAgICAgICAgICAgc3RhcnQgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGVuZCA+PSB0cmlhbmd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ZW50IG9mIG91cgorICAgICAgICAvLyBBY3Rpdml0eQorICAgICAgICBtVmlldyA9IG5ldyBGaWxtVmlldyh0aGlzKTsKKyAgICAgICAgc2V0Q29udGVudFZpZXcobVZpZXcpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uUmVzdW1lKCkgeworICAgICAgICAvLyBJZGVhbGx5IGEgZ2FtZSBzaG91bGQgaW1wbGVtZW50IG9uUmVzdW1lKCkgYW5kIG9uUGF1c2UoKQorICAgICAgICAvLyB0byB0YWtlIGFwcHJvcHJpYXRlIGFjdGlvbiB3aGVuIHRoZSBhY3Rpdml0eSBsb29zZXMgZm9jdXMKKyAgICAgICAgc3VwZXIub25SZXN1bWUoKTsKKyAgICAgICAgbVZpZXcub25SZXN1bWUoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvblBhdXNlKCkgeworICAgICAgICAvLyBJZGVhbGx5IGEgZ2FtZSBzaG91bGQgaW1wbGVtZW50IG9uUmVzdW1lKCkgYW5kIG9uUGF1c2UoKQorICAgICAgICAvLyB0byB0YWtlIGFwcHJvcHJpYXRlIGFjdGlvbiB3aGVuIHRoZSBhY3Rpdml0eSBsb29zZXMgZm9jdXMKKyAgICAgICAgc3VwZXIub25QYXVzZSgpOworICAgICAgICBtVmlldy5vblBhdXNlKCk7CisKKyAgICAgICAgUnVudGltZS5nZXRSdW50aW1lKCkuZXhpdCgwKTsKKyAgICB9CisKKworICAgIHN0YXRpYyB2b2lkIGxvZyhTdHJpbmcgbWVzc2FnZSkgeworICAgICAgICBpZiAoTE9HX0VOQUJMRUQpIHsKKyAgICAgICAgICAgIExvZy52KExPR19UQUcsIG1lc3NhZ2UpOworICAgICAgICB9CisgICAgfQorCisKK30KKwpkaWZmIC0tZ2l0IGEvbGlicy9ycy9qYXZhL0ZpbG0vc3JjL2NvbS9hbmRyb2lkL2ZpbG0vRmlsbVJTLmphdmE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ZS4KKyAqLworCitwYWNrYWdlIGNvbS5hbmRyb2lkLmZpbG07CisKK2ltcG9ydCBqYXZhLmlvLldyaXRlcjsKKworaW1wb3J0IGFuZHJvaWQuY29udGVudC5Db250ZXh0OworaW1wb3J0IGFuZHJvaWQuY29udGVudC5yZXMuUmVzb3VyY2VzOworaW1wb3J0IGFuZHJvaWQuZ3JhcGhpY3MuQml0bWFwOworaW1wb3J0IGFuZHJvaWQudXRpbC5Mb2c7CisKK2ltcG9ydCBhbmRyb2lkLnJlbmRlcnNjcmlwdC4qOworCitwdWJsaWMgY2xhc3MgRmlsbVJTIHsKKyAgICBjbGFzcyBTdHJpcFBvc2l0aW9uIHsKKyAgICAgICAgcHVibGljIGZsb2F0IHRyYW5zbGF0ZTsKKyAgICAgICAgcHVibGljIGZsb2F0IHJvdGF0ZTsKKyAgICAgICAgcHVibGljIGZsb2F0IGZvY3VzOworICAgICAgICBwdWJsaWMgaW50IHRyaWFuZ2xlT2Zmc2V0Q291bnQ7CisgICAgfQorICAgIFN0cmlwUG9zaXRpb24gbVBvcyA9IG5ldyBTdHJpcFBvc2l0aW9uKCk7CisKKworICAgIHByaXZhdGUgZmluYWwgaW50IFNUQVRFX0xBU1RfRk9DVVMgPSAxOworCisgICAgcHVibGljIEZpbG1SUygpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0KFJlbmRlclNjcmlwdCBycywgUmVzb3VyY2VzIHJlcywgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgIG1SUyA9IHJzOworICAgICAgICBtUmVzID0gcmVzOworICAgICAgICBpbml0UlMoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRGaWxtU3RyaXBQb3NpdGlvbihpbnQgeCwgaW50IHkpCisgICAgeworICAgICAgICBpZiAoeCA8IDUwKSB7CisgICAgICAgICAgICB4ID0gNTA7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHggPiAyNzApIHsKKyAgICAgICAgICAgI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gICAgICAgICAgYS5zdWJEYXRhKDAsIDAsIDIsIHNpemUsIGJsYWNrKTsKKyAgICAgICAgICAgICAgICBhLnN1YkRhdGEoc2l6ZS0yLCAwLCAyLCBzaXplLCBibGFjayk7CisgICAgICAgICAgICAgICAgYS5zdWJEYXRhKDAsIDAsIHNpemUsIDIsIGJsYWNrKTsKKyAgICAgICAgICAgICAgICBhLnN1YkRhdGEoMCwgc2l6ZS0yLCBzaXplLCAyLCBibGFjayk7CisgICAgICAgICAgICAgICAgc2l6ZSA+Pj0gMTsKKyAgICAgICAgICAgICAgICBtaXArKzsKKyAgICAgICAgICAgICAgICBhLnNldENvbnN0cmFpbnQoRGltZW5zaW9uLkxPRCwgbWlwKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUltYWdlc1tjdF0udXBsb2FkVG9UZXh0dXJlKDEpOworICAgICAgICAgICAgbUJ1ZmZlcklEc1tjdF0gPSBtSW1hZ2VzW2N0XS5nZXRJRCgpOworICAgICAgICB9CisgICAgICAgIG1BbGxvY0lEcy5kYXRhKG1CdWZmZXJJRHMpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0U3RhdGUoKQorICAgIHsKKyAgICAgICAgbUJ1ZmZlclN0YXRlID0gbmV3IGludFsxMF07CisgICAgICAgIG1BbGxvY1N0YXRlID0gQWxsb2NhdGlvbi5jcmVhdGVTaXplZChtUlMsCisgICAgICAgICAgICBFbGVtZW50LlVTRVJfRkxPQVQsIG1CdWZmZXJTdGF0ZS5sZW5ndGgpOworICAgICAgICBtQnVmZmVyU3RhdGVbU1RBVEVfTEFTVF9GT0NVU10gPSAtMTsKKyAgICAgICAgbUFsbG9jU3RhdGUuZGF0YShtQnVmZmVyU3RhdGUpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0UlMoKSB7CisgICAgICAgIG1GU00gPSBuZXcgRmlsbVN0cmlwTWVzaCgpOworICAgICAgICBtTWVzaCA9IG1GU00uaW5pdChtUlMpOworICAgICA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aXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworCitwYWNrYWdlIGNvbS5hbmRyb2lkLmZpbG07CisKK2ltcG9ydCBqYXZhLmlvLldyaXRlcjsKK2ltcG9ydCBqYXZhLmxhbmcuTWF0aDsKK2ltcG9ydCBhbmRyb2lkLnV0aWwuTG9nOworCitpbXBvcnQgYW5kcm9pZC5yZW5kZXJzY3JpcHQuUmVuZGVyU2NyaXB0OworaW1wb3J0IGFuZHJvaWQucmVuZGVyc2NyaXB0LlNpbXBsZU1lc2g7CisKKworY2xhc3MgRmlsbVN0cmlwTWVzaCB7CisKKyAgICBjbGFzcyBWZXJ0ZXggeworICAgICAgICBmbG9hdCBueDsKKyAgICAgICAgZmxvYXQgbnk7CisgICAgICAgIGZsb2F0IG56OworICAgICAgICBmbG9hdCBzOworICAgICAgICBmbG9hdCB0OworICAgICAgICBmbG9hdCB4OworICAgICAgICBmbG9hdCB5OworICAgICAgICBmbG9hdCB6OworCisgICAgICAgIFZlcnRleCgpIHsKKyAgICAgICAgICAgIG54ID0gMDsKKyAgICAgICAgICAgIG55ID0gMDsKKyAgICAgICAgICAgIG56ID0gMDsKKyAgICAgICAgICAgIHMgPSAwOworICAgICAgICAgICAgdCA9IDA7CisgICAgICAgICAgICB4ID0gMDsKKyAgICAgICAgICAgIHkgPSAwOworICAgICAgICAgICAgeiA9IDA7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHh5eihmbG9hdCBfeCwgZmxvYXQgX3ksIGZsb2F0IF96KSB7CisgICAgICAgICAgICB4ID0gX3g7CisgICAgICAgICAgICB5ID0gX3k7CisgICAgICAgICAgICB6ID0gX3o7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIG54eXooZmxvYXQgX3gsIGZsb2F0IF95LCBmbG9hdCBfeikgeworICAgICAgICAgICAgbnggPSBfeDsKKyAgICAgICAgICAgIG55ID0gX3k7CisgICAgICAgICAgICBueiA9IF96OworICAgICAgICB9CisKKyAgICAgICAgdm9pZCBzdChmbG9hdCBfcywgZmxvYXQgX3QpIHsKKyAgICAgICAgICAgIHMgPSBfczsKKyAgICAgICAgICAgIHQgPSBfdDsKKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgY29tcHV0ZU5vcm0oVmVydGV4IHYxLCBWZXJ0ZXggdjIpIHsKKyAgICAgICAgICAgIGZsb2F0IGR4ID0gdjEueCAtIHYyLng7CisgICAgICAgICAgICBmbG9hdCBkeSA9IHYxLnkgLSB2Mi55OworICAgICAgICAgICAgZmxvYXQgZHogPSB2MS56IC0gdjIuejsKKyAgICAgICAgICAgIGZsb2F0IGxlbiA9IChmbG9hdClqYXZhLmxhbmcuTWF0aC5zcXJ0KGR4KmR4ICsgZHkqZHkgKyBkeipkeik7CisgICAgICAgICAgICBkeCAvPSBsZW47CisgICAgICAgICAgICBkeSAvPSBsZW47CisgICAgICAgICAgICBkeiAvPSBsZW47CisKKyAgICAgICAgICAgIG54ID0gZHggKiBkejsKKyAgICAgICAgICAgIG55ID0gZHkgKiBkejsKKyAgICAgICAgICAgIG56ID0gKGZsb2F0KWphdmEubGFuZy5NYXRoLnNxcnQoZHgqZHggKyBkeSpkeSk7CisKKyAgICAgICAgICAgIGxlbiA9IChmbG9hdClqYXZhLmxhbmcuTWF0aC5zcXJ0KG54Km54ICsgbnkqbnkgKyBueipueik7CisgICAgICAgICAgICBueCAvPSBsZW47CisgICAgICAgICAgICBueSAvPSBsZW47CisgICAgICAgICAgICBueiAvPSBsZW47CisgICAgICAgIH0KKyAgICB9CisKKyAgICBpbnRbXSBtVHJpYW5nbGVPZmZzZXRzOworICAgIGZsb2F0W10gbVRyaWFuZ2xlT2Zmc2V0c1RleDsKKyAgICBpbnQgbVRyaWFuZ2xlT2Zmc2V0c0NvdW50OworCisgICAgU2ltcGxlTWVzaCBpbml0KFJlbmRlclNjcmlwdCBycykKKyAgICB7CisgICAgICAgIGZsb2F0IHZ0eFtdID0gbmV3IGZsb2F0W10geworICAgICAgICAgICAgNjAuNDMx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2YsIC0zNi4xNzMwNDBmLAorICAgICAgICAgICAgMTQxLjEzMTY4NmYsIC01MC40ODY5MTRmLAorICAgICAgICAgICAgMTI1LjE0MTc5NWYsIC02MC42OTk1OTRmLAorICAgICAgICAgICAgMTA2LjkxODExN2YsIC02NS45NzkwODFmLAorICAgICAgICAgICAgODcuOTQ1MjgzZiwgLTY1Ljg5NTI2OWYsCisgICAgICAgICAgICA4MGYsIC02NS44OTUyNjlmLAorICAgICAgICAgICAgNjBmLCAtNjUuODk1MjY5ZiwKKyAgICAgICAgICAgIDQwZiwgLTY1Ljg5NTI2OWYsCisgICAgICAgICAgICAyMGYsIC02NS44OTUyNjlmLAorICAgICAgICAgICAgMGYsIC02NS44OTUyNjlmLAorICAgICAgICAgICAgLTIwZiwgLTY1Ljg5NTI2OWYsCisgICAgICAgICAgICAtNDBmLCAtNjUuODk1MjY5ZiwKKyAgICAgICAgICAgIC02MGYsIC02NS44OTUyNjlmLAorICAgICAgICAgICAgLTgwZiwgLTY1Ljg5NTI2OWYsCisgICAgICAgICAgICAtODcuOTQ1MjgzZiwgLTY1Ljg5NTI2OWYsCisgICAgICAgICAgICAtMTA2LjkxODExN2YsIC02NS45NzkwODFmLAorICAgICAgICAgICAgLTEyNS4xNDE3OTVmLCAtNjAuNjk5NTk0ZiwKKyAgICAgICAgICAgIC0xNDEuMTMxNjg2ZiwgLTUwLjQ4NjkxNGYsCisgICAgICAgICAgICAtMTUzLjU4NTEzN2YsIC0zNi4xNzMwNDBmLAorICAgICAgICAgICAgLTE2MS40ODc2MDBmLCAtMTguOTI0MDg0ZiwKKyAgICAgICAgICAgIC0xNjQuMTk1MjgzZiwgLTAuMTQ1MjY5ZiwKKyAgICAgICAgICAgIC0xNjEuNDg3NjAwZiwgMTguNjMzNTQ1ZiwKKyAgICAgICAgICAgICAtMTUzLjU4NTEzN2YsIDM1Ljg4MjUwMmYsCisgICAgICAgICAgICAgLTE0MS4xMzE2ODZmLCA1MC4xOTYzNzZmLAorICAgICAgICAgICAgIC0xMjUuMTQxNzk1ZiwgNjAuNDA5MDU2ZiwKKyAgICAgICAgICAgICAtMTA2LjkxODExN2YsIDY1LjY4ODU0MmYsCisgICAgICAgICAgICAgLTg3Ljk0NTI4M2YsIDY1LjYwNDczMWYsCisgICAgICAgICAgICAgLTcyLjUwNzMxM2YsIDY1LjUzNjUzNGYsCisgICAgICAgICAgICAgLTU3LjY3ODkyMGYsIDY5LjgzMjM5MGYsCisgICAgICAgICAgICAgLTQ0LjY2ODEzNWYsIDc4LjE0MjMyN2YsCisgICAgICAgICAgICAgLTM0LjUzNDkwOGYsIDg5Ljc4OTM1OGYsCisgICAgICAgICAgICAgLTI4LjEwNDc2N2YsIDEwMy44MjQ2MzFmLAorICAgICAgICAgICAgIC0yNS45MDE1NTdmLCAxMTkuMTA0NzMxZiwKKyAgICAgICAgICAgICAtMjguMTA0NzY3ZiwgMTM0LjM4NDgzMWYsCisgICAgICAgICAgICAgLTM0LjUzNDkwOGYsIDE0OC40MjAxMDRmLAorICAgICAgICAgICAgIC00NC42NjgxMzVmLCAxNjAuMDY3MTM0ZiwKKyAgICAgICAgICAgICAtNTcuNjc4OTIwZiwgMTY4LjM3NzA3MWYsCisgICAgICAgICAgICAgLTcyLjUwNzMxM2YsIDE3Mi42NzI5MjdmLAorICAgICAgICAgICAgIC04Ny45NDUyODNmLCAxNzIuNjA0NzMxZiwKKyAgICAgICAgICAgICAtOTguOTU4OTk0ZiwgMTcyLjQ0MjM2NGYsCisgICAgICAgICAgICAgLTEwOS40ODk1MjNmLCAxNjkuMjExODY2ZiwKKyAgICAgICAgICAgICAtMTE4LjY5OTU4MmYsIDE2My4xNzAwOTZmLAorICAgICAgICAgICAgIC0xMjUuODU2ODcyZiwgMTU0Ljc5NzQzOWYsCisgICAgICAgICAgICAgLTEzMC4zOTIzMTFmLCAxNDQuNzU5NjEzZiwKKyAgICAgICAgICAgICAtMTMxLjk0NTI4M2YsIDEzMy44NTQ3MzFmLAorICAgICAgICAgICAgIC0xMzAuMzkyMzExZiwgMTIyLjk0OTg0OWYsCisgICAgICAgICAgICAgLTEyNS44NTY4NzJmLCAxMTIuOTEyMDIyZiwKKyAgICAgICAgICAgICAtMTE4LjY5OTU4MmYsIDEwNC41MzkzNjZmLAorICAgICAgICAgICAgIC0xMDkuNDg5NTIzZiwgOTguNDk3NTk2ZiwKKyAgICAgICAgICAgICAtOTguOTU4OTk0ZiwgOTUuMjY3MDk4ZiwKKyAgICAgICAgICAgICAtODcuOTQ1MjgzZiwgOTUuMTA0NzMxZiwKKyAgICAgICAgICAgICAtODQuMzcxNzczZiwgOTUuNzcxMDIzZiwKKyAgICAgICAgICAgICAtODAuODk4NTc0ZiwgOTYuODQzNzgxZiwKKyAgICAgICAgICAgICAtNzcuNTcxNzU3ZiwgOTguMzA4Nzc3ZiwKKyAgICAgICAgICAgICAtNzQuNDM1NDUyZiwgMTAwLjE0NjU3N2YsCisgICAgICAgICAgICAgLTcxLjUzMTI1OWYsIDEwMi4zMzI4MDNmLAorICAgICAgICAgICAgIC02OC44OTc3MDNmLCAxMDQuODM4NDU3ZiwKKyAgICAgICAgICAgICAtNjYuNTY5NzE2ZiwgMTA3LjYzMDMwMmYsCisgICAgICAgICAgICAgLTY0LjU3ODE3N2YsIDExMC42NzEzMDRmLAorICAgICAgICAgICAgIC02Mi45NDk1MDVmLCAxMTMuOTIxMTI3ZiwKKyAgICAgICAgICAgICAtNjEuNzA1MzAzZiwgMTE3LjMzNjY2MmYsCisgICAgICAgICAgICAgLTYwLjg2MjA3NGYsIDEyMC44NzI2MDRmLAorICAgICAgICAgICAgIC02MC40MzEwMDNmLCAxMjQuNDgyMDUwZgorICAgICAgICB9OworCisKKyAgICAgICAgbVRyaWFuZ2xlT2Zmc2V0cyA9IG5ldyBpbnRbNjRdOworICAgICAgICBtVHJpYW5nbGVPZmZzZXRzVGV4ID0gbmV3IGZsb2F0WzY0XTsKKworICAgICAgICBtVHJpYW5nbGVPZmZzZXRzWzBdID0gMDsKKyAgICAgICAgbVRyaWFuZ2xlT2Zmc2V0c0NvdW50ID0gMTsKKworICAgICAgICBWZXJ0ZXggdCA9IG5ldyBWZXJ0ZXgoKTsKKyAgICAgICAgdC5ueHl6KDEsIDAsIDApOworICAgICAgICBpbnQgY291bnQgPSB2dHgubGVuZ3RoIC8gMjsKKworICAgICAgICBTaW1wbGVNZXNoLlRyaWFuZ2xlTWVzaEJ1aWxkZXIgdG0gPSBuZXcgU2ltcGxlTWVzaC5UcmlhbmdsZU1lc2hCdWlsZGVyKHJzLCAzLCB0cnVlLCB0cnVlKTsKKworICAgICAgICBmbG9hdCBydW5uaW5nUyA9IDA7CisgICAgICAgIGZvciAoaW50IGN0PTA7IGN0IDwgKGNvdW50LTEpOyBjdCsrKSB7CisgICAgICAgICAgICB0LnggPSAtdnR4W2N0KjJdIC8gMTAwLmY7CisgICAgICAgICAgICB0LnogPSB2dHhbY3QqMisxXSAvIDEwMC5mOworICAgICAgICAgICAgdC5zID0gcnVubmluZ1M7CisgICAgICAgICAgICB0Lm54ID0gICh2dHhbY3QqMiszXSAtIHZ0eFtjdCoyICsxXSk7CisgICAgICAgICAgICB0Lm55ID0gICh2dHhbY3QqMisyXSAtIHZ0eFtjdCoyICAgXSk7CisgICAgICAgICAgICBmbG9hdCBsZW4gPSAoZmxvYXQpamF2YS5sYW5nLk1hdGguc3FydCh0Lm54ICogdC5ueCArIHQubnkgKiB0Lm55KTsKKyAgICAgICAgICAgIHJ1bm5pbmdTICs9IGxlbiAvIDEwMDsKKyAgICAgICAgICAgIHQubnggLz0gbGVuOworICAgICAgICAgICAgdC5ueSAvPSBsZW47CisgICAgICAgICAgICB0LnkgPSAtMC41ZjsKKyAgICAgICAgICAgIHQudCA9IDA7CisgICAgICAgICAgICB0bS5hZGRfWFlaX1NUX05PUk0odC54LCB0LnksIHQueiwgdC5zLCB0LnQsIHQubngsIHQubnksIHQubnopOworICAgICAgICAgICAgLy9hbmRyb2lkLnV0aWwuTG9nLmUoInJzIiwgInZ0eCB4PSIrdC54KyIgeT0iK3QueSsiIHo9Iit0LnorIiBzPSIrdC5zKyIgdD0iK3QudCk7CisgICAgICAgICAgICB0LnkgPSAuNWY7CisgICAgICAgICAgICB0LnQgPSAxOworICAgICAgICAgICAgdG0uYWRkX1hZWl9TVF9OT1JNKHQueCwgdC55LCB0LnosIHQucywgdC50LCB0Lm54LCB0Lm55LCB0Lm56KTsKKyAgICAgICAgICAgIC8vYW5kcm9pZC51dGlsLkxvZy5lKCJycyIsICJ2dHggeD0iK3QueCsiIHk9Iit0LnkrIiB6PSIrdC56KyIgcz0iK3QucysiIHQ9Iit0LnQpOworCisgICAgICAgICAgICBpZigocnVubmluZ1MqMikgPiBtVHJpYW5nbGVPZmZzZXRzQ291bnQpIHsKKyAgICAgICAgICAgICAgICBtVHJpYW5nbGVPZmZzZXRzW21UcmlhbmdsZU9mZnNldHNDb3VudF0gPSBjdCoyICogMzsKKyAgICAgICAgICAgICAgICBtVHJpYW5nbGVPZmZzZXRzVGV4W21UcmlhbmdsZU9mZnNldHNDb3VudF0gPSB0LnM7CisgICAgICAgICAgICAgICAgbVRyaWFuZ2xlT2Zmc2V0c0NvdW50ICsrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgY291bnQgPSAoY291bnQgKiAyIC0gMik7CisgICAgICAgIGZvciAoaW50IGN0PTA7IGN0IDwgKGNvdW50LTIpOyBjdCs9IDIpIHsKKyAgICAgICAgICAgIHRtLmFkZFRyaWFuZ2xlKGN0LCBjdCsxLCBjdCsyKTsKKyAgICAgICAgICAgIHRtLmFkZFRyaWFuZ2xlKGN0KzEsIGN0KzMsIGN0KzIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0bS5jcmVhdGUoKTsKKyAgICB9CisKKworfQorCmRpZmYgLS1naXQgYS9saWJzL3JzL2phdmEvRmlsbS9zcmMvY29tL2FuZHJvaWQvZmlsbS9GaWxtVmlldy5qYXZhIGIvbGlicy9ycy9qYXZhL0ZpbG0vc3JjL2Nvb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9jdXNhYmxlKHRydWUpOworICAgIH0KKworICAgIHByaXZhdGUgUmVuZGVyU2NyaXB0IG1SUzsKKyAgICBwcml2YXRlIEZpbG1SUyBtUmVuZGVyOworCisgICAgcHVibGljIHZvaWQgc3VyZmFjZUNoYW5nZWQoU3VyZmFjZUhvbGRlciBob2xkZXIsIGludCBmb3JtYXQsIGludCB3LCBpbnQgaCkgeworICAgICAgICBzdXBlci5zdXJmYWNlQ2hhbmdlZChob2xkZXIsIGZvcm1hdCwgdywgaCk7CisKKyAgICAgICAgbVJTID0gY3JlYXRlUmVuZGVyU2NyaXB0KHRydWUpOworICAgICAgICBtUmVuZGVyID0gbmV3IEZpbG1SUygpOworICAgICAgICBtUmVuZGVyLmluaXQobVJTLCBnZXRSZXNvdXJjZXMoKSwgdywgaCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25LZXlEb3duKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkKKyAgICB7CisgICAgICAgIC8vIGJyZWFrIHBvaW50IGF0IGhlcmUKKyAgICAgICAgLy8gdGhpcyBtZXRob2QgZG9lc24ndCB3b3JrIHdoZW4gJ2V4dGVuZHMgVmlldycgaW5jbHVkZSAnZXh0ZW5kcyBTY3JvbGxWaWV3Jy4KKyAgICAgICAgcmV0dXJuIHN1cGVyLm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7CisgICAgfQorCisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvblRvdWNoRXZlbnQoTW90aW9uRXZlbnQgZXYpCisgICAgeworICAgICAgICBib29sZWFuIHJldCA9IHRydWU7CisgICAgICAgIGludCBhY3QgPSBldi5nZXRBY3Rpb24oKTsKKyAgICAgICAgaWYgKGFjdCA9PSBldi5BQ1RJT05fVVApIHsKKyAgICAgICAgICAgIHJldCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIG1SZW5kZXIuc2V0RmlsbVN0cmlwUG9zaX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21hIHZlcnNpb24oMSkKKyNwcmFnbWEgc3RhdGVWZXJ0ZXgoZGVmYXVsdCkKKyNwcmFnbWEgc3RhdGVGcmFnbWVudChkZWZhdWx0KQorI3ByYWdtYSBzdGF0ZUZyYWdtZW50U3RvcmUoZGVmYXVsdCkKKworaW50IG5ld1BhcnQgPSAwOworCitpbnQgbWFpbihpbnQgbGF1bmNoSUQpIHsKKyAgICBpbnQgY3Q7CisgICAgaW50IGNvdW50ID0gQ29udHJvbC0+Y291bnQ7CisgICAgaW50IHJhdGUgPSBDb250cm9sLT5yYXRlOworICAgIGZsb2F0IGhlaWdodCA9IGdldEhlaWdodCgpOworICAgIHN0cnVjdCBwb2ludF9zICogcCA9IChzdHJ1Y3QgcG9pbnRfcyAqKXBvaW50OworCisgICAgaWYgKHJhdGUpIHsKKyAgICAgICAgZmxvYXQgck1heCA9ICgoZmxvYXQpcmF0ZSkgKiAwLjAwNWY7CisgICAgICAgIGludCB4ID0gQ29udHJvbC0+eDsKKyAgICAgICAgaW50IHkgPSBDb250cm9sLT55OworICAgICAgICBjaGFyIHIgPSBDb250cm9sLT5yICogMjU1LmY7CisgICAgICAgIGNoYXIgZyA9IENvbnRyb2wtPmcgKiAyNTUuZjsKKyAgICAgICAgY2hhciBiID0gQ29udHJvbC0+YiAqIDI1NS5mOworICAgICAgICBjaGFyIGEgPSAweGYwOworCisgICAgICAgIHdoaWxlIChyYXRlLS0pIHsKKyAgICAgICAgICAgIHZlYzJSYW5kKChmbG9hdCAqKShwICsgbmV3UGFydCksIHJNYXgpOworICAgICAgICAgICAgcFtuZXdQYXJ0XS54ID0geDsKKyAgICAgICAgICAgIHBbbmV3UGFydF0ueSA9IHk7CisgICAgICAgICAgICBwW25ld1BhcnRdLnIgPSByOworICAgICAgICAgICAgcFtuZXdQYXJ0XS5nID0gZzsKKyAgICAgICAgICAgIHBbbmV3UGFydF0uYiA9IGI7CisgICAgICAgICAgICBwW25ld1BhcnRdLmEgPSBhOworICAgICAgICAgICAgbmV3UGFydCsrOworICAgICAgICAgICAgaWYgKG5ld1BhcnQgPj0gY291bnQpIHsKKyAgICAgICAgICAgICAgICBuZXdQYXJ0ID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGZvciAoY3Q9MDsgY3QgPCBjb3VudDsgY3QrKykgeworICAgICAgICBmbG9hdCBkeSA9IHAtPmR5ICsgMC4xNWY7CisgICAgICAgIGZsb2F0IHBvc3kgPSBwLT55ICsgZHk7CisgICAgICAgIGlmICgocG9zeSA+IGhlaWdodCkgJiYgKGR5ID4gMCkpIHsKKyAgICAgICAgICAgIGR5ICo9IC0wLjNmOworICAgICAgICB9CisgICAgICAgIHAtPmR5ID0gZHk7CisgICAgICAgIHAtPnggKz0gcC0+ZHg7CisgICAgICAgIHAtPnkgPSBwb3N5OworICAgICAgICBwKys7CisgICAgfQorCisgICAgdXBsb2FkVG9CdWZmZXJPYmplY3QoTkFNRURfUGFydEJ1ZmZlcik7CisgICAgZHJhd1NpbXBsZU1lc2goTkFNRURfUGFydE1lc2gpOworICAgIHJldHVybiAxOworfQpkaWZmIC0tZ2l0IGEvbGlicy9ycy9qYXZhL0ZvdW50YWluL3NyYy9jb20vYW5kcm9pZC9mb3VudGFpbi9Gb3VudGFpbi5qYXZhIGIvbGlicy9ycy9qYXZhL0ZvdW50YWluL3NyYy9jb20vYW5kcm9pZC9mb3VudGFpbi9Gb3VudGFpbi5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjU4Yzc4ZmEKLS0tIC9kZXYvbnVsbAorKysgYi9saWJzL3JzL2phdmEvRm91bnRhaW4vc3JjL2NvbS9hbmRyb2lkL2ZvdW50YWluL0ZvdW50YWluLmphdmEKQEAgLTAsMCArMSw5MCBAQAorLyoKKyAqIENvcHlyaWdodCAoQykgMjAwOCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0CisgKgorICogTGljZW5zZWQgdW5kZXI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ltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCitwYWNrYWdlIGNvbS5hbmRyb2lkLmZvdW50YWluOworCitpbXBvcnQgYW5kcm9pZC5jb250ZW50LnJlcy5SZXNvdXJjZXM7CitpbXBvcnQgYW5kcm9pZC5yZW5kZXJzY3JpcHQuKjsKK2ltcG9ydCBhbmRyb2lkLnV0aWwuTG9nOworCisKK3B1YmxpYyBjbGFzcyBGb3VudGFpblJTIHsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQQVJUX0NPVU5UID0gMjAwMDA7CisKKyAgICBzdGF0aWMgY2xhc3MgU29tZURhdGEgeworICAgICAgICBwdWJsaWMgaW50IHg7CisgICAgICAgIHB1YmxpYyBpbnQgeTsKKyAgICAgICAgcHVibGljIGludCByYXRlOworICAgICAgICBwdWJsaWMgaW50IGNvdW50OworICAgICAgICBwdWJsaWMgZmxvYXQgcjsKKyAgICAgICAgcHVibGljIGZsb2F0IGc7CisgICAgICAgIHB1YmxpYyBmbG9hdCBiOworICAgIH0KKworICAgIHB1YmxpYyBGb3VudGFpblJTKCkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXQoUmVuZGVyU2NyaXB0IHJzLCBSZXNvdXJjZXMgcmVzLCBpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKKyAgICAgICAgbVJTID0gcnM7CisgICAgICAgIG1SZXMgPSByZXM7CisgICAgICAgIGluaXRSUygpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG5ld1RvdWNoUG9zaXRpb24oaW50IHgsIGludCB5LCBpbnQgcmF0ZSkgeworICAgICAgICBpZiAobVNELnJhdGUgPT0gMCkgeworICAgICAgICAgICAgbVNELnIgPSAoKHggJiAweDEpICE9IDApID8gMC5mIDogMS5mOworICAgICAgICAgICAgbVNELmcgPSAoKHggJiAweDIpICE9IDApID8gMC5mIDogMS5mOworICAgICAgICAgICAgbVNELmIgPSAoKHggJiAweDQpICE9IDApID8gMC5mIDogMS5mOworICAgICAgICAgICAgaWYgKChtU0QuciArIG1TRC5nICsgbVNELmIpIDwgMC45ZikgeworICAgICAgICAgICAgICAgIG1TRC5yID0gMC44ZjsKKyAgICAgICAgICAgICAgICBtU0QuZyA9IDAuNWY7CisgICAgICAgICAgICAgICAgbVNELmIgPSAxLmY7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbVNELnJhdGUgPSByYXRlOworICAgICAgICBtU0QueCA9IHg7CisgICAgICAgIG1TRC55ID0geTsKKyAgICAgICAgbUludEFsbG9jLmRhdGEobVNEKTsKKyAgICB9CisKKworICAgIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKKyAgICBwcml2YXRlIFJlc291cmNlcyBtUmVzOworCisgICAgcHJpdmF0ZSBSZW5kZXJTY3JpcHQgbVJTOworICAgIHByaXZhdGUgQWxsb2NhdGlvbiBtSW50QWxsb2M7CisgICAgcHJpdmF0ZSBTaW1wbGVNZXNoIG1TTTsKKyAgICBwcml2YXRlIFNvbWVEYXRhIG1TRDsKKyAgICBwcml2YXRlIFR5cGUgbVNEVHlwZTsKKworICAgIHByaXZhdGUgdm9pZCBpbml0UlMoKSB7CisgICAgICAgIG1TRCA9IG5ldyBTb21lRGF0YSgpOworICAgICAgICBtU0RUeXBlID0gVHlwZS5jcmVhdGVGcm9tQ2xhc3MobVJTLCBTb21lRGF0YS5jbGFzcywgMSwgIlNvbWVEYXRhIik7CisgICAgICAgIG1JbnRBbGxvYyA9IEFsbG9jYXRpb24uY3JlYXRlVHlwZWQobVJTLCBtU0RUeXBlKTsKKyAgICAgICAgbVNELmNvdW50ID0gUEFSVF9DT1VOVDsKKyAgICAgICAgbUludEFsbG9jLmRhdGEobV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ldyBGb3VudGFpblJTKCk7CisgICAgICAgIG1SZW5kZXIuaW5pdChtUlMsIGdldFJlc291cmNlcygpLCB3LCBoKTsKKyAgICB9CisKKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikKKyAgICB7CisgICAgICAgIGludCBhY3QgPSBldi5nZXRBY3Rpb24oKTsKKyAgICAgICAgaWYgKGFjdCA9PSBldi5BQ1RJT05fVVApIHsKKyAgICAgICAgICAgIG1SZW5kZXIubmV3VG91Y2hQb3NpdGlvbigwLCAwLCAwKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBmbG9hdCByYXRlID0gKGV2LmdldFByZXNzdXJlKCkgKiA1MC5mKTsKKyAgICAgICAgcmF0ZSAqPSByYXRlOworICAgICAgICBpZihyYXRlID4gMjAwMC5mKSB7CisgICAgICAgICAgICByYXRlID0gMjAwMC5mOworICAgICAgICB9CisgICAgICAgIG1SZW5kZXIubmV3VG91Y2hQb3NpdGlvbigoaW50KWV2LmdldFgoKSwgKGludClldi5nZXRZKCksIChpbnQpcmF0ZSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KK30KKworCmRpZmYgLS1naXQgYS9saWJzL3JzL2phdmEvUm9sbG8vQW5kcm9pZC5tayBiL2xpYnMvcnMvamF2YS9Sb2xsby9BbmRyb2lkLm1rCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjVhNDk1N2MKLS0tIC9kZXYvbnVsbAorKysgYi9saWJzL3JzL2phdmEvUm9sbG8vQW5kcm9pZC5tawpAQCAtMCwwICsxLDI1IEBACisjCisjIENvcHlyaWdodCAoQykgMjAwOCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0CisjCisjIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHR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Jlcy9yYXcvcm9sbG8uYwpAQCAtMCwwICsxLDE4NCBAQAorI3ByYWdtYSB2ZXJzaW9uKDEpCisjcHJhZ21hIHN0YXRlVmVydGV4KFBWKQorI3ByYWdtYSBzdGF0ZUZyYWdtZW50KFBGKQorI3ByYWdtYSBzdGF0ZUZyYWdtZW50U3RvcmUoUEZTKQorCisvLyBTY3JhdGNoIGJ1ZmZlciBsYXlvdXQKKyNkZWZpbmUgU0NSQVRDSF9GQURFIDAKKyNkZWZpbmUgU0NSQVRDSF9aT09NIDEKKyNkZWZpbmUgU0NSQVRDSF9ST1QgMgorCisvLyNkZWZpbmUgU1RBVEVfUE9TX1ggICAgICAgICAgICAgMAorI2RlZmluZSBTVEFURV9ET05FICAgICAgICAgICAgICAxCisvLyNkZWZpbmUgU1RBVEVfUFJFU1NVUkUgICAgICAgICAgMgorI2RlZmluZSBTVEFURV9aT09NICAgICAgICAgICAgICAzCisvLyNkZWZpbmUgU1RBVEVfV0FSUCAgICAgICAgICAgICAgNAorI2RlZmluZSBTVEFURV9PUklFTlRBVElPTiAgICAgICA1CisjZGVmaW5lIFNUQVRFX1NFTEVDVElPTiAgICAgICAgIDYKKyNkZWZpbmUgU1RBVEVfRklSU1RfVklTSUJMRSAgICAgNworI2RlZmluZSBTVEFURV9DT1VOVCAgICAgICAgICAgICA4CisjZGVmaW5lIFNUQVRFX1RPVUNIICAgICAgICAgICAgIDkKKworCitmbG9hdCBmaWx0ZXIoZmxvYXQgdmFsLCBmbG9hdCB0YXJnZXQsIGZsb2F0IHN0cikKK3sKKyAgICBmbG9hdCBkZWx0YSA9ICh0YXJnZXQgLSB2YWwpOworICAgIHJldHVybiB2YWwgKyBkZWx0YSAqIHN0cjsKK30KKworaW50IG1haW4odm9pZCogY29uLCBpbnQgZnQsIGludCBsYXVuY2hJRCkKK3sKKyAgICBpbnQgcm93Q291bnQ7CisgICAgaW50IHJvdzsKKyAgICBpbnQgY29sOworICAgIGludCBpbWFnZUlEOworICAgIGludCBkb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IHRhcmdldFJvdCwgMC4xZiAqIHRvdWNoQ3V0KTsKKyAgICBzdG9yZUYoMiwgU0NSQVRDSF9ST1QsIGRyYXdSb3QpOworCisgICAgZmxvYXQgZGlhbSA9IDguZjsKKyAgICBmbG9hdCBzY2FsZSA9IDEuMGYgLyB6b29tOworCisgICAgLy8gQnVnIG1ha2VzIDEuMGYgYWxwaGEgZmFpbC4KKyAgICBjb2xvcigxLjBmLCAxLjBmLCAxLjBmLCAwLjk5Zik7CisKKyAgICBmbG9hdCByb3QgPSBkcmF3Um90ICogc2NhbGU7CisgICAgZmxvYXQgcm90U3RlcCA9IDE2LjBmIC8gMTgwLjBmICogMy4xNGYgKiBzY2FsZTsKKyAgICByb3dDb3VudCA9IDQ7CisgICAgaW50IGluZGV4ID0gMDsKKyAgICBpbnQgaWNvbkNvdW50ID0gbG9hZEkzMigwLCBTVEFURV9DT1VOVCk7CisgICAgd2hpbGUgKGljb25Db3VudCkgeworICAgICAgICBmbG9hdCB0bXBTaW4gPSBzaW5mKHJvdCk7CisgICAgICAgIGZsb2F0IHRtcENvcyA9IGNvc2Yocm90KTsKKyAgICAgICAgICAgIC8vZGVidWdGKCJyb3QiLCByb3QpOworCisgICAgICAgIGZsb2F0IHR4MSA9IHRtcFNpbiAqIGRpYW0gLSAodG1wQ29zICogc2NhbGUgKiAwLjlmKTsKKyAgICAgICAgZmxvYXQgdHgyID0gdHgxICsgKHRtcENvcyAqIHNjYWxlICogMS44Zik7CisgICAgICAgIGZsb2F0IHR6MSA9IHRtcENvcyAqIGRpYW0gKyAodG1wU2luICogc2NhbGUgKiAwLjlmKTsKKyAgICAgICAgZmxvYXQgdHoyID0gdHoxIC0gKHRtcFNpbiAqIHNjYWxlICogMS44Zik7CisKKyAgICAgICAgaW50IHk7CisgICAgICAgIGZvciAoeSA9IHJvd0NvdW50IC0xOyAoeSA+PSAwKSAmJiBpY29uQ291bnQ7IHktLSkgeworICAgICAgICAgICAgZmxvYXQgdHkxID0gKCh5ICogMy4xZikgLSA1LmYpICogc2NhbGU7CisgICAgICAgICAgICBmbG9hdCB0eTIgPSB0eTEgKyBzY2FsZSAqIDEuOGY7CisgICAgICAgICAgICBiaW5kVGV4dHVyZShOQU1FRF9QRiwgMCwgbG9hZEkzMigxLCBpbmRleCkpOworICAgICAgICAgICAgZHJhd1F1YWQodHgxLCB0eTEsIHR6MSwKKyAgICAgICAgICAgICAgICAgICAgIHR4MiwgdHkxLCB0ejIsCisgICAgICAgICAgICAgICAgICAgICB0eDIsIHR5MiwgdHoyLAorICAgICAgICAgICAgICAgICAgICAgdHgxLCB0eTIsIHR6MSk7CisKKyAgICAgICAgICAgIGljb25Db3VudC0tOworICAgICAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgfQorICAgICAgICByb3QgPSByb3QgKyByb3RTdGVwOworICAgIH0KKworICAgIGlmICgoem9vbSA8IDEuMWYpICYmICh6b29tID4gMC45ZikpIHsKKyAgICAgICAgYmluZFByb2dyYW1WZXJ0ZXgoTkFNRURfUFZPcnRobyk7CisgICAgICAgIGJpbmRQcm9ncmFtRnJhZ21lbnQoTkFNRURfUEZUZXh0KTsKKyAgICAgICAgYmluZFByb2dyYW1GcmFnbWVudFN0b3JlKE5BTUVEX1BGU1RleHQpOworCisgICAgICAgIHJvdCA9IGRyYXdSb3QgKiBzY2FsZTsKKyAgICAgICAgaW5kZXggPSAwOworICAgICAgICBpY29uQ291bnQgPSBsb2FkSTMyKDAsIFNUQVRFX0NPVU5UKTsKKyAgICAgICAgd2hpbGUgKGljb25Db3VudCkgeworICAgICAgICAgICAgaW50IHk7CisKKyAgICAgICAgICAgIGZsb2F0IHR4ID0gMjQwLmYgKyBmbG9vcmYoc2luZihyb3QpICogNDMwLmYpIC0gNjQuZiArIDE2LmY7CisKKyAgICAgICAgICAgIGZsb2F0IGFscGhhID0gMi40ZiAtIChmYWJzZih0eCAtIDI0MC5mICsgNDguZikgLyA3Ni5mKTsKKyAgICAgICAgICAgIGlmIChhbHBoYSA+IDAuOTlmKSB7CisgICAgICAgICAgICAgICAgYWxwaGEgPSAwLjk5ZjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGFscGhhID0gYWxwaGEgKiAoMS5mIC0gKGZhYnNmKHpvb20gLSAxLmYpICogMTAuZikpOworCisgICAgICAgICAgICB0eCA9IHR4ICsgMC4yNWY7CisKKyAgICAgICAgICAgIGZvciAoeSA9IHJvd0NvdW50IC0xOyAoeSA+PSAwKSAmJiBpY29uQ291bnQ7IHktLSkgeworCisgICAgICAgICAgICAgICAgaWYgKGFscGhhID4gMCkgeworICAgICAgICAgICAgICAgICAgICBjb2xvcigxLjBmLCAxLjBmLCAxLjBmLCBhbHBoYSk7CisKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgdHkgPSA2MDUuZiAtIHkgKiAxNTAuZjsKKworICAgICAgICAgICAgICAgICAgICB0eSA9IHR5ICsgMC4yNWY7CisKKyAgICAgICAgICAgICAgICAgICAgYmluZFRleHR1cmUoTkFNRURfUEZUZXh0LCAwLCBsb2FkSTMyKDMsIGluZGV4KSk7CisgICAgICAgICAgICAgICAgICAgIGRyYXdSZWN0KHR4LCB0eSwgdHggKyAxMjguZiwgdHkgKyAzMi5mLCAwLjVmKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWNvbkNvdW50LS07CisgICAgICAgICAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJvdCA9IHJvdCArIHJvdFN0ZXA7CisgICAgICAgIH0KKworCisgICAgICAgIGJpbmRQcm9ncmFtVmVydGV4KE5BTUVEX1BWKTsKKyAgICAgICAgYmluZFByb2dyYW1GcmFnbWVudChOQU1FRF9QRik7CisgICAgICAgIGJpbmRQcm9ncmFtRnJhZ21lbnRTdG9yZShOQU1FRF9QRlMpOworICAgIH0KKworICAgIC8vIERyYXcgdGhlIHNlbGVjdGVkIGljb24KKyAgICBjb2xvcigxLjBmLCAxLjBmLCAxLjBmLCAwLjlmKTsKKyAgICByb3QgPSBkcmF3Um90ICogc2NhbGU7CisgICAgaW5kZXggPSAwOworICAgIGljb25Db3VudCA9IGxvYWRJMzIoMCwgU1RBVEVfQ09VTlQpOworICAgIHdoaWxlIChpY29uQ291bnQpIHsKKyAgICAgICAgaW50IHk7CisgICAgICAgIGZvciAoeSA9IHJvd0NvdW50IC0xOyAoeSA+PSAwKSAmJiBpY29uQ291bnQ7IHktLSkgeworICAgICAgICAgICAgaWYgKGluZGV4ID09IHNlbGVjdGVkSUQpIHsKKworICAgICAgICAgICAgICAgIGZsb2F0IHRtcFNpbiA9IHNpbmYocm90KSAqIHNjYWxlOworICAgICAgICAgICAgICAgIGZsb2F0IHRtcENvcyA9IGNvc2Yocm90KSAqIHNjYWxlOworICAgICAgICAgICAgICAgIGZsb2F0IHR4MSA9IHRtcFNpbiAqIGRpYW0gKiAwLjlmIC0gdG1wQ29zICogMi5mOworICAgICAgICAgICAgICAgIGZsb2F0IHR4MiA9IHR4MSArICh0bXBDb3MgKiA0LmYpOworICAgICAgICAgICAgICAgIGZsb2F0IHR6MSA9IHRtcENvcyAqIGRpYW0gKiAwLjlmICsgdG1wU2luICogMi5mOworICAgICAgICAgICAgICAgIGZsb2F0IHR6MiA9IHR6MSAtICh0bXBTaW4gKiA0LmYpOworCisgICAgICAgICAgICAgICAgZmxvYXQgdHkxID0gKCh5ICogMy4xZikgLSA0LjVmKSAqIHNjYWxlOworICAgICAgICAgICAgICAgIGZsb2F0IHR5MiA9IHR5MSArIHNjYWxlICogNC5mOworICAgICAgICAgICAgICAgIGJpbmRUZXh0dXJlKE5BTUVEX1BGLCAwLCBsb2FkSTMyKDEsIGluZGV4KSk7CisgICAgICAgICAgICAgICAgZHJhd1F1YWQodHgxLCB0eTEsIHR6MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0eDIsIHR5MSwgdHoyLAorICAgICAgICAgICAgICAgICAgICAgICAgIHR4MiwgdHkyLCB0ejIsCisgICAgICAgICAgICAgICAgICAgICAgIC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VklTSUJMRSAgICAgNworI2RlZmluZSBTVEFURV9DT1VOVCAgICAgICAgICAgICA4CisjZGVmaW5lIFNUQVRFX1RPVUNIICAgICAgICAgICAgIDkKKworZmxvYXQgZmlsdGVyKGZsb2F0IHZhbCwgZmxvYXQgdGFyZ2V0LCBmbG9hdCBzdHIpCit7CisgICAgZmxvYXQgZGVsdGEgPSAodGFyZ2V0IC0gdmFsKTsKKyAgICByZXR1cm4gdmFsICsgZGVsdGEgKiBzdHI7Cit9CisKKworaW50IG1haW4odm9pZCogY29uLCBpbnQgZnQsIGludCBsYXVuY2hJRCkKK3sKKyAgICBpbnQgcm93Q291bnQ7CisgICAgaW50IGltYWdlSUQ7CisgICAgaW50IGRvbmUgPSBsb2FkSTMyKDAsIFNUQVRFX0RPTkUpOworICAgIGludCBzZWxlY3RlZElEID0gbG9hZEkzMigwLCBTVEFURV9TRUxFQ1RJT04pOworICAgIGludCBpY29uQ291bnQgPSBsb2FkSTMyKDAsIFNUQVRFX0NPVU5UKTsKKworICAgIGZsb2F0IGYgPSBsb2FkRigyLCAwKTsKKworICAgIGZsb2F0IGljb25TaXplID0gMS5mOworICAgIGZsb2F0IGljb25TcGFjaW5nID0gMC4yZjsKKyAgICBmbG9hdCB6ID0gNC5mOworCisgICAgcGZDbGVhckNvbG9yKDAuMGYsIDAuMGYsIDAuMGYsIGYpOworICAgIGlmIChkb25lKSB7CisgICAgfSBlbHNlIHsKKyAgICAgICAgaWYgKGYgPCAwLjhmKSB7CisgICAgICAgICAgICBmID0gZiArIDAuMDJmOworICAgICAgICAgICAgc3RvcmVGKDIsIDAsIGYpOworICAgICAgICB9CisgICAgfQorCisgICAgZmxvYXQgdG91Y2hDdXQgPSAxLmY7CisgICAgaWYgKGxvYWRJMzIoMCwgU1RBVEVfVE9VQ0gpKSB7CisgICAgICAgIHRvdWNoQ3V0ID0gNS5mOworICAgIH0KKworCisgICAgZmxvYXQgdGFyZ2V0Wm9vbSA9ICgoZmxvYXQpbG9hZEkzMigwLCBTVEFURV9aT09NKSkgLyAxMDAwLmY7CisgICAgZmxvYXQgem9vbSA9IGZpbHRlcihsb2FkRigyLCBTQ1JBVENIX1pPT00pLCB0YXJnZXRab29tLCAwLjE1ICogdG91Y2hDdXQpOworICAgIHN0b3JlRigyLCBTQ1JBVENIX1pPT00sIHpvb20pOworCisgICAgZmxvYXQgdGFyZ2V0UG9zID0gbG9hZEkzMigwLCBTVEFURV9GSVJTVF9WSVNJQkxFKSAvICgtMjAuMGYpOworICAgIGZsb2F0IHBvcyA9IGZpbHRlcihsb2FkRigyLCBTQ1JBVENIX1JPVCksIHRhcmdldFBvcywgMC4xZiAqIHRvdWNoQ3V0KTsKKyAgICBzdG9yZUYoMiwgU0NSQVRDSF9ST1QsIHBvcyk7CisgICAgcG9zID0gcG9zIC0gMS5mOworCisgICAgY29sb3IoMS4wZiwgMS4wZiwgMS4wZiwgMS4wZik7CisKKworICAgIC8vIERyYXcgZmxhdCBpY29ucyBmaXJzdAorICAgIGludCBpbmRleCA9ICgoaW50KXBvcykgKiA0OworICAgIGludCByb3c7CisgICAgaW50IGNvbDsKKyAgICBmbG9hdCB4b2Zmc2V0ID0gLTAuM2Y7CisgICAgZmxvYXQgZ3JpZFNpemUgPSBpY29uU2l6ZSAqIDQuZiArIGljb25TcGFjaW5nICogMy5mOworICAgIGZsb2F0IHlvZmZzZXQgPSAocG9zIC0gKChpbnQpcG9zKSk7CisgICAgZm9yIChyb3cgPSAwOyByb3cgPCA0OyByb3cgKyspIHsKKyAgICAgICAgZmxvYXQgdHkxID0gKGdyaWRTaXplIC8gMi5mKSAtICgoZmxvYXQpcm93IC0geW9mZnNldCkgKiAoaWNvblNpemUgKyBpY29uU3BhY2luZykgLSBpY29uU2l6ZTsKKyAgICAgICAgZmxvYXQgdHkyID0gdHkxICsgaWNvblNpemU7CisKKyAgICAgICAgZm9yIChjb2wgPSAwOyAoY29sIDwgNCkgJiYgKGluZGV4IDwgaWNvbkNvdW50KTsgY29sICsrKSB7CisgICAgICAgICAgICBpZiAoaW5kZXggPj0gMCkgeworICAgICAgICAgICAgICAgIGJpbmRUZXh0dXJlKE5BTUVEX1BGLCAwLCBsb2FkSTMyKDEsIGluZGV4KSk7CisgICAgICAgICAgICAgICAgZmxvYXQgZmNvbCA9IGNvbDsKKyAgICAgICAgICAgICAgICBmbG9hdCB0eDEgPSB4b2Zmc2V0ICsgKC1ncmlkU2l6ZSAvIDIuZikgKyAoZmNvbCAqIChpY29uU2l6ZSArIGljb25TcGFjaW5nKSk7CisgICAgICAgICAgICAgICAgZmxvYXQgdHgyID0gdHgxICsgaWNvblNpemU7CisKKyAgICAgICAgICAgICAgICBkcmF3UXVhZCh0eDEsIHR5MSwgeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0eDIsIHR5MSwgeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0eDIsIHR5MiwgeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICB0eDEsIHR5Miwgeik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbmRleCsrOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gYm90dG9tIHJvbGxlcgorICAgIHsKKyAgICAgICAgZmxvYXQgcm9sbCA9ICgxLmYgLSB5b2Zmc2V0KSAqIDAuNWYgKiAzLjE0ZjsKKyAgICAgICAgZmxvYXQgdG1wU2luID0gc2luZihyb2xsKTsKKyAgICAgICAgZmxvYXQgdG1wQ29zID0gY29zZihyb2xsKTsKKworICAgICAgICBmb3IgKGNvbCA9IDA7IChjb2wgPCA0KSAmJiAoaW5kZXggPCBpY29uQ291bnQpICYmIChpbmRleCA+PSAwKTsgY29sICsrKSB7CisgICAgICAgICAgICBmbG9hdCB0eTIgPSAoZ3JpZFNpemUgLyAyLmYpIC0gKChmbG9hdClyb3cgLSB5b2Zmc2V0KSAqIChpY29uU2l6ZSArIGljb25TcGFjaW5nKTsKKyAgICAgICAgICAgIGZsb2F0IHR5MSA9IHR5MiAtIHRtcENvcyAqIGljb25TaXplOworCisgICAgICAgICAgICBmbG9hdCB0ejEgPSB6ICsgdG1wU2luICogaWNvblNpemU7CisgICAgICAgICAgICBmbG9hdCB0ejIgPSB6OworCisgICAgICAgICAgICBmbG9hdCB0eDEgPSB4b2Zmc2V0ICsgKC1ncmlkU2l6ZSAvIDIuZikgKyAoKGZsb2F0KWNvbCAqIChpY29uU2l6ZSArIGljb25TcGFjaW5nKSk7CisgICAgICAgICAgICBmbG9hdCB0eDIgPSB0eDEgKyBpY29uU2l6ZTsKKworICAgICAgICAgICAgYmluZFRleHR1cmUoTkFNRURfUEYsIDAsIGxvYWRJMzIoMSwgaW5kZXgpKTsKKyAgICAgICAgICAgIGRyYXdRdWFkKHR4MSwgdHkxLCB0ejEsCisgICAgICAgICAgICAgICAgICAgICB0eDIsIHR5MSwgdHoxLAorICAgICAgICAgICAgICAgICAgICAgdHgyLCB0eTIsIHR6MiwKKyAgICAgICAgICAgICAgICAgICAgIHR4MSwgdHkyLCB0ejIpOworICAgICAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIFRvcCByb2xsZXIKKyAgICB7CisgICAgICAgIGluZGV4ID0gKCgoaW50KXBvcykgKiA0KSAtIDQ7CisgICAgICAgIGZsb2F0IHJvbGwgPSB5b2Zmc2V0ICogMC41ZiAqIDMuMTRmOworICAgICAgICBmbG9hdCB0bXBTaW4gPSBzaW5mKHJvbGwpOworICAgICAgICBmbG9hdCB0bXBDb3MgPSBjb3NmKHJvbGwpOworCisgICAgICAgIGZvciAoY29sID0gMDsgKGNvbCA8IDQpICYmIChpbmRleCA8IGljb25Db3VudCkgJiYgKGluZGV4ID49IDApOyBjb2wgKyspIHsKKyAgICAgICAgICAgIGZsb2F0IHR5MSA9IChncmlkU2l6ZSAvIDIuZikgLSAoKGZsb2F0KS0xLmYgLSB5b2Zmc2V0KSAqIChpY29uU2l6ZSArIGljb25TcGFjaW5nKSAtIGljb25TaXplOworICAgICAgICAgICAgZmxvYXQgdHkyID0gdHkxICsgdG1wQ29zICogaWNvblNpemU7CisKKyAgICAgICAgICAgIGZsb2F0IHR6MSA9IHo7CisgICAgICAgICAgICBmbG9hdCB0ejIgPSB6ICsgdG1wU2luICogaWNvblNpemU7CisKKyAgICAgICAgICAgIGZsb2F0IHR4MSA9IHhvZmZzZXQgKyAoLWdyaWRTaXplIC8gMi5mKSArICgoZmxvYXQpY29sICogKGljb25TaXplICsgaWNvblNwYWNpbmcpKTsKKyAgICAgICAgICAgIGZsb2F0IHR4MiA9IHR4MSArIGljb25TaXplOworCisgICAgICAgICAgICBiaW5kVGV4dHVyZShOQU1FRF9QRiwgMCwgbG9hZEkzMigxLCBpbmRleCkpOworICAgICAgICAgICAgZHJhd1F1YWQodHgxLCB0eTEsIHR6MSwKKyAgICAgICAgICAgICAgICAgICAgIHR4MiwgdHkxLCB0ejEsCisgICAgICAgICAgICAgICAgICAgICB0eDIsIHR5MiwgdHoyLAorICAgICAgICAgICAgICAgICAgICAgdHgxLCB0eTIsIHR6Mik7CisgICAgICAgICAgICBpbmRleCsrOworICAgICAgICB9CisgICAgfQorCisKKworCisgICAgcmV0dXJuIDE7Cit9CisKKworCmRpZmYgLS1naXQgYS9saWJzL3JzL2phdmEvUm9sbG8vcmVzL3Jhdy9zZXR0aW5ncy5wbmcgYi9saWJzL3JzL2phdmEvUm9sbG8vcmVzL3Jhdy9zZXR0aW5ncy5wbmcKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZGQyY2Q5NQotLS0gL2Rldi9udWxsCisrKyBiL2xpYnMvcnMvamF2YS9Sb2xsby9yZXMvcmF3L3NldHRpbmdzLnBuZwpCaW5hcnkgZmlsZXMgZGlmZmVyCmRpZmYgLS1naXQgYS9saWJzL3JzL2phdmEvUm9sbG8vc3JjL2NvbS9hbmRyb2lkL3JvbGxvL1JvbGxvLmphdmEgYi9saWJzL3JzL2phdmEvUm9sbG8vc3JjL2NvbS9hbmRyb2lkL3JvbGxvL1JvbGxvLmphdmE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9IDk7CisKKworICAgIHB1YmxpYyBSb2xsb1JTKCkgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXQoUmVuZGVyU2NyaXB0IHJzLCBSZXNvdXJjZXMgcmVzLCBpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKKyAgICAgICAgbVJTID0gcnM7CisgICAgICAgIG1SZXMgPSByZXM7CisgICAgICAgIG1XaWR0aCA9IHdpZHRoOworICAgICAgICBtSGVpZ2h0ID0gaGVpZ2h0OworICAgICAgICBpbml0TmFtZWQoKTsKKyAgICAgICAgaW5pdFJTKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UG9zaXRpb24oZmxvYXQgY29sdW1uKSB7CisgICAgICAgIG1BbGxvY1N0YXRlQnVmW1NUQVRFX0ZJUlNUX1ZJU0lCTEVdID0gKGludCkoY29sdW1uICogKC0yMCkpOworICAgICAgICBtQWxsb2NTdGF0ZS5kYXRhKG1BbGxvY1N0YXRlQnVmKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRUb3VjaChib29sZWFuIHRvdWNoKSB7CisgICAgICAgIG1BbGxvY1N0YXRlQnVmW1NUQVRFX1RPVUNIXSA9IHRvdWNoID8gMSA6IDA7CisgICAgICAgIG1BbGxvY1N0YXRlLmRhdGEobUFsbG9jU3RhdGVCdWYpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFpvb20oZmxvYXQgeikgeworICAgICAgICAvL0xvZy5lKCJycyIsICJ6b29tICIgKyBGbG9hdC50b1N0cmluZyh6KSk7CisKKyAgICAgICAgbUFsbG9jU3RhdGVCdWZbU1RBVEVfWk9PTV0gPSAoaW50KSh6ICogMTAwMC5mKTsKKyAgICAgICAgbUFsbG9jU3RhdGUuZGF0YShtQWxsb2NTdGF0ZUJ1Zik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0U2VsZWN0ZWQoaW50IGluZGV4KSB7CisgICAgICAgIC8vTG9nLmUoInJzIiwgICJzZ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xsb2MpOworCisgICAgICAgIG1SUy5jb250ZXh0QmluZFByb2dyYW1WZXJ0ZXgobVBWKTsKKworICAgICAgICBtQWxsb2NTY3JhdGNoQnVmID0gbmV3IGludFszMl07CisgICAgICAgIG1BbGxvY1NjcmF0Y2ggPSBBbGxvY2F0aW9uLmNyZWF0ZVNpemVkKG1SUywKKyAgICAgICAgICAgIEVsZW1lbnQuVVNFUl9JMzIsIG1BbGxvY1NjcmF0Y2hCdWYubGVuZ3RoKTsKKyAgICAgICAgbUFsbG9jU2NyYXRjaC5kYXRhKG1BbGxvY1NjcmF0Y2hCdWYpOworCisgICAgICAgIExvZy5lKCJycyIsICJEb25lIGxvYWRpbmcgbmFtZWQiKTsKKworCisKKyAgICAgICAgeworICAgICAgICAgICAgbUljb25zID0gbmV3IEFsbG9jYXRpb25bMjldOworICAgICAgICAgICAgbUFsbG9jSWNvbklEQnVmID0gbmV3IGludFttSWNvbnMubGVuZ3RoXTsKKyAgICAgICAgICAgIG1BbGxvY0ljb25JRCA9IEFsbG9jYXRpb24uY3JlYXRlU2l6ZWQobVJTLAorICAgICAgICAgICAgICAgIEVsZW1lbnQuVVNFUl9JMzIsIG1BbGxvY0ljb25JREJ1Zi5sZW5ndGgpOworCisgICAgICAgICAgICBtTGFiZWxzID0gbmV3IEFsbG9jYXRpb25bMjldOworICAgICAgICAgICAgbUFsbG9jTGFiZWxJREJ1ZiA9IG5ldyBpbnRbbUxhYmVscy5sZW5ndGhdOworICAgICAgICAgICAgbUFsbG9jTGFiZWxJRCA9IEFsbG9jYXRpb24uY3JlYXRlU2l6ZWQobVJTLAorICAgICAgICAgICAgICAgIEVsZW1lbnQuVVNFUl9JMzIsIG1MYWJlbHMubGVuZ3RoKTsKKworICAgICAgICAgICAgRWxlbWVudCBpZTg4ODggPSBFbGVtZW50LlJHQkFfODg4ODsKKworICAgICAgICAgICAgbUljb25zWzBdID0gQWxsb2NhdGlvbi5jcmVhdGVGcm9tQml0bWFwUmVzb3VyY2UobVJTLC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VGV4dEJpdG1hcCgicGF0aDgxNSIpOworICAgICAgICAgICAgbUxhYmVsc1sxMl0gPSBtYWtlVGV4dEJpdG1hcCgicGF0aDE5MjAiKTsKKyAgICAgICAgICAgIG1MYWJlbHNbMTNdID0gbWFrZVRleHRCaXRtYXAoInBhdGgxOTI3Iik7CisgICAgICAgICAgICBtTGFiZWxzWzE0XSA9IG1ha2VUZXh0Qml0bWFwKCJwYXRoMzA5OSIpOworICAgICAgICAgICAgbUxhYmVsc1sxNV0gPSBtYWtlVGV4dEJpdG1hcCgicGF0aDM5NTAiKTsKKyAgICAgICAgICAgIG1MYWJlbHNbMTZdID0gbWFrZVRleHRCaXRtYXAoInBhdGg0NDgxIik7CisgICAgICAgICAgICBtTGFiZWxzWzE3XSA9IG1ha2VUZXh0Qml0bWFwKCJwYXRoNTE2OCIpOworICAgICAgICAgICAgbUxhYmVsc1sxOF0gPSBtYWtlVGV4dEJpdG1hcCgicG9seWdvbjI0MDgiKTsKKworICAgICAgICAgICAgbUljb25zWzE5XSA9IG1JY29uc1swXTsKKyAgICAgICAgICAgIG1JY29uc1syMF0gPSBtSWNvbnNbMV07CisgICAgICAgICAgICBtSWNvbnNbMjFdID0gbUljb25zWzJdOworICAgICAgICAgICAgbUljb25zWzIyXSA9IG1JY29uc1szXTsKKyAgICAgICAgICAgIG1JY29uc1syM10gPSBtSWNvbnNbNF07CisgICAgICAgICAgICBtSWNvbnNbMjRdID0gbUljb25zWzVdOworICAgICAgICAgICAgbUljb25zWzI1XSA9IG1JY29uc1s2XTsKKyAgICAgICAgICAgIG1JY29uc1syNl0gPSBtSWNvbnNbN107CisgICAgICAgICAgICBtSWNvbnNbMjddID0gbUljb25zWzhdOworICAgICAgICAgICAgbUljb25zWzI4XSA9IG1JY29uc1s5XTsKKworICAgICAgICAgICAgbUxhYmVsc1sxOV0gPSBtTGFiZWxzWzBdOworICAgICAgICAgICAgbUxhYmVsc1syMF0gPSBtTGFiZWxzWzFdOworICAgICAgICAgICAgbUxhYmVsc1syMV0gPSBtTGFiZWxzWzJdOworICAgICAgICAgICAgbUxhYmVsc1syMl0gPSBtTGFiZWxzWzNdOworICAgICAgICAgICAgbUxhYmVsc1syM10gPSBtTGFiZWxzWzRdOworICAgICAgICAgICAgbUxhYmVsc1syNF0gPSBtTGFiZWxzWzVdOworICAgICAgICAgICAgbUxhYmVsc1syNV0gPSBtTGFiZWxzWzZdOworICAgICAgICAgICAgbUxhYmVsc1syNl0gPSBtTGFiZWxzWzddOworICAgICAgICAgICAgbUxhYmVsc1syN10gPSBtTGFiZWxzWzhdOworICAgICAgICAgICAgbUxhYmVsc1syOF0gPSBtTGFiZWxzWzldOworCisgICAgICAgICAgICBmb3IoaW50IGN0PTA7IGN0IDwgbUljb25zLmxlbmd0aDsgY3QrKykgeworICAgICAgICAgICAgICAgIG1JY29uc1tjdF0udXBsb2FkVG9UZXh0dXJlKDApOworICAgICAgICAgICAgICAgIG1MYWJlbHNbY3RdLnVwbG9hZFRvVGV4dHVyZSgwKTsKKyAgICAgICAgICAgICAgICBtQWxsb2NJY29uSURCdWZbY3RdID0gbUljb25zW2N0XS5nZXRJRCgpOworICAgICAgICAgICAgICAgIG1BbGxvY0xhYmVsSURCdWZbY3RdID0gbUxhYmVsc1tjdF0uZ2V0SUQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1BbGxvY0ljb25JRC5kYXRhKG1BbGxvY0ljb25JREJ1Zik7CisgICAgICAgICAgICBtQWxsb2NMYWJlbElELmRhdGEobUFsbG9jTGFiZWxJREJ1Zik7CisgICAgICAgIH0KKworICAgIH0KKworICAgIEFsbG9jYXRpb24gbWFrZVRleHRCaXRtYXAoU3RyaW5nIHQpIHsKKyAgICAgICAgQml0bWFwIGIgPSBCaXRtYXAuY3JlYXRlQml0bWFwKDEyOCwgMzIsIEJpdG1hcC5Db25maWcuQVJHQl84ODg4KTsKKyAgICAgICAgQ2FudmFzIGMgPSBuZXcgQ2FudmFzKGIpOworICAgICAgICBQYWludCB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KG1SUywgZ2V0UmVzb3VyY2VzKCksIHcsIGgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uS2V5RG93bihpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpCisgICAgeworICAgICAgICAvLyBicmVhayBwb2ludCBhdCBoZXJlCisgICAgICAgIC8vIHRoaXMgbWV0aG9kIGRvZXNuJ3Qgd29yayB3aGVuICdleHRlbmRzIFZpZXcnIGluY2x1ZGUgJ2V4dGVuZHMgU2Nyb2xsVmlldycuCisgICAgICAgIHJldHVybiBzdXBlci5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpOworICAgIH0KKworICAgIGJvb2xlYW4gbUNvbnRyb2xNb2RlID0gZmFsc2U7CisgICAgYm9vbGVhbiBtWm9vbU1vZGUgPSBmYWxzZTsKKyAgICBib29sZWFuIG1GbGluZ01vZGUgPSBmYWxzZTsKKyAgICBmbG9hdCBtRmxpbmdYID0gMDsKKyAgICBmbG9hdCBtRmxpbmdZID0gMDsKKyAgICBmbG9hdCBtQ29sdW1uID0gLTE7CisgICAgZmxvYXQgbU9sZENvbHVtbjsKKyAgICBmbG9hdCBtWm9vbSA9IDE7CisKKyAgICBpbnQgbUljb25Db3VudCA9IDI5OworICAgIGludCBtUm93cyA9IDQ7CisgICAgaW50IG1Db2x1bW5zID0gKG1JY29uQ291bnQgKyBtUm93cyAtIDEpIC8gbVJvd3M7CisKKyAgICBmbG9hdCBtTWF4Wm9vbSA9ICgoZmxvYXQpbUNvbHVtbnMpIC8gMy5mOworCisKKyAgICB2b2lkIHNldENvbHVtbihib29sZWFuIGNsYW1wKQorICAgIHsKKyAgICAgICAgLy9Mb2cuZSgicnMiLCAiIGNvbCA9ICIgKyBGbG9hdC50b1N0cmluZyhtQ29sdW1uKSk7CisgICAgICAgIGZsb2F0IGMgPSBtQ29sdW1uOworICAgICAgICBpZihjID4gKG1Db2x1bW5zIC0yKSkgeworICAgICAgICAgICAgYyA9IChtQ29sdW1ucyAtMik7CisgICAgICAgIH0KKyAgICAgICAgaWYoYyA8IDApIHsKKyAgICAgICAgICAgIGMgPSAwOworICAgICAgICB9CisgICAgICAgIG1SZW5kZXIuc2V0UG9zaXRpb24oYyk7CisgICAgICAgIGlmKGNsYW1wKSB7CisgICAgICAgICAgICBtQ29sdW1uID0gYzsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgY29tcHV0ZVNlbGVjdGlvbihmbG9hdCB4LCBmbG9hdCB5KQorICAgIHsKKyAgICAgICAgZmxvYXQgY29sID0gbUNvbHVtbiArICh4IC0gMC41ZikgKiA0ICsgMS4yNWY7CisgICAgICAgIGludCBpQ29sID0gKGludCkoY29sICsgMC4yNWYpOworCisgICAgICAgIGZsb2F0IHJvdyA9ICh5IC8gMC44ZikgKiBtUm93czsKKyAgICAgICAgaW50IGlSb3cgPSAoaW50KShyb3cgLSAwLjVmKTsKKworICAgICAgICBtUmVuZGVyLnNldFNlbGVjdGVkKGlDb2wgKiBtUm93cyArIGlSb3cpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikKKyAgICB7CisgICAgICAgIGJvb2xlYW4gcmV0ID0gdHJ1ZTsKKyAgICAgICAgaW50IGFjdCA9IGV2LmdldEFjdGlvbigpOworICAgICAgICBpZiAoYWN0ID09IGV2LkFDVElPTl9VUCkgeworICAgICAgICAgICAgcmV0ID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCBueCA9IGV2LmdldFgoKSAvIGdldFdpZHRoKCk7CisgICAgICAgIGZsb2F0IG55ID0gZXYuZ2V0WSgpIC8gZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgLy9Mb2cuZSgicnMiLCAid2lkdGg9IiArIEZsb2F0LnRvU3RyaW5nKGdldFdpZHRoKCkpKTsKKyAgICAgICAgLy9Mb2cuZSgicnMiLCAiaGVpZ2h0PSIgKyBGbG9hdC50b1N0cmluZyhnZXRIZWlnaHQoKSkpOworCisgICAgICAgIG1SZW5kZXIuc2V0VG91Y2gocmV0KTsKKworICAgICAgICBpZigobnkgPiAwLjg1ZikgfHwgbUNvbnRyb2xNb2RlKSB7CisgICAgICAgICAgICBtRmxpbmdNb2RlID0gZmFsc2U7CisKKyAgICAgICAgICAgIC8vIFByb2plY3RvciBjb250cm9sCisgICAgICAgICAgICBpZigobnggPiAwLjJmKSAmJiAobnggPCAwLjhmKSB8fCBtQ29udHJvbE1vZGUpIHsKKyAgICAgICAgICAgICAgICBpZihhY3QgIT0gZXYuQUNUSU9OX1VQKSB7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHpvb20gPSBtTWF4Wm9vbTsKKyAgICAgICAgICAgICAgICAgICAgaWYobUNvbnRyb2xNb2RlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighbVpvb21Nb2RlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgem9vbSA9IDEuZjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGR4ID0gbnggLSBtRmxpbmdYOworCisgICAgICAgICAgICAgICAgICAgICAgICBpZigobnkgPCAwLjkpICYmIG1ab29tTW9kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpvb20gPSBtTWF4Wm9vbSAtICgoMC45ZiAtIG55KSAqIDEwLmYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHpvb20gPCAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpvb20gPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtWm9vbU1vZGUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU9sZENvbHVtbiA9IG1Db2x1bW47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBtQ29sdW1uICs9IGR4ICogNDsvLyAqIHpvb207CisgICAgICAgICAgICAgICAgICAgICAgICBpZih6b29tID4gMS4wMWYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29sdW1uICs9IChtWm9vbSAtIHpvb20pICogKG54IC0gMC41ZikgKiA0ICogem9vbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1PbGRDb2x1bW4gPSBtQ29sdW1uOworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbHVtbiA9ICgoZmxvYXQpbUNvbHVtbnMpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250cm9sTW9kZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBtWm9vbU1vZGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1ab29tID0gem9vbTsKKyAgICAgICAgICAgICAgICAgICAgbUZsaW5nWCA9IG54OworICAgICAgICAgICAgICAgICAgICBtUmVuZGVyLnNldFpvb20oem9vbSk7CisgICAgICAgICAgICAgICAgICAgIGlmKG1ab29tIDwgMS4wMWYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVTZWxlY3Rpb24obngsIG55KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1Db250cm9sTW9kZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBtQ29sdW1uID0gbU9sZENvbHVtbjsKKyAgICAgICAgICAgICAgICAgICAgbVJlbmRlci5zZXRab29tKDEuZik7CisgICAgICAgICAgICAgICAgICAgIG1SZW5kZXIuc2V0U2VsZWN0ZWQoLTEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gRG8gc29tZXRoaW5nIHdpdGggY29ybmVycyBoZXJlLi4uLgorICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0Q29sdW1uKHRydWUpOworCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBpY29uIGNvbnRyb2wKKyAgICAgICAgICAgIGlmKGFjdCAhPSBldi5BQ1RJT05fVVApIHsKKyAgICAgICAgICAgICAgICBpZihtRmxpbmdNb2RlKSB7CisgICAgICAgICAgICAgICAgICAgIG1Db2x1bW4gKz0gKG1GbGluZ1ggLSBueCkgKiA0OworICAgICAgICAgICAgICAgICAgICBzZXRDb2x1bW4odHJ1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1GbGluZ01vZGUgPSB0cnVlOworICAgICAgICAgICAgICAgIG1GbGluZ1ggPSBueDsKKyAgICAgICAgICAgICAgICBtRmxpbmdZID0gbnk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1GbGluZ01vZGUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBtQ29sdW1uID0gKGZsb2F0KShqYXZhLmxhbmcuTWF0aC5mbG9vcihtQ29sdW1uICogMC4yNWYgKyAwLjNmKSAqIDQuZikgKyAxLmY7CisgICAgICAgICAgICAgICAgc2V0Q29sdW1uKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uVHJhY2tiYWxsRXZlbnQoTW90aW9uRXZlbnQgZXYpCisgICAgeworICAgICAgICBmbG9hdCB4ID0gZXYuZ2V0WCgpOworICAgICAgICBmbG9hdCB5ID0gZXYuZ2V0WSgpOworICAgICAgICAvL0Zsb2F0IHR4ID0gbmV3IEZsb2F0KHgpOworICAgICAgICAvL0Zsb2F0IHR5ID0gbmV3IEZsb2F0KHkpOworICAgICAgICAvL0xvZy5lKCJycyIsIC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ICAgIHVpbnQzMl90IGxpbmVTaXplID0gZVNpemUgKiB3OworICAgIHVpbnQzMl90IGRlc3RXID0gZ2V0RGltWCgpOworCisgICAgY29uc3QgdWludDhfdCAqc3JjID0gc3RhdGljX2Nhc3Q8Y29uc3QgdWludDhfdCAqPihkYXRhKTsKKyAgICBmb3IgKHVpbnQzMl90IGxpbmU9eW9mZjsgbGluZSA8ICh5b2ZmK2gpOyBsaW5lKyspIHsKKyAgICAgICAgbWVtY3B5KGdldEVsZW1lbnQoeG9mZiwgbGluZSksIHNyYywgbGluZVNpemUpOworICAgICAgICBzcmMgKz0gbGluZVNpemU7CisgICAgfQorfQorCit2b2lkIEFkYXB0ZXIyRDo6ZGF0YShjb25zdCB2b2lkICpkYXRhKQoreworICAgIG1lbWNweShnZXRFbGVtZW50KDAsMCksCisgICAgICAgICAgIGRhdGEsCisgICAgICAgICAgIG1BbGxvY2F0aW9uLmdldCgpLT5nZXRUeXBlKCktPmdldFNpemVCeXRlcygpKTsKK30KKworCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKK25hbWVzcGFjZSByZW5kZXJzY3JpcHQgeworCitSc0FkYXB0ZXIyRCByc2lfQWRhcHRlcjJEQ3JlYXRlKENvbnRleHQgKnJzYykKK3sKKyAgICBBZGFwdGVyMkQgKmEgPSBuZXcgQWRhcHRlcjJEKCk7CisgICAgYS0+aW5jVXNlclJlZigpOworICAgIHJldHVybiBhOworfQorCit2b2lkIHJzaV9BZGFwdGVyMkRCaW5kQWxsb2NhdGlvbihDb250ZXh0ICpyc2MsIFJzQWRhcHRlcjJEIHZhLCBSc0FsbG9jYXRpb24gdmFsbG9jKQoreworICAgIEFkYXB0ZXIyRCAqIGEgPSBzdGF0aWNfY2FzdDxBZGFwdGVyMkQgKj4odmEpOworICAgIEFsbG9jYXRpb24gKiBhbGxvYyA9IHN0YXRpY19jYXN0PEFsbG9jYXRpb24gKj4odmFsbG9jKTsKKyAgICBhLT5zZXRBbGxvY2F0aW9uKGFsbG9jKT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dWZmZXJPYmplY3QoKTsKK30KKworc3RhdGljIHZvaWQgbWlwNTY1KGNvbnN0IEFkYXB0ZXIyRCAmb3V0LCBjb25zdCBBZGFwdGVyMkQgJmluKQoreworICAgIHVpbnQzMl90IHcgPSBvdXQuZ2V0RGltWCgpOworICAgIHVpbnQzMl90IGggPSBvdXQuZ2V0RGltWSgpOworCisgICAgZm9yICh1aW50MzJfdCB5PTA7IHkgPCBoOyB5KyspIHsKKyAgICAgICAgdWludDE2X3QgKm9QdHIgPSBzdGF0aWNfY2FzdDx1aW50MTZfdCAqPihvdXQuZ2V0RWxlbWVudCgwLCB5KSk7CisgICAgICAgIGNvbnN0IHVpbnQxNl90ICppMSA9IHN0YXRpY19jYXN0PHVpbnQxNl90ICo+KGluLmdldEVsZW1lbnQoMCwgeSoyKSk7CisgICAgICAgIGNvbnN0IHVpbnQxNl90ICppMiA9IHN0YXRpY19jYXN0PHVpbnQxNl90ICo+KGluLmdldEVsZW1lbnQoMCwgeSoyKzEpKTsKKworICAgICAgICBmb3IgKHVpbnQzMl90IHg9MDsgeCA8IHc7IHgrKykgeworICAgICAgICAgICAgKm9QdHIgPSByc0JveEZpbHRlcjU2NShpMVswXSwgaTFbMV0sIGkyWzBdLCBpMlsxXSk7CisgICAgICAgICAgICBvUHRyICsrOworICAgICAgICAgICAgaTEgKz0gMjsKKyAgICAgICAgICAgIGkyICs9IDI7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIG1pcDg4ODgoY29uc3QgQWRhcHRlcjJEICZvdXQsIGNvbnN0IEFkYXB0ZXIyRCAmaW4pCit7CisgICAgdWludDMyX3QgdyA9IG91dC5nZXREaW1YKCk7CisgICAgdWludDMyX3QgaCA9IG91dC5nZXREaW1ZKCk7CisKKyAgICBmb3IgKHVpbnQzMl90IHk9MDsgeSA8IGg7IHkrKykgeworICAgICAgICB1aW50MzJfdCAqb1B0ciA9IHN0YXRpY19jYXN0PHVpbnQzMl90ICo+KG91dC5nZXRFbGVtZW50KDAsIHkpKTsKKyAgICAgICAgY29uc3QgdWludDMyX3QgKmkxID0gc3RhdGljX2Nhc3Q8dWludDMyX3QgKj4oaW4uZ2V0RWxlbWVudCgwLCB5KjIpKTsKKyAgICAgICAgY29uc3QgdWludDMyX3QgKmkyID0gc3RhdGljX2Nhc3Q8dWludDMyX3QgKj4oaW4uZ2V0RWxlbWVudCgwLCB5KjIrMSkpOworCisgICAgICAgIGZvciAodWludDMyX3QgeD0wOyB4IDwgdzsgeCsrKSB7CisgICAgICAgICAgICAqb1B0ciA9IHJzQm94RmlsdGVyODg4OChpMVswXSwgaTFbMV0sIGkyWzBdLCBpMlsxXSk7CisgICAgICAgICAgICBvUHRyICsrOworICAgICAgICAgICAgaTEgKz0gMjsKKyAgICAgICAgICAgIGkyICs9IDI7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIG1pcChjb25zdCBBZGFwdGVyMkQgJm91dCwgY29uc3QgQWRhcHRlcjJEICZpbikKK3sKKyAgICBzd2l0Y2gob3V0LmdldEJhc2VUeXBlKCktPmdldEVsZW1lbnQoKS0+Z2V0U2l6ZUJpdHMoKSkgeworICAgIGNhc2UgMzI6CisgICAgICAgIG1pcDg4ODgob3V0LCBpbik7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgMTY6CisgICAgICAgIG1pcDU2NShvdXQsIGluKTsKKyAgICAgICAgYnJlYWs7CisKKyAgICB9CisKK30KKwordHlwZWRlZiB2b2lkICgqRWxlbWVudENvbnZlcnRlcl90KSh2b2lkICpkc3QsIGNvbnN0IHZvaWQgKnNyYywgdWludDMyX3QgY291bnQpOworCitzdGF0aWMgdm9pZCBlbGVtZW50Q29udmVydGVyX2NweV8xNih2b2lkICpkc3QsIGNvbnN0IHZvaWQgKnNyYywgdWludDMyX3QgY291bnQpCit7CisgICAgbWVtY3B5KGRzdCwgc3JjLCBjb3VudCAqIDIpOworfQorc3RhdGljIHZvaWQgZWxlbWVudENvbnZlcnRlcl9jcHlfOCh2b2lkICpkc3QsIGNvbnN0IHZvaWQgKnNyYywgdWludDMyX3QgY291bnQpCit7CisgICAgbWVtY3B5KGRzdCwgc3JjLCBjb3VudCk7Cit9CitzdGF0aWMgdm9pZCBlbGVtZW50Q29udmVydGVyX2NweV8zMih2b2lkICpkc3QsIGNvbnN0IHZvaWQgKnNyYywgdWludDMyX3QgY291bnQpCit7CisgICAgbWVtY3B5KGRzdCwgc3JjLCBjb3VudCAqIDQpOworfQorCisKK3N0YXRpYyB2b2lkIGVsZW1lbnRDb252ZXJ0ZXJfODg4X3RvXzU2NSh2b2lkICpkc3QsIGNvbnN0IHZvaWQgKnNyYywgdWludDMyX3QgY291bnQpCit7CisgICAgdWludDE2X3QgKmQgPSBzdGF0aWNfY2FzdDx1aW50MTZfdCAqPihkc3QpOworICAgIGNvbnN0IHVpbnQ4X3QgKnMgPSBzdGF0aWNfY2FzdDxjb25zdCB1aW50OF90ICo+KHNyYyk7CisKKyAgICB3aGlsZShjb3VudC0tKSB7CisgICAgICAgICpkID0gcnM4ODh0bzU2NShzWzBdLCBzWzFdLCBzWzJdKTsKKyAgICAgICAgZCsrOworICAgICAgICBzKz0gMzsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIGVsZW1lbnRDb252ZXJ0ZXJfODg4OF90b181NjUodm9pZCAqZHN0LCBjb25zdCB2b2lkICpzcmMsIHVpbnQzMl90IGNvdW50KQoreworICAgIHVpbnQxNl90ICpkID0gc3RhdGljX2Nhc3Q8dWludDE2X3QgKj4oZHN0KTsKKyAgICBjb25zdCB1aW50OF90ICpzID0gc3RhdGljX2Nhc3Q8Y29uc3QgdWludDhfdCAqPihzcmMpOworCisgICAgd2hpbGUoY291bnQtLSkgeworICAgICAgICAqZCA9IHJzODg4dG81NjUoc1swXSwgc1sxXSwgc1syXSk7CisgICAgICAgIGQrKzsKKyAgICAgICAgcys9IDQ7CisgICAgfQorfQorCitzdGF0aWMgRWxlbWVudENvbnZlcnRlcl90IHBpY2tDb252ZXJ0ZXIoY29uc3QgRWxlbWVudCAqZHN0LCBjb25zdCBFbGVtZW50ICpzcmMpCit7CisgICAgR0xlbnVtIHNyY0dMVHlwZSA9IHNyYy0+Z2V0R0xUeXBlKCk7CisgICAgR0xlbnVtIHNyY0dMRm10ID0gc3JjLT5nZXRHTEZvcm1hdCgpOworICAgIEdMZW51bSBkc3RHTFR5cGUgPSBkc3QtPmdldEdMVHlwZSgpOworICAgIEdMZW51bSBkc3RHTEZtdCA9IGRzdC0+Z2V0R0xGb3JtYXQoKTsKKworICAgIGlmIChzcmNHTEZtdCA9PSBkc3RHTEZtdCAmJiBzcmNHTFR5cGUgPT0gZHN0R0xUeXBlKSB7CisgICAgICAgIHN3aXRjaChkc3QtPmdldFNpemVCeXRlcygpKSB7CisgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgIHJldHVybiBlbGVtZW50Q29udmVydGVyX2NweV8zMjsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgcmV0dXJuIGVsZW1lbnRDb252ZXJ0ZXJfY3B5XzE2OworICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICByZXR1cm4gZWxlbWVudENvbnZlcnRlcl9jcHlfODsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChzcmNHTFR5cGUgPT0gR0xfVU5TSUdORURfQllURSAmJgorICAgICAgICBzcmNHTEZtdCA9PSBHTF9SR0IgJiYKKyAgICAgICAgZHN0R0xUeXBlID09IEdMX1VOU0lHTkVEX1NIT1JUXzVfNl81ICYmCisgICAgICAgIGRzdEdMVHlwZSA9PSBHTF9SR0IpIHsKKworICAgICAgICByZXR1cm4gZWxlbWVudENvbnZlcnRlcl84ODhfdG9fNTY1OworICAgIH0KKworICAgIGlmIChzcmNHTFR5cGUgPT0gR0xfVU5TSUdORURfQllURSAmJgorICAgICAgICBzcmNHTEZtdCA9PSBHTF9SR0JBICYmCisgICAgICAgIGRzdEdMVHlwZSA9PSBHTF9VTlNJR05FRF9TSE9SVF81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iwgaDIsIF9kc3QsIF9zcmMsIGdlbk1pcHMsIHRtcCk7CisgICAgZnJlZSh0bXApOworICAgIHJldHVybiByZXQ7CisKKworCisKK30KKworCitSc0FsbG9jYXRpb24gcnNpX0FsbG9jYXRpb25DcmVhdGVGcm9tRmlsZShDb250ZXh0ICpyc2MsIGNvbnN0IGNoYXIgKmZpbGUsIGJvb2wgZ2VuTWlwcykKK3sKKyAgICBib29sIHVzZTMyYnBwID0gZmFsc2U7CisKKyAgICB0eXBlZGVmIHN0cnVjdCBfV2luM3hCaXRtYXBIZWFkZXIKKyAgICB7CisgICAgICAgdWludDE2X3QgdHlwZTsKKyAgICAgICB1aW50MzJfdCB0b3RhbFNpemU7CisgICAgICAgdWludDMyX3QgcmVzZXJ2ZWQ7CisgICAgICAgdWludDMyX3Qgb2Zmc2V0OworICAgICAgIGludDMyX3QgaGRyU2l6ZTsgICAgICAgICAgICAvKiBTaXplIG9mIHRoaXMgaGVhZGVyIGluIGJ5dGVzICovCisgICAgICAgaW50MzJfdCB3aWR0aDsgICAgICAgICAgIC8qIEltYWdlIHdpZHRoIGluIHBpeGVscyAqLworICAgICAgIGludDMyX3QgaGVpZ2h0OyAgICAgICAgICAvKiBJbWFnZSBoZWlnaHQgaW4gcGl4ZWxzICovCisgICAgICAgaW50MTZfdCBwbGFuZXM7ICAgICAgICAgIC8qIE51bWJlciBvZiBjb2xvciBwbGFuZXMgKi8KKyAgICAgICBpbnQxNl90IGJwcDsgICAgICAgICAgICAgLyogTnVtYmVyIG9mIGJpdHMgcGVyIHBpeGVsICovCisgICAgICAgLyogRmllbGRzIGFkZGVkIGZvciBXaW5kb3dzIDMueCBmb2xsb3cgdGhpcyBsaW5lICovCisgICAgICAgaW50MzJfdCBjb21wcmVzc2lvbjsgICAgIC8qIENvbXByZXNzaW9uIG1ldGhvZHMgdXNlZCAqLworICAgICAgIGludDMyX3Qgc2l6ZU9mQml0bWFwOyAgICAvKiBTaXplIG9mIGJpdG1hcCBpbiBieXRlcyAqLworICAgICAgIGludDMyX3QgaG9yelJlc29sdXRpb247ICAvKiBIb3Jpem9udGFsIHJlc29sdXRpb24gaW4gcGl4ZWxzIHBlciBtZXRlciAqLworICAgICAgIGludDMyX3QgdmVydFJlc29sdXRpb247ICAvKiBWZXJ0aWNhbCByZXNvbHV0aW9uIGluIHBpeGVscyBwZXIgbWV0ZXIgKi8KKyAgICAgICBpbnQzMl90IGNvbG9yc1VzZWQ7ICAgICAgLyogTnVtYmVyIG9mIGNvbG9ycyBpbiB0aGUgaW1hZ2UgKi8KKyAgICAgICBpbnQzMl90IGNvbG9yc0ltcG9ydGFudDsgLyogTWluaW11bSBudW1iZXIgb2YgaW1wb3J0YW50IGNvbG9ycyAqLworICAgIH0gX19hdHRyaWJ1dGVfXygoX19wYWNrZWRfXykpIFdJTjNYQklUTUFQSEVBREVSOworCisgICAgX1dpbjN4Qml0bWFwSGVhZGVyIGhkcjsKKworICAgIEZJTEUgKmYgPSBmb3BlbihmaWxlLCAicmIiKTsKKyAgICBpZiAoZiA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoInJzQWxsb2NhdGlvbkNyZWF0ZUZyb21CaXRtYXAgZmFpbGVkIHRvIG9wZW4gZmlsZSAlcyIsIGZpbGUpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgbWVtc2V0KCZoZHIsIDAsIHNpemVvZihoZHIpKTsKKyAgICBmcmVhZCgmaGRyLCBzaXplb2YoaGRyKSwgMSwgZik7CisKKyAgICBpZiAoaGRyLmJwcCAhPSAyNCkgeworICAgICAgICBMT0dFKCJVbnN1cG9ydGVkIEJNUCB0eXBlIik7CisgICAgICAgIGZjbG9zZShmKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgaW50MzJfdCB0ZXhXaWR0aCA9IHJzSGlnaGVyUG93MihoZHIud2lkdGgpOworICAgIGludDMyX3QgdGV4SGVpZ2h0ID0gcnNIaWdoZXJQb3cyKGhkci5oZWlnaHQpOworC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RoICogM107CisgICAgdWludDMyX3QgeU9mZnNldCA9IChoZHIud2lkdGggLSBoZHIuaGVpZ2h0KSAvIDI7CisKKyAgICBpZiAodXNlMzJicHApIHsKKyAgICAgICAgdWludDhfdCAqdG1wID0gc3RhdGljX2Nhc3Q8dWludDhfdCAqPihhZGFwdC5nZXRFbGVtZW50KDAsIHlPZmZzZXQpKTsKKyAgICAgICAgZm9yIChpbnQgeT0wOyB5IDwgaGRyLmhlaWdodDsgeSsrKSB7CisgICAgICAgICAgICBmc2VlayhmLCBoZHIub2Zmc2V0ICsgKHkqaGRyLndpZHRoKjMpLCBTRUVLX1NFVCk7CisgICAgICAgICAgICBmcmVhZChmaWxlSW5CdWYsIDEsIGhkci53aWR0aCAqIDMsIGYpOworICAgICAgICAgICAgZm9yKGludCB4PTA7IHggPCBoZHIud2lkdGg7IHgrKykgeworICAgICAgICAgICAgICAgIHRtcFswXSA9IGZpbGVJbkJ1Zlt4KjMgKyAyXTsKKyAgICAgICAgICAgICAgICB0bXBbMV0gPSBmaWxlSW5CdWZbeCozICsgMV07CisgICAgICAgICAgICAgICAgdG1wWzJdID0gZmlsZUluQnVmW3gqM107CisgICAgICAgICAgICAgICAgdG1wWzNdID0gMHhmZjsKKyAgICAgICAgICAgICAgICB0bXAgKz0gNDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICAgIHVpbnQxNl90ICp0bXAgPSBzdGF0aWNfY2FzdDx1aW50MTZfdCAqPihhZGFwdC5nZXRFbGVtZW50KDAsIHlPZmZzZXQpKTsKKyAgICAgICAgZm9yIChpbnQgeT0wOyB5IDwgaGRyLmhlaWdodDsgeSsrKSB7CisgICAgICAgICAgICBmc2VlayhmLCBoZHIub2Zmc2V0ICsgKHkqaGRyLndpZHRoKjMpLCBTRUVLX1NFVCk7CisgICAgICAgICAgICBmcmVhZChmaWxlSW5CdWYsIDEsIGhkci53aWR0aCAqIDMsIGYpOworICAgICAgICAgICAgZm9yKGludCB4PTA7IHggPCBoZHIud2lkdGg7IHgrKykgeworICAgICAgICAgICAgICAgICp0bXAgPSByczg4OHRvNTY1KGZpbGVJbkJ1Zlt4KjMgKyAyXSwgZmlsZUluQnVmW3gqMyArIDFdLCBmaWxlSW5CdWZbeCozXSk7CisgICAgICAgICAgICAgICAgdG1wKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBmY2xvc2UoZik7CisgICAgZGVsZXRlIFtdIGZpbGVJbkJ1ZjsKKworICAgIGlmIChnZW5NaXBzKSB7CisgICAgICAgIEFkYXB0ZXIyRCBhZGFwdDIodGV4QWxsb2MpOworICAgICAgICBmb3IodWludDMyX3QgbG9kPTA7IGxvZCA8ICh0ZXhBbGxvYy0+Z2V0VHlwZSgpLT5nZXRMT0RDb3VudCgpIC0xKTsgbG9kKyspIHsKKyAgICAgICAgICAgIGFkYXB0LnNldExPRChsb2QpOworICAgICAgICAgICAgYWRhcHQyLnNldExPRChsb2QgKyAxKTsKKyAgICAgICAgICAgIG1pcChhZGFwdDIsIGFkYXB0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiB0ZXhBbGxvYzsKK30KKwordm9pZCByc2lfQWxsb2NhdGlvbkRhdGEoQ29udGV4dCAqcnNjLCBSc0FsbG9jYXRpb24gdmEsIGNvbnN0IHZvaWQgKmRhdGEsIHVpbnQzMl90IHNpemVCeXRlcykKK3sKKyAgICBBbGxvY2F0aW9uICphID0gc3RhdGljX2Nhc3Q8QWxsb2NhdGlvbiAqPih2YSk7CisgICAgYS0+ZGF0YShkYXRhLCBzaXplQnl0ZXMpOworICAgIHJzYy0+YWxsb2NhdGlvbkNoZWNrKGEpOworfQorCit2b2lkIHJzaV9BbGxvY2F0aW9uMURTdWJEYXRhKENvbnRleHQgKnJzYywgUnNBbGxvY2F0aW9uIHZhLCB1aW50MzJfdCB4b2ZmLCB1aW50MzJfdCBjb3VudCwgY29uc3Qgdm9pZCAqZGF0YSwgdWludDMyX3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Cit7CisgICAgbVR5cGUgPSBkdDsKKyAgICBtS2luZCA9IGRrOworICAgIG1Jc05vcm1hbGl6ZWQgPSBpc05vcm1hbGl6ZWQ7CisgICAgbUJpdHMgPSBiaXRzOworICAgIGlmIChuYW1lKSB7CisgICAgICAgIG1OYW1lID0gbmFtZTsKKyAgICB9Cit9CisKK2NvbnN0IGNoYXIgKiBDb21wb25lbnQ6OmdldENUeXBlKCkgY29uc3QKK3sKKyAgICBzd2l0Y2gobVR5cGUpIHsKKyAgICBjYXNlIEZMT0FUOgorICAgICAgICByZXR1cm4gImZsb2F0IjsKKyAgICBjYXNlIFNJR05FRDoKKyAgICBjYXNlIFVOU0lHTkVEOgorICAgICAgICBzd2l0Y2gobUJpdHMpIHsKKyAgICAgICAgY2FzZSAzMjoKKyAgICAgICAgICAgIHJldHVybiAiaW50IjsKKyAgICAgICAgY2FzZSAxNjoKKyAgICAgICAgICAgIHJldHVybiAic2hvcnQiOworICAgICAgICBjYXNlIDg6CisgICAgICAgICAgICByZXR1cm4gImNoYXIiOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKworQ29tcG9uZW50Ojp+Q29tcG9uZW50KCkKK3sKK30KKwordWludDMyX3QgQ29tcG9uZW50OjpnZXRHTFR5cGUoKSBjb25zdAoreworICAgIHN3aXRjaChtVHlwZSkgeworICAgIGNhc2UgUlNfVFlQRV9GTE9BVDoKKyAgICAgICAgcnNBc3NlcnQobUJpdHMgPT0gMzIpOworICAgICAgICByZXR1cm4gR0xfRkxPQVQ7CisgICAgY2FzZSBSU19UWVBFX1NJR05FRDoKKyAgICAgICAgc3dpdGNoKG1CaXRzKSB7CisgICAgICAgIGNhc2UgMzI6CisgICAgICAgICAgICByZXR1cm4gMDsvL0dMX0lOVDsKKyAgICAgICAgY2FzZSAxNjoKKyAgICAgICAgICAgIHJldHVybiBHTF9TSE9SVDsKKyAgICAgICAgY2FzZSA4OgorICAgICAgICAgICAgcm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ERhdGFLaW5kIHsKKyAgICAgICAgVVNFUiwKKyAgICAgICAgUkVELCBHUkVFTiwgQkxVRSwgQUxQSEEsIExVTUlOQU5DRSwgSU5URU5TSVRZLAorICAgICAgICBYLCBZLCBaLCBXLAorICAgICAgICBTLCBULCBRLCBSLAorICAgICAgICBOWCwgTlksIE5aLAorICAgICAgICBJTkRFWCwKKyAgICAgICAgUE9JTlRfU0laRQorICAgIH07CisKKworICAgIENvbXBvbmVudChEYXRhS2luZCBkaywgRGF0YVR5cGUgZHQsIGJvb2wgaXNOb3JtLCB1aW50MzJfdCBiaXRzLCBjb25zdCBjaGFyICopOworICAgIHZpcnR1YWwgfkNvbXBvbmVudCgpOworCisgICAgRGF0YVR5cGUgZ2V0VHlwZSgpIGNvbnN0IHtyZXR1cm4gbVR5cGU7fQorICAgIGJvb2wgZ2V0SXNOb3JtYWxpemVkKCkgY29uc3Qge3JldHVybiBtSXNOb3JtYWxpemVkO30KKyAgICBEYXRhS2luZCBnZXRLaW5kKCkgY29uc3Qge3JldHVybiBtS2luZDt9CisgICAgdWludDMyX3QgZ2V0Qml0cygpIGNvbnN0IHtyZXR1cm4gbUJpdHM7fQorCisgICAgdWludDMyX3QgZ2V0R0xUeXBlKCkgY29uc3Q7CisgICAgY29uc3QgY2hhciAqIGdldENUeXBlKCkgY29uc3Q7CisKKyAgICBjb25zdCBjaGFyICogZ2V0Q29tcG9uZW50TmFtZSgpIGNvbnN0IHtyZXR1cm4gbU5hbWUuc3RyaW5nKCk7fQorCitwcm90ZWN0ZWQ6CisKKyAgICBEYXRhVHlwZSBtVHlwZTsKKyAgICBib29sIG1Jc05vcm1hbGl6ZWQ7CisgICAgRGF0YUtpbmQgbUtpbmQ7CisgICAgdWludDMyX3QgbUJpdHM7CisgICAgU3RyaW5nOCBtTmFtZTsKKworcHJpdmF0ZToKKyAgICBDb21wb25lbnQoKTsKK307CisKKworfQorfQorCisjZW5kaWYgLy9BTkRST0lEX1JTX1NUUlVDVFVSRURfQ09NUE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ojp0aW1lclJlc2V0KCkKK3sKKyAgICBmb3IgKGludCBjdD0wOyBjdCA8IF9SU19USU1FUl9UT1RBTDsgY3QrKykgeworICAgICAgICBtVGltZXJzW2N0XSA9IDA7CisgICAgfQorfQorCit2b2lkIENvbnRleHQ6OnRpbWVySW5pdCgpCit7CisgICAgbVRpbWVMYXN0ID0gZ2V0VGltZSgpOworICAgIG1UaW1lRnJhbWUgPSBtVGltZUxhc3Q7CisgICAgbVRpbWVMYXN0RnJhbWUgPSBtVGltZUxhc3Q7CisgICAgbVRpbWVyQWN0aXZlID0gUlNfVElNRVJfSU5URVJOQUw7CisgICAgdGltZXJSZXNldCgpOworfQorCit2b2lkIENvbnRleHQ6OnRpbWVyRnJhbWUoKQoreworICAgIG1UaW1lTGFzdEZyYW1lID0gbVRpbWVGcmFtZTsKKyAgICBtVGltZUZyYW1lID0gZ2V0VGltZSgpOworfQorCit2b2lkIENvbnRleHQ6OnRpbWVyU2V0KFRpbWVycyB0bSkKK3sKKyAgICB1aW50NjRfdCBsYXN0ID0gbVRpbWVMYXN0OworICAgIG1UaW1lTGFzdCA9IGdldFRpbWUoKTsKKyAgICBtVGltZXJzW21UaW1lckFjdGl2ZV0gKz0gbVRpbWVMYXN0IC0gbGFzdDsKKyAgICBtVGltZXJBY3RpdmUgPSB0bTsKK30KKwordm9pZCBDb250ZXh0Ojp0aW1lclByaW50KCkKK3sKKyAgICBkb3VibGUgdG90YWwgPSAwOworICAgIGZvciAoaW50IGN0ID0gMDsgY3QgPCBfUlNfVElNRVJfVE9UQUw7IGN0KyspIHsKKyAgICAgICAgdG90YWwgKz0gbVRpbWVyc1tjdF07CisgICAgfQorICAgIHVpbnQ2NF90IGZyYW1lID0gbVRpbWVGcmFtZSAtIG1UaW1lTGFzdEZyYW1lOworCisgICAgTE9HVigiUlM6IEZyYW1lICglbGxpKSwgICBTY3JpcHQgJTIuMWYgKCVsbGkpLCAgQ2xlYXIgJiBTd2FwICUyLjFmICglbGxpKSwgIElkbGUg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1JTy5wbGF5Q29yZUNvbW1hbmRzKHJzYywgIW1EcmF3KTsKKyAgICAgICAgIG1EcmF3ICY9IChyc2MtPm1Sb290U2NyaXB0LmdldCgpICE9IE5VTEwpOworCisgICAgICAgICBpZiAobURyYXcpIHsKKyAgICAgICAgICAgICBtRHJhdyA9IHJzYy0+cnVuUm9vdFNjcmlwdCgpOworI2lmIFJTX0xPR19USU1FUworICAgICAgICAgICAgIHJzYy0+dGltZXJTZXQoUlNfVElNRVJfQ0xFQVJfU1dBUCk7CisjZW5kaWYKKyAgICAgICAgICAgICBlZ2xTd2FwQnVmZmVycyhyc2MtPm1FR0wubURpc3BsYXksIHJzYy0+bUVHTC5tU3VyZmFjZSk7CisjaWYgUlNfTE9HX1RJTUVTCisgICAgICAgICAgICAgcnNjLT50aW1lckZyYW1lKCk7CisgICAgICAgICAgICAgcnNjLT50aW1lclNldChSU19USU1FUl9JTlRFUk5BTCk7CisgICAgICAgICAgICAgcnNjLT50aW1lclByaW50KCk7CisgICAgICAgICAgICAgcnNjLT50aW1lclJlc2V0KCk7CisjZW5kaWYKKyAgICAgICAgIH0KKyAgICAgICAgIGlmIChyc2MtPm1PYmpEZXN0cm95Lm1OZWVkVG9FbXB0eSkgeworICAgICAgICAgICAgIHJzYy0+b2JqRGVzdHJveU9PQlJ1bigpOworICAgICAgICAgfQorICAgICB9CisKKyAgICAgTE9HVigiUlMgVGhyZWFkIGV4aXRpbmciKTsKKyAgICAgZ2xDbGVhckNvbG9yKDAsMCwwLDApOworICAgICBnbENsZWFyKEdMX0NPTE9SX0JVRkZFUl9CSVQpOworICAgICBlZ2xTd2FwQnVmZmVycyhyc2MtPm1FR0wubURpc3BsYXksIHJzYy0+bUVHTC5tU3VyZmFjZSk7CisgICAgIGVnbFRlcm1pbmF0ZShyc2MtPm1FR0wubURpc3BsYXkpOworICAgICByc2MtPm9iakRlc3Ryb3lPT0JSdW4oKTsKKyAgICAgTE9HVigiUlMgVGhyZWFkIGV4aXRlZCIpOworICAg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yZWFkUHJvYywgdGhpcyk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJGYWlsZWQgdG8gc3RhcnQgcnMgY29udGV4dCB0aHJlYWQuIik7CisgICAgfQorCisgICAgd2hpbGUoIW1SdW5uaW5nKSB7CisgICAgICAgIHNsZWVwKDEpOworICAgIH0KKworICAgIHB0aHJlYWRfYXR0cl9kZXN0cm95KCZ0aHJlYWRBdHRyKTsKK30KKworQ29udGV4dDo6fkNvbnRleHQoKQoreworICAgIExPR1YoIkNvbnRleHQ6On5Db250ZXh0Iik7CisgICAgbUV4aXQgPSB0cnVlOworICAgIHZvaWQgKnJlczsKKworICAgIG1JTy5zaHV0ZG93bigpOworICAgIGludCBzdGF0dXMgPSBwdGhyZWFkX2pvaW4obVRocmVhZElkLCAmcmVzKTsKKyAgICBvYmpEZXN0cm95T09CUnVuKCk7CisKKyAgICBpZiAobURldikgeworICAgICAgICBtRGV2LT5yZW1vdmVDb250ZXh0KHRoaXMpOworICAgICAgICBwdGhyZWFkX2tleV9kZWxldGUoZ1RocmVhZFRMU0tleSk7CisgICAgfQorCisgICAgb2JqRGVzdHJveU9PQkRlc3Ryb3koKTsKK30KKwordm9pZCBDb250ZXh0OjpzZXRSb290U2NyaXB0KFNjcmlwdCAqcykKK3sKKyAgICBtUm9vdFNjcmlwdC5zZXQocyk7Cit9CisKK3ZvaWQgQ29udGV4dDo6c2V0RnJhZ21lbnRTdG9yZShQcm9ncmFtRnJhZ21lbnRTdG9yZSAqcGZzKQoreworICAgIGlmIChwZnMgPT0gTlVMTCkgeworICAgICAgICBtRnJhZ21lbnRTdG9yZS5zZXQobVN0YXRlRnJhZ21lbnRTdG9yZS5tRGVmYXVsdCk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgbUZyYWdtZW50U3RvcmUuc2V0KHBmcyk7CisgICAgfQorfQorCit2b2lkIENvbnRleHQ6OnNldEZyYWdtZW50KFByb2dyYW1GcmFnbWVudCAqcGYpCit7CisgICAgaWYgKHBmID09IE5VTEwpIHsKKyAgICAgICAgbUZyYWdtZW50LnNldChtU3RhdGVGcmFnbWVudC5tRGVmYXVsdCk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgbUZyYWdtZW50LnNldChwZik7CisgICAgfQorfQorCit2b2lkIENvbnRleHQ6OmFsbG9jYXRpb25DaGVjayhjb25zdCBBbGxvY2F0aW9uICphKQoreworICAgIG1WZXJ0ZXgtPmNoZWNrVXBkYXRlZEFsbG9jYXRpb24oYSk7CisgICAgbUZyYWdtZW50LT5jaGVja1VwZGF0ZWRBbGxvY2F0aW9uKGEpOworICAgIG1GcmFnbWVudFN0b3JlLT5jaGVja1VwZGF0ZWRBbGxvY2F0aW9uKGEpOworfQorCit2b2lkIENvbnRleHQ6OnNldFZlcnRleChQcm9ncmFtVmVydGV4ICpwdikKK3sKKyAgICBpZiAocHYgPT0gTlVMTCkgeworICAgICAgICBtVmVydGV4LnNldChtU3RhdGVWZXJ0ZXgubURlZmF1bHQpOworICAgIH0gZWxzZSB7CisgICAgICAgIG1WZXJ0ZXguc2V0KHB2KTsKKyAgICB9Cit9CisKK3ZvaWQgQ29udGV4dDo6YXNzaWduTmFtZShPYmplY3RCYXNlICpvYmosIGNvbnN0IGNoYXIgKm5hbWUsIHVpbnQzMl90IGxlbikKK3sKKyAgICByc0Fzc2VydCghb2JqLT5nZXROYW1lKCkpOworICAgIG9iai0+c2V0TmFtZShuYW1lLCBsZW4pOworICAgIG1OYW1lcy5hZGQob2JqKTsKK30KKwordm9pZCBDb250ZXh0OjpyZW1vdmVOYW1lKE9iamVjdEJhc2UgKm9iaikKK3sKKyAgICBmb3Ioc2l6ZV90IGN0PTA7IGN0IDwgbU5hbWVzLnNpemUoKTsgY3QrKykgeworICAgICAgICBpZiAob2JqID09IG1OYW1lc1tjdF0pIHsKKyAgICAgICAgICAgIG1OYW1lcy5yZW1vdmVBdChjdCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9Cit9CisKK09iam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WZpbmVzLnZhbHVlQXQoY3QpKTsKKyAgICAgICAgc3RyLT5hcHBlbmQoYnVmKTsKKworICAgIH0KKyAgICBmb3IgKHNpemVfdCBjdD0wOyBjdCA8IG1GbG9hdERlZmluZXMuc2l6ZSgpOyBjdCsrKSB7CisgICAgICAgIHN0ci0+YXBwZW5kKCIjZGVmaW5lICIpOworICAgICAgICBzdHItPmFwcGVuZChtRmxvYXREZWZpbmVzLmtleUF0KGN0KSk7CisgICAgICAgIHN0ci0+YXBwZW5kKCIgIik7CisgICAgICAgIHNwcmludGYoYnVmLCAiJWZmXG4iLCBtRmxvYXREZWZpbmVzLnZhbHVlQXQoY3QpKTsKKyAgICAgICAgc3RyLT5hcHBlbmQoYnVmKTsKKyAgICB9Cit9CisKK2Jvb2wgQ29udGV4dDo6b2JqRGVzdHJveU9PQkluaXQoKQoreworICAgIGludCBzdGF0dXMgPSBwdGhyZWFkX211dGV4X2luaXQoJm1PYmpEZXN0cm95Lm1NdXRleCwgTlVMTCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJDb250ZXh0OjpPYmpEZXN0cm95T09CSW5pdCBtdXRleCBpbml0IGZhaWx1cmUiKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICByZXR1cm4gdHJ1ZTsKK30KKwordm9pZCBDb250ZXh0OjpvYmpEZXN0cm95T09CUnVuKCkKK3sKKyAgICBpZiAobU9iakRlc3Ryb3kubU5lZWRUb0VtcHR5KSB7CisgICAgICAgIGludCBzdGF0dXMgPSBwdGhyZWFkX211dGV4X2xvY2soJm1PYmpEZXN0cm95Lm1NdXRleCk7CisgICAgICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICAgICAgIExPR0UoIkNvbnRleHQ6Ok9iakRlc3Ryb3lPT0JSdW46IGVycm9yICVpIGxvY2tpbmcgZm9yIE9PQlJ1bi4iLCBzdGF0dXMpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICA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G5hbWUpLCB2YWx1ZSk7CisgICAgfQorCisgICAgdm9pZCBhZGRGbG9hdERlZmluZShjb25zdCBjaGFyKiBuYW1lLCBmbG9hdCB2YWx1ZSkgeworICAgICAgICBtRmxvYXREZWZpbmVzLmFkZChTdHJpbmc4KG5hbWUpLCB2YWx1ZSk7CisgICAgfQorCisgICAgdWludDMyX3QgZ2V0V2lkdGgoKSBjb25zdCB7cmV0dXJuIG1FR0wubVdpZHRoO30KKyAgICB1aW50MzJfdCBnZXRIZWlnaHQoKSBjb25zdCB7cmV0dXJuIG1FR0wubUhlaWdodDt9CisKKworICAgIFRocmVhZElPIG1JTzsKKyAgICB2b2lkIG9iakRlc3Ryb3lBZGQoT2JqZWN0QmFzZSAqKTsKKworICAgIC8vIFRpbWVycworICAgIGVudW0gVGltZXJzIHsKKyAgICAgICAgUlNfVElNRVJfSURMRSwKKyAgICAgICAgUlNfVElNRVJfSU5URVJOQUwsCisgICAgICAgIFJTX1RJTUVSX1NDUklQVCwKKyAgICAgICAgUlNfVElNRVJfQ0xFQVJfU1dBUCwKKyAgICAgICAgX1JTX1RJTUVSX1RPVEFMCisgICAgfTsKKyAgICB1aW50NjRfdCBnZXRUaW1lKCkgY29uc3Q7CisgICAgdm9pZCB0aW1lckluaXQoKTsKKyAgICB2b2lkIHRpbWVyUmVzZXQoKTsKKyAgICB2b2lkIHRpbWVyU2V0KFRpbWVycyk7CisgICAgdm9pZCB0aW1lclByaW50KCk7CisgICAgdm9pZCB0aW1lckZyYW1lKCk7CisKKyAgICBib29sIGNoZWNrVmVyc2lvbjFfMSgpIGNvbnN0IHtyZXR1cm4gKG1HTC5tTWFqb3JWZXJzaW9uID4gMSkgfHwgKG1HTC5tTWlub3JWZXJzaW9uID49IDEpOyB9CisgICAgYm9vbCBjaGVja1ZlcnNpb24yXzAoKSBjb25zdCB7cmV0dXJuIG1HTC5tTWFqb3JWZXJzaW9uID49IDI7IH0KKworcHJvdGVjdGVkOgorICAgIERldmljZSAqbURldjsKKworICAgIHN0cnVjdCB7CisgICAgICAgIEVHTGludCBtTnVtQ29uZmlnczsKKyAgICAgICAgRUdMaW50IG1NYWpvclZlcnNpb247CisgICAgICAgIEVHTGludCBtTWlub3JWZXJzaW9uOworICAgICAgICBFR0xDb25maWcgbUNvbmZpZzsKKyAgICAgICAgRUdMQ29udGV4dCBtQ29udGV4dDsKKyAgICAgICAgRUdMU3VyZmFjZSBtU3VyZmFjZTsKKyAgICAgICAgRUdMaW50IG1XaWR0aDsKKyAgICAgICAgRUdMaW50IG1IZWlnaHQ7CisgICAgICAgIEVHTERpc3BsYXkgbURpc3BsYXk7CisgICAgfSBtRUdMOworCisgICAgc3RydWN0IHsKKyAgICAgICAgY29uc3QgdWludDhfdCAqIG1WZW5kb3I7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKiBtUmVuZGVyZXI7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKiBtVmVyc2lvbjsKKyAgICAgICAgY29uc3QgdWludDhfdCAqIG1FeHRlbnNpb25zOworCisgICAgICAgIHVpbnQzMl90IG1NYWpvclZlcnNpb247CisgICAgICAgIHVpbnQzMl90IG1NaW5vclZlcnNpb247CisKKyAgICB9IG1HTDsKKworICAgIGJvb2wgbVJ1bm5pbmc7CisgICAgYm9vbCBtRXhpdDsKKyAgICBib29sIG1Vc2VEZXB0aDsKKworICAgIHB0aHJlYWRfdCBtVGhyZWFkSWQ7CisKKyAgICBPYmplY3RCYXNlUmVmPFNjcmlwdD4gbVJvb3RTY3JpcHQ7CisgICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtRnJhZ21lbnQ+IG1GcmFnbWVudDsKKyAgICBPYmplY3RCYXNlUmVmPFByb2dyYW1WZXJ0ZXg+IG1WZXJ0ZXg7CisgICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtRnJhZ21lbnRTdG9yZT4gbUZyYWdtZW50U3RvcmU7CisKKworICAgIHN0cnVjdCBPYmpEZXN0cm95T09CIHsKKyAgICAgICAgcHRocmVhZF9tdXRleF90IG1NdXRleDsKKyAgICAgICAgVmVjdG9yPE9iamVjdEJhc2UgKj4gbURlc3Ryb3lMaXN0OworICAgICAgICBib29sIG1OZWVkVG9FbXB0eTsKKyAgICB9OworICAgIE9iakRlc3Ryb3lPT0IgbU9iakRlc3Ryb3k7CisgICAgYm9vbCBvYmpEZXN0cm95T09CSW5pdCgpOworICAgIHZvaWQgb2JqRGVzdHJveU9PQlJ1bigpOworICAgIHZvaWQgb2JqRGVzdHJveU9PQkRlc3Ryb3koKTsKKworcHJpdmF0ZToKKyAgICBDb250ZXh0KCk7CisKKyAgICB2b2lkIGluaXRFR0woKTsKKworICAgIGJvb2wgcnVuU2NyaXB0KFNjcmlwdCAqcywgdWludDMyX3QgbGF1bmNoSUQpOworICAgIGJvb2wgcnVuUm9vdFNjcmlwdCgpOworCisgICAgc3RhdGljIHZvaWQgKiB0aHJlYWRQcm9jKHZvaWQgKik7CisKKyAgICBTdXJmYWNlICptV25kU3VyZmFjZTsKKworICAgIFZlY3RvcjxPYmplY3RCYXNlICo+IG1OYW1lczsKKyAgICBLZXllZFZlY3RvcjxTdHJpbmc4LGludD4gbUludDMyRGVmaW5lczsKKyAgICBLZXllZFZlY3RvcjxTdHJpbmc4LGZsb2F0PiBtRmxvYXREZWZpbmVzOworCisgICAgdWludDY0X3QgbVRpbWVyc1tfUlNfVElNRVJfVE9UQUxdOworICAgIFRpbWVycyBtVGltZXJBY3RpdmU7CisgICAgdWludDY0X3QgbVRpbWVMYXN0OworICAgIHVpbnQ2NF90IG1UaW1lRnJhbWU7CisgICAgdWludDY0X3QgbVRpbWVMYXN0RnJhbWU7Cit9OworCisKK30KK30KKyNlbmRpZgpkaWZmIC0tZ2l0IGEvbGlicy9ycy9yc0RldmljZS5jcHAgYi9saWJzL3JzL3JzRGV2aWNlLmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xYjNjNDFiCi0tLSAvZGV2L251bGwKKysrIGIvbGl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K3sKKworfQorCitEZXZpY2U6On5EZXZpY2UoKQoreworCit9CisKK3ZvaWQgRGV2aWNlOjphZGRDb250ZXh0KENvbnRleHQgKnJzYykKK3sKKyAgICBtQ29udGV4dHMuYWRkKHJzYyk7Cit9CisKK3ZvaWQgRGV2aWNlOjpyZW1vdmVDb250ZXh0KENvbnRleHQgKnJzYykKK3sKKyAgICBmb3IgKHNpemVfdCBpZHg9MDsgaWR4IDwgbUNvbnRleHRzLnNpemUoKTsgaWR4KyspIHsKKyAgICAgICAgaWYgKG1Db250ZXh0c1tpZHhdID09IHJzYykgeworICAgICAgICAgICAgbUNvbnRleHRzLnJlbW92ZUF0KGlkeCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KK30KKworCisKK1JzRGV2aWNlIHJzRGV2aWNlQ3JlYXRlKCkKK3sKKyAgICBEZXZpY2UgKiBkID0gbmV3IERldmljZSgpOworICAgIHJldHVybiBkOworfQorCit2b2lkIHJzRGV2aWNlRGVzdHJveShSc0RldmljZSBkZXYpCit7CisgICAgRGV2aWNlICogZCA9IHN0YXRpY19jYXN0PERldmljZSAqPihkZXYpOworICAgIGRlbGV0ZSBkOworCit9CisKZGlmZiAtLWdpdCBhL2xpYnMvcnMvcnNEZXZpY2UuaCBiL2xpYnMvcnMvcnNEZXZpY2UuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xNTYzMTVmCi0tLSAvZGV2L251bGwKKysrIGIvbGlicy9ycy9yc0RldmljZS5oCkBAIC0wLDAgKzEsNDggQEAKKy8qCisgKiBDb3B5cmlnaHQgKEMpIDIwMDkgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29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ZSwgIDUsIDApOworICAgIENvbXBvbmVudCAqIHJfOCAgPSBuZXcgQ29tcG9uZW50KENvbXBvbmVudDo6UkVELCAgICBDb21wb25lbnQ6OlVOU0lHTkVELCAgdHJ1ZSwgIDgsIDApOworCisgICAgQ29tcG9uZW50ICogZ180ICA9IG5ldyBDb21wb25lbnQoQ29tcG9uZW50OjpHUkVFTiwgIENvbXBvbmVudDo6VU5TSUdORUQsICB0cnVlLCAgNCwgMCk7CisgICAgQ29tcG9uZW50ICogZ181ICA9IG5ldyBDb21wb25lbnQoQ29tcG9uZW50OjpHUkVFTiwgIENvbXBvbmVudDo6VU5TSUdORUQsICB0cnVlLCAgNSwgMCk7CisgICAgQ29tcG9uZW50ICogZ182ICA9IG5ldyBDb21wb25lbnQoQ29tcG9uZW50OjpHUkVFTiwgIENvbXBvbmVudDo6VU5TSUdORUQsICB0cnVlLCAgNiwgMCk7CisgICAgQ29tcG9uZW50ICogZ184ICA9IG5ldyBDb21wb25lbnQoQ29tcG9uZW50OjpHUkVFTiwgIENvbXBvbmVudDo6VU5TSUdORUQsICB0cnVlLCAgOCwgMCk7CisKKyAgICBDb21wb25lbnQgKiBiXzQgID0gbmV3IENvbXBvbmVudChDb21wb25lbnQ6OkJMVUUsICAgQ29tcG9uZW50OjpVTlNJR05FRCwgIHRydWUsICA0LCAwKTsKKyAgICBDb21wb25lbnQgKiBiXzUgID0gbmV3IENvbXBvbmVudChDb21wb25lbnQ6OkJMVUUsICAgQ29tcG9uZW50OjpVTlNJR05FRCwgIHRydWUsICA1LCAwKTsKKyAgICBDb21wb25lbnQgKiBiXzggID0gbmV3IENvbXBvbmVudChDb21wb25lbnQ6OkJMVUUsICAgQ29tcG9uZW50OjpVTlNJR05FRCwgIHRydWUsICA4LCAwKTsKKworICAgIENvbXBvbmVudCAqIGFfMSAgPSBuZXcgQ29tcG9uZW50KENvbXBvbmVudDo6QUxQSEEsICBDb21wb25lbnQ6OlVOU0lHTkVELCAgdHJ1ZSwgIDEsIDApOworICAgIENvbXBvbmVudCAqIGFfNCAgPSBuZXcgQ29tcG9uZW50KENvbXBvbmVudDo6QUxQSEEsICBDb21wb25lbnQ6OlVOU0lHTkVELCAgdHJ1ZSwgIDQsIDApOworICAgIENvbXBvbmVudCAqIGFfOCAgPSBuZXcgQ29tcG9uZW50KENvbXBvbmVudDo6QUxQSEEsICBDb21wb25lbnQ6OlVOU0lHTkVELCAgdHJ1ZSwgIDgsIDApOworCisgICAgQ29tcG9uZW50ICogaWR4XzE2ID0gbmV3IENvbXBvbmVudChDb21wb25lbnQ6OklOREVYLCAgQ29tcG9uZW50OjpVTlNJR05FRCwgIGZhbHNlLCAxNiwgMCk7CisgICAgQ29tcG9uZW50ICogaWR4XzMyID0gbmV3IENvbXBvbmVudChDb21wb25lbnQ6OklOREVYLCAgQ29tcG9uZW50OjpVTlNJR05FRCwgIGZhbHNlLCAzMiwgMCk7CisKKyAgICBDb21wb25lbnQgKiB4ICAgID0gbmV3IENvbXBvbmVudChDb21wb25lbnQ6OlgsICAgICAgQ29tcG9uZW50OjpGTE9BVCwgICAgIGZhbHNlLCAzMiwgMCk7CisgICAgQ29tcG9uZW50ICogeSAgICA9IG5ldyBDb21wb25lbnQoQ29tcG9uZW50OjpZLCAgICAgIENvbXBvbmVudDo6RkxPQVQsICAgICBmYWxzZSwgMzIsIDApOworICAgIENvbXBvbmVudCAqIHogICAgPSBuZXcgQ29tcG9uZW50KENvbXBvbmVudDo6WiwgICAgICBDb21wb25lbnQ6OkZMT0FULCAgICAgZmFsc2UsIDMyLCAwKTsKKworICAgIENvbXBvbmVudCAqIG54ICAgPSBuZXcgQ29tcG9uZW50KENvbXBvbmVudDo6TlgsICAgICBDb21wb25lbnQ6OkZMT0FULCAgICAgZmFsc2UsIDMyLCAwKTsKKyAgICBDb21wb25lbnQgKiBueSAgID0gbmV3IENvbXBvbmVudChDb21wb25lbnQ6Ok5ZLCAgICAgQ29tcG9uZW50OjpGTE9BVCwgICAgIGZhbHNlLCAzMiwgMCk7CisgICAgQ29tcG9uZW50ICogbnogICA9IG5ldyBDb21wb25lbnQoQ29tcG9uZW50OjpOWiwgICAgIENvbXBvbmVudDo6RkxPQVQsICAgICBmYWxzZSwgMzIsIDApOworCisgICAgQ29tcG9uZW50ICogcyAgICA9IG5ldyBDb21wb25lbnQoQ29tcG9uZW50OjpTLCAgICAgIENvbXBvbmVudDo6RkxPQVQsICAgICBmYWxzZSwgMzIsIDApOworICAgIENvbXBvbmVudCAqIHQgICAgPSBuZXcgQ29tcG9uZW50KENvbXBvbmVudDo6VCwgICAgICBDb21wb25lbnQ6OkZMT0FULCAgICAgZmFsc2UsIDMyLCAwKTsKKworICAgIEVsZW1lbnQgKiBlOworCisgICAgZSA9IG5ldyBFbGVtZW50KDEpOworICAgIGUtPnNldENvbXBvbmVudCgwLCB1XzgpOworICAgIG1QcmVkZWZpbmVkTGlzdC5hZGQoUHJlZGVmaW5lZChSU19FTEVNRU5UX1VTRVJfVTgsIGUpKTsKKworICAgIGUgPSBuZXcgRWxlbWVudCgxKTsKKyAgICBlLT5zZXRDb21wb25lbnQoMCwgaV84KTsKKyAgICBtUHJlZGVmaW5lZExpc3QuYWRkKFByZWRlZmluZWQoUlNfRUxFTUVOVF9VU0VSX0k4LCBlKSk7CisKKyAgICBlID0gbmV3IEVsZW1lbnQoMSk7CisgICAgZS0+c2V0Q29tcG9uZW50KDAsIHVfMTYpOworICAgIG1QcmVkZWZpbmVkTGlzdC5hZGQoUHJlZGVmaW5lZChSU19FTEVNRU5UX1VTRVJfVTE2LCBlKSk7CisKKyAgICBlID0gbmV3IEVsZW1lbnQoMSk7CisgICAgZS0+c2V0Q29tcG9uZW50KDAsIGlfMTYpOworICAgIG1QcmVkZWZpbmVkTGlzdC5hZGQoUHJlZGVmaW5lZChSU19FTEVNRU5UX1VTRVJfSTE2LCBlKSk7CisKKyAgICBlID0gbmV3IEVsZW1lbnQoMSk7CisgICAgZS0+c2V0Q29tcG9uZW50KDAsIHVfMzIpOworICAgIG1Qc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T5zZXRDb21wb25lbnQoMCwgeCk7CisgICAgZS0+c2V0Q29tcG9uZW50KDEsIHkpOworICAgIG1QcmVkZWZpbmVkTGlzdC5hZGQoUHJlZGVmaW5lZChSU19FTEVNRU5UX1hZX0YzMiwgZSkpOworCisgICAgZSA9IG5ldyBFbGVtZW50KDMpOworICAgIGUtPnNldENvbXBvbmVudCgwLCB4KTsKKyAgICBlLT5zZXRDb21wb25lbnQoMSwgeSk7CisgICAgZS0+c2V0Q29tcG9uZW50KDIsIHopOworICAgIG1QcmVkZWZpbmVkTGlzdC5hZGQoUHJlZGVmaW5lZChSU19FTEVNRU5UX1hZWl9GMzIsIGUpKTsKKworICAgIGUgPSBuZXcgRWxlbWVudCg0KTsKKyAgICBlLT5zZXRDb21wb25lbnQoMCwgcyk7CisgICAgZS0+c2V0Q29tcG9uZW50KDEsIHQpOworICAgIGUtPnNldENvbXBvbmVudCgyLCB4KTsKKyAgICBlLT5zZXRDb21wb25lbnQoMywgeSk7CisgICAgbVByZWRlZmluZWRMaXN0LmFkZChQcmVkZWZpbmVkKFJTX0VMRU1FTlRfU1RfWFlfRjMyLCBlKSk7CisKKyAgICBlID0gbmV3IEVsZW1lbnQoNSk7CisgICAgZS0+c2V0Q29tcG9uZW50KDAsIHMpOworICAgIGUtPnNldENvbXBvbmVudCgxLCB0KTsKKyAgICBlLT5zZXRDb21wb25lbnQoMiwgeCk7CisgICAgZS0+c2V0Q29tcG9uZW50KDMsIHkpOworICAgIGUtPnNldENvbXBvbmVudCg0LCB6KTsKKyAgICBtUHJlZGVmaW5lZExpc3QuYWRkKFByZWRlZmluZWQoUlNfRUxFTUVOVF9TVF9YWVpfRjMyLCBlKSk7CisKKyAgICBlID0gbmV3IEVsZW1lbnQoNik7CisgICAgZS0+c2V0Q29tcG9uZW50KDAsIG54KTsKKyAgICBlLT5zZXRDb21wb25lbnQoMSwgbnkpOworICAgIGUtPnNldENvbXBvbmVudCgyLCBueik7CisgICAgZS0+c2V0Q29tcG9uZW50KDMsIHgpOworICAgIGUtPnNldENvbXBvbmVudCg0LCB5KTsKKyAgICBlLT5zZXRDb21wb25lbnQoNSwgeik7CisgICAgbVByZWRlZmluZWRMaXN0LmFkZChQcmVkZWZpbmVkKFJTX0VMRU1FTlRfTk9STV9YWVpfRjMyLCBlKSk7CisKKyAgICBlID0gbmV3IEVsZW1lbnQoOCk7CisgICAgZS0+c2V0Q29tcG9uZW50KDAsIG54KTsKKyAgICBlLT5zZXRDb21wb25lbnQoMSwgbnkpOworICAgIGUtPnNldENvbXBvbmVudCgyLCBueik7CisgICAgZS0+c2V0Q29tcG9uZW50KDMsIHMpOworICAgIGUtPnNldENvbXBvbmVudCg0LCB0KTsKKyAgICBlLT5zZXRDb21wb25lbnQoNSwgeCk7CisgICAgZS0+c2V0Q29tcG9uZW50KDYsIHkpOworICAgIGUtPnNldENvbXBvbmVudCg3LCB6KTsKKyAgICBtUHJlZGVmaW5lZExpc3QuYWRkKFByZWRlZmluZWQoUlNfRUxFTUVOVF9OT1JNX1NUX1hZWl9GMzIsIGUpKTsKK30KKworCitFbGVtZW50OjpFbGVtZW50KCkKK3sKKyAgICBtQ29tcG9uZW50cyA9IE5VTEw7CisgICAgbUNvbXBvbmVudENvdW50ID0gMDsKK30KKworRWxlbWVudDo6RWxlbWVudCh1aW50MzJfdCBjb3VudCkKK3sKKyAgICBtQ29tcG9uZW50cyA9IG5ldyBPYmplY3RCYXNlUmVmPENvbXBvbmVudD4gW2NvdW50XTsKKyAgICBtQ29tcG9uZW50Q291bnQgPSBjb3VudDsKK30KKworRWxlbWVudDo6fkVsZW1lbnQoKQoreworICAgIGNsZWFyKCk7Cit9CisKK3ZvaWQgRWxlbWVudDo6Y2xlYXIoKQoreworICAgIGRlbGV0ZSBbXSBtQ29tcG9uZW50czsKKyAgICBtQ29tcG9uZW50cyA9IE5VTEw7CisgICAgbUNvbXBvbmVudENvdW50ID0gMDsKK30KKwordm9pZCBFbGVtZW50OjpzZXRDb21wb25lbnQodWludDMyX3QgaWR4LCBDb21wb25lbnQgKmMpCit7CisgICAgcnNBc3NlcnQoIW1Db21wb25lbnRzW2lkeF0uZ2V0KCkpOworICAgIHJzQXNzZXJ0KGlkeCA8IG1Db21wb25lbnRDb3VudCk7CisgICAgbUNvbXBvbmVudHNbaWR4XS5zZXQoYyk7CisgICAgYy0+aW5jVXNlclJlZigpOworfQorCisKK3NpemVfdCBFbGVtZW50OjpnZXRTaXplQml0cygpIGNvbnN0Cit7CisgICAgc2l6ZV90IHRvdGFsID0gMDsKKyAgICBmb3IgKHNpemVfdCBjdD0wOyBjdCA8IG1Db21wb25lbnRDb3VudDsgY3QrKykgeworICAgICAgICB0b3RhbCArPSBtQ29tcG9uZW50c1tjdF0tPmdldEJpdHMoKTsKKyAgICB9CisgICAgcmV0dXJuIHRvdGFsOworfQorCitzaXplX3QgRWxlbWVudDo6Z2V0Q29tcG9uZW50T2Zmc2V0Qml0cyh1aW50MzJfdCBjb21wb25lbnROdW1iZXIpIGNvbnN0Cit7CisgICAgc2l6ZV90IG9mZnNldCA9IDA7CisgICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgY29tcG9uZW50TnVtYmVyOyBjdCsrKSB7CisgICAgICAgIG9mZnNldCArPSBtQ29tcG9uZW50c1tjdF0tPmdldEJpdHMoKTsKKyAgICB9CisgICAgcmV0dXJuIG9mZnNldDsKK30KKwordWludDMyX3QgRWxlbWVudDo6Z2V0R0xUeXBlKCkgY29uc3QKK3sKKyAgICBpbnQgYml0c1s0XTsKKworICAgIGlmIChtQ29tcG9uZW50Q291bnQgPiA0KSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtQ29tcG9uZW50Q291bnQ7IGN0KyspIHsKKyAgICAgICAgYml0c1tjdF0gPSBtQ29tcG9uZW50c1tjdF0tPmdldEJpdHMoKTsKKyAgICAgICAgaWYgKG1Db21wb25lbnRzW2N0XS0+Z2V0VHlwZSgpICE9IENvbXBvbmVudDo6VU5TSUdORUQpIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgICAgIGlmICghbUNvbXBvbmVudHNbY3RdLT5nZXRJc05vcm1hbGl6ZWQoKSkgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzd2l0Y2gobUNvbXBvbmVudENvdW50KSB7CisgICAgY2FzZSAxOgorICAgICAgICBpZiAoYml0c1swXSA9PSA4KSB7CisgICAgICAgICAgICByZXR1cm4gR0xfVU5TSUdORURfQllURTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gMDsKKyAgICBjYXNlIDI6CisgICAgICAgIGlmICgoYml0c1swXSA9PSA4KSAmJgorICAgICAgICAgICAgKGJpdHNbMV0gPT0gOCkpIHsKKyAgICAgICAgICAgIHJldHVybiBHTF9VTlNJR05FRF9CWVRFOworICAgICAgICB9CisgICAgICAgIHJldHVybiAwOworICAgIGNhc2UgMzoKKyAgICAgICAgaWYgKChiaXRzWzBdID09IDgpICYmCisgICAgICAgICAgICAoYml0c1sxXSA9PSA4KSAmJgorICAgICAgICAgICAgKGJpdHNbMl0gPT0gOCkpIHsKKyAgICAgICAgICAgIHJldHVybiBHTF9VTlNJR05FRF9CWVRFOworICAgICAgICB9CisgICAgICAgIGlmICgoYml0c1swXSA9PSA1KSAmJgorICAgICAgICAgICAgKGJpdHNbMV0gPT0gNikgJiYKKyAgICAgICAgICAgIChiaXRzWzJdID09IDUpKSB7CisgICAgICAgICAgICByZXR1cm4gR0xfVU5TSUdORURfU0hPUlRfNV82XzU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIDA7CisgICAgY2FzZSA0OgorICAgICAgICBpZiAoKGJpdHNbMF0gPT0gOCkgJiYKKyAgICAgICAgICAgIChiaXRzWzFdID09IDgpICYmCisgICAgICAgICAgICAoYml0c1syXSA9PSA4KSAmJgorICAgICAgICAgICAgKGJpdHNbM10gPT0gOCkpIHsKKyAgICAgICAgICAgIHJldHVybiBHTF9VTlNJR05FRF9CWVRFOworICAgICAgICB9CisgICAgICAgIGlmICgoYml0c1swXSA9PSA0KSAmJgorICAgICAgICAgICAgKGJpdHNbMV0gPT0gNCkgJiYKKyAgICAgICAgICAgIChiaXRzWzJdID09IDQpICYmCisgICAgICAgICAgICAoYml0c1szXSA9PSA0KSkgeworICAgICAgICAgICAgcmV0dXJuIEdMX1VOU0lHTkVEX1NIT1JUXzRfNF80XzQ7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChiaXRzWzBdID09IDUpICYmCisgICAgICAgICAgICAoYml0c1sxXSA9PSA1KSAmJgorICAgICAgICAgICAgKGJpdHNbMl0gPT0gNSkgJiYKKyAgICAgICAgICAgIChiaXRzWzNdID09IDEpKSB7CisgICAgICAgICAgICByZXR1cm4gR0xfVU5TSUdORURfU0hPUlRfNV81XzVfMTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gMDsKK30KKwordWludDMyX3QgRWxlbWVudDo6Z2V0R0xGb3JtYXQoKSBjb25zdAoreworICAgIHN3aXRjaChtQ29tcG9uZW50Q291bnQpIHsKKyAgICBjYXNlIDE6CisgICAgICAgIGlmIChtQ29tcG9uZW50c1swXS0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6QUxQSEEpIHsKKyAgICAgICAgICAgIHJldHVybiBHTF9BTFBIQTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUNvbXBvbmVudHNbMF0tPmdldEtpbmQoKSA9PSBDb21wb25lbnQ6OkxVTUlOQU5DRSkgeworICAgICAgICAgICAgcmV0dXJuIEdMX0xVTUlOQU5DRTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICBjYXNlIDI6CisgICAgICAgIGlmICgobUNvbXBvbmVudHNbMF0tPmdldEtpbmQoKSA9PSBDb21wb25lbnQ6OkxVTUlOQU5DRSkgJiYKKyAgICAgICAgICAgIChtQ29tcG9uZW50c1sxXS0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6QUxQSEEpKSB7CisgICAgICAgICAgICByZXR1cm4gR0xfTFVNSU5BTkNFX0FMUEhBOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgMzoKKyAgICAgICAgaWYgKChtQ29tcG9uZW50c1swXS0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6UkVEKSAmJgorICAgICAgICAgICAgKG1Db21wb25lbnRzWzFdLT5nZXRLaW5kKCkgPT0gQ29tcG9uZW50OjpHUkVFTikgJiYKKyAgICAgICAgICAgIChtQ29tcG9uZW50c1syXS0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6QkxVRSkpIHsKKyAgICAgICAgICAgIHJldHVybiBHTF9SR0I7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSA0OgorICAgICAgICBpZiAoKG1Db21wb25lbnRzWzBdLT5nZXRLaW5kKCkgPT0gQ29tcG9uZW50OjpSRUQpICYmCisgICAgICAgICAgICAobUNvbXBvbmVudHNbMV0tPmdldEtpbmQoKSA9PSBDb21wb25lbnQ6OkdSRUVOKSAmJgorICAgICAgICAgICAgKG1Db21wb25lbnRzWzJdLT5nZXRLaW5kKCkgPT0gQ29tcG9uZW50OjpCTFVFKSAmJgorICAgICAgICAgICAgKG1Db21wb25lbnRzWzNdLT5nZXRLaW5kKCkgPT0gQ29tcG9uZW50OjpBTFBIQSkpIHsKKyAgICAgICAgICAgIHJldHVybiBHTF9SR0JBOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICByZXR1cm4gMDsKK30KKworCitFbGVtZW50U3RhdGU6OkVsZW1lbnRTdGF0ZSgpCit7Cit9CisKK0VsZW1lbnRTdGF0ZTo6fkVsZW1lbnRTdGF0ZSgpCit7Cit9CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLworCituYW1lc3BhY2UgYW5kcm9pZCB7CituYW1lc3BhY2UgcmVuZGVyc2NyaXB0I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bVByZWRlZmluZWRMaXN0LnNpemUoKSkpIHsKKyAgICAgICAgTE9HRSgicnNFbGVtZW50R2V0UHJlZGVmaW5lZDogUmVxdWVzdCBmb3IgYmFkIHByZWRlZmluZWQgdHlwZSIpOworICAgICAgICAvLyBlcnJvcgorICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICByc0Fzc2VydChzZWMtPm1QcmVkZWZpbmVkTGlzdFtwcmVkZWZdLm1FbnVtID09IHByZWRlZik7CisgICAgRWxlbWVudCAqIGUgPSBzZWMtPm1QcmVkZWZpbmVkTGlzdFtwcmVkZWZdLm1FbGVtZW50OworICAgIGUtPmluY1VzZXJSZWYoKTsKKyAgICByZXR1cm4gZTsKK30KKwordm9pZCByc2lfRWxlbWVudEFkZChDb250ZXh0ICpyc2MsIFJzRGF0YUtpbmQgZGssIFJzRGF0YVR5cGUgZHQsIGJvb2wgaXNOb3JtYWxpemVkLCBzaXplX3QgYml0cywgY29uc3QgY2hhciAqbmFtZSkKK3sKKyAgICBFbGVtZW50U3RhdGUgKiBzZWMgPSAmcnNjLT5tU3RhdGVFbGVtZW50OworICAgIENvbXBvbmVudCAqYyA9IG5ldyBDb21wb25lbnQoc3RhdGljX2Nhc3Q8Q29tcG9uZW50OjpEYXRhS2luZD4oZGspLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8Q29tcG9uZW50OjpEYXRhVHlwZT4oZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNOb3JtYWxpemVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUpOworICAgIHNlYy0+bUNvbXBvbmVudEJ1aWxkTGlzdC5hZGQoYyk7Cit9CisKK1JzRWxlbWVudCByc2lfRWxlbWVudENyZWF0ZShDb250ZXh0ICpyc2MpCit7CisgICAgRWxlbWVudFN0YXRlICogc2VjID0gJn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CBnZXRHTEZvcm1hdCgpIGNvbnN0OworCisKKyAgICBzaXplX3QgZ2V0U2l6ZUJpdHMoKSBjb25zdDsKKyAgICBzaXplX3QgZ2V0U2l6ZUJ5dGVzKCkgY29uc3QgeworICAgICAgICByZXR1cm4gKGdldFNpemVCaXRzKCkgKyA3KSA+PiAzOworICAgIH0KKworICAgIHNpemVfdCBnZXRDb21wb25lbnRPZmZzZXRCaXRzKHVpbnQzMl90IGNvbXBvbmVudE51bWJlcikgY29uc3Q7CisgICAgc2l6ZV90IGdldENvbXBvbmVudE9mZnNldEJ5dGVzKHVpbnQzMl90IGNvbXBvbmVudE51bWJlcikgY29uc3QgeworICAgICAgICByZXR1cm4gKGdldENvbXBvbmVudE9mZnNldEJpdHMoY29tcG9uZW50TnVtYmVyKSArIDcpID4+IDM7CisgICAgfQorCisgICAgdWludDMyX3QgZ2V0Q29tcG9uZW50Q291bnQoKSBjb25zdCB7cmV0dXJuIG1Db21wb25lbnRDb3VudDt9CisgICAgQ29tcG9uZW50ICogZ2V0Q29tcG9uZW50KHVpbnQzMl90IGlkeCkgY29uc3Qge3JldHVybiBtQ29tcG9uZW50c1tpZHhdLmdldCgpO30KKworcHJvdGVjdGVkOgorICAgIC8vIGRlYWxsb2NhdGUgYW55IGNvbXBvbmVudHMgdGhhdCBhcmUgcGFydCBvZiB0aGlzIGVsZW1lbnQuCisgICAgdm9pZCBjbGVhcigpOworCisgICAgc2l6ZV90IG1Db21wb25lbnRDb3VudDsKKyAgICBPYmplY3RCYXNlUmVmPENvbXBvbmVudD4gKiBtQ29tcG9uZW50czsKKyAgICAvL3VpbnQzMl90ICptT2Zmc2V0VGFibGU7CisKKyAgICBFbGVtZW50KCk7Cit9OworCisKK2NsYXNzIEVsZW1lbnRTdGF0ZSB7CitwdWJsaWM6CisgICAgRWxlbWVudFN0YXRlKCk7CisgICAgfkVsZW1lbnRTdGF0ZSgpOworCisgICAgVmVjdG9yPENvbXBvbmVudCAqPiBtQ29tcG9uZW50QnVp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8fAorICAgICAgICBtZW1jbXAobWFnaWNTdHJpbmcsICJBbmRyb2lkM0RfZmYiLCAxMikpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIExPR0UoImZpbGUgb3BlbiAyIik7CisgICAgbGVuID0gZnJlYWQoJm1NYWpvclZlcnNpb24sIDEsIHNpemVvZihtTWFqb3JWZXJzaW9uKSwgZik7CisgICAgaWYgKGxlbiAhPSBzaXplb2YobU1ham9yVmVyc2lvbikpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIExPR0UoImZpbGUgb3BlbiAzIik7CisgICAgbGVuID0gZnJlYWQoJm1NaW5vclZlcnNpb24sIDEsIHNpemVvZihtTWlub3JWZXJzaW9uKSwgZik7CisgICAgaWYgKGxlbiAhPSBzaXplb2YobU1pbm9yVmVyc2lvbikpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIExPR0UoImZpbGUgb3BlbiA0Iik7CisgICAgdWludDMyX3QgZmxhZ3M7CisgICAgbGVuID0gZnJlYWQoJmZsYWdzLCAxLCBzaXplb2YoZmxhZ3MpLCBmKTsKKyAgICBpZiAobGVuICE9IHNpemVvZihmbGFncykpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBtVXNlNjRCaXRPZmZzZXRzID0gKGZsYWdzICYgMSkgIT0gMDsKKworICAgIExPR0UoImZpbGUgb3BlbiA2NGJpdCA9ICVpIiwgbVVzZTY0Qml0T2Zmc2V0cyk7CisKKyAgICBpZiAobVVzZTY0Qml0T2Zmc2V0cykgeworICAgICAgICBsZW4gPSBmcmVhZCgmbURhdGFTaXplLCAxLCBzaXplb2YobURhdGFTaXplKSwgZik7CisgICAgICAgIGlmIChsZW4gIT0gc2l6ZW9mKG1EYXRhU2l6ZSkpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICAgIHVpbnQzMl90IHRtcDsKKyAgICAgICAgbGVuID0gZnJlYWQoJnRtcCwgMSwgc2l6ZW9mKHRtcCksIGYpOworICAgICAgICBpZiAobGVuICE9IHNpemVvZih0bXApKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgbURhdGFTaXplID0gdG1wOworICAgIH0KKworICAgIExPR0UoImZpbGUgb3BlbiBzaXplID0gJWxsaSIsIG1EYXRhU2l6ZSk7CisKKyAgICAvLyBXZSBzaG91bGQga25vdyBlbm91Z2ggdG8gcmVhZCB0aGUgZmlsZSBpbiBhdCB0aGlzIHBvaW50LgorICAgIGZzZWVrKGYsIFNFRUtfU0VULCAwKTsKKyAgICBtQWxsb2M9IG1hbGxvYyhtRGF0YVNpemUpOworICAgIGlmICghbUFsbG9jKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgbURhdGEgPSAodWludDhfdCAqKW1BbGxvYzsKKyAgICBsZW4gPSBmcmVhZChtQWxsb2MsIDEsIG1EYXRhU2l6ZSwgZik7CisgICAgaWYgKGxlbiAhPSBtRGF0YVNpemUpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIExPR0UoImZpbGUgc3RhcnQgcHJvY2Vzc2luZyIpOworICAgIHJldHVybiBwcm9jZXNzKHJzYyk7Cit9CisKK2Jvb2wgRmlsZUEzRDo6cHJvY2Vzc0luZGV4KENvbnRleHQgKnJzYywgQTNESW5kZXhFbnRyeSAqaWUpCit7CisgICAgYm9vbCByZXQgPSBmYWxzZTsKKyAgICBJTyBpbyhtRGF0YSArIGllLT5tT2Zmc2V0LCBtVXNlNjRCaXRPZmZzZXRzKTsKKworICAgIExPR0UoInByb2Nlc3MgaW5kZXgsIHR5cGUgJWkiLCBpZS0+bVR5cGUpOworCisgICAgc3dpdGNoKGllLT5tVHlwZSkgeworICAgIGNhc2UgQ0hVTktfRUxFTUVOVDoKKyAgICAgICAgcHJvY2Vzc0NodW5rX0VsZW1lbnQocnNjLCAmaW8sIGllKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBDSFVOS19FTEVNRU5UX1NPVVJDRToKKyAgICAgICAgcHJvY2Vzc0NodW5rX0VsZW1lbnRTb3VyY2UocnNjLCAmaW8sIGllKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBDSFVOS19WRVJUSUNJRVM6CisgICAgICAgIHByb2Nlc3NDaHVua19WZXJ0aWNpZXMocnNjLCAmaW8sIGllKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBDSFVOS19NRVNIOgorICAgICAgICBwcm9jZXNzQ2h1bmtfTWVzaChyc2MsICZpbywgaWUpOworICAgICAgICBicmVhazsKKyAgICBjYXNlIENIVU5LX1BSSU1JVElWRToKKyAgICAgICAgcHJvY2Vzc0NodW5rX1ByaW1pdGl2ZShyc2MsICZpbywgaWUpOworICAgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgICBMT0dFKCJGaWxlQTNEIFVua25vd24gY2h1bmsgdHlwZSIpOworICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIChpZS0+bVJzT2JqICE9IE5VTEwpOworfQorCitib29sIEZpbGVBM0Q6OnByb2Nlc3MoQ29udGV4dCAqcnNjKQoreworICAgIExPR0UoInByb2Nlc3MiKTsKKyAgICBJTyBpbyhtRGF0YSArIDEyLCBtVXNlNjRCaXRPZmZzZXRzKTsKKyAgICBib29sIHJldCA9IHRydWU7CisKKyAgICAvLyBCdWlsZCB0aGUgaW5kZXggZmlyc3QKKyAgICBMT0dFKCJwcm9jZXNzIDEiKTsKKyAgICBpby5sb2FkVTMyKCk7IC8vIG1ham9yIHZlcnNpb24sIGFscmVhZHkgbG9hZGVkCisgICAgaW8ubG9hZFUzMigpOyAvLyBtaW5vciB2ZXJzaW9uLCBhbHJlYWR5IGxvYWRlZAorICAgIExPR0UoInByb2Nlc3MgMiIpOworCisgICAgaW8ubG9hZFUzMigpOy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mdFbnRyeUNvdW50OyBjdCsrKSB7CisgICAgICAgICAgICB1aW50NjRfdCBvZmZzZXQgPSBzdHJpbmdUYWJsZS5sb2FkT2Zmc2V0KCk7CisgICAgICAgICAgICBMT0dFKCJzdHJpbmcgb2Zmc2V0IDB4JTAxNmxseCIsIG9mZnNldCk7CisgICAgICAgICAgICBJTyB0bXAobURhdGEgKyBvZmZzZXQsIG1Vc2U2NEJpdE9mZnNldHMpOworICAgICAgICAgICAgU3RyaW5nOCBzOworICAgICAgICAgICAgdG1wLmxvYWRTdHJpbmcoJnMpOworICAgICAgICAgICAgTE9HRSgic3RyaW5nICVzIiwgcy5zdHJpbmcoKSk7CisgICAgICAgICAgICBtU3RyaW5ncy5wdXNoKHMpOworICAgICAgICB9CisgICAgfQorCisgICAgTE9HRSgic3RyaW5ncyBkb25lIik7CisgICAgdWludDMyX3QgaW5kZXhFbnRyeUNvdW50ID0gaW5kZXgubG9hZFUzMigpOworICAgIExPR0UoImluZGV4IGNvdW50ICVpIiwgaW5kZXhFbnRyeUNvdW50KTsKKyAgICBtSW5kZXguc2V0Q2FwYWNpdHkoaW5kZXhFbnRyeUNvdW50KTsKKyAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBpbmRleEVudHJ5Q291bnQ7IGN0KyspIHsKKyAgICAgICAgQTNESW5kZXhFbnRyeSBlOworICAgICAgICB1aW50MzJfdCBzdHJpbmdJbmRleCA9IGluZGV4LmxvYWRVMzIoKTsKKyAgICAgICAgTE9HRSgiaW5kZXggJWkiLCBjdCk7CisgICAgICAgIExPR0UoIiAgc3RyaW5nIGluZGV4ICVpIiwgc3RyaW5nSW5kZXgpOworICAgICAgICBlLm1UeXBlID0gKEEzRENodW5rVHlwZSlpbmRleC5sb2FkVTMyKCk7CisgICAgICAgIExPR0UoIiAgdHlwZSAlaSIsIGUubVR5cGUpOworICAgICAgICBlLm1PZmZzZXQgPSBpbmRleC5sb2FkT2Zmc2V0KCk7CisgICAgICAgIExPR0UoI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IDcpICYgKH43KTsKKyAgICAgICAgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50NjRfdCAqPigmbURhdGFbbVBvc10pWzBdOworICAgICAgICBtUG9zICs9IHNpemVvZih1aW50NjRfdCk7CisgICAgICAgIHJldHVybiB0bXA7CisgICAgfQorICAgIHJldHVybiBsb2FkVTMyKCk7Cit9CisKK3ZvaWQgRmlsZUEzRDo6SU86OmxvYWRTdHJpbmcoU3RyaW5nOCAqcykKK3sKKyAgICBMT0dFKCJsb2FkU3RyaW5nIik7CisgICAgdWludDMyX3QgbGVuID0gbG9hZFUzMigpOworICAgIExPR0UoImxvYWRTdHJpbmcgbGVuICVpIiwgbGVuKTsKKyAgICBzLT5zZXRUbygoY29uc3QgY2hhciAqKSZtRGF0YVttUG9zXSwgbGVuKTsKKyAgICBtUG9zICs9IGxlbjsKK30KKworCit2b2lkIEZpbGVBM0Q6OnByb2Nlc3NDaHVua19NZXNoKENvbnRleHQgKnJzYywgSU8gKmlvLCBBM0RJbmRleEVudHJ5ICppZSkKK3sKKyAgICBNZXNoICogbSA9IG5ldyBNZXNoOworCisgICAgbS0+bVByaW1pdGl2ZXNDb3VudCA9IGlvLT5sb2FkVTMyKCk7CisgICAgbS0+bVByaW1pdGl2ZXMgPSBuZXcgTWVzaDo6UHJpbWl0aXZlX3QgKlttLT5tUHJpbWl0aXZlc0NvdW50XTsKKworICAgIGZvciAodWludDMyX3QgY3QgPSAwOyBjdCA8IG0tPm1QcmltaXRpdmVzQ291bnQ7IGN0KyspIHsKKyAgICAgICAgdWludDMyX3QgaW5kZXggPSBpby0+bG9hZFUzMigpOworCisgICAgICAgIG0tPm1QcmltaXRpdmVzW2N0XSA9IChNZXNoOjpQcmltaXRpdmVfdCAqKW1JbmRleFtpbmRleF0ubVJzT2JqOworICAgIH0KKyAgICBpZS0+bVJzT2JqID0gbTsKK30KKwordm9pZCBGaWxlQTNEOjpwcm9jZXNzQ2h1bmtfUHJpbWl0aXZlKENvbnRleHQgKnJzYywgSU8gKmlvLCBBM0RJbmRleEVudHJ5ICppZSkKK3sKKyAgICBNZXNoOjpQcmltaXRpdmVfdCAqIHAgPSBuZXcgTWVzaDo6UHJpbWl0aXZlX3Q7CisKKyAgICBwLT5tSW5kZXhDb3VudCA9IGlvLT5sb2FkVTMyKCk7CisgICAgdWludDMyX3QgdmVydElkeCA9IGlvLT5sb2FkVTMyKCk7CisgICAgcC0+bVJlc3RhcnRDb3VudHMgPSBpby0+bG9hZFUxNigpOworICAgIHVpbnQzMl90IGJpdHMgPSBpby0+bG9hZFU4KCk7CisgICAgcC0+bVR5cGUgPSAoUnNQcmltaXRpdmUpaW8tPmxvYWRVOCgpOworCisgICAgTE9HRSgicHJvY2Vzc0NodW5rX1ByaW1pdGl2ZSBjb3VudCAlaSwgYml0cyAlaSIsIHAtPm1JbmRleENvdW50LCBiaXRzKTsKKworICAgIHAtPm1WZXJ0aWNpZXMgPSAoTWVzaDo6VmVydGljaWVzX3QgKiltSW5kZXhbdmVydElkeF0ubVJzT2JqOworCisgICAgcC0+bUluZGljaWVzID0gbmV3IHVpbnQxNl90W3AtPm1JbmRleENvdW50XTsKKyAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBwLT5tSW5kZXhDb3VudDsgY3QrKykgeworICAgICAgICBzd2l0Y2goYml0cykgeworICAgICAgICBjYXNlIDg6CisgICAgICAgICAgICBwLT5tSW5kaWNpZXNbY3RdID0gaW8tPmxvYWRVOCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMTY6CisgICAgICAgICAgICBwLT5tSW5kaWNpZXNbY3RdID0gaW8tPmxvYWRVMTYoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDMyOgorICAgICAgICAgICAgcC0+bUluZGljaWVzW2N0XSA9IGlvLT5sb2FkVTMyKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBMT0dFKCIgIGlkeCAlaSIsIHAtPm1JbmRpY2llc1tjdF0pOworICAgIH0KKworICAgIGlmIChwLT5tUmVzdGFydENvdW50cykgeworICAgICAgICBwLT5tUmVzdGFydHMgPSBuZXcgdWludDE2X3RbcC0+bVJlc3RhcnRDb3VudHNdOworICAgICAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBwLT5tUmVzdGFydENvdW50czsgY3QrKykgeworICAgICAgICAgICAgc3dpdGNoKGJpdHMpIHsKKyAgICAgICAgICAgIGNhc2UgODoKKyAgICAgICAgICAgICAgICBwLT5tUmVzdGFydHNbY3RdID0gaW8tPmxvYWRVOCgpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAxNjoKKyAgICAgICAgICAgICAgICBwLT5tUmVzdGFydHNbY3RdID0gaW8tPmxvYWRVMTYoKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMzI6CisgICAgICAgICAgICAgICAgcC0+bVJlc3RhcnRzW2N0XSA9IGlvLT5sb2FkVTMyKCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBMT0dFKCIgIGlkeCAlaSIsIHAtPm1SZXN0YXJ0c1tjdF0pOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgcC0+bVJlc3RhcnRzID0gTlVMTDsKKyAgICB9CisKKyAgICBpZS0+bVJzT2JqID0gcDsKK30KKwordm9pZCBGaWxlQTNEOjpwcm9jZXNzQ2h1bmtfVmVydGljaWVzKENvbnRleHQgKnJzYywgSU8gKmlvLCBBM0RJbmRleEVudHJ5ICppZSkKK3sKKyAgICBNZXNoOjpWZXJ0aWNpZXNfdCAqY3YgPSBuZXcgTWVzaDo6VmVydGljaWVzX3Q7CisgICAgY3YtPm1BbGxvY2F0aW9uQ291bnQgPSBpby0+bG9hZFUzMigpOworICAgIGN2LT5tQWxsb2NhdGlvbnMgPSBuZXcgQWxsb2NhdGlvbiAqW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ICAgIExPR0UoInByb2Nlc3NDaHVua19FbGVtZW50IGNyZWF0ZSIpOworICAgIGllLT5tUnNPYmogPSByc2lfRWxlbWVudENyZWF0ZShyc2MpOworfQorCit2b2lkIEZpbGVBM0Q6OnByb2Nlc3NDaHVua19FbGVtZW50U291cmNlKENvbnRleHQgKnJzYywgSU8gKmlvLCBBM0RJbmRleEVudHJ5ICppZSkKK3sKKyAgICB1aW50MzJfdCBpbmRleCA9IGlvLT5sb2FkVTMyKCk7CisgICAgdWludDMyX3QgY291bnQgPSBpby0+bG9hZFUzMigpOworCisgICAgTE9HRSgicHJvY2Vzc0NodW5rX0VsZW1lbnRTb3VyY2UgY291bnQgJWksIGluZGV4ICVpIiwgY291bnQsIGluZGV4KTsKKworICAgIFJzRWxlbWVudCBlID0gKFJzRWxlbWVudCltSW5kZXhbaW5kZXhdLm1Sc09iajsKKworICAgIFJzQWxsb2NhdGlvbiBhID0gcnNpX0FsbG9jYXRpb25DcmVhdGVTaXplZChyc2MsIGUsIGNvdW50KTsKKyAgICBBbGxvY2F0aW9uICogYWxsb2MgPSBzdGF0aWNfY2FzdDxBbGxvY2F0aW9uICo+KGEpOworCisgICAgZmxvYXQgKiBkYXRhID0gKGZsb2F0ICopYWxsb2MtPmdldFB0cigpOworICAgIHdoaWxlKGNvdW50LS0pIHsKKyAgICAgICAgKmRhdGEgPSBpby0+bG9hZEYoKTsKKyAgICAgICAgTE9HRSgiICAlZiIsICpkYXRhKTsKKyAgICAgICAgZGF0YSsrOworICAgIH0KKyAgICBpZS0+bVJzT2JqID0gYWxsb2M7Cit9CisKK25hbWVzcGFjZSBhbmRyb2lkIHsKK25hbWVzcGFjZSByZW5kZXJzY3JpcHQgeworCisKK1JzRmlsZSByc2lfRmlsZU9wZW4oQ29udGV4dCAqcnNjLCBjaGFyIGNvbnN0ICpwYXRoLCB1bnNpZ25lZCBpbnQgbGVuKQoreworICAgIEZpbGVBM0QgKmZhM2QgPSBuZXcgRmlsZUEzRDsKKworICAgIEZ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YWQoQ29udGV4dCAqcnNjLCBGSUxFICpmKTsKKworcHJvdGVjdGVkOgorICAgIGNsYXNzIElPCisgICAgeworICAgIHB1YmxpYzoKKyAgICAgICAgSU8oY29uc3QgdWludDhfdCAqLCBib29sIHVzZTY0KTsKKyAgICAKKyAgICAgICAgZmxvYXQgbG9hZEYoKSB7CisgICAgICAgICAgICBtUG9zID0gKG1Qb3MgKyAzKSAmICh+Myk7CisgICAgICAgICAgICBmbG9hdCB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGZsb2F0ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgICAgICBtUG9zICs9IHNpemVvZihmbG9hdCk7CisgICAgICAgICAgICByZXR1cm4gdG1wOworICAgICAgICB9CisgICAgICAgIGludDMyX3QgbG9hZEkzMigpIHsKKyAgICAgICAgICAgIG1Qb3MgPSAobVBvcyArIDMpICYgKH4zKTsKKyAgICAgICAgICAgIGludDMyX3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCBpbnQzMl90ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgICAgICBtUG9zICs9IHNpemVvZihpbnQzMl90KTsKKyAgICAgICAgICAgIHJldHVybiB0bXA7CisgICAgICAgIH0KKyAgICAgICAgdWludDMyX3QgbG9hZFUzMigpIHsKKyAgICAgICAgICAgIG1Qb3MgPSAobVBvcyArIDMpICYgKH4zKTsKKyAgICAgICAgICAgIHVpbnQzMl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDMyX3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKKyAgICAgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKHVpbnQzMl90KTsKKyAgICAgICAgICAgIHJldHVybiB0bXA7CisgICAgICAgIH0KKyAgICAgICAgdWludDE2X3QgbG9hZFUxNigpIHsKKyAgICAgICAgICAgIG1Qb3MgPSAobVBvcyArIDEpICYgKH4xKTsKKyAgICAgICAgICAgIHVpbnQxNl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDE2X3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKKyAgICAgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKHVpbnQxNl90KTsKKyAgICAgICAgICAgIHJldHVybiB0bXA7CisgICAgICAgIH0KKyAgICAgICAgdWludDhfdCBsb2FkVTgoKSB7CisgICAgICAgICAgICB1aW50OF90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDhfdCAqPigmbURhdGFbbVBvc10pWzBdOworICAgICAgICAgICAgbVBvcyArPSBzaXplb2YodWludDhfdCk7CisgICAgICAgICAgICByZXR1cm4gdG1wOworICAgICAgICB9CisgICAgICAgIHVpbnQ2NF90IGxvYWRPZmZzZXQoKTsKKyAgICAgICAgdm9pZCBsb2FkU3RyaW5nKFN0cmluZzggKnMpOworICAgICAgICB1aW50NjRfdCBnZXRQb3MoKSBjb25zdCB7cmV0dXJuIG1Qb3M7fQorICAgICAgICBjb25zdCB1aW50OF90ICogZ2V0UHRyKCkgY29uc3Q7CisgICAgcHJvdGVjdGVkOgorICAgICAgICBjb25zdCB1aW50OF90ICogbURhdGE7CisgICAgICAgIHVpbnQ2NF90IG1Qb3M7CisgICAgICAgIGJvb2wgbVVzZTY0OworICAgIH07CisKKworICAgIGJvb2wgcHJvY2VzcyhDb250ZXh0ICpyc2MpOworICAgIGJvb2wgcHJvY2Vzc0luZGV4KENvbnRleHQgKnJzYywgQTNESW5kZXhFbnRyeSAqKTsKKyAgICB2b2lkIHByb2Nlc3NDaHVua19NZXNoKENvbnRleHQgKnJzYywgSU8gKmlvLCBBM0RJbmRleEVudHJ5ICppZSk7CisgICAgdm9pZCBwcm9jZXNzQ2h1bmtfUHJpbWl0aXZlKENvbnRleHQgKnJzYywgSU8gKmlvLCBBM0RJbmRleEVudHJ5ICppZSk7CisgICAgdm9pZCBwcm9jZXNzQ2h1bmtfVmVydGljaWVzKENvbnRleHQgKnJ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gc2l6ZUluQnl0ZXMpCit7CisgICAgY29tbWl0KGNvbW1hbmQsIHNpemVJbkJ5dGVzKTsKKyAgICBmbHVzaCgpOworfQorCit2b2lkIExvY2tsZXNzQ29tbWFuZEZpZm86OmZsdXNoKCkKK3sKKyAgICAvL2R1bXBTdGF0ZSgiZmx1c2ggMSIpOworICAgIHdoaWxlKG1QdXQgIT0gbUdldCkgeworICAgICAgICBtU2lnbmFsVG9Db250cm9sLndhaXQoKTsKKyAgICB9CisgICAgLy9kdW1wU3RhdGUoImZsdXNoIDIiKTsKK30KKworY29uc3Qgdm9pZCAqIExvY2tsZXNzQ29tbWFuZEZpZm86OmdldCh1aW50MzJfdCAqY29tbWFuZCwgdWludDMyX3QgKmJ5dGVzRGF0YSkKK3sKKyAgICB3aGlsZSgxKSB7CisgICAgICAgIC8vZHVtcFN0YXRlKCJnZXQiKTsKKyAgICAgICAgd2hpbGUoaXNFbXB0eSgpICYmICFtSW5TaHV0ZG93bikgeworICAgICAgICAgICAgbVNpZ25hbFRvQ29udHJvbC5zZXQoKTsKKyAgICAgICAgICAgIG1TaWduYWxUb1dvcmtlci53YWl0KCk7CisgICAgICAgIH0KKworICAgICAgICAqY29tbWFuZCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDE2X3QgKj4obUdldClbMF07CisgICAgICAgICpieXRlc0RhdGEgPSByZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQxNl90ICo+KG1HZXQpWzFdOworICAgICAgICBpZiAoKmNvbW1hbmQpIHsKKyAgICAgICAgICAgIC8vIG5vbi16ZXJvIGNvbW1hbmQgaXMgdmFsaWQKKyAgICAgICAgICAgIHJldHVybiBtR2V0KzQ7CisgICAgICAgIH0KKworICAgICAgICAvLyB6ZXJvIGNvbW1hbmQgbWVhbnMgcmVzZXQgdG8gYmVnaW5uaW5nLgorICAgICAgICBtR2V0ID0gbUJ1ZmZlcjsKKyAgICB9Cit9CisKK3ZvaWQgTG9ja2xlc3NDb21tYW5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F9sb2NrKCZtTXV0ZXgpOworICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICAgTE9HRSgiTG9ja2xlc3NDb21tYW5kRmlmbzogZXJyb3IgJWkgbG9ja2luZyBmb3Igc2V0IGNvbmRpdGlvbi4iLCBzdGF0dXMpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbVNldCA9IHRydWU7CisKKyAgICBzdGF0dXMgPSBwdGhyZWFkX2NvbmRfc2lnbmFsKCZtQ29uZGl0aW9uKTsKKyAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgIExPR0UoIkxvY2tsZXNzQ29tbWFuZEZpZm86IGVycm9yICVpIG9uIHNldCBjb25kaXRpb24uIiwgc3RhdHVzKTsKKyAgICB9CisKKyAgICBzdGF0dXMgPSBwdGhyZWFkX211dGV4X3VubG9jaygmbU11dGV4KTsKKyAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgIExPR0UoIkxvY2tsZXNzQ29tbWFuZEZpZm86IGVycm9yICVpIHVubG9ja2luZyBmb3Igc2V0IGNvbmRpdGlvbi4iLCBzdGF0dXMpOworICAgIH0KK30KKwordm9pZCBMb2NrbGVzc0NvbW1hbmRGaWZvOjpTaWduYWw6OndhaXQoKQoreworICAgIGludCBzdGF0dXM7CisKKyAgICBzdGF0dXMgPSBwdGhyZWFkX211dGV4X2xvY2soJm1NdXRleCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0NvbW1hbmRGaWZvOiBlcnJvciAlaSBsb2NraW5nIGZvciBjb25kaXRpb24uIiwgc3RhdHVzKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGlmICghbVNldCkgeworICAgICAgICBzdGF0dXMgPSBwdGhyZWFkX2NvbmRfd2FpdCgmbUNvbmRpdGlvbiwgJm1NdXRleCk7CisgICAgICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICAgICAgIExPR0UoIkxvY2tsZXNzQ29tbWFuZEZpZm86IGVycm9yICV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GJvb2wgaW5pdCgpOworCisgICAgICAgIHZvaWQgc2V0KCk7CisgICAgICAgIHZvaWQgd2FpdCgpOworCisgICAgcHJvdGVjdGVkOgorICAgICAgICBib29sIG1TZXQ7CisgICAgICAgIHB0aHJlYWRfbXV0ZXhfdCBtTXV0ZXg7CisgICAgICAgIHB0aHJlYWRfY29uZF90IG1Db25kaXRpb247CisgICAgfTsKKworICAgIHVpbnQ4X3QgKiB2b2xhdGlsZSBtUHV0OworICAgIHVpbnQ4X3QgKiB2b2xhdGlsZSBtR2V0OworICAgIHVpbnQ4X3QgKiBtQnVmZmVyOworICAgIHVpbnQ4X3QgKiBtRW5kOworICAgIHVpbnQ4X3QgbVNpemU7CisgICAgYm9vbCBtSW5TaHV0ZG93bjsKKworICAgIFNpZ25hbCBtU2lnbmFsVG9Xb3JrZXI7CisgICAgU2lnbmFsIG1TaWduYWxUb0NvbnRyb2w7CisKKworCitwdWJsaWM6CisgICAgdm9pZCAqIHJlc2VydmUodWludDMyX3QgYnl0ZXMpOworICAgIHZvaWQgY29tbWl0KHVpbnQzMl90IGNvbW1hbmQsIHVpbnQzMl90IGJ5dGVzKTsKKyAgICB2b2lkIGNvbW1pdFN5bmModWludDMyX3QgY29tbWFuZCwgdWludDMyX3QgYnl0ZXMpOworCisgICAgdm9pZCBmbHVzaCgpOworICAgIGNvbnN0IHZvaWQgKiBnZXQodWludDMyX3QgKmNvbW1hbmQsIHVpbnQzMl90ICpieXRlc0RhdGEpOworICAgIHZvaWQgbmV4dCgpOworCisgICAgdm9pZCBtYWtlU3BhY2UodWludDMyX3QgYnl0ZXMpOworCisgICAgYm9vbCBpc0VtcHR5KCkgY29uc3Q7CisgICAgdWludDMyX3QgZ2V0RnJlZVNwYWNlKCkgY29uc3Q7CisKKworcHJpdmF0ZToKKyAgICB2b2lkIGR1bXBTdGF0ZShjb25zdCBjaGFyICopIGNvbnN0OworfTsKKworCit9CisjZW5kaWYKZGlmZiAtLWdpdCBhL2xpYnMvcnMvcnNNY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MgPSBjb3NmKHJvdCk7CisgICAgcyA9IHNpbmYocm90KTsKKworICAgIGNvbnN0IGZsb2F0IGxlbiA9IHNxcnRmKHgqeCArIHkqeSArIHoqeik7CisgICAgaWYgKCEobGVuICE9IDEpKSB7CisgICAgICAgIGNvbnN0IGZsb2F0IHJlY2lwTGVuID0gMS5mIC8gbGVuOworICAgICAgICB4ICo9IHJlY2lwTGVuOworICAgICAgICB5ICo9IHJlY2lwTGVuOworICAgICAgICB6ICo9IHJlY2lwTGVuOworICAgIH0KKyAgICBjb25zdCBmbG9hdCBuYyA9IDEuMGYgLSBjOworICAgIGNvbnN0IGZsb2F0IHh5ID0geCAqIHk7CisgICAgY29uc3QgZmxvYXQgeXogPSB5ICogejsKKyAgICBjb25zdCBmbG9hdCB6eCA9IHogKiB4OworICAgIGNvbnN0IGZsb2F0IHhzID0geCAqIHM7CisgICAgY29uc3QgZmxvYXQgeXMgPSB5ICogczsKKyAgICBjb25zdCBmbG9hdCB6cyA9IHogKiBzOwkJCisgICAgbVsgMF0gPSB4KngqbmMgKyAgYzsKKyAgICBtWyA0XSA9ICB4eSpuYyAtIHpzOworICAgIG1bIDhdID0gIHp4Km5jICsgeXM7CisgICAgbVsgMV0gPSAgeHkqbmMgKyB6czsKKyAgICBtWyA1XSA9IHkqeSpuYyArICBjOworICAgIG1bIDldID0gIHl6Km5jIC0geHM7CisgICAgbVsgMl0gPSAgengqbmMgLSB5czsKKyAgICBtWyA2XSA9ICB5eipuYyArIHhzOworICAgIG1bMTBdID0geip6Km5jICsgIGM7Cit9CisKK3ZvaWQgTWF0cml4Ojpsb2FkU2NhbGUoZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikKK3sKKyAgICBsb2FkSWRlbnRpdHkoKTsKKyAgICBtWzBdID0geDsKKyAgICBtWzVdID0geTsKKyAgICBtWzEwXSA9IHo7Cit9CisKK3ZvaWQgTWF0cml4Ojpsb2FkVHJhbnNsYXRlKGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopCit7CisgICAgbG9hZElkZW50aXR5KCk7CisgICAgbVsxMl0gPSB4OworICAgIG1bMTNdID0geTsKKyAgICBtWzE0XSA9IHo7Cit9CisKK3ZvaWQgTWF0cml4Ojpsb2FkTXVsdGlwbHkoY29uc3QgTWF0cml4ICpsaHMsIGNvbnN0IE1hdHJpeCAqcmhzKQoreworICAgIGZvciAoaW50IGk9MCA7IGk8NCA7IGkrKykgeworICAgICAgICBmbG9hdCByaTAgPSAwOworICAgICAgICBmbG9hdCByaTEgPSAwOworICAgICAgICBmbG9hdCByaTIgPSAwOworICAgICAgICBmbG9hdCByaTMgPSAwOworICAgICAgICBmb3IgKGludCBqPTAgOyBqPDQgOyBqKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHJoc19paiA9IHJocy0+Z2V0KGksaik7CisgICAgICAgICAgICByaTAgKz0gbGhzLT5nZXQoaiwwKSAqIHJoc19pajsKKyAgICAgICAgICAgIHJpMSArPSBsaHMtPmdldChqLDEpICogcmhzX2lqOworICAgICAgICAgICAgcmkyICs9IGxocy0+Z2V0KGosMikgKiByaHNfaWo7CisgICAgICAgICAgICByaTMgKz0gbGhzLT5nZXQoaiwzKSAqIHJoc19pajsKKyAgICAgICAgfQorICAgICAgICBzZXQoaSwwLCByaTApOworICAgICAgICBzZXQoaSwxLCByaTEpOworICAgICAgICBzZXQoaSwyLCByaTIpOworICAgICAgICBzZXQoaSwzLCByaTMpOworICAgIH0KK30KKwordm9pZCBNYXRyaXg6OmxvYWRPcnRobyhmbG9hdCBsLCBmbG9hdCByLCBmbG9hdCBiLCBmbG9hdCB0LCBmbG9hdCBuLCBmbG9hdCBmKSB7CisgICAgbG9hZElkZW50aXR5KCk7CisgICAgbVswXSA9IDIgLyAociAtIGwpOworICAgIG1bNV0gPSAyIC8gKHQgLSBiKTsKKyAgICBtWzEwXT0gLTIgLyAoZiAtIG4pOworICAgIG1bMTJdPSAtKHIgKyBsKSAvIChyIC0gbCk7CisgICAgbVsxM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KyAgICAgICAgQWxsb2NhdGlvbiAqKiBtQWxsb2NhdGlvbnM7CisgICAgICAgIHVpbnQzMl90IG1BbGxvY2F0aW9uQ291bnQ7CisKKyAgICAgICAgc2l6ZV90IG1WZXJ0ZXhEYXRhU2l6ZTsKKworICAgICAgICBzaXplX3QgbU9mZnNldENvb3JkOworICAgICAgICBzaXplX3QgbU9mZnNldFRleDsKKyAgICAgICAgc2l6ZV90IG1PZmZzZXROb3JtOworICAgIAorICAgICAgICBzaXplX3QgbVNpemVDb29yZDsKKyAgICAgICAgc2l6ZV90IG1TaXplVGV4OworICAgICAgICBzaXplX3QgbVNpemVOb3JtOworCisgICAgICAgIHVpbnQzMl90IG1CdWZmZXJPYmplY3Q7CisgICAgfTsKKworICAgIHN0cnVjdCBQcmltaXRpdmVfdAorICAgIHsKKyAgICAgICAgUnNQcmltaXRpdmUgbVR5cGU7CisgICAgICAgIFZlcnRpY2llc190ICptVmVydGljaWVzOworCisgICAgICAgIHVpbnQzMl90IG1JbmRleENvdW50OworICAgICAgICB1aW50MTZfdCAqbUluZGljaWVzOworCisgICAgICAgIHVpbnQzMl90IG1SZXN0YXJ0Q291bnRzOworICAgICAgICB1aW50MTZfdCAqbVJlc3RhcnRzOworICAgIH07CisKKyAgICBWZXJ0aWNpZXNfdCAqIG1WZXJ0aWNpZXM7CisgICAgdWludDMyX3QgbVZlcnRpY2llc0NvdW50OworCisgICAgUHJpbWl0aXZlX3QgKiogbVByaW1pdGl2ZXM7CisgICAgdWludDMyX3QgbVByaW1pdGl2ZXNDb3VudDsKKworCisKKyAgICB2b2lkIGFuYWx5emVFbGVtZW50KCk7Citwcm90ZWN0ZWQ6Cit9OworCitjbGFzcyBNZXNoQ29udGV4dAoreworcHVibGljOgorICAgIE1lc2hDb250ZXh0KCk7CisgICAgfk1lc2hDb250ZXh0KCk7CisKK307CisKKworfQorfQorI2VuZGlmIC8vQU5EUk9JRF9SU19UUklBTkdMRV9NRVNIX0gKKworCmRpZmYgLS1naXQgY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worfQorCitpbmxpbmUgdm9pZCBTQ19ub3JtYWxpemVmMyhmbG9hdCB2W10pCit7CisgICAgZmxvYXQgcyA9IChmbG9hdClzcXJ0Zih2WzBdICogdlswXSArIHZbMV0gKiB2WzFdICsgdlsyXSAqIHZbMl0pOworICAgIHZbMF0gPSB2WzBdIC8gczsKKyAgICB2WzFdID0gdlsxXSAvIHM7CisgICAgdlsyXSA9IHZbMl0gLyBzOworfQorCitzdGF0aWMgdm9pZCBub2lzZV9pbml0KCkKK3sKKyAgICBpbnQgaSwgaiwgazsKKyAgICAKKyAgICBmb3IgKGkgPSAwOyBpIDwgQjsgaSsrKSB7CisgICAgICAgIHBbaV0gPSBpOworICAgICAgICAKKyAgICAgICAgZzFbaV0gPSAoZmxvYXQpKChyYW5kKCkgJSAoQiArIEIpKSAtIEIpIC8gQjsKKyAgICAgICAgCisgICAgICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKyspCisgICAgICAgICAgICBnMltpXVtqXSA9IChmbG9hdCkoKHJhbmQoKSAlIChCICsgQikpIC0gQikgLyBCOworICAgICAgICBTQ19ub3JtYWxpemVmMihnMltpXSk7CisgICAgICAgIAorICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaisrKQorICAgICAgICAgICAgZzNbaV1bal0gPSAoZmxvYXQpKChyYW5kKCkgJSAoQiArIEIpKSAtIEIpIC8gQjsKKyAgICAgICAgU0Nfbm9ybWFsaXplZjMoZzNbaV0pOworICAgIH0KKyAgICAKKyAgICBmb3IgKGkgPSBCLTE7IGkgPj0gMDsgaS0tKSB7CisgICAgICAgIGsgPSBwW2ldOworICAgICAgICBwW2ldID0gcFtqID0gcmFuZCgpICUgQl07CisgICAgICAgIHBbal0gPSBrOworICAgIH0KKyAgICAKKyAgICBmb3IgKGkgPSAwOyBpIDwgQiArIDI7IGkrKykgeworICAgICAgICBwW0IgKyBpXSA9IHBbaV07CisgICAgICAgIGcxW0IgKyBpXSA9IGcxW2ldOworICAgICAgICBmb3IgKGogPSAwOyBqIDwgMjsgaisrKQorICAgICAgICAgICAgZzJbQiArIGldW2pdID0gZzJbaV1bal07CisgICAgICAgIGZvciAoaiA9IDA7IGogPCAzOyBqKyspCisgICAgICAgICAgICBnM1tCICsgaV1bal0gPSBnM1tpXVtqXTsKKyAgICB9Cit9CisKK2Zsb2F0IFNDX25vaXNlZihmbG9hdCB4KQoreworICAgIHNyYW5kKHRpbWUoTlVMTCkpOworICAgIGludCBieDAsIGJ4MTsKKyAgICBmbG9hdCByeDAsIHJ4MSwgc3gsIHQsIHUsIHY7CisgICAgCisgICAgaWYgKG5vaXNlX3N0YXJ0KSB7CisgICAgICAgIG5vaXNlX3N0YXJ0ID0gZmFsc2U7CisgICAgICAgIG5vaXNlX2luaXQoKTsKKyAgICB9CisgICAgCisgICAgdCA9IHggKyBOOworICAgIGJ4MCA9ICgoaW50KXQpICYgQk07CisgICAgYngxID0gKGJ4MCsxKSAmIEJNOworICAgIHJ4MCA9IHQgLSAoaW50KXQ7CisgICAgcngxID0gcngwIC0gMS4wZjsKKyAgICAKKyAgICBzeCA9IG5vaXNlX3NDdXJ2ZShyeDApOworICAgIAorICAgIHUgPSByeDAgKiBnMVtwW2J4MF1dOworICAgIHYgPSByeDEgKiBnMVtwW2J4MV1dOworICAgIHJldHVybiAyLjNmICogbGVycGYodSwgdiwgc3gpOworfQorCitmbG9hdCBTQ19ub2lzZWYyKGZsb2F0IHgsIGZsb2F0IHkpCit7CisgICAgc3JhbmQodGltZShOVUxMKSk7CisgICAgaW50IGJ4MCwgYngxLCBieTAsIGJ5MSwgYjAwLCBiMTAsIGIwMSwgYjExOworICAgIGZsb2F0IHJ4MCwgcngxLCByeTAsIHJ5MSwgc3gsIHN5LCBhLCBiLCB0LCB1LCB2OworICAgIGZsb2F0ICpxOworICAgIGludCBpLCBqOworICAgIAorICAgIGlmIChub2lzZV9zdGFydCkgeworICAgICAgICBub2lzZV9zdGFydCA9IGZhbHNlOworICAgICAgICBub2lzZV9pbml0KCk7CisgICAgfQorICAgIAorICAgIHQgPSB4ICsgTjsKKyAgICBieDAgPSAoKGludCl0KSAmIEJNOworICAgIGJ4MSA9IChieDArMSkgJiBCTTsKKyAgICByeDAgPSB0IC0gKGludCl0OworICAgIHJ4MSA9IHJ4MCAtIDEuMGY7CisJCisgICAgdCA9IHkgKyBOOworICAgIGJ5MCA9ICgoaW50KXQpICYgQk07CisgICAgYnkxID0gKGJ5MCsxKSAmIEJNOworICAgIHJ5MCA9IHQgLSAoaW50KXQ7CisgICAgcnkxID0gcnkwIC0gMS4wZjsKKwkKKyAgICBpID0gcFtieDBdOworICAgIGogPSBwW2J4MV07CisgICAgCisgICAgYjAwID0gcFtpICsgYnkwXTsKKyAgICBiMTAgPSBwW2ogKyBieTBdOworICAgIGIwMSA9IHBbaSArIGJ5MV07CisgICAgYjExID0gcFtqICsgYnkxXTsKKyAgICAKKyAgICBzeCA9IG5vaXNlX3NDdXJ2ZShyeDApOworICAgIHN5ID0gbm9pc2Vfc0N1cnZlKHJ5MCk7CisgICAgCisgICAgcSA9IGcyW2IwMF07IHUgPSByeDAgKiBxWzBdICsgcnkwICogcVsxXTsKKyAgICBxID0gZzJbYjEwXTsgdiA9IHJ4MSAqIHFbMF0gKyByeTAgKiBxWzFdOworICAgIGEgPSBsZXJwZih1LCB2LCBzeCk7CisgICAgCisgICAgcSA9IGcyW2IwMV07IHUgPSByeDAgKiBxWzBdICsgcnkxICogcVsxXTsKKyAgICBxID0gZzJbYjExXTsgdiA9IHJ4MSAqIHFbMF0gKyByeTEgKiBxWzFdOworICAgIGIgPSBsZXJwZih1LCB2LCBzeCk7CisgICAgCisgICAgcmV0dXJuIDEuNWYqbGVycGYoYSwgYiwgc3kpOworfQorCitmbG9hdCBTQ19ub2lzZWYzKGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopCit7CisgICAgc3JhbmQodGltZShOVUxMKSk7CisgICAgaW50IGJ4MCwgYngxLCBieTAsIGJ5MSwgYnowLCBiejEsIGIwMCwgYjEwLCBiMDEsIGIxMTsKKyAgICBmbG9hdCByeDAsIHJ4MSwgcnkwLCByeTEsIHJ6MCwgcnoxLCBzeSwgc3osIGEsIGIsIGMsIGQsIHQsIHUsIHY7CisgICAgZmxvYXQgKnE7CisgICAgaW50IGksIGo7CisgICAgCisgICAgaWYgKG5vaXNlX3N0YXJ0KSB7CisgICAgICAgIG5vaXNlX3N0YXJ0ID0gZmFsc2U7CisgICAgICAgIG5vaXNlX2luaXQoKTsKKyAgICB9CisgICAgCisgICAgdCA9IHggKyBOOworICAgIGJ4MCA9ICgoaW50KXQpICYgQk07CisgICAgYngxID0gKGJ4MCsxKSAmIEJNOworICAgIHJ4MCA9IHQgLSAoaW50KXQ7CisgICAgcngxID0gcngwIC0gMS4wZjsKKyAgICAKKyAgICB0ID0geSArIE47CisgICAgYnkwID0gKChpbnQpdCkgJiBCTTsKKyAgICBieTEgPSAoYnkwKzEpICYgQk07CisgICAgcnkwID0gdCAtIChpbnQpdDsKKyAgICByeTEgPSByeTAgLSAxLjBmOworCQorICAgIHQgPSB6ICsgTjsKKyAgICBiejAgPSAoKGludCl0KSAmIEJNOworICAgIGJ6MSA9IChiejArMSkgJiBCTTsKKyAgICByejAgPSB0IC0gKGludCl0OworICAgIHJ6MSA9IHJ6MCAtIDEuMGY7CisJCisgICAgaSA9IHBbYngwXTsKKyAgICBqID0gcFtieDFdOworICAgIAorICAgIGIwMCA9IHBbaSArIGJ5MF07CisgICAgYjEwID0gcFtqICsgYnkwXTsKKyAgICBiMDEgPSBwW2kgKyBieTFdOworICAgIGIxMSA9IHBbaiArIGJ5MV07CisgICAgCisgICAgdCAgPSBub2lzZV9zQ3VydmUocngwKTsKKyAgICBzeSA9IG5vaXNlX3NDdXJ2ZShyeTApOworICAgIHN6ID0gbm9pc2Vfc0N1cnZlKHJ6MCk7CisgICAgCisgICAgcSA9IGczW2IwMCArIGJ6MF07IHUgPSByeDAgKiBxWzBdICsgcnkwICogcVsxXSArIHJ6MCAqIHFbMl07CisgICAgcSA9IGczW2IxMCArIGJ6MF07IHYgPSByeDEgKiBxWzBdICsgcnkwICogcVsxXSArIHJ6MCAqIHFbMl07CisgICAgYSA9IGxlcnBmKHUsIHYsIHQpOworICAgIAorICAgIHEgPSBnM1tiMDEgKyBiejBdOyB1ID0gcngwICogcVswXSArIHJ5MSAqIHFbMV0gKyByejAgKiBxWzJdOworICAgIHEgPSBnM1tiMTEgKyBiejBdOyB2ID0gcngxICogcVswXSArIHJ5MSAqIHFbMV0gKyByejAgKiBxWzJdOworICAgIGIgPSBsZXJwZih1LCB2LCB0KTsKKyAgICAKKyAgICBjID0gbGVycGYoYSwgYiwgc3kpOworICAgIAorICAgIHEgPSBnM1tiMDAgKyBiejFdOyB1ID0gcngwICogcVswXSArIHJ5MCAqIHFbMV0gKyByejEgKiBxWzJdOworICAgIHEgPSBnM1tiMTAgKyBiejFdOyB2ID0gcngxICogcVswXSArIHJ5MCAqIHFbMV0gKyByejEgKiBxWzJdOworICAgIGEgPSBsZXJwZih1LCB2LCB0KTsKKyAgICAKKyAgICBxID0gZzNbYjAxICsgYnoxXTsgdSA9IHJ4MCAqIHFbMF0gKyByeTEgKiBxWzFdICsgcnoxICogcVsyXTsKKyAgICBxID0gZzNbYjExICsgYnoxXTsgdiA9IHJ4MSAqIHFbMF0gKyByeTEgKiBxWzFdICsgcnoxICogcVsyXTsKKyAgICBiID0gbGVycGYodSwgdiwgdCk7CisgICAgCisgICAgZCA9IGxlcnBmKGEsIGIsIHN5KTsKKyAgICAKKyAgICByZXR1cm4gMS41ZipsZXJwZihjLCBkLCBzeik7Cit9CisKK2Zsb2F0IFNDX3R1cmJ1bGVuY2VmMihmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCBvY3RhdmVzKQoreworICAgIHNyYW5kKHRpbWUoTlVMTCkpOworICAgIGZsb2F0IHQgPSAwLjBmOworICAgIAorICAgIGZvciAoZmxvYXQgZiA9IDEuMGY7IGYgPD0gb2N0YXZlczsgZiAqPSAyKQorICAgICAgICB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gICAgTE9HVigiRGVsZXRpbmcgUlMgb2JqZWN0ICVwLCBuYW1lICVzIiwgdGhpcywgbU5hbWUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTE9HVigiRGVsZXRpbmcgUlMgb2JqZWN0ICVwLCBubyBuYW1lIiwgdGhpcyk7CisgICAgICAgIH0KKyAgICAgICAgZGVsZXRlIHRoaXM7CisgICAgfQorfQorCit2b2lkIE9iamVjdEJhc2U6OmRlY1N5c1JlZigpIGNvbnN0Cit7CisgICAgcnNBc3NlcnQobVN5c1JlZkNvdW50ID4gMCk7CisgICAgbVN5c1JlZkNvdW50IC0tOworICAgIC8vTE9HVigiT2JqZWN0QmFzZSAlcCBkZWMgcmVmICVpIiwgdGhpcywgbVJlZkNvdW50KTsKKyAgICBpZiAoIShtU3lzUmVmQ291bnQgfCBtVXNlclJlZkNvdW50KSkgeworICAgICAgICBpZiAobU5hbWUpIHsKKyAgICAgICAgICAgIExPR1YoIkRlbGV0aW5nIFJTIG9iamVjdCAlcCwgbmFtZSAlcyIsIHRoaXMsIG1OYW1lKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExPR1YoIkRlbGV0aW5nIFJTIG9iamVjdCAlcCwgbm8gbmFtZSIsIHRoaXMpOworICAgICAgICB9CisgICAgICAgIGRlbGV0ZSB0aGlzOworICAgIH0KK30KKwordm9pZCBPYmplY3RCYXNlOjpzZXROYW1lKGNvbnN0IGNoYXIgKm5hbWUpCit7CisgICAgZGVsZXRlIG1OYW1lOworICAgIG1OYW1lID0gTlVMTDsKKyAgICBpZiAobmFtZSkgeworICAgICAgICBtTmFtZSA9IG5ldyBjaGFyW3N0cmxlbihuYW1lKSArMV07CisgICAgICAgIHN0cmNweShtTmFtZSwgbmFtZSk7CisgICAgfQorfQorCit2b2lkIE9iamVjdEJhc2U6OnNldE5hbWUoY29uc3QgY2hhciAqbmFtZSwgdWludDMyX3QgbGVuKQoreworICAgIGRlbGV0ZSBtTmFtZTsKKyAg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2xhc3MgT2JqZWN0QmFzZVJlZgoreworcHVibGljOgorICAgIE9iamVjdEJhc2VSZWYoKSB7CisgICAgICAgIG1SZWYgPSBOVUxMOworICAgIH0KKworICAgIE9iamVjdEJhc2VSZWYoY29uc3QgT2JqZWN0QmFzZVJlZiAmcmVmKSB7CisgICAgICAgIG1SZWYgPSByZWYuZ2V0KCk7CisgICAgICAgIGlmIChtUmVmKSB7CisgICAgICAgICAgICBtUmVmLT5pbmNTeXNSZWYoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIE9iamVjdEJhc2VSZWYoVCAqcmVmKSB7CisgICAgICAgIG1SZWYgPSByZWY7CisgICAgICAgIGlmIChtUmVmKSB7CisgICAgICAgICAgICByZWYtPmluY1N5c1JlZigpOworICAgICAgICB9CisgICAgfQorCisgICAgfk9iamVjdEJhc2VSZWYoKSB7CisgICAgICAgIGNsZWFyKCk7CisgICAgfQorCisgICAgdm9pZCBzZXQoVCAqcmVmKSB7CisgICAgICAgIGlmIChtUmVmICE9IHJlZikgeworICAgICAgICAgICAgY2xlYXIoKTsKKyAgICAgICAgICAgIG1SZWYgPSByZWY7CisgICAgICAgICAgICBpZiAobVJlZikgeworICAgICAgICAgICAgICAgIHJlZi0+aW5jU3lzUmVmKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHNldChjb25zdCBPYmplY3RCYXNlUmVmICZyZWYpIHsKKyAgICAgICAgc2V0KHJlZi5tUmVmKTsKKyAgICB9CisKKyAgICB2b2lkIGNsZWFyKCkgeworICAgICAgICBpZiAobVJlZikgeworICAgICAgICAgICAgbVJlZi0+ZGVjU3lzUmVmKCk7CisgICAgICAgIH0KKyAgICAgICAgbVJlZiA9IE5VTEw7CisgICAgfQorCisgICAgaW5saW5lIFQgKiBnZXQoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBtUmVmOworICAgIH0KKworICAgIGlubGluZSBUICogb3BlcmF0b3ItPiAoKSBjb25zdCB7CisgICAg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FNwcml0ZUVuYWJsZSkgeworICAgICAgICAgICAgICAgIGdsRW5hYmxlKEdMX1BPSU5UX1NQUklURV9PRVMpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBnbERpc2FibGUoR0xfUE9JTlRfU1BSSVRFX09FUyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBnbFRleEVudmkoR0xfUE9JTlRfU1BSSVRFX09FUywgR0xfQ09PUkRfUkVQTEFDRV9PRVMsIG1Qb2ludFNwcml0ZUVuYWJsZSk7CisgICAgICAgIH0KKyAgICAgICAgZ2xCaW5kVGV4dHVyZShHTF9URVhUVVJFXzJELCBtVGV4dHVyZXNbY3RdLT5nZXRUZXh0dXJlSUQoKSk7CisKKyAgICAgICAgc3dpdGNoKG1FbnZNb2Rlc1tjdF0pIHsKKyAgICAgICAgY2FzZSBSU19URVhfRU5WX01PREVfUkVQTEFDRToKKyAgICAgICAgICAgIGdsVGV4RW52ZihHTF9URVhUVVJFX0VOViwgR0xfVEVYVFVSRV9FTlZfTU9ERSwgR0xfUkVQTEFDRSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBSU19URVhfRU5WX01PREVfTU9EVUxBVEU6CisgICAgICAgICAgICBnbFRleEVudmYoR0xfVEVYVFVSRV9FTlYsIEdMX1RFWFRVUkVfRU5WX01PREUsIEdMX01PRFVMQVRFKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJTX1RFWF9FTlZfTU9ERV9ERUNBTDoKKyAgICAgICAgICAgIGdsVGV4RW52ZihHTF9URVhUVVJFX0VOViwgR0xfVEVYVFVSRV9FTlZfTU9ERSwgR0xfREVDQUwpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAobVNhbXBsZXJzW2N0XS5nZXQoKSkgeworICAgICAgICAgICAgbVNhbXBsZXJzW2N0XS0+c2V0dXBHTCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIC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ICBnbEVuYWJsZShHTF9CTEVORCk7CisgICAgICAgIGdsQmxlbmRGdW5jKG1CbGVuZFNyYywgbUJsZW5kRHN0KTsKKyAgICB9IGVsc2UgeworICAgICAgICBnbERpc2FibGUoR0xfQkxFTkQpOworICAgIH0KKworICAgIC8vTE9HRSgicGZzICAlaSwgJWksICV4IiwgbURlcHRoV3JpdGVFbmFibGUsIG1EZXB0aFRlc3RFbmFibGUsIG1EZXB0aEZ1bmMpOworCisgICAgZ2xEZXB0aE1hc2sobURlcHRoV3JpdGVFbmFibGUpOworICAgIGlmKG1EZXB0aFRlc3RFbmFibGUgfHwgbURlcHRoV3JpdGVFbmFibGUpIHsKKyAgICAgICAgZ2xFbmFibGUoR0xfREVQVEhfVEVTVCk7CisgICAgICAgIGdsRGVwdGhGdW5jKG1EZXB0aEZ1bmMpOworICAgIH0gZWxzZSB7CisgICAgICAgIGdsRGlzYWJsZShHTF9ERVBUSF9URVNUKTsKKyAgICB9CisKKyAgICBpZiAobURpdGhlckVuYWJsZSkgeworICAgICAgICBnbEVuYWJsZShHTF9ESVRIRVIpOworICAgIH0gZWxzZSB7CisgICAgICAgIGdsRGlzYWJsZShHTF9ESVRIRVIpOworICAgIH0KKworCit9CisKK3ZvaWQgUHJvZ3JhbUZyYWdtZW50U3RvcmU6OnNldERpdGhlckVuYWJsZShib29sIGVuYWJsZSkKK3sKKyAgICBtRGl0aGVyRW5hYmxlID0gZW5hYmxlOworfQorCit2b2lkIFByb2dyYW1GcmFnbWVudFN0b3JlOjpzZXREZXB0aEZ1bmMoUnNEZXB0aEZ1bmMgZnVuYykKK3sKKyAgICBtRGVwdGhUZXN0RW5hYmxlID0gdHJ1ZTsKKworICAgIHN3aXRjaChmdW5jKSB7CisgICAgY2FzZSBSU19ERVBUSF9GVU5DX0FMV0FZUzoKKyAgICAgICAgbURlcHRoVGVzdEVuYWJsZSA9IGZhbHNlOworICAgICAgICBtRGVwdGhGdW5jID0gR0xfQUxXQVlTOworICAgICAgICBicmVhaz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Y2FzZSBSU19CTEVORF9TUkNfWkVSTzoKKyAgICAgICAgbUJsZW5kU3JjID0gR0xfWkVSTzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9TUkNfT05FOgorICAgICAgICBtQmxlbmRTcmMgPSBHTF9PTkU7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfU1JDX0RTVF9DT0xPUjoKKyAgICAgICAgbUJsZW5kU3JjID0gR0xfRFNUX0NPTE9SOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX1NSQ19PTkVfTUlOVVNfRFNUX0NPTE9SOgorICAgICAgICBtQmxlbmRTcmMgPSBHTF9PTkVfTUlOVVNfRFNUX0NPTE9SOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX1NSQ19TUkNfQUxQSEE6CisgICAgICAgIG1CbGVuZFNyYyA9IEdMX1NSQ19BTFBIQTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9TUkNfT05FX01JTlVTX1NSQ19BTFBIQToKKyAgICAgICAgbUJsZW5kU3JjID0gR0xfT05FX01JTlVTX1NSQ19BTFBIQTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9TUkNfRFNUX0FMUEhBOgorICAgICAgICBtQmxlbmRTcmMgPSBHTF9EU1RfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfU1JDX09ORV9NSU5VU19EU1RfQUxQSEE6CisgICAgICAgIG1CbGVuZFNyYyA9IEdMX09ORV9NSU5VU19EU1RfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfU1JDX1NSQ19BTFBIQV9TQVRVUkFURToKKyAgICAgICAgbUJsZW5kU3JjID0gR0xfU1JDX0FMUEhBX1NBVFVSQVRFOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBzd2l0Y2goZHN0KSB7CisgICAgY2FzZSBSU19CTEVORF9EU1RfWkVSTzoKKyAgICAgICAgbUJsZW5kRHN0ID0gR0xfWkVSTzsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9EU1RfT05FOgorICAgICAgICBtQmxlbmREc3QgPSBHTF9PTkU7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfRFNUX1NSQ19DT0xPUjoKKyAgICAgICAgbUJsZW5kRHN0ID0gR0xfU1JDX0NPTE9SOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX0RTVF9PTkVfTUlOVVNfU1JDX0NPTE9SOgorICAgICAgICBtQmxlbmREc3QgPSBHTF9PTkVfTUlOVVNfU1JDX0NPTE9SOworICAgICAgICBicmVhazsKKyAgICBjYXNlIFJTX0JMRU5EX0RTVF9TUkNfQUxQSEE6CisgICAgICAgIG1CbGVuZERzdCA9IEdMX1NSQ19BTFBIQTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9EU1RfT05FX01JTlVTX1NSQ19BTFBIQToKKyAgICAgICAgbUJsZW5kRHN0ID0gR0xfT05FX01JTlVTX1NSQ19BTFBIQTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBSU19CTEVORF9EU1RfRFNUX0FMUEhBOgorICAgICAgICBtQmxlbmREc3QgPSBHTF9EU1RfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgUlNfQkxFTkRfRFNUX09ORV9NSU5VU19EU1RfQUxQSEE6CisgICAgICAgIG1CbGVuZERzdCA9IEdMX09ORV9NSU5VU19EU1RfQUxQSEE7CisgICAgICAgIGJyZWFrOworICAgIH0KK30KKwordm9pZCBQcm9ncmFtRnJhZ21lbnRTdG9yZTo6c2V0Q29sb3JNYXNrKGJvb2wgciwgYm9vbCBnLCBib29sIGIsIGJvb2wgYSkKK3sKKyAgICBtQ29sb3JSV3JpdGVFbmFibGUgPSByOworICAgIG1Db2xvckdXcml0ZU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yaXhFbmFibGUpIHsKKyAgICAgICAgZ2xMb2FkTWF0cml4ZigmZltSU19QUk9HUkFNX1ZFUlRFWF9URVhUVVJFX09GRlNFVF0pOworICAgIH0gZWxzZSB7CisgICAgICAgIGdsTG9hZElkZW50aXR5KCk7CisgICAgfQorCisgICAgZ2xNYXRyaXhNb2RlKEdMX01PREVMVklFVyk7CisgICAgZ2xMb2FkSWRlbnRpdHkoKTsKKyAgICBpZiAobUxpZ2h0Q291bnQpIHsKKyAgICAgICAgaW50IHYgPSAwOworICAgICAgICBnbEVuYWJsZShHTF9MSUdIVElORyk7CisgICAgICAgIGdsTGlnaHRNb2RlbHh2KEdMX0xJR0hUX01PREVMX1RXT19TSURFLCAmdik7CisgICAgICAgIGZvciAodWludDMyX3QgY3QgPSAwOyBjdCA8IG1MaWdodENvdW50OyBjdCsrKSB7CisgICAgICAgICAgICBjb25zdCBMaWdodCAqbCA9IG1MaWdodHNbY3RdLmdldCgpOworICAgICAgICAgICAgZ2xFbmFibGUoR0xfTElHSFQwICsgY3QpOworICAgICAgICAgICAgbC0+c2V0dXBHTChjdCk7CisgICAgICAgIH0KKyAgICAgICAgZm9yICh1aW50MzJfdCBjdCA9IG1MaWdodENvdW50OyBjdCA8IE1BWF9MSUdIVFM7IGN0KyspIHsKKyAgICAgICAgICAgIGdsRGlzYWJsZShHTF9MSUdIVDAgKyBjdCk7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICBnbERpc2FibGUoR0xfTElHSFRJTkcpOworICAgIH0KKworICAgIGlmICghZikgeworICAgICAgICBMT0dFKCJNdXN0IGJpbmQgY29uc3RhbnRzIHRvIHZlcnRleCBwcm9ncmFtIik7CisgICAgfQorCisgICAgZ2xNYXRyaXhNb2RlKEdMX1BST0pFQ1RJT04pOworICAgIGdsTG9hZE1hdHJpeGYoJmZbUlNfUFJPR1JBTV9WRVJURVhfUFJPSkVDVElPTl9PRkZTRVRdKTsKKyAgICBnbE1hdHJpeE1vZGUoR0xfTU9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GlmIChtRW52aXJvbWVudC5tRnJhZ21lbnQuZ2V0KCkpIHsKKyAgICAgICAgcnNjLT5zZXRGcmFnbWVudChtRW52aXJvbWVudC5tRnJhZ21lbnQuZ2V0KCkpOworICAgIH0KKyAgICBpZiAobUVudmlyb21lbnQubVZlcnRleC5nZXQoKSkgeworICAgICAgICByc2MtPnNldFZlcnRleChtRW52aXJvbWVudC5tVmVydGV4LmdldCgpKTsKKyAgICB9CisKKyAgICBpZiAobGF1bmNoSW5kZXggPT0gMCkgeworICAgICAgICBtRW52aXJvbWVudC5tU3RhcnRUaW1lTWlsbGlzCisgICAgICAgICAgICAgICAgPSBuYW5vc2Vjb25kc190b19taWxsaXNlY29uZHMoc3lzdGVtVGltZShTWVNURU1fVElNRV9NT05PVE9OSUMpKTsKKyAgICB9CisKKyAgICBmb3IgKGludCBjdD0wOyBjdCA8IE1BWF9TQ1JJUFRfQkFOS1M7IGN0KyspIHsKKyAgICAgICAgaWYgKG1Qcm9ncmFtLm1TbG90UG9pbnRlcnNbY3RdKSB7CisgICAgICAgICAgICAqbVByb2dyYW0ubVNsb3RQb2ludGVyc1tjdF0gPSBtU2xvdHNbY3RdLT5nZXRQdHIoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGJvb2wgcmV0ID0gZmFsc2U7CisgICAgdGxzLT5tU2NyaXB0ID0gdGhpczsKKyAgICByZXQgPSBtUHJvZ3JhbS5tU2NyaXB0KGxhdW5jaEluZGV4KSAhPSAwOworICAgIHRscy0+bVNjcmlwdCA9IE5VTEw7CisgICAgcmV0dXJuIHJldDsKK30KKworU2NyaXB0Q1N0YXRlOjpTY3JpcHRDU3RhdGUoKQoreworICAgIGNsZWFyKCk7Cit9CisKK1NjcmlwdENTdGF0ZTo6flNjcmlwdENTdGF0ZSgpCit7CisgICAgaWYgKG1BY2NTY3JpcHQpIHsKKyAgICAgICAgYWNjRGVsZXRlU2NyaXB0KG1BY2NTY3JpcHQpOworICAgIH0KK30KKwordm9pZCBTY3JpcH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IsIChBQ0N2b2lkKiopICZtUHJvZ3JhbS5tSW5pdCk7CisgICAgcnNBc3NlcnQobVByb2dyYW0ubVNjcmlwdCk7CisKKyAgICBpZiAoIW1Qcm9ncmFtLm1TY3JpcHQpIHsKKyAgICAgICAgQUNDY2hhciBidWZbNDA5Nl07CisgICAgICAgIEFDQ3NpemVpIGxlbjsKKyAgICAgICAgYWNjR2V0U2NyaXB0SW5mb0xvZyhtQWNjU2NyaXB0LCBzaXplb2YoYnVmKSwgJmxlbiwgYnVmKTsKKyAgICAgICAgTE9HRShidWYpOworICAgIH0KKworICAgIGlmIChtUHJvZ3JhbS5tSW5pdCkgeworICAgICAgICBtUHJvZ3JhbS5tSW5pdCgpOworICAgIH0KKworICAgIGZvciAoaW50IGN0PTA7IGN0IDwgTUFYX1NDUklQVF9CQU5LUzsgY3QrKykgeworICAgICAgICBpZiAobVNsb3ROYW1lc1tjdF0ubGVuZ3RoKCkgPiAwKSB7CisgICAgICAgICAgICBhY2NHZXRTY3JpcHRMYWJlbChtQWNjU2NyaXB0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNsb3ROYW1lc1tjdF0uc3RyaW5nKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQUNDdm9pZCoqKSAmbVByb2dyYW0ubVNsb3RQb2ludGVyc1tjdF0pOworICAgICAgICAgICAgTE9HRSgidmFyICAlcyAgJXAiLCBtU2xvdE5hbWVzW2N0XS5zdHJpbmcoKSwgbVByb2dyYW0ubVNsb3RQb2ludGVyc1tjdF0pOworICAgICAgICB9CisgICAgfQorCisgICAgbUVudmlyb21lbnQubUZyYWdtZW50LnNldChyc2MtPmdldERlZmF1bHRQcm9ncmFtRnJhZ21lbnQoKSk7CisgICAgbUVudmlyb21lbnQubVZlcnRleC5zZXQocnNjLT5nZXREZWZhdWx0UHJvZ3JhbVZlcnRleCgpKTsKKyAgICBtRW52aXJvbWVudC5tRnJhZ21lbnRTdG9yZS5zZXQocnNjLT5nZXREZWZhdWx0UHJvZ3JhbUZyYWdtZW50U3RvcmUoKSk7CisKKyAgICBpZiAobVByb2dyYW0ubVNjcmlwdCkgeworICAgICAgICBjb25zdCBzdGF0aWMgaW50IHByYWdtYU1heCA9IDE2OworICAgICAgICBBQ0NzaXplaSBwcmFnbWFDb3VudDsKKyAgICAgICAgQUNDY2hhciAqIHN0cltwcmFnbWFNYXhdOworICAgICAgICBhY2NHZXRQcmFnbWFzKG1BY2NTY3JpcHQsICZwcmFnbWFDb3VudCwgcHJhZ21hTWF4LCAmc3RyWzBdKTsKKworICAgICAgICBmb3IgKGludCBjdD0wOyBjdCA8IHByYWdtYUNvdW50OyBjdCs9MikgeworICAgICAgICAgICAgaWYgKCFzdHJjbXAoc3RyW2N0XSwgInZlcnNpb24iKSkgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIXN0cmNtcChzdHJbY3RdLCAic3RhdGVWZXJ0ZXgiKSkgeworICAgICAgICAgICAgICAgIGlmICghc3RyY21wKHN0cltjdCsxXSwgImRlZmF1bHQiKSkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFzdHJjbXAoc3RyW2N0KzFdLCAicGFyZW50IikpIHsKKyAgICAgICAgICAgICAgICAgICAgbUVudmlyb21lbnQubVZlcnRleC5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgUHJvZ3JhbVZlcnRleCAqIHB2ID0gKFByb2dyYW1WZXJ0ZXggKilyc2MtPmxvb2t1cE5hbWUoc3RyW2N0KzFdKTsKKyAgICAgICAgICAgICAgICBpZiAocHYgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgICAgICBtRW52aXJvbWVudC5tVmVydGV4LnNldChwdik7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBMT0dFKCJVbnJlY29uaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVWZXJ0ZXgiLCBzdHJbY3QrMV0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIXN0cmNtcChzdHJbY3RdLCAic3RhdGVSYXN0ZXIiKSkgeworICAgICAgICAgICAgICAgIExPR0UoIlVucmVjb25pemVkIHZhbHVlICVzIHBhc3NlZCB0byBzdGF0ZVJhc3RlciIsIHN0cltjdCsxXSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghc3RyY21wKHN0cltjdF0sICJzdGF0ZUZyYWdtZW50IikpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXN0cmNtcChzdHJbY3QrMV0sICJkZWZhdWx0IikpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghc3RyY21wKHN0cltjdCsxXSwgInBhcmVudCIpKSB7CisgICAgICAgICAgICAgICAgICAgIG1FbnZpcm9tZW50Lm1GcmFnbWVudC5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgUHJvZ3JhbUZyYWdtZW50ICogcGYgPSAoUHJvZ3JhbUZyYWdtZW50ICopcnNjLT5sb29rdXBOYW1lKHN0cltjdCsxXSk7CisgICAgICAgICAgICAgICAgaWYgKHBmICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUVudmlyb21lbnQubUZyYWdtZW50LnNldChwZik7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBMT0dFKCJVbnJlY29uaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVGcmFnbWVudCIsIHN0cltjdCsxXSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghc3RyY21wKHN0cltjdF0sICJzdGF0ZUZyYWdtZW50U3RvcmUiKSkgeworICAgICAgICAgICAgICAgIGlmICghc3RyY21wKHN0cltjdCsxXSwgImRlZmF1bHQiKSkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFzdHJjbXAoc3RyW2N0KzFdLCAicGFyZW50IikpIHsKKyAgICAgICAgICAgICAgICAgICAgbUVudmlyb21lbnQubUZyYWdtZW50U3RvcmUuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIFByb2dyYW1GcmFnbWVudFN0b3JlICogcGZzID0KKyAgICAgICAgICAgICAgICAgICAgKFByb2dyYW1GcmFnbWVudFN0b3JlICopcnNjLT5sb29rdXBOYW1lKHN0cltjdCsxXSk7CisgICAgICAgICAgICAgICAgaWYgKHBmcyAhPSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgIG1FbnZpcm9tZW50Lm1GcmFnbWVudFN0b3JlLnNldChwZnMpOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgTE9HRSgiVW5yZWNvbml6ZWQgdmFsdWUgJXMgcGFzc2VkIHRvIHN0YXRlRnJhZ21lbnRTdG9yZSIsIHN0cltjdCsxXSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgfQorCisKKyAgICB9IGVsc2UgeworICAgICAgICAvLyBEZWFsIHdpdGggYW4gZXJyb3IuCisgICAgfQorfQorCitzdGF0aWMgdm9pZCBhcHBlbmRFbGVtZW50Qm9keShTdHJpbmc4ICpzLCBjb25zdCBFbGVtZW50ICplKQoreworICAgIHMtPmFwcGVuZCgiIHtcbiIpOworICAgIGZvciAoc2l6ZV90IGN0Mj0wOyBjdDIgPCBlLT5nZXRDb21wb25lbnRDb3VudCgpOyBjdDIrKykgeworICAgICAgICBjb25zdCBDb21wb25lbnQgKmMgPSBlLT5nZXRDb21wb25lbnQoY3QyKTsKKyAgICAgICAgcy0+YXBwZW5kKCIgICAgIik7CisgICAgICAgIHMtPmFwcGVuZChjLT5nZXRDVHlwZSgpKTsKKyAgICAgICAgcy0+YXBwZW5kKCIgIik7CisgICAgICAgIHMtPmFwcGVuZChjLT5nZXRDb21wb25lbnROYW1lKCkpOworICAgICAgICBzLT5hcHBlbmQoIjtcbiIpOworICAgIH0KKyAgICBzLT5hcHBlbmQoIn0iKTsKK30KKwordm9pZCBTY3JpcHRDU3RhdGU6OmFwcGVuZFZhckRlZmluZXMoU3RyaW5nOCAqc3RyKQoreworICAgIGNoYXIgYnVmWzI1Nl07CisgICAgTE9HRCgiYXBwZW5kVmFyRGVmaW5lcyBtSW50MzJEZWZpbmVzLnNpemUoKT0lZCBtRmxvYXREZWZpbmVzLnNpemUoKT0lZFxuIiwKKyAgICAgICAgICAgIG1JbnQzMkRlZmluZXMuc2l6ZSgpLCBtRmxvYXREZWZpbmVzLnNpemUoKSk7CisgICAgZm9yIChzaXplX3QgY3Q9MDsgY3QgPCBtSW50MzJEZWZpbmVzLnNpemUoKTsgY3QrKykgeworICAgICAgICBzdHItPmFwcGVuZCgiI2RlZmluZSAiKTsKKyAgICAgICAgc3RyLT5hcHBlbmQobUludDMyRGVmaW5lcy5rZXlBdChjdCkpOworICAgICAgICBzdHItPmFwcGVuZCgiICIpOworICAgICAgICBzcHJpbnRmKGJ1ZiwgIiVpXG4iLCAoaW50KW1JbnQzMkRlZmluZXMudmFsdWVBdChjdCkpOworICAgICAgICBzdHItPmFwcGVuZChidWYpOworICAgIH0KKyAgICBmb3IgKHNpemVfdCBjdD0wOyBjdCA8IG1GbG9hdERlZmluZXMuc2l6ZSgpOyBjdCsrKSB7CisgICAgICAgIHN0ci0+YXBwZW5kKCIjZGVmaW5lICIpOworICAgICAgICBzdHItPmFwcGVuZChtRmx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AgIHMuYXBwZW5kKCI7XG4iKTsKKyAgICAgICAgICAgIHMuYXBwZW5kKCIjZGVmaW5lICIpOworICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0TmFtZSgpKTsKKyAgICAgICAgICAgIHMuYXBwZW5kKCJfdCBzdHJ1Y3Qgc3RydWN0XyIpOworICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0TmFtZSgpKTsKKyAgICAgICAgICAgIHMuYXBwZW5kKCJcblxuIik7CisgICAgICAgICAgICBMT0dEKHMpOworICAgICAgICAgICAgc3RyLT5hcHBlbmQocyk7CisgICAgICAgIH0KKworICAgICAgICBpZiAodC0+Z2V0TmFtZSgpKSB7CisgICAgICAgICAgICBmb3IgKHNpemVfdCBjdDI9MDsgY3QyIDwgZS0+Z2V0Q29tcG9uZW50Q291bnQoKTsgY3QyKyspIHsKKyAgICAgICAgICAgICAgICBjb25zdCBDb21wb25lbnQgKmMgPSBlLT5nZXRDb21wb25lbnQoY3QyKTsKKyAgICAgICAgICAgICAgICB0bXAuc2V0VG8oIiNkZWZpbmUgT0ZGU0VUT0ZfIik7CisgICAgICAgICAgICAgICAgdG1wLmFwcGVuZCh0LT5nZXROYW1lKCkpOworICAgICAgICAgICAgICAgIHRtcC5hcHBlbmQoIl8iKTsKKyAgICAgICAgICAgICAgICB0bXAuYXBwZW5kKGMtPmdldENvbXBvbmVudE5hbWUoKSk7CisgICAgICAgICAgICAgICAgc3ByaW50ZihidWYsICIgJWlcbiIsIGN0Mik7CisgICAgICAgICAgICAgICAgdG1wLmFwcGVuZChidWYpOworICAgICAgICAgICAgICAgIExPR0QodG1wKTsKKyAgICAgICAgICAgICAgICBzdHItPmFwcGVuZCh0bXApOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKG1TbG90TmFtZXNbY3RdLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgU3RyaW5nOCBzOworICAgICAgICAgICAgaWYgKGUtPmdldENvbXBvbmVudENvdW50KCkgPiAxKSB7CisgICAgICAgICAgICAgICAgaWYgKGUtPmdldE5hbWUoKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBVc2UgdGhlIG5hbWVkIHN0cnVjdAorICAgICAgICAgICAgICAgICAgICBzLnNldFRvKGUtPmdldE5hbWUoKSk7CisgICAgICAgICAgICAgICAgICAgIHMuYXBwZW5kKCJfdCAqIik7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGFuIHN0cnVjdCBuYW1lZCBmcm9tIHRoZSBzbG90LgorICAgICAgICAgICAgICAgICAgICBzLnNldFRvKCJzdHJ1Y3QgIik7CisgICAgICAgICAgICAgICAgICAgIHMuYXBwZW5kKG1TbG90TmFtZXNbY3RdKTsKKyAgICAgICAgICAgICAgICAgICAgcy5hcHBlbmQoIl9zIik7CisgICAgICAgICAgICAgICAgICAgIGFwcGVuZEVsZW1lbnRCb2R5KCZzLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgcy5hcHBlbmQoIjtcbiIpOworICAgICAgICAgICAgICAgICAgICBzLmFwcGVuZCgic3RydWN0ICIpOworICAgICAgICAgICAgICAgICAgICBzLmFwcGVuZChtU2xvdE5hbWVzW2N0XSk7CisgICAgICAgICAgICAgICAgICAgIHMuYXBwZW5kKCJfcyAqICIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gSnVzdCBtYWtlIGFuIGFycmF5CisgICAgICAgICAgICAgICAgcy5zZXRUbyhlLT5nZXRDb21wb25lbnQoMCktPmdldENUeXBlKCkpOworICAgICAgICAgICAgICAgIHMuYXBwZW5kKCJfdCAqIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzLmFwcGVuZChtU2xvdE5hbWVzW2N0XSk7CisgICAgICAgICAgICBzLmFwcGVuZCgiO1xuIik7CisgICAgICAgICAgICBMT0dEKHMpOworICAgICAgICAgICAgc3RyLT5hcHBlbmQocyk7CisjaWYgMAorICAgICAgICAgICAgZm9yIChzaXplX3QgY3QyPTA7IGN0MiA8IGUtPmdldENvbXBvbmVudENvdW50KCk7IGN0MisrKSB7CisgICAgICAgICAgICAgICAgY29uc3QgQ29tcG9uZW50ICpjID0gZS0+Z2V0Q29tcG9uZW50KGN0Mik7CisgICAgICAgICAgICAgICAgdG1wLnNldFRvKCIjZGVmaW5lICIpOworICAgICAgICAgICAgICAgIHRtcC5hcHBlbmQobVNsb3ROYW1lc1tjdF0pOworICAgICAgICAgICAgICAgIHRtcC5hcHBlbmQoIl8iKTsKKyAgICAgICAgICAgICAgICB0bXAuYXBwZW5kKGMtPmdldENvbXBvbmVudE5hbWUoKSk7CisgICAgICAgICAgICAgICAgc3dpdGNoIChjLT5nZXRUeXBlKCkpIHsKKyAgICAgICAgICAgICAgICBjYXNlIENvbXBvbmVudDo6RkxPQVQ6CisgICAgICAgICAgICAgICAgICAgIHRtcC5hcHBlbmQoIiBsb2FkRigiKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDb21wb25lbnQ6OlNJR05FRDoKKyAgICAgICAgICAgICAgICAgICAgc3ByaW50ZihidWYsICIgbG9hZEklaSgiLCBjLT5nZXRCaXRzKCkpOworICAgICAgICAgICAgICAgICAgICB0bXAuYXBwZW5kKGJ1Zik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ29tcG9uZW50OjpVTlNJR05FRDoKKyAgICAgICAgICAgICAgICAgICAgc3ByaW50ZihidWYsICIgbG9hZFUlaSgiLCBjLT5nZXRCaXRzKCkpOworICAgICAgICAgICAgICAgICAgICB0bXAuYXBwZW5kKGJ1Zik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzcHJpbnRmKGJ1ZiwgIiVpLCAlaSlcbiIsIGN0LCBjdDIpOworICAgICAgICAgICAgICAgIHRtcC5hcHBlbmQoYnVmKTsKKworICAgICAgICAgICAgICAgIExPR0QodG1wKTsKKyAgICAgICAgICAgICAgICBzdHItPmFwcGVuZCh0bXApOworICAgICAgICAgICAgfQorI2VuZGlmCisgICAgICAgIH0KKyAgICB9Cit9CisKKworbmFtZXNwYWNlIGFuZHJvaWQgeworbmFtZXNwYWNlIHJlbmRlcnNjcmlwdCB7CisKK3ZvaWQgcnNpX1NjcmlwdENCZWdpbihDb250ZXh0ICogcnNjKQoreworICAgIFNjcmlwdENTdGF0ZSAqc3MgPSAmcnNjLT5tU2NyaXB0QzsKKyAgICBzcy0+Y2xlYXIoKTsKK30KKwordm9pZCByc2lfU2NyaXB0Q1NldFNjcmlwdChDb250ZXh0ICogcnNjLCB2b2lkICp2cCkKK3sKKyAgICBTY3JpcHRDU3RhdGUgKnNzID0gJnJzYy0+bVNjcmlwdEM7CisgICAgc3MtPm1Qcm9ncmFtLm1TY3JpcHQgPSByZWludGVycHJldF9jYXN0PFNjcmlwdEM6OlJ1blNjcmlwdF90Pih2cCk7Cit9CisKK3ZvaWQgcnNpX1NjcmlwdENTZXRUZXh0KENvbnRleHQgKnJzYywgY29uc3QgY2hhciAqdGV4dCwgdWludDMyX3QgbGVuKQoreworICAgIFNjcmlwdENTdGF0ZSAqc3MgPSAmcnNjLT5tU2NyaXB0QzsKKyAgICBzcy0+bVByb2dyYW0ubVNjcmlwdFRleHQgPSB0ZXh0OworICAgIHNzLT5tUHJvZ3JhbS5tU2NyaXB0VGV4dExlbmd0aCA9IGxlbjsKK30KKworCitSc1NjcmlwdCByc2lfU2NyaXB0Q0NyZWF0ZShDb250ZXh0ICogcnNjKQoreworICAgIFNjcmlwdENTdGF0ZSAqc3MgPSAmcnNjLT5tU2NyaXB0QzsKKworICAgIHNzLT5ydW5Db21waWxlcihyc2MpOworCisgICAgU2NyaXB0QyAqcyA9IG5ldyBTY3JpcHRDKCk7CisgICAgcy0+aW5jVXNlclJlZigpOworICAgI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GljIGZsb2F0IFNDX3ZlYzNMZW5ndGgoY29uc3QgdmVjM190ICp2KQoreworICAgIHJldHVybiBzcXJ0Zih2LT54ICogdi0+eCArIHYtPnkgKiB2LT55ICsgdi0+eiAqIHYtPnopOworfQorCitzdGF0aWMgdm9pZCBTQ192ZWMzQWRkKHZlYzNfdCAqZGVzdCwgY29uc3QgdmVjM190ICpsaHMsIGNvbnN0IHZlYzNfdCAqcmhzKQoreworICAgIGRlc3QtPnggPSBsaHMtPnggKyByaHMtPng7CisgICAgZGVzdC0+eSA9IGxocy0+eSArIHJocy0+eTsKKyAgICBkZXN0LT56ID0gbGhzLT56ICsgcmhzLT56OworfQorCitzdGF0aWMgdm9pZCBTQ192ZWMzU3ViKHZlYzNfdCAqZGVzdCwgY29uc3QgdmVjM190ICpsaHMsIGNvbnN0IHZlYzNfdCAqcmhzKQoreworICAgIGRlc3QtPnggPSBsaHMtPnggLSByaHMtPng7CisgICAgZGVzdC0+eSA9IGxocy0+eSAtIHJocy0+eTsKKyAgICBkZXN0LT56ID0gbGhzLT56IC0gcmhzLT56OworfQorCitzdGF0aWMgdm9pZCBTQ192ZWMzQ3Jvc3ModmVjM190ICpkZXN0LCBjb25zdCB2ZWMzX3QgKmxocywgY29uc3QgdmVjM190ICpyaHMpCit7CisgICAgZmxvYXQgeCA9IGxocy0+eSAqIHJocy0+eiAgLSBsaHMtPnogKiByaHMtPnk7CisgICAgZmxvYXQgeSA9IGxocy0+eiAqIHJocy0+eCAgLSBsaHMtPnggKiByaHMtPno7CisgICAgZmxvYXQgeiA9IGxocy0+eCAqIHJocy0+eSAgLSBsaHMtPnkgKiByaHMtPng7CisgICAgZGVzdC0+eCA9IHg7CisgICAgZGVzdC0+eSA9IHk7CisgICAgZGVzdC0+eiA9IHo7Cit9CisKK3N0YXRpYyBmbG9hdCBTQ192ZWMzRG90KGNvbnN0IHZlYzNfdCAqbGhzLCBjb25zdCB2ZWMzX3QgKnJocykKK3sKKyAgICByZXR1cm4gbGhzLT54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vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworc3RhdGljIGludDMyX3QgU0Nfc2Vjb25kKCkKK3sKKyAgICBHRVRfVExTKCk7CisKKyAgICB0aW1lX3QgcmF3dGltZTsKKyAgICB0aW1lKCZyYXd0aW1lKTsKKworICAgIGlmIChzYy0+bUVudmlyb21lbnQubVRpbWVab25lKSB7CisgICAgICAgIHN0cnVjdCB0bSB0aW1laW5mbzsKKyAgICAgICAgbG9jYWx0aW1lX3R6KCZyYXd0aW1lLCAmdGltZWluZm8sIHNjLT5tRW52aXJvbWVudC5tVGltZVpvbmUpOworICAgICAgICByZXR1cm4gdGltZWluZm8udG1fc2VjOworICAgIH0gZWxzZSB7CisgICAgICAgIHN0cnVjdCB0bSAqdGltZWluZm87CisgICAgICAgIHRpbWVpbmZvID0gbG9jYWx0aW1lKCZyYXd0aW1lKTsKKyAgICAgICAgcmV0dXJuIHRpbWVpbmZvLT50bV9zZWM7CisgICAgfQorfQorCitzdGF0aWMgaW50MzJfdCBTQ19taW51dGUoKQoreworICAgIEdFVF9UTFMoKTsKKworICAgIHRpbWVfdCByYXd0aW1lOworICAgIHRpbWUoJnJhd3RpbWUpOworCisgICAgaWYgKHNjLT5tRW52aXJvbWVudC5tVGltZVpvbmUpIHsKKyAgICAgICAgc3RydWN0IHRtIHRpbWVpbmZvOworICAgICAgICBsb2NhbHRpbWVfdHooJnJhd3RpbWUsICZ0aW1laW5mbywgc2MtPm1FbnZpcm9tZW50Lm1UaW1lWm9uZSk7CisgICAgICAgIHJldHVybiB0aW1laW5mby50bV9taW47CisgICAgfSBlbHNlIHsKKyAgICAgICAgc3RydWN0IHRtICp0aW1laW5mbzsKKyAgICAgICAgdGltZWluZm8gPSBsb2NhbHRpbWUoJnJhd3RpbWUpOworICAgICAgICByZXR1cm4gdGltZWluZm8tPnRtX21pbjsKKyAgICB9Cit9CisKK3N0YXRpYyBpbnQzMl90IFNDX2hvdXIoKQoreworICAgIEdFVF9UTFMoKTsKKworICAgIHRpbWVfdCByYXd0aW1lOworICAgIHRpbWUoJnJhd3RpbWUpOworCisgICAgaWYgKHNjLT5tRW52aXJvbWVudC5tVGltZVpvbmUpIHsKKyAgICAgICAgc3RydWN0IHRtIHRpbWVpbmZvOworICAgICAgICBsb2NhbHRpbWVfdHooJnJhd3RpbWUsICZ0aW1laW5mbywgc2MtPm1FbnZpcm9tZW50Lm1UaW1lWm9uZSk7CisgICAgICAgIHJldHVybiB0aW1laW5mby50bV9ob3VyOworICAgIH0gZWxzZSB7CisgICAgICAgIHN0cnVjdCB0bSAqdGltZWluZm87CisgICAgICAgIHRpbWVpbmZvID0gbG9jYWx0aW1lKCZyYXd0aW1lKTsKKyAgICAgICAgcmV0dXJuIHRpbWVpbmZvLT50bV9ob3VyOworICAgIH0KK30KKworc3RhdGljIGludDMyX3QgU0NfZGF5KCkKK3sKKyAgICBHRVRfVExTKCk7CisKKyAgICB0aW1lX3QgcmF3dGltZTsKKyAgICB0aW1lKCZyYXd0aW1lKTsKKworICAgIGlmIChzYy0+bUVudmlyb21lbnQubVRpbWVab25lKSB7CisgICAgICAgIHN0cnVjdCB0bSB0aW1laW5mbzsKKyAgICAgICAgbG9jYWx0aW1lX3R6KCZyYXd0aW1lLCAmdGltZWluZm8sIHNjLT5tRW52aXJvbWVudC5tVGltZVpvbmUpOworICAgICAgICByZXR1cm4gdGltZWluZm8udG1fbWRheTsKKyAgICB9IGVsc2UgeworICAgICAgICBzdHJ1Y3QgdG0gKnRpbWVpbmZvOworICAgICAgICB0aW1laW5mbyA9IGxvY2FsdGltZSgmcmF3dGltZSk7CisgICAgICAgIHJldHVybiB0aW1laW5mby0+dG1fbWRheTsKKyAgICB9Cit9CisKK3N0YXRpYyBpbnQzMl90IFNDX21vbnRoKCkKK3sKKyAgICBHRVRfVExTKCk7CisKKyAgICB0aW1lX3QgcmF3dGltZTsKKyAgICB0aW1lKCZyYXd0aW1lKTsKKworICAgIGlmIChzYy0+bUVudmlyb21lbnQubVRpbWVab25lKSB7CisgICAgICAgIHN0cnVjdCB0bSB0aW1laW5mbzsKKyAgICAgICAgbG9jYWx0aW1lX3R6KCZyYXd0aW1lLCAmdGltZWluZm8sIHNjLT5tRW52aXJvbWVudC5tVGltZVpvbmUpOworICAgICAgICByZXR1cm4gdGltZWluZm8udG1fbW9uOworICAgIH0gZWxzZSB7CisgICAgICAgIHN0cnVjdCB0bSAqdGltZWluZm87CisgICAgICAgIHRpbWVpbmZvID0gbG9jYWx0aW1lKCZyYXd0aW1lKTsKKyAgICAgICAgcmV0dXJuIHRpbWVpbmZvLT50bV9tb247CisgICAgfQorfQorCitzdGF0aWMgaW50MzJfdCBTQ195ZWFyKCkKK3sKKyAgICBHRVRfVExTKCk7CisKKyAgICB0aW1lX3QgcmF3dGltZTsKKyAgICB0aW1lKCZyYXd0aW1lKTsKKworICAgIGlmIChzYy0+bUVudmlyb21lbnQubVRpbWVab25lKSB7CisgICAgICAgIHN0cnVjdCB0bSB0aW1laW5mbzsKKyAgICAgICAgbG9jYWx0aW1lX3R6KCZyYXd0aW1lLCAmdGltZWluZm8sIHNjLT5tRW52aXJvbWVudC5tVGltZVpvbmUpOworICAgICAgICByZXR1cm4gdGltZWluZm8udG1feWVhcjsKKyAgICB9IGVsc2UgeworICAgICAgICBzdHJ1Y3QgdG0gKnRpbWVpbmZvOworICAgICAgICB0aW1laW5mbyA9IGxvY2FsdGltZSgmcmF3dGltZSk7CisgICAgICAgIHJldHVybiB0aW1laW5mby0+dG1feWVhcjsKKyAgICB9Cit9CisKK3N0YXRpYyBpbnQzMl90IFNDX3VwdGltZU1pbGxpcygpCit7CisgICAgcmV0dXJuIG5hbm9zZWNvbmRzX3RvX21pbGxpc2Vjb25kcyhzeXN0ZW1UaW1lKFNZU1RFTV9USU1FX01PTk9UT05JQykpOworfQorCitzdGF0aWMgaW50MzJfdCBTQ19zdGFydFRpbWVNaWxsaXMoKQoreworICAgIEd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XSA9IGxlbiAqIHNpbmYoYW5nbGUpOworICAgIHZlY1sxXSA9IGxlbiAqIGNvc2YoYW5nbGUpOworfQorCisKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLyBDb250ZXh0CisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworc3RhdGljIHZvaWQgU0NfYmluZFRleHR1cmUoUnNQcm9ncmFtRnJhZ21lbnQgdnBmLCB1aW50MzJfdCBzbG90LCBSc0FsbG9jYXRpb24gdmEpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzaV9Qcm9ncmFtRnJhZ21lbnRCaW5kVGV4dHVyZShyc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PFByb2dyYW1GcmFnbWVudCAqPih2cGYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbG90LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxBbGxvY2F0aW9uICo+KHZhKSk7CisKK30KKworc3RhdGljIHZvaWQgU0NfYmluZFNhbXBsZXIoUnNQcm9ncmFtRnJhZ21lbnQgdnBmLCB1aW50MzJfdCBzbG90LCBSc1NhbXBsZXIgdnMpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzaV9Qcm9ncmFtRnJhZ21lbnRCaW5kU2FtcGxlcihyc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PFByb2dyYW1GcmFnbWVudCAqPih2cGYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbG90LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd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IDAsIHZ0eCk7CisKKyAgICBnbERpc2FibGVDbGllbnRTdGF0ZShHTF9OT1JNQUxfQVJSQVkpOworICAgIGdsRGlzYWJsZUNsaWVudFN0YXRlKEdMX0NPTE9SX0FSUkFZKTsKKworICAgIGdsRHJhd0FycmF5cyhHTF9MSU5FUywgMCwgMik7Cit9CisKK3N0YXRpYyB2b2lkIFNDX2RyYXdRdWFkVGV4Q29vcmRzKGZsb2F0IHgxLCBmbG9hdCB5MSwgZmxvYXQgejEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MSwgZmxvYXQgdjEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MiwgZmxvYXQgeTIsIGZsb2F0IHoyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTIsIGZsb2F0IHYyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDMsIGZsb2F0IHkzLCBmbG9hdCB6MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUzLCBmbG9hdCB2MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHg0LCBmbG9hdCB5NCwgZmxvYXQgejQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1NCwgZmxvYXQgdjQpCit7CisgICAgR0VUX1RMUygpOworCisgICAgLy9MT0dFKCJRdWFkIik7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDEsIHkxLCB6MSk7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDIsIHkyLCB6Mik7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDMsIHkzLCB6Myk7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDQsIHk0LCB6NCk7CisKKyAgICBmbG9hdC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VfRkFOLCAwLCA0KTsKK30KKworc3RhdGljIHZvaWQgU0NfZHJhd1F1YWQoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MywgZmxvYXQgeTMsIGZsb2F0IHozLAorICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDQsIGZsb2F0IHk0LCBmbG9hdCB6NCkKK3sKKyAgICBTQ19kcmF3UXVhZFRleENvb3Jkcyh4MSwgeTEsIHoxLCAwLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIHgyLCB5MiwgejIsIDEsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeDMsIHkzLCB6MywgMSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4NCwgeTQsIHo0LCAwLCAwKTsKK30KKworc3RhdGljIHZvaWQgU0NfZHJhd1JlY3QoZmxvYXQgeDEsIGZsb2F0IHkxLAorICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDIsIGZsb2F0IHkyLCBmbG9hdCB6KQoreworICAgIFNDX2RyYXdRdWFkKHgxLCB5MiwgeiwKKyAgICAgICAgICAgICAgICB4MiwgeTIsIHosCisgICAgICAgICAgICAgICAgeDIsIHkxLCB6LAorICAgICAgICAgICAgICAgIHgxLCB5MSwgeik7Cit9CisKK3N0YXRpYyB2b2lkIFNDX2RyYXdTaW1wbGVNZXNoKFJzU2ltcGxlTWVzaCB2c20pCit7CisgICAgR0VUX1RMUygpOworICAgIFNpbXBsZU1lc2ggKnNtID0gc3RhdGljX2Nhc3Q8U2ltcGxlTWVzaCAqPih2c20pOworICAgIHJzYy0+c2V0dXBDaGVjaygpOworICAgIHNtLT5yZW5kZXIoKTsKK30KKworc3RhdGljIHZvaWQgU0NfZHJhd1NpbXBsZU1lc2hSYW5nZShSc1NpbXBsZU1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CisgICAgZmxvYXQgZiA9IGhmIC0gaWhmOworICAgIGZsb2F0IHB2ID0geiAqICgxLjBmIC0geSk7CisgICAgZmxvYXQgcXYgPSB6ICogKDEuMGYgLSB5ICogZik7CisgICAgZmxvYXQgdHYgPSB6ICogKDEuMGYgLSB5ICogKDEuMGYgLSBmKSk7CisKKyAgICBzd2l0Y2ggKGloZikgeworICAgICAgICBjYXNlIDA6ICAgICAgICAgLy8gUmVkIGlzIHRoZSBkb21pbmFudCBjb2xvcgorICAgICAgICAgICAgcmVkID0gejsKKyAgICAgICAgICAgIGdyZWVuID0gdHY7CisgICAgICAgICAgICBibHVlID0gcHY7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAxOiAgICAgICAgIC8vIEdyZWVuIGlzIHRoZSBkb21pbmFudCBjb2xvcgorICAgICAgICAgICAgcmVkID0gcXY7CisgICAgICAgICAgICBncmVlbiA9IHo7CisgICAgICAgICAgICBibHVlID0gcHY7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgcmVkID0gcHY7CisgICAgICAgICAgICBncmVlbiA9IHo7CisgICAgICAgICAgICBibHVlID0gdHY7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAzOiAgICAgICAgIC8vIEJsdWUgaXMgdGhlIGRvbWluYW50IGNvbG9yCisgICAgICAgICAgICByZWQgPSBwdjsKKyAgICAgICAgICAgIGdyZWVuID0gcXY7CisgICAgICAgICAgICBibHVlID0gejsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICByZWQgPSB0djsKKyAgICAgICAgICAgIGdyZWVuID0gcHY7CisgICAgICAgICAgICBibHVlID0gejsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDU6ICAgICAgICAgLy8gUmVkIGlzIHRoZSBkb21pbmFudCBjb2xvcgorICAgICAgICAgICAgcmVkID0gejsKKyAgICAgICAgICAgIGdyZWVuID0gcHY7CisgICAgICAgICAgICBibHVlID0gcXY7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZ2JbMF0gPSByZWQ7CisgICAgcmdiWzFdID0gZ3JlZW47CisgICAgcmdiWzJdID0gYmx1ZTsKK30KKworc3RhdGljIGludCBTQ19oc2JUb0FiZ3IoZmxvYXQgaCwgZmxvYXQgcywgZmxvYXQgYiwgZmxvYXQgYSkKK3sKKyAgICBmbG9hdCByZ2JbM107CisgICAgU0NfaHNiVG9SZ2IoaCwgcywgYiwgcmdiKTsKKyAgICByZXR1cm4gaW50KGEgICAgICAqIDI1NS4wZikgPDwgMjQgfAorICAgICAgICAgICBpbnQocmdiWzJdICogMjU1LjBmKSA8PCAxNiB8CisgICAgICAgICAgIGludChyZ2JbMV0gKiAyNTUuMGYpIDw8ICA4IHwKKyAgICAgICAgICAgaW50KHJnYlswXSAqIDI1NS4wZik7Cit9CisKK3N0YXRpYyB2b2lkIFNDX2hzYihmbG9hdCBoLCBmbG9hdCBzLCBmbG9hdCBiLCBmbG9hdCBhKQoreworICAgIGZsb2F0IHJnYlszXTsKKyAgICBTQ19oc2JUb1JnYihoLCBzLCBiLCByZ2IpOworICAgIGdsQ29sb3I0ZihyZ2JbMF0sIHJnYlsxXSwgcmdiWzJdLCBhKTsKK30KKworc3RhdGljIHZvaWQgU0NfdXBsb2FkVG9UZXh0dXJlKFJzQWxsb2NhdGlvbiB2YSwgdWludDMyX3QgYmFzZU1pcExldmVsKQoreworICAgIEdFVF9UTFMoKTsKKyAgICByc2lfQWxsb2NhdGlvblVwbG9hZFRvVGV4dHVyZShyc2MsIHZhLCBiYXNlTWlwTGV2ZWwpOworfQorCitzdGF0aWMgdm9pZCBTQ191cGxvYWRUb0J1ZmZlck9iamVjdChSc0FsbG9jYXRpb24gdmEpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzaV9BbGxvY2F0aW9uVXBsb2FkVG9CdWZmZXJPYmplY3QocnNjLCB2YSk7Cit9CisKK3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b2lkICopJlNDX2xvYWRJMzIsCisgICAgICAgICJpbnQiLCAiKGludCwgaW50KSIgfSwKKyAgICAvL3sgImxvYWRVMzIiLCAodm9pZCAqKSZTQ19sb2FkVTMyLCAidW5zaWduZWQgaW50IiwgIihpbnQsIGludCkiIH0sCisgICAgeyAibG9hZEYiLCAodm9pZCAqKSZTQ19sb2FkRiwKKyAgICAgICAgImZsb2F0IiwgIihpbnQsIGludCkiIH0sCisgICAgeyAibG9hZEFycmF5RiIsICh2b2lkICopJlNDX2xvYWRBcnJheUYsCisgICAgICAgICJmbG9hdCoiLCAiKGludCwgaW50KSIgfSwKKyAgICB7ICJsb2FkQXJyYXlJMzIiLCAodm9pZCAqKSZTQ19sb2FkQXJyYXlJMzIsCisgICAgICAgICJpbnQqIiwgIihpbnQsIGludCkiIH0sCisgICAgeyAibG9hZFZlYzQiLCAodm9pZCAqKSZTQ19sb2FkVmVjNCwKKyAgICAgICAgInZvaWQiLCAiKGludCwgaW50LCBmbG9hdCAqKSIgfSwKKyAgICB7ICJsb2FkTWF0cml4IiwgKHZvaWQgKikmU0NfbG9hZE1hdHJpeCwKKyAgICAgICAgInZvaWQiLCAiKGludCwgaW50LCBmbG9hdCAqKSIgfSwKKyAgICB7ICJzdG9yZUkzMiIsICh2b2lkICopJlNDX3N0b3JlSTMyLAorICAgICAgICAidm9pZCIsICIoaW50LCBpbnQsIGludCkiIH0sCisgICAgLy97ICJzdG9yZVUzMiIsICh2b2lkICopJlNDX3N0b3JlVTMyLCAidm9pZCIsICIoaW50LCBpbnQsIHVuc2lnbmVkIGludCkiIH0sCisgICAgeyAic3RvcmVGIiwgKHZvaWQgKikmU0Nfc3RvcmVGLAorICAgICAgICAidm9pZCIsICIoaW50LCBpbnQsIGZsb2F0KSIgfSwKKyAgICB7ICJzdG9yZVZlYzQiLCAodm9pZCAqKSZTQ19zdG9yZVZlYzQsCisgICAgICAgICJ2b2lkIiwgIihpbnQsIGludCwgZmxvYXQgKikiIH0sCisgICAgeyAic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wKKyAgICAgICAgImZsb2F0IiwgIihzdHJ1Y3QgdmVjM19zICpsaHMsIHN0cnVjdCB2ZWMzX3MgKnJocykiIH0sCisgICAgeyAidmVjM1NjYWxlIiwgKHZvaWQgKikmU0NfdmVjM1NjYWxlLAorICAgICAgICAidm9pZCIsICIoc3RydWN0IHZlYzNfcyAqbGhzLCBmbG9hdCBzY2FsZSkiIH0sCisKKyAgICAvLyBjb250ZXh0CisgICAgeyAiYmluZFByb2dyYW1GcmFnbWVudCIsICh2b2lkICopJlNDX2JpbmRQcm9ncmFtRnJhZ21lbnQsCisgICAgICAgICJ2b2lkIiwgIihpbnQpIiB9LAorICAgIHsgImJpbmRQcm9ncmFtRnJhZ21lbnRTdG9yZSIsICh2b2lkICopJlNDX2JpbmRQcm9ncmFtRnJhZ21lbnRTdG9yZSwKKyAgICAgICAgInZvaWQiLCAiKGludCkiIH0sCisgICAgeyAiYmluZFByb2dyYW1WZXJ0ZXgiLCAodm9pZCAqKSZTQ19iaW5kUHJvZ3JhbVZlcnRleCwKKyAgICAgICAgInZvaWQiLCAiKGludCkiIH0sCisgICAgeyAiYmluZFNhbXBsZXIiLCAodm9pZCAqKSZTQ19iaW5kU2FtcGxlciwKKyAgICAgICAgInZvaWQiLCAiKGludCwgaW50LCBpbnQpIiB9LAorICAgIHsgImJpbmRUZXh0dXJlIiwgKHZvaWQgKikmU0NfYmluZFRleHR1cmUsCisgICAgICAgICJ2b2lkIiwgIihpbnQsIGludCwgaW50KSIgfSwKKworICAgIC8vIHZwCisgICAgeyAidnBMb2FkTW9kZWxNYXRyaXgiLCAodm9pZCAqKSZTQ192cExvYWRNb2RlbE1hdHJpeCwKKyAgICAgICAgInZvaWQiLCAiKHZvaWQgKikiIH0sCisgICAgeyAidnBMb2FkVGV4dHVyZU1hdHJpeCIsICh2b2lkICopJlNDX3ZwTG9hZFRleHR1cmVNYXRyaXgsCisgICAgICAgICJ2b2lkIiwgIih2b2lkICopIiB9LAorCisKKworICAgIC8vIGRyYX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NDX2NvbG9yRmxvYXRSR0JBdG81NjUsCisgICAgICAgICJpbnQiLCAiKGZsb2F0LCBmbG9hdCwgZmxvYXQpIiB9LAorCisKKyAgICB7ICJnZXRXaWR0aCIsICh2b2lkICopJlNDX2dldFdpZHRoLAorICAgICAgICAiaW50IiwgIigpIiB9LAorICAgIHsgImdldEhlaWdodCIsICh2b2lkICopJlNDX2dldEhlaWdodCwKKyAgICAgICAgImludCIsICIoKSIgfSwKKworCisKKyAgICB7ICJkZWJ1Z0YiLCAodm9pZCAqKSZTQ19kZWJ1Z0YsCisgICAgICAgICJ2b2lkIiwgIih2b2lkICosIGZsb2F0KSIgfSwKKyAgICB7ICJkZWJ1Z0kzMiIsICh2b2lkICopJlNDX2RlYnVnSTMyLAorICAgICAgICAidm9pZCIsICIodm9pZCAqLCBpbnQpIiB9LAorICAgIHsgImRlYnVnSGV4RiIsICh2b2lkICopJlNDX2RlYnVnSGV4RiwKKyAgICAgICAgInZvaWQiLCAiKHZvaWQgKiwgZmxvYXQpIiB9LAorICAgIHsgImRlYnVnSGV4STMyIiwgKHZvaWQgKikmU0NfZGVidWdIZXhJMzIsCisgICAgICAgICJ2b2lkIiwgIih2b2lkICosIGludCkiIH0sCisKKworICAgIHsgTlVMTCwgTlVMTCwgTlVMTCwgTlVMTCB9Cit9OworCitjb25zdCBTY3JpcHRDU3RhdGU6OlN5bWJvbFRhYmxlX3QgKiBTY3JpcHRDU3RhdGU6Omxvb2t1cFN5bWJvbChjb25zdCBjaGFyICpzeW0pCit7CisgICAgU2NyaXB0Q1N0YXRlOjpTeW1ib2xUYWJsZV90ICpzeW1zID0gZ1N5bXM7CisKKyAgICB3aGlsZSAoc3ltcy0+bVB0cikgeworICAgICAgICBpZiAoIXN0cmNtcChzeW1zLT5tTmFtZSwgc3ltKSkgeworICAgICAgICAgICAgcmV0dXJuIHN5bXM7CisgICAgICAgIH0KKyAgICAgICAgc3ltcysrOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKwordm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0gPSAwOworICAgIG1CdWZmZXJPYmplY3RzWzFdID0gMDsKKworICAgIG1PZmZzZXRDb29yZCA9IDA7CisgICAgbU9mZnNldFRleCA9IDA7CisgICAgbU9mZnNldE5vcm0gPSAwOworCisgICAgbVNpemVDb29yZCA9IDA7CisgICAgbVNpemVUZXggPSAwOworICAgIG1TaXplTm9ybSA9IDA7CisKK30KKworVHJpYW5nbGVNZXNoOjp+VHJpYW5nbGVNZXNoKCkKK3sKKyAgICBmcmVlKG1WZXJ0ZXhEYXRhKTsKKyAgICBmcmVlKG1JbmRleERhdGEpOworfQorCisKKworVHJpYW5nbGVNZXNoQ29udGV4dDo6VHJpYW5nbGVNZXNoQ29udGV4dCgpCit7CisgICAgY2xlYXIoKTsKK30KKworVHJpYW5nbGVNZXNoQ29udGV4dDo6flRyaWFuZ2xlTWVzaENvbnRleHQoKQoreworfQorCit2b2lkIFRyaWFuZ2xlTWVzaENvbnRleHQ6OmNsZWFyKCkKK3sKKyAgICBtVmVydGV4RWxlbWVudCA9IE5VTEw7CisgICAgbVZlcnRleFNpemVCaXRzID0gMDsKKyAgICBtSW5kZXhFbGVtZW50ID0gTlVMTDsKKyAgICBtSW5kZXhTaXplQml0cyA9IDA7CisgICAgbVRyaWFuZ2xlQ291bnQgPSAwOworICAgIG1WZXJ0ZXhEYXRhLmNsZWFyKCk7CisgICAgbUluZGV4RGF0YS5jbGVhcigpOworfQorCit2b2lkIFRyaWFuZ2xlTWVzaDo6YW5hbHl6ZUVsZW1lbnQoKQoreworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBtVmVydGV4RWxlbWVudC0+Z2V0Q29tcG9uZW50Q291bnQoKTsgY3QrKykgeworICAgICAgICBjb25zdCBDb21wb25lbnQgKmMgPSBtVmVydGV4RWxlbWVudC0+Z2V0Q29tcG9uZW50KGN0KTsKKworICAgICAgICBpZiAoYy0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6WCkgeworICAgICAgICAgICAgcnNBc3NlcnQobVNpemVDb29yZCA9PSAwKTsKKyAgICAgICAgICAgIG1TaXplQ29vcmQgPSAxOworICAgICAgICAgICAgbU9mZnNldENvb3JkID0gY3Q7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGMtPmdldEtpbmQoKSA9PSBDb21wb25lbnQ6OlkpIHsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1TaXplQ29vcmQgPT0gMSk7CisgICAgICAgICAgICBtU2l6ZUNvb3JkID0gMjsKKyAgICAgICAgfQorICAgICAgICBpZiAoYy0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6WikgeworICAgICAgICAgICAgcnNBc3NlcnQobVNpemVDb29yZCA9PSAyKTsKKyAgICAgICAgICAgIG1TaXplQ29vcmQgPSAzOworICAgICAgICB9CisgICAgICAgIGlmIChjLT5nZXRLaW5kKCkgPT0gQ29tcG9uZW50OjpXKSB7CisgICAgICAgICAgICByc0Fzc2VydChtU2l6ZUNvb3JkID09IDQpOworICAgICAgICAgICAgbVNpemVDb29yZCA9IDQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAoYy0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6TlgpIHsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1TaXplTm9ybSA9PSAwKTsKKyAgICAgICAgICAgIG1TaXplTm9ybSA9IDE7CisgICAgICAgICAgICBtT2Zmc2V0Tm9ybSA9IGN0OworICAgICAgICB9CisgICAgICAgIGlmIChjLT5nZXRLaW5kKCkgPT0gQ29tcG9uZW50OjpOWSkgeworICAgICAgICAgICAgcnNBc3NlcnQobVNpemVOb3JtID09IDEpOworICAgICAgICAgICAgbVNpemVOb3JtID0gMjsKKyAgICAgICAgfQorICAgICAgICBpZiAoYy0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6TlopIHsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1TaXplTm9ybSA9PSAyKTsKKyAgICAgICAgICAgIG1TaXplTm9ybSA9IDM7CisgICAgICAgIH0KKworICAgICAgICBpZiAoYy0+Z2V0S2luZCgpID09IENvbXBvbmVudDo6UykgeworICAgICAgICAgICAgcnNBc3NlcnQobVNpemVUZXggPT0gMCk7CisgICAgICAgICAgICBtU2l6ZVRleCA9IDE7CisgICAgICAgICAgICBtT2Zmc2V0VGV4ID0gY3Q7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGMtPmdldEtpbmQoKSA9PSBDb21wb25lbnQ6OlQpIHsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1TaXplVGV4ID09IDEpOworICAgICAgICAgICAgbVNpemVUZXggPSAyOworICAgICAgICB9CisgICAgfQorICAgIExPR1YoIlRyaWFuZ2xlTWVzaCAlaSwlaSAgJWksJWkgICVpLCVpIiwgbVNpemVDb29yZCwgbU9mZnNldENvb3JkLCBtU2l6ZU5vcm0sIG1PZmZzZXROb3JtLCBtU2l6ZVRleCwgbU9mZnNldFRleCk7CisKK30KKworCituYW1lc3BhY2UgYW5kcm9pZCB7CituYW1lc3BhY2UgcmVuZGVyc2NyaXB0IHsKKwordm9pZCByc2lfVHJpYW5nbGVNZXNoQmVnaW4oQ29udGV4dCAqcnNjLCBSc0VsZW1lbnQgdmVydGV4LCBSc0VsZW1lbnQgaW5kZXgpCit7CisgICAgVHJpYW5nbGVNZXNoQ29udGV4dCAqdG1jID0gJnJzYy0+bVN0YXRlVHJpYW5nbGVNZXNoOworCisgICAgdG1jLT5jbGVhcigpOworICAgIHRtYy0+bVZlcnRleEVsZW1lbnQgPSBzdGF0aWNfY2FzdDxFbGVtZW50ICo+KHZlcnRleCk7CisgICAgdG1jLT5tVmVydGV4U2l6ZUJpdHMgPSB0bWMtPm1WZXJ0ZXhFbGVtZW50LT5nZXRTaXplQml0cygpOworICAgIHRtYy0+bUluZGV4RWxlbWVudCA9IHN0YXRpY19jYXN0PEVsZW1lbnQgKj4oaW5kZXgpOworICAgIHRtYy0+bUluZGV4U2l6ZUJpdHMgPSB0bWMtPm1JbmRleEVsZW1lbnQtPmdldFNpemVCaXRzKCk7CisKK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BWSk7CisgICAgZ2xWZXJ0ZXhQb2ludGVyKHRtLT5tU2l6ZUNvb3JkLAorICAgICAgICAgICAgICAgICAgICBHTF9GTE9BVCwKKyAgICAgICAgICAgICAgICAgICAgdG0tPm1WZXJ0ZXhFbGVtZW50LT5nZXRTaXplQnl0ZXMoKSwKKyAgICAgICAgICAgICAgICAgICAgKHZvaWQgKil0bS0+bVZlcnRleEVsZW1lbnQtPmdldENvbXBvbmVudE9mZnNldEJ5dGVzKHRtLT5tT2Zmc2V0Q29vcmQpKTsKKworICAgIGlmICh0bS0+bVNpemVUZXgpIHsKKyAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9URVhUVVJFX0NPT1JEX0FSUkFZKTsKKyAgICAgICAgZ2xUZXhDb29yZFBvaW50ZXIodG0tPm1TaXplVGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICBHTF9GTE9BVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdG0tPm1WZXJ0ZXhFbGVtZW50LT5nZXRTaXplQnl0ZXMoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKil0bS0+bVZlcnRleEVsZW1lbnQtPmdldENvbXBvbmVudE9mZnNldEJ5dGVzKHRtLT5tT2Zmc2V0VGV4KSk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgZ2xEaXNhYmxlQ2xpZW50U3RhdGUoR0xfVEVYVFVSRV9DT09SRF9BUlJBWSk7CisgICAgfQorCisgICAgaWYgKHRtLT5tU2l6ZU5vcm0pIHsKKyAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9OT1JNQUxfQVJSQVkpOworICAgICAgICBnbE5vcm1hbFBvaW50ZXIoR0xfRkxPQVQsCisgICAgICAgICAgICAgICAgICAgICAgICB0bS0+bVZlcnRleEVsZW1lbnQtPmdldFNpemVCeXRlcygpLAorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKil0bS0+bVZlcnRleEVsZW1lbnQtPmdldENvb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H5UcmlhbmdsZU1lc2goKTsKKworICAgIGNvbnN0IEVsZW1lbnQgKiBtVmVydGV4RWxlbWVudDsKKyAgICBjb25zdCBFbGVtZW50ICogbUluZGV4RWxlbWVudDsKKworICAgIHZvaWQgKiBtVmVydGV4RGF0YTsKKyAgICB2b2lkICogbUluZGV4RGF0YTsKKworICAgIHNpemVfdCBtVmVydGV4RGF0YVNpemU7CisgICAgc2l6ZV90IG1JbmRleERhdGFTaXplOworICAgIHVpbnQzMl90IG1UcmlhbmdsZUNvdW50OworCisgICAgc2l6ZV90IG1PZmZzZXRDb29yZDsKKyAgICBzaXplX3QgbU9mZnNldFRleDsKKyAgICBzaXplX3QgbU9mZnNldE5vcm07CisKKyAgICBzaXplX3QgbVNpemVDb29yZDsKKyAgICBzaXplX3QgbVNpemVUZXg7CisgICAgc2l6ZV90IG1TaXplTm9ybTsKKworICAgIC8vIEdMIGJ1ZmZlciBpbmZvCisgICAgdWludDMyX3QgbUJ1ZmZlck9iamVjdHNbMl07CisKKyAgICB2b2lkIGFuYWx5emVFbGVtZW50KCk7Citwcm90ZWN0ZWQ6Cit9OworCitjbGFzcyBUcmlhbmdsZU1lc2hDb250ZXh0Cit7CitwdWJsaWM6CisgICAgVHJpYW5nbGVNZXNoQ29udGV4dCgpOworICAgIH5UcmlhbmdsZU1lc2hDb250ZXh0KCk7CisKKyAgICBjb25zdCBFbGVtZW50ICogbVZlcnRleEVsZW1lbnQ7CisgICAgY29uc3QgRWxlbWVudCAqIG1JbmRleEVsZW1lbnQ7CisgICAgc2l6ZV90IG1WZXJ0ZXhTaXplQml0czsKKyAgICBzaXplX3QgbUluZGV4U2l6ZUJpdHM7CisKKyAgICBWZWN0b3I8dWludDhfdD4gbVZlcnRleERhdGE7IAorICAgIFZlY3Rvcjx1aW50MTZfdD4gbUluZGV4RGF0YTsgCisKKyAgICB1aW50MzJfdCBtVHJpYW5nbGVDb3VudDsKKworICAgIHZvaWQgY2xlYXIoKTsKK307CisKKworfQorfQorI2Vu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GljZW5zZS4KKyAqLworCisjaW5jbHVkZSAicnNDb250ZXh0LmgiCisjaW5jbHVkZSA8R0xFUy9nbC5oPgorCit1c2luZyBuYW1lc3BhY2UgYW5kcm9pZDsKK3VzaW5nIG5hbWVzcGFjZSBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ7CisKK1R5cGU6OlR5cGUoKQoreworICAgIG1MT0RzID0gMDsKKyAgICBtTE9EQ291bnQgPSAwOworICAgIG1lbXNldCgmbUdMLCAwLCBzaXplb2YobUdMKSk7CisgICAgY2xlYXIoKTsKK30KKworVHlwZTo6flR5cGUoKQoreworICAgIGlmIChtTE9EcykgeworICAgICAgICBkZWxldGUgW10gbUxPRHM7CisgICAgfQorfQorCit2b2lkIFR5cGU6OmNsZWFyKCkKK3sKKyAgICBpZiAobUxPRHMpIHsKKyAgICAgICAgZGVsZXRlIFtdIG1MT0RzOworICAgICAgICBtTE9EcyA9IE5VTEw7CisgICAgfQorICAgIG1EaW1YID0gMDsKKyAgICBtRGltWSA9IDA7CisgICAgbURpbVogPSAwOworICAgIG1EaW1MT0QgPSAwOworICAgIG1GYWNlcyA9IGZhbHNlOworICAgIG1FbGVtZW50LmNsZWFyKCk7Cit9CisKK1R5cGVTdGF0ZTo6VHlwZVN0YXRlKCkKK3sKK30KKworVHlwZVN0YXRlOjp+VHlwZVN0YXRlKCkKK3sKK30KKworc2l6ZV90IFR5cGU6OmdldE9mZnNldEZvckZhY2UodWludDMyX3QgZmFjZSkgY29uc3QKK3sKKyAgICByc0Fzc2VydChtRmFjZXMpOworICAgIHJldHVybiAwOworfQorCit2b2lkIFR5cGU6OmNvbXB1dGUoKQoreworICAgIHVpbnQzMl90IG9sZExPRENvdW50ID0gbUxPRENvdW50OworICAgIGlmIChtRGltTE9EKSB7CisgICAgICAgIHVpbnQzMl90IGwyeCA9IHJzRmluZEhpZ2hCaXQobURpbVgpICsgMTsKKyAgICAgICAgdWludDMyX3QgbDJ5ID0gcnNGaW5kSGlnaEJpdChtRGltWSkgKyAxOworICAgICAgICB1aW50MzJfdCBsMnogPSByc0ZpbmRIaWdoQml0KG1EaW1aKSArIDE7CisKKyAgICAgICAgbUxPRENvdW50ID0gcnNNYXgobDJ4LCBsMnkpOworICAgICAgICBtTE9EQ291bnQgPSByc01heChtTE9EQ291bnQsIGwyeik7CisgICAgfSBlbHNlIHsKKyAgICAgICAgbUxPRENvdW50ID0gMTsKKyAgICB9CisgICAgaWYgKG1MT0RDb3VudCAhPSBvbGRMT0RDb3VudCkgeworICAgICAgICBkZWxldGUgW10gbUxPRHM7CisgICAgICAgIG1MT0RzID0gbmV3IExPRFttTE9EQ291bnRdOworICAgIH0KKworICAgIHVpbnQzMl90IHR4ID0gbURpbVg7CisgICAgdWludDMyX3QgdHkgPSBtRGltWTsKKyAgICB1aW50MzJfdCB0eiA9IG1EaW1aOworICAgIHNpemVfdCBvZmZzZXQgPSAwOworICAgIGZvciAodWludDMyX3QgbG9kPTA7IGxvZCA8IG1MT0RDb3VudDsgbG9kKyspIHsKKyAgICAgICAgbUxPRHNbbG9kXS5tWCA9IHR4OworICAgICAgICBtTE9Ec1tsb2RdLm1ZID0gdHk7CisgICAgICAgIG1MT0RzW2xvZF0ubVogPSB0ejsKKyAgICAgICAgbUxPRHNbbG9kXS5tT2Zmc2V0ID0gb2Zmc2V0OworICAgICAgICBvZmZzZXQgKz0gdHggKiByc01heCh0eSwgMXUpICogcnNNYXgodHosIDF1KSAqIG1FbGVtZW50LT5nZXRTaXplQnl0ZXMoKTsKKyAgICAgICAgdHggPSAodHggKyAxKSA+PiAxOworICAgICAgICB0eSA9ICh0eSArIDEpID4+IDE7CisgICAgICAgIHR6ID0gKHR6ICsgMSkgPj4gMTsKKyAgICB9CisKKyAgICAvLyBBdCB0aGlzIHBvaW50IHRoZSBvZmZzZXQgaXMgdGhlIHNpemUgb2YgYSBtaXBtYXAgY2hhaW47CisgICAgbU1pcENoYWluU2l6ZUJ5dGVzID0gb2Zmc2V0OworCisgICAgaWYgKG1GYWNl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yAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgZ2V0RWxlbWVudCgpLT5nZXRDb21wb25lbnRDb3VudCgpOyBjdCsrKSB7CisgICAgICAgIGNvbnN0IENvbXBvbmVudCAqYyA9IGdldEVsZW1lbnQoKS0+Z2V0Q29tcG9uZW50KGN0KTsKKworICAgICAgICBzd2l0Y2goYy0+Z2V0S2luZCgpKSB7CisgICAgICAgIGNhc2UgQ29tcG9uZW50OjpYOgorICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1WdHguc2l6ZSA9PSAwKTsKKyAgICAgICAgICAgIG1HTC5tVnR4LnNpemUgPSAxOworICAgICAgICAgICAgbUdMLm1WdHgub2Zmc2V0ID0gbUVsZW1lbnQtPmdldENvbXBvbmVudE9mZnNldEJ5dGVzKGN0KTsKKyAgICAgICAgICAgIG1HTC5tVnR4LnR5cGUgPSBjLT5nZXRHTFR5cGUoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENvbXBvbmVudDo6WToKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tVnR4LnNpemUgPT0gMSk7CisgICAgICAgICAgICByc0Fzc2VydChtR0wubVZ0eC50eXBlID09IGMtPmdldEdMVHlwZSgpKTsKKyAgICAgICAgICAgIG1HTC5tVnR4LnNpemUgPSAyOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ29tcG9uZW50OjpaOgorICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1WdHguc2l6ZSA9PSAyKTsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tVnR4LnR5cGUgPT0gYy0+Z2V0R0xUeXBlKCkpOworICAgICAgICAgICAgbUdMLm1WdHguc2l6ZSA9IDM7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBDb21wb25lbnQ6Olc6CisgICAgICAgICAgICByc0Fzc2VydChtR0wubVZ0eC5zaXplID09IDQpOworICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1WdHgudHlwZSA9PSBjLT5nZXRHTFR5cGUoKSk7CisgICAgICAgICAgICBtR0wubVZ0eC5zaXplID0gNDsKKyAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBDb21wb25lbnQ6OlJFRDoKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tQ29sb3Iuc2l6ZSA9PSAwKTsKKyAgICAgICAgICAgIG1HTC5tQ29sb3Iuc2l6ZSA9IDE7CisgICAgICAgICAgICBtR0wubUNvbG9yLm9mZnNldCA9IG1FbGVtZW50LT5nZXRDb21wb25lbnRPZmZzZXRCeXRlcyhjdCk7CisgICAgICAgICAgICBtR0wubUNvbG9yLnR5cGUgPSBjLT5nZXRHTFR5cGUoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENvbXBvbmVudDo6R1JFRU46CisgICAgICAgICAgICByc0Fzc2VydChtR0wubUNvbG9yLnNpemUgPT0gMSk7CisgICAgICAgICAgICByc0Fzc2VydChtR0wubUNvbG9yLnR5cGUgPT0gYy0+Z2V0R0xUeXBlKCkpOworICAgICAgICAgICAgbUdMLm1Db2xvci5zaXplID0gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENvbXBvbmVudDo6QkxVRToKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tQ29sb3Iuc2l6ZSA9PSAyKTsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tQ29sb3IudHlwZSA9PSBjLT5nZXRHTFR5cGUoKSk7CisgICAgICAgICAgICBtR0wubUNvbG9yLnNpemUgPSAzOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ29tcG9uZW50OjpBTFBIQToKKyAgICAgICAgICAgIC8vIENhbiBiZSBSR0JBIG9yIEEgYXQgdGhpcyBwb2ludAorICAgICAgICAgICAgaWYgKG1HTC5tQ29sb3Iuc2l6ZSA+IDApIHsKKyAgICAgICAgICAgICAgICByc0Fzc2VydChtR0wubUNvbG9yLnNpemUgPT0gMyk7CisgICAgICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1Db2xvci50eXBlID09IGMtPmdldEdMVHlwZSgpKTsKKyAgICAgICAgICAgICAgICBtR0wubUNvbG9yLnNpemUgPSA0OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtR0wubUNvbG9yLnNpemUgPSAxOworICAgICAgICAgICAgICAgIG1HTC5tQ29sb3Iub2Zmc2V0ID0gbUVsZW1lbnQtPmdldENvbXBvbmVudE9mZnNldEJ5dGVzKGN0KTsKKyAgICAgICAgICAgICAgICBtR0wubUNvbG9yLnR5cGUgPSBjLT5nZXRHTFR5cGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBDb21wb25lbnQ6Ok5YOgorICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1Ob3JtLnNpemUgPT0gMCk7CisgICAgICAgICAgICBtR0wubU5vcm0uc2l6ZSA9IDE7CisgICAgICAgICAgICBtR0wubU5vcm0ub2Zmc2V0ID0gbUVsZW1lbnQtPmdldENvbXBvbmVudE9mZnNldEJ5dGVzKGN0KTsKKyAgICAgICAgICAgIG1HTC5tTm9ybS50eXBlID0gYy0+Z2V0R0xUeXBlKCk7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENvbXBvbmVudDo6Tlk6CisgICAgICAgICAgICByc0Fzc2VydChtR0wubU5vcm0uc2l6ZSA9PSAxKTsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tTm9ybS50eXBlID09IGMtPmdldEdMVHlwZSgpKTsKKyAgICAgICAgICAgIG1HTC5tTm9ybS5zaXplID0gMjsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ29tcG9uZW50OjpOWjoKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tTm9ybS5zaXplID09IDIpOworICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1Ob3JtLnR5cGUgPT0gYy0+Z2V0R0xUeXBlKCkpOworICAgICAgICAgICAgbUdMLm1Ob3JtLnNpemUgPSAzOworICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIENvbXBvbmVudDo6UzoKKyAgICAgICAgICAgIGlmIChtR0wubVRleFt0ZXhOdW1dLnNpemUpIHsKKyAgICAgICAgICAgICAgICB0ZXhOdW0rKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1HTC5tVGV4W3RleE51bV0uc2l6ZSA9IDE7CisgICAgICAgICAgICBtR0wubVRleFt0ZXhOdW1dLm9mZnNldCA9IG1FbGVtZW50LT5nZXRDb21wb25lbnRPZmZzZXRCeXRlcyhjdCk7CisgICAgICAgICAgICBtR0wubVRleFt0ZXhOdW1dLnR5cGUgPSBjLT5nZXRHTFR5cGUoKTsKKyAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQ29tcG9uZW50OjpUOgorICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1UZXhbdGV4TnVtXS5zaXplID09IDEpOworICAgICAgICAgICAgcnNBc3NlcnQobUdMLm1UZXhbdGV4TnVtXS50eXBlID09IGMtPmdldEdMVHlwZSgpKTsKKyAgICAgICAgICAgIG1HTC5tVGV4W3RleE51bV0uc2l6ZSA9IDI7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIENvbXBvbmVudDo6UjoKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tVGV4W3RleE51bV0uc2l6ZSA9PSAyKTsKKyAgICAgICAgICAgIHJzQXNzZXJ0KG1HTC5tVGV4W3RleE51bV0udHlwZSA9PSBjLT5nZXRHTFR5cGUoKSk7CisgICAgICAgICAgICBtR0wubVRleFt0ZXhOdW1dLnNpemUgPSAzOworICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBDb21wb25lbnQ6OlE6CisgICAgICAgICAgICByc0Fzc2VydChtR0wubVRleFt0ZXhOdW1dLnNpemUgPT0gMyk7CisgICAgICAgICA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XgsICVpLCAlcCIsIG1HTC5tVnR4LnNpemUsIG1HTC5tVnR4LnR5cGUsIHN0cmlkZSwgKHZvaWQgKiltR0wubVZ0eC5vZmZzZXQpOworICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX1ZFUlRFWF9BUlJBWSk7CisgICAgICAgIGdsVmVydGV4UG9pbnRlcihtR0wubVZ0eC5zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgbUdMLm1WdHgudHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUdMLm1WdHgub2Zmc2V0KTsKKyAgICB9CisKKyAgICBpZiAobUdMLm1Ob3JtLnNpemUpIHsKKyAgICAgICAgLy9MT0dFKCJ2YSBub3JtICVpICV4LCAlaSwgJXAiLCBtR0wubU5vcm0uc2l6ZSwgbUdMLm1Ob3JtLnR5cGUsIHN0cmlkZSwgKHZvaWQgKiltR0wubU5vcm0ub2Zmc2V0KTsKKyAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9OT1JNQUxfQVJSQVkpOworICAgICAgICByc0Fzc2VydChtR0wubU5vcm0uc2l6ZSA9PSAzKTsKKyAgICAgICAgZ2xOb3JtYWxQb2ludGVyKG1HTC5tTm9ybS50eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RyaWRlLAorICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKiltR0wubU5vcm0ub2Zmc2V0KTsKKyAgICB9CisKKyAgICBpZiAobUdMLm1Db2xvci5zaXplKSB7CisgICAgICAgIGdsRW5hYmxlQ2xpZW50U3RhdGUoR0xfQ09MT1JfQVJSQVkpOworICAgICAgICBnbENvbG9yUG9pbnRlcihtR0wubUNvbG9yLnNpemUsCisgICAgICAgICAgICAgICAgICAgICAgIG1HTC5tQ29sb3IudHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RyaWRlLAorICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKW1HTC5tQ29sb3Iub2Zmc2V0KTsKKyAgICB9CisKKyAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgUlNfTUFYX1RFWFRVUkU7IGN0KyspIHsKKyAgICAgICAgaWYgKG1HTC5tVGV4W2N0XS5zaXplKSB7CisgICAgICAgICAgICAvL0xPR0UoInZhIHRleCVpICVpICV4LCAlaSwgJXAiLCBjdCwgbUdMLm1UZXhbY3RdLnNpemUsIG1HTC5tVGV4W2N0XS50eXBlLCBzdHJpZGUsICh2b2lkICopbUdMLm1UZXhbY3RdLm9mZnNldCk7CisgICAgICAgICAgICBnbENsaWVudEFjdGl2ZVRleHR1cmUoR0xfVEVYVFVSRTAgKyBjdCk7CisgICAgICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX1RFWFRVUkVfQ09PUkRfQVJSQVkpOworICAgICAgICAgICAgZ2xUZXhDb29yZFBvaW50ZXIobUdMLm1UZXhbY3RdLnNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtR0wubVRleFtjdF0udHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUdMLm1UZXhbY3RdLm9mZnNldCk7CisgICAgICAgIH0KKyAgICB9CisgICAgZ2xDbGllbnRBY3RpdmVUZXh0dXJlKEdMX1RFWFRVUkUwKTsKKworICAgIGlmIChtR0wubVBvaW50U2l6ZS5zaXplKSB7CisgICAgICAgIGdsRW5hYmxlQ2xpZW50U3RhdGUoR0xfUE9JTlRfU0laRV9BUlJBWV9PRVMpOworICAgICAgICBnbFBvaW50U2l6ZVBvaW50ZXJPRVMobUdMLm1Qb2ludFNpemUudHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUdMLm1Qb2ludFNpemUub2Z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AgICAgIHN0Yy0+bUZhY2VzID0gKHZhbHVlICE9IDApOworICAgICAgICByZXR1cm47CisgICAgY2FzZSBSU19ESU1FTlNJT05fTE9EOgorICAgICAgICBzdGMtPm1MT0QgPSAodmFsdWUgIT0gMCk7CisgICAgICAgIHJldHVybjsKKyAgICBkZWZhdWx0OgorICAgICAgICBicmVhazsKKyAgICB9CisKKworICAgIGludDMyX3QgYXJyYXlOdW0gPSBkaW0gLSBSU19ESU1FTlNJT05fQVJSQVlfMDsKKyAgICBpZiAoKGRpbSA8IDApIHx8IChkaW0gPiBSU19ESU1FTlNJT05fTUFYKSkgeworICAgICAgICBMT0dFKCJyc1R5cGVBZGQ6IEJhZCBkaW1lbnNpb24iKTsKKyAgICAgICAgLy9lcnJvcgorICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy8gdG9kbzogaW1wbGVtZW50IGFycmF5IHN1cHBvcnQKKworfQorCitSc1R5cGUgcnNpX1R5cGVDcmVhdGUoQ29udGV4dCAqcnNjKQoreworICAgIFR5cGVTdGF0ZSAqIHN0YyA9ICZyc2MtPm1TdGF0ZVR5cGU7CisKKyAgICBUeXBlICogc3QgPSBuZXcgVHlwZSgpOworICAgIHN0LT5pbmNVc2VyUmVmKCk7CisgICAgc3QtPnNldERpbVgoc3RjLT5tWCk7CisgICAgc3QtPnNldERpbVkoc3RjLT5tWSk7CisgICAgc3QtPnNldERpbVooc3RjLT5tWik7CisgICAgc3QtPnNldEVsZW1lbnQoc3RjLT5tRWxlbWVudC5nZXQoKSk7CisgICAgc3QtPnNldERpbUxPRChzdGMtPm1MT0QpOworICAgIHN0LT5zZXREaW1GYWNlcyhzdGMtPm1GYWNlcyk7CisgICAgc3QtPmNvbXB1dGUoKTsKKworICAgIHJldHVybiBzdDsKK30KKworCit9Cit9CisKZGlmZiAtLWdpdCBhL2xpYnMvcnMvcnNUeXBlLmggYi9saWJzL3JzL3JzVHlwZS5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDA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O30KKyAgICB2b2lkIHNldERpbUxPRChib29sIHYpIHttRGltTE9EID0gdjt9CisKKyAgICB2b2lkIGNsZWFyKCk7CisgICAgdm9pZCBjb21wdXRlKCk7CisKKyAgICB2b2lkIGVuYWJsZUdMVmVydGV4QnVmZmVyKCkgY29uc3Q7CisKKworcHJvdGVjdGVkOgorICAgIHN0cnVjdCBMT0QgeworICAgICAgICBzaXplX3QgbVg7CisgICAgICAgIHNpemVfdCBtWTsKKyAgICAgICAgc2l6ZV90IG1aOworICAgICAgICBzaXplX3QgbU9mZnNldDsKKyAgICB9OworCisgICAgdm9pZCBtYWtlTE9EVGFibGUoKTsKKworICAgIC8vIEludGVybmFsIHN0cnVjdHVyZSBmcm9tIG1vc3QgdG8gbGVhc3Qgc2lnbmlmaWNhbnQuCisgICAgLy8gKiBBcnJheSBkaW1lbnNpb25zCisgICAgLy8gKiBGYWNlcworICAgIC8vICogTWlwbWFwcworICAgIC8vICogeHl6CisKKyAgICBPYmplY3RCYXNlUmVmPGNvbnN0IEVsZW1lbnQ+IG1FbGVtZW50OworCisgICAgLy8gU2l6ZSBvZiB0aGUgc3RydWN0dXJlIGluIHRoZSB2YXJpb3VzIGRpbWVuc2lvbnMuICBBIG1pc3NpbmcgRGltZW5zaW9uIGlzCisgICAgLy8gc3BlY2lmaWVkIGFzIGEgMCBhbmQgbm90IGEgMS4KKyAgICBzaXplX3QgbURpbVg7CisgICAgc2l6ZV90IG1EaW1ZOworICAgIHNpemVfdCBtRGltWjsKKyAgICBib29sIG1EaW1MT0Q7CisgICAgYm9vbCBtRmFjZXM7CisKKyAgICAvLyBBIGxpc3Qgb2YgYXJyYXkgZGltZW5zaW9ucy4gIFRoZSBjb3VudCBpcyB0aGUgbnVtYmVyIG9mIGFycmF5IGRpbWVuc2lvbnMgYW5kIHRoZQorICAgIC8vIHNpemVzIGlzIGEgcGVyIGFycmF5IHNpemUuCisgICAgLy9WZWN0b3I8c2l6ZV90PiBtRGltQXJyYXlzU2l6ZXM7CisKKyAgICAvLyBjb3VudCBvZiBtaXBtYXAgbGV2ZWxzLCAwIGluZGljYXRlcyBubyBtaXBtYXBwaW5nCisKKyAgICBzaXplX3QgbU1pcENoYWluU2l6ZUJ5dGVzOworICAgIHNpemVfdCBtVG90YWxTaXplQnl0ZXM7CisgICAgTE9EICptTE9EczsKKyAgICB1aW50MzJfdCBtTE9EQ291bnQ7CisKKyAgICBzdHJ1Y3QgVmVydGV4Q29tcG9uZW50X3QgeworICAgICAgICB1aW50MzJfdCBvZmZzZXQ7CisgICAgICAgIHVpbnQzMl90IHR5cGU7CisgICAgICAgIHVpbnQzMl90IHNpemU7CisgICAgICAgIHVpbnQzMl90IHN0cmlkZTsKKyAgICB9OworICAgIHN0cnVjdCBHTFN0YXRlX3QgeworICAgICAgICBWZXJ0ZXhDb21wb25lbnRfdCBtVnR4OworICAgICAgICBWZXJ0ZXhDb21wb25lbnRfdCBtTm9ybTsKKyAgICAgICAgVmVydGV4Q29tcG9uZW50X3QgbUNvbG9yOworICAgICAgICBWZXJ0ZXhDb21wb25lbnRfdCBtVGV4W1JTX01BWF9URVhUVVJFXTsKKyAgICAgICAgVmVydGV4Q29tcG9uZW50X3QgbVBvaW50U2l6ZTsKKyAgICB9OworICAgIEdMU3RhdGVfdCBtR0w7CisgICAgdm9pZCBtYWtlR0xDb21wb25lbnRzKCk7CisKK3ByaXZhdGU6CisgICAgVHlwZShjb25zdCBUeXBlICYpOworfTsKKworCitjbGFzcyBUeXBlU3RhdGUgeworcHVibGljOgorICAgIFR5cGVTdGF0ZSgpOworICAgIH5UeXBlU3RhdGUoKTsKKworICAgIHNpemVfdCBtWDsKKyAgICBzaXplX3QgbVk7CisgICAgc2l6ZV90IG1aOworICAgIHVpbnQzMl90IG1MT0Q7CisgICAgYm9vbCBtRmFjZXM7CisgICAgT2JqZWN0QmFzZVJlZjxjb25zdCBFbGVtZW50PiBtRWxlbWVudDsKKworICAgIE9iamVjdEJhc2VSZWY8Y29uc3QgVHlwZT4gbUluZ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JldHVybiBpbjE7Cit9CisKK3RlbXBsYXRlPHR5cGVuYW1lIFQ+CitUIHJzTWF4KFQgaW4xLCBUIGluMikKK3sKKyAgICBpZiAoaW4xIDwgaW4yKSB7CisgICAgICAgIHJldHVybiBpbjI7CisgICAgfQorICAgIHJldHVybiBpbjE7Cit9CisKK3RlbXBsYXRlPHR5cGVuYW1lIFQ+CitUIHJzRmluZEhpZ2hCaXQoVCB2YWwpCit7CisgICAgdWludDMyX3QgYml0ID0gMDsKKyAgICB3aGlsZSh2YWwgPiAxKSB7CisgICAgICAgIGJpdCsrOworICAgICAgICB2YWw+Pj0xOworICAgIH0KKyAgICByZXR1cm4gYml0OworfQorCit0ZW1wbGF0ZTx0eXBlbmFtZSBUPgorYm9vbCByc0lzUG93MihUIHZhbCkKK3sKKyAgICByZXR1cm4gKHZhbCAmICh2YWwtMSkpID09IDA7Cit9CisKK3RlbXBsYXRlPHR5cGVuYW1lIFQ+CitUIHJzSGlnaGVyUG93MihUIHYpCit7CisgICAgaWYgKHJzSXNQb3cyKHYpKSB7CisgICAgICAgIHJldHVybiB2OworICAgIH0KKyAgICByZXR1cm4gMSA8PCAocnNGaW5kSGlnaEJpdCh2KSArIDEpOworfQorCit0ZW1wbGF0ZTx0eXBlbmFtZSBUPgorVCByc0xvd2VyUG93MihUIHYpCit7CisgICAgaWYgKHJzSXNQb3cyKHYpKSB7CisgICAgICAgIHJldHVybiB2OworICAgIH0KKyAgICByZXR1cm4gMSA8PCByc0ZpbmRIaWdoQml0KHYpOworfQorCisKK3N0YXRpYyBpbmxpbmUgdWludDE2X3QgcnM4ODh0bzU2NSh1aW50MzJfdCByLCB1aW50MzJfdCBnLCB1aW50MzJfdCBiKQoreworICAgIHVpbnQxNl90IHQgPSAwOworICAgIHQgfD0gYiA+PiAzOworICAgIHQgfD0gKGcgPj4gMikgPDwgNTsKKyAgICB0IHw9IChyID4+IDMpIDw8IDExOworICAgIHJldHVybiB0OworfQorCitzdGF0aWMgaW5saW5lIHVpbnQxNl90IHJzQm94RmlsdGVyNTY1KHVpbnQxNl90IGkxLCB1aW50MTZfdCBpMiwgdWludDE2X3QgaTMsIHVpbnQxNl90IGk0KQoreworICAgIHVpbnQzMl90IHIgPSAoKGkxICYgMHgxZikgKyAoaTIgJiAweDFmKSArIChpMyAmIDB4MWYpICsgKGk0ICYgMHgxZikpOworICAgIHVpbnQzMl90IGcgPSAoKGkxID4+IDUpICYgMHgzZikgKyAoKGkyID4+IDUpICYgMHgzZikgKyAoKGkzID4+IDUpICYgMHgzZikgKyAoKGk0ID4+IDUpICYgMHgzZik7CisgICAgdWludDMyX3QgYiA9ICgoaTEgPj4gMTEpICsgKGkyID4+IDExKSArIChpMyA+PiAxMSkgKyAoaTQgPj4gMTEpKTsKKyAgICByZXR1cm4gKHIgPj4gMikgfCAoKGcgPj4gMikgPDwgNSkgfCAoKGIgPj4gMikgPDwgMTEpOworfQorCitzdGF0aWMgaW5saW5lIHVpbnQzMl90IHJzQm94RmlsdGVyODg4OCh1aW50MzJfdCBpMSwgdWludDMyX3QgaTIsIHVpbnQzMl90IGkzLCB1aW50MzJfdCBpNCkKK3sKKyAgICB1aW50MzJfdCByID0gKGkxICYgMHhmZikgKyAgICAgICAgIChpMiAmIDB4ZmYpICsgICAgICAgICAoaTMgJiAweGZmKSArICAgICAgICAgKGk0ICYgMHhmZik7CisgICAgdWludDMyX3QgZyA9ICgoaTEgPj4gOCkgJiAweGZmKSArICAoKGkyID4+IDgpICYgMHhmZikgKyAgKChpMyA+PiA4KSAmIDB4ZmYpICsgICgoaTQgPj4gOCkgJiAweGZmKTsKKyAgICB1aW50MzJfdCBiID0gKChpMSA+PiAxNikgJiAweGZmKSArICgoaTIgPj4gMTYpICYgMHhmZikgKyAoKGkzID4+IDE2KSAmIDB4ZmYpICsgKChpNCA+PiAxNikgJiAweGZmKTsKKyAgICB1aW50MzJfdCBhID0gKChpMSA+PiAyNCkgJiAweGZmKSArICgoaTIgPj4gMjQpICYgMHhmZikgKyAoKGkz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ICAgY2FzZSAzOgorICAgICAgICBpZiAodnQtPmJpdHMgPT0gMzIpCisgICAgICAgICAgICBmcHJpbnRmKGYsICJmbG9hdCIpOworICAgICAgICBlbHNlCisgICAgICAgICAgICBmcHJpbnRmKGYsICJkb3VibGUiKTsKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSA0OgorICAgICAgICBmcHJpbnRmKGYsICIlcyIsIHZ0LT50eXBlTmFtZSk7CisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIGlmKHZ0LT5wdHJMZXZlbCkgeworICAgICAgICBmcHJpbnRmKGYsICIgIik7CisgICAgICAgIGZvcihjdD0wOyBjdCA8IHZ0LT5wdHJMZXZlbDsgY3QrKykgeworICAgICAgICAgICAgZnByaW50ZihmLCAiKiIpOworICAgICAgICB9CisgICAgfQorCisgICAgaWYodnQtPm5hbWVbMF0pIHsKKyAgICAgICAgZnByaW50ZihmLCAiICVzIiwgdnQtPm5hbWUpOworICAgIH0KK30KKwordm9pZCBwcmludEFyZ0xpc3QoRklMRSAqZiwgY29uc3QgQXBpRW50cnkgKiBhcGksIGludCBhc3N1bWVQcmV2aW91cykKK3sKKyAgICBpbnQgY3Q7CisgICAgZm9yKGN0PTA7IGN0IDwgYXBpLT5wYXJhbUNvdW50OyBjdCsrKSB7CisgICAgICAgIGlmIChjdCB8fCBhc3N1bWVQcmV2aW91cykgeworICAgICAgICAgICAgZnByaW50ZihmLCAiLCAiKTsKKyAgICAgICAgfQorICAgICAgICBwcmludFZhclR5cGUoZiwgJmFwaS0+cGFyYW1zW2N0XSk7CisgICAgfQorfQorCit2b2lkIHByaW50U3RydWN0dXJlcyhGSUxFICpmKQoreworICAgIGludCBjdDsKKyAgICBpbnQgY3QyOworCisgICAgZm9yKGN0PTA7IGN0IDwgYXBpQ291bnQ7IGN0KyspIHsKKyAgICAgICAgZnByaW50ZihmLCAidHlwZWRlZiBzdHJ1Y3QgUlNfQ01EXyVzX3JlYyBSU19DTURfJXM7XG4iLCBhcGlzW2N0XS5uYW1lLCBhcGlzW2N0XS5uYW1lKTsKKyAgICB9CisgICAgZnByaW50ZihmLCAiXG4iKTsKKworICAgIGZvcihjdD0wOyBjdCA8IGFwaUNvdW50OyBjdCsrKSB7CisgICAgICAgIGNvbnN0IEFwaUVudHJ5ICogYXBpID0gJmFwaXNbY3RdOworICAgICAgICBmcHJpbnRmKGYsICIjZGVmaW5lIFJTX0NNRF9JRF8lcyAlaVxuIiwgYXBpLT5uYW1lLCBjdCsxKTsKKyAgICAgICAgZnByaW50ZihmLCAic3RydWN0IFJTX0NNRF8lc19yZWMge1xuIiwgYXBpLT5uYW1lKTsKKyAgICAgICAgLy9mcHJpbnRmKGYsICIgICAgUnNDb21tYW5kSGVhZGVyIF9oZHI7XG4iKTsKKworICAgICAgICBmb3IoY3QyPTA7IGN0MiA8IGFwaS0+cGFyYW1Db3VudDsgY3QyKyspIHsKKyAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICAiKTsKKyAgICAgICAgICAgIHByaW50VmFyVHlwZShmLCAmYXBpLT5wYXJhbXNbY3QyXSk7CisgICAgICAgICAgICBmcHJpbnRmKGYsICI7XG4iKTsKKyAgICAgICAgfQorICAgICAgICBmcHJpbnRmKGYsICJ9O1xuXG4iKTsKKyAgICB9Cit9CisKK3ZvaWQgcHJpbnRGdW5jRGVjbChGSUxFICpmLCBjb25zdCBBcGlFbnRyeSAqYXBpLCBjb25zdCBjaGFyICpwcmVmaXgsIGludCBhZGRDb250ZXh0KQoreworICAgIHByaW50VmFyVHlwZShmLCAmYXBpLT5yZXQpOworICAgIGZwcmludGYoZiwgIiAlcyVzICgiLCBwcmVmaXgsIGFwaS0+bmFtZSk7CisgICAgaWYgKGFkZENvbnRleHQpIHsKKyAgICAgICAgZnByaW50ZihmLCAiQ29udGV4dCAqIik7CisgICAgfSBlbHNlIHsKKyAgICAgICAgZnByaW50ZihmLCAiUnNDb250ZXh0IHJzYyIpOworICAgIH0KKyAgICBwcmludEFyZ0xpc3QoZiwgYXBp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c3BhY2UgYW5kcm9pZDtcbiIpOworICAgIGZwcmludGYoZiwgInVzaW5nIG5hbWVzcGFjZSBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ7XG4iKTsKKyAgICBmcHJpbnRmKGYsICIjaW5jbHVkZSBcInJzSGFuZGNvZGUuaFwiXG4iKTsKKyAgICBmcHJpbnRmKGYsICJcbiIpOworCisgICAgZm9yKGN0PTA7IGN0IDwgYXBpQ291bnQ7IGN0KyspIHsKKyAgICAgICAgaW50IG5lZWRGbHVzaCA9IDA7CisgICAgICAgIGNvbnN0IEFwaUVudHJ5ICogYXBpID0gJmFwaXNbY3RdOworCisgICAgICAgIHByaW50RnVuY0RlY2woZiwgYXBpLCAicnMiLCAwKTsKKyAgICAgICAgZnByaW50ZihmLCAiXG57XG4iKTsKKyAgICAgICAgaWYgKGFwaS0+aGFuZGNvZGVBcGkpIHsKKyAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICByc0hDQVBJXyVzKHJzYyIsIGFwaS0+bmFtZSk7CisgICAgICAgICAgICBmb3IoY3QyPTA7IGN0MiA8IGFwaS0+cGFyYW1Db3VudDsgY3QyKyspIHsKKyAgICAgICAgICAgICAgICBjb25zdCBWYXJUeXBlICp2dCA9ICZhcGktPnBhcmFtc1tjdDJdOworICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiwgJXMiLCB2dC0+bmFtZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcHJpbnRmKGYsICIpO1xuIik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgVGhyZWFkSU8gKmlvID0gJigoQ29udGV4dCAqKXJzYyktPm1JTztcbiIpOworICAgICAgICAgICAgLy9mcHJpbnRmKGYsICIgICAgTE9HRShcImFkZCBjb21tYW5kICVzXFxuXCIpO1xuIiwgYXBpLT5uYW1lKTsKKyAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBSU19DTURfJXMgKmNtZCA9IHN0YXRpY19jYXN0PFJTX0NNRF8lcyAqPihpby0+bVRvQ29yZS5yZXNlcnZlKHNpemVvZihSU19DTURfJXMpKSk7XG4iLCBhcGktPm5hbWUsIGFwaS0+bmFtZSwgYXBpLT5uYW1lKTsKKyAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB1aW50MzJfdCBzaXplID0gc2l6ZW9mKFJTX0NNRF8lcyk7XG4iLCBhcGktPm5hbWUpOworCisgICAgICAgICAgICBmb3IoY3QyPTA7IGN0MiA8IGFwaS0+cGFyYW1Db3VudDsgY3QyKyspIHsKKyAgICAgICAgICAgICAgICBjb25zdCBWYXJUeXBlICp2dCA9ICZhcGktPnBhcmFtc1tjdDJdOworICAgICAgICAgICAgICAgIG5lZWRGbHVzaCArPSB2dC0+cHRyTGV2ZWw7CisgICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGNtZC0+JXMgPSAlcztcbiIsIHZ0LT5uYW1lLCB2dC0+bmFtZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXBpLT5yZXQudHlwZU5hbWVbMF0pIHsKKyAgICAgICAgICAgICAgICBuZWVkRmx1c2ggPSAxOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgaW8tPm1Ub0NvcmUuY29tbWl0Iik7CisgICAgICAgICAgICBpZiAobmVlZEZsdXNoKSB7CisgICAgICAgICAgICAgICAgZnByaW50ZihmLCAiU3luYyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnByaW50ZihmLCAiKFJTX0NNRF9JRF8lcywgc2l6ZSk7XG4iLCBhcGktPm5hbWUpOworCisgICAgICAgICAgICBpZiAoYXBpLT5yZXQudHlwZU5hbWVbMF0pIHsKKyAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgcmV0dXJuIHJlaW50ZXJwcmV0X2Nhc3Q8Iik7CisgICAgICAgICAgICAgICAgcHJpbnRWYXJUeXBlKGYsICZhcGktPnJldCk7CisgICAgICAgICAgICAgICAgZnByaW50ZihmLCAiPihpby0+bVRvQ29yZVJldCk7XG4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBmcHJpbnRmKGYsICJ9O1xuXG4iKTsKKyAgICB9Cit9CisKK3ZvaWQgcHJpbnRQbGF5YmFja0NwcChGSUxFICpmKQoreworICAgIGludCBjdDsKKyAgICBpbnQgY3QyOworCisgICAgZnByaW50ZihmLCAiI2luY2x1ZGUgXCJyc0RldmljZS5oXCJcbiIpOworICAgIGZwcmludGYoZiwgIiNpbmNsdWRlIFwicnNDb250ZXh0LmhcIlxuIik7CisgICAgZnByaW50ZihmLCAiI2luY2x1ZGUgXCJyc1RocmVhZElPLmhcIlxuIik7CisgICAgLy9mcHJpbnRmKGYsICIjaW5jbHVkZSBcInJzZ0FwaVN0cnVjdHMuaFwiXG4iKTsKKyAgICBmcHJpbnRmKGYsICIjaW5jbHVkZSBcInJzZ0FwaUZ1bmNEZWNsLmhcIlxuIik7CisgICAgZnByaW50ZihmLCAiXG4iKTsKKyAgICBmcHJpbnRmKGYsICJuYW1lc3BhY2UgYW5kcm9pZCB7XG4iKTsKKyAgICBmcHJpbnRmKGYsICJuYW1lc3BhY2UgcmVuZGVyc2NyaXB0IHtcbiIpOworICAgIGZwcmludGYoZiwgIiNpbmNsdWRlIFwicnNIYW5kY29kZS5oXCJcbiIpOworICAgIGZwcmludGYoZiwgIlxuIik7CisKKyAgICBmb3IoY3Q9MDsgY3QgPCBhcGlDb3VudDsgY3QrKykgeworICAgICAgICBjb25zdCBBcGlFbnRyeSAqIGFwaSA9ICZhcGlzW2N0XTsKKworICAgICAgICBmcHJpbnRmKGYsICJ2b2lkIHJzcF8lcyhDb250ZXh0ICpjb24sIGNvbnN0IHZvaWQgKnZwKVxuIiwgYXBpLT5uYW1lKTsKKyAgICAgICAgZnByaW50ZihmLCAie1xuIik7CisgICAgICAgIGlmIChhcGktPmhhbmRjb2RlUGxheSkgeworICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIHJzSENQTEFZXyVzKGNvbiwgdnApO1xuIiwgYXBpLT5uYW1lKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vZnByaW50ZihmLCAiICAgIExPR0UoXCJwbGF5IGNvbW1hbmQgJXNcXG5cIik7XG4iLCBhcGktPm5hbWUpOworICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGNvbnN0IFJTX0NNRF8lcyAqY21kID0gc3RhdGljX2Nhc3Q8Y29uc3QgUlNfQ01EXyVzICo+KHZwKTtcbiIsIGFwaS0+bmFtZSwgYXBpLT5uYW1lKTsKKyAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICAiKTsKKyAgICAgICAgICAgIGlmIChhcGktPnJldC50eXBlTmFtZVswXSkgeworICAgICAgICAgICAgICAgIGZwcmludGYoZiwgImNvbi0+bUlPLm1Ub0NvcmVSZXQgPSAoaW50cHRyX3QpIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcHJpbnRmKGYsICJyc2lfJXMoY29uIiwgYXBpLT5uYW1lKTsKKyAgICAgICAgICAgIGZvcihjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgeworICAgICAgICAgICAgICAgIGNvbnN0IFZhclR5cGUgKnZ0ID0gJmFwaS0+cGFyYW1zW2N0Ml07CisgICAgICAgICAgICAgICAgZnByaW50ZihmLCAiLFxuICAgICAgICAgICBjbWQtPiVzIiwgdnQtPm5hbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnByaW50ZihmLCAiKTtcbiIpOworICAgICAgICB9CisgICAgICAgIGZwcmludGYoZiwgIn07XG5cbiIpOworICAgIH0KKworICAgIGZwcmludGYoZiwgIlJzUGxheWJhY2tGdW5jIGdQbGF5YmFja0Z1bmNzW10gPSB7XG4iKTsKKyAgICBmcHJpbnRmKGYsICIgICAgTlVMTCxcbiIpOworICAgIGZvcihjdD0wOyBjdCA8IGFwaUNvdW50OyBjdCsrKSB7CisgICAgICAgIGZwcmludGYoZiwgIiAgICAlcyVzLFxuIiwgInJzcF8iLCBhcGlzW2N0XS5uYW1lKTsKKyAgICB9CisgICAgZnByaW50ZihmLCAifTtcbiIpOworCisgICAgZnByaW50ZihmLCAifTtcbiIpOworICAgIGZwcmludGYoZiwgIn07XG4iKTsKK30KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQoreworICAgIGlmIChhcmdjICE9IDMpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJ1c2FnZTogJXMgY29tbWFuZEZpbGUgb3V0RmlsZVxuIiwgYXJndlswXSk7CisgICAgICAgIHJldHVybiAxOworICAgIH0KKyAgICBjb25zdCBjaGFyKiByc2dGaWxlID0gYXJndlsxXTsKKyAgICBjb25zdCBjaGFyKiBvdXRGaWxlID0gYXJndlsyXTsKKyAgICBGSUxFKiBpbnB1dCA9IGZvcGVuKHJzZ0ZpbGUsICJyIik7CisKKyAgICBjaGFyIGNob2ljZSA9IGZnZXRjKGlucHV0KTsKKyAgICBmY2xvc2UoaW5wdXQpOworCisgICAgaWYgKGNob2ljZSA8ICcwJyB8fCBjaG9pY2UgPiAnMycpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJVa25vd24gY29tbWFuZDogXCclY1wnXG4iLCBjaG9pY2UpOworICAgICAgICByZXR1cm4gLTI7CisgICAgfQorCisgICAgeXlsZXgoKTsKKyAgICAvLyBwcmludGYoIiMgb2YgbGluZXMgPSAlZFxuIiwgbnVtX2xpbmVzKTsKKworICAgIEZJTEUgKmYgPSBmb3BlbihvdXRGaWxlLCAidyIpOworCisgICAgcHJpbnRGaWxlSGVhZGVyKGYpOworICAgIHN3aXRjaChjaG9pY2UpIHsKKyAgICAgICAgY2FzZSAnMCc6IC8vIHJzZ0FwaVN0cnVjdHMuaAorICAgICAgICB7CisgICAgICAgICAgICBmcHJpbnRmKGYsICJcbiIpOworICAgICAgICAgICAgZnByaW50ZihmLCAiI2luY2x1ZGUgXCJyc0NvbnRleHQuaFwiXG4iKTsKKyAgICAgICAgICAgIGZwcmludGYoZiwgIlxuIik7CisgICAgICAgICAgICBmcHJpbnRmKGYsICJuYW1lc3BhY2UgYW5kcm9pZCB7XG4iKTsKKyAgICAgICAgICAgIGZwcmludGYoZiwgIm5hbWVzcGFjZSByZW5kZXJzY3JpcHQge1xuIik7CisgICAgICAgICAgICBwcmludFN0cnVjdHVyZXMoZik7CisgICAgICAgICAgICBwcmludEZ1bmNEZWNscyhmLCAicnNpXyIsIDEpOworICAgICAgICAgICAgcHJpbnRQbGF5YmFja0Z1bmNzKGYsICJyc3BfIik7CisgICAgICAgICAgICBmcHJpbnRmKGYsICJcblxudHlwZWRlZiB2b2lkICgqUnNQbGF5YmFja0Z1bmMpKENvbnRleHQgKiwgY29uc3Qgdm9pZCAqKTtcbiIpOworICAgICAgICAgICAgZnByaW50ZihmLCAiZXh0ZXJuIFJzUGxheWJhY2tGdW5jIGdQbGF5YmFja0Z1bmNzW107XG4iKTsKKworICAgICAgICAgICAgZnByaW50ZihmLCAifVxuIik7CisgICAgICAgICAgICBmcHJpbnRmKGYsICJ9XG4iKTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlICcxJzogLy8gcnNnQXBpRnVuY0RlY2wuaAorICAgICAgICB7CisgICAgICAgICAgICBwcmludEZ1bmNEZWNscyhmLCAicnMiLCAwKTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlICcyJzogLy8gcnNnQXBpLmNwcAorICAgICAgICB7CisgICAgICAgICAgICBwcmludEFwaUNwcChmKTsKKyAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlICczJzogLy8gcnNnQXBpUmVwbGF5LmNwcAorICAgICAgICB7CisgICAgICAgICAgICBwcmludEZpbGVIZWFkZXIoZik7CisgICAgICAgICAgICBwcmludFBsYXliYWNrQ3BwKGYpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIH0KKyAgICB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mlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kODFkNDdlCi0tLSAvZGV2L251bGwKKysrIGIvbGlicy9ycy9zcGVjLmwKQEAgLTAsMCArMSwxNjUgQEAKKyVvcHRpb24gc3RhY2sKKworJXggY29tbWVudAorJXggYXBpX2VudHJ5CisleCBhcGlfZW50cnkyCisleCBhcGlfZW50cnlfcGFyYW0KKyV4IHZhcl90eXBlCisKK0RJR0lUICAgIFswLTldCitJRCAgICAgICBbYS16QS1aX11bYS16QS1aMC05X10qCisKKyAgICAjaW5jbHVkZSAic3BlYy5oIgorCisgICBpbnQgbnVtX2xpbmVzID0gMDsKKworICAgVmFyVHlwZSAqY3VyclR5cGUgPSAwOworCisgICBBcGlFbnRyeSBhcGlzWzEyOF07CisgICBpbnQgYXBpQ291bnQgPSAwOworCisgICBpbnQgdHlwZU5leHRTdGF0ZTsKKworICAgZXh0ZXJuICJDIiBpbnQgeXlsZXgoKTsKKworJSUKKworIi8qIiAgICAgICAgIEJFR0lOKGNvbW1lbnQpOworPGNvbW1lbnQ+W14qXG5dKiAgICAgICAgLyogZWF0IGFueXRoaW5nIHRoYXQncyBub3QgYSAnKicgKi8KKzxjb21tZW50PiIqIitbXiovXG5dKiAgIC8qIGVhdCB1cCAnKidzIG5vdCBmb2xsb3dlZCBieSAnLydzICovCis8Y29tbWVudD5cbiAgICAgICAgICAgICArK251bV9saW5lczsKKzxjb21tZW50PiIqIisiLyIgICAgICAgIEJFR0lOKElOSVRJQUwpOworCis8Kj4iICIgICAvL3ByaW50ZigiZm91bmQgJyAnXG4iKTsKKzwqPiJcbiIgICsrbnVtX2xpbmVzOyAvL3ByaW50ZigiZm91bmQgbGYgXG4iKTsKKwore0lEfSB7CisgICAgbWVtc2V0KCZhcGlzW2FwaUNvdW50XSwgMCwgc2l6ZW9mKEFwaUVudHJ5KSk7CisgICAgbWVtY3B5KGFwaXNbYXBpQ291bnRdLm5hbWUsIHl5dGV4dCwgeXlsZW5nKTsKKyAgICBCRUdJTihhcGlfZW50cnkpOworICAgIH0KKworPGFwaV9lbnRyeT4ieyIgeworICAgIEJFR0lOKGFwaV9lbnRyeTIpOworICAgIH0KKworPGFwaV9lbnRyeTI+InN5bmMiIHsKKyAgICBhcGlzW2FwaUNvdW50XS5zeW5jID0gMTsKKyAgICB9CisKKzxhcGlfZW50cnkyPiJoYW5kY29kZUFwaSIgeworICAgIGFwaXNbYXBpQ291bnRdLmhhbmRjb2RlQXBpID0gMTsKKyAgICB9CisKKzxhcGlfZW50cnkyPiJoYW5kY29kZVBsYXkiIHsKKyAgICBhcGlzW2FwaUNvdW50XS5oYW5kY29kZVBsYXkgPSAxOworICAgIH0KKworPGFwaV9lbnRyeTI+InJldCIgeworICAgIGN1cnJUeXBlID0gJmFwaXNbYXBpQ291bnRdLnJldDsKKyAgICB0eXBlTmV4dFN0YXRlID0gYXBpX2VudHJ5MjsKKyAgICBCRUdJTih2YXJfdHlwZSk7CisgICAgfQorCis8YXBpX2VudHJ5Mj4icGFyYW0iIHsKKyAgICBjdXJyVHlwZSA9ICZhcGlzW2FwaUNvdW50XS5wYXJhbXNbYXBpc1thcGlDb3VudF0ucGFyYW1Db3VudF07CisgICAgYXBpc1thcGlDb3VudF0ucGFyYW1Db3VudCsrOworICAgIHR5cGVOZXh0U3RhdGUgPSBhcGlfZW50cnlfcGFyYW07CisgICAgQkVHSU4odmFyX3R5cGUpOworICAgIH0KKworPHZhcl90eXBlPiJjb25zdCIgeworICAgIGN1cnJUeXBlLT5pc0NvbnN0ID0gMTsKKyAgICB9CisKKzx2YXJfdHlwZT4iaTgiIHsKKyAgICBjdXJyVHlwZS0+dHlwZSA9IDE7CisgICAgY3VyclR5cGUtPmJpdHMgPSA4OworICAgIEJFR0lOKHR5cGVOZXh0U3RhdGUpOworICAgIH0KKworPHZhcl90eXBlPiJpMTYiIHsKKyAgICBjdXJyVHlwZS0+dHlwZSA9IDE7CisgICAgY3VyclR5cGUtPmJpdHMgPSAxNjsKKyAgICBCR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isjaW5jbHVkZSAiQnVmZmVyQWxsb2NhdG9yLmgiCisjaW5jbHVkZSAiU3VyZmFjZUZsaW5nZXIuaCIKKworCituYW1lc3BhY2UgYW5kcm9pZCB7CisKKy8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorLy8gQnVmZmVyIGFuZCBpbXBsZW1lbnRhdGlvbiBvZiBhbmRyb2lkX25hdGl2ZV9idWZmZXJfdAorLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKK0J1ZmZlcjo6QnVmZmVyKCkKKyAgICA6IFN1cmZhY2VCdWZmZXIoKSwgbUluaXRDaGVjayhOT19FUlJPUiksICBtVlN0cmlkZSgwKQoreworfQorCitCdWZmZXI6OkJ1ZmZlcih1aW50MzJfdCB3LCB1aW50MzJfdCBoLCBQaXhlbEZvcm1hdCBmb3JtYXQsCisgICAgICAgIHVpbnQzMl90IHJlcVVzYWdlLCB1aW50MzJfdCBmbGFncykKKyAgICA6IFN1cmZhY2VCdWZmZXIoKSwgbUluaXRDaGVjayhOT19JTklUKSwgbVZTdHJpZGUoMCkKK3sKKyAgICBtSW5pdENoZWNrID0gaW5pdFNpemUodywgaCwgZm9ybWF0LCByZXFVc2FnZSwgZmxhZ3MpOworfQorCitCdWZmZXI6On5CdWZmZXIoKQoreworICAgIGlmIChoYW5kbGUpIHsKKyAgICAgICAgQnVmZmVyQWxsb2NhdG9yJiBhbGxvY2F0b3IoQnVmZmVyQWxsb2NhdG9yOjpnZXQoKSk7CisgICAgICAgIGFsbG9jYXRvci5mcmVlKGhhbmRsZSk7CisgICAgfQorfQorCitzdGF0dXNfdCBCdWZmZXI6OmluaXRDaGVjaygpIGNvbnN0IHsKKyAgICByZXR1cm4gbUluaXRDaGVjazsKK30KKworYW5kcm9pZF9uYXRpdmVfYnVmZmVyX3QqIE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PgorCisjaW5jbHVkZSA8dWkvUGl4ZWxGb3JtYXQuaD4KKyNpbmNsdWRlIDx1aS9SZWN0Lmg+CisjaW5jbHVkZSA8dWkvU3VyZmFjZS5oPgorCisjaW5jbHVkZSA8cGl4ZWxmbGluZ2VyL3BpeGVsZmxpbmdlci5oPgorCisjaW5jbHVkZSA8cHJpdmF0ZS91aS9TaGFyZWRCdWZmZXJTdGFjay5oPgorI2luY2x1ZGUgPHByaXZhdGUvdWkvU3VyZmFjZUJ1ZmZlci5oPgorCitjbGFzcyBjb3B5Yml0X2ltYWdlX3Q7CitzdHJ1Y3QgYW5kcm9pZF9uYXRpdmVfYnVmZmVyX3Q7CisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisvLyBCdWZmZXIKKy8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCitjbGFzcyBOYXRpdmVCdWZmZXI7CisKK2NsYXNzIEJ1ZmZlciA6IHB1YmxpYyBTdXJmYWNlQnVmZmVyCit7CitwdWJsaWM6CisgICAgZW51bSB7CisgICAgICAgIERPTlRfQ0xFQVIgID0gMHgwMDAwMDAwMSwKKyAgICAgICAgU0VDVVJFICAgICAgPSAweDAwMDAwMDA0CisgICAgfTsKKworICAgIEJ1ZmZlcigpOworCisgICAgLy8gY3JlYXRlcyB3ICogaCBidWZmZXIKKyAgICBCdWZmZXIodWludDMyX3QgdywgdWludDMyX3QgaCwgUGl4ZWxGb3JtYXQgZm9ybWF0LAorICAgICAgICAgICAgdWludDMyX3QgcmVxVXNhZ2UsIHVpbnQzMl90IGZsYWdzID0gMCk7CisKKyAgICAvLyByZXR1cm4gc3RhdHVzCisgICAgc3RhdHVzX3QgaW5pdENoZWNrKCkgY29uc3Q7CisKKyAgICB1aW50MzJ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ICAgICAgICBpZiAobVJFR0hlYXAgIT0gMCkgewotICAgICAgICAgICAgaWYgKG1Pd25lciAhPSBOT19PV05FUikgewotICAgICAgICAgICAgICAgIC8vIHNvbWVvbmUgYWxyZWFkeSBoYXMgdGhlIGdwdS4KLSAgICAgICAgICAgICAgICB0YWtlQmFja0dQVUxvY2tlZCgpOwotICAgICAgICAgICAgICAgIHJlbGVhc2VMb2NrZWQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIGZpcnN0IHRpbWUsIGluaXRpYWxpemUgdGhlIHN0dWZmLgotICAgICAgICAgICAgaWYgKG1TTUlIZWFwID09IDApCi0gICAgICAgICAgICAgICAgbVNNSUhlYXAgPSBuZXcgR1BVQXJlYUhlYXAodGhpcywgIi9kZXYvcG1lbV9ncHUwIik7Ci0gICAgICAgICAgICBpZiAobUVCSUhlYXAgPT0gMCkKLSAgICAgICAgICAgICAgICBtRUJJSGVhcCA9IG5ldyBHUFVBcmVhSGVhcCh0aGlzLCAKLSAgICAgICAgICAgICAgICAgICAgICAgICIvZGV2L3BtZW1fZ3B1MSIsIDAsIEdQVV9SRVNFUlZFRF9TSVpFKTsKLSAgICAgICAgICAgIG1SRUdIZWFwID0gbmV3IEdQVVJlZ2lzdGVySGVhcCh0aGlzKTsKLSAgICAgICAgICAgIG1BbGxvY2F0b3IgPSBtRUJJSGVhcC0+Z2V0QWxsb2NhdG9yKCk7Ci0gICAgICAgICAgICBpZiAobUFsbG9jYXRvciA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgLy8gc29tZXRoaW5nIHdlbnQgdGVycmlibHkgd3JvbmcuCi0gICAgICAgICAgICAgICAgbVNNSUhlYXAuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICBtRUJJSGVhcC5jbGVhcigpOwotICAgICAgICAgICAgICAgIG1SRUdIZWFwLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIElOVkFMSURfT1BF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7Ci0gICAgaWYgKGNhbGxiYWNrICE9IDApIHsKLSAgICAgICAgY2FsbGJhY2stPmdwdUxvc3QoKTsgLy8gb25lLXdheQotICAgICAgICBtQ29uZGl0aW9uLndhaXRSZWxhdGl2ZShtTG9jaywgbXMybnMoMjUwKSk7Ci0gICAgfQotfQotCi12b2lkIEdQVUhhcmR3YXJlOjpyZWxlYXNlTG9ja2VkKCkKLXsKLSAgICAvL0xPR0QoInJldm9raW5nIGdwdSBmcm9tIHBpZCAlZCIsIG1Pd25lcik7Ci0gICAgaWYgKG1Pd25lciAhPSBOT19PV05FUikgewotICAgICAgICAvLyB0aGlzIG1heSBmYWlsIGJlY2F1c2UgdGhlIGNsaWVudCBtaWdodCBoYXZlIGRpZWQsIGFuZCBoYXZlCi0gICAgICAgIC8vIGJlZW4gcmVtb3ZlZCBmcm9tIHRoZSBsaXN0LgotICAgICAgICBzc2l6ZV90IGluZGV4ID0gbUNsaWVudHMuaW5kZXhPZktleShtT3duZXIpOwotICAgICAgICBpZiAoaW5kZXggPj0gMCkgewotICAgICAgICAgICAgQ2xpZW50JiBjbGllbnQobUNsaWVudHMuZWRpdFZhbHVlQXQoaW5kZXgpKTsKLSAgICAgICAgICAgIGNsaWVudC5yZXZva2VBbGxIZWFwcygpOwotICAgICAgICB9Ci0gICAgICAgIG1Pd25lciA9IE5PX09XTkVSOwotICAgICAgICBtQ3VycmVudEFsbG9jYXRvci5jbGVhcigpOwotICAgICAgICBtQ2FsbGJhY2suY2xlYXIoKTsKLSAgICB9Ci19Ci0KLUdQVUhhcmR3YXJlOjpDbGllbnQmIEdQVUhhcmR3YXJlOjpnZXRDbGllbnRMb2NrZWQocGlkX3QgcGlkKQotewotICAgIHNzaXplX3QgaW5kZXggPSBtQ2xpZW50cy5pbmRleE9mS2V5KHBpZCk7Ci0gICAgaWYgKGluZGV4IDwgMCkgewotICAgICAgICBDbGllbnQgY2xpZW50OwotICAgICAgICBjbGllbnQucGlkID0gcGlkOwotICAgICAgICBjbGll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RzLmFkZChiaW5kZXIsIGNsaWVudC5waWQpID49IDApIHsKLSAgICAgICAgYmluZGVyLT5saW5rVG9EZWF0aCh0aGlzKTsKLSAgICB9Ci19Ci0KLXZvaWQgR1BVSGFyZHdhcmU6OmJpbmRlckRpZWQoY29uc3Qgd3A8SUJpbmRlcj4mIHdobykKLXsKLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotICAgIHBpZF90IHBpZCA9IG1SZWdpc3RlcmVkQ2xpZW50cy52YWx1ZUZvcih3aG8pOwotICAgIGlmIChwaWQgIT0gMCkgewotICAgICAgICBzc2l6ZV90IGluZGV4ID0gbUNsaWVudHMuaW5kZXhPZktleShwaWQpOwotICAgICAgICBpZiAoaW5kZXggPj0gMCkgewotICAgICAgICAgICAgLy9MT0dEKCIqKiogcmVtb3ZpbmcgY2xpZW50IGF0ICVkIiwgaW5kZXgpOwotICAgICAgICAgICAgQ2xpZW50JiBjbGllbnQobUNsaWVudHMuZWRpdFZhbHVlQXQoaW5kZXgpKTsKLSAgICAgICAgICAgIGNsaWVudC5yZXZva2VBbGxIZWFwcygpOyAvLyBub3QgcmVhbGx5IG5lZWRlZCBpbiB0aGVvcnkKLSAgICAgICAgICAgIG1DbGllbnRzLnJlbW92ZUl0ZW1zQXQoaW5kZXgpOwotICAgICAgICAgICAgaWYgKG1DbGllbnRzLnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgLy9MT0dEKCIqKiogd2FzIGxhc3QgY2xpZW50IGNsb3NpbmcgZXZlcnl0aGluZyIpOwotICAgICAgICAgICAgICAgIG1DYWxsYmFjay5jbGVhcigpOwotICAgICAgICAgICAgICAgIG1BbGxvY2F0b3IuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICBtQ3VycmVudEFsbG9jYXRvci5jbGVhcigpOwotICAgICAgICAgICAgICAgIG1TTUlIZWFwLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgbVJFR0hlYXAuY2xlYXIoKTsKLSAgICAgIC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cnR5KSkgeworICAgICAgICAgICAgZ2xCaW5kVGV4dHVyZShHTF9URVhUVVJFXzJELCBtVGV4dHVyZXNbaW5kZXhdLm5hbWUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gd2UgbmVlZCB0byByZWNyZWF0ZSB0aGUgdGV4dHVyZQorICAgICAgICAgICAgRUdMRGlzcGxheSBkcHkobUZsaW5nZXItPmdyYXBoaWNQbGFuZSgwKS5nZXRFR0xEaXNwbGF5KCkpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBjcmVhdGUgdGhlIG5ldyB0ZXh0dXJlIG5hbWUgaWYgbmVlZGVkCisgICAgICAgICAgICBpZiAoVU5MSUtFTFkobVRleHR1cmVzW2luZGV4XS5uYW1lID09IC0xVSkpIHsKKyAgICAgICAgICAgICAgICBtVGV4dHVyZXNbaW5kZXhdLm5hbWUgPSBjcmVhdGVUZXh0dXJlKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGdsQmluZFRleHR1cmUoR0xfVEVYVFVSRV8yRCwgbVRleHR1cmVzW2luZGV4XS5uYW1lKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gZnJlZSB0aGUgcHJldmlvdXMgaW1hZ2UKKyAgICAgICAgICAgIGlmIChtVGV4dHVyZXNbaW5kZXhdLmltYWdlICE9IEVHTF9OT19JTUFHRV9LSFIpIHsKKyAgICAgICAgICAgICAgICBlZ2xEZXN0cm95SW1hZ2VLSFIoZHB5LCBtVGV4dHVyZXNbaW5kZXhdLmltYWdlKTsKKyAgICAgICAgICAgICAgICBtVGV4dHVyZXNbaW5kZXhdLmltYWdlID0gRUdMX05PX0lNQUdFX0tIUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gY29uc3RydWN0IGFuIEVHTF9OQVRJVkVfQlVGRkVSX0FORFJPSUQKKyAgICAgICAgICAgIGFuZHJvaWRfbmF0aXZlX2J1ZmZlcl90KiBjbGllbnRCdWYgPSBidWZmZXItPmdldE5hdGl2ZUJ1ZmZlcigpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBjcmVhdGUgdGhlIG5ldyBFR0xJbWFnZUtIUgorICAgICAgICAgICAgY29uc3QgRUdMaW50IGF0dHJzW10gPSB7IAorICAgICAgICAgICAgICAgICAgICBFR0xfSU1BR0VfUFJFU0VSVkVEX0tIUiwgICAgRUdMX1RSVUUsIAorICAgICAgICAgICAgICAgICAgICBFR0xfTk9ORSwgICAgICAgICAgICAgICAgICAgRUdMX05PTkUgCisgICAgICAgICAgICB9OworICAgICAgICAgICAgbVRleHR1cmVzW2luZGV4XS5pbWFnZSA9IGVnbENyZWF0ZUltYWdlS0hSKAorICAgICAgICAgICAgICAgICAgICBkcHksIEVHTF9OT19DT05URVhULCBFR0xfTkFUSVZFX0JVRkZFUl9BTkRST0lELAorICAgICAgICAgICAgICAgICAgICAoRUdMQ2xpZW50QnVmZmVyKWNsaWVudEJ1ZiwgYXR0cnMpOworCisgICAgICAgICAgICBMT0dFX0lGKG1UZXh0dXJlc1tpbmRleF0uaW1hZ2UgPT0gRUdMX05PX0lNQUdFX0tIUiwKKyAgICAgICAgICAgICAgICAgICAgImVnbENyZWF0ZUltYWdlS0hSKCkgZmFpbGVkLiBlcnI9MHglNHgiLAorICAgICAgICAgICAgICAgICAgICBlZ2xHZXRFcnJvcigpKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG1UZXh0dXJlc1tpbmRleF0uaW1hZ2UgIT0gRUdMX05PX0lNQUdFX0tIUikgeworICAgICAgICAgICAgICAgIGdsRUdMSW1hZ2VUYXJnZXRUZXh0dXJlMkRPRVMoR0xfVEVYVFVSRV8yRCwgCisgICAgICAgICAgICAgICAgICAgICAgICAoR0xlZ2xJbWFnZU9FUyltVGV4dHVyZXNbaW5kZXhdLmltYWdlKTsKKyAgICAgICAgICAgICAgICBHTGludCBlcnJvciA9IGdsR2V0RXJyb3IoKTsKKyAgICAgICAgICAgICAgICBpZiAoVU5MSUtFTFkoZXJyb3IgIT0gR0xfTk9fRVJST1IpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgZmFpbGVkLCBmb3IgaW5zdGFuY2UsIGJlY2F1c2Ugd2UgZG9uJ3Qgc3VwcG9ydAorICAgICAgICAgICAgICAgICAgICAvLyBOUE9ULgorICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRTogZG8gc29tZXRoaW5nIQorICAgICAgICAgICAgICAgICAgICBtRmxhZ3MgJj0gfkRpc3BsYXlIYXJkd2FyZTo6RElSRUNUX1RFWFRVUkU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gRXZlcnl0aGluZyB3ZW50IG9rYXkhCisgICAgICAgICAgICAgICAgICAgIG1UZXh0dXJlc1tpbmRleF0uZGlydHkgID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIG1UZXh0dXJlc1tpbmRleF0ud2lkdGggID0gY2xpZW50QnVmLT53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgbVRleHR1cmVzW2luZGV4XS5oZWlnaHQgPSBjbGllbnRCdWYtPmhlaWdodDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ICAgICAgICAgICAgICAgIAorICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgR0dMU3VyZmFjZSB0OworICAgICAgICBzdGF0dXNfdCByZXMgPSBidWZmZXItPmxvY2soJnQsIEdSQUxMT0NfVVNBR0VfU1dfUkVBRF9SQVJFTFkpOworICAgICAgICBMT0dFX0lGKHJlcywgImVycm9yICVkICglcykgbG9ja2luZyBidWZmZXIgJXAiLAorICAgICAgICAgICAgICAgIHJlcywgc3RyZXJyb3IocmVzKSwgYnVmZmVyLmdldCgpKTsKKyAgICAgICAgaWYgKHJlcyA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgaWYgKFVOTElLRUxZKG1UZXh0dXJlc1swXS5uYW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pZW50YXRpb24oKSk7Ci0gICAgICAgIGNvcHliaXQtPnNldF9wYXJhbWV0ZXIoY29weWJpdCwgQ09QWUJJVF9QTEFORV9BTFBIQSwgcy5hbHBoYSk7Ci0gICAgICAgIGNvcHliaXQtPnNldF9wYXJhbWV0ZXIoY29weWJpdCwgQ09QWUJJVF9ESVRIRVIsCi0gICAgICAgICAgICAgICAgcy5mbGFncyAmIElTdXJmYWNlQ29tcG9zZXI6OmVMYXllckRpdGhlciA/Ci0gICAgICAgICAgICAgICAgICAgICAgICBDT1BZQklUX0VOQUJMRSA6IENPUFlCSVRfRElTQUJMRSk7Ci0KLSAgICAgICAgcmVnaW9uX2l0ZXJhdG9yIGl0KGNsaXApOwotICAgICAgICBlcnIgPSBjb3B5Yml0LT5zdHJldGNoKGNvcHliaXQsICZkc3QsICZzcmMsICZkcmVjdCwgJnNyZWN0LCAmaXQpOwotICAgIH0KLQotICAgIGlmICghY2FuX3VzZV9jb3B5Yml0IHx8IGVycikgewotICAgICAgICBkcmF3V2l0aE9wZW5HTChjbGlwLCBtVGV4dHVyZU5hbWUsIHQpOwotICAgIH0KKyAgICBkcmF3V2l0aE9wZW5HTChjbGlwLCBtVGV4dHVyZXNbaW5kZXhdKTsKIH0KIAotc3RhdHVzX3QgTGF5ZXI6OnJlYWxsb2NhdGVCdWZmZXIoaW50MzJfdCBpbmRleCwgdWludDMyX3QgdywgdWludDMyX3QgaCkKK3NwPFN1cmZhY2VCdWZmZXI+IExheWVyOjpyZXF1ZXN0QnVmZmVyKGludCBpbmRleCwgaW50IHVzYWdlKQogewotICAgIExPR0RfSUYoREVCVUdfUkVTSVpFLAotICAgICAgICAgICAgICAgICJyZWFsbG9jYXRlQnVmZmVyIChsYXllcj0lcCksICIKLSAgICAgICAgICAgICAgICAicmVxdWVzdGVkICglZHglZCksICIKLSAgICAgICAgICAgICAgICAiaW5kZXg9JWQsICglZHglZCksICglZHglZCkiLAotICAgICAgICAgICAgICAgIHRoaXMsCi0gICAgICAgICA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1ZXN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgLy8gRVJST1IsIHRoZSByZXNpemVkIGJ1ZmZlciBkb2Vzbid0IGhhdmUgaXRzIHJlc2l6ZSBmbGFnIHNldAotICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzaXplID09IGVSZXNpemVSZXF1ZXN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgLy8gT0ssIE5vcm1hbCBjYXNlLCBwcm9jZWVkIHdpdGggcmVzaXplCi0gICAgICAgICAgICAgfQotICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICBpZiAocmVzaXplID09IDApIHsKLSAgICAgICAgICAgICAgICAgLy8gT0ssIG5vdGhpbmcgc3BlY2lhbCwgZG8gbm90aGluZwotICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzaXplID09IG1hc2spIHsKLSAgICAgICAgICAgICAgICAgLy8gcmVzdGFydGVkIHRyYW5zYWN0aW9uLCBkbyBub3RoaW5nCi0gICAgICAgICAgICAgfSBlbHNlIGlmIChyZXNpemUgPT0gbWFzayBeIGVSZXNpemVSZXF1ZXN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgLy8gcmVzdGFydGVkIHRyYW5zYWN0aW9uLCBkbyBub3RoaW5nCi0gICAgICAgICAgICAgfSBlbHNlIGlmIChyZXNpemUgPT0gZVJlc2l6ZVJlcXVlc3RlZCkgewotICAgICAgICAgICAgICAgICAvLyBPSywgc2l6ZSByZXNldCB0byBwcmV2aW91cyB2YWx1ZSwgcHJvY2VlZCB3aXRoIHJlc2l6ZQotICAgICAgICAgICAgIH0KLSAgICAgICAgIH0KLSAgICAgKi8KLQogICAgIC8vIEluZGV4IG9mIHRoZSBiYWNrIGJ1ZmZlcgogICAgIGNvbnN0IGJvb2wgYmFja2J1ZmZlckNoYW5nZWQgPSAoZnJvbnQudyAhPSB0ZW1wLncpIHx8IChmcm9udC5oICE9IHRlbXAuaCk7Ci0gICAgY29uc3QgdWludDMyX3Qgc3RhdGUgPS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AgICAgICAgICAgICAgImluZGV4PSVkLCAoJWR4JWQpLCAoJWR4JWQpIiwKLSAgICAgICAgICAgICAgICAgICAgdGhpcywgIHN0YXRlLAotICAgICAgICAgICAgICAgICAgICBpbnQodGVtcC53KSwgaW50KHRlbXAuaCksCisgICAgICAgICAgICAgICAgICAgICJyZXNpemUgKGxheWVyPSVwKSwgcmVxdWVzdGVkICglZHglZCksICIKKyAgICAgICAgICAgICAgICAgICAgImRyYXdpbmcgKCVkLCVkKSwgKCVkeCVkKSwgKCVkeCVkKSIsCisgICAgICAgICAgICAgICAgICAgIHRoaXMsIGludCh0ZW1wLncpLCBpbnQodGVtcC5oKSwKICAgICAgICAgICAgICAgICAgICAgaW50KGRyYXdpbmdTdGF0ZSgpLncpLCBpbnQoZHJhd2luZ1N0YXRlKCkuaCksCi0gICAgICAgICAgICAgICAgICAgIGludChjbGllbnRCYWNrQnVmZmVySW5kZXgpLAotICAgICAgICAgICAgICAgICAgICBpbnQobUJ1ZmZlcnNbMF0ud2lkdGgoKSksIGludChtQnVmZmVyc1swXS5oZWlnaHQoKSksCi0gICAgICAgICAgICAgICAgICAgIGludChtQnVmZmVyc1sxXS53aWR0aCgpKSwgaW50KG1CdWZmZXJzWzFdLmhlaWdodCgpKSk7CisgICAgICAgICAgICAgICAgICAgIGludChtQnVmZmVyc1swXS0+Z2V0V2lkdGgoKSksIGludChtQnVmZmVyc1swXS0+Z2V0SGVpZ2h0KCkpLAorICAgICAgICAgICAgICAgICAgICBpbnQobUJ1ZmZlcnNbMV0tPmdldFdpZHRoKCkpLCBpbnQobUJ1ZmZlcnNbMV0tPmdldEhlaWdodCgpKSk7CiAKLSAgICAgICAgaWYgKHN0YXRlICYgZUxvY2tlZCkgewotICAgICAgICAgICAgLy8gaWYgdGhlIGJ1ZmZlciBpcyBsb2NrZWQsIHdlIGNhbid0IHJlc2l6ZSBhbnl0aGluZyBiZWNhdXNlCi0gICAgICAgICAgICAvLyAtIHRoZSBiYWNrYnVmZmVyIGl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IGxldAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIG5leHQgdHJhbnNhY3Rpb24gaGFuZGxlIGV2ZXJ5dGhpbmcuCi0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBuZXdWYWx1ZSA9IG9sZFZhbHVlICYgfm1hc2s7Ci0gICAgICAgICAgICAgICAgfSB3aGlsZShhbmRyb2lkX2F0b21pY19jbXB4Y2hnKG9sZFZhbHVlLCBuZXdWYWx1ZSwgJihsY2Jsay0+c3dhcFN0YXRlKSkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVJlc2l6ZVRyYW5zYWN0aW9uRG9uZSA9IGZhbHNlOwotICAgICAgICAgICAgcmVjb21wdXRlVmlzaWJsZVJlZ2lvbnMgPSB0cnVlOwotICAgICAgICAgICAgdGhpcy0+Y29udGVudERpcnR5ID0gdHJ1ZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJlbG9hZFRleHR1cmUoZGlydHkpOwotCi0gICAgcmV0dXJuIGRpcnR5OwotfQotCi1Qb2ludCBMYXllcjo6Z2V0UGh5c2ljYWxTaXplKCkgY29uc3QKLXsKLSAgICBjb25zdCBMYXllckJpdG1hcCYgZnJvbnQoZnJvbnRCdWZmZXIoKSk7Ci0gICAgcmV0dXJuIFBvaW50KGZyb250LndpZHRoKCksIGZyb250LmhlaWdodCgpKTsKKyAgICByZWxvYWRUZXh0dXJlKCBtUG9zdGVkRGlydHlSZWdpb24gKTsKIH0KIAogdm9pZCBMYXllcjo6dW5sb2NrUGFnZUZsaXAoCkBAIC01NDQsMjMgKzM2OSw0MiBAQAogICAgICAgICAvLyBpcyBpbiBzY3JlZW4gc3BhY2UgYXMgd2VsbCkuCiAgICAgICAgIGRpcnR5UmVnaW9uLmFuZFNlbGYodmlzaWJsZVJlZ2lvblNjcmVlbik7CiAgICAgICAgIG91dERpcnR5UmVnaW9uLm9yU2VsZihka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eyByZXR1cm4gdHlwZUlEOyB9CiAgICAgdmlydHVhbCB1aW50MzJfdCBnZXRUeXBlSW5mbygpIGNvbnN0IHsgcmV0dXJuIHR5cGVJbmZvOyB9CiAKKyAgICAKKyAgICBTaGFyZWRCdWZmZXJTZXJ2ZXIqICAgICBsY2JsazsKKworICAgIAogICAgICAgICAgICAgICAgICBMYXllcihTdXJmYWNlRmxpbmdlciogZmxpbmdlciwgRGlzcGxheUlEIGRpc3BsYXksCi0gICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50KiBjLCBpbnQzMl90IGkpOworICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPENsaWVudD4mIGNsaWVudCwgaW50MzJfdCBpKTsKIAogICAgICAgICB2aXJ0dWFsIH5MYXllcigpOwogCi0gICAgaW5saW5lIFBpeGVsRm9ybWF0IHBpeGVsRm9ybWF0KCkgY29uc3QgewotICAgICAgICByZXR1cm4gZnJvbnRCdWZmZXIoKS5waXhlbEZvcm1hdCgpOwotICAgIH0KKyAgICBzdGF0dXNfdCBzZXRCdWZmZXJzKHVpbnQzMl90IHcsIHVpbnQzMl90IGgsIAorICAgICAgICAgICAgUGl4ZWxGb3JtYXQgZm9ybWF0LCB1aW50MzJfdCBmbGFncz0wKTsKIAotICAgIHN0YXR1c190IHNldEJ1ZmZlcnMoICAgIENsaWVudCogY2xpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUGl4ZWxGb3JtYXQgZm9ybWF0LCB1aW50MzJfdCBmbGFncz0wKTsKKyAgICB2b2lkIHNldERyYXdpbmdTaXplKHVpbnQzMl90IHcsIHVpbnQzMl90IGgpOwogCiAgICAgdmlydHVhbCB2b2lkIG9uRHJhdyhjb25zdCBSZWdpb24mIGNsaXApIGNvbnN0OwotICAgIHZpcnR1YWwgdm9pZCBpbml0U3RhdGVzKHVpbnQzMl90IHcsI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AgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdDxMYXllcio+KFN1cmZhY2U6OmdldE93bmVyKCkuZ2V0KCkpOworICAgICAgICB9CisgICAgfTsKKyAgICBmcmllbmQgY2xhc3MgU3VyZmFjZUxheWVyOworICAgIAogICAgIHNwPFN1cmZhY2U+ICAgICAgICAgICAgIG1TdXJmYWNlOwogCiAgICAgICAgICAgICBib29sICAgICAgICAgICAgbVNlY3VyZTsKLSAgICAgICAgICAgIExheWVyQml0bWFwICAgICBtQnVmZmVyc1syXTsKICAgICAgICAgICAgIGludDMyX3QgICAgICAgICBtRnJvbnRCdWZmZXJJbmRleDsKICAgICAgICAgICAgIGJvb2wgICAgICAgICAgICBtTmVlZHNCbGVuZGluZzsKLSAgICAgICAgICAgIGJvb2wgICAgICAgICAgICBtUmVzaXplVHJhbnNhY3Rpb25Eb25lOwogICAgICAgICAgICAgUmVnaW9uICAgICAgICAgIG1Qb3N0ZWREaXJ0eVJlZ2lvbjsKICAgICAgICAgICAgIHNwPEZyZWV6ZUxvY2s+ICBtRnJlZXplTG9jazsKKyAgICAgICAgICAgIFBpeGVsRm9ybWF0ICAgICBtRm9ybWF0OworICAgICAgICAgICAgdWludDMyX3QgICAgICAgIG1CdWZmZXJGbGFnczsKICAgICAgICAgICAgIAotICAgICAgICAgICAgR0x1aW50ICAgICAgICAgIG1UZXh0dXJlTmFtZTsKLSAgICAgICAgICAgIEdMdWludCAgICAgICAgICBtVGV4dHVyZVdpZHRoOwotICAgICAgICAgICAgR0x1aW50ICAgICAgICAgIG1UZXh0dXJlSGVpZ2h0OworICAgICAgICAgICAgLy8gcHJvdGVjdGVkIGJ5IG1Mb2NrCisgICAgICAgICAgICBzcDxCdWZmZXI+ICAgICAgbUJ1ZmZlcnNbTlVNX0JVRkZFUlNdOworICAgICAgICAgICAgVGV4dHVyZSAgICAgICAgIG1UZXh0dXJlc1tOVU1fQlVGRkVSU107CisgICAgICAgICAgICB1aW50MzJfdCAgICAgICAgbVdpZHRo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FuZGxlIHRoZSBvdGhlciBvcmllbnRhdGlvbnMKICAgICAgICAgICAgICAgICBnbFRyYW5zbGF0ZWYoMCwgMSwgMCk7CiAgICAgICAgICAgICAgICAgZ2xSb3RhdGVmKC05MCwgMCwgMCwgMSk7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmICghKG1GbGFncyAmIERpc3BsYXlIYXJkd2FyZTo6TlBPVF9FWFRFTlNJT04pKSB7CisgICAgICAgICAgICBpZiAoIShtRmxhZ3MgJiAoRGlzcGxheUhhcmR3YXJlOjpOUE9UX0VYVEVOU0lPTiB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlzcGxheUhhcmR3YXJlOjpESVJFQ1RfVEVYVFVSRSkpKSB7CiAgICAgICAgICAgICAgICAgLy8gZmluZCB0aGUgc21hbGxlc3QgcG93ZXItb2YtdHdvIHRoYXQgd2lsbCBhY2NvbW1vZGF0ZSBvdXIgc3VyZmFjZQotICAgICAgICAgICAgICAgIEdMdWludCB0dyA9IDEgPDwgKDMxIC0gY2x6KHQud2lkdGgpKTsKLSAgICAgICAgICAgICAgICBHTHVpbnQgdGggPSAxIDw8ICgzMSAtIGNseih0LmhlaWdodCkpOwotICAgICAgICAgICAgICAgIGlmICh0dyA8IHQud2lkdGgpICB0dyA8PD0gMTsKLSAgICAgICAgICAgICAgICBpZiAodGggPCB0LmhlaWdodCkgdGggPDw9IDE7CisgICAgICAgICAgICAgICAgR0x1aW50IHR3ID0gMSA8PCAoMzEgLSBjbHood2lkdGgpKTsKKyAgICAgICAgICAgICAgICBHTHVpbnQgdGggPSAxIDw8ICgzMSAtIGNseihoZWlnaHQpKTsKKyAgICAgICAgICAgICAgICBpZiAodHcgPCB3aWR0aCkgIHR3IDw8PSAxOworICAgICAgICAgICAgICAgIGlmICh0aCA8IGhlaWdodCkgdGggPDw9IDE7CiAgICAgICAgICAgICAgICAgLy8gdGhpcyBkaXZpZGUgc2hvdWxkIGJlIHJlbGF0aXZlbHkgZmFzdCBiZWNhdXNlIGl0J3MKICAgICAgICAgICAgICAgICAvLyBhIHBvd2VyLW9mLXR3byAob3B0aW1pemVkIHBhdGggaW4gbGliZ2NjKQotICAgICAgICAgICAgICAgIEdMZmxvYXQgd3MgPSBHTGZsb2F0KHQud2lkdGgpIC90dzsKLSAgICAgICAgICAgICAgICBHTGZsb2F0IGhzID0gR0xmbG9hdCh0LmhlaWdodCkvdGg7CisgICAgICAgICAgICAgICAgR0xmbG9hdCB3cyA9IEdMZmxvYXQod2lkdGgpIC90dzsKKyAgICAgICAgICAgICAgICBHTGZsb2F0IGhzID0gR0xmbG9hdChoZWlnaHQpL3RoOwogICAgICAgICAgICAgICAgIGdsU2NhbGVmKHdzLCBocywgMS4wZik7CiAgICAgICAgICAgICB9CiAKQEAgLTUxMiw4ICs0NzUsOCBAQAogICAgICAgICAgICAgZ2xWZXJ0ZXhQb2ludGVyKDIsIEdMX0ZJWEVELCAwLCBtVmVydGljZXMpOwogICAgICAgICAgICAgZ2xUZXhDb29yZFBvaW50ZXIoMiwgR0xfRklYRUQsIDAsIHRleENvb3Jkcyk7CiAKLSAgICAgICAgICAgIFJlY3QgcjsKLSAgICAgICAgICAgIHdoaWxlIChpdGVyYXRvci5pdGVyYXRlKCZyKSkgeworICAgICAgICAgICAgd2hpbGUgKGl0ICE9IGVuZCkgeworICAgICAgICAgICAgICAgIGNvbnN0IFJlY3QmIHIgPSAqaXQrKzsKICAgICAgICAgICAgICAgICBjb25zdCBHTGludCBzeSA9IGZiSGVpZ2h0IC0gKHIudG9wICsgci5oZWlnaHQoKSk7CiAgICAgICAgICAgICAgICAgZ2xTY2lzc29yKHIubGVmdCwgc3ksIHIud2lkdGgoKSwgci5oZWlnaHQoKSk7CiAgICAgICAgICAgICAgICAgZ2xEcmF3QXJyYXlzKEdMX1RSSUFOR0xFX0ZBTiwgMCwgNCk7IApAQCAtNTI2LDE4ICs0ODksMTkgQEAKICAgICAgICAgICAgIGdsRGlzYWJsZUNsaWVudFN0YXR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DAsCi0gICAgICAgICAgICAgICAgICAgICAgICBHTF9SR0IsIHRleHR1cmVfdywgdGV4dHVyZV9oLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgR0xfUkdCLCBHTF9VTlNJR05FRF9TSE9SVF81XzZfNSwgZGF0YSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHQuZm9ybWF0ID09IEdHTF9QSVhFTF9GT1JNQVRfUkdCQV80NDQ0KSB7Ci0gICAgICAgICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICBHTF9SR0JBLCB0ZXh0dXJlX3csIHRleHR1cmVfaCwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgIEdMX1JHQkEsIEdMX1VOU0lHTkVEX1NIT1JUXzRfNF80XzQsIGRhdGEpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1JHQkFfODg4OCkgewotICAgICAgICAgICAgICAgIGdsVGV4SW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgR0xfUkdCQSwgdGV4dHVyZV93LCB0ZXh0dXJlX2gsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICBHTF9SR0JBLCBHTF9VTlNJR05FRF9CWVRFLCBkYXRhKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIHQuZm9ybWF0ID09IEdHTF9QSVhFTF9GT1JNQVRfWUNiQ3JfNDIyX1NQIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICB0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1lDYkNyXzQyMF9TUCkgewotICAgICAgICAgICAgICAgIC8vIGp1c3Qgc2hvdyB0aGUgWSBwbGFuZSBvZiBZVVYgYnVmZmVycworICAgICAgICBpZiAoIXRleHR1cmVXaWR0aCB8fCAhdGV4dHVyZUhlaWdodCkgeworICAgICAgICAgICAgLy8gdGhpcyBpcyB0aGUgZmlyc3QgdGltZSwgbG9hZCB0aGUgd2hvbGUgdGV4dHVyZQorICAgICAgICAgICAgaWYgKHRleHR1cmVfdz09dHcgJiYgdGV4dHVyZV9oPT10aCkgeworICAgICAgICAgICAgICAgIC8vIHdlIGNhbiBkbyBpdCBvbmUgcGFzcwogICAgICAgICAgICAgICAgIGRhdGEgPSB0LmRhdGE7Ci0gICAgICAgICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICBHTF9MVU1JTkFOQ0UsIHRleHR1cmVfdywgdGV4dHVyZV9oLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgR0xfTFVNSU5BTkNFLCBHTF9VTlNJR05FRF9CWVRFLCBkYXRhKTsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gb29wcywgd2UgZG9uJ3QgaGFuZGxlIHRoaXMgZm9ybWF0IQotICAgICAgICAgICAgICAgIExPR0UoImxheWVyICVwLCB0ZXh0dXJlPSVkLCB1c2luZyBmb3JtYXQgJWQsIHdoaWNoIGlzIG5vdCAiCi0gICAgICAgICAgICAgICAgICAgICAic3VwcG9ydGVkIGJ5IHRoZSBHTCIsIHRoaXMsIHRleHR1cmVOYW1lLCB0LmZvcm1hdCk7Ci0gICAgICAgICAgICAgICAgdGV4dHVyZU5hbWUgPSAtMTsKKyAgICAgICAgICAgICAgICAvLyB3ZSBoYXZlIHRvIGNyZWF0ZSB0aGUgdGV4dHVyZSBmaXJzdCBiZWNhdXNlIGl0CisgICAgICAgICAgICAgICAgLy8gZG9lc24ndCBtYXRjaCB0aGUgc2l6ZSBvZiB0aGUgYnVmZmVyCisgICAgICAgICAgICAgICAgYm91bmRzLnNldChSZWN0KHR3LCB0aCkpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgdGV4dHVyZVdpZHRoID0gdGV4dHVyZV93OwotICAgICAgICAgICAgdGV4dHVyZUhlaWdodCA9IHRleHR1cmVfaDsKICAgICAgICAgfQotICAgICAgICBpZiAoIWRhdGEgJiYgdGV4dHVyZU5hbWU+PTApIHsKLSAgICAgICAgICAgIGlmICh0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1JHQl81NjUpIHsKLSAgICAgICAgICAgICAgICBnbFRleFN1YkltYWdlMkQoR0xfVEVYVFVSRV8yRCwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgIDAsIGJvdW5kcy50b3AsIHQud2lkdGgsIGJvdW5kcy5oZWlnaHQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIEdMX1JHQiwgR0xfVU5TSUdORURfU0hPUlRfNV82XzUsCi0gICAgICAgICAgICAgICAgICAgICAgICB0LmRhdGEgKyBib3VuZHMudG9wKnQud2lkdGgqMik7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHQuZm9ybWF0ID09IEdHTF9QSVhFTF9GT1JNQVRfUkdCQV80NDQ0KSB7Ci0gICAgICAgICAgICAgICAgZ2xUZXhTdWJJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAwLCBib3VuZHMudG9wLCB0LndpZHRoLCBib3VuZHMuaGVpZ2h0KCksCi0gICAgICAgICAgICAgICAgICAgICAgICBHTF9SR0JBLCBHTF9VTlNJR05FRF9TSE9SVF80XzRfNF80LAotICAgICAgICAgICAgICAgICAgICAgICAgdC5kYXRhICsgYm91bmRzLnRvcCp0LndpZHRoKjIpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1JHQkFfODg4OCkgewotICAgICAgICAgICAgICAgIGdsVGV4U3ViSW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgMCwgYm91bmRzLnRvcCwgdC53aWR0aCwgYm91bmRzLmhlaWdodCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgR0xfUkdCQSwgR0xfVU5TSUdORURfQllURSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHQuZGF0YSArIGJvdW5kcy50b3AqdC53aWR0aCo0KTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICh0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1JHQl81NjUpIHsKKyAgICAgICAgICAgIGdsVGV4SW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLAorICAgICAgICAgICAgICAgICAgICBHTF9SR0IsIHRleHR1cmVfdywgdGV4dHVyZV9oLCAwLAorICAgICAgICAgICAgICAgICAgICBHTF9SR0IsIEdMX1VOU0lHTkVEX1NIT1JUXzVfNl81LCBkYXRhKTsKKyAgICAgICAgfSBlbHNlIGlmICh0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1JHQkFfNDQ0NCkgeworICAgICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsCisgICAgICAgICAgICAgICAgICAgIEdMX1JHQkEsIHRleHR1cmVfdywgdGV4dHVyZV9oLCAwLAorICAgICAgICAgICAgICAgICAgICBHTF9SR0JBLCBHTF9VTlNJR05FRF9TSE9SVF80XzRfNF80LCBkYXRhKTsKKyAgICAgICAgfSBlbHNlIGlmICh0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1JHQkFfODg4OCkgeworICAgICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsCisgICAgICAgICAgICAgICAgICAgIEdMX1JHQkEsIHRleHR1cmVfdywgdGV4dHVyZV9oLCAwLAorICAgICAgICAgICAgICAgICAgICBHTF9SR0JBLCBHTF9VTlNJR05FRF9CWVRFLCBkYXRhKTsKKyAgICAgICAgfSBlbHNlIGlmICggdC5mb3JtYXQgPT0gR0dMX1BJWEVMX0ZPUk1BVF9ZQ2JDcl80MjJfU1AgfHwKKyAgICAgICAgICAgICAgICAgICAgdC5mb3JtYXQgPT0gR0dMX1BJWEVMX0ZPUk1BVF9ZQ2JDcl80MjBfU1ApIHsKKyAgICAgICAgICAgIC8vIGp1c3Qgc2hvdyB0aGUgWSBwbGFuZSBvZiBZVVYgYnVmZmVycworICAgICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsCisgICAgICAgICAgICAgICAgICAgIEdMX0xVTUlOQU5DRSwgdGV4dHVyZV93LCB0ZXh0dXJlX2gsIDAsCisgICAgICAgICAgICAgICAgICAgIEdMX0xVTUlOQU5DRSwgR0xfVU5TSUdORURfQllURSwgZGF0YSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBvb3BzLCB3ZSBkb24ndCBoYW5kbGUgdGhpcyBmb3JtYXQhCisgICAgICAgICAgICBMT0dFKCJsYXllciAlcCwgdGV4dHVyZT0lZCwgdXNpbmcgZm9ybWF0ICVkLCB3aGljaCBpcyBub3QgIgorICAgICAgICAgICAgICAgICAic3VwcG9ydGVkIGJ5IHRoZSBHTCIsIHRoaXMsIHRleHR1cmVOYW1lLCB0LmZvcm1hdCk7CisgICAgICAgICAgICB0ZXh0dXJlTmFtZSA9IC0xOworICAgICAgICB9CisgICAgICAgIHRleHR1cmVXaWR0aCA9IHRleHR1cmVfdzsKKyAgICAgICAgdGV4dHVyZUhlaWdodCA9IHRleHR1cmVfaDsKKyAgICB9CisgICAgaWYgKCFkYXRhICYmIHRleHR1cmVOYW1lPj0wKSB7CisgICAgICAgIGlmICh0LmZvcm1hdCA9PSBHR0xfUElYRUxfRk9STUFUX1JHQl81NjUpIHsKKyAgICAgICAgICAgIGdsVGV4U3ViSW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLAorICAgICAgICAgICAgICAgICAgICAwLCBib3VuZHMudG9wLCB0LndpZHRoLCBib3VuZHMuaGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgIEdMX1JHQiwgR0xfVU5TSUdORURfU0hPUlRfNV82XzUsCisgICAgICAgICAgICAgICAgICAgIHQuZGF0YSArIGJvdW5kcy50b3AqdC5zdHJpZGUqMik7CisgICAgICAgIH0gZWxzZSBpZiAodC5mb3JtYXQgPT0gR0dMX1BJWEVMX0ZPUk1BVF9SR0JBXzQ0NDQpIHsKKyAgICAgICAgICAgIGdsVGV4U3ViSW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLAorICAgICAgICAgICAgICAgICAgICAwLCBib3VuZHMudG9wLCB0LndpZHRoLCBib3VuZHMuaGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgIEdMX1JHQkEsIEdMX1VOU0lHTkVEX1NIT1JUXzRfNF80XzQsCisgICAgICAgICAgICAgICAgICAgIHQuZGF0YSArIGJvdW5kcy50b3AqdC5zdHJpZGUqMik7CisgICAgICAgIH0gZWxzZSBpZiAodC5mb3JtYXQgPT0gR0dMX1BJWEVMX0ZPUk1BVF9SR0JBXzg4ODgpIHsKKyAgICAgICAgICAgIGdsVGV4U3ViSW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLAorICAgICAgICAgICAgICAgICAgICAwLCBib3VuZHMudG9wLCB0LndpZHRoLCBib3VuZHMuaGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgIEdMX1JHQkEsIEdMX1VOU0lHTkVEX0JZVEUsCisgICAgICAgICAgICAgICAgICAgIHQuZGF0YSArIGJvdW5kcy50b3AqdC5zdHJpZGUqNCk7CisgICAgICAgIH0gZWxzZSBpZiAoIHQuZm9ybWF0ID09IEdHTF9QSVhFTF9GT1JNQVRfWUNiQ3JfNDIyX1NQIHx8CisgICAgICAgICAgICAgICAgICAgIHQuZm9ybWF0ID09IEdHTF9QSVhFTF9GT1JNQVRfWUNiQ3JfNDIwX1NQKSB7CisgICAgICAgICAgICAvLyBqdXN0IHNob3cgdGhlIFkgcGxhbmUgb2YgWVVWIGJ1ZmZlcnMKKyAgICAgICAgICAgIGdsVGV4U3ViSW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLAorICA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Ci1pbnQzMl90IExheWVyQmFzZUNsaWVudDo6c2VydmVySW5kZXgoKSBjb25zdCB7Ci0gICAgaWYgKGNsaWVudCkgeworaW50MzJfdCBMYXllckJhc2VDbGllbnQ6OnNlcnZlckluZGV4KCkgY29uc3QgCit7CisgICAgc3A8Q2xpZW50PiBjbGllbnQodGhpcy0+Y2xpZW50LnByb21vdGUoKSk7CisgICAgaWYgKGNsaWVudCAhPSAwKSB7CiAgICAgICAgIHJldHVybiAoY2xpZW50LT5jaWQ8PDE2KXxtSW5kZXg7CiAgICAgfQogICAgIHJldHVybiAweEZGRkYwMDAwIHwgbUluZGV4OwogfQogCi1zcDxMYXllckJhc2VDbGllbnQ6OlN1cmZhY2U+IExheWVyQmFzZUNsaWVudDo6Z2V0U3VyZmFjZSgpIGNvbnN0CitzcDxMYXllckJhc2VDbGllbnQ6OlN1cmZhY2U+IExheWVyQmFzZUNsaWVudDo6Z2V0U3VyZmFjZSgpCiB7Ci0gICAgcmV0dXJuIG5ldyBTdXJmYWNlKGNsaWVudEluZGV4KCksIG1JZGVudGl0eSk7CisgICAgc3A8U3VyZmFjZT4gczsKKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgIHMgPSBtQ2xpZW50U3VyZmFjZS5wcm9tb3RlKCk7CisgICAgaWYgKHMgPT0gMCkgeworICAgICAgICBzID0gY3JlYXRlU3VyZmFjZSgpOworICAgICAgICBtQ2xpZW50U3VyZmFjZSA9IHM7CisgICAgfQorICAgIHJldHVybiBzOwogfQogCitzcDxMYXllckJhc2VDbGllbnQ6OlN1cmZhY2U+IExheWVyQmFzZUNsaWVudDo6Y3JlYXRlU3VyZmFjZSgpIGNvbnN0Cit7CisgICAgcmV0dXJuIG5ldyBTdXJmYWNlKG1GbGluZ2VyLCBjbGllbnRJbmRleCgpLCBtSWRlbnRpdHksCisgICAgICAgICAgICBjb25zdF9jYXN0PExheWVyQmFzZUNsaWVudCAqPih0aGlzKSk7Cit9CisKKy8vIC0tLS0t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ogcmVwbHksIHVpbnQzMl90IGZsYWdzKQoreworICAgIHN3aXRjaCAoY29kZSkgeworICAgICAgICBjYXNlIFJFR0lTVEVSX0JVRkZFUlM6CisgICAgICAgIGNhc2UgVU5SRUdJU1RFUl9CVUZGRVJTOgorICAgICAgICBjYXNlIENSRUFURV9PVkVSTEFZOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoIW1GbGluZ2VyLT5tQWNjZXNzU3VyZmFjZUZsaW5nZXIuY2hlY2tDYWxsaW5nKCkpIHsKKyAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZSogaXBjID0gSVBDVGhyZWFkU3RhdGU6OnNlbGYoKTsKKyAgICAgICAgICAgICAgICBjb25zdCBpbnQgcGlkID0gaXBjLT5nZXRDYWxsaW5nUGlkKCk7CisgICAgICAgICAgICAgICAgY29uc3QgaW50IHVpZCA9IGlwYy0+Z2V0Q2FsbGluZ1VpZCgpOworICAgICAgICAgICAgICAgIExPR0UoIlBlcm1pc3Npb24gRGVuaWFsOiAiCisgICAgICAgICAgICAgICAgICAgICAgICAiY2FuJ3QgYWNjZXNzIFN1cmZhY2VGbGluZ2VyIHBpZD0lZCwgdWlkPSVkIiwgcGlkLCB1aWQpOworICAgICAgICAgICAgICAgIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gQm5TdXJmYWNlOjpvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7Cit9CisKK3NwPFN1cmZhY2VCdWZmZXI+IExheWVyQmFzZUNsaWVudDo6U3VyZmFjZTo6cmVxdWVzdEJ1ZmZlcihpbnQgaW5kZXgsIGludCB1c2FnZSkgCit7CisgICAgcmV0dXJuIE5VTEw7IAorfQorCitzdGF0dXNfdCBMYXllckJhc2VDbGllbnQ6OlN1cmZhY2U6OnJlZ2lzdGVyQnVmZmVycygKKyAgICAgICAgY29uc3QgSVN1cmZh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jdXJyZW50U3RhdGUoKSAgICAgICAgICB7IHJldHVybiBtQ3VycmVudFN0YXRlOyB9CiAKLSAgICBzdGF0aWMgaW50IGNvbXBhcmVDdXJyZW50U3RhdGVaKExheWVyQmFzZSpjb25zdCogbGF5ZXJBLCBMYXllckJhc2UqY29uc3QqIGxheWVyQikgeworICAgIHN0YXRpYyBpbnQgY29tcGFyZUN1cnJlbnRTdGF0ZVooCisgICAgICAgICAgICBzcDxMYXllckJhc2U+IGNvbnN0ICogbGF5ZXJBLAorICAgICAgICAgICAgc3A8TGF5ZXJCYXNlPiBjb25zdCAqIGxheWVyQikgewogICAgICAgICByZXR1cm4gbGF5ZXJBWzBdLT5jdXJyZW50U3RhdGUoKS56IC0gbGF5ZXJCWzBdLT5jdXJyZW50U3RhdGUoKS56OwogICAgIH0KIApAQCAtMjI5LDIwICsyMzAsMjYgQEAKIAogICAgICAgICAgIEdMdWludCBjcmVhdGVUZXh0dXJlKCkgY29uc3Q7CiAgICAgCi0gICAgICAgICAgdm9pZCBkcmF3V2l0aE9wZW5HTChjb25zdCBSZWdpb24mIGNsaXAsCi0gICAgICAgICAgICAgICAgICBHTGludCB0ZXh0dXJlTmFtZSwKLSAgICAgICAgICAgICAgICAgIGNvbnN0IEdHTFN1cmZhY2UmIHN1cmZhY2UsCi0gICAgICAgICAgICAgICAgICBpbnQgdHJhbnNmb3JtID0gMCkgY29uc3Q7CisgICAgICAgICAgc3RydWN0IFRleHR1cmUgeworICAgICAgICAgICAgICBUZXh0dXJlKCkgOiBuYW1lKC0xVSksIHdpZHRoKDApLCBoZWlnaHQoMCksCisgICAgICAgICAgICAgICAgICBpbWFnZShFR0xfTk9fSU1BR0VfS0hSKSwgdHJhbnNmb3JtKDApLCBkaXJ0eSh0cnVlKSB7IH0KKyAgICAgICAgICAgICAgR0x1aW50ICAgICAgICBuYW1lOworICAgICAgICAgICAgICBHTHVpbnQgICAgICAgIHdpZHRoOworICAgICAgICAgICAgICBHTHVpbnQgICAgICAgIGhlaWdodDsKKyAgICAgICAgICAgICAgRUdMSW1hZ2VLSFIgICBpbWFnZTsKKyAgICAgICAgICAgICAgdWludDMyX3QgICAgICB0cmFuc2Zvcm07CisgICAgICAgICAgICAgIGJvb2wgICAgICAgICAgZGlydHk7CisgICAgICAgICAgfTsKIAorICAgICAgICAgIHZvaWQgY2xlYXJXaXRoT3BlbkdMKGNvbnN0IFJlZ2lvbiYgY2xpcCwgR0xjbGFtcHggciwgR0xjbGFtcHggZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTGNsYW1weCBiLCBHTGNsYW1weCBhbHBoYSkgY29uc3Q7CiAgICAgICAgICAgdm9pZCBjbGVhcldpdGhPcGVuR0woY29uc3QgUmVnaW9uJiBjbGlwKSBjb25zdDsKKyAgICAgICAgICB2b2lkIGRyYXdXaXRoT3BlbkdMKGNvbnN0IFJlZ2lvbiYgY2xpcCwgY29uc3QgVGV4dHVyZSYgdGV4dHVyZSkgY29uc3Q7CisgICAgICAgICAgdm9pZCBsb2FkVGV4dHVyZShUZXh0dXJlKiB0ZXh0dXJlLCBHTGludCB0ZXh0dXJlTmFtZSwgCisgICAgICAgICAgICAgICAgICBjb25zdCBSZWdpb24mIGRpcnR5LCBjb25zdCBHR0xTdXJmYWNlJiB0KSBjb25zdDsKIAotICAgICAgICAgIHZvaWQgbG9hZFRleHR1cmUoY29uc3QgUmVnaW9uJiBkaXJ0eSwKLSAgICAgICAgICAgICAgICAgIEdMaW50IHRleHR1cmVOYW1lLCBjb25zdCBHR0xTdXJmYWNlJiB0LAotICAgICAgICAgICAgICAgICAgR0x1aW50JiB0ZXh0dXJlV2lkdGgsIEdMdWludCYgdGV4dHVyZUhlaWdodCkgY29uc3Q7Ci0KLSAgICAgICAgICBib29sIGNhblVzZUNvcHliaXQoKSBjb25zdDsKICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBTdXJmYWNlRmxpbmdlciogbUZsaW5nZXI7CisgICAgICAgICAgICAgICAgc3A8U3VyZmFjZUZsaW5nZXI+IG1GbGluZ2VyOwogICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICBtRmxhZ3M7CiAKICAgICAgICAgICAgICAgICAvLyBjYWNoZWQgZHVyaW5nIHZhbGlkYXRlVmlzaWJpbGl0eSgpCkBAIC0yNTAsNyArMjU3LDYgQEAKICAgICAgICAgICAgICAgICBpbnQzMl90ICAgICAgICAgbU9yaWVudGF0aW9uOwogICAgICAgICAgICAgICAgIEdMZml4ZWQgICAgICAgICBtVmVydGljZXNbNF1bMl07CiAgICAgICAgICAgICAgICAgUmVjdCAgICAgICAgICAgIG1UcmFuc2Zvcm1lZEJvdW5kczsKLSAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgbUNhblVzZUNvcHlCaXQ7CiAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgIG1MZWZ0OwogICAgICAgICAgICAgICAgIGludCAgICAgICAgICAgICBtVG9wOwogICAgICAgICAgICAgCkBAIC0yNjIsMTYgKzI2OCwxNiBAQAogICAgICAgICAgICAgICAgIC8vIGRvbid0IGNoYW5nZSwgZG9uJ3QgbmVlZCBhIGxvY2sKICAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgbVByZW11bHRpcGxpZWRBbHBoYTsKIAotICAgICAgICAgICAgICAgIC8vIG9ubHkgcmVhZAotICAgIGNvbnN0ICAgICAgIHVpbnQzMl90ICAgICAgICBtSWRlbnRpdHk7Ci0gICAgIAogICAgICAgICAgICAgICAgIC8vIGF0b21pYwogICAgIHZvbGF0aWxlICAgIGludDMyX3QgICAgICAgICBtSW52YWxpZGF0ZTsKICAgICAgICAgICAgICAgICAKIAorcHJvdGVjdGVkOgorICAgIHZpcnR1YWwgfkxheWVyQmFzZSgpOworCiBwcml2YXRlOgotICAgICAgICAgICAgICAgIHZvaWQgdmFsaWRhdGVUZXh0dXJlKEdMaW50IHRleHR1cmVOYW1lKSBjb25zdDsKLSAgICBzdGF0aWMgICAgICBpbnQzMl90ICAgICAgICAgc0lkZW50aXR5OworICAgIExheWVyQmFzZShjb25zdCBMYXllckJhc2UmIHJocyk7CisgICAgdm9pZCB2YWxpZGF0ZVRleHR1cmUoR0xpbnQgdGV4dHVyZU5hbWUpIGNvbnN0OwogfTsKIAogCkBAIC0yODcsNjYgKzI5Myw2MiBAQAogICAgIHZpcnR1YWwgdWludDMyX3QgZ2V0VHlwZUluZm8oKSBjb25zdCB7IHJldHVybiB0eXBlSW5mbzsgfQogCiAgICAgTGF5ZXJCYXNlQ2xpZW50KFN1cmZhY2VGbGluZ2VyKiBmbGluZ2VyLCBEaXNwbGF5SUQgZGlzcGxheSwgCi0gICAgICAgICAgICBDbGllbnQqIGNsaWVudCwgaW50MzJfdCBpKTsKKyAgICAgICAgICAgIGNvbnN0IHNwPENsaWVudD4mIGNsaWVudCwgaW50MzJfdCBpKTsKICAgICB2aXJ0dWFsIH5MYXllckJhc2VDbGllbnQoKTsKKyAgICB2aXJ0dWFsIHZvaWQgb25GaXJzdFJlZigpOwogCisgICAgd3A8Q2xpZW50PiAgICAgICAgICAgICAgY2xpZW50OworLy8gICAgU2hhcmVkQnVmZmVyU2VydmVyKiAgICAgbGNibGs7CiAKLSAgICBDbGllbnQqICAgICAgICAgICAgIGNvbnN0IGNsaWVudDsKLSAgICBsYXllcl9jYmxrX3QqICAgICAgIGNvbnN0IGxjYmxrOwotCisgICAgaW5saW5lICB1aW50MzJfdCAgICBnZXRJZGVudGl0eSgpIGNvbnN0IHsgcmV0dXJuIG1JZGVudGl0eTsgfQogICAgIGlubGluZSAgaW50MzJfdCAgICAgY2xpZW50SW5kZXgoKSBjb25zdCB7IHJldHVybiBtSW5kZXg7IH0KICAgICAgICAgICAgIGludDMyX3QgICAgIHNlcnZlckluZGV4KCkgY29uc3Q7CiAKLSAgICB2aXJ0dWFsIHNwPFN1cmZhY2U+IGdldFN1cmZhY2UoKSBjb25zdDsKICAgIAotICAgICAgICAgICAgdWludDMyX3QgICAgZ2V0SWRlbnRpdHkoKSBjb25zdCB7IHJ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eGVscygpIHJlYWRzIHRoZSBmYiBib3R0b20tdG8tdG9wLCBob3dldmVyIHdlJ2xsCi0gICAgICAgICAgICAgICAgLy8gc2tpcCBhbGwgdGhlIGphY2NvYmlhbiBjb21wdXRhdGlvbnMuCi0gICAgICAgICAgICAgICAgUmVjdCByOwotICAgICAgICAgICAgICAgIEdMaW50IGNyb3BbNF0gPSB7IDAsIDAsIHcsIGggfTsKLSAgICAgICAgICAgICAgICBnbFRleFBhcmFtZXRlcml2KEdMX1RFWFRVUkVfMkQsIEdMX1RFWFRVUkVfQ1JPUF9SRUNUX09FUywgY3JvcCk7Ci0gICAgICAgICAgICAgICAgeSA9IGZiSGVpZ2h0IC0gKHkgKyBoKTsKLSAgICAgICAgICAgICAgICB3aGlsZSAoaXRlcmF0b3IuaXRlcmF0ZSgmcikpIHsKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgR0xpbnQgc3kgPSBmYkhlaWdodCAtIChyLnRvcCArIHIuaGVpZ2h0KCkpOwotICAgICAgICAgICAgICAgICAgICBnbFNjaXNzb3Ioci5sZWZ0LCBzeSwgci53aWR0aCgpLCByLmhlaWdodCgpKTsKLSAgICAgICAgICAgICAgICAgICAgZ2xEcmF3VGV4aU9FUyh4LCB5LCAwLCB3LCBoKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBOT1RFOiB0aGlzIGlzIG1hcmdpbmFsbHkgZmFzdGVyIHdpdGggdGhlIHNvZnR3YXJlIGdsLCBiZWNhdXNlCisgICAgICAgICAgICAvLyBnbFJlYWRQaXhlbHMoKSByZWFkcyB0aGUgZmIgYm90dG9tLXRvLXRvcCwgaG93ZXZlciB3ZSdsbAorICAgICAgICAgICAgLy8gc2tpcCBhbGwgdGhlIGphY2NvYmlhbiBjb21wdXRhdGlvbnMuCisgICAgICAgICAgICBSZWN0IHI7CisgICAgICAgICAgICBHTGludCBjcm9wWzRdID0geyAwLCAwLCB3LCBoIH07CisgICAgICAgICAgICBnbFRleFBhcmFtZXRlcml2KEdMX1RFWFRVUkVfMkQsIEdMX1RFWFRVUkVfQ1JPUF9SRUNUX09FUywgY3JvcCk7CisgICAgICAgICAgICB5ID0gZmJIZWlnaHQgLSAoeSArIGgpOworICAgICAgICAgICAgd2hpbGUgKGl0ICE9IGVuZCkgeworICAgICAgICAgICAgICAgIGNvbnN0IFJlY3QmIHIgPSAqaXQrKzsKKyAgICAgICAgICAgICAgICBjb25zdCBHTGludCBzeSA9IGZiSGVpZ2h0IC0gKHIudG9wICsgci5oZWlnaHQoKSk7CisgICAgICAgICAgICAgICAgZ2xTY2lzc29yKHIubGVmdCwgc3ksIHIud2lkdGgoKSwgci5oZWlnaHQoKSk7CisgICAgICAgICAgICAgICAgZ2xEcmF3VGV4aU9FUyh4LCB5LCAwLCB3LCBoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KZGlmZiAtLWdpdCBhL2xpYnMvc3VyZmFjZWZsaW5nZXIvTGF5ZXJCbHVyLmggYi9saWJzL3N1cmZhY2VmbGluZ2VyL0xheWVyQmx1ci5oCmluZGV4IDI0YjExNTYuLjBjM2U2ZWIgMTAwNjQ0Ci0tLSBhL2xpYnMvc3VyZmFjZWZsaW5nZXIvTGF5ZXJCbHVyLmgKKysrIGIvbGlicy9zdXJmYWNlZmxpbmdlci9MYXllckJsdXIuaApAQCAtMzksNyArMzksNyBAQAogICAgIHZpcnR1YWwgdWludDMyX3QgZ2V0VHlwZUluZm8oKSBjb25zdCB7IHJldHVybiB0eXBlSW5mbzsgfQogICAgIAogICAgICAgICAgICAgICAgIExheWVyQmx1cihTdXJmYWNlRmxpbmdlciogZmxpbmdlciwgRGlzcGxheUlEIGRpc3BsYXksCi0gICAgICAgICAgICAgICAgICAgICAgICBDbGllbnQqIGNsaWVudCwgaW50MzJfdCBpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPENsaWVudD4mIGNsaWVudCwgaW50MzJfdCBpKTsKICAgICAgICAgdmlydHVhbCB+T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TGF5ZXJCdWZmZXI6OnNlcnZlckRlc3Ryb3koKQoreworICAgIHNwPFNvdXJjZT4gc291cmNlKGNsZWFyU291cmNlKCkpOworICAgIGlmIChzb3VyY2UgIT0gMCkgeworICAgICAgICBzb3VyY2UtPmRlc3Ryb3koKTsKKyAgICB9Cit9CisKIC8qKgogICogVGhpcyBjcmVhdGVzIGEgImJ1ZmZlciIgc291cmNlIGZvciB0aGlzIHN1cmZhY2UKICAqLwpAQCAtMTg5LDg1ICsxOTAsNTIgQEAKIH0KIAogLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gTGF5ZXJCdWZmZXI6OlN1cmZhY2VCdWZmZXIKKy8vIExheWVyQnVmZmVyOjpTdXJmYWNlTGF5ZXJCdWZmZXIKIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAotTGF5ZXJCdWZmZXI6OlN1cmZhY2VCdWZmZXI6OlN1cmZhY2VCdWZmZXIoU3VyZmFjZUlEIGlkLCBMYXllckJ1ZmZlciogb3duZXIpCi06IExheWVyQmFzZUNsaWVudDo6U3VyZmFjZShpZCwgb3duZXItPmdldElkZW50aXR5KCkpLCBtT3duZXIob3duZXIpCitMYXllckJ1ZmZlcjo6U3VyZmFjZUxheWVyQnVmZmVyOjpTdXJmYWNlTGF5ZXJCdWZmZXIoY29uc3Qgc3A8U3VyZmFjZUZsaW5nZXI+JiBmbGluZ2VyLAorICAgICAgICBTdXJmYWNlSUQgaWQsIGNvbnN0IHNwPExheWVyQnVmZmVyPiYgb3duZXIpCisgICAgOiBMYXllckJhc2VDbGllbnQ6OlN1cmZhY2UoZmxpbmdlciwgaWQsIG93bmVyLT5nZXRJZGVudGl0eSgpLCBvd25lcikKIHsKIH0KIAotTGF5ZXJCdWZmZXI6OlN1cmZhY2VCdWZmZXI6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DEuMGY7Ci0gICAgICAgIGlmIChzcmNfaGVpZ2h0ID4gSCptaW4pICAgICAgICAgeXNjYWxlID0gMS4wZiAvIG1pbjsKLSAgICAgICAgZWxzZSBpZiAoc3JjX2hlaWdodCptYWcgPCBIKSAgICB5c2NhbGUgPSBtYWc7CisgICAgICAgICAgICBmbG9hdCB4c2NhbGUgPSAxLjBmOworICAgICAgICAgICAgaWYgKHNyY193aWR0aCA+IFcqbWluKSAgICAgICAgICB4c2NhbGUgPSAxLjBmIC8gbWluOworICAgICAgICAgICAgZWxzZSBpZiAoc3JjX3dpZHRoKm1hZyA8IFcpICAgICB4c2NhbGUgPSBtYWc7CiAKLSAgICAgICAgaWYgKFVOTElLRUxZKHhzY2FsZSE9MS4wZiB8fCB5c2NhbGUhPTEuMGYpKSB7Ci0gICAgICAgICAgICBpZiAoVU5MSUtFTFkobVRlbXBvcmFyeURlYWxlciA9PSAwKSkgewotICAgICAgICAgICAgICAgIC8vIGFsbG9jYXRlIGEgbWVtb3J5LWRlYWxlciBmb3IgdGhpcyB0aGUgZmlyc3QgdGltZQotICAgICAgICAgICAgICAgIG1UZW1wb3JhcnlEZWFsZXIgPSBtTGF5ZXIubUZsaW5nZXItPmdldFN1cmZhY2VIZWFwTWFuYWdlcigpCi0gICAgICAgICAgICAgICAgICAgIC0+Y3JlYXRlSGVhcChJU3VyZmFjZUNvbXBvc2VyOjplSGFyZHdhcmUpOwotICAgICAgICAgICAgICAgIG1UZW1wQml0bWFwLmluaXQobVRlbXBvcmFyeURlYWxlcik7CisgICAgICAgICAgICBmbG9hdCB5c2NhbGUgPSAxLjBmOworICAgICAgICAgICAgaWYgKHNyY19oZWlnaHQgPiBIKm1pbikgICAgICAgICB5c2NhbGUgPSAxLjBmIC8gbWluOworICAgICAgICAgICAgZWxzZSBpZiAoc3JjX2hlaWdodCptYWcgPCBIKSAgICB5c2NhbGUgPSBtYWc7CisKKyAgICAgICAgICAgIGlmIChVTkxJS0VMWSh4c2NhbGUhPTEuMGYgfHwgeXNjYWxlIT0xLjBmKSkgeworICAgICAgICAgICAgICAgIGNvbnN0IGludCB0bXBfdyA9IGZsb29yZihzcmNfd2lkdGggICogeHNjYWxlKTsKKyAgICAgICAgICAgICAgICBjb25zdCBpbnQgdG1wX2ggPSBmbG9vcmYoc3JjX2hlaWdodCAqIHlzY2FsZSk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKG1UZW1wQml0bWFwPT0wIHx8IAorICAgICAgICAgICAgICAgICAgICAgICAgbVRlbXBCaXRtYXAtPmdldFdpZHRoKCkgPCBzaXplX3QodG1wX3cpIHx8IAorICAgICAgICAgICAgICAgICAgICAgICAgbVRlbXBCaXRtYXAtPmdldEhlaWdodCgpIDwgc2l6ZV90KHRtcF9oKSkgeworICAgICAgICAgICAgICAgICAgICBtVGVtcEJpdG1hcC5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICBtVGVtcEJpdG1hcCA9IG5ldyBhbmRyb2lkOjpCdWZmZXIoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3csIHRtcF9oLCBzcmMuaW1nLmZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBCdWZmZXJBbGxvY2F0b3I6OlVTQUdFX0hXXzJEKTsKKyAgICAgICAgICAgICAgICAgICAgZXJyID0gbVRlbXBCaXRtYXAtPmluaXRDaGVjaygpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChMSUtFTFkoZXJyID09IE5PX0VSUk9SKSkgeworICAgICAgICAgICAgICAgICAgICBOYXRpdmVCdWZmZXIgdG1wOworICAgICAgICAgICAgICAgICAgICB0bXAuaW1nLncgPSB0bXBfdzsKKyAgICAgICAgICAgICAgICAgICAgdG1wLmltZy5oID0gdG1wX2g7CisgICAgICAgICAgICAgICAgICAgIHRtcC5pbWcuZm9ybWF0ID0gc3JjLmltZy5mb3JtYXQ7CisgICAgICAgICAgICAgICAgICAgIHRtcC5pbWcuaGFuZGxlID0gKG5hdGl2ZV9oYW5kbGVfdCopbVRlbXBCaXRtYXAtPmdldE5hdGl2ZUJ1ZmZlcigpLT5oYW5kbGU7CisgICAgICAgICAgICAgICAgICAgIHRtcC5jcm9wLmwgPSAwOworICAgICAgICAgICAgICAgICAgICB0bXAuY3JvcC50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgdG1wLmNyb3AuciA9IHRtcC5pbWcudzsKKyAgICAgICAgICAgICAgICAgICAgdG1wLmNyb3AuYiA9IHRtcC5pbWcuaDsKKworICAgICAgICAgICAgICAgICAgICByZWdpb25faXRlcmF0b3IgdG1wX2l0KFJlZ2lvbihSZWN0KHRtcC5jcm9wLnIsIHRtcC5jcm9wLmIpKSk7CisgICAgICAgICAgICAgICAgICAgIGNvcHliaXQtPnNldF9wYXJhbWV0ZXIoY29weWJpdCwgQ09QWUJJVF9UUkFOU0ZPUk0sIDApOworICAgICAgICAgICAgICAgICAgICBjb3B5Yml0LT5zZXRfcGFyYW1ldGVyKGNvcHliaXQsIENPUFlCSVRfUExBTkVfQUxQSEEsIDB4RkYpOworICAgICAgICAgICAgICAgICAgICBjb3B5Yml0LT5zZXRfcGFyYW1ldGVyKGNvcHliaXQsIENPUFlCSVRfRElUSEVSLCBDT1BZQklUX0RJU0FCTEUpOworICAgICAgICAgICAgICAgICAgICBlcnIgPSBjb3B5Yml0LT5zdHJldGNoKGNvcHliaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRtcC5pbWcsICZzcmMuaW1nLCAmdG1wLmNyb3AsICZzcmMuY3JvcCwgJnRtcF9pdCk7CisgICAgICAgICAgICAgICAgICAgIHNyYyA9IHRtcDsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGNvbnN0IGludCB0bXBfdyA9IGZsb29yZihzcmNfd2lkdGggICogeHNjYWxlKTsKLSAgICAgICAgICAgIGNvbnN0IGludCB0bXBfaCA9IGZsb29yZihzcmNfaGVpZ2h0ICogeXNjYWxlKTsKLSAgICAgICAgICAgIGVyciA9IG1UZW1wQml0bWFwLnNldEJpdHModG1wX3csIHRtcF9oLCAxLCBzcmMuaW1nLmZvcm1hdCk7CisgICAgICAgICAgICBjb25zdCBSZWN0IHRyYW5zZm9ybWVkQm91bmRzKG1MYXllci5nZXRUcmFuc2Zvcm1lZEJvdW5kcygpKTsKKyAgICAgICAgICAgIGNvbnN0IGNvcHliaXRfcmVjdF90JiBkcmVjdCA9CisgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCBjb3B5Yml0X3JlY3RfdCY+KHRyYW5zZm9ybWVkQm91bmRzKTsKKyAgICAgICAgICAgIGNvbnN0IFN0YXRlJiBzKG1MYXllci5kcmF3aW5nU3RhdGUoKSk7CisgICAgICAgICAgICByZWdpb25faXRlcmF0b3IgaXQoY2xpcCk7CiAKLSAgICAgICAgICAgIGlmIChMSUtFTFkoZXJyID09IE5PX0VSUk9SKSkgewotICAgICAgICAgICAgICAgIE5hdGl2ZUJ1ZmZlciB0bXA7Ci0gICAgICAgICAgICAgICAgbVRlbXBCaXRtYXAuZ2V0Qml0bWFwU3VyZmFjZSgmdG1wLmltZyk7Ci0gICAgICAgICAgICAgICAgdG1wLmNyb3AubCA9IDA7Ci0gICAgICAgICAgICAgICAgdG1wLmNyb3AudCA9IDA7Ci0gICAgICAgICAgICAgICAgdG1wLmNyb3AuciA9IHRtcC5pbWcudzsKLSAgICAgICAgICAgICAgICB0bXAuY3JvcC5iID0gdG1wLmltZy5oOwotCi0gICAgICAgICAgICAgICAgcmVnaW9uX2l0ZXJhdG9yIHRtcF9pdChSZWdpb24oUmVjdCh0bXAuY3JvcC5yLCB0bXAuY3JvcC5iKSkpOwotICAgICAgICAgICAgICAgIGNvcHliaXQtPnNldF9wYXJhbWV0ZXIoY29weWJpdCwgQ09QWUJJVF9UUkFOU0ZPUk0sIDApOwotICAgICAgICAgICAgICAgIGNvcHliaXQtPnNldF9wYXJhbWV0ZXIoY29weWJpdCwgQ09QWUJJVF9QTEFORV9BTFBIQSwgMHhGRik7Ci0gICAgICAgICAgICAgICAgY29weWJpdC0+c2V0X3BhcmFtZXRlcihjb3B5Yml0LCBDT1BZQklUX0RJVEhFUiwgQ09QWUJJVF9ESVNBQkxFKTsKLSAgICAgICAgICAgICAgICBlcnIgPSBjb3B5Yml0LT5zdHJldGNoKGNvcHliaXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAmdG1wLmltZywgJnNyYy5pbWcsICZ0bXAuY3JvcCwgJnNyYy5jcm9wLCAmdG1wX2l0KTsKLSAgICAgICAgICAgICAgICBzcmMgPSB0bXA7CisgICAgICAgICAgICAvLyBwaWNrIHRoZSByaWdodCBvcmllbnRhdGlvbiBmb3IgdGhpcyBidWZmZXIKKyAgICAgICAgICAgIGludCBvcmllbnRhdGlvbiA9IG1MYXllci5nZXRPcmllbnRhdGlvbigpOworICAgICAgICAgICAgaWYgKFVOTElLRUxZKG1CdWZmZXJIZWFwLnRyYW5zZm9ybSkpIHsKKyAgICAgICAgICAgICAgICBUcmFuc2Zvcm0gcm90OTA7CisgICAgICAgICAgICAgICAgR3JhcGhpY1BsYW5lOjpvcmllbnRhdGlvblRvVHJhbnNmcm9tKAorICAgICAgICAgICAgICAgICAgICAgICAgSVN1cmZhY2VDb21wb3Nlcjo6ZU9yaWVudGF0aW9uOTAsIDAsIDAsICZyb3Q5MCk7CisgICAgICAgICAgICAgICAgY29uc3QgVHJhbnNmb3JtJiBwbGFuZVRyYW5zZm9ybShtTGF5ZXIuZ3JhcGhpY1BsYW5lKDApLnRyYW5zZm9ybSgpKTsKKyAgICAgICAgICAgICAgICBjb25zdCBMYXllcjo6U3RhdGUmIHMobUxheWVyLmRyYXdpbmdTdGF0ZSgpKTsKKyAgICAgICAgICAgICAgICBUcmFuc2Zvcm0gdHIocGxhbmVUcmFuc2Zvcm0gKiBzLnRyYW5zZm9ybSAqIHJvdDkwKTsKKyAgICAgICAgICAgICAgICBvcmllbnRhdGlv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KKyAgICAgICAgICAgICAgICAgICAgJmRzdCwgJnNyYy5pbWcsICZkcmVjdCwgJnNyYy5jcm9wLCAmaXQpOworICAgICAgICAgICAgaWYgKGVyciAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIExPR0UoImNvcHliaXQgZmFpbGVkICglcykiLCBzdHJlcnJvcihlcnIpKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLQotICAgIGlmICghY2FuX3VzZV9jb3B5Yml0IHx8IGVycikgewotICAgICAgICBpZiAoVU5MSUtFTFkobVRleHR1cmVOYW1lID09IC0xTFUpKSB7Ci0gICAgICAgICAgICBtVGV4dHVyZU5hbWUgPSBtTGF5ZXIuY3JlYXRlVGV4dHVyZSgpOworI2VuZGlmCisgICAgCisgICAgaWYgKCFjb3B5Yml0IHx8IGVycikgCisgICAgeworICAgICAgICAvLyBPcGVuR0wgZmFsbC1iYWNrCisgICAgICAgIGlmIChVTkxJS0VMWShtVGV4dHVyZS5uYW1lID09IC0xTFUpKSB7CisgICAgICAgICAgICBtVGV4dHVyZS5uYW1lID0gbUxheWVyLmNyZWF0ZVRleHR1cmUoKTsKICAgICAgICAgfQogICAgICAgICBHTHVpbnQgdyA9IDA7CiAgICAgICAgIEdMdWludCBoID0gMDsKQEAgLTU0MSwxMCArNTQ3LDExIEBACiAgICAgICAgIHQuc3RyaWRlID0gc3JjLmltZy53OwogICAgICAgICB0LnZzdHJpZGU9IHNyYy5pbWcuaDsKICAgICAgICAgdC5mb3JtYXQgPSBzcmMuaW1nLmZvcm1hdDsKLSAgICAgICAgdC5kYXRhID0gKEdHTHVieXRlKikoaW50cHRyX3Qoc3JjLmltZy5iYXNlKSArIHNyYy5pbWcub2Zmc2V0KTsKKyAgICAgICAgdC5kYXRhID0gKEdHTHVieXRlKilzcmMuaW1nLmJhc2U7CiAgICAgICAgIGNvbnN0IFJlZ2lvbiBkaXJ0eShSZWN0KHQud2lkdGgsIHQuaGVpZ2h0KSk7Ci0gICAgICA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gICBtSW5pdGlhbGl6ZWQgPSB0cnVlOworICAgICAgICAgICAgY29uc3QgUmVjdCBib3VuZHMobUxheWVyLmdldFRyYW5zZm9ybWVkQm91bmRzKCkpOwogICAgICAgICAgICAgaW50IHggPSBib3VuZHMubGVmdDsKICAgICAgICAgICAgIGludCB5ID0gYm91bmRzLnRvcDsKICAgICAgICAgICAgIGludCB3ID0gYm91bmRzLndpZHRoKCk7CiAgICAgICAgICAgICBpbnQgaCA9IGJvdW5kcy5oZWlnaHQoKTsKICAgICAgICAgICAgIAogICAgICAgICAgICAgLy8gd2UgbmVlZCBhIGxvY2sgaGVyZSB0byBwcm90ZWN0ICJkZXN0cm95IgotICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKKyAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChtT3ZlcmxheVNvdXJjZUxvY2spOwogICAgICAgICAgICAgaWYgKG1PdmVybGF5KSB7CiAgICAgICAgICAgICAgICAgb3ZlcmxheV9jb250cm9sX2RldmljZV90KiBvdmVybGF5X2RldiA9IG1PdmVybGF5RGV2aWNlOwogICAgICAgICAgICAgICAgIG92ZXJsYXlfZGV2LT5zZXRQb3NpdGlvbihvdmVybGF5X2RldiwgbU92ZXJsYXksIHgseSx3LGgpOwotICAgICAgICAgICAgICAgIG92ZXJsYXlfZGV2LT5zZXRQYXJhbWV0ZXIob3ZlcmxheV9kZXYsIG1PdmVybGF5LCAKKyAgICAgICAgICAgICAgICBvdmVybGF5X2Rldi0+c2V0UGFyYW1ldGVyKG92ZXJsYXlfZGV2LCBtT3ZlcmxheSwKICAgICAgICAgICAgICAgICAgICAgICAgIE9WRVJMQVlfVFJBTlNGT1JNLCBtTGF5ZXIuZ2V0T3JpZW50YXRpb24oKSk7CisgICAgICAgICAgICAgICAgb3ZlcmxheV9kZXYtPmNvbW1pdChvdmVybGF5X2RldiwgbU92ZXJsYXkpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQ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JsZSBMYXllckJpdG1hcCBtVGVtcEJpdG1hcDsKLSAgICAgICAgbXV0YWJsZSBHTHVpbnQgIG1UZXh0dXJlTmFtZTsKKyAgICAgICAgbXV0YWJsZSBNdXRleCAgICAgICAgICAgICAgICAgICBtQnVmZmVyU291cmNlTG9jazsKKyAgICAgICAgc3A8QnVmZmVyPiAgICAgICAgICAgICAgICAgICAgICBtQnVmZmVyOworICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgICAgICAgICAgICAgIG1TdGF0dXM7CisgICAgICAgIElTdXJmYWNlOjpCdWZmZXJIZWFwICAgICAgICAgICAgbUJ1ZmZlckhlYXA7CisgICAgICAgIHNpemVfdCAgICAgICAgICAgICAgICAgICAgICAgICAgbUJ1ZmZlclNpemU7CisgICAgICAgIG11dGFibGUgc3A8YW5kcm9pZDo6QnVmZmVyPiAgICAgbVRlbXBCaXRtYXA7CisgICAgICAgIG11dGFibGUgTGF5ZXJCYXNlOjpUZXh0dXJlICAgICAgbVRleHR1cmU7CisgICAgICAgIGNvcHliaXRfZGV2aWNlX3QqICAgICAgICAgICAgICAgbUJsaXRFbmdpbmU7CiAgICAgfTsKICAgICAKICAgICBjbGFzcyBPdmVybGF5U291cmNlIDogcHVibGljIFNvdXJjZSB7CkBAIC0xMzcsMzAgKzE0NCwyNiBAQAogICAgICAgICAgICAgICAgIHNwPE92ZXJsYXlSZWY+KiBvdmVybGF5UmVmLCAKICAgICAgICAgICAgICAgICB1aW50MzJfdCB3LCB1aW50MzJfdCBoLCBpbnQzMl90IGZvcm1hdCk7CiAgICAgICAgIHZpcnR1YWwgfk92ZXJsYXlTb3VyY2UoKTsKKyAgICAgICAgdmlydHVhbCB2b2lkIG9uRHJhdyhjb25zdCBSZWdpb24mIGNsaXApIGNvbnN0OwogICAgICAgICB2aXJ0dWFsIHZvaWQgb25UcmFuc2FjdGlvbih1aW50MzJfdCBmbGFncyk7CiAgICAgICAgIHZpcnR1YWwgdm9pZCBvblZpc2liaWxpdHlSZXNvbHZlZChjb25zdCBUcmFuc2Zvcm0mIHBsYW5lVHJhbnNmb3JtKTsKKyAgICAgICAgdmlydHVhbCB2b2lkIGRlc3Ryb3koKTsKICAgICBwcml2YXRlOgotICAgICAgICB2b2lkIHNlcnZlckRlc3Ryb3koKTsgCi0gICAgICAgIHZvaWQgZGVzdHJveU92ZXJsYXkoKTsgCisKICAgICAgICAgY2xhc3MgT3ZlcmxheUNoYW5uZWwgOiBwdWJsaWMgQm5PdmVybGF5IHsKLSAgICAgICAgICAgIG11dGFibGUgTXV0ZXggbUxvY2s7Ci0gICAgICAgICAgICBzcDxPdmVybGF5U291cmNlPiBtU291cmNlOworICAgICAgICAgICAgd3A8TGF5ZXJCdWZmZXI+IG1MYXllcjsKICAgICAgICAgICAgIHZpcnR1YWwgdm9pZCBkZXN0cm95KCkgewotICAgICAgICAgICAgICAgIHNwPE92ZXJsYXlTb3VyY2U+IHNvdXJjZTsKLSAgICAgICAgICAgICAgICB7IC8vIHNjb3BlIGZvciB0aGUgbG9jazsKLSAgICAgICAgICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKLSAgICAgICAgICAgICAgICAgICAgc291cmNlID0gbVNvdXJjZTsKLSAgICAgICAgICAgICAgICAgICAgbVNvdXJjZS5jbGVhcigpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoc291cmNlICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgc291cmNlLT5zZXJ2ZXJEZXN0cm95KCk7CisgICAgICAgICAgICAgICAgc3A8TGF5ZXJCdWZmZXI+IGxheWVyKG1MYXllci5wcm9tb3RlKCkpOworICAgICAgICAgICAgICAgIGlmIChsYXllciAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGxheWVyLT5zZXJ2ZXJEZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICBwdWJsaWM6Ci0gICAgICAgICAgICBPdmVybGF5Q2hhbm5lbChjb25zdCBzcDxPdmVybGF5U291cmNlPiYgc291cmNlKQotICAgICAgICAgICAgICAgIDogbVNvdXJjZShzb3VyY2UpIHsKKyAgICAgICAgICAgIE92ZXJsYXlDaGFubmVsKGNvbnN0IHNwPExheWVyQnVmZmVyPiYgbGF5ZXIpCisgICAgICAgICAgICAgICAgOiBtTGF5ZXIobGF5ZXIpIHsKICAgICAgICAgICAgIH0KICAgICAgICAgfTsKKyAgICAgICAgCiAgICAgICAgIGZyaWVuZCBjbGFzcyBPdmVybGF5Q2hhbm5lbDsKICAgICAgICAgYm9vbCBtVmlzaWJpbGl0eUNoYW5nZWQ7CiAKQEAgLTE3Miw0MSArMTc1LDM1IEBACiAgICAgICAgIGludDMyX3QgbUZvcm1hdDsKICAgICAgICAgaW50MzJfdCBtV2lkdGhTdHJpZGU7CiAgICAgICAgIGludDMyX3QgbUhlaWdodFN0cmlkZTsKLSAgICAgICAgbXV0YWJsZSBNdXRleCBtTG9jazsKKyAgICAgICAgbXV0YWJsZSBNdXRleCBtT3ZlcmxheVNvdXJjZUxvY2s7CisgICAgICAgIGJvb2wgbUluaXRpYWxpemVkOwogICAgIH07CiAKIAotICAgIGNsYXNzIFN1cmZhY2VCdWZmZXIgOiBwdWJsaWMgTGF5ZXJCYXNlQ2xpZW50OjpTdXJmYWNlCisgICAgY2xhc3MgU3VyZmFjZUxheWVyQnVmZmVyIDogcHVibGljIExheWVyQmFzZUNsaWVudDo6U3VyZmFjZQogICAgIHsKICAgICBwdWJsaWM6Ci0gICAgICAgICAgICAgICAgU3VyZmFjZUJ1ZmZlcihTdXJmYWNlSUQgaWQsIExheWVyQnVmZmVyKiBvd25lcik7Ci0gICAgICAgIHZpcnR1YWwgflN1cmZhY2VCdWZmZXIoKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBvblRyYW5zYWN0KAotICAgICAgICAgICAgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLCBQYXJjZWwqIHJlcGx5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isgICAgOiBMYXllckJhc2VDbGllbnQoZmxpbmdlciwgZGlzcGxheSwgY2xpZW50LCBpKQogewogfQogCiB2b2lkIExheWVyRGltOjppbml0RGltbWVyKFN1cmZhY2VGbGluZ2VyKiBmbGluZ2VyLCB1aW50MzJfdCB3LCB1aW50MzJfdCBoKQogewotICAgIC8vIG11c3Qgb25seSBiZSBjYWxsZWQgb25jZS4KLSAgICBtRGltbWVyRGVhbGVyID0gZmxpbmdlci0+Z2V0U3VyZmFjZUhlYXBNYW5hZ2VyKCkKLSAgICAgICAgICAgIC0+Y3JlYXRlSGVhcChJU3VyZmFjZUNvbXBvc2VyOjplSGFyZHdhcmUpOwotICAgIGlmIChtRGltbWVyRGVhbGVyICE9IDApIHsKLSAgICAgICAgbURpbW1lckJpdG1hcC5pbml0KG1EaW1tZXJEZWFsZXIpOwotICAgICAgICBtRGltbWVyQml0bWFwLnNldEJpdHModywgaCwgMSwgUElYRUxfRk9STUFUX1JHQl81NjUpOwotICAgICAgICBtRGltbWVyQml0bWFwLmNsZWFyKCk7CisgICAgc1RleElkID0gLTE7CisgICAgc0ltYWdlID0gRUdMX05PX0lNQUdFX0tIUjsKKyAgICBzV2lkdGggPSB3OworICAgIHNIZWlnaHQgPSBoOworICAgIHNVc2VUZXh0dXJlID0gZmFsc2U7CisgICAgCisjaWZkZWYgRElNX1dJVEhfVEVYVFVSRQorICAgIAorI3dhcm5pbmcgInVzaW5nIGEgdGV4dHVyZSB0byBpbXBsZW1lbnQgTGF5ZXJEaW0iCisgICAgCisgICAgLyogT24gc29tZSBoL3cgbGlrZSBtc203SywgaXQgaXMgZmFzdGVyIHRvIHVzZSBhIHRleHR1cmUgYmVjYXVzZSB0aGUKKyAgICAgKiBzb2Z0d2FyZSByZW5kZXJlciB3aWxsIGRlZmVyIHRvIGNvcHliaXQsIGZvciB0aGlzIHRvIHdvcmsgd2UgbmVlZCB0bworICAgICAqIHVzZSBhbiBFR0xJbWFnZSB0ZXh0dXJlIHNvIGNvcHlia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X3QqIGNvcHliaXQgPSBtRmxpbmdlci0+Z2V0QmxpdEVuZ2luZSgpOwotICAgICAgICAgICAgY29weWJpdC0+c2V0X3BhcmFtZXRlcihjb3B5Yml0LCBDT1BZQklUX1RSQU5TRk9STSwgMCk7Ci0gICAgICAgICAgICBjb3B5Yml0LT5zZXRfcGFyYW1ldGVyKGNvcHliaXQsIENPUFlCSVRfUExBTkVfQUxQSEEsIHMuYWxwaGEpOwotICAgICAgICAgICAgY29weWJpdC0+c2V0X3BhcmFtZXRlcihjb3B5Yml0LCBDT1BZQklUX0RJVEhFUiwgQ09QWUJJVF9FTkFCTEUpOwotICAgICAgICAgICAgcmVnaW9uX2l0ZXJhdG9yIGl0KGNsaXApOwotICAgICAgICAgICAgZXJyID0gY29weWJpdC0+c3RyZXRjaChjb3B5Yml0LCAmZHN0LCAmc3JjLCAmZHJlY3QsICZzcmVjdCwgJml0KTsKKyAgICAgICAgY29uc3QgR0dMZml4ZWQgYWxwaGEgPSAocy5hbHBoYSA8PCAxNikvMjU1OworICAgICAgICBjb25zdCB1aW50MzJfdCBmYkhlaWdodCA9IGh3LmdldEhlaWdodCgpOworICAgICAgICBnbERpc2FibGUoR0xfRElUSEVSKTsKKyAgICAgICAgZ2xFbmFibGUoR0xfQkxFTkQpOworICAgICAgICBnbEJsZW5kRnVuYyhHTF9PTkUsIEdMX09ORV9NSU5VU19TUkNfQUxQSEEpOworICAgICAgICBnbENvbG9yNHgoMCwgMCwgMCwgYWxwaGEpOworICAgICAgICAKKyNpZmRlZiBESU1fV0lUSF9URVhUVVJFCisgICAgICAgIGlmIChzVXNlVGV4dHVyZSkgeworICAgICAgICAgICAgZ2xCaW5kVGV4dHVyZShHTF9URVhUVVJFXzJELCBzVGV4SWQpOworICAgICAgICAgICAgZ2xFbmFibGUoR0xfVEVYVFVSRV8yRCk7CisgICAgICAgICAgICBnbFRleEVudngoR0xfVEVYVFVSRV9FTlYsIEdMX1RFWFRVUkVfRU5WX01PREUsIEdMX1JFUExBQ0UpOworICAgICAgICAgICAgY29uc3QgR0xzaG9ydCB0ZXhDb29yZHNbNF1bMl0gPSB7CisgICAgICAgICAgICAgICAgICAgIHsgMCwgIDAgfSwKKyAgICAgICAgICAgICAgICAgICAgeyAwLCAgMSB9LAorICAgICAgICAgICAgICAgICAgICB7IDEsICAxIH0sCisgICAgICAgICAgICAgICAgICAgIHsgMSwgIDAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGdsTWF0cml4TW9kZShHTF9URVhUVVJFKTsKKyAgICAgICAgICAgIGdsTG9hZElkZW50aXR5KCk7CisgICAgICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX1RFWFRVUkVfQ09PUkRfQVJSQVkpOworICAgICAgICAgICAgZ2xUZXhDb29yZFBvaW50ZXIoMiwgR0xfU0hPUlQsIDAsIHRleENvb3Jkcyk7CisgICAgICAgIH0gZWxzZQorI2VuZGlmCisgICAgICAgIHsKKyAgICAgICAgICAgIGdsRGlzYWJsZShHTF9URVhUVVJFXzJEKTsKICAgICAgICAgfQogCi0gICAgICAgIGlmICghY2FuX3VzZV9jb3B5Yml0IHx8IGVycikgewotICAgICAgICAgICAgY29uc3QgR0dMZml4ZWQgYWxwaGEgPSAocy5hbHBoYSA8PCAxNikvMjU1OwotICAgICAgICAgICAgY29uc3QgdWludDMyX3QgZmJIZWlnaHQgPSBody5nZXRIZWlnaHQoKTsKLSAgICAgICAgICAgIGdsRGlzYWJsZShHTF9URVhUVVJFXzJEKTsKLSAgICAgICAgICAgIGdsRGlzYWJsZShHTF9ESVRIRVIpOwotICAgICAgICAgICAgZ2xFbmFibGUoR0xfQkxFTkQpOwotICAgICAgICAgICAgZ2xCbGVuZEZ1bmMoR0xfT05FLCBHTF9PTkVfTUlOVVNfU1JDX0FMUEhBKTsKLSAgICAgICAgICAgIGdsQ29sb3I0eCgwLCAwLCAwLCBhbHBoYSk7Ci0gICAgICAgICAgICBnbFZlcnRleFBvaW50ZXIoMiwgR0xfRklYRUQsIDAsIG1WZXJ0aWNlcyk7Ci0gICAgICAgICAgICBSZWN0IHI7Ci0gICAgICAgICAgICB3aGlsZSAoaXRlcmF0b3IuaXRlcmF0ZSgmcikpIHsKLSAgICAgICAgICAgICAgICBjb25zdCBHTGludCBzeSA9IGZiSGVpZ2h0IC0gKHIudG9wICsgci5oZWlnaHQoKSk7Ci0gICAgICAgICAgICAgICAgZ2xTY2lzc29yKHIubGVmdCwgc3ksIHIud2lkdGgoKSwgci5oZWlnaHQoKSk7Ci0gICAgICAgICAgICAgICAgZ2xEcmF3QXJyYXlzKEdMX1RSSUFOR0xFX0ZBTiwgMCwgNCk7IAotICAgICAgICAgICAgfQorICAgICAgICBHTHNob3J0IHcgPSBzV2lkdGg7CisgICAgICAgIEdMc2hvcnQgaCA9IHNIZWlnaHQ7CisgICAgICAgIGNvbnN0IEdMc2hvcnQgdmVydGljZXNbNF1bMl0gPSB7CisgICAgICAgICAgICAgICAgeyAwLCAwIH0sCisgICAgICAgICAgICAgICAgeyAwLCBoIH0sCisgICAgICAgICAgICAgICAgeyB3LCBoIH0sCisgICAgICAgICAgICAgICAgeyB3LCAwIH0KKyAgICAgICAgfTsKKyAgICAgICAgZ2xWZXJ0ZXhQb2ludGVyKDIsIEdMX1NIT1JULCAwLCB2ZXJ0aWNlcyk7CisKKyAgICAgICAgd2hpbGUgKGl0ICE9IGVuZCkgeworICAgICAgICAgICAgY29uc3QgUmVjdCYgciA9ICppdCsrOworICAgICAgICAgICAgY29uc3QgR0xpbnQgc3kgPSBmYkhlaWdodCAtIChyLnRvcCArIHIuaGVpZ2h0KCkpOworICAgICAgICAgICAgZ2xTY2lzc29yKHIubGVmdCwgc3ksIHIud2lkdGgoKSwgci5oZWlnaHQoKSk7CisgICAgICAgICAgICBnbERyYXdBcnJheXMoR0xfVFJJQU5HTEVfRkFOLCAwLCA0KTsgCiAgICAgICAgIH0KICAgICB9CisgICAgZ2xEaXNhYmxlQ2xpZW50U3RhdGUoR0xfVEVYVFVSRV9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2hlbiA9IG5vdzsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBtSW52YWxpZGF0ZU1lc3NhZ2U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIExJU1Q6Oml0ZXJhdG9yIGN1cihtTWVzc2FnZXMuYmVnaW4oKSk7CisgICAgICAgICAgICBpZiAoY3VyICE9IG1NZXNzYWdlcy5lbmQoKSkgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9ICpjdXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChyZXN1bHQtPndoZW4gPD0gbm93KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRoZXJlIGlzIGEgbWVzc2FnZSB0byBkZWxpdmVyCisgICAgICAgICAgICAgICAgICAgIG1NZXNzYWdlcy5yZW1vdmUoY3VyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICh0aW1lb3V0Pj0wICYmIHRpbWVvdXRUaW1lIDwgbm93KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHdlIHRpbWVkLW91dCwgcmV0dXJuIGEgTlVMTCBtZXNzYWdlCisgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IDA7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBuZXh0RXZlbnRUaW1lID0gcmVzdWx0LT53aGVuOworICAgICAgICAgICAgICAgIHJlc3VsdCA9IDA7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh0aW1lb3V0ID49IDAgJiYgbmV4dEV2ZW50VGltZSA+IDApIHsKKyAgICAgICAgICAgICAgICBpZiAobmV4dEV2ZW50VGltZSA+IHRpbWVvdXRUaW1lKSB7CisgICAgICAgICAgICAgICAgICAgIG5leHRFdmVudFRpbWUgPSB0aW1lb3V0VGltZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChuZXh0RXZlbnRUaW1lID49IDApIHsKKyAgICAgICAgICAgICAgICAvL0xPR0QoIm5leHRFdmVudFRpbWUgPSAlbGxkIG1zIiwgbmV4dEV2ZW50VGltZSk7CisgICAgICAgICAgICAgICAgaWYgKG5leHRFdmVudFRpbWUgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIGFib3V0IHRvIHdhaXQsIGZsdXNoIHRoZSBiaW5kZXIgY29tbWFuZCBidWZmZXIKKyAgICAgICAgICAgICAgICAgICAgSVBDVGhyZWFkU3RhdGU6OnNlbGYoKS0+Zmx1c2hDb21tYW5kcygpOworICAgICAgICAgICAgICAgICAgICBjb25zdCBuc2Vjc190IHJlbHRpbWUgPSBuZXh0RXZlbnRUaW1lIC0gc3lzdGVtVGltZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAocmVsdGltZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db25kaXRpb24ud2FpdFJlbGF0aXZlKG1Mb2NrLCByZWx0aW1lKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy9MT0dEKCJnb2luZyB0byB3YWl0Iik7CisgICAgICAgICAgICAgICAgLy8gd2UncmUgYWJvdXQgdG8gd2FpdCwgZmx1c2ggdGhlIGJpbmRlciBjb21tYW5kIGJ1ZmZlcgorICAgICAgICAgICAgICAgIElQQ1RocmVhZFN0YXRlOjpzZWxmKCktPmZsdXNoQ29tbWFuZHMoKTsKKyAgICAgICAgICAgICAgICBtQ29uZGl0aW9uLndhaXQobUxvY2spOworICAgICAgICAgICAgfQorICAgICAgICB9IAorICAgICAgICAvLyBoZXJlIHdlJ3JlIG5vdCBob2xkaW5nIHRoZ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0b3I6OmFkZCgKLSAgICAgICAgTGF5ZXJCYXNlKiBsYXllciwKLSAgICAgICAgVmVjdG9yPExheWVyQmFzZSo+Ojpjb21wYXJfdCBjbXApCisgICAgICAgIGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyLAorICAgICAgICBWZWN0b3I8IHNwPExheWVyQmFzZT4gPjo6Y29tcGFyX3QgY21wKQogewogICAgIHNpemVfdCBjb3VudCA9IGxheWVycy5zaXplKCk7CiAgICAgc3NpemVfdCBsID0gMDsKICAgICBzc2l6ZV90IGggPSBjb3VudC0xOwogICAgIHNzaXplX3QgbWlkOwotICAgIExheWVyQmFzZSogY29uc3QqIGEgPSBsYXllcnMuYXJyYXkoKTsKKyAgICBzcDxMYXllckJhc2U+IGNvbnN0KiBhID0gbGF5ZXJzLmFycmF5KCk7CiAgICAgd2hpbGUgKGwgPD0gaCkgewogICAgICAgICBtaWQgPSBsICsgKGggLSBsKS8yOwogICAgICAgICBjb25zdCBpbnQgYyA9IGNtcChhK21pZCwgJmxheWVyKTsKQEAgLTEzOSwxNCArMTMyLDE0IEBACiAgICAgcmV0dXJuIG9yZGVyOwogfQogCi1zc2l6ZV90IFN1cmZhY2VGbGluZ2VyOjpMYXllclZlY3Rvcjo6cmVtb3ZlKExheWVyQmFzZSogbGF5ZXIpCitzc2l6ZV90IFN1cmZhY2VGbGluZ2VyOjpMYXllclZlY3Rvcjo6cmVtb3ZlKGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyKQogewogICAgIGNvbnN0IHNzaXplX3Qga2V5SW5kZXggPSBsb29rdXAuaW5kZXhPZktleShsYXllcik7CiAgICAgaWYgKGtleUluZGV4ID49IDApIHsKICAgICAgICAgY29uc3Qgc2l6ZV90IGluZGV4ID0gbG9va3VwLnZhbHVlQXQoa2V5SW5kZXgpOwotICAgICAgICBMT0dfQVNTRVJUKGxheWVyc1tpbmRleF09PWxheWVyLAorICAgICAgICBMT0dFX0lGKGxheWVyc1tpbmRleF0hPWxheWVyLAogICAgICAgICAgICAgICAgICJMYXllclZlY3RvclslcF06IGxheWVyc1sldV09JXAsIGxheWVyPSVwIiwKLSAgICAgICAgICAgICAgICB0aGlzLCBpbnQoaW5kZXgpLCBsYXllcnNbaW5kZXhdLCBsYXllcik7CisgICAgICAgICAgICAgICAgdGhpcywgaW50KGluZGV4KSwgbGF5ZXJzW2luZGV4XS5nZXQoKSwgbGF5ZXIuZ2V0KCkpOwogICAgICAgICBsYXllcnMucmVtb3ZlSXRlbXNBdChpbmRleCk7CiAgICAgICAgIGxvb2t1cC5yZW1vdmVJdGVtc0F0KGtleUluZGV4KTsKICAgICAgICAgY29uc3Qgc2l6ZV90IGNvdW50ID0gbG9va3VwLnNpemUoKTsKQEAgLTE2MSw4ICsxNTQsOCBAQAogfQogCiBzc2l6ZV90IFN1cmZhY2VGbGluZ2VyOjpMYXllclZlY3Rvcjo6cmVvcmRlcigKLSAgICAgICAgTGF5ZXJCYXNlKiBsYXllciwKLSAgICAgICAgVmVjdG9yPExheWVyQmFzZSo+Ojpjb21wYXJfdCBjbXApCisgICAgICAgIGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyLAorICAgICAgICBWZWN0b3I8IHNwPExheWVyQmFzZT4gPjo6Y29tcGFyX3QgY21wKQogewogICAgIC8vIFhYWDogaXQncyBhIGxpdHRsZSBsYW1lLiBidXQgb2ggd2VsbC4uLgogICAgIHNzaXplX3QgZXJyID0gcmVtb3ZlKGxheWVyKTsKQEAgLTE4MCwxOSArMTczLDIzIEBACiAgICAgOiAgIEJuU3VyZmFjZUNvbXBvc2VyKCksIFRocmVhZChmYWxzZSksCiAgICAgICAgIG1UcmFuc2FjdGlvbkZsYWdzKDApLAogICAgICAgICBtVHJhbnNhY3Rpb25Db3VudCgwKSwKKyAgICAgICAgbVJlc2l6ZVRyYW5zYXRpb25QZW5kaW5nKGZhbHNlKSwKKyAgICAgICAgbUxheWVyc1JlbW92ZWQoZmFsc2UpLAogICAgICAgICBtQm9vdFRpbWUoc3l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WVudHNNYXAudmFsdWVGb3IoY2lkKTsKLSAgICBpZiAoY2xpZW50KSB7CisgICAgc3A8Q2xpZW50PiBjbGllbnQgPSBtQ2xpZW50c01hcC52YWx1ZUZvcihjaWQpOworICAgIGlmIChjbGllbnQgIT0gMCkgewogICAgICAgICAvLyBmcmVlIGFsbCB0aGUgbGF5ZXJzIHRoaXMgY2xpZW50IG93bnMKLSAgICAgICAgY29uc3QgVmVjdG9yPExheWVyQmFzZUNsaWVudCo+JiBsYXllcnMgPSBjbGllbnQtPmdldExheWVycygpOworICAgICAgICBWZWN0b3I8IHdwPExheWVyQmFzZUNsaWVudD4gPiBsYXllcnMoY2xpZW50LT5nZXRMYXllcnMoKSk7CiAgICAgICAgIGNvbnN0IHNpemVfdCBjb3VudCA9IGxheWVycy5zaXplKCk7CiAgICAgICAgIGZvciAoc2l6ZV90IGk9MCA7IGk8Y291bnQgOyBpKyspIHsKLSAgICAgICAgICAgIExheWVyQmFzZUNsaWVudCogY29uc3QgbGF5ZXIgPSBsYXllcnNbaV07Ci0gICAgICAgICAgICByZW1vdmVMYXllcl9sKGxheWVyKTsKKyAgICAgICAgICAgIHNwPExheWVyQmFzZUNsaWVudD4gbGF5ZXIobGF5ZXJzW2ldLnByb21vdGUoKSk7CisgICAgICAgICAgICBpZiAobGF5ZXIgIT0gMCkgeworICAgICAgICAgICAgICAgIHB1cmdhdG9yaXplTGF5ZXJfbChsYXllcik7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICAvLyB0aGUgcmVzb3VyY2VzIGFzc29jaWF0ZWQgd2l0aCB0aGlzIGNsaWVudCB3aWxsIGJlIGZyZWVkCkBAIC0zMzksNDEgKzMwNSwxNSBAQAogICAgIG1SZWFkeVRvUnVuQmFycmllci53YWl0KCk7CiB9CiAKLQogc3RhdGljIGlubGluZSB1aW50MTZfdCBwYWNrNTY1KGludCByLCBpbnQgZywgaW50IGIpIHsKICAgICByZXR1cm4gKHI8PDExKXwoZzw8NSl8Yjs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VEaXNwbGF5VGltZW91dCA9IG1zMm5zKDUwMDApOwotICAgICAgICBjb25zdCBuc2Vjc190IG5vdyA9IHN5c3RlbVRpbWUoKTsKLSAgICAgICAgaWYgKG1GcmVlemVEaXNwbGF5VGltZSA9PSAwKSB7Ci0gICAgICAgICAgICBtRnJlZXplRGlzcGxheVRpbWUgPSBub3c7CisgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgbnNlY3NfdCB0aW1lb3V0ID0gLTE7CisgICAgICAgIGlmIChVTkxJS0VMWShpc0Zyb3plbigpKSkgeworICAgICAgICAgICAgLy8gd2FpdCA1IHNlY29uZHMKKyAgICAgICAgICAgIGNvbnN0IG5zZWNzX3QgZnJlZXplRGlzcGxheVRpbWVvdXQgPSBtczJucyg1MDAwKTsKKyAgICAgICAgICAgIGNvbnN0IG5zZWNzX3Qgbm93ID0gc3lzdGVtVGltZSgpOworICAgICAgICAgICAgaWYgKG1GcmVlemVEaXNwbGF5VGltZSA9PSAwKSB7CisgICAgICAgICAgICAgICAgbUZyZWV6ZURpc3BsYXlUaW1lID0gbm93OworICAgICAgICAgICAgfQorICAgICAgICAgICAgbnNlY3NfdCB3YWl0VGltZSA9IGZyZWV6ZURpc3BsYXlUaW1lb3V0IC0gKG5vdyAtIG1GcmVlemVEaXNwbGF5VGltZSk7CisgICAgICAgICAgICB0aW1lb3V0ID0gd2FpdFRpbWU+MCA/IHdhaXRUaW1lIDogMDsKICAgICAgICAgfQotICAgICAgICBuc2Vjc190IHdhaXRUaW1lID0gZnJlZXplRGlzcGxheVRpbWVvdXQgLSAobm93IC0gbUZyZWV6ZURpc3BsYXlUaW1lKTsKLSAgICAgICAgaW50IGVyciA9ICh3YWl0VGltZSA+IDApID8gbVN5bmNPYmplY3Qud2FpdCh3YWl0VGltZSkgOiBUSU1FRF9PVVQ7Ci0gICAgICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIHsKKworICAgICAgICBNZXNzYWdlTGlzdDo6dmFsdWVfdHlwZSBtc2cgPSBtRXZlbnRRdWV1ZS53YWl0TWVzc2FnZSh0aW1lb3V0KTsKKyAgICAgICAgaWYgKG1zZyAhPSAwKSB7CisgICAgICAgICAgICBtRnJlZXplRGlzcGxheVRpbWUgPSAwOworICAgICAgICAgICAgc3dpdGNoIChtc2ctPndoYXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIE1lc3NhZ2VRdWV1ZTo6SU5WQUxJREFURToKKyAgICAgICAgICAgICAgICAgICAgLy8gaW52YWxpZGF0ZSBtZXNzYWdlLCBqdXN0IHJldHVybiB0byB0aGUgbWFpbiBsb29wCisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIHdlIHRpbWVkIG91dAogICAgICAgICAgICAgaWYgKGlzRnJvemVuKCkpIHsKICAgICAgICAgICAgICAgICAvLyB3ZSB0aW1lZCBvdXQgYW5kIGFyZSBzdGlsbCBmcm96ZW4KICAgICAgICAgICAgICAgICBMT0dXKCJ0aW1lb3V0IGV4cGlyZWQgbUZyZWV6ZURpc3BsYXk9JWQsIG1GcmVlemVDb3VudD0lZCIsCiAgICAgICAgICAgICAgICAgICAgICAgICBtRnJlZXplRGlzcGxheSwgbUZyZWV6ZUNvdW50KTsKICAgICAgICAgICAgICAgICBtRnJlZXplQ291bnQgPSAwOwogICAgICAgICAgICAgICAgIG1GcmVlemVEaXNwbGF5ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgbUZyZWV6ZURpc3BsYXlUaW1lID0gMDsKLSAgICAgICAgbVN5bmNPYmplY3Qud2FpdCgpOwogICAgIH0KIH0KIAogdm9pZCBTdXJmYWNlRmxpbmdlcjo6c2lnbmFsRXZlbnQoKSB7Ci0gICAgbVN5bmNPYmplY3Qub3BlbigpOworICAgIG1FdmVudFF1ZXVlLmludmFs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YWN0aW9uRmxhZ3MoZVRyYW5zYWN0aW9uTmVlZGVkKTsKICAgICAgICAgICAgIGlmICghdHJGbGFncykgY29udGludWU7CiAKQEAgLTY4MSw3ICs2MzksNiBAQAogICAgICAgICAgICAgbVZpc2libGVSZWdpb25zRGlydHkgPSB0cnVlOwogICAgICAgICAgICAgbURpcnR5UmVnaW9uLnNldChody5ib3VuZHMoKSk7CiAgICAgICAgICAgICBtRnJlZXplRGlzcGxheVRpbWUgPSAwOwotICAgICAgICAgICAgbU9yaWVudGF0aW9uQW5pbWF0aW9uLT5vbk9yaWVudGF0aW9uQ2hhbmdlZCh0eXBlKTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChtQ3VycmVudFN0YXRlLmZyZWV6ZURpc3BsYXkgIT0gbURyYXdpbmdTdGF0ZS5mcmVlemVEaXNwbGF5KSB7CkBAIC02ODksMjQgKzY0NiwyNyBAQAogICAgICAgICAgICAgbUZyZWV6ZURpc3BsYXkgPSBtQ3VycmVudFN0YXRlLmZyZWV6ZURpc3BsYXk7CiAgICAgICAgIH0KIAotICAgICAgICAvLyBzb21lIGxheWVycyBtaWdodCBoYXZlIGJlZW4gcmVtb3ZlZCwgc28KLSAgICAgICAgLy8gd2UgbmVlZCB0byB1cGRhdGUgdGhlIHJlZ2lvbnMgdGhleSdyZSBleHBvc2luZy4KLSAgICAgICAgY29uc3QgU29ydGVkVmVjdG9yPExheWVyQmFzZSo+JiByZW1vdmVkTGF5ZXJzKG1SZW1vdmVkTGF5ZXJzKTsKLSAgICAgICAgc2l6ZV90IGMgPSByZW1vdmVkTGF5ZXJzLnNpemUoKTsKLSAgICAgICAgaWYgKGMpIHsKLSAgICAgICAgICAgIG1WaXNpYmxlUmVnaW9uc0RpcnR5ID0gdHJ1ZTsKLSAgICAgICAgICAgIHdoaWxlIChjLS0pIHsKLSAgICAgICAgICAgICAgICBtRGlydHlSZWdpb25SZW1vdmVkTGF5ZXIub3JTZWxmKAotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlZExheWVyc1tjXS0+dmlzaWJsZVJlZ2lvblNjcmVlbik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBjb25zdCBMYXllclZlY3RvciYgY3VycmVudExheWVycyA9IG1DdXJyZW50U3RhdGUubGF5ZXJzU29ydGVkQnlaOwogICAgICAgICBpZiAoY3VycmVudExheWVycy5zaXplKCkgPiBtRHJhd2luZ1N0YXRlLmxheWVyc1NvcnRlZEJ5Wi5zaXplKCkpIHsKICAgICAgICAgICAgIC8vIGxheWVycyBoYXZlIGJlZW4gYWRkZWQKICAgICAgICAgICAgIG1WaXNpYmxlUmVnaW9uc0RpcnR5ID0gdHJ1ZTsKICAgICAgICAgfQogCisgICAgICAgIC8vIHNvbWUgbGF5ZXJzIG1pZ2h0IGhhdmUgYmVlbiByZW1vdmVkLCBzbworICAgICAgICAvLyB3ZSBuZWVkIHRvIHVwZGF0ZSB0aGUgcmVnaW9ucyB0aGV5J3JlIGV4cG9zaW5nLgorICAgICAgICBpZiAobUxheWVyc1JlbW92ZWQpIHsKKyAgICAgICAgICAgIG1WaXNpYmxlUmVnaW9uc0RpcnR5ID0gdHJ1ZTsKKyAgICAgICAgICAgIGNvbnN0IExheWVyVmVjdG9yJiBwcmV2aW91c0xheWVycyhtRHJhd2luZ1N0YXRlLmxheWVyc1NvcnRlZEJ5Wik7CisgICAgICAgICAgICBjb25zdCBzaXplX3QgY291bnQgPSBwcmV2aW91c0xheWVycy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKHNpemVfdCBpPTAgOyBpPGNvdW50IDsgaSsrKSB7CisgICAgICAgICAgICAgICAgY29uc3Qgc3A8TGF5ZXJCYXNlPiYgbGF5ZXIocHJldmlvdXNMYXllcnNbaV0pOworICAgICAgICAgICAgICAgIGlmIChjdXJyZW50TGF5ZXJzLmluZGV4T2YoIGxheWVyICkgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgbGF5ZXIgaXMgbm90IHZpc2libGUgYW55bW9yZQorICAgICAgICAgICAgICAgICAgICBkaXRjaGVkTGF5ZXJzLmFkZChsYXllcik7CisgICAgICAgICAgICAgICAgICAgIG1EaXJ0eVJlZ2lvblJlbW92ZWRMYXllci5vclNlbGYobGF5ZXItPnZpc2libGVSZWdpb25TY3JlZW4pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCiAgICAgICAgIC8vIGdldCByaWQgb2YgYWxsIHJlc291cmNlcyB3ZSBkb24ndCBuZWVkIGFueW1vcmUKICAgICAgICAgLy8gKGxheWVycyBhbmQgY2xpZW50cykKICAgICAgICAgZnJlZV9yZXNvdXJjZXNfbCgpOwpAQCAtNzM0LDcgKzY5NCw3IEBACiAKICAgICBzaXplX3QgaSA9IGN1cnJlbnRMYXllcnMuc2l6ZSgpOwogICAgIHdoaWxlIChpLS0pIHsKLSAgICAgICAgTGF5ZXJCYXNlKiBjb25zdCBsYXllciA9IGN1cnJlbnRMYXllcnNbaV07CisgICAgICAgIGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyID0gY3VycmVudExheWVyc1tpXTsKICAgICAgICAgbGF5ZXItPnZhbGlkYXRlVmlzaWJpbGl0eShwbGFuZVRyYW5zZm9ybSk7CiAKICAgICAgICAgLy8gc3RhcnQgd2l0aCB0aGUgd2hvbGUgc3VyZmFjZSBhdCBpdHMgY3VycmVudCBsb2NhdGlvbgpAQCAtNzg1LDcgKzc0NSw3IEBACiAgICAgICAgIC8vIGFjY3VtdWxhdGUgdG8gdGhlIHNjcmVlbiBkaXJ0eSByZWdpb24KICAgICAgICAgZGlydHlSZWdpb24ub3JTZWxmKGRpcnR5KTsKIAotICAgICAgICAvLyB1cGRhZGUgYWJvdmVPcGFxdWVMYXllcnMvYWJvdmVDb3ZlcmVkTGF5ZXJzIGZvciBuZXh0IChsb3dlcikgbGF5ZXIKKyAgICAgICAgLy8gVXBkYXRlIGFib3ZlT3BhcXVlTGF5ZXJzL2Fib3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OyArK2kpIHsKLSAgICAgICAgTGF5ZXJCYXNlIGNvbnN0ICogY29uc3QgbGF5ZXIgPSBsYXllcnNbaV07CisgICAgICAgIGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyID0gbGF5ZXJzW2ldOwogICAgICAgICBjb25zdCBSZWdpb24mIHZpc2libGVSZWdpb24obGF5ZXItPnZpc2libGVSZWdpb25TY3JlZW4pOwogICAgICAgICBpZiAoIXZpc2libGVSZWdpb24uaXNFbXB0eSgpKSAgewogICAgICAgICAgICAgY29uc3QgUmVnaW9uIGNsaXAoZGlydHkuaW50ZXJzZWN0KHZpc2libGVSZWdpb24pKTsKQEAgLTkyMCw2NyArOTAyLDQyIEBACiB7CiAgICAgY29uc3QgTGF5ZXJWZWN0b3ImIGRyYXdpbmdMYXllcnMobURyYXdpbmdTdGF0ZS5sYXllcnNTb3J0ZWRCeVopOwogICAgIGNvbnN0IHNpemVfdCBjb3VudCA9IGRyYXdpbmdMYXllcnMuc2l6ZSgpOwotICAgIExheWVyQmFzZSogY29uc3QqIGNvbnN0IGxheWVycyA9IGRyYXdpbmdMYXllcnMuYXJyYXkoKTsKKyAgICBzcDxMYXllckJhc2U+IGNvbnN0KiBjb25zdCBsYXllcnMgPSBkcmF3aW5nTGF5ZXJzLmFycmF5KCk7CiAgICAgZm9yIChzaXplX3QgaT0wIDsgaTxjb3VudCA7ICsraSkgewotICAgICAgICBMYXllckJhc2UqIGNvbnN0IGxheWVyID0gbGF5ZXJzW2ldOworICAgICAgICBjb25zdCBzcDxMYXllckJhc2U+JiBsYXllciA9IGxheWVyc1tpXTsKICAgICAgICAgbGF5ZXItPmZpbmlzaFBhZ2VGbGlwKCk7CiAgICAgfQogfQogCi12b2lkIFN1cmZhY2VGbGluZ2VyOjpzY2hlZHVsZUJyb2FkY2FzdChDbGllbnQqIGNsaWVudCkKLXsKLSAgICBpZiAobUxhc3RTY2hlZHVsZWRCcm9hZGNhc3QgIT0gY2xpZW50KSB7Ci0gICAgICAgIG1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AgY29uc3QgRGlzcGxheUhhcmR3YXJlJiBodyhncmFwaGljUGxhbmUoMCkuZGlzcGxheUhhcmR3YXJlKCkpOwotICAgIGh3LmZsaXAobURpcnR5UmVnaW9uLm1lcmdlKG1JbnZhbGlkUmVnaW9uKSk7Ci0gICAgbUludmFsaWRSZWdpb24uY2xlYXIoKTsKKyAgICAKKyAgICBpZiAobUludmFsaWRSZWdpb24uaXNFbXB0eSgpKSB7CisgICAgICAgIG1EaXJ0eVJlZ2lvbi5kdW1wKCJtRGlydHlSZWdpb24iKTsKKyAgICAgICAgbUludmFsaWRSZWdpb24uZHVtcCgibUludmFsaWRSZWdpb24iKTsKKyAgICB9CisgICAgaHcuZmxpcChtSW52YWxpZFJlZ2lvbik7CiAKICAgICBpZiAobURlYnVnUmVnaW9uID4gMSkKICAgICAgICB1c2xlZXAobURlYnVnUmVnaW9uICogMTAwMCk7CkBAIC0xMDE3LDkgKzk3NiwxMCBAQAogCiAgICAgaWYgKExJS0VMWSghbURlYnVnQmFja2dyb3VuZCkpIHsKICAgICAgICAgZ2xDbGVhckNvbG9yeCgwLDAsMCwwKTsKLSAgICAgICAgUmVjdCByOwotICAgICAgICBSZWdpb246Oml0ZXJhdG9yIGl0ZXJhdG9yKHJlZ2lvbik7Ci0gICAgICAgIHdoaWxlIChpdGVyYXRvci5pdGVyYXRlKCZyKSkgeworICAgICAgICBSZWdpb246OmNvbnN0X2l0ZXJhdG9yIGl0ID0gcmVnaW9uLmJlZ2luKCk7CisgICAgICAgIFJlZ2lvbjo6Y29uc3RfaXRlcmF0b3IgY29uc3QgZW5kID0gcmVnaW9uLmVuZCgpOworICAgICAgICB3aGlsZSAoaXQgIT0gZW5kKSB7CisgICAgICAgICAgICBjb25zdCBSZWN0JiByID0gKml0Kys7CiAgICAgICAgICAgICBjb25zdCBHTGludCBzeSA9IGhlaWdodCAtIChyLnRvcCArIHIuaGVpZ2h0KCkpOwogICAgICAgICAgICAgZ2xTY2lzc29yKHIubGVmdCwgc3ks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tYWxTdXJmYWNlTG9ja2VkKGNsaWVudCwgZCwgaWQsCisgICAgICAgICAgICAgICAgICAgICAgICB3LCBoLCBmbGFncywgZm9ybWF0KTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBjYXNlIGVGWFN1cmZhY2VCbHVyOgotICAgICAgICAgICAgbGF5ZXIgPSBjcmVhdGVCbHVyU3VyZmFjZUxvY2tlZChjLCBkLCBpZCwgdywgaCwgZmxhZ3MpOworICAgICAgICAgICAgbGF5ZXIgPSBjcmVhdGVCbHVyU3VyZmFjZUxvY2tlZChjbGllbnQsIGQsIGlkLCB3LCBoLCBmbGFncyk7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgY2FzZSBlRlhTdXJmYWNlRGltOgotICAgICAgICAgICAgbGF5ZXIgPSBjcmVhdGVEaW1TdXJmYWNlTG9ja2VkKGMsIGQsIGlkLCB3LCBoLCBmbGFncyk7CisgICAgICAgICAgICBsYXllciA9IGNyZWF0ZURpbVN1cmZhY2VMb2NrZWQoY2xpZW50LCBkLCBpZCwgdywgaCwgZmxhZ3MpOwogICAgICAgICAgICAgYnJlYWs7CiAgICAgfQogCi0gICAgaWYgKGxheWVyKSB7CisgICAgaWYgKGxheWVyICE9IDApIHsKICAgICAgICAgc2V0VHJhbnNhY3Rpb25GbGFncyhlVHJhbnNhY3Rpb25OZWVkZWQpOwogICAgICAgICBzdXJmYWNlSGFuZGxlID0gbGF5ZXItPmdldFN1cmZhY2UoKTsKLSAgICAgICAgaWYgKHN1cmZhY2VIYW5kbGUgIT0gMCkKLSAgICAgICAgICAgIHN1cmZhY2VIYW5kbGUtPmdldFN1cmZhY2VEYXRhKHBhcmFtcyk7CisgICAgICAgIGlmIChzdXJmYWNlSGFuZGxlICE9IDApIHsgCisgICAgICAgICAgICBwYXJhbXMtPnRva2VuID0gc3VyZmFjZUhhbmRsZS0+Z2V0VG9rZW4oKTsKKyAgICAgICAgICAgIHBhcmFtcy0+aWRlbnRp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ZXNzYWdlKCBuZXcgTWVzc2FnZURlc3Ryb3lTdXJmYWNlKHRoaXMsIGxheWVyKSApOwogICAgIHJldHVybiBOT19FUlJPUjsKIH0KIApAQCAtMTM2OSwxOCArMTM3NCw5IEBACiAgICAgY2lkIDw8PSAxNjsKICAgICBmb3IgKGludCBpPTAgOyBpPGNvdW50IDsgaSsrKSB7CiAgICAgICAgIGNvbnN0IGxheWVyX3N0YXRlX3QmIHMgPSBzdGF0ZXNbaV07Ci0gICAgICAgIExheWVyQmFzZUNsaWVudCogbGF5ZXIgPSBnZXRMYXllclVzZXJfbChzLnN1cmZhY2UgfCBjaWQpOwotICAgICAgICBpZiAobGF5ZXIpIHsKKyAgICAgICAgc3A8TGF5ZXJCYXNlQ2xpZW50PiBsYXllcihnZXRMYXllclVzZXJfbChzLnN1cmZhY2UgfCBjaWQpKTsKKyAgICAgICAgaWYgKGxheWVyICE9IDApIHsKICAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90IHdoYXQgPSBzLndoYXQ7Ci0gICAgICAgICAgICAvLyBjaGVjayBpZiBpdCBoYXMgYmVlbiBkZXN0cm95ZWQgZmlyc3QKLSAgICAgICAgICAgIGlmICh3aGF0ICYgZURlc3Ryb3llZCkgewotICAgICAgICAgICAgICAgIGlmIChyZW1vdmVMYXllcl9sKGxheWVyKSA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgICAgICBmbGFncyB8PSBlVHJhbnNhY3Rpb25OZWVkZWQ7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdlIHNraXAgZXZlcnl0aGluZyBlbHNlLi4uIHdlbGwsIG5vLCBub3QgcmVhbGx5Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdlIHNraXAgT05MWSB0aGF0IHRyYW5zYWN0aW9uLgotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAod2hhdCAmIGVQb3NpdGlvbkNoYW5nZWQpIHsKICAgICAgICAgICAgICAgICBpZiAobGF5ZXItPnNldFBvc2l0aW9uKHMueCwgcy55KSkKICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgfD0gZVRyYXZlcnNhbE5lZWRlZDsKQEAgLTEzOTUsOCArMTM5MSwxMCBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICh3aGF0ICYgZVNpemVDaGFuZ2VkKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGxheWVyLT5zZXRTaXplKHMudywgcy5oKSkKKyAgICAgICAgICAgICAgICBpZiAobGF5ZXItPnNldFNpemUocy53LCBzLmgpKSB7CiAgICAgICAgICAgICAgICAgICAgIGZsYWdzIHw9IGVUcmF2ZXJzYWxOZWVkZWQ7CisgICAgICAgICAgICAgICAgICAgIG1SZXNpemVUcmFuc2F0aW9uUGVuZGluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKHdoYXQgJiBlQWxwaGFDaGFuZ2VkKSB7CiAgICAgICAgICAgICAgICAgaWYgKGxheWVyLT5zZXRBbHBoYSh1aW50OF90KDI1NS4wZipzLmFscGhhKzAuNWYpKSkKQEAgLTE0MjIsOSArMTQyMCwxMCBAQAogICAgIHJldHVybiBOT19FUlJPUjsKIH0KIAotTGF5ZXJCYXNlQ2xpZW50KiBTdXJmYWNlRmxpbmdlcjo6Z2V0TGF5ZXJVc2VyX2woU3VyZmFjZUlEIHMpIGNvbnN0CitzcDxMYXllckJhc2VDbGllbnQ+IFN1cmZhY2VGbGluZ2VyOjpnZXRMYXllclVzZXJfbChTdXJmYWNlSUQgcykgY29uc3QKIHsKLSAgICByZXR1cm4gbUxheWVyTWFwLnZhbHVlRm9yKHMpOworICAgIHNwPExheWVyQmFzZUNsaWVudD4gbGF5ZXIgPSBtTGF5ZXJNYXAudmFsdWVGb3Iocyk7CisgICAgcmV0dXJuIGxheWVyOwogfQogCiB2b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worICAgICAgICBuc2Vjc190IGluU3dhcEJ1ZmZlcnNEdXJhdGlvbiA9IChpblN3YXBCdWZmZXJzKSA/IG5vdy1pblN3YXBCdWZmZXJzIDogMDsKKyAgICAgICAgbnNlY3NfdCBpblRyYW5zYWN0aW9uRHVyYXRpb24gPSAoaW5UcmFuc2FjdGlvbikgPyBub3ctaW5UcmFuc2FjdGlvbiA6IDA7CisKKyAgICAgICAgLy8gVHJ5IHRvIGdldCB0aGUgbWFpbiBsb2NrLCBidXQgZG9uJ3QgaW5zaXN0IGlmIHdlIGNhbid0CisgICAgICAgIC8vICh0aGlzIHdvdWxkIGluZGljYXRlIFNGIGlzIHN0dWNrLCBidXQgd2Ugd2FudCB0byBiZSBhYmxlIHRvCisgICAgICAgIC8vIHByaW50IHNvbWV0aGluZyBpbiBkdW1wc3lzKS4KKyAgICAgICAgaW50IHJldHJ5ID0gMzsKKyAgICAgICAgd2hpbGUgKG1TdGF0ZUxvY2sudHJ5TG9jaygpPDAgJiYgLS1yZXRyeT49MCkgeworICAgICAgICAgICAgdXNsZWVwKDEwMDAwMDApOworICAgICAgICB9CisgICAgICAgIGNvbnN0IGJvb2wgbG9ja2VkKHJldHJ5ID49IDApOworICAgICAgICBpZiAoIWxvY2tlZCkgeworICAgICAgICAgICAgc25wcmludGYoYnVmZmVyLCBTSVpFLCAKKyAgICAgICAgICAgICAgICAgICAgIlN1cmZhY2VGbGluZ2VyIGFwcGVhcnMgdG8gYmUgdW5yZXNwb25zaXZlLCAiCisgICAgICAgICAgICAgICAgICAgICJkdW1waW5nIGFueXdheXMgKG5vIGxvY2tzIGhlbGQpXG4iKTsKKyAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKKyAgICAgICAgfQorCiAgICAgICAgIHNpemVfdCBzID0gbUNsaWVudHNNYXAuc2l6ZSgpOwogICAgICAgICBjaGFyIG5hbWVbNjRdOwogICAgICAgICBmb3IgKHNpemVfdCBpPTAgOyBpPHMgOyBpKyspIHsKLSAgICAgICAgICAgIENsaWVudCogY2xpZW50ID0gbUNsaWVudHNNYXAudmFsdWVBdChpKTsKKyAgICAgICAgICAgIHNwPENsaWVudD4gY2xpZW50ID0gbUNsaWVudHNNYXAudmFsdWVBdChpKTsKICAgICAgICAgICAgIHNwcmludGYobmFtZSwgIiAgQ2xpZW50IChpZD0weCUwOHgpIiwgY2xpZW50LT5jaWQpOwogICAgICAgICAgICAgY2xpZW50LT5kdW1wKG5hbWUpOwogICAgICAgICB9CkBAIC0xNDY3LDcgKzE0ODYsNyBAQAogICAgICAgICBjb25zdCBzaXplX3QgY291bnQgPSBjdXJyZW50TGF5ZXJzLnNpemUoKTsKICAgICAgICAgZm9yIChzaXplX3QgaT0wIDsgaTxjb3VudCA7IGkrKykgewogICAgICAgICAgICAgLyoqKiBMYXllckJhc2UgKioqLwotICAgICAgICAgICAgTGF5ZXJCYXNlIGNvbnN0ICogY29uc3QgbGF5ZXIgPSBjdXJyZW50TGF5ZXJzW2ldOworICAgICAgICAgICAgY29uc3Qgc3A8TGF5ZXJCYXNlPiYgbGF5ZXIgPSBjdXJyZW50TGF5ZXJzW2ldOwogICAgICAgICAgICAgY29uc3QgTGF5ZXI6OlN0YXRlJiBzID0gbGF5ZXItPmRyYXdpbmdTdGF0ZSgpOwogICAgICAgICAgICAgc25wcmludGYoYnVmZmVyLCBTSVpFLAogICAgICAgICAgICAgICAgICAgICAiKyAlcyAlcFxuIgpAQCAtMTQ3NSw3ICsxNDk0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgIno9JTlkLCBwb3M9KCU0ZCwlNGQpLCBzaXplPSglNGQsJTRkKSwgIgogICAgICAgICAgICAgICAgICAgICAibmVlZHNCbGVuZGluZz0lMWQsIGludmFsaWRhdGU9JTFkLCAiCiAgICAgICAgICAgICAgICAgICAgICJhbHBoYT0weCUwMngsIGZsYWdzPTB4JTA4eCwgdHI9WyUuMmYsICUuMmZdWyUuMmYsICUuMmZdXG4iLAotICAgICAgICAgICAgICAgICAgICBsYXllci0+Z2V0VHlwZUlEKCksIGxheWVyLAorICAgICAgICAgICAgICAgICAgICBsYXllci0+Z2V0VHlwZUlEKCksIGxheWVyLmdldCgpLAogICAgICAgICAgICAgICAgICAgICBzLnosIGxheWVyLT50eCgpLCBsYXllci0+dHkoKSwgcy53LCBzLmgsCiAgICAgICAgICAgICAgICAgICAgIGxheWVyLT5uZWVkc0JsZW5kaW5nKCksIGxheWVyLT5jb250ZW50RGlydHksCiAgICAgICAgICAgICAgICAgICAgIHMuYWxwaGEsIHMuZmxhZ3MsCkBAIC0xNDg0LDM0ICsxNTAzLDM2IEBACiAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CiAgICAgICAgICAgICBidWZmZXJbMF0gPSAwOwogICAgICAgICAgICAgLyoqKiBMYXllckJhc2VDbGllbnQgKioqLwotICAgICAgICAgICAgTGF5ZXJCYXNlQ2xpZW50KiBjb25zdCBsYmMgPQotICAgICAgICAgICAgICAgIExheWVyQmFzZTo6ZHluYW1pY0Nhc3Q8TGF5ZXJCYXNlQ2xpZW50Kj4oKExheWVyQmFzZSopbGF5ZXIpOwotICAgICAgICAgICAgaWYgKGxiYykgeworICAgICAgICAgICAgc3A8TGF5ZXJCYXNlQ2xpZW50PiBsYmMgPQorICAgICAgICAgICAgICAgIExheWVyQmFzZTo6ZHluYW1pY0Nhc3Q8IExheWVyQmFzZUNsaWVudCogPihsYXllci5nZXQoKSk7CisgICAgICAgICAgICBpZiAobGJjICE9IDApIHsKKyAgICAgICAgICAgICAgICBzcDxDbGllbnQ+IGNsaWVudChsYmMtPmNsaWVudC5wcm9tb3RlKCkpOwogICAgICAgICAgICAgICAgIHNucHJpbnRmKGJ1ZmZlciwgU0laRSwKICAgICAgICAgICAgICAgICAgICAgICAgICIgICAgICAiCiAgICAgICAgICAgICAgICAgICAgICAgICAiaWQ9MHglMDh4LCBjbGllbnQ9MHglMDh4LCBpZGVudGl0eT0ldVxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGxiYy0+Y2xpZW50SW5kZXgoKSwgbGJjLT5jbGllbnQgPyBsYmMtPmNsaWVudC0+Y2lkIDogMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxiYy0+Y2xpZW50SW5kZXgoKSwgY2xpZW50LmdldCgpID8gY2xpZW50LT5jaWQgOiAwLAogICAgICAgICAgICAgICAgICAgICAgICAgbGJjLT5nZXRJZGVudGl0eSgpKTsKKworICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKKyAgICAgICAgICAgICAgICBidWZmZXJbMF0gPSAwOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOwotICAgICAgICAgICAgYnVmZmVyWzBdID0gMDsKICAgICAgICAgICAgIC8qKiogTGF5ZXIgKioqLwotICAgICAgICAgICAgTGF5ZXIqIGNvbnN0IGwgPSBMYXllckJhc2U6OmR5bmFtaWNDYXN0PExheWVyKj4oKExheWVyQmFzZSopbGF5ZXIpOwotICAgICAgICAgICAgaWYgKGwpIHsKLSAgICAgICAgICAgICAgICBjb25zdCBMYXllckJpdG1hcCYgYnVmMChsLT5nZXRCdWZmZXIoMCkpOwotICAgICAgICAgICAgICAgIGNvbnN0IExheWVyQml0bWFwJiBidWYxKGwtPmdldEJ1ZmZlcigxKSk7CisgICAgICAgICAgICBzcDxMYXllcj4gbCA9IExheWVyQmFzZTo6ZHluYW1pY0Nhc3Q8IExheWVyKiA+KGxheWVyLmdldCgpKTsKKyAgICAgICAgICAgIGlmIChsICE9IDApIHsKKyAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKCBsLT5sY2Jsay0+ZHVtcCgiICAgICAgIikgKTsKKyAgICAgICAgICAgICAgICBzcDxjb25zdCBCdWZmZXI+IGJ1ZjAobC0+Z2V0QnVmZmVyKDApKTsKKyAgICAgICAgICAgICAgICBzcDxjb25zdCBCdWZmZXI+IGJ1ZjEobC0+Z2V0QnVmZmVyKDEpKTsKICAgICAgICAgICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsCiAgICAgICAgICAgICAgICAgICAgICAgICAiICAgICAgIgotICAgICAgICAgICAgICAgICAgICAgICAgImZvcm1hdD0lMmQsIFslM3V4JTN1OiUzdV0gWyUzdXglM3U6JTN1XSwgbVRleHR1cmVOYW1lPSVkLCIKLSAgICAgICAgICAgICAgICAgICAgICAgICIgZnJlZXplTG9jaz0lcCwgc3dhcFN0YXRlPTB4JTA4eFxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJmb3JtYXQ9JTJkLCBbJTN1eCUzdTolM3VdIFslM3V4JTN1OiUzdV0sIgorICAgICAgICAgICAgICAgICAgICAgICAgIiBmcmVlemVMb2NrPSVwXG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgbC0+cGl4ZWxGb3JtYXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZjAud2lkdGgoKSwgYnVmMC5oZWlnaHQoKSwgYnVmMC5zdHJpZGUoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZjEud2lkdGgoKSwgYnVmMS5oZWlnaHQoKSwgYnVmMS5zdHJpZGUoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGwtPmdldFRleHR1cmVOYW1lKCksIGwtPmdldEZyZWV6ZUxvY2soKS5nZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGwtPmxjYmxrLT5zd2FwU3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgYnVmMC0+Z2V0V2lkdGgoKSwgYnVmMC0+Z2V0SGVpZ2h0KCksIGJ1ZjAtPmdldFN0cmlkZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgYnVmMS0+Z2V0V2lkdGgoKSwgYnVmMS0+Z2V0SGVpZ2h0KCksIGJ1ZjEtPmdldFN0cmlkZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgbC0+Z2V0RnJlZXplTG9jaygpLmdldCgpKTsKKyAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7CisgICAgICAgICAgICAgICAgYnVmZmVyWzBdID0gMDsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKLSAgICAgICAgICAgIGJ1ZmZlclswXSA9IDA7CiAgICAgICAgICAgICBzLnRyYW5zcGFyZW50UmVnaW9uLmR1bXAocmVzdWx0LCAidHJhbnNwYXJlbnRSZWdpb24iKTsKICAgICAgICAgICAgIGxheWVyLT50cmFuc3BhcmVudFJlZ2lvblNjcmVlbi5kdW1wKHJlc3VsdCwgInRyYW5zcGFyZW50UmVnaW9uU2NyZWVuIik7CiAgICAgICAgICAgICBsYXllci0+dmlzaWJsZVJlZ2lvblNjcmVlbi5kdW1wKHJlc3VsdCwgInZpc2libGVSZWdpb25TY3JlZW4iKTsKQEAgLTE1MjMsMTkgKzE1NDQsMjggQEAKICAgICAgICAgICAgICAgICBtRnJlZXplRGlzcGxheT8ieWVzIjoibm8iLCBtRnJlZXplQ291bnQsCiAgICAgICAgICAgICAgICAgbUN1cnJlbnRTdGF0ZS5vcmllbnRhdGlvbiwgaHcuY2FuRHJhdygpKTsKICAgICAgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOwotCi0gICAgICAgIHNwPEFsbG9jYXRvckludGVyZmFjZT4gYWxsb2NhdG9yOwotICAgICAgICBpZiAobUdQVSAhPSAwKSB7Ci0gICAgICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsICIgIEdQVSBvd25lcjogJWRcbiIsIG1HUFUtPmdldE93bmVyKCkpOworICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsCisgICAgICAgICAgICAgICAgIiAgbGFzdCBlZ2xTd2FwQnVmZmVycygpIHRpbWU6ICVmIHVzXG4iCisgICAgICAgICAgICAgICAgIiAgbGFzdCB0cmFuc2FjdGlvbiB0aW1lICAgICA6ICVmIHVzXG4iLAorICAgICAgICAgICAgICAgIG1MYXN0U3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IGEgZGlmZmVyZW50IHByb2Nlc3MsIGRvIHRoZSByZWFsIGNoZWNrCi0gICAgICAgICAgICAgICAgaWYgKCFjaGVja0NhbGxpbmdQZXJtaXNzaW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nMTYoImFuZHJvaWQucGVybWlzc2lvbi5BQ0NFU1NfU1VSRkFDRV9GTElOR0VSIikpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTE9HRSgiUGVybWlzc2lvbiBEZW5pYWw6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY2FuJ3QgYWNjZXNzIFN1cmZhY2VGbGluZ2VyIHBpZD0lZCwgdWlkPSVkIiwgcGlkLCB1aWQpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUEVSTUlTU0lPTl9ERU5JRUQ7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCh1aWQgIT0gQUlEX0dSQVBISUNTKSAmJiAhbUFjY2Vzc1N1cmZhY2VGbGluZ2VyLmNoZWNrKHBpZCwgdWlkKSkgeworICAgICAgICAgICAgICAgIExPR0UoIlBlcm1pc3Npb24gRGVuaWFsOiAiCisgICAgICAgICAgICAgICAgICAgICAgICAiY2FuJ3QgYWNjZXNzIFN1cmZhY2VGbGluZ2VyIHBpZD0lZCwgdWlkPSVkIiwgcGlkLCB1aWQpOworICAgICAgICAgICAgICAgIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLQogICAgIHN0YXR1c190IGVyciA9IEJuU3VyZmFjZUNvbXBvc2VyOjpvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7CiAgICAgaWYgKGVyciA9PSBVTktOT1dOX1RSQU5TQUNUSU9OIHx8IGVyciA9PSBQRVJNSVNTSU9OX0RFTklFRCkgewotICAgICAgICAvLyBIQVJEV0FSRV9URVNUIHN0dWZmLi4uC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9XX0NQVQotICAgICAgICAgICAgICAgIG4gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgICAgIG1EZWJ1Z0NwdSA9IG4gPyAxIDogMDsKLSAgICAgICAgICAgICAgICBpZiAobURlYnVnQ3B1KSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtQ3B1R2F1Z2UgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUNwdUdhdWdlID0gbmV3IENQVUdhdWdlKHRoaXMsIG1zMm5zKDUwMCkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1DcHVHYXVnZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQ3B1R2F1Z2UtPnJlcXVlc3RFeGl0QW5kV2FpdCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1EZWJ1Z0xvY2spOwotICAgICAgICAgICAgICAgICAgICAgICAgbUNwdUdhdWdlLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIDEwMDA6IC8vIFNIT1dfQ1BVLCBOT1QgU1VQUE9SVEVEIEFOWU1PUkUKICAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgICAgICBjYXNlIDEwMDE6ICAvLyBTSE9XX0ZQUwotICAgICAgICAgICAgICAgIG4gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgICAgIG1EZWJ1Z0ZwcyA9IG4gPyAxIDogMDsKKyAgICAgICAgICAgIGNhc2UgMTAwMTogIC8vIFNIT1dfRlBTLCBOT1QgU1VQUE9SVEVEIEFOWU1PUkUKICAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgICAgICBjYXNlIDEwMDI6ICAvLyBTSE9XX1VQREFURVMKICAgICAgICAgICAgICAgICBuID0gZGF0YS5yZWFkSW50MzIoKTsKQEAgLTE2MTgsMjMgKzE2MjUsMTcgQEAKICAgICAgICAgICAgICAgICBjb25zdCBEaXNwbGF5SGFyZHdhcmUmIGh3KGdyYXBoaWNQbGFuZSgwKS5kaXNwbGF5SGFyZHdhcmUoKSk7CiAgICAgICAgICAgICAgICAgbURpcnR5UmVnaW9uLnNldChody5ib3VuZHMoKSk7IC8vIGNhcmVmdWwgdGhhdCdzIG5vdCB0aHJlYWQtc2FmZQogICAgICAgICAgICAgICAgIHNpZ25hbEV2ZW50KCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICAgICAgY2FzZSAxMDA1OiAvLyBhc2sgR1BVIHJldm9rZQotICAgICAgICAgICAgICAgIGlmIChtR1BVICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbUdQVS0+ZnJpZW5kbHlSZXZva2UoKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBjYXNlIDEwMDU6eyAvLyBmb3JjZSB0cmFuc2FjdGlvbgorICAgICAgICAgICAgICAgIHNldFRyYW5zYWN0aW9uRmxhZ3MoZVRyYW5zYWN0aW9uTmVlZGVkfGVUcmF2ZXJzYWxOZWVkZWQpOwogICAgICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgICAgIGNhc2UgMTAwNjogLy8gcmV2b2tlIEdQVQotICAgICAgICAgICAgICAgIGlmIChtR1BVICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbUdQVS0+dW5jb25kaXRpb25hbFJldm9rZSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBjYXNlIDEwMDc6IC8vIHNldCBtRnJlZXplQ291bnQKICAgICAgICAgICAgICAgICBtRnJlZXplQ291bnQgPSBkYXRhLnJlYWRJbnQzMigpOwogICAgICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgICAgIGNhc2UgMTAxMDogIC8vIGludGVycm9nYXRlLgotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKG1EZWJ1Z0NwdSk7CisgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoMCk7CiAgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoMCk7CiAgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIobURlYnVnUmVnaW9uKTsKICAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihtRGVidWdCYWNrZ3JvdW5kKTsKQEAgLTE2NTgsMzAgKzE2NTksMjQgQEAKIENsaWVudDo6Q2xpZW50KENsaWVudElEIGNsaWVudElELCBjb25zdCBzcDxTdXJmYWNlRmxpbmdlcj4mIGZsaW5nZXIpCiAgICAgOiBjdHJsYmxrKDApLCBjaWQoY2xpZW50SUQpLCBtUGlkKDApLCBtQml0bWFwKDApLCBtRmxpbmdlcihmbGluZ2VyKQogewotICAgIG1TaGFyZWRIZWFwQWxsb2NhdG9yID0gZ2V0U3VyZmFjZUhlYXBNYW5hZ2VyKCktPmNyZWF0ZUhlYXAoKTsKICAgICBjb25zdCBpbnQgcGdzaXplID0gZ2V0cGFnZXNpemUoKTsKLSAgICBjb25zdCBpbnQgY2Jsa3NpemU9KChzaXplb2YocGVyX2NsaWVudF9jYmxrX3QpKyhwZ3NpemUtMSkpJn4ocGdzaXplLTEpKTsKLSAgICBtQ2Jsa0hlYXAgPSBuZXcgTWVtb3J5RGVhbGVyKGNibGtzaXplKTsKLSAgICBtQ2Jsa01lbW9yeSA9IG1DYmxrSGVhcC0+YWxsb2NhdGUoY2Jsa3NpemUpOwotICAgIGlmIChtQ2Jsa01lbW9yeSAhPSAwKSB7Ci0gICAgICAgIGN0cmxibGsgP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AgZ2VuZXJhdGVJZChpbnQgcGlkKTsKICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGZyZWUoaW50MzJfdCBpZCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgICAgICBiaW5kTGF5ZXIoTGF5ZXJCYXNlQ2xpZW50KiBsYXllciwgaW50MzJfdCBpZCk7Ci0gICAgICAgICAgICBzcDxNZW1vcnlEZWFsZXI+ICAgICAgICBjcmVhdGVBbGxvY2F0b3IodWludDMyX3QgbWVtb3J5X3R5cGUpOworICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICAgICAgYmluZExheWVyKGNvbnN0IHNwPExheWVyQmFzZUNsaWVudD4mIGxheWVyLCBpbnQzMl90IGlkKTsKIAogICAgIGlubGluZSAgYm9vbCAgICAgICAgICAgICAgICAgICAgaXNWYWxpZChpbnQzMl90IGkpIGNvbnN0OwotICAgIGlubGluZSAgY29uc3QgdWludDhfdCogICAgICAgICAgaW5Vc2VBcnJheSgpIGNvbnN0OwotICAgIGlubGluZSAgc2l6ZV90ICAgICAgICAgICAgICAgICAgbnVtQWN0aXZlTGF5ZXJzKCkgY29uc3Q7Ci0gICAgTGF5ZXJCYXNlQ2xpZW50KiAgICAgICAgICAgICAgICBnZXRMYXllclVzZXIoaW50MzJfdCBpKSBjb25zdDsKLSAgICBjb25zdCBWZWN0b3I8TGF5ZXJCYXNlQ2xpZW50Kj4mIGdldExheWVycygpIGNvbnN0IHsgcmV0dXJuIG1MYXllcnM7IH0KLSAgICBjb25zdCBzcDxJTWVtb3J5PiYgICAgICAgICAgICAgIGNvbnRyb2xCbG9ja01lbW9yeSgpIGNvbnN0IHsgcmV0dXJuIG1DYmxrTWVtb3J5OyB9CisgICAgc3A8TGF5ZXJCYXNlQ2xpZW50PiAgICAgICAgICAgICBnZXRMYXllclVzZXIoaW50MzJfdCBpKSBjb25zdDsKICAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR1bXAoY29uc3QgY2hhciogd2hhdCk7Ci0gICAgY29uc3Qgc3A8U3VyZmFjZUhlYXBNYW5hZ2VyPiYgICBnZXRTdXJmYWNlSGVhcE1hbmFnZXIoKSBjb25zdDsKKyAgICAKKyAgICBjb25zdCBWZWN0b3I8IHdwPExheWVyQmFzZUNsaWVudD4gPiYgZ2V0TGF5ZXJzKCkgY29uc3QgeyAKKyAgICAgICAgcmV0dXJuIG1MYXllcnM7IAorICAgIH0KKyAgICAKKyAgICBjb25zdCBzcDxJTWVtb3J5SGVhcD4mIGdldENvbnRyb2xCbG9ja01lbW9yeSgpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1DYmxrSGVhcDsgCisgICAgfQogICAgIAogICAgIC8vIHBvaW50ZXIgdG8gdGhpcyBjbGllbnQncyBjb250cm9sIGJsb2NrCi0gICAgcGVyX2NsaWVudF9jYmxrX3QqICAgICAgY3RybGJsazsKKyAgICBTaGFyZWRDbGllbnQqICAgICAgICAgICBjdHJsYmxrOwogICAgIENsaWVudElEICAgICAgICAgICAgICAgIGNpZDsKIAogICAgIAogcHJpdmF0ZToKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICBnZXRDbGllbnRQaWQoKSBjb25zdCB7IHJldHVybiBtUGlkOyB9CisgICAgaW50IGdldENsaWVudFBpZCgpIGNvbnN0IHsgcmV0dXJuIG1QaWQ7IH0KICAgICAgICAgCi0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIG1QaWQ7Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgICAgIG1CaXRtYXA7Ci0gICAgU29ydGVkVmVjdG9yPHVpbnQ4X3Q+ICAgICAgIG1JblVzZTsKLSAgICBWZWN0b3I8TGF5ZXJCYXNlQ2xpZW50Kj4gICAgbUxheWVyczsKLSAgICBzcDxNZW1vcnlEZWFsZXI+ICAgICAgICAgICAgbUNibGtIZWFwOwotICAgIHNwPFN1cmZhY2VGbGluZ2VyPiAgICAgICAgICBtRmxpbmdlcjsKLSAgICBzcDxNZW1vcnlEZWFsZXI+ICAgICAgICAgICAgbVNoYXJlZEhlYXBBbGxvY2F0b3I7Ci0gICAgc3A8TWVtb3J5RGVhbGVyPiAgICAgICAgICAgIG1QTWVtQWxsb2NhdG9yOwotICAgIHNwPElNZW1vcnk+ICAgICAgICAgICAgICAgICBtQ2Jsa01lbW9yeTsKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaWQ7CisgICAgdWludDMyX3QgICAgICAgICAgICAgICAgICAgICAgICBtQml0bWFwOworICAgIFNvcnRlZFZlY3Rvcjx1aW50OF90PiAgICAgICAgICAgbUluVXNlOworICAgIFZlY3Rvcjwgd3A8TGF5ZXJCYXNlQ2xpZW50PiA+ICAgbUxheWVyczsKKyAgICBzcDxJTWVtb3J5SGVhcD4gICAgICAgICAgICAgICAgIG1DYmxrSGVhcDsKKyAgICBzcDxTdXJmYWNlRmxpbmdlcj4gICAgICAgICAgICAgIG1GbGluZ2VyOwogfTsKIAogLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCkBAIC0xMjUsNiArMTIyLDggQEAKIAogICAgICAgICBjb25zdCBEaXNwbGF5SGFyZHdhcmUmICBkaXNwbGF5SGFyZHdhcmUoKSBjb25zdDsKICAgICAgICAgY29uc3QgVHJhbnNmb3JtJiAgICAgICAgdHJhbnNmb3JtKCkgY29uc3Q7CisgICAgICAgIEVHTERpc3BsYXkgICAgICAgICAgICAgIGdldEVHTERpc3BsYXkoKSBjb25zdDsKKyAgICAgICAgCiBwcml2YXRlOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHcmFwaGljUGxhbmUoY29uc3QgR3JhcGhpY1BsYW5lJik7CiAgICAgICAgIEdyYXBoaWNQbGFuZSAgICAgICAgICAgIG9wZXJhdG9yID0gKGNvbnN0IEdyYXBoaWNQbGFuZSYpO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AgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgc2NyZWVuUmVsZWFzZWQoRGlzcGxheUlEIGRweSk7CiAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgc2NyZWVuQWNxdWlyZWQoRGlzcGxheUlEIGRweSk7CiAKLSAgICAgICAgICAgIGNvbnN0IHNwPFN1cmZhY2VIZWFwTWFuYWdlcj4mIGdldFN1cmZhY2VIZWFwTWFuYWdlcigpIGNvbnN0IHsgCi0gICAgICAgICAgICAgICAgcmV0dXJuIG1TdXJmYWNlSGVhcE1hbmFnZXI7IAotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjb25zdCBzcDxHUFVIYXJkd2FyZUludGVyZmFjZT4mIGdldEdQVSgpIGNvbnN0IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbUdQVTsgCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNvcHliaXRfZGV2aWNlX3QqIGdldEJsaXRFbmdpbmUoKSBjb25zdDsKICAgICAgICAgICAgIG92ZXJsYXlfY29udHJvbF9kZXZpY2VfdCogZ2V0T3ZlcmxheUVuZ2luZSgpIGNvbnN0OwogCiAgICAgICAgICAgICAKLSAgICBzdGF0dXNfdCByZW1vdmVMYXllcihMYXllckJhc2UqIGxheWVyKTsKLSAgICBzdGF0dXNfdCBhZGRMYXllcihMYXllckJhc2UqIGxheWVyKTsKLSAgICBzdGF0dXNfdCBpbnZhbGlkYXRlTGF5ZXJWaXNpYmlsaXR5KExheWVyQmFzZSogbGF5ZXIpOworICAgIHN0YXR1c190IHJlbW92ZUxheWVyKGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyKTsKKyAgICBzdGF0dXNfdCBhZGRMYXllcihjb25zdCBzcDxMYXllckJhc2U+JiBsYXllcik7CisgICAgc3RhdHVzX3QgaW52YWxpZGF0ZUxheWVyVmlzaWJpbGl0eShjb25zdCBzcDxMYXllckJhc2U+JiBsYXllcik7CiAgICAgCiBwcml2YXRl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1cmZhY2VJRCBzdXJmYWNlX2lkKTsKLSAgICBzdGF0dXNfdCAgICBzZXRDbGllbnRTdGF0ZShDbGllbnRJRCBjaWQsIGludDMyX3QgY291bnQsIGNvbnN0IGxheWVyX3N0YXRlX3QqIHN0YXRlcyk7CisgICAgc3RhdHVzX3QgcmVtb3ZlU3VyZmFjZShTdXJmYWNlSUQgc3VyZmFjZV9pZCk7CisgICAgc3RhdHVzX3QgZGVzdHJveVN1cmZhY2UoY29uc3Qgc3A8TGF5ZXJCYXNlQ2xpZW50PiYgbGF5ZXIpOworICAgIHN0YXR1c190IHNldENsaWVudFN0YXRlKENsaWVudElEIGNpZCwgaW50MzJfdCBjb3VudCwgY29uc3QgbGF5ZXJfc3RhdGVfdCogc3RhdGVzKTsKIAogCiAgICAgY2xhc3MgTGF5ZXJWZWN0b3IgewpAQCAtMjI1LDE1ICsyMjAsMTUgQEAKICAgICAgICAgaW5saW5lICAgICAgICAgICAgICBMYXllclZlY3RvcigpIHsgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExheWVyVmVjdG9yKGNvbnN0IExheWVyVmVjdG9yJik7CiAgICAgICAgIGlubGluZSBzaXplX3QgICAgICAgc2l6ZSgpIGNvbnN0IHsgcmV0dXJuIGxheWVycy5zaXplKCk7IH0KLSAgICAgICAgaW5saW5lIExheWVyQmFzZSpjb25zdCogYXJyYXkoKSBjb25zdCB7IHJldHVybiBsYXllcnMuYXJyYXkoKTsgfQotICAgICAgICBzc2l6ZV90ICAgICAgICAgICAgIGFkZChMYXllckJhc2UqLCBWZWN0b3I8TGF5ZXJCYXNlKj46OmNvbXBhcl90KTsKLSAgICAgICAgc3NpemVfdCAgICAgICAgICAgICByZW1vdmUoTGF5ZXJCYXNlKik7Ci0gICAgICAgIHNzaXplX3QgICAgICAgICAgICAgcmVvcmRlcihMYXllckJhc2UqLCBWZWN0b3I8TGF5ZXJCYXNlKj46OmNvbXBhcl90KTsKLSAgICAgICAgc3NpemVfdCAgICAgICAgICAgIC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ogICAgIH07CiAKICAgICBzdHJ1Y3QgU3RhdGUgewpAQCAtMjQ3LDI1ICsyNDIsNiBAQAogICAgICAgICB1aW50OF90ICAgICAgICAgZnJlZXplRGlzcGxheTsKICAgICB9OwogCi0gICAgY2xhc3MgRGVsYXllZFRyYW5zYWN0aW9uIDogcHVibGljIFRocmVhZAotICAgIHsKLSAgICAgICAgZnJpZW5kIGNsYXNzIFN1cmZhY2VGbGluZ2VyOwotICAgICAgICBzcDxTdXJmYWNlRmxpbmdlcj4gIG1GbGluZ2VyOwotICAgICAgICBuc2Vjc190ICAgICAgICAgICAgIG1EZWxheTsKLSAgICBwdWJsaWM6Ci0gICAgICAgIERlbGF5ZWRUcmFuc2FjdGlvbihjb25zdCBzcDxTdXJmYWNlRmxpbmdlcj4mIGZsaW5nZXIsIG5zZWNzX3QgZGVsYXkpCi0gICAgICAgICAgICA6IFRocmVhZChmYWxzZSksIG1GbGluZ2VyKGZsaW5nZXIpLCBtRGVsYXkoZGVsYXkpIHsKLSAgICAgICAgfQotICAgICAgICB2aXJ0dWFsIGJvb2wgdGhyZWFkTG9vcCgpIHsKLSAgICAgICAgICAgIHVzbGVlcChtRGVsYXkgLyAxMDAwKTsKLSAgICAgICAgICAgIGlmIChhbmRyb2lkX2F0b21pY19hbmQofjEsCi0gICAgICAgICAgICAgICAgICAgICZtRmxpbmdlci0+bURlcGxheWVkVHJhbnNhY3Rpb25QZW5kaW5nKSA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgbUZsaW5nZXItPnNpZ25hbEV2ZW50KCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9OwotCiAgICAgdmlydHVhbCBib29sICAgICAgICB0aHJlYWRMb29wKCk7CiAgICAgdmlydHVhbCBzdGF0dXNfdCAgICByZWFkeVRvUnVuKCk7CiAgICAgdmlydHVhbCB2b2lkICAgICAgICBvbkZpcnN0UmVmKCk7CkBAIC0yNzksNiArMjU1LDkgQEAKIAogICAgICAgICAgICAgdm9pZCAgICAgICAgaGFuZGxlQ29uc29sZUV2ZW50cygpOwogICAgICAgICAgICAgdm9pZCAgICAgICAgaGFuZGxlVHJhbnNhY3Rpb24odWludDMyX3QgdHJhbnNhY3Rpb25GbGFncyk7CisgICAgICAgICAgICB2b2lkICAgICAgICBoYW5kbGVUcmFuc2FjdGlvbkxvY2tlZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB0cmFuc2FjdGlvbkZsYWdzLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBWZWN0b3I8IHNwPExheWVyQmFzZT4gPiYgZGl0Y2hlZExheWVycyk7CiAKICAgICAgICAgICAgIHZvaWQgICAgICAgIGNvbXB1dGVWaXNpYmxlUmVnaW9ucygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMYXllclZlY3RvciYgY3VycmVudExheWVycywKQEAgLTI4OSwxOSArMjY4LDE2IEBACiAgICAgICAgICAgICBib29sICAgICAgICBsb2NrUGFnZUZsaXAoY29uc3QgTGF5ZXJWZWN0b3ImIGN1cnJlbnRMYXllcnMpOwogICAgICAgICAgICAgdm9pZCAgICAgICAgdW5sb2NrUGFnZUZsaXAoY29uc3QgTGF5ZXJWZWN0b3ImIGN1cnJlbnRMYXllcnMpOwogICAgICAgICAgICAgdm9pZCAgICAgICAgaGFuZGxlUmVwYWludCgpOwotICAgICAgICAgICAgdm9pZCAgICAgICAgaGFuZGxlRGVidWdDcHUoKTsKLSAgICAgICAgICAgIHZvaWQgICAgICAgIHNjaGVkdWxlQnJvYWRjYXN0KENsaWVudCogY2xpZW50KTsKLSAgICAgICAgICAgIHZvaWQgICAgICAgIGV4ZWN1dGVTY2hlZHVsZWRCcm9hZGNhc3RzKCk7CiAgICAgICAgICAgICB2b2lkICAgICAgICBwb3N0RnJhbWVidWZmZXIoKTsKICAgICAgICAgICAgIHZvaWQgICAgICAgIGNvbXBvc2VTdXJmYWNlcyhjb25zdCBSZWdpb24mIGRpcnR5KTsKICAgICAgICAgICAgIHZvaWQgICAgICAgIHVubG9ja0NsaWVudHMoKTsKIAogCiAgICAgICAgICAgICB2b2lkICAgICAgICBkZXN0cm95Q29ubmVjdGlvbihDbGllbnRJRCBjaWQpOwotICAgICAgICAgICAgTGF5ZXJCYXNlQ2xpZW50KiBnZXRMYXllclVzZXJfbChTdXJmYWNlSUQgaW5kZXgpIGNvbnN0OwotICAgICAgICAgICAgc3RhdHVzX3QgICAgYWRkTGF5ZXJfbChMYXllckJhc2UqIGxheWVyKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgIHJlbW92ZUxheWVyX2woTGF5ZXJCYXNlKiBsYXllcik7Ci0gICAgICAgICAgICB2b2lkICAgICAgICBkZXN0cm95X2FsbF9yZW1vdmVkX2xheWVyc19sKCk7CisgICAgICAgICAgICBzcDxMYXllckJhc2VDbGllbnQ+IGdldExheWVyVXNlcl9sKFN1cmZhY2VJRCBpbmRleCkgY29uc3Q7CisgICAgICAgICAgICBzdGF0dXNfdCAgICBhZGRMYXllcl9sKGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyKTsKKyAgICAgICAgICAgIHN0YXR1c190ICAgIHJlbW92ZUxheWVyX2woY29uc3Qgc3A8TGF5ZXJCYXNlPiYgbGF5ZXIpOworICAgICAgICAgICAgc3RhdHVzX3QgICAgcHVyZ2F0b3JpemVMYXllcl9sKGNvbnN0IHNwPExheWVyQmFzZT4mIGxheWVyKTsKICAgICAgICAgICAgIHZvaWQgICAgICAgIGZyZWVfcmVzb3VyY2VzX2woKTsKIAogICAgICAgICAgICAgdWludDMyX3QgICAgZ2V0VHJhbnNhY3Rpb25GbGFncyh1aW50MzJfdCBmbGFncyk7CkBAIC0zMjMsNiArMjk5LDExIEBACiAgICAgICAgICAgICB2b2lkICAgICAgICBkZWJ1Z1Nob3dGUFMoKSBjb25zdDsKICAgICAgICAgICAgIHZvaWQgICAgICAgIGRyYXdXb3JtaG9sZSgpIGNvbnN0OwogICAgICAgICAgICAKKworICAgIG11dGFibGUgICAgIE1lc3NhZ2VRdWV1ZSAgICBtRXZlbnRRdWV1ZTsKKyAgICAKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAvLyBhY2Nlc3MgbXVzdCBiZSBwcm90ZWN0ZWQgYnkgbVN0YXRlTG9jawogICAgIG11dGFibGUgICAgIE11dGV4ICAgICAgICAgICAgICAgICAgIG1TdGF0ZUxvY2s7CiAgICAgICAgICAgICAgICAgU3RhdGUgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRTdGF0ZTsKQEAgLTMzMCwyMyArMzExLDI0IEBACiAgICAgdm9sYXRpbGUgICAgaW50MzJfdCAgICAgICAgICAgICAgICAgbVRyYW5zYWN0aW9uRmxhZ3M7CiAgICAgdm9sYXRpbGUgICAgaW50MzJfdCAgICAgICAgICAgICAgICAgbVRyYW5zYWN0aW9uQ291bnQ7CiAgICAgICAgICAgICAgICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgbVRyYW5zYWN0aW9uQ1Y7Ci0KKyAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICBtUmVzaXplVHJhbnNhdGlvblBlbmRpbmc7CisgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgLy8gcHJvdGVjdGVkIGJ5IG1TdGF0ZUxvY2sgKGJ1dCB3ZSBjb3VsZCB1c2UgYW5vdGhlciBsb2NrKQogICAgICAgICAgICAgICAgIFRva2VuaXplciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG9rZW5zOwotICAgICAgICAgICAgICAgIERlZmF1bHRLZXllZFZlY3RvcjxDbGllbnRJRCwgQ2xpZW50Kj4gICBtQ2xpZW50c01hcDsKLSAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8U3VyZmFjZUlELCBMYXllckJhc2VDbGllbnQqPiAgIG1MYXllck1hcDsKKyAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8Q2xpZW50SUQsIHNwPENsaWVudD4gPiAgIG1DbGllbnRzTWFwOworICAgICAgICAgICAgICAgIERlZmF1bHRLZXllZFZlY3RvcjxTdXJmYWNlSUQsIHNwPExheWVyQmFzZUNsaWVudD4gPiAgIG1MYXllck1hcDsKICAgICAgICAgICAgICAgICBHcmFwaGljUGxhbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUdyYXBoaWNQbGFuZXNbMV07Ci0gICAgICAgICAgICAgICAgU29ydGVkVmVjdG9yPExheWVyQmFzZSo+ICAgICAgICAgICAgICAgIG1SZW1vdmVkTGF5ZXJzOwotICAgICAgICAgICAgICAgIFZlY3RvcjxDbGllbnQqPiAgICAgICAgICAgICAgICAgICAgICAgICBtRGlzY29ubmVjdGVkQ2xpZW50czsKKyAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxheWVyc1JlbW92ZWQ7CisgICAgICAgICAgICAgICAgVmVjdG9yPCBzcDxDbGllbnQ+ID4gICAgICAgICAgICAgICAgICAgIG1EaXNjb25uZWN0ZWRDbGllbnRzOwogCiAgICAgICAgICAgICAgICAgLy8gY29uc3RhbnQgbWVtYmVycyAobm8gc3luY2hyb25pemF0aW9uIG5lZWRlZCBmb3IgYWNjZXNzKQotICAgICAgICAgICAgICAgIHNwPE1lbW9yeURlYWxlcj4gICAgICAgICAgICBtU2VydmVySGVhcDsKLSAgICAgICAgICAgICAgICBzcDxJTWVtb3J5PiAgICAgICAgICAgICAgICAgbVNlcnZlckNibGtNZW1vcnk7CisgICAgICAgICAgICAgICAgc3A8SU1lbW9yeUhlYXA+ICAgICAgICAgICAgIG1TZXJ2ZXJIZWFwOwogICAgICAgICAgICAgICAgIHN1cmZhY2VfZmxpbmdlcl9jYmxrX3QqICAgICBtU2VydmVyQ2JsazsKLSAgICAgICAgICAgICAgICBzcDxTdXJmYWNlSGVhcE1hbmFnZXI+ICAgICAgbVN1cmZhY2VIZWFwTWFuYWdlcjsKLSAgICAgICAgICAgICAgICBzcDxHUFVIYXJkd2FyZUludGVyZmFjZT4gICAgbUdQVTsKICAgICAgICAgICAgICAgICBHTHVpbnQgICAgICAgICAgICAgICAgICAgICAgbVdvcm1ob2xlVGV4TmFtZTsKICAgICAgICAgICAgICAgICBuc2Vjc190ICAgICAgICAgICAgICAgICAgICAgbUJvb3RUaW1lOworICAgICAgICAgICAgICAgIFBlcm1pc3Npb24gICAgICAgICAgICAgICAgICBtSGFyZHdhcmVUZXN0OworICAgICAgICAgICAgICAgIFBlcm1pc3Npb24gICAgICAgICAgICAgICAgICBtQWNjZXNzU3VyZmFjZUZsaW5nZXI7CisgICAgICAgICAgICAgICAgUGVybWlzc2lvbiAgICAgICAgICAgICAgICAgIG1EdW1wOwogICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgIC8vIENhbiBvbmx5IGFjY2Vzc2VkIGZyb20gdGhlIG1haW4gdGhyZWFkLCB0aGVzZSBtZW1iZXJzCiAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgbmVlZCBzeW5jaHJvbml6YXRpb24KQEAgLTM1NCwzMCArMzM2LDIyIEBACiAgICAgICAgICAgICAgICAgUmVnaW9uICAgICAgICAgICAgICAgICAgICAgIG1EaXJ0eVJlZ2lvblJlbW92ZWRMYXllcjsKICAgICAgICAgICAgICAgICBSZWdpb24gICAgICAgICAgICAgICAgICAgICAgbUludmFsaWRSZWdpb247CiAgICAgICAgICAgICAgICAgUmVnaW9uICAgICAgICAgICAgICAgICAgICAgIG1Xb3JtaG9sZVJlZ2lvbjsKLSAgICAgICAgICAgICAgICBDbGllbnQqICAgICAgICAgICAgICAgICAgICAgbUxhc3RTY2hlZHVsZWRCcm9hZGNhc3Q7Ci0gICAgICAgICAgICAgICAgU29ydGVkVmVjdG9yPENsaWVudCo+ICAgICAgIG1TY2hlZHVsZWRCcm9hZGNhc3RzOwogICAgICAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICBtVmlzaWJsZVJlZ2lvbnNEaXJ0eTsKICAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgbURlZmVyUmVsZWFzZUNvbnNvbGU7CiAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgIG1GcmVlemVEaXNwbGF5OwogICAgICAgICAgICAgICAgIGludDMyX3QgICAgICAgICAgICAgICAgICAgICBtRnJlZXplQ291bnQ7CiAgICAgICAgICAgICAgICAgbnNlY3NfdCAgICAgICAgICAgICAgICAgICAgIG1GcmVlemVEaXNwbGF5VGltZTsKLSAgICAgICAgICAgICAgICBmcmllbmQgY2xhc3MgT3JpZW50YXRpb25BbmltYXRpb247Ci0gICAgICAgICAgICAgICAgT3JpZW50YXRpb25BbmltYXRpb24qICAgICAgIG1PcmllbnRhdGlvbkFuaW1hdGlvbjsKLQotICAgICAgICAgICAgICAgIC8vIGFjY2VzcyBwcm90ZWN0ZWQgYnkgbURlYnVnTG9jawotICAgIG11dGFibGUgICAgIE11dGV4ICAgICAgICAgICAgICAgICAgICAgICBtRGVidWdMb2NrOwotICAgICAgICAgICAgICAgIHNwPENQVUdhdWdlPiAgICAgICAgICAgICAgICBtQ3B1R2F1Z2U7CiAKICAgICAgICAgICAgICAgICAvLyBkb24ndCB1c2UgYSBsb2NrIGZvciB0aGVzZSwgd2UgZG9uJ3QgY2FyZQogICAgICAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICBtRGVidWdSZWdpb247Ci0gICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWJ1Z0NwdTsKLSAgICAgICAgICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgbURlYnVnRnBzOwogICAgICAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICBtRGVidWdCYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgIHZvbGF0aWxlIG5zZWNzX3QgICAgICAgICAgICBtRGVidWdJblN3YXBCdWZmZXJzOworICAgICAgICAgICAgICAgIG5zZWNzX3QgICAgICAgICAgICAgICAgICAgICBtTGFzdFN3YXBCdWZmZXJUaW1lOworICAgICAgICAgICAgICAgIHZvbGF0aWxlIG5zZWNzX3QgICAgICAgICAgICBtRGVidWdJblRyYW5zYWN0aW9uOworICAgICAgICAgICAgICAgIG5zZWNzX3QgICAgICAgICAgICAgICAgICAgICBtTGFzdFRyYW5zYWN0aW9uVGltZTsKIAogICAgICAgICAgICAgICAgIC8vIHRoZXNlIGFyZSB0aHJlYWQgc2FmZQogICAgIG11dGFibGUgICAgIEJhcnJpZXIgICAgICAgICAgICAgICAgICAgICBtUmVhZHlUb1J1bkJhcnJpZXI7Ci0gICAgbXV0YWJsZSAgICAgU3VyZmFjZUZsaW5nZXJTeW5jaHJvICAgICAgIG1TeW5jT2JqZWN0OwotICAgIHZvbGF0aWxlICAgIGludDMyX3QgICAgICAgICAgICAgICAgICAgICBtRGVwbGF5ZWRUcmFuc2FjdGlvblBlbmRpbmc7CiAKICAgICAgICAgICAgICAgICAvLyBhdG9taWMgdmFyaWFibGVzCiAgICAgICAgICAgICAgICAgZW51bSB7CkBAIC00MTAsMTEgKzM4NCwxMSBAQAogewogcHVibGljOgogICAgIEJDbGllbnQoU3VyZmFjZUZsaW5nZXIgKmZsaW5nZXIsIENsaWVudElEIGNpZCwKLSAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBjYmxrKTsKKyAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnlIZWFwPiYgY2Jsayk7CiAgICAgfkJDbGllbnQoKTsKIAogICAgIC8vIElTdXJmYWNlRmxpbmdlckNsaWVudCBpbnRlcmZhY2UKLSAgICB2aXJ0dWFsIHZvaWQgZ2V0Q29udHJvbEJsb2NrcyhzcDxJTWVtb3J5PiogY3RybCkgY29uc3Q7CisgICAgdmlydHVhbCBzcDxJTWVtb3J5SGVhcD4gZ2V0Q29udHJvbEJsb2NrKCkgY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yml0X2ltYWdlX3QgZHN0ID0gewotICAgICAgICAgICAgICAgIGVnbF9uYXRpdmVfd2luZG93X3Q6OndpZHRoLAotICAgICAgICAgICAgICAgIGVnbF9uYXRpdmVfd2luZG93X3Q6OmhlaWdodCwKLSAgICAgICAgICAgICAgICBlZ2xfbmF0aXZlX3dpbmRvd190Ojpmb3JtYXQsCi0gICAgICAgICAgICAgICAgZWdsX25hdGl2ZV93aW5kb3dfdDo6b2Zmc2V0LAotICAgICAgICAgICAgICAgICh2b2lkKillZ2xfbmF0aXZlX3dpbmRvd190OjpiYXNlLAotICAgICAgICAgICAgICAgIGVnbF9uYXRpdmVfd2luZG93X3Q6OmZkCi0gICAgICAgIH07Ci0gICAgICAgIGNvcHliaXRfaW1hZ2VfdCBzcmMgPSB7Ci0gICAgICAgICAgICAgICAgZWdsX25hdGl2ZV93aW5kb3dfdDo6d2lkdGgsCi0gICAgICAgICAgICAgICAgZWdsX25hdGl2ZV93aW5kb3dfdDo6aGVpZ2h0LAotICAgICAgICAgICAgICAgIGVnbF9uYXRpdmVfd2luZG93X3Q6OmZvcm1hdCwgLy8gWFhYOiB1c2UgcHJvcGVyIGZvcm1hdAotICAgICAgICAgICAgICAgIGVnbF9uYXRpdmVfd2luZG93X3Q6Om9mZnNldCwKLSAgICAgICAgICAgICAgICAodm9pZCopZWdsX25hdGl2ZV93aW5kb3dfdDo6YmFzZSwgIC8vIFhYWDogdXNlIHByb3BlciBiYXNlCi0gICAgICAgICAgICAgICAgZWdsX25hdGl2ZV93aW5kb3dfdDo6b2VtWzBdCi0gICAgICAgIH07Ci0gICAgICAgIHJlZ2lvbl9pdGVyYXRvciBpdChSZWdpb24oUmVjdCgKLSAgICAgICAgICAgICAgICBlZ2xfbmF0aXZlX3dpbmRvd190Ojp3aWR0aCwgZWdsX25hdGl2ZV93aW5kb3dfdDo6aGVpZ2h0KSkpOwotICAgICAgICBjb3B5Yml0LT5zZXRfcGFyYW1ldGVyKGNvcHliaXQsIENPUFlCSVRf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WYKLSAgICB7Ci0gICAgICAgIC8qIG5vIGV4dHJhIGNvcHkgbmVlZGVkIHNpbmNlIHdlIGNvcGllZCBiYWNrIHRvIGZyb250IGluc3RlYWQgb2YKLSAgICAgICAgICogZmxpcHBpbmcgKi8KLSAgICAgICAgaWYgKCEobUZsYWdzICYgUEFHRV9GTElQKSkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgUmVnaW9uOjppdGVyYXRvciBpdGVyYXRvcihjb3B5YmFjayk7Ci0gICAgICAgIGlmIChpdGVyYXRvcikgewotICAgICAgICAgICAgUmVjdCByOwotICAgICAgICAgICAgdWludDhfdCogY29uc3Qgc2NyZWVuX3NyYyA9IG1GYlsgIG1JbmRleF0uZGF0YTsKLSAgICAgICAgICAgIHVpbnQ4X3QqIGNvbnN0IHNjcmVlbl9kc3QgPSBtRmJbMS1tSW5kZXhdLmRhdGE7Ci0gICAgICAgICAgICBjb25zdCBzaXplX3QgYnBwID0gYnl0ZXNQZXJQaXhlbChlZ2xfbmF0aXZlX3dpbmRvd190Ojpmb3JtYXQpOwotICAgICAgICAgICAgY29uc3Qgc2l6ZV90IGJwciA9IGVnbF9uYXRpdmVfd2luZG93X3Q6OnN0cmlkZSAqIGJwcDsKLSAgICAgICAgICAgIHdoaWxlIChpdGVyYXRvci5pdGVyYXRlKCZyKSkgewotICAgICAgICAgICAgICAgIHNzaXplX3QgaCA9IHIuYm90dG9tIC0gci50b3A7Ci0gICAgICAgICAgICAgICAgaWYgKGgpIHsKLSAgICAgICAgICAgICAgICAgICAgc2l6ZV90IHNpemUgPSAoci5yaWdodCAtIHIubGVmdCkgKiBicHA7Ci0gICAgICAgICAgICAgICAgICAgIHNpemVfdCBvID0gKHIubGVmdCArIGVnbF9uYXRpdmVfd2luZG93X3Q6OnN0cmlkZSAqIHIudG9wKSAqIGJwcDsKLSAgICAgICAgICAgICAgICAgICAgdWludDhfdCogcyA9IHNjcmVlbl9zcmMgKyBvOwotICAgICAgICAgICAgICAgICAgICB1aW50OF90KiBkID0gc2NyZWVuX2RzdCArIG87Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzaXplID09IGJwcikgewotICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSAqPSBoOwotICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KGQsIHMsIHNpemUpOwotICAgICAgICAgICAgICAgICAgICAgICAgZCArPSBicHI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzICs9IGJwcjsKLSAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1oID4gMCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIEVHTERpc3BsYXlTdXJmYWNlOjpjb3B5RnJvbnRUb0ltYWdlKGNvbnN0IGNvcHliaXRfaW1hZ2VfdCYgZHN0KQotewotI2lmIEhBVkVfQU5EUk9JRF9PUwotICAgIGlmIChtQmxpdEVuZ2luZSkgewotICAgICAgICBjb3B5Yml0X2ltYWdlX3Qgc3JjID0gewotICAgICAgICAgICAgICAgIHc6ICAgICAgZWdsX25hdGl2ZV93aW5kb3dfdDo6c3RyaWRlLAotICAgICAgICAgICAgICAgIGg6ICAgICAgZWdsX25hdGl2ZV93aW5kb3dfdDo6aGVpZ2h0LAotICAgICAgICAgICAgICAgIGZvcm1hdDogZWdsX25hdGl2ZV93aW5kb3dfdDo6Zm9ybWF0LAotICAgICAgICAgICAgICAgIG9mZnNldDogbUZiW21JbmRleF0uZGF0YSAtIG1GYlswXS5kYXRhLAotICAgICAgICAgICAgICAgIGJhc2U6ICAgKHZvaWQqKWVnbF9uYXRpdmVfd2luZG93X3Q6OmJhc2UsCi0gICAgICAgICAgICAgICAgZmQ6ICAgICBlZ2xfbmF0aXZlX3dpbmRvd190Ojpm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gICAgICAgICB1aW50NjRfdCggaW5mby51cHBlcl9tYXJnaW4gKyBpbmZvLmxvd2VyX21hcmdpbiArIGluZm8ueXJlcyApCi0gICAgICAgICAgICAqICggaW5mby5sZWZ0X21hcmdpbiAgKyBpbmZvLnJpZ2h0X21hcmdpbiArIGluZm8ueHJlcyApCi0gICAgICAgICAgICAqIGluZm8ucGl4Y2xvY2sKLSAgICApOwotCi0gICAgaWYgKHJlZnJlc2hSYXRlID09IDApIHsKLSAgICAgICAgLy8gYmxlYWdoLCBiYWQgaW5mbyBmcm9tIHRoZSBkcml2ZXIKLSAgICAgICAgcmVmcmVzaFJhdGUgPSA2MCoxMDAwOyAgLy8gNjAgSHoKLSAgICB9Ci0gICAgaWYgKGludChpbmZvLndpZHRoKSA8PSAwIHx8IGludChpbmZvLmhlaWdodCkgPD0gMCkgewotICAgICAgICAvLyB0aGUgZHJpdmVyIGRvZXNuJ3QgcmV0dXJuIHRoYXQgaW5mb3JtYXRpb24KLSAgICAgICAgLy8gZGVmYXVsdCB0byAxNjAgZHBpCi0gICAgICAgIGluZm8ud2lkdGggID0gKChpbmZvLnhyZXMgKiAyNS40ZikvMTYwLjBmICsgMC41Zik7Ci0gICAgICAgIGluZm8uaGVpZ2h0ID0gKChpbmZvLnlyZXMgKiAyNS40ZikvMTYwLjBmICsgMC41Zik7Ci0gICAgfQotCi0gICAgZmxvYXQgeGRwaSA9IChpbmZvLnhyZXMgKiAyNS40ZikgLyBpbmZvLndpZHRoOwotICAgIGZsb2F0IHlkcGkgPSAoaW5mby55cmVzICogMjUuNGYpIC8gaW5mby5oZWlnaHQ7Ci0gICAgZmxvYXQgZnBzICA9IHJlZnJlc2hSYXRlIC8gMTAwMC4wZjsKLQotICAgIExPR0koICAgInVzaW5nIChmZD0lZClcbiIKLSAgICAgICAgICAgICJpZCAgICAgICAgICAgPSAlc1xuIgotICAgICAgICAgICAgInhyZXMgICAgICAgICA9ICVkIHB4XG4iCi0gICAgICAgICAgICAieXJlcyAgICAgICAgID0gJWQgcHhcbiIKLSAgICAgICAgICAgICJ4cmVzX3ZpcnR1YWwgPSAlZCBweFxuIgotICAgICAgICAgICAgInlyZXNfdmlydHVhbCA9ICVkIHB4XG4iCi0gICAgICAgICAgICAiYnBwICAgICAgICAgID0gJWRcbiIKLSAgICAgICAgICAgICJyICAgICAgICAgICAgPSAlMnU6JXVcbiIKLSAgICAgICAgICAgICJnICAgICAgICAgICAgPSAlMnU6JXVcbiIKLSAgICAgICAgICAgICJiICAgICAgICAgICAgPSAlMnU6JXVcbiIsCi0gICAgICAgICAgICBmZCwKLSAgICAgICAgICAgIGZpbmZvLmlkLAotICAgICAgICAgICAgaW5mby54cmVzLAotICAgICAgICAgICAgaW5mby55cmVzLAotICAgICAgICAgICAgaW5mby54cmVzX3ZpcnR1YWwsCi0gICAgICAgICAgICBpbmZvLnlyZXNfdmlydHVhbCwKLSAgICAgICAgICAgIGluZm8uYml0c19wZXJfcGl4ZWwsCi0gICAgICAgICAgICBpbmZvLnJlZC5vZmZzZXQsIGluZm8ucmVkLmxlbmd0aCwKLSAgICAgICAgICAgIGluZm8uZ3JlZW4ub2Zmc2V0LCBpbmZvLmdyZWVuLmxlbmd0aCwKLSAgICAgICAgICAgIGluZm8uYmx1ZS5vZmZzZXQsIGluZm8uYmx1ZS5sZW5ndGgKLSAgICApOwotCi0gICAgTE9HSSggICAid2lkdGggICAgICAgID0gJWQgbW0gKCVmIGRwaSlcbiIKLSAgICAgICAgICAgICJoZWlnaHQgICAgICAgPSAlZCBtbSAoJWYgZHBpKVxuIgotICAgICAgICAgICAgInJlZnJlc2ggcmF0ZSA9ICUuMmYgSHpcbiIsCi0gICAgICAgICAgICBpbmZvLndpZHRoLCAgeGRwaSwKLSAgICAgICAgICAgIGluZm8uaGVpZ2h0LCB5ZHBpLAotICAgICAgICAgICAgZnBzCi0gICAgKTsKLQotCi0gICAgaWYgKGlvY3RsKGZkLCBGQklPR0VUX0ZTQ1JFRU5JTkZPLCAmZmluZm8pID09IC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ICAgICAgIGNhc2UgRUdMX0JBRF9DT05URVhUOiAgICAgICByZXR1cm4gIkVHTF9CQURfQ09OVEVYVCI7CisgICAgICAgIGNhc2UgRUdMX0JBRF9DVVJSRU5UX1NVUkZBQ0U6IHJldHVybiAiRUdMX0JBRF9DVVJSRU5UX1NVUkZBQ0UiOworICAgICAgICBjYXNlIEVHTF9CQURfRElTUExBWTogICAgICAgcmV0dXJuICJFR0xfQkFEX0RJU1BMQVkiOworICAgICAgICBjYXNlIEVHTF9CQURfTUFUQ0g6ICAgICAgICAgcmV0dXJuICJFR0xfQkFEX01BVENIIjsKKyAgICAgICAgY2FzZSBFR0xfQkFEX05BVElWRV9QSVhNQVA6IHJldHVybiAiRUdMX0JBRF9OQVRJVkVfUElYTUFQIjsKKyAgICAgICAgY2FzZSBFR0xfQkFEX05BVElWRV9XSU5ET1c6IHJldHVybiAiRUdMX0JBRF9OQVRJVkVfV0lORE9XIjsKKyAgICAgICAgY2FzZSBFR0xfQkFEX1BBUkFNRVRFUjogICAgIHJldHVybiAiRUdMX0JBRF9QQVJBTUVURVIiOworICAgICAgICBjYXNlIEVHTF9CQURfU1VSRkFDRTogICAgICAgcmV0dXJuICJFR0xfQkFEX1NVUkZBQ0UiOworICAgICAgICBjYXNlIEVHTF9DT05URVhUX0xPU1Q6ICAgICAgcmV0dXJuICJFR0xfQ09OVEVYVF9MT1NUIjsKKyAgICAgICAgZGVmYXVsdDogcmV0dXJuICJVTktOT1dOIjsKKyAgICB9Cit9CisKK3N0YXR1c190IEVHTFV0aWxzOjpzZWxlY3RDb25maWdGb3JQaXhlbEZvcm1hdCgKKyAgICAgICAgRUdMRGlzcGxheSBkcHksCisgICAgICAgIEVHTGludCBjb25zdCogYXR0cnMsCisgICAgICAgIFBpeGVsRm9ybWF0IGZvcm1hdCwKKyAgICAgICAgRUdMQ29uZmlnKiBvdXRDb25maWcpCit7CisgICAgRUdMaW50IG51bUNvbmZpZ3MgPSAtMSwgbj0wOworCisgICAgaWYgKCFh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NvbnN0IGludCBmYlN6QiA9IGZiRm9ybWF0SW5mby5nZXRTaXplKFBpeGVsRm9ybWF0SW5mbzo6SU5ERVhfQkxVRSk7IAorICAgIAorICAgIGludCBpOworICAgIEVHTENvbmZpZyBjb25maWcgPSBOVUxMOworICAgIGZvciAoaT0wIDsgaTxuIDsgaSsrKSB7CisgICAgICAgIEVHTGludCByLGcsYixhOworICAgICAgICBFR0xDb25maWcgY3VyciA9IGNvbmZpZ3NbaV07CisgICAgICAgIGVnbEdldENvbmZpZ0F0dHJpYihkcHksIGN1cnIsIEVHTF9SRURfU0laRSwgICAmcik7CisgICAgICAgIGVnbEdldENvbmZpZ0F0dHJpYihkcHksIGN1cnIsIEVHTF9HUkVFTl9TSVpFLCAmZyk7CisgICAgICAgIGVnbEdldENvbmZpZ0F0dHJpYihkcHksIGN1cnIsIEVHTF9CTFVFX1NJWkUsICAmYik7CisgICAgICAgIGVnbEdldENvbmZpZ0F0dHJpYihkcHksIGN1cnIsIEVHTF9BTFBIQV9TSVpFLCAmYSk7CisgICAgICAgIGlmIChmYlN6QSA9PSBhICYmIGZiU3pSID09IHIgJiYgZmJTekcgPT0gZyAmJiBmYlN6QiAgPT0gYikgeworICAgICAgICAgICAgY29uZmlnID0gY3VycjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgZnJlZShjb25maWdzKTsKKyAgICAKKyAgICBpZiAoaTxuKSB7CisgICAgICAgICpvdXRDb25maWcgPSBjb25maWc7CisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9CisKKyAgICByZXR1cm4gTkFNRV9OT1RfRk9VTkQ7Cit9CisKK3N0YXR1c190IEVHTFV0aWxzOjpzZWxlY3RDb25maWdGb3JOYXRpdmVXaW5kb3coCisgICAgICAgIEVHTERpc3BsYXkgZHB5LAorICAgICAgICBFR0xpbnQgY29uc3QqIGF0dHJzLAorICAgICAgICBFR0xOYXRpdmVXaW5kb3dUeXBlIHdpbmRvdywKKyAg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ICAgcmV0dXJuIDA7CiB9CiAKK3N0YXR1c190IEV2ZW50SHViOjpzY2FuY29kZVRvS2V5Y29kZShpbnQzMl90IGRldmljZUlkLCBpbnQgc2NhbmNvZGUsCisgICAgICAgIGludDMyX3QqIG91dEtleWNvZGUsIHVpbnQzMl90KiBvdXRGbGFncykgY29uc3QKK3sKKyAgICBBdXRvTXV0ZXggX2wobUxvY2spOworICAgIGRldmljZV90KiBkZXZpY2UgPSBnZXREZXZpY2UoZGV2aWNlSWQpOworICAgIAorICAgIGlmIChkZXZpY2UgIT0gTlVMTCAmJiBkZXZpY2UtPmxheW91dE1hcCAhPSBOVUxMKSB7CisgICAgICAgIHN0YXR1c190IGVyciA9IGRldmljZS0+bGF5b3V0TWFwLT5tYXAoc2NhbmNvZGUsIG91dEtleWNvZGUsIG91dEZsYWdzKTsKKyAgICAgICAgaWYgKGVyciA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIGlmIChtSGF2ZUZpcnN0S2V5Ym9hcmQpIHsKKyAgICAgICAgZGV2aWNlID0gZ2V0RGV2aWNlKG1GaXJzdEtleWJvYXJkSWQpOworICAgICAgICAKKyAgICAgICAgaWYgKGRldmljZSAhPSBOVUxMICYmIGRldmljZS0+bGF5b3V0TWFwICE9IE5VTEwpIHsKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGRldmljZS0+bGF5b3V0TWFwLT5tYXAoc2NhbmNvZGUsIG91dEtleWNvZGUsIG91dEZsYWdzKTsKKyAgICAgICAgICAgIGlmIChlcnIgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgKm91dEtleWNvZGUgPSAwOworICAgICpvdXRGbGFncyA9IDA7CisgICAgcmV0dXJuIE5BTUVfTk9UX0ZPVU5EOworfQorCit2b2lkIE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WQgbGlzdAorICAgIExpc3Q8U3RyaW5nOD46Oml0ZXJhdG9yIGl0ZXIgPSBtRXhjbHVkZWREZXZpY2VzLmJlZ2luKCk7CisgICAgTGlzdDxTdHJpbmc4Pjo6aXRlcmF0b3IgZW5kID0gbUV4Y2x1ZGVkRGV2aWNlcy5lbmQoKTsKKyAgICBmb3IgKCA7IGl0ZXIgIT0gZW5kOyBpdGVyKyspIHsKKyAgICAgICAgY29uc3QgY2hhciogdGVzdCA9ICppdGVyOworICAgICAgICBpZiAoc3RyY21wKG5hbWUsIHRlc3QpID09IDApIHsKKyAgICAgICAgICAgIExPR0koImlnbm9yaW5nIGV2ZW50IGlkICVzIGRyaXZlciAlc1xuIiwgZGV2aWNlTmFtZSwgdGVzdCk7CisgICAgICAgICAgICBjbG9zZShmZCk7CisgICAgICAgICAgICBmZCA9IC0xOworICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9CisgICAgfQorCiAgICAgaWYoaW9jdGwoZmQsIEVWSU9DR1BIWVMoc2l6ZW9mKGxvY2F0aW9uKSAtIDEpLCAmbG9jYXRpb24pIDwgMSkgewogICAgICAgICAvL2ZwcmludGYoc3RkZXJyLCAiY291bGQgbm90IGdldCBsb2NhdGlvbiBmb3IgJXMsICVzXG4iLCBkZXZpY2VOYW1lLCBzdHJlcnJvcihlcnJubykpOwogICAgICAgICBsb2NhdGlvblswXSA9ICdcMCc7CkBAIC01MzEsNyArNTkzLDcgQEAKICAgICAgICAgdmVyc2lvbiA+PiAxNiwgKHZlcnNpb24gPj4gOCkgJiAweGZmLCB2ZXJzaW9uICYgMHhmZik7CiAjZW5kaWYKIAotICAgIGRldmljZV90KiBkZXZpY2UgPSBuZXcgZGV2aWNlX3QoZGV2aWR8bURldmljZXNCeUlkW2RldmlkXS5zZXEsIGRldmljZU5hbWUpOworICAgIGRldmljZV90KiBkZXZpY2UgPSBuZXcgZGV2aWNlX3QoZGV2aWR8bURldmljZXNCeUlkW2RldmlkXS5zZXEsIGRldmlj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mKGFic19iaXRtYXNrKSksIGFic19iaXRtYXNrKSA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodGVzdF9iaXQoQUJTX1gsIGFic19iaXRtYXNrKSAmJiB0ZXN0X2JpdChBQlNfWSwgYWJzX2JpdG1hc2spKSB7Ci0gICAgICAgICAgICAgICAgZGV2aWNlLT5jbGFzc2VzIHw9IENMQVNTX1RPVUNIU0NSRUVOOwotICAgICAgICAgICAgfQotICAgICAgICB9CisgICAgCisgICAgdWludDhfdCBhYnNfYml0bWFza1soQUJTX01BWCsxKS84XTsKKyAgICBtZW1zZXQoYWJzX2JpdG1hc2ssIDAsIHNpemVvZihhYnNfYml0bWFzaykpOworICAgIExPR1YoIkdldHRpbmcgYWJzb2x1dGUgY29udHJvbGxlcnMuLi4iKTsKKyAgICBpb2N0bChmZCwgRVZJT0NHQklUKEVWX0FCUywgc2l6ZW9mKGFic19iaXRtYXNrKSksIGFic19iaXRtYXNrKTsKKyAgICAKKyAgICAvLyBJcyB0aGlzIGEgbmV3IG1vZGVybiBtdWx0aS10b3VjaCBkcml2ZXI/CisgICAgaWYgKHRlc3RfYml0KEFCU19NVF9UT1VDSF9NQUpPUiwgYWJzX2JpdG1hc2spCisgICAgICAgICAgICAmJiB0ZXN0X2JpdChBQlNfTVRfUE9TSVRJT05fWCwgYWJzX2JpdG1hc2spCisgICAgICAgICAgICAmJiB0ZXN0X2JpdChBQlNfTVRfUE9TSVRJT05fWSwgYWJzX2JpdG1hc2spKSB7CisgICAgICAgIGRldmljZS0+Y2xhc3NlcyB8PSBDTEFTU19UT1VDSFNDUkVFTiB8IENMQVNTX1RPVUNIU0NSRUVOX01UOworICAgICAgICAKKyAgICAvLyBJcyB0aGlzIGFuIG9sZCBzdHlsZSBzaW5nbGUtdG91Y2ggZHJpdmVyPworICAgIH0gZWxzZSBpZiAodGVzdF9iaXQoQlROX1RPVUNILCBrZXlfYml0bWFzaykKKyAgICAgICAgICAgICYmIHRlc3RfYml0KEFCU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ZERvd24pICYmCisgICAgICAgICAgICAgICAgaGFzS2V5Y29kZShkZXZpY2UsIGtLZXlDb2RlRHBhZExlZnQpICYmCisgICAgICAgICAgICAgICAgaGFzS2V5Y29kZShkZXZpY2UsIGtLZXlDb2RlRHBhZFJpZ2h0KSAmJgorICAgICAgICAgICAgICAgIGhhc0tleWNvZGUoZGV2aWNlLCBrS2V5Q29kZURwYWRDZW50ZXIpKSB7CisgICAgICAgICAgICBkZXZpY2UtPmNsYXNzZXMgfD0gQ0xBU1NfRFBBRDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgTE9HSSgiTmV3IGtleWJvYXJkOiBwdWJsaWNJRD0lZCBkZXZpY2UtPmlkPTB4JXggZGV2bmFtZT0nJXMnIHByb3BOYW1lPSclcycga2V5bGF5b3V0PSclcydcbiIsCisgICAgICAgICAgICAgICAgcHVibGljSUQsIGRldmljZS0+aWQsIG5hbWUsIHByb3BOYW1lLCBrZXlsYXlvdXRGaWxlbmFtZSk7CiAgICAgfQogCisgICAgTE9HSSgiTmV3IGRldmljZTogcGF0aD0lcyBuYW1lPSVzIGlkPTB4JXggKG9mIDB4JXgpIGluZGV4PSVkIGZkPSVkIGNsYXNzZXM9MHgleFxuIiwKKyAgICAgICAgIGRldmljZU5hbWUsIG5hbWUsIGRldmljZS0+aWQsIG1OdW1EZXZpY2VzQnlJZCwgbUZEQ291bnQsIGZkLCBkZXZpY2UtPmNsYXNzZXMpOworICAgICAgICAgCiAgICAgTE9HVigiQWRkaW5nIGRldmljZSAlcyAlcCBhdCAlZCwgaWQgPSAlZCwgY2xhc3NlcyA9IDB4JXhcbiIsCiAgICAgICAgICBkZXZpY2VOYW1lLCBkZXZpY2UsIG1GRENvdW50LCBkZXZpZCwgZGV2aWNlLT5jbGFzc2VzKTsKIApAQCAtNjc0LDYgKzc1MywyNSBAQAogICAgIHJldHVybiAwOwogfQogCitib29sIEV2ZW50SHViOjpoYXNLZXljb2RlKGRldmljZV90KiBkZXZpY2UsIGludCBrZXljb2RlKSBjb25zdAoreworICAgIGlmIChkZXZpY2UtPmtleUJpdG1hc2sgPT0gTlVMTCB8fCBkZXZpY2UtPmxheW91dE1hcCA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgCisgICAgVmVjdG9yPGludDMyX3Q+IHNjYW5Db2RlczsKKyAgICBkZXZpY2UtPmxheW91dE1hcC0+ZmluZFNjYW5jb2RlcyhrZXljb2RlLCAmc2NhbkNvZGVzKTsKKyAgICBjb25zdCBzaXplX3QgTiA9IHNjYW5Db2Rlcy5zaXplKCk7CisgICAgZm9yIChzaXplX3QgaT0wOyBpPE4gJiYgaTw9S0VZX01BWDsgaSsrKSB7CisgICAgICAgIGludDMyX3Qgc2MgPSBzY2FuQ29kZXMuaXRlbUF0KGkpOworICAgICAgICBpZiAoc2MgPj0gMCAmJiBzYyA8PSBLRVlfTUFYICYmIHRlc3RfYml0KHNjLCBkZXZpY2UtPmtleUJpdG1hc2spKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICByZXR1cm4gZmFsc2U7Cit9CisKIGludCBFdmVudEh1Yjo6Y2xvc2VfZGV2aWNlKGNvbnN0IGNoYXIgKmRldmljZU5hbWUpCiB7CiAgICAgQXV0b011dGV4IF9sKG1Mb2NrKTsKQEAgLTY4MywxMSArNzgxLDIxIEBACiAgICAgICAgIGlmKHN0cmNtcChtRGV2aWNlc1tpXS0+cGF0aC5zdHJpbmcoKSwgZGV2aWNlTmFtZSkgPT0gMCkgewogICAgICAgICAgICAgLy9MT0dEKCJyZW1vdmUgZGV2aWNlICVkOiAlc1xuIiwgaSwgZGV2aWNlTmFtZSk7CiAgICAgICAgICAgICBkZXZpY2VfdCogZGV2aWNlID0gbURldmljZXNbaV07Ci0gICAgICAgICAgICBpbnQgY291bnQgPSBtRkRDb3VudCAtIGkgLSAxOworICAgICAgICAgICAgCisgICAgICAgICAgICBMT0dJKCJSZW1vdmVkIGRldmljZTogcGF0aD0lcyBuYW1lPSVzIGlkPTB4JXggKG9mIDB4JXgpIGluZGV4PSVkIGZkPSVkIGNsYXNzZXM9MHgleFxuIiwKKyAgICAgICAgICAgICAgICAgZGV2aWNlLT5wYXRoLnN0cmluZygpLCBkZXZpY2UtPm5hbWUuc3RyaW5nKCksIGRldmljZS0+aWQsCisgICAgICAgICAgICAgICAgIG1OdW1EZXZpY2VzQnlJZCwgbUZEQ291bnQsIG1GRHNbaV0uZmQsIGRldmljZS0+Y2xhc3Nlcyk7CisgICAgICAgICAKKyAgICAgICAgICAgIC8vIENsZWFyIHRoaXMgZGV2aWNlJ3MgZW50cnkuCiAgICAgICAgICAgICBpbnQgaW5kZXggPSAoZGV2aWNlLT5pZCZJRF9NQVNLKTsKICAgICAgICAgICAgIG1EZXZpY2VzQnlJZFtpbmRleF0uZGV2aWNlID0gTlVMTDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gQ2xvc2UgdGhlIGZpbGUgZGVzY3JpcHRvciBhbmQgY29tcGFjdCB0aGUgZmQgYXJyYXkuCisgICAgICAgICAgICBjbG9zZShtRkRzW2ldLmZkKTsKKyAgICAgICAgICAgIGludCBjb3VudCA9IG1GRENvdW50IC0gaSAtIDE7CiAgICAgICAgICAgICBtZW1tb3ZlKG1EZXZpY2VzICsgaSwgbURldmljZXMgKyBpICsgMSwgc2l6ZW9mKG1EZXZpY2VzWzBdKSAqIGNvdW50KTsKICAgICAgICAgICAgIG1lbW1vdmUobUZEcyArIGksIG1GRHMgKyBpICsgMSwgc2l6ZW9mKG1GRHNbMF0pICogY291bnQpOworICAgICAgICAgICAgbUZEQ291bnQtLTsKIAogI2lmZGVmIEVWX1NXCiAgICAgICAgICAgICBmb3IgKGludCBqPTA7IGo8RVZfU1c7IGorKykgewpAQCAtNzAwLDggKzgwOCw2IEBACiAgICAgICAgICAgICBkZXZpY2UtPm5leHQgPSBtQ2xvc2luZ0RldmljZXM7CiAgICAgICAgICAgICBtQ2xvc2luZ0RldmljZXMgPSBkZXZpY2U7CiAKLSAgICAgICAgICAgIG1GRENvdW50LS07Ci0KICAgICAgICAgICAgIHVpbnQzMl90IHB1YmxpY0lEOwogICAgICAgICAgICAgaWYgKGRldmljZS0+aWQgPT0gbUZpcnN0S2V5Ym9hcmRJZCkgewogICAgICAgICAgICAgICAgIExPR1coImJ1aWx0LWluIGtleWJvYXJkIGRldmljZSAlcyAoaWQ9JWQpIGlzIGNsb3NpbmchIHRoZSBhcHBzIHdpbGwgbm90IGxpa2UgdGhpcyIsCkBAIC03MTgsNyArODI0LDcgQEAKICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICB9CiAgICAgfQotICAgIExPR0UoInJlbW90ZSBkZXZpY2U6ICVzIG5vdCBmb3VuZFxuIiwgZGV2aWNlTmFtZSk7CisgICAgTE9HRSgicmVtb3ZlIGRldmljZTogJXMgbm90IGZvdW5kXG4iLCBkZXZpY2VOYW1lKTsKICAgICByZXR1cm4gLTE7CiB9CiAKQEAgLTczMyw2ICs4MzksNyBAQAogICAgIGludCBldmVudF9wb3MgPSAwOwogICAgIHN0cnVjdCBpbm90aWZ5X2V2ZW50ICpldmVudDsKIAorICAgIExPR1YoIkV2ZW50SHViOjpyZWFkX25vdGlmeSBuZmQ6ICVkXG4iLCBuZmQpOwogICAgIHJlcyA9IHJlYWQobmZkLCBldmVudF9idWYsIHNpemVvZihldmVudF9idWYpKTsKICAgICBpZihyZXMgPCAoaW50KXNpemVvZigqZXZlbnQpKSB7CiAgICAgICAgIGlmKGVycm5vID09IEVJTlRSKQpkaWZmIC0tZ2l0IGEvbGlicy91aS9GcmFtZWJ1ZmZlck5hdGl2ZVdpbmRvdy5jcHAgYi9saWJzL3VpL0ZyYW1lYnVmZmVyTmF0aXZlV2luZG93LmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45MGI1MTYzCi0tLSAvZGV2L251bGwKKysrIGIvbGlicy91aS9Gc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HN0YXR1c190IGVyciA9IEJuSW50ZXJmYWNlPElTdXJmYWNlQ29tcG9zZXI+OjpvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7Ci0gICAgaWYgKGVyciA9PSBOT19FUlJPUikKLSAgICAgICAgcmV0dXJuIGVycjsKLQotICAgIENIRUNLX0lOVEVSRkFDRShJU3VyZmFjZUNvbXBvc2VyLCBkYXRhLCByZXBseSk7Ci0KICAgICBzd2l0Y2goY29kZSkgewogICAgICAgICBjYXNlIENSRUFURV9DT05ORUNUSU9OOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSVN1cmZhY2VDb21wb3NlciwgZGF0YSwgcmVwbHkpOwogICAgICAgICAgICAgc3A8SUJpbmRlcj4gYiA9IGNyZWF0ZUNvbm5lY3Rpb24oKS0+YXNCaW5kZXIoKTsKICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcihiKTsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBPUEVOX0dMT0JBTF9UUkFOU0FDVElPTjogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElTdXJmYWNlQ29tcG9zZXIsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIG9wZW5HbG9iYWxUcmFuc2FjdGlvbigpOwogICAgICAgICB9IGJyZWFrOwogICAgICAgICBjYXNlIENMT1NFX0dMT0JBTF9UUkFOU0FDVElPTjogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElTdXJmYWNlQ29tcG9zZXIsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIGNsb3NlR2xvYmFsVHJhbnNhY3Rpb24oKTsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBTRVRfT1JJRU5UQVRJT046IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJU3VyZmFjZUNvbXBvc2VyLCBkYXRhLCByZXBseSk7CiAgICAgICAgICAgICBEaXNwbGF5SUQgZHB5ID0gZGF0YS5yZWFkSW50MzIoKTsKICAgICAgICAgICAgIGludCBvcmllbnRhdGlvbiA9IGRhdGEucmVhZEludDMyKCk7CiAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyA9IGRhdGEucmVhZEludDMyKCk7CiAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggc2V0T3JpZW50YXRpb24oZHB5LCBvcmllbnRhdGlvbiwgZmxhZ3MpICk7CiAgICAgICAgIH0gYnJlYWs7CiAgICAgICAgIGNhc2UgRlJFRVpFX0RJU1BMQVk6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJU3VyZmFjZUNvbXBvc2VyLCBkYXRhLCByZXBseSk7CiAgICAgICAgICAgICBEaXNwbGF5SUQgZHB5ID0gZGF0YS5yZWFkSW50MzIoKTsKICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gZGF0YS5yZWFkSW50MzIoKTsKICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBmcmVlemVEaXNwbGF5KGRweSwgZmxhZ3MpICk7CiAgICAgICAgIH0gYnJlYWs7CiAgICAgICAgIGNhc2UgVU5GUkVFWkVfRElTUExBWTogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElTdXJmYWNlQ29tcG9zZXIsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIERpc3BsYXlJRCBkcHkgPSBkYXRhLnJlYWRJbnQzMigpOwogICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSBkYXRhLnJlYWRJbnQzMigpOwogICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIHVuZnJlZXplRGlzcGxheShkcHksIGZsYWdzKSApOwogICAgICAgICB9IGJyZWFrOwogICAgICAgICBjYXNlIEJPT1RfRklOSVNIRUQ6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJU3VyZmFjZUNvbXBvc2VyLCBkYXRhLCByZXBseSk7CiAgICAgICAgICAgICBib290RmluaXNoZWQoKTsKICAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBSRVZPS0VfR1BVOiB7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggcmV2b2tlR1BVKCkgKTsKLSAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBTSUdOQUw6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJU3VyZmFjZUNvbXBvc2VyLCBkYXRhLCByZXBseSk7CiAgICAgICAgICAgICBzaWduYWwoKTsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBHRVRfQ0JMSzogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElTdXJmYWNlQ29tcG9zZXIsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIHNwPElCaW5kZXI+IGIgPSBnZXRDYmxrKCktPmFzQmluZGVyKCk7CiAgICAgICAgICAgICByZXBseS0+d3JpdGVTdHJvbmdCaW5kZXIoYik7CiAgICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVRVUVTVF9HUFU6IHsKLSAgICAgICAgICAgIC8vIFRPRE86IHRoaXMgc2hvdWxkIGJlIHByb3RlY3RlZCBieSBhIHBlcm1pc3Npb24KLSAgICAgICAgICAgIGdwdV9pbmZvX3QgaW5mbzsKLSAgICAgICAgICAgIHNwPElHUFVDYWxsYmFjaz4gY2FsbGJhY2sKLSAgICAgICAgICAgICAgICA9IGludGVyZmFjZV9jYXN0PElHUFVDYWxsYmFjaz4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICAgICAgc3RhdHVzX3QgcmVzID0gcmVxdWVzdEdQVShjYWxsYmFjaywgJmluZm8pOwotCi0gICAgICAgICAgICAvLyBGSVhNRTogZm9yIG5vdywgd2UgZG9uJ3QgZHluYW1pY2FsbHkgYWxsb2NhdGUgdGhlIHJlZ2lvbnMgYXJyYXkKLSAgICAgICAgICAg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cHRpbWFsIHJlZ2lvbi4KK2NsYXNzIFJlZ2lvbjo6cmFzdGVyaXplciA6IHB1YmxpYyByZWdpb25fb3BlcmF0b3I8UmVjdD46OnJlZ2lvbl9yYXN0ZXJpemVyIAogeworICAgIFJlY3QmIGJvdW5kczsKKyAgICBWZWN0b3I8UmVjdD4mIHN0b3JhZ2U7CisgICAgUmVjdCogaGVhZDsKKyAgICBSZWN0KiB0YWlsOworICAgIFZlY3RvcjxSZWN0PiBzcGFuOworICAgIFJlY3QqIGN1cjsKK3B1YmxpYzoKKyAgICByYXN0ZXJpemVyKFJlZ2lvbiYgcmVnKSAKKyAgICAgICAgOiBib3VuZHMocmVnLm1Cb3VuZHMpLCBzdG9yYWdlKHJlZy5tU3RvcmFnZSksIGhlYWQoKSwgdGFpbCgpLCBjdXIoKSB7CisgICAgICAgIGJvdW5kcy50b3AgPSBib3VuZHMuYm90dG9tID0gMDsKKyAgICAgICAgYm91bmRzLmxlZnQgICA9IElOVF9NQVg7CisgICAgICAgIGJvdW5kcy5yaWdodCAgPSBJTlRfTUlOOworICAgICAgICBzdG9yYWdlLmNsZWFyKCk7CisgICAgfQorCisgICAgfnJhc3Rlcml6ZXIoKSB7CisgICAgICAgIGlmIChzcGFuLnNpemUoKSkgeworICAgICAgICAgICAgZmx1c2hTcGFuKCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHN0b3JhZ2Uuc2l6ZSgpKSB7CisgICAgICAgICAgICBib3VuZHMudG9wID0gc3RvcmFnZS5pdGVtQXQoMCkudG9wOworICAgICAgICAgICAgYm91bmRzLmJvdHRvbSA9IHN0b3JhZ2UudG9wKCkuYm90dG9tOworICAgICAgICAgICAgaWYgKHN0b3JhZ2Uuc2l6ZSgpID09IDEpIHsKKyAgICAgICAgICAgICAgICBzdG9yYWdlLmNsZWFyKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBib3VuZHMubGVmdCAgPSAwOworICAgICAgICAgICAgYm91bmRzLnJpZ2h0ID0gMDsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2aXJ0dWFsIHZvaWQgb3BlcmF0b3IoKShjb25zdCBSZWN0JiByZWN0KSB7CisgICAgICAgIC8vTE9HRCgiPj4+ICUzZCwgJTNkLCAlM2QsICUzZCIsIAorICAgICAgICAvLyAgICAgICAgcmVjdC5sZWZ0LCByZWN0LnRvcCwgcmVjdC5yaWdodCwgcmVjdC5ib3R0b20pOworICAgICAgICBpZiAoc3Bhbi5zaXplKCkpIHsKKyAgICAgICAgICAgIGlmIChjdXItPnRvcCAhPSByZWN0LnRvcCkgeworICAgICAgICAgICAgICAgIGZsdXNoU3BhbigpOworICAgICAgICAgICAgfSBlbHNlIGlmIChjdXItPnJpZ2h0ID09IHJlY3QubGVmdCkgeworICAgICAgICAgICAgICAgIGN1ci0+cmlnaHQgPSByZWN0LnJpZ2h0OworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBzcGFuLmFkZChyZWN0KTsKKyAgICAgICAgY3VyID0gc3Bhbi5lZGl0QXJyYXkoKSArIChzcGFuLnNpemUoKSAtIDEpOworICAgIH0KK3ByaXZhdGU6CisgICAgdGVtcGxhdGU8dHlwZW5hbWUgVD4gCisgICAgc3RhdGljIGlubGluZSBUIG1pbihUIHJocywgVCBsaHMpIHsgcmV0dXJuIHJocyA8IGxocyA/IHJocyA6IGxoczsgfQorICAgIHRlbXBsYXRlPHR5cGVuYW1lIFQ+IAorICAgIHN0YXRpYyBpbmxpbmUgVCBtYXgoVCByaHMsIFQgbGhzKSB7IHJldHVybiByaHMgPiBsaHMgPyByaHMgOiBsaHM7IH0KKyAgICB2b2lkIGZsdXNoU3BhbigpIHsKKyAgICAgICAgYm9vbCBtZXJnZSA9IGZhbHNlOworICAgICAgICBpZiAodGFpbC1oZWFkID09IHNzaXplX3Qoc3Bhbi5zaXplKCkpKSB7CisgICAgICAgICAgICBSZWN0IGNvbnN0KiBwID0gY3VyOworICAgICAgICAgICAgUmVjdCBjb25zdCogcSA9IGhlYWQ7CisgICAgICAgICAgICBpZiAocC0+dG9wID09IHEtPmJvdHRvbSkgeworICAgICAgICAgICAgICAgIG1lcmdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB3aGlsZSAocSAhPSB0YWlsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgocC0+bGVmdCAhPSBxLT5sZWZ0KSB8fCAocC0+cmlnaHQgIT0gcS0+cmlnaHQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtZXJnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcCsrLCBxKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtZXJnZSkgeworICAgICAgICAgICAgY29uc3QgaW50IGJvdHRvbSA9IHNwYW5bMF0uYm90dG9tOworICAgICAgICAgICAgUmVjdCogciA9IGhlYWQ7CisgICAgICAgICAgICB3aGlsZSAociAhPSB0YWlsKSB7CisgICAgICAgICAgICAgICAgci0+Ym90dG9tID0gYm90dG9tOworICAgICAgICAgICAgICAgIHIrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGJvdW5kcy5sZWZ0ID0gbWluKHNwYW4uaXRlbUF0KDApLmxlZnQsIGJvdW5kcy5sZWZ0KTsKKyAgICAgICAgICAgIGJvdW5kcy5yaWdodCA9IG1heChzcGFuLnRvcCgpLnJpZ2h0LCBib3VuZHMucmlnaHQpOworICAgICAgICAgICAgc3RvcmFnZS5hcHBlbmRWZWN0b3Ioc3Bhbik7CisgICAgICAgICAgICB0YWlsID0gc3RvcmFnZS5lZGl0QXJyYXkoKSArIHN0b3JhZ2Uuc2l6ZSgpOworICAgICAgICAgICAgaGVhZCA9IHRhaWwgLSBzcGFuLnNpemUoKTsKKyAgICAgICAgfQorICAgICAgICBzcGFuLmNsZWFyKCk7CisgICAgfQorfTsKKworYm9vbCBSZWdpb246OnZhbGlkYXRlKGNvbnN0IFJlZ2lvbiYgcmVnLCBjb25zdCBjaGFyKiBuYW1lKQoreworICAgIGJvb2wgcmVzdWx0ID0gdHJ1ZTsKKyAgICBjb25zdF9pdGVyYXRvciBjdXIgPSByZWcuYmVnaW4oKTsKKyAgICBjb25zdF9pdGVyYXRvciBjb25zdCB0YWlsID0gcmVnLmVuZCgpOworICAgIGNvbnN0X2l0ZXJhdG9yIHByZXYgPSBjdXIrKzsKKyAgICBSZWN0IGIoKnByZXYpOworICAgIHdoaWxlIChjdXIgIT0gdGFpbCkgeworICAgICAgICBiLmxlZnQgICA9IGIubGVmdCAgIDwgY3VyLT5sZWZ0ICAgPyBiLmxlZnQgICA6IGN1ci0+bGVmdDsKKyAgICAgICAgYi50b3AgICAgPSBiLnRvcCAgICA8IGN1ci0+dG9wICAgID8gYi50b3AgICAgOiBjdXItPnRvcDsKKyAgICAgICAgYi5yaWdodCAgPSBiLnJpZ2h0ICA+IGN1ci0+cmlnaHQgID8gYi5yaWdodCAgOiBjdXItPnJpZ2h0OworICAgICAgICBiLmJvdHRvbSA9IGIuYm90dG9tID4gY3VyLT5ib3R0b20gPyBiLmJvdHRvbSA6IGN1ci0+Ym90dG9tOworICAgICAgICBpZiAoY3VyLT50b3AgPT0gcHJldi0+dG9wKSB7CisgICAgICAgICAgICBpZiAoY3VyLT5ib3R0b20gIT0gcHJldi0+Ym90dG9tKSB7CisgICAgICAgICAgICAgICAgTE9HRSgiJXM6IGludmFsaWQgc3BhbiAlcCIsIG5hbWUsIGN1cik7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGN1ci0+bGVmdCA8IHByZXYtPnJpZ2h0KSB7CisgICAgICAgICAgICAgICAgTE9HRSgiJXM6IHNwYW5zIG92ZXJsYXAgaG9yaXpvbnRhbGx5IHByZXY9JXAsIGN1cj0lcCIsCisgICAgICAgICAgICAgICAgICAgICAgICBuYW1lLCBwcmV2LCBjdXIpOworICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKGN1ci0+dG9wIDwgcHJldi0+Ym90dG9tKSB7CisgICAgICAgICAgICBMT0dFKCIlczogc3BhbnMgb3ZlcmxhcCB2ZXJ0aWNhbGx5IHByZXY9JXAsIGN1cj0lcCIsCisgICAgICAgICAgICAgICAgICAgIG5hbWUsIHByZXYsIGN1cik7CisgICAgICAgICAgICByZXN1bHQgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBwcmV2ID0gY3VyOworICAgICAgICBjdXIrKzsKKyAgICB9CisgICAgaWYgKGIgIT0gcmVnLmdldEJvdW5kcygpKSB7CisgICAgICAgIHJlc3VsdCA9IGZhbHNlOworICAgICAgICBMT0dFKCIlczogaW52YWxpZCBib3VuZHMgWyVkLCVkLCVkLCVkXSB2cy4gWyVkLCVkLCVkLCVkXSIsIG5hbWUsCisgICAgICAgICAgICAgICAgYi5sZWZ0LCBiLnRvcCwgYi5yaWdodCwgYi5ib3R0b20sCisgICAgICAgICAgICAgICAgcmVnLmdldEJvdW5kcygpLmxlZnQsIHJlZy5nZXRCb3VuZHMoKS50b3AsIAorICAgICAgICAgICAgICAgIHJlZy5nZXRCb3VuZHMoKS5yaWdodCwgcmVnLmdldEJvdW5kcygpLmJvdHRvbSk7CisgICAgfQorICAgIGlmIChyZXN1bHQgPT0gZmFsc2UpIHsKKyAgICAgICAgcmVnLmR1bXAobmFtZSk7CisgICAgfQorICAgIHJldHVybiByZXN1bHQ7CiB9CiAKLWludCBSZWdpb246Oml0ZXJhdG9yOjppdGVyYXRlKFJlY3QqIHJlY3QpCit2b2lkIFJlZ2lvbjo6Ym9vbGVhbl9vcGVyYXRpb24oaW50IG9wLCBSZWdpb24mIGRzdCwKKyA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MsICJib29sZWFuX29wZXJhdGlvbjogbGhzIik7CisgICAgdmFsaWRhdGUocmhzLCAiYm9vbGVhbl9vcGVyYXRpb246IHJocyIpOworICAgIHZhbGlkYXRlKGRzdCwgImJvb2xlYW5fb3BlcmF0aW9uOiBkc3QiKTsKKyNlbmRpZgorCisjaWYgVkFMSURBVEVfV0lUSF9DT1JFQ0cKKyAgICBTa1JlZ2lvbiBza19saHM7CisgICAgU2tSZWdpb24gc2tfcmhzOworICAgIFNrUmVnaW9uIHNrX2RzdDsKKyAgICAKKyAgICBmb3IgKHNpemVfdCBpPTAgOyBpPGxoc19jb3VudCA7IGkrKykKKyAgICAgICAgc2tfbGhzLm9wKAorICAgICAgICAgICAgICAgIGxoc19yZWN0c1tpXS5sZWZ0ICAgKyBkeCwKKyAgICAgICAgICAgICAgICBsaHNfcmVjdHNbaV0udG9wICAgICsgZHksCisgICAgICAgICAgICAgICAgbGhzX3JlY3RzW2ldLnJpZ2h0ICArIGR4LAorICAgICAgICAgICAgICAgIGxoc19yZWN0c1tpXS5ib3R0b20gKyBkeSwKKyAgICAgICAgICAgICAgICBTa1JlZ2lvbjo6a1VuaW9uX09wKTsKKyAgICAKKyAgICBmb3IgKHNpemVfdCBpPTAgOyBpPHJoc19jb3VudCA7IGkrKykKKyAgICAgICAgc2tfcmhzLm9wKAorICAgICAgICAgICAgICAgIHJoc19yZWN0c1tpXS5sZWZ0ICAgKyBkeCwKKyAgICAgICAgICAgICAgICByaHNfcmVjdHNbaV0udG9wICAgICsgZHksCisgICAgICAgICAgICAgICAgcmhzX3JlY3RzW2ldLnJpZ2h0ICArIGR4LAorICAgICAgICAgICAgICAgIHJoc19yZWN0c1tpXS5ib3R0b20gKyBkeSwKKyAgICAgICAgICAgICAgICBTa1JlZ2lvbjo6a1VuaW9uX09wKTsKKyAKKyAgICBjb25zdCBjaGFyKiBuYW1lID0gIi0tLSI7CisgICAgU2tSZWdpb246Ok9wIHNrX29wOworICAgIHN3aXRjaCAob3ApIHsKK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SBmYWxzZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHNhbWUgPSBmYWxzZTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGhlYWQrKzsKKyAgICAgICAgaXQubmV4dCgpOworICAgIH0KKyAgICAKKyAgICBpZiAoaGVhZCAhPSB0YWlsKSB7CisgICAgICAgIHNhbWUgPSBmYWxzZTsKKyAgICB9CisgICAgCisgICAgaWYoIXNhbWUpIHsKKyAgICAgICAgTE9HRCgiLS0tXG5yZWdpb24gYm9vbGVhbiAlcyBmYWlsZWQiLCBuYW1lKTsKKyAgICAgICAgbGhzLmR1bXAoImxocyIpOworICAgICAgICByaHMuZHVtcCgicmhzIik7CisgICAgICAgIGRzdC5kdW1wKCJkc3QiKTsKKyAgICAgICAgTE9HRCgic2hvdWxkIGJlIik7CisgICAgICAgIFNrUmVnaW9uOjpJdGVyYXRvciBpdChza19kc3QpOworICAgICAgICB3aGlsZSAoIWl0LmRvbmUoKSkgeworICAgICAgICAgICAgTE9HRCgiICAgIFslM2QsICUzZCwgJTNkLCAlM2RdIiwKKyAgICAgICAgICAgICAgICBpdC5yZWN0KCkuZkxlZnQsCisgICAgICAgICAgICAgICAgaXQucmVjdCgpLmZUb3AsCisgICAgICAgICAgICAgICAgaXQucmVjdCgpLmZSaWdodCwKKyAgICAgICAgICAgICAgICBpdC5yZWN0KCkuZkJvdHRvbSk7CisgICAgICAgICAgICBpdC5uZXh0KCk7CisgICAgICAgIH0KKyAgICB9CisjZW5kaWYKK30KKwordm9pZCBSZWdpb246OmJvb2xlYW5fb3BlcmF0aW9uKGludCBvcCwgUmVnaW9uJiBkc3QsCisgICAgICAgIGNvbnN0IFJlZ2lvbiYgbGhzLAorICAgICAgICBjb25zdCBSZWN0JiByaHMsIGludCBkeCwgaW50IGR5KQoreworI2lmIFZBTElEQVRFX1dJVEhfQ09SRUNHIHx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cmV0dXJuIHNpemVfdCggc3RhY2suaGVhZCApOworfQorCitTdHJpbmc4IFNoYXJlZEJ1ZmZlckJhc2U6OmR1bXAoY2hhciBjb25zdCogcHJlZml4KSBjb25zdAoreworICAgIGNvbnN0IHNpemVfdCBTSVpFID0gMTAyNDsKKyAgICBjaGFyIGJ1ZmZlcltTSVpFXTsKKyAgICBTdHJpbmc4IHJlc3VsdDsKKyAgICBTaGFyZWRCdWZmZXJTdGFjayYgc3RhY2soICptU2hhcmVkU3RhY2sgKTsKKyAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsIAorICAgICAgICAgICAgIiVzWyBoZWFkPSUyZCwgYXZhaWxhYmxlPSUyZCwgcXVldWVkPSUyZCBdICIKKyAgICAgICAgICAgICJyZWFsbG9jTWFzaz0lMDh4LCBpblVzZT0lMmQsIGlkZW50aXR5PSVkLCBzdGF0dXM9JWRcbiIsCisgICAgICAgICAgICBwcmVmaXgsIHN0YWNrLmhlYWQsIHN0YWNrLmF2YWlsYWJsZSwgc3RhY2sucXVldWVkLCAKKyAgICAgICAgICAgIHN0YWNrLnJlYWxsb2NNYXNrLCBzdGFjay5pblVzZSwgc3RhY2suaWRlbnRpdHksIHN0YWNrLnN0YXR1cyk7CisgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKKworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorLy8gY29uZGl0aW9ucyBhbmQgdXBkYXRlcworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCitTaGFyZWRCdWZmZXJDbGllbnQ6OkRlcXVldWVDb25kaXRpb246OkRlcXVldWVDb25kaXRpb24oCisgICAgICAgIFNoYXJlZEJ1ZmZlckNsaWVudCogc2JjKSA6IENvbmRpdGlvbkJhc2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yY19iaXRzICYmIGRzdF9iaXRzKSB7CisgICAgICAgIC8vIE5PVEU6IGRzdCBhbmQgc3JjIG11c3QgYmUgdGhlIHNhbWUgZm9ybWF0CisgICAgICAgIGNvbnN0IHNpemVfdCBicHAgPSBieXRlc1BlclBpeGVsKHNyYy0+Zm9ybWF0KTsKKyAgICAgICAgY29uc3Qgc2l6ZV90IGRicHIgPSBkc3QtPnN0cmlkZSAqIGJwcDsKKyAgICAgICAgY29uc3Qgc2l6ZV90IHNicHIgPSBzcmMtPnN0cmlkZSAqIGJwcDsKKworICAgICAgICB3aGlsZSAoaGVhZCAhPSB0YWlsKSB7CisgICAgICAgICAgICBjb25zdCBSZWN0JiByKCpoZWFkKyspOworICAgICAgICAgICAgc3NpemVfdCBoID0gci5oZWlnaHQoKTsKKyAgICAgICAgICAgIGlmIChoIDw9IDApIGNvbnRpbnVlOworICAgICAgICAgICAgc2l6ZV90IHNpemUgPSByLndpZHRoKCkgKiBicHA7CisgICAgICAgICAgICB1aW50OF90IGNvbnN0ICogcyA9IHNyY19iaXRzICsgKHIubGVmdCArIHNyYy0+c3RyaWRlICogci50b3ApICogYnBwOworICAgICAgICAgICAgdWludDhfdCAgICAgICAqIGQgPSBkc3RfYml0cyArIChyLmxlZnQgKyBkc3QtPnN0cmlkZSAqIHIudG9wKSAqIGJwcDsKKyAgICAgICAgICAgIGlmIChkYnByPT1zYnByICYmIHNpemU9PXNicHIpIHsKKyAgICAgICAgICAgICAgICBzaXplICo9IGg7CisgICAgICAgICAgICAgICAgaCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgbWVtY3B5KGQsIHMsIHNpemUpOworICAgICAgICAgICAgICAgIGQgKz0gZGJwcjsKKyAgICAgICAgICAgICAgICBzICs9IHNicHI7CisgICAgICAgICAgICB9IHdoaWxlICgtLWggPiAwKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBpZiAoc3JjX2JpdHMpCisgICAgICAgIHNyYy0+dW5sb2NrKCk7CisgICAgCisgICAgaWYgKGRzdF9iaXRzKQorICAgICAgICBkc3QtPnVubG9jaygpOworICAgIAorICAgIHJldHVybiBlcnI7Cit9CisKKy8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy8vICBTdXJmYWNlQ29udHJvbAorLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCitTdXJmYWNlQ29udHJvbDo6U3VyZmFjZUNvbnRyb2woCisgICAgICAgIGNvbnN0IHNwPFN1cmZhY2VDb21wb3NlckNsaWVudD4mIGNsaWVudCwgCiAgICAgICAgIGNvbnN0IHNwPElTdXJmYWNlPiYgc3VyZmFjZSwKICAgICAgICAgY29uc3QgSVN1cmZhY2VGbGluZ2VyQ2xpZW50OjpzdXJmYWNlX2RhdGFfdCYgZGF0YSwKLSAgICAgICAgdWludDMyX3QgdywgdWludDMyX3QgaCwgUGl4ZWxGb3JtYXQgZm9ybWF0LCB1aW50MzJfdCBmbGFncywKLSAgICAgICAgYm9vbCBvd25lcikKKyAgICAgICAgdWludDMyX3QgdywgdWludDMyX3QgaCwgUGl4ZWxGb3JtYXQgZm9ybWF0LCB1aW50MzJfdCBmbGFncykKICAgICA6IG1DbGllbnQoY2xpZW50KSwgbVN1cmZhY2Uoc3VyZmFjZSksCiAgICAgICBtVG9rZW4oZGF0YS50b2tlbiksIG1JZGVudGl0eShkYXRhLmlkZW50aXR5KSwKLSAgICAgIG1Gb3JtYXQoZm9ybWF0KSwgbUZsYWdzKGZsYWdzKSwgbU93bmVyKG93bmVyKQorICAgICAgbVdpZHRoKGRhdGEud2lkdGgpLCBtSGVpZ2h0KGRhdGEuaGVpZ2h0KSwgbUZvcm1hdChkYXRhLmZvcm1hdCksCisgICAgICBtRmxhZ3MoZmxhZ3MpCiB7Ci0g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JmYWNlQ29udHJvbDo6aXNTYW1lU3VyZmFjZSgKKyAgICAgICAgY29uc3Qgc3A8U3VyZmFjZUNvbnRyb2w+JiBsaHMsIGNvbnN0IHNwPFN1cmZhY2VDb250cm9sPiYgcmhzKSAKIHsKICAgICBpZiAobGhzID09IDAgfHwgcmhzID09IDApCiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICByZXR1cm4gbGhzLT5tU3VyZmFjZS0+YXNCaW5kZXIoKSA9PSByaHMtPm1TdXJmYWNlLT5hc0JpbmRlcigpOwogfQogCi12b2lkKiBTdXJmYWNlOjpoZWFwQmFzZShpbnQgaSkgY29uc3QgCitzdGF0dXNfdCBTdXJmYWNlQ29udHJvbDo6c2V0TGF5ZXIoaW50MzJfdCBsYXllcikgeworICAgIGNvbnN0IHNwPFN1cmZhY2VDb21wb3NlckNsaWVudD4mIGNsaWVudChtQ2xpZW50KTsKKyAgICBpZiAoY2xpZW50ID09IDApIHJldHVybiBOT19JTklUOworICAgIHN0YXR1c190IGVyciA9IHZhbGlkYXRlKGNsaWVudC0+bUNvbnRyb2wpOworICAgIGlmIChlcnIgPCAwKSByZXR1cm4gZXJyOworICAgIHJldHVybiBjbGllbnQtPnNldExheWVyKG1Ub2tlbiwgbGF5ZXIpOworfQorc3RhdHVzX3QgU3VyZmFjZUNvbnRyb2w6OnNldFBvc2l0aW9uKGludDMyX3QgeCwgaW50MzJfdCB5KSB7CisgICAgY29uc3Qgc3A8U3VyZmFjZUNvbXBvc2VyQ2xpZW50PiYgY2xpZW50KG1DbGllbnQpOworICAgIGlmIChjbGllbnQgPT0gMCkgcmV0dXJuIE5PX0lOSVQ7CisgICAgc3RhdHVzX3QgZXJyID0gdmFsaWRhdGUoY2xpZW50LT5tQ29udHJvbCk7CisgICAgaWYgKGVyciA8IDApIHJldHVybiBlcnI7CisgICAgcmV0dXJuIGNsaWVudC0+c2V0UG9zaXRpb24obVRva2VuLCB4LCB5KTsKK30KK3N0YXR1c190IFN1cmZhY2VDb250c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VyQ2xpZW50PiYgY2xpZW50KG1DbGllbnQpOworICAgIGlmIChjbGllbnQgPT0gMCkgcmV0dXJuIE5PX0lOSVQ7CisgICAgc3RhdHVzX3QgZXJyID0gdmFsaWRhdGUoY2xpZW50LT5tQ29udHJvbCk7CisgICAgaWYgKGVyciA8IDApIHJldHVybiBlcnI7CisgICAgcmV0dXJuIGNsaWVudC0+ZnJlZXplKG1Ub2tlbik7Cit9CitzdGF0dXNfdCBTdXJmYWNlQ29udHJvbDo6dW5mcmVlemUoKSB7CisgICAgY29uc3Qgc3A8U3VyZmFjZUNvbXBvc2VyQ2xpZW50PiYgY2xpZW50KG1DbGllbnQpOworICAgIGlmIChjbGllbnQgPT0gMCkgcmV0dXJuIE5PX0lOSVQ7CisgICAgc3RhdHVzX3QgZXJyID0gdmFsaWRhdGUoY2xpZW50LT5tQ29udHJvbCk7CisgICAgaWYgKGVyciA8IDApIHJldHVybiBlcnI7CisgICAgcmV0dXJuIGNsaWVudC0+dW5mcmVlemUobVRva2VuKTsKK30KK3N0YXR1c190IFN1cmZhY2VDb250cm9sOjpzZXRGbGFncyh1aW50MzJfdCBmbGFncywgdWludDMyX3QgbWFzaykgeworICAgIGNvbnN0IHNwPFN1cmZhY2VDb21wb3NlckNsaWVudD4mIGNsaWVudChtQ2xpZW50KTsKKyAgICBpZiAoY2xpZW50ID09IDApIHJldHVybiBOT19JTklUOworICAgIHN0YXR1c190IGVyciA9IHZhbGlkYXRlKGNsaWVudC0+bUNvbnRyb2wpOworICAgIGlmIChlcnIgPCAwKSByZXR1cm4gZXJyOworICAgIHJldHVybiBjbGllbnQtPnNldEZsYWdzKG1Ub2tlbiwgZmxhZ3MsIG1hc2spOworfQorc3RhdHVzX3QgU3VyZmFjZUNvbnRyb2w6OnNldFRyYW5zcGFyZW50UmVnaW9uSGludChjb25zdCBSZWdpb24mIHRyYW5zcGFyZW50KSB7CisgICAgY29uc3Qgc3A8U3VyZmFjZUNvbXBvc2VyQ2xpZW50PiYgY2xpZ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IG1TdXJmYWNlSGVhcEJhc2VbaV0gPSBoZWFwQmFzZTsKKyAgICBpZiAobVRva2VuPDAgfHwgbUNsaWVudD09MCkgeworICAgICAgICBMT0dFKCJpbnZhbGlkIHRva2VuICglZCwgaWRlbnRpdHk9JXUpIG9yIGNsaWVudCAoJXApIiwgCisgICAgICAgICAgICAgICAgbVRva2VuLCBtSWRlbnRpdHksIG1DbGllbnQuZ2V0KCkpOworICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICB9CisgICAgaWYgKGNibGsgPT0gMCkgeworICAgICAgICBMT0dFKCJjYmxrIGlzIG51bGwgKHN1cmZhY2UgaWQ9JWQsIGlkZW50aXR5PSV1KSIsIG1Ub2tlbiwgbUlkZW50aXR5KTsKKyAgICAgICAgcmV0dXJuIE5PX0lOSVQ7CisgICAgfQorICAgIHN0YXR1c190IGVyciA9IGNibGstPnZhbGlkYXRlKG1Ub2tlbik7CisgICAgaWYgKGVyciAhPSBOT19FUlJPUikgeworICAgICAgICBMT0dFKCJzdXJmYWNlIChpZD0lZCwgaWRlbnRpdHk9JXUpIGlzIGludmFsaWQsIGVycj0lZCAoJXMpIiwKKyAgICAgICAgICAgICAgICBtVG9rZW4sIG1JZGVudGl0eSwgZXJyLCBzdHJlcnJvcigtZXJyKSk7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorICAgIHVpbnQzMl90IGlkZW50aXR5ID0gY2Jsay0+Z2V0SWRlbnRpdHkobVRva2VuKTsKKyAgICBpZiAobUlkZW50aXR5ICE9IGlkZW50aXR5KSB7CisgICAgICAgIExPR0UoInVzaW5nIGFuIGludmFsaWQgc3VyZmFjZSBpZD0lZCwgaWRlbnRpdHk9JXUgc2hvdWxkIGJlICVkIiwKKyAgICAgICAgICAgICAgICBtVG9rZW4sIG1JZGVudGl0eSwgaWRlbnRpdHkpOworICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICB9CisgICAgcmV0dXJuIE5PX0VSUk9SOworfQorCitzdGF0dXNfdCBTdXJmYWNlQ29udHJvbDo6d3JpdGVTdXJmYWNlVG9QYXJjZWwoCisgICAgICAgIGNvbnN0IHNwPFN1cmZhY2VDb250cm9sPiYgY29udHJvbCwgUGFyY2VsKiBwYXJjZWwpCit7CisgICAgdWludDMyX3QgZmxhZ3MgPSAwOworICAgIHVpbnQzMl90IGZvcm1hdCA9IDA7CisgICAgU3VyZmFjZUlEIHRva2VuID0gLTE7CisgICAgdWludDMyX3QgaWRlbnRpdHkgPSAwOworICAgIHVpbnQzMl90IHdpZHRoID0gMDsKKyAgICB1aW50MzJfdCBoZWlnaHQgPSAwOworICAgIHNwPFN1cmZhY2VDb21wb3NlckNsaWVudD4gY2xpZW50OworICAgIHNwPElTdXJmYWNlPiBzdXI7CisgICAgaWYgKFN1cmZhY2VDb250cm9sOjppc1ZhbGlkKGNvbnRyb2wpKSB7CisgICAgICAgIHRva2VuICAgID0gY29udHJvbC0+bVRva2VuOworICAgICAgICBpZGVudGl0eSA9IGNvbnRyb2wtPm1JZGVudGl0eTsKKyAgICAgICAgY2xpZW50ICAgPSBjb250cm9sLT5tQ2xpZW50OworICAgICAgICBzdXIgICAgICA9IGNvbnRyb2wtPm1TdXJmYWNlOworICAgICAgICB3aWR0aCAgICA9IGNvbnRyb2wtPm1XaWR0aDsKKyAgICAgICAgaGVpZ2h0ICAgPSBjb250cm9sLT5tSGVpZ2h0OworICAgICAgICBmb3JtYXQgICA9IGNvbnRyb2wtPm1Gb3JtYXQ7CisgICAgICAgIGZsYWdzICAgID0gY29udHJvbC0+bUZsYWdzOworICAgIH0KKyAgICBwYXJjZWwtPndyaXRlU3Ryb25nQmluZGVyKGNsaWVudCE9MCAgPyBjbGllbnQtPmNvbm5lY3Rpb24oKSA6IE5VTEwpOworICAgIHBhcmNlbC0+d3JpdGVTdHJvbmdCaW5kZXIoc3VyIT0wICAgICA/IHN1ci0+YXNCaW5kZXIoKSAgICAgIDogTlVMTCk7CisgICAgcGFyY2VsLT53cml0ZUludDMyKHRva2VuKTsKKyAgICBwYXJjZWwtPndyaXRlSW50MzIoaWRlbnRpdHkpOworICAgIHBhcmNlbC0+d3JpdGVJbnQzMih3aWR0aCk7CisgICAgcGFyY2VsLT53cml0ZUludDMyKGhlaWdodCk7CisgICAgcGFyY2VsLT53cml0ZUludDMyKGZvcm1hdCk7CisgICAgcGFyY2VsLT53cml0ZUludDMyKGZsYWdzKTsKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKK3NwPFN1cmZhY2U+IFN1cmZhY2VDb250cm9sOjpnZXRTdXJmYWNlKCkgY29uc3QKK3sKKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOworICAgIGlmIChtU3VyZmFjZURhdGEgPT0gMCkgeworICAgICAgICBtU3VyZmFjZURhdGEgPSBuZXcgU3VyZmFjZShjb25zdF9jYXN0PFN1cmZhY2VDb250cm9sKj4odGhpcykpOworICAgIH0KKyAgICByZXR1cm4gbVN1cmZhY2VEYXRhOworfQorCisvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisvLyAgU3VyZmFjZQorLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCitTdXJmYWNlOjpTdXJmYWNlKGNvbnN0IHNwPFN1cmZhY2VDb250cm9sPiYgc3VyZmFjZSkKKyAgICA6IG1DbGllbnQoc3VyZmFjZS0+bUNsaWVudCksIG1TdXJmYWNlKHN1cmZhY2UtPm1TdXJmYWNlKSwKKyAgICAgIG1Ub2tlbihzdXJmYWNlLT5tVG9rZW4pLCBtSWRlbnRpdHkoc3VyZmFjZS0+bUlkZW50aXR5KSwKKyAgICAgIG1Gb3JtYXQoc3VyZmFjZS0+bUZvcm1hdCksIG1GbGFncyhzdXJmYWNlLT5tRmxhZ3MpLAorICAgICAgbUJ1ZmZlck1hcHBlcihCdWZmZXJNY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mZmVyCisgICAgICAgICAgICBtV2lkdGggID0gdWludDMyX3QoYmFja0J1ZmZlci0+d2lkdGgpOworICAgICAgICAgICAgbUhlaWdodCA9IHVpbnQzMl90KGJhY2tCdWZmZXItPmhlaWdodCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBpZiB3ZSBzdGlsbCBkb24ndCBoYXZlIGEgYnVmZmVyIGhlcmUsIHdlIHByb2JhYmx5IHJhbiBvdXQgb2YgbWVtb3J5CisgICAgaWYgKCFlcnIgJiYgYmFja0J1ZmZlcj09MCkgeworICAgICAgICBlcnIgPSBOT19NRU1PUlk7CisgICAgfQorCisgICAgaWYgKGVyciA9PSBOT19FUlJPUikgeworICAgICAgICBtRGlydHlSZWdpb24uc2V0KGJhY2tCdWZmZXItPndpZHRoLCBiYWNrQnVmZmVyLT5oZWlnaHQpOworICAgICAgICAqYnVmZmVyID0gYmFja0J1ZmZlci5nZXQoKTsKKyAgICB9IGVsc2UgeworICAgICAgICBtU2hhcmVkQnVmZmVyQ2xpZW50LT51bmRvRGVxdWV1ZShidWZJZHgpOworICAgIH0KKworICAgIHJldHVybiBlcnI7Cit9CisKK2ludCBTdXJmYWNlOjpsb2NrQnVmZmVyKGFuZHJvaWRfbmF0aXZlX2J1ZmZlcl90KiBidWZmZXIpCit7CisgICAgc3A8U3VyZmFjZUNvbXBvc2VyQ2xpZW50PiBjbGllbnQoZ2V0Q2xpZW50KCkpOworICAgIHN0YXR1c190IGVyciA9IHZhbGlkYXRlKGNsaWVudC0+bUNvbnRyb2wpOworICAgIGlmIChlcnIgIT0gTk9fRVJST1IpCisgICAgICAgIHJldHVybiBlcnI7CisKKyAgICBpbnQzMl90IGJ1ZklkeCA9IFN1cmZhY2VCdWZmZXI6OmdldFNlbGYoYnVmZmVyKS0+Z2V0SW5kZXgoKTsKKyAgICBlcnIgPSBtU2hhcmVkQnVmZmVyQ2xpZW50LT5sb2NrKGJ1ZklkeCk7CisgICAgTE9HRV9JRihlcnIsICJlcnJv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QsIGludCogdmFsdWUpCit7CisgICAgc3dpdGNoICh3aGF0KSB7CisgICAgY2FzZSBOQVRJVkVfV0lORE9XX1dJRFRIOgorICAgICAgICAqdmFsdWUgPSBpbnQobVdpZHRoKTsKKyAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgIGNhc2UgTkFUSVZFX1dJTkRPV19IRUlHSFQ6CisgICAgICAgICp2YWx1ZSA9IGludChtSGVpZ2h0KTsKKyAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgIGNhc2UgTkFUSVZFX1dJTkRPV19GT1JNQVQ6CisgICAgICAgICp2YWx1ZSA9IGludChtRm9ybWF0KTsKKyAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgIH0KKyAgICByZXR1cm4gQkFEX1ZBTFVFOworfQorCitpbnQgU3VyZmFjZTo6cGVyZm9ybShpbnQgb3BlcmF0aW9uLCB2YV9saXN0IGFyZ3MpCit7CisgICAgaW50IHJlcyA9IE5PX0VSUk9SOworICAgIHN3aXRjaCAob3BlcmF0aW9uKSB7CisgICAgICAgIGNhc2UgTkFUSVZFX1dJTkRPV19TRVRfVVNBR0U6CisgICAgICAgICAgICBzZXRVc2FnZSggdmFfYXJnKGFyZ3MsIGludCkgKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmVzID0gTkFNRV9OT1RfRk9VTkQ7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIHJlczsKK30KKwordm9pZCBTdXJmYWNlOjpzZXRVc2FnZSh1aW50MzJfdCByZXFVc2FnZSkKK3sKKyAgICBNdXRleDo6QXV0b2xvY2sgX2wobVN1cmZhY2VMb2NrKTsKKyAgICBpZiAobVVzYWdlICE9IHJlcVVzYWdlKSB7CisgICAgICAgIG1Vc2FnZUNoYW5nZWQgPSB0cnVlOworICAgICAgICBtVXNhZ2UgPSByZXFVc2FnZTsKKyAgICB9Cit9CisKK2Jvb2wgU3VyZmF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b2NpYXRlZCB3aXRoCisgICAgICAgICAgICAgICAgLy8gdGhlIGJ1ZmZlciBhbmQgbWFkZSBhdmFpbGFibGUgdG8gb3V0c2lkZSBvZiBTdXJmYWNlLgorICAgICAgICAgICAgICAgIC8vIFRoaXMgd2lsbCBkbyBmb3Igbm93IHRob3VnaC4KKyAgICAgICAgICAgICAgICBtTmVlZEZ1bGxVcGRhdGUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBuZXdEaXJ0eVJlZ2lvbi5zZXQoYm91bmRzKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbmV3RGlydHlSZWdpb24uYW5kU2VsZihib3VuZHMpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjb25zdCBzcDxTdXJmYWNlQnVmZmVyPiYgZnJvbnRCdWZmZXIobVBvc3RlZEJ1ZmZlcik7CisgICAgICAgICAgICBpZiAoZnJvbnRCdWZmZXIgIT0wICYmCisgICAgICAgICAgICAgICAgYmFja0J1ZmZlci0+d2lkdGggID09IGZyb250QnVmZmVyLT53aWR0aCAmJiAKKyAgICAgICAgICAgICAgICBiYWNrQnVmZmVyLT5oZWlnaHQgPT0gZnJvbnRCdWZmZXItPmhlaWdodCAmJgorICAgICAgICAgICAgICAgICEobUZsYWdzICYgSVN1cmZhY2VDb21wb3Nlcjo6ZURlc3Ryb3lCYWNrYnVmZmVyKSkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY29uc3QgUmVnaW9uIGNvcHliYWNrKG1PbGREaXJ0eVJlZ2lvbi5zdWJ0cmFjdChuZXdEaXJ0eVJlZ2lvbikpOworICAgICAgICAgICAgICAgIGlmICghY29weWJhY2suaXNFbXB0eSgpICYmIGZyb250QnVmZmVyIT0wKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGNvcHkgZnJvbnQgdG8gYmFjaworICAgICAgICAgICAgICAgICAgICBjb3B5Qmx0KGJhY2tCdWZmZXIsIGZyb250QnVmZmVyLCBjb3B5YmFjayk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtRGlydHlSZWdpb24gPSBuZXdEaXJ0eVJlZ2lvbjsKKyAgICAgICAgICAgIG1PbGREaXJ0eVJlZ2lvbiA9IG5ld0RpcnR5UmVnaW9uOworCisgICAgICAgICAgICB2b2lkKiB2YWRkcjsKKyAgICAgICAgICAgIHN0YXR1c190IHJlcyA9IGJhY2tCdWZmZXItPmxvY2soCisgICAgICAgICAgICAgICAgICAgIEdSQUxMT0NfVVNBR0VfU1dfUkVBRF9PRlRFTiB8IEdSQUxMT0NfVVNBR0VfU1dfV1JJVEVfT0ZURU4sCisgICAgICAgICAgICAgICAgICAgIG5ld0RpcnR5UmVnaW9uLmJvdW5kcygpLCAmdmFkZHIpOworICAgICAgICAgICAgCisgICAgICAgICAgICBMT0dXX0lGKHJlcywgImZhaWxlZCBsb2NraW5nIGJ1ZmZlciAoaGFuZGxlID0gJXApIiwgCisgICAgICAgICAgICAgICAgICAgIGJhY2tCdWZmZXItPmhhbmRsZSk7CisKKyAgICAgICAgICAgIG1Mb2NrZWRCdWZmZXIgPSBiYWNrQnVmZmVyOworICAgICAgICAgICAgb3RoZXItPncgICAgICA9IGJhY2tCdWZmZXItPndpZHRoOworICAgICAgICAgICAgb3RoZXItPmggICAgICA9IGJhY2tCdWZmZXItPmhlaWdodDsKKyAgICAgICAgICAgIG90aGVyLT5zICAgICAgPSBiYWNrQnVmZmVyLT5zdHJpZGU7CisgICAgICAgICAgICBvdGhlci0+dXNhZ2UgID0gYmFja0J1ZmZlci0+dXNhZ2U7CisgICAgICAgICAgICBvdGhlci0+Zm9ybWF0ID0gYmFja0J1ZmZlci0+Zm9ybWF0OworICAgICAgICAgICAgb3RoZXItPmJpdHMgICA9IHZhZGRyOworICAgICAgICB9CisgICAgfQorICAgIG1BcGlMb2NrLnVubG9jaygpOworICAgIHJldHVybiBlcnI7Cit9CisgICAgCitzdGF0dXNfdCBTdXJmYWNl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worICAgIGlmIChidWZmZXIgPT0gTlVMTCkKKyAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKworICAgIGlmIChidWZmZXItPndpZHRoIDwgMCB8fCBidWZmZXItPmhlaWdodCA8IDApCisgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisKKyAgICBzdGF0dXNfdCBlcnIgPSBOT19FUlJPUjsKKyAgICBpZiAoYnVmZmVyLT5oYW5kbGUgPT0gTlVMTCkgeworICAgICAgICAvLyB0aGlzIGJ1ZmZlciBkb2Vzbid0IGhhdmUgYSBoYW5kbGUKKyAgICAgICAgcmVwbHktPndyaXRlSW50MzIoTk9fTUVNT1JZKTsKKyAgICB9IGVsc2UgeworICAgICAgICByZXBseS0+d3JpdGVJbnQzMihidWZmZXItPndpZHRoKTsKKyAgICAgICAgcmVwbHktPndyaXRlSW50MzIoYnVmZmVyLT5oZWlnaHQpOworICAgICAgICByZXBseS0+d3JpdGVJbnQzMihidWZmZXItPnN0cmlkZSk7CisgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGJ1ZmZlci0+Zm9ybWF0KTsKKyAgICAgICAgcmVwbHktPndyaXRlSW50MzIoYnVmZmVyLT51c2FnZSk7CisgICAgICAgIGVyciA9IHJlcGx5LT53cml0ZU5hdGl2ZUhhbmRsZShidWZmZXItPmhhbmRsZSk7CisgICAgfQorICAgIHJldHVybiBlcnI7Cit9CisKKwordm9pZCBTdXJmYWNlQnVmZmVyOjpzZXRJbmRleChpbnQgaW5kZXgpIHsKKyAgICBtSW5kZXggPSBpbmRleDsKK30KKworaW50IFN1cmZhY2VCdWZmZXI6OmdldEluZGV4KCkgY29uc3QgeworICAgIHJldHVybiBtSW5kZXg7Cit9CisKKworfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKwpkaWZmIC0tZ2l0IGEvbGlicy91aS9TdXJmYWNlQ29tcG9zZXJDbGllbnQuY3BwIGIvbGlicy91aS9TdXJmYWNlQ29tcG9zZXJDbGllbnQuY3BwCmluZGV4I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ml0ZXJhdGUoJnIpKSB7Ci0gICAgICAgICAgICBzc2l6ZV90IGggPSByLmJvdHRvbSAtIHIudG9wOwotICAgICAgICAgICAgaWYgKGgpIHsKLSAgICAgICAgICAgICAgICBzaXplX3Qgc2l6ZSA9IChyLnJpZ2h0IC0gci5sZWZ0KSAqIGJwcDsKLSAgICAgICAgICAgICAgICB1aW50OF90KiBzID0gc3JjLmRhdGEgKyAoci5sZWZ0ICsgc3JjLnN0cmlkZSAqIHIudG9wKSAqIGJwcDsKLSAgICAgICAgICAgICAgICB1aW50OF90KiBkID0gZHN0LmRhdGEgKyAoci5sZWZ0ICsgZHN0LnN0cmlkZSAqIHIudG9wKSAqIGJwcDsKLSAgICAgICAgICAgICAgICBpZiAoZGJwcj09c2JwciAmJiBzaXplPT1zYnByKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNpemUgKj0gaDsKLSAgICAgICAgICAgICAgICAgICAgaCA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGRvIHsKLSAgICAgICAgICAgICAgICAgICAgbWVtY3B5KGQsIHMsIHNpemUpOwotICAgICAgICAgICAgICAgICAgICBkICs9IGRicHI7Ci0gICAgICAgICAgICAgICAgICAgIHMgKz0gc2JwcjsKLSAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWggPiAwKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0KLQotLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLXN1cmZhY2VfZmxpbmdlcl9jYmxrX3Q6OnN1cmZhY2VfZmxpbmdlcl9jYmxrX3QoKQotewotfQotCi0vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotcG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gICAgICAgICBpZiAoIWJsb2NraW5nKQotCSAgICAgICAgICAgICAgICByZXR1cm4gV09VTERfQkxPQ0s7Ci0KLSAgICAgICAgICAgICAgICB0aW1lb3V0ID0gMDsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSBjdi53YWl0UmVsYXRpdmUobG9jaywgc2Vjb25kcygxKSk7Ci0JICAgICAgICAgICAgaWYgKF9fYnVpbHRpbl9leHBlY3QocmVzdWx0IT1OT19FUlJPUiwgZmFsc2UpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnN0IGludCBuZXdTdGF0ZSA9IGxheWVyLT5zd2FwU3RhdGU7Ci0gICAgICAgICAgICAgICAgICAgIExPR1coICAgImxvY2tfbGF5ZXIgdGltZWQgb3V0IChpcyB0aGUgQ1BVIHBlZ2dlZD8pICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAibGF5ZXI9JWQsIGxjYmxrPSVwLCBzdGF0ZT0lMDh4ICh3YXMgJTA4eCkiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludChpKSwgbGF5ZXIsIG5ld1N0YXRlLCBpbnQoc3RhdGUpKTsKLSAgICAgICAgICAgICAgICAgICAgdGltZW91dCA9IG5ld1N0YXRlICE9IGludChzdGF0ZSk7Ci0gICAgICAgICAgICAgICAgfQotCi0JICAgICAgICBzdGFydF9sb29wX2hlcmU6Ci0JICAgICAgICAgICAgc3RhdGUgPSBsYXllci0+c3dhcFN0YXRlOwotCSAgICAgICAgICAgIHJlc2l6ZUluZGV4ID0gKHN0YXRlJmVJbmRleCkgXiAoKHN0YXRlJmVGbGlwUmVxdWVzdGVkKT4+MSk7Ci0JICAgICAgICB9Ci0KLSAgICAgICAgICAgIExPR1dfSUYodGltZW91dCwKLSAgICAgICAgICAgICAgICAgICAgImxvY2tfbGF5ZXIoKSB0aW1lZCBvdXQgYnV0IGRpZG4ndCBhcHBlYXIgdG8gbmVlZCAiCi0gICAgICAgICAgICAgICAgICAgICJ0byBiZSBsb2N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gICAgICBvdGhlci0+YmFzZSAgID0gc3VyZmFjZS0+aGVhcEJhc2UoYmFja0lkeCk7Ci0gICAgICAgICAgICBvdGhlci0+Yml0cyAgID0gcmVpbnRlcnByZXRfY2FzdDx2b2lkKj4oaW50cHRyX3Qob3RoZXItPmJhc2UpICsgYmFjay0+Yml0c19vZmZzZXQpOwotICAgICAgICAgICAgb3RoZXItPmJwciAgICA9IGJhY2stPmJwcjsKLQotICAgICAgICBjb25zdCBSZWN0IGJvdW5kcyhvdGhlci0+dywgb3RoZXItPmgpOwotICAgICAgICBSZWdpb24gbmV3RGlydHlSZWdpb247Ci0KLSAgICAgICAgaWYgKGJhY2stPmZsYWdzICYgc3VyZmFjZV9pbmZvX3Q6OmVCdWZmZXJEaXJ0eSkgewotICAgICAgICAgICAgLyogaXQgaXMgc2FmZSB0byB3cml0ZSAqYmFjayBoZXJlLCBiZWNhdXNlIHdlJ3JlIGd1YXJhbnRlZWQKLSAgICAgICAgICAgICAqIFN1cmZhY2VGbGluZ2VyIGlzIG5vdCB0b3VjaGluZyBpdCAoc2luY2UgaXQganVzdCBncmFudGVkCi0gICAgICAgICAgICAgKiBhY2Nlc3MgdG8gdXMpICovCi0gICAgICAgICAgICBjb25zdF9jYXN0PHN1cmZhY2VfaW5mb190Kj4oYmFjayktPmZsYWdzICY9Ci0gICAgICAgICAgICAgICAgICAgIH5zdXJmYWNlX2luZm9fdDo6ZUJ1ZmZlckRpcnR5OwotCi0gICAgICAgICAgICAvLyBjb250ZW50IGlzIG1lYW5pbmdsZXNzIGluIHRoaXMgY2FzZSBhbmQgdGhlIHdob2xlIHN1cmZhY2UKLSAgICAgICAgICAgIC8vIG5lZWRzIHRvIGJlIHJlZHJhd24uCi0KLSAgICAgICAgICAgIG5ld0RpcnR5UmVnaW9uLnNldChib3VuZHMpOwotICAgICAgICAgICAgaWYgKGRpcnR5KSB7Ci0gICAgICAgICAgICAgICAgKmRpcnR5ID0gbmV3RGlydHlSZWdpb247Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vaWYgKGJ5dGVzUGVyUGl4ZWwob3RoZXItPmZvcm1hdCkgPT0gNCkgewotICAgICAgICAgICAgLy8gICAgYW5kcm9pZF9tZW1zZXQzMigKLSAgICAgICAgICAgIC8vICAgICAgICAodWludDMyX3QqKW90aGVyLT5iaXRzLCAweEZGMDBGRjAwLCBvdGhlci0+aCAqIG90aGVyLT5icHIpOwotICAgICAgICAgICAgLy99IGVsc2UgewotICAgICAgICAgICAgLy8gICAgYW5kcm9pZF9tZW1zZXQxNiggLy8gZmlsbCB3aXRoIGdyZWVuCi0gICAgICAgICAgICAvLyAgICAgICAgKHVpbnQxNl90KilvdGhlci0+Yml0cywgMHg3RTAsIG90aGVyLT5oICogb3RoZXItPmJwcik7Ci0gICAgICAgICAgICAvL30KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChkaXJ0eSkgewotICAgICAgICAgICAgICAgIGRpcnR5LT5hbmRTZWxmKFJlZ2lvbihib3VuZHMpKTsKLSAgICAgICAgICAgICAgICBuZXdEaXJ0eVJlZ2lvbiA9ICpkaXJ0eTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbmV3RGlydHlSZWdpb24uc2V0KGJvdW5kcyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIFJlZ2lvbiBjb3B5YmFjazsKLSAgICAgICAgICAgIGlmICghKGxjYmxrLT5mbGFncyAmIGVOb0NvcHlCYWNrKSkgewotICAgICAgICAgICAgICAgIGNvbnN0IFJlZ2lvbiBwcmV2aW91c0RpcnR5UmVnaW9uKHN1cmZhY2UtPmRpcnR5UmVnaW9uKCkpOwotICAgICAgICAgICAgICAgIGNvcHliYWNrID0gcHJldmlvdXNEaXJ0eVJlZ2lvbi5zdWJ0cmFjdChuZXdEaXJ0eVJlZ2lvbik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghY29weWJhY2suaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgLy8gY29weSBmcm9udCB0byBiYWNrCi0gICAgICAgICAgICAgICAgR0dMU3VyZmFjZSBjYjsKLSAgICAgICAgICAgICAgICAgICAgY2IudmVyc2lvbiA9IHNpemVvZihHR0xTdXJmYWNlKTsKLSAgICAgICAgICAgICAgICAgICAgY2Iud2lkdGggPSBiYWNrLT53OwotICAgICAgICAgICAgICAgICAgICBjYi5oZWlnaHQgPSBiYWNrLT5oOwotICAgICAgICAgICAgICAgICAgICBjYi5zdHJpZGUgPSBiYWNrLT5zdHJpZGU7Ci0gICAgICAgICAgICAgICAgICAgIGNiLmRhdGEgPSAoR0dMdWJ5dGUqKXN1cmZhY2UtPmhlYXBCYXNlKGJhY2tJZHgpOwotICAgICAgICAgICAgICAgICAgICBjYi5kYXRhICs9IGJhY2stPmJpdHNfb2Zmc2V0OwotICAgICAgICAgICAgICAgICAgICBjYi5mb3JtYXQgPSBiYWNrLT5mb3JtYXQ7Ci0KLSAgICAgICAgICAgICAgICBHR0xTdXJmYWNlIHQ7Ci0gICAgICAgICAgICAgICAgICAgIHQudmVyc2lvbiA9IHNpemVvZihHR0xTdXJmYWNlKTsKLSAgICAgICAgICAgICAgICAgICAgdC53aWR0aCA9IGZyb250LT53OwotICAgICAgICAgICAgICAgICAgICB0LmhlaWdodCA9IGZyb250LT5oOwotICAgICAgICAgICAgICAgICAgICB0LnN0cmlkZSA9IGZyb250LT5zdHJpZGU7Ci0gICAgICAgICAgICAgICAgICAgIHQuZGF0YSA9IChHR0x1Ynl0ZSopc3VyZmFjZS0+aGVhcEJhc2UoMS1iYWNrSWR4KTsKLSAgICAgICAgICAgICAgICAgICAgdC5kYXRhICs9IGZyb250LT5iaXRzX29mZnNldDsKLSAgICAgICAgICAgICAgICAgICAgdC5mb3JtYXQgPSBmcm9udC0+Zm9ybWF0OwotCi0gICAgICAgICAgICAgICAgLy9jb25zdCBSZWdpb24gY29weWJhY2sob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VtcCgicmVnMCIpOworICAgIHJlZzEuZHVtcCgicmVnMSIpOworCisgICAgcmVnMCA9IHJlZzAgfCByZWcwLnRyYW5zbGF0ZSgxNTAsIDApOworICAgIHJlZzAuZHVtcCgicmVnMCIpOworICAgIHJlZzEuZHVtcCgicmVnMSIpOworCisgICAgcmVnMCA9IHJlZzAgfCByZWcwLnRyYW5zbGF0ZSgzMDAsIDApOworICAgIHJlZzAuZHVtcCgicmVnMCIpOworICAgIHJlZzEuZHVtcCgicmVnMSIpOworCisgICAgLy9yZWcyID0gcmVnMCB8IHJlZzAudHJhbnNsYXRlKDAsIDEwMCk7CisgICAgLy9yZWcwLmR1bXAoInJlZzAiKTsKKyAgICAvL3JlZzEuZHVtcCgicmVnMSIpOworICAgIC8vcmVnMi5kdW1wKCJyZWcyIik7CisKKyAgICAvL3JlZzMgPSByZWcwIHwgcmVnMC50cmFuc2xhdGUoMCwgMTUwKTsKKyAgICAvL3JlZzAuZHVtcCgicmVnMCIpOworICAgIC8vcmVnMS5kdW1wKCJyZWcxIik7CisgICAgLy9yZWcyLmR1bXAoInJlZzIiKTsKKyAgICAvL3JlZzMuZHVtcCgicmVnMyIpOworCisgICAgTE9HRCgiLS0tIik7CisgICAgcmVnMiA9IHJlZzAgfCByZWcwLnRyYW5zbGF0ZSgxMDAsIDApOworICAgIHJlZzAuZHVtcCgicmVnMCIpOworICAgIHJlZzEuZHVtcCgicmVnMSIpOworICAgIHJlZzIuZHVtcCgicmVnMiIpOworICAgIAorICAgIHJldHVybiAwOworfQorCmRpZmYgLS1naXQgYS9saWJzL3V0aWxzL0FuZHJvaWQubWsgYi9saWJzL3V0aWxzL0FuZHJvaWQubWsKaW5kZXggOWJkZDY0YS4uNTk0MDlhMiAxMDA2NDQKLS0tIGEvbGlicy91dGlscy9BbmRyb2lkLm1rCisrKyBiL2xpYnMvdXRpbHMvQW5kcm9pZC5tawpAQCAtMzIsNTIgKzMyLDI0IEBACiAJU3RvcFdhdGNoLmNwcCBcCiAJU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KQogCmRpZmYgLS1naXQgYS9saWJzL3V0aWxzL0JhY2t1cERhdGEuY3BwIGIvbGlicy91dGlscy9CYWNrdXBEYXRhLmNwcAppbmRleCBjY2U3NTRhLi4wY2VmMzVhIDEwMDY0NAotLS0gYS9saWJzL3V0aWxzL0JhY2t1cERhdGEuY3BwCisrKyBiL2xpYnMvdXRpbHMvQmFja3VwRGF0YS5jcHAKQEAgLTE5Myw5ICsxOTMsMTEgQEAKICAgICAgICAgaWYgKChhY3R1YWwpICE9IChleHBlY3RlZCkpIHsgXAogICAgICAgICAgICAgaWYgKChhY3R1YWwpID09IDApIHsgXAogICAgICAgICAgICAgICAgIG1fc3RhdHVzID0gRUlPOyBcCisgICAgICAgICAgICAgICAgbV9kb25lID0gdHJ1ZTsgXAogICAgICAgICAgICAgfSBlbHNlIHsgXAogICAgICAgICAgICAgICAgIG1fc3RhdHVzID0gZXJybm87IFwKICAgICAgICAgICAgIH0gXAorICAgICAgICAgICAgTE9HRCgiQ0hFQ0tfU0laRSBmYWlsZWQgd2l0aCBhdCBsaW5lICVkIG1fc3RhdHVzPSclcyciLCBfX0xJTkVfXywgc3RyZXJyb3IobV9zdGF0dXMpKTsgXAogICAgICAgICAgICAgcmV0dXJuIG1fc3RhdHVzOyBcCiAgICAgICAgIH0gXAogICAgIH0gd2hpbGUoMCkKQEAgLTIwMyw2ICsyMDUsNyBAQAogICAgIGRvIHsgXAogICAgICAgICBzdGF0dXNfdCBlcnIgPSBza2lwX3BhZGRpbmcoKTsgXAogICAgICAgICBpZiAoZXJyICE9IE5PX0VSUk9SKSB7IFwKKyAgICAgICAgICAgIExPR0QoIlNLSVBfUEFERElORyBGQUlMRUQgYXQgbGluZSAlZCIsIF9fTElORV9fKTsgXAogICAgICAgICAgICAgbV9zdGF0dXMgPSBlcnI7IFwKICAgICAgICAgICAgIHJldHVybiBlcnI7IFwKICAgICAgICAgfSBcCkBAIC0yMTgsMTAgKzIyMSwxOSBAQAogCiAgICAgaW50IGFtdDsKIAotICAgIC8vIE5vIGVycm9yIGNoZWNraW5nIGhlcmUsIGluIGNhc2Ugd2UncmUgYXQgdGhlIGVuZCBvZiB0aGUgc3RyZWFtLiAgSnVzdCBsZXQgcmVhZCgpIGZhaWwuCi0gICAgc2tpcF9wYWRkaW5nKCk7CisgICAgYW10ID0gc2tpcF9wYWRkaW5nKCk7CisgICAgaWYgKGFtdCA9PSBFSU8pIHsKKyAgICAgICAgKmRvbmUgPSBtX2RvbmUgPSB0cnVlOworICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgfQorICAgIGVsc2UgaWYgKGFtdCAhPSBOT19FUlJPUikgeworICAgICAgICByZXR1cm4gYW10OworICAgIH0KICAgICBhbXQgPSByZWFkKG1fZmQsICZtX2hlYWRlciwgc2l6ZW9mKG1faGVhZGVyKSk7CiAgICAgKmRvbmUgPSBtX2RvbmUgPSAoYW10ID09IDApOworICAgIGlmICgqZG9uZSkgeworICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgfQogICAgIENIRUNLX1NJWkUoYW10LCBzaXplb2YobV9oZWFkZXIpKTsKICAgICBtX3BvcyArPSBzaXplb2YobV9oZWFkZXIpOwogICAgIGlmICh0eXBlKSB7CkBAIC0yOTgsMTAgKzMxMCwxMiBAQAogICAgIH0KICAgICBpZiAobV9oZWFkZXIuZW50aXR5LmRhdGFTaXplID4gMCkgewogICAgICAgICBpbnQgcG9zID0gbHNlZWsobV9mZCwgbV9kYXRhRW5kUG9zLCBTRUVLX1NFVCk7Ci0gICAgICAgIHJldHVybiBwb3MgPT0gLTEgPyAoaW50KWVycm5vIDogKGludClOT19FUlJPUjsKLSAgICB9IGVsc2UgewotICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIGlmIChwb3MgPT0gLTEpIHsKKyAgICAgICAgICAgIHJldHVybiBlcnJubzsKKyAgICAgICAgfQogICAgIH0KKyAgICBTS0lQX1BBRERJTkcoKTsKKyAgICByZXR1cm4gTk9fRVJST1I7CiB9CiAKIH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GRlZmF1bHQ6Ci0gICAgICAgICAgICBlcnIgPSBvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICBpZiAocmVwbHkgIT0gTlVMTCkgewotICAgICAgICByZXBseS0+c2V0RGF0YVBvc2l0aW9uKDApOwotICAgIH0KLQotICAgIHJldHVybiBlcnI7Ci19Ci0KLXN0YXR1c190IEJCaW5kZXI6OmxpbmtUb0RlYXRoKAotICAgIGNvbnN0IHNwPERlYXRoUmVjaXBpZW50PiYgcmVjaXBpZW50LCB2b2lkKiBjb29raWUsIHVpbnQzMl90IGZsYWdzKQotewotICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKLX0KLQotc3RhdHVzX3QgQkJpbmRlcjo6dW5saW5rVG9EZWF0aCgKLSAgICBjb25zdCB3cDxEZWF0aFJlY2lwaWVudD4mIHJlY2lwaWVudCwgdm9pZCogY29va2llLCB1aW50MzJfdCBmbGFncywKLSAgICB3cDxEZWF0aFJlY2lwaWVudD4qIG91dFJlY2lwaWVudCkKLXsKLSAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci19Ci0KLXN0YXR1c190IEJCaW5kZXI6OmR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKQotewotICAgIHJldHVybiBOT19FUlJPUjsKLX0KLQotdm9pZCBCQmluZGVyOjphdHRhY2hPYmplY3QoCi0gICAgY29uc3Qgdm9pZCogb2JqZWN0SUQsIHZvaWQqIG9iamVjdCwgdm9pZCogY2xlYW51cENvb2tpZSwKLSAgICBvYmplY3RfY2xlYW51cF9mdW5jIGZ1bmMpCi17Ci0gICAgRXh0cmFzKiBlID0gbUV4dHJhczsKLQotICAgIGlmICghZSkgewotICAgICAgICBlID0gbmV3IEV4dHJhczsKLSAgICAgICAgaWYgKGFuZHJvaWRfYXRvbWljX2NtcHhjaGcoMCwgcmVpbnRl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AgICAgQXV0b011dGV4IF9sKG1Mb2NrKTsKLQotICAgICAgICBpZiAoIW1PYml0c1NlbnQpIHsKLSAgICAgICAgICAgIGlmICghbU9iaXR1YXJpZXMpIHsKLSAgICAgICAgICAgICAgICBtT2JpdHVhcmllcyA9IG5ldyBWZWN0b3I8T2JpdHVhcnk+OwotICAgICAgICAgICAgICAgIGlmICghbU9iaXR1YXJpZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5PX01FTU9SWTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgTE9HVigiUmVxdWVzdGluZyBkZWF0aCBub3RpZmljYXRpb246ICVwIGhhbmRsZSAlZFxuIiwgdGhpcywgbUhhbmRsZSk7Ci0gICAgICAgICAgICAgICAgZ2V0V2Vha1JlZnMoKS0+aW5jV2Vhayh0aGlzKTsKLSAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZSogc2VsZiA9IElQQ1RocmVhZFN0YXRlOjpzZWxmKCk7Ci0gICAgICAgICAgICAgICAgc2VsZi0+cmVxdWVzdERlYXRoTm90aWZpY2F0aW9uKG1IYW5kbGUsIHRoaXMpOwotICAgICAgICAgICAgICAgIHNlbGYtPmZsdXNoQ29tbWFuZHMoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHNzaXplX3QgcmVzID0gbU9iaXR1YXJpZXMtPmFkZChvYik7Ci0gICAgICAgICAgICByZXR1cm4gcmVzID49IChzc2l6ZV90KU5PX0VSUk9SID8gKHN0YXR1c190KU5PX0VSUk9SIDogcmVzOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIERFQURfT0JKRUNUOwotfQotCi1zdGF0dXNfdCBCcEJpbmRlcjo6dW5saW5rVG9EZWF0aCgKLSAgICBjb25zdCB3cDxEZWF0aFJlY2lwaWVudD4mIHJlY2lwaWVudCwgdm9pZCogY29va2llLCB1aW50MzJfdCBmbGFncywKLSAgICB3cDxEZWF0aFJlY2lwaWVudD4qIG91dFJlY2lwaWVudCkKLXsKLSAgICBBdXRvTXV0ZXggX2wobUxvY2spOwotCi0gICAgaWYgKG1PYml0c1NlbnQpIHsKLSAgICAgICAgcmV0dXJuIERFQURfT0JKRUNUOwotICAgIH0KLQotICAgIGNvbnN0IHNpemVfdCBOID0gbU9iaXR1YXJpZXMgPyBtT2JpdHVhcmllcy0+c2l6ZSgpIDogMDsKLSAgICBmb3IgKHNpemVfdCBpPTA7IGk8TjsgaSsrKSB7Ci0gICAgICAgIGNvbnN0IE9iaXR1YXJ5JiBvYml0ID0gbU9iaXR1YXJpZXMtPml0ZW1BdChpKTsKLSAgICAgICAgaWYgKChvYml0LnJlY2lwaWVudCA9PSByZWNpcGllbnQKLSAgICAgICAgICAgICAgICAgICAgfHwgKHJlY2lwaWVudCA9PSBOVUxMICYmIG9iaXQuY29va2llID09IGNvb2tpZSkpCi0gICAgICAgICAgICAgICAgJiYgb2JpdC5mbGFncyA9PSBmbGFncykgewotICAgICAgICAgICAgY29uc3QgdWludDMyX3QgYWxsRmxhZ3MgPSBvYml0LmZsYWdzfGZsYWdzOwotICAgICAgICAgICAgaWYgKG91dFJlY2lwaWVudCAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgKm91dFJlY2lwaWVudCA9IG1PYml0dWFyaWVzLT5pdGVtQXQoaSkucmVjaXBpZW50OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbU9iaXR1YXJpZXMtPnJlbW92ZUF0KGkpOwotICAgICAgICAgICAgaWYgKG1PYml0dWFyaWVzLT5zaXplKCkgPT0gMCkgewotICAgICAgICAgICAgICAgIExPR1YoIkNsZWFyaW5nIGRlYXRoIG5vdGlmaWNhdGlvbjogJXAgaGFuZGxlICVkXG4iLCB0aGlzLCBtSGFuZGxlKTsKLSAgICAgICAgICAgICAgICBJUENUaHJlYWRTdGF0ZSogc2VsZiA9IElQQ1RocmVhZFN0YXRlOjpzZWxmKCk7Ci0gICAgICAgICAgICAgICAgc2VsZi0+Y2x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W5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7Ci0gICAgfQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUJwTWVtb3J5SGVhcDo6QnBNZW1vcnlIZWFwKGNvbnN0IHNwPElCaW5kZXI+JiBpbXBsKQotICAgIDogQnBJbnRlcmZhY2U8SU1lbW9yeUhlYXA+KGltcGwpLAotICAgICAgICBtSGVhcElkKC0xKSwgbUJhc2UoTUFQX0ZBSUxFRCksIG1TaXplKDApLCBtRmxhZ3MoMCksIG1SZWFsSGVhcChmYWxzZSkKLXsKLX0KLQotQnBNZW1vcnlIZWFwOjp+QnBNZW1vcnlIZWFwKCkgewotICAgIGlmIChtSGVhcElkICE9IC0xKSB7Ci0gICAgICAgIGNsb3NlKG1IZWFwSWQpOwotICAgICAgICBpZiAobVJlYWxIZWFwKSB7Ci0gICAgICAgICAgICAvLyBieSBjb25zdHJ1Y3Rpb24gd2UncmUgdGhlIGxhc3Qgb25lCi0gICAgICAgICAgICBpZiAobUJhc2UgIT0gTUFQX0ZBSUxFRCkgewotICAgICAgICAgICAgICAgIHNwPElCaW5kZXI+IGJpbmRlciA9IGNvbnN0X2Nhc3Q8QnBNZW1vcnlIZWFwKj4odGhpcyktPmFzQmluZGVyKCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoVkVSQk9TRSkgewotICAgICAgICAgICAgICAgICAgICBMT0dEKCJVTk1BUFBJTkcgYmluZGVyPSVwLCBoZWFwPSVwLCBzaXplPSVkLCBmZD0lZCIsIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpbmRlci5nZXQoKSwgdGhpcywgbVNpemUsIG1IZWFwSWQpOwotICAgICAgICAgICAgICAgICAgICBDYWxsU3RhY2sgc3RhY2s7Ci0gICAgICAgICAgICAgICAgICAgIHN0YWNrLnVwZGF0ZSgpOwotICAgICAgICAgICA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LSAgICB1aW50MzJfdCBjb2RlLCBjb25zdCBQYXJjZWwmIGRhdGEsIFBhcmNlbCogcmVwbHksIHVpbnQzMl90IGZsYWdzKQotewotICAgIHN3aXRjaChjb2RlKSB7Ci0gICAgICAgY2FzZSBIRUFQX0lEOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lbW9yeUhlYXAsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUZpbGVEZXNjcmlwdG9yKGdldEhlYXBJRCgpKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGdldFNpemUoKSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihnZXRGbGFncygpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBCQmluZGVyOjpvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7Ci0gICAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUhlYXBDYWNoZTo6SGVhcENhY2hlKCkKLSAgICA6IERlYXRoUmVjaXBpZW50KCkKLXsKLX0KLQotSGVhcENhY2hlOjp+SGVhcENhY2hlKCkKLXsKLX0KLQotdm9pZCBIZWFwQ2FjaGU6OmJpbmRlckRpZWQoY29uc3Qgd3A8SUJpbmRlcj4mIGJpbmRlcikKLXsKLSAgICAvL0xPR0QoImJpbmRlckRpZWQgYmluZGVyPSVwIiwgYmluZGVyLnVuc2FmZV9nZXQoKSk7Ci0gICAgZnJlZV9oZWFwKGJpbmRlcik7IAotfQotCi1zcDxJTWVtb3J5SGVhcD4gSGVhcENhY2hlOjpmaW5kX2hlYXAoY29uc3Qgc3A8SUJpbmRlcj4mIGJpbmRlcikgCi17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KTsKLSAgICAgICAgICAgIGlmIChjID09IDEpIHsKLSAgICAgICAgICAgICAgICBMT0dEX0lGKFZFUkJPU0UsCi0gICAgICAgICAgICAgICAgICAgICAgICAicmVtb3ZpbmcgYmluZGVyPSVwLCBoZWFwPSVwLCBzaXplPSVkLCBmZD0lZCwgY291bnQ9JWQiLCAKLSAgICAgICAgICAgICAgICAgICAgICAgIGJpbmRlci51bnNhZmVfZ2V0KCksIGluZm8uaGVhcC5nZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PEJwTWVtb3J5SGVhcCo+KGluZm8uaGVhcC5nZXQoKSktPm1TaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QnBNZW1vcnlIZWFwKj4oaW5mby5oZWFwLmdldCgpKS0+bUhlYXBJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGluZm8uY291bnQpOwotICAgICAgICAgICAgICAgIHJlbCA9IG1IZWFwQ2FjaGUudmFsdWVBdChpKS5oZWFwOwotICAgICAgICAgICAgICAgIG1IZWFwQ2FjaGUucmVtb3ZlSXRlbXNBdChpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIExPR0UoImZyZWVfaGVhcCBiaW5kZXI9JXAgbm90IGZvdW5kISEhIiwgYmluZGVyLnVuc2FmZV9nZXQoKSk7Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLXNwPElNZW1vcnlIZWFwPiBIZWFwQ2FjaGU6OmdldF9oZWFwKGNvbnN0IHNwPElCaW5kZXI+JiBiaW5kZXIpCi17Ci0gICAgc3A8SU1lbW9yeUhlYXA+IHJlYWxIZWFwOwotICAgIE11dGV4OjpBdXRvbG9jayBfbChtSGVhcENhY2hlTG9jayk7Ci0gICAgc3NpemVfdCBpID0gbUhlYXBDYWNoZS5pbmRleE9mS2V5KGJpbmRlcik7Ci0gICAgaWYgKGk+PTApICAgcmVhbEhlYXAgPS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SAoY29uc3QgaW50MzJfdCopX2NtZDsKLSAgICBpbnQzMl90IGNvZGUgPSAqY21kKys7Ci0gICAgaWYgKGNvZGUgPT0gQlJfRVJST1IpIHsKLSAgICAgICAgb3V0IDw8ICJCUl9FUlJPUjogIiA8PCAodm9pZCopKCpjbWQrKykgPDwgZW5kbDsKLSAgICAgICAgcmV0dXJuIGNtZDsKLSAgICB9IGVsc2UgaWYgKGNvZGUgPCAwIHx8IGNvZGUgPj0gTikgewotICAgICAgICBvdXQgPDwgIlVua25vd24gcmVwbHk6ICIgPDwgY29kZSA8PCBlbmRsOwotICAgICAgICByZXR1cm4gY21kOwotICAgIH0KLSAgICAKLSAgICBvdXQgPDwga1JldHVyblN0cmluZ3NbY29kZV07Ci0gICAgc3dpdGNoIChjb2RlKSB7Ci0gICAgICAgIGNhc2UgQlJfVFJBTlNBQ1RJT046Ci0gICAgICAgIGNhc2UgQlJfUkVQTFk6IHsKLSAgICAgICAgICAgIG91dCA8PCAiOiAiIDw8IGluZGVudDsKLSAgICAgICAgICAgIGNtZCA9IChjb25zdCBpbnQzMl90ICopcHJpbnRCaW5kZXJUcmFuc2FjdGlvbkRhdGEob3V0LCBjbWQpOwotICAgICAgICAgICAgb3V0IDw8IGRlZGVudDsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgCi0gICAgICAgIGNhc2UgQlJfQUNRVUlSRV9SRVNVTFQ6IHsKLSAgICAgICAgICAgIGNvbnN0IGludDMyX3QgcmVzID0gKmNtZCsrOwotICAgICAgICAgICAgb3V0IDw8ICI6ICIgPDwgcmVzIDw8IChyZXMgPyAiIChTVUNDRVNTKSIgOiAiIChGQUlMVVJFKSIpOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICAKLSAgICAgICAgY2FzZSBCUl9JTkNSRUZTOgotICAgICAgICBjYXNlIEJSX0FDUVVJUkU6Ci0gICAgICAgIGNhc2UgQlJfUkVMRUFTRToKLSAgICAgICAgY2FzZSBCUl9ERUNSRUZTOiB7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IGIgPSAqY21kKys7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IGMgPSAqY21kKys7Ci0gICAgICAgICAgICBvdXQgPDwgIjogdGFyZ2V0PSIgPDwgKHZvaWQqKWIgPDwgIiAoY29va2llICIgPDwgKHZvaWQqKWMgPDwgIikiOwotICAgICAgICB9IGJyZWFrOwotICAgIAotICAgICAgICBjYXNlIEJSX0FUVEVNUFRfQUNRVUlSRTogewotICAgICAgICAgICAgY29uc3QgaW50MzJfdCBwID0gKmNtZCsrOwotICAgICAgICAgICAgY29uc3QgaW50MzJfdCBiID0gKmNtZCsrOwotICAgICAgICAgICAgY29uc3QgaW50MzJfdCBjID0gKmNtZCsrOwotICAgICAgICAgICAgb3V0IDw8ICI6IHRhcmdldD0iIDw8ICh2b2lkKiliIDw8ICIgKGNvb2tpZSAiIDw8ICh2b2lkKiljCi0gICAgICAgICAgICAgICAgPDwgIiksIHByaT0iIDw8IHA7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBCUl9ERUFEX0JJTkRFUjoKLSAgICAgICAgY2FzZSBCUl9DTEVBUl9ERUFUSF9OT1RJRklDQVRJT05fRE9ORTogewotICAgICAgICAgICAgY29uc3QgaW50MzJfdCBjID0gKmNtZCsrOwotICAgICAgICAgICAgb3V0IDw8ICI6IGRlYXRoIGNvb2tpZSAiIDw8ICh2b2lkKiljOwotICAgICAgICB9IGJyZWFrOwotICAgIH0KLSAgICAKLSAgICBvdXQgPDwgZW5kbDsKLSAgICByZXR1cm4gY21kOwotfQotCi1zdGF0aWMgY29uc3Qgdm9pZCogcHJpbnRDb21tYW5kKFRleHRPdXRwdXQmIG91dCwgY29uc3Qgdm9pZCogX2NtZCkKLXsKLSAgICBzdGF0aWMgY29uc3QgaW50MzJfdCBOID0gc2l6ZW9mKGtDb21tYW5kU3RyaW5ncykvc2l6ZW9mKGtDb21tYW5kU3RyaW5nc1swXSk7Ci0gICAgC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NRVUlSRToKLSAgICAgICAgY2FzZSBCQ19SRUxFQVNFOgotICAgICAgICBjYXNlIEJDX0RFQ1JFRlM6IHsKLSAgICAgICAgICAgIGNvbnN0IGludDMyX3QgZCA9ICpjbWQrKzsKLSAgICAgICAgICAgIG91dCA8PCAiOiBkZXNjcmlwdG9yPSIgPDwgKHZvaWQqKWQ7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgCi0gICAgICAgIGNhc2UgQkNfSU5DUkVGU19ET05FOgotICAgICAgICBjYXNlIEJDX0FDUVVJUkVfRE9ORTogewotICAgICAgICAgICAgY29uc3QgaW50MzJfdCBiID0gKmNtZCsrOwotICAgICAgICAgICAgY29uc3QgaW50MzJfdCBjID0gKmNtZCsrOwotICAgICAgICAgICAgb3V0IDw8ICI6IHRhcmdldD0iIDw8ICh2b2lkKiliIDw8ICIgKGNvb2tpZSAiIDw8ICh2b2lkKiljIDw8ICIpIjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgCi0gICAgICAgIGNhc2UgQkNfQVRURU1QVF9BQ1FVSVJFOiB7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IHAgPSAqY21kKys7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IGQgPSAqY21kKys7Ci0gICAgICAgICAgICBvdXQgPDwgIjogZGVjcmlwdG9yPSIgPDwgKHZvaWQqKWQgPDwgIiwgcHJpPSIgPDwgcDsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgCi0gICAgICAgIGNhc2UgQkNfUkVRVUVTVF9ERUFUSF9OT1RJRklDQVRJT046Ci0gICAgICAgIGNhc2UgQkNfQ0xFQVJfREVBVEhfTk9USUZJQ0FUSU9OOiB7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IGggPSAqY21kKys7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IGMgPSAqY21kKys7Ci0gICAgICAgICAgICBvdXQgPDwgIjogaGFuZGxlPSIgPDwgaCA8PCAiIChkZWF0aCBjb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QpIElTIEpPSU5JTkcgVEhFIFRIUkVBRCBQT09MXG4iLCAodm9pZCopcHRocmVhZF9zZWxmKCksIGdldHBpZCgpKTsKLQotICAgIG1PdXQud3JpdGVJbnQzMihpc01haW4gPyBCQ19FTlRFUl9MT09QRVIgOiBCQ19SRUdJU1RFUl9MT09QRVIpOwotICAgIAotICAgIHN0YXR1c190IHJlc3VsdDsKLSAgICBkbyB7Ci0gICAgICAgIGludDMyX3QgY21kOwotICAgICAgICAKLSAgICAgICAgLy8gV2hlbiB3ZSd2ZSBjbGVhcmVkIHRoZSBpbmNvbWluZyBjb21tYW5kIHF1ZXVlLCBwcm9jZXNzIGFueSBwZW5kaW5nIGRlcmVmcwotICAgICAgICBpZiAobUluLmRhdGFQb3NpdGlvbigpID49IG1Jbi5kYXRhU2l6ZSgpKSB7Ci0gICAgICAgICAgICBzaXplX3QgbnVtUGVuZGluZyA9IG1QZW5kaW5nV2Vha0RlcmVmcy5zaXplKCk7Ci0gICAgICAgICAgICBpZiAobnVtUGVuZGluZyA+IDApIHsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG51bVBlbmRpbmc7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBSZWZCYXNlOjp3ZWFrcmVmX3R5cGUqIHJlZnMgPSBtUGVuZGluZ1dlYWtEZXJlZnNbaV07Ci0gICAgICAgICAgICAgICAgICAgIHJlZnMtPmRlY1dlYWsobVByb2Nlc3MuZ2V0KCkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtUGVuZGluZ1dlYWtEZXJlZnMuY2xlYXIoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbnVtUGVuZGluZyA9IG1QZW5kaW5nU3Ryb25nRGVyZWZzLnNpemUoKTsKLSAgICAgICAgICAgIGlmIChudW1QZW5kaW5nID4gMCkgewotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbnVtUGVuZGluZzsg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0gICAgICAgIGNtZCA9IG1Jbi5yZWFkSW50MzIoKTsKLSAgICAgICAgCi0gICAgICAgIElGX0xPR19DT01NQU5EUygpIHsKLSAgICAgICAgICAgIGFsb2cgPDwgIlByb2Nlc3Npbmcgd2FpdEZvclJlc3BvbnNlIENvbW1hbmQ6ICIKLSAgICAgICAgICAgICAgICA8PCBnZXRSZXR1cm5TdHJpbmcoY21kKSA8PCBlbmRsOwotICAgICAgICB9Ci0KLSAgICAgICAgc3dpdGNoIChjbWQpIHsKLSAgICAgICAgY2FzZSBCUl9UUkFOU0FDVElPTl9DT01QTEVURToKLSAgICAgICAgICAgIGlmICghcmVwbHkgJiYgIWFjcXVpcmVSZXN1bHQpIGdvdG8gZmluaXNoOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIAotICAgICAgICBjYXNlIEJSX0RFQURfUkVQTFk6Ci0gICAgICAgICAgICBlcnIgPSBERUFEX09CSkVDVDsKLSAgICAgICAgICAgIGdvdG8gZmluaXNoOwotCi0gICAgICAgIGNhc2UgQlJfRkFJTEVEX1JFUExZOgotICAgICAgICAgICAgZXJyID0gRkFJTEVEX1RSQU5TQUNUSU9OOwotICAgICAgICAgICAgZ290byBmaW5pc2g7Ci0gICAgICAgIAotICAgICAgICBjYXNlIEJSX0FDUVVJUkVfUkVTVUxUOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExPR19BU1NFUlQoYWNxdWlyZVJlc3VsdCAhPSBOVUxMLCAiVW5leHBlY3RlZCBickFDUVVJUkVfUkVTVUxUIik7Ci0gICAgICAgICAgICAgICAgY29uc3QgaW50MzJfdCByZXN1bHQgPSBtSW4ucmVhZEludDMyKCk7Ci0gICAgICAgICAgICAgICAgaWYgKCFhY3F1aXJlUmVzdWx0KSBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAqYWNxdWlyZVJlc3VsdCA9IHJlc3VsdCA/IE5PX0VSUk9SIDogSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBnb3RvIGZpbmlzaDsKLSAgICAgICAgCi0gICAgICAgIGNhc2UgQlJfUkVQTFk6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYmluZGVyX3RyYW5zYWN0aW9uX2RhdGEgdHI7Ci0gICAgICAgICAgICAgICAgZXJyID0gbUluLnJlYWQoJnRyLCBzaXplb2YodHIpKTsKLSAgICAgICAgICAgICAgICBMT0dfQVNTRVJUKGVyciA9PSBOT19FUlJPUiwgIk5vdCBlbm91Z2ggY29tbWFuZCBkYXRhIGZvciBiclJFUExZIik7Ci0gICAgICAgICAgICAgICAgaWYgKGVyciAhPSBOT19FUlJPUikgZ290byBmaW5pc2g7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVwbHkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh0ci5mbGFncyAmIFRGX1NUQVRVU19DT0RFKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXBseS0+aXBjU2V0RGF0YVJlZmVyZW5jZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQ4X3QqPih0ci5kYXRhLnB0ci5idWZmZXIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyLmRhdGFfc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IHNpemVfdCo+KHRyLmRhdGEucHRyLm9mZnNldHMpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyLm9mZnNldHNfc2l6ZS9zaXplb2Yoc2l6ZV90KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmVlQnVmZmVyLCB0aGlzKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGVyciA9ICpzdGF0aWNfY2FzdDxjb25zdCBzdGF0dXNfdCo+KHRyLmRhdGEucHRyLmJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmcmVlQnVmZmVyKE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4odHIuZGF0YS5wdHIuYnVmZmVyKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ci5kYXRhX3NpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCBzaXplX3QqPih0ci5kYXRhLnB0ci5vZmZzZXRzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ci5vZmZzZXRzX3NpemUvc2l6ZW9mKHNpemVfdCksIHRoaXMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZnJlZUJ1ZmZlcihOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4odHIuZGF0YS5wdHIuYnVmZmVyKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHRyLmRhdGFfc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3Qgc2l6ZV90Kj4odHIuZGF0YS5wdHIub2Zmc2V0cyksCi0gICAgICAgICAgICAgICAgICAgICAgICB0ci5vZmZzZXRzX3NpemUvc2l6ZW9mKHNpemVfdCksIHRoaXMpOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBnb3RvIGZpbmlzaDsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgZXJyID0gZXhlY3V0ZUNvbW1hbmQoY21kKTsKLSAgICAgICAgICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIGdvdG8gZmluaXNoOwotICA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Ws7Ci0gICAgCi0gICAgY2FzZSBCUl9UUkFOU0FDVElPTjoKLSAgICAgICAgewotICAgICAgICAgICAgYmluZGVyX3RyYW5zYWN0aW9uX2RhdGEgdHI7Ci0gICAgICAgICAgICByZXN1bHQgPSBtSW4ucmVhZCgmdHIsIHNpemVvZih0cikpOwotICAgICAgICAgICAgTE9HX0FTU0VSVChyZXN1bHQgPT0gTk9fRVJST1IsCi0gICAgICAgICAgICAgICAgIk5vdCBlbm91Z2ggY29tbWFuZCBkYXRhIGZvciBiclRSQU5TQUNUSU9OIik7Ci0gICAgICAgICAgICBpZiAocmVzdWx0ICE9IE5PX0VSUk9SKSBicmVhazsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgUGFyY2VsIGJ1ZmZlcjsKLSAgICAgICAgICAgIGJ1ZmZlci5pcGNTZXREYXRhUmVmZXJlbmNlKAotICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDhfdCo+KHRyLmRhdGEucHRyLmJ1ZmZlciksCi0gICAgICAgICAgICAgICAgdHIuZGF0YV9zaXplLAotICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3Qgc2l6ZV90Kj4odHIuZGF0YS5wdHIub2Zmc2V0cyksCi0gICAgICAgICAgICAgICAgdHIub2Zmc2V0c19zaXplL3NpemVvZihzaXplX3QpLCBmcmVlQnVmZmVyLCB0aGlzKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgY29uc3QgcGlkX3Qgb3JpZ1BpZCA9IG1DYWxsaW5nUGlkOwotICAgICAgICAgICAgY29uc3QgdWlkX3Qgb3JpZ1VpZCA9IG1DYWxsaW5nVWlkOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBtQ2FsbGluZ1BpZCA9IHRyLnNlbmRlcl9waWQ7Ci0gICAgICAgICAgICBtQ2FsbGluZ1VpZCA9IHRyLnNlbmRlcl9ldWlkOwotICAgICAgICAgICAgCi0gICAgICAgICAgICAvL0xPR0koIj4+Pj4gVFJBTlNBQ1QgZnJvbSBwaWQgJWQgdWlkICVkXG4iLCBtQ2FsbGluZ1BpZCwgbUNhbGxpbmdVaWQpOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBQYXJjZWwgcmVwbHk7Ci0gICAgICAgICAgICBJRl9MT0dfVFJBTlNBQ1RJT05TKCkgewotICAgICAgICAgICAgICAgIFRleHRPdXRwdXQ6OkJ1bmRsZSBfYihhbG9nKTsKLSAgICAgICAgICAgICAgICBhbG9nIDw8ICJCUl9UUkFOU0FDVElPTiB0aHIgIiA8PCAodm9pZCopcHRocmVhZF9zZWxmKCkKLSAgICAgICAgICAgICAgICAgICAgPDwgIiAvIG9iaiAiIDw8IHRyLnRhcmdldC5wdHIgPDwgIiAvIGNvZGUgIgotICAgICAgICAgICAgICAgICAgICA8PCBUeXBlQ29kZSh0ci5jb2RlKSA8PCAiOiAiIDw8IGluZGVudCA8PCBidWZmZXIKLSAgICAgICAgICAgICAgICAgICAgPDwgZGVkZW50IDw8IGVuZGwKLSAgICAgICAgICAgICAgICAgICAgPDwgIkRhdGEgYWRkciA9ICIKLSAgICAgICAgICAgICAgICAgICAgPDwgcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4odHIuZGF0YS5wdHIuYnVmZmVyKQotICAgICAgICAgICAgICAgICAgICA8PCAiLCBvZmZzZXRzIGFkZHI9IgotICAgICAgICAgICAgICAgICAgICA8PCByZWludGVycHJldF9jYXN0PGNvbnN0IHNpemVfdCo+KHRyLmRhdGEucHRyLm9mZnNldHMpIDw8IGVuZGw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodHIudGFyZ2V0LnB0cikgewotICAgICAgICAgICAgICAgIHNwPEJCaW5kZXI+IGIoKEJCaW5kZXIqKXRyLmNvb2tpZSk7Ci0gICAgICAgICAgICAgICAgY29uc3Qgc3RhdHVzX3QgZXJyb3IgPSBiLT50cmFuc2FjdCh0ci5jb2RlLCBidWZmZXIsICZyZXBseSwgMCk7Ci0gICAgICAgICAgICAgICAgaWYgKGVycm9yIDwgTk9fRVJST1IpIHJlcGx5LnNldEVycm9yKGVycm9yKTsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgY29uc3Qgc3RhdHVzX3QgZXJyb3IgPSB0aGVfY29udGV4dF9vYmplY3QtPnRyYW5zYWN0KHRyLmNvZGUsIGJ1ZmZlciwgJnJlcGx5LCAwKTsKLSAgICAgICAgICAgICAgICBpZiAoZXJyb3IgPCBOT19FUlJPUikgcmVwbHkuc2V0RXJyb3IoZXJyb3IpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgICAgICAvL0xPR0koIjw8PDwgVFJBTlNBQ1QgZnJvbSBwaWQgJWQgcmVzdG9yZSBwaWQgJWQgdWlkICVkXG4iLAotICAgICAgICAgICAgLy8gICAgIG1DYWxsaW5nUGlkLCBvcmlnUGlkLCBvcmlnVWlkKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgaWYgKCh0ci5mbGFncyAmIFRGX09ORV9XQVkpID09IDApIHsKLSAgICAgICAgICAgICAgICBMT0dfT05FV0FZKCJTZW5kaW5nIHJlcGx5IHRvICVkISIsIG1DYWxsaW5nUGlkKTsKLSAgICAgICAgICAgICAgICBzZW5kUmVwbHkocmVwbHksIDApOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBMT0dfT05FV0FZKCJOT1Qgc2VuZGluZyByZXBseSB0byAlZCEiLCBtQ2FsbGluZ1BpZCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIG1DYWxsaW5nUGlkID0gb3JpZ1BpZDsKLSAgICAgICAgICAgIG1DYWxsaW5nVWlkID0gb3JpZ1VpZDsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgSUZfTE9HX1RSQU5TQUNUSU9OUygpIHsKLSAgICAgICAgICAgICAgICBUZXh0T3V0cHV0OjpCdW5kbGUgX2IoYWxvZyk7Ci0gICAgICAgICAgICAgICAgYWxvZyA8PCAiQkNfUkVQTFkgdGhyICIgPDwgKHZvaWQqKXB0aHJlYWRfc2VsZigpIDw8ICIgLyBvYmogIgotICAgICAgICAgICAgICAgICAgICA8PCB0ci50YXJnZXQucHRyIDw8ICI6ICIgPDwgaW5kZW50IDw8IHJlcGx5IDw8IGRlZGVudCA8PCBlbmRsOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0gICAgCi0gICAgY2FzZSBCUl9ERUFEX0JJTkRFUjoKLSAgICAgICAgewotICAgICAgICAgICAgQnBCaW5kZXIgKnByb3h5ID0gKEJwQmluZGVyKiltSW4ucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBwcm94eS0+c2VuZE9iaXR1YXJ5KCk7Ci0gICAgICAgICAgICBtT3V0LndyaXRlSW50MzIoQkNfREVBRF9CSU5ERVJfRE9ORSk7Ci0gICAgICAgICAgICBtT3V0LndyaXRlSW50MzIoKGludDMyX3QpcHJveHkpOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICAKLSAgICBjYXNlIEJSX0NMRUFSX0RFQVRIX05PVElGSUNBVElPTl9ET05FOgotICAgICAgICB7Ci0gICAgICAgICAgICBCcEJpbmRlciAqcHJveHkgPSAoQnBCaW5kZXIqKW1Jbi5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHByb3h5LT5nZXRXZWFrUmVmcygpLT5kZWNXZWFrKHByb3h5KTsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgCi0gICAgY2FzZSBCUl9GSU5JU0hFRDoKLSAgICAgICAgcmVzdWx0ID0gVElNRURfT1VUOwotICAgICAgICBicmVhazsKLSAgICAgICAgCi0gICAgY2FzZSBCUl9OT09QOgotICAgICAgICBicmVhazsKLSAgICAgICAgCi0gICAgY2FzZSBCUl9TUEFXTl9MT09QRVI6Ci0gICAgIC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XVsdFNlcnZpY2VNYW5hZ2VyTG9jay51bmxvY2soKTsKLSAgICAKLSAgICBpbnQ2NF90IHN0YXJ0VGltZSA9IDA7Ci0KLSAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICBpZiAocGMgIT0gTlVMTCkgewotICAgICAgICAgICAgYm9vbCByZXMgPSBwYy0+Y2hlY2tQZXJtaXNzaW9uKHBlcm1pc3Npb24sIHBpZCwgdWlkKTsKLSAgICAgICAgICAgIGlmIChyZXMpIHsKLSAgICAgICAgICAgICAgICBpZiAoc3RhcnRUaW1lICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgTE9HSSgiQ2hlY2sgcGFzc2VkIGFmdGVyICVkIHNlY29uZHMgZm9yICVzIGZyb20gdWlkPSVkIHBpZD0lZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkoKHVwdGltZU1pbGxpcygpLXN0YXJ0VGltZSkvMTAwMCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOChwZXJtaXNzaW9uKS5zdHJpbmcoKSwgdWlkLCBwaWQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm4gcmVzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgICAgICAvLyBJcyB0aGlzIGEgcGVybWlzc2lvbiBmYWlsdXJlLCBvciBkaWQgdGhlIGNvbnRyb2xsZXIgZ28gYXdheT8KLSAgICAgICAgICAgIGlmIChwYy0+YXNCaW5kZXIoKS0+aXNCaW5kZXJBbGl2ZSgpKSB7Ci0gICAgICAgICAgICAgICAgTE9HVygiUGVybWlzc2lvbiBmYWlsdXJlOiAlcyBmcm9tIHVpZD0lZCBwaWQ9JWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOChwZXJtaXNzaW9uKS5zdHJpbmcoKSwgdWlkLCBwaWQpOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAotICAgICAgICAgICAgLy8gT2JqZWN0IGlzIGRlYWQhCi0gICAgICAgICAgICBnRGVmYXVsdFNlcnZpY2VNYW5hZ2VyTG9jay5sb2NrKCk7Ci0gICAgICAgICAgICBpZiAoZ1Blcm1pc3Npb25Db250cm9sbGVyID09IHBjKSB7Ci0gICAgICAgICAgICAgICAgZ1Blcm1pc3Npb25Db250cm9sbGVyID0gTlVMTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGdEZWZhdWx0U2VydmljZU1hbmFnZXJMb2NrLnVubG9jaygpOwotICAgICAgICB9Ci0gICAgCi0gICAgICAgIC8vIE5lZWQgdG8gcmV0cmlldmUgdGhlIHBlcm1pc3Npb24gY29udHJvbGxlci4KLSAgICAgICAgc3A8SUJpbmRlcj4gYmluZGVyID0gZGVmYXVsdFNlcnZpY2VNYW5hZ2VyKCktPmNoZWNrU2VydmljZShfcGVybWlzc2lvbik7Ci0gICAgICAgIGlmIChiaW5kZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgLy8gV2FpdCBmb3IgdGhlIHBlcm1pc3Npb24gY29udHJvbGxlciB0byBjb21lIGJhY2suLi4KLSAgICAgICAgICAgIGlmIChzdGFydFRpbWUgPT0gMCkgewotICAgICAgICAgICAgICAgIHN0YXJ0VGltZSA9IHVwdGltZU1pbGxpcygpOwotICAgICAgICAgICAgICAgIExPR0koIldhaXRpbmcgdG8gY2hlY2sgcGVybWlzc2lvbiAlcyBmcm9tIHVpZD0lZCBwaWQ9JWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOChwZXJtaXNzaW9uKS5zdHJpbmcoKSwgdWlkLCBwaWQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc2xlZXAoMSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBwYyA9IGludGVyZmFjZV9jYXN0PElQZXJtaXNzaW9uQ29udHJvbGxlcj4oYmluZGVyKTsKLSAgICAgICAgICAgIC8vI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OwotICAgICAgICAgICAgcmVwbHktPndyaXRlU3Ryb25nQmluZGVyKGIpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIEFERF9TRVJWSUNFX1RSQU5TQUNUSU9OOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSVNlcnZpY2VNYW5hZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBTdHJpbmcxNiB3aGljaCA9IGRhdGEucmVhZFN0cmluZzE2KCk7Ci0gICAgICAgICAgICBzcDxJQmluZGVyPiBiID0gZGF0YS5yZWFkU3Ryb25nQmluZGVyKCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBhZGRTZXJ2aWNlKHdoaWNoLCBiKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgTElTVF9TRVJWSUNFU19UUkFOU0FDVElPTjogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElTZXJ2aWNlTWFuYWdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgVmVjdG9yPFN0cmluZzE2PiBsaXN0ID0gbGlzdFNlcnZpY2VzKCk7Ci0gICAgICAgICAgICBjb25zdCBzaXplX3QgTiA9IGxpc3Quc2l6ZSgpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoTik7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBpPTA7IGk8TjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlU3RyaW5nMTYobGlzdFtpXSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgIC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c29uKSB7Ci0gICAgaWYgKHN0YXRzTWFwKSB7Ci0gICAgICAgIFNvY2tldFN0YXRzICpzID0gKFNvY2tldFN0YXRzKikgaGFzaG1hcEdldChzdGF0c01hcCwgJmZkKTsKLSAgICAgICAgaWYgKHMgIT0gTlVMTCkgewotICAgICAgICAgICAgaWYgKHMtPnNlbmQgIT0gMCB8fCBzLT5yZWN2ICE9IDApIHsKLSAgICAgICAgICAgICAgICBzLT5yZWFzb24gPSByZWFzb247Ci0gICAgICAgICAgICAgICAgLy8gNSBpbnQgKyBsaXN0IHR5cGUgbmVlZCAyIGJ5dGVzCi0gICAgICAgICAgICAgICAgY2hhciBidWZbTE9HX0xJU1RfTlVNQkVSICogNSArIDJdOwotICAgICAgICAgICAgICAgIGJ1ZlswXSA9IEVWRU5UX1RZUEVfTElTVDsKLSAgICAgICAgICAgICAgICBidWZbMV0gPSBMT0dfTElTVF9OVU1CRVI7Ci0gICAgICAgICAgICAgICAgY2hhciogd3JpdGVQb3MgPSBidWYgKyAyOwotICAgICAgICAgICAgICAgIHdyaXRlUG9zID0gcHV0X2ludCh3cml0ZVBvcywgcy0+c2VuZCk7Ci0gICAgICAgICAgICAgICAgd3JpdGVQb3MgPSBwdXRfaW50KHdyaXRlUG9zLCBzLT5yZWN2KTsKLSAgICAgICAgICAgICAgICB3cml0ZVBvcyA9IHB1dF9pbnQod3JpdGVQb3MsIHMtPmlwKTsKLSAgICAgICAgICAgICAgICB3cml0ZVBvcyA9IHB1dF9pbnQod3JpdGVQb3MsIHMtPnBvcnQpOwotICAgICAgICAgICAgICAgIHdyaXRlUG9zID0gcHV0X2ludCh3cml0ZVBvcywgcy0+cmVhc29uKTsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBhbmRyb2lkX2JXcml0ZUxvZyhTT0NLRVRfQ0xPU0VfTE9HLCBidWYsIHNpemVvZihidWYpKTsKLSAgICAgICAgICAgICAgICAvLyBMT0dEKCJzZW5kICVkIHJlY3YgJWQgcmVh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3QqIGZyZWVfY2h1bmsgPSAwOwotICAgIGNodW5rX3QqIGN1ciA9IG1MaXN0LmhlYWQoKTsKLQotICAgIHNpemVfdCBwYWdlc2l6ZSA9IGdldHBhZ2VzaXplKCk7Ci0gICAgd2hpbGUgKGN1cikgewotICAgICAgICBpbnQgZXh0cmEgPSAwOwotICAgICAgICBpZiAoZmxhZ3MgJiBQQUdFX0FMSUdORUQpCi0gICAgICAgICAgICBleHRyYSA9ICggLWN1ci0+c3RhcnQgJiAoKHBhZ2VzaXplL2tNZW1vcnlBbGlnbiktMSkgKSA7Ci0KLSAgICAgICAgLy8gYmVzdCBmaXQKLSAgICAgICAgaWYgKGN1ci0+ZnJlZSAmJiAoY3VyLT5zaXplID49IChzaXplK2V4dHJhKSkpIHsKLSAgICAgICAgICAgIGlmICgoIWZyZWVfY2h1bmspIHx8IChjdXItPnNpemUgPCBmcmVlX2NodW5rLT5zaXplKSkgewotICAgICAgICAgICAgICAgIGZyZWVfY2h1bmsgPSBjdXI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoY3VyLT5zaXplID09IHNpemUpIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBjdXIgPSBjdXItPm5leHQ7Ci0gICAgfQotCi0gICAgaWYgKGZyZWVfY2h1bmspIHsKLSAgICAgICAgY29uc3Qgc2l6ZV90IGZyZWVfc2l6ZSA9IGZyZWVfY2h1bmstPnNpemU7Ci0gICAgICAgIGZyZWVfY2h1bmstPmZyZWUgPSAwOwotICAgICAgICBmcmVlX2NodW5rLT5zaXplID0gc2l6ZTsKLSAgICAgICAgaWYgKGZyZWVfc2l6ZSA+IHNpemUpIHsKLSAgICAgICAgICAgIGludCBleHRyYSA9IDA7Ci0gICAgICAgICAgICBpZiAoZmxhZ3MgJiBQQUdFX0FMSUdORUQpCi0gICAgICAgICAgICAgICAgZXh0cmEgPSAoIC1mcmVlX2NodW5rLT5zdGFydCAmICgocGFnZXNpemUva01lbW9yeUFsaWduKS0xKSApIDsKLSAgICAgICAgICAgIGlmIChleHRyYSkgewotICAgICAgICAgICAgICAgIGNodW5rX3QqIHNwbGl0ID0gbmV3IGNodW5rX3QoZnJlZV9jaHVuay0+c3RhcnQsIGV4dHJhKTsKLSAgICAgICAgICAgICAgICBmcmVlX2NodW5rLT5zdGFydCArPSBleHRyYTsKLSAgICAgICAgICAgICAgICBtTGlzdC5pbnNlcnRCZWZvcmUoZnJlZV9jaHVuaywgc3BsaXQpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBMT0dFX0lGKChmbGFncyZQQUdFX0FMSUdORUQpICYmIAotICAgICAgICAgICAgICAgICAgICAoKGZyZWVfY2h1bmstPnN0YXJ0KmtNZW1vcnlBbGlnbikmKHBhZ2VzaXplLTEpKSwKLSAgICAgICAgICAgICAgICAgICAgIlBBR0VfQUxJR05FRCByZXF1ZXN0ZWQsIGJ1dCBwYWdlIGlzIG5vdCBhbGlnbmVkISEhIik7Ci0KLSAgICAgICAgICAgIGNvbnN0IHNzaXplX3QgdGFpbF9mcmVlID0gZnJlZV9zaXplIC0gKHNpemUrZXh0cmEpOwotICAgICAgICAgICAgaWYgKHRhaWxfZnJlZSA+IDApIHsKLSAgICAgICAgICAgICAgICBjaHVua190KiBzcGxpdCA9IG5ldyBjaHVua190KAotICAgICAgICAgICAgICAgICAgICAgICAgZnJlZV9jaHVuay0+c3RhcnQgKyBmcmVlX2NodW5rLT5zaXplLCB0YWlsX2ZyZWUpOwotICAgICAgICAgICAgICAgIG1MaXN0Lmluc2VydEFmdGVyKGZyZWVfY2h1bmssIHNwbGl0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKGZyZWVfY2h1bmstPnN0YXJ0KSprTWVtb3J5QWxpZ247Ci0gICAgfQotICAgIHJldHVybiBOT19NRU1PUlk7Ci19Ci0KLVNpbXBsZUJlc3RGaXRBbGxvY2F0b3I6OmNodW5rX3QqIFNpbXBsZUJlc3RGaXRBbGxvY2F0b3I6OmRlYWxsb2Moc2l6ZV90IHN0YXJ0KQotewotICAgIHN0YXJ0ID0gc3RhcnQgLyBrTWVtb3J5QWxpZ247Ci0gICAgY2h1bmtfdCogY3VyID0gbUxpc3QuaGVhZCgpOwotICAgIHdoaWxlIChjdXIpIHsKLSAgICAgICAgaWYgKGN1ci0+c3RhcnQgPT0gc3RhcnQpIHsKLSAgICAgICAgICAgIExPR19GQVRBTF9JRihjdXItPmZyZWUsCi0gICAgICAgICAgICAgICAgImJsb2NrIGF0IG9mZnNldCAweCUwOGxYIG9mIHNpemUgMHglMDhsWCBhbHJlYWR5IGZyZWVkIiwKLSAgICAgICAgICAgICAgICBjdXItPnN0YXJ0KmtNZW1vcnlBbGlnbiwgY3VyLT5zaXplKmtNZW1vcnlBbGlnbik7Ci0KLSAgICAgICAgICAgIC8vIG1lcmdlIGZyZWVkIGJsb2NrcyB0b2dldGhlcgotICAgICAgICAgICAgY2h1bmtfdCogZnJlZWQgPSBjdXI7Ci0gICAgICAgICAgICBjdXItPmZyZWUgPSAxOwotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIGNodW5rX3QqIGNvbnN0IHAgPSBjdXItPnByZXY7Ci0gICAgICAgICAgICAgICAgY2h1bmtfdCogY29uc3QgbiA9IGN1ci0+bmV4dDsKLSAgICAgICAgICAgICAgICBpZiAocCAmJiAocC0+ZnJlZSB8fCAhY3VyLT5zaXplKSkgewotICAgICAgICAgICAgICAgICAgICBmcmVlZCA9IHA7Ci0gICAgICAgICAgICAgICAgICAgIHAtPnNpemUgKz0gY3VyLT5zaXplOwotICAgICAgICAgICAgICAgICAgICBtTGlzdC5yZW1vdmUoY3VyKTsKLSAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGN1cjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY3VyID0gbjsKLSAgICAgICAgICAgIH0gd2hpbGUgKGN1ciAmJiBjdXItPmZy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pb2N0bAotICAgICAgICBwbWVtX3JlZ2lvbiByZWc7Ci0gICAgICAgIGludCBlcnIgPSBpb2N0bChmZCwgUE1FTV9HRVRfVE9UQUxfU0laRSwgJnJlZyk7Ci0gICAgICAgIGlmIChlcnIgPT0gMCkKLSAgICAgICAgICAgIHNpemUgPSByZWcubGVuOwotI2VuZGlmCi0gICAgICAgIGlmIChzaXplID09IDApIHsgLy8gdHJ5IGZzdGF0Ci0gICAgICAgICAgICBzdHJ1Y3Qgc3RhdCBzYjsKLSAgICAgICAgICAgIGlmIChmc3RhdChmZCwgJnNiKSA9PSAwKQotICAgICAgICAgICAgICAgIHNpemUgPSBzYi5zdF9zaXplOwotICAgICAgICB9Ci0gICAgICAgIC8vIGlmIGl0IGRpZG4ndCB3b3JrLCBsZXQgbW1hcCgpIGZhaWwuCi0gICAgfQotCi0gICAgaWYgKChtRmxhZ3MgJiBET05UX01BUF9MT0NBTExZKSA9PSAwKSB7Ci0gICAgICAgIHZvaWQqIGJhc2UgPSAodWludDhfdCopbW1hcCgwLCBzaXplLAotICAgICAgICAgICAgICAgIFBST1RfUkVBRHxQUk9UX1dSSVRFLCBNQVBfU0hBUkVELCBmZCwgMCk7Ci0gICAgICAgIGlmIChiYXNlID09IE1BUF9GQUlMRUQpIHsKLSAgICAgICAgICAgIExPR0UoIm1tYXAoZmQ9JWQsIHNpemU9JXUpIGZhaWxlZCAoJXMpIiwKLSAgICAgICAgICAgICAgICAgICAgZmQsIHVpbnQzMl90KHNpemUpLCBzdHJlcnJvcihlcnJubykpOwotICAgICAgICAgICAgY2xvc2UoZmQpOwotICAgICAgICAgICAgcmV0dXJuIC1lcnJubzsKLSAgICAgICAgfQotICAgICAgICAvL0xPR0QoIm1tYXAoZmQ9JWQsIGJhc2U9JXAsIHNpemU9JWx1KSIsIGZkLCBiYXNlLCBzaXplKTsKLSAgICAgICAgbUJhc2UgPSBiYXNlOwotICAgICAgICBtTmVlZFVubWFwID0gdHJ1ZTsKLSAgICB9IGVsc2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ljX2Nhc3Q8UmVmQmFzZTo6d2Vha3JlZl90eXBlKj4ob2JqLmJpbmRlciktPmluY1dlYWsod2hvKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgY2FzZSBCSU5ERVJfVFlQRV9IQU5ETEU6IHsKLSAgICAgICAgICAgIGNvbnN0IHNwPElCaW5kZXI+IGIgPSBwcm9jLT5nZXRTdHJvbmdQcm94eUZvckhhbmRsZShvYmouaGFuZGxlKTsKLSAgICAgICAgICAgIGlmIChiICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBMT0dfUkVGUygiUGFyY2VsICVwIGFjcXVpcmluZyByZWZlcmVuY2Ugb24gcmVtb3RlICVwIiwgd2hvLCBiLmdldCgpKTsKLSAgICAgICAgICAgICAgICBiLT5pbmNTdHJvbmcod2hvKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX1dFQUtfSEFORExFOiB7Ci0gICAgICAgICAgICBjb25zdCB3cDxJQmluZGVyPiBiID0gcHJvYy0+Z2V0V2Vha1Byb3h5Rm9ySGFuZGxlKG9iai5oYW5kbGUpOwotICAgICAgICAgICAgaWYgKGIgIT0gTlVMTCkgYi5nZXRfcmVmcygpLT5pbmNXZWFrKHdobyk7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBCSU5ERVJfVFlQRV9GRDogewotICAgICAgICAgICAgLy8gaW50ZW50aW9uYWxseSBibGFuayAtLSBub3RoaW5nIHRvIGRvIHRvIGFjcXVpcmUgdGhpcywgYnV0IHdlIGRvCi0gICAgICAgICAgICAvLyByZWNvZ25pemUgaXQgYXMgYSBsZWdpdGltYXRlIG9iamVjdCB0eXBlLgotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgTE9HRCgiSW52YWxpZCBvYmplY3QgdHlwZSAweCUwOGx4Iiwgb2JqLnR5cGUpOwotfQotCi12b2lkIHJlbGVhc2Vfb2JqZWN0KGNvbnN0IHNwPFByb2Nlc3NTdGF0ZT4mIHByb2MsCi0gICAgY29uc3QgZmxhdF9iaW5kZXJfb2JqZWN0JiBvYmosIGNvbnN0IHZvaWQqIHdobykKLXsKLSAgICBzd2l0Y2ggKG9iai50eXBlKSB7Ci0gICAgICAgIGNhc2UgQklOREVSX1RZUEVfQklOREVSOgotICAgICAgICAgICAgaWYgKG9iai5iaW5kZXIpIHsKLSAgICAgICAgICAgICAgICBMT0dfUkVGUygiUGFyY2VsICVwIHJlbGVhc2luZyByZWZlcmVuY2Ugb24gbG9jYWwgJXAiLCB3aG8sIG9iai5jb29raWUpOwotICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PElCaW5kZXIqPihvYmouY29va2llKS0+ZGVjU3Ryb25nKHdobyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIGNhc2UgQklOREVSX1RZUEVfV0VBS19CSU5ERVI6Ci0gICAgICAgICAgICBpZiAob2JqLmJpbmRlcikKLSAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxSZWZCYXNlOjp3ZWFrcmVmX3R5cGUqPihvYmouYmluZGVyKS0+ZGVjV2Vhayh3aG8pOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX0hBTkRMRTogewotICAgICAgICAgICAgY29uc3Qgc3A8SUJpbmRlcj4gYiA9IHByb2MtPmdldFN0cm9uZ1Byb3h5Rm9ySGFuZGxlKG9iai5oYW5kbGUpOwotICAgICAgICAgICAgaWYgKGIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIExPR19SRUZTKCJQYXJjZWwgJXAgcmVsZWFzaW5nIHJlZmVyZW5jZSBvbiByZW1vdGUgJXAiLCB3aG8sIGIuZ2V0KCkpOwotICAgICAgICAgICAgICAgIGItPmRlY1N0cm9uZyh3aG8pOwotICAgICAgICA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0gICAgICAgIElCaW5kZXIgKmxvY2FsID0gYmluZGVyLT5sb2NhbEJpbmRlcigpOwotICAgICAgICBpZiAoIWxvY2FsKSB7Ci0gICAgICAgICAgICBCcEJpbmRlciAqcHJveHkgPSBiaW5kZXItPnJlbW90ZUJpbmRlcigpOwotICAgICAgICAgICAgaWYgKHByb3h5ID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBMT0dFKCJudWxsIHByb3h5Iik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IGhhbmRsZSA9IHByb3h5ID8gcHJveHktPmhhbmRsZSgpIDogMDsKLSAgICAgICAgICAgIG9iai50eXBlID0gQklOREVSX1RZUEVfSEFORExFOwotICAgICAgICAgICAgb2JqLmhhbmRsZSA9IGhhbmRsZTsKLSAgICAgICAgICAgIG9iai5jb29raWUgPSBOVUxMOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgb2JqLnR5cGUgPSBCSU5ERVJfVFlQRV9CSU5ERVI7Ci0gICAgICAgICAgICBvYmouYmluZGVyID0gbG9jYWwtPmdldFdlYWtSZWZzKCk7Ci0gICAgICAgICAgICBvYmouY29va2llID0gbG9jYWw7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UgewotICAgICAgICBvYmoudHlwZSA9IEJJTkRFUl9UWVBFX0JJTkRFUjsKLSAgICAgICAgb2JqLmJpbmRlciA9IE5VTEw7Ci0gICAgICAgIG9iai5jb29raWUgPSBOVUxMOwotICAgIH0KLSAgICAKLSAgICByZXR1cm4gZmluaXNoX2ZsYXR0ZW5fYmluZGVyKGJpbmRlciwgb2JqLCBvdXQpOwotfQotCi1zdGF0dXNfdCBmbGF0dGVuX2JpbmRlcihjb25zdCBzcDxQcm9jZXNzU3RhdGU+JiBwcm9jLAotICAgIGNvbnN0IHdwPElCaW5kZXI+JiBiaW5kZXIsIFBhcmNlbCogb3V0KQotewotICAgIGZsYXRfYmluZGVyX29iamVjdCBvYmo7Ci0gICAgCi0gICAgb2JqLmZsYWdzID0gMHg3ZiB8IEZMQVRfQklOREVSX0ZMQUdfQUNDRVBUU19GRFM7Ci0gICAgaWYgKGJpbmRlciAhPSBOVUxMKSB7Ci0gICAgICAgIHNwPElCaW5kZXI+IHJlYWwgPSBiaW5kZXIucHJvbW90ZSgpOwotICAgICAgICBpZiAocmVhbCAhPSBOVUxMKSB7Ci0gICAgICAgICAgICBJQmluZGVyICpsb2NhbCA9IHJlYWwtPmxvY2FsQmluZGVyKCk7Ci0gICAgICAgICAgICBpZiAoIWxvY2FsKSB7Ci0gICAgICAgICAgICAgICAgQnBCaW5kZXIgKnByb3h5ID0gcmVhbC0+cmVtb3RlQmluZGVyKCk7Ci0gICAgICAgICAgICAgICAgaWYgKHByb3h5ID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgTE9HRSgibnVsbCBwcm94eSIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjb25zdCBpbnQzMl90IGhhbmRsZSA9IHByb3h5ID8gcHJveHktPmhhbmRsZSgpIDogMDsKLSAgICAgICAgICAgICAgICBvYmoudHlwZSA9IEJJTkRFUl9UWVBFX1dFQUtfSEFORExFOwotICAgICAgICAgICAgICAgIG9iai5oYW5kbGUgPSBoYW5kbGU7Ci0gICAgICAgICAgICAgICAgb2JqLmNvb2tpZSA9IE5VTEw7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG9iai50eXBlID0gQklOREVSX1RZUEVfV0VBS19CSU5ERVI7Ci0gICAgICAgICAgICAgICAgb2JqLmJpbmRlciA9IGJpbmRlci5nZXRfcmVmcygpOwotICAgICAgICAgICAgICAgIG9iai5jb29raWUgPSBiaW5kZXIudW5zYWZlX2dldCgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIGZpbmlzaF9mbGF0dGVuX2JpbmRlcihyZWFsLCBvYmosIG91dCk7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIC8v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A8SUJpbmRlcj4qIG91dCkKLXsKLSAgICBjb25zdCBmbGF0X2JpbmRlcl9vYmplY3QqIGZsYXQgPSBpbi5yZWFkT2JqZWN0KGZhbHNlKTsKLSAgICAKLSAgICBpZiAoZmxhdCkgewotICAgICAgICBzd2l0Y2ggKGZsYXQtPnR5cGUpIHsKLSAgICAgICAgICAgIGNhc2UgQklOREVSX1RZUEVfQklOREVSOgotICAgICAgICAgICAgICAgICpvdXQgPSBzdGF0aWNfY2FzdDxJQmluZGVyKj4oZmxhdC0+Y29va2llKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmluaXNoX3VuZmxhdHRlbl9iaW5kZXIoTlVMTCwgKmZsYXQsIGluKTsKLSAgICAgICAgICAgIGNhc2UgQklOREVSX1RZUEVfV0VBS19CSU5ERVI6Ci0gICAgICAgICAgICAgICAgaWYgKGZsYXQtPmJpbmRlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIG91dC0+c2V0X29iamVjdF9hbmRfcmVmcygKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PElCaW5kZXIqPihmbGF0LT5jb29raWUpLAotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8UmVmQmFzZTo6d2Vha3JlZl90eXBlKj4oZmxhdC0+YmluZGVyKSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgKm91dCA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiBmaW5pc2hfdW5mbGF0dGVuX2JpbmRlcihOVUxMLCAqZmxhdCwgaW4pOwotICAgICAgICAgICAgY2FzZSBCSU5ERVJfVFlQRV9IQU5ETEU6Ci0gICAgICAgICAgICBjYXNlIEJJTkRFUl9UWVBFX1dFQUtfSEFORExFOgotICAgICAgICAgICAgICAgICpvdXQgPSBwcm9jLT5nZXRXZWFrUHJveHlGb3JIYW5kbGUoZmxhdC0+a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kFEX1ZBTFVFOwotICAgIH0KLQotICAgIC8vIENvdW50IG9iamVjdHMgaW4gcmFuZ2UKLSAgICBmb3IgKGludCBpID0gMDsgaSA8IChpbnQpIHNpemU7IGkrKykgewotICAgICAgICBzaXplX3Qgb2ZmID0gb2JqZWN0c1tpXTsKLSAgICAgICAgaWYgKChvZmYgPj0gb2Zmc2V0KSAmJiAob2ZmIDwgb2Zmc2V0ICsgbGVuKSkgewotICAgICAgICAgICAgaWYgKGZpcnN0SW5kZXggPT0gLTEpIHsKLSAgICAgICAgICAgICAgICBmaXJzdEluZGV4ID0gaTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGxhc3RJbmRleCA9IGk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgaW50IG51bU9iamVjdHMgPSBsYXN0SW5kZXggLSBmaXJzdEluZGV4ICsgMTsKLQotICAgIC8vIGdyb3cgZGF0YQotICAgIGVyciA9IGdyb3dEYXRhKGxlbik7Ci0gICAgaWYgKGVyciAhPSBOT19FUlJPUikgewotICAgICAgICByZXR1cm4gZXJyOwotICAgIH0KLQotICAgIC8vIGFwcGVuZCBkYXRhCi0gICAgbWVtY3B5KG1EYXRhICsgbURhdGFQb3MsIGRhdGEgKyBvZmZzZXQsIGxlbik7Ci0gICAgbURhdGFQb3MgKz0gbGVuOwotICAgIG1EYXRhU2l6ZSArPSBsZW47Ci0KLSAgICBpZiAobnVtT2JqZWN0cyA+IDApIHsKLSAgICAgICAgLy8gZ3JvdyBvYmplY3RzCi0gICAgICAgIGlmIChtT2JqZWN0c0NhcGFjaXR5IDwgbU9iamVjdHNTaXplICsgbnVtT2JqZWN0cykgewotICAgICAgICAgICAgaW50IG5ld1NpemUgPSAoKG1PYmplY3RzU2l6ZSArIG51bU9iamVjdHMpKjMpLzI7Ci0gICAgICAgICAgICBzaXplX3QgKm9iamVjdHMgPQotICAgICAgICAgICAgICAgIChzaXplX3QqKXJlYWxsb2MobU9iamVjdHMsIG5ld1NpemUqc2l6ZW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VkIHRvICVsZFxuIiwgbGVuLCBwYWRkZWQpOwotICAgICAgICB1aW50OF90KiBjb25zdCBkYXRhID0gbURhdGErbURhdGFQb3M7Ci0KLSAgICAgICAgLy8gTmVlZCB0byBwYWQgYXQgZW5kPwotICAgICAgICBpZiAocGFkZGVkICE9IGxlbikgewotI2lmIEJZVEVfT1JERVIgPT0gQklHX0VORElBTgotICAgICAgICAgICAgc3RhdGljIGNvbnN0IHVpbnQzMl90IG1hc2tbNF0gPSB7Ci0gICAgICAgICAgICAgICAgMHgwMDAwMDAwMCwgMHhmZmZmZmYwMCwgMHhmZmZmMDAwMCwgMHhmZjAwMDAwMAotICAgICAgICAgICAgfTsKLSNlbmRpZgotI2lmIEJZVEVfT1JERVIgPT0gTElUVExFX0VORElBTgotICAgICAgICAgICAgc3RhdGljIGNvbnN0IHVpbnQzMl90IG1hc2tbNF0gPSB7Ci0gICAgICAgICAgICAgICAgMHgwMDAwMDAwMCwgMHgwMGZmZmZmZiwgMHgwMDAwZmZmZiwgMHgwMDAwMDBmZgotICAgICAgICAgICAgfTsKLSNlbmRpZgotICAgICAgICAgICAgLy9wcmludGYoIkFwcGx5aW5nIHBhZCBtYXNrOiAlcCB0byAlcFxuIiwgKHZvaWQqKW1hc2tbcGFkZGVkLWxlbl0sCi0gICAgICAgICAgICAvLyAgICAqcmVpbnRlcnByZXRfY2FzdDx2b2lkKio+KGRhdGErcGFkZGVkLTQpKTsKLSAgICAgICAgICAgICpyZWludGVycHJldF9jYXN0PHVpbnQzMl90Kj4oZGF0YStwYWRkZWQtNCkgJj0gbWFza1twYWRkZWQtbGVuXTsKLSAgICAgICAgfQotCi0gICAgICAgIGZpbmlzaFdyaXRlKHBhZGRlZCk7Ci0gICAgICAgIHJldHVybiBkYXRhOwotICAgIH0KLQotICAgIHN0YXR1c190IGVyciA9IGdyb3dEYXRhKHBhZGRlZCk7Ci0gICAgaWYgKGVyciA9PSBOT19FUlJPUikgZ290byByZXN0YXJ0X3dyaXRlOwotICAg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GF0YSkgY29uc3QKLXsKLSAgICBjb25zdCBzaXplX3QgRFBPUyA9IG1EYXRhUG9zOwotICAgIGlmICgoRFBPUytzaXplb2YoZmxhdF9iaW5kZXJfb2JqZWN0KSkgPD0gbURhdGFTaXplKSB7Ci0gICAgICAgIGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCogb2JqCi0gICAgICAgICAgICAgICAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCo+KG1EYXRhK0RQT1MpOwotICAgICAgICBtRGF0YVBvcyA9IERQT1MgKyBzaXplb2YoZmxhdF9iaW5kZXJfb2JqZWN0KTsKLSAgICAgICAgaWYgKCFudWxsTWV0YURhdGEgJiYgKG9iai0+Y29va2llID09IE5VTEwgJiYgb2JqLT5iaW5kZXIgPT0gTlVMTCkpIHsKLSAgICAgICAgICAgIC8vIFdoZW4gdHJhbnNmZXJyaW5nIGEgTlVMTCBvYmplY3QsIHdlIGRvbid0IHdyaXRlIGl0IGludG8KLSAgICAgICAgICAgIC8vIHRoZSBvYmplY3QgbGlzdCwgc28gd2UgZG9uJ3Qgd2FudCB0byBjaGVjayBmb3IgaXQgd2hlbgotICAgICAgICAgICAgLy8gcmVhZGluZy4KLSAgICAgICAgICAgIExPR1YoInJlYWRPYmplY3QgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOwotICAgICAgICAgICAgcmV0dXJuIG9iajsKLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgLy8gRW5zdXJlIHRoYXQgdGhpcyBvYmplY3QgaXMgdmFsaWQuLi4KLSAgICAgICAgc2l6ZV90KiBjb25zdCBPQkpTID0gbU9iamVjdHM7Ci0gICAgICAgIGNvbnN0IHNpemVfdCBOID0gbU9iamVjdHNTaXplOwotICAgICAgICBzaXplX3Qgb3BvcyA9IG1OZXh0T2JqZWN0SGludDsKLSAgICAgICAgCi0gICAgICAgIGlmIChOID4gMCkgewotICAgICAgICAgICAgTE9HVigiUGFyY2VsICVwIGxvb2tpbmcgZm9yIG9iaiBhdCAlZCwgaGludD0lZFxuIiwKLSAgICAgICAgICAgICAgICAgdGhpcywgRFBPUywgb3Bvcyk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8vIFN0YXJ0IGF0IHRoZSBjdXJyZW50IGhpbnQgcG9zaXRpb24sIGxvb2tpbmcgZm9yIGFuIG9iamVjdCBhdAotICAgICAgICAgICAgLy8gdGhlIGN1cnJlbnQgZGF0YSBwb3NpdGlvbi4KLSAgICAgICAgICAgIGlmIChvcG9zIDwgTikgewotICAgICAgICAgICAgICAgIHdoaWxlIChvcG9zIDwgKE4tMSkgJiYgT0JKU1tvcG9zXSA8IERQT1MpIHsKLSAgICAgICAgICAgICAgICAgICAgb3BvcysrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgb3BvcyA9IE4tMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChPQkpTW29wb3NdID09IERQT1MpIHsKLSAgICAgICAgICAgICAgICAvLyBGb3VuZCBpdCEKLSAgICAgICAgICAgICAgICBMT0dWKCJQYXJjZWwgZm91bmQgb2JqICVkIGF0IGluZGV4ICVkIHdpdGggZm9yd2FyZCBzZWFyY2giLAotICAgICAgICAgICAgICAgICAgICAgdGhpcywgRFBPUywgb3Bvcyk7Ci0gICAgICAgICAgICAgICAgbU5leHRPYmplY3RIaW50ID0gb3BvcysxOwotICAgICAgICAgICAgICAgIExPR1YoInJlYWRPYmplY3QgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOwotICAgICAgICAgICAgICAgIHJldHVybiBvYmo7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICAgICAgLy8gTG9vayBiYWNrd2FyZHMgZm9yIGl0Li4uCi0gICAgICAgICAgICB3aGlsZSAob3BvcyA+I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0gTlVMTDsKLSAgICBtT2JqZWN0c1NpemUgPSBtT2JqZWN0c0NhcGFjaXR5ID0gMDsKLSAgICBtTmV4dE9iamVjdEhpbnQgPSAwOwotICAgIG1IYXNGZHMgPSBmYWxzZTsKLSAgICBtRmRzS25vd24gPSB0cnVlOwotICAgIAotICAgIHJldHVybiBOT19FUlJPUjsKLX0KLQotc3RhdHVzX3QgUGFyY2VsOjpjb250aW51ZVdyaXRlKHNpemVfdCBkZXNpcmVkKQotewotICAgIC8vIElmIHNocmlua2luZywgZmlyc3QgYWRqdXN0IGZvciBhbnkgb2JqZWN0cyB0aGF0IGFwcGVhcgotICAgIC8vIGFmdGVyIHRoZSBuZXcgZGF0YSBzaXplLgotICAgIHNpemVfdCBvYmplY3RzU2l6ZSA9IG1PYmplY3RzU2l6ZTsKLSAgICBpZiAoZGVzaXJlZCA8IG1EYXRhU2l6ZSkgewotICAgICAgICBpZiAoZGVzaXJlZCA9PSAwKSB7Ci0gICAgICAgICAgICBvYmplY3RzU2l6ZSA9IDA7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICB3aGlsZSAob2JqZWN0c1NpemUgPiAwKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1PYmplY3RzW29iamVjdHNTaXplLTFdIDwgZGVzaXJlZCkKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgb2JqZWN0c1NpemUtLTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICBpZiAobU93bmVyKSB7Ci0gICAgICAgIC8vIElmIHRoZSBzaXplIGlzIGdvaW5nIHRvIHplcm8sIGp1c3QgcmVsZWFzZSB0aGUgb3duZXIncyBkYXRhLgotICAgICAgICBpZiAoZGVzaXJlZCA9PSAwKSB7Ci0gICAgICAgICAgICBmcmVlRGF0YSgpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gSWYgdGhlcmUgaXMgYSBkaWZmZXJlbnQgb3duZXIsIHdlIG5lZWQgdG8gdGFrZQotICAgICAgICAvLyBwb3Nlc3Npb24uCi0gICAgICAgIHVpbnQ4X3QqIGRhdGEgPSAodWludDhfdCopbWFsbG9jKGRlc2lyZWQpOwotICAgICAgICBpZiAoIWRhdGEpIHsKLSAgICAgICAgICAgIG1FcnJvciA9IE5PX01FTU9SWTsKLSAgICAgICAgICAgIHJldHVybiBOT19NRU1PUlk7Ci0gICAgICAgIH0KLSAgICAgICAgc2l6ZV90KiBvYmplY3RzID0gTlVMTDsKLSAgICAgICAgCi0gICAgICAgIGlmIChvYmplY3RzU2l6ZSkgewotICAgICAgICAgICAgb2JqZWN0cyA9IChzaXplX3QqKW1hbGxvYyhvYmplY3RzU2l6ZSpzaXplb2Yoc2l6ZV90KSk7Ci0gICAgICAgICAgICBpZiAoIW9iamVjdHMpIHsKLSAgICAgICAgICAgICAgICBtRXJyb3IgPSBOT19NRU1PUlk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5PX01FTU9SWTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gTGl0dGxlIGhhY2sgdG8gb25seSBhY3F1aXJlIHJlZmVyZW5jZXMgb24gb2JqZWN0cwotICAgICAgICAgICAgLy8gd2Ugd2lsbCBiZSBrZWVwaW5nLgotICAgICAgICAgICAgc2l6ZV90IG9sZE9iamVjdHNTaXplID0gbU9iamVjdHNTaXplOwotICAgICAgICAgICAgbU9iamVjdHNTaXplID0gb2JqZWN0c1NpemU7Ci0gICAgICAgICAgICBhY3F1aXJlT2JqZWN0cygpOwotICAgICAgICAgICAgbU9iamVjdHNTaXplID0gb2xkT2JqZWN0c1NpemU7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGlmIChtRGF0YSkgewotICAgICAgICAgICAgbWVtY3B5KGRhdGEsIG1EYXRhLCBtRGF0YVNpemUgPCBkZXNpcmVkID8gbURhdGFTaXplIDogZGVzaXJ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ICAgICAgZm9yIChzaXplX3QgaT1vYmplY3RzU2l6ZTsgaTxtT2JqZWN0c1NpemU7IGkrKykgewotICAgICAgICAgICAgICAgIGNvbnN0IGZsYXRfYmluZGVyX29iamVjdCogZmxhdAotICAgICAgICAgICAgICAgICAgICA9IHJlaW50ZXJwcmV0X2Nhc3Q8ZmxhdF9iaW5kZXJfb2JqZWN0Kj4obURhdGErbU9iamVjdHNbaV0pOwotICAgICAgICAgICAgICAgIGlmIChmbGF0LT50eXBlID09IEJJTkRFUl9UWVBFX0ZEKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdpbGwgbmVlZCB0byByZXNjYW4gYmVjYXVzZSB3ZSBtYXkgaGF2ZSBsb3BwZWQgb2ZmIHRoZSBvbmx5IEZEcwotICAgICAgICAgICAgICAgICAgICBtRmRzS25vd24gPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmVsZWFzZV9vYmplY3QocHJvYywgKmZsYXQsIHRoaXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc2l6ZV90KiBvYmplY3RzID0KLSAgICAgICAgICAgICAgICAoc2l6ZV90KilyZWFsbG9jKG1PYmplY3RzLCBvYmplY3RzU2l6ZSpzaXplb2Yoc2l6ZV90KSk7Ci0gICAgICAgICAgICBpZiAob2JqZWN0cykgewotICAgICAgICAgICAgICAgIG1PYmplY3RzID0gb2JqZWN0czsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1PYmplY3RzU2l6ZSA9IG9iamVjdHNTaXplOwotICAgICAgICAgICAgbU5leHRPYmplY3RIaW50ID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIFdlIG93biB0aGUgZGF0YSwgc28gd2UgY2FuIGp1c3QgZG8gYSByZWFsbG9jKCkuCi0gICAgICAgIGlmIChkZXNpcmVkID4gbURhdGFDYXBhY2l0eSkgewotICAgICAgICAgICAgdWludDhfdCogZGF0YSA9ICh1aW50OF90KilyZWFsbG9jKG1EYXRhLCBkZXNpcmVkKTsKLSAgICAgICAgICAgIGlmIChkYXRhKSB7Ci0gICAgICAgICAgICAgICAgbURhdGEgPSBkYXRhOwotICAgICAgICAgICAgICAgIG1EYXRhQ2FwYWNpdHkgPSBkZXNpcmVkOwotICAgICAgICAgICAgfSBlbHNlIGlmIChkZXNpcmVkID4gbURhdGFDYXBhY2l0eSkgewotICAgICAgICAgICAgICAgIG1FcnJvciA9IE5PX01FTU9SWTsKLSAgICAgICAgICAgICAgICByZXR1cm4gTk9fTUVNT1JZOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbURhdGFTaXplID0gZGVzaXJlZDsKLSAgICAgICAgICAgIExPR1YoImNvbnRpbnVlV3JpdGUgU2V0dGluZyBkYXRhIHNpemUgb2YgJXAgdG8gJWRcbiIsIHRoaXMsIG1EYXRhU2l6ZSk7Ci0gICAgICAgICAgICBpZiAobURhdGFQb3MgPiBkZXNpcmVkKSB7Ci0gICAgICAgICAgICAgICAgbURhdGFQb3MgPSBkZXNpcmVkOwotICAgICAgICAgICAgICAgIExPR1YoImNvbnRpbnVlV3JpdGUgU2V0dGluZyBkYXRhIHBvcyBvZiAlcCB0byAlZFxuIiwgdGhpcywgbURhdGFQb3MpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIAotICAgIH0gZWxzZSB7Ci0gICAgICAgIC8vIFRoaXMgaXMgdGhlIGZpcnN0IGRhdGEuICBFYXN5IQotICAgICAgICB1aW50OF90KiBkYXRhID0gKHVpbnQ4X3QqKW1hbGxvYyhkZXNpcmVkKTsKLSAgICAgICAgaWYgKCFkYXRhKSB7Ci0gICAgICAgICAgICBtRXJyb3IgPSBOT19NRU1PUlk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fTUVNT1JZOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBpZighKG1EYXRhQ2FwYWNpdHkgPT0gMCAmJiBtT2JqZWN0cyA9PSBOVUxMCi0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Y2Vzc1N0YXRlOjp+UHJvY2Vzc1N0YXRlKCkKLXsKLX0KLSAgICAgICAgCi19OyAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbGlicy91dGlscy9SZXNvdXJjZVR5cGVzLmNwcCBiL2xpYnMvdXRpbHMvUmVzb3VyY2VUeXBlcy5jcHAKaW5kZXggMDgzMWY0YS4uZjgwODQzZCAxMDA2NDQKLS0tIGEvbGlicy91dGlscy9SZXNvdXJjZVR5cGVzLmNwcAorKysgYi9saWJzL3V0aWxzL1Jlc291cmNlVHlwZXMuY3BwCkBAIC0zMjg0LDcgKzMyODQsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmIChjID09ICdcJycgJiYgKHF1b3RlZCA9PSAwIHx8IHF1b3RlZCA9PSAnXCcnKSkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogSW4gcHJhY3RpY2UsIHdoZW4gcGVvcGxlIHdyaXRlICcgaW5zdGVhZCBvZiBcJworICAgICAgICAgICAgICAgICAgICAgKiBpbiBhIHN0cmluZywgdGhleSBhcmUgZG9pbmcgaXQgYnkgYWNjaWRlbnQKKyAgICAgICAgICAgICAgICAgICAgICogaW5zdGVhZCBvZiByZWFsbHkgbWVhbmluZyB0byB1c2UgJyBhcyBhIHF1b3RpbmcKKyAgICAgICAgICAgICAgICAgICAgICogY2hhcmFjdGVyLiAgV2FybiB0aGVtIHNvIHRoZXkgZG9uJ3QgbG9zZSBpdC4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGlmIChvdXRFcnJvck1zZykgeworICAgICAgICAgICAgICAgICAgICAgICAgKm91dEVycm9yTXNnID0gIkFwb3N0cm9waGUgbm90IHByZWNlZGVkIGJ5IFxcIjsKKyAgICAgICAgICAgICAgICA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ldHVybiAoZXJyID4gMCkgPyAtZXJyIDogLTE7Ci0gICAgfQotCi0gICAgcmV0dXJuIGNjOwotfQotCi0vKgotICogV3JpdGUgZGF0YSB0byBhIHNvY2tldC4KLSAqCi0gKiBTdGFuZGFyZCBzZW1hbnRpY3M6IHdyaXRlIHVwIHRvICJsZW4iIGJ5dGVzIGludG8gImJ1ZiIuICBSZXR1cm5zIHRoZQotICogbnVtYmVyIG9mIGJ5dGVzIHdyaXR0ZW4sIG9yIGxlc3MgdGhhbiB6ZXJvIG9uIGVycm9yLgotICovCi1pbnQgU29ja2V0Ojp3cml0ZShjb25zdCB2b2lkKiBidWYsIHNzaXplX3QgbGVuKSBjb25zdAotewotICAgIGlmIChtU29jayA9PSBVTkRFRl9TT0NLRVQpIHsKLSAgICAgICAgTE9HKExPR19FUlJPUiwgInNvY2tldCIsICJFUlJPUjogd3JpdGUgb24gaW52YWxpZCBzb2NrZXRcbiIpOwotICAgICAgICByZXR1cm4gLTUwMDsKLSAgICB9Ci0KLSNpZmRlZiBIQVZFX1dJTlNPQ0sKLSAgICBTT0NLRVQgc29jayA9IChTT0NLRVQpIG1Tb2NrOwotI2Vsc2UKLSAgICBpbnQgc29jayA9IChpbnQpIG1Tb2NrOwotI2VuZGlmCi0gICAgaW50IGNjOwotCi0gICAgY2MgPSBzZW5kKHNvY2ssIChjb25zdCBjaGFyKilidWYsIGxlbiwgMCk7Ci0gICAgaWYgKGNjIDwgMCkgewotICAgICAgICBpbnQgZXJyID0gZ2V0U29ja2V0RXJyb3IoKTsKLSAgICAgICAgcmV0dXJuIChlcnIgPiAwKSA/IC1lcnIgOiAtMTsKLSAgICB9Ci0KLSAgICByZXR1cm4gY2M7Ci19Ci0KLQotLyoKLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogICAgICBTb2NrZXQgdGVzdHMKLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09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koKSB7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtQ3VycmVudDsgaSsrKQorICAgICAgICBkZWxldGVbXSBtQXJyYXlbaV07CisgICAgZGVsZXRlW10gbUFycmF5OworfQorCisvLworLy8gQWRkIGEgc3RyaW5nLiAgQSBjb3B5IG9mIHRoZSBzdHJpbmcgaXMgbWFkZS4KKy8vCitib29sIFN0cmluZ0FycmF5OjpwdXNoX2JhY2soY29uc3QgY2hhciogc3RyKSB7CisgICAgaWYgKG1DdXJyZW50ID49IG1NYXgpIHsKKyAgICAgICAgY2hhcioqIHRtcDsKKworICAgICAgICBpZiAobU1heCA9PSAwKQorICAgICAgICAgICAgbU1heCA9IDE2OyAgICAgIC8vIGluaXRpYWwgc3RvcmFnZQorICAgICAgICBlbHNlCisgICAgICAgICAgICBtTWF4ICo9IDI7CisKKyAgICAgICAgdG1wID0gbmV3IGNoYXIqW21NYXhdOworICAgICAgICBpZiAodG1wID09IE5VTEwpCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgbWVtY3B5KHRtcCwgbUFycmF5LCBtQ3VycmVudCAqIHNpemVvZihjaGFyKikpOworICAgICAgICBkZWxldGVbXSBtQXJyYXk7CisgICAgICAgIG1BcnJheSA9IHRtcDsKKyAgICB9CisKKyAgICBpbnQgbGVuID0gc3RybGVuKHN0cik7CisgICAgbUFycmF5W21DdXJyZW50XSA9IG5ldyBjaGFyW2xlbisxXTsKKyAgICBtZW1jcHkobUFycmF5W21DdXJyZW50XSwgc3RyLCBsZW4rMSk7CisgICAgbUN1cnJlbnQrKzsKKworICAgIHJldHVybiB0cnVlOworfQorCisvLworLy8gRGVsZXRlIGFuIGVudHJ5LgorLy8KK3ZvaWQgU3RyaW5nQXJyYXk6OmVyYXNlKGludCBpZHgpIHsKKyAgICBpZiAoaWR4IDwgMCB8fCBpZHggPj0gbUN1cnJlbnQpCisgICAgICAgIHJldHVybjsKKyAgICBkZWxldGVbXSBtQXJyYXlbaWR4XTsKKyAgICBpZiAoaWR4IDwgbUN1cnJlbnQtMSkgeworICAgICAgICBtZW1tb3ZlKCZtQXJyYXlbaWR4XSwgJm1BcnJheVtpZHgrMV0sCisgICAgICAgICAgICAgICAgKG1DdXJyZW50LTEgLSBpZHgpICogc2l6ZW9mKGNoYXIqKSk7CisgICAgfQorICAgIG1DdXJyZW50LS07Cit9CisKKy8vCisvLyBTb3J0IHRoZSBhcnJheS4KKy8vCit2b2lkIFN0cmluZ0FycmF5Ojpzb3J0KGludCAoKmNvbXBhcmUpKGNvbnN0IHZvaWQqLCBjb25zdCB2b2lkKikpIHsKKyAgICBxc29ydChtQXJyYXksIG1DdXJyZW50LCBzaXplb2YoY2hhciopLCBjb21wYXJlKTsKK30KKworLy8KKy8vIFBhc3MgdGhpcyB0byB0aGUgc29ydCByb3V0aW5lIHRvIGRvIGFuIGFzY2VuZGluZyBhbHBoYWJldGljYWwgc29ydC4KKy8vCitpbnQgU3RyaW5nQXJyYXk6OmNtcEFzY2VuZGluZ0FscGhhKGNvbnN0IHZvaWQqIHBzdHIxLCBjb25zdCB2b2lkKiBwc3RyMikgeworICAgIHJldHVybiBzdHJjbXAoKihjb25zdCBjaGFyKiopcHN0cjEsICooY29uc3QgY2hhcioqKXBzdHIyKTsKK30KKworLy8KKy8vIFNldCBlbnRyeSBOIHRvIHNwZWNpZmllZCBzdHJpbmcuCisvLyBbc2hvdWxkIHVzZSBvcGVyYXRvcltdIGhlcmVdCisvLwordm9pZCBTdHJpbmdBcnJheTo6c2V0RW50cnkoaW50IGlkeCwgY29uc3QgY2hhciogc3RyKSB7CisgICAgaWYgKGlkeCA8IDAgfHwgaWR4ID49IG1DdXJyZW50KQorICAgICAgICByZXR1cm47CisgICAgZGVsZXRlW10gbUFycmF5W2lkeF07CisgICAgaW50IGxlbiA9IHN0cmxlbihzdHIpOworICAgIG1BcnJheVtpZHhdID0gbmV3IGNoYXJbbGVuKzFdOworICAgIG1lbWNweShtQXJyYXlbaWR4XSwgc3RyLCB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KTsKLX0KLQotc3RhdHVzX3QgTXV0ZXg6OnRyeUxvY2soKQotewotICAgIGludCByZXM7Ci0gICAgd2hpbGUgKChyZXM9ZnV0ZXhfbXV0ZXhfdHJ5bG9jayhTVEFURSkpID09IEVJTlRSKSA7Ci0gICAgcmV0dXJuIC1yZXM7Ci19Ci0jdW5kZWYgU1RBVEUKLQorI2lmIGRlZmluZWQoSEFWRV9QVEhSRUFEUykKKy8vIGltcGxlbWVudGVkIGFzIGlubGluZXMgaW4gdGhyZWFkcy5oCiAjZWxpZiBkZWZpbmVkKEhBVkVfV0lOMzJfVEhSRUFEUykKLSNpZiAwCi0jcHJhZ21hIG1hcmsgLQotI2VuZGlmCiAKIE11dGV4OjpNdXRleCgpCiB7CkBAIC00MTMsNiArMjk2LDE5IEBACiAgICAgLy8gWFhYOiBuYW1lIG5vdCB1c2VkIGZvciBub3cKICAgICBIQU5ETEUgaE11dGV4OwogCisgICAgYXNzZXJ0KHNpemVvZihoTXV0ZXgpID09IHNpemVvZihtU3RhdGUpKTsKKworICAgIGhNdXRleCA9IENyZWF0ZU11dGV4KE5VTEwsIEZBTFNFLCBOVUxMKTsKKyAgICBtU3RhdGUgPSAodm9pZCopIGhNdXRleDsKK30KKworTXV0ZXg6Ok11dGV4KGludCB0eXBlLCBjb25zdCBjaGFyKiBuYW1lKQoreworICAgIC8vIFhYWDogdHlwZSBhbmQgbmFtZSBub3QgdXNlZCBmb3Igbm93CisgICAgSEFORExFIGhNdXRleDsKKworICAgIGFzc2VydChzaXplb2YoaE11dGV4KSA9PSBzaXplb2YobVN0YXRlKSk7CisKICAgICBoTXV0ZXggPSBDcmVhdGVNdXRleChOVUxMLCBGQUxTRSwgTlVMTCk7CiAgICAgbVN0YXRlID0gKHZvaWQqKSBoTXV0ZXg7CiB9CkBAIC00NTYsMTYxICszNTIsOSBAQAogICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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Y2hlY2sgdXNsZWVwKCkgYWNjdXJhY3k7IGRlZmF1bHQgTGludXggdGhyZWFkcyBhcmUgcHJldHR5IHNsb3BweSAqLwotICAgICAgICBhY3R1YWwgPSBhbmRyb2lkOjpEdXJhdGlvblRpbWVyOjpzdWJ0cmFjdFRpbWV2YWxzKCZhZnRlciwgJmJlZm9yZSk7Ci0gICAgICAgIGlmICgobG9uZykgYWN0dWFsIDwgc2xlZXBUaW1lIC0gMTQwMDAgLyooc2xlZXBUaW1lLzEwKSovIHx8Ci0gICAgICAgICAgICAobG9uZykgYWN0dWFsID4gc2xlZXBUaW1lICsgMjAwMDAgLyooc2xlZXBUaW1lLzEwKSovKQotICAgICAgICB7Ci0gICAgICAgICAgICBMT0coTE9HX0RFQlVHLCAiIiwgIiBPZGQgdXNsZWVwOiByZXE9JWxkLCBhY3R1YWw9JWxkXG4iLCBzbGVlcFRpbWUsCi0gICAgICAgICAgICAgICAgKGxvbmcpIGFjdHVhbCk7Ci0gICAgICAgIH0KLSNlbHNlCi0jaWZkZWYgSEFWRV9XSU4zMl9USFJFQURTCi0gICAgICAgIFNsZWVwKCBzbGVlcFRpbWUvMTAwMCApOwotI2Vsc2UgICAgICAgIAotICAgICAgICB1c2xlZXAoKGxvbmcpIHNsZWVwVGltZSk7Ci0jZW5kaWYgICAgICAgIAotI2VuZGlmCi0gICAgfQotCi0gICAgLy9wcmludGYoInNsZXB0ICVkXG4iLCBzbGVlcFRpbWUpOwotCi0gICAgaWYgKG92ZXJTbGVwdCkKLSAgICAgICAgcmV0dXJuIDE7ICAgICAgIC8vIGNsb3NlIGVub3VnaAotICAgIGVsc2UKLSAgICAgICAgcmV0dXJuIDA7Ci19Ci0KLQogLyoKICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICogICAgICBEdXJhdGlvblRpbWVyCmRpZmYgLS1naXQgYS9saWJzL3V0aWxzL1ppcEVudHJ5L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WxzZQotICAgIHB0bSA9IGxvY2FsdGltZSgmZXZlbik7Ci0jZW5kaWYKLQotICAgIGludCB5ZWFyOwotICAgIHllYXIgPSBwdG0tPnRtX3llYXI7Ci0gICAgaWYgKHllYXIgPCA4MCkKLSAgICAgICAgeWVhciA9IDgwOwotCi0gICAgemRhdGUgPSAoeWVhciAtIDgwKSA8PCA5IHwgKHB0bS0+dG1fbW9uKzEpIDw8IDUgfCBwdG0tPnRtX21kYXk7Ci0gICAgenRpbWUgPSBwdG0tPnRtX2hvdXIgPDwgMTEgfCBwdG0tPnRtX21pbiA8PCA1IHwgcHRtLT50bV9zZWMgPj4gMTsKLQotICAgIG1DREUubUxhc3RNb2RGaWxlVGltZSA9IG1MRkgubUxhc3RNb2RGaWxlVGltZSA9IHp0aW1lOwotICAgIG1DREUubUxhc3RNb2RGaWxlRGF0ZSA9IG1MRkgubUxhc3RNb2RGaWxlRGF0ZSA9IHpkYXRlOwotfQotCi0KLS8qCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqICAgICAgWmlwRW50cnk6OkxvY2FsRmlsZUhlYWRlcgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKi8KLQotLyoKLSAqIFJlYWQgYSBsb2NhbCBmaWxlIGhlYWRlci4KLSAqCi0gKiBPbiBlbnRyeSwgImZwIiBwb2ludHMgdG8gdGhlIHNpZ25hdHVyZSBhdCB0aGUgc3RhcnQgb2YgdGhlIGhlYWRlci4KLSAqIE9uIGV4aXQsICJmcCIgcG9pbnRzIHRvIHRoZSBzdGFydCBvZiBkYXRhLgotICovCi1zdGF0dXNfdCBaaXBFbnRyeTo6TG9jYWxGaWxlSGVhZGVyOjpyZWFkKEZJTEUqIGZwKQotewotICAgIHN0YXR1c190IHJlc3VsdCA9IE5PX0VSU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uIik7Ci0gICAgTE9HRCgiICB2ZXJzVG9FeHQ9JXUgZ3BCaXRzPTB4JTA0eCBjb21wcmVzc2lvbj0ldVxuIiwKLSAgICAgICAgbVZlcnNpb25Ub0V4dHJhY3QsIG1HUEJpdEZsYWcsIG1Db21wcmVzc2lvbk1ldGhvZCk7Ci0gICAgTE9HRCgiICBtb2RUaW1lPTB4JTA0eCBtb2REYXRlPTB4JTA0eCBjcmMzMj0weCUwOGx4XG4iLAotICAgICAgICBtTGFzdE1vZEZpbGVUaW1lLCBtTGFzdE1vZEZpbGVEYXRlLCBtQ1JDMzIpOwotICAgIExPR0QoIiAgY29tcHJlc3NlZFNpemU9JWx1IHVuY29tcHJlc3NlZFNpemU9JWx1XG4iLAotICAgICAgICBtQ29tcHJlc3NlZFNpemUsIG1VbmNvbXByZXNzZWRTaXplKTsKLSAgICBMT0dEKCIgIGZpbGVuYW1lTGVuPSV1IGV4dHJhTGVuPSV1XG4iLAotICAgICAgICBtRmlsZU5hbWVMZW5ndGgsIG1FeHRyYUZpZWxkTGVuZ3RoKTsKLSAgICBpZiAobUZpbGVOYW1lICE9IE5VTEwpCi0gICAgICAgIExPR0QoIiAgZmlsZW5hbWU6ICclcydcbiIsIG1GaWxlTmFtZSk7Ci19Ci0KLQotLyoKLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogICAgICBaaXBFbnRyeTo6Q2VudHJhbERpckVudHJ5Ci0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqLwotCi0vKgotICogUmVhZCB0aGUgY2VudHJhbCBkaXIgZW50cnkgdGhhdCBhcHBlYXJzIG5leHQgaW4gdGhlIGZpbGUuCi0gKgotICogT24gZW50cnksICJmcCIgc2hvdWxkIGJlIHBvc2l0aW9uZWQgb24gdGhlIHNpZ25hdHVyZ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pZiAoZHN0ICsgKGRzdCAvIDEwKSA+IHNyYykgewotICAgICAgICAgICAgICAgICAgICBMT0dEKCJpbnN1ZmZpY2llbnQgY29tcHJlc3Npb24gKHNyYz0lbGQgZHN0PSVsZCksIHN0b3JpbmdcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBzcmMsIGRzdCk7Ci0gICAgICAgICAgICAgICAgICAgIGZhaWxlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZmFpbGVkKSB7Ci0gICAgICAgICAgICAgICAgY29tcHJlc3Npb25NZXRob2QgPSBaaXBFbnRyeTo6a0NvbXByZXNzU3RvcmVkOwotICAgICAgICAgICAgICAgIGlmIChpbnB1dEZwKSByZXdpbmQoaW5wdXRGcCk7Ci0gICAgICAgICAgICAgICAgZnNlZWsobVppcEZwLCBzdGFydFBvc24sIFNFRUtfU0VUKTsKLSAgICAgICAgICAgICAgICAvKiBmYWxsIHRocm91Z2ggdG8ga0NvbXByZXNzU3RvcmVkIGNhc2UgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvKiBoYW5kbGUgIm5vIGNvbXByZXNzaW9uIiByZXF1ZXN0LCBvciBmYWlsZWQgY29tcHJlc3Npb24gZnJvbSBhYm92ZSAqLwotICAgICAgICBpZiAoY29tcHJlc3Npb25NZXRob2QgPT0gWmlwRW50cnk6OmtDb21wcmVzc1N0b3JlZCkgewotICAgICAgICAgICAgaWYgKGlucHV0RnApIHsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSBjb3B5RnBUb0ZwKG1aaXBGcCwgaW5wdXRGcCwgJmNyYyk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNvcHlEYXRhVG9GcChtWmlwRnAsIGRhdGEsIHNpemUsICZjcmMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgIC8vIGRvbid0IG5lZWQgdG8gdHJ1bmNhdGU7IGhhcHBlbnMgaW4gQ0RFIHJld3JpdGUKLSAgICAgICAgICAgICAgICBMT0dEKCJmYWlsZWQgY29weWluZyBkYXRhIGluXG4iKTsKLSAgICAgICAgICAgICAgICBnb3RvIGJhaWw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBjdXJyZW50bHkgc2Vla2VkIHRvIGVuZCBvZiBmaWxlCi0gICAgICAgIHVuY29tcHJlc3NlZExlbiA9IGlucHV0RnAgPyBmdGVsbChpbnB1dEZwKSA6IHNpemU7Ci0gICAgfSBlbHNlIGlmIChzb3VyY2VUeXBlID09IFppcEVudHJ5OjprQ29tcHJlc3NEZWZsYXRlZCkgewotICAgICAgICAvKiB3ZSBzaG91bGQgc3VwcG9ydCB1bmNvbXByZXNzZWQtZnJvbS1jb21wcmVzc2VkLCBidXQgaXQncyBub3QKLSAgICAgICAgICogaW1wb3J0YW50IHJpZ2h0IG5vdyAqLwotICAgICAgICBhc3NlcnQoY29tcHJlc3Npb25NZXRob2QgPT0gWmlwRW50cnk6OmtDb21wcmVzc0RlZmxhdGVkKTsKLQotICAgICAgICBib29sIHNjYW5SZXN1bHQ7Ci0gICAgICAgIGludCBtZXRob2Q7Ci0gICAgICAgIGxvbmcgY29tcHJlc3NlZExlbjsKLQotICAgICAgICBzY2FuUmVzdWx0ID0gWmlwVXRpbHM6OmV4YW1pbmVHemlwKGlucHV0RnAsICZtZXRob2QsICZ1bmNvbXByZXNzZWRMZW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAmY29tcHJlc3NlZExlbiwgJmNyYyk7Ci0gICAgICAgIGlmICghc2NhblJlc3VsdCB8fCBtZXRob2QgIT0gWmlwRW50cnk6OmtDb21wcmVzc0RlZmxhdGVkKSB7Ci0gICAgICAgICAgICBMT0dEKCJ0aGlzIGlzbid0IGEgZGVmbGF0ZWQgZ3ppcCBmaW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gICAgICAgICAgICogZW50cnkuCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIG5leHRPZmZzZXQgPSAwOwotICAgICAgICAgICAgZm9yIChpbnQgaWkgPSBpKzE7IG5leHRPZmZzZXQgPT0gMCAmJiBpaSA8IGNvdW50OyBpaSsrKQotICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBtRW50cmllc1tpaV0tPmdldExGSE9mZnNldCgpOwotICAgICAgICAgICAgaWYgKG5leHRPZmZzZXQgPT0gMCkKLSAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gbUVPQ0QubUNlbnRyYWxEaXJPZmZzZXQ7Ci0gICAgICAgICAgICBzcGFuID0gbmV4dE9mZnNldCAtIHBFbnRyeS0+Z2V0TEZIT2Zmc2V0KCk7Ci0KLSAgICAgICAgICAgIGFzc2VydChzcGFuID49IFppcEVudHJ5OjpMb2NhbEZpbGVIZWFkZXI6OmtMRkhMZW4pOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLyogVGhpcyBpcyBhIGRpcmVjdG9yeSBlbnRyeS4gIEl0IGRvZXNuJ3QgaGF2ZQotICAgICAgICAgICAgICogYW55IGFjdHVhbCBmaWxlIGNvbnRlbnRzLCBzbyB0aGVyZSdzIG5vIG5lZWQgdG8KLSAgICAgICAgICAgICAqIG1vdmUgYW55dGhpbmcuCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHNwYW4gPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgLy9wcmludGYoIisrKyAlZDogb2ZmPSVsZCBzcGFuPSVsZCBkZWw9JWQgW2NvdW50PSVkXVxuIiwKLSAgICAgICAgLy8gICAgaSwgcEVudHJ5LT5nZXRMRkhPZmZzZXQoKSwgc3BhbiwgcEVudHJ5LT5nZXREZWxldGVkKCksIGNvdW50KTsKLQotICAgICAgICBpZiAocEVudHJ5LT5nZXREZWxldGVkKCkpIHsKLSAgICAgICAgICAgIGFkanVzdCArPSBzcGFuOwotICAgICAg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ci0gICAgICAgICAgICBpZiAoZ2V0U2l6ZSA+IG4pCi0gICAgICAgICAgICAgICAgZ2V0U2l6ZSA9IG47Ci0KLSAgICAgICAgICAgIGlmIChmc2VlayhmcCwgKGxvbmcpIHNyYywgU0VFS19TRVQpICE9IDApIHsKLSAgICAgICAgICAgICAgICBMT0dEKCJmaWxlbW92ZSBzcmMgc2VlayAlbGQgZmFpbGVkXG4iLCAobG9uZykgc3JjKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGZyZWFkKHJlYWRCdWYsIDEsIGdldFNpemUsIGZwKSAhPSBnZXRTaXplKSB7Ci0gICAgICAgICAgICAgICAgTE9HRCgiZmlsZW1vdmUgcmVhZCAlbGQgb2ZmPSVsZCBmYWlsZWRcbiIsCi0gICAgICAgICAgICAgICAgICAgIChsb25nKSBnZXRTaXplLCAobG9uZykgc3JjKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGZzZWVrKGZwLCAobG9uZykgZHN0LCBTRUVLX1NFVCkgIT0gMCkgewotICAgICAgICAgICAgICAgIExPR0QoImZpbGVtb3ZlIGRzdCBzZWVrICVsZCBmYWlsZWRcbiIsIChsb25nKSBkc3QpOwotICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZndyaXRlKHJlYWRCdWYsIDEsIGdldFNpemUsIGZwKSAhPSBnZXRTaXplKSB7Ci0gICAgICAgICAgICAgICAgTE9HRCgiZmlsZW1vdmUgd3JpdGUgJWxkIG9mZj0lbGQgZmFpbGVkXG4iLAotICAgICAgICAgICAgICAgICAgICAobG9uZykgZ2V0U2l6ZSwgKGxvbmcpIGRzdCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFVOS05PV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IG9mZl90IG9mZnNldCA9IGVudHJ5LT5nZXRGaWxlT2Zmc2V0KCk7Ci0gICAgaWYgKGZzZWVrKG1aaXBGcCwgb2Zmc2V0LCBTRUVLX1NFVCkgIT0gMCkgewotICAgICAgICBnb3RvIGJhaWw7Ci0gICAgfQotCi0gICAgc3dpdGNoIChlbnRyeS0+Z2V0Q29tcHJlc3Npb25NZXRob2QoKSkKLSAgICB7Ci0gICAgICAgIGNhc2UgWmlwRW50cnk6OmtDb21wcmVzc1N0b3JlZDogewotICAgICAgICAgICAgc3NpemVfdCBhbXQgPSBmcmVhZChidWYsIDEsIHVubGVuLCBtWmlwRnApOwotICAgICAgICAgICAgaWYgKGFtdCAhPSAoc3NpemVfdCl1bmxlbikgewotICAgICAgICAgICAgICAgIGdvdG8gYmFpbDsKLSAgICAgICAgICAgIH0KLSNpZiAwCi0gICAgICAgICAgICBwcmludGYoImRhdGEuLi5cbiIpOwotICAgICAgICAgICAgY29uc3QgdW5zaWduZWQgY2hhciogcCA9ICh1bnNpZ25lZCBjaGFyKilidWY7Ci0gICAgICAgICAgICBjb25zdCB1bnNpZ25lZCBjaGFyKiBlbmQgPSBwK3VubGVuOwotICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPDMyICYmIHAgPCBlbmQ7IGkrKykgewotICAgICAgICAgICAgICAgIHByaW50ZigiMHglMDh4ICIsIChpbnQpKG9mZnNldCsoaSoweDEwKSkpOwotICAgICAgICAgICAgICAgIGZvciAoaW50IGo9MDsgajwweDEwICYmIHAgPCBlbmQ7IGorKykgewotICAgICAgICAgICAgICAgICAgICBwcmludGYoIiAlMDJ4IiwgKnApOwotICAgICAgICAgICAgICAgICAgICBwKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHByaW50ZigiXG4iKTsKLSAgICAgICAgICAgIH0KLSNlbmRpZgotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBaaXBFbnRyeTo6a0NvbXByZXNzRGVmbGF0ZWQ6IHsKLSAgICAgICAgICAgIGlmICghWmlwVXRpbHM6OmluZmxhdGVUb0J1ZmZlcihtWmlwRnAsIGJ1ZiwgdW5sZW4sIGNsZW4pKSB7Ci0gICAgICAgICAgICAgICAgZ290byBiYWlsOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBnb3RvIGJhaWw7Ci0gICAgfQotICAgIHJldHVybiBidWY7Ci0KLWJhaWw6Ci0gICAgZnJlZShidWYpOwotICAgIHJldHVybiBOVUxMOwotfQotCi0KLS8qCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqCQlaaXBGaWxlOjpFbmRPZkNlbnRyYWxEaXIKLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICovCi0KLS8qCi0gKiBSZWFkIHRoZSBlbmQtb2YtY2VudHJhbC1kaXIgZmllbGRzLgotICoKLSAqICJidWYiIHNob3VsZCBiZSBwb3NpdGlvbmVkIGF0IHRoZSBFT0NEIHNpZ25hdHVyZSwgYW5kIHNob3VsZCBjb250YWluCi0gKiB0aGUgZW50aXJlIEVPQ0QgYXJlYSBpbmNsdWRpbmcgdGhlIGNvbW1lbnQuCi0gKi8KLXN0YXR1c190IFppcEZpbGU6OkVuZE9mQ2VudHJhbERpcjo6cmVhZEJ1Zihjb25zdCB1bnNpZ25lZCBjaGFyKiBidWYsIGludCBsZW4pCi17Ci0gICAgLyogZG9uJ3QgYWxsb3cgcmUtdXNlICovCi0gICAgYXNzZXJ0KG1Db21tZW50ID09IE5VTEwpOwotCi0gICAgaWYgKGxlbiA8IGtFT0NETGVuKSB7Ci0gICAgICAgIC8qIGxvb2tzIGxpa2UgWklQI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BtTGlzdGVuZXJzID0KICAgICAgICAgbmV3IEhhc2hNYXA8TG9jYXRpb25MaXN0ZW5lcixMaXN0ZW5lclRyYW5zcG9ydD4oKTsKQEAgLTExMjMsNDkgKzExMjIsMTAzIEBACiAgICAgcHJpdmF0ZSBjbGFzcyBHcHNTdGF0dXNMaXN0ZW5lclRyYW5zcG9ydCBleHRlbmRzIElHcHNTdGF0dXNMaXN0ZW5lci5TdHViIHsKIAogICAgICAgICBwcml2YXRlIGZpbmFsIEdwc1N0YXR1cy5MaXN0ZW5lciBtTGlzdGVuZXI7CisgICAgICAgIHByaXZhdGUgZmluYWwgR3BzU3RhdHVzLk5tZWFMaXN0ZW5lciBtTm1lYUxpc3RlbmVyOworCisgICAgICAgIC8vIFRoaXMgbXVzdCBub3QgZXF1YWwgYW55IG9mIHRoZSBHcHNTdGF0dXMgZXZlbnQgSURzCisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBOTUVBX1JFQ0VJVkVEID0gMTAwMDsKKworICAgICAgICBwcml2YXRlIGNsYXNzIE5tZWEgeworICAgICAgICAgICAgbG9uZyBtVGltZXN0YW1wOworICAgICAgICAgICAgU3RyaW5nIG1ObWVhOworCisgICAgICAgICAgICBObWVhKGxvbmcgdGltZXN0YW1wLCBTdHJpbmcgbm1lYSkgeworICAgICAgICAgICAgICAgIG1UaW1lc3RhbXAgPSB0aW1lc3RhbXA7CisgICAgICAgICAgICAgICAgbU5tZWEgPSBubWVhOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHByaXZhdGUgQXJyYXlMaXN0PE5tZWE+IG1ObWVhQnVmZmVyOwogCiAgICAgICAgIEdwc1N0YXR1c0xpc3RlbmVyVHJhbnNwb3J0KEdwc1N0YXR1cy5MaXN0ZW5lciBsaXN0ZW5lcikgewogICAgICAgICAgICAgbUxpc3RlbmVyID0gbGlzdGVuZXI7CisgICAgICAgICAgICBtTm1lYUxpc3RlbmVyID0gbnVsbDsKKyAgICAgICAgfQorC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tc2cgPSBNZXNzYWdlLm9idGFpbigpOworICAgICAgICAgICAgICAgIG1zZy53aGF0ID0gR3BzU3RhdHVzLkdQU19FVkVOVF9TVE9QUEVEOworICAgICAgICAgICAgICAgIG1HcHNIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgdm9pZCBvbkZpcnN0Rml4KGludCB0dGZmKSB7Ci0gICAgICAgICAgICBtR3BzU3RhdHVzLnNldFRpbWVUb0ZpcnN0Rml4KHR0ZmYpOwotICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbigpOwotICAgICAgICAgICAgbXNnLndoYXQgPSBHcHNTdGF0dXMuR1BTX0VWRU5UX0ZJUlNUX0ZJWDsKLSAgICAgICAgICAgIG1HcHNIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICBpZiAobUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtR3BzU3RhdHVzLnNldFRpbWVUb0ZpcnN0Rml4KHR0ZmYpOworICAgICAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gTWVzc2FnZS5vYnRhaW4oKTsKKyAgICAgICAgICAgICAgICBtc2cud2hhdCA9IEdwc1N0YXR1cy5HUFNfRVZFTlRfRklSU1RfRklYOworICAgICAgICAgICAgICAgIG1HcHNIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgdm9pZCBvblN2U3RhdHVzQ2hhbmdlZChpbnQgc3ZDb3VudCwgaW50W10gcHJucywgZmxvYXRbXSBzbnJzLAogICAgICAgICAgICAgICAgIGZsb2F0W10gZWxldmF0aW9ucywgZmxvYXRbXSBhemltdXRocywgaW50IGVwaGVtZXJpc01hc2ssCiAgICAgICAgICAgICAgICAgaW50IGFsbWFuYWNNYXNrLCBpbnQgd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gICAgICBtR3BzSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhHcHNTdGF0dXMuR1BTX0VWRU5UX1NBVEVMTElURV9TVEFUVVMpOworICAgICAgICAgICAgICAgIG1HcHNIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvbk5tZWFSZWNlaXZlZChsb25nIHRpbWVzdGFtcCwgU3RyaW5nIG5tZWEpIHsKKyAgICAgICAgICAgIGlmIChtTm1lYUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1ObWVhQnVmZmVyKSB7CisgICAgICAgICAgICAgICAgICAgIG1ObWVhQnVmZmVyLmFkZChuZXcgTm1lYSh0aW1lc3RhbXAsIG5tZWEpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBNZXNzYWdlLm9idGFpbigpOworICAgICAgICAgICAgICAgIG1zZy53aGF0ID0gTk1FQV9SRUNFSVZFRDsKKyAgICAgICAgICAgICAgICAvLyByZW1vdmUgYW55IE5NRUFfUkVDRUlWRUQgbWVzc2FnZXMgYWxyZWFkeSBpbiB0aGUgcXVldWUKKyAgICAgICAgICAgICAgICBtR3BzSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhOTUVBX1JFQ0VJVkVEKTsKKyAgICAgICAgICAgICAgICBtR3BzSGFuZGxlci5zZW5kTWVzc2FnZShtc2cpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgcHJpdmF0ZSBmaW5hbCBIYW5kbGVyIG1HcHNIYW5kbGVyID0gbmV3IEhhbmRsZXIoKSB7CiAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGhhbmRsZU1lc3NhZ2UoTWVzc2FnZSBtc2cpIHsKLSAgICAgICAgICAgICAgICAvLyBzeW5jaHJvbml6ZSBvbiBtR3BzU3RhdHVzIHRvIGVuc3VyZSB0aGUgZGF0YSBpcyBjb3BpZWQgYXRvbWljYWxseS4KLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQobUdwc1N0YXR1cykgewotICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIub25HcHNTdGF0dXNDaGFuZ2VkKG1zZy53aGF0KTsKKyAgICAgICAgICAgICAgICBpZiAobXNnLndoYXQgPT0gTk1FQV9SRUNFSVZFRCkgeworICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1ObWVhQnVmZmVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoID0gbU5tZWFCdWZmZXIuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5tZWEgbm1lYSA9IG1ObWVhQnVmZmVyLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm1lYUxpc3RlbmVyLm9uTm1lYVJlY2VpdmVkKG5tZWEubVRpbWVzdGFtcCwgbm1lYS5tTm1lYSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBtTm1lYUJ1ZmZlci5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gc3luY2hyb25pemUgb24gbUdwc1N0YXR1cyB0byBlbnN1cmUgdGhlIGRhdGEgaXMgY29waWVkIGF0b21pY2FsbHkuCisgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZChtR3BzU3RhdHVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIub25HcHNTdGF0dXNDaGFuZ2VkKG1zZy53aGF0KTsKKyAgICAgICAgICAgICAgICAgICAgfQog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aXN0ZW5lcnMucHV0KGxpc3RlbmVyLCB0cmFuc3BvcnQpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGluIHJlZ2lzdGVyR3BzU3RhdHVzTGlzdGVuZXI6ICIsIGUpOworICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlbW92ZXMgYW4gTk1FQSBsaXN0ZW5lci4KKyAgICAgKgorICAgICAqIEBwYXJhbSBsaXN0ZW5lciBhIHsjbGluayBHcHNTdGF0dXMuTm1lYUxpc3RlbmVyfSBvYmplY3QgdG8gcmVtb3ZlCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVtb3ZlTm1lYUxpc3RlbmVyKEdwc1N0YXR1cy5ObWVhTGlzdGVuZXIgbGlzdGVuZXIpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIEdwc1N0YXR1c0xpc3RlbmVyVHJhbnNwb3J0IHRyYW5zcG9ydCA9IG1ObWVhTGlzdGVuZXJzLnJlbW92ZShsaXN0ZW5lcik7CisgICAgICAgICAgICBpZiAodHJhbnNwb3J0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtU2VydmljZS5yZW1vdmVHcHNTdGF0dXNMaXN0ZW5lcih0cmFuc3BvcnQpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVtb3RlRXhjZXB0aW9uIGluIHVucmVnaXN0ZXJHcHNTdGF0dXNMaXN0ZW5lcjogIiwgZSk7CisgICAgICAgIH0KKyAgICB9CisKICAgICAgLyoqCiAgICAgICogUmV0cmlldmVzIGluZm9ybWF0aW9uIGFib3V0IH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sKLSAgICAgICAgICAgICAgICAgICAgbmF0aXZlX3NldF9hZ3BzX3NlcnZlcihBR1BTX1RZUEVfU1VQTCwgaG9zdCwgcG9ydCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHVzZSBNUy1CYXNlZCBwb3NpdGlvbiBtb2RlIGlmIFNVUEwgc3VwcG9ydCBpcyBlbmFibGVkCi0gICAgICAgICAgICAgICAgICAgIG1Qb3NpdGlvbk1vZGUgPSBHUFNfUE9TSVRJT05fTU9ERV9NU19CQVNFRDsKKyAgICAgICAgICAgICAgICAgICAgbVN1cGxTZXJ2ZXJQb3J0ID0gSW50ZWdlci5wYXJzZUludChwb3J0U3RyaW5nKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJ1bmFibGUgdG8gcGFyc2UgU1VQTF9QT1JUOiAiICsgcG9ydFN0cmluZyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBob3N0ID0gbVByb3BlcnRpZXMuZ2V0UHJvcGVydHkoIkMyS19IT1NUIik7CisgICAgICAgICAgICBtQzJLU2VydmVySG9zdCA9IG1Qcm9wZXJ0aWVzLmdldFByb3BlcnR5KCJDMktfSE9TVCIpOwogICAgICAgICAgICAgcG9ydFN0cmluZyA9IG1Qcm9wZXJ0aWVzLmdldFByb3BlcnR5KCJDMktfUE9SVCIpOwotICAgICAgICAgICAgaWYgKGhvc3QgIT0gbnVsbCAmJiBwb3J0U3RyaW5nICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtQzJLU2VydmVySG9zdCAhPSBudWxsICYmIHBvcnRTdHJpbmcgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGludCBwb3J0ID0gSW50ZWdlci5wYXJzZUludChwb3J0U3RyaW5nKTsKLSAgICAgICAgICAgICAgICAgICAgbmF0aXZlX3NldF9hZ3BzX3NlcnZlcihBR1BTX1RZUEVfQzJLLCBob3N0LCBwb3J0KTsKLSAgICAgICAgICAgICAgICAgICAgLy8gdXNlIE1TLUJhc2VkIHBvc2l0aW9uIG1vZGUgaWYgU1VQTCBzdXBwb3J0IGlzIGVuYWJsZWQKLSAgICAgICAgICAgICAgICAgICAgbVBvc2l0aW9uTW9kZSA9IEdQU19QT1NJVElPTl9NT0RFX01TX0JBU0VEOworICAgICAgICAgICAgICAgICAgICBtQzJLU2VydmVyUG9ydCA9IEludGVnZXIucGFyc2VJbnQocG9ydFN0cmluZyk7CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAidW5hYmxlIHRvIHBhcnNlIEMyS19QT1JUOiAiICsgcG9ydFN0cmluZyk7CiAgICAgICAgICAgICAgICAgfQpAQCAtNDk5LDYgKzUwMywxMyBAQAogICAgICAgICBtRW5hYmxlZCA9IG5hdGl2ZV9pbml0KCk7CiAKICAgICAgICAgaWYgKG1FbmFibGVkKSB7CisgICAgICAgICAgICBpZiAobVN1cGxTZXJ2ZXJIb3N0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBuYXRpdmVfc2V0X2FncHNfc2VydmVyKEFHUFNfVFlQRV9TVVBMLCBtU3VwbFNlcnZlckhvc3QsIG1TdXBsU2VydmVyUG9ydCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUMyS1NlcnZlckhvc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG5hdGl2ZV9zZXRfYWdwc19zZXJ2ZXIoQUdQU19UWVBFX0MySywgbUMyS1NlcnZlckhvc3QsIG1DMktTZXJ2ZXJQb3J0KTsKKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgLy8gcnVuIGV2ZW50IGxpc3RlbmVyIHRocmVhZCB3aGlsZSB3ZSBhcmUgZW5hYmxlZAogICAgICAgICAgICAgbUV2ZW50VGhyZWFkID0gbmV3IEdwc0V2ZW50VGhyZWFkKCk7CiAgICAgICAgICAgICBtRXZlbnRUaHJlYWQuc3RhcnQoKTsKQEAgLTcyMiw3ICs3MzMsMTUgQEAKICAgICAgICAgaWYgKCFtU3RhcnRlZCkgewogICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJzdGFydE5hdmlnYXRpbmciKTsKICAgICAgICAgICAgIG1TdGFydGVkID0gdHJ1ZTsKLSAgICAgICAgICAgIGlmICghbmF0aXZlX3N0YXJ0KG1Qb3NpdGlvbk1vZGUsIGZhbHNlLCBtRml4SW50ZXJ2YWwpKSB7CisgICAgICAgICAgICBpbnQgcG9zaXRpb25Nb2RlOworICAgICAgICAgICAgaWYgKFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5BU1NJU1RFRF9HUFNfRU5BQkxFRCwgMSkgIT0gMCkgeworICAgICAgICAgICAgICAgIHBvc2l0aW9uTW9kZSA9IEdQU19QT1NJVElPTl9NT0RFX01TX0JBU0VEOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbk1vZGUgPSBHUFNfUE9TSVRJT05fTU9ERV9TVEFOREFMT05FOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIW5hdGl2ZV9zdGFydChwb3NpdGlvbk1vZGUsIGZhbHNlLCBtRml4SW50ZXJ2YWwpKSB7CiAgICAgICAgICAgICAgICAgbVN0YXJ0ZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJuYXRpdmVfc3RhcnQgZmFpbGVkIGluIHN0YXJ0TmF2aWdhdGluZygpIik7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwpAQCAtMTAwMiw2ICsxMDIxLDMyIEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICAvKioKKyAgICAgKiBjYWxsZWQgZnJvbSBuYXRpdmUgY29kZSB0byByZXBvcnQgTk1FQSBkYXRhIHJlY2VpdmVkCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHJlcG9ydE5tZWEoaW50IGluZGV4LCBsb25nIHRpbWVzdGFtcCkgeworICAgICAgICBzeW5jaHJvbml6ZWQobUxpc3RlbmVycykgeworICAgICAgICAgICAgaW50IHNpemUgPSBtTGlzdGVuZXJzLnNpemUoKTsKKyAgICAgICAgICAgIGlmIChzaXplID4gMCkgeworICAgICAgICAgICAgICAgIC8vIGRvbid0IGJvdGhlciBjcmVhdGluZyB0aGUgU3RyaW5nIGlmIHdlIGhhdmUgbm8gbGlzdGVuZXJzCisgICAgICAgICAgICAgICAgaW50IGxlbmd0aCA9IG5hdGl2ZV9yZWFkX25tZWEoaW5kZXgsIG1ObWVhQnVmZmVyLCBtTm1lYUJ1ZmZlci5sZW5ndGgpOworICAgICAgICAgICAgICAgIFN0cmluZyBubWVhID0gbmV3IFN0cmluZyhtTm1lYUJ1ZmZlciwgMCwgbGVuZ3RoKTsKKworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIExpc3RlbmVyIGxpc3RlbmVyID0gbUxpc3RlbmVycy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lci5tTGlzdGVuZXIub25ObWVhUmVjZWl2ZWQodGltZXN0YW1wLCBubWVhKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlJlbW90ZUV4Y2VwdGlvbiBpbiByZXBvcnRObWVhIik7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXJzLnJlbW92ZShsaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGp1c3QgZm9yIHNpemUgb2YgbGlzdCBjaGFuZ2luZworICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZS0tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCiAgICAgcHJpdmF0ZSB2b2lkIHh0cmFEb3dubG9hZFJlcXVlc3QoKSB7CiAgICAgICAgIGlmIChDb25maWcuTE9HRCkgTG9nLmQoVEFHLCAieHRyYURvd25sb2FkUmVxdWVzdCIpOwogICAgICAgICBpZiAobU5ldHdvcmtUaHJlYWQgIT0gbnVsbCkgewpAQCAtMTAwOSw2ICsxMDU0LDk2IEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAvLyBOSSBDbGllbnQgc3VwcG9ydAorCS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgIHByaXZhdGUgZmluYWwgSU5ldEluaXRpYXRlZExpc3RlbmVyIG1OZXRJbml0aWF0ZWRMaXN0ZW5lciA9IG5ldyBJTmV0SW5pdGlhdGVkTGlzdGVuZXIuU3R1YigpIHsKKyAgICAJLy8gU2VuZHMgYSByZXNwb25zZSBmb3IgYW4gTkkgcmVxZXVzdCB0byBIQUwuCisgICAgCXB1YmxpYyBib29sZWFuIHNlbmROaVJlc3BvbnNlKGludCBub3RpZmljYXRpb25JZCwgaW50IHVzZXJSZXNwb25zZSkKKyAgICAJeworICAgICAgICAJLy8gVE9ETyBBZGQgUGVybWlzc2lvbiBjaGVjaworICAgIAkJCisgICAgCQlTdHJpbmdCdWlsZGVyIGV4dHJhc0J1ZiA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisKKyAgICAJCWlmIChDb25maWcuTE9HRCkgTG9nLmQoVEFHLCAic2VuZE5pUmVzcG9uc2UsIG5vdGlmSWQ6ICIgKyBub3RpZmljYXRpb25JZCArCisgICAgCQkJCSIsIHJlc3BvbnNlOiAiICsgdXNlclJlc3BvbnNlKTsKKyAgICAJCQorICAgIAkJbmF0aXZlX3NlbmRfbmlfcmVzcG9uc2Uobm90aWZpY2F0aW9uSWQsIHVzZXJSZXNwb25zZSk7CisgICAgCQkKKyAgICAJCXJldHVybiB0cnVlOworICAgIAl9ICAgICAgICAKKyAgICB9OworICAgICAgICAKKyAgICBwdWJsaWMgSU5ldEluaXRpYXRlZExpc3RlbmVyIGdldE5ldEluaXRpYXRlZExpc3RlbmVyKCkgeworICAgICAgICByZXR1cm4gbU5ldEluaXRpYXRlZExpc3RlbmVyOworICAgIH0KKworICAgIC8vIENhbGxlZCBieSBKTkkgZnVuY3Rpb24gdG8gcmVwb3J0IGFuIE5JIHJlcXVlc3QuCisJQFN1cHByZXNzV2FybmluZ3MoImRlcHJlY2F0aW9uIikKKwlwdWJsaWMgdm9pZCByZXBvcnROaU5vdGlmaWNhdGlvbigKKyAgICAgICAgCWludCBub3RpZmljYXRpb25JZCwKKyAgICAgICAgCWludCBuaVR5cGUsCisgICAgICAgIAlpbnQgbm90aWZ5RmxhZ3MsCisgICAgICAgIAlpbnQgdGltZW91dCwKKyAgICAgICAgCWludCBkZWZhdWx0UmVzcG9uc2UsCisgICAgICAgIAlTdHJpbmcgcmVxdWVzdG9ySWQsCisgICAgICAgIAlTdHJpbmcgdGV4dCwKKyAgICAgICAgCWludCByZXF1ZXN0b3JJZEVuY29kaW5nLAorICAgICAgICAJaW50IHRleHRFbmNvZGluZywKKyAgICAgICAgCVN0cmluZyBleHRyYXMgIC8vIEVuY29kZWQgZXh0cmEgZGF0YQorICAgICAgICApCisJeworCQlMb2cuaShUQUcsICJyZXBvcnROaU5vdGlmaWNhdGlvbjogZW50ZXJlZCIpOworCQlMb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lZCB0byBkbyBhbnl0aGluZy4KKyAgICAJLy8gICAKKyAgICAJLy8gICBIb3dldmVyLCB0aGUgVUkgc2hvdWxkIGF0IGxlYXN0IGNsb3NlIHRoZSBkaWFsb2cgd2hlbiB0aW1lb3V0LiBGdXJ0aGVyLCAKKyAgICAJLy8gICBmb3IgbW9yZSBnZW5lcmFsIGhhbmRsaW5nLCB0aW1lb3V0IHJlc3BvbnNlIHNob3VsZCBiZSBhZGRlZCB0byB0aGUgSGFuZGxlciBoZXJlLgorICAgIAkvLyAgICAJICAgIAkKKyAgICB9CisgICAgCisgICAgLy8gU2V0cyB0aGUgTkkgbm90aWZpY2F0aW9uLgorICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgc2V0TmlOb3RpZmljYXRpb24oR3BzTmlOb3RpZmljYXRpb24gbm90aWYpIHsKKyAgICAgICAgTm90aWZpY2F0aW9uTWFuYWdlciBub3RpZmljYXRpb25NYW5hZ2VyID0gKE5vdGlmaWNhdGlvbk1hbmFnZXIpIG1Db250ZXh0CisgICAgICAgICAgICAgICAgLmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5OT1RJRklDQVRJT05fU0VSVklDRSk7CisgICAgICAgIGlmIChub3RpZmljYXRpb25NYW5hZ2VyID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgCisgICAgCVN0cmluZyB0aXRsZSA9IGdldE5vdGlmVGl0bGUobm90aWYpOworICAgIAlTdHJpbmcgbWVzc2FnZSA9IGdldE5vdGlmTWVzc2FnZShub3RpZik7CisgICAgICAgIAorICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgInNldE5pTm90aWZpY2F0aW9uLCBub3RpZnlJZDogIiArIG5vdGlmLm5vdGlmaWNhdGlvbklkICsKKyAgICAgICAgCQkiLCB0aXRsZTogIiArIHRpdGxlICsKKyAgICAgICAgCQkiLCBtZXNzYWdlOiAiICsgbWVzc2FnZSk7CisgICAgICAgIAorICAgIAkvLyBDb25zdHJ1Y3QgTm90aWZpY2F0aW9uCisgICAgCWlmIChtTmlOb3RpZmljYXRpb24gPT0gbnVsbCkgeworICAgICAgICAJbU5pTm90aWZpY2F0aW9uID0gbmV3IE5vdGlmaWNhdGlvbigpOworICAgICAgICAJbU5pTm90aWZpY2F0aW9uLmljb24gPSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmRyYXdhYmxlLnN0YXRfc3lzX2dwc19vbjsgLyogQ2hhbmdlIG5vdGlmaWNhdGlvbiBpY29uIGhlcmUgKi8KKyAgICAgICAgCW1OaU5vdGlmaWNhdGlvbi53aGVuID0gMDsKKyAgICAgICAgfQorICAgIAkKKyAgICAgICAgaWYgKG1QbGF5U291bmRzKSB7CisgICAgICAgIAltTmlOb3RpZmljYXRpb24uZGVmYXVsdHMgfD0gTm90aWZpY2F0aW9uLkRFRkFVTFRfU09VTkQ7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgIAltTmlOb3RpZmljYXRpb24uZGVmYXVsdHMgJj0gfk5vdGlmaWNhdGlvbi5ERUZBVUxUX1NPVU5EOworICAgICAgICB9ICAgICAgICAKKyAgICAgICAgCisgICAgICAgIG1OaU5vdGlmaWNhdGlvbi5mbGFncyA9IE5vdGlmaWNhdGlvbi5GTEFHX09OR09JTkdfRVZFTlQ7CisgICAgICAgIG1OaU5vdGlmaWNhdGlvbi50aWNrZXJUZXh0ID0gZ2V0Tm90aWZUaWNrZXIobm90aWYpOworICAgICAgICAKKyAgICAgICAgLy8gaWYgbm90IHRvIHBvcHVwIGRpYWxvZyBpbW1lZGlhdGVseSwgcGVuZGluZyBpbnRlbnQgd2lsbCBvcGVuIHRoZSBkaWFsb2cKKyAgICAgICAgSW50ZW50IGludGVudCA9ICFtUG9wdXBJbW1lZGlhdGVseSA/IGdldERsZ0ludGVudChub3RpZikgOiBuZXcgSW50ZW50KCk7ICAgIAkgICAgICAgIAorICAgICAgICBQZW5kaW5nSW50ZW50IHBpID0gUGVuZGluZ0ludGVudC5nZXRCcm9hZGNhc3QobUNvbnRleHQsIDAsIGludGVudCwgMCk7ICAgICAgICAgICAgICAgIAorICAgICAgICBtTmlOb3RpZmljYXRpb24uc2V0TGF0ZXN0RXZlbnRJbmZvKG1Db250ZXh0LCB0aXRsZSwgbWVzc2FnZSwgcGkpOworICAgICAgICAKKyAgICAgICAgaWYgKHZpc2libGUpIHsKKyAgICAgICAgICAgIG5vdGlmaWNhdGlvbk1hbmFnZXIubm90aWZ5KG5vdGlmLm5vdGlmaWNhdGlvbklkLCBtTmlOb3RpZmljYXRpb24pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbm90aWZpY2F0aW9uTWFuYWdlci5jYW5jZWwobm90aWYubm90aWZpY2F0aW9uSWQpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8vIE9wZW5zIHRoZSBub3RpZmljYXRpb24gZGlhbG9nIGFuZCB3YWl0cyBmb3IgdXNlciBpbnB1dAorICAgIHByaXZhdGUgdm9pZCBvcGVuTmlEaWFsb2coR3BzTmlOb3RpZmljYXRpb24gbm90aWYpIAorICAgIHsKKyAgICAJSW50ZW50IGludGVudCA9IGdldERsZ0ludGVudChub3RpZik7CisgICAgCQorICAgIAlpZiAoREVCVUcpIExvZy5kKFRBRywgIm9wZW5OaURpYWxvZywgbm90aWZ5SWQ6ICIgKyBub3RpZi5ub3RpZmljYXRpb25JZCArIAorICAgIAkJCSIsIHJlcXVlc3RvcklkOiAiICsgbm90aWYucmVxdWVzdG9ySWQgKyAKKyAgICAJCQkiLCB0ZXh0OiAiICsgbm90aWYudGV4dCk7ICAgICAgICAgICAgICAgCQorCisgICAgCW1Db250ZXh0LnN0YXJ0QWN0aXZpdHkoaW50ZW50KTsKKyAgICB9CisgICAgCisgICAgLy8gQ29uc3RydWN0IHRoZSBpbnRlbnQgZm9yIGJyaW5naW5nIHVwIHRoZSBkaWFsb2cgYWN0aXZpdHksIHdoaWNoIHNob3dzIHRoZSAKKyAgICAvLyBub3RpZmljYXRpb24gYW5kIHRha2VzIHVzZXIgaW5wdXQKKyAgICBwcml2YXRlIEludGVudCBnZXREbGdJbnRlbnQoR3BzTmlOb3RpZmljYXRpb24gbm90aWYpCisgICAgeworICAgIAlJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCgpOworICAgIAlTdHJpbmcgdGl0bGUgPSBnZXREaWFsb2dUaXRsZShub3RpZik7CisgICAgCVN0cmluZyBtZXNzYWdlID0gZ2V0RGlhbG9nTWVzc2FnZShub3RpZik7CisgICAgCQorICAgIAkvLyBkaXJlY3RseSBicmluZyB1cCB0aGUgTkkgYWN0aXZpdHkKKyAgICAJaW50ZW50LnNldEZsYWdzKEludGVudC5GTEFHX0FDVElWSVRZX05FV19UQVNLKTsKKyAgICAJaW50ZW50LnNldENsYXNzKG1Db250ZXh0LCBjb20uYW5kcm9pZC5pbnRlcm5hbC5hcHAuTmV0SW5pdGlhdGVkQWN0aXZpdHkuY2xhc3MpOyAgICAJCisKKyAgICAJLy8gcHV0IGRhdGEgaW4gdGhlIGludGVudAorICAgIAlpbnRlbnQucHV0RXh0cmEoTklfSU5URU5UX0tFWV9OT1RJRl9JRCwgbm90aWYubm90aWZpY2F0aW9uSWQpOyAgICAJCisgICAgCWludGVudC5wdXRFeHRyYShOSV9JTlRFTlRfS0VZX1RJVExFLCB0aXRsZSk7CisgICAgCWludGVudC5wdXRFeHRyYShOSV9JTlRFTlRfS0VZX01FU1NBR0UsIG1lc3NhZ2UpOworICAgIAlpbnRlbnQucHV0RXh0cmEoTklfSU5URU5UX0tFWV9USU1FT1VULCBub3RpZi50aW1lb3V0KTsKKyAgICAJaW50ZW50LnB1dEV4dHJhKE5JX0lOVEVOVF9LRVlfREVGQVVMVF9SRVNQT05TRSwgbm90aWYuZGVmYXVsdFJlc3BvbnNlKTsKKyAgICAJCisgICAgCWlmIChERUJVRykgTG9nLmQoVEFHLCAiZ2VuZXJhdGVJbnRlbnQsIHRpdGxlOiAiICsgdGl0bGUgKyAiLCBtZXNzYWdlOiAiICsgbWVzc2FnZSArCisgICAgCQkJIiwgdGltZW91dDogIiArIG5vdGlmLnRpbWVvdXQpOworICAgIAkKKyAgICAJcmV0dXJuIGludGVudDsKKyAgICB9CisgICAgCisgICAgLy8gQ29udmVydHMgYSBzdHJpbmcgKG9yIEhleCBzdHJpbmcpIHRvIGEgY2hhciBhcnJheQorICAgIHN0YXRpYyBieXRlW10gc3RyaW5nVG9CeXRlQXJyYXkoU3RyaW5nIG9yaWdpbmFsLCBib29sZWFuIGlzSGV4KQorICAgIHsKKyAgICAJaW50IGxlbmd0aCA9IGlzSGV4ID8gb3JpZ2luYWwubGVuZ3RoKCkgLyAyIDogb3JpZ2luYWwubGVuZ3RoKCk7CisgICAgCWJ5dGVbXSBvdXRwdXQgPSBuZXcgYnl0ZVtsZW5ndGhdOworICAgIAlpbnQgaTsKKyAgICAJCisgICAgCWlmIChpc0hleCkKKyAgICAJeworICAgIAkJZm9yIChpID0gMDsgaSA8IGxlbmd0aDsgaSsrKQorICAgIAkJeworICAgIAkJCW91dHB1dFtpXSA9IChieXRlKSBJbnRlZ2VyLnBhcnNlSW50KG9yaWdpbmFsLnN1YnN0cmluZyhpKjIsIGkqMisyKSwgMTYpOworICAgIAkJfQorICAgIAl9CisgICAgCWVsc2UgeworICAgIAkJZm9yIChpID0gMDsgaSA8IGxlbmd0aDsgaSsrKQorICAgIAkJeworICAgIAkJCW91dHB1dFtpXSA9IChieXRlKSBvcmlnaW5hbC5jaGFyQXQoaSk7CisgICAgCQl9CisgICAgCX0KKyAgICAJCisgICAgCXJldHVybiBvdXRwdXQ7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFVucGFja3MgYW4gYnl0ZSBhcnJheSBjb250YWluaW5nIDctYml0IHBhY2tlZCBjaGFyYWN0ZXJzIGludG8gYSBTdHJpbmcuCisgICAgICogCisgICAgICogQHBhcmFtIGlucHV0IGEgNy1iaXQgcGFja2VkIGNoYXIgYXJyYXkKKyAgICAgKiBAcmV0dXJuIH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JlbGVhc2UuCi0gICAgICAgIC8vIE1PREVfSU5WQUxJRCBpbmRpY2F0ZXMgdG8gQXVkaW9TZXJ2aWNlIHRoYXQgc2V0Um91dGluZygpIHdhcyBpbml0aWF0ZWQgYnkgQXVkaW9NYW5hZ2VyCi0gICAgICAgIHNldFJvdXRpbmdQKE1PREVfSU5WQUxJRCwgb24gPyBST1VURV9TUEVBS0VSOiAwLCBST1VURV9TUEVBS0VSKTsKKyAgICAgICAgSUF1ZGlvU2VydmljZSBzZXJ2aWNlID0gZ2V0U2VydmljZSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgc2VydmljZS5zZXRTcGVha2VycGhvbmVPbihvbik7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJEZWFkIG9iamVjdCBpbiBzZXRTcGVha2VycGhvbmVPbiIsIGUpOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC02NDgsNDEgKzY0OSw1MiBAQAogICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBzcGVha2VycGhvbmUgaXMgb24sIGZhbHNlIGlmIGl0J3Mgb2ZmCiAgICAgICovCiAgICAgcHVibGljIGJvb2xlYW4gaXNTcGVha2VycGhvbmVPbigpIHsKLSAgICAgICAgcmV0dXJuIChnZXRSb3V0aW5nUChNT0RFX0lOX0NBTEwpICYgUk9VVEVfU1BFQUtFUikgPT0gMCA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgSUF1ZGlvU2VydmljZSBzZXJ2aWNlID0gZ2V0U2VydmljZSgpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIHNlcnZpY2UuaXNTcGVha2VycGhvbmVPbigpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiRGVhZCBvYmplY3QgaW4gaXNTcGVha2VycGhvbmVPbiIsIGUpOwor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QsNyBAQAogICAgICAqLwogICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIGludCBnZXRSb3V0aW5nKGludCBtb2RlKSB7Ci0gICAgICAgIElBdWRpb1NlcnZpY2Ugc2VydmljZSA9IGdldFNlcnZpY2UoKTsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBzZXJ2aWNlLmdldFJvdXRpbmcobW9kZSk7Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICJEZWFkIG9iamVjdCBpbiBnZXRSb3V0aW5nIiwgZSk7Ci0gICAgICAgICAgICByZXR1cm4gLTE7Ci0gICAgICAgIH0KKyAgICAgICAgcmV0dXJuIC0xOwogICAgIH0KIAogICAgIC8qKgpAQCAtODg0LDEzICs4OTMsNyBAQAogICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBhbnkgbXVzaWMgdHJhY2tzIGFyZSBhY3RpdmUuCiAgICAgICovCiAgICAgcHVibGljIGJvb2xlYW4gaXNNdXNpY0FjdGl2ZSgpIHsKLSAgICAgICAgSUF1ZGlvU2VydmljZSBzZXJ2aWNlID0gZ2V0U2VydmljZSgpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIHNlcnZpY2UuaXNNdXNpY0FjdGl2ZSgpOwotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgTG9nLmUoVEFHLCAiRGVhZCBvYmplY3QgaW4gaXNNdXNpY0FjdGl2ZSIsIGUpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9CisgICAgICAgIHJldHVybiBBdWRpb1N5c3RlbS5pc011c2ljQWN0aXZlKCk7CiAgICAgfQogCiAgICAgLyoKQEAgLTkwNiwxNCArOTA5LDMyIEBACiAgICAgICovCiAgICAgLyoqCiAgICAgICogQGhpZGUKKyAgICAgKiBAZGVwcmVjY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V0ubUxhc3RBdWRpYmxlSW5kZXggPSBzdHJlYW1zW2ldLmdldFZhbGlkSW5kZXgoaW5kZXgpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aWMgaW50W10gY3JlYXRlVm9sdW1lTGV2ZWxzKGludCBvZmZzZXQsIGludCBudW1sZXZlbHMpIHsKLSAgICAgICAgZG91YmxlIGN1cnZlID0gMS4wZjsgLy8gMS40ZgotICAgICAgICBpbnQgW10gdm9sdW1lcyA9IG5ldyBpbnRbbnVtbGV2ZWxzICsgb2Zmc2V0XTsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBvZmZzZXQ7IGkrKykgewotICAgICAgICAgICAgdm9sdW1lc1tpXSA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICBkb3VibGUgdmFsID0gMDsKLSAgICAgICAgZG91YmxlIG1heCA9IE1hdGgucG93KG51bWxldmVscyAtIDEsIGN1cnZlKTsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1sZXZlbHM7IGkrKykgewotICAgICAgICAgICAgdmFsID0gTWF0aC5wb3coaSwgY3VydmUpIC8gbWF4OwotICAgICAgICAgICAgdm9sdW1lc1tvZmZzZXQgKyBpXSA9IChpbnQpICh2YWwgKiAxMDAuMGYpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB2b2x1bWVzOwotICAgIH0KLQogICAgIHByaXZhdGUgdm9pZCByZWFkUGVyc2lzdGVkU2V0dGluZ3MoKSB7CiAgICAgICAgIGZpbmFsIENvbnRlbnRSZXNvbHZlciBjciA9IG1Db250ZW50UmVzb2x2ZXI7CiAKQEAgLTI5MSwxMiArMzIwLDE5IEBACiAKICAgICAgICAgbVJpbmdlck1vZGVBZmZlY3RlZFN0cmVhbXMgPSBTZXR0aW5ncy5TeXN0ZW0uZ2V0SW50KGNyLAogICAgICAgICAgICAgICAgIFNldHRpbmdzLlN5c3RlbS5NT0RFX1JJT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4gKG1TdHJlYW1TdGF0ZXNbc3RyZWFtVHlwZV0uZ2V0TWF4SW5kZXgoKSArIDUpIC8gMTA7CiAgICAgfQogCiAgICAgLyoqIEBzZWUgQXVkaW9NYW5hZ2VyI2dldFJpbmdlck1vZGUoKSAqLwpAQCAtNTA3LDExICs0ODcsMTIgQEAKIAogICAgIC8qKiBAc2VlIEF1ZGlvTWFuYWdlciNzZXRSaW5nZXJNb2RlKGludCkgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRSaW5nZXJNb2RlKGludCByaW5nZXJNb2RlKSB7Ci0gICAgICAgIGlmIChyaW5nZXJNb2RlICE9IG1SaW5nZXJNb2RlKSB7Ci0gICAgICAgICAgICBzZXRSaW5nZXJNb2RlSW50KHJpbmdlck1vZGUsIHRydWUpOwotCi0gICAgICAgICAgICAvLyBTZW5kIHN0aWNreSBicm9hZGNhc3QKLSAgICAgICAgICAgIGJyb2FkY2FzdFJpbmdlck1vZGUoKTsKKyAgICAgICAgc3luY2hyb25pemVkIChtU2V0dGluZ3NMb2NrKSB7CisgICAgICAgICAgICBpZiAocmluZ2VyTW9kZSAhPSBtUmluZ2VyTW9kZSkgeworICAgICAgICAgICAgICAgIHNldFJpbmdlck1vZGVJbnQocmluZ2VyTW9kZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgLy8gU2VuZCBzdGlja3kgYnJvYWRjYXN0CisgICAgICAgICAgICAgICAgYnJvYWRjYXN0UmluZ2VyTW9kZSgpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCkBAIC01NDEsNyArNTIyLDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLy8gUG9zdCBhIHBlcnNpc3QgcmluZ2VyIG1vZGUgbXNnCiAgICAgICAgIGlmIChwZXJzaXN0KSB7CiAgICAgICAgICAgICBzZW5kTXNnKG1BdWRpb0hhbmRsZXIsIE1TR19QRVJTSVNUX1JJTkdFUl9NT0RFLCBTSEFSRURfTVNHLApAQCAtNjA2LDM5ICs1ODcsMjggQEAKICAgICAgICAgcmV0dXJuIGV4aXN0aW5nVmFsdWU7CiAgICAgfQogCi0gICAgLyoqIEBzZWUgQXVkaW9NYW5hZ2VyI3NldE1pY3JvcGhvbmVNdXRlKGJvb2xlYW4pICovCi0gICAgcHVibGljIHZvaWQgc2V0TWljcm9waG9uZU11dGUoYm9vbGVhbiBvbikgewotICAgICAgICBpZiAoIWNoZWNrQXVkaW9TZXR0aW5nc1Blcm1pc3Npb24oInNldE1pY3JvcGhvbmVNdXRlKCkiKSkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIHN5bmNocm9uaXplZCAobVNldHRpbmdzTG9jaykgewotICAgICAgICAgICAgaWYgKG9uICE9IG1NaWNNdXRlKSB7Ci0gICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0ubXV0ZU1pY3JvcGhvbmUob24pOwotICAgICAgICAgICAgICAgIG1NaWNNdXRlID0gb247Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiogQHNlZSBBdWRpb01hbmFnZXIjaXNNaWNyb3Bob25lTXV0ZSgpICovCi0gICAgcHVibGljIGJvb2xlYW4gaXNNaWNyb3Bob25lTXV0ZSgpIHsKLSAgICAgICAgcmV0dXJuIG1NaWNNdXRlOwotICAgIH0KLQogICAgIC8qKiBAc2VlIEF1ZGlvTWFuYWdlciNzZXRNb2RlKGludCkgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRNb2RlKGludCBtb2RlKSB7CiAgICAgICAgIGlmICghY2hlY2tBdWRpb1NldHRpbmdzUGVybWlzc2lvbigic2V0TW9kZSgpIikpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQorCisgICAgICAgIGlmIChtb2RlIDwgQXVkaW9TeXN0ZW0uTU9ERV9DVVJSRU5UIHx8IG1vZGUgPiBBdWRpb1N5c3RlbS5NT0RFX0lOX0NBTEwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCiAgICAgICAgIHN5bmNocm9uaXplZCAobVNldHRpbmdzTG9jaykgeworICAgICAgICAgICAgaWYgKG1vZGUgPT0gQXVkaW9TeXN0ZW0uTU9ERV9DVVJSRU5UKSB7CisgICAgICAgICAgICAgICAgbW9kZSA9IG1Nb2RlOworICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKG1vZGUgIT0gbU1vZGUpIHsKLSAgICAgICAgICAgICAgICBpZiAoQXVkaW9TeXN0ZW0uc2V0TW9kZShtb2RlKSA9PSBBdWRpb1N5c3RlbS5BVURJT19TVEFUVVNfT0spIHsKKyAgICAgICAgICAgICAgICBpZiAoQXVkaW9TeXN0ZW0uc2V0UGhvbmVTdGF0ZShtb2RlKSA9PSBBdWRpb1N5c3RlbS5BVURJT19TVEFUVVNfT0spIHsKICAgICAgICAgICAgICAgICAgICAgbU1vZGUgPSBtb2RlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGludCBzdHJlYW1UeXBlID0gZ2V0QWN0aXZlU3RyZWFtVHlwZShBdWRpb01hbmFnZXIuVVNFX0RFRkFVTFRfU1RSRUFNX1RZUEUpOwotICAgICAgICAgICAgaW50IGluZGV4ID0gbVN0cmVhbVN0YXRlc1tzdHJlYW1UeXBlXS5tSW5kZXg7Ci0gICAgICAgICAgICBzeW5jUmluZ2VyQW5kTm90aWZpY2F0aW9uU3RyZWFtVm9sdW1lKHN0cmVhbVR5cGUsIGluZGV4LCB0cnVlKTsKLSAgICAgICAgICAgIHNldFN0cmVhbVZvbHVtZUludChzdHJlYW1UeXBlLCBpbmRleCwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgICBpbnQgaW5kZXggPSBtU3RyZWFtU3RhdGVzW1NUUkVBTV9WT0xVTUVfQUxJQVNbc3RyZWFtVHlwZV1dLm1JbmRleDsKKyAgICAgICAgICAgIHNldFN0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uc2V0Um91dGluZygpIHRoYXQgaXMgbm93IGRlcHJlY2F0ZWQsIHRoZSByb3V0aW5nCi0gICAgICAgICAgICAvLyBjb21tYW5kIHdpbGwgYmUgaWdub3JlZC4KLSAgICAgICAgICAgIGlmIChtb2RlID09IEF1ZGlvU3lzdGVtLk1PREVfSU5WQUxJRCkgewotICAgICAgICAgICAgICAgIHN3aXRjaCAobWFzaykgewotICAgICAgICAgICAgICAgIGNhc2UgQXVkaW9TeXN0ZW0uUk9VVEVfU1BFQUtFUjoKLSAgICAgICAgICAgICAgICAgICAgLy8gaGFuZGxlIHNldFNwZWFrZXJwaG9uZU9uKCkKLSAgICAgICAgICAgICAgICAgICAgaWYgKHJvdXRlcyAhPSAwICYmICFtU3BlYWtlcklzT24pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TcGVha2VySXNPbiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTF0gPSBBdWRpb1N5c3RlbS5ST1VURV9TUEVBS0VSOwotICAgICAgICAgICAgICAgICAgICAgICAgaW5jYWxsTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0FMTDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyb3V0ZXMgPT0gMCAmJiBtU3BlYWtlcklzT24pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TcGVha2VySXNPbiA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1CbHVldG9vdGhTY29Jc0Nvbm5lY3RlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sb3V0ZXNbQXVkaW9TeXN0ZW0uTU9ERV9JTl9DQUxMXSA9IEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9TQ087Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1IZWFkc2V0SXNDb25uZWN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTF0gPSBBdWRpb1N5c3RlbS5ST1VURV9IRUFEU0VUOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTF0gPSBBdWRpb1N5c3RlbS5ST1VURV9FQVJQSUVDRTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGluY2FsbE1hc2sgPSBBdWRpb1N5c3RlbS5ST1VURV9BTEw7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9TQ086Ci0gICAgICAgICAgICAgICAgICAgIC8vIGhhbmRsZSBzZXRCbHVldG9vdGhTY29PbigpCi0gICAgICAgICAgICAgICAgICAgIGlmIChyb3V0ZXMgIT0gMCAmJiAhbUJsdWV0b290aFNjb0lzQ29ubmVjdGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQmx1ZXRvb3RoU2NvSXNDb25uZWN0ZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgbVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX0lOX0NBTExdID0gQXVkaW9TeXN0ZW0uUk9VVEVfQkxVRVRPT1RIX1NDTzsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Sb3V0ZXNbQXVkaW9TeXN0ZW0uTU9ERV9SSU5HVE9ORV0gPSAobVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX1JJTkdUT05FXSAmIEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQKSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9TQ087Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfTk9STUFMXSA9IChtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfTk9STUFMXSAmIEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQKSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ST1VURV9CTFVFVE9PVEhfU0NPOwotICAgICAgICAgICAgICAgICAgICAgICAgaW5jYWxsTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0FMTDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIEEyRFAgaGFzIGhpZ2hlciBwcmlvcml0eSB0aGFuIFNDTyBoZWFkc2V0LCBzbyBoZWFkc2V0IGNvbm5lY3QvZGlzY29ubmVjdCBldmVudHMKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZCBub3QgYWZmZWN0IEEyRFAgcm91dGluZwotICAgICAgICAgICAgICAgICAgICAgICAgcmluZ3RvbmVNYXNrID0gQXVkaW9TeXN0ZW0uUk9VVEVfQUxMICYgfkF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQOwotICAgICAgICAgICAgICAgICAgICAgICAgbm9ybWFsTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0FMTCAmIH5BdWRpb1N5c3RlbS5ST1VURV9CTFVFVE9PVEhfQTJEUDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyb3V0ZXMgPT0gMCAmJiBtQmx1ZXRvb3RoU2NvSXNDb25uZWN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CbHVldG9vdGhTY29Jc0Nvbm5lY3RlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1IZWFkc2V0SXNDb25uZWN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTF0gPSBBdWRpb1N5c3RlbS5ST1VURV9IRUFEU0VUOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sb3V0ZXNbQXVkaW9TeXN0ZW0uTU9ERV9SSU5HVE9ORV0gPSAobVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX1JJTkdUT05FXSAmIEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQKSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChBdWRpb1N5c3RlbS5ST1VURV9IRUFEU0VUfEF1ZGlvU3lzdGVtLlJPVVRFX1NQRUFLRVIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sb3V0ZXNbQXVkaW9TeXN0ZW0uTU9ERV9OT1JNQUxdID0gKG1Sb3V0ZXNbQXVkaW9TeXN0ZW0uTU9ERV9OT1JNQUxdICYgQXVkaW9TeXN0ZW0uUk9VVEVfQkxVRVRPT1RIX0EyRFApIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLlJPVVRFX0hFQURTRVQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU3BlYWtlcklzT24pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX0lOX0NBTExdID0gQXVkaW9TeXN0ZW0uUk9VVEVfU1BFQUtFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTF0gPSBBdWRpb1N5c3RlbS5ST1VURV9FQVJQSUVDRTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX1JJTkdUT05FXSA9IChtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfUklOR1RPTkVdICYgQXVkaW9TeXN0ZW0uUk9VVEVfQkxVRVRPT1RIX0EyRFApIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uUk9VVEVfU1BFQUtFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfTk9STUFMXSA9IChtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfTk9STUFMXSAmIEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQKSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ST1VURV9TUEVBS0VSOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaW5jYWxsTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0FMTDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIEEyRFAgaGFzIGhpZ2hlciBwcmlvcml0eSB0aGFuIFNDTyBoZWFkc2V0LCBzbyBoZWFkc2V0IGNvbm5lY3QvZGlzY29ubmVjdCBldmVudHMKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZCBub3QgYWZmZWN0IEEyRFAgcm91dGluZwotICAgICAgICAgICAgICAgICAgICAgICAgcmluZ3RvbmVNYXNrID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HwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEF1ZGlvU3lzdGVtLlJPVVRFX0hFQURTRVR8QXVkaW9TeXN0ZW0uUk9VVEVfU1BFQUtFUik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX05PUk1BTF0gPSAobVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX05PUk1BTF0gJiBBdWRpb1N5c3RlbS5ST1VURV9CTFVFVE9PVEhfQTJEUCkgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uUk9VVEVfSEVBRFNFVDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmNhbGxNYXNrID0gQXVkaW9TeXN0ZW0uUk9VVEVfQUxMOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEEyRFAgaGFzIGhpZ2hlciBwcmlvcml0eSB0aGFuIHdpcmVkIGhlYWRzZXQsIHNvIGhlYWRzZXQgY29ubmVjdC9kaXNjb25uZWN0IGV2ZW50cwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZCBub3QgYWZmZWN0IEEyRFAgcm91dGluZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpbmd0b25lTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0FMTCAmIH5BdWRpb1N5c3RlbS5ST1VURV9CTFVFVE9PVEhfQTJEUDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBub3JtYWxNYXNrID0gQXVkaW9TeXN0ZW0uUk9VVEVfQUxMICYgfkF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJvdXRlcyA9PSAwICYmIG1IZWFkc2V0SXNDb25uZWN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1IZWFkc2V0SXNDb25uZWN0ZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvIG5vdCBhY3QgdXBvbiBoZWFkc2V0IGRpc2Nvbm5lY3Rpb24gaWYgYmx1ZXRvb3RoIFNDTyBpcyBjb25uZWN0ZWQgdG8gbWF0Y2ggcGhvbmUgYXBwIGJlaGF2aW9yCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1CbHVldG9vdGhTY29Jc0Nvbm5lY3RlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU3BlYWtlcklzT24pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX0lOX0NBTExdID0gQXVkaW9TeXN0ZW0uUk9VVEVfU1BFQUtFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTF0gPSBBdWRpb1N5c3RlbS5ST1VURV9FQVJQSUVDRTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJvdXRlc1tBdWRpb1N5c3RlbS5NT0RFX1JJTkdUT05FXSA9IChtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfUklOR1RPTkVdICYgQXVkaW9TeXN0ZW0uUk9VVEVfQkxVRVRPT1RIX0EyRFApIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uUk9VVEVfU1BFQUtFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfTk9STUFMXSA9IChtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfTk9STUFMXSAmIEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQKSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ST1VURV9TUEVBS0VSOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5jYWxsTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0FMTDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBMkRQIGhhcyBoaWdoZXIgcHJpb3JpdHkgdGhhbiB3aXJlZCBoZWFkc2V0LCBzbyBoZWFkc2V0IGNvbm5lY3QvZGlzY29ubmVjdCBldmVudHMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzaG91bGQgbm90IGFmZmVjdCBBMkRQIHJvdXRpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByaW5ndG9uZU1hc2sgPSBBdWRpb1N5c3RlbS5ST1VURV9BTEwgJiB+QXVkaW9TeXN0ZW0uUk9VVEVfQkxVRVRPT1RIX0EyRFA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9ybWFsTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0FMTCAmIH5BdWRpb1N5c3RlbS5ST1VURV9CTFVFVE9PVEhfQTJEUDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgQXVkaW9TeXN0ZW0uUk9VVEVfQkxVRVRPT1RIX0EyRFA6Ci0gICAgICAgICAgICAgICAgICAgIC8vIGhhbmRsZSBzZXRCbHVldG9vdGhBMmRwT24oKQotICAgICAgICAgICAgICAgICAgICBpZiAocm91dGVzICE9IDAgJiYgIW1CbHVldG9vd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pb1N5c3RlbS5NT0RFX05PUk1BTF0gJj0gfkF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQOwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGF1ZGlvIGZsaW5nZXIgY2hvb3NlcyBBMkRQIGFzIGEgaGlnaGVyIHByaW9yaXR5LAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc28gdGhlcmUgaXMgbm8gbmVlZCB0byBkaXNhYmxlIG90aGVyIHJvdXRlcy4KLSAgICAgICAgICAgICAgICAgICAgICAgIHJpbmd0b25lTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQOwotICAgICAgICAgICAgICAgICAgICAgICAgbm9ybWFsTWFzayA9IEF1ZGlvU3lzdGVtLlJPVVRFX0JMVUVUT09USF9BMkRQOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAvLyBpbmNhbGxNYXNrIGlzICE9IDAgbWVhbnMgd2UgbXVzdCBhcHBseSBuZSByb3V0aW5nIHRvIE1PREVfSU5fQ0FMTCBtb2RlCi0gICAgICAgICAgICAgICAgaWYgKGluY2FsbE1hc2sgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXRSb3V0aW5nKEF1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUm91dGVzW0F1ZGlvU3lzdGVtLk1PREVfSU5fQ0FMTF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5jYWxsTWFzayk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIHJpbmd0b25lTWFzayBpcyAhPSAwIG1lYW5zIHdlIG11c3QgYXBwbHkgbmUgcm91dGluZyB0byBNT0RFX1JJTkdUT05FIG1vZGUKLSAgICAgICAgICAgICAgICBpZiAocmluZ3RvbmVNYXNrICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0Um91dGluZyhBdWRpb1N5c3RlbS5NT0RFX1JJTkdUT05FLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sb3V0ZXNbQXVkaW9TeXN0ZW0uTU9ERV9SSU5HVE9ORV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmluZ3RvbmVNYXNrKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLy8gbm9ybWFsTWFzayBpcyAhPSAwIG1lYW5zIHdlIG11c3QgYXBwbHkgbmUgcm91dGluZyB0byBNT0RFX05PUk1BTCBtb2RlCi0gICAgICAgICAgICAgICAgaWYgKG5vcm1hbE1hc2sgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXRSb3V0aW5nKEF1ZGlvU3lzdGVtLk1PREVfTk9STUFMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sb3V0ZXNbQXVkaW9TeXN0ZW0uTU9ERV9OT1JNQUxdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vcm1hbE1hc2spOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGludCBzdHJlYW1UeXBlID0gZ2V0QWN0aXZlU3RyZWFtVHlwZShBdWRpb01hbmFnZXIuVVNFX0RFRkFVTFRfU1RSRUFNX1RZUEUpOwotICAgICAgICAgICAgICAgIGludCBpbmRleCA9IG1TdHJlYW1TdGF0ZXNbc3RyZWFtVHlwZV0ubUluZGV4OwotICAgICAgICAgICAgICAgIHN5bmNSaW5nZXJBbmROb3RpZmljYXRpb25TdHJlYW1Wb2x1bWUoc3Ry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GUubUluZGV4IDogQXVkaW9NYW5hZ2VyLkRFRkFVTFRfU1RSRUFNX1ZPTFVNRVtzdHJlYW1UeXBlXSkpOworICAgICAgICAgICAgU3RyaW5nIHNldHRpbmdOYW1lID0gU3lzdGVtLlZPTFVNRV9TRVRUSU5HU1tTVFJFQU1fVk9MVU1FX0FMSUFTW3N0cmVhbVR5cGVdXTsKKyAgICAgICAgICAgIFN0cmluZyBsYXN0QXVkaWJsZVNldHRpbmdOYW1lID0gc2V0dGluZ05hbWUgKyBTeXN0ZW0uQVBQRU5EX0ZPUl9MQVNUX0FVRElCTEU7CisgICAgICAgICAgICBpbnQgaW5kZXggPSBTZXR0aW5ncy5TeXN0ZW0uZ2V0SW50KG1Db250ZW50UmVzb2x2ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0dGluZ05hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9NYW5hZ2VyLkRFRkFVTFRfU1RSRUFNX1ZPTFVNRVtzdHJlYW1UeXBlXSk7CisgICAgICAgICAgICBpZiAoU1RSRUFNX1ZPTFVNRV9BTElBU1tzdHJlYW1UeXBlXSAhPSBzdHJlYW1UeXBlKSB7CisgICAgICAgICAgICAgICAgaW5kZXggPSByZXNjYWxlSW5kZXgoaW5kZXggKiAxMCwgU1RSRUFNX1ZPTFVNRV9BTElBU1tzdHJlYW1UeXBlXSwgc3RyZWFtVHlwZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGluZGV4ICo9IDEwOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RyZWFtU3RhdGUubUluZGV4ID0gc3RyZWFtU3RhdGUuZ2V0VmFsaWRJbmRleChpbmRleCk7CisKKyAgICAgICAgICAgIGluZGV4ID0gKGluZGV4ICsgNSkgLyAxMDsKKyAgICAgICAgICAgIGluZGV4ID0gU2V0dGluZ3MuU3lzdGVtLmdldEludChtQ29udGVudFJlc29sdmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0QXVkaWJsZVNldHRpbmdOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW5kZXggPiAwKSA/IGluZGV4IDogQXVkaW9NYW5hZ2VyLkRFRkFVTFRfU1RSRUFNX1ZPTFVNRVtzdHJlYW1UeXBlXSk7CisgICAgICAgICAgICBpZiAoU1RSRUFNX1ZPTFVNRV9BTElBU1tzdHJlYW1UeXBlXSAhPSBzdHJlYW1UeXBlKSB7CisgICAgICAgICAgICAgICAgaW5kZXggPSByZXNjYWxlSW5kZXgoaW5kZXggKiAxMCwgU1RSRUFNX1ZPTFVNRV9BTElBU1tzdHJlYW1UeXBlXSwgc3RyZWFtVHlwZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGluZGV4ICo9IDEwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3RyZWFtU3RhdGUubUxhc3RBdWRpYmxlSW5kZXggPSBzdHJlYW1TdGF0ZS5nZXRWYWxpZEluZGV4KGluZGV4KTsKKwogICAgICAgICAgICAgLy8gdW5tdXRlIHN0cmVhbSB0aGF0IHdoYXMgbXV0ZWQgYnV0IGlzIG5vdCBhZmZlY3QgYnkgbXV0ZSBhbnltb3JlCiAgICAgICAgICAgICBpZiAoc3RyZWFtU3RhdGUubXV0ZUNvdW50KCkgIT0gMCAmJiAhaXNTdHJlYW1BZmZlY3RlZEJ5TXV0ZShzdHJlYW1UeXBlKSkgewogICAgICAgICAgICAgICAgIGludCBzaXplID0gc3RyZWFtU3RhdGUubURlYXRoSGFuZGxlcnMuc2l6ZSgpOwpAQCAtOTQ4LDcgKzc0OCw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAvLyBhcHBseSBzdHJlYW0gdm9sdW1lCiAgICAgICAgICAgICBpZiAoc3RyZWFtU3RhdGUubXV0ZUNvdW50KCkgPT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0uc2V0Vm9sdW1lKG1TdHJlYW1UeXBlLCBkZWZhdWx0Vm9sdW1lKTsKKyAgICAgICAgICAgIG1JbmRleE1heCA9IE1BWF9TVFJFQU1fVk9MVU1FW3N0cmVhbVR5cGVdOworICAgICAgICAgICAgbUluZGV4ID0gU2V0dGluZ3MuU3lzdGVtLmdldEludChjciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVZvbHVtZUluZGV4U2V0dGluZ05hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvTWFuYWdlci5ERUZBVUxUX1NUUkVBTV9WT0xVTUVbc3RyZWFtVHlwZV0pOworICAgICAgICAgICAgbUxhc3RBdWRpYmxlSW5kZXggPSBTZXR0aW5ncy5TeXN0ZW0uZ2V0SW50KGNyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0QXVkaWJsZVZvbHVtZUluZGV4U2V0dGluZ05hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1JbmRleCA+IDApID8gbUluZGV4IDogQXVkaW9NYW5hZ2VyLkRFRkFVTFRfU1RSRUFNX1ZPTFVNRVtzdHJlYW1UeXBlXSk7CisgICAgICAgICAgICBBdWRpb1N5c3RlbS5pbml0U3RyZWFtVm9sdW1lKHN0cmVhbVR5cGUsIDAsIG1JbmRleE1heCk7CisgICAgICAgICAgICBtSW5kZXhNYXggKj0gMTA7CisgICAgICAgICAgICBtSW5kZXggPSBnZXRWYWxpZEluZGV4KDEwICogbUluZGV4KTsKKyAgICAgICAgICAgIG1MYXN0QXVkaWJsZUluZGV4ID0gZ2V0VmFsaWRJbmRleCgxMCAqIG1MYXN0QXVkaWJsZUluZGV4KTsKKyAgICAgICAgICAgIHNldFN0cmVhbVZvbHVtZUluZGV4KHN0cmVhbVR5cGUsIG1JbmRleCk7CiAgICAgICAgICAgICBtRGVhdGhIYW5kbGVycyA9IG5ldyBBcnJheUxpc3Q8Vm9sdW1lRGVhdGhIYW5kbGVyPigpOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIGJvb2xlYW4gYWRqdXN0SW5kZXgoaW50IGRlbHRhSW5kZXgpIHsKLSAgICAgICAgICAgIHJldHVybiBzZXRJbmRleChtSW5kZXggKyBkZWx0YUluZGV4LCB0cnVlKTsKKyAgICAgICAgICAgIHJldHVybiBzZXRJbmRleChtSW5kZXggKyBkZWx0YUluZGV4ICogMTAsIHRydWUpOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIGJvb2xlYW4gc2V0SW5kZXgoaW50IGluZGV4LCBib29sZWFuIGxhc3RBdWRpYmxlKSB7CkBAIC0xMTYxLDYgKzk5MiwxMyBAQAogICAgICAgICAgICAgICAgIGlmIChsYXN0QXVkaWJsZSkgewogICAgICAgICAgICAgICAgICAgICBtTGFzdEF1ZGlibGVJbmRleCA9IG1JbmRleDsKICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gQXBwbHkgY2hhbmdlIHRvIGFsbCBzdHJlYW1zIHVzaW5nIHRoaXMgb25lIGFzIGFsaWFzCisgICAgICAgICAgICAgICAgaW50IG51bVN0cmVhbVR5cGVzID0gQXVkaW9TeXN0ZW0uZ2V0TnVtU3RyZWFtVHlwZXMoKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBzdHJlYW1UeXBlID0gbnVtU3RyZWFtVHlwZXMgLSAxOyBzdHJlYW1UeXBlID49IDA7IHN0cmVhbVR5cGUtLSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtVHlwZSAhPSBtU3RyZWFtVHlwZSAmJiBTVFJFQU1fVk9MVU1FX0FMSUFTW3N0cmVhbVR5cGVdID09IG1TdHJlYW1UeXBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtU3RyZWFtU3RhdGVzW3N0cmVhbVR5cGVdLnNldEluZGV4KHJlc2NhbGVJbmRleChtSW5kZXgsIG1TdHJlYW1UeXBlLCBzdHJlYW1UeXBlKSwgbGFzdEF1ZGlibGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CkBAIC0xMTY4LDcgKzEwMDYsNyBAQAogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIGludCBnZXRNYXhJbmRleCgpIHsKLSAgICAgICAgICAgIHJldHVybiBtVm9sdW1lcy5sZW5ndGggLSAxOworICAgICAgICAgICAgcmV0dXJuIG1JbmRleE1heDsKICAgICAgICAgfQogCiAgICAgICAgIHB1YmxpYyB2b2lkIG11dGUoSUJpbmRlciBjYiwgYm9vbGVhbiBzdGF0ZSkgewpAQCAtMTE4Myw4ICsxMDIxLDggQEAKICAgICAgICAgcHJpdmF0ZSBpbnQgZ2V0VmFsaWRJbmRleChpbnQgaW5kZXgpIHsKICAgICAgICAgICAgIGlmIChpbmRleCA8IDApIHsKICAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5kZXggPj0gbVZvbHVtZXMubGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1Wb2x1bWVzLmxlbmd0aCAtIDE7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGluZGV4ID4gbUluZGV4TWF4KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1JbmRleE1heDsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgcmV0dXJuIGluZGV4OwpAQCAtMTMxOCw4ICsxMTU2LDE2IEBACiAgICAgICAgIHByaXZhdGUgdm9pZCBzZXRTeXN0ZW1Wb2x1bWUoVm9sdW1lU3RyZWFtU3RhdGUgc3RyZWFtU3RhdGUpIHsKIAogICAgICAgICAgICAgLy8gQWRqdX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AtMTQyMSwyNSArMTI2NSw0NSBAQAogICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJNZWRpYSBzZXJ2ZXIgZGllZC4iKTsKICAgICAgICAgICAgICAgICAgICAgLy8gRm9yY2UgY3JlYXRpb24gb2YgbmV3IElBdWRpb2ZsaW5nZXIgaW50ZXJmYWNlCiAgICAgICAgICAgICAgICAgICAgIG1NZWRpYVNlcnZlck9rID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLmdldE1vZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uaXNNdXNpY0FjdGl2ZSgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgIGNhc2UgTVNHX01FRElBX1NFUlZFUl9TVEFSVEVEOgogICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJNZWRpYSBzZXJ2ZXIgc3RhcnRlZC4iKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gUmVzdG9yZSBhdWRpbyByb3V0aW5nIGFuZCBzdHJlYW0gdm9sdW1lcwotICAgICAgICAgICAgICAgICAgICBhcHBseUF1ZGlvU2V0dGluZ3MoKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gUmVzdG9yZSBkZXZpY2UgY29ubmVjdGlvbiBzdGF0ZXMKKyAgICAgICAgICAgICAgICAgICAgU2V0IHNldCA9IG1Db25uZWN0ZWREZXZpY2VzLmVudHJ5U2V0KCk7CisgICAgICAgICAgICAgICAgICAgIEl0ZXJhdG9yIGkgPSBzZXQuaXRlcmF0b3IoKTsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUoaS5oYXNOZXh0KCkpeworICAgICAgICAgICAgICAgICAgICAgICAgTWFwLkVudHJ5IGRldmljZSA9IChNYXAuRW50cnkpaS5uZXh0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoKChJbnRlZ2VyKWRldmljZS5nZXRLZXkoKSkuaW50VmFsdWUoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ERVZJQ0VfU1RBVEVfQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChTdHJpbmcpZGV2aWNlLmdldFZhbHVlKCkpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gUmVzdG9yZSBjYWxsIHN0YXRlCisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldFBob25lU3RhdGUobU1vZGUpOworCisgICAgICAgICAgICAgICAgICAgIC8vIFJlc3RvcmUgZm9yY2VkIHVzYWdlIGZvciBjb21tdW5jYXRpb25zIGFuZCByZWNvcmQKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0Rm9yY2VVc2UoQXVkaW9TeXN0ZW0uRk9SX0NPTU1VTklDQVRJT04sIG1Gb3JjZWRVc2VGb3JDb21tKTsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0Rm9yY2VVc2UoQXVkaW9TeXN0ZW0uRk9SX1JFQ09SRCwgbUZvcmNlZFVzZUZvckNvbW0pOworCisgICAgICAgICAgICAgICAgICAgIC8vIFJlc3RvcmUgc3RyZWFtIHZvbHVtZXMKICAgICAgICAgICAgICAgICAgICAgaW50IG51bVN0cmVhbVR5cGVzID0gQXVkaW9TeXN0ZW0uZ2V0TnVtU3RyZWFtVHlwZXMoKTsKICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgc3RyZWFtVHlwZSA9IG51bVN0cmVhbVR5cGVzIC0gMTsgc3RyZWFtVHlwZSA+PSAwOyBzdHJlYW1UeXBlLS0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCB2b2x1bWU7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXg7CiAgICAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVTdHJlYW1TdGF0ZSBzdHJlYW1TdGF0ZSA9IG1TdHJlYW1TdGF0ZXNbc3RyZWFtVHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5pbml0U3RyZWFtVm9sdW1lKHN0cmVhbVR5cGUsIDAsIChzdHJlYW1TdGF0ZS5tSW5kZXhNYXggKyA1KSAvIDEwKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW1TdGF0ZS5tdXRlQ291bnQoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9sdW1lID0gc3RyZWFtU3RhdGUubVZvbHVtZXNbc3RyZWFtU3RhdGUubUluZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IHN0cmVhbVN0YXRlLm1JbmRleDsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9sdW1lID0gc3RyZWFtU3RhdGUubVZvbHVtZXNbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0Vm9sdW1lKHN0cmVhbVR5cGUsIHZvbHVtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRTdHJlYW1Wb2x1bWVJbmRleChzdHJlYW1UeXBlLCBpbmRleCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgc2V0UmluZ2VyTW9kZShtUmluZ2VyTW9kZSk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gUmVzdG9yZSByaW5nZXIgbW9kZQorICAgICAgICAgICAgICAgICAgICBzZXRSaW5nZXJNb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ICAgICAgIFNldHRpbmdzLlN5c3RlbS5NT0RFX1JJTkdFUl9TVFJFQU1TX0FGRkVDVEVELAotICAgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVNldHRpbmdzTG9jaykgeworICAgICAgICAgICAgICAgIGludCByaW5nZXJNb2RlQWZmZWN0ZWRTdHJlYW1zID0gU2V0dGluZ3MuU3lzdGVtLmdldEludChtQ29udGVudFJlc29sdmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU3lzdGVtLk1PREVfUklOR0VSX1NUUkVBTVNfQUZGRUNURUQsCisgICAgICAgICAgICAgICAgICAgICAgICAwKTsKKyAgICAgICAgICAgICAgICBpZiAocmluZ2VyTW9kZUFmZmVjdGVkU3RyZWFtcyAhPSBtUmluZ2VyTW9kZUFmZmVjdGVkU3RyZWFtcykgeworICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgKiBFbnN1cmUgYWxsIHN0cmVhbSB0eXBlcyB0aGF0IHNob3VsZCBiZSBhZmZlY3RlZCBieSByaW5nZXIgbW9kZQorICAgICAgICAgICAgICAgICAgICAgKiBhcmUgaW4gdGhlIHByb3BlciBzdGF0ZS4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIG1SaW5nZXJNb2RlQWZmZWN0ZWRTdHJlYW1zID0gcmluZ2VyTW9kZUFmZmVjdGVkU3RyZWFtczsKKyAgICAgICAgICAgICAgICAgICAgc2V0UmluZ2VyTW9kZUludChnZXRSaW5nZXJNb2RlKCksIGZhbHNlKTsKKyAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBFbnN1cmUgYWxsIHN0cmVhbSB0eXBlcyB0aGF0IHNob3VsZCBiZSBhZmZlY3RlZCBieSByaW5nZXIgbW9kZQotICAgICAgICAgICAgICogYXJlIGluIHRoZSBwcm9wZXIgc3RhdGUuCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHNldFJpbmdlck1vZGVJbnQoZ2V0UmluZ2VyTW9kZSgpLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgaW50IG5vdGlmaWNhdGlvbnNVc2VSaW5nVm9sdW1lID0gU2V0dGluZ3MuU3lzdGVtLmdldEludChtQ29udGVudFJlc29sdmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU3lzdGVtLk5PVElGSUNBVElPTlNfVVNFX1JJTkdfVk9MVU1FLAorICAgICAgICAgICAgICAgICAgICAgICAgMSk7CisgICAgICAgICAgICAgICAgaWYgKG5vdGlmaWNhdGlvbnNVc2VSaW5nVm9sdW1lICE9IG1Ob3RpZmljYXRpb25zVXNlUmluZ1ZvbHVtZSkgeworICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uc1VzZVJpbmdWb2x1bWUgPSBub3RpZmljYXRpb25zVXNlUmluZ1ZvbHVtZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Ob3RpZmljYXRpb25zVXNlUmluZ1ZvbHVtZSA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFQU1fVk9MVU1FX0FMSUFTW0F1ZGlvU3lzdGVtLlNUUkVBTV9OT1RJRklDQVRJT05dID0gQXVkaW9TeXN0ZW0uU1RSRUFNX1JJTkc7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFQU1fVk9MVU1FX0FMSUFTW0F1ZGlvU3lzdGVtLlNUUkVBTV9OT1RJRklDQVRJT05dID0gQXVkaW9TeXN0ZW0uU1RSRUFNX05PVElGSUNBVElPTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFBlcnNpc3Qgbm90aWZpY2F0aW9uIHZvbHVtZSB2b2x1bWUgYXMgaXQgd2FzIG5vdCBwZXJzaXN0ZWQgd2hpbGUgYWxpYXNlZCB0byByaW5nIHZvbHVtZQorICAgICAgICAgICAgICAgICAgICAgICAgc2VuZE1zZyhtQXVkaW9IYW5kbGVyLCBNU0dfUEVSU0lTVF9WT0xVTUUsIEF1ZGlvU3lzdGVtLlNUUkVBTV9OT1RJRklDQVRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNFTkRNU0dfUkVQTEFDRSwgMCwgMCwgbVN0cmVhbVN0YXRlc1tBdWRpb1N5c3RlbS5TVFJFQU1fTk9USUZJQ0FUSU9OXSwgUEVSU0lTVF9ERUxBWSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCiAgICAgfQotICAgIAorCisgICAgLyoqCisgICAgICogUmVjZWl2ZXIgZm9yIG1pc2MgaW50ZW50IGJyb2FkY2FzdHMgdGhlIFBob25lIGFwcCBjYXJlcyBhYm91dC4KKyAgICAgKi8KKyAgICBwcml2YXRlIGNsYXNzIEF1ZGlvU2VydmljZUJyb2FkY2FzdFJlY2VpdmVyIGV4dGVuZHMgQnJvYWRjYXN0UmVjZWl2ZXIgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgU3RyaW5nIGFjdGlvbiA9IGludGVudC5nZXRBY3Rpb24oKTsKKworICAgICAgICAgICAgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoQTJkcC5TSU5LX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgeworICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhBMmRwLlNJTktfU1RBVEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEEyZHAuU1RBVEVfRElTQ09OTkVDVEVEKTsKKyAgICAgICAgICAgICAgICBCbHVldG9vdGhEZXZpY2UgYnREZXZpY2UgPSBpbnRlbnQuZ2V0UGFyY2VsYWJsZUV4dHJhKEJsdWV0b290aEludGVudC5ERVZJQ0UpOworICAgICAgICAgICAgICAgIFN0cmluZyBhZGRyZXNzID0gYnREZXZpY2UuZ2V0QWRkcmVzcygpOworICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNDb25uZWN0ZWQgPSAobUNvbm5lY3RlZERldmljZXMuY29udGFpbnNLZXkoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9CTFVFVE9PVEhfQTJEUCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoU3RyaW5nKW1Db25uZWN0ZWREZXZpY2VzLmdldChBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9BMkRQKSkuZXF1YWxzKGFkZHJlc3MpKTsKKworICAgICAgICAgICAgICAgIGlmIChpc0Nvbm5lY3RlZCAmJgorICAgICAgICAgICAgICAgICAgICBzdGF0ZSAhPSBCbHVldG9vdGhBMmRwLlNUQVRFX0NPTk5FQ1RFRCAmJiBzdGF0ZSAhPSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpIHsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfQkxVRVRPT1RIX0EyRFAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uREVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHJlc3MpOworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5yZW1vdmUoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9CTFVFVE9PVEhfQTJEUCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghaXNDb25uZWN0ZWQgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHN0YXRlID09IEJsdWV0b290aEEyZHAuU1RBVEVfQ09OTkVDVEVEIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpKSB7CisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9BMkRQLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uREVWSUNFX1NUQVRFX0FWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHJlc3MpOworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5wdXQoIG5ldyBJbnRlZ2VyKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfQkxVRVRPT1RIX0EyRFApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHJlc3MpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhJbnRlbnQuSEVBRFNFVF9TVEFURV9DSEFOR0VEX0FDVElPTikpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhdGUgPSBpbnRlbnQuZ2V0SW50RXh0cmEoQmx1ZXRvb3RoSW50ZW50LkhFQURTRVRfU1RBVEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEhlYWRzZXQuU1RBVEVfRVJST1IpOworICAgICAgICAgICAgICAgIGludCBkZXZpY2UgPSBBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9TQ087CisgICAgICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGJ0RGV2aWNlID0gaW50ZW50LmdldFBhcmNlbGFibGVFeHRyYShCbHVldG9vdGhJbnRlbnQuREVWSUNFKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzcyA9IG51bGw7CisgICAgICAgICAgICAgICAgaW50IGJ0Q2xhc3MgPSBCbHVldG9vdGhDbGFzcy5FUlJPUjsKKyAgICAgICAgICAgICAgICBpZiAoYnREZXZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBhZGRyZXNzID0gYnREZXZpY2UuZ2V0QWRkcmVzcygpOworICAgICAgICAgICAgICAgICAgICBidENsYXNzID0gYnREZXZpY2UuZ2V0Qmx1ZXRvb3RoQ2xhc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKEJsdWV0b290aENsYXNzLkRldmljZS5NYWpvci5nZXREZXZpY2VNYWpvcihidENsYXNzKSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbHVldG9vdGhDbGFzcy5EZXZpY2UuTWFqb3IuQVVESU9fVklERU8pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLmdldERldmljZShidENsYXNzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBCbHVldG9vdGhDbGFzcy5EZXZpY2UuQVVESU9fVklERU9fV0VBUkFCTEVfSEVBRFNFVDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkFVRElPX1ZJREVPX0hBTkRTRlJFRToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2UgPSBBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9TQ09fSEVBRFNFVDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQmx1ZXRvb3RoQ2xhc3MuRGV2aWNlLkFVRElPX1ZJREVPX0NBUl9BVURJTzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2UgPSBBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0JMVUVUT09USF9TQ09fQ0FSS0lUOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNDb25uZWN0ZWQgPSAobUNvbm5lY3RlZERldmljZXMuY29udGFpbnNLZXkoZGV2aWNlKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChTdHJpbmcpbUNvbm5lY3RlZERldmljZXMuZ2V0KGRldmljZSkpLmVxdWFscyhhZGRyZXNzKSk7CisKKyAgICAgICAgICAgICAgICBpZiAoaXNDb25uZWN0ZWQgJiYgc3RhdGUgIT0gQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9DT05ORUNURUQpIHsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKGRldmljZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLkRFVklDRV9TVEFURV9VTkFWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHJlc3MpOworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5yZW1vdmUoZGV2aWNlKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFpc0Nvbm5lY3RlZCAmJiBzdGF0ZSA9PSBCbHVldG9vdGhIZWFkc2V0LlNUQVRFX0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uREVWSUNFX1NUQVRFX0FWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHJlc3MpOworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5wdXQobmV3IEludGVnZXIoZGV2aWNlKSwgYWRkcmVzcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEludGVudC5BQ1RJT05fSEVBRFNFVF9QTFVHKSkgeworICAgICAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYSgic3RhdGUiLCAwKTsKKyAgICAgICAgICAgICAgICBpZiAoKHN0YXRlICYgQklUX0hFQURTRVQpID09IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgKG1IZWFkc2V0U3RhdGUgJiBCSVRfSEVBRFNFVCkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9XSVJFRF9IRUFEU0VULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLkRFVklDRV9TVEFURV9VTkFWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIik7CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLnJlbW92ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1dJUkVEX0hFQURTRVQpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHN0YXRlICYgQklUX0hFQURTRVQpICE9IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgKG1IZWFkc2V0U3RhdGUgJiBCSVRfSEVBRFNFVCkgPT0gMCkgIHsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfV0lSRURfSEVBRFNFVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ERVZJQ0VfU1RBVEVfQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIiKTsKKyAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RlZERldmljZXMucHV0KCBuZXcgSW50ZWdlcihBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1dJUkVEX0hFQURTRVQpLCAiIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgoc3RhdGUgJiBCSVRfSEVBRFNFVF9OT19NSUMpID09IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgKG1IZWFkc2V0U3RhdGUgJiBCSVRfSEVBRFNFVF9OT19NSUMpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfV0lSRURfSEVBRFBIT05FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLkRFVklDRV9TVEFURV9VTkFWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIik7CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLnJlbW92ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1dJUkVEX0hFQURQSE9ORSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoc3RhdGUgJiBCSVRfSEVBRFNFVF9OT19NSUMpICE9IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgKG1IZWFkc2V0U3RhdGUgJiBCSVRfSEVBRFNFVF9OT19NSUMpID09IDApICB7CisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1dJUkVEX0hFQURQSE9ORSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ERVZJQ0VfU1RBVEVfQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIiKTsKKyAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RlZERldmljZXMucHV0KCBuZXcgSW50ZWdlcihBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1dJUkVEX0hFQURQSE9ORSksICIiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKChzdGF0ZSAmIEJJVF9UVFkpID09IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgKG1IZWFkc2V0U3RhdGUgJiBCSVRfVFRZKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1RUWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ERVZJQ0VfU1RBVEVfVU5BVkFJTEFCTEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiIpOworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkRGV2aWNlcy5yZW1vdmUoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9UVFkpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHN0YXRlICYgQklUX1RUWSkgIT0gMCAmJgorICAgICAgICAgICAgICAgICAgICAobUhlYWRzZXRTdGF0ZSAmIEJJVF9UVFkpID09IDApICB7CisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1RUWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5ERVZJQ0VfU1RBVEVfQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIiKTsKKyAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RlZERldmljZXMucHV0KCBuZXcgSW50ZWdlcihBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX1RUWSksICIiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKChzdGF0ZSAmIEJJVF9GTV9IRUFEU0VUKSA9PSAwICYmCisgICAgICAgICAgICAgICAgICAgIChtSGVhZHNldFN0YXRlICYgQklUX0ZNX0hFQURTRVQpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uc2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfRk1fSEVBRFBIT05FLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLkRFVklDRV9TVEFURV9VTkFWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIik7CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLnJlbW92ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0ZNX0hFQURQSE9ORSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoc3RhdGUgJiBCSVRfRk1fSEVBRFNFVCkgIT0gMCAmJgorICAgICAgICAgICAgICAgICAgICAobUhlYWRzZXRTdGF0ZSAmIEJJVF9GTV9IRUFEU0VUKSA9PSAwKSAgeworICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbS5zZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9GTV9IRUFEUEhPTkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uREVWSUNFX1NUQVRFX0FWQUlMQUJMRSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIik7CisgICAgICAgICAgICAgICAgICAgIG1Db25uZWN0ZWREZXZpY2VzLnB1dCggbmV3IEludGVnZXIoQXVkaW9TeXN0ZW0uREVWSUNFX09VVF9GTV9IRUFEUEhPTkUpLCAiIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgoc3RhdGUgJiBCSVRfRk1fU1BFQUtFUikgPT0gMCAmJgorICAgICAgICAgICAgICAgICAgICAobUhlYWRzZXRTdGF0ZSAmIEJJVF9GTV9TUEVBS0VSKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtLnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShBdWRpb1N5c3RlbS5ERVZJQ0VfT1VUX0ZNX1NQRUFLRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW0uREVWSUNFX1NUQVRFX1VOQVZBSUxBQkxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICIiKTsKKyAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RlZERldmljZXMucmVtb3ZlKEF1ZGlvU3lzdGVtLkRFVklDRV9PVVRfRk1fU1BFQUtFUik7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoc3RhdGUgJiBCSVRfRk1fU1BFQUtFUikgIT0gMCAmJgorICAgICAgICAgICAgICAgICAgICAobUhlYWRzZXRTdGF0ZSAmIEJJVF9GTV9TUEVBS0VSKSA9PSAwKSAgeworICAgICAgICAg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ZXIpIHsKKyAgICAgICAgUGFyY2VsIHJlcGx5ID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBNZXRhZGF0YSBkYXRhID0gbmV3IE1ldGFkYXRhKCk7CisKKyAgICAgICAgaWYgKCFuYXRpdmVfZ2V0TWV0YWRhdGEodXBkYXRlX29ubHksIGFwcGx5X2ZpbHRlciwgcmVwbHkpKSB7CisgICAgICAgICAgICByZXBseS5yZWN5Y2xlKCk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIE1ldGFkYXRhIHRha2VzIG92ZXIgdGhlIHBhcmNlbCwgZG9uJ3QgcmVjeWNsZSBpdCB1bmxlc3MKKyAgICAgICAgLy8gdGhlcmUgaXMgYW4gZXJyb3IuCisgICAgICAgIGlmICghZGF0YS5wYXJzZShyZXBseSkpIHsKKyAgICAgICAgICAgIHJlcGx5LnJlY3ljbGUoKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHJldHVybiBkYXRhOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCBhIGZpbHRlciBmb3IgdGhlIG1ldGFkYXRhIHVwZGF0ZSBub3RpZmljYXRpb24gYW5kIHVwZGF0ZQorICAgICAqIHJldHJpZXZhbC4gVGhlIGNhbGxlciBwcm92aWRlcyAyIHNldCBvZiBtZXRhZGF0YSBrZXlzLCBhbGxvd2VkCisgICAgICogYW5kIGJsb2NrZWQuIFRoZSBibG9ja2VkIHNldCBhbHdheXMgdGFrZXMgcHJlY2VkZW5jZSBvdmVyIHRoZQorICAgICAqIGFsbG93ZWQgb25lLgorICAgICAqIE1ldGFkYXRhLk1BVENIX0FMTCBhbmQgTWV0YWRhdGEuTUFUQ0hfTk9ORSBhcmUgMiBzZXRzIGF2YWlsYWJsZSBhcworICAgICAqIHNob3J0aGFuZHMgdG8gYWxsb3cvYmxvY2sgYWxsIG9yIG5vIG1ldGFkYXRhLgorICAgICAqCisgICAgICogQ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wgc3RhcnRzIGFscmVhZHkgd2l0aCBhbiBpbnRlcmZhY2UgdG9rZW4uIFRoZXJlCisgICAgICAgIC8vIGFyZSAyIGZpbHRlcnMuIEVhY2ggb25lIHN0YXJ0cyB3aXRoIGEgNGJ5dGVzIG51bWJlciB0bworICAgICAgICAvLyBzdG9yZSB0aGUgbGVuIGZvbGxvd2VkIGJ5IGEgbnVtYmVyIG9mIGludCAoNCBieXRlcyBhcyB3ZWxsKQorICAgICAgICAvLyByZXByZXNlbnRpbmcgdGhlIG1ldGFkYXRhIHR5cGUuCisgICAgICAgIGludCBjYXBhY2l0eSA9IHJlcXVlc3QuZGF0YVNpemUoKSArIDQgKiAoMSArIGFsbG93LnNpemUoKSArIDEgKyBibG9jay5zaXplKCkpOworCisgICAgICAgIGlmIChyZXF1ZXN0LmRhdGFDYXBhY2l0eSgpIDwgY2FwYWNpdHkpIHsKKyAgICAgICAgICAgIHJlcXVlc3Quc2V0RGF0YUNhcGFjaXR5KGNhcGFjaXR5KTsKKyAgICAgICAgfQorCisgICAgICAgIHJlcXVlc3Qud3JpdGVJbnQoYWxsb3cuc2l6ZSgpKTsKKyAgICAgICAgZm9yKEludGVnZXIgdDogYWxsb3cpIHsKKyAgICAgICAgICAgIHJlcXVlc3Qud3JpdGVJbnQodCk7CisgICAgICAgIH0KKyAgICAgICAgcmVxdWVzdC53cml0ZUludChibG9jay5zaXplKCkpOworICAgICAgICBmb3IoSW50ZWdlciB0OiBibG9jaykgeworICAgICAgICAgICAgcmVxdWVzdC53cml0ZUludCh0KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbmF0aXZlX3NldE1ldGFkYXRhRmlsdGVyKHJlcXVlc3QpOworICAgIH0KKworICAgIC8qKgogICAgICAqIFJlbGVhc2VzIHJlc291cmNlcyBhc3NvY2lhdGVkIHdpdGggdGhpcyBNZWRpYVBsYXllciBvYmplY3QuCiAgICAgICogSXQgaXMgY29uc2lkZXJlZCBnb29kIHByYWN0aWNlIHRvIGNhb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lIG5hdGl2ZSBwbGF5ZXIgc2VudCB0byB0aGUKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgTWVkaWFQbGF5ZXJTZXJ2aWNlIGR1cmluZyB0aGF0IHBlcmlvZCBvZgorICAgICAqICAgICAgICAgICAgICAgICAgICB0aW1lLiBJZiBmYWxzZSwgYWxsIHRoZSBtZXRhZGF0YXMgYXJlIGNvbnNpZGVyZWQuCisgICAgICogQHBhcmFtIGFwcGx5X2ZpbHRlciAgSWYgdHJ1ZSwgb25jZSB0aGUgbWV0YWRhdGEgc2V0IGhhcyBiZWVuIGJ1aWx0IGJhc2VkIG9uCisgICAgICogICAgICAgICAgICAgICAgICAgICB0aGUgdmFsdWUgdXBkYXRlX29ubHksIHRoZSBjdXJyZW50IGZpbHRlciBpcyBhcHBsaWVkLgorICAgICAqIEBwYXJhbSByZXBseVtvdXRdIE9uIHJldHVybiBjb250YWlucyB0aGUgc2VyaWFsaXplZAorICAgICAqICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhLiBWYWxpZCBvbmx5IGlmIHRoZSBjYWxsIHdhcyBzdWNjZXNzZnVsLgorICAgICAqIEByZXR1cm4gVGhlIHN0YXR1cyBjb2RlLgorICAgICAqLworICAgIHByaXZhdGUgbmF0aXZlIGZpbmFsIGJvb2xlYW4gbmF0aXZlX2dldE1ldGFkYXRhKGJvb2xlYW4gdXBkYXRlX29ubHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBhcHBseV9maWx0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsIHJlcGx5KTsKKworICAgIC8qKgorICAgICAqIEBwYXJhbSByZXF1ZXN0IFBhcmNlbCB3aXRoIHRoZSAyIHNlcmlhbGl6ZWQgbGlzdHMgb2YgYWxsb3dlZAorICAgICAqICAgICAgICAgICAgICAgIG1ldGFkYXRhIHR5cGVzIGZvbGxv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ID0gbmV3IE15TWVkaWFTY2FubmVyQ2xpZW50KCk7CkBAIC0zODksNiArMzk2LDcgQEAKICAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbVBhdGg7CiAgICAgICAgIHByaXZhdGUgbG9uZyBtTGFzdE1vZGlmaWVkOwogICAgICAgICBwcml2YXRlIGxvbmcgbUZpbGVTaXplOworICAgICAgICBwcml2YXRlIFN0cmluZyBtV3JpdGVyOwogCiAgICAgICAgIHB1YmxpYyBGaWxlQ2FjaGVFbnRyeSBiZWdpbkZpbGUoU3RyaW5nIHBhdGgsIFN0cmluZyBtaW1lVHlwZSwgbG9uZyBsYXN0TW9kaWZpZWQsIGxvbmcgZmlsZVNpemUpIHsKIApAQCAtNDcyLDYgKzQ4MCw3IEBACiAgICAgICAgICAgICBtRHVyYXRpb24gPSAwOwogICAgICAgICAgICAgbVBhdGggPSBwYXRoOwogICAgICAgICAgICAgbUxhc3RNb2RpZmllZCA9IGxhc3RNb2RpZmllZDsKKyAgICAgICAgICAgIG1Xcml0ZXIgPSBudWxsOwogCiAgICAgICAgICAgICByZXR1cm4gZW50cnk7CiAgICAgICAgIH0KQEAgLTQ4NCw2ICs0OTMsMjIgQEAKICAgICAgICAgICAgIGRvU2NhbkZpbGUocGF0aCwgbWltZVR5cGUsIGxhc3RNb2RpZmllZCwgZmlsZVNpemUsIGZhbHNlKTsKICAgICAgICAgfQogCisgICAgICAgIHByaXZhdGUgYm9vbGVhbiBpc01ldGFkYXRhU3VwcG9ydGVkKGludCBmaWxlVHlwZSkgeworICAgICAgICAgICAgaWYgKG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX01QMyB8fAorICAgICAgICAgICAgICAgICAgICBtRmlsZVR5cGUgPT0gTWVkaWFGaWxlLkZJTEVfVFlQRV9NUDQgfHwKKyAgICAgICAgICAgICAgICAgICAgbUZpbGVUeXBlID09IE1lZGlhRmlsZS5GSUxFX1RZUEVfTTRBIHx8CisgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFXzNHUFAgfHwKKyAgICAgICAgICAgICAgICAgICAgbUZpbGVUeXBlID09IE1lZGlhRmlsZS5GSUxFX1RZUEVfM0dQUDIgfHwKKyAgICAgICAgICAgICAgICAgICAgbUZpbGVUeXBlID09IE1lZGlhRmlsZS5GSUxFX1RZUEVfT0dHIHx8CisgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX0FBQyB8fAorICAgICAgICAgICAgICAgICAgICBtRmlsZVR5cGUgPT0gTWVkaWFGaWxlLkZJTEVfVFlQRV9NSUQgfHwKKyAgICAgICAgICAgICAgICAgICAgbUZpbGVUeXBlID09IE1lZGlhRmlsZS5GSUxFX1RZUEVfV01BKSB7CisgICAgICAgICAgICAgICAgLy8gd2Ugb25seSBleHRyYWN0IG1ldGFkYXRhIGZyb20gTVAzLCBNNEEsIE9HRywgTUlELCBBQUMgYW5kIFdNQSBmaWxlcy4KKyAgICAgICAgICAgICAgICAvLyBjaGVjayBNUDQgZmlsZXMsIHRvIGRldGVybWluZSBpZiB0aGV5IGNvbnRhaW4gb25seSBhdWRpby4KKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQogICAgICAgICBwdWJsaWMgVXJpIGRvU2NhbkZpbGUoU3RyaW5nIHBhdGgsIFN0cmluZyBtaW1lVHlwZSwgbG9uZyBsYXN0TW9kaWZpZWQsIGxvbmcgZmlsZVNpemUsIGJvb2xlYW4gc2NhbkFsd2F5cykgewogICAgICAgICAgICAgVXJpIHJlc3VsdCA9IG51bGw7CiAvLyAgICAgICAgICAgIGxvbmcgdDEgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKQEAgLTQ5OSwxNiArNTI0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBtdXNpYyA9IChsb3dwYXRoLmluZGV4T2YoTVVTSUNfRElSKSA+IDApIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAoIXJpbmd0b25lcyAmJiAhbm90aWZpY2F0aW9ucyAmJiAhYWxhcm1zICYmICFwb2RjYXN0cyk7CiAKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX01QMyB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX01QNCB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX000QSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFXzNHUFAgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmlsZVR5cGUgPT0gTWVkaWFGaWxlLkZJTEVfVFlQRV8zR1BQMiB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX09HRyB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX01JRCB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWxlVHlwZSA9PSBNZWRpYUZpbGUuRklMRV9UWVBFX1dNQSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugb25seSBleHRyYWN0IG1ldGFkYXRhIGZyb20gTVAzLCBNNEEsIE9HRywgTUlEIGFuZCBXTUEgZmlsZXMuCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBjaGVjayBNUDQgZmlsZXMsIHRvIGRldGVybWluZSBpZiB0aGV5IGNvbnRhaW4gb25seSBhdWRpby4KKyAgICAgICAgICAgICAgICAgICAgaWYoIGlzTWV0YWRhdGFTdXBwb3J0ZWQobUZpbGVUeXBlKSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NGaWxlKHBhdGgsIG1pbWVUeXBlLCB0aGlzKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChNZWRpYUZpbGUuaXNJbWFnZUZpbGVUeXBlKG1GaWxlVHlwZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHVzZWQgdG8gY29tcHV0ZSB0aGUgd2lkdGggYW5kIGhlaWdodCBidXQgaXQncyBub3Qgd29ydGggaXQKQEAgLTU4Niw2ICs2MDIsOCBAQAogICAgICAgICAgICAgICAgIG1UcmFjayA9IChudW0gKiAxMDAwKSArIChtVHJhY2sgJSAxMDAwKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHNJZ25vcmVDYXNlKCJkdXJhdGlvbiIpKSB7CiAgICAgICAgICAgICAgICAgbUR1cmF0aW9uID0gcGFyc2VTdWJzdHJpbmcodmFsdWUsIDAsIDApOworICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFsc0lnbm9yZUNhc2UoIndyaXRlciIpIHx8IG5hbWUuc3RhcnRzV2l0aCgid3JpdGVyOyIpKSB7CisgICAgICAgICAgICAgICAgbVdyaXRlciA9IHZhbHVlLnRyaW0oKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC03MDksNiArNzI3LDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KEltYWdlcy5NZWRpYS5MQVRJVFVERSwgbGF0bG5nWzBdKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoSW1hZ2VzLk1lZGlhLkxPTkdJVFVERSwgbGF0bG5nWzFdKTsKICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGxvbmcgdGltZSA9IEV4aWZJbnRlcmZhY2UuZ2V0RGF0ZVRpbWUoZXhpZkRhdGEpOworICAgICAgICAgICAgICAgICAgICBpZiAodGltZSAhPSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnB1dChJbWFnZXMuTWVkaWEuREFURV9UQUtFTiwgdGltZSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKQEAgLTc3OSw2ICs4MDIsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgc2V0U2V0dGluZ0lmTm90U2V0KFNldHRpbmdzLlN5c3RlbS5SSU5HVE9ORSwgdGFibGVVcmksIHJvd0lkKTsKICAgICAgICAgICAgICAgICAgICAgbURlZmF1bHRSaW5ndG9uZVNldCA9IHRydWU7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChhbGFybXMgJiYgIW1EZWZhdWx0QWxhcm1TZXQpIHsKKyAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobURlZmF1bHRBbGFybUFsZXJ0RmlsZW5hbWUpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICBkb2VzUGF0aEhhdmVGaWxlbmFtZShlbnRyeS5tUGF0aCwgbURlZmF1bHRBbGFybUFsZXJ0RmlsZW5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHNldFNldHRpbmdJZk5vdFNldChTZXR0aW5ncy5TeXN0ZW0uQUxBUk1fQUxFUlQsIHRhYmxlVXJpLCByb3dJZCk7CisgICAgICAgICAgICAgICAgICAgIG1EZWZhdWx0QWxhcm1TZXQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKQEAgLTgwMyw2ICs4MzIsMjIgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZE5vTWVkaWFGb2xkZXIoU3Rya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2V5OiBNZXRhZGF0YSBJRAorICAgIC8vIFZhbHVlOiBPZmZzZXQgb2YgdGhlIG1ldGFkYXRhIHR5cGUgZmllbGQgaW4gdGhlIHJlY29yZC4KKyAgICBwcml2YXRlIGZpbmFsIEhhc2hNYXA8SW50ZWdlciwgSW50ZWdlcj4gbUtleVRvUG9zTWFwID0KKyAgICAgICAgICAgIG5ldyBIYXNoTWFwPEludGVnZXIsIEludGVnZXI+KCk7CisKKyAgICAvKioKKyAgICAgKiBIZWxwZXIgY2xhc3MgdG8gaG9sZCBhIHRyaXBsZSAodGltZSwgZHVyYXRpb24sIHRleHQpLiBDYW4gYmUgdXNlZCB0bworICAgICAqIGltcGxlbWVudCBjYXB0aW9uLgorICAgICAqLworICAgIHB1YmxpYyBjbGFzcyBUaW1lZFRleHQgeworICAgICAgICBwcml2YXRlIERhdGUgbVRpbWU7CisgICAgICAgIHByaXZhdGUgaW50IG1EdXJhdGlvbjsgIC8vIG1pbGxpc2VjCisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1UZXh0OworCisgICAgICAgIHB1YmxpYyBUaW1lZFRleHQoRGF0ZSB0aW1lLCBpbnQgZHVyYXRpb24sIFN0cmluZyB0ZXh0KSB7CisgICAgICAgICAgICBtVGltZSA9IHRpbWU7CisgICAgICAgICAgICBtRHVyYXRpb24gPSBkdXJhdGlvbjsKKyAgICAgICAgICAgIG1UZXh0ID0gdGV4dDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHJlcyA9IG5ldyBTdHJpbmdCdWlsZGVyKDgwKTsKKyAgICAgICAgICAgIHJlcy5hcHBlbmQobVRpbWUpLmFwcGVuZCgiLSIpLmFwcGVuZChtRHVyYXRpb24pCisgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoIjoiKS5hcHBlbmQobVRleHQpOworICAgICAgICAgICAgcmV0dXJuIHJlcy50b1N0cmluZygpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIE1ldGFkYXRhKCkgeyB9CisKKyAgICAvKioKKyAgICAgKiBHbyBvdmVyIGFsbCB0aGUgcmVjb3JkcywgY29sbGVjdGluZyBtZXRhZGF0YSBrZXlzIGFuZCByZWNvcmRzJworICAgICAqIHR5cGUgZmllbGQgb2Zmc2V0IGluIHRoZSBQYXJjZWwuIFRoZXNlIGFyZSBzdG9yZWQgaW4KKyAgICAgKiBtS2V5VG9Qb3NNYXAgZm9yIGxhdHRlciByZXRyaWV2YWwuCisgICAgICogRm9ybWF0IG9mIGEgbWV0YWRhdGEgcmVjb3JkOgorICAgICA8cHJlPgorICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAgICAgICAgICAgMiAgICAgICAgICAgICAgICAgICAzCisgICAgICAwIDEgMiAzIDQgNSA2IDcgOCA5IDAgMSAyIDMgNCA1IDYgNyA4IDkgMCAxIDIgMyA0IDUgNiA3IDggOSAwIDEKKyAgICAgICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCisgICAgICB8ICAgICAgICAgICAgICAgICAgICAgcmVjb3JkIHNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICAgICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKyAgICAgIHwgICAgICAgICAgICAgICAgICAgICBtZXRhZGF0YSBrZXkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAvLyBUSVRMRQorICAgICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKyAgICAgIHwgICAgICAgICAgICAgICAgICAgICBtZXRhZGF0YSB0eXBlICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAvLyBTVFJJTkdfVkFMCisgICAgICArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKyAgICAgIHwgICAgICAgICAgICAgICAgLi4uLiBtZXRhZGF0YSBwYXlsb2FkIC4uLi4gICAgICAgICAgICAgICAgICAgICB8CisgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICAgICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKyAgICAgPC9wcmU+CisgICAgICogQHBhcmFtIHBhcmNlbCBXaXRoIHRoZSBzZXJpYWxpemVkIHJlY29yZHMuCisgICAgICogQHBhcmFtIGJ5dGVzTGVmdCBIb3cgbWFueSBieXRlcyBpbiB0aGUgcGFyY2VsIHNob3VsZCBiZSBwcm9jZXNzZWQuCisgICAgICogQHJldHVybiBmYWxzZSBpZiBhbiBlcnJvciBvY2N1cnJlZCBkdXJpbmcgcGFyc2luZy4KKyAgICAgKi8KKyAgICBwcml2YXRlIGJvb2xlYW4gc2NhbkFsbFJlY29yZHMoUGFyY2VsIHBhcmNlbCwgaW50IGJ5dGVzTGVmdCkgeworICAgICAgICBpbnQgcmVjQ291bnQgPSAwOworICAgICAgICBib29sZWFuIGVycm9yID0gZmFsc2U7CisKKyAgICAgICAgbUtleVRvUG9zTWFwLmNsZWFyKCk7CisgICAgICAgIHdoaWxlIChieXRlc0xlZnQgPiBrUmVjb3JkSGVhZGVyU2l6ZSkgeworICAgICAgICAgICAgZmluYWwgaW50IHN0YXJ0ID0gcGFyY2VsLmRhdGFQb3NpdGlvbigpOworICAgICAgICAgICAgLy8gQ2hlY2sgdGhlIHNpemUuCisgICAgICAgICAgICBmaW5hbCBpbnQgc2l6ZSA9IHBhcmNlbC5yZWFkSW50KCk7CisKKyAgICAgICAgICAgIGlmIChzaXplIDw9IGtSZWNvcmRIZWFkZXJTaXplKSB7ICAvLyBhdCBsZWFzdCAxIGJ5dGUgc2hvdWxkIGJlIHByZXNlbnQuCisgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVjb3JkIGlzIHRvbyBzaG9ydCIpOworICAgICAgICAgICAgICAgIGVycm9yID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQ2hlY2sgdGhlIG1ldGFkYXRhIGtleS4KKyAgICAgICAgICAgIGZpbmFsIGludCBtZXRhZGF0YUlkID0gcGFyY2VsLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGlmICghY2hlY2tNZXRhZGF0YUlkKG1ldGFkYXRhSWQpKSB7CisgICAgICAgICAgICAgICAgZXJyb3IgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBTdG9yZSB0aGUgcmVjb3JkIG9mZnNldCB3aGljaCBwb2ludHMgdG8gdGhlIHR5cGUKKyAgICAgICAgICAgIC8vIGZpZWxkIHNvIHdlIGNhbiBsYXRlciBvbiByZWFkL3VubWFyc2hhbGwgdGhlIHJlY29yZAorICAgICAgICAgICAgLy8gcGF5bG9hZC4KKyAgICAgICAgICAgIGlmIChtS2V5VG9Qb3NNYXAuY29udGFpbnNLZXkobWV0YWRhdGFJZCkpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJEdXBsaWNhdGUgbWV0YWRhdGEgSUQgZm91bmQiKTsKKyAgICAgICAgICAgICAgICBlcnJvciA9IHRydWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1LZXlUb1Bvc01hcC5wdXQobWV0YWRhdGFJZCwgcGFyY2VsLmRhdGFQb3NpdGlvbigpKTsKKworICAgICAgICAgICAgLy8gQ2hlY2sgdGhlIG1ldGFkYXRhIHR5cGUuCisgICAgICAgICAgICBmaW5hbCBpbnQgbWV0YWRhdGFUeXBlID0gcGFyY2VsLnJlYWRJbnQoKTsKKyAgICAgICAgICAgIGlmIChtZXRhZGF0YVR5cGUgPD0gMCB8fCBtZXRhZGF0YVR5cGUgPiBMQVNUX1RZUEUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJbnZhbGlkIG1ldGFkYXRhIHR5cGUgIiArIG1ldGFkYXRhVHlwZSk7CisgICAgICAgICAgICAgICAgZXJyb3IgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBTa2lwIHRvIHRoZSBuZXh0IG9uZS4KKyAgICAgICAgICAgIHBhcmNlbC5zZXREYXRhUG9zaXRpb24oc3RhcnQgKyBzaXplKTsKKyAgICAgICAgICAgIGJ5dGVzTGVmdCAtPSBzaXplOworICAgICAgICAgICAgKytyZWNDb3VudDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICgwICE9IGJ5dGVzTGVmdCB8fCBlcnJvcikgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmFuIG91dCBvZiBkYXRhIG9yIGVycm9yIG9uIHJlY29yZCAiICsgcmVjQ291bnQpOworICAgICAgICAgICAgbUtleVRvUG9zTWFwLmNsZWFyKCk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENoZWNrIGEgcGFyY2VsIGNvbnRhaW5pbmcgbWV0YWRhdGEgaXMgd2VsbCBmb3JtZWQuIFRoZSBoZWFkZXIKKyAgICAgKiBpcyBjaGVja2VkIGFzIHdlbGwgYXMgdGhlIGluZGl2aWR1YWwgcmVjb3JkcyBmb3JtYXQuIEhvd2V2ZXIsIHRoZQorICAgICAqIGRhdGEgaW5zaWRlIHRoZSByZWNvcmQgaXMgbm90IGNoZWNrZWQgYmVjYXVzZSB3ZSBkbyBsYXp5IGFjY2VzcworICAgICAqICh3ZSBjaGVjay91bm1hcnNoYWxsIG9ubHkgZGF0YSB0aGUgdXNlciBhc2tzIGZvci4pCisgICAgICoKKyAgICAgKiBGb3JtYXQgb2YgYSBtZXRhZGF0YSBwYXJjZWw6CisgICAgIDxwcmU+CisgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgICAgICAgICAgICAyICAgICAgICAgICAgICAgICAgIDMKKyAgICAgIDAgMSAyIDMgNCA1IDYgNyA4IDkgMCAxIDIgMyA0IDUgNiA3IDggOSAwIDEgMiAzIDQgNSA2IDcgOCA5IDAgMQorICAgICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKyAgICAgIHwgICAgICAgICAgICAgICAgICAgICBtZXRhZGF0YSB0b3RhbCBzaXplICAgICAgICAgICAgICAgICAgICAgICB8CisgICAgICArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworICAgICAgfCAgICAgJ00nICAgICAgIHwgICAgICdFJyAgICAgICB8ICAgICAnVCcgICAgICAgfCAgICAgJ0EnICAgICAgIHwKKyAgICAgICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCisgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICAgICAgfCAgICAgICAgICAgICAgICAuLi4uIG1ldGFkYXRhIHJlY29yZHMgLi4uLiAgICAgICAgICAgICAgICAgICAgIHwKKyAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgICAgICArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworICAgICA8L3ByZT4KKyAgICAgKgorICAgICAqIEBwYXJhbSBwYXJjZWwgV2l0aCB0aGUgc2VyaWFsaXplZCBkYXRhLiBNZXRhZGF0YSBrZWVwcyBhCisgICAgICogICAgICAgICAgICAgICByZWZlcmVuY2Ugb24gaXQgdG8gYWNjZXNzIGl0IGxhdGVyIG9uLiBUaGUgY2FsbGVyCisgICAgICogICAgICAgICAgICAgICBzaG91bGQgbm90IG1vZGlmeSB0aGUgcGFyY2VsIGFmdGVyIHRoaXMgY2FsbCAoYW5kCisgICAgICogICAgICAgICAgICAgICBub3QgY2FsbCByZWN5Y2xlIG9uIGl0LikKKyAgICAgKiBAcmV0dXJuIGZhbHNlIGlmIGFuIGVycm9yIG9jY3VycmVkLgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHBhcnNlKFBhcmNlbCBwYXJjZWwpIHsKKyAgICAgICAgaWYgKHBhcmNlbC5kYXRhQXZhaWwoKSA8IGtNZXRhSGVhZGVyU2l6ZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiTm90IGVub3VnaCBkYXRhICIgKyBwYXJjZWwuZGF0YUF2YWlsKCkpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgaW50IHBpbiA9IHBhcmNlbC5kYXRhUG9zaXRpb24oKTsgIC8vIHRvIHJvbGwgYmFjayBpbiBjYXNlIG9mIGVycm9ycy4KKyAgICAgICAgZmluYWwgaW50IHNpemUgPSBwYXJjZWwucmVhZEludCgpOworCisgICAgICAgIC8vIFRoZSBleHRyYSBrSW50MzJTaXplIGJlbG93IGlzIHRvIGFjY291bnQgZm9yIHRoZSBpbnQzMiAnc2l6ZScganVzdCByZWFkLgorICAgICAgICBpZiAocGFyY2VsLmRhdGFBdmFpbCgpICsga0ludDMyU2l6ZSA8IHNpemUgfHwgc2l6ZSA8IGtNZXRhSGVhZGVyU2l6ZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiQmFkIHNpemUgIiArIHNpemUgKyAiIGF2YWlsICIgKyBwYXJjZWwuZGF0YUF2YWlsKCkgKyAiIHBvc2l0aW9uICIgKyBwaW4pOworICAgICAgICAgICAgcGFyY2VsLnNldERhdGFQb3NpdGlvbihwaW4pOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ2hlY2tzIGlmIHRoZSAnTScgJ0UnICdUJyAnQScgbWFya2VyIGlzIHByZXNlbnQuCisgICAgICAgIGZpbmFsIGludCBrU2hvdWxkQmVNZXRhTWFya2VyID0gcGFyY2VsLnJlYWRJbnQoKTsKKyAgICAgICAgaWYgKGtTaG91bGRCZU1ldGFNYXJrZXIgIT0ga01ldGFNYXJrZXIgKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICJNYXJrZXIgbWlzc2luZyAiICsgSW50ZWdlci50b0hleFN0cmluZyhrU2hvdWxkQmVNZXRhTWFya2VyKSk7CisgICAgICAgICAgICBwYXJjZWwuc2V0RGF0YVBvc2l0aW9uKHBpbik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICAvLyBTY2FuIHRoZSByZWNvcmRzIHRvIGNvbGxlY3QgbWV0YWRhdGEgaWRzIGFuZCBvZmZzZXRzLgorICAgICAgICBpZiAoIXNjYW5BbGxSZWNvcmRzKHBhcmNlbCwgc2l6ZSAtIGtNZXRhSGVhZGVyU2l6ZSkpIHsKKyAgICAgICAgICAgIHBhcmNlbC5zZXREYXRhUG9zaXRpb24ocGluKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBtUGFyY2VsID0gcGFyY2VsOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBzZXQgb2YgbWV0YWRhdGEgSUQgZm91bmQuCisgICAgICovCisgICAgcHVibGljIFNldDxJbnRlZ2VyPiBrZXlTZXQoKSB7CisgICAgICAgIHJldHVybiBtS2V5VG9Qb3NNYXAua2V5U2V0KCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiB0cnVlIGlmIGEgdmFsdWUgaXMgcHJlc2VudCBmb3IgdGhlIGdpdmVuIGtleS4KKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBoYXMoZmluYWwgaW50IG1ldGFkYXRhSWQpIHsKKyAgICAgICAgaWYgKCFjaGVja01ldGFkYXRhSWQobWV0YWRhdGFJZCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkludmFsaWQga2V5OiAiICsgbWV0YWRhdGFJZCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1LZXlUb1Bvc01hcC5jb250YWluc0tleShtZXRhZGF0YUlkKTsKKyAgICB9CisKKyAgICAvLyBBY2Nlc3NvcnMuCisgICAgLy8gQ2FsbGVyIG11c3QgbWFrZSBzdXJlIHRoZSBrZXkgaXMgcHJlc2VudCB1c2luZyB0aGUge0Bjb2RlIGhhc30KKyAgICAvLyBtZXRob2Qgb3RoZXJ3aXNlIGEgUnVudGltZUV4Y2VwdGlvbiB3aWxsIG9jY3VyLgorCisgICAgcHVibGljIFN0cmluZyBnZXRTdHJpbmcoZmluYWwgaW50IGtleSkgeworICAgICAgICBjaGVja1R5cGUoa2V5LCBTVFJJTkdfVkFMKTsKKyAgICAgICAgcmV0dXJuIG1QYXJjZWwucmVhZFN0cmluZygpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0SW50KGZpbmFsIGludCBrZXkpIHsKKyAgICAgICAgY2hlY2tUeXBlKGtleSwgSU5URUdFUl9WQUwpOworICAgICAgICByZXR1cm4gbVBhcmNlbC5yZWFkSW50KCk7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gZ2V0Qm9vbGVhbihmaW5hbCBpbnQga2V5KSB7CisgICAgICAgIGNoZWNrVHlwZShrZXksIEJPT0xFQU5fVkFMKTsKKyAgICAgICAgcmV0dXJuIG1QYXJjZWwucmVhZEludCgpID09IDE7CisgICAgfQorCisgICAgcHVibGljIGxvbmcgZ2V0TG9uZyhmaW5hbCBpbnQga2V5KSB7CisgICAgICAgIGNoZWNrVHlwZShrZXksIExPTkdfVkFMKTsKKyAgICAgICAgcmV0dXJuIG1QYXJjZWwucmVhZExvbmcoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgZG91YmxlIGdldERvdWJsZShmaW5hbCBpbnQga2V5KSB7CisgICAgICAgIGNoZWNrVHlwZShrZXksIERPVUJMRV9WQUwpOworICAgICAgICByZXR1cm4gbVBhcmNlbC5yZWFkRG91YmxlKCk7CisgICAgfQorCisgICAgcHVibGljIGJ5dGVbXSBnZXRCeXRlQXJyYXkoZmluYWwgaW50IGtleSkgeworICAgICAgICBjaGVja1R5cGUoa2V5LCBCWVRFX0FSUkFZX1ZBTCk7CisgICAgICAgIHJldHVybiBtUGFyY2VsLmNyZWF0ZUJ5dGVBcnJheSgpOworICAgIH0KKworICAgIHB1YmxpYyBEYXRlIGdldERhdGUoZmluYWwgaW50IGtleSkgeworICAgICAgICBjaGVja1R5cGUoa2V5LCBEQVRFX1ZBTCk7CisgICAgICAgIGZpbmFsIGxvbmcgdGltZVNpbmNlRXBvY2ggPSBtUGFyY2VsLnJlYWRMb25nKCk7CisgICAgICAgIGZpbmFsIFN0cmluZyB0aW1lWm9uZSA9IG1QYXJjZWwucmVhZFN0cmluZygpOworCisgICAgICAgIGlmICh0aW1lWm9uZS5sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IERhdGUodGltZVNpbmNlRXBvY2gpOworICAgICAgICB9IGVsc2UgeworICAgIC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W5SYXdSZXNvdXJjZUZkKAotICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnJhdy5mYWxsYmFja3JpbmcpOwotICAgICAgICAgICAgaWYgKGFmZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgUmluZ3RvbmUgciA9IG5ldyBSaW5ndG9uZShjb250ZXh0KTsKLSAgICAgICAgICAgICAgICByLm9wZW4oYWZkKTsKLSAgICAgICAgICAgICAgICBhZmQuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gcjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIC8vIHdlIHNob3VsZCBuZXZlciBnZXQgaGVyZQotICAgICAgICBMb2cuZShUQUcsICJ1bmFibGUgdG8gZmluZCBhIHVzYWJsZSByaW5ndG9uZSIpOwogICAgICAgICByZXR1cm4gbnVsbDsKICAgICB9CiAgICAgCkBAIC02MjcsMTUgKzYxNSwxNiBAQAogICAgICAqIAogICAgICAqIEBwYXJhbSBjb250ZXh0IEEgY29udGV4dCB1c2VkIGZvciBxdWVyeWluZy4KICAgICAgKiBAcGFyYW0gdHlwZSBUaGUgdHlwZSB3aG9zZSBkZWZhdWx0IHNvdW5kIHNob3VsZCBiZSByZXR1cm5lZC4gT25lIG9mCi0gICAgICogICAgICAgICAgICB7QGxpbmsgI1RZUEVfUklOR1RPTkV9IG9yIHtAbGluayAjVFlQRV9OT1RJRklDQVRJT059LgorICAgICAqICAgICAgICAgICAge0BsaW5rICNUWVBFX1JJTkdUT05FfSwge0BsaW5rICNUWVBFX05PVElGSUNBVElPTn0sIG9yCisgICAgICogICAgICAgICAgICB7QGxpbmsgI1RZUEVfQUxBUk19LgogICAgICAqIEByZXR1cm4gQSB7QGxpbmsgVXJpfSBwb2ludGluZyB0byB0aGUgZGVmYXVsdCBzb3VuZCBmb3IgdGhlIH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RhdGljIHZvaWQKK2FuZHJvaWRfbWVkaWFfTWVkaWFQbGF5ZXJfbmF0aXZlX2luaXQoSk5JRW52ICplbnYpCit7CisgICAgamNsYXNzIGNsYXp6OworCisgICAgY2xhenogPSBlbnYtPkZpbmRDbGFzcygiYW5kcm9pZC9tZWRpYS9NZWRpYVBsYXllciIpOworICAgIGlmIChjbGF6eiA9PSBOVUxMKSB7CisgICAgICAgIGpuaVRocm93RXhjZXB0aW9uKGVudiwgImphdmEvbGFuZy9SdW50aW1lRXhjZXB0aW9uIiwgIkNhbid0IGZpbmQgYW5kcm9pZC9tZWRpYS9NZWRpYVBsYXllciIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgZmllbGRzLmNvbnRleHQgPSBlbnYtPkdldEZpZWxkSUQoY2xhenosICJtTmF0aXZlQ29udGV4dCIsICJJIik7CisgICAgaWYgKGZpZWxkcy5jb250ZXh0ID09IE5VTEwpIHsKKyAgICAgICAgam5pVGhyb3dFeGNlcHRpb24oZW52LCAiamF2YS9sYW5nL1J1bnRpbWVFeGNlcHRpb24iLCAiQ2FuJ3QgZmluZCBNZWRpYVBsYXllci5tTmF0aXZlQ29udGV4dCIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgZmllbGRzLnBvc3RfZXZlbnQgPSBlbnYtPkdldFN0YXRpY01ldGhvZElEKGNsYXp6LCAicG9zdEV2ZW50RnJvbU5hdGl2ZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoTGphdmEvbGFuZy9PYmplY3Q7SUlJTGphdmEvbGFuZy9PYmplY3Q7KVYiKTsKKyAgICBpZiAoZmllbGRzLnBvc3RfZXZlbnQgPT0gTlVMTCkgeworICAgICAgICBqbmlUaHJvd0V4Y2VwdGlvbihlbnYsICJqYXZhL2xhbmcvUnVudGltZUV4Y2VwdGlvbiIsICJDYW4ndCBmaW5kIE1lZGlhUGxheWVyLnBvc3RFdmVudEZyb21OYXRpdmUiKTsK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NjE4LDE5IEBACiAgICAgeyJpc0xvb3BpbmciLCAgICAgICAgICAgIigpWiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX01lZGlhUGxheWVyX2lzTG9vcGluZ30sCiAgICAgeyJzZXRWb2x1bWUiLCAgICAgICAgICAgIihGRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX01lZGlhUGxheWVyX3NldFZvbHVtZX0sCiAgICAgeyJnZXRGcmFtZUF0IiwgICAgICAgICAgIihJKUxhbmRyb2lkL2dyYXBoaWNzL0JpdG1hcDsiLCAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX01lZGlhUGxheWVyX2dldEZyYW1lQXR9LAorICAgIHsibmF0aXZlX2ludm9rZSIsICAgICAgICIoTGFuZHJvaWQvb3MvUGFyY2VsO0xhbmRyb2lkL29zL1BhcmNlbDspSSIsKHZvaWQgKilhbmRyb2lkX21lZGlhX01lZGlhUGxheWVyX2ludm9rZX0sCisgICAgeyJuYXRpdmVfc2V0TWV0YWRhdGFGaWx0ZXIiLCAiKExhbmRyb2lkL29zL1BhcmNlbDspSSIsICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX01lZGlhUGxheWVyX3NldE1ldGFkYXRhRmlsdGVyfSwKKyAgICB7Im5hdGl2ZV9nZXRNZXRhZGF0YSIsICIoWlpMYW5kcm9pZC9vcy9QYXJjZWw7KVoiLCAgICAgICAgICAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTWVkaWFQbGF5ZXJfZ2V0TWV0YWRhdGF9LAorICAgIHsibmF0aXZlX2luaXQiLCAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVBsYXllcl9uYXRpdmVfaW5pdH0sCiAgICAgeyJuYXRpdmVfc2V0dXAiLCAgICAgICAgIihMamF2YS9sYW5nL09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vcmRlci5tU3VyZmFjZSIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgamNsYXNzIHN1cmZhY2UgPSBlbnYtPkZpbmRDbGFzcygiYW5kcm9pZC92aWV3L1N1cmZhY2UiKTsKKyAgICBpZiAoc3VyZmFjZSA9PSBOVUxMKSB7CisgICAgICAgIGpuaVRocm93RXhjZXB0aW9uKGVudiwgImphdmEvbGFuZy9SdW50aW1lRXhjZXB0aW9uIiwgIkNhbid0IGZpbmQgYW5kcm9pZC92aWV3L1N1cmZhY2UiKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGZpZWxkcy5zdXJmYWNlX25hdGl2ZSA9IGVudi0+R2V0RmllbGRJRChzdXJmYWNlLCAibVN1cmZhY2UiLCAiSSIpOworICAgIGlmIChmaWVsZHMuc3VyZmFjZV9uYXRpdmUgPT0gTlVMTCkgeworICAgICAgICBqbmlUaHJvd0V4Y2VwdGlvbihlbnYsICJqYXZhL2xhbmcvUnVudGltZUV4Y2VwdGlvbiIsICJDYW4ndCBmaW5kIFN1cmZhY2UubVN1cmZhY2UiKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGZpZWxkcy5wb3N0X2V2ZW50ID0gZW52LT5HZXRTdGF0aWNNZXRob2RJRChjbGF6eiwgInBvc3RFdmVudEZyb21OYXRpdmUiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvT2JqZWN0O0lJSUxqYXZhL2xhbmcvT2JqZWN0OylWIik7CisgICAgaWYgKGZpZWxkcy5wb3N0X2V2ZW50ID09IE5VTEwpIHsKKyAgICAgICAgam5pVGhyb3dFeGNlcHRpb24oZW52LCAiamF2YS9sYW5nL1J1bnRpbWVFeGNlcHRpb24iLCAiTWVkaWFSZWNvcmRlci5wb3N0RXZlbnRGcm9tTmF0aXZlIik7CisgICAgICAgIHJldHVybjsKKyAgICB9Cit9CisKKwogc3RhdGljIHZvaWQKIGFuZHJvaWRfbWVkaWFfTWVkaWFSZWNvcmRlcl9uYXRpdmVfc2V0dXAoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwgam9iamVjdCB3ZWFrX3RoaXMpCiB7CkBAIC00MTgsNTUgKzQ2NSwxOSBAQAogICAgIHsiZ2V0TWF4QW1wbGl0dWRlIiwgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVJlY29yZGVyX25hdGl2ZV9nZXRNYXhBbXBsaXR1ZGV9LAogICAgIHsic3RhcnQiLCAgICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVJlY29yZGVyX3N0YXJ0fSwKICAgICB7InN0b3AiLCAgICAgICAgICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTWVkaWFSZWNvcmRlcl9zdG9wfSwKLSAgICB7Im5hdGl2ZV9yZXNldCIsICAgICAgICAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilhbmRyb2lkX21lZGlhX01lZGlhUmVjb3JkZXJfbmF0aXZlX3Jlc2V0fSwKKyAgICB7Im5hdGl2ZV9yZXNldCIsICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTWVkaWFSZWNvcmRlcl9uYXRpdmVfcmVzZXR9LAogICAgIHsicmVsZWFzZSIsICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NZWRpYVJlY29yZGVyX3JlbGVhc2V9LAorICAgIHsibmF0aXZlX2luaXQiLCAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2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gICBpZiAoZmllbGRzLnBvc3RfZXZlbnQgPT0gTlVMTCkgewotICAgICAgICBMT0dFKCJDYW4ndCBmaW5kIE1lZGlhUmVjb3JkZXIucG9zdEV2ZW50RnJvbU5hdGl2ZSIpOwotICAgICAgICByZXR1cm4gLTE7Ci0gICAgfQotCiAgICAgcmV0dXJuIEFuZHJvaWRSdW50aW1lOjpyZWdpc3Rlck5hdGl2ZU1ldGhvZHMoZW52LAogICAgICAgICAgICAgICAgICJhbmRyb2lkL21lZGlhL01lZGlhUmVjb3JkZXIiLCBnTWV0aG9kcywgTkVMRU0oZ01ldGhvZHMpKTsKIH0KZGlmZiAtLWdpdCBhL21lZGlhL2puaS9hbmRyb2lkX21lZGlhX01lZGlhU2Nhbm5lci5jcHAgYi9tZWRpYS9qbmkvYW5kcm9pZF9tZWRpYV9NZWRpYVNjYW5uZXIuY3BwCmluZGV4IDg3NjRhNzAuLjZhNTQwNGUgMTAwNjQ0Ci0tLSBhL21lZGlhL2puaS9hbmRyb2lkX21lZGlhX01lZGlhU2Nhbm5lci5jcHAKKysrIGIvbWVkaWEvam5pL2FuZHJvaWRfbWVkaWFfTWVkaWFTY2FubmVyLmNwcApAQCAtNjUsNiArNjUsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0xqYXZhL2xhbmcvU3RyaW5nOylWIik7CiAgICAgICAgICAgICBtU2V0TWltZVR5cGVNZXRob2RJRCA9IGVudi0+R2V0TWV0aG9kSUQobWVkaWFTY2FubmVyQ2xpZW50SW50ZXJmYWNlLCAic2V0TWltZVR5cGUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nOylWIik7CisgICAgICAgICAgICBtQWRkTm9NZWRpYUZvbGRlck1ldGhvZElEID0gZW52LT5HZXRNZXRob2RJRChtZWRpYVNjYW5uZXJDbGllbnRJbnRlcmZhY2UsICJhZGROb01lZGlhRm9sZGVyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZzspViIpOwogICAgICAgICB9CiAgICAgfQogICAgIApAQCAtMTExLDEyICsxMTMsMjYgQEAKICAgICAgICAgcmV0dXJuICghbUVudi0+RXhjZXB0aW9uQ2hlY2soKSk7CiAgICAgfQogCisgICAgLy8gcmV0dXJucyB0cnVlIGlmIGl0IHN1Y2NlZWRlZCwgZmFsc2UgaWYgYW4gZXhjZXB0aW9uIG9jY3VyZWQgaW4gdGhlIEphdmEgY29kZQorICAgIHZpcnR1YWwgYm9vbCBhZGROb01lZGlhRm9sZGVyKGNvbnN0IGNoYXIqIHBhdGgpCisgICAgeworICAgICAgICBqc3RyaW5nIHBhdGhTdHI7CisgICAgICAgIGlmICgocGF0aFN0ciA9IG1FbnYtPk5ld1N0cmluZ1VURihwYXRoKSkgPT0gTlVMTCkgcmV0dXJuIGZhbHNlOworCisgICAgICAgIG1FbnYtPkNhbGxWb2lkTWV0aG9kKG1DbGllbnQsIG1BZGROb01lZGlhRm9sZGVyTWV0aG9kSUQsIHBhdGhTdHIpOworCisgICAgICAgIG1FbnYtPkRlbGV0ZUxvY2FsUmVmKHBhdGhTdHIpOworICAgICAgICByZXR1cm4gKCFtRW52LT5FeGNlcHRpb25DaGVjaygpKTsKKyAgICB9CisKKwogcHJpdmF0ZToKICAgICBKTklFbnYgKm1FbnY7CiAgICAgam9iamVjdCBtQ2xpZW50OwogICAgIGptZXRob2RJRCBtU2NhbkZpbGVNZXRob2RJRDsgCiAgICAgam1ldGhvZElEIG1IYW5kbGVTdHJpbmdUYWdNZXRob2RJRDsgCiAgICAgam1ldGhvZElEIG1TZXRNaW1lVHlwZU1ldGhvZElEOworICAgIGptZXRob2RJRCBtQWRkTm9NZWRpYUZvbGRlck1ldGhvZElEOwogfTsKIAogCkBAIC0yNDEs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CSVQgPyBzaXplb2YoaW50MTZfdCkgOiBzaXplb2YoaW50OF90KSk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgZnJhbWVTaXplSW5CeXRlcyA9IHNpemVvZihpbnQ4X3QpOworICAgIH0KKwogCiAgICAgLy8gV2UgdXNlIDIqIHNpemUgb2YgaW5wdXQgYnVmZmVyIGZvciBwaW5nIHBvbmcgdXNlIG9mIHJlY29yZCBidWZmZXIuCiAgICAgaW50IG1pbkZyYW1lQ291bnQgPSAyICogaW5wdXRCdWZmU2l6ZUluQnl0ZXMgLyBmcmFtZVNpemVJbkJ5dGVzOwpAQCAtMTU3LDExICsxNzMsMTEgQEAKIAogICAgIC8vIG9wZW4gcmVjb3JkIGNoYW5uZWwKICAgICBzdGF0dXNfdCBzdGF0dXM7Ci0gICAgc3A8SUF1ZGlvUmVjb3JkPiByZWNvcmQgPSBhdWRpb0ZsaW5nZXItPm9wZW5SZWNvcmQoZ2V0cGlkKCksIGlucHV0U291cmNlLAorICAgIHNwPElBdWRpb1JlY29yZD4gcmVjb3JkID0gYXVkaW9GbGluZ2VyLT5vcGVuUmVjb3JkKGdldHBpZCgpLCBtSW5wdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwgZm9ybWF0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxDb3VudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZUNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodWludDE2X3QpZmxhZ3MpIDw8IDE2LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHVpbnQxNl90KWZsYWdzKSA8PCAxNiwKICAgICAgICAgICAgICAgIC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ICAgICAgIHJldHVybiBzaXplb2YodWludDhfdCk7CisgICAgfQogfQogCiBpbnQgQXVkaW9SZWNvcmQ6OmlucHV0U291cmNlKCkgY29uc3QKQEAgLTI2MiwxNSArMjgyLDE4IEBACiAgICAgIH0KIAogICAgIGlmIChhbmRyb2lkX2F0b21pY19vcigxLCAmbUFjdGl2ZSkgPT0gMCkgewotICAgICAgICBtTmV3UG9zaXRpb24gPSBtQ2Jsay0+dXNlciArIG1VcGRhdGVQZXJpb2Q7Ci0gICAgICAgIG1DYmxrLT5idWZmZXJUaW1lb3V0TXMgPSBNQVhfUlVOX1RJTUVPVVRfTVM7Ci0gICAgICAgIG1DYmxrLT53YWl0VGltZU1zID0gMDsKLSAgICAgICAgaWYgKHQgIT0gMCkgewotICAgICAgICAgICB0LT5ydW4oIkNsaWVudFJlY29yZFRocmVhZCIsIFRIUkVBRF9QUklPUklUWV9BVURJT19DTElFTlQpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgc2V0cHJpb3JpdHkoUFJJT19QUk9DRVNTLCAwLCBUSFJFQURfUFJJT1JJVFlfQVVESU9fQ0xJRU5UKTsKKyAgICAgICAgcmV0ID0gQXVkaW9TeXN0ZW06OnN0YXJ0SW5wdXQobUlucHV0KTsKKyAgICAgICAgaWYgKHJldCA9PSBOT19FUlJPUikgeworICAgICAgICAgICAgbU5ld1Bvc2l0aW9uID0gbUNibGstPnVzZXIgKyBtVXBkYXRlUGVyaW9kOworICAgICAgICAgICAgbUNibGstPmJ1ZmZlclRpbWVvdXRNcyA9IE1BWF9SVU5fVElNRU9VVF9NUzsKKyAgICAgICAgICAgIG1DYmxrLT53YWl0VGltZU1zID0gMDsKKyAgICAgICAgICAgIGlmICh0ICE9IDApIHsKKyAgICAgICAgICAgICAgIHQtPnJ1bigiQ2xpZW50UmVjb3JkVGhyZWFkIiwgVEhSRUFEX1BSSU9SSVRZX0FVRElPX0NMSUVOVCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgIC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SwgaW9IYW5kbGUpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgT1VUUFVUX09QRU5FRDogeworICAgICAgICBpZiAoZ091dHB1dHMuaW5kZXhPZktleShpb0hhbmRsZSkgPj0gMCkgeworICAgICAgICAgICAgTE9HVigiaW9Db25maWdDaGFuZ2VkKCkgb3BlbmluZyBhbHJlYWR5IGV4aXN0aW5nIG91dHB1dCEgJWQiLCBpb0hhbmRsZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBpZiAocGFyYW0yID09IDApIGJyZWFrOworICAgICAgICBkZXNjID0gKE91dHB1dERlc2NyaXB0b3IgKilwYXJhbTI7CisKKyAgICAgICAgT3V0cHV0RGVzY3JpcHRvciAqb3V0cHV0RGVzYyA9ICBuZXcgT3V0cHV0RGVzY3JpcHRvcigqZGVzYyk7CisgICAgICAgIGdPdXRwdXRzLmFkZChpb0hhbmRsZSwgb3V0cHV0RGVzYyk7CisgICAgICAgIExPR1YoImlvQ29uZmlnQ2hhbmdlZCgpIG5ldyBvdXRwdXQgc2FtcGxpbmdSYXRlICVkLCBmb3JtYXQgJWQgY2hhbm5lbHMgJWQgZnJhbWVDb3VudCAlZCBsYXRlbmN5ICVkIiwKKyAgICAgICAgICAgICAgICBvdXRwdXREZXNjLT5zYW1wbGluZ1JhdGUsIG91dHB1dERlc2MtPmZvcm1hdCwgb3V0cHV0RGVzYy0+Y2hhbm5lbHMsIG91dHB1dERlc2MtPmZyYW1lQ291bnQsIG91dHB1dERlc2MtPmxhdGVuY3kpOworICAgICAgICB9IGJyZWFrOworICAgIGNhc2UgT1VUUFVUX0NMT1NFRDogeworICAgICAgICBpZiAoZ091dHB1dHMuaW5kZXhPZktleShpb0hhbmRsZSkgPCAwKSB7CisgICAgICAgICAgICBMT0dXKCJpb0NvbmZpZ0NoYW5nZWQoKSBjbG9zaW5nIHVua25vdyBvdXRwdXQhICVkIiwgaW9IYW5kbGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgTE9HVigiaW9Db25maWdDaGFuZ2VkKCkgb3V0cHV0ICVkIGNsb3NlZCIsIGlvSGFuZGxlKTsKKworICAgICAgICBnT3V0cHV0cy5yZW1vdmVJdGVtKGlvSGFuZGxlKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IGdTdHJlYW1PdXRwdXRNYXAuc2l6ZSgpIC0gMTsgaSA+PSAwIDsgaS0tKSB7CisgICAgICAgICAgICBpZiAoZ1N0cmVhbU91dHB1dE1hcC52YWx1ZUF0KGkpID09IGlvSGFuZGxlKSB7CisgICAgICAgICAgICAgICAgZ1N0cmVhbU91dHB1dE1hcC5yZW1vdmVJdGVtc0F0KGkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIH0gYnJlYWs7CisKKyAgICBjYXNlIE9VVFBVVF9DT05GSUdfQ0hBTkdFRDogeworICAgICAgICBpbnQgaW5kZXggPSBnT3V0cHV0cy5pbmRleE9mS2V5KGlvSGFuZGxlKTsKKyAgICAgICAgaWYgKGluZGV4IDwgMCkgeworICAgICAgICAgICAgTE9HVygiaW9Db25maWdDaGFuZ2VkKCkgbW9kaWZ5aW5nIHVua25vdyBvdXRwdXQhICVkIiwgaW9IYW5kbGUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHBhcmFtMiA9PSAwKSBicmVhazsKKyAgICAgICAgZGVzYyA9IChPdXRwdXREZXNjcmlwdG9yICopcGFyYW0yOworCisgICAgICAgIExPR1YoImlvQ29uZmlnQ2hhbmdlZCgpIG5ldyBjb25maWcgZm9yIG91dHB1dCAlZCBzYW1wbGluZ1JhdGUgJWQsIGZvcm1hdCAlZCBjaGFubmVscyAlZCBmcmFtZUNvdW50ICVkIGxhdGVuY3kgJWQiLAorICAgICAgICAgICAgICAgIGlvSGFuZGxlLCBkZXNjLT5zYW1wbGluZ1JhdGUsIGRlc2MtPmZvcm1hdCwKKyAgICAgICAgICAg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LmdldCgpID09IDApIHsKKyAgICAgICAgc3A8SVNlcnZpY2VNYW5hZ2VyPiBzbSA9IGRlZmF1bHRTZXJ2aWNlTWFuYWdlcigpOworICAgICAgICBzcDxJQmluZGVyPiBiaW5kZXI7CisgICAgICAgIGRvIHsKKyAgICAgICAgICAgIGJpbmRlciA9IHNtLT5nZXRTZXJ2aWNlKFN0cmluZzE2KCJtZWRpYS5hdWRpb19wb2xpY3kiKSk7CisgICAgICAgICAgICBpZiAoYmluZGVyICE9IDApCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBMT0dXKCJBdWRpb1BvbGljeVNlcnZpY2Ugbm90IHB1Ymxpc2hlZCwgd2FpdGluZy4uLiIpOworICAgICAgICAgICAgdXNsZWVwKDUwMDAwMCk7IC8vIDAuNSBzCisgICAgICAgIH0gd2hpbGUodHJ1ZSk7CisgICAgICAgIGlmIChnQXVkaW9Qb2xpY3lTZXJ2aWNlQ2xpZW50ID09IE5VTEwpIHsKKyAgICAgICAgICAgIGdBdWRpb1BvbGljeVNlcnZpY2VDbGllbnQgPSBuZXcgQXVkaW9Qb2xpY3lTZXJ2aWNlQ2xpZW50KCk7CisgICAgICAgIH0KKyAgICAgICAgYmluZGVyLT5saW5rVG9EZWF0aChnQXVkaW9Qb2xpY3lTZXJ2aWNlQ2xpZW50KTsKKyAgICAgICAgZ0F1ZGlvUG9saWN5U2VydmljZSA9IGludGVyZmFjZV9jYXN0PElBdWRpb1BvbGljeVNlcnZpY2U+KGJpbmRlcik7CisgICAgICAgIGdMb2NrLnVubG9jaygpOworICAgIH0gZWxzZSB7CisgICAgICAgIGdMb2NrLnVubG9jaygpOworICAgIH0KKyAgICByZXR1cm4gZ0F1ZGlvUG9saWN5U2VydmljZTsKK30KKworc3RhdHVzX3QgQXVkaW9TeXN0ZW06OnNldERldmljZUNvbm5lY3Rpb25TdGF0ZShhdWRpb19kZXZpY2VzIGRldmljZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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fTk9ORTsKKyAgICByZXR1cm4gYXBzLT5nZXRGb3JjZVVzZSh1c2FnZSk7Cit9CisKKworYXVkaW9faW9faGFuZGxlX3QgQXVkaW9TeXN0ZW06OmdldE91dHB1dChzdHJlYW1fdHlwZSBzdHJlYW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dF9mbGFncyBmbGFncykKK3sKKyAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQgPSAwOworICAgIGlmICgoZmxhZ3MgJiBBdWRpb1N5c3RlbTo6T1VUUFVUX0ZMQUdfRElSRUNUKSA9PSAwKSB7CisgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChnTG9jayk7CisgICAgICAgIG91dHB1dCA9IEF1ZGlvU3lzdGVtOjpnU3RyZWFtT3V0cHV0TWFwLnZhbHVlRm9yKHN0cmVhbSk7CisgICAgICAgIExPR1ZfSUYoKG91dHB1dCAhPSAwKSwgImdldE91dHB1dCgpIHJlYWQgJWQgZnJvbSBjYWNoZSBmb3Igc3RyZWFtICVkIiwgb3V0cHV0LCBzdHJlYW0pOworICAgIH0KKyAgICBpZiAob3V0cHV0ID09IDApIHsKKyAgICAgICAgY29uc3Qgc3A8SUF1ZGlvUG9saWN5U2VydmljZT4mIGFwcyA9IEF1ZGlvU3lzdGVtOjpnZXRfYXVkaW9fcG9saWN5X3NlcnZpY2UoKTsKKyAgICAgICAgaWYgKGFwcyA9PSAwKSByZXR1cm4gMDsKKyAgICAgICAgb3V0cHV0ID0gYXBzLT5nZXRPdXRwdXQoc3RyZWFtLCBzYW1wbGluZ1JhdGUsIGZvcm1hdCwgY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sZV90IG91dHB1dCkKK3sKKyAgICBjb25zdCBzcDxJQXVkaW9Qb2xpY3lTZXJ2aWNlPiYgYXBzID0gQXVkaW9TeXN0ZW06OmdldF9hdWRpb19wb2xpY3lfc2VydmljZSgpOworICAgIGlmIChhcHMgPT0gMCkgcmV0dXJuOworICAgIGFwcy0+cmVsZWFzZU91dHB1dChvdXRwdXQpOworfQorCithdWRpb19pb19oYW5kbGVfdCBBdWRpb1N5c3RlbTo6Z2V0SW5wdXQoaW50IGlucHV0U291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pbl9hY291c3RpY3MgYWNvdXN0aWNzKQoreworICAgIGNvbnN0IHNwPElBdWRpb1BvbGljeVNlcnZpY2U+JiBhcHMgPSBBdWRpb1N5c3RlbTo6Z2V0X2F1ZGlvX3BvbGljeV9zZXJ2aWNlKCk7CisgICAgaWYgKGFwcyA9PSAwKSByZXR1cm4gMDsKKyAgICByZXR1cm4gYXBzLT5nZXRJbnB1dChpbnB1dFNvdXJjZSwgc2FtcGxpbmdSYXRlLCBmb3JtYXQsIGNoYW5uZWxzLCBhY291c3RpY3MpOworfQorCitzdGF0dXNfdCBBdWRpb1N5c3RlbTo6c3RhcnRJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCkKK3sKKyAgICBjb25zdCBzcDxJQXVkaW9Qb2xpY3lTZXJ2aWNlPiYgYXBzID0gQXVkaW9TeXN0ZW06OmdldF9hdWRpb19wb2xpY3lfc2VydmljZSgpOworICAgIGlmIChhcHMgPT0gMCkgcmV0dXJuIFBFUk1JU1NJT05fREVOSUVEOworICAgIH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WN5U2VydmljZSBzZXJ2ZXIgZGllZCEiKTsKK30KKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworLy8gdXNlIGVtdWxhdGVkIHBvcGNvdW50IG9wdGltaXphdGlvbgorLy8gaHR0cDovL3d3dy5kZi5sdGguc2UvfmpvaG5fZS9nZW1zL2dlbTAwMmQuaHRtbAordWludDMyX3QgQXVkaW9TeXN0ZW06OnBvcENvdW50KHVpbnQzMl90IHUpCit7CisgICAgdSA9ICgodSYweDU1NTU1NTU1KSArICgodT4+MSkmMHg1NTU1NTU1NSkpOworICAgIHUgPSAoKHUmMHgzMzMzMzMzMykgKyAoKHU+PjIpJjB4MzMzMzMzMzMpKTsKKyAgICB1ID0gKCh1JjB4MGYwZjBmMGYpICsgKCh1Pj40KSYweDBmMGYwZjBmKSk7CisgICAgdSA9ICgodSYweDAwZmYwMGZmKSArICgodT4+OCkmMHgwMGZmMDBmZikpOworICAgIHUgPSAoIHUmMHgwMDAwZmZmZikgKyAodT4+MTYpOworICAgIHJldHVybiB1OworfQorCitib29sIEF1ZGlvU3lzdGVtOjppc091dHB1dERldmljZShhdWRpb19kZXZpY2VzIGRldmljZSkKK3sKKyAgICBpZiAoKHBvcENvdW50KGRldmljZSkgPT0gMSApICYmCisgICAgICAgICgoZGV2aWNlICYgfkF1ZGlvU3lzdGVtOjpERVZJQ0VfT1VUX0FMTCkgPT0gMCkpIHsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfSBlbHNlIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KK30KKworYm9vbCBBdWRpb1N5c3RlbTo6aXNJbnB1dERldmljZShhdWRpb19kZXZpY2VzIGRldmljZSkKK3sKKyAgICBpZiAoKHBvcENvdW50KGRldmljZSkgPT0gMSApICYmCisgICAgICAgICgoZGV2aWNlICYgfkF1ZGlvU3lzdGVtOjpERVZJQ0VfSU5fQUxMKSA9PSAwKSkgeworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorfQorCitib29sIEF1ZGlvU3lzdGVtOjppc0EyZHBEZXZpY2UoYXVkaW9fZGV2aWNlcyBkZXZpY2UpCit7CisgICAgaWYgKChwb3BDb3VudChkZXZpY2UpID09IDEgKSAmJgorICAgICAgICAoZGV2aWNlICYgKEF1ZGlvU3lzdGVtOjpERVZJQ0VfT1VUX0JMVUVUT09USF9BMkRQIHwKKyAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6REVWSUNFX09VVF9CTFVFVE9PVEhfQTJEUF9IRUFEUEhPTkVTIHwKKyAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6REVWSUNFX09VVF9CTFVFVE9PVEhfQTJEUF9TUEVBS0VSKSkpIHsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfSBlbHNlIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KK30KKworYm9vbCBBdWRpb1N5c3RlbTo6aXNCbHVldG9vdGhTY29EZXZpY2UoYXVkaW9fZGV2aWNlcyBkZXZpY2UpCit7CisgICAgaWYgKChwb3BDb3VudChkZXZpY2UpID09IDEgKSAmJgorICAgICAgICAoZGV2aWNlICYgKEF1ZGlvU3lzdGVtOjpERVZJQ0VfT1VUX0JMVUVUT09USF9TQ08gfAorICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtOjpERVZJQ0VfT1VUX0JMVUVUT09USF9TQ09fSEVBRFNFVCB8CisgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OkRFVklDRV9PVVRfQkxVRVRPT1RIX1NDT19DQVJLSVQpKSkgeworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorfQorCitib29sIEF1ZGlvU3lzdGVtOjppc0xvd1Zpc2liaWxpdHkoc3RyZWFtX3R5cGUgc3RyZWFtKQoreworICAgIGlmIChzdHJlYW0gPT0gQXVkaW9TeXN0ZW06OlNZU1RFTSB8fCBzdHJlYW0gPT0gQXVkaW9TeXN0ZW06Ok5PVElGSUNBVElPTikgeworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorfQorCitib29sIEF1ZGlvU3lzdGVtOjppc0lucHV0Q2hhbm5lbCh1aW50MzJfdCBjaGFubmVsKQoreworICAgIGlmICgoY2hhbm5lbCAmIH5BdWRpb1N5c3RlbTo6Q0hBTk5FTF9JTl9BTEwpID09IDApIHsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfSBlbHNlIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KK30KKworYm9vbCBBdWRpb1N5c3RlbTo6aXNPdXRwdXRDaGFubmVsKHVpbnQzMl90IGNoYW5uZWwpCit7CisgICAgaWYgKChjaGFubmVsICYgfkF1ZGlvU3lzdGVtOjpDSEFOTkVMX09VVF9BTEwpID09IDApIHsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfSBlbHNlIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KK30KKworYm9vbCBBdWRpb1N5c3RlbTo6aXNWYWxpZEZvcm1hdCh1aW50MzJfdCBmb3JtYXQpCit7CisgICAgc3dpdGNoIChmb3JtYXQgJiBNQUlOX0ZPUk1BVF9NQVNLKSB7CisgICAgY2FzZSAgICAgICAgIFBDTToKKyAgICBjYXNlICAgICAgICAgTVAzOgorICAgIGNhc2UgICAgICAgICBBTVJfTkI6CisgICAgY2FzZSAgICAgICAgIEFNUl9XQjoKKyAgICBjYXNlICAgICAgICAgQUFDOgorICAgIGNhc2UgICAgICAgICBIRV9BQUNfVjE6CisgICAgY2FzZSAgICAgICAgIEhFX0FBQ19WMjoKK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c3RyY3B5KHN0ciwga2V5VmFsdWVQYWlycy5zdHJpbmcoKSk7CisgICAgY2hhciAqcGFpciA9IHN0cnRvayhzdHIsICI7Iik7CisgICAgd2hpbGUgKHBhaXIgIT0gTlVMTCkgeworICAgICAgICBpZiAoc3RybGVuKHBhaXIpICE9IDApIHsKKyAgICAgICAgICAgIHNpemVfdCBlcUlkeCA9IHN0cmNzcG4ocGFpciwgIj0iKTsKKyAgICAgICAgICAgIFN0cmluZzgga2V5ID0gU3RyaW5nOChwYWlyLCBlcUlkeCk7CisgICAgICAgICAgICBTdHJpbmc4IHZhbHVlOworICAgICAgICAgICAgaWYgKGVxSWR4ID09IHN0cmxlbihwYWlyKSkgeworICAgICAgICAgICAgICAgIHZhbHVlID0gU3RyaW5nOCgiIik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHZhbHVlID0gU3RyaW5nOChwYWlyICsgZXFJZHggKyAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtUGFyYW1ldGVycy5pbmRleE9mS2V5KGtleSkgPCAwKSB7CisgICAgICAgICAgICAgICAgbVBhcmFtZXRlcnMuYWRkKGtleSwgdmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtUGFyYW1ldGVycy5yZXBsYWNlVmFsdWVGb3Ioa2V5LCB2YWx1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMT0dWKCJBdWRpb1BhcmFtZXRlcigpIGNzdG9yIGVtcHR5IGtleSB2YWx1ZSBwYWlyIik7CisgICAgICAgIH0KKyAgICAgICAgcGFpciA9IHN0cnRvayhOVUxMLCAiOyIpOworICAgIH0KKworICAgIGRlbGV0ZVtdIHN0cjsKK30KKworQXVkaW9QYXJhbWV0ZXI6On5BdWRpb1BhcmFtZXRlcigpCit7CisgICAgbVBhcmFtZXRlcnMuY2xlYXIoKTsKK30KKworU3RyaW5nOCBBdWRpb1BhcmFtZXRlcjo6dG9TdHJpbmcoKQoreworICAgIFN0cmluZzggc3RyID0gU3RyaW5nOCgiIik7CisKKyAgICBzaXplX3Qgc2l6ZSA9IG1QYXJhbWV0ZXJzLnNpemUoKTsKKyAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHNpemU7IGkrKykgeworICAgICAgICBzdHIgKz0gbVBhcmFtZXRlcnMua2V5QXQoaSk7CisgICAgICAgIHN0ciArPSAiPSI7CisgICAgICAgIHN0ciArPSBtUGFyYW1ldGVycy52YWx1ZUF0KGkpOworICAgICAgICBpZiAoaSA8IChzaXplIC0gMSkpIHN0ciArPSAiOyI7CisgICAgfQorICAgIHJldHVybiBzdHI7Cit9CisKK3N0YXR1c190IEF1ZGlvUGFyYW1ldGVyOjphZGQoY29uc3QgU3RyaW5nOCYga2V5LCBjb25zdCBTdHJpbmc4JiB2YWx1ZSkKK3sKKyAgICBpZiAobVBhcmFtZXRlcnMuaW5kZXhPZktleShrZXkpIDwgMCkgeworICAgICAgICBtUGFyYW1ldGVycy5hZGQoa2V5LCB2YWx1ZSk7CisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9IGVsc2UgeworICAgICAgICBtUGFyYW1ldGVycy5yZXBsYWNlVmFsdWVGb3Ioa2V5LCB2YWx1ZSk7CisgICAgICAgIHJldHVybiBBTFJFQURZX0VYSVNUUzsKKyAgICB9Cit9CisKK3N0YXR1c190IEF1ZGlvUGFyYW1ldGVyOjphZGRJbnQoY29uc3QgU3RyaW5nOCYga2V5LCBjb25zdCBpbnQgdmFsdWUpCit7CisgICAgY2hhciBzdHJbMTJdOworICAgIGlmIChzbnByaW50ZihzdHIsIDEyLCAiJWQiLCB2YWx1ZSkgPiAwKSB7CisgICAgICAgIFN0cmluZzggc3RyOCA9IFN0cmluZzgoc3RyKTsKKyAgICAgICAgcmV0dXJuIGFkZChrZXksIHN0cjgpOworICAgIH0gZWxzZSB7CisgICAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgfQorfQorCitzdGF0dXNfdCBBdWRpb1BhcmFtZXRlcjo6YWRkRmxvYXQoY29uc3QgU3RyaW5nOCYga2V5LCBjb25zdCBmbG9hdCB2YWx1ZSkKK3sKKyAgICBjaGFyIHN0clsyM107CisgICAgaWYgKHNucHJpbnRmKHN0ciwgMjMsICIlLjEwZiIsIHZhbHVlKSA+IDApIHsKKyAgICAgICAgU3RyaW5nOCBzdHI4ID0gU3RyaW5nOChzdHIpOworICAgICAgICByZXR1cm4gYWRkKGtleSwgc3RyOCk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKKyAgICB9Cit9CisKK3N0YXR1c190IEF1ZGlvUGFyYW1ldGVyOjpyZW1vdmUoY29uc3QgU3RyaW5nOCYga2V5KQoreworICAgIGlmIChtUGFyYW1ldGVycy5pbmRleE9mS2V5KGtleSkgPj0gMCkgeworICAgICAgICBtUGFyYW1ldGVycy5yZW1vdmVJdGVtKGtleSk7CisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgIH0KK30KKworc3RhdHVzX3QgQXVkaW9QYXJhbWV0ZXI6OmdldChjb25zdCBTdHJpbmc4JiBrZXksIFN0cmluZzgmIHZhbHVlKQoreworICAgIGlmIChtUGFyYW1ldGVycy5pbmRleE9mS2V5KGtleSkgPj0gMCkgeworICAgICAgICB2YWx1ZSA9IG1QYXJhbWV0ZXJzLnZhbHVlRm9yKGtleSk7CisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgIH0KK30KKworc3RhdHVzX3QgQXVkaW9QYXJhbWV0ZXI6OmdldEludChjb25zdCBTdHJpbmc4JiBrZXksIGludCYgdmFsdWUpCit7CisgICAgU3RyaW5nOCBzdHI4OworICAgIHN0YXR1c190IHJlc3VsdCA9IGdldChrZXksIHN0cjgpOworICAgIHZhbHVlID0gMDsKKyAgICBpZiAocmVzdWx0ID09IE5PX0VSUk9SKSB7CisgICAgICAgIGludCB2YWw7CisgICAgICAgIGlmIChzc2NhbmYoc3RyOC5zdHJpbmcoKSwgIiVkIiwgJnZhbCkgPT0gMSkgeworICAgICAgICAgICAgdmFsdWUgPSB2YWw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXN1bHQgPSBJTlZBTElEX09QRVJBVElPTjsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gcmVzdWx0OworfQorCitzdGF0dXNfdCBBdWRpb1BhcmFtZXRlcjo6Z2V0RmxvYXQoY29uc3QgU3RyaW5nOCYga2V5LCBmbG9hdCYgdmFsdWUpCit7CisgICAgU3RyaW5nOCBzdHI4OworICAgIHN0YXR1c190IHJlc3VsdCA9IGdldChrZXksIHN0cjgpOworICAgIHZhbHVlID0gMDsKKyAgICBpZiAocmVzdWx0ID09IE5PX0VSUk9SKSB7CisgICAgICAgIGZsb2F0IHZhbDsKKyAgICAgICAgaWYgKHNzY2FuZihzdHI4LnN0cmluZygpLCAiJWYiLCAmdmFsKSA9PSAxKSB7CisgICAgICAgICAgICB2YWx1ZSA9IHZhbDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IElOVkFMSURfT1BFUkFUSU9OOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiByZXN1bHQ7Cit9CisKK3N0YXR1c190IEF1ZGlvUGFyYW1ldGVyOjpnZXRBdChzaXplX3QgaW5kZXgsIFN0cmluZzgmIGtleSwgU3RyaW5nOCYgdmFsdWUpCit7CisgICAgaWYgKG1QYXJhbWV0ZXJzLnNpemUoKSA+IGluZGV4KSB7CisgICAgICAgIGtleSA9IG1QYXJhbWV0ZXJzLmtleUF0KGluZGV4KTsKKyAgICAgICAgdmFsdWUgPSBtUGFyYW1ldGVycy52YWx1ZUF0KGluZGV4KTsKKyAgICAgICAgcmV0dXJuIE5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CBmcmFtZUNvdW50KTsKLSAgICAgIHJldHVybiBCQURfVkFMVUU7CisgICAgICAgIGludCBtaW5GcmFtZUNvdW50ID0gKGFmRnJhbWVDb3VudCpzYW1wbGVSYXRlKm1pbkJ1ZkNvdW50KS9hZlNhbXBsZVJhdGU7CisKKyAgICAgICAgaWYgKHNoYXJlZEJ1ZmZlciA9PSAwKSB7CisgICAgICAgICAgICBpZiAoZnJhbWVDb3VudCA9PSAwKSB7CisgICAgICAgICAgICAgICAgZnJhbWVDb3VudCA9IG1pbkZyYW1lQ291bnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobm90aWZpY2F0aW9uRnJhbWVzID09IDApIHsKKyAgICAgICAgICAgICAgICBub3RpZmljYXRpb25GcmFtZXMgPSBmcmFtZUNvdW50LzI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhhdCBhcHBsaWNhdGlvbiBpcyBub3RpZmllZCB3aXRoIHN1ZmZpY2llbnQgbWFyZ2luCisgICAgICAgICAgICAvLyBiZWZvcmUgdW5kZXJydW4KKyAgICAgICAgICAgIGlmIChub3RpZmljYXRpb25GcmFtZXMgPiBmcmFtZUNvdW50LzIpIHsKKyAgICAgICAgICAgICAgICBub3RpZmljYXRpb25GcmFtZXMgPSBmcmFtZUNvdW50LzI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZnJhbWVDb3VudCA8IG1pbkZyYW1lQ291bnQpIHsKKyAgICAgICAgICAgICAgTE9HRSgiSW52YWxpZCBidWZmZXIgc2l6ZTogbWluRnJhbWVDb3VudCAlZCwgZnJhbWVDb3VudCAlZCIsIG1pbkZyYW1lQ291bnQsIGZyYW1lQ291bnQpOworICAgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gRW5zdXJlIHRoYXQgYnVmZmVyIGFsaWdubWVudCBtYXRjaGVzIGNoYW5uZWxjb3VudAorICAgICAgICAgICAgaWYgKCgodWludDMyX3Qpc2hhcmVkQnVmZmVyLT5wb2ludGVyKCkgJiAoY2hhbm5lbENvdW50IHwgMSkpICE9IDApIHsKKyAgICAgICAgICAgICAgICBMT0dFKCJJbnZhbGlkIGJ1ZmZlciBhbGlnbmVtZW50OiBhZGRyZXNzICVwLCBjaGFubmVsQ291bnQgJWQiLCBzaGFyZWRCdWZmZXItPnBvaW50ZXIoKSwgY2hhbm5lbENvdW50KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnJhbWVDb3VudCA9IHNoYXJlZEJ1ZmZlci0+c2l6ZSgpL2NoYW5uZWxDb3VudC9zaXplb2YoaW50MTZfdCk7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvLyBjcmVhdGUgdGhlIHRyYWNrCiAgICAgc3RhdHVzX3Qgc3RhdHVzOwogICAgIHNwPElBdWRpb1RyYWNrPiB0cmFjayA9IGF1ZGlvRmxpbmdlci0+Y3JlYXRlVHJhY2soZ2V0cGlkKCksCi0gICAgICAgICAgICAgICAgc3RyZWFtVHlwZSwgc2FtcGxlUmF0ZSwgZm9ybWF0LCBjaGFubmVsQ291bnQsIGZyYW1lQ291bnQsIGZsYWdzLCBzaGFyZWRCdWZmZXIsICZzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZVJhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsQ291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZUNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1aW50MTZfdClmbGFncykgPDwgMTYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZWRCdWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhdHVzKTsKIAogICAgIGlmICh0cmFjayA9PSAwKSB7CiAgICAgICAgIExPR0UoIkF1ZGlvRmxpbmdlciBjb3VsZCBub3QgY3JlYXRlIHRyYWNrLCBzdGF0dXM6ICVkIiwgc3RhdHVzKTsKQEAgLTI0NSw2ICsyNjcsNyBAQAogICAgIG1Wb2x1bWVbUklHSFRdID0gMS4wZjsKICAgICBtU3RyZWFtVHlwZSA9IHN0cmVhbVR5cGU7CiAgICAgbUZvcm1hdCA9IGZvcm1hdDsKKyAgICBtQ2hhbm5lbHMgPSBjaGFubmVsczsKICAgICBtQ2hhbm5lbENvdW50ID0gY2hhbm5lbENvdW50OwogICAgIG1TaGFyZWRCdWZmZXIgPSBzaGFyZWRCdWZmZXI7CiAgICAgbU11dGVkID0gZmFsc2U7CkBAIC0yNTksNiArMjgyLDcgQEAKICAgICBtTWFya2VyUmVhY2hlZCA9IGZhbHNlOwogICAgIG1OZXdQb3NpdGlvbiA9IDA7CiAgICAgbVVwZGF0ZVBlcmlvZCA9IDA7CisgICAgbUZsYWdzID0gZmxhZ3M7CiAKICAgICByZXR1cm4gTk9fRVJST1I7CiB9CkBAIC0yOTcsNyArMzIxLDExIEBACiAKIGludCBBdWRpb1RyYWNrOjpmcmFtZVNpemUoKSBjb25zdAogewotICAgIHJldHVybiBjaGFubmVsQ291bnQoKSooKGZvcm1hdCgpID09IEF1ZGlv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2NDQsNyBAQAogICAgICAgICAgICAgICAgIHJldHVybiBXT1VMRF9CTE9DSzsKICAgICAgICAgICAgIHRpbWVvdXQgPSAwOwogICAgICAgICAgICAgcmVzdWx0ID0gY2Jsay0+Y3Yud2FpdFJlbGF0aXZlKGNibGstPmxvY2ssIG1pbGxpc2Vjb25kcyh3YWl0VGltZU1zKSk7Ci0gICAgICAgICAgICBpZiAoX19idWlsdGluX2V4cGVjdChyZXN1bHQhPU5PX0VSUk9SLCBmYWxzZSkpIHsgCisgICAgICAgICAgICBpZiAoX19idWlsdGluX2V4cGVjdChyZXN1bHQhPU5PX0VSUk9SLCBmYWxzZSkpIHsKICAgICAgICAgICAgICAgICBjYmxrLT53YWl0VGltZU1zICs9IHdhaXRUaW1lTXM7CiAgICAgICAgICAgICAgICAgaWYgKGNibGstPndhaXRUaW1lTXMgPj0gY2Jsay0+YnVmZmVyVGltZW91dE1zKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIHRpbWluZyBvdXQgd2hlbiBhIGxvb3AgaGFzIGJlZW4gc2V0IGFuZCB3ZSBoYXZlIGFscmVhZHkgd3JpdHRlbiB1cHRvIGxvb3AgZW5kCkBAIC02MTYsNyArNjUyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKGNibGstPnVzZXIgPCBjYmxrLT5sb29wRW5kKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMT0dXKCAgICJvYnRhaW5CdWZmZXIgdGltZWQgb3V0IChpcyB0aGUgQ1BVIHBlZ2dlZD8pICVwICIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInVzZXI9JTA4eCwgc2VydmVyPSUwOHgiLCB0aGlzLCBjYmxrLT51c2VyLCBjYmxrLT5zZXJ2ZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgLy91bmxvY2sgY2JsayBtdXRleCBiZWZvcmUgY2FsbGluZyBtQXVkaW9UcmFjay0+c3RhcnQoKSAoc2VlIGlzc3VlICMxNjE3MTQwKSAKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vdW5sb2NrIGNibGsgbXV0ZXggYmVmb3JlIGNhbGxpbmcgbUF1ZGlvVHJhY2stPnN0YXJ0KCkgKHNlZSBpc3N1ZSAjMTYxNzE0MCkKICAgICAgICAgICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBtQXVkaW9UcmFjay0+c3RhcnQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGNibGstPmxvY2subG9jaygpOwpAQCAtNjI0LDcgKzY2MCw3IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgY2Jsay0+d2FpdFRpbWVNcyA9IDA7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgaWYgKC0td2FpdENvdW50ID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFRJTUVEX09VVDsKICAgICAgICAgICAgICAgICB9CkBAIC02MzYsNyArNjcyLDcgQEAKICAgICB9CiAKICAgICBjYmxrLT53YWl0VGltZU1zID0gMDsKLSAgICAKKwogICAgIGlmIChmcmFtZXNSZXEgPiBmcmFtZXNBdmFpbCkgewogICAgICAgICBmcmFtZXNSZXEgPSBmcmFtZXNBdmFpbDsKICAgICB9CkBAIC02NTMsMTIgKzY4OSwxNiBAQAogICAgICAgICAiYnV0IGRpZG4ndCBuZWVkIHRvIGJlIGxvY2tlZC4gV2UgcmVjb3ZlcmVkLCBidXQgIgogICAgICAgICAidGhpcyBzaG91bGRuJ3QgaGFwcGVuICh1c2VyPSUwOHgsIHNlcnZlcj0lMDh4KSIsIGNibGstPnVzZXIsIGNibGstPnNlcnZlcik7CiAKLSAgICBhdWRpb0J1ZmZlci0+ZmxhZ3MgICAgICAgPSBtTXV0ZWQgPyBCdWZmZXI6Ok1VVEUgOiAwOwotICAgIGF1ZGlvQnVmZmVyLT5jaGFubmVsQ291bnQ9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sKICAgICAgICAgICAgIH0KLSAgICAgICAgfWVsc2UgeworICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgdG9Xcml0ZSA9IGF1ZGlvQnVmZmVyLnNpemU7CiAgICAgICAgICAgICBtZW1jcHkoYXVkaW9CdWZmZXIuaTgsIHNyYywgdG9Xcml0ZSk7CiAgICAgICAgICAgICBzcmMgKz0gdG9Xcml0ZTsKQEAgLTc0MiwxMyArNzgxLDEzIEBACiAgICAgICAgIGlmIChtQ2Jsay0+Zmxvd0NvbnRyb2xGbGFnID09IDApIHsKICAgICAgICAgICAgIG1DYmYoRVZFTlRfVU5ERVJSVU4sIG1Vc2VyRGF0YSwgMCk7CiAgICAgICAgICAgICBpZiAobUNibGstPnNlcnZlciA9PSBtQ2Jsay0+ZnJhbWVDb3VudCkgewotICAgICAgICAgICAgICAgIG1DYmYoRVZFTlRfQlVGRkVSX0VORCwgbVVzZXJEYXRhLCAwKTsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgbUNiZihFVkVOVF9CVUZGRVJfRU5ELCBtVXNlckRhdGEsIDApOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgbUNibGstPmZsb3dDb250cm9sRmxhZyA9IDE7CiAgICAgICAgICAgICBpZiAobVNoYXJlZEJ1ZmZlciAhPSAwKSByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvLyBNYW5hZ2UgbG9vcCBlbmQgY2FsbGJhY2sKICAgICB3aGlsZSAobUxvb3BDb3VudCA+IG1DYmxrLT5sb29wQ291bnQpIHsKICAgICAgICAgaW50IGxvb3BDb3VudCA9IC0xOwpAQCAtNzY3LDcgKzgwNiw3IEBACiAgICAgfQogCiAgICAgLy8gTWFuYWdlIG5ldyBwb3NpdGlvbiBjYWxsYmFjawotICAgIGlmKG1VcGRhdGVQZXJpb2QgPiAwKSB7CisgICAgaWYgKG1VcGRhdGVQZXJpb2QgPiAwKSB7CiAgICAgICAgIHdoaWxlICh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UX1NUUkVBTV9PVVRQVVQKIH07CiAKIGNsYXNzIEJwQXVkaW9GbGluZ2VyIDogcHVibGljIEJwSW50ZXJmYWNlPElBdWRpb0ZsaW5nZXI+CkBAIC03NCw2ICs3OSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG91dHB1dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cykKICAgICB7CiAgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKQEAgLTg2LDYgKzkyLDcgQEAKICAgICAgICAgZGF0YS53cml0ZUludDMyKGZyYW1lQ291bnQpOwogICAgICAgICBkYXRhLndyaXRlSW50MzIoZmxhZ3MpOwogICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKHNoYXJlZEJ1ZmZlci0+YXNCaW5kZXIoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihvdXRwdXQpOwogICAgICAgICBzdGF0dXNfdCBsU3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KENSRUFURV9UUkFDSywgZGF0YSwgJnJlcGx5KTsKICAgICAgICAgaWYgKGxTdGF0dXMgIT0gTk9fRVJST1IpIHsKICAgICAgICAgICAgIExPR0UoImNyZWF0ZVRyYWNrIGVycm9yOiAlcyIsIHN0cmVycm9yKC1sU3RhdHVzKSk7CkBAIC05OSw3ICsxMDYsNyBAQAogCiAgICAgdmlydHVhbCBzcDxJQXVkaW9SZWNvcmQ+IG9wZW5SZWNvcmQoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpZF90IHBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0U291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5wdXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQsCkBAIC0xMTAsNyArMTE3LDcgQEAKICAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwogICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvRmxpbmdlcjo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKICAgICAgICAgZGF0YS53cml0ZUludDMyKHBpZCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihpbnB1dFNvdXJjZSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihpbnB1dCk7CiAgICAgICAgIGRhdGEud3JpdGVJbnQzMihzYW1wbGVSYXRlKTsKICAgICAgICAgZGF0YS53cml0ZUludDMyKGZvcm1hdCk7CiAgICAgICAgIGRhdGEud3JpdGVJbnQzMihjaGFubmVsQ291bnQpOwpAQCAtMjAzLDEyICsyMTAsMTMgQEAKICAgICAgICAgcmV0dXJuIHJlcGx5LnJlYWRJbnQzMigpOwogICAgIH0KIAotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0U3RyZWFtVm9sdW1lKGludCBzdHJlYW0sIGZsb2F0IHZhbHVlKQorICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0U3RyZWFtVm9sdW1lKGludCBzdHJlYW0sIGZsb2F0IHZhbHVlLCBpbnQgb3V0cHV0KQogICAgIHsKICAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwogICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvRmxp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UFVUQlVGRkVSU0laRSwgZGF0YSwgJnJlcGx5KTsKICAgICAgICAgcmV0dXJuIHJlcGx5LnJlYWRJbnQzMigpOwogICAgIH0KLSAgICAKLSAgICB2aXJ0dWFsIHZvaWQgd2FrZVVwKCkKKworICAgIHZpcnR1YWwgaW50IG9wZW5PdXRwdXQodWludDMyX3QgKnBEZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwU2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBMYXRlbmN5TXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MpCiAgICAgewogICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIHVpbnQzMl90IGRldmljZXMgPSBwRGV2aWNlcyA/ICpwRGV2aWNlcyA6IDA7CisgICAgICAgIHVpbnQzMl90IHNhbXBsaW5nUmF0ZSA9IHBTYW1wbGluZ1JhdGUgPyAqcFNhbXBsaW5nUmF0ZSA6IDA7CisgICAgICAgIHVpbnQzMl90IGZvcm1hdCA9IHBGb3JtYXQgPyAqcEZvcm1hdCA6IDA7CisgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gcENoYW5uZWxzID8gKnBDaGFubmVscyA6IDA7CisgICAgICAgIHVpbnQzMl90IGxhdGVuY3kgPSBwTGF0ZW5jeU1zID8gKnBMYXRlbmN5TXMgOiAwOworCiAgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9GbGluZ2VyOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoV0FLRV9VUCwgZGF0YSwgJnJlcGx5LCBJQmluZGVyOjpGTEFHX09ORVdBWSk7Ci0gICAgICAgIHJldHVybjsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGRldmljZXMpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoc2FtcGxpbmdSYXRlKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGZvcm1hdCk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihjaGFubmVscyk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihsYXRlbmN5KTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGZsYWdzKTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KE9QRU5fT1VUUFVULCBkYXRhLCAmcmVwbHkpOworICAgICAgICBpbnQgIG91dHB1dCA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBMT0dWKCJvcGVuT3V0cHV0KCkgcmV0dXJuZWQgb3V0cHV0LCAlcCIsIG91dHB1dCk7CisgICAgICAgIGRldmljZXMgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgaWYgKHBEZXZpY2VzKSAqcERldmljZXMgPSBkZXZpY2VzOworICAgICAgICBzYW1wbGluZ1JhdGUgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgaWYgKHBTYW1wbGluZ1JhdGUpICpwU2FtcGxpbmdSYXRlID0gc2FtcGxpbmdSYXRlOworICAgICAgICBmb3JtYXQgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgaWYgKHBGb3JtYXQpICpwRm9ybWF0ID0gZm9ybWF0OworICAgICAgICBjaGFubmVscyA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBpZiAocENoYW5uZWxzKSAqcENoYW5uZWxzID0gY2hhbm5lbHM7CisgICAgICAgIGxhdGVuY3kgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgaWYgKHBMYXRlbmN5TXMpICpwTGF0ZW5jeU1zID0gbGF0ZW5jeTsKKyAgICAgICAgc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wdXQoaW50IG91dHB1dCkKKyAgICB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb0ZsaW5nZXI6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihvdXRwdXQpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoU1VTUEVORF9PVVRQVVQsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IHJlc3RvcmVPdXRwdXQoaW50IG91dHB1dCkKKyAgICB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb0ZsaW5nZXI6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihvdXRwdXQpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoUkVTVE9SRV9PVVRQVVQsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKKyAgICB9CisKKyAgICB2aXJ0dWFsIGludCBvcGVuSW5wdXQodWludDMyX3QgKnBEZXZpY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwU2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgYWNvdXN0aWNzKQorICAgIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICB1aW50MzJfdCBkZXZpY2VzID0gcERldmljZXMgPyAqcERldmljZXMgOiAwOworICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSBwU2FtcGxpbmdSYXRlID8gKnBTYW1wbGluZ1JhdGUgOiAwOworICAgICAgICB1aW50MzJfdCBmb3JtYXQgPSBwRm9ybWF0ID8gKnBGb3JtYXQgOiAwOworICAgICAgICB1aW50MzJfdCBjaGFubmVscyA9IHBDaGFubmVscyA/ICpwQ2hhbm5lbHMgOiAwOworCisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9GbGluZ2VyOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoZGV2aWNlcyk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihzYW1wbGluZ1JhdGUpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoZm9ybWF0KTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGNoYW5uZWxzKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGFjb3VzdGljcyk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChPUEVOX0lOUFVULCBkYXRhLCAmcmVwbHkpOworICAgICAgICBpbnQgaW5wdXQgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgZGV2aWNlcyA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBpZiAocERldmljZXMpICpwRGV2aWNlcyA9IGRldmljZXM7CisgICAgICAgIHNhbXBsaW5nUmF0ZSA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBpZiAocFNhbXBsaW5nUmF0ZSkgKnBTYW1wbGluZ1JhdGUgPSBzYW1wbGluZ1JhdGU7CisgICAgICAgIGZvcm1hdCA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBpZiAocEZvcm1hdCkgKnBGb3JtYXQgPSBmb3JtYXQ7CisgICAgICAgIGNoYW5uZWxzID0gcmVwbHkucmVhZEludDMyKCk7Cis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GFubmVsQ291bnQsIGJ1ZmZlckNvdW50LCBmbGFncywgYnVmZmVyLCBvdXRwdXQsICZzdGF0dXMpOwogICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcih0cmFjay0+YXNCaW5kZXIoKSk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CkBAIC0zODQsMTQgKzQ3OCwxNCBAQAogICAgICAgICBjYXNlIE9QRU5fUkVDT1JEOiB7CiAgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwogICAgICAgICAgICAgcGlkX3QgcGlkID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGludCBpbnB1dFNvdXJjZSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBpbnQgaW5wdXQgPSBkYXRhLnJlYWRJbnQzMigpOwogICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSA9IGRhdGEucmVhZEludDMyKCk7CiAgICAgICAgICAgICBpbnQgZm9ybWF0ID0gZGF0YS5yZWFkSW50MzIoKTsKICAgICAgICAgICAgIGludCBjaGFubmVsQ291bnQgPSBkYXRhLnJlYWRJbnQzMigpOwogICAgICAgICAgICAgc2l6ZV90IGJ1ZmZlckNvdW50ID0gZGF0YS5yZWFkSW50MzIoKTsKICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gZGF0YS5yZWFkSW50MzIoKTsKICAgICAgICAgICAgIHN0YXR1c190IHN0YXR1czsKLSAgICAgICAgICAgIHNwPElBdWRpb1JlY29yZD4gcmVjb3JkID0gb3BlblJlY29yZChwaWQsIGlucHV0U291cmNlLAorICAgICAgICAgICAgc3A8SUF1ZGlvUmVjb3JkPiByZWNvcmQgPSBvcGVuUmVjb3JkKHBpZCwgaW5wdXQsCiAgICAgICAgICAgICAgICAgICAgIHNhbXBsZVJhdGUsIGZvcm1hdCwgY2hhbm5lbENvdW50LCBidWZmZXJDb3VudCwgZmxhZ3MsICZzdGF0dXMpOwogICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcihyZWNvcmQtPmFzQmluZGVyKCkpOwpAQCAtMzk5LDMyICs0OTMsMjcgQEAKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBTQU1QTEVfUkFURTogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCBvdXRwdXQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIHNhbXBsZVJhdGUob3V0cHV0KSApOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIHNhbXBsZVJhdGUoZGF0YS5yZWFkSW50MzIoKSkgKTsKICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBDSEFOTkVMX0NPVU5UOiB7CiAgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IG91dHB1dCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggY2hhbm5lbENvdW50KG91dHB1dCkgKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBjaGFubmVsQ291bnQoZGF0YS5yZWFkSW50MzIoKSkgKTsKICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBGT1JNQVQ6IHsKICAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgb3V0cHV0ID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBmb3JtYXQob3V0cHV0KSApOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIGZvcm1hdChkYXRhLnJlYWRJbnQzMigpKSApOwogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICB9IGJyZWFrOwogICAgICAgICBjYXNlIEZSQU1FX0NPVU5UOiB7CiAgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IG91dHB1dCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggZnJhbWVDb3VudChvdXRwdXQpICk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggZnJhbWVDb3VudChkYXRhLnJlYWRJbnQzMigpKSApOwogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICB9IGJyZWFrOwogICAgICAgICBjYXNlIExBVEVOQ1k6IHsKICAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgb3V0cHV0ID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBsYXRlbmN5KG91dHB1dCkgKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBsYXRlbmN5KGRhdGEucmVhZEludDMyKCkpICk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7CiAgICAgICAgICBjYXNlIFNFVF9NQVNURVJfVk9MVU1FOiB7CkBAIC00NTAsNyArNTM5LDkgQEAKICAgICAgICAgY2FzZSBTRVRfU1RSRUFNX1ZPTFVNRTogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIGludCBzdHJlYW0gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIHNldFN0cmVhbVZvbHVtZShzdHJlYW0sIGRhdGEucmVhZEZsb2F0KCkpICk7CisgICAgICAgICAgICBmbG9hdCB2b2x1bWUgPSBkYXRhLnJlYWRGbG9hdCgpOworICAgICAgICAgICAgaW50IG91dHB1dCA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggc2V0U3RyZWFtVm9sdW1lKHN0cmVhbSwgdm9sdW1lLCBvdXRwdXQpICk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7CiAgICAgICAgIGNhc2UgU0VUX1NUUkVBTV9NVVRFOiB7CkBAIC00NjIsNyArNTUzLDggQEAKICAgICAgICAgY2FzZSBTVFJFQU1fVk9MVU1FOiB7CiAgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwogICAgICAgICAgICAgaW50IHN0cmVhbSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVGbG9hdCggc3RyZWFtVm9sdW1lKHN0cmVhbSkgKTsKKyAgICAgICAgICAgIGludCBvdXRwdXQgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgcmVwbHktPndyaXRlRmxvYXQoIHN0cmVhbVZvbHVtZShzdHJlYW0sIG91dHB1dCkgKTsKICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBTVFJFQU1fTVVURTogewpAQCAtNDcxLDMxICs1NjMsMTIgQEAKICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBzdHJlYW1NdXRlKHN0cmVhbSkgKTsKICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfUk9VVElORzogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCBtb2RlID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHVpbnQzMl90IHJvdXRlcyA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB1aW50MzJfdCBtYXNrID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBzZXRSb3V0aW5nKG1vZGUsIHJvdXRlcywgbWFzaykgKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBHRVRfUk9VVElORzogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCBtb2RlID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKCBnZXRSb3V0aW5nKG1vZGUpICk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7CiAgICAgICAgIGNhc2UgU0VUX01PREU6IHsKICAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7CiAgICAgICAgICAgICBpbnQgbW9kZSA9IGRhdGEucmVhZEludDMyKCk7CiAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggc2V0TW9kZShtb2RlKSApOwogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIEdFVF9NT0RFOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIGdldE1vZGUoKSApOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwogICAgICAgICBjYXNlIFNFVF9NSUNfTVVURTogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIGludCBzdGF0ZSA9IGRhdGEucmVhZEludDMyKCk7CkBAIC01MTIsMTMgKzU4NSwyMSBAQAogICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIGlzTXVzaWNBY3RpdmUoKSApOwogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9QQVJBTUVURVI6IHsKKyAgICAgICAgY2FzZSBTRVRfUEFSQU1FVEVSUzogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGNvbnN0IGNoYXIgKmtleSA9IGRhdGEucmVhZENTdHJpbmcoKTsKLSAgICAgICAgICAgIGNvbnN0IGNoYXIgKnZhbHVlID0gZGF0YS5yZWFkQ1N0cmluZygpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIHNldFBhcmFtZXRlcihrZXksIHZhbHVlKSApOworICAgICAgICAgICAgaW50IGlvSGFuZGxlID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIFN0cmluZzgga2V5VmFsdWVQYWlycyhkYXRhLnJlYWRTdHJpbmc4KCkpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0UGFyYW1ldGVycyhpb0hhbmRsZSwga2V5VmFsdWVQYWlycykpOwogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOworICAgICAgICAgfSBicmVhazsKKyAgICAgICAgY2FzZSBHRVRfUEFSQU1FVEVSUzogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIGludCBpb0hhbmRsZSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBTdHJpbmc4IGtleXMoZGF0YS5yZWFkU3RyaW5nOCgpKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cmluZzgoZ2V0UGFyYW1ldGVycyhpb0hhbmRsZSwga2V5cykpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICAgfSBicmVhazsKKwogICAgICAgICBjYXNlIFJFR0lTVEVSX0NMSUVOVDogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKICAgICAgICAgICAgIHNwPElBdWRpb0ZsaW5nZXJDbGllbnQ+IGNsaWVudCA9IGludGVyZmFjZV9jYXN0PElBdWRpb0ZsaW5nZXJDbGllbnQ+KGRhdGEucmVhZFN0cm9uZ0JpbmRlcigpKTsKQEAgLTUzMywxNCArNjE0LDgxIEBACiAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggZ2V0SW5wdXRCdWZmZXJTaXplKHNhbXBsZVJhdGUsIGZvcm1hdCwgY2hhbm5lbENvdW50KSApOwogICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwogICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFdBS0VfVVA6IHsKKyAgICAgICAgY2FzZSBPUEVOX09VVFBVVDogewogICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHdha2VVcCgpOworICAgICAgICAgICAgdWludDMyX3QgZGV2aWNlcyA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHVpbnQzMl90IGxhdGVuY3kgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgaW50IG91dHB1dCA9IG9wZW5PdXRwdXQoJmRldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGF0ZW5jeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFncyk7CisgICAgICAgICAgICBMT0dWKCJPUEVOX09VVFBVVCBvdXRwdXQsICVwIiwgb3V0cHV0KTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKG91dHB1dCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihkZXZpY2VzKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNhbXBsaW5nUmF0ZSk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihmb3JtYXQpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoY2hhbm5lbHMpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIobGF0ZW5jeSk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgSVNfQTJEUF9FTkFCTEVEOiB7CisgICAgICAgIGNhc2UgT1BFTl9EVVBMSUNBVEVfT1VUUFVUOiB7CiAgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIChpbnQpaXNBMmRwRW5hYmxlZCgpICk7CisgICAgICAgICAgICBpbnQgb3V0cHV0MSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBpbnQgb3V0cHV0MiA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihvcGVuRHVwbGljYXRlT3V0cHV0KG91dHB1dDEsIG91dHB1dDIpKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgY2FzZSBDTE9TRV9PVVRQVVQ6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihjbG9zZU91dHB1dChkYXRhLnJlYWRJbnQzMigpKSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGNhc2UgU1VTUEVORF9PVVRQVVQ6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdXNwZW5kT3V0cHV0KGRhdGEucmVhZEludDMyKCkpKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgY2FzZSBSRVNUT1JFX09VVFBVVDogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHJlc3RvcmVPdXRwdXQoZGF0YS5yZWFkSW50MzIoKSkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworICAgICAgICBjYXNlIE9QRU5fSU5QVVQ6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICB1aW50MzJfdCBkZXZpY2VzID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsaW5nUmF0ZSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICB1aW50MzJfdCBmb3JtYXQgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgdWludDMyX3QgYWNvdXRpY3MgPSBkYXRhLnJlYWRJbnQzMigpOworCisgICAgICAgICAgICBpbnQgaW5wdXQgPSBvcGVuSW5wdXQoJmRldmljZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjaGFubmVscywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY291dGljcyk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihpbnB1dCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihkZXZpY2VzKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNhbXBsaW5nUmF0ZSk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihmb3JtYXQpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoY2hhbm5lbHMpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworICAgICAgICBjYXNlIENMT1NFX0lOUFVUOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoY2xvc2VJbnB1dChkYXRhLnJlYWRJbnQzMigpKSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGNhc2UgU0VUX1NUUkVBTV9PVVRQVVQ6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICB1aW50MzJfdCBzdHJlYW0gPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgaW50IG91dHB1dCA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRTdHJlYW1PdXRwdXQoc3RyZWFtLCBvdXRwdXQpKTsKICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgZGVmYXVsdDoKZGlmZiAtLWdpdCBhL21lZGlhL2xpYm1lZGlhL0lBdWRpb0ZsaW5nZXJDbGllbnQuY3BwIGIvbWVkaWEvbGlibWVkaWEvSUF1ZGlvRmxpbmdlckNsaWVudC5jcHAKaW5kZXggOWQwMGFlZmIuLjM5MDBkZTQgMTAwNjQ0Ci0tLSBhL21lZ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0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHZvaWQgKnBhcmFtMiA9IDA7CisgICAgICAgICAgICBBdWRpb1N5c3RlbTo6T3V0cHV0RGVzY3JpcHRvciBkZXNjOworICAgICAgICAgICAgdWludDMyX3Qgc3RyZWFtOworICAgICAgICAgICAgaWYgKGV2ZW50ID09IEF1ZGlvU3lzdGVtOjpTVFJFQU1fQ09ORklHX0NIQU5HRUQpIHsKKyAgICAgICAgICAgICAgICBzdHJlYW0gPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgICAgIHBhcmFtMiA9ICZzdHJlYW07CisgICAgICAgICAgICAgICAgTE9HVigiU1RSRUFNX0NPTkZJR19DSEFOR0VEIHN0cmVhbSAlZCIsIHN0cmVhbSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50ICE9IEF1ZGlvU3lzdGVtOjpPVVRQVVRfQ0xPU0VEICYmIGV2ZW50ICE9IEF1ZGlvU3lzdGVtOjpJTlBVVF9DTE9TRUQpIHsKKyAgICAgICAgICAgICAgICBkZXNjLnNhbXBsaW5nUmF0ZSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICAgICAgZGVzYy5mb3JtYXQgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgICAgIGRlc2MuY2hhbm5lbHMgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgICAgIGRlc2MuZnJhbWVDb3VudCA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICAgICAgZGVzYy5sYXRlbmN5ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgICAgICBwYXJhbTIgPSAmZGVzYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlvQ29uZmlnQ2hhbmdlZChldmVudCwgaW9IYW5kbGUsIHBhcmFtMik7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7CiAgIC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4mIGltcGwpCisgICAgICAgIDogQnBJbnRlcmZhY2U8SUF1ZGlvUG9saWN5U2VydmljZT4oaW1wbCkKKyAgICB7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBzZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6YXVkaW9fZGV2aWNlcyBkZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6ZGV2aWNlX2Nvbm5lY3Rpb25fc3RhdGUgc3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpkZXZpY2VfYWRkcmVzcykKKyAgICB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb1BvbGljeVNlcnZpY2U6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihzdGF0aWNfY2FzdCA8dWludDMyX3Q+KGRldmljZSkpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihzdGF0ZSkpOworICAgICAgICBkYXRhLndyaXRlQ1N0cmluZyhkZXZpY2VfYWRkcmVzcyk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChTRVRfREVWSUNFX0NPTk5FQ1RJT05fU1RBVEUsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8c3RhdHVzX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7CisgICAgfQorCisgICAgdmlydHVhbCBBdWRpb1N5c3RlbTo6ZGV2aWNlX2Nvbm5lY3Rpb25fc3RhdGUgZ2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmF1ZGlvX2RldmljZXMgZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MpCisgICAgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihkZXZpY2UpKTsKKyAgICAgICAgZGF0YS53cml0ZUNTdHJpbmcoZGV2aWNlX2FkZHJlc3MpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX0RFVklDRV9DT05ORUNUSU9OX1NUQVRFLCBkYXRhLCAmcmVwbHkpOworICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3QgPEF1ZGlvU3lzdGVtOjpkZXZpY2VfY29ubmVjdGlvbl9zdGF0ZT4ocmVwbHkucmVhZEludDMyKCkpOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0UGhvbmVTdGF0ZShpbnQgc3RhdGUpCisgICAgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoc3RhdGUpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX1BIT05FX1NUQVRFLCBkYXRhLCAmcmVwbHkpOworICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3QgPHN0YXR1c190PiAocmVwbHkucmVhZEludDMyKCkpOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3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Zm9yY2VkX2NvbmZpZyBnZXRGb3JjZVVzZShBdWRpb1N5c3RlbTo6Zm9yY2VfdXNlIHVzYWdlKQorICAgIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4odXNhZ2UpKTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9GT1JDRV9VU0UsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8QXVkaW9TeXN0ZW06OmZvcmNlZF9jb25maWc+IChyZXBseS5yZWFkSW50MzIoKSk7CisgICAgfQorCisgICAgdmlydHVhbCBhdWRpb19pb19oYW5kbGVfdCBnZXRPdXRwdXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlIHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1ZGlvU3lzdGVtOjpvdXRwdXRfZmxhZ3MgZmxhZ3MpCisgICAgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG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3Qgb3V0cHV0LCBBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtKQorICAgIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKG91dHB1dCk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihzdHJlYW0pOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoU1RPUF9PVVRQVVQsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8c3RhdHVzX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7CisgICAgfQorCisgICAgdmlydHVhbCB2b2lkIHJlbGVhc2VPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KQorICAgIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKG91dHB1dCk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChSRUxFQVNFX09VVFBVVCwgZGF0YSwgJnJlcGx5KTsKKyAgICB9CisKKyAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IGdldElucHV0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0U291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N5c3RlbTo6YXVkaW9faW5fYWNvdXN0aWNzIGFjb3VzdGljcykKKyAgICB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb1BvbGljeVNlcnZpY2U6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihpbnB1dFNvdXJjZSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihzYW1wbGluZ1JhdGUpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90Pihmb3JtYXQpKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGNoYW5uZWxzKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oYWNvdXN0aWNzKSk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChHRVRfSU5QVVQsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8YXVkaW9faW9faGFuZGxlX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBzdGFydElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KQorICAgIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGlucHV0KTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KFNUQVJUX0lOUFVULCBkYXRhLCAmcmVwbHkpOworICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3QgPHN0YXR1c190PiAocmVwbHkucmVhZEludDMyKCkpOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3RvcElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KQorICAgIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGlucHV0KTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KFNUT1BfSU5QVVQsIGRhdGEsICZyZXBseSk7CisgICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8c3RhdHVzX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7CisgICAgfQorCisgICAgdmlydHVhbCB2b2lkIHJlbGVhc2VJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCkKKyAgICB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb1BvbGljeVNlcnZpY2U6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihpbnB1dCk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChSRUxFQVNFX0lOUFVULCBkYXRhLCAmcmVwbHkpOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3QgaW5pdFN0cmVhbVZvbHVtZShBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4TWluLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4TWF4KQorICAgIHsKKyA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RldmljZV9hZGRyZXNzKSkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworCisgICAgICAgIGNhc2UgU0VUX1BIT05FX1NUQVRFOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihzZXRQaG9uZVN0YXRlKGRhdGEucmVhZEludDMyKCkpKSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBTRVRfUklOR0VSX01PREU6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9Qb2xpY3lTZXJ2aWNlLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICB1aW50MzJfdCBtb2RlID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHVpbnQzMl90IG1hc2sgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihzZXRSaW5nZXJNb2RlKG1vZGUsIG1hc2spKSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBTRVRfRk9SQ0VfVVNFOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgQXVkaW9TeXN0ZW06OmZvcmNlX3VzZSB1c2FnZSA9IHN0YXRpY19jYXN0IDxBdWRpb1N5c3RlbTo6Zm9yY2VfdXNlPihkYXRhLnJlYWRJbnQzMigpKTsKKyAgICAgICAgICAgIEF1ZGlvU3lzdGVtOjpmb3JjZ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AgICAgICB1aW50MzJfdCBjaGFubmVscyA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBBdWRpb1N5c3RlbTo6b3V0cHV0X2ZsYWdzIGZsYWdzID0gc3RhdGljX2Nhc3QgPEF1ZGlvU3lzdGVtOjpvdXRwdXRfZmxhZ3M+KGRhdGEucmVhZEludDMyKCkpOworCisgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQgPSBnZXRPdXRwdXQoc3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsaW5nUmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPGludD4ob3V0cHV0KSk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBTVEFSVF9PVVRQVVQ6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9Qb2xpY3lTZXJ2aWNlLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQgPSBzdGF0aWNfY2FzdCA8YXVkaW9faW9faGFuZGxlX3Q+KGRhdGEucmVhZEludDMyKCkpOworICAgICAgICAgICAgdWludDMyX3Qgc3RyZWFtID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oc3RhcnRPdXRwdXQob3V0cHV0LCAoQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlKXN0cmVhbSkpKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIFNUT1BfT1VUUFVUOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0ID0gc3RhdGljX2Nhc3QgPGF1ZGlvX2lvX2hhbmRsZV90PihkYXRhLnJlYWRJbnQzMigpKTsKKyAgICAgICAgICAgIHVpbnQzMl90IHN0cmVhbSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0aWNfY2FzdCA8dWludDMyX3Q+KHN0b3BPdXRwdXQob3V0cHV0LCAoQXVkaW9TeXN0ZW06OnN0cmVhbV90eXBlKXN0cmVhbSkpKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIFJFTEVBU0VfT1VUUFVUOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0ID0gc3RhdGljX2Nhc3QgPGF1ZGlvX2lvX2hhbmRsZV90PihkYXRhLnJlYWRJbnQzMigpKTsKKyAgICAgICAgICAgIHJlbGVhc2VPdXRwdXQob3V0cHV0KTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEdFVF9JTlBVVDogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIGludCBpbnB1dFNvdXJjZSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIEF1ZGlvU3lzdGVtOjphdWRpb19pbl9hY291c3RpY3MgYWNvdXN0aWNzID0gc3RhdGljX2Nhc3QgPEF1ZGlvU3lzdGVtOjphdWRpb19pbl9hY291c3RpY3M+KGRhdGEucmVhZEludDMyKCkpOworICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgaW5wdXQgPSBnZXRJbnB1dChpbnB1dFNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxpbmdSYXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY291c3RpY3MpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPGludD4oaW5wdXQpKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIFNUQVJUX0lOUFVUOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgaW5wdXQgPSBzdGF0aWNfY2FzdCA8YXVkaW9faW9faGFuZGxlX3Q+KGRhdGEucmVhZEludDMyKCkpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihzdGFydElucHV0KGlucHV0KSkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworCisgICAgICAgIGNhc2UgU1RPUF9JTlBVVDogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0ID0gc3RhdGljX2Nhc3QgPGF1ZGlvX2lvX2hhbmRsZV90PihkYXRhLnJlYWRJbnQzMigpKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oc3RvcElucHV0KGlucHV0KSkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworCisgICAgICAgIGNhc2UgUkVMRUFTRV9JTlBVVDogeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0ID0gc3RhdGljX2Nhc3QgPGF1ZGlvX2lvX2hhbmRsZV90PihkYXRhLnJlYWRJbnQzMigpKTsKKyAgICAgICAgICAgIHJlbGVhc2VJbnB1dChpbnB1dCk7CisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBJTklUX1NUUkVBTV9WT0xVTUU6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9Qb2xpY3lTZXJ2aWNlLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBBdWRpb1N5c3RlbTo6c3RyZWFtX3R5cGUgc3RyZWFtID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aW50MzJfdCBmbGFncykKIHsKQEAgLTI2Niw2ICsyODksMjQgQEAKICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldFZvbHVtZShkYXRhLnJlYWRGbG9hdCgpLCBkYXRhLnJlYWRGbG9hdCgpKSk7CiAgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CiAgICAgICAgIH0gYnJlYWs7CisgICAgICAgIGNhc2UgSU5WT0tFOiB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7CisgICAgICAgICAgICBpbnZva2UoZGF0YSwgcmVwbHkpOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9IGJyZWFrOworICAgICAgICBjYXNlIFNFVF9NRVRBREFUQV9GSUxURVI6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldE1ldGFkYXRhRmlsdGVyKGRhdGEpKTsKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfSBicmVhazsKKyAgICAgICAgY2FzZSBHRVRfTUVUQURBVEE6IHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKKyAgICAgICAgICAgIGNvbnN0IHN0YXR1c190IHJldGNvZGUgPSBnZXRNZXRhZGF0YShkYXRhLnJlYWRJbnQzMigpLCBkYXRhLnJlYWRJbnQzMigpLCByZXBseSk7CisgICAgICAgICAgICByZXBseS0+c2V0RGF0YVBvc2l0aW9uKDApOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocmV0Y29kZSk7CisgICAgICAgICAgICByZXBseS0+c2V0RGF0YVBvc2l0aW9uKDApOworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAg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isgICAgICAgIHNpemVfdCBlbmNvZGVkV2lkdGgsIHNpemVfdCBlbmNvZGVkSGVpZ2h0LAorICAgICAgICBzaXplX3QgZGlzcGxheVdpZHRoLCBzaXplX3QgZGlzcGxheUhlaWdodCkgeworICAgIHJldHVybiBjcmVhdGVSZW5kZXJlcigKKyAgICAgICAgICAgIHN1cmZhY2UtPmdldElTdXJmYWNlKCksCisgICAgICAgICAgICBjb21wb25lbnROYW1lLCBjb2xvckZvcm1hdCwgZW5jb2RlZFdpZHRoLCBlbmNvZGVkSGVpZ2h0LAorICAgICAgICAgICAgZGlzcGxheVdpZHRoLCBkaXNwbGF5SGVpZ2h0KTsKK30KKworY2xhc3MgQnBPTVggOiBwdWJsaWMgQnBJbnRlcmZhY2U8SU9NWD4geworcHVibGljOgorICAgIEJwT01YKGNvbnN0IHNwPElCaW5kZXI+ICZpbXBsKQorICAgICAgICA6IEJwSW50ZXJmYWNlPElPTVg+KGltcGwpIHsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IGxpc3Rfbm9kZXMoTGlzdDxTdHJpbmc4PiAqbGlzdCkgeworICAgICAgICBsaXN0LT5jbGVhcigpOworCisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChMSVNUX05PREVTLCBkYXRhLCAmcmVwbHkpOworCisgICAgICAgIGludDMyX3QgbiA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBmb3IgKGludDMyX3QgaSA9IDA7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgICAgIFN0cmluZzggcyA9IHJlcGx5LnJlYWRTdHJpbmc4KCk7CisKKyAgICAgICAgICAgIGxpc3QtPnB1c2hfYmFjayhzKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBPSzsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IGFsbG9jYXRlX25vZGUoY29uc3QgY2hhciAqbmFtZSwgbm9kZV9pZCAqbm9kZSkgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlQ1N0cmluZyhuYW1lKTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KEFMTE9DQVRFX05PREUsIGRhdGEsICZyZXBseSk7CisKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gcmVwbHkucmVhZEludDMyKCk7CisgICAgICAgIGlmIChlcnIgPT0gT0spIHsKKyAgICAgICAgICAgICpub2RlID0gKHZvaWQqKXJlcGx5LnJlYWRJbnRQdHIoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICpub2RlID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBmcmVlX25vZGUobm9kZV9pZCBub2RlKSB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoRlJFRV9OT0RFLCBkYXRhLCAmcmVwbHkpOworCisgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IHNlbmRfY29tbWFuZCgKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX0NPTU1BTkRUWVBFIGNtZCwgT01YX1MzMiBwYXJhbSkgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50UHRyKChpbnRwdHJfdClub2RlKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGNtZCk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihwYXJhbSk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChTRU5EX0NPTU1BTkQsIGRhdGEsICZyZXBseSk7CisKKyAgICAgICAgcmV0dXJuIHJlcGx5LnJlYWRJbnQzMigpOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0X3BhcmFtZXRlcigKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX0lOREVYVFlQRSBpbmRleCwKKyAgICAgICAgICAgIHZvaWQgKnBhcmFtcywgc2l6ZV90IHNpemUpIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU9NWDo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludFB0cigoaW50cHRyX3Qpbm9kZSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihpbmRleCk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihzaXplKTsKKyAgICAgICAgZGF0YS53cml0ZShwYXJhbXMsIHNpemUpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX1BBUkFNRVRFUiwgZGF0YSwgJnJlcGx5KTsKKworICAgICAgICBzdGF0dXNfdCBlcnIgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgfQorCisgICAgICAgIHJlcGx5LnJlYWQocGFyYW1zLCBzaXplKTsKKworICAgICAgICByZXR1cm4gT0s7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBzZXRfcGFyYW1ldGVyKAorICAgICAgICAgICAgbm9kZV9pZCBub2RlLCBPTVhfSU5ERVhUWVBFIGluZGV4LAorICAgICAgICAgICAgY29uc3Qgdm9pZCAqcGFyYW1zLCBzaXplX3Qgc2l6ZSkgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50UHRyKChpbnRwdHJfdClub2RlKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKGluZGV4KTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKHNpemUpOworICAgICAgICBkYXRhLndyaXRlKHBhcmFtcywgc2l6ZSk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChTRVRfUEFSQU1FVEVSLCBkYXRhLCAmcmVwbHkpOworCisgICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IGdldF9jb25maWcoCisgICAgICAgICAgICBub2RlX2lkIG5vZGUsIE9NWF9JTkRFWFRZUEUgaW5kZXgsCisgICAgICAgICAgICB2b2lkICpwYXJhbXMsIHNpemVfdCBzaXplKSB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoaW5kZXgpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoc2l6ZSk7CisgICAgICAgIGRhdGEud3JpdGUocGFyYW1zLCBzaXplKTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9DT05GSUcsIGRhdGEsICZyZXBseSk7CisKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gcmVwbHkucmVhZEludDMyKCk7CisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKworICAgICAgICByZXBseS5yZWFkKHBhcmFtcywgc2l6ZSk7CisKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0X2NvbmZpZygKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX0lOREVYVFlQRSBpbmRleCwKKyAgICAgICAgICAgIGNvbnN0IHZvaWQgKnBhcmFtcywgc2l6ZV90IHNpemUpIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU9NWDo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludFB0cigoaW50cHRyX3Qpbm9kZSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihpbmRleCk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihzaXplKTsKKyAgICAgICAgZGF0YS53cml0ZShwYXJhbXMsIHNpemUpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX0NPTkZJRywgZGF0YSwgJnJlcGx5KTsKKworICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCB1c2VfYnVmZmVyKAorICAgICAgICAgICAgbm9kZV9pZCBub2RlLCBPTVhfVTMyIHBvcnRfaW5kZXgsIGNvbnN0IHNwPElNZW1vcnk+ICZwYXJhbXMsCisgICAgICAgICAgICBidWZmZXJfaWQgKmJ1ZmZlcikgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50UHRyKChpbnRwdHJfdClub2RlKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKHBvcnRfaW5kZXgpOworICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKHBhcmFtcy0+YXNCaW5kZXIoKSk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChVU0VfQlVGRkVSLCBkYXRhLCAmcmVwbHkpOworCisgICAgICAgIHN0YXR1c190IGVyciA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAqYnVmZmVyID0gMDsKKworICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgfQorCisgICAgICAgICpidWZmZXIgPSAodm9pZCopcmVwbHkucmVhZEludFB0cigpOworCisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBhbGxvY2F0ZV9idWZmZXIoCisgICAgICAgICAgICBub2RlX2lkIG5vZGUsIE9NWF9VMzIgcG9ydF9pbmRleCwgc2l6ZV90IHNpemUsCisgICAgICAgICAgICBidWZmZXJfaWQgKmJ1ZmZlcikgeworICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7CisgICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOworICAgICAgICBkYXRhLndyaXRlSW50UHRyKChpbnRwdHJfdClub2RlKTsKKyAgICAgICAgZGF0YS53cml0ZUludDMyKHBvcnRfaW5kZXgpOworICAgICAgICBkYXRhLndyaXRlSW50MzIoc2l6ZSk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChBTExPQ19CVUZGRVIsIGRhdGEsICZyZXBseSk7CisKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gcmVwbHkucmVhZEludDMyKCk7CisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgICpidWZmZXIgPSAwOworCisgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICB9CisKKyAgICAgICAgKmJ1ZmZlciA9ICh2b2lkKilyZXBseS5yZWFkSW50UHRyKCk7CisKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IGFsbG9jYXRlX2J1ZmZlcl93aXRoX2JhY2t1cCgKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX1UzMiBwb3J0X2luZGV4LCBjb25zdCBzcDxJTWVtb3J5PiAmcGFyYW1zLAorICAgICAgICAgICAgYnVmZmVyX2lkICpidWZmZXIpIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU9NWDo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludFB0cigoaW50cHRyX3Qpbm9kZSk7CisgICAgICAgIGRhdGEud3JpdGVJbnQzMihwb3J0X2luZGV4KTsKKyAgICAgICAgZGF0YS53cml0ZVN0cm9uZ0JpbmRlcihwYXJhbXMtPmFzQmluZGVyKCkpOworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoQUxMT0NfQlVGRkVSX1dJVEhfQkFDS1VQLCBkYXRhLCAmcmVwbHkpOworCisgICAgICAgIHN0YXR1c190IGVyciA9IHJlcGx5LnJlYWRJbnQzMigpOworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAqYnVmZmVyID0gMDsKKworICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgfQorCisgICAgICAgICpidWZmZXIgPSAodm9pZCopcmVwbHkucmVhZEludFB0cigpOworCisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBmcmVlX2J1ZmZlcigKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX1UzMiBwb3J0X2luZGV4LCBidWZmZXJfaWQgYnVmZmVyKSB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOworICAgICAgICBkYXRhLndyaXRlSW50MzIocG9ydF9pbmRleCk7CisgICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KWJ1ZmZlcik7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChGUkVFX0JVRkZFUiwgZGF0YSwgJnJlcGx5KTsKKworICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7CisgICAgfQorCisgICAgdmlydHVhbCBzdGF0dXNfdCBvYnNlcnZlX25vZGUoCisgICAgICAgICAgICBub2RlX2lkIG5vZGUsIGNvbnN0IHNwPElPTVhPYnNlcnZlcj4gJm9ic2VydmVyKSB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7CisgICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOworICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKG9ic2VydmVyLT5hc0JpbmRlcigpKTsKKyAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KE9CU0VSVkVfTk9ERSwgZGF0YSwgJnJlcGx5KTsKKworICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7CisgICAgfQorCisgICAgdmlydHVhbCB2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UludDY0KHRpbWVzdGFtcCk7CisgICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChFTVBUWV9CVUZGRVIsIGRhdGEsICZyZXBseSwgSUJpbmRlcjo6RkxBR19PTkVXQVkpOworICAgIH0KKworICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0X2V4dGVuc2lvbl9pbmRleCgKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwKKyAgICAgICAgICAgIGNvbnN0IGNoYXIgKnBhcmFtZXRlcl9uYW1lLAorICAgICAgICAgICAgT01YX0lOREVYVFlQRSAqaW5kZXgpIHsKKyAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OworICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU9NWDo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKKyAgICAgICAgZGF0YS53cml0ZUludFB0cigoaW50cHRyX3Qpbm9kZSk7CisgICAgICAgIGRhdGEud3JpdGVDU3RyaW5nKHBhcmFtZXRlcl9uYW1lKTsKKworICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX0VYVEVOU0lPTl9JTkRFWCwgZGF0YSwgJnJlcGx5KTsKKworICAgICAgICBzdGF0dXNfdCBlcnIgPSByZXBseS5yZWFkSW50MzIoKTsKKyAgICAgICAgaWYgKGVyciA9PSBPSykgeworICAgICAgICAgICAgKmluZGV4ID0gc3RhdGljX2Nhc3Q8T01YX0lOREVYVFlQRT4ocmVwbHkucmVhZEludDMyKCkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgKmluZGV4ID0gT01YX0luZGV4Q29tcG9uZW50U3RhcnRVbnVzZWQ7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIHZpcnR1YWwgc3A8SU9NWFJlbmRlcmVyPiBjcmVhdGVSZW5kZXJlcigKKyAgICAgICAgICAgIGNvbnN0IHNwPElTdXJmYWNlPiAmc3VyZmFjZSwKKyAgICAg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Ly8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworCisjZGVmaW5lIENIRUNLX0lOVEVSRkFDRShpbnRlcmZhY2UsIGRhdGEsIHJlcGx5KSBcCisgICAgICAgIGRvIHsgaWYgKCFkYXRhLmVuZm9yY2VJbnRlcmZhY2UoaW50ZXJmYWNlOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpKSB7IFwKKyAgICAgICAgICAgIExPR1coIkNhbGwgaW5jb3JyZWN0bHkgcm91dGVkIHRvICIgI2ludGVyZmFjZSk7IFwKKyAgICAgICAgICAgIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsgXAorICAgICAgICB9IH0gd2hpbGUgKDApCisKK3N0YXR1c190IEJuT01YOjpvblRyYW5zYWN0KAorICAgIHVpbnQzMl90IGNvZGUsIGNvbnN0IFBhcmNlbCAmZGF0YSwgUGFyY2VsICpyZXBseSwgdWludDMyX3QgZmxhZ3MpIHsKKyAgICBzd2l0Y2ggKGNvZGUpIHsKKyAgICAgICAgY2FzZSBMSVNUX05PREVTOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBMaXN0PFN0cmluZzg+IGxpc3Q7CisgICAgICAgICAgICBsaXN0X25vZGVzKCZsaXN0KTsKKworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIobGlzdC5zaXplKCkpOworICAgICAgICAgICAgZm9yIChMaXN0PFN0cmluZzg+OjppdGVyYXRvciBpdCA9IGxpc3QuYmVnaW4oKTsKKyAgICAgICAgICAgICAgICAgaXQgIT0gbGlzdC5lbmQoKTsgKytpdCkgeworICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cmluZzgoKml0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBBTExPQ0FURV9OT0RFOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGU7CisgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBhbGxvY2F0ZV9ub2RlKGRhdGEucmVhZENTdHJpbmcoKSwgJm5vZGUpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZXJyKTsKKyAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKKyAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBGUkVFX05PREU6CisgICAgICAgIHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJT01YLCBkYXRhLCByZXBseSk7CisKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKKworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZnJlZV9ub2RlKG5vZGUpKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgU0VORF9DT01NQU5EOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7CisKKyAgICAgICAgICAgIE9NWF9DT01NQU5EVFlQRSBjbWQgPQorICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PE9NWF9DT01NQU5EVFlQRT4oZGF0YS5yZWFkSW50MzIoKSk7CisKKyAgICAgICAgICAgIE9NWF9TMzIgcGFyYW0gPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2VuZF9jb21tYW5kKG5vZGUsIGNtZCwgcGFyYW0pKTsKKworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBHRVRfUEFSQU1FVEVSOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7CisgICAgICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4ID0gc3RhdGljX2Nhc3Q8T01YX0lOREVYVFlQRT4oZGF0YS5yZWFkSW50MzIoKSk7CisKKyAgICAgICAgICAgIHNpemVfdCBzaXplID0gZGF0YS5yZWFkSW50MzIoKTsKKworICAgICAgICAgICAgLy8gWFhYIEkgYW0gbm90IGhhcHB5IHdpdGggdGhpcyBidXQgUGFyY2VsOjpyZWFkSW5wbGFjZSBkaWRuJ3Qgd29yay4KKyAgICAgICAgICAgIHZvaWQgKnBhcmFtcyA9IG1hbGxvYyhzaXplKTsKKyAgICAgICAgICAgIGRhdGEucmVhZChwYXJhbXMsIHNpemUpOworCisgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBnZXRfcGFyYW1ldGVyKG5vZGUsIGluZGV4LCBwYXJhbXMsIHNpemUpOworCisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOworCisgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7CisgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlKHBhcmFtcywgc2l6ZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZyZWUocGFyYW1zKTsKKyAgICAgICAgICAgIHBhcmFtcyA9IE5VTEw7CisKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgU0VUX1BBUkFNRVRFUjoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKKworICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleCA9IHN0YXRpY19jYXN0PE9NWF9JTkRFWFRZUEU+KGRhdGEucmVhZEludDMyKCkpOworCisgICAgICAgICAgICBzaXplX3Qgc2l6ZSA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICB2b2lkICpwYXJhbXMgPSBjb25zdF9jYXN0PHZvaWQgKj4oZGF0YS5yZWFkSW5wbGFjZShzaXplKSk7CisKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldF9wYXJhbWV0ZXIobm9kZSwgaW5kZXgsIHBhcmFtcywgc2l6ZSkpOworCisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEdFVF9DT05GSUc6CisgICAgICAgIHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJT01YLCBkYXRhLCByZXBseSk7CisKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKKyAgICAgICAgICAgIE9NWF9JTkRFWFRZUEUgaW5kZXggPSBzdGF0aWNfY2FzdDxPTVhfSU5ERVhUWVBFPihkYXRhLnJlYWRJbnQzMigpKTsKKworICAgICAgICAgICAgc2l6ZV90IHNpemUgPSBkYXRhLnJlYWRJbnQzMigpOworCisgICAgICAgICAgICAvLyBYWFggSSBhbSBub3QgaGFwcHkgd2l0aCB0aGlzIGJ1dCBQYXJjZWw6OnJlYWRJbnBsYWNlIGRpZG4ndCB3b3JrLgorICAgICAgICAgICAgdm9pZCAqcGFyYW1zID0gbWFsbG9jKHNpemUpOworICAgICAgICAgICAgZGF0YS5yZWFkKHBhcmFtcywgc2l6ZSk7CisKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGdldF9jb25maWcobm9kZSwgaW5kZXgsIHBhcmFtcywgc2l6ZSk7CisKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7CisKKyAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKKyAgICAgICAgICAgICAgICByZXBseS0+d3JpdGUocGFyYW1zLCBzaXplKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnJlZShwYXJhbXMpOworICAgICAgICAgICAgcGFyYW1zID0gTlVMTDsKKworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBTRVRfQ09ORklHOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7CisgICAgICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4ID0gc3RhdGljX2Nhc3Q8T01YX0lOREVYVFlQRT4oZGF0YS5yZWFkSW50MzIoKSk7CisKKyAgICAgICAgICAgIHNpemVfdCBzaXplID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHZvaWQgKnBhcmFtcyA9IGNvbnN0X2Nhc3Q8dm9pZCAqPihkYXRhLnJlYWRJbnBsYWNlKHNpemUpKTsKKworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0X2NvbmZpZyhub2RlLCBpbmRleCwgcGFyYW1zLCBzaXplKSk7CisKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgVVNFX0JVRkZFUjoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKKworICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgT01YX1UzMiBwb3J0X2luZGV4ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHNwPElNZW1vcnk+IHBhcmFtcyA9CisgICAgICAgICAgICAgICAgaW50ZXJmYWNlX2Nhc3Q8SU1lbW9yeT4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOworCisgICAgICAgICAgICBidWZmZXJfaWQgYnVmZmVyOworICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gdXNlX2J1ZmZlcihub2RlLCBwb3J0X2luZGV4LCBwYXJhbXMsICZidWZmZXIpOworICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZXJyKTsKKworICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgeworICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludFB0cigoaW50cHRyX3QpYnVmZmVyKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBBTExPQ19CVUZGRVI6CisgICAgICAgIHsKKyAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJT01YLCBkYXRhLCByZXBseSk7CisKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKKyAgICAgICAgICAgIE9NWF9VMzIgcG9ydF9pbmRleCA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBzaXplX3Qgc2l6ZSA9IGRhdGEucmVhZEludDMyKCk7CisKKyAgICAgICAgICAgIGJ1ZmZlcl9pZCBidWZmZXI7CisgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBhbGxvY2F0ZV9idWZmZXIobm9kZSwgcG9ydF9pbmRleCwgc2l6ZSwgJmJ1ZmZlcik7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOworCisgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7CisgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50UHRyKChpbnRwdHJfdClidWZmZXIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEFMTE9DX0JVRkZFUl9XSVRIX0JBQ0tVUDoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKKworICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgT01YX1UzMiBwb3J0X2luZGV4ID0gZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHNwPElNZW1vcnk+IHBhcmFtcyA9CisgICAgICAgICAgICAgICAgaW50ZXJmYWNlX2Nhc3Q8SU1lbW9yeT4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOworCisgICAgICAgICAgICBidWZmZXJfaWQgYnVmZmVyOworICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gYWxsb2NhdGVfYnVmZmVyX3dpdGhfYmFja3VwKAorICAgICAgICAgICAgICAgICAgICBub2RlLCBwb3J0X2luZGV4LCBwYXJhbXMsICZidWZmZXIpOworCisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOworCisgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7CisgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50UHRyKChpbnRwdHJfdClidWZmZXIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEZSRUVfQlVGRkVSOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7CisgICAgICAgICAgICBPTVhfVTMyIHBvcnRfaW5kZXggPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgYnVmZmVyX2lkIGJ1ZmZlciA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGZyZWVfYnVmZmVyKG5vZGUsIHBvcnRfaW5kZXgsIGJ1ZmZlcikpOworCisgICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIE9CU0VSVkVfTk9ERToKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKKworICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgc3A8SU9NWE9ic2VydmVyPiBvYnNlcnZlciA9CisgICAgICAgICAgICAgICAgaW50ZXJmYWNlX2Nhc3Q8SU9NWE9ic2VydmVyPihkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKSk7CisgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihvYnNlcnZlX25vZGUobm9kZSwgb2JzZXJ2ZXIpKTsKKworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBGSUxMX0JVRkZFUjoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKKworICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgYnVmZmVyX2lkIGJ1ZmZlciA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKKyAgICAgICAgICAgIGZpbGxfYnVmZmVyKG5vZGUsIGJ1ZmZlcik7CisKKyAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRU1QVFlfQlVGRkVSOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7CisgICAgICAgICAgICBidWZmZXJfaWQgYnVmZmVyID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOworICAgICAgICAgICAgT01YX1UzMiByYW5nZV9vZmZzZXQgPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgT01YX1UzMiByYW5nZV9sZW5ndGggPSBkYXRhLnJlYWRJbnQzMigpOworICAgICAgICAgICAgT01YX1UzMiBmbGFncyA9IGRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBPTVhfVElDS1MgdGltZXN0YW1wID0gZGF0YS5yZWFkSW50NjQoKTsKKworICAgICAgICAgICAgZW1wdHlfYnVmZmVyKAorICAgICAgICAgICAgICAgICAgICBub2RlLCBidWZmZXIsIHJhbmdlX29mZnNldCwgcmFuZ2VfbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICBmbGFncywgdGltZXN0YW1wKTsKKworICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBHRVRfRVhURU5TSU9OX0lOREVYOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7CisgICAgICAgICAgICBjb25zdCBjaGFyICpwYXJhbWV0ZXJfbmFtZSA9IGRhdGEucmVhZENTdHJpbmcoKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleDsKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGdldF9leHRlbnNpb25faW5kZXgobm9kZSwgcGFyYW1ldGVyX25hbWUsICZpbmRleCk7CisKKyAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7CisKKyAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKKyAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihpbmRleCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBPSzsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgQ1JFQVRFX1JFTkRFUkVSOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOworCisgICAgICAgICAgICBzcDxJU3VyZmFjZT4gaXN1cmZhY2UgPQorICAgICAgICAgICAgICAgIGludGVyZmFjZV9jYXN0PElTdXJmYWNlPihkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKSk7CisKKyAgICAgICAgICAgIGNvbnN0IGNoYXIgKmNvbXBvbmVudE5hbWUgPSBkYXRhLnJlYWRDU3RyaW5nKCk7CisKKyAgICAgICAgICAgIE9NWF9DT0xPUl9GT1JNQVRUWVBFIGNvbG9yRm9ybWF0ID0KKyAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxPTVhfQ09MT1JfRk9STUFUVFlQRT4oZGF0YS5yZWFkSW50MzIoKSk7CisKKyAgICAgICAgICAgIHNpemVfdCBlbmNvZGVkV2lkdGggPSAoc2l6ZV90KWRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBzaXplX3QgZW5jb2RlZEhlaWdodCA9IChzaXplX3QpZGF0YS5yZWFkSW50MzIoKTsKKyAgICAgICAgICAgIHNpemVfdCBkaXNwbGF5V2lkdGggPSAoc2l6ZV90KWRhdGEucmVhZEludDMyKCk7CisgICAgICAgICAgICBzaXplX3QgZGlzcGxheUhlaWdodCA9IChzaXplX3QpZGF0YS5yZWFkSW50MzIoKTsKKworICAgICAgICAgICAgc3A8SU9NWFJlbmRlcmVyPiByZW5kZXJlciA9CisgICAgICAgICAgICAgICAgY3JlYXRlUmVuZGVyZXIoaXN1cmZhY2UsIGNvbXBvbmVudE5hbWUsIGNvbG9yRm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kZWRXaWR0aCwgZW5jb2RlZEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5V2lkdGgsIGRpc3BsYXlIZWlnaHQpOworCisgICAgICAgICAgICByZXBseS0+d3JpdGVTdHJvbmdCaW5kZXIocmVuZGVyZXItPmFzQmluZGVyKCkpOworCisgICAgICAgICAgICByZXR1cm4gT0s7CisgICAgICAgIH0KKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmV0dXJuIEJCaW5kZXI6Om9uVHJhbnNhY3QoY29kZSwgZGF0YSwgcmVwbHksIGZsYWdzKTsKKyAgICB9Cit9CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK2NsYXNzIEJwT01YT2JzZXJ2ZXIgOiBwdWJsaWMgQnBJbnRlcmZhY2U8SU9NWE9ic2VydmVyPiB7CitwdWJsaWM6CisgICAgQnBPTVhPYnNlcnZlcihjb25zdCBzcDxJQmluZGVyPiAmaW1wbCkKKyAgICAgICAgOiBCcEludGVyZmFjZTxJT01YT2JzZXJ2ZXI+KGltcGwpIHsKKyAgICB9CisKKyAgICB2aXJ0dWFsIHZvaWQgb25fbWVzc2FnZShjb25zdCBvbXhfbWVzc2FnZSAmbXNnKSB7CisgICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKKyAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2Vu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hlIGxlbmd0aCBvZiB0aGUgbWV0YWRhdGEKKyAgICBvayA9IG9rICYmIG1EYXRhLT53cml0ZUludDMyKC0xKSA9PSBPSzsKKyAgICBvayA9IG9rICYmIG1EYXRhLT53cml0ZUludDMyKGtNZXRhTWFya2VyKSA9PSBPSzsKKyAgICByZXR1cm4gb2s7Cit9CisKK2Jvb2wgTWV0YWRhdGE6OmFwcGVuZEJvb2woaW50IGtleSwgYm9vbCB2YWwpCit7CisgICAgaWYgKCFjaGVja0tleShrZXkpKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBjb25zdCBzaXplX3QgYmVnaW4gPSBtRGF0YS0+ZGF0YVBvc2l0aW9uKCk7CisgICAgYm9vbCBvayA9IHRydWU7CisKKyAgICAvLyA0IGludDMyczogc2l6ZSwga2V5LCB0eXBlLCB2YWx1ZS4KKyAgICBvayA9IG9rICYmIG1EYXRhLT53cml0ZUludDMyKDQgKiBzaXplb2YoaW50MzJfdCkpID09IE9LOworICAgIG9rID0gb2sgJiYgbURhdGEtPndyaXRlSW50MzIoa2V5KSA9PSBPSzsKKyAgICBvayA9IG9rICYmIG1EYXRhLT53cml0ZUludDMyKEJPT0xFQU5fVkFMKSA9PSBPSzsKKyAgICBvayA9IG9rICYmIG1EYXRhLT53cml0ZUludDMyKHZhbCA/IDEgOiAwKSA9PSBPSzsKKyAgICBpZiAoIW9rKSB7CisgICAgICAgIG1EYXRhLT5zZXREYXRhUG9zaXRpb24oYmVnaW4pOworICAgIH0KKyAgICByZXR1cm4gb2s7Cit9CisKK2Jvb2wgTWV0YWRhdGE6OmFwcGVuZEludDMyKGludCBrZXksIGludDMyX3QgdmFsKQoreworICAgIGlmICghY2hlY2tLZXkoa2V5KSkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgY29uc3Qgc2l6ZV90IGJlZ2luID0gbURhdGEtPmRhdGFQb3NpdGlvbigpOworICAgIGJvb2wgb2sgPSB0cnVlOworCisgIC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ICAwIDEgMiAzIDQgNSA2IDcgOCA5IDAgMSAyIDMgNCA1IDYgNyA4IDkgMCAxIDIgMyA0IDUgNiA3IDggOSAwIDEKKy8vICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCisvLyB8ICAgICAgICAgICAgICAgICAgICAgICBudW1iZXIgb2YgZW50cmllcyAobikgICAgICAgICAgICAgICAgICAgfAorLy8gKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKy8vIHwgICAgICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhIHR5cGUgMSAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworLy8gfCAgICAgICAgICAgICAgICAgICAgICAgbWV0YWRhdGEgdHlwZSAyICAgICAgICAgICAgICAgICAgICAgICAgIHwKKy8vICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCisvLyAgLi4uLgorLy8gKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKKy8vIHwgICAgICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhIHR5cGUgbiAgICAgICAgICAgICAgICAgICAgICAgICB8CisvLyArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKworLy8KKy8vIEBwYXJhbSBwIFBhcmNlbCB0aGF0IHNob3VsZCBzdGFydCB3aXRoIGEgZmlsdGVyLgorLy8gQHBhcmFtW291dF0gZmlsdGVyIE9uIGV4aXQgY29udGFpbnMgdGhlIGxpc3Qgb2YgbWV0YWRhdGEgdHlwZSB0byBiZQorLy8gICAgICAgICAgICAgICAgICAgIGZpbHRlcmVkLgorLy8gQHBhcmFtW291dF0gc3RhdHVzIE9uIGV4aXQgY29udGFpbnMgdGhlIHN0YXR1cyBjb2RlIHRvIGJlIHJldHVybmVkLgorLy8gQHJldHVybiB0cnVlIGlmIHRoZSBwYXJjZWwgc3RhcnRzIHdpdGggYSB2YWxpZCBmaWx0ZXIuCitib29sIHVubWFyc2hhbGxGaWx0ZXIoY29uc3QgUGFyY2VsJiBwLAorICAgICAgICAgICAgICAgICAgICAgIE1ldGFkYXRhOjpGaWx0ZXIgKmZpbHRlciwKKyAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzKQoreworICAgIGludDMyX3QgdmFsOworICAgIGlmIChwLnJlYWRJbnQzMigmdmFsKSAhPSBPSykKKyAgICB7CisgICAgICAgIExPR0UoIkZhaWxlZCB0byByZWFkIGZpbHRlcidzIGxlbmd0aCIpOworICAgICAgICAqc3RhdHVzID0gTk9UX0VOT1VHSF9EQVRBOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgaWYoIHZhbCA+IGtNYXhGaWx0ZXJTaXplIHx8IHZhbCA8IDApCisgICAgeworICAgICAgICBMT0dFKCJJbnZhbGlkIGZpbHRlciBsZW4gJWQiLCB2YWwpOworICAgICAgICAqc3RhdHVzID0gQkFEX1ZBTFVFOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgY29uc3Qgc2l6ZV90IG51bSA9IHZhbDsKKworICAgIGZpbHRlci0+Y2xlYXIoKTsKKyAgICBmaWx0ZXItPnNldENhcGFjaXR5KG51bSk7CisKKyAgICBzaXplX3Qgc2l6ZSA9IG51bSAqIHNpemVvZihNZXRhZGF0YTo6VHlwZSk7CisKKworICAgIGlmIChwLmRhdGFBdmFpbCgpIDwgc2l6ZSkKKyAgICB7CisgICAgICAgIExPR0UoIkZpbHRlciB0b28gc2h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QsMTQgQEAKICAgICAgICAgICAgIExPR1YoIiBjcmVhdGUgVm9yYmlzUGxheWVyIik7CiAgICAgICAgICAgICBwID0gbmV3IFZvcmJpc1BsYXllcigpOwogICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU1RBR0VGUklHSFRfUExBWUVSOgorICAgICAgICAgICAgTE9HVigiIGNyZWF0ZSBTdGFnZWZyaWdodFBsYXllciIpOworICAgICAgICAgICAgcCA9IG5ldyBTdGFnZWZyaWdodFBsYXllcjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFRFU1RfUExBWUVSOgorICAgICAgICAgICAgTE9HVigiQ3JlYXRlIFRlc3QgUGxheWVyIHN0dWIiKTsKKyAgICAgICAgICAgIHAgPSBuZXcgVGVzdFBsYXllclN0dWIoKTsKKyAgICAgICAgICAgIGJyZWFrOwogICAgIH0KICAgICBpZiAocCAhPSBOVUxMKSB7CiAgICAgICAgIGlmIChwLT5pbml0Q2hlY2soKSA9PSBOT19FUlJPUikgewpAQCAtNjA4LDcgKzc1NiwxMSBAQAogICAgICAgICAvLyBub3cgc2V0IGRhdGEgc291cmNlCiAgICAgICAgIExPR1YoIiBzZXREYXRhU291cmNlIik7CiAgICAgICAgIG1TdGF0dXMgPSBwLT5zZXREYXRhU291cmNlKHVybCk7Ci0gICAgICAgIGlmIChtU3RhdHVzID09IE5PX0VSUk9SKSBtUGxheWVyID0gcDsKKyAgICAgICAgaWYgKG1TdGF0dXMgPT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgIG1QbGF5ZXIgPSBwOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgTE9HRSgiICBlcnJvcjogJWQiLCBtU3RhdHVzKTsKKyAgICAgICAgfQogICAgICAgICByZXR1cm4gbVN0YXR1czsKICAgICB9CiB9CkBAIC02NjUsNiArODE3LDczIEBACiAgICAgcmV0dXJuIHAtPnNldFZpZGVvU3VyZmFjZShzdXJmYWNlKTsKIH0KIAorc3RhdHVz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AgICAgICAgIHdyaXRlKGNvbnN0IHZvaWQqIGJ1ZmZlciwgc2l6ZV90IHNpemUpOwogICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBzdG9wKCk7CkBAIC04NCw4ICs5NSwxMiBAQAogICAgICAgICBzdGF0aWMgaW50ICAgICAgICAgICAgICBnZXRNaW5CdWZmZXJDb3VudCgpOwogICAgIHByaXZhdGU6CiAgICAgICAgIHN0YXRpYyB2b2lkICAgICAgICAgICAgIHNldE1pbkJ1ZmZlckNvdW50KCk7CisgICAgICAgIHN0YXRpYyB2b2lkICAgICAgICAgICAgIENhbGxiYWNrV3JhcHBlcigKKyAgICAgICAgICAgICAgICBpbnQgZXZlbnQsIHZvaWQgKm1lLCB2b2lkICppbmZvKTsKIAogICAgICAgICBBdWRpb1RyYWNrKiAgICAgICAgICAgICBtVHJhY2s7CisgICAgICAgIEF1ZGlvQ2FsbGJhY2sgICAgICAgICAgIG1DYWxsYmFjazsKKyAgICAgICAgdm9pZCAqICAgICAgICAgICAgICAgICAgbUNhbGxiYWNrQ29va2llOwogICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZTsKICAgICAgICAgZmxvYXQgICAgICAgICAgICAgICAgICAgbUxlZnRWb2x1bWU7CiAgICAgICAgIGZsb2F0ICAgICAgICAgICAgICAgICAgIG1SaWdodFZvbHVtZTsKQEAgLTExMyw3ICsxMjgsMTIgQEAKICAgICAgICAgdmlydHVhbCBzc2l6ZV90ICAgICAgICAgZnJhbWVTaXplKCkgY29uc3QgeyByZXR1cm4gc3NpemVfdChtQ2hhbm5lbENvdW50ICogKChtRm9ybWF0ID09IEF1ZGlvU3lzdGVtOjpQQ01fMTZfQklUKT9zaXplb2YoaW50MTZfdCk6c2l6ZW9mKHVfaW50OF90KSkpOyB9CiAgICAgICAgIHZpcnR1YWwgdWludDMyX3QgICAgICAgIGxhdGVuY3koKSBjb25zdDsKICAgICAgICAgdmlydHVhbCBmbG9hdCAgICAgICAgICAgbXNlY3NQZXJGcmFtZSgpIGNvbnN0OwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBvcGVuKHVpbnQzMl90IHNhbXBsZVJhdGUsIGludCBjaGFubmVsQ291bnQsIGludCBmb3JtYXQsIGludCBidWZmZXJDb3VudD0xKTsKKworICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBvcGVuKAorICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsIGludCBjaGFubmVsQ291bnQsIGludCBmb3JtYXQsCisgICAgICAgICAgICAgICAgaW50IGJ1ZmZlckNvdW50ID0gMSwKKyAgICAgICAgICAgICAgICBBdWRpb0NhbGxiYWNrIGNiID0gTlVMTCwgdm9pZCAqY29va2llID0gTlVMTCk7CisKICAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgc3RhcnQoKSB7fQogICAgICAgICB2aXJ0dWFsIHNzaXplX3QgICAgICAgICB3cml0ZShjb25zdCB2b2lkKiBidWZmZXIsIHNpemVfdCBzaXplKTsKICAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgc3RvcCgpIHt9CkBAIC0xNDAsNyArMTYwLDcgQEAKICAgICAgICAgc3A8TWVtb3J5SGVhcEJhc2U+ICBtSGVhcDsKICAgICAgICAgZmxvYXQgICAgICAgICAgICAgICBtTXNlY3NQZXJGcmFtZTsKICAgICAgICAgdWludDE2X3QgICAgICAgICAgICBtQ2hhbm5lbENvdW50OwotICAgICAgICB1aW50MTZfdAkJCW1Gb3JtYXQ7CisgICAgICAgIHVpbnQxNl90ICAgICAgICAgICAgbUZvcm1hdDsKICAgICAgICAgc3NpemVfdCAgICAgICAgICAgICBtRnJhbWVDb3VudDsKICAgICAgICAgdWludDMyX3QgICAgICAgICAgICBtU2FtcGxlUmF0ZTsKICAgICAgICAgdWludDMyX3QgICAgICAgICAgICBtU2l6ZTsKQEAgLTE2MCwxMSArMTgwLDEzIEBACiAgICAgdmlydHVhbCB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WUpOworICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBpbnZva2UoY29uc3QgUGFyY2VsJiByZXF1ZXN0LCBQYXJjZWwgKnJlcGx5KTsKKyAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgc2V0TWV0YWRhdGFGaWx0ZXIoY29uc3QgUGFyY2VsJiBmaWx0ZXIpOworICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBnZXRNZXRhZGF0YShib29sIHVwZGF0ZV9vbmx5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFwcGx5X2ZpbHRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsICpyZXBseSk7CiAKICAgICAgICAgc3A8TWVkaWFQbGF5ZXJCYXNlPiAgICAgY3JlYXRlUGxheWVyKHBsYXllcl90eXBlIHBsYXllclR5cGUpOwogICAgICAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBzZXREYXRhU291cmNlKGNvbnN0IGNoYXIgKnVybCk7CkBAIC0yMDYsNiArMjMzLDE4IEBACiAKICAgICAgICAgc3A8TWVkaWFQbGF5ZXJCYXNlPiAgICAgZ2V0UGxheWVyKCkgY29uc3QgeyBNdXRleDo6QXV0b2xvY2sgbG9jayhtTG9jayk7IHJldHVybiBtUGxheWVyOyB9CiAKKworCisgICAgICAgIC8vIEBwYXJhbSB0eXBlIE9mIHRoZSBtZXRhZGF0YSB0byBiZSB0ZXN0ZWQuCisgICAgICAgIC8vIEByZXR1cm4gdHJ1ZSBpZiB0aGUgbWV0YWRhdGEgc2hvdWxkIGJlIGRyb3BwZWQgYWNjb3JkaW5nIHRvCisgICAgICAgIC8vICAgICAgICAgICAgICB0aGUgZmlsdGVycy4KKyAgICAgICAgYm9vbCBzaG91bGREcm9wTWV0YWRhdGEobWVkaWE6Ok1ldGFkYXRhOjpUeXBlIHR5cGUpIGNvbnN0OworCisgICAgICAgIC8vIEFkZCBhIG5ldyBlbGVtZW50IHRvIHRoZSBzZXQgb2YgbWV0YWRhdGEgdXBkYXRlZC4gTm9vcCBpZgorICAgICAgICAvLyB0aGUgZWxlbWVudCBleGlzdHMgYWxyZWFkeS4KKyAgICAgICAgLy8gQHBhcmFtIHR5cGUgT2YgdGhlIG1ldGFkYXRhIHRvIGJlIHJlY29yZGVkLgorICAgICAgICB2b2lkIGFkZE5ld01ldGFkYXRhVXBkYXRlKG1lZGlhOjpNZXRhZGF0YTo6VHlwZSB0eXBlKTsKKwogICAgICAgICBtdXRhYmxlICAgICBNdXRleCAgICAgICAgICAgICAgICAgICAgICAgbUxvY2s7CiAgICAgICAgICAgICAgICAgICAgIHNwPE1lZGlhUGxheWVyQmFzZT4gICAgICAgICBtUGxheWVyOwogICAgICAgICAgICAgICAgICAgICBzcDxNZWRpYVBsYXllclNlcnZpY2U+ICAgICAgbVNlcnZpY2U7CkBAIC0yMTUsNiArMjU0LDE3IEBACiAgICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgICAgICAgICBtU3RhdHVzOwogICAgICAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgbUxvb3A7CiAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgICAgICAgICAgICAgICAgICAgICBtQ29ubklkOworCisgICAgICAgIC8vIE1ldGFkYXRhIGZpbHRlcnMuCisgICAgICAgIG1lZGlhOjpNZXRhZGF0YTo6RmlsdGVyIG1NZXRhZGF0YUFsbG93OyAgLy8gcHJvdGVjdGVkIGJ5IG1Mb2NrCisgICAgICAgIG1lZGlhOjpNZXRhZGF0YTo6RmlsdGVyIG1NZXRhZGF0YURyb3A7ICAvLyBwcm90ZWN0ZWQgYnkgbUxvY2sKKworICAgICAgICAvLyBNZXRhZGF0YSB1cGRhdGVkLiBGb3IgZWFjaCBNRURJQV9JTkZPX01FVEFEQVRBX1VQREFURQorICAgICAgICAvLyBub3RpZmljYXRpb24gd2UgdHJ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gIG1SZXRyaWV2ZXIgPSBOVUxMOworI2VuZGlmCiAgICAgaWYgKG1SZXRyaWV2ZXIgPT0gTlVMTCkgewogICAgICAgICBMT0dFKCJmYWlsZWQgdG8gaW5pdGlhbGl6ZSB0aGUgcmV0cmlldmVyIik7CiAgICAgfQpAQCAtODYsNiArOTMsMzYgQEAKICAgICBJUENUaHJlYWRTdGF0ZTo6c2VsZigpLT5mbHVzaENvbW1hbmRzKCk7CiB9CiAKK3N0YXRpYyBzcDxNZWRpYU1ldGFkYXRhUmV0cmlldmVyQmFzZT4gY3JlYXRlUmV0cmlldmVyKHBsYXllcl90eXBlIHBsYXllclR5cGUpCit7CisgICAgc3A8TWVkaWFNZXRhZGF0YVJldHJpZXZlckJhc2U+IHA7CisgICAgc3dpdGNoIChwbGF5ZXJUeXBlKSB7CisjaWZuZGVmIE5PX09QRU5DT1JFCisgICAgICAgIGNhc2UgUFZfUExBWUVSOgorICAgICAgICAgICAgTE9HVigiY3JlYXRlIHB2IG1ldGFkYXRhIHJldHJpZXZlciIpOworICAgICAgICAgICAgcCA9IG5ldyBQVk1ldGFkYXRhUmV0cmlldmVyKCk7CisgICAgICAgICAgICBicmVhazsKKyNlbmRpZgorICAgICAgICBjYXNlIFZPUkJJU19QTEFZRVI6CisgICAgICAgICAgICBMT0dWKCJjcmVhdGUgdm9yYmlzIG1ldGFkYXRhIHJldHJpZXZlciIpOworICAgICAgICAgICAgcCA9IG5ldyBWb3JiaXNNZXRhZGF0YVJldHJpZXZlcigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgU09OSVZPWF9QTEFZRVI6CisgICAgICAgICAgICBMT0dWKCJjcmVhdGUgbWlkaSBtZXRhZGF0YSByZXRyaWV2ZXIiKTsKKyAgICAgICAgICAgIHAgPSBuZXcgTWlkaU1ldGFkYXRhUmV0cmlldmVyKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIC8vIFRPRE86Cis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heWVyIGlzIG5vdCBpbml0aWFsaXplZCB5ZXQiKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIHN3aXRjaCAoa2V5Q29kZSkgeworICAgIGNhc2UgTUVUQURBVEFfS0VZX0RVUkFUSU9OOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAobU1ldGFkYXRhVmFsdWVzWzBdWzBdID09ICdcMCcpIHsKKyAgICAgICAgICAgICAgICBpbnQgZHVyYXRpb24gPSAtMTsKKyAgICAgICAgICAgICAgICBpZiAobU1pZGlQbGF5ZXItPmdldER1cmF0aW9uKCZkdXJhdGlvbikgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HRSgiZmFpbGVkIHRvIGdldCBkdXJhdGlvbiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc25wcmludGYobU1ldGFkYXRhVmFsdWVzWzBdLCBNQVhfTUVUQURBVEFfU1RSSU5HX0xFTkdUSCwgIiVkIiwgZHVyYXRpb24pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBMT0dWKCJkdXJhdGlvbjogJXMgbXMiLCBtTWV0YWRhdGFWYWx1ZXNbMF0pOworICAgICAgICAgICAgcmV0dXJuIG1NZXRhZGF0YVZhbHVlc1swXTsKKyAgICAgICAgfQorICAgIGRlZmF1bHQ6CisgICAgICAgIExPR0UoIlVuc3VwcG9ydGVkIGtleSBjb2RlICglZCkiLCBrZXlDb2RlKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCit9OworCmRpZmYgLS1naXQgYS9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvTWlkaU1ldGFkYXRhUmV0cmlldmVyLmggYi9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvTWlkaU1ldGFkYXRhUmV0cmlldmVyLmgKbmV3IGZpbGUg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bmUgQU5EUk9JRF9NSURJTUVUQURBVEFSRVRSSUVWRVJfSAorCisjaW5jbHVkZSA8dXRpbHMvdGhyZWFkcy5oPgorI2luY2x1ZGUgPHV0aWxzL0Vycm9ycy5oPgorI2luY2x1ZGUgPG1lZGlhL01lZGlhTWV0YWRhdGFSZXRyaWV2ZXJJbnRlcmZhY2UuaD4KKworI2luY2x1ZGUgIk1pZGlGaWxlLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTWlkaU1ldGFkYXRhUmV0cmlldmVyIDogcHVibGljIE1lZGlhTWV0YWRhdGFSZXRyaWV2ZXJJbnRlcmZhY2UgeworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNaWRpTWV0YWRhdGFSZXRyaWV2ZXIoKSB7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+TWlkaU1ldGFkYXRhUmV0cmlldmVyKCkge30KKworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgICAgICAgICAgc2V0RGF0YVNvdXJjZShjb25zdCBjaGFyICp1cmwpOworICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgICAgICAgICAgc2V0RGF0YVNvdXJjZShpbnQgZmQsIGludDY0X3Qgb2Zmc2V0LCBpbnQ2NF90IGxlbmd0aCk7CisgICAgdmlydHVhbCBjb25zdCBjaGFyKiAgICAgICAgICAgICBleHRyYWN0TWV0YWRhdGEoaW50IGtleUNvZGUpOworCitwcml2YXRlOgorICAgIHN0YXRpYyBjb25zdCB1aW50MzJfdCBNQVhfTUVUQURBVEFfU1RSSU5HX0xFTkdUSCA9IDEyODsKKyAgICB2b2lkIGNsZWFyTWV0YWRhdGFWYWx1ZXMoKTsKKworICAgIE11dGV4ICAgICAgICAgICAgICAgbUxvY2s7CisgICAgc3A8TWlkaUZpbGU+ICAgICAgICBtTWlkaVBsYXllcjsKKyAgICBjaGFyICAgICAgICAgICAgICAgIG1NZXRhZGF0YVZhbHV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CisgICAgTE9HVigiaW5pdENoZWNrIik7CisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBTdGFnZWZyaWdodFBsYXllcjo6c2V0RGF0YVNvdXJjZShjb25zdCBjaGFyICp1cmwpIHsKKyAgICBMT0dWKCJzZXREYXRhU291cmNlKCclcycpIiwgdXJsKTsKKworICAgIHJlc2V0KCk7CisgICAgbVBsYXllciA9IG5ldyBNZWRpYVBsYXllckltcGwodXJsKTsKKworICAgIHN0YXR1c190IGVyciA9IG1QbGF5ZXItPmluaXRDaGVjaygpOworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgZGVsZXRlIG1QbGF5ZXI7CisgICAgICAgIG1QbGF5ZXIgPSBOVUxMOworICAgIH0gZWxzZSB7CisgICAgICAgIG1QbGF5ZXItPnNldEF1ZGlvU2luayhtQXVkaW9TaW5rKTsKKyAgICB9CisKKyAgICByZXR1cm4gZXJyOworfQorCitzdGF0dXNfdCBTdGFnZWZyaWdodFBsYXllcjo6c2V0RGF0YVNvdXJjZShpbnQgZmQsIGludDY0X3Qgb2Zmc2V0LCBpbnQ2NF90IGxlbmd0aCkgeworICAgIExPR1YoInNldERhdGFTb3VyY2UoJWQsICVsbGQsICVsbGQpIiwgZmQsIG9mZnNldCwgbGVuZ3RoKTsKKworICAgIHJlc2V0KCk7CisgICAgbVBsYXllciA9IG5ldyBNZWRpYVBsYXllckltcGwoZmQsIG9mZnNldCwgbGVuZ3RoKTsKKworICAgIHN0YXR1c190IGVyciA9IG1QbGF5ZXItPmluaXRDaGVjaygpOworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgZGVsZXRlIG1QbGF5ZXI7CisgICAgICAgIG1QbGF5ZXIgPSBOVUxMOworICAgIH0gZWxzZSB7CisgICAgICAgIG1QbGF5ZXItPnNldEF1ZGlvU2luayhtQXVkaW9TaW5rKTsKKyAgICB9CisKKyAgICByZXR1cm4gZXJyOworfQorCitzdGF0dXNfdCBTdGFnZWZyaWdodFBsYXllcjo6c2V0VmlkZW9TdXJmYWNlKGNvbnN0IHNwPElTdXJmYWNlPiAmc3VyZmFjZSkgeworICAgIExPR1YoInNldFZpZGVvU3VyZmFjZSIpOworCisgICAgaWYgKG1QbGF5ZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICB9CisKKyAgICBtUGxheWVyLT5zZXRJU3VyZmFjZShzdXJmYWNlKTsKKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgU3RhZ2VmcmlnaHRQbGF5ZXI6OnByZXBhcmUoKSB7CisgICAgTE9HVigicHJlcGFyZSIpOworCisgICAgaWYgKG1QbGF5ZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICB9CisKKyAgICBzZW5kRXZlbnQoCisgICAgICAgICAgICBNRURJQV9TRVRfVklERU9fU0laRSwKKyAgICAgICAgICAgIG1QbGF5ZXItPmdldFdpZHRoKCksIG1QbGF5ZXItPmdldEhlaWdodCgpKTsKKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgU3RhZ2VmcmlnaHRQbGF5ZXI6OnByZXBhcmVBc3luYygpIHsKKyAgICBMT0dWKCJwcmVwYXJlQXN5bmMiKTsKKworICAgIHN0YXR1c190IGVyciA9IHByZXBhcmUoKTsKKworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICBzZW5kRXZlbnQoTUVESUFfUFJFUEFSRUQpOworCisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBTdGFnZWZyaWdodFBsYXllcjo6c3RhcnQoKSB7CisgICAgTE9HVigic3RhcnQiKTsKKworICAgIGlmIChtUGxheWVyID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuIE5PX0lOSVQ7CisgICAgfQorCisgICAgbVBsYXllci0+cGxheSgpOworCisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBTdGFnZWZyaWdodFBsYXllcjo6c3RvcCgpIHsKKyAgICBMT0dWKCJzdG9wIik7CisKKyAgICBpZiAobVBsYXllciA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiBOT19JTklUOworICAgIH0KKworICAgIHJlc2V0KCk7CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IFN0YWdlZnJpZ2h0UGxheWVyOjpwYXVzZSgpIHsKKyAgICBMT0dWKCJwYXVzZSIpOworCisgICAgaWYgKG1QbGF5ZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICB9CisKKyAgICBtUGxheWVyLT5wYXVzZSgpOworCisgICAgcmV0dXJuIE9LOworfQorCitib29sIFN0YWdlZnJpZ2h0UGxheWVyOjppc1BsYXlpbmcoKSB7CisgICAgTE9HVigiaXNQbGF5aW5nIik7CisgICAgcmV0dXJuIG1QbGF5ZXIgIT0gTlVMTCAmJiBtUGxheWVyLT5pc1BsYXlpbmcoKTsKK30KKworc3RhdHVzX3QgU3RhZ2VmcmlnaHRQbGF5ZXI6OnNlZWtUbyhpbnQgbXNlYykgeworICAgIExPR1YoInNlZWtUbyIpOworCisgICAgaWYgKG1QbGF5ZXIgPT0gTlVMTCkgeworICAgICAgICByZXR1cm4gTk9fSU5JVDsKKyAgICB9CisKKyAgICBzdGF0dXNfdCBlcnIgPSBtUGxheWVyLT5zZWVrVG8oKGludDY0X3QpbXNlYyAqIDEwMDApOworCisgICAgc2VuZEV2ZW50KE1FRElBX1NFRUtfQ09NUExFVEUpOworCisgICAgcmV0dXJuIGVycjsKK30KKworc3RhdHVzX3QgU3RhZ2VmcmlnaHRQbGF5ZXI6OmdldEN1cnJlbnRQb3NpdGlvbihpbnQgKm1zZWMpIHsKKyAgICBMT0dWKCJnZXRDdXJyZW50UG9zaXRpb24iKTsKKworICAgIGlmIChtUGxheWVyID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuIE5PX0lOSVQ7CisgICAgfQorCisgICAgKm1z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9PUEVSQVRJT047CisgICAgfQorCisgICAgbVVybCA9IHN0cmR1cCh1cmwpOworCisgICAgc3RhdHVzX3Qgc3RhdHVzID0gcGFyc2VVcmwoKTsKKworICAgIGlmIChPSyAhPSBzdGF0dXMpIHsKKyAgICAgICAgcmVzZXRJbnRlcm5hbCgpOworICAgICAgICByZXR1cm4gc3RhdHVzOworICAgIH0KKworICAgIDo6ZGxlcnJvcigpOyAgLy8gQ2xlYXJzIGFueSBwZW5kaW5nIGVycm9yLgorCisgICAgLy8gTG9hZCB0aGUgdGVzdCBwbGF5ZXIgZnJvbSB0aGUgdXJsLiBkbG9wZW4gd2lsbCBmYWlsIGlmIHRoZSBsaWIKKyAgICAvLyBpcyBub3QgdGhlcmUuIGRscyBhcmUgdW5kZXIgL3N5c3RlbS9saWIKKyAgICAvLyBOb25lIG9mIHRoZSBlbnRyeSBwb2ludHMgc2hvdWxkIGJlIE5VTEwuCisgICAgbUhhbmRsZSA9IDo6ZGxvcGVuKG1GaWxlbmFtZSwgUlRMRF9OT1cgfCBSVExEX0dMT0JBTCk7CisgICAgaWYgKCFtSGFuZGxlKSB7CisgICAgICAgIExPR0UoImRsb3BlbiBmYWlsZWQ6ICVzIiwgOjpkbGVycm9yKCkpOworICAgICAgICByZXNldEludGVybmFsKCk7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgIC8vIExvYWQgdGhlIDIgZW50cnkgcG9pbnRzIHRvIGNyZWF0ZSBhbmQgZGVsZXRlIGluc3RhbmNlcy4KKyAgICBjb25zdCBjaGFyICplcnI7CisgICAgbU5ld1BsYXllciA9IHJlaW50ZXJwcmV0X2Nhc3Q8TkVXX1BMQVlFUj4oZGxzeW0obUhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV3UGxheWVyIikpOworICAgIGVyciA9IDo6ZGxlcnJvcigpOworICAgIGlmIChlcnIgfHwgbU5ld1BsYXllciA9PSBOVUxMKSB7CisgICAgICAgIC8vIGlmIGVyciBpcyBOVUxMIHRoZSBzdHJpbmcgPG51bGw+IGlzIGluc2VydGVkIGluIHRoZSBsb2dzID0+CisgICAgICAgIC8vIG1OZXdQbGF5ZXIgd2FzIE5VTEwuCisgICAgICAgIExPR0UoImRsc3ltIGZvciBuZXdQbGF5ZXIgZmFpbGVkICVzIiwgZXJyKTsKKyAgICAgICAgcmVzZXRJbnRlcm5hbCgpOworICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICB9CisKKyAgICBtRGVsZXRlUGxheWVyID0gcmVpbnRlcnByZXRfY2FzdDxERUxFVEVfUExBWUVSPihkbHN5bShtSGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJkZWxldGVQbGF5ZXIiKSk7CisgICAgZXJyID0gOjpkbGVycm9yKCk7CisgICAgaWYgKGVyciB8fCBtRGVsZXRlUGxheWVyID09IE5VTEwpIHsKKyAgICAgICAgTE9HRSgiZGxzeW0gZm9yIGRlbGV0ZVBsYXllciBmYWlsZWQgJXMiLCBlcnIpOworICAgICAgICByZXNldEludGVybmFsKCk7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgIG1QbGF5ZXIgPSAoKm1OZXdQbGF5ZXIpKCk7CisgICAgcmV0dXJuIG1QbGF5ZXItPnNldERhdGFTb3VyY2UobUNvbnRlbnRVcmwpOworfQorCisvLyBJbnRlcm5hbCBjbGVhbnVwLgorc3RhdHVzX3QgVGVzdFBsYXllclN0dWI6OnJlc2V0SW50ZXJuYWwoKQoreworICAgIGlmKG1VcmwpIHsKKyAgICAgICAgZnJlZShtVXJsKTsKKyAgICAgICAgbVVybCA9IE5VTEw7CisgICAgfQorICAgIG1GaWxlbmFtZSA9IE5VTEw7CisgICAgbUNvbnRlbnRVcmwgPSBOVUxMOworCisgICAgaWYgKG1QbGF5ZXIpIHsKKyAg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TsKKyAgICAgICAgICAgICAgICBpZiAobVZvcmJpc1BsYXllci0+Z2V0RHVyYXRpb24oJmR1cmF0aW9uKSAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgICAgICBMT0dFKCJmYWlsZWQgdG8gZ2V0IGR1cmF0aW9uIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzbnByaW50ZihtTWV0YWRhdGFWYWx1ZXNbMF0sIE1BWF9NRVRBREFUQV9TVFJJTkdfTEVOR1RILCAiJWQiLCBkdXJhdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBMT0dWKCJkdXJhdGlvbjogJXMgbXMiLCBtTWV0YWRhdGFWYWx1ZXNbMF0pOworICAgICAgICAgICAgcmV0dXJuIG1NZXRhZGF0YVZhbHVlc1swXTsKKyAgICAgICAgfQorICAgIGRlZmF1bHQ6CisgICAgICAgIExPR0UoIlVuc3VwcG9ydGVkIGtleSBjb2RlICglZCkiLCBrZXlDb2RlKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCit9OworCmRpZmYgLS1naXQgYS9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvVm9yYmlzTWV0YWRhdGFSZXRyaWV2ZXIuaCBiL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9Wb3JiaXNNZXRhZGF0YVJldHJpZXZlci5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjFjNTdmZTMKLS0tIC9kZXYvbnVsbAorKysgYi9tZWRpYS9saWJtZWRpYXBsYXllcnNlcnZpY2UvVm9yYmlzTWV0YWRhdGFSZXRyaWV2ZXIuaApAQCAtMCwwICsxLDQ5IEBACisvKgorKioKKyoqIENvcHlyaWdodCAyMDA5LCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0CisqKgorK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sKKyAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgaWYgKGhlYWRlciAmIDB4ODMpIHsKKyAgICAgICAgLy8gUGFkZGluZyBiaXRzIG11c3QgYmUgMC4KKworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIHVuc2lnbmVkIEZUID0gKGhlYWRlciA+PiAzKSAmIDB4MGY7CisKKyAgICBpZiAoRlQgPiA4IHx8ICghbUlzV2lkZSAmJiBGVCA+IDcpKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgfQorCisgICAgc3RhdGljIGNvbnN0IHNpemVfdCBrRnJhbWVTaXplTkJbOF0gPSB7CisgICAgICAgIDk1LCAxMDMsIDExOCwgMTM0LCAxNDgsIDE1OSwgMjA0LCAyNDQKKyAgICB9OworICAgIHN0YXRpYyBjb25zdCBzaXplX3Qga0ZyYW1lU2l6ZVdCWzldID0geworICAgICAgICAxMzIsIDE3NywgMjUzLCAyODUsIDMxNywgMzY1LCAzOTcsIDQ2MSwgNDc3CisgICAgfTsKKworICAgIHNpemVfdCBmcmFtZVNpemUgPSBtSXNXaWRlID8ga0ZyYW1lU2l6ZVdCW0ZUXSA6IGtGcmFtZVNpemVOQltGVF07CisKKyAgICAvLyBSb3VuZCB1cCBiaXRzIHRvIGJ5dGVzIGFuZCBhZGQgMSBmb3IgdGhlIGhlYWRlciBieXRlLgorICAgIGZyYW1lU2l6ZSA9IChmcmFtZVNpemUgKyA3KSAvIDggKyAxOworCisgICAgbiA9IG1EYXRhU291cmNlLT5yZWFkX2F0KG1PZmZzZXQsIGJ1ZmZlci0+ZGF0YSgpLCBmcmFtZVNpemUpOworCisgICAgaWYgKG4gIT0gKHNzaXplX3QpZnJhbWVTaXplKSB7CisgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOworICAgICAgICBidWZmZXIgPSBOVUxMOworCisgICAgICAgIHJldHVyb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gICAgICptaW1lVHlwZSA9ICJhdWRpby9hbXItd2IiOworICAgICAgICAqY29uZmlkZW5jZSA9IDAuNTsKKworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICByZXR1cm4gZmFsc2U7Cit9CisKK30gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9BbmRyb2lkLm1rIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvQW5kcm9pZC5tawpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jM2E0NzIyCi0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvQW5kcm9pZC5tawpAQCAtMCwwICsxLDU1IEBACitMT0NBTF9QQVRIOj0gJChjYWxsIG15LWRpcikKK2luY2x1ZGUgJChDTEVBUl9WQVJTKQorCitMT0NBTF9TUkNfRklMRVM6PSAgICAgICAgICAgICAgICAgXAorICAgICAgICBBTVJFeHRyYWN0b3IuY3BwICAgICAgICAgIFwKKyAgICAgICAgQ2FjaGluZ0RhdGFTb3VyY2UuY3BwICAgICBcCisgICAgICAgIERhdGFTb3VyY2UuY3BwICAgICAgICAgICAgXAorICAgICAgICBGaWxlU291cmNlLmNwcCAgICAgICAgICAgIFwKKyAgICAgICAgSFRUUERhdGFTb3VyY2UuY3BwICAgICAgICBcCisgICAgICAgIEhUVFBTdHJlYW0uY3BwICAgICAgICAgICAgXAorICAgICAgICBNUDNFeHRyYWN0b3IuY3BwICAgICAgICAgIFwKKyAgICAgICAgTVBFRzRFeHRyYWN0b3IuY3BwICAgICAgICBcCisgICAgICAgIE1QRUc0V3JpdGVyLmNwcCAgICAgICAgICAgXAorICAgICAgICBNZWRpYUJ1ZmZlci5jcHAgICAgICAgICAgIFwKKyAgICAgICAgTWVkaWFCdWZmZXJHcm91cC5jcHAgICAgICBcCisgICAgICAgIE1lZGlhRXh0cmFjdG9yLmNwcCAgICAgICAgXAorICAgICAgICBNZWRpYVBsYXllckltcGwuY3BwICAgICAgIFwKKyAgICAgICAgTWVkaWFTb3VyY2UuY3BwICAgICAgICAgICBcCisgICAgICAgIE1ldGFEYXRhLmNwcCAgICAgICAgICAgICAgXAorICAgICAgICBNbWFwU291cmNlLmNwcCAgICAgICAgICAgIFwKKyAgICAgICAgT01YQ29kZWMuY3BwICAgICAgICAgICAgICBcCisgICAgICAgIFNhbXBsZVRhYmxlLmNwcCAgICAgICAgICAgXAorICAgICAgICBTaG91dGNhc3RTb3VyY2UuY3BwICAgICAgIFwKKyAgICAgICAgVGltZVNvdXJjZS5jcHAgICAgICAgICAgICBcCisgICAgICAgIFRpbWVkRXZlbnRRdWV1ZS5jcHAgICAgICAgXAorICAgICAgICBVdGlscy5jcHAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgQXVkaW9QbGF5ZXIuY3BwICAgICAgICAgICBcCisgICAgICAgIEVTRFMuY3BwICAgICAgICAgICAgICAgICAgXAorICAgICAgICBPTVhDbGllbnQuY3BwICAgICAgICAgICAgIFwKKyAgICAgICAgc3RyaW5nLmNwcAorCitMT0NBTF9DX0lOQ0xVREVTOj0gXAorICAgICAgICAkKFRPUCkvZXh0ZXJuYWwvb3BlbmNvcmUvZXh0ZXJuX2xpYnNfdjIva2hyb25vcy9vcGVubWF4L2luY2x1ZGUgXAorICAgICAgICAkKFRPUCkvZXh0ZXJuYWwvb3BlbmNvcmUvYW5kcm9pZAorCitMT0NBTF9TSEFSRURfTElCUkFSSUVTIDo9IFwKKyAgICAgICAgbGliYmluZGVyICAgICAgICAgXAorICAgICAgICBsaWJtZWRpYSAgICAgICAgICBcCisgICAgICAgIGxpYnV0aWxzICAgICAgICAgIFwKKyAgICAgICAgbGliY3V0aWxzICAgICAgICAgXAorICAgICAgICBsaWJ1aQorCitpZmVxICgkKFRBUkdFVF9PUyktJChUQVJHRVRfU0lNVUxBVE9SKSxsaW51eC10cnVlKQorICAgICAgICBMT0N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0hFQ0soc3VjY2Vzcyk7CisKKyAgICBpZiAobUF1ZGlvU2luay5nZXQoKSAhPSBOVUxMKSB7CisgICAgICAgIHN0YXR1c190IGVyciA9IG1BdWRpb1NpbmstPm9wZW4oCisgICAgICAgICAgICAgICAgbVNhbXBsZVJhdGUsIG51bUNoYW5uZWxzLCBBdWRpb1N5c3RlbTo6UENNXzE2X0JJVCwKKyAgICAgICAgICAgICAgICBERUZBVUxUX0FVRElPU0lOS19CVUZGRVJDT1VOVCwKKyAgICAgICAgICAgICAgICAmQXVkaW9QbGF5ZXI6OkF1ZGlvU2lua0NhbGxiYWNrLCB0aGlzKTsKKyAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICAgICAgbUxhdGVuY3lVcyA9IChpbnQ2NF90KW1BdWRpb1NpbmstPmxhdGVuY3koKSAqIDEwMDA7CisgICAgICAgIG1GcmFtZVNpemUgPSBtQXVkaW9TaW5rLT5mcmFtZVNpemUoKTsKKworICAgICAgICBtQXVkaW9TaW5rLT5zdGFydCgpOworICAgIH0gZWxzZSB7CisgICAgICAgIG1BdWRpb1RyYWNrID0gbmV3IEF1ZGlvVHJhY2soCisgICAgICAgICAgICAgICAgQXVkaW9TeXN0ZW06Ok1VU0lDLCBtU2FtcGxlUmF0ZSwgQXVkaW9TeXN0ZW06OlBDTV8xNl9CSVQsCisgICAgICAgICAgICAgICAgKG51bUNoYW5uZWxzID09IDIpCisgICAgICAgICAgICAgICAgICAgID8gQXVkaW9TeXN0ZW06OkNIQU5ORUxfT1VUX1NURVJFTworICAgICAgICAgICAgICAgICAgICA6IEF1ZGlvU3lzdGVtOjpDSEFOTkVMX09VVF9NT05PLAorICAgICAgICAgICAgICAgIDgxOTIsIDAsICZBdWRpb0NhbGxiYWNrLCB0aGlzLCAwKTsKKworICAgICAgICBDSEVDS19FUShtQXVkaW9UcmFjay0+aW5pdENoZWNrKCksIE9LKTsKKworICAgICAgICBtTGF0ZW5jeVVzID0gKGludDY0X3QpbU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AgICAgICByZXR1cm47CisgICAgfQorCisgICAgQXVkaW9UcmFjazo6QnVmZmVyICpidWZmZXIgPSAoQXVkaW9UcmFjazo6QnVmZmVyICopaW5mbzsKKyAgICBmaWxsQnVmZmVyKGJ1ZmZlci0+cmF3LCBidWZmZXItPnNpemUpOworfQorCit2b2lkIEF1ZGlvUGxheWVyOjpmaWxsQnVmZmVyKHZvaWQgKmRhdGEsIHNpemVfdCBzaXplKSB7CisgICAgaWYgKG1OdW1GcmFtZXNQbGF5ZWQgPT0gMCkgeworICAgICAgICBMT0dJKCJBdWRpb0NhbGxiYWNrIik7CisgICAgfQorCisgICAgc2l6ZV90IHNpemVfZG9uZSA9IDA7CisgICAgc2l6ZV90IHNpemVfcmVtYWluaW5nID0gc2l6ZTsKKyAgICB3aGlsZSAoc2l6ZV9yZW1haW5pbmcgPiAwKSB7CisgICAgICAgIE1lZGlhU291cmNlOjpSZWFkT3B0aW9ucyBvcHRpb25zOworCisgICAgICAgIHsKKyAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7CisKKyAgICAgICAgICAgIGlmIChtU2Vla2luZykgeworICAgICAgICAgICAgICAgIG9wdGlvbnMuc2V0U2Vla1RvKG1TZWVrVGltZVVzKTsKKworICAgICAgICAgICAgICAgIGlmIChtSW5wdXRCdWZmZXIgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgICAgICBtSW5wdXRCdWZmZXItPnJlbGVhc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgbUlucHV0QnVmZmVyID0gTlVMTDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVNlZWtpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChtSW5wdXRCdWZmZXIgPT0gTlVMTCkgeworICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gbVNvdXJjZS0+cmVhZCgmbUlucHV0QnVmZmVyLCAmb3B0aW9ucyk7CisKKyAgICAgICAgICAgIENIRUNLKChlcnIgPT0gT0sgJiYgbUlucHV0QnVmZmVyICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgfHwgKGVyciAhPSBPSyAmJiBtSW5wdXRCdWZmZXIgPT0gTlVMTCkpOworCisgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAgICAgbWVtc2V0KChjaGFyICopZGF0YSArIHNpemVfZG9uZSwgMCwgc2l6ZV9yZW1haW5pbmcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQzMl90IHVuaXRzLCBzY2FsZTsKKyAgICAgICAgICAgIGJvb2wgc3VjY2VzcyA9CisgICAgICAgICAgICAgICAgbUlucHV0QnVmZmVyLT5tZXRhX2RhdGEoKS0+ZmluZEludDMyKGtLZXlUaW1lVW5pdHMsICZ1bml0cyk7CisgICAgICAgICAgICBzdWNjZXNzID0gc3VjY2VzcyAmJgorICAgICAgICAgICAgICAgIG1JbnB1dEJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQzMihrS2V5VGltZVNjYWxlLCAmc2NhbGUpOworICAgICAgICAgICAgQ0hFQ0soc3VjY2Vzcyk7CisKKyAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7CisgICAgICAgICAgICBtUG9zaXRpb25UaW1lTWVkaWFVcyA9IChpbnQ2NF90KXVuaXRzICogMTAwMDAwMCAvIHNjYWxlOworCisgICAgICAgICAgICBtUG9zaXRpb25UaW1lUmVhbFVzID0KKyAgICAgICAgICAgICAgICAoKG1OdW1GcmFtZXNQbGF5ZWQgKyBzaXplX2RvbmUgLyBtRnJhbWVTaXplKSAqIDEwMDAwMDApCisgICAgICAgICAgICAgICAgICAgIC8gbVNhbXBsZVJhdGU7CisgICAgICAgIH0KKworICAgICAgICBpZiAobUlucHV0QnVmZmVyLT5yYW5nZV9sZW5ndGgoKSA9PSAwKSB7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c2V0IC0gb2Zmc2V0ICUgbVBhZ2VTaXplOworICAgICAgICAgICAgc3NpemVfdCBuID0gbVNvdXJjZS0+cmVhZF9hdChwYWdlLT5tT2Zmc2V0LCBwYWdlLT5tRGF0YSwgbVBhZ2VTaXplKTsKKyAgICAgICAgICAgIGlmIChuIDwgMCkgeworICAgICAgICAgICAgICAgIHBhZ2UtPm1MZW5ndGggPSAwOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBwYWdlLT5tTGVuZ3RoID0gKHNpemVfdCluOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUZpcnN0LT5tUHJldiA9IHBhZ2U7CisgICAgICAgICAgICBwYWdlLT5tTmV4dCA9IG1GaXJzdDsKKyAgICAgICAgICAgIHBhZ2UtPm1QcmV2ID0gTlVMTDsKKyAgICAgICAgICAgIG1GaXJzdCA9IHBhZ2U7CisKKyAgICAgICAgICAgIGlmIChuIDwgMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAob2Zmc2V0ID49IHBhZ2UtPm1PZmZzZXQgKyAob2ZmX3QpcGFnZS0+bUxlbmd0aCkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gTW92ZSAicGFnZSIgdG8gdGhlIGZyb250IGluIExSVSBvcmRlci4KKyAgICAgICAgICAgIGlmIChwYWdlLT5tTmV4dCAhPSBOVUxMKSB7CisgICAgICAgICAgICAgICAgcGFnZS0+bU5leHQtPm1QcmV2ID0gcGFnZS0+bVByZXY7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1MYXN0ID0gcGFnZS0+bVByZXY7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwYWdlLT5tUHJldiAhPSBOVUxMKSB7CisgICAgICAgICAgICAgICAgcGFnZS0+bVByZXYtPm1OZXh0ID0gcGFnZS0+bU5leHQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1GaXJzdCA9IHBhZ2UtPm1OZXh0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtRmlyc3QtPm1QcmV2ID0gcGFnZTsKKyAgICAgICAgICAgIHBhZ2UtPm1OZXh0ID0gbUZpcnN0OworICAgICAgICAgICAgcGFnZS0+bVByZXYgPSBOVUxMOworICAgICAgICAgICAgbUZpcnN0ID0gcGFnZTsKKyAgICAgICAgfQorCisgICAgICAgIHNpemVfdCBjb3B5ID0gcGFnZS0+bUxlbmd0aCAtIChvZmZzZXQgLSBwYWdlLT5tT2Zmc2V0KTsKKyAgICAgICAgaWYgKGNvcHkgPiBzaXplKSB7CisgICAgICAgICAgICBjb3B5ID0gc2l6ZTsKKyAgICAgICAgfQorICAgICAgICBtZW1jcHkoZGF0YSwoY29uc3QgY2hhciAqKXBhZ2UtPm1EYXRhICsgKG9mZnNldCAtIHBhZ2UtPm1PZmZzZXQpLAorICAgICAgICAgICAgICAgY29weSk7CisKKyAgICAgICAgdG90YWwgKz0gY29weTsKKworICAgICAgICBpZiAocGFnZS0+bUxlbmd0aCA8IG1QYWdlU2l6ZSkgeworICAgICAgICAgICAgLy8gVGhpcyB3YXMgdGhlIGZpbmFsIHBhZ2UuIFRoZXJlIGlzIG5vIG1vcmUgZGF0YSBiZXlvbmQgaXQuCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIG9mZnNldCArPSBjb3B5OworICAgICAgICBzaXplIC09IGNvcHk7CisgICAgICAgIGRhdGEgPSAoY2hhciAqKWRhdGEgKyBjb3B5OworICAgIH0KKworICAgIHJldHVybiB0b3RhbDsKK30KKworQ2FjaGluZ0RhdGFTb3VyY2U6OlBhZ2UgKkNhY2hpbmdEYXRhU291cmNlOjphbGxvY2F0ZV9wYWdlKCkgeworICAgIC8vIFRoZSBsYXN0IHBhZ2UgaXMgdGhlIGxlYXN0IHJlY2Vud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VsZXRlW10gbURhdGE7CisgICAgbURhdGEgPSBOVUxMOworfQorCitzdGF0dXNfdCBFU0RTOjpJbml0Q2hlY2soKSBjb25zdCB7CisgICAgcmV0dXJuIG1Jbml0Q2hlY2s7Cit9CisKK3N0YXR1c190IEVTRFM6OmdldENvZGVjU3BlY2lmaWNJbmZvKGNvbnN0IHZvaWQgKipkYXRhLCBzaXplX3QgKnNpemUpIGNvbnN0IHsKKyAgICBpZiAobUluaXRDaGVjayAhPSBPSykgeworICAgICAgICByZXR1cm4gbUluaXRDaGVjazsKKyAgICB9CisKKyAgICAqZGF0YSA9ICZtRGF0YVttRGVjb2RlclNwZWNpZmljT2Zmc2V0XTsKKyAgICAqc2l6ZSA9IG1EZWNvZGVyU3BlY2lmaWNMZW5ndGg7CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IEVTRFM6OnNraXBEZXNjcmlwdG9ySGVhZGVyKAorICAgICAgICBzaXplX3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSwKKyAgICAgICAgdWludDhfdCAqdGFnLCBzaXplX3QgKmRhdGFfb2Zmc2V0LCBzaXplX3QgKmRhdGFfc2l6ZSkgY29uc3QgeworICAgIGlmIChzaXplID09IDApIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICB9CisKKyAgICAqdGFnID0gbURhdGFbb2Zmc2V0KytdOworICAgIC0tc2l6ZTsKKworICAgICpkYXRhX3NpemUgPSAwOworICAgIGJvb2wgbW9yZTsKKyAgICBkbyB7CisgICAgICAgIGlmIChzaXplID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgIH0KKworICAgICAgICB1aW50OF90IHggPSBtRGF0YVtvZmZzZXQrK107CisgICAgICAgIC0tc2l6ZTsKKworICAgICAgICAqZGF0YV9zaXplID0gKCpkYXRhX3NpemUgPDwgNykgfCAoeCAmIDB4N2YpOworICAgICAgICBtb3JlID0gKHgg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DUnN0cmVhbUZsYWcgPSBtRGF0YVtvZmZzZXRdICYgMHgyMDsKKworICAgICsrb2Zmc2V0OworICAgIC0tc2l6ZTsKKworICAgIGlmIChzdHJlYW1EZXBlbmRlbmNlRmxhZykgeworICAgICAgICBvZmZzZXQgKz0gMjsKKyAgICAgICAgc2l6ZSAtPSAyOworICAgIH0KKworICAgIGlmIChVUkxfRmxhZykgeworICAgICAgICBpZiAob2Zmc2V0ID49IHNpemUpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgIH0KKyAgICAgICAgdW5zaWduZWQgVVJMbGVuZ3RoID0gbURhdGFbb2Zmc2V0XTsKKyAgICAgICAgb2Zmc2V0ICs9IFVSTGxlbmd0aCArIDE7CisgICAgICAgIHNpemUgLT0gVVJMbGVuZ3RoICsgMTsKKyAgICB9CisKKyAgICBpZiAoT0NSc3RyZWFtRmxhZykgeworICAgICAgICBvZmZzZXQgKz0gMjsKKyAgICAgICAgc2l6ZSAtPSAyOworICAgIH0KKyAgICAKKyAgICBpZiAob2Zmc2V0ID49IHNpemUpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICB9CisKKyAgICB1aW50OF90IHRhZzsKKyAgICBzaXplX3Qgc3ViX29mZnNldCwgc3ViX3NpemU7CisgICAgc3RhdHVzX3QgZXJyID0gc2tpcERlc2NyaXB0b3JIZWFkZXIoCisgICAgICAgICAgICBvZmZzZXQsIHNpemUsICZ0YWcsICZzdWJfb2Zmc2V0LCAmc3ViX3NpemUpOworCisgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIGlmICh0YWcgIT0ga1RhZ19EZWNvZGVyQ29uZmlnRGVzY3JpcHRvcikgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIGVyciA9IHBhcnNlRGVjb2RlckNvbmZpZ0Rlc2NyaXB0b3Ioc3ViX29mZnNldCwgc3ViX3NpemUpOworCisgICAgcmV0dXJuIGVycjsKK30KKworc3RhdHVzX3QgRVNEUzo6cGFyc2VEZWNvZGVyQ29uZmlnRGVzY3JpcHRvcihzaXplX3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSkgeworICAgIGlmIChzaXplIDwgMTMpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICB9CisKKyAgICBvZmZzZXQgKz0gMTM7CisgICAgc2l6ZSAtPSAxMzsKKworICAgIGlmIChzaXplID09IDApIHsKKyAgICAgICAgbURlY29kZXJTcGVjaWZpY09mZnNldCA9IDA7CisgICAgICAgIG1EZWNvZGVyU3BlY2lmaWNMZW5ndGggPSAwOworICAgICAgICByZXR1cm4gT0s7CisgICAgfQorCisgICAgdWludDhfdCB0YWc7CisgICAgc2l6ZV90IHN1Yl9vZmZzZXQsIHN1Yl9zaXplOworICAgIHN0YXR1c190IGVyciA9IHNraXBEZXNjcmlwdG9ySGVhZGVyKAorICAgICAgICAgICAgb2Zmc2V0LCBzaXplLCAmdGFnLCAmc3ViX29mZnNldCwgJnN1Yl9zaXplKTsKKworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICBpZiAodGFnICE9IGtUYWdfRGVjb2RlclNwZWNpZmljSW5mbykgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIG1EZWNvZGVyU3BlY2lmaWNPZmZzZXQgPSBzdWJfb2Zmc2V0OworICAgIG1EZWNvZGVyU3BlY2lmaWNMZW5ndGggPSBzdWJfc2l6ZTsKKworICAgIHJldHVybiBPSzsKK30KKworfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvRmlsZVNvdXJjZS5jcHAgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9GaWxlU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gT0sKKyAgICAgICAgICAgIHx8IChlcnIgPSBtSHR0cC5zZW5kKG1QYXRoKSkgIT0gT0sKKyAgICAgICAgICAgIHx8IChlcnIgPSBtSHR0cC5zZW5kKCIgSFRUUC8xLjFcclxuIikpICE9IE9LCisgICAgICAgICAgICB8fCAoZXJyID0gbUh0dHAuc2VuZChob3N0KSkgIT0gT0sKKyAgICAgICAgICAgIHx8IChlcnIgPSBtSHR0cC5zZW5kKHJhbmdlKSkgIT0gT0sKKyAgICAgICAgICAgIHx8IChlcnIgPSBtSHR0cC5zZW5kKCJcclxuIikpICE9IE9LCisgICAgICAgICAgICB8fCAoZXJyID0gbUh0dHAucmVjZWl2ZV9oZWFkZXIoJmh0dHBfc3RhdHVzKSkgIT0gT0spIHsKKworICAgICAgICAgICAgaWYgKGF0dGVtcHQgPT0gMykgeworICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1IdHRwLmNvbm5lY3QobUhvc3QsIG1Qb3J0KTsKKyAgICAgICAgICAgICsrYXR0ZW1wdDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKChodHRwX3N0YXR1cyAvIDEwMCkgIT0gMikgeworICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICB9CisKKyAgICBzdHJpbmcgdmFsdWU7CisgICAgaWYgKCFtSHR0cC5maW5kX2hlYWRlcl92YWx1ZSgiQ29udGVudC1MZW5ndGgiLCAmdmFsdWUpKSB7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgIGNoYXIgKmVuZDsKKyAgICB1bnNpZ25lZCBsb25nIGNvbnRlbnRMZW5ndGggPSBzdHJ0b3VsKHZhbHVlLmNfc3RyKCksICZlbmQsIDEwKTsKKworICAgIHNzaXplX3QgbnVtX2J5dGVzX3JlY2VpdmVkID0gbUh0dHAucmVjZW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IGdvdG8gZXhpdDE7CisgICAgfQorCisgICAgbVN0YXRlID0gQ09OTkVDVEVEOworCisgICAgcmV0dXJuIE9LOworCitleGl0MToKKyAgICBjbG9zZShtU29ja2V0KTsKKyAgICBtU29ja2V0ID0gLTE7CisKKyAgICByZXR1cm4gZXJyOworfQorCitzdGF0dXNfdCBIVFRQU3RyZWFtOjpkaXNjb25uZWN0KCkgeworICAgIGlmIChtU3RhdGUgIT0gQ09OTkVDVEVEKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9OT1RfQ09OTkVDVEVEOworICAgIH0KKworICAgIENIRUNLKG1Tb2NrZXQgPj0gMCk7CisgICAgY2xvc2UobVNvY2tldCk7CisgICAgbVNvY2tldCA9IC0xOworCisgICAgbVN0YXRlID0gUkVBRFk7CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IEhUVFBTdHJlYW06OnNlbmQoY29uc3QgY2hhciAqZGF0YSwgc2l6ZV90IHNpemUpIHsKKyAgICBpZiAobVN0YXRlICE9IENPTk5FQ1RFRCkgeworICAgICAgICByZXR1cm4gRVJST1JfTk9UX0NPTk5FQ1RFRDsKKyAgICB9CisKKyAgICB3aGlsZSAoc2l6ZSA+IDApIHsKKyAgICAgICAgc3NpemVfdCBuID0gOjpzZW5kKG1Tb2NrZXQsIGRhdGEsIHNpemUsIDApOworCisgICAgICAgIGlmIChuIDwgMCkgeworICAgICAgICAgICAgaWYgKGVycm5vID09IEVJTlRSKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGRpc2Nvbm5lY3QoKTsKKworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9IGVsc2UgaWYgKG4gPT0gMCkgeworICAgICAgICAgICAgZGlzY29ubmVjdCgpOworCisgICAgICAgICAgICByZXR1cm4gRVJST1JfQ09OTkVDVElPTl9MT1NUOworICAgICAgICB9CisKKyAgICAgICAgc2l6ZSAtPSAoc2l6ZV90KW47CisgICAgICAgIGRhdGEgKz0gKHNpemVfdCluOworICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgSFRUUFN0cmVhbTo6c2VuZChjb25zdCBjaGFyICpkYXRhKSB7CisgICAgcmV0dXJuIHNlbmQoZGF0YSwgc3RybGVuKGRhdGEpKTsKK30KKworc3RhdHVzX3QgSFRUUFN0cmVhbTo6cmVjZWl2ZV9saW5lKGNoYXIgKmxpbmUsIHNpemVfdCBzaXplKSB7CisgICAgaWYgKG1TdGF0ZSAhPSBDT05ORUNURUQpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX05PVF9DT05ORUNURUQ7CisgICAgfQorCisgICAgYm9vbCBzYXdfQ1IgPSBmYWxzZTsKKyAgICBzaXplX3QgbGVuZ3RoID0gMDsKKworICAgIGZvciAoOzspIHsKKyAgICAgICAgY2hhciBjOworICAgICAgICBzc2l6ZV90IG4gPSByZWN2KG1Tb2NrZXQsICZjLCAxLCAwKTsKKyAgICAgICAgaWYgKG4gPCAwKSB7CisgICAgICAgICAgICBpZiAoZXJybm8gPT0gRUlOVFIpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZGlzY29ubmVjdCgpOworCisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0gZWxzZSBpZiAobiA9PSAwKSB7CisgICAgICAgICAgICBkaXNjb25uZWN0KCk7CisKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9DT05ORUNUSU9OX0xPU1Q7CisgICAgICAgIH0KKworICAgICAgICBpZiAoc2F3X0NSICYmIGMgPT0gJ1xuJykgeworICAgICAgICAgICAgLy8gV2UgaGF2ZSBhIGNvbXBsZXRlIGxpbmUuCisKKyAgICAgICAgICAgIGxpbmVbbGVuZ3RoIC0gMV0gPSAnXDAnOworICAgICAgICAgICAgcmV0dXJuIE9LOworICAgICAgICB9CisKKyAgICAgICAgc2F3X0NSID0g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tIHN0YXR1c19zdGFydCk7CisgICAgbGluZVtzdGF0dXNfZW5kIC0gc3RhdHVzX3N0YXJ0XSA9ICdcMCc7CisKKyAgICBsb25nIHRtcCA9IHN0cnRvbChsaW5lLCBOVUxMLCAxMCk7CisgICAgaWYgKHRtcCA8IDAgfHwgdG1wID4gOTk5KSB7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgICpodHRwX3N0YXR1cyA9IChpbnQpdG1wOworCisgICAgZm9yICg7OykgeworICAgICAgICBlcnIgPSByZWNlaXZlX2xpbmUobGluZSwgc2l6ZW9mKGxpbmUpKTsKKyAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgfQorCisgICAgICAgIGlmICgqbGluZSA9PSAnXDAnKSB7CisgICAgICAgICAgICAvLyBFbXB0eSBsaW5lIHNpZ25hbHMgdGhlIGVuZCBvZiB0aGUgaGVhZGVyLgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICAvLyBwdXRzKGxpbmUpOworCisgICAgICAgIGNoYXIgKmNvbG9uUG9zID0gc3RyY2hyKGxpbmUsICc6Jyk7CisgICAgICAgIGlmIChjb2xvblBvcyA9PSBOVUxMKSB7CisgICAgICAgICAgICBtSGVhZGVycy5hZGQoc3RyaW5nKGxpbmUpLCBzdHJpbmcoKSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBjaGFyICplbmRfb2Zfa2V5ID0gY29sb25Qb3M7CisgICAgICAgICAgICB3aGlsZSAoZW5kX29mX2tleSA+IGxpbmUgJiYgaXNzcGFjZShlbmRfb2Zfa2V5Wy0xXSkpIHsKKyAgICAgICAgICAgICAgICAtLWVuZF9vZl9rZXk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNoYXIgKnN0YXJ0X29mX3ZhbHVlID0gY29sb25Qb3MgKyAxOworICAgICAgICAgICAgd2hpbGUgKGlzc3BhY2UoKnN0YXJ0X29mX3ZhbHVlKSkgeworICAgICAgICAgICAgICAgICsrc3RhcnRfb2ZfdmFsdWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICplbmRfb2Zfa2V5ID0gJ1wwJzsKKworICAgICAgICAgICAgbUhlYWRlcnMuYWRkKHN0cmluZyhsaW5lKSwgc3RyaW5nKHN0YXJ0X29mX3ZhbHVlKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3NzaXplX3QgSFRUUFN0cmVhbTo6cmVjZWl2ZSh2b2lkICpkYXRhLCBzaXplX3Qgc2l6ZSkgeworICAgIHNpemVfdCB0b3RhbCA9IDA7CisgICAgd2hpbGUgKHRvdGFsIDwgc2l6ZSkgeworICAgICAgICBzc2l6ZV90IG4gPSByZWN2KG1Tb2NrZXQsIChjaGFyICopZGF0YSArIHRvdGFsLCBzaXplIC0gdG90YWwsIDApOworCisgICAgICAgIGlmIChuIDwgMCkgeworICAgICAgICAgICAgaWYgKGVycm5vID09IEVJTlRSKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGRpc2Nvbm5lY3QoKTsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgfSBlbHNlIGlmIChuID09IDApIHsKKyAgICAgICAgICAgIGRpc2Nvbm5lY3QoKTsKKworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0NPTk5FQ1RJT05fTE9TVDsKKyAgICAgICAgfQorCisgICAgICAgIHRvdGFsICs9IChzaXplX3QpbjsKKyAgICB9CisKKyAgICByZXR1cm4gKHNzaXplX3QpdG90YWw7Cit9CisKK2Jvb2wgSFRUUFN0cmVhbTo6ZmluZF9oZWFkZXJfdmFsdWUoY29uc3Qgc3RyaW5nICZrZXksIHN0cmluZyAqdmFsdWUpIGNvbnN0IHsKKyAgICBzc2l6ZV90IGluZGV4ID0gbUhlYWRlcnMuaW5kZXh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ZV90ICpmcmFtZV9zaXplLAorICAgICAgICBpbnQgKm91dF9zYW1wbGluZ19yYXRlID0gTlVMTCwgaW50ICpvdXRfY2hhbm5lbHMgPSBOVUxMLAorICAgICAgICBpbnQgKm91dF9iaXRyYXRlID0gTlVMTCkgeworICAgICpmcmFtZV9zaXplID0gMDsKKworICAgIGlmIChvdXRfc2FtcGxpbmdfcmF0ZSkgeworICAgICAgICAqb3V0X3NhbXBsaW5nX3JhdGUgPSAwOworICAgIH0KKworICAgIGlmIChvdXRfY2hhbm5lbHMpIHsKKyAgICAgICAgKm91dF9jaGFubmVscyA9IDA7CisgICAgfQorCisgICAgaWYgKG91dF9iaXRyYXRlKSB7CisgICAgICAgICpvdXRfYml0cmF0ZSA9IDA7CisgICAgfQorCisgICAgaWYgKChoZWFkZXIgJiAweGZmZTAwMDAwKSAhPSAweGZmZTAwMDAwKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICB1bnNpZ25lZCB2ZXJzaW9uID0gKGhlYWRlciA+PiAxOSkgJiAzOworCisgICAgaWYgKHZlcnNpb24gPT0gMHgwMSkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIAorICAgIHVuc2lnbmVkIGxheWVyID0gKGhlYWRlciA+PiAxNykgJiAzOworCisgICAgaWYgKGxheWVyID09IDB4MDApIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHVuc2lnbmVkIHByb3RlY3Rpb24gPSAoaGVhZGVyID4+IDE2KSAmIDE7CisKKyAgICB1bnNpZ25lZCBiaXRyYXRlX2luZGV4ID0gKGhlYWRlciA+PiAxMikgJiAweDBmOworCisgICAgaWYgKGJpdHJhdGVfaW5kZXggPT0gMCB8fCBiaXRyYXRlX2luZGV4ID09IDB4MGYpIHsKKyAgICAgICAgLy8gRGlzYWxsb3cgImZyZWUiIGJpdHJhdGUuCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICB1bnNpZ25lZCBzYW1wbGluZ19yYXRlX2luZGV4ID0gKGhlYWRlciA+PiAxMCkgJiAzOworCisgICAgaWYgKHNhbXBsaW5nX3JhdGVfaW5kZXggPT0gMykgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgc3RhdGljIGNvbnN0IGludCBrU2FtcGxpbmdSYXRlVjFbXSA9IHsgNDQxMDAsIDQ4MDAwLCAzMjAwMCB9OworICAgIGludCBzYW1wbGluZ19yYXRlID0ga1NhbXBsaW5nUmF0ZVYxW3NhbXBsaW5nX3JhdGVfaW5kZXhdOworICAgIGlmICh2ZXJzaW9uID09IDIgLyogVjIgKi8pIHsKKyAgICAgICAgc2FtcGxpbmdfcmF0ZSAvPSAyOworICAgIH0gZWxzZSBpZiAodmVyc2lvbiA9PSAwIC8qIFYyLjUgKi8pIHsKKyAgICAgICAgc2FtcGxpbmdfcmF0ZSAvPSA0OworICAgIH0KKworICAgIHVuc2lnbmVkIHBhZGRpbmcgPSAoaGVhZGVyID4+IDkpICYgMTsKKworICAgIGlmIChsYXllciA9PSAzKSB7CisgICAgICAgIC8vIGxheWVyIEkKKworICAgICAgICBzdGF0aWMgY29uc3QgaW50IGtCaXRyYXRlVjFbXSA9IHsKKyAgICAgICAgICAgIDMyLCA2NCwgOTYsIDEyOCwgMTYwLCAxOTIsIDIyNCwgMjU2LAorICAgICAgICAgICAgMjg4LCAzMjAsIDM1MiwgMzg0LCA0MTYsIDQ0OAorICAgICAgICB9OworCisgICAgICAgIHN0YXRpYyBjb25zdCBpbnQga0JpdHJhdGVWMltdID0geworICAgICAgICAgICAgMzIsIDQ4LCA1NiwgNjQsIDgwLCA5NiwgMTEyLCAxMjgsCisgICAgICAgICAgICAxNDQsIDE2MCwgMTc2LCAxOTIsIDIyNCwgMjU2CisgICAgICAgIH07CisKKyAgICAgICAgaW50IGJpdHJhdGUgPQorICAgICAgICAgICAgKHZlcnNpb24gPT0gMyAvKiBWMSAqLykKKyAgICAgICAgICAgICAgICA/IGtCaXRyYXRlVjFbYml0cmF0ZV9pbmRleCAtIDFdCisgICAgICAgICAgICAgICAgOiBrQml0cmF0ZVYyW2JpdHJhdGVfaW5kZXggLSAxXTsKKworICAgICAgICBpZiAob3V0X2JpdHJhdGUpIHsKKyAgICAgICAgICAgICpvdXRfYml0cmF0ZSA9IGJpdHJhdGU7CisgICAgICAgIH0KKworICAgICAgICAqZnJhbWVfc2l6ZSA9ICgxMjAwMCAqIGJpdHJhdGUgLyBzYW1wbGluZ19yYXRlICsgcGFkZGluZykgKiA0OworICAgIH0gZWxzZSB7CisgICAgICAgIC8vIGxheWVyIElJIG9yIElJSQorCisgICAgICAgIHN0YXRpYyBjb25zdCBpbnQga0JpdHJhdGVWMUwyW10gPSB7CisgICAgICAgICAgICAzMiwgNDgsIDU2LCA2NCwgODAsIDk2LCAxMTIsIDEyOCwKKyAgICAgICAgICAgIDE2MCwgMTkyLCAyMjQsIDI1NiwgMzIwLCAzODQKKyAgICAgICAgfTsKKworICAgICAgICBzdGF0aWMgY29uc3QgaW50IGtCaXRyYXRlVjFMM1tdID0geworICAgICAgICAgICAgMzIsIDQwLCA0OCwgNTYsIDY0LCA4MCwgOTYsIDExMiwKKyAgICAgICAgICAgIDEyOCwgMTYwLCAxOTIsIDIyNCwgMjU2LCAzMjAKKyAgICAgICAgfTsKKworICAgICAgICBzdGF0aWMgY29uc3QgaW50IGtCaXRyYXRlVjJbXSA9IHsKKyAgICAgICAgICAgIDgsIDE2LCAyNCwgMzIsIDQwLCA0OCwgNTYsIDY0LAorICAgICAgICAgICAgODAsIDk2LCAxMTIsIDEyOCwgMTQ0LCAxNjAKKyAgICAgICAgfTsKKworICAgICAgICBpbnQgYml0cmF0ZTsKKyAgICAgICAgaWYgKHZlcnNpb24gPT0gMyAvKiBWMSAqLykgeworICAgICAgICAgICAgYml0cmF0ZSA9IChsYXllciA9PSAyIC8qIEwyICovKQorICAgICAgICAgICAgICAgID8ga0JpdHJhdGVWMUwyW2JpdHJhdGVfaW5kZXggLSAxXQorICAgICAgICAgICAgICAgIDoga0JpdHJhdGVWMUwzW2JpdHJhdGVfaW5kZXggLSAxXTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIFYyIChvciAyLjUpCisKKyAgICAgICAgICAgIGJpdHJhdGUgPSBrQml0cmF0ZVYyW2JpdHJhdGVfaW5kZXggLSAxXTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChvdXRfYml0cmF0ZSkgeworICAgICAgICAgICAgKm91dF9iaXRyYXRlID0gYml0cmF0ZTsKKyAgICAgICAgfQorCisgICAgICAgICpmcmFtZV9zaXplID0gMTQ0MDAwICogYml0cmF0ZSAvIHNhbXBsaW5nX3JhdGUgKyBwYWRkaW5nOworICAgIH0KKworICAgIGlmIChvdXRfc2FtcGxpbmdfcmF0ZSkgeworICAgICAgICAqb3V0X3NhbXBsaW5nX3JhdGUgPSBzYW1wbGluZ19yYXRlOworICAgIH0KKworICAgIGlmIChvdXRfY2hhbm5lbHMpIHsKKyAgICAgICAgaW50IGNoYW5uZWxfbW9kZSA9IChoZWFkZXIgPj4gNikgJiAzOworCisgICAgICAgICpvdXRfY2hhbm5lbHMgPSAoY2hhbm5lbF9tb2RlID09IDMpID8gMSA6IDI7CisgICAgfQorCisgICAgcmV0dXJuIHRydWU7Cit9CisKK3N0YXRpYyBib29sIFJlc3luYygKKyAgICAgICAgY29uc3Qgc3A8RGF0YVNvdXJjZT4gJnNvdXJjZSwgdWludDMyX3QgbWF0Y2hfaGVhZGVyLAorICAgICAgICBvZmZfdCAqaW5vdXRfcG9zLCB1aW50MzJfdCAqb3V0X2hlYWRlcikgeworICAgIC8vIEV2ZXJ5dGhpbmcgbXVzdCBtYXRjaCBleGNlcHQgZm9yCisgICAgLy8gcHJvdGVjdGlvbiwgYml0cmF0ZSwgcGFkZGluZywgcHJpdmF0ZSBiaXRzIGFuZCBtb2RlIGV4dGVuc2lvbi4KKyAgICBjb25zdCB1aW50MzJfdCBrTWFzayA9IDB4ZmZmZTBjY2Y7CisKKyAgICBjb25zdCBzaXplX3Qga01heEZyYW1lU2l6ZSA9IDQwOTY7CisgICAgdWludDhfdCAqYnVmZmVyID0gbmV3IHVpbnQ4X3Rba01heEZyYW1lU2l6ZV07CisgICAgCisgICAgb2ZmX3QgcG9zID0gKmlub3V0X3BvcyAtIGtNYXhGcmFtZVNpemU7CisgICAgc2l6ZV90IGJ1ZmZlcl9vZmZzZXQgPSBrTWF4RnJhbWVTaXplOworICAgIHNpemVfdCBidWZmZXJfbGVuZ3RoID0ga01heEZyYW1lU2l6ZTsKKyAgICBib29sIHZhbGlkID0gZmFsc2U7CisgICAgZG8geworICAgICAgICBpZiAoYnVmZmVyX29mZnNldCArIDMgPj0gYnVmZmVyX2xlbmd0aCkgeworICAgICAgICAgICAgaWYgKGJ1ZmZlcl9sZW5ndGggPCBrTWF4RnJhbWVTaXplKSB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBvcyArPSBidWZmZXJfb2Zmc2V0OworCisgICAgICAgICAgICBpZiAocG9zID49ICppbm91dF9wb3MgKyAxMjggKiAxMDI0KSB7CisgICAgICAgICAgICAgICAgLy8gRG9uJ3Qgc2NhbiBmb3JldmVyLgorICAgICAgICAgICAgICAgIExPR1YoImdpdmluZyB1cCBhdCBvZmZzZXQgJWxkIiwgcG9zKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbWVtbW92ZShidWZmZXIsICZidWZmZXJbYnVmZmVyX29mZnNldF0sIGJ1ZmZlcl9sZW5ndGggLSBidWZmZXJfb2Zmc2V0KTsKKyAgICAgICAgICAgIGJ1ZmZlcl9sZW5ndGggPSBidWZmZXJfbGVuZ3RoIC0gYnVmZmVyX29mZnNldDsKKyAgICAgICAgICAgIGJ1ZmZlcl9vZmZzZXQgPSAwOworCisgICAgICAgICAgICBzc2l6ZV90IG4gPSBzb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgICAgIHBvcywgJmJ1ZmZlcltidWZmZXJfbGVuZ3RoXSwga01heEZyYW1lU2l6ZSAtIGJ1ZmZlcl9sZW5ndGgpOworCisgICAgICAgICAgICBpZiAobiA8PSAwKSB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJ1ZmZlcl9sZW5ndGggKz0gKHNpemVfdCluOworCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgICAgIHVpbnQzMl90IGhlYWRlciA9IFUzMl9BVCgmYnVmZmVyW2J1ZmZlcl9vZmZzZXRdKTsKKworICAgICAgICBpZiAobWF0Y2hfaGVhZGVyICE9IDAgJiYgKGhlYWRlciAmIGtNYXNrKSAhPSAobWF0Y2hfaGVhZGVyICYga01hc2spKSB7CisgICAgICAgICAgICArK2J1ZmZlcl9vZmZzZXQ7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgICAgIHNpemVfdCBmcmFtZV9zaXplOworICAgICAgICBpbnQgc2FtcGxlX3JhdGUsIG51bV9jaGFubmVscywgYml0cmF0ZTsKKyAgICAgICAgaWYgKCFnZXRfbXAzX2ZyYW1lX3NpemUoaGVhZGVyLCAmZnJhbWVfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2FtcGxlX3JhdGUsICZudW1fY2hhbm5lbHMsICZiaXRyYXRlKSkgeworICAgICAgICAgICAgKytidWZmZXJfb2Zmc2V0OworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBMT0dWKCJmb3VuZCBwb3NzaWJsZSAxc3QgZnJhbWUgYXQgJWxkIiwgcG9zICsgYnVmZmVyX29mZnNldCk7CisKKyAgICAgICAgLy8gV2UgZm91bmQgd2hhdCBsb29rcyBsaWtlIGEgdmFsaWQgZnJhbWUsCisgICAgICAgIC8vIG5vdyBmaW5kIGl0cyBzdWNjZXNzb3JzLgorCisgICAgICAgIG9mZl90IHRlc3RfcG9zID0gcG9zICsgYnVmZmVyX29mZnNldCArIGZyYW1lX3NpemU7CisKKyAgICAgICAgdmFsaWQgPSB0cnVlOworICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IDM7ICsraikgeworICAgICAgICAgICAgdWludDhfdCB0bXBbNF07CisgICAgICAgICAgICBpZiAoc291cmNlLT5yZWFkX2F0KHRlc3RfcG9zLCB0bXAsIDQpIDwgNCkgeworICAgICAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHVpbnQzMl90IHRlc3RfaGVhZGVyID0gVTMyX0FUKHRtcCk7CisKKyAgICAgICAgICAgIExPR1YoInN1YnNlcXVlbnQgaGVhZGVyIGlzICUwOHgiLCB0ZXN0X2hlYWRlcik7CisKKyAgICAgICAgICAgIGlmICgodGVzdF9oZWFkZXIgJiBrTWFzaykgIT0gKGhlYWRlciAmIGtNYXNrKSkgeworICAgICAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNpemVfdCB0ZXN0X2ZyYW1lX3NpemU7CisgICAgICAgICAgICBpZiAoIWdldF9tcDNfZnJhbWVfc2l6ZSh0ZXN0X2hlYWRlciwgJnRlc3RfZnJhbWVfc2l6ZSkpIHsKKyAgICAgICAgICAgICAgICB2YWxpZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBMT0dWKCJmb3VuZCBzdWJzZXF1ZW50IGZyYW1lICMlZCBhdCAlbGQiLCBqICsgMiwgdGVzdF9wb3MpOworCisgICAgICAgICAgICB0ZXN0X3BvcyArPSB0ZXN0X2ZyYW1lX3NpemU7CisgICAgICAgIH0KKworICAgICAgICBpZiAodmFsaWQpIHsKKyAgICAgICAgICAgICppbm91dF9wb3MgPSBwb3MgKyBidWZmZXJfb2Zmc2V0OworCisgICAgICAgICAgICBpZiAob3V0X2hlYWRlciAhPSBOVUxMKSB7CisgICAgICAgICAgICAgICAgKm91dF9oZWFkZXIgPSBoZWFkZXI7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMT0dWKCJubyBkaWNlLCBubyB2YWxpZCBzZXF1ZW5jZSBvZiBmcmFtZXMgZm91bmQuIik7CisgICAgICAgIH0KKworICAgICAgICArK2J1ZmZlcl9vZmZzZXQ7CisKKyAgICB9IHdoaWxlICghdmFsaWQpOworCisgICAgZGVsZXRlW10gYnVmZmVyOworICAgIGJ1ZmZlciA9IE5VTEw7CisKKyAgICByZXR1cm4gdmFsaWQ7Cit9CisKK2NsYXNzIE1QM1NvdXJjZSA6IHB1YmxpYyBNZWRpYVNvdXJjZSB7CitwdWJsaWM6CisgICAgTVAzU291cmNlKAorICAgICAgICAgICAgY29uc3Qgc3A8TWV0YURhdGE+ICZtZXRhLCBjb25zdCBzcDxEYXRhU291cmNlPiAmc291cmNlLAorICAgICAgICAgICAgb2ZmX3QgZmlyc3RfZnJhbWVfcG9zLCB1aW50MzJfdCBmaXhlZF9oZWFkZXIpOworCisgICAgdmlydHVhbCBzdGF0dXNfdCBzdGFydChNZXRhRGF0YSAqcGFyYW1zID0gTlVMTCk7CisgICAgdmlydHVhbCBzdGF0dXNfdCBzdG9wKCk7CisKKyAgICB2aXJ0dWFsIHNwPE1ldGFEYXRhPiBnZXRGb3JtYXQoKTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgcmVhZCgKKyAgICAgICAgICAgIE1lZGlhQnVmZmVyICoqYnVmZmVyLCBjb25zdCBSZWFkT3B0aW9ucyAqb3B0aW9ucyA9IE5VTEwpOworCitwcm90ZWN0ZWQ6CisgICAgdmlydHVhbCB+TVAzU291cmNlKCk7CisKK3ByaXZhdGU6CisgICAgc3A8T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ywgJmJpdHJhdGUpOworCisgICAgICAgIG1NZXRhID0gbmV3IE1ldGFEYXRhOworCisgICAgICAgIG1NZXRhLT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgImF1ZGlvL21wZWciKTsKKyAgICAgICAgbU1ldGEtPnNldEludDMyKGtLZXlTYW1wbGVSYXRlLCBzYW1wbGVfcmF0ZSk7CisgICAgICAgIG1NZXRhLT5zZXRJbnQzMihrS2V5Qml0UmF0ZSwgYml0cmF0ZSk7CisgICAgICAgIG1NZXRhLT5zZXRJbnQzMihrS2V5Q2hhbm5lbENvdW50LCBudW1fY2hhbm5lbHMpOworCisgICAgICAgIG9mZl90IGZpbGVTaXplOworICAgICAgICBpZiAobURhdGFTb3VyY2UtPmdldFNpemUoJmZpbGVTaXplKSA9PSBPSykgeworICAgICAgICAgICAgbU1ldGEtPnNldEludDMyKAorICAgICAgICAgICAgICAgICAgICBrS2V5RHVyYXRpb24sCisgICAgICAgICAgICAgICAgICAgIDggKiAoZmlsZVNpemUgLSBtRmlyc3RGcmFtZVBvcykgLyBiaXRyYXRlKTsKKyAgICAgICAgICAgIG1NZXRhLT5zZXRJbnQzMihrS2V5VGltZVNjYWxlLCAxMDAwKTsKKyAgICAgICAgfQorICAgIH0KK30KKworTVAzRXh0cmFjdG9yOjp+TVAzRXh0cmFjdG9yKCkgeworfQorCitzaXplX3QgTVAzRXh0cmFjdG9yOjpjb3VudFRyYWNrcygpIHsKKyAgICByZXR1cm4gKG1GaXJzdEZyYW1lUG9zIDwgMCkgPyAwIDogMTsKK30KKworc3A8TWVkaWFTb3VyY2U+IE1QM0V4dHJhY3Rvcjo6Z2V0VHJhY2soc2l6ZV90IGluZGV4KSB7CisgICAgaWYgKG1GaXJzdEZyYW1lUG9zIDwgMCB8fCBpbmRleCAhPSAwKSB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHJldHVybiBuZXcgTVAzU291cmNlKAorICAgICAgICAgICAgbU1ldGEsIG1EYXRhU291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worICAgIGNvbnN0IHNpemVfdCBrTWF4RnJhbWVTaXplID0gMzI3Njg7CisgICAgbUdyb3VwLT5hZGRfYnVmZmVyKG5ldyBNZWRpYUJ1ZmZlcihrTWF4RnJhbWVTaXplKSk7CisKKyAgICBtQ3VycmVudFBvcyA9IG1GaXJzdEZyYW1lUG9zOworICAgIG1DdXJyZW50VGltZVVzID0gMDsKKworICAgIG1TdGFydGVkID0gdHJ1ZTsKKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgTVAzU291cmNlOjpzdG9wKCkgeworICAgIENIRUNLKG1TdGFydGVkKTsKKworICAgIGRlbGV0ZSBtR3JvdXA7CisgICAgbUdyb3VwID0gTlVMTDsKKworICAgIG1TdGFydGVkID0gZmFsc2U7CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3NwPE1ldGFEYXRhPiBNUDNTb3VyY2U6OmdldEZvcm1hdCgpIHsKKyAgICByZXR1cm4gbU1ldGE7Cit9CisKK3N0YXR1c190IE1QM1NvdXJjZTo6cmVhZCgKKyAgICAgICAgTWVkaWFCdWZmZXIgKipvdXQsIGNvbnN0IFJlYWRPcHRpb25zICpvcHRpb25zKSB7CisgICAgKm91dCA9IE5VTEw7CisKKyAgICBpbnQ2NF90IHNlZWtUaW1lVXM7CisgICAgaWYgKG9wdGlvbnMgIT0gTlVMTCAmJiBvcHRpb25zLT5nZXRTZWVrVG8oJnNlZWtUaW1lVXMpKSB7CisgICAgICAgIGludDMyX3QgYml0cmF0ZTsKKyAgICAgICAgaWYgKCFtTWV0YS0+ZmluZEludDMyKGtLZXlCaXRSYXRlLCAmYml0cmF0ZSkpIHsKKyAgICAgICAgICAgIC8vIGJpdHJhdGUgaXMgaW4ga2JpdHMvc2VjLgorICAgICAgICAgICAgTE9HSSgibm8gYml0cmF0ZSIpOworCisgICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7CisgICAgICAgIH0KKworICAgICAgICBtQ3VycmVudFRpbWVVcyA9IHNlZWtUaW1lVXM7CisgICAgICAgIG1DdXJyZW50UG9zID0gbUZpcnN0RnJhbWVQb3MgKyBzZWVrVGltZVVzICogYml0cmF0ZSAvIDEwMDAwMDAgKiAxMjU7CisgICAgfQorCisgICAgTWVkaWFCdWZmZXIgKmJ1ZmZlcjsKKyAgICBzdGF0dXNfdCBlcnIgPSBtR3JvdXAtPmFjcXVpcmVfYnVmZmVyKCZidWZmZXIpOworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICBzaXplX3QgZnJhbWVfc2l6ZTsKKyAgICBmb3IgKDs7KSB7CisgICAgICAgIHNzaXplX3QgbiA9IG1EYXRhU291cmNlLT5yZWFkX2F0KG1DdXJyZW50UG9zLCBidWZmZXItPmRhdGEoKSwgNCk7CisgICAgICAgIGlmIChuIDwgNCkgeworICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7CisgICAgICAgICAgICBidWZmZXIgPSBOVUxMOworCisgICAgICAgICAgICByZXR1cm4gRVJST1JfRU5EX09GX1NUUkVBTTsKKyAgICAgICAgfQorCisgICAgICAgIHVpbnQzMl90IGhlYWRlciA9IFUzMl9BVCgoY29uc3QgdWludDhfdCAqKWJ1ZmZlci0+ZGF0YSgpKTsKKyAgICAgICAgCisgICAgICAgIGlmIChnZXRfbXAzX2ZyYW1lX3NpemUoaGVhZGVyLCAmZnJhbWVfc2l6ZSkpIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgLy8gTG9zdCBzeW5jLgorICAgICAgICBMT0dXKCJsb3N0IHN5bmMhXG4iKTsKKworICAgICAgICBvZmZfdCBwb3MgPSBtQ3VycmVudFBvczsKKyAgICAgICAgaWYgKCFSZXN5bmMobURhdGFTb3VyY2UsIG1GaXhlZEhlYWRlciwgJnBvcywgTlVMTCkpIHsKKyAgICAgICAgICAgIExPR0UoIlVuYWJsZSB0byByZXN5bmMuIFNpZ25hbGxpbmcgZW5kIG9mIHN0cmVhbS4iKTsKKworICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7CisgICAgICAgICAgICBidWZmZXIgPSBOVUxMOworCisgICAgICAgICAgICByZXR1cm4gRVJST1JfRU5EX09GX1NUUkVBTTsKKyAgICAgICAgfQorCisgICAgICAgIG1DdXJyZW50UG9zID0gcG9zOworCisgICAgICAgIC8vIFRyeSBhZ2FpbiB3aXRoIHRoZSBuZXcgcG9zaXRpb24uCisgICAgfQorCisgICAgQ0hFQ0soZnJhbWVfc2l6ZSA8PSBidWZmZXItPnNpemUoKSk7CisKKyAgICBzc2l6ZV90IG4gPSBtRGF0YVNvdXJjZS0+cmVhZF9hdChtQ3VycmVudFBvcywgYnVmZmVyLT5kYXRhKCksIGZyYW1lX3NpemUpOworICAgIGlmIChuIDwgKHNzaXplX3QpZnJhbWVfc2l6ZSkgeworICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKKyAgICAgICAgYnVmZmVyID0gTlVMTDsKKworICAgICAgICByZXR1cm4gRVJST1JfRU5EX09GX1NUUkVBTTsKKyAgICB9CisKKyAgICBidWZmZXItPnNldF9yYW5nZSgwLCBmcmFtZV9zaXplKTsKKworICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDMyKGtLZXlUaW1lVW5pdHMsIG1DdXJyZW50VGltZVVzIC8gMTAwMCk7CisgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50MzIoa0tleVRpbWVTY2FsZSwgMTAwMCk7CisKKyAgICBtQ3VycmVudFBvcyArPSBmcmFtZV9zaXplOworICAgIG1DdXJyZW50VGltZVVzICs9IDExNTIgKiAxMDAwMDAwIC8gNDQxMDA7CisKKyAgICAqb3V0ID0gYnVmZmVyOworCisgICAgcmV0dXJuIE9LOworfQorCitib29sIFNuaWZmTVAzKAorICAgICAgICBjb25zdCBzcDxEYXRhU291cmNlPiAmc291cmNlLCBTdHJpbmc4ICptaW1lVHlwZSwgZmxvYXQgKmNvb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bUlzQVZDOworICAgIGJvb2wgbVN0YXJ0ZWQ7CisKKyAgICBNZWRpYUJ1ZmZlckdyb3VwICptR3JvdXA7CisKKyAgICBNZWRpYUJ1ZmZlciAqbUJ1ZmZlcjsKKworICAgIGJvb2wgbVdhbnRzTkFMRnJhZ21lbnRzOworCisgICAgdWludDhfdCAqbVNyY0J1ZmZlcjsKKworICAgIE1QRUc0U291cmNlKGNvbnN0IE1QRUc0U291cmNlICYpOworICAgIE1QRUc0U291cmNlICZvcGVyYXRvcj0oY29uc3QgTVBFRzRTb3VyY2UgJik7Cit9OworCitzdGF0aWMgdm9pZCBoZXhkdW1wKGNvbnN0IHZvaWQgKl9kYXRhLCBzaXplX3Qgc2l6ZSkgeworICAgIGNvbnN0IHVpbnQ4X3QgKmRhdGEgPSAoY29uc3QgdWludDhfdCAqKV9kYXRhOworICAgIHNpemVfdCBvZmZzZXQgPSAwOworICAgIHdoaWxlIChvZmZzZXQgPCBzaXplKSB7CisgICAgICAgIHByaW50ZigiMHglMDR4ICAiLCBvZmZzZXQpOworCisgICAgICAgIHNpemVfdCBuID0gc2l6ZSAtIG9mZnNldDsKKyAgICAgICAgaWYgKG4gPiAxNikgeworICAgICAgICAgICAgbiA9IDE2OworICAgICAgICB9CisKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCAxNjsgKytpKSB7CisgICAgICAgICAgICBpZiAoaSA9PSA4KSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCIgIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChvZmZzZXQgKyBpIDwgc2l6ZSkgeworICAgICAgICAgICAgICAgIHByaW50ZigiJTAyeCAiLCBkYXRhW29mZnNldCArIGldKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaW50ZigiICIpOworCisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbjsgKytpKSB7CisgICAgICAgICAgICBpZiAoaXNwcmludChkYXRhW29mZnNldCArIGldKSkgeworICAgICAgICAgICAgICAgIHByaW50ZigiJWMiLCBkYXRhW29mZnNldCArIGldKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCIuIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcmludGYoIlxuIik7CisKKyAgICAgICAgb2Zmc2V0ICs9IDE2OworICAgIH0KK30KKworc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IEZvdXJDQzJNSU1FKHVpbnQzMl90IGZvdXJjYykgeworICAgIHN3aXRjaCAoZm91cmNjKSB7CisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ3AnLCAnNCcsICdhJyk6CisgICAgICAgICAgICByZXR1cm4gImF1ZGlvL21wNGEtbGF0bSI7CisKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAnYScsICdtJywgJ3InKToKKyAgICAgICAgICAgIHJldHVybiAiYXVkaW8vM2dwcCI7CisKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ20nLCAncCcsICc0JywgJ3YnKToKKyAgICAgICAgICAgIHJldHVybiAidmlkZW8vbXA0di1lcyI7CisKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAnMicsICc2JywgJzMnKToKKyAgICAgICAgICAgIHJldHVybiAidmlkZW8vM2dwcCI7CisKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2EnLCAndicsICdjJywgJzEnKToKKyAgICAgICAgICAgIHJldHVybiAidmlkZW8vYXZjIjsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgQ0hFQ0soISJzaG91bGQgbm90IGJlIGhlcmUuIik7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9Cit9CisKK01QRUc0RXh0cmFjdG9yOjpNUEVHNEV4dHJhY3Rvcihjb25zdCBzcDxEYXRhU291cmNlPiAmc291cmNlKQorICAgIDogbURhdGFTb3VyY2Uoc291cmNlKSwKKyAgICAgIG1IYXZlTWV0YWRhdGEoZmFsc2UpLAorICAgICAgbUZpcnN0VHJhY2soTlVMTCksCisgICAgICBtTGFzdFRyYWNrKE5VTEwpIHsKK30KKworTVBFRzRFeHRyYWN0b3I6On5NUEVHNEV4dHJhY3RvcigpIHsKKyAgICBUcmFjayAqdHJhY2sgPSBtRmlyc3RUcmFjazsKKyAgICB3aGlsZSAodHJhY2spIHsKKyAgICAgICAgVHJhY2sgKm5leHQgPSB0cmFjay0+bmV4dDsKKworICAgICAgICBkZWxldGUgdHJhY2s7CisgICAgICAgIHRyYWNrID0gbmV4dDsKKyAgICB9CisgICAgbUZpcnN0VHJhY2sgPSBtTGFzdFRyYWNrID0gTlVMTDsKK30KKworc2l6ZV90IE1QRUc0RXh0cmFjdG9yOjpjb3VudFRyYWNrcygpIHsKKyAgICBzdGF0dXNfdCBlcnI7CisgICAgaWYgKChlcnIgPSByZWFkTWV0YURhdGEoKSkgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgc2l6ZV90IG4gPSAwOworICAgIFRyYWNrICp0cmFjayA9IG1GaXJzdFRyYWNrOworICAgIHdoaWxlICh0cmFjaykgeworICAgICAgICArK247CisgICAgICAgIHRyYWNrID0gdHJhY2stPm5leHQ7CisgICAgfQorCisgICAgcmV0dXJuIG47Cit9CisKK3NwPE1ldGFEYXRhPiBNUEVHNEV4dHJhY3Rvcjo6Z2V0VHJhY2tNZXRhRGF0YShzaXplX3QgaW5kZXgpIHsKKyAgICBzdGF0dXNfdCBlcnI7CisgICAgaWYgKChlcnIgPSByZWFkTWV0YURhdGEoKSkgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgVHJhY2sgKnRyYWNrID0gbUZpcnN0VHJhY2s7CisgICAgd2hpbGUgKGluZGV4ID4gMCkgeworICAgICAgICBpZiAodHJhY2sgPT0gTlVMTCkgeworICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKworICAgICAgICB0cmFjayA9IHRyYWNrLT5uZXh0OworICAgICAgICAtLWluZGV4OworICAgIH0KKworICAgIHJldHVybiB0cmFjay0+bWV0YTsKK30KKworc3RhdHVzX3QgTVBFRzRFeHRyYWN0b3I6OnJlYWRNZXRhRGF0YSgpIHsKKyAgICBpZiAobUhhdmVNZXRhZGF0YSkgeworICAgICAgICByZXR1cm4gT0s7CisgICAgfQorCisgICAgb2ZmX3Qgb2Zmc2V0ID0gMDsKKyAgICBzdGF0dXNfdCBlcnI7CisgICAgd2hpbGUgKChlcnIgPSBwYXJzZUNodW5rKCZvZmZzZXQsIDApKSA9PSBPSykgeworICAgIH0KKyAgICAKKyAgICBpZiAobUhhdmVNZXRhZGF0YSkgeworICAgICAgICByZXR1cm4gT0s7CisgICAgfQorCisgICAgcmV0dXJuIGVycjsKK30KKworc3RhdGljIHZvaWQgTWFrZUZvdXJDQ1N0cmluZyh1aW50MzJfdCB4LCBjaGFyICpzKSB7CisgICAgc1swXSA9IHggPj4gMjQ7CisgICAgc1sxXSA9ICh4ID4+IDE2KSAmIDB4ZmY7CisgICAgc1syXSA9ICh4ID4+IDgpICYgMHhmZjsKKyAgICBzWzNdID0geCAmIDB4ZmY7CisgICAgc1s0XSA9ICdcMCc7Cit9CisKK3N0YXR1c190IE1QRUc0RXh0cmFjdG9yOjpwYXJzZUNodW5rKG9mZl90ICpvZmZzZXQsIGludCBkZXB0aCkgeworICAgIHVpbnQzMl90IGhkclsyXTsKKyAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoKm9mZnNldCwgaGRyLCA4KSA8IDgpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgIH0KKyAgICB1aW50NjRfdCBjaHVua19zaXplID0gbnRvaGwoaGRyWzBdKTsKKyAgICB1aW50MzJfdCBjaHVua190eXBlID0gbnRvaGwoaGRyWzFdKTsKKyAgICBvZmZfdCBkYXRhX29mZnNldCA9ICpvZmZzZXQgKyA4OworCisgICAgaWYgKGNodW5rX3NpemUgPT0gMSkgeworICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoKm9mZnNldCArIDgsICZjaHVua19zaXplLCA4KSA8IDgpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgfQorICAgICAgICBjaHVua19zaXplID0gbnRvaDY0KGNodW5rX3NpemUpOworICAgICAgICBkYXRhX29mZnNldCArPSA4OworICAgIH0KKworICAgIGNoYXIgY2h1bmtbNV07CisgICAgTWFrZUZvdXJDQ1N0cmluZyhjaHVua190eXBlLCBjaHVuayk7CisKKyNpZiAwCisgICAgc3RhdGljIGNvbnN0IGNoYXIga1doaXRlc3BhY2VbXSA9ICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjsKKyAgICBjb25zdCBjaGFyICppbmRlbnQgPSAma1doaXRlc3BhY2Vbc2l6ZW9mKGtXaGl0ZXNwYWNlKSAtIDEgLSAyICogZGVwdGhdOworICAgIHByaW50ZigiJXNmb3VuZCBjaHVuayAnJXMnIG9mIHNpemUgJWxsZFxuIiwgaW5kZW50LCBjaHVuaywgY2h1bmtfc2l6ZSk7CisKKyAgICBjaGFyIGJ1ZmZlclsyNTZdOworICAgIGlmIChjaHVua19zaXplIDw9IHNpemVvZihidWZmZXIpKSB7CisgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgqb2Zmc2V0LCBidWZmZXIsIGNodW5rX3NpemUpIDwgY2h1bmtfc2l6ZSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9CisKKyAgICAgICAgaGV4ZHVtcChidWZmZXIsIGNodW5rX3NpemUpOworICAgIH0KKyNlbmRpZgorCisgICAgb2ZmX3QgY2h1bmtfZGF0YV9zaXplID0gKm9mZnNldCArIGNodW5rX3NpemUgLSBkYXRhX29mZnNldDsKKworICAgIHN3aXRjaChjaHVua190eXBlKSB7CisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ28nLCAnbycsICd2Jyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCd0JywgJ3InLCAnYScsICdrJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ2QnLCAnaScsICdhJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ2knLCAnbicsICdmJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdkJywgJ2knLCAnbicsICdmJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJ3QnLCAnYicsICdsJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ3YnLCAnZScsICd4Jyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ28nLCAnbycsICdmJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCd0JywgJ3InLCAnYScsICdmJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ2YnLCAncicsICdhJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJ2snLCAnaScgLCdwJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIG9mZl90IHN0b3Bfb2Zmc2V0ID0gKm9mZnNldCArIGNodW5rX3NpemU7CisgICAgICAgICAgICAqb2Zmc2V0ID0gZGF0YV9vZmZzZXQ7CisgICAgICAgICAgICB3aGlsZSAoKm9mZnNldCA8IHN0b3Bfb2Zmc2V0KSB7CisgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gcGFyc2VDaHVuayhvZmZzZXQsIGRlcHRoICsgMSk7CisgICAgICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIENIRUNLX0VRKCpvZmZzZXQsIHN0b3Bfb2Zmc2V0KTsKKworICAgICAgICAgICAgaWYgKGNodW5rX3R5cGUgPT0gRk9VUkNDKCdtJywgJ28nLCAnbycsICd2JykpIHsKKyAgICAgICAgICAgICAgICBtSGF2ZU1ldGFkYXRhID0gdHJ1ZTsKKworICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOyAgLy8gUmV0dXJuIGEgZHVtbXkgZXJyb3IuCisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRk9VUkNDKCd0JywgJ2snLCAnaCcsICdkJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIENIRUNLKGNodW5rX2RhdGFfc2l6ZSA+PSA0KTsKKworICAgICAgICAgICAgdWludDhfdCB2ZXJzaW9uOworICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkX2F0KGRhdGFfb2Zmc2V0LCAmdmVyc2lvbiwgMSkgPCAxKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50NjRfdCBjdGltZSwgbXRpbWUsIGR1cmF0aW9uOworICAgICAgICAgICAgaW50MzJfdCBpZDsKKyAgICAgICAgICAgIHVpbnQzMl90IHdpZHRoLCBoZWlnaHQ7CisKKyAgICAgICAgICAgIGlmICh2ZXJzaW9uID09IDEpIHsKKyAgICAgICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplICE9IDM2ICsgNjApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB1aW50OF90IGJ1ZmZlclszNiArIDYwXTsKKyAgICAgICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpIDwgKHNzaXplX3Qpc2l6ZW9mKGJ1ZmZlcikpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGN0aW1lID0gVTY0X0FUKCZidWZmZXJbNF0pOworICAgICAgICAgICAgICAgIG10aW1lID0gVTY0X0FUKCZidWZmZXJbMTJdKTsKKyAgICAgICAgICAgICAgICBpZCA9IFUzMl9BVCgmYnVmZmVyWzIwXSk7CisgICAgICAgICAgICAgICAgZHVyYXRpb24gPSBVNjRfQVQoJmJ1ZmZlclsyOF0pOworICAgICAgICAgICAgICAgIHdpZHRoID0gVTMyX0FUKCZidWZmZXJbODhdKTsKKyAgICAgICAgICAgICAgICBoZWlnaHQgPSBVMzJfQVQoJmJ1ZmZlcls5Ml0pOworICAgICAgICAgICAgfSBlbHNlIGlmICh2ZXJzaW9uID09IDApIHsKKyAgICAgICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplICE9IDI0ICsgNjApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB1aW50OF90IGJ1ZmZlclsyNCArIDYwXTsKKyAgICAgICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpIDwgKHNzaXplX3Qpc2l6ZW9mKGJ1ZmZlcikpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjdGltZSA9IFUzMl9BVCgmYnVmZmVyWzRdKTsKKyAgICAgICAgICAgICAgICBtdGltZSA9IFUzMl9BVCgmYnVmZmVyWzhdKTsKKyAgICAgICAgICAgICAgICBpZCA9IFUzMl9BVCgmYnVmZmVyWzEyXSk7CisgICAgICAgICAgICAgICAgZHVyYXRpb24gPSBVMzJfQVQoJmJ1ZmZlclsyMF0pOworICAgICAgICAgICAgICAgIHdpZHRoID0gVTMyX0FUKCZidWZmZXJbNzZdKTsKKyAgICAgICAgICAgICAgICBoZWlnaHQgPSBVMzJfQVQoJmJ1ZmZlcls4MF0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBUcmFjayAqdHJhY2sgPSBuZXcgVHJhY2s7CisgICAgICAgICAgICB0cmFjay0+bmV4dCA9IE5VTEw7CisgICAgICAgICAgICBpZiAobUxhc3RUcmFjaykgeworICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPm5leHQgPSB0cmFjazsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUZpcnN0VHJhY2sgPSB0cmFjazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1MYXN0VHJhY2sgPSB0cmFjazsKKworICAgICAgICAgICAgdHJhY2stPm1ldGEgPSBuZXcgTWV0YURhdGE7CisgICAgICAgICAgICB0cmFjay0+dGltZXNjYWxlID0gMDsKKyAgICAgICAgICAgIHRyYWNrLT5zYW1wbGVUYWJsZSA9IG5ldyBTYW1wbGVUYWJsZShtRGF0YVNvdXJjZSk7CisgICAgICAgICAgICB0cmFjay0+bWV0YS0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsICJhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0iKTsKKworICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEZPVVJDQygnbScsICdkJywgJ2gnLCAnZCcpOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplIDwgNCkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHVpbnQ4X3QgdmVyc2lvbjsKKyAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCAmdmVyc2lvbiwgc2l6ZW9mKHZlcnNpb24pKQorICAgICAgICAgICAgICAgICAgICA8IChzc2l6ZV90KXNpemVvZih2ZXJzaW9uKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgb2ZmX3QgdGltZXNjYWxlX29mZnNldDsKKworICAgICAgICAgICAgaWYgKHZlcnNpb24gPT0gMSkgeworICAgICAgICAgICAgICAgIHRpbWVzY2FsZV9vZmZzZXQgPSBkYXRhX29mZnNldCArIDQgKyAxNjsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodmVyc2lvbiA9PSAwKSB7CisgICAgICAgICAgICAgICAgdGltZXNjYWxlX29mZnNldCA9IGRhdGFfb2Zmc2V0ICsgNCArIDg7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdWludDMyX3QgdGltZXNjYWxlOworICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkX2F0KAorICAgICAgICAgICAgICAgICAgICAgICAgdGltZXNjYWxlX29mZnNldCwgJnRpbWVzY2FsZSwgc2l6ZW9mKHRpbWVzY2FsZSkpCisgICAgICAgICAgICAgICAgICAgIDwgKHNzaXplX3Qpc2l6ZW9mKHRpbWVzY2FsZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1MYXN0VHJhY2stPnRpbWVzY2FsZSA9IG50b2hsKHRpbWVzY2FsZSk7CisgICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRJbnQzMihrS2V5VGltZVNjYWxlLCBtTGFzdFRyYWNrLT50aW1lc2NhbGUpOworCisgICAgICAgICAgICBpbnQ2NF90IGR1cmF0aW9uOworICAgICAgICAgICAgaWYgKHZlcnNpb24gPT0gMSkgeworICAgICAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lc2NhbGVfb2Zmc2V0ICsgNCwgJmR1cmF0aW9uLCBzaXplb2YoZHVyYXRpb24pKQorICAgICAgICAgICAgICAgICAgICAgICAgPCAoc3NpemVfdClzaXplb2YoZHVyYXRpb24pKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZHVyYXRpb24gPSBudG9oNjQoZHVyYXRpb24pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpbnQzMl90IGR1cmF0aW9uMzI7CisgICAgICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkX2F0KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzY2FsZV9vZmZzZXQgKyA0LCAmZHVyYXRpb24zMiwgc2l6ZW9mKGR1cmF0aW9uMzIpKQorICAgICAgICAgICAgICAgICAgICAgICAgPCAoc3NpemVfdClzaXplb2YoZHVyYXRpb24zMikpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkdXJhdGlvbiA9IG50b2hsKGR1cmF0aW9uMzIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUxhc3RUcmFjay0+bWV0YS0+c2V0SW50MzIoa0tleUR1cmF0aW9uLCBkdXJhdGlvbik7CisKKyAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2gnLCAnZCcsICdsJywgJ3InKToKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IDI1KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdWludDhfdCBidWZmZXJbMjRdOworICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkX2F0KGRhdGFfb2Zmc2V0LCBidWZmZXIsIDI0KSA8IDI0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoVTMyX0FUKGJ1ZmZlcikgIT0gMCkgeworICAgICAgICAgICAgICAgIC8vIFNob3VsZCBiZSB2ZXJzaW9uIDAsIGZsYWdzIDAuCisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKFUzMl9BVCgmYnVmZmVyWzRdKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgLy8gcHJlX2RlZmluZWQgc2hvdWxkIGJlIDAuCisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUhhbmRsZXJUeXBlID0gVTMyX0FUKCZidWZmZXJbOF0pOworICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3MnLCAnZCcpOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplIDwgOCkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHVpbnQ4X3QgYnVmZmVyWzhdOworICAgICAgICAgICAgQ0hFQ0soY2h1bmtfZGF0YV9zaXplID49IChvZmZfdClzaXplb2YoYnVmZmVyKSk7CisgICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhX29mZnNldCwgYnVmZmVyLCA4KSA8IDgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChVMzJfQVQoYnVmZmVyKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgLy8gU2hvdWxkIGJlIHZlcnNpb24gMCwgZmxhZ3MgMC4KKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50MzJfdCBlbnRyeV9jb3VudCA9IFUzMl9BVCgmYnVmZmVyWzRdKTsKKworICAgICAgICAgICAgaWYgKGVudHJ5X2NvdW50ID4gMSkgeworICAgICAgICAgICAgICAgIC8vIEZvciBub3cgd2Ugb25seSBzdXBwb3J0IGEgc2luZ2xlIHR5cGUgb2YgbWVkaWEgcGVyIHRyYWNrLgorICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9VTlNVUFBPUlRFRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgb2ZmX3Qgc3RvcF9vZmZzZXQgPSAqb2Zmc2V0ICsgY2h1bmtfc2l6ZTsKKyAgICAgICAgICAgICpvZmZzZXQgPSBkYXRhX29mZnNldCArIDg7CisgICAgICAgICAgICBmb3IgKHVpbnQzMl90IGkgPSAwOyBpIDwgZW50cnlfY291bnQ7ICsraSkgeworICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHBhcnNlQ2h1bmsob2Zmc2V0LCBkZXB0aCArIDEpOworICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBDSEVDS19FUSgqb2Zmc2V0LCBzdG9wX29mZnNldCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ3AnLCAnNCcsICdhJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJ2EnLCAnbScsICdyJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChtSGFuZGxlclR5cGUgIT0gRk9VUkNDKCdzJywgJ28nLCAndScsICduJykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50OF90IGJ1ZmZlcls4ICsgMjBdOworICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IChzc2l6ZV90KXNpemVvZihidWZmZXIpKSB7CisgICAgICAgICAgICAgICAgLy8gQmFzaWMgQXVkaW9TYW1wbGVFbnRyeSBzaXplLgorICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBidWZmZXIsIHNpemVvZihidWZmZXIpKSA8IChzc2l6ZV90KXNpemVvZihidWZmZXIpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50MTZfdCBkYXRhX3JlZl9pbmRleCA9IFUxNl9BVCgmYnVmZmVyWzZdKTsKKyAgICAgICAgICAgIHVpbnQxNl90IG51bV9jaGFubmVscyA9IFUxNl9BVCgmYnVmZmVyWzE2XSk7CisKKyAgICAgICAgICAgIGlmICghc3RyY2FzZWNtcCgiYXVkaW8vM2dwcCIsIEZvdXJDQzJNSU1FKGNodW5rX3R5cGUpKSkgeworICAgICAgICAgICAgICAgIC8vIEFNUiBhdWRpbyBpcyBhbHdheXMgbW9uby4KKyAgICAgICAgICAgICAgICBudW1fY2hhbm5lbHMgPSAxOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50MTZfdCBzYW1wbGVfc2l6ZSA9IFUxNl9BVCgmYnVmZmVyWzE4XSk7CisgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVfcmF0ZSA9IFUzMl9BVCgmYnVmZmVyWzI0XSkgPj4gMTY7CisKKyAgICAgICAgICAgIHByaW50ZigiKioqIGNvZGluZz0nJXMnICVkIGNoYW5uZWxzLCBzaXplICVkLCByYXRlICVkXG4iLAorICAgICAgICAgICAgICAgICAgIGNodW5rLCBudW1fY2hhbm5lbHMsIHNhbXBsZV9zaXplLCBzYW1wbGVfcmF0ZSk7CisKKyAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBGb3VyQ0MyTUlNRShjaHVua190eXBlKSk7CisgICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRJbnQzMihrS2V5Q2hhbm5lbENvdW50LCBudW1fY2hhbm5lbHMpOworICAgICAgICAgICAgbUxhc3RUcmFjay0+bWV0YS0+c2V0SW50MzIoa0tleVNhbXBsZVJhdGUsIHNhbXBsZV9yYXRlKTsKKworICAgICAgICAgICAgb2ZmX3Qgc3RvcF9vZmZzZXQgPSAqb2Zmc2V0ICsgY2h1bmtfc2l6ZTsKKyAgICAgICAgICAgICpvZmZzZXQgPSBkYXRhX29mZnNldCArIHNpemVvZihidWZmZXIpOworICAgICAgICAgICAgd2hpbGUgKCpvZmZzZXQgPCBzdG9wX29mZnNldCkgeworICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHBhcnNlQ2h1bmsob2Zmc2V0LCBkZXB0aCArIDEpOworICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBDSEVDS19FUSgqb2Zmc2V0LCBzdG9wX29mZnNldCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ3AnLCAnNCcsICd2Jyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJzInLCAnNicsICczJyk6CisgICAgICAgIGNhc2UgRk9VUkNDKCdhJywgJ3YnLCAnYycsICcxJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChtSGFuZGxlclR5cGUgIT0gRk9VUkNDKCd2JywgJ2knLCAnZCcsICdlJykpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB1aW50OF90IGJ1ZmZlcls3OF07CisgICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplIDwgKHNzaXplX3Qpc2l6ZW9mKGJ1ZmZlcikpIHsKKyAgICAgICAgICAgICAgICAvLyBCYXNpYyBWaWRlb1NhbXBsZUVudHJ5IHNpemUuCisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkX2F0KAorICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpIDwgKHNzaXplX3Qpc2l6ZW9mKGJ1ZmZlcikpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHVpbnQxNl90IGRhdGFfcmVmX2luZGV4ID0gVTE2X0FUKCZidWZmZXJbNl0pOworICAgICAgICAgICAgdWludDE2X3Qgd2lkdGggPSBVMTZfQVQoJmJ1ZmZlcls2ICsgMThdKTsKKyAgICAgICAgICAgIHVpbnQxNl90IGhlaWdodCA9IFUxNl9BVCgmYnVmZmVyWzYgKyAyMF0pOworCisgICAgICAgICAgICBwcmludGYoIioqKiBjb2Rpbmc9JyVzJyB3aWR0aD0lZCBoZWlnaHQ9JWRcbiIsCisgICAgICAgICAgICAgICAgICAgY2h1bmssIHdpZHRoLCBoZWlnaHQpOworCisgICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgRm91ckNDMk1JTUUoY2h1bmtfdHlwZSkpOworICAgICAgICAgICAgbUxhc3RUcmFjay0+bWV0YS0+c2V0SW50MzIoa0tleVdpZHRoLCB3aWR0aCk7CisgICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRJbnQzMihrS2V5SGVpZ2h0LCBoZWlnaHQpOworCisgICAgICAgICAgICBvZmZfdCBzdG9wX29mZnNldCA9ICpvZmZzZXQgKyBjaHVua19zaXplOworICAgICAgICAgICAgKm9mZnNldCA9IGRhdGFfb2Zmc2V0ICsgc2l6ZW9mKGJ1ZmZlcik7CisgICAgICAgICAgICB3aGlsZSAoKm9mZnNldCA8IHN0b3Bfb2Zmc2V0KSB7CisgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gcGFyc2VDaHVuayhvZmZzZXQsIGRlcHRoICsgMSk7CisgICAgICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIENIRUNLX0VRKCpvZmZzZXQsIHN0b3Bfb2Zmc2V0KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICdjJywgJ28nKToKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ2MnLCAnbycsICc2JywgJzQnKToKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KKyAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZS0+c2V0Q2h1bmtPZmZzZXRQYXJhbXMoCisgICAgICAgICAgICAgICAgICAgICAgICBjaHVua190eXBlLCBkYXRhX29mZnNldCwgY2h1bmtfZGF0YV9zaXplKTsKKworICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICdzJywgJ2MnKToKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KKyAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZS0+c2V0U2FtcGxlVG9DaHVua1BhcmFtcygKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOworCisgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3MnLCAneicpOgorICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3onLCAnMicpOgorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQorICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlLT5zZXRTYW1wbGVTaXplUGFyYW1zKAorICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmtfdHlwZSwgZGF0YV9vZmZzZXQsIGNodW5rX2RhdGFfc2l6ZSk7CisKKyAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJ3QnLCAndCcsICdzJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIHN0YXR1c190IGVyciA9CisgICAgICAgICAgICAgICAgbUxhc3RUcmFjay0+c2FtcGxlVGFibGUtPnNldFRpbWVUb1NhbXBsZVBhcmFtcygKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOworCisgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3MnLCAncycpOgorICAgICAgICB7CisgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQorICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlLT5zZXRTeW5jU2FtcGxlUGFyYW1zKAorICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGNodW5rX2RhdGFfc2l6ZSk7CisKKyAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRk9VUkNDKCdlJywgJ3MnLCAnZCcsICdzJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChjaHVua19kYXRhX3NpemUgPCA0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdWludDhfdCBidWZmZXJbMjU2XTsKKyAgICAgICAgICAgIGlmIChjaHVua19kYXRhX3NpemUgPiAob2ZmX3Qpc2l6ZW9mKGJ1ZmZlcikpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfQlVGRkVSX1RPT19TTUFMTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkX2F0KAorICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGJ1ZmZlciwgY2h1bmtfZGF0YV9zaXplKSA8IGNodW5rX2RhdGFfc2l6ZSkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKFUzMl9BVChidWZmZXIpICE9IDApIHsKKyAgICAgICAgICAgICAgICAvLyBTaG91bGQgYmUgdmVyc2lvbiAwLCBmbGFncyAwLgorICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldERhdGEoCisgICAgICAgICAgICAgICAgICAgIGtLZXlFU0RTLCBrVHlwZUVTRFMsICZidWZmZXJbNF0sIGNodW5rX2RhdGFfc2l6ZSAtIDQpOworCisgICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgRk9VUkNDKCdhJywgJ3YnLCAnYycsICdDJyk6CisgICAgICAgIHsKKyAgICAgICAgICAgIGNoYXIgYnVmZmVyWzI1Nl07CisgICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplID4gKG9mZl90KXNpemVvZihidWZmZXIpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0JVRkZFUl9UT09fU01BTEw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBidWZmZXIsIGNodW5rX2RhdGFfc2l6ZSkgPCBjaHVua19kYXRhX3NpemUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldERhdGEoCisgICAgICAgICAgICAgICAgICAgIGtLZXlBVkNDLCBrVHlwZUFWQ0MsIGJ1ZmZlciwgY2h1bmtfZGF0YV9zaXplKTsKKworICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKworc3A8TWVkaWFTb3VyY2U+IE1QRUc0RXh0cmFjdG9yOjpnZXRUcmFjayhzaXplX3QgaW5kZXgpIHsKKyAgICBzdGF0dXNfdCBlcnI7CisgICAgaWYgKChlcnIgPSByZWFkTWV0YURhdGEoKSkgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgVHJhY2sgKnRyYWNrID0gbUZpcnN0VHJhY2s7CisgICAgd2hpbGUgKGluZGV4ID4gMCkgeworICAgICAgICBpZiAodHJhY2sgPT0gTlVMTCkgeworICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKworICAgICAgICB0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hbXBsZSgKKyAgICAgICAgICAgICAgICBzZWVrVGltZVVzICogbVRpbWVzY2FsZSAvIDEwMDAwMDAsCisgICAgICAgICAgICAgICAgJnNhbXBsZUluZGV4LCBTYW1wbGVUYWJsZTo6a1N5bmNTYW1wbGVfRmxhZyk7CisKKyAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgfQorCisgICAgICAgIG1DdXJyZW50U2FtcGxlSW5kZXggPSBzYW1wbGVJbmRleDsKKyAgICAgICAgaWYgKG1CdWZmZXIgIT0gTlVMTCkgeworICAgICAgICAgICAgbUJ1ZmZlci0+cmVsZWFzZSgpOworICAgICAgICAgICAgbUJ1ZmZlciA9IE5VTEw7CisgICAgICAgIH0KKworICAgICAgICAvLyBmYWxsIHRocm91Z2gKKyAgICB9CisKKyAgICBvZmZfdCBvZmZzZXQ7CisgICAgc2l6ZV90IHNpemU7CisgICAgdWludDMyX3QgZHRzOworICAgIGJvb2wgbmV3QnVmZmVyID0gZmFsc2U7CisgICAgaWYgKG1CdWZmZXIgPT0gTlVMTCkgeworICAgICAgICBuZXdCdWZmZXIgPSB0cnVlOworCisgICAgICAgIHN0YXR1c190IGVyciA9IG1TYW1wbGVUYWJsZS0+Z2V0U2FtcGxlT2Zmc2V0QW5kU2l6ZSgKKyAgICAgICAgICAgICAgICBtQ3VycmVudFNhbXBsZUluZGV4LCAmb2Zmc2V0LCAmc2l6ZSk7CisKKyAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgcmV0dXJuIGVycjsKKyAgICAgICAgfQorCisgICAgICAgIGVyciA9IG1TYW1wbGVUYWJsZS0+Z2V0RGVjb2RpbmdUaW1lKG1DdXJyZW50U2FtcGxlSW5kZXgsICZkdHMpOworCisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKworICAgICAgICBlcnIgPSBtR3JvdXAtPmFjcXVpcmVfYnVmZmVyKCZtQnVmZmVyKTsKKyAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgQ0hFQ0tfRVEobUJ1ZmZlciwgTlVMTCk7CisgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKCFtSXNBVkMgfHwgbVdhbnRzTkFMRnJhZ21lbnRzKSB7CisgICAgICAgIGlmIChuZXdCdWZmZXIpIHsKKyAgICAgICAgICAgIHNzaXplX3QgbnVtX2J5dGVzX3JlYWQgPQorICAgICAgICAgICAgICAgIG1EYXRhU291cmNlLT5yZWFkX2F0KG9mZnNldCwgKHVpbnQ4X3QgKiltQnVmZmVyLT5kYXRhKCksIHNpemUpOworCisgICAgICAgICAgICBpZiAobnVtX2J5dGVzX3JlYWQgPCAoc3NpemVfdClzaXplKSB7CisgICAgICAgICAgICAgICAgbUJ1ZmZlci0+cmVsZWFzZSgpOworICAgICAgICAgICAgICAgIG1CdWZmZXIgPSBOVUxMOworCisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtQnVmZmVyLT5zZXRfcmFuZ2UoMCwgc2l6ZSk7CisgICAgICAgICAgICBtQnVmZmVyLT5tZXRhX2RhdGEoKS0+Y2xlYXIoKTsKKyAgICAgICAgICAgIG1CdWZmZXItPm1ldGFfZGF0YSgpLT5zZXRJbnQzMihrS2V5VGltZVVuaXRzLCBkdHMpOworICAgICAgICAgICAgbUJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDMyKGtLZXlUaW1lU2NhbGUsIG1UaW1lc2NhbGUpOworICAgICAgICAgICAgKyttQ3VycmVudFNhbXBsZUluZGV4OworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFtSXNBVkMpIHsKKyAgICAgICAgICAgICpvdXQgPSBtQnVmZmVyOworICAgICAgICAgICAgbUJ1ZmZlciA9IE5VTEw7CisKKyAgICAgICAgICAgIHJldHVybiBPSzsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEVhY2ggTkFMIHVuaXQgaXMgc3BsaXQgdXAgaW50byBpdHMgY29uc3RpdHVlbnQgZnJhZ21lbnRzIGFuZAorICAgICAgICAvLyBlYWNoIG9uZSBvZiB0aGVtIHJldHVybmVkIGluIGl0cyBvd24gYnVmZmVyLgorCisgICAgICAgIENIRUNLKG1CdWZmZXItPnJhbmdlX2xlbmd0aCgpID49IDIpOworCisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKnNyYyA9CisgICAgICAgICAgICAoY29uc3QgdWludDhfdCAqKW1CdWZmZXItPmRhdGEoKSArIG1CdWZmZXItPnJhbmdlX29mZnNldCgpOworCisgICAgICAgIHNpemVfdCBuYWxfc2l6ZSA9IFUxNl9BVChzcmMpOworCisgICAgICAgIENIRUNLKG1CdWZmZXItPnJhbmdlX2xlbmd0aCgpID49IDIgKyBuYWxfc2l6ZSk7CisKKyAgICAgICAgTWVkaWFCdWZmZXIgKmNsb25lID0gbUJ1ZmZlci0+Y2xvbmUoKTsKKyAgICAgICAgY2xvbmUtPnNldF9yYW5nZShtQnVmZmVyLT5yYW5nZV9vZmZzZXQoKSArIDIsIG5hbF9zaXplKTsKKworICAgICAgICBtQnVmZmVyLT5zZXRfcmFuZ2UoCisgICAgICAgICAgICAgICAgbUJ1ZmZlci0+cmFuZ2Vfb2Zmc2V0KCkgKyAyICsgbmFsX3NpemUsCisgICAgICAgICAgICAgICAgbUJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkgLSAyIC0gbmFsX3NpemUpOworCisgICAgICAgIGlmIChtQnVmZmVyLT5yYW5nZV9sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICBtQnVmZmVyLT5yZWxlYXNlKCk7CisgICAgICAgICAgICBtQnVmZmVyID0gTlVMTDsKKyAgICAgICAgfQorCisgICAgICAgICpvdXQgPSBjbG9uZTsKKworICAgICAgICByZXR1cm4gT0s7CisgICAgfSBlbHNlIHsKKyAgICAgICAgLy8gV2hvbGUgTkFMIHVuaXRzIGFyZSByZXR1cm5lZCBidXQgZWFjaCBmcmFnbWVudCBpcyBwcmVmaXhlZCBieQorICAgICAgICAvLyB0aGUgc3RhcnQgY29kZSAoMHgwMCAwMCAwMCAwMSkuCisKKyAgICAgICAgc3NpemVfdCBudW1fYnl0ZXNfcmVhZCA9CisgICAgICAgICAgICBtRGF0YVNvdXJjZS0+cmVhZF9hdChvZmZzZXQsIG1TcmNCdWZmZXIsIHNpemUpOworCisgICAgICAgIGlmIChudW1fYnl0ZXNfcmVhZCA8IChzc2l6ZV90KXNpemUpIHsKKyAgICAgICAgICAgIG1CdWZmZXItPnJlbGVhc2UoKTsKKyAgICAgICAgICAgIG1CdWZmZXIgPSBOVUxMOworCisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0KKworICAgICAgICB1aW50OF90ICpkc3REYXRhID0gKHVpbnQ4X3QgKiltQnVmZmVyLT5kYXRhKCk7CisgICAgICAgIHNpemVfdCBzcmNPZmZzZXQgPSAwOworICAgICAgICBzaXplX3QgZHN0T2Zmc2V0ID0gMDsKKyAgICAgICAgd2hpbGUgKHNyY09mZnNldCA8IHNpemUpIHsKKyAgICAgICAgICAgIENIRUNLKHNyY09mZnNldCArIDEgPCBzaXplKTsKKyAgICAgICAgICAgIHNpemVfdCBuYWxMZW5ndGggPQorICAgICAgICAgICAgICAgIChtU3JjQnVmZmVyW3NyY09mZnNldF0gPDwgOCkgfCBtU3JjQnVmZmVyW3NyY09mZnNldCArIDFdOworICAgICAgICAgICAgQ0hFQ0soc3JjT2Zmc2V0ICsgMSArIG5hbExlbmd0aCA8IHNpemUpOworICAgICAgICAgICAgc3JjT2Zmc2V0ICs9IDI7CisKKyAgICAgICAgICAgIGlmIChuYWxMZW5ndGggPT0gMCkgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBDSEVDSyhkc3RPZmZzZXQgKyA0IDw9I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FRzRXcml0ZXI6OnN0b3AoKSB7CisgICAgaWYgKG1GaWxlID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGludDY0X3QgbWF4X2R1cmF0aW9uID0gMDsKKyAgICBmb3IgKExpc3Q8VHJhY2sgKj46Oml0ZXJhdG9yIGl0ID0gbVRyYWNrcy5iZWdpbigpOworICAgICAgICAgaXQgIT0gbVRyYWNrcy5lbmQoKTsgKytpdCkgeworICAgICAgICAoKml0KS0+c3RvcCgpOworCisgICAgICAgIGludDY0X3QgZHVyYXRpb24gPSAoKml0KS0+Z2V0RHVyYXRpb24oKTsKKyAgICAgICAgaWYgKGR1cmF0aW9uID4gbWF4X2R1cmF0aW9uKSB7CisgICAgICAgICAgICBtYXhfZHVyYXRpb24gPSBkdXJhdGlvbjsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIEZpeCB1cCB0aGUgc2l6ZSBvZiB0aGUgJ21kYXQnIGNodW5rLgorICAgIGZzZWVrKG1GaWxlLCBtTWRhdE9mZnNldCArIDgsIFNFRUtfU0VUKTsKKyAgICBpbnQ2NF90IHNpemUgPSBtT2Zmc2V0IC0gbU1kYXRPZmZzZXQ7CisgICAgc2l6ZSA9IGh0b242NChzaXplKTsKKyAgICBmd3JpdGUoJnNpemUsIDEsIDgsIG1GaWxlKTsKKyAgICBmc2VlayhtRmlsZSwgbU9mZnNldCwgU0VFS19TRVQpOworCisgICAgdGltZV90IG5vdyA9IHRpbWUoTlVMTCk7CisKKyAgICBiZWdpbkJveCgibW9vdiIpOworCisgICAgICBiZWdpbkJveCgibXZoZCIpOworICAgICAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTAKKyAgICAgICAgd3JpdGVJbnQzMihub3cpOyAgICAgICAgICAgLy8gY3JlYXRpb24gdGltZQorICAgICAgICB3cml0ZUludDMyKG5vdyk7ICAgICAgICAgICAvLyBtb2RpZmljYXRpb24gdGltZQorICAgICAgICB3cml0ZUludDMyKDEwMDApOyAgICAgICAgICAvLyB0aW1lc2NhbGUKKyAgICAgICAgd3JpdGVJbnQzMihtYXhfZHVyYXRpb24pOworICAgICAgICB3cml0ZUludDMyKDB4MTAwMDApOyAgICAgICAvLyByYXRlCisgICAgICAgIHdyaXRlSW50MTYoMHgxMDApOyAgICAgICAgIC8vIHZvbHVtZQorICAgICAgICB3cml0ZUludDE2KDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICB3cml0ZUludDMyKDB4MTAwMDApOyAgICAgICAvLyBtYXRyaXgKKyAgICAgICAgd3JpdGVJbnQzMigwKTsKKyAgICAgICAgd3JpdGVJbnQzMigwKTsKKyAgICAgICAgd3JpdGVJbnQzMigwKTsKKyAgICAgICAgd3JpdGVJbnQzMigweDEwMDAwKTsKKyAgICAgICAgd3JpdGVJbnQzMigwKTsKKyAgICAgICAgd3JpdGVJbnQzMigwKTsKKyAgICAgICAgd3JpdGVJbnQzMigwKTsKKyAgICAgICAgd3JpdGVJbnQzMigweDQwMDAwMDAwKTsKKyAgICAgICAgd3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcHJlZGVmaW5lZAorICAgICAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyBwcmVkZWZpbmVkCisgICAgICAgIHdyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHByZWRlZmluZWQKKyAgICAgICAgd3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcHJlZGVmaW5lZAorICAgICAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyBwcmVkZWZpbmVkCisgICAgICAgIHdyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHByZWRlZmluZWQKKyAgICAgICAgd3JpdGVJbnQz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UEVHNFdyaXRlcjo6ZW5kQm94KCkgeworICAgIENIRUNLKCFtQm94ZXMuZW1wdHkoKSk7CisKKyAgICBvZmZfdCBvZmZzZXQgPSAqLS1tQm94ZXMuZW5kKCk7CisgICAgbUJveGVzLmVyYXNlKC0tbUJveGVzLmVuZCgpKTsKKworICAgIGZzZWVrKG1GaWxlLCBvZmZzZXQsIFNFRUtfU0VUKTsKKyAgICB3cml0ZUludDMyKG1PZmZzZXQgLSBvZmZzZXQpOworICAgIG1PZmZzZXQgLT0gNDsKKyAgICBmc2VlayhtRmlsZSwgbU9mZnNldCwgU0VFS19TRVQpOworfQorCit2b2lkIE1QRUc0V3JpdGVyOjp3cml0ZUludDgoaW50OF90IHgpIHsKKyAgICBmd3JpdGUoJngsIDEsIDEsIG1GaWxlKTsKKyAgICArK21PZmZzZXQ7Cit9CisKK3ZvaWQgTVBFRzRXcml0ZXI6OndyaXRlSW50MTYoaW50MTZfdCB4KSB7CisgICAgeCA9IGh0b25zKHgpOworICAgIGZ3cml0ZSgmeCwgMSwgMiwgbUZpbGUpOworICAgIG1PZmZzZXQgKz0gMjsKK30KKwordm9pZCBNUEVHNFdyaXRlcjo6d3JpdGVJbnQzMihpbnQzMl90IHgpIHsKKyAgICB4ID0gaHRvbmwoeCk7CisgICAgZndyaXRlKCZ4LCAxLCA0LCBtRmlsZSk7CisgICAgbU9mZnNldCArPSA0OworfQorCit2b2lkIE1QRUc0V3JpdGVyOjp3cml0ZUludDY0KGludDY0X3QgeCkgeworICAgIHggPSBodG9uNjQoeCk7CisgICAgZndyaXRlKCZ4LCAxLCA4LCBtRmlsZSk7CisgICAgbU9mZnNldCArPSA4OworfQorCit2b2lkIE1QRUc0V3JpdGVyOjp3cml0ZUNTdHJpbmcoY29uc3QgY2hhciAqcykgeworICAgIHNpemVfdCBuID0gc3RybGVuKHMpOworCisgICAgZndyaXRlKHMsIDEsIG4gKyAxLCBtRmlsZSk7CisgICAgbU9mZnNldCArPSBuICsgMTsKK30KKwordm9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lzX21wZWc0ID0gIXN0cmNhc2VjbXAobWltZSwgInZpZGVvL21wNHYtZXMiKTsKKworICAgIE1lZGlhQnVmZmVyICpidWZmZXI7CisgICAgd2hpbGUgKCFtRG9uZSAmJiBtU291cmNlLT5yZWFkKCZidWZmZXIpID09IE9LKSB7CisgICAgICAgIGlmIChidWZmZXItPnJhbmdlX2xlbmd0aCgpID09IDApIHsKKyAgICAgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOworICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKKworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBpZiAobUNvZGVjU3BlY2lmaWNEYXRhID09IE5VTEwgJiYgaXNfbXBlZzQpIHsKKyAgICAgICAgICAgIGNvbnN0IHVpbnQ4X3QgKmRhdGEgPQorICAgICAgICAgICAgICAgIChjb25zdCB1aW50OF90ICopYnVmZmVyLT5kYXRhKCkgKyBidWZmZXItPnJhbmdlX29mZnNldCgpOworCisgICAgICAgICAgICBjb25zdCBzaXplX3Qgc2l6ZSA9IGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCk7CisKKyAgICAgICAgICAgIHNpemVfdCBvZmZzZXQgPSAwOworICAgICAgICAgICAgd2hpbGUgKG9mZnNldCArIDMgPCBzaXplKSB7CisgICAgICAgICAgICAgICAgaWYgKGRhdGFbb2Zmc2V0XSA9PSAweDAwICYmIGRhdGFbb2Zmc2V0ICsgMV0gPT0gMHgwMAorICAgICAgICAgICAgICAgICAgICAmJiBkYXRhW29mZnNldCArIDJdID09IDB4MDEgJiYgZGF0YVtvZmZzZXQgKyAzXSA9PSAweGI2KSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICsrb2Zmc2V0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDSEVDSyhvZmZzZXQgKyAzIDwgc2l6ZSk7CisgICAgICAgICAgICBpZiAob2Zmc2V0ICsgMyA+PSBzaXplKSB7CisgICAgICAgICAgICAgICAgLy8gWFhYIGFzc3VtZSB0aGUgZW50aXJlIGZpcnN0IGNodW5rIG9mIGRhdGEgaXMgdGhlIGNvZGVjIHNwZWNpZmljCisgICAgICAgICAgICAgICAgLy8gZGF0YS4KKyAgICAgICAgICAgICAgICBvZmZzZXQgPSBzaXplOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtQ29kZWNTcGVjaWZpY0RhdGFTaXplID0gb2Zmc2V0OworICAgICAgICAgICAgbUNvZGVjU3BlY2lmaWNEYXRhID0gbWFsbG9jKG9mZnNldCk7CisgICAgICAgICAgICBtZW1jcHkobUNvZGVjU3BlY2lmaWNEYXRhLCBkYXRhLCBvZmZzZXQpOworCisgICAgICAgICAgICBidWZmZXItPnNldF9yYW5nZShidWZmZXItPnJhbmdlX29mZnNldCgpICsgb2Zmc2V0LCBzaXplIC0gb2Zmc2V0KTsKKyAgICAgICAgfQorCisgICAgICAgIG9mZl90IG9mZnNldCA9IG1Pd25lci0+YWRkU2FtcGxlKGJ1ZmZlcik7CisKKyAgICAgICAgU2FtcGxlSW5mbyBpbmZvOworICAgICAgICBpbmZvLnNpemUgPSBidWZmZXItPnJhbmdlX2xlbmd0aCgpOworICAgICAgICBpbmZvLm9mZnNldCA9IG9mZnNldDsKKworICAgICAgICBpbnQzMl90IHVuaXRzLCBzY2FsZTsKKyAgICAgICAgYm9vbCBzdWNjZXNzID0KKyAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQzMihrS2V5VGltZVVuaXRzLCAmdW5pdHMpOworICAgICAgICBDSEVDSyhzdWNjZXNzKTsKKyAgICAgICAgc3VjY2VzcyA9CisgICAgICAgICAgICBidWZmZXItPm1ldGFfZGF0YSgpLT5maW5kSW50MzIoa0tleVRpbWVTY2FsZSwgJnNjYWxlKTsKKyAgICAgICAgQ0hFQ0soc3VjY2Vzcyk7CisKKyAgICAgICAgaW5mby50aW1lc3RhbXAgPSAoaW50NjRfdCl1bml0cyAqIDEwMDAgLyBzY2FsZTsKKworICAgICAgICBtU2FtcGxlSW5mb3MucHVzaF9iYWNrKGluZm8pOworCisgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOworICAgICAgICBidWZmZXIgPSBOVUxMOworICAgIH0KK30KKworaW50NjRfdCBNUEVHNFdyaXRlcjo6VHJhY2s6OmdldER1cmF0aW9uKCkgY29uc3QgeworICAgIHJldHVybiAxMDAwMDsgIC8vIFhYWAorfQorCit2b2lkIE1QRUc0V3JpdGVyOjpUcmFjazo6d3JpdGVUcmFja0hlYWRlcihpbnQzMl90IHRyYWNrSUQpIHsKKyAgICBjb25zdCBjaGFyICptaW1lOworICAgIGJvb2wgc3VjY2VzcyA9IG1NZXRhLT5maW5kQ1N0cmluZyhrS2V5TUlNRVR5cGUsICZtaW1lKTsKKyAgICBDSEVDSyhzdWNjZXNzKTsKKworICAgIGJvb2wgaXNfYXVkaW8gPSAhc3RybmNhc2VjbXAobWltZSwgImF1ZGlvLyIsIDYpOworCisgICAgdGltZV90IG5vdyA9IHRpbWUoTlVMTCk7CisKKyAgICBtT3duZXItPmJlZ2luQm94KCJ0cmFrIik7CisKKyAgICAgIG1Pd25lci0+YmVnaW5Cb3goInRraGQiKTsKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTAKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKG5vdyk7ICAgICAgICAgICAvLyBjcmVhdGlvbiB0aW1lCisgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMihub3cpOyAgICAgICAgICAgLy8gbW9kaWZpY2F0aW9uIHRpbWUKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKHRyYWNrSUQpOworICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHJlc2VydmVkCisgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMihnZXREdXJhdGlvbigpKTsKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHJlc2VydmVkCisgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgICAgLy8gbGF5ZXIKKyAgICAgICAgbU93bmVyLT53cml0ZUludDE2KDApOyAgICAgICAgICAgICAvLyBhbHRlcm5hdGUgZ3JvdXAKKyAgICAgICAgbU93bmVyLT53cml0ZUludDE2KGlzX2F1ZGlvID8gMHgxMDAgOiAwKTsgIC8vIHZvbHVtZQorICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAgIC8vIHJlc2VydmVkCisKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDB4MTAwMDApOyAgICAgICAvLyBtYXRyaXgKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOworICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7CisgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDB4MTAwMDApOworICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7CisgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsKKyAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOworICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMHg0MDAwMDAwMCk7CisKKyAgICAgICAgaWYgKGlzX2F1ZGlvKSB7CisgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7CisgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQzMl90IHdpZHRoLCBoZWlnaHQ7CisgICAgICAgICAgICBib29sIHN1Y2Nlc3MgPSBtTWV0YS0+ZmluZEludDMyKGtLZXlXaWR0aCwgJndpZHRoKTsKKyAgICAgICAgICAgIHN1Y2Nlc3MgPSBzdWNjZXNzICYmIG1NZXRhLT5maW5kSW50MzIoa0tleUhlaWdodCwgJmhlaWdodCk7CisgICAgICAgICAgICBDSEVDSyhzdWNjZXNzKTsKKworICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKHdpZHRoKTsKKyAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMihoZWlnaHQpOworICAgICAgICB9CisgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gdGtoZAorCisgICAgICBtT3duZXItPmJlZ2luQm94KCJtZGlhIik7CisKKyAgICAgICAgbU93bmVyLT5iZWdpbkJveCgibWRoZCIpOworICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gdmVyc2lvbj0wLCBmbGFncz0wCisgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKG5vdyk7ICAgICAgICAgICAvLyBjcmVhdGlvbiB0aW1lCisgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKG5vdyk7ICAgICAgICAgICAvLyBtb2RpZmljYXRpb24gdGltZQorICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigxMDAwKTsgICAgICAgICAgLy8gdGltZXNjYWxlCisgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKGdldER1cmF0aW9uKCkpOworICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgICAgLy8gbGFuZ3VhZ2UgY29kZSBYWFgKKyAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAgIC8vIHByZWRlZmluZWQKKyAgICAgICAgbU93bmVyLT5lbmRCb3goKTsKKworICAgICAgICBtT3duZXItPmJlZ2luQm94KCJoZGxyIik7CisgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTAKKyAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHByZWRlZmluZWQKKyAgICAgICAgICBtT3duZXItPndyaXRlRm91cmNjKGlzX2F1ZGlvID8gInNvdW4iIDogInZpZGUiKTsKKyAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHJlc2VydmVkCisgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcmVzZXJ2ZWQKKyAgICAgICAgICBtT3duZXItPndyaXRlQ1N0cmluZygiIik7ICAgICAgICAgIC8vIG5hbWUKKyAgICAgICAgbU93bmVyLT5lbmRCb3goKTsKKworICAgICAgICBtT3duZXItPmJlZ2luQm94KCJtaW5mIik7CisKKyAgICAgICAgICBtT3duZXItPmJlZ2luQm94KCJkaW5mIik7CisgICAgICAgICAgICBtT3duZXItPmJlZ2luQm94KCJkcmVmIik7CisgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgIC8vIHZlcnNpb249MCwgZmxhZ3M9MAorICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMSk7CisgICAgICAgICAgICAgIG1Pd25lci0+YmVnaW5Cb3goInVybCAiKTsKKyAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMSk7ICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTEKKyAgICAgICAgICAgICAgbU93bmVyLT5lbmRCb3goKTsgIC8vIHVybAorICAgICAgICAgICAgbU93bmVyLT5lbmRCb3goKTsgIC8vIGRyZWYKKyAgICAgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gZGluZgorCisgICAgICAgICAgaWYgKGlzX2F1ZGlvKSB7CisgICAgICAgICAgICAgIG1Pd25lci0+YmVnaW5Cb3goInNtaGQiKTsKKyAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgLy8gdmVyc2lvbj0wLCBmbGFncz0wCisgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgIC8vIGJhbGFuY2UKKyAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDE2KDApOyAgICAgICAgICAgLy8gcmVzZXJ2ZWQKKyAgICAgICAgICAgICAgbU93bmVyLT5lbmRCb3goKTsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICBtT3duZXItPmJlZ2luQm94KCJ2bWhkIik7CisgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigweDAwMDAwMDAxKTsgIC8vIHZlcnNpb249MCwgZmxhZ3M9MQorICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAvLyBncmFwaGljcyBtb2RlCisgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgIC8vIG9wY29sb3IKKyAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDE2KDApOworICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMCk7CisgICAgICAgICAgICAgIG1Pd25lci0+ZW5kQm94KCk7CisgICAgICAgICAgfQorICAgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gbWluZgorCisgICAgICAgIG1Pd25lci0+YmVnaW5Cb3goInN0YmwiKTsKKworICAgICAgICAgIG1Pd25lci0+YmVnaW5Cb3goInN0c2QiKTsKKyAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTAKKyAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigxKTsgICAgICAgICAgICAgICAvLyBlbnRyeSBjb3VudAorICAgICAgICAgICAgaWYgKGlzX2F1ZGlvKSB7CisgICAgICAgICAgICAgICAgbU93bmVyLT5iZWdpbkJveCgieHh4eCIpOyAgICAgICAgICAvLyBhdWRpbyBmb3JtYXQgWFhYCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDE2KDApOyAgICAgICAgICAgLy8gcmVzZXJ2ZWQKKyAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgIC8vIGRhdGEgcmVmIGluZGV4CisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgLy8gcmVzZXJ2ZWQKKyAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigyKTsgICAgICAgICAgIC8vIGNoYW5uZWwgY291bnQKKyAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigxNik7ICAgICAgICAgIC8vIHNhbXBsZSBzaXplCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAvLyBwcmVkZWZpbmVkCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAvLyByZXNlcnZlZAorCisgICAgICAgICAgICAgICAgICBpbnQzMl90IHNhbXBsZXJhdGU7CisgICAgICAgICAgICAgICAgICBib29sIHN1Y2Nlc3MgPSBtTWV0YS0+ZmluZEludDMyKGtLZXlTYW1wbGVSYXRlLCAmc2FtcGxlcmF0ZSk7CisgICAgICAgICAgICAgICAgICBDSEVDSyhzdWNjZXNzKTsKKworICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKHNhbXBsZXJhdGUgPDwgMTYpOworICAgICAgICAgICAgICAgIG1Pd25lci0+ZW5kQm94KCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmICghc3RyY2FzZWNtcCgidmlkZW8vbXA0di1lcyIsIG1pbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+YmVnaW5Cb3goIm1wNHYiKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJjYXNlY21wKCJ2aWRlby8zZ3BwIiwgbWltZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgbU93bmVyLT5iZWdpbkJveCgiczI2MyIpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIENIRUNLKCEic2hvdWxkIG5vdCBiZSBoZXJlLCB1bmtub3duIG1pbWUgdHlwZS4iKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgIC8vIHJlc2VydmVkCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAvLyByZXNlcnZlZAorICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDE2KDApOyAgICAgICAgICAgLy8gZGF0YSByZWYgaW5kZXgKKyAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgIC8vIHByZWRlZmluZWQKKyAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgIC8vIHJlc2VydmVkCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyBwcmVkZWZpbmVkCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyBwcmVkZWZpbmVkCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyBwcmVkZWZpbmVkCisKKyAgICAgICAgICAgICAgICAgIGludDMyX3Qgd2lkdGgsIGhlaWdodDsKKyAgICAgICAgICAgICAgICAgIGJvb2wgc3VjY2VzcyA9IG1NZXRhLT5maW5kSW50MzIoa0tleVdpZHRoLCAmd2lkdGgpOworICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHN1Y2Nlc3MgJiYgbU1ldGEtPmZpbmRJbnQzMihrS2V5SGVpZ2h0LCAmaGVpZ2h0KTsKKyAgICAgICAgICAgICAgICAgIENIRUNLKHN1Y2Nlc3MpOworCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYod2lkdGgpOworICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDE2KGhlaWdodCk7CisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMHg0ODAwMDApOyAgICAvLyBob3JpeiByZXNvbHV0aW9uCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMHg0ODAwMDApOyAgICAvLyB2ZXJ0IHJlc29sdXRpb24KKyAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgIC8vIHJlc2VydmVkCisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMSk7ICAgICAgICAgICAvLyBmcmFtZSBjb3VudAorICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZSgiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCAzMik7CisgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMHgxOCk7ICAgICAgICAvLyBkZXB0aAorICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDE2KC0xKTsgICAgICAgICAgLy8gcHJlZGVmaW5lZAorCisgICAgICAgICAgICAgICAgICBDSEVDSygyMyArIG1Db2RlY1NwZWNpZmljRGF0YVNpemUgPCAxMjgpOworCisgICAgICAgICAgICAgICAgICBpZiAoIXN0cmNhc2VjbXAoInZpZGVvL21wNHYtZXMiLCBtaW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+YmVnaW5Cb3goImVzZHMiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgLy8gdmVyc2lvbj0wLCBmbGFncz0wCisKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQ4KDB4MDMpOyAgLy8gRVNfRGVzY3JUYWcKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQ4KDIzICsgbUNvZGVjU3BlY2lmaWNEYXRhU2l6ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MTYoMHgwMDAwKTsgIC8vIEVTX0lECisgICAgICAgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50OCgweDFmKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDgoMHgwNCk7ICAvLyBEZWNvZGVyQ29uZmlnRGVzY3JUYWcKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQ4KDE1ICsgbUNvZGVjU3BlY2lmaWNEYXRhU2l6ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50OCgweDIwKTsgIC8vIG9iamVjdFR5cGVJbmRpY2F0aW9uIElTTy9JRUMgMTQ0OTItMgorICAgICAgICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDgoMHgxMSk7ICAvLyBzdHJlYW1UeXBlIFZpc3VhbFN0cmVhbQorCisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWMgY29uc3QgdWludDhfdCBrRGF0YVtdID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEsIDB4NzcsIDB4MDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMCwgMHgwMywgMHhlOCwgMHgwMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwLCAweDAzLCAweGU4LCAweDAwCisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZShrRGF0YSwgc2l6ZW9mKGtEYXRhKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQ4KDB4MDUpOyAgLy8gRGVjb2RlclNwZWNpZmljSW5mb1RhZworCisgICAgICAgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50OChtQ29kZWNTcGVjaWZpY0RhdGFTaXplKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGUobUNvZGVjU3BlY2lmaWNEYXRhLCBtQ29kZWNTcGVjaWZpY0RhdGFTaXplKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljIGNvbnN0IHVpbnQ4X3Qga0RhdGEyW10gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNiwgIC8vIFNMQ29uZmlnRGVzY3JpcHRvclRhZworICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMgorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGUoa0RhdGEyLCBzaXplb2Yoa0RhdGEyKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gZXNkcworICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyY2FzZWNtcCgidmlkZW8vM2dwcCIsIG1pbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgbU93bmVyLT5iZWdpbkJveCgiZDI2MyIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgIC8vIHZlbmRvcgorICAgICAgICAgICAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50OCgwKTsgICAvLyBkZWNvZGVyIHZlcnNpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDgoMTApOyAgLy8gbGV2ZWw6IDEwCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQ4KDApOyAgIC8vIHByb2ZpbGU6IDAKKworICAgICAgICAgICAgICAgICAgICAgIG1Pd25lci0+ZW5kQm94KCk7ICAvLyBkMjYzCisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbU93bmVyLT5lbmRCb3goKTsgIC8vIG1wNHYgb3IgczI2MworICAgICAgICAgICAgfQorICAgICAgICAgIG1Pd25lci0+ZW5kQm94KCk7ICAvLyBzdHNkCisKKyAgICAgICAgICBtT3duZXItPmJlZ2luQm94KCJzdHRzIik7CisgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTAKKyAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMihtU2FtcGxlSW5mb3Muc2l6ZSgpIC0gMSk7CisKKyAgICAgICAgICAgIExpc3Q8U2FtcGxlSW5mbz46Oml0ZXJhdG9yIGl0ID0gbVNhbXBsZUluZm9zLmJlZ2luKCk7CisgICAgICAgICAgICBpbnQ2NF90IGxhc3QgPSAoKml0KS50aW1lc3RhbXA7CisgICAgICAgICAgICArK2l0OworICAgICAgICAgICAgd2hpbGUgKGl0ICE9IG1TYW1wbGVJbmZvcy5lbmQoKSkgeworICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigxKTsKKyAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoKCppdCkudGltZXN0YW1wIC0gbGFzdCk7CisKKyAgICAgICAgICAgICAgICBsYXN0ID0gKCppdCkudGltZXN0YW1wOworCisgICAgICAgICAgICAgICAgKytpdDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gc3R0cworCisgICAgICAgICAgbU93bmVyLT5iZWdpbkJveCgic3RzeiIpOworICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgLy8gdmVyc2lvbj0wLCBmbGFncz0wCisgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAvLyBkZWZhdWx0IHNhbXBsZSBzaXplCisgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIobVNhbXBsZUluZm9zLnNpemUoKSk7CisgICAgICAgICAgICBmb3IgKExpc3Q8U2FtcGxlSW5mbz46Oml0ZXJhdG9yIGl0ID0gbVNhbXBsZUluZm9zLmJlZ2luKCk7CisgICAgICAgICAgICAgICAgIGl0ICE9IG1TYW1wbGVJbmZvcy5lbmQoKTsgKytpdCkgeworICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigoKml0KS5zaXplKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gc3RzegorCisgICAgICAgICAgbU93bmVyLT5iZWdpbkJveCgic3RzYyIpOworICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgLy8gdmVyc2lvbj0wLCBmbGFncz0wCisgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIobVNhbXBsZUluZm9zLnNpemUoKSk7CisgICAgICAgICAgICBpbnQzMl90IG4gPSAxOworICAgICAgICAgICAgZm9yIChMaXN0PFNhbXBsZUluZm8+OjppdGVyYXRvciBpdCA9IG1TYW1wbGVJbmZvcy5iZWdpbigpOworICAgICAgICAgICAgICAgICBpdCAhPSBtU2FtcGxlSW5mb3MuZW5kKCk7ICsraXQsICsrbikgeworICAgICAgICAgICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMihuKTsKKyAgICAgICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoMSk7CisgICAgICAgICAgICAgICAgbU93bmVyLT53cml0ZUludDMyKDEpOworIC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KCkgeworICAgIGlmIChtT2JzZXJ2ZXIgPT0gTlVMTCkgeworICAgICAgICBDSEVDS19FUShtUmVmQ291bnQsIDApOworICAgICAgICBkZWxldGUgdGhpczsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGludCBwcmV2Q291bnQgPSBhdG9taWNfYWRkKCZtUmVmQ291bnQsIC0xKTsKKyAgICBpZiAocHJldkNvdW50ID09IDEpIHsKKyAgICAgICAgaWYgKG1PYnNlcnZlciA9PSBOVUxMKSB7CisgICAgICAgICAgICBkZWxldGUgdGhpczsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIG1PYnNlcnZlci0+c2lnbmFsQnVmZmVyUmV0dXJuZWQodGhpcyk7CisgICAgfQorICAgIENIRUNLKHByZXZDb3VudCA+IDApOworfQorCit2b2lkIE1lZGlhQnVmZmVyOjpjbGFpbSgpIHsKKyAgICBDSEVDSyhtT2JzZXJ2ZXIgIT0gTlVMTCk7CisgICAgQ0hFQ0tfRVEobVJlZkNvdW50LCAxKTsKKworICAgIG1SZWZDb3VudCA9IDA7Cit9CisKK3ZvaWQgTWVkaWFCdWZmZXI6OmFkZF9yZWYoKSB7CisgICAgYXRvbWljX2FkZCgmbVJlZkNvdW50LCAxKTsKK30KKwordm9pZCAqTWVkaWFCdWZmZXI6OmRhdGEoKSBjb25zdCB7CisgICAgcmV0dXJuIG1EYXRhOworfQorCitzaXplX3QgTWVkaWFCdWZmZXI6OnNpemUoKSBjb25zdCB7CisgICAgcmV0dXJuIG1TaXplOworfQorCitzaXplX3QgTWVkaWFCdWZmZXI6OnJhbmdlX29mZnNldCgpIGNvbnN0IHsKKyAgICByZXR1cm4gbVJhbmdlT2Zmc2V0OworfQorCitzaXplX3QgTWVkaWFCdWZmZXI6OnJhbmdlX2xlbmd0aCgpIGNvbnN0IHsKKyAgICByZXR1cm4gbVJhbmdlTGVuZ3RoOworfQorCit2b2lkIE1lZGlhQnVmZmVyOjpzZXRfcmFuZ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XAoInNob3V0Y2FzdDovLyIsIHVyaSwgMTIpKSB7CisgICAgICAgIHNldEF1ZGlvU291cmNlKG1ha2VTaG91dGNhc3RTb3VyY2UodXJpKSk7CisjaWYgMAorICAgIH0gZWxzZSBpZiAoIXN0cm5jYXNlY21wKCJjYW1lcmE6IiwgdXJpLCA3KSkgeworICAgICAgICBtVmlkZW9XaWR0aCA9IDQ4MDsKKyAgICAgICAgbVZpZGVvSGVpZ2h0ID0gMzIwOworICAgICAgICBtVmlkZW9EZWNvZGVyID0gQ2FtZXJhU291cmNlOjpDcmVhdGUoKTsKKyNlbmRpZgorICAgIH0gZWxzZSB7CisgICAgICAgIHNwPERhdGFTb3VyY2U+IHNvdXJjZTsKKyAgICAgICAgaWYgKCFzdHJuY2FzZWNtcCgiZmlsZTovLyIsIHVyaSwgNykpIHsKKyAgICAgICAgICAgIHNvdXJjZSA9IG5ldyBNbWFwU291cmNlKHVyaSArIDcpOworICAgICAgICB9IGVsc2UgaWYgKCFzdHJuY2FzZWNtcCgiaHR0cDovLyIsIHVyaSwgNykpIHsKKyAgICAgICAgICAgIHNvdXJjZSA9IG5ldyBIVFRQRGF0YVNvdXJjZSh1cmkpOworICAgICAgICAgICAgc291cmNlID0gbmV3IENhY2hpbmdEYXRhU291cmNlKHNvdXJjZSwgNjQgKiAxMDI0LCAxMCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBBc3N1bWUgaXQncyBhIGZpbGVuYW1lLgorICAgICAgICAgICAgc291cmNlID0gbmV3IE1tYXBTb3VyY2UodXJpKTsKKyAgICAgICAgfQorCisgICAgICAgIG1FeHRyYWN0b3IgPSBNZWRpYUV4dHJhY3Rvcjo6Q3JlYXRlKHNvdXJjZSk7CisKKyAgICAgICAgaWYgKG1FeHRyYWN0b3IgPT0gTlVMTCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorCisgICAgaW5pdCgpOworCisgICAgbUluaXRDaGVjayA9IE9LOworfQorCitNZWRpYVBsYXllckltcGw6Ok1lZGlhUGxheWVySW1wbChpbnQgZmQsIGludDY0X3Qgb2Zmc2V0LCBpbnQ2NF90IGxlbmd0aCkKKyAgICA6IG1Jbml0Q2hlY2soTk9fSU5JVCksCisgICAgICBtVGltZVNvdXJjZShOVUxMKSwKKyAgICAgIG1BdWRpb1BsYXllcihOVUxMKSwKKyAgICAgIG1WaWRlb1dpZHRoKDApLAorICAgICAgbVZpZGVvSGVpZ2h0KDApLAorICAgICAgbVZpZGVvUG9zaXRpb24oMCksCisgICAgICBtRHVyYXRpb24oMCksCisgICAgICBtUGxheWluZyhmYWxzZSksCisgICAgICBtUGF1c2VkKGZhbHNlKSwKKyAgICAgIG1TZWVraW5nKGZhbHNlKSB7CisgICAgTE9HSSgiTWVkaWFQbGF5ZXJJbXBsKCVkLCAlbGxkLCAlbGxkKSIsIGZkLCBvZmZzZXQsIGxlbmd0aCk7CisgICAgRGF0YVNvdXJjZTo6UmVnaXN0ZXJEZWZhdWx0U25pZmZlcnMoKTsKKworICAgIHN0YXR1c190IGVyciA9IG1DbGllbnQuY29ubmVjdCgpOworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgTE9HRSgiRmFpbGVkIHRvIGNvbm5lY3QgdG8gT01YQ2xpZW50LiIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgbUV4dHJhY3RvciA9IE1lZGlhRXh0cmFjdG9yOjpDcmVhdGUoCisgICAgICAgICAgICBuZXcgTW1hcFNvdXJjZShmZCwgb2Zmc2V0LCBsZW5ndGgpKTsKKworICAgIGlmIChtRXh0cmFjdG9yID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGluaXQoKTsKKworICAgIG1Jbml0Q2hlY2sgPSBPSzsKK30KKworc3RhdHVzX3QgTWVkaWFQbGF5ZXJJbXBsOjppbml0Q2hlY2soKSBjb25zdCB7CisgICAgcmV0dXJuIG1Jbml0Q2hlY2s7Cit9CisKK01lZGlhUGxheWVySW1wbDo6fk1lZGlhUGxheWVySW1wbCgpIHsKKyAgICBzdG9wKCk7CisgICAgc2V0U3VyZmFjZShOVUxMKTsKKworICAgIGlmIChtSW5pdENoZWNrID09IE9LKSB7CisgICAgICAgIG1DbGllbnQuZGlzY29ubmVjdCgpOworICAgIH0KKworICAgIExPR1YoIn5NZWRpYVBsYXllckltcGwgZG9uZS4iKTsKK30KKwordm9pZCBNZWRpYVBsYXllckltcGw6OnBsYXkoKSB7CisgICAgTE9HSSgicGxheSIpOworCisgICAgaWYgKG1QbGF5aW5nKSB7CisgICAgICAgIGlmIChtUGF1c2VkKSB7CisgICAgICAgICAgICBpZiAobUF1ZGlvU291cmNlICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBtQXVkaW9QbGF5ZXItPnJlc3VtZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBhdXNlZCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBtUGxheWluZyA9IHRydWU7CisKKyAgICBpZiAobUF1ZGlvU291cmNlICE9IE5VTEwpIHsKKyAgICAgICAgbUF1ZGlvUGxheWVyID0gbmV3IEF1ZGlvUGxheWVyKG1BdWRpb1NpbmspOworICAgICAgICBtQXVkaW9QbGF5ZXItPnNldFNvdXJjZShtQXVkaW9EZWNvZGVyKTsKKyAgICAgICAgbUF1ZGlvUGxheWVyLT5zdGFydCgpOworICAgICAgICBtVGltZVNvdXJjZSA9IG1BdWRpb1BsYXllcjsKKyAgICB9IGVsc2UgeworICAgICAgICBtVGltZVNvdXJjZSA9IG5ldyBTeXN0ZW1UaW1lU291cmNlOworICAgIH0KKworICAgIGlmIChtVmlkZW9EZWNvZGVyICE9IE5VTEwpIHsKKyAgICAgICAgcHRocmVhZF9hdHRyX3QgYXR0cjsKKyAgICAgICAgcHRocmVhZF9hdHRyX2luaXQoJmF0dHIpOworICAgICAgICBwdGhyZWFkX2F0dHJfc2V0ZGV0YWNoc3RhdGUoJmF0dHIsIFBUSFJFQURfQ1JFQVRFX0pPSU5BQkxFKTsKKworICAgICAgICBwdGhyZWFkX2NyZWF0ZSgmbVZpZGVvVGhyZWFkLCAmYXR0ciwgVmlkZW9XcmFwcGVyLCB0aGlzKTsKKworICAgICAgICBwdGhyZWFkX2F0dHJfZGVzdHJveSgmYXR0cik7CisgICAgfQorfQorCit2b2lkIE1lZGlhUGxheWVySW1wbDo6cGF1c2UoKSB7CisgICAgaWYgKCFtUGxheWluZyB8fCBtUGF1c2VkKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAobUF1ZGlvU291cmNlICE9IE5VTEwpIHsKKyAgICAgICAgbUF1ZGlvUGxheWVyLT5wYXVzZSgpOworICAgIH0KKworICAgIG1QYXVzZWQgPSB0cnVlOworfQorCit2b2lkIE1lZGlhUGxheWVySW1wbDo6c3RvcCgpIHsKKyAgICBpZiAoIW1QbGF5aW5nKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBtUGxheWluZyA9IGZhbHNlOworCisgICAgaWYgKG1WaWRlb0RlY29kZXIgIT0gTlVMTCkgeworICAgICAgICB2b2lkICpkdW1teTsKKyAgICAgICAgcHRocmVhZF9qb2luKG1WaWRlb1RocmVhZCwgJmR1bW15KTsKKyAgICB9CisKKyAgICBpZiAobUF1ZGlvU291cmNlICE9IE5VTEwpIHsKKyAgICAgICAgbUF1ZGlvUGxheWVyLT5zdG9wKCk7CisKKyAgICAgICAgZGVsZXRlIG1BdWRpb1BsYXllcjsKKyAgICAgICAgbUF1ZGlvUGxheWVyID0gTlVMTDsKKyAgICB9IGVsc2UgeworICAgICAgICBkZWxldGUgbVRpbWVTb3VyY2U7CisgICAgfQorCisgICAgbVRpbWVTb3VyY2UgPSBOVUxMOworfQorCisvLyBzdGF0aWMKK3ZvaWQgKk1lZGlhUGxheWVySW1wbDo6VmlkZW9XcmFwcGVyKHZvaWQgKm1lKSB7CisgICAgKChNZWRpYVBsYXllckltcGwgKiltZSktPnZpZGVvRW50cnkoKTsKKworICAgIHJldHVybiBOVUxMOworfQorCit2b2lkIE1lZGlhUGxheWVySW1wbDo6dmlkZW9FbnRyeSgpIHsKKyAgICBib29sIGZpcnN0RnJhbWUgPSB0cnVlOworICAgIGJvb2wgZW9mID0gZmFsc2U7CisKKyAgICBzdGF0dXNfdCBlcnIgPSBtVmlkZW9EZWNvZGVyLT5zdGFydCgpOworICAgIENIRUNLX0VRKGVyciwgT0spOworCisgICAgd2hpbGUgKG1QbGF5aW5nKSB7CisgICAgICAgIE1lZGlhQnVmZmVyICpidWZmZXI7CisKKyAgICAgICAgTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zIG9wdGlvbnM7CisgICAgICAgIGJvb2wgc2Vla2luZyA9IGZhbHNlOworCisgICAgICAgIHsKKyAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7CisgICAgICAgICAgICBpZiAobVNlZWtpbmcpIHsKKyAgICAgICAgICAgICAgICBMT0dJKCJzZWVrLW9wdGlvbnMgdG8gJWxsZCIsIG1TZWVrVGltZVVzKTsKKyAgICAgICAgICAgICAgICBvcHRpb25zLnNldFNlZWtUbyhtU2Vla1RpbWVVcyk7CisKKyAgICAgICAgICAgICAgICBtU2Vla2luZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIHNlZWtpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIGVvZiA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKGVvZiB8fCBtUGF1c2VkKSB7CisgICAgICAgICAgICB1c2xlZXAoMTAwMDAwKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gbVZpZGVvRGVjb2Rlci0+cmVhZCgmYnVmZmVyLCAmb3B0aW9ucyk7CisgICAgICAgIENIRUNLKChlcnIgPT0gT0sgJiYgYnVmZmVyICE9IE5VTEwpIHx8IChlcnIgIT0gT0sgJiYgYnVmZmVyID09IE5VTEwpKTsKKworICAgICAgICBpZiAoZXJyID09IEVSUk9SX0VORF9PRl9TVFJFQU0gfHwgZXJyICE9IE9LKSB7CisgICAgICAgICAgICBlb2YgPSB0cnVlOworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBpZiAoYnVmZmVyLT5yYW5nZV9sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICAvLyBUaGUgZmluYWwgYnVmZmVyIGlzIGVtcHR5LgorICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgICAgIGludDMyX3QgdW5pdHMsIHNjYWxlOworICAgICAgICBib29sIHN1Y2Nlc3MgPQorICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+ZmluZEludDMyKGtLZXlUaW1lVW5pdHMsICZ1bml0cyk7CisgICAgICAgIENIRUNLKHN1Y2Nlc3MpOworICAgICAgICBzdWNjZXNzID0KKyAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQzMihrS2V5VGltZVNjYWxlLCAmc2NhbGUpOworICAgICAgICBDSEVDSyhzdWNjZXNzKTsKKworICAgICAgICBpbnQ2NF90IHB0c191cyA9IChpbnQ2NF90KXVuaXRzICogMTAwMDAwMCAvIHNjYWxlOworICAgICAgICB7CisgICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOworICAgICAgICAgICAgbVZpZGVvUG9zaXRpb24gPSBwdHNfdXM7CisKKyAgICAgICAgICAgIExPR1YoIm5vd192aWRlbyA9ICUuMmYgc2VjcyAoJWxsZCBtcykiLAorICAgICAgICAgICAgICAgICBwdHNfdXMgLyAxRTYsIChwdHNfdXMgKyA1MDApIC8gMTAwMCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoc2Vla2luZyAmJiBtQXVkaW9QbGF5ZXIgIT0gTlVMTCkgeworICAgICAgICAgICAgLy8gTm93IHRoYXQgd2Uga25vdyB3aGVyZSBleGFjdGx5IHZpZGVvIHNlZWtlZCAodGFraW5nIHN5bmMtc2FtcGxlcworICAgICAgICAgICAgLy8gaW50byBhY2NvdW50KSwgd2Ugd2lsbCBzZWVrIHRoZSBhdWRpbyB0cmFjayB0byB0aGUgc2FtZSB0aW1lLgorICAgICAgICAgICAgbUF1ZGlvUGxheWVyLT5zZWVrVG8ocHRzX3VzKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChmaXJzdEZyYW1lIHx8IHNlZWtpbmcpIHsKKyAgICAgICAgICAgIG1UaW1lU291cmNlRGVsdGFVcyA9IG1UaW1lU291cmNlLT5nZXRSZWFsVGltZVVzKCkgLSBwdHNfdXM7CisgICAgICAgICAgICBmaXJzdEZyYW1lID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBkaXNwbGF5T3JEaXNjYXJkRnJhbWUoYnVmZmVyLCBwdHNfdXMpOworICAgIH0KKworICAgIG1WaWRlb0RlY29kZXItPnN0b3AoKTsKK30KKwordm9pZCBNZWRpYVBsYXllckltcGw6OmRpc3BsYXlPckRpc2NhcmRGcmFtZSgKKyAgICAgICAgTWVkaWFCdWZmZXIgKmJ1ZmZlciwgaW50NjRfdCBwdHNfdXMpIHsKKyAgICBmb3IgKDs7KSB7CisgICAgICAgIGlmICghbVBsYXlpbmcgfHwgbVBhdXNlZCkgeworICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7CisgICAgICAgICAgICBidWZmZXIgPSBOVUxMOworCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpbnQ2NF90IHJlYWx0aW1lX3VzLCBtZWRpYXRpbWVfdXM7CisgICAgICAgIGlmIChtQXVkaW9QbGF5ZXIgIT0gTlVMTAorICAgICAgICAgICAgJiYgbUF1ZGlvUGxheWVyLT5nZXRNZWRpYVRpbWVNYXBwaW5nKCZyZWFsdGltZV91cywgJm1lZGlhdGltZV91cykpIHsKKyAgICAgICAgICAgIG1UaW1lU291cmNlRGVsdGFVcyA9IHJlYWx0aW1lX3VzIC0gbWVkaWF0aW1lX3VzOworICAgICAgICAgICAgTE9HVigibVRpbWVTb3VyY2VEZWx0YVVzID0gJS4yZiBzZWNzIiwgbVRpbWVTb3VyY2VEZWx0YVVzIC8gMUU2KTsKKyAgICAgICAgfQorCisgICAgICAgIGludDY0X3Qgbm93X3VzID0gbVRpbWVTb3VyY2UtPmdldFJlYWxUaW1lVXMoKTsKKyAgICAgICAgbm93X3VzIC09IG1UaW1lU291cmNlRGVsdGFVczsKKworICAgICAgICBpbnQ2NF90IGRlbGF5X3VzID0gcHRzX3VzIC0gbm93X3VzOworCisgICAgICAgIGlmIChkZWxheV91cyA8IC0xNTAwMCkgeworICAgICAgICAgICAgLy8gV2UncmUgbGF0ZS4KKworICAgICAgICAgICAgTE9HSSgid2UncmUgbGF0ZSBieSAlbGxkIG1zLCBkcm9wcGluZyBhIGZyYW1lXG4iLAorICAgICAgICAgICAgICAgICAtZGVsYXlfdXMgLyAxMDAwKTsKKworICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7CisgICAgICAgICAgICBidWZmZXIgPSBOVUxMOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9IGVsc2UgaWYgKGRlbGF5X3VzID4gMTAwMDAwKSB7CisgICAgICAgICAgICBMT0dJKCJ3ZSdyZSBtdWNoIHRvbyBlYXJseSAoYnkgJWxsZCBtcylcbiIsCisgICAgICAgICAgICAgICAgIGRlbGF5X3VzIC8gMTAwMCk7CisgICAgICAgICAgICB1c2xlZXAoMTAwMDAwKTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9IGVsc2UgaWYgKGRlbGF5X3VzID4gMCkgeworICAgICAgICAgICAgdXNsZWVwKGRlbGF5X3VzKTsKKyAgICAgICAgfQorCisgICAgICAgIGJyZWFrOworICAgIH0KKworICAgIHsKKyA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VyY2UgPT0gTlVMTCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJuY2FzZWNtcChtaW1lLCAidmlkZW8vIiwgNikpIHsKKyAgICAgICAgICAgICAgICBpc19hY2NlcHRhYmxlID0gKG1WaWRlb1NvdXJjZSA9PSBOVUxMKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFpc19hY2NlcHRhYmxlKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNwPE1lZGlhU291cmNlPiBzb3VyY2UgPSBtRXh0cmFjdG9yLT5nZXRUcmFjayhpKTsKKworICAgICAgICAgICAgaW50MzJfdCB1bml0cywgc2NhbGU7CisgICAgICAgICAgICBpZiAobWV0YS0+ZmluZEludDMyKGtLZXlEdXJhdGlvbiwgJnVuaXRzKQorICAgICAgICAgICAgICAgICYmIG1ldGEtPmZpbmRJbnQzMihrS2V5VGltZVNjYWxlLCAmc2NhbGUpKSB7CisgICAgICAgICAgICAgICAgaW50NjRfdCBkdXJhdGlvbl91cyA9IChpbnQ2NF90KXVuaXRzICogMTAwMDAwMCAvIHNjYWxlOworICAgICAgICAgICAgICAgIGlmIChkdXJhdGlvbl91cyA+IG1EdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICBtRHVyYXRpb24gPSBkdXJhdGlvbl91czsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpc19hdWRpbykgeworICAgICAgICAgICAgICAgIHNldEF1ZGlvU291cmNlKHNvdXJjZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNldFZpZGVvU291cmNlKHNvdXJjZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3ZvaWQgTWVkaWFQbGF5ZXJJbXBsOjpzZXRBdWRpb1NvdXJjZShjb25zdCBzcDxNZWRpYVNvdXJjZT4gJnNvdXJjZSk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Jyk7CisgICAgaWYgKHNsYXNoID09IE5VTEwpIHsKKyAgICAgICAgaG9zdCA9IHVyaSArIDEyOworICAgICAgICBwYXRoID0gIi8iOworICAgIH0gZWxzZSB7CisgICAgICAgIGhvc3QgPSBzdHJpbmcodXJpICsgMTIsIHNsYXNoIC0gKHVyaSArIDEyKSk7CisgICAgICAgIHBhdGggPSBzbGFzaDsKKyAgICB9CisKKyAgICBjaGFyICpjb2xvbiA9IHN0cmNocihob3N0LmNfc3RyKCksICc6Jyk7CisgICAgaWYgKGNvbG9uID09IE5VTEwpIHsKKyAgICAgICAgcG9ydCA9IDgwOworICAgIH0gZWxzZSB7CisgICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgbG9uZyB0bXAgPSBzdHJ0b2woY29sb24gKyAxLCAmZW5kLCAxMCk7CisgICAgICAgIENIRUNLKGVuZCA+IGNvbG9uICsgMSk7CisgICAgICAgIENIRUNLKHRtcCA+IDAgJiYgdG1wIDwgNjU1MzYpOworICAgICAgICBwb3J0ID0gdG1wOworCisgICAgICAgIGhvc3QgPSBzdHJpbmcoaG9zdCwgMCwgY29sb24gLSBob3N0LmNfc3RyKCkpOworICAgIH0KKworICAgIExPR0koIkNvbm5lY3RpbmcgdG8gaG9zdCAnJXMnLCBwb3J0ICVkLCBwYXRoICclcyciLAorICAgICAgICAgaG9zdC5jX3N0cigpLCBwb3J0LCBwYXRoLmNfc3RyKCkpOworCisgICAgSFRUUFN0cmVhbSAqaHR0cCA9IG5ldyBIVFRQU3RyZWFtOworICAgIGludCBodHRwX3N0YXR1czsKKworICAgIGZvciAoOzspIHsKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gaHR0cC0+Y29ubmVjdChob3N0LmNfc3RyKCksIHBvcnQpOworICAgICAgICBDSEVDS19FUShlcnIsIE9LKTsKKworICAgICAgICBlcnIgPSBodHRwLT5zZW5kKCJHRVQgIik7CisgICAgICAgIGVyciA9IGh0dHAtPnNlbmQocGF0aC5jX3N0cigpKTsKKyAgICAgICAgZXJyID0gaHR0cC0+c2VuZCgiIEhUVFAvMS4xXHJcbiIpOworICAgICAgICBlcnIgPSBodHRwLT5zZW5kKCJIb3N0OiAiKTsKKyAgICAgICAgZXJyID0gaHR0cC0+c2VuZChob3N0LmNfc3RyKCkpOworICAgICAgICBlcnIgPSBodHRwLT5zZW5kKCJcclxuIik7CisgICAgICAgIGVyciA9IGh0dHAtPnNlbmQoIkljeS1NZXRhRGF0YTogMVxyXG5cclxuIik7CisKKyAgICAgICAgQ0hFQ0tfRVEoT0ssIGh0dHAtPnJlY2VpdmVfaGVhZGVyKCZodHRwX3N0YXR1cykpOworCisgICAgICAgIGlmIChodHRwX3N0YXR1cyA9PSAzMDEgfHwgaHR0cF9zdGF0dXMgPT0gMzAyKSB7CisgICAgICAgICAgICBzdHJpbmcgbG9jYXRpb247CisgICAgICAgICAgICBDSEVDSyhodHRwLT5maW5kX2hlYWRlcl92YWx1ZSgiTG9jYXRpb24iLCAmbG9jYXRpb24pKTsKKworICAgICAgICAgICAgQ0hFQ0soc3RyaW5nKGxvY2F0aW9uLCAwLCA3KSA9PSAiaHR0cDovLyIpOworICAgICAgICAgICAgbG9jYXRpb24uZXJhc2UoMCwgNyk7CisgICAgICAgICAgICBzdHJpbmc6OnNpemVfdHlwZSBzbGFzaFBvcyA9IGxvY2F0aW9uLmZpbmQoJy8nKTsKKyAgICAgICAgICAgIGlmIChzbGFzaFBvcyA9PSBzdHJpbmc6Om5wb3MpIHsKKyAgICAgICAgICAgICAgICBzbGFzaFBvcyA9IGxvY2F0aW9uLnNpemUoKTsKKyAgICAgICAgICAgICAgICBsb2NhdGlvbiArPSAnLyc7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGh0dHAtPmRpc2Nvbm5lY3QoKTsKKworICAgICAgICAgICAgTE9HSSgiUmVkaXJlY3RpbmcgdG8gJXNcbiIsIGxvY2F0aW9uLmNfc3RyKCkpOworCisgICAgICAgICAgICBob3N0ID0gc3RyaW5nKGxvY2F0aW9uLCAwLCBzbGFzaFBvcyk7CisKKyAgICAgICAgICAgIHN0cmluZzo6c2l6ZV90eXBlIGNvbG9uUG9zID0gaG9zdC5maW5kKCc6Jyk7CisgICAgICAgICAgICBpZiAoY29sb25Qb3MgIT0gc3RyaW5nOjpucG9zKSB7CisgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqc3RhcnQgPSBob3N0LmNfc3RyKCkgKyBjb2xvblBvcyArIDE7CisgICAgICAgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgICAgICAgIGxvbmcgdG1wID0gc3RydG9sKHN0YXJ0LCAmZW5kLCAxMCk7CisgICAgICAgICAgICAgICAgQ0hFQ0soZW5kID4gc3RhcnQgJiYgKCplbmQgPT0gJ1wwJykpOworCisgICAgICAgICAgICAgICAgcG9ydCA9ICh0bXAgPj0gMCAmJiB0bXAgPCA2NTUzNikgPyAoaW50KXRtcCA6IDgwOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBwb3J0ID0gODA7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBhdGggPSBzdHJpbmcobG9jYXRpb24sIHNsYXNoUG9zKTsKKworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAoaHR0cF9zdGF0dXMgIT0gMjAwKSB7CisgICAgICAgIExPR0UoIkNvbm5lY3Rpb24gZmFpbGVkOiBodHRwX3N0YXR1cyA9ICVkIiwgaHR0cF9zdGF0dXMpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBNZWRpYVNvdXJjZSAqc291cmNlID0gbmV3IFNob3V0Y2FzdFNvdXJjZShodHRwKTsKKworICAgIHJldHVybiBzb3VyY2U7Cit9CisKK2Jvb2wgTWVkaWFQbGF5ZXJJbXBsOjppc1BsYXlpbmcoKSBjb25zdCB7CisgICAgcmV0dXJuIG1QbGF5aW5nICYmICFtUGF1c2VkOworfQorCitpbnQ2NF90IE1lZGlhUGxheWVySW1wbDo6Z2V0RHVyYXRpb24oKSB7CisgICAgcmV0dXJuIG1EdXJhdGlvbjsKK30KKworaW50NjRfdCBNZWRpYVBsYXllckltcGw6OmdldFBvc2l0aW9uKCkgeworICAgIGludDY0X3QgcG9zaXRpb24gPSAwOworICAgIGlmIChtVmlkZW9Tb3VyY2UgIT0gTlVMTCkgeworICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOworICAgICAgICBwb3NpdGlvbiA9IG1WaWRlb1Bvc2l0aW9uOworICAgIH0gZWxzZSBpZiAobUF1ZGlvUGxheWVyICE9IE5VTEwpIHsKKyAgICAgICAgcG9zaXRpb24gPSBtQXVkaW9QbGF5ZXItPmdldE1lZGlhVGltZVVzKCk7CisgICAgfQorCisgICAgcmV0dXJuIHBvc2l0aW9uOworfQorCitzdGF0dXNfdCBNZWRpYVBsYXllckltcGw6OnNlZWtUbyhpbnQ2NF90IHRpbWUpIHsKKyAgICBMT0dJKCJzZWVrVG8gJWxsZCIsIHRpbWUpOworCisgICAgaWYgKG1QYXVzZWQpIHsKKyAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgfQorCisgICAgaWYgKG1WaWRlb1NvdXJjZSA9PSBOVUxMICYmIG1BdWRpb1BsYXllciAhPSBOVUxMKSB7CisgICAgICAgIG1BdWRpb1BsYXllci0+c2Vla1RvKHRpbWUpOworICAgIH0gZWxzZSB7CisgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7CisgICAgICAgIG1TZWVrVGltZVVzID0gdGltZTsKKyAgICAgICAgbVNlZWtpbmcgPSB0cnVlOworICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKwordm9pZCBNZWRpYVBsYXllckltcGw6OnBvcHVsYXRlSVN1cmZhY2UoKSB7CisgICAgaWYgKG1WaWRlb1NvdXJjZSA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICB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Eoc2l6ZSwgc2l6ZW9mKCp2YWx1ZSkpOworCisgICAgKnZhbHVlID0gKihpbnQzMl90ICopZGF0YTsKKworICAgIHJldHVybiB0cnVlOworfQorCitib29sIE1ldGFEYXRhOjpmaW5kRmxvYXQodWludDMyX3Qga2V5LCBmbG9hdCAqdmFsdWUpIHsKKyAgICB1aW50MzJfdCB0eXBlOworICAgIGNvbnN0IHZvaWQgKmRhdGE7CisgICAgc2l6ZV90IHNpemU7CisgICAgaWYgKCFmaW5kRGF0YShrZXksICZ0eXBlLCAmZGF0YSwgJnNpemUpIHx8IHR5cGUgIT0gVFlQRV9GTE9BVCkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgQ0hFQ0tfRVEoc2l6ZSwgc2l6ZW9mKCp2YWx1ZSkpOworCisgICAgKnZhbHVlID0gKihmbG9hdCAqKWRhdGE7CisKKyAgICByZXR1cm4gdHJ1ZTsKK30KKworYm9vbCBNZXRhRGF0YTo6ZmluZFBvaW50ZXIodWludDMyX3Qga2V5LCB2b2lkICoqdmFsdWUpIHsKKyAgICB1aW50MzJfdCB0eXBlOworICAgIGNvbnN0IHZvaWQgKmRhdGE7CisgICAgc2l6ZV90IHNpemU7CisgICAgaWYgKCFmaW5kRGF0YShrZXksICZ0eXBlLCAmZGF0YSwgJnNpemUpIHx8IHR5cGUgIT0gVFlQRV9QT0lOVEVSKSB7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBDSEVDS19FUShzaXplLCBzaXplb2YoKnZhbHVlKSk7CisKKyAgICAqdmFsdWUgPSAqKHZvaWQgKiopZGF0YTsKKworICAgIHJldHVybiB0cnVlOworfQorCitib29sIE1ldGFEYXRhOjpzZXREYXRhKAorICAgICAgICB1aW50MzJfdCBrZXksIHVpbnQzMl90IHR5cGUsIGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBzaXplKSB7CisgICAgYm9vbCBvdmVyd3JvdGVfZXhpc3RpbmcgPSB0cnVlOworCisgICAgc3NpemVfdCBpID0gbUl0ZW1zLmluZGV4T2ZLZXkoa2V5KTsKKyAgICBpZiAoaSA8IDApIHsKKyAgICAgICAgdHlwZWRfZGF0YSBpdGVtOworICAgICAgICBpID0gbUl0ZW1zLmFkZChrZXksIGl0ZW0pOworCisgICAgICAgIG92ZXJ3cm90ZV9leGlzdGluZyA9IGZhbHNlOworICAgIH0KKworICAgIHR5cGVkX2RhdGEgJml0ZW0gPSBtSXRlbXMuZWRpdFZhbHVlQXQoaSk7CisKKyAgICBpdGVtLnNldERhdGEodHlwZSwgZGF0YSwgc2l6ZSk7CisKKyAgICByZXR1cm4gb3Zlcndyb3RlX2V4aXN0aW5nOworfQorCitib29sIE1ldGFEYXRhOjpmaW5kRGF0YSh1aW50MzJfdCBrZXksIHVpbnQzMl90ICp0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqKmRhdGEsIHNpemVfdCAqc2l6ZSkgY29uc3QgeworICAgIHNzaXplX3QgaSA9IG1JdGVtcy5pbmRleE9mS2V5KGtleSk7CisKKyAgICBpZiAoaSA8IDApIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIGNvbnN0IHR5cGVkX2RhdGEgJml0ZW0gPSBtSXRlbXMudmFsdWVBdChpKTsKKworICAgIGl0ZW0uZ2V0RGF0YSh0eXBlLCBkYXRhLCBzaXplKTsKKworICAgIHJldHVybiB0cnVlOworfQorCitNZXRhRGF0YTo6dHlwZWRfZGF0YTo6dHlwZWRfZGF0YSgpCisgICAgOiBtVHlwZSgwKSwKKyAgICAgIG1TaXplKDApIHsKK30KKworTWV0YURhdGE6OnR5cGVkX2RhdGE6On50eXBlZF9kYXRhKCkgeworICAgIGNsZWFyKCk7Cit9CisKK01ldGFEYXRhOjp0eXBlZF9kYXRhOjp0eXBlZF9kYXRhKGNvbnN0IHR5cGVkX2RhdGEgJmZyb20pCisgICAgOiBtVHlwZShmcm9tLm1UeXBlKSwKKyAg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dWKCJNbWFwU291cmNlICclcyciLCBmaWxlbmFtZSk7CisgICAgQ0hFQ0sobUZkID49IDApOworCisgICAgb2ZmX3Qgc2l6ZSA9IGxzZWVrKG1GZCwgMCwgU0VFS19FTkQpOworICAgIG1TaXplID0gKHNpemVfdClzaXplOworCisgICAgbUJhc2UgPSBtbWFwKDAsIG1TaXplLCBQUk9UX1JFQUQsIE1BUF9GSUxFIHwgTUFQX1NIQVJFRCwgbUZkLCAwKTsKKworICAgIGlmIChtQmFzZSA9PSAodm9pZCAqKS0xKSB7CisgICAgICAgIG1CYXNlID0gTlVMTDsKKworICAgICAgICBjbG9zZShtRmQpOworICAgICAgICBtRmQgPSAtMTsKKyAgICB9Cit9CisKK01tYXBTb3VyY2U6Ok1tYXBTb3VyY2UoaW50IGZkLCBpbnQ2NF90IG9mZnNldCwgaW50NjRfdCBsZW5ndGgpCisgICAgOiBtRmQoZmQpLAorICAgICAgbUJhc2UoTlVMTCksCisgICAgICBtU2l6ZShsZW5ndGgpIHsKKyAgICBMT0dWKCJNbWFwU291cmNlIGZkOiVkIG9mZnNldDolbGxkIGxlbmd0aDolbGxkIiwgZmQsIG9mZnNldCwgbGVuZ3RoKTsKKyAgICBDSEVDSyhmZCA+PSAwKTsKKworICAgIG1CYXNlID0gbW1hcCgwLCBtU2l6ZSwgUFJPVF9SRUFELCBNQVBfRklMRSB8IE1BUF9TSEFSRUQsIG1GZCwgb2Zmc2V0KTsKKworICAgIGlmIChtQmFzZSA9PSAodm9pZCAqKS0xKSB7CisgICAgICAgIG1CYXNlID0gTlVMTDsKKworICAgICAgICBjbG9zZShtRmQpOworICAgICAgICBtRmQgPSAtMTsKKyAgICB9CisKK30KKworTW1hcFNvdXJjZTo6fk1tYXBTb3VyY2UoKSB7CisgICAgaWYgKG1GZCAhPSAtMSkgeworICAgICAgICBtdW5tYXAobUJhc2UsIG1TaXplKTsKKyAgICAgICAgbUJhc2UgPSBOVUxMOworICAgICAgICBtU2l6ZSA9IDA7CisKKyAg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YXJnZXQucHJvbW90ZSgpOworCisgICAgICAgIGlmIChjb2RlYy5nZXQoKSAhPSBOVUxMKSB7CisgICAgICAgICAgICBjb2RlYy0+b25fbWVzc2FnZShtc2cpOworICAgICAgICB9CisgICAgfQorCitwcm90ZWN0ZWQ6CisgICAgdmlydHVhbCB+T01YQ29kZWNPYnNlcnZlcigpIHt9CisKK3ByaXZhdGU6CisgICAgd3A8T01YQ29kZWM+IG1UYXJnZXQ7CisKKyAgICBPTVhDb2RlY09ic2VydmVyKGNvbnN0IE9NWENvZGVjT2JzZXJ2ZXIgJik7CisgICAgT01YQ29kZWNPYnNlcnZlciAmb3BlcmF0b3I9KGNvbnN0IE9NWENvZGVjT2JzZXJ2ZXIgJik7Cit9OworCitzdGF0aWMgY29uc3QgY2hhciAqR2V0Q29kZWMoY29uc3QgQ29kZWNJbmZvICppbmZvLCBzaXplX3QgbnVtSW5mb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqbWltZSwgaW50IGluZGV4KSB7CisgICAgQ0hFQ0soaW5kZXggPj0gMCk7CisgICAgZm9yKHNpemVfdCBpID0gMDsgaSA8IG51bUluZm9zOyArK2kpIHsKKyAgICAgICAgaWYgKCFzdHJjYXNlY21wKG1pbWUsIGluZm9baV0ubWltZSkpIHsKKyAgICAgICAgICAgIGlmIChpbmRleCA9PSAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGluZm9baV0uY29kZWM7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC0taW5kZXg7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gTlVMTDsKK30KKworZW51bSB7CisgICAga0FWQ1Byb2ZpbGVCYXNlbGluZSAgICAgID0gMHg0MiwKKyAgICBrQVZDUHJvZmlsZU1haW4gICAgICAgICAgPSAweDRkLAorICAgIGtBVkNQcm9maWxlRXh0ZW5kZWQgICAgICA9IDB4NTgsCisgICAga0FWQ1Byb2ZpbGVIaWdoICAgICAgICAgID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+CitzdGF0aWMgdm9pZCBJbml0T01YUGFyYW1zKFQgKnBhcmFtcykgeworICAgIHBhcmFtcy0+blNpemUgPSBzaXplb2YoVCk7CisgICAgcGFyYW1zLT5uVmVyc2lvbi5zLm5WZXJzaW9uTWFqb3IgPSAxOworICAgIHBhcmFtcy0+blZlcnNpb24ucy5uVmVyc2lvbk1pbm9yID0gMDsKKyAgICBwYXJhbXMtPm5WZXJzaW9uLnMublJldmlzaW9uID0gMDsKKyAgICBwYXJhbXMtPm5WZXJzaW9uLnMublN0ZXAgPSAwOworfQorCisvLyBzdGF0aWMKK3NwPE9NWENvZGVjPiBPTVhDb2RlYzo6Q3JlYXRlKAorICAgICAgICBjb25zdCBzcDxJT01YPiAmb214LAorICAgICAgICBjb25zdCBzcDxNZXRhRGF0YT4gJm1ldGEsIGJvb2wgY3JlYXRlRW5jb2RlciwKKyAgICAgICAgY29uc3Qgc3A8TWVkaWFTb3VyY2U+ICZzb3VyY2UpIHsKKyAgICBjb25zdCBjaGFyICptaW1lOworICAgIGJvb2wgc3VjY2VzcyA9IG1ldGEtPmZpbmRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgJm1pbWUpOworICAgIENIRUNLKHN1Y2Nlc3MpOworCisgICAgY29uc3QgY2hhciAqY29tcG9uZW50TmFtZSA9IE5VTEw7CisgICAgSU9NWDo6bm9kZV9pZCBub2RlID0gMDsKKyAgICBmb3IgKGludCBpbmRleCA9IDA7OyArK2luZGV4KSB7CisgICAgICAgIGlmIChjcmVhdGVFbmNvZGVyKSB7CisgICAgICAgICAgICBjb21wb25lbnROYW1lID0gR2V0Q29kZWMoCisgICAgICAgICAgICAgICAgICAgIGtFbmNvZGVySW5mbywgc2l6ZW9mKGtFbmNvZGVySW5mbykgLyBzaXplb2Yoa0VuY29kZXJJbmZvWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgbWltZSwgaW5kZXgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY29tcG9uZW50TmFtZSA9IEdldENvZGVjKAorICAgICAgICAgICAgICAgICAgICBrRGVjb2RlckluZm8sIHNpemVvZihrRGVjb2RlckluZm8pIC8gc2l6ZW9mKGtEZWNvZGVySW5mb1swXSksCisgICAgICAgICAgICAgICAgICAgIG1pbWUsIGluZGV4KTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghY29tcG9uZW50TmFtZSkgeworICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKworICAgICAgICBMT0dWKCJBdHRlbXB0aW5nIHRvIGFsbG9jYXRlIE9NWCBub2RlICclcyciLCBjb21wb25lbnROYW1lKTsKKworICAgICAgICBzdGF0dXNfdCBlcnIgPSBvbXgtPmFsbG9jYXRlX25vZGUoY29tcG9uZW50TmFtZSwgJm5vZGUpOworICAgICAgICBpZiAoZXJyID09IE9LKSB7CisgICAgICAgICAgICBMT0dJKCJTdWNjZXNzZnVsbHkgYWxsb2NhdGVkIE9NWCBub2RlICclcyciLCBjb21wb25lbnROYW1lKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgdWludDMyX3QgcXVpcmtzID0gMDsKKyAgICBpZiAoIXN0cmNtcChjb21wb25lbnROYW1lLCAiT01YLlBWLmF2Y2RlYyIpKSB7CisgICAgICAgIHF1aXJrcyB8PSBrV2FudHNOQUxGcmFnbWVudHM7CisgICAgfQorICAgIGlmICghc3RyY21wKGNvbXBvbmVudE5hbWUsICJPTVguVEkuTVAzLmRlY29kZSIpKSB7CisgICAgICAgIHF1aXJrcyB8PSBrTmVlZHNGbHVzaEJlZm9yZURpc2FibGU7CisgICAgfQorICAgIGlmICghc3RyY21wKGNvbXBvbmVudE5hbWUsICJPTVguVEkuQUFDLmRlY29kZSIpKSB7CisgICAgICAgIHF1aXJrcyB8PSBrTmVlZHNGbHVzaEJlZm9yZURpc2FibGU7CisgICAgICAgIHF1aXJrcyB8PSBrUmVxdWlyZXNGbHVzaENvbXBsZXRlRW11bGF0aW9uOworCisgICAgIC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worICAgICAgICBFU0RTIGVzZHMoKGNvbnN0IGNoYXIgKilkYXRhLCBzaXplKTsKKyAgICAgICAgQ0hFQ0tfRVEoZXNkcy5Jbml0Q2hlY2soKSwgT0spOworCisgICAgICAgIGNvbnN0IHZvaWQgKmNvZGVjX3NwZWNpZmljX2RhdGE7CisgICAgICAgIHNpemVfdCBjb2RlY19zcGVjaWZpY19kYXRhX3NpemU7CisgICAgICAgIGVzZHMuZ2V0Q29kZWNTcGVjaWZpY0luZm8oCisgICAgICAgICAgICAgICAgJmNvZGVjX3NwZWNpZmljX2RhdGEsICZjb2RlY19zcGVjaWZpY19kYXRhX3NpemUpOworCisgICAgICAgIHByaW50ZigiZm91bmQgY29kZWMtc3BlY2lmaWMgZGF0YSBvZiBzaXplICVkXG4iLAorICAgICAgICAgICAgICAgY29kZWNfc3BlY2lmaWNfZGF0YV9zaXplKTsKKworICAgICAgICBjb2RlYy0+YWRkQ29kZWNTcGVjaWZpY0RhdGEoCisgICAgICAgICAgICAgICAgY29kZWNfc3BlY2lmaWNfZGF0YSwgY29kZWNfc3BlY2lmaWNfZGF0YV9zaXplKTsKKyAgICB9IGVsc2UgaWYgKG1ldGEtPmZpbmREYXRhKGtLZXlBVkNDLCAmdHlwZSwgJmRhdGEsICZzaXplKSkgeworICAgICAgICBwcmludGYoImZvdW5kIGF2Y2Mgb2Ygc2l6ZSAlZFxuIiwgc2l6ZSk7CisKKyAgICAgICAgLy8gUGFyc2UgdGhlIEFWQ0RlY29kZXJDb25maWd1cmF0aW9uUmVjb3JkCisKKyAgICAgICAgY29uc3QgdWludDhfdCAqcHRyID0gKGNvbnN0IHVpbnQ4X3QgKilkYXRhOworCisgICAgICAgIENIRUNLKHNpemUgPj0gNyk7CisgICAgICAgIENIRUNLX0VRKHB0clswXSwgMSk7ICAvLyBjb25maWd1cmF0aW9uVmVyc2lvbiA9PSAxCisgICAgICAgIHVpbnQ4X3QgcHJvZmlsZSA9IHB0clsxXTsKKyAgICAgICAgdWludDhfdCBsZXZlbCA9IHB0clszXTsKKworICAgICAgICBDSEVDSygocHRyWzRdID4+IDIpID09IDB4M2YpOyAgLy8gcmVzZXJ2ZWQKKworICAgICAgICBzaXplX3QgbGVuZ3RoU2l6ZSA9IDEgKyAocHRyWzRdICYgMyk7CisKKyAgICAgICAgLy8gY29tbWVudGVkIG91dCBjaGVjayBiZWxvdyBhcyBIMjY0X1FWR0FfNTAwX05PX0FVRElPLjNncAorICAgICAgICAvLyB2aW9sYXRlcyBpdC4uLgorICAgICAgICAvLyBDSEVDSygocHRyWzVdID4+IDUpID09IDcpOyAgLy8gcmVzZXJ2ZWQKKworICAgICAgICBzaXplX3QgbnVtU2VxUGFyYW1ldGVyU2V0cyA9IHB0cls1XSAmIDMxOworCisgICAgICAgIHB0ciArPSA2OworICAgICAgICBzaXplIC09IDY7CisKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBudW1TZXFQYXJhbWV0ZXJTZXRzOyArK2kpIHsKKyAgICAgICAgICAgIENIRUNLKHNpemUgPj0gMik7CisgICAgICAgICAgICBzaXplX3QgbGVuZ3RoID0gVTE2X0FUKHB0cik7CisKKyAgICAgICAgICAgIHB0ciArPSAyOworICAgICAgICAgICAgc2l6ZSAtPSAyOworCisgICAgICAgICAgICBDSEVDSyhzaXplID49IGxlbmd0aCk7CisKKyAgICAgICAgICAgIGNvZGVjLT5hZGRDb2RlY1NwZWNpZmljRGF0YShwdHIsIGxlbmd0aCk7CisKKyAgICAgICAgICAgIHB0ciArPSBsZW5ndGg7CisgICAgICAgICAgICBzaXplIC09IGxlbmd0aDsKKyAgICAgICAgfQorCisgICAgICAgIENIRUNLKHNpemUgPj0gMSk7CisgICAgICAgIHNpemVfdCBudW1QaWN0dXJlUGFyYW1ldGVyU2V0cyA9ICpwdHI7CisgICAgICAgICsrcHRyOworICAgICAgICAtLXNpemU7CisKKyAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBudW1QaWN0dXJlUGFyYW1ldGVyU2V0czsgKytpKSB7CisgICAgICAgICAgICBDSEVDSyhzaXplID49IDIpOworICAgICAgICAgICAgc2l6ZV90IGxlbmd0aCA9IFUxNl9BVChwdHIpOworCisgICAgICAgICAgICBwdHIgKz0gMjsKKyAgICAgICAgICAgIHNpemUgLT0gMjsKKworICAgICAgICAgICAgQ0hFQ0soc2l6ZSA+PSBsZW5ndGgpOworCisgICAgICAgICAgICBjb2RlYy0+YWRkQ29kZWNTcGVjaWZpY0RhdGEocHRyLCBsZW5ndGgpOworCisgICAgICAgICAgICBwdHIgKz0gbGVuZ3RoOworICAgICAgICAgICAgc2l6ZSAtPSBsZW5ndGg7CisgICAgICAgIH0KKworICAgICAgICBMT0dJKCJBVkMgcHJvZmlsZSA9ICVkICglcyksIGxldmVsID0gJWQiLAorICAgICAgICAgICAgIChpbnQpcHJvZmlsZSwgQVZDUHJvZmlsZVRvU3RyaW5nKHByb2ZpbGUpLCAoaW50KWxldmVsIC8gMTApOworCisgICAgICAgIGlmICghc3RyY21wKGNvbXBvbmVudE5hbWUsICJPTVguVEkuVmlkZW8uRGVjb2RlciIpCisgICAgICAgICAgICAmJiAocHJvZmlsZSAhPSBrQVZDUHJvZmlsZUJhc2VsaW5lIHx8IGxldmVsID4gMzkpKSB7CisgICAgICAgICAgICAvLyBUaGlzIHN0cmVhbSBleGNlZWRzIHRoZSBkZWNvZGVyJ3MgY2FwYWJpbGl0aWVzLgorCisgICAgICAgICAgICBMT0dFKCJQcm9maWxlIGFuZC9vciBsZXZlbCBleGNlZWQgdGhlIGRlY29kZXIncyBjYXBhYmlsaXRpZXMuIik7CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmICghc3RyY2FzZWNtcCgiYXVkaW8vM2dwcCIsIG1pbWUpKSB7CisgICAgICAgIGNvZGVjLT5zZXRBTVJGb3JtYXQoKTsKKyAgICB9CisgICAgaWYgKCFzdHJjYXNlY21wKCJhdWRpby9hbXItd2IiLCBtaW1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GUiKSkgeworICAgICAgICBPTVhfQ09MT1JfRk9STUFUVFlQRSBmb3JtYXQgPQorICAgICAgICAgICAgT01YX0NPTE9SX0Zvcm1hdDMyYml0QVJHQjg4ODg7CisgICAgICAgICAgICAvLyBPTVhfQ09MT1JfRm9ybWF0WVVWNDIwUGFja2VkUGxhbmFyOworICAgICAgICAgICAgLy8gT01YX0NPTE9SX0Zvcm1hdENiWUNyWTsKKyAgICAgICAgICAgIC8vIE9NWF9DT0xPUl9Gb3JtYXRZVVY0MTFQbGFuYXI7CisKKyAgICAgICAgaW50MzJfdCB3aWR0aCwgaGVpZ2h0OworICAgICAgICBib29sIHN1Y2Nlc3MgPSBtZXRhLT5maW5kSW50MzIoa0tleVdpZHRoLCAmd2lkdGgpOworICAgICAgICBzdWNjZXNzID0gc3VjY2VzcyAmJiBtZXRhLT5maW5kSW50MzIoa0tleUhlaWdodCwgJmhlaWdodCk7CisKKyAgICAgICAgaW50MzJfdCBjb21wcmVzc2VkU2l6ZTsKKyAgICAgICAgc3VjY2VzcyA9IHN1Y2Nlc3MgJiYgbWV0YS0+ZmluZEludDMyKAorICAgICAgICAgICAgICAgIGtLZXlNYXhJbnB1dFNpemUsICZjb21wcmVzc2VkU2l6ZSk7CisKKyAgICAgICAgQ0hFQ0soc3VjY2Vzcyk7CisgICAgICAgIENIRUNLKGNvbXByZXNzZWRTaXplID4gMCk7CisKKyAgICAgICAgY29kZWMtPnNldEltYWdlT3V0cHV0Rm9ybWF0KGZvcm1hdCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgIGNvZGVjLT5zZXRKUEVHSW5wdXRGb3JtYXQod2lkdGgsIGhlaWdodCwgKE9NWF9VMzIpY29tcHJlc3NlZFNpemUpOworICAgIH0KKworICAgIGludDMyX3QgbWF4SW5wdXRTaXplOworICAgIGlmIChjcmVhdGVFbmNvZGVyICYmIG1ldGEtPmZpbmRJbnQzMihrS2V5TWF4SW5wdXRTaXplLCAmbWF4SW5wdXRTaXplKSkgeworICAgICAgICBjb2RlYy0+c2V0TWluQnVmZmVyU2l6ZShrUG9ydEluZGV4SW5wdXQsIChPTVhfVTMyKW1heElucHV0U2l6ZSk7CisgICAgfQorCisgICAgaWYgKCFzdHJjbXAoY29tcG9uZW50TmFtZSwgIk9NWC5USS5BTVIuZW5jb2RlIikKKyAgICAgICAgfHwgIXN0cmNtcChjb21wb25lbnROYW1lLCAiT01YLlRJLldCQU1SLmVuY29kZSIpKSB7CisgICAgICAgIGNvZGVjLT5zZXRNaW5CdWZmZXJTaXplKGtQb3J0SW5kZXhPdXRwdXQsIDgxOTIpOyAgLy8gWFhYCisgICAgfQorCisgICAgY29kZWMtPmluaXRPdXRwdXRGb3JtYXQobWV0YSk7CisKKyAgICByZXR1cm4gY29kZWM7Cit9CisKK3ZvaWQgT01YQ29kZWM6OnNldE1pbkJ1ZmZlclNpemUoT01YX1UzMiBwb3J0SW5kZXgsIE9NWF9VMzIgc2l6ZSkgeworICAgIE9NWF9QQVJBTV9QT1JUREVGSU5JVElPTlRZUEUgZGVmOworICAgIEluaXRPTVhQYXJhbXMoJmRlZik7CisgICAgZGVmLm5Qb3J0SW5kZXggPSBwb3J0SW5kZXg7CisKKyAgICBzdGF0dXNfdCBlcnIgPSBtT01YLT5nZXRfcGFyYW1ldGVyKAorICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtUG9ydERlZmluaXRpb24sICZkZWYsIHNpemVvZihkZWYpKTsKKyAgICBDSEVDS19FUShlcnIsIE9LKTsKKworICAgIGlmIChkZWYubkJ1ZmZlclNpemUgPCBzaXplKSB7CisgICAgICAgIGRlZi5uQnVmZmVyU2l6ZSA9IHNpemU7CisKKyAgICB9CisKKyAgICBlcnIgPSBtT01YLT5zZXRfcGFyYW1ldGVyKAorICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtUG9ydERlZmluaXRpb24sICZkZWYsIHNpemVvZihkZWYpKTsKKyAgICBDSEVDS19FUShlcnIsIE9LKTsKK30KKworc3RhdHVzX3QgT01YQ29kZWM6OnNldFZpZGVvUG9ydEZvcm1hdFR5cGUoCisgICAgICAgIE9NWF9VMzIgcG9ydEluZGV4LAorICAgICAgICBPTVhfVklERU9fQ09ESU5HVFlQRSBjb21wcmVzc2lvbkZvcm1hdCwKKyAgICAgICAgT01YX0NPTE9SX0ZPUk1BVFRZUEUgY29sb3JGb3JtYXQpIHsKKyAgICBPTVhfVklERU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgZm9ybWF0OworICAgIEluaXRPTVhQYXJhbXMoJmZvcm1hdCk7CisgICAgZm9ybWF0Lm5Qb3J0SW5kZXggPSBwb3J0SW5kZXg7CisgICAgZm9ybWF0Lm5JbmRleCA9IDA7CisgICAgYm9vbCBmb3VuZCA9IGZhbHNlOworCisgICAgT01YX1UzMiBpbmRleCA9IDA7CisgICAgZm9yICg7OykgeworICAgICAgICBmb3JtYXQubkluZGV4ID0gaW5kZXg7CisgICAgICAgIHN0YXR1c190IGVyciA9IG1PTVgtPmdldF9wYXJhbWV0ZXIoCisgICAgICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtVmlkZW9Qb3J0Rm9ybWF0LAorICAgICAgICAgICAgICAgICZmb3JtYXQsIHNpemVvZihmb3JtYXQpKTsKKworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICB9CisKKyAgICAgICAgLy8gVGhlIGZvbGxvd2luZyBhc3NlcnRpb24gaXMgdmlvbGF0ZWQgYnkgVEkncyB2aWRlbyBkZWNvZGVyLgorICAgICAgICAvLyBDSEVDS19FUShmb3JtYXQubkluZGV4LCBpbmRleCk7CisKKyNpZiAxCisgICAgICAgIExPR0koInBvcnRJbmRleDogJWxkLCBpbmRleDogJWxkLCBlQ29tcHJlc3Npb25Gb3JtYXQ9JWQgZUNvbG9yRm9ybWF0PSVkIiwKKyAgICAgICAgICAgICBwb3J0SW5kZXgsCisgICAgICAgICAgICAgaW5kZXgsIGZvcm1hdC5lQ29tcHJlc3Npb25Gb3JtYXQsIGZvcm1hdC5lQ29sb3JGb3JtYXQpOworI2VuZGlmCisKKyAgICAgICAgaWYgKCFzdHJjbXAoIk9NWC5USS5WaWRlby5lbmNvZGVyIiwgbUNvbXBvbmVudE5hbWUpKSB7CisgICAgICAgICAgICBpZiAocG9ydEluZGV4ID09IGtQb3J0SW5kZXhJbnB1dAorICAgICAgICAgICAgICAgICAgICAmJiBjb2xvckZvcm1hdCA9PSBmb3JtYXQuZUNvbG9yRm9ybWF0KSB7CisgICAgICAgICAgICAgICAgLy8gZUNvbXByZXNzaW9uRm9ybWF0IGRvZXMgbm90IHNlZW0gcmlnaHQuCisgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4T3V0cHV0CisgICAgICAgICAgICAgICAgICAgICYmIGNvbXByZXNzaW9uRm9ybWF0ID09IGZvcm1hdC5lQ29tcHJlc3Npb25Gb3JtYXQpIHsKKyAgICAgICAgICAgICAgICAvLyBlQ29sb3JGb3JtYXQgZG9lcyBub3Qgc2VlbSByaWdodC4KKyAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoZm9ybWF0LmVDb21wcmVzc2lvbkZvcm1hdCA9PSBjb21wcmVzc2lvbkZvcm1hdAorICAgICAgICAgICAgJiYgZm9ybWF0LmVDb2xvckZvcm1hdCA9PSBjb2xvckZvcm1hdCkgeworICAgICAgICAgICAgZm91bmQgPSB0cnVlOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICArK2luZGV4OworICAgIH0KKworICAgIGlmICghZm91bmQpIHsKKyAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgfQor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IHZpZGVvX2RlZi0+bkZyYW1lV2lkdGggPSB3aWR0aDsKKyAgICB2aWRlb19kZWYtPm5GcmFtZUhlaWdodCA9IGhlaWdodDsKKworICAgIGVyciA9IG1PTVgtPnNldF9wYXJhbWV0ZXIoCisgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4UGFyYW1Qb3J0RGVmaW5pdGlvbiwgJmRlZiwgc2l6ZW9mKGRlZikpOworICAgIENIRUNLX0VRKGVyciwgT0spOworfQorCisKK09NWENvZGVjOjpPTVhDb2RlYygKKyAgICAgICAgY29uc3Qgc3A8SU9NWD4gJm9teCwgSU9NWDo6bm9kZV9pZCBub2RlLCB1aW50MzJfdCBxdWlya3MsCisgICAgICAgIGJvb2wgaXNFbmNvZGVyLAorICAgICAgICBjb25zdCBjaGFyICptaW1lLAorICAgICAgICBjb25zdCBjaGFyICpjb21wb25lbnROYW1lLAorICAgICAgICBjb25zdCBzcDxNZWRpYVNvdXJjZT4gJnNvdXJjZSkKKyAgICA6IG1PTVgob214KSwKKyAgICAgIG1Ob2RlKG5vZGUpLAorICAgICAgbVF1aXJrcyhxdWlya3MpLAorICAgICAgbUlzRW5jb2Rlcihpc0VuY29kZXIpLAorICAgICAgbU1JTUUoc3RyZHVwKG1pbWUpKSwKKyAgICAgIG1Db21wb25lbnROYW1lKHN0cmR1cChjb21wb25lbnROYW1lKSksCisgICAgICBtU291cmNlKHNvdXJjZSksCisgICAgICBtQ29kZWNTcGVjaWZpY0RhdGFJbmRleCgwKSwKKyAgICAgIG1TdGF0ZShMT0FERUQpLAorICAgICAgbUluaXRpYWxCdWZmZXJTdWJtaXQodHJ1ZSksCisgICAgICBtU2lnbmFsbGVkRU9TKGZhbHNlKSwKKyAgICAgIG1Ob01vcmVPdXRwdXREYXRhKGZhbHNlKSwKKyAgICAgIG1TZWVrVGltZVVzKC0xKSB7CisgICAgbVBvcnRTdGF0dXNba1BvcnRJbmRleElucHV0XSA9IEVOQUJMRUQ7CisgICAgbVBvcnRTdGF0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WRlb19kZWNvZGVyLmgyNjMiLCAidmlkZW9fZW5jb2Rlci5oMjYzIiB9LAorICAgIH07CisKKyAgICBzdGF0aWMgY29uc3Qgc2l6ZV90IGtOdW1NaW1lVG9Sb2xlID0KKyAgICAgICAgc2l6ZW9mKGtNaW1lVG9Sb2xlKSAvIHNpemVvZihrTWltZVRvUm9sZVswXSk7CisKKyAgICBzaXplX3QgaTsKKyAgICBmb3IgKGkgPSAwOyBpIDwga051bU1pbWVUb1JvbGU7ICsraSkgeworICAgICAgICBpZiAoIXN0cmNhc2VjbXAobU1JTUUsIGtNaW1lVG9Sb2xlW2ldLm1pbWUpKSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChpID09IGtOdW1NaW1lVG9Sb2xlKSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBjb25zdCBjaGFyICpyb2xlID0KKyAgICAgICAgbUlzRW5jb2RlciA/IGtNaW1lVG9Sb2xlW2ldLmVuY29kZXJSb2xlCisgICAgICAgICAgICAgICAgICAgOiBrTWltZVRvUm9sZVtpXS5kZWNvZGVyUm9sZTsKKworICAgIGlmIChyb2xlICE9IE5VTEwpIHsKKyAgICAgICAgQ09ERUNfTE9HVigiU2V0dGluZyBjb21wb25lbnQgcm9sZSAnJXMnLiIsIHJvbGUpOworCisgICAgICAgIE9NWF9QQVJBTV9DT01QT05FTlRST0xFVFlQRSByb2xlUGFyYW1zOworICAgICAgICBJbml0T01YUGFyYW1zKCZyb2xlUGFyYW1zKTsKKworICAgICAgICBzdHJuY3B5KChjaGFyICopcm9sZVBhcmFtcy5jUm9sZSwKKyAgICAgICAgICAgICAgICByb2xlLCBPTVhfTUFYX1NUUklOR05BTUVfU0laRSAtIDEpOworCisgICAgICAgIHJvbGVQYXJhbXMuY1JvbGVbT01YX01BWF9TVFJJTkdOQU1FX1NJWkUgLSAxXSA9ICdcMCc7CisKKyAgICAgICAgc3RhdHVzX3QgZXJyID0gbU9NWC0+c2V0X3BhcmFtZXRlcigKKyAgICAgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4UGFyYW1TdGFuZGFyZENvbXBvbmVudFJvbGUsCisgICAgICAgICAgICAgICAgJnJvbGVQYXJhbXMsIHNpemVvZihyb2xlUGFyYW1zKSk7CisKKyAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgTE9HVygiRmFpbGVkIHRvIHNldCBzdGFuZGFyZCBjb21wb25lbnQgcm9sZSAnJXMnLiIsIHJvbGUpOworICAgICAgICB9CisgICAgfQorfQorCitPTVhDb2RlYzo6fk9NWENvZGVjKCkgeworICAgIENIRUNLKG1TdGF0ZSA9PSBMT0FERUQgfHwgbVN0YXRlID09IEVSUk9SKTsKKworICAgIHN0YXR1c190IGVyciA9IG1PTVgtPm9ic2VydmVfbm9kZShtTm9kZSwgTlVMTCk7CisgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICBlcnIgPSBtT01YLT5mcmVlX25vZGUobU5vZGUpOworICAgIENIRUNLX0VRKGVyciwgT0spOworCisgICAgbU5vZGUgPSBOVUxMOworICAgIHNldFN0YXRlKERFQUQpOworCisgICAgY2xlYXJDb2RlY1NwZWNpZmljRGF0YSgpOworCisgICAgZnJlZShtQ29tcG9uZW50TmFtZSk7CisgICAgbUNvbXBvbmVudE5hbWUgPSBOVUxMOworCisgICAgZnJlZShtTUlNRSk7CisgICAgbU1JTUUgPSBOVUxMOworfQorCitzdGF0dXNfdCBPTVhDb2RlYzo6aW5pdCgpIHsKKyAgICAvLyBtTG9jayBpcyBoZWxkLgorCisgICAgQ0hFQ0tfRVEobVN0YXRlLCBMT0FERUQpOworCisgICAgc3RhdHVzX3QgZXJyOworICAgIGlmICghKG1RdWlya3MgJiBrUmVxdWlyZXNMb2FkZWRUb0lkbGVBZnRlckFsbG9jYXRpb24pKSB7CisgICAgICAgIGVyciA9IG1PTVgtPnNlbmRfY29tbWFuZChtTm9kZSwgT01YX0NvbW1hbmRTdGF0ZVNldCwgT01YX1N0YXRlSWRsZSk7CisgICAgICAgIENIRUNLX0VRKGVyciwgT0spOworICAgICAgICBzZXRTdGF0ZShMT0FERURfVE9fSURMRSk7CisgICAgfQorCisgICAgZXJyID0gYWxsb2NhdGVCdWZmZXJzKCk7CisgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICBpZiAobVF1aXJrcyAmIGtSZXF1aXJlc0xvYWRlZFRvSWRsZUFmdGVyQWxsb2NhdGlvbikgeworICAgICAgICBlcnIgPSBtT01YLT5zZW5kX2NvbW1hbmQobU5vZGUsIE9NWF9Db21tYW5kU3RhdGVTZXQsIE9NWF9TdGF0ZUlkbGUpOworICAgICAgICBDSEVDS19FUShlcnIsIE9LKTsKKworICAgICAgICBzZXRTdGF0ZShMT0FERURfVE9fSURMRSk7CisgICAgfQorCisgICAgd2hpbGUgKG1TdGF0ZSAhPSBFWEVDVVRJTkcgJiYgbVN0YXRlICE9IEVSUk9SKSB7CisgICAgICAgIG1Bc3luY0NvbXBsZXRpb24ud2FpdChtTG9jayk7CisgICAgfQorCisgICAgcmV0dXJuIG1TdGF0ZSA9PSBFUlJPUiA/IFVOS05PV05fRVJST1IgOiBPSzsKK30KKworLy8gc3RhdGljCitib29sIE9NWENvZGVjOjppc0ludGVybWVkaWF0ZVN0YXRlKFN0YXRlIHN0YXRlKSB7CisgICAgcmV0dXJuIHN0YXRlID09IExPQURFRF9UT19JRExFCisgICAgICAgIHx8IHN0YXRlID09IElETEVfVE9fRVhFQ1VUSU5HCisgICAgICAgIHx8IHN0YXRlID09IEVYRUNVVElOR19UT19JRExFCisgICAgICAgIHx8IHN0YXRlID09IElETEVfVE9fTE9BREVECisgICAgICAgIHx8IHN0YXRlID09IFJFQ09ORklHVVJJTkc7Cit9CisKK3N0YXR1c190IE9NWENvZGVjOjphbGxvY2F0ZUJ1ZmZlcnMoKSB7CisgICAgc3RhdHVzX3QgZXJyID0gYWxsb2NhdGVCdWZmZXJzT25Qb3J0KGt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AgICAgICAgICAmJiAobVF1aXJrcyAmIGtSZXF1aXJlc0FsbG9jYXRlQnVmZmVyT25JbnB1dFBvcnRzKSkgeworICAgICAgICAgICAgZXJyID0gbU9NWC0+YWxsb2NhdGVfYnVmZmVyX3dpdGhfYmFja3VwKAorICAgICAgICAgICAgICAgICAgICBtTm9kZSwgcG9ydEluZGV4LCBtZW0sICZidWZmZXIpOworICAgICAgICB9IGVsc2UgaWYgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4T3V0cHV0CisgICAgICAgICAgICAgICAgJiYgKG1RdWlya3MgJiBrUmVxdWlyZXNBbGxvY2F0ZUJ1ZmZlck9uT3V0cHV0UG9ydHMpKSB7CisgICAgICAgICAgICBlcnIgPSBtT01YLT5hbGxvY2F0ZV9idWZmZXIoCisgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBwb3J0SW5kZXgsIGRlZi5uQnVmZmVyU2l6ZSwgJmJ1ZmZlcik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBlcnIgPSBtT01YLT51c2VfYnVmZmVyKG1Ob2RlLCBwb3J0SW5kZXgsIG1lbSwgJmJ1ZmZlcik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgICAgICBMT0dFKCJhbGxvY2F0ZV9idWZmZXJfd2l0aF9iYWNrdXAgZmFpbGVkIik7CisgICAgICAgICAgICByZXR1cm4gZXJyOworICAgICAgICB9CisKKyAgICAgICAgQnVmZmVySW5mbyBpbmZvOworICAgICAgICBpbmZvLm1CdWZmZXIgPSBidWZmZXI7CisgICAgICAgIGluZm8ubU93bmVkQnlDb21wb25lbnQgPSBmYWxzZTsKKyAgICAgICAgaW5mby5tTWVtID0gbWVtOworICAgICAgICBpbmZvLm1NZWRpYUJ1ZmZlciA9IE5VTEw7CisKKyAgICAgICAgaWYgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4T3V0cHV0KSB7CisgICAgICAgICAgICBpbmZvLm1NZWRpYUJ1ZmZlciA9IG5ldyBNZWRpYUJ1ZmZlcihtZW0tPnBvaW50ZXIoKSwgbWVtLT5zaXplKCkpOworICAgICAgICAgICAgaW5mby5tTWVkaWFCdWZmZXItPnNldE9ic2VydmVyKHRoaXMpOworICAgICAgICB9CisKKyAgICAgICAgbVBvcnRCdWZmZXJzW3BvcnRJbmRleF0ucHVzaChpbmZvKTsKKworICAgICAgICBDT0RFQ19MT0dWKCJhbGxvY2F0ZWQgYnVmZmVyICVwIG9uICVzIHBvcnQiLCBidWZmZXIsCisgICAgICAgICAgICAgcG9ydEluZGV4ID09IGtQb3J0SW5kZXhJbnB1dCA/ICJpbnB1dCIgOiAib3V0cHV0Iik7CisgICAgfQorCisgICAgZHVtcFBvcnRTdGF0dXMocG9ydEluZGV4KTsKKworICAgIHJldHVybiBPSzsKK30KKwordm9pZCBPTVhDb2RlYzo6b25fbWVzc2FnZShjb25zdCBvbXhfbWVzc2FnZSAmbXNnKSB7CisgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKKworICAgIHN3aXRjaCAobXNnLnR5cGUpIHsKKyAgICAgICAgY2FzZSBvbXhfbWVzc2FnZTo6RVZFTlQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIG9uRXZlbnQoCisgICAgICAgICAgICAgICAgIG1zZy51LmV2ZW50X2RhdGEuZXZlbnQsIG1zZy51LmV2ZW50X2RhdGEuZGF0YTEsCisgICAgICAgICAgICAgICAgIG1zZy51LmV2ZW50X2RhdGEuZGF0YTIpOworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2Ugb214X21lc3NhZ2U6OkVNUFRZX0JVRkZFUl9ET05FOgorICAgICAgICB7CisgICAgICAgICAgICBJT01YOjpidWZmZXJfaWQgYnVmZmVyID0gbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEuYnVmZmVyOworCisgICAgICAgICAgICBDT0RFQ19MT0dWKCJFTVBUWV9CVUZGRVJfRE9ORShidWZmZXI6ICVwKSIsIGJ1ZmZlcik7CisKKyAgICAgICAgICAgIFZlY3RvcjxCdWZmZXJJbmZvPiAqYnVmZmVycyA9ICZtUG9ydEJ1ZmZlcnNba1BvcnRJbmRleElucHV0XTsKKyAgICAgICAgICAgIHNpemVfdCBpID0gMDsKKyAgICAgICAgICAgIHdoaWxlIChpIDwgYnVmZmVycy0+c2l6ZSgpICYmICgqYnVmZmVycylbaV0ubUJ1ZmZlciAhPSBidWZmZXIpIHsKKyAgICAgICAgICAgICAgICArK2k7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIENIRUNLKGkgPCBidWZmZXJzLT5zaXplKCkpOworICAgICAgICAgICAgaWYgKCEoKmJ1ZmZlcnMpW2ldLm1Pd25lZEJ5Q29tcG9uZW50KSB7CisgICAgICAgICAgICAgICAgTE9HVygiV2UgYWxyZWFkeSBvd24gaW5wdXQgYnVmZmVyICVwLCB5ZXQgcmVjZWl2ZWQgIgorICAgICAgICAgICAgICAgICAgICAgImFuIEVNUFRZX0JVRkZFUl9ET05FLiIsIGJ1ZmZlcik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJ1ZmZlcnMtPmVkaXRJdGVtQXQoaSkubU93bmVkQnlDb21wb25lbnQgPSBmYWxzZTsKKworICAgICAgICAgICAgaWYgKG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhJbnB1dF0gPT0gRElTQUJMSU5HKSB7CisgICAgICAgICAgICAgICAgQ09ERUNfTE9HVigiUG9ydCBpcyBkaXNhYmxlZCwgZnJlZWluZyBidWZmZXIgJXAiLCBidWZmZXIpOworCisgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KKyAgICAgICAgICAgICAgICAgICAgbU9NWC0+ZnJlZV9idWZmZXIobU5vZGUsIGtQb3J0SW5kZXhJbnB1dCwgYnVmZmVyKTsKKyAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIE9LKTsKKworICAgICAgICAgICAgICAgIGJ1ZmZlcnMtPnJlbW92ZUF0KGkpOworICAgICAgICAgICAgfSBlbHNlIGlmIChtUG9ydFN0YXR1c1trUG9ydEluZGV4SW5wdXRdICE9IFNIVVRUSU5HX0RPV04pIHsKKyAgICAgICAgICAgICAgICBDSEVDS19FUShtUG9ydFN0YXR1c1trUG9ydEluZGV4SW5wdXRdLCBFTkFCTEVEKTsKKyAgICAgICAgICAgICAgICBkcmFpbklucHV0QnVmZmVyKCZidWZmZXJzLT5lZGl0SXRlbUF0KGkpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIG9teF9tZXNzYWdlOjpGSUxMX0JVRkZFUl9ET05FOgorICAgICAgICB7CisgICAgICAgICAgICBJT01YOjpidWZmZXJfaWQgYnVmZmVyID0gbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEuYnVmZmVyOworICAgICAgICAgICAgT01YX1UzMiBmbGFncyA9IG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLmZsYWdzOworCisgICAgICAgICAgICBDT0RFQ19MT0dWKCJGSUxMX0JVRkZFUl9ET05FKGJ1ZmZlcjogJXAsIHNpemU6ICVsZCwgZmxhZ3M6IDB4JTA4bHgpIiwKKyAgICAgICAgICAgICAgICAgYnVmZmVyLAorICAgICAgICAgICAgICAgICBtc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5yYW5nZV9sZW5ndGgsCisgICAgICAgICAgICAgICAgIGZsYWdzKTsKKworICAgICAgICAgICAgQ09ERUNfTE9HVigiRklMTF9CVUZGRVJfRE9ORSh0aW1lc3RhbXA6ICVsbGQgdXMgKCUuMmYgc2VjcykpIiwKKyAgICAgICAgICAgICAgICAgbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEudGltZXN0YW1wLAorICAgICAgICAgICAgICAgICBtc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS50aW1lc3RhbXAgLyAxRTYpOworCisgICAgICAgICAgICBWZWN0b3I8QnVmZmVySW5mbz4gKmJ1ZmZlcnMgPSAmbVBvcnRCdWZmZXJzW2tQb3J0SW5kZXhPdXRwdXRdOworICAgICAgICAgICAgc2l6ZV90IGkgPSAwOworICAgICAgICAgICAgd2hpbGUgKGkgPCBidWZmZXJzLT5zaXplKCkgJiYgKCpidWZmZXJzKVtpXS5tQnVmZmVyICE9IGJ1ZmZlcikgeworICAgICAgICAgICAgICAgICsraTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQ0hFQ0soaSA8IGJ1ZmZlcnMtPnNpemUoKSk7CisgICAgICAgICAgICBCdWZmZXJJbmZvICppbmZvID0gJmJ1ZmZlcnMtPmVkaXRJdGVtQXQoaSk7CisKKyAgICAgICAgICAgIGlmICghaW5mby0+bU93bmVkQnlDb21wb25lbnQpIHsKKyAgICAgICAgICAgICAgICBMT0dXKCJXZSBhbHJlYWR5IG93biBvdXRwdXQgYnVmZmVyICVwLCB5ZXQgcmVjZWl2ZWQgIgorICAgICAgICAgICAgICAgICAgICAgImEgRklMTF9CVUZGRVJfRE9ORS4iLCBidWZmZXIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbmZvLT5tT3duZWRCeUNvbXBvbmVudCA9IGZhbHNlOworCisgICAgICAgICAgICBpZiAobVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0gPT0gRElTQUJMSU5HKSB7CisgICAgICAgICAgICAgICAgQ09ERUNfTE9HVigiUG9ydCBpcyBkaXNhYmxlZCwgZnJlZWluZyBidWZmZXIgJXAiLCBidWZmZXIpOworCisgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KKyAgICAgICAgICAgICAgICAgICAgbU9NWC0+ZnJlZV9idWZmZXIobU5vZGUsIGtQb3J0SW5kZXhPdXRwdXQsIGJ1ZmZlcik7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICAgICAgICAgICAgICBidWZmZXJzLT5yZW1vdmVBdChpKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0gPT0gRU5BQkxFRAorICAgICAgICAgICAgICAgICAgICAgICAmJiAoZmxhZ3MgJiBPTVhfQlVGRkVSRkxBR19FT1MpKSB7CisgICAgICAgICAgICAgICAgQ09ERUNfTE9HVigiTm8gbW9yZSBvdXRwdXQgZGF0YS4iKTsKKyAgICAgICAgICAgICAgICBtTm9Nb3JlT3V0cHV0RGF0YSA9IHRydWU7CisgICAgICAgICAgICAgICAgbUJ1ZmZlckZpbGxlZC5zaWduYWwoKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0gIT0gU0hVVFRJTkdfRE9XTikgeworICAgICAgICAgICAgICAgIENIRUNLX0VRKG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhPdXRwdXRdLCBFTkFCTEVEKTsKKworICAgICAgICAgICAgICAgIE1lZGlhQnVmZmVyICpidWZmZXIgPSBpbmZvLT5tTWVkaWFCdWZmZXI7CisKKyAgICAgICAgICAgICAgICBidWZmZXItPnNldF9yYW5nZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLnJhbmdlX29mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLnJhbmdlX2xlbmd0aCk7CisKKyAgICAgICAgICAgICAgICBidWZmZXItPm1ldGFfZGF0YSgpLT5jbGVhcigpOworCisgICAgICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50MzIoCisgICAgICAgICAgICAgICAgICAgICAgICBrS2V5VGltZVVuaXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgKG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLnRpbWVzdGFtcCArIDUwMCkgLyAxMDAwKTsKKworICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDMyKAorICAgICAgICAgICAgICAgICAgICAgICAga0tleVRpbWVTY2FsZSwgMTAwMCk7CisKKyAgICAgICAgICAgICAgICBpZiAobXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEuZmxhZ3MgJiBPTVhfQlVGRkVSRkxBR19TWU5DRlJBTUUpIHsKKyAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50MzIoa0tleUlzU3luY0ZyYW1lLCB0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBidWZmZXItPm1ldGFfZGF0YSgpLT5zZXRQb2ludGVyKAorICAgICAgICAgICAgICAgICAgICAgICAga0tleVBsYXRmb3JtUHJpdmF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLnBsYXRmb3JtX3ByaXZhdGUpOworCisgICAgICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0UG9pbnRlcigKKyAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlCdWZmZXJJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLmJ1ZmZlcik7CisKKyAgICAgICAgICAgICAgICBtRmlsbGVkQnVmZmVycy5wdXNoX2JhY2soaSk7CisgICAgICAgICAgICAgICAgbUJ1ZmZlckZpbGxlZC5zaWduYWwoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDSyghInNob3VsZCBub3QgYmUgaGVyZS4iKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkIE9NWENvZGVjOjpvbkV2ZW50KE9NWF9FVkVOVFRZUEUgZXZlbnQsIE9NWF9VMzIgZGF0YTEsIE9NWF9VMzIgZGF0YTIpIHsKKyAgICBzd2l0Y2ggKGV2ZW50KSB7CisgICAgICAgIGNhc2UgT01YX0V2ZW50Q21kQ29tcGxldGU6CisgICAgICAgIHsKKyAgICAgICAgICAgIG9uQ21kQ29tcGxldGUoKE9NWF9DT01NQU5EVFlQRSlkYXRhMSwgZGF0YTIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIE9NWF9FdmVudEVycm9yOgorICAgICAgICB7CisgICAgICAgICAgICBMT0dFKCJFUlJPUiglbGQsICVsZCkiLCBkYXRhMSwgZGF0YTIpOworCisgICAgICAgICAgICBzZXRTdGF0ZShFUlJPUik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgT01YX0V2ZW50UG9ydFNldHRpbmdzQ2hhbmdlZDoKKyAgICAgICAgeworICAgICAgICAgICAgb25Qb3J0U2V0dGluZ3NDaGFuZ2VkKGRhdGExKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBPTVhfRXZlbnRCdWZmZXJGbGFnOgorICAgICAgICB7CisgICAgICAgICAgICBDT0RFQ19MT0dWKCJFVkVOVF9CVUZGRVJfRkxBRyglbGQpIiwgZGF0YTEpOworCisgICAgICAgICAgICBpZiAoZGF0YTEgPT0ga1BvcnRJbmRleE91dHB1dCkgeworICAgICAgICAgICAgICAgIG1Ob01vcmVPdXRwdXREYXRhID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgQ09ERUNfTE9HVigiRVZFTlQoJWQsICVsZCwgJWxkKSIsIGV2ZW50LCBkYXRhMSwgZGF0YTIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3ZvaWQgT01YQ29kZWM6Om9uQ21kQ29tcGxldGUoT01YX0NPTU1BTkRUWVBFIGNtZCwgT01YX1UzMiBkYXRhKSB7CisgICAgc3dpdGNoIChjbWQpIHsKKyAgICAgICAgY2FzZSBPTVhfQ29tbWFuZFN0YXRlU2V0OgorICAgICAgICB7CisgICAgICAgICAgICBvblN0YXRlQ2hhbmdlKChPTVhfU1RBVEVUWVBFKWRhdGEpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIE9NWF9Db21tYW5kUG9ydERpc2FibGU6CisgICAgICAgIHsKKyAgICAgICAgICAgIE9NWF9VMzIgcG9ydEluZGV4ID0gZGF0YTsKKyAgICAgICAgICAgIENPREVDX0xPR1YoIlBPUlRfRElTQUJMRUQoJWxkKSIsIHBvcnRJbmRleCk7CisKKyAgICAgICAgICAgIENIRUNLKG1TdGF0ZSA9PSBFWEVDVVRJTkcgfHwgbVN0YXRlID09IFJFQ09ORklHVVJJTkcpOworICAgICAgICAgICAgQ0hFQ0tfRVEobVBvcnRTdGF0dXNbcG9ydEluZGV4XSwgRElTQUJMSU5HKTsKKyAgICAgICAgICAgIENIRUNLX0VRKG1Qb3J0QnVmZmVyc1twb3J0SW5kZXhdLnNpemUoKSwgMCk7CisKKyAgICAgICAgICAgIG1Qb3J0U3RhdHVzW3BvcnRJbmRleF0gPSBESVNBQkxFRDsKKworICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBSRUNPTkZJR1VSSU5HKSB7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEocG9ydEluZGV4LCBrUG9ydEluZGV4T3V0cHV0KTsKKworICAgICAgICAgICAgICAgIGVuYWJsZVBvcnRBc3luYyhwb3J0SW5kZXgpOworCisgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gYWxsb2NhdGVCdWZmZXJzT25Qb3J0KHBvcnRJbmRleCk7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgT01YX0NvbW1hbmRQb3J0RW5hYmxlOgorICAgICAgICB7CisgICAgICAgICAgICBPTVhfVTMyIHBvcnRJbmRleCA9IGRhdGE7CisgICAgICAgICAgICBDT0RFQ19MT0dWKCJQT1JUX0VOQUJMRUQoJWxkKSIsIHBvcnRJbmRleCk7CisKKyAgICAgICAgICAgIENIRUNLKG1TdGF0ZSA9PSBFWEVDVVRJTkcgfHwgbVN0YXRlID09IFJFQ09ORklHVVJJTkcpOworICAgICAgICAgICAgQ0hFQ0tfRVEobVBvcnRTdGF0dXNbcG9ydEluZGV4XSwgRU5BQkxJTkcpOworCisgICAgICAgICAgICBtUG9ydFN0YXR1c1twb3J0SW5kZXhdID0gRU5BQkxFRDsKKworICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBSRUNPTkZJR1VSSU5HKSB7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEocG9ydEluZGV4LCBrUG9ydEluZGV4T3V0cHV0KTsKKworICAgICAgICAgICAgICAgIHNldFN0YXRlKEVYRUNVVElORyk7CisKKyAgICAgICAgICAgICAgICBmaWxsT3V0cHV0QnVmZmVycygpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIE9NWF9Db21tYW5kRmx1c2g6CisgICAgICAgIHsKKyAgICAgICAgICAgIE9NWF9VMzIgcG9ydEluZGV4ID0gZGF0YTsKKworICAgICAgICAgICAgQ09ERUNfTE9HVigiRkxVU0hfRE9ORSglbGQpIiwgcG9ydEluZGV4KTsKKworICAgICAgICAgICAgQ0hFQ0tfRVEobVBvcnRTdGF0dXNbcG9ydEluZGV4XSwgU0hVVFRJTkdfRE9XTik7CisgICAgICAgICAgICBtUG9ydFN0YXR1c1twb3J0SW5kZXhdID0gRU5BQkxFRDsKKworICAgICAgICAgICAgQ0hFQ0tfRVEoY291bnRCdWZmZXJzV2VPd24obVBvcnRCdWZmZXJzW3BvcnRJbmRleF0pLAorICAgICAgICAgICAgICAgICAgICAgbVBvcnRCdWZmZXJzW3BvcnRJbmRleF0uc2l6ZSgpKTsKKworICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBSRUNPTkZJR1VSSU5HKSB7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEocG9ydEluZGV4LCBrUG9ydEluZGV4T3V0cHV0KTsKKworICAgICAgICAgICAgICAgIGRpc2FibGVQb3J0QXN5bmMocG9ydEluZGV4KTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobVN0YXRlID09IEVYRUNVVElOR19UT19JRExFKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhJbnB1dF0gPT0gRU5BQkxFRAorICAgICAgICAgICAgICAgICAgICAmJiBtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9PSBFTkFCTEVEKSB7CisgICAgICAgICAgICAgICAgICAgIENPREVDX0xPR1YoIkZpbmlzaGVkIGZsdXNoaW5nIGJvdGggcG9ydHMsIG5vdyBjb21wbGV0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAidHJhbnNpdGlvbiBmcm9tIEVYRUNVVElORyB0byBJRExFLiIpOworCisgICAgICAgICAgICAgICAgICAgIG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhJbnB1dF0gPSBTSFVUVElOR19ET1dOOworICAgICAgICAgICAgICAgICAgICBtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9IFNIVVRUSU5HX0RPV047CisKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1PTVgtPnNlbmRfY29tbWFuZChtTm9kZSwgT01YX0NvbW1hbmRTdGF0ZVNldCwgT01YX1N0YXRlSWRsZSk7CisgICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKGVyciwgT0spOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gV2UncmUgZmx1c2hpbmcgYm90aCBwb3J0cyBpbiBwcmVwYXJhdGlvbiBmb3Igc2Vla2luZy4KKworICAgICAgICAgICAgICAgIGlmIChtUG9ydFN0YXR1c1trUG9ydEluZGV4SW5wdXRdID09IEVOQUJMRUQKKyAgICAgICAgICAgICAgICAgICAgJiYgbVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0gPT0gRU5BQkxFRCkgeworICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dWKCJGaW5pc2hlZCBmbHVzaGluZyBib3RoIHBvcnRzLCBub3cgY29udGludWluZyBmcm9tIgorICAgICAgICAgICAgICAgICAgICAgICAgICIgc2Vlay10aW1lLiIpOworCisgICAgICAgICAgICAgICAgICAgIGRyYWluSW5wdXRCdWZmZXJzKCk7CisgICAgICAgICAgICAgICAgICAgIGZpbGxPdXRwdXRCdWZmZXJzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIENPREVDX0xPR1YoIkNNRF9DT01QTEVURSglZCwgJWxkKSIsIGNtZCwgZGF0YSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZCBPTVhDb2RlYzo6b25TdGF0ZUNoYW5nZShPTVhfU1RBVEVUWVBFIG5ld1N0YXRlKSB7CisgICAgc3dpdGNoIChuZXdTdGF0ZSkgeworICAgICAgICBjYXNlIE9NWF9TdGF0ZUlkbGU6CisgICAgICAgIHsKKyAgICAgICAgICAgIENPREVDX0xPR1YoIk5vdyBJZGxlLiIpOworICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBMT0FERURfVE9fSURMRSkgeworICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1PTVgtPnNlbmRfY29tbWFuZCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfQ29tbWFuZFN0YXRlU2V0LCBPTVhfU3RhdGVFeGVjdXRpbmcpOworCisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICAgICAgICAgICAgICBzZXRTdGF0ZShJRExFX1RPX0VYRUNVVElORyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIENIRUNLX0VRKG1TdGF0ZSwgRVhFQ1VUSU5HX1RPX0lETEUpOworCisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoCisgICAgICAgICAgICAgICAgICAgIGNvdW50QnVmZmVyc1dlT3duKG1Qb3J0QnVmZmVyc1trUG9ydEluZGV4SW5wdXRdKSwKKyAgICAgICAgICAgICAgICAgICAgbVBvcnRCdWZmZXJzW2tQb3J0SW5kZXhJbnB1dF0uc2l6ZSgpKTsKKworICAgICAgICAgICAgICAgIENIRUNLX0VRKAorICAgICAgICAgICAgICAgICAgICBjb3VudEJ1ZmZlcnNXZU93bihtUG9ydEJ1ZmZlcnNba1BvcnRJbmRleE91dHB1dF0pLAorICAgICAgICAgICAgICAgICAgICBtUG9ydEJ1ZmZlcnNba1BvcnRJbmRleE91dHB1dF0uc2l6ZSgpKTsKKworICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1PTVgtPnNlbmRfY29tbWFuZCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfQ29tbWFuZFN0YXRlU2V0LCBPTVhfU3RhdGVMb2FkZWQpOworCisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICAgICAgICAgICAgICBlcnIgPSBmcmVlQnVmZmVyc09uUG9ydChrUG9ydEluZGV4SW5wdXQpOworICAgICAgICAgICAgICAgIENIRUNLX0VRKGVyciwgT0spOworCisgICAgICAgICAgICAgICAgZXJyID0gZnJlZUJ1ZmZlcnNPblBvcnQoa1BvcnRJbmRleE91dHB1dCk7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICAgICAgICAgICAgICBtUG9ydFN0YXR1c1trUG9ydEluZGV4SW5wdXRdID0gRU5BQkxFRDsKKyAgICAgICAgICAgICAgICBtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9IEVOQUJMRUQ7CisKKyAgICAgICAgICAgICAgICBzZXRTdGF0ZShJRExFX1RPX0xPQURFRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgT01YX1N0YXRlRXhlY3V0aW5nOgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDS19FUShtU3RhdGUsIElETEVfVE9fRVhFQ1VUSU5HKTsKKworICAgICAgICAgICAgQ09ERUNfTE9HVigiTm93IEV4ZWN1dGluZy4iKTsKKworICAgICAgICAgICAgc2V0U3RhdGUoRVhFQ1VUSU5HKTsKKworICAgICAgICAgICAgLy8gQnVmZmVycyB3aWxsIGJlIHN1Ym1pdHRlZCB0byB0aGUgY29tcG9uZW50IGluIHRoZSBmaXJzdAorICAgICAgICAgICAgLy8gY2FsbCB0byBPTVhDb2RlYzo6cmVhZCBhcyBtSW5pdGlhbEJ1ZmZlclN1Ym1pdCBpcyB0cnVlIGF0CisgICAgICAgICAgICAvLyB0aGlzIHBvaW50LiBUaGlzIGVuc3VyZXMgdGhhdCB0aGlzIG9uX21lc3NhZ2UgY2FsbCByZXR1cm5zLAorICAgICAgICAgICAgLy8gcmVsZWFzZXMgdGhlIGxvY2sgYW5kIDo6aW5pdCBjYW4gbm90aWNlIHRoZSBzdGF0ZSBjaGFuZ2UgYW5kCisgICAgICAgICAgICAvLyBpdHNlbGYgcmV0dXJuLgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIE9NWF9TdGF0ZUxvYWRlZDoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfRVEobVN0YXRlLCBJRExFX1RPX0xPQURFRCk7CisKKyAgICAgICAgICAgIENPREVDX0xPR1YoIk5vdyBMb2FkZWQuIik7CisKKyAgICAgICAgICAgIHNldFN0YXRlKExPQURFRCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgIHsKKyAgICAgICAgICAgIENIRUNLKCEic2hvdWxkIG5vdCBiZSBoZXJlLiIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cit9CisKKy8vIHN0YXRpYworc2l6ZV90IE9NWENvZGVjOjpjb3VudEJ1ZmZlcnNXZU93bihjb25zdCBWZWN0b3I8QnVmZmVySW5mbz4gJmJ1ZmZlcnMpIHsKKyAgICBzaXplX3QgbiA9IDA7CisgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBidWZmZXJzLnNpemUoKTsgKytpKSB7CisgICAgICAgIGlmICghYnVmZmVyc1tpXS5tT3duZWRCeUNvbXBvbmVudCkgeworICAgICAgICAgICAgKytuOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIG47Cit9CisKK3N0YXR1c190IE9NWENvZGVjOjpmcmVlQnVmZmVyc09uUG9ydCgKKyAgICAgICAgT01YX1UzMiBwb3J0SW5kZXgsIGJvb2wgb25seVRob3NlV2VPd24pIHsKKyAgICBWZWN0b3I8QnVmZmVySW5mbz4gKmJ1ZmZlcnMgPSAmbVBvcnRCdWZmZXJzW3BvcnRJbmRleF07CisKKyAgICBzdGF0dXNfdCBzdGlja3lFcnIgPSBPSzsKKworICAgIGZvciAoc2l6ZV90IGkgPSBidWZmZXJzLT5zaXplKCk7IGktLSA+IDA7KSB7CisgICAgICAgIEJ1ZmZlckluZm8gKmluZm8gPSAmYnVmZmVycy0+ZWRpdEl0ZW1BdChpKTsKKworICAgICAgICBpZiAob25seVRob3NlV2VPd24gJiYgaW5mby0+bU93bmVkQnlDb21wb25lbnQpIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisKKyAgICAgICAgQ0hFQ0tfRVEoaW5mby0+bU93bmVkQnlDb21wb25lbnQsIGZhbHNlKTsKKworICAgICAgICBzdGF0dXNfdCBlcnIgPQorICAgICAgICAgICAgbU9NWC0+ZnJlZV9idWZmZXIobU5vZGUsIHBvcnRJbmRleCwgaW5mby0+bUJ1ZmZlcik7CisKKyAgICAgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICAgICAgc3RpY2t5RXJyID0gZXJyOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGluZm8tPm1NZWRpYUJ1ZmZlciAhPSBOVUxMKSB7CisgICAgICAgICAgICBpbmZvLT5tTWVkaWFCdWZmZXItPnNldE9ic2VydmVyKE5VTEwpOworCisgICAgICAgICAgICAvLyBNYWtlIHN1cmUgbm9ib2R5IGJ1dCB1cyBvd25zIHRoaXMgYnVmZmVyIGF0IHRoaXMgcG9pbnQuCisgICAgICAgICAgICBDSEVDS19FUShpbmZvLT5tTWVkaWFCdWZmZXItPnJlZmNvdW50KCksIDApOworCisgICAgICAgICAgICBpbmZvLT5tTWVkaWFCdWZmZXItPnJlbGVhc2UoKTsKKyAgICAgICAgfQorCisgICAgICAgIGJ1ZmZlcnMtPnJlbW92ZUF0KGkpOworICAgIH0KKworICAgIENIRUNLKG9ubHlUaG9zZVdlT3duIHx8IGJ1ZmZlcnMtPmlzRW1wdHkoKSk7CisKKyAgICByZXR1cm4gc3RpY2t5RXJyOworfQorCit2b2lkIE9NWENvZGVjOjpvblBvcnRTZXR0aW5nc0NoYW5nZWQoT01YX1UzMiBwb3J0SW5kZXgpIHsKKyAgICBDT0RFQ19MT0dWKCJQT1JUX1NFVFRJTkdTX0NIQU5HRUQoJWxkKSIsIHBvcnRJbmRleCk7CisKKyAgICBDSEVDS19FUShtU3RhdGUsIEVYRU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eworICAgIENIRUNLX0VRKGluZm8tPm1Pd25lZEJ5Q29tcG9uZW50LCBmYWxzZSk7CisKKyAgICBpZiAobVNpZ25hbGxlZEVPUykgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaWYgKG1Db2RlY1NwZWNpZmljRGF0YUluZGV4IDwgbUNvZGVjU3BlY2lmaWNEYXRhLnNpemUoKSkgeworICAgICAgICBjb25zdCBDb2RlY1NwZWNpZmljRGF0YSAqc3BlY2lmaWMgPQorICAgICAgICAgICAgbUNvZGVjU3BlY2lmaWNEYXRhW21Db2RlY1NwZWNpZmljRGF0YUluZGV4XTsKKworICAgICAgICBzaXplX3Qgc2l6ZSA9IHNwZWNpZmljLT5tU2l6ZTsKKworICAgICAgICBpZiAoIXN0cmNhc2VjbXAoInZpZGVvL2F2YyIsIG1NSU1FKQorICAgICAgICAgICAgICAgICYmICEobVF1aXJrcyAmIGtXYW50c05BTEZyYWdtZW50cykpIHsKKyAgICAgICAgICAgIHN0YXRpYyBjb25zdCB1aW50OF90IGtOQUxTdGFydENvZGVbNF0gPQorICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAsIDB4MDAsIDB4MDEgfTsKKworICAgICAgICAgICAgQ0hFQ0soaW5mby0+bU1lbS0+c2l6ZSgpID49IHNwZWNpZmljLT5tU2l6ZSArIDQpOworCisgICAgICAgICAgICBzaXplICs9IDQ7CisKKyAgICAgICAgICAgIG1lbWNweShpbmZvLT5tTWVtLT5wb2ludGVyKCksIGtOQUxTdGFydENvZGUsIDQpOworICAgICAgICAgICAgbWVtY3B5KCh1aW50OF90ICopaW5mby0+bU1lbS0+cG9pbnRlcigpICsgNCwKKyAgICAgICAgICAgICAgICAgICBzcGVjaWZpYy0+bURhdGEsIHNwZWNpZmljLT5tU2l6ZSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBDSEVDSyhpbmZvLT5tTWVtLT5zaXplKCkgPj0gc3BlY2lmaWMtPm1TaXplKTsKKyAgICAgICAgICAgIG1lbWNweShpbmZvLT5tTWVtLT5wb2ludGVyKCksIHNwZWNpZmljLT5tRGF0YSwgc3BlY2lmaWMtPm1TaXplKTsKKyAgICAgICAgfQorCisgICAgICAgIG1PTVgtPmVtcHR5X2J1ZmZlcigKKyAgICAgICAgICAgICAgICBtTm9kZSwgaW5mby0+bUJ1ZmZlciwgMCwgc2l6ZSwKKyAgICAgICAgICAgICAgICBPTVhfQlVGRkVSRkxBR19FTkRPRkZSQU1FIHwgT01YX0JVRkZFUkZMQUdfQ09ERUNDT05GSUcsCisgICAgICAgICAgICAgICAgMCk7CisKKyAgICAgICAgaW5mby0+bU93bmVkQnlDb21wb25lbnQgPSB0cnVlOworCisgICAgICAgICsrbUNvZGVjU3BlY2lmaWNEYXRhSW5kZXg7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBNZWRpYUJ1ZmZlciAqc3JjQnVmZmVyOworICAgIHN0YXR1c190IGVycjsKKyAgICBpZiAobVNlZWtUaW1lVXMgPj0gMCkgeworICAgICAgICBNZWRpYVNvdXJjZTo6UmVhZE9wdGlvbnMgb3B0aW9uczsKKyAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8obVNlZWtUaW1lVXMpOworICAgICAgICBtU2Vla1RpbWVVcyA9IC0xOworCisgICAgICAgIGVyciA9IG1Tb3VyY2UtPnJlYWQoJnNyY0J1ZmZlciwgJm9wdGlvbnMpOworICAgIH0gZWxzZSB7CisgICAgICAgIGVyciA9IG1Tb3VyY2UtPnJlYWQoJnNyY0J1ZmZlcik7CisgICAgfQorCisgICAgT01YX1UzMiBmbGFncyA9IE9NWF9CVUZGRVJGTEFHX0VORE9GRlJBTUU7CisgICAgT01YX1RJQ0tTIHRpbWVzdGFtcCA9IDA7CisgICAgc2l6ZV90IHNyY0xlbmd0aCA9IDA7CisKKyAgICBpZiAoZXJyICE9IE9LKSB7CisgICAgICAgIENPREVDX0xPR1YoInNpZ25hbGxpbmcgZW5kIG9mIGlucHV0IHN0cmVhbS4iKTsKKyAgICAgICAgZmxhZ3MgfD0gT01YX0JVRkZFUkZMQUdfRU9TOworCisgICAgICAgIG1TaWduYWxsZWRFT1MgPSB0cnVlOworICAgIH0gZWxzZSB7CisgICAgICAgIHNyY0xlbmd0aCA9IHNyY0J1ZmZlci0+cmFuZ2VfbGVuZ3RoKCk7CisKKyAgICAgICAgaWYgKGluZm8tPm1NZW0tPnNpemUoKSA8IHNyY0xlbmd0aCkgeworICAgICAgICAgICAgTE9HRSgiaW5mby0+bU1lbS0+c2l6ZSgpID0gJWQsIHNyY0xlbmd0aCA9ICVkIiwKKyAgICAgICAgICAgICAgICAgaW5mby0+bU1lbS0+c2l6ZSgpLCBzcmNMZW5ndGgpOworICAgICAgICB9CisgICAgICAgIENIRUNLKGluZm8tPm1NZW0tPnNpemUoKSA+PSBzcmNMZW5ndGgpOworICAgICAgICBtZW1jcHkoaW5mby0+bU1lbS0+cG9pbnRlcigpLAorICAgICAgICAgICAgICAgKGNvbnN0IHVpbnQ4X3QgKilzcmNCdWZmZXItPmRhdGEoKSArIHNyY0J1ZmZlci0+cmFuZ2Vfb2Zmc2V0KCksCisgICAgICAgICAgICAgICBzcmNMZW5ndGgpOworCisgICAgICAgIGludDMyX3QgdW5pdHMsIHNjYWxlOworICAgICAgICBpZiAoc3JjQnVmZmVyLT5tZXRhX2RhdGEoKS0+ZmluZEludDMyKGtLZXlUaW1lVW5pdHMsICZ1bml0cykKKyAgICAgICAgICAgICYmIHNyY0J1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQzMihrS2V5VGltZVNjYWxlLCAmc2NhbGUpKSB7CisgICAgICAgICAgICB0aW1lc3RhbXAgPSAoKE9NWF9USUNLUyl1bml0cyAqIDEwMDAwMDApIC8gc2NhbGU7CisKKyAgICAgICAgICAgIENPREVDX0xPR1YoIkNhbGxpbmcgZW1wdHlfYnVmZmVyIG9uIGJ1ZmZlciAlcCAobGVuZ3RoICVkKSIsCisgICAgICAgICAgICAgICAgIGluZm8t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VyU2l6ZSA9ICh3aWR0aCAqIGhlaWdodCAqIDMpIC8gMjsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBPTVhfQ09MT1JfRm9ybWF0Q2JZQ3JZOgorICAgICAgICB7CisgICAgICAgICAgICBkZWYubkJ1ZmZlclNpemUgPSB3aWR0aCAqIGhlaWdodCAqIDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgT01YX0NPTE9SX0Zvcm1hdDMyYml0QVJHQjg4ODg6CisgICAgICAgIHsKKyAgICAgICAgICAgIGRlZi5uQnVmZmVyU2l6ZSA9IHdpZHRoICogaGVpZ2h0ICogNDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSBPTVhfQ09MT1JfRm9ybWF0MTZiaXRBUkdCNDQ0NDoKKyAgICAgICAgY2FzZSBPTVhfQ09MT1JfRm9ybWF0MTZiaXRBUkdCMTU1NToKKyAgICAgICAgY2FzZSBPTVhfQ09MT1JfRm9ybWF0MTZiaXRSR0I1NjU6CisgICAgICAgIGNhc2UgT01YX0NPTE9SX0Zvcm1hdDE2Yml0QkdSNTY1OgorICAgICAgICB7CisgICAgICAgICAgICBkZWYubkJ1ZmZlclNpemUgPSB3aWR0aCAqIGhlaWdodCAqIDI7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBDSEVDSyghIlNob3VsZCBub3QgYmUgaGVyZS4gVW5rbm93biBjb2xvciBmb3JtYXQuIik7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBkZWYubkJ1ZmZlckNvdW50QWN0dWFsID0gZGVmLm5CdWZmZXJDb3VudE1pbjsKKworICAgIGVyciA9IG1PTVgtPnNldF9wYXJhbWV0ZXIoCisgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4UGFyYW1Qb3J0RGVmaW5pdGl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XRJbnQzMihrS2V5V2FudHNOQUxGcmFnbWVudHMsIHRydWUpOworICAgIH0KKyAgICBzdGF0dXNfdCBlcnIgPSBtU291cmNlLT5zdGFydChwYXJhbXMuZ2V0KCkpOworCisgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgIG1Db2RlY1NwZWNpZmljRGF0YUluZGV4ID0gMDsKKyAgICBtSW5pdGlhbEJ1ZmZlclN1Ym1pdCA9IHRydWU7CisgICAgbVNpZ25hbGxlZEVPUyA9IGZhbHNlOworICAgIG1Ob01vcmVPdXRwdXREYXRhID0gZmFsc2U7CisgICAgbVNlZWtUaW1lVXMgPSAtMTsKKyAgICBtRmlsbGVkQnVmZmVycy5jbGVhcigpOworCisgICAgcmV0dXJuIGluaXQoKTsKK30KKworc3RhdHVzX3QgT01YQ29kZWM6OnN0b3AoKSB7CisgICAgQ09ERUNfTE9HVigic3RvcCIpOworCisgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKKworICAgIHdoaWxlIChpc0ludGVybWVkaWF0ZVN0YXRlKG1TdGF0ZSkpIHsKKyAgICAgICAgbUFzeW5jQ29tcGxldGlvbi53YWl0KG1Mb2NrKTsKKyAgICB9CisKKyAgICBzd2l0Y2ggKG1TdGF0ZSkgeworICAgICAgICBjYXNlIExPQURFRDoKKyAgICAgICAgY2FzZSBFUlJPUjoKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgRVhFQ1VUSU5HOgorICAgICAgICB7CisgICAgICAgICAgICBzZXRTdGF0ZShFWEVDVVRJTkdfVE9fSURMRSk7CisKKyAgICAgICAgICAgIGlmIChtUXVpcmtzICYga1JlcXVpcmVzRmx1c2hCZWZvcmVTaHV0ZG93bikgeworICAgICAgICAgICAgICAgIENPREVDX0xPR1YoIlRoaXMgY29tcG9uZW50IHJlcXVpcmVzIGEgZmx1c2ggYmVmb3JlIHRyYW5zaXRpb25pbmcgIgorICAgICAgICAgICAgICAgICAgICAgImZyb20gRVhFQ1VUSU5HIHRvIElETEUuLi4iKTsKKworICAgICAgICAgICAgICAgIGJvb2wgZW11bGF0ZUlucHV0Rmx1c2hDb21wbGV0aW9uID0KKyAgICAgICAgICAgICAgICAgICAgIWZsdXNoUG9ydEFzeW5jKGtQb3J0SW5kZXhJbnB1dCk7CisKKyAgICAgICAgICAgICAgICBib29sIGVtdWxhdGVPdXRwdXRGbHVzaENvbXBsZXRpb24gPQorICAgICAgICAgICAgICAgICAgICAhZmx1c2hQb3J0QXN5bmMoa1BvcnRJbmRleE91dHB1dCk7CisKKyAgICAgICAgICAgICAgICBpZiAoZW11bGF0ZUlucHV0Rmx1c2hDb21wbGV0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgIG9uQ21kQ29tcGxldGUoT01YX0NvbW1hbmRGbHVzaCwga1BvcnRJbmRleElucHV0KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoZW11bGF0ZU91dHB1dEZsdXNoQ29tcGxldGlvbikgeworICAgICAgICAgICAgICAgICAgICBvbkNtZENvbXBsZXRlKE9NWF9Db21tYW5kRmx1c2gsIGtQb3J0SW5kZXhPdXRwdXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVBvcnRTdGF0dXNba1BvcnRJbmRleElucHV0XSA9IFNIVVRUSU5HX0RPV047CisgICAgICAgICAgICAgICAgbVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0gPSBTSFVUVElOR19ET1dOOworCisgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KKyAgICAgICAgICAgICAgICAgICAgbU9NWC0+c2VuZF9jb21tYW5kKG1Ob2RlLCBPTVhfQ29tbWFuZFN0YXRlU2V0LCBPTVhfU3RhdGVJZGxlKTsKKyAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIE9LKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgd2hpbGUgKG1TdGF0ZSAhPSBMT0FERUQgJiYgbVN0YXRlICE9IEVSUk9SKSB7CisgICAgICAgICAgICAgICAgbUFzeW5jQ29tcGxldGlvbi53YWl0KG1Mb2NrKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBkZWZhdWx0OgorICAgICAgICB7CisgICAgICAgICAgICBDSEVDSyghInNob3VsZCBub3QgYmUgaGVyZS4iKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgbVNvdXJjZS0+c3RvcCgpOworCisgICAgcmV0dXJuIE9LOworfQorCitzcDxNZXRhRGF0YT4gT01YQ29kZWM6OmdldEZvcm1hdCgpIHsKKyAgICByZXR1cm4gbU91dHB1dEZvcm1hdDsKK30KKworc3RhdHVzX3QgT01YQ29kZWM6OnJlYWQoCisgICAgICAgIE1lZGlhQnVmZmVyICoqYnVmZmVyLCBjb25zdCBSZWFkT3B0aW9ucyAqb3B0aW9ucykgeworICAgICpidWZmZXIgPSBOVUxMOworCisgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKKworICAgIGlmIChtU3RhdGUgIT0gRVhFQ1VUSU5HICYmIG1TdGF0ZSAhPSBSRUNPTkZJR1VSSU5HKSB7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgIGlmIChtSW5pdGlhbEJ1ZmZlclN1Ym1pdCkgeworICAgICAgICBtSW5pdGlhbEJ1ZmZlclN1Ym1pdCA9IGZhbHNlOworCisgICAgICAgIGRyYWluSW5wdXRCdWZmZXJzKCk7CisKKyAgICAgICAgaWYgKG1TdGF0ZSA9PSBFWEVDVVRJTkcpIHsKKyAgICAgICAgICAgIC8vIE90aGVyd2lzZSBtU3RhdGUgPT0gUkVDT05GSUdVUklORyBhbmQgdGhpcyBjb2RlIHdpbGwgdHJpZ2dlcg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mZmVySW5mbyAqaW5mbyA9ICZidWZmZXJzLT5lZGl0SXRlbUF0KGkpOworCisgICAgICAgIGlmIChpbmZvLT5tTWVkaWFCdWZmZXIgPT0gYnVmZmVyKSB7CisgICAgICAgICAgICBDSEVDS19FUShtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSwgRU5BQkxFRCk7CisgICAgICAgICAgICBmaWxsT3V0cHV0QnVmZmVyKGluZm8pOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgfQorCisgICAgQ0hFQ0soISJzaG91bGQgbm90IGJlIGhlcmUuIik7Cit9CisKK3N0YXRpYyBjb25zdCBjaGFyICppbWFnZUNvbXByZXNzaW9uRm9ybWF0U3RyaW5nKE9NWF9JTUFHRV9DT0RJTkdUWVBFIHR5cGUpIHsKKyAgICBzdGF0aWMgY29uc3QgY2hhciAqa05hbWVzW10gPSB7CisgICAgICAgICJPTVhfSU1BR0VfQ29kaW5nVW51c2VkIiwKKyAgICAgICAgIk9NWF9JTUFHRV9Db2RpbmdBdXRvRGV0ZWN0IiwKKyAgICAgICAgIk9NWF9JTUFHRV9Db2RpbmdKUEVHIiwKKyAgICAgICAgIk9NWF9JTUFHRV9Db2RpbmdKUEVHMksiLAorICAgICAgICAiT01YX0lNQUdFX0NvZGluZ0VYSUYiLAorICAgICAgICAiT01YX0lNQUdFX0NvZGluZ1RJRkYiLAorICAgICAgICAiT01YX0lNQUdFX0NvZGluZ0dJRiIsCisgICAgICAgICJPTVhfSU1BR0VfQ29kaW5nUE5HIiwKKyAgICAgICAgIk9NWF9JTUFHRV9Db2RpbmdMWlciLAorICAgICAgICAiT01YX0lNQUdFX0NvZGluZ0JNUCIsCisgICAgfTsKKworICAgIHNpemVfdCBudW1OYW1lcyA9IHNpemVvZihrTmFtZXMpIC8gc2l6ZW9mKGtOYW1lc1swXSk7CisKKyAgICBpZiAodHlwZSA8IDAgfHwgKHNpemVfdCl0eXBlID49IG51bU5hbWVzKSB7CisgICAgICAg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W10gPSB7CisgICAgICAgICJPTVhfVklERU9fQ29kaW5nVW51c2VkIiwKKyAgICAgICAgIk9NWF9WSURFT19Db2RpbmdBdXRvRGV0ZWN0IiwKKyAgICAgICAgIk9NWF9WSURFT19Db2RpbmdNUEVHMiIsCisgICAgICAgICJPTVhfVklERU9fQ29kaW5nSDI2MyIsCisgICAgICAgICJPTVhfVklERU9fQ29kaW5nTVBFRzQiLAorICAgICAgICAiT01YX1ZJREVPX0NvZGluZ1dNViIsCisgICAgICAgICJPTVhfVklERU9fQ29kaW5nUlYiLAorICAgICAgICAiT01YX1ZJREVPX0NvZGluZ0FWQyIsCisgICAgICAgICJPTVhfVklERU9fQ29kaW5nTUpQRUciLAorICAgIH07CisKKyAgICBzaXplX3QgbnVtTmFtZXMgPSBzaXplb2Yoa05hbWVzKSAvIHNpemVvZihrTmFtZXNbMF0pOworCisgICAgaWYgKHR5cGUgPCAwIHx8IChzaXplX3QpdHlwZSA+PSBudW1OYW1lcykgeworICAgICAgICByZXR1cm4gIlVOS05PV04iOworICAgIH0gZWxzZSB7CisgICAgICAgIHJldHVybiBrTmFtZXNbdHlwZV07CisgICAgfQorfQorCitzdGF0aWMgY29uc3QgY2hhciAqYXVkaW9Db2RpbmdUeXBlU3RyaW5nKE9NWF9BVURJT19DT0RJTkdUWVBFIHR5cGUpIHsKKyAgICBzdGF0aWMgY29uc3QgY2hhciAqa05hbWVzW10gPSB7CisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nVW51c2VkIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdBdXRvRGV0ZWN0IiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdQQ00iLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ0FEUENNIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdBTVIiLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ0dTTUZSIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdHU01FRlIiLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ0dTTUhSIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdQRENGUiIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nUERDRUZSIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdQRENIUiIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nVERNQUZSIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdURE1BRUZSIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdRQ0VMUDgiLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ1FDRUxQMTMiLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ0VWUkMiLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ1NNViIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcxMSIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcyMyIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcyNiIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcyOSIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nQUFDIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdNUDMiLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ1NCQyIsCisgICAgICAgICJPTVhfQVVESU9fQ29kaW5nVk9SQklTIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdXTUEiLAorICAgICAgICAiT01YX0FVRElPX0NvZGluZ1JBIiwKKyAgICAgICAgIk9NWF9BVURJT19Db2RpbmdNSURJIiwKKyAgICB9OworCisgICAgc2l6ZV90IG51bU5hbWVzID0gc2l6ZW9mKGtOYW1lcykgLyBzaXplb2Yoa05hbWVzWzBdKTsKKworICAgIGlmICh0eXBlIDwgMCB8fCAoc2l6ZV90KXR5cGUgPj0gbnVtTmFtZXMpIHsKKyAgICAgICAgcmV0dXJuICJVTktOT1dOIjsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4ga05hbWVzW3R5cGVdOworICAgIH0KK30KKworc3RhdGljIGNvbnN0IGNoYXIgKmF1ZGlvUENNTW9kZVN0cmluZyhPTVhfQVVESU9fUENNTU9ERVRZUEUgdHlwZSkgeworICAgIHN0YXRpYyBjb25zdCBjaGFyICprTmFtZXNbXSA9IHsKKyAgICAgICAgIk9NWF9BVURJT19QQ01Nb2RlTGluZWFyIiwKKyAgICAgICAgIk9NWF9BVURJT19QQ01Nb2RlQUxhdyIsCisgICAgICAgICJPTVhfQVVESU9fUENNTW9kZU1VTGF3IiwKKyAgICB9OworCisgICAgc2l6ZV90IG51bU5hbWVzID0gc2l6ZW9mKGtOYW1lcykgLyBzaXplb2Yoa05hbWVzWzBdKTsKKworICAgIGlmICh0eXBlIDwgMCB8fCAoc2l6ZV90KXR5cGUgPj0gbnVtTmFtZXMpIHsKKyAgICAgICAgcmV0dXJuICJVTktOT1dOIjsKKyAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4ga05hbWVzW3R5cGVdOworICAgIH0KK30KKworCit2b2lkIE9NWENvZGVjOjpkdW1wUG9ydFN0YXR1cyhPTVhfVTMyIHBvcnRJbmRleCkgeworICAgIE9NWF9QQVJBTV9QT1JUREVGSU5JVElPTlRZUEUgZGVmOworICAgIEluaXRPTVhQYXJhbXMoJmRlZik7CisgICAgZGVmLm5Qb3J0SW5kZXggPSBwb3J0SW5kZXg7CisKKyAgICBzdGF0dXNfdCBlcnIgPSBtT01YLT5nZXRfcGFyYW1ldGVyKAorICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtUG9ydERlZmluaXRpb24sICZkZWYsIHNpemVvZihkZWYpKTsKKyAgICBDSEVDS19FUShlcnIsIE9LKTsKKworICAgIHByaW50ZigiJXMgUG9ydCA9IHtcbiIsIHBvcnRJbmRleCA9PSBrUG9ydEluZGV4SW5wdXQgPyAiSW5wdXQiIDogIk91dHB1dCIpOworCisgICAgQ0hFQ0soKHBvcnRJbmRleCA9PSBrUG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YtPmVDb21wcmVzc2lvbkZvcm1hdCkpOworCisgICAgICAgICAgICBwcmludGYoIiAgZUNvbG9yRm9ybWF0ID0gJXNcbiIsCisgICAgICAgICAgICAgICAgICAgY29sb3JGb3JtYXRTdHJpbmcoaW1hZ2VEZWYtPmVDb2xvckZvcm1hdCkpOworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgT01YX1BvcnREb21haW5WaWRlbzoKKyAgICAgICAgeworICAgICAgICAgICAgT01YX1ZJREVPX1BPUlRERUZJTklUSU9OVFlQRSAqdmlkZW9EZWYgPSAmZGVmLmZvcm1hdC52aWRlbzsKKworICAgICAgICAgICAgcHJpbnRmKCJcbiIpOworICAgICAgICAgICAgcHJpbnRmKCIgIC8vIFZpZGVvXG4iKTsKKyAgICAgICAgICAgIHByaW50ZigiICBuRnJhbWVXaWR0aCA9ICVsZFxuIiwgdmlkZW9EZWYtPm5GcmFtZVdpZHRoKTsKKyAgICAgICAgICAgIHByaW50ZigiICBuRnJhbWVIZWlnaHQgPSAlbGRcbiIsIHZpZGVvRGVmLT5uRnJhbWVIZWlnaHQpOworICAgICAgICAgICAgcHJpbnRmKCIgIG5TdHJpZGUgPSAlbGRcbiIsIHZpZGVvRGVmLT5uU3RyaWRlKTsKKworICAgICAgICAgICAgcHJpbnRmKCIgIGVDb21wcmVzc2lvbkZvcm1hdCA9ICVzXG4iLAorICAgICAgICAgICAgICAgICAgIHZpZGVvQ29tcHJlc3Npb25Gb3JtYXRTdHJpbmcodmlkZW9EZWYtPmVDb21wcmVzc2lvbkZvcm1hdCkpOworCisgICAgICAgICAgICBwcmludGYoIiAgZUNvbG9yRm9ybWF0ID0gJXNcbiIsCisgICAgICAgICAgICAgICAgICAgY29sb3JGb3JtYXRTdHJpbmcodmlkZW9EZWYtPmVDb2xvckZvcm1hdCkpOworCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgT01YX1BvcnREb21haW5BdWRpbzoKKyAgICAgICAgeworICAgICAgICAgICAgT01YX0FVRElPX1BPUlRERUZJTklUSU9OVFlQRSAqYXVkaW9EZWYgPSAmZGVmLmZvcm1hdC5hdWRpbzsKKworICAgICAgICAgICAgcHJpbnRmKCJcbiIpOworICAgICAgICAgICAgcHJpbnRmKCIgIC8vIEF1ZGlvXG4iKTsKKyAgICAgICAgICAgIHByaW50ZigiICBlRW5jb2RpbmcgPSAlc1xuIiwKKyAgICAgICAgICAgICAgICAgICBhdWRpb0NvZGluZ1R5cGVTdHJpbmcoYXVkaW9EZWYtPmVFbmNvZGluZykpOworCisgICAgICAgICAgICBpZiAoYXVkaW9EZWYtPmVFbmNvZGluZyA9PSBPTVhfQVVESU9fQ29kaW5nUENNKSB7CisgICAgICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX1BDTU1PREVUWVBFIHBhcmFtczsKKyAgICAgICAgICAgICAgICBJbml0T01YUGFyYW1zKCZwYXJhbXMpOworICAgICAgICAgICAgICAgIHBhcmFtcy5uUG9ydEluZGV4ID0gcG9ydEluZGV4OworCisgICAgICAgICAgICAgICAgZXJyID0gbU9NWC0+Z2V0X3BhcmFtZXRlcigKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtLCAmcGFyYW1zLCBzaXplb2YocGFyYW1zKSk7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPSyk7CisKKyAgICAgICAgICAgICAgICBwcmludGYoIiAgblNhbXBsaW5nUmF0ZSA9ICVsZFxuIiwgcGFyYW1zLm5TYW1wbGluZ1JhdGUpOworICAgICAgICAgICAgICAgIHByaW50ZigiICBuQ2hhbm5lbHMgPSAlbGRcbiIsIHBhcmFtcy5uQ2hhbm5lbHMpOworICAgICAgICAgICAgICAgIHByaW50ZigiICBiSW50ZXJsZWF2ZWQgPSAlZFxuIiwgcGFyYW1zLmJJbnRlcmxlYXZlZCk7CisgICAgICAgICAgICAgICAgcHJpbnRmKCIgIG5CaXRQZXJTYW1wbGUgPSAlbGRcbiIsIHBhcmFtcy5uQml0UGVyU2FtcGxlKTsKKworICAgICAgICAgICAgICAgIHByaW50ZigiICBlTnVtRGF0YSA9ICVzXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuZU51bURhdGEgPT0gT01YX051bWVyaWNhbERhdGFTaWduZWQKKyAgICAgICAgICAgICAgICAgICAgICAgID8gInNpZ25lZCIgOiAidW5zaWduZWQiKTsKKworICAgICAgICAgICAgICAgIHByaW50ZigiICBlUENNTW9kZSA9ICVzXG4iLCBhdWRpb1BDTU1vZGVTdHJpbmcocGFyYW1zLmVQQ01Nb2RlKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgcHJpbnRmKCIgIC8vIFVua25vd25cbiIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcmludGYoIn1cbiIpOworfQorCit2b2lkIE9NWENvZGVjOjppbml0T3V0cHV0Rm9ybWF0KGNvbnN0IHNwPE1ldGFEYXRhPiAmaW5wdXRGb3JtYXQpIHsKKyAgICBtT3V0cHV0Rm9ybWF0ID0gbmV3IE1ldGFEYXRhOworICAgIG1PdXRwdXRGb3JtYXQtPnNldENTdHJpbmcoa0tleURlY29kZXJDb21wb25lbnQsIG1Db21wb25lbnROYW1lKTsKKworICAgIE9NWF9QQVJBTV9QT1JUREVGSU5JVElPTlRZUEUgZGVmOworICAgIEluaXRPTVhQYXJhbXMoJmRlZik7CisgICAgZGVmLm5Qb3J0SW5kZXggPSBrUG9ydEluZGV4T3V0cHV0OworCisgICAgc3RhdHVzX3QgZXJyID0gbU9NWC0+Z2V0X3BhcmFtZXRlcigKKyAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhQYXJhbVBvcnREZWZpbml0aW9uLCAmZGV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gICAgICAgSW5pdE9NWFBhcmFtcygmcGFyYW1zKTsKKyAgICAgICAgICAgICAgICBwYXJhbXMublBvcnRJbmRleCA9IGtQb3J0SW5kZXhPdXRwdXQ7CisKKyAgICAgICAgICAgICAgICBlcnIgPSBtT01YLT5nZXRfcGFyYW1ldGVyKAorICAgICAgICAgICAgICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtQXVkaW9QY20sICZwYXJhbXMsIHNpemVvZihwYXJhbXMpKTsKKyAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIE9LKTsKKworICAgICAgICAgICAgICAgIENIRUNLX0VRKHBhcmFtcy5lTnVtRGF0YSwgT01YX051bWVyaWNhbERhdGFTaWduZWQpOworICAgICAgICAgICAgICAgIENIRUNLX0VRKHBhcmFtcy5uQml0UGVyU2FtcGxlLCAxNik7CisgICAgICAgICAgICAgICAgQ0hFQ0tfRVEocGFyYW1zLmVQQ01Nb2RlLCBPTVhfQVVESU9fUENNTW9kZUxpbmVhcik7CisKKyAgICAgICAgICAgICAgICBpbnQzMl90IG51bUNoYW5uZWxzLCBzYW1wbGVSYXRlOworICAgICAgICAgICAgICAgIGlucHV0Rm9ybWF0LT5maW5kSW50MzIoa0tleUNoYW5uZWxDb3VudCwgJm51bUNoYW5uZWxzKTsKKyAgICAgICAgICAgICAgICBpbnB1dEZvcm1hdC0+ZmluZEludDMyKGtLZXlTYW1wbGVSYXRlLCAmc2FtcGxlUmF0ZSk7CisKKyAgICAgICAgICAgICAgICBpZiAoKE9NWF9VMzIpbnVtQ2hhbm5lbHMgIT0gcGFyYW1zLm5DaGFubmVscykgeworICAgICAgICAgICAgICAgICAgICBMT0dXKCJDb2RlYyBvdXRwdXRzIGEgZGlmZmVyZW50IG51bWJlciBvZiBjaGFubmVscyB0aGFuICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAidGhlIGlucHV0IHN0cmVhbSBjb250YWlucy4iKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgImF1ZGlvL3JhdyIpOworCisgICAgICAgICAgICAgICAgLy8gVXNlIHRoZSBjb2RlYy1hZHZlcnRpc2VkIG51bWJlciBvZiBjaGFubmVscywgYXMgc29tZQorICAgICAgICAgICAgICAgIC8vIGNvZGVjcyBhcHBlYXIgdG8gb3V0cHV0IHN0ZXJlbyBldmVuIGlmIHRoZSBpbnB1dCBkYXRhIGlzCisgICAgICAgICAgICAgICAgLy8gbW9uby4KKyAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMihrS2V5Q2hhbm5lbENvdW50LCBwYXJhbXMubkNoYW5uZWxzKTsKKworICAgICAgICAgICAgICAgIC8vIFRoZSBjb2RlYy1yZXBvcnRlZCBzYW1wbGVSYXRlIGlzIG5vdCByZWxpYWJsZS4uLgorICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldEludDMyKGtLZXlTYW1wbGVSYXRlLCBzYW1wbGVSYXRlKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYXVkaW9fZGVmLT5lRW5jb2RpbmcgPT0gT01YX0FVRElPX0NvZGluZ0FNUikgeworICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCAiYXVkaW8vM2dwcCIpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhdWRpb19kZWYtPmVFbmNvZGluZyA9PSBPTVhfQVVESU9fQ29kaW5nQUFDKSB7CisgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsICJhdWRpby9tcDRhLWxhdG0iKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgQ0hFQ0soISJTaG91bGQgbm90IGJlIGhlcmUuIFVua25vd24gYXVkaW8gZW5jb2RpbmcuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGNhc2UgT01YX1BvcnREb21haW5WaWRlbzoKKyAgICAgICAgeworICAgICAgICAgICAgT01YX1ZJREVPX1BPUlRERUZJTklUSU9OVFlQRSAqdmlkZW9fZGVmID0gJmRlZi5mb3JtYXQudmlkZW87CisKKyAgICAgICAgICAgIGlmICh2aWRlb19kZWYtPmVDb21wcmVzc2lvbkZvcm1hdCA9PSBPTVhfVklERU9fQ29kaW5nVW51c2VkKSB7CisgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsICJ2aWRlby9yYXciKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodmlkZW9fZGVmLT5lQ29tcHJlc3Npb25Gb3JtYXQgPT0gT01YX1ZJREVPX0NvZGluZ01QRUc0KSB7CisgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsICJ2aWRlby9tcDR2LWVzIik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZpZGVvX2RlZi0+ZUNvbXByZXNzaW9uRm9ybWF0ID09IE9NWF9WSURFT19Db2RpbmdIMjYzKSB7CisgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsICJ2aWRlby8zZ3BwIik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZpZGVvX2RlZi0+ZUNvbXByZXNzaW9uRm9ybWF0ID09IE9NWF9WSURFT19Db2RpbmdBVkMpIHsKKyAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgInZpZGVvL2F2YyIpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBDSEVDSyghIlVua25vd24gY29tcHJlc3Npb24gZm9ybWF0LiIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIXN0cmNtcChtQ29tcG9uZW50TmFtZSwgIk9NWC5QVi5hdmNkZWMiKSkgeworICAgICAgICAgICAgICAgIC8vIFRoaXMgY29tcG9uZW50IGFwcGVhcnMgdG8gYmUgbHlpbmcgdG8gbWUuCisgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoCisgICAgICAgICAgICAgICAgICAgICAgICBrS2V5V2lkdGgsICh2aWRlb19kZWYtPm5GcmFtZVdpZHRoICsgMTUpICYgLTE2KTsKKyAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMigKKyAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlIZWlnaHQsICh2aWRlb19kZWYtPm5GcmFtZUhlaWdodCArIDE1KSAmIC0xNik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldEludDMyKGtLZXlXaWR0aCwgdmlkZW9fZGVmLT5uRnJhbWVXaWR0aCk7CisgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoa0tleUhlaWdodCwgdmlkZW9fZGVmLT5uRnJhbWVIZWlnaHQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMihrS2V5Q29sb3JGb3JtYXQsIHZpZGVvX2RlZi0+ZUNvbG9yRm9ybWF0KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0soISJzaG91bGQgbm90IGJlIGhlcmUsIG5laXRoZXIgYXVkaW8gbm9yIHZpZGVvLiIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cit9CisKK30gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCmRpZmYgLS1naXQgYS9tZWRpYS9sa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sZVRvQ2h1bmtPZmZzZXRzKDApLAorICAgICAgbVNhbXBsZVNpemVPZmZzZXQoLTEpLAorICAgICAgbVNhbXBsZVNpemVGaWVsZFNpemUoMCksCisgICAgICBtRGVmYXVsdFNhbXBsZVNpemUoMCksCisgICAgICBtTnVtU2FtcGxlU2l6ZXMoMCksCisgICAgICBtVGltZVRvU2FtcGxlQ291bnQoMCksCisgICAgICBtVGltZVRvU2FtcGxlKE5VTEwpLAorICAgICAgbVN5bmNTYW1wbGVPZmZzZXQoLTEpLAorICAgICAgbU51bVN5bmNTYW1wbGVzKDApIHsKK30KKworU2FtcGxlVGFibGU6On5TYW1wbGVUYWJsZSgpIHsKKyAgICBkZWxldGVbXSBtVGltZVRvU2FtcGxlOworICAgIG1UaW1lVG9TYW1wbGUgPSBOVUxMOworfQorCitzdGF0dXNfdCBTYW1wbGVUYWJsZTo6c2V0Q2h1bmtPZmZzZXRQYXJhbXMoCisgICAgICAgIHVpbnQzMl90IHR5cGUsIG9mZl90IGRhdGFfb2Zmc2V0LCBvZmZfdCBkYXRhX3NpemUpIHsKKyAgICBpZiAobUNodW5rT2Zmc2V0T2Zmc2V0ID49IDApIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICB9CisKKyAgICBDSEVDSyh0eXBlID09IGtDaHVua09mZnNldFR5cGUzMiB8fCB0eXBlID09IGtDaHVua09mZnNldFR5cGU2NCk7CisKKyAgICBtQ2h1bmtPZmZzZXRPZmZzZXQgPSBkYXRhX29mZnNldDsKKyAgICBtQ2h1bmtPZmZzZXRUeXBlID0gdHlwZTsKKworICAgIGlmIChkYXRhX3NpemUgPCA4KSB7CisgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgfQorCisgICAgdWludDhfdCBoZWFkZXJbOF07CisgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkX2F0KAorICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBoZWFkZXIsIHNpemVv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TsKKyAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGhlYWRlciwgc2l6ZW9mKGhlYWRlcikpIDwgKHNzaXplX3Qpc2l6ZW9mKGhlYWRlcikpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgIH0KKworICAgIGlmIChVMzJfQVQoaGVhZGVyKSAhPSAwKSB7CisgICAgICAgIC8vIEV4cGVjdGVkIHZlcnNpb24gPSAwLCBmbGFncyA9IDAuCisgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7CisgICAgfQorCisgICAgbU51bVNhbXBsZVRvQ2h1bmtPZmZzZXRzID0gVTMyX0FUKCZoZWFkZXJbNF0pOworCisgICAgaWYgKGRhdGFfc2l6ZSA8IDggKyBtTnVtU2FtcGxlVG9DaHVua09mZnNldHMgKiAxMikgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgU2FtcGxlVGFibGU6OnNldFNhbXBsZVNpemVQYXJhbXMoCisgICAgICAgIHVpbnQzMl90IHR5cGUsIG9mZl90IGRhdGFfb2Zmc2V0LCBvZmZfdCBkYXRhX3NpemUpIHsKKyAgICBpZiAobVNhbXBsZVNpemVPZmZzZXQgPj0gMCkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIENIRUNLKHR5cGUgPT0ga1NhbXBsZVNpemVUeXBlMzIgfHwgdHlwZSA9PSBrU2FtcGxlU2l6ZVR5cGVDb21wYWN0KTsKKworICAgIG1TYW1wbGVTaXplT2Zmc2V0ID0gZGF0YV9vZmZzZXQ7CisKKyAgICBpZiAoZGF0YV9zaXplIDwgMTIpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICB9CisKKyAgICB1aW50OF90IGhlYWRlclsxMl07CisgICAgaWYgKG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gICAgICAgbURlZmF1bHRTYW1wbGVTaXplID0gMDsKKworICAgICAgICBpZiAobVNhbXBsZVNpemVGaWVsZFNpemUgIT0gNCAmJiBtU2FtcGxlU2l6ZUZpZWxkU2l6ZSAhPSA4CisgICAgICAgICAgICAmJiBtU2FtcGxlU2l6ZUZpZWxkU2l6ZSAhPSAxNikgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChkYXRhX3NpemUgPCAxMiArIChtTnVtU2FtcGxlU2l6ZXMgKiBtU2FtcGxlU2l6ZUZpZWxkU2l6ZSArIDQpIC8gOCkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgU2FtcGxlVGFibGU6OnNldFRpbWVUb1NhbXBsZVBhcmFtcygKKyAgICAgICAgb2ZmX3QgZGF0YV9vZmZzZXQsIG9mZl90IGRhdGFfc2l6ZSkgeworICAgIGlmIChtVGltZVRvU2FtcGxlICE9IE5VTEwgfHwgZGF0YV9zaXplIDwgOCkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIHVpbnQ4X3QgaGVhZGVyWzhdOworICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICBkYXRhX29mZnNldCwgaGVhZGVyLCBzaXplb2YoaGVhZGVyKSkgPCAoc3NpemVfdClzaXplb2YoaGVhZGVyKSkgeworICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgfQorCisgICAgaWYgKFUzMl9BVChoZWFkZXIpICE9IDApIHsKKyAgICAgICAgLy8gRXhwZWN0ZWQgdmVyc2lvbiA9IDAsIGZsYWdzID0gMC4KKyAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKKyAgICB9CisKKyAgICBtVGltZVRvU2FtcGxl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MzIsCisgICAgICAgICAgICAgICAgICAgIHNpemVvZihvZmZzZXQzMikpIDwgKHNzaXplX3Qpc2l6ZW9mKG9mZnNldDMyKSkgeworICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICB9CisKKyAgICAgICAgKm9mZnNldCA9IG50b2hsKG9mZnNldDMyKTsKKyAgICB9IGVsc2UgeworICAgICAgICBDSEVDS19FUShtQ2h1bmtPZmZzZXRUeXBlLCBrQ2h1bmtPZmZzZXRUeXBlNjQpOworCisgICAgICAgIHVpbnQ2NF90IG9mZnNldDY0OworICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgICAgIG1DaHVua09mZnNldE9mZnNldCArIDggKyA4ICogY2h1bmtfaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICZvZmZzZXQ2NCwKKyAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKG9mZnNldDY0KSkgPCAoc3NpemVfdClzaXplb2Yob2Zmc2V0NjQpKSB7CisgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgIH0KKworICAgICAgICAqb2Zmc2V0ID0gbnRvaDY0KG9mZnNldDY0KTsKKyAgICB9CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IFNhbXBsZVRhYmxlOjpnZXRDaHVua0ZvclNhbXBsZSgKKyAgICAgICAgdWludDMyX3Qgc2FtcGxlX2luZGV4LAorICAgICAgICB1aW50MzJfdCAqY2h1bmtfaW5kZXgsIAorICAgICAgICB1aW50MzJfdCAqY2h1bmtfcmVsYXRpdmVfc2FtcGxlX2luZGV4LAorICAgICAgICB1aW50MzJfdCAqZGVzY19pbmRleCkgeworICAgICpjaHVua19pbmRleCA9IDA7CisgICAgKmNodW5rX3JlbGF0aXZlX3NhbXBsZV9pbmRleCA9IDA7CisgICAgKmRlc2NfaW5kZXggPSAwOworCisgICAgaWYgKG1TYW1wbGVUb0NodW5rT2Zmc2V0IDwgMCkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIGlmIChzYW1wbGVfaW5kZXggPj0gY291bnRTYW1wbGVzKCkpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX0VORF9PRl9TVFJFQU07CisgICAgfQorCisgICAgdWludDMyX3QgZmlyc3RfY2h1bmsgPSAwOworICAgIHVpbnQzMl90IHNhbXBsZXNfcGVyX2NodW5rID0gMDsKKyAgICB1aW50MzJfdCBjaHVua19kZXNjX2luZGV4ID0gMDsKKworICAgIHVpbnQzMl90IGluZGV4ID0gMDsKKyAgICB3aGlsZSAoaW5kZXggPCBtTnVtU2FtcGxlVG9DaHVua09mZnNldHMpIHsKKyAgICAgICAgdWludDhfdCBidWZmZXJbMTJdOworICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQobVNhbXBsZVRvQ2h1bmtPZmZzZXQgKyA4ICsgaW5kZXggKiAxMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpIDwgKHNzaXplX3Qpc2l6ZW9mKGJ1ZmZlcikpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgfQorCisgICAgICAgIHVpbnQzMl90IHN0b3BfY2h1bmsgPSBVMzJfQVQoYnVmZmVyKTsKKyAgICAgICAgaWYgKHNhbXBsZV9pbmRleCA8IChzdG9wX2NodW5rIC0gZmlyc3RfY2h1bmspICogc2FtcGxlc19wZXJfY2h1bmspIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgc2FtcGxlX2luZGV4IC09IChzdG9wX2NodW5rIC0gZmlyc3RfY2h1bmspICogc2FtcGxlc19wZXJfY2h1bms7CisgICAgICAgIGZpcnN0X2NodW5rID0gc3RvcF9jaHVuazsKKyAgICAgICAgc2FtcGxlc19wZXJfY2h1bmsgPSBVMzJfQVQoJmJ1ZmZlcls0XSk7CisgICAgICAgIGNodW5rX2Rlc2NfaW5kZXggPSBVMzJfQVQoJmJ1ZmZlcls4XSk7CisKKyAgICAgICAgKytpbmRleDsKKyAgICB9CisKKyAgICAqY2h1bmtfaW5kZXggPSBzYW1wbGVfaW5kZXggLyBzYW1wbGVzX3Blcl9jaHVuayArIGZpcnN0X2NodW5rIC0gMTsKKyAgICAqY2h1bmtfcmVsYXRpdmVfc2FtcGxlX2luZGV4ID0gc2FtcGxlX2luZGV4ICUgc2FtcGxlc19wZXJfY2h1bms7CisgICAgKmRlc2NfaW5kZXggPSBjaHVua19kZXNjX2luZGV4OworCisgICAgcmV0dXJuIE9LOworfQorCit1aW50MzJfdCBTYW1wbGVUYWJsZTo6Y291bnRTYW1wbGVzKCkgY29uc3QgeworICAgIHJldHVybiBtTnVtU2FtcGxlU2l6ZXM7Cit9CisKK3N0YXR1c190IFNhbXBsZVRhYmxlOjpnZXRTYW1wbGVTaXplKAorICAgICAgICB1aW50MzJfdCBzYW1wbGVfaW5kZXgsIHNpemVfdCAqc2FtcGxlX3NpemUpIHsKKyAgICAqc2FtcGxlX3NpemUgPSAwOworCisgICAgaWYgKG1TYW1wbGVTaXplT2Zmc2V0IDwgMCkgeworICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOworICAgIH0KKworICAgIGlmIChzYW1wbGVfaW5kZXggPj0gbU51bVNhbXBsZVNpemVzKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9PVVRfT0ZfUkFOR0U7CisgICAgfQorCisgICAgaWYgKG1EZWZhdWx0U2FtcGxlU2l6ZSA+IDApIHsKKyAgICAgICAgKnNhbXBsZV9zaXplID0gbURlZmF1bHRTYW1wbGVTaXplOworICAgICAgICByZXR1cm4gT0s7CisgICAgfQorCisgICAgc3dpdGNoIChtU2FtcGxlU2l6ZUZpZWxkU2l6ZSkgeworICAgICAgICBjYXNlIDMyOgorICAgICAgICB7CisgICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgICAgICAgICBtU2FtcGxlU2l6ZU9mZnNldCArIDEyICsgNCAqIHNhbXBsZV9pbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZV9zaXplLCBzaXplb2YoKnNhbXBsZV9zaXplKSkgPCAoc3NpemVfdClzaXplb2YoKnNhbXBsZV9zaXplKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgKnNhbXBsZV9zaXplID0gbnRvaGwoKnNhbXBsZV9zaXplKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgY2FzZSAxNjoKKyAgICAgICAgeworICAgICAgICAgICAgdWludDE2X3QgeDsKKyAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TYW1wbGVTaXplT2Zmc2V0ICsgMTIgKyAyICogc2FtcGxlX2luZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgJngsIHNpemVvZih4KSkgPCAoc3NpemVfdClzaXplb2YoeCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICpzYW1wbGVfc2l6ZSA9IG50b2hzKHgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBjYXNlIDg6CisgICAgICAgIHsKKyAgICAgICAgICAgIHVpbnQ4X3QgeDsKKyAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TYW1wbGVTaXplT2Zmc2V0ICsgMTIgKyBzYW1wbGVfaW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAmeCwgc2l6ZW9mKHgpKSA8IChzc2l6ZV90KXNpemVvZih4KSkgeworICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgKnNhbXBsZV9zaXplID0geDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgeworICAgICAgICAgICAgQ0hFQ0tfRVEobVNhbXBsZVNpemVGaWVsZFNpemUsIDQpOworCisgICAgICAgICAgICB1aW50OF90IHg7CisgICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRfYXQoCisgICAgICAgICAgICAgICAgICAgICAgICBtU2FtcGxlU2l6ZU9mZnNldCArIDEyICsgc2FtcGxlX2luZGV4IC8gMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICZ4LCBzaXplb2YoeCkpIDwgKHNzaXplX3Qpc2l6ZW9mKHgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAqc2FtcGxlX3NpemUgPSAoc2FtcGxlX2luZGV4ICYgMSkgPyB4ICYgMHgwZiA6IHggPj4gNDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBTYW1wbGVUYWJsZTo6Z2V0U2FtcGxlT2Zmc2V0QW5kU2l6ZSgKKyAgICAgICAgdWludDMyX3Qgc2FtcGxlX2luZGV4LCBvZmZfdCAqb2Zmc2V0LCBzaXplX3QgKnNpemUpIHsKKyAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOworCisgICAgKm9mZnNldCA9IDA7CisgICAgKnNpemUgPSAwOworCisgICAgdWludDMyX3QgY2h1bmtfaW5kZXg7CisgICAgdWludDMyX3QgY2h1bmtfcmVsYXRpdmVfc2FtcGxlX2luZGV4OworICAgIHVpbnQzMl90IGRlc2NfaW5kZXg7CisgICAgc3RhdHVzX3QgZXJyID0gZ2V0Q2h1bmtGb3JTYW1wbGUoCisgICAgICAgICAgICBzYW1wbGVfaW5kZXgsICZjaHVua19pbmRleCwgJmNodW5rX3JlbGF0aXZlX3NhbXBsZV9pbmRleCwKKyAgICAgICAgICAgICZkZXNjX2luZGV4KTsKKworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICBlcnIgPSBnZXRDaHVua09mZnNldChjaHVua19pbmRleCwgb2Zmc2V0KTsKKworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICBmb3IgKHVpbnQzMl90IGogPSAwOyBqIDwgY2h1bmtfcmVsYXRpdmVfc2FtcGxlX2luZGV4OyArK2opIHsKKyAgICAgICAgc2l6ZV90IHNhbXBsZV9zaXplOworICAgICAgICBlcnIgPSBnZXRTYW1wbGVTaXplKHNhbXBsZV9pbmRleCAtIGogLSAxLCAmc2FtcGxlX3NpemUpOworCisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKworICAgICAgICAqb2Zmc2V0ICs9IHNhbXBsZV9zaXplOworICAgIH0KKworICAgIGVyciA9IGdldFNhbXBsZVNpemUoc2FtcGxlX2luZGV4LCBzaXplKTsKKworICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IFNhbXBsZVRhYmxlOjpnZXRNYXhTYW1wbGVTaXplKHNpemVfdCAqbWF4X3NpemUpIHsKKyAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOworCisgICAgKm1heF9zaXplID0gMDsKKworICAgIGZvciAodWludDMyX3QgaSA9IDA7IGkgPCBtTnVtU2FtcGxlU2l6ZXM7ICsraSkgeworICAgICAgICBzaXplX3Qgc2FtcGxlX3NpemU7CisgICAgICAgIHN0YXR1c190IGVyciA9IGdldFNhbXBsZVNpemUoaSwgJnNhbXBsZV9zaXplKTsKKyAgICAgICAgCisgICAgICAgIGlmIChlcnIgIT0gT0spIHsKKyAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgIH0KKworICAgICAgICBpZiAoc2FtcGxlX3NpemUgPiAqbWF4X3NpemUpIHsKKyAgICAgICAgICAgICptYXhfc2l6ZSA9IHNhbXBsZV9zaXplOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIE9LOworfQorCitzdGF0dXNfdCBTYW1wbGVUYWJsZTo6Z2V0RGVjb2RpbmdUaW1lKHVpbnQzMl90IHNhbXBsZV9pbmRleCwgdWludDMyX3QgKnRpbWUpIHsKKyAgICAvLyBYWFggRklYTUUgaWRpb3RpYyAoZm9yIHRoZSBjb21tb24gdXNlLWNhc2UpIE8obikgYWxnb3JpdGhtIGJlbG93Li4uCisKKyAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOworCisgICAgaWYgKHNhbXBsZV9pbmRleCA+PSBtTnVtU2FtcGxlU2l6ZXMpIHsKKyAgICAgICAgcmV0dXJuIEVSUk9SX09VVF9PRl9SQU5HRTsKKyAgICB9CisKKyAgICB1aW50MzJfdCBjdXJfc2FtcGxlID0gMDsKKyAgICAqdGltZSA9IDA7CisgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IG1UaW1lVG9TYW1wbGVDb3VudDsgKytpKSB7CisgICAgICAgIHVpbnQzMl90IG4gPSBtVGltZVRvU2FtcGxlWzIgKiBpXTsKKyAgICAgICAgdWludDMyX3QgZGVsdGEgPSBtVGltZVRvU2FtcGxlWzIgKiBpICsgMV07CisKKyAgICAgICAgaWYgKHNhbXBsZV9pbmRleCA8IGN1cl9zYW1wbGUgKyBuKSB7CisgICAgICAgICAgICAqdGltZSArPSBkZWx0YSAqIChzYW1wbGVfaW5kZXggLSBjdXJfc2FtcGxlKTsKKworICAgICAgICAgICAgcmV0dXJuIE9LOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAqdGltZSArPSBkZWx0YSAqIG47CisgICAgICAgIGN1cl9zYW1wbGUgKz0gbjsKKyAgICB9CisKKyAgICByZXR1cm4gRVJST1JfT1VUX09GX1JBTkdFOworfQorCitzdGF0dXNfdCBTYW1wbGVUYWJsZTo6ZmluZENsb3Nlc3RTYW1wbGUoCisgICAgICAgIHVpbnQzMl90IHJlcV90aW1lLCB1aW50MzJfdCAqc2FtcGxlX2luZGV4LCB1aW50MzJfdCBmbGFncykgeworICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7CisKKyAgICB1aW50MzJfdCBjdXJfc2FtcGxlID0gMDsKKyAgICB1aW50MzJfdCB0aW1lID0gMDsKKyAgICBmb3IgKHVpbnQzMl90IGkgPSAwOyBpIDwgbVRpbWVUb1NhbXBsZUNvdW50OyArK2kpIHsKKyAgICAgICAgdWludDMyX3QgbiA9IG1UaW1lVG9TYW1wbGVbMiAqIGldOworICAgICAgICB1aW50MzJfdCBkZWx0YSA9IG1UaW1lVG9TYW1wbGVbMiAqIGkgKyAxXTsKKworICAgICAgICBpZiAocmVxX3RpbWUgPCB0aW1lICsgbiAqIGRlbHRhKSB7CisgICAgICAgICAgICBpbnQgaiA9IChyZXFfdGltZSAtIHRpbWUpIC8gZGVsdGE7CisKKyAgICAgICAgICAgICpzYW1wbGVfaW5kZXggPSBjdXJfc2FtcGxlICsgajsKKworICAgICAgICAgICAgaWYgKGZsYWdzICYga1N5bmNTYW1wbGVfRmxhZykgeworICAgICAgICAgICAgICAgIHJldHVybiBmaW5kQ2xvc2VzdFN5bmNTYW1wbGUoKnNhbXBsZV9pbmRleCwgc2FtcGxlX2luZGV4KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIE9LOworICAgICAgICB9CisKKyAgICAgICAgdGltZSArPSBkZWx0YSAqIG47CisgICAgICAgIGN1cl9zYW1wbGUgKz0gbjsKKyAgICB9CisKKyAgICByZXR1cm4gRVJST1JfT1VUX09GX1JBTkdFOworfQorCitzdGF0dXNfdCBTYW1wbGVUYWJsZTo6ZmluZENsb3Nlc3RTeW5jU2FtcGxlKAorICAgICAgICB1aW50MzJfdCBzdGFydF9zYW1wbGVfaW5kZXgsIHVpbnQzMl90ICpzYW1wbGVfaW5kZXgpIHsKKyAgICAqc2FtcGxlX2luZGV4ID0gMDsKKworICAgIGlmIChtU3luY1NhbXBsZU9mZnNldCA8IDApIHsKKyAgICAgICAgLy8gQWxsIHNhbXBsZXMgYXJlIHN5bmMtc2FtcGxlcy4KKyAgICAgICAgKnNhbXBsZV9pbmRleCA9IHN0YXJ0X3NhbXBsZV9pbmRleDsKKyAgICAgICAgcmV0dXJuIE9LOworICAgIH0KKworICAgIHVpbnQzMl90IHg7CisgICAgdWludDMyX3QgbGVmdCA9IDA7CisgICAgdWludDMyX3QgcmlnaHQgPSBtTnVtU3luY1NhbXBsZXM7CisgICAgd2hpbGUgKGxlZnQgPCByaWdodCkgeworICAgICAgICB1aW50MzJfdCBtaWQgPSAobGVmdCArIHJpZ2h0KSAvIDI7CisgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZF9hdCgKKyAgICAgICAgICAgICAgICAgICAgbVN5bmNTYW1wbGVPZmZzZXQgKyA4ICsgKG1pZCAtIDEpICogNCwgJngsIDQpICE9IDQpIHsKKyAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKKyAgICAgICAgfQorCisgICAgICAgIHggPSBudG9obCh4KTsKKworICAgICAgICBpZiAoeCA8IChzdGFydF9zYW1wbGVfaW5kZXggKyAxKSkgeworICAgICAgICAgICAgbGVmdCA9IG1pZCArIDE7CisgICAgICAgIH0gZWxzZSBpZiAoeCA+IChzdGFydF9zYW1wbGVfaW5kZXggKyAxKSkgeworICAgICAgICAgICAgcmlnaHQgPSBtaWQ7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgICpzYW1wbGVfaW5kZXggPSB4IC0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ApOworICAgIG1ldGEtPnNldEludDMyKGtLZXlDaGFubmVsQ291bnQsIDIpOyAgLy8gWFhYCisKKyAgICByZXR1cm4gbWV0YTsKK30KKworc3RhdHVzX3QgU2hvdXRjYXN0U291cmNlOjpyZWFkKAorICAgICAgICBNZWRpYUJ1ZmZlciAqKm91dCwgY29uc3QgUmVhZE9wdGlvbnMgKm9wdGlvbnMpIHsKKyAgICBDSEVDSyhtU3RhcnRlZCk7CisKKyAgICAqb3V0ID0gTlVMTDsKKworICAgIGludDY0X3Qgc2Vla1RpbWVVczsKKyAgICBpZiAob3B0aW9ucyAmJiBvcHRpb25zLT5nZXRTZWVrVG8oJnNlZWtUaW1lVXMpKSB7CisgICAgICAgIHJldHVybiBFUlJPUl9VTlNVUFBPUlRFRDsKKyAgICB9CisKKyAgICBNZWRpYUJ1ZmZlciAqYnVmZmVyOworICAgIHN0YXR1c190IGVyciA9IG1Hcm91cC0+YWNxdWlyZV9idWZmZXIoJmJ1ZmZlcik7CisgICAgaWYgKGVyciAhPSBPSykgeworICAgICAgICByZXR1cm4gZXJyOworICAgIH0KKworICAgICpvdXQgPSBidWZmZXI7CisKKyAgICBzaXplX3QgbnVtX2J5dGVzID0gYnVmZmVyLT5zaXplKCk7CisgICAgaWYgKG1NZXRhRGF0YU9mZnNldCA+IDAgJiYgbnVtX2J5dGVzID4gbUJ5dGVzVW50aWxNZXRhRGF0YSkgeworICAgICAgICBudW1fYnl0ZXMgPSBtQnl0ZXNVbnRpbE1ldGFEYXRhOworICAgIH0KKworICAgIHNzaXplX3QgbiA9IG1IdHRwLT5yZWNlaXZlKGJ1ZmZlci0+ZGF0YSgpLCBudW1fYnl0ZXMpOworCisgICAgaWYgKG4gPD0gMCkgeworICAgICAgICByZXR1cm4gKHN0YXR1c190KW47CisgICAgfQorCisgICAgYnVmZmVyLT5zZXRfcmFuZ2UoMCwgbik7CisKKyAgICBtQnl0ZXNVbnRpbE1ldGFEYXRhIC09IChzaXplX3QpbjsKKworICAgIGlmI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XR1cm4gdHJ1ZTsKK30KKworLy8gc3RhdGljCitpbnQ2NF90IFRpbWVkRXZlbnRRdWV1ZTo6Z2V0UmVhbFRpbWVVcygpIHsKKyAgICBzdHJ1Y3QgdGltZXZhbCB0djsKKyAgICBnZXR0aW1lb2ZkYXkoJnR2LCBOVUxMKTsKKworICAgIHJldHVybiAoaW50NjRfdCl0di50dl9zZWMgKiAxMDAwMDAwICsgdHYudHZfdXNlYzsKK30KKworLy8gc3RhdGljCit2b2lkICpUaW1lZEV2ZW50UXVldWU6OlRocmVhZFdyYXBwZXIodm9pZCAqbWUpIHsKKyAgICBzdGF0aWNfY2FzdDxUaW1lZEV2ZW50UXVldWUgKj4obWUpLT50aHJlYWRFbnRyeSgpOworCisgICAgcmV0dXJuIE5VTEw7Cit9CisKK3ZvaWQgVGltZWRFdmVudFF1ZXVlOjp0aHJlYWRFbnRyeSgpIHsKKyAgICBmb3IgKDs7KSB7CisgICAgICAgIGludDY0X3Qgbm93X3VzOworICAgICAgICBzcDxFdmVudD4gZXZlbnQ7CisKKyAgICAgICAgeworICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKKworICAgICAgICAgICAgaWYgKG1TdG9wcGVkKSB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHdoaWxlIChtUXVldWUuZW1wdHkoKSkgeworICAgICAgICAgICAgICAgIG1RdWV1ZU5vdEVtcHR5Q29uZGl0aW9uLndhaXQobUxvY2spOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBMaXN0PFF1ZXVlSXRlbT46Oml0ZXJhdG9yIGl0OworICAgICAgICAgICAgZm9yICg7OykgeworICAgICAgICAgICAgICAgIGl0ID0gbVF1ZXVlLmJlZ2luKCk7CisKKyAgICAgICAgICAgICAgICBub3dfdXMgPSBnZXRSZWFsVGltZVVzKCk7CisgICAgICAgICAgICAgICAgaW50NjRfdCB3aGVuX3VzID0gKCppdCkucmVhbHRpbWVfdXM7CisKKyAgICAgICAgICAgICAgICBpbnQ2NF90IGRlbGF5X3VzOworICAgICAgICAgICAgICAgIGlmICh3aGVuX3VzIDwgMCB8fCB3aGVuX3VzID09IElOVDY0X01BWCkgeworICAgICAgICAgICAgICAgICAgICBkZWxheV91cyA9IDA7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZGVsYXlfdXMgPSB3aGVuX3VzIC0gbm93X3VzOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChkZWxheV91cyA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1RdWV1ZUhlYWRDaGFuZ2VkQ29uZGl0aW9uLndhaXRSZWxhdGl2ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Mb2NrLCBkZWxheV91cyAqIDEwMDApOworCisgICAgICAgICAgICAgICAgaWYgKGVyciA9PSAtRVRJTUVET1VUKSB7CisgICAgICAgICAgICAgICAgICAgIG5vd191cyA9IGdldFJlYWxUaW1lVXMoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBldmVudCA9ICgqaXQpLmV2ZW50OworICAgICAgICAgICAgbVF1ZXVlLmVyYXNlKGl0KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEZpcmUgZXZlbnQgd2l0aCB0aGUgbG9jayBOT1QgaGVsZC4KKyAgICAgICAgZXZlbnQtPmZpcmUodGhpcywgbm93X3VzKTsKKyAgICB9Cit9CisKK30gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L1V0aWxzLmNwcCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L1V0aWxz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QoY2FsbCBteS1kaXIpCitpbmNsdWRlICQoQ0xFQVJfVkFSUykKKworIyBTZXQgdXAgdGhlIE9wZW5Db3JlIHZhcmlhYmxlcy4KK2luY2x1ZGUgZXh0ZXJuYWwvb3BlbmNvcmUvQ29uZmlnLm1rCitMT0NBTF9DX0lOQ0xVREVTIDo9ICQoUFZfSU5DTFVERVMpCitMT0NBTF9DRkxBR1MgOj0gJChQVl9DRkxBR1NfTUlOVVNfVklTSUJJTElUWSkKKworTE9DQUxfQ19JTkNMVURFUyArPSAkKFRPUCkvaGFyZHdhcmUvdGkvb21hcDMvbGlib3ZlcmxheQorCitMT0NBTF9TUkNfRklMRVM6PSAgICAgICAgICAgICAgICAgXAorCU9NWC5jcHAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBRQ29tSGFyZHdhcmVSZW5kZXJlci5jcHAgIFwKKyAgICAgICAgU29mdHdhcmVSZW5kZXJlci5jcHAgICAgICBcCisgICAgICAgIFRJSGFyZHdhcmVSZW5kZXJlci5jcHAKKworTE9DQUxfU0hBUkVEX0xJQlJBUklFUyA6PSAgICAgICBcCisgICAgICAgIGxpYmJpbmRlciAgICAgICAgICAgICAgIFwKKyAgICAgICAgbGlibWVkaWEgICAgICAgICAgICAgICAgXAorICAgICAgICBsaWJ1dGlscyAgICAgICAgICAgICAgICBcCisgICAgICAgIGxpYnVpICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgbGliY3V0aWxzICAgICAgICAgICAgICAgXAorICAgICAgICBsaWJvcGVuY29yZV9jb21tb24KKworaWZlcSAoJChUQVJHRVRfT1MpLSQoVEFSR0VUX1NJTVVMQVRPUiksbGludXgtdHJ1ZSkKKyAgICAgICAgTE9DQUxfTERMSUJTICs9IC1scHRocmVhZAorZW5kaWYKKworTE9DQUxfUFJFTElOS19NT0RVTEU6PSBmYWxzZQorCitMT0NBTF9NT0RVTEU6PSBsaWJzdGFnZWZyaWdodF9vbXgKKworaW5jbHVkZSAkKEJVSUxEX1NIQVJFRF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7CisgICAgICAgICAgICBtUXVldWUuZXJhc2UobVF1ZXVlLmJlZ2luKCkpOworICAgICAgICB9CisKKyAgICAgICAgZGlzcGF0Y2gobXNnKTsKKyAgICB9Cit9CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK2NsYXNzIEJ1ZmZlck1ldGEgeworcHVibGljOgorICAgIEJ1ZmZlck1ldGEoT01YICpvd25lciwgY29uc3Qgc3A8SU1lbW9yeT4gJm1lbSwgYm9vbCBpc19iYWNrdXAgPSBmYWxzZSkKKyAgICAgICAgOiBtT3duZXIob3duZXIpLAorICAgICAgICAgIG1NZW0obWVtKSwKKyAgICAgICAgICBtSXNCYWNrdXAoaXNfYmFja3VwKSB7CisgICAgfQorCisgICAgQnVmZmVyTWV0YShPTVggKm93bmVyLCBzaXplX3Qgc2l6ZSkKKyAgICAgICAgOiBtT3duZXIob3duZXIpLAorICAgICAgICAgIG1TaXplKHNpemUpLAorICAgICAgICAgIG1Jc0JhY2t1cChmYWxzZSkgeworICAgIH0KKworICAgIHZvaWQgQ29weUZyb21PTVgoY29uc3QgT01YX0JVRkZFUkhFQURFUlRZUEUgKmhlYWRlcikgeworICAgICAgICBpZiAoIW1Jc0JhY2t1cCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgbWVtY3B5KChPTVhfVTggKiltTWVtLT5wb2ludGVyKCkgKyBoZWFkZXItPm5PZmZzZXQsCisgICAgICAgICAgICAgICBoZWFkZXItPnBCdWZmZXIgKyBoZWFkZXItPm5PZmZzZXQsCisgICAgICAgICAgICAgICBoZWFkZXItPm5GaWxsZWRMZW4pOworICAgIH0KKworICAgIHZvaWQgQ29weVRvT01YKGNvbnN0IE9NWF9CVUZGRVJIRUFERVJUWVBFICpoZWFkZXIpIHsKKyAgICAgICAgaWYgKCFtSXNCYWNrdXApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIG1lbWNweShoZWFkZXItPnBCdWZmZXIgKyBoZWFkZXItPm5PZmZzZXQsCisgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4ICopbU1lbS0+cG9pbnRlcigpICsgaGVhZGVyLT5uT2Zmc2V0LAorICAgICAgICAgICAgICAgaGVhZGVyLT5uRmlsbGVkTGVuKTsKKyAgICB9CisKK3ByaXZhdGU6CisgICAgT01YICptT3duZXI7CisgICAgc3A8SU1lbW9yeT4gbU1lbTsKKyAgICBzaXplX3QgbVNpemU7CisgICAgYm9vbCBtSXNCYWNrdXA7CisKKyAgICBCdWZmZXJNZXRhKGNvbnN0IEJ1ZmZlck1ldGEgJik7CisgICAgQnVmZmVyTWV0YSAmb3BlcmF0b3I9KGNvbnN0IEJ1ZmZlck1ldGEgJik7Cit9OworCisvLyBzdGF0aWMKK09NWF9DQUxMQkFDS1RZUEUgT01YOjprQ2FsbGJhY2tzID0geworICAgICZPbkV2ZW50LCAmT25FbXB0eUJ1ZmZlckRvbmUsICZPbkZpbGxCdWZmZXJEb25lCit9OworCisvLyBzdGF0aWMKK09NWF9FUlJPUlRZUEUgT01YOjpPbkV2ZW50KAorICAgICAgICBPTVhfSU4gT01YX0hBTkRMRVRZUEUgaENvbXBvbmVudCwKKyAgICAgICAgT01YX0lOIE9NWF9QVFIgcEFwcERhdGEsCisgICAgICAgIE9NWF9JTiBPTVhfRVZFTlRUWVBFIGVFdmVudCwKKyAgICAgICAgT01YX0lOIE9NWF9VMzIgbkRhdGExLAorICAgICAgICBPTVhfSU4gT01YX1UzMiBuRGF0YTIsCisgICAgICAgIE9NWF9JTiBPTVhfUFRSIHBFdmVudERhdGEpIHsKKyAgICBOb2RlTWV0YSAqbWV0YSA9IHN0YXRpY19jYXN0PE5vZGVNZXRhICo+KHBBcHBEYXRhKTsKKyAgICByZXR1cm4gbWV0YS0+b3duZXIoKS0+T25FdmVudChtZXR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KKyAgICBPTVhfVTMyIGluZGV4ID0gMDsKKyAgICBjaGFyIGNvbXBvbmVudE5hbWVbMjU2XTsKKyAgICB3aGlsZSAoT01YX01hc3RlckNvbXBvbmVudE5hbWVFbnVtKGNvbXBvbmVudE5hbWUsIHNpemVvZihjb21wb25lbnROYW1lKSwgaW5kZXgpCisgICAgICAgICAgICAgICA9PSBPTVhfRXJyb3JOb25lKSB7CisgICAgICAgIGxpc3QtPnB1c2hfYmFjayhTdHJpbmc4KGNvbXBvbmVudE5hbWUpKTsKKworICAgICAgICArK2luZGV4OworICAgIH0KKworICAgIHJldHVybiBPSzsKK30KKworc3RhdHVzX3QgT01YOjphbGxvY2F0ZV9ub2RlKGNvbnN0IGNoYXIgKm5hbWUsIG5vZGVfaWQgKm5vZGUpIHsKKyAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOworCisgICAgKm5vZGUgPSAwOworCisgICAgT01YX01hc3RlckluaXQoKTsgIC8vIFhYWCBQdXQgdGhpcyBzb21ld2hlcmUgZWxzZS4KKworICAgIE5vZGVNZXRhICptZXRhID0gbmV3IE5vZGVNZXRhKHRoaXMpOworCisgICAgT01YX0hBTkRMRVRZUEUgaGFuZGxlOworICAgIE9NWF9FUlJPUlRZUEUgZXJyID0gT01YX01hc3RlckdldEhhbmRsZSgKKyAgICAgICAgICAgICZoYW5kbGUsIGNvbnN0X2Nhc3Q8Y2hhciAqPihuYW1lKSwgbWV0YSwgJmtDYWxsYmFja3MpOworCisgICAgaWYgKGVyciAhPSBPTVhfRXJyb3JOb25lKSB7CisgICAgICAgIExPR0UoIkZBSUxFRCB0byBhbGxvY2F0ZSBvbXggY29tcG9uZW50ICclcyciLCBuYW1lKTsKKworICAgICAgICBkZWxldGUgbWV0YTsKKyAgICAgICAgbWV0YSA9IE5VTEw7CisKKyAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgfQorCisgICAgbWV0YS0+c2V0SGFuZGxlKGhhbmRsZSk7CisK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Sk7CisKKyAgICBpZiAoZXJyICE9IE9NWF9FcnJvck5vbmUpIHsKKyAgICAgICAgZGVsZXRlIGJ1ZmZlcl9tZXRhOworICAgICAgICBidWZmZXJfbWV0YSA9IE5VTEw7CisKKyAgICAgICAgKmJ1ZmZlciA9IDA7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgICpidWZmZXIgPSBoZWFkZXI7CisKKyAgICByZXR1cm4gT0s7Cit9CisKK3N0YXR1c190IE9NWDo6YWxsb2NhdGVfYnVmZmVyX3dpdGhfYmFja3VwKAorICAgICAgICBub2RlX2lkIG5vZGUsIE9NWF9VMzIgcG9ydF9pbmRleCwgY29uc3Qgc3A8SU1lbW9yeT4gJnBhcmFtcywKKyAgICAgICAgYnVmZmVyX2lkICpidWZmZXIpIHsKKyAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOworCisgICAgQnVmZmVyTWV0YSAqYnVmZmVyX21ldGEgPSBuZXcgQnVmZmVyTWV0YSh0aGlzLCBwYXJhbXMsIHRydWUpOworCisgICAgT01YX0JVRkZFUkhFQURFUlRZUEUgKmhlYWRlcjsKKworICAgIE5vZGVNZXRhICpub2RlX21ldGEgPSBzdGF0aWNfY2FzdDxOb2RlTWV0YSAqPihub2RlKTsKKyAgICBPTVhfRVJST1JUWVBFIGVyciA9CisgICAgICAgIE9NWF9BbGxvY2F0ZUJ1ZmZlcigKKyAgICAgICAgICAgICAgICBub2RlX21ldGEtPmhhbmRsZSgpLCAmaGVhZGVyLCBwb3J0X2luZGV4LCBidWZmZXJfbWV0YSwKKyAgICAgICAgICAgICAgICBwYXJhbXMtPnNpemUoKSk7CisKKyAgICBpZiAoZXJyICE9IE9NWF9FcnJvck5vbmUpIHsKKyAgICAgICAgZGVsZXRlIGJ1ZmZlcl9tZXRhOworICAgICAgICBidWZmZXJfbWV0YSA9IE5VTEw7CisKKyAgICAgICAgKmJ1ZmZlciA9IDA7CisgICAgICAgIHJldHVyb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ZW50TmFtZSwKKyAgICAgICAgT01YX0NPTE9SX0ZPUk1BVFRZUEUgY29sb3JGb3JtYXQsCisgICAgICAgIHNpemVfdCBlbmNvZGVkV2lkdGgsIHNpemVfdCBlbmNvZGVkSGVpZ2h0LAorICAgICAgICBzaXplX3QgZGlzcGxheVdpZHRoLCBzaXplX3QgZGlzcGxheUhlaWdodCkgeworICAgIFZpZGVvUmVuZGVyZXIgKmltcGwgPSBOVUxMOworCisgICAgc3RhdGljIGNvbnN0IGludCBPTVhfUUNPTV9DT0xPUl9Gb3JtYXRZVlU0MjBTZW1pUGxhbmFyID0gMHg3RkEzMEMwMDsKKworICAgIGlmIChjb2xvckZvcm1hdCA9PSBPTVhfUUNPTV9DT0xPUl9Gb3JtYXRZVlU0MjBTZW1pUGxhbmFyCisgICAgICAgICYmICFzdHJuY21wKGNvbXBvbmVudE5hbWUsICJPTVgucWNvbS52aWRlby5kZWNvZGVyLiIsIDIzKSkgeworICAgICAgICBMT0dXKCJVc2luZyBRQ29tSGFyZHdhcmVSZW5kZXJlci4iKTsKKyAgICAgICAgaW1wbCA9CisgICAgICAgICAgICBuZXcgUUNvbUhhcmR3YXJlUmVuZGVyZXIoCisgICAgICAgICAgICAgICAgICAgIHN1cmZhY2UsCisgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlXaWR0aCwgZGlzcGxheUhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgZW5jb2RlZFdpZHRoLCBlbmNvZGVkSGVpZ2h0KTsKKyAgICB9IGVsc2UgaWYgKGNvbG9yRm9ybWF0ID09IE9NWF9DT0xPUl9Gb3JtYXRDYllDclkKKyAgICAgICAgICAgICYmICFzdHJjbXAoY29tcG9uZW50TmFtZSwgIk9NWC5USS5WaWRlby5EZWNvZGVyIikpIHsKKyAgICAgICAgTE9HVygiVXNpbmcgVElIYXJkd2FyZVJlbmRlcmVyLiIpOworICAgICAgICBpbXBsID0KKyAgICAgICAgICAgIG5ldyBUSUhhcmR3YXJlUmVuZGVyZXIoCisgICAgICAgICAgICAgICAgICAgIHN1cmZhY2UsCisgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlXaWR0aCwgZGlzcGxheUhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgZW5jb2RlZFdpZHRoLCBlbmNvZGVkSGVpZ2h0KTsKKyAgICB9IGVsc2UgeworICAgICAgICBMT0dXKCJVc2luZyBzb2Z0d2FyZSByZW5kZXJlci4iKTsKKyAgICAgICAgaW1wbCA9IG5ldyBTb2Z0d2FyZVJlbmRlcmVyKAorICAgICAgICAgICAgICAgIHN1cmZhY2UsCisgICAgICAgICAgICAgICAgZGlzcGxheVdpZHRoLCBkaXNwbGF5SGVpZ2h0LAorICAgICAgICAgICAgICAgIGVuY29kZWRXaWR0aCwgZW5jb2RlZEhlaWdodCk7CisgICAgfQorCisgICAgcmV0dXJuIG5ldyBPTVhSZW5kZXJlcihpbXBsKTsKK30KKworT01YUmVuZGVyZXI6Ok9NWFJlbmRlcmVyKFZpZGVvUmVuZGVyZXIgKmltcGwpCisgICAgOiBtSW1wbChpbXBsKSB7Cit9CisKK09NWFJlbmRlcmVyOjp+T01YUmVuZGVyZXIoKSB7CisgICAgZGVsZXRlIG1JbXBsOworICAgIG1JbXBsID0gTlVMTDsKK30KKwordm9pZCBPTVhSZW5kZXJlcjo6cmVuZGVyKElPTVg6OmJ1ZmZlcl9pZCBidWZmZXIpIHsKKyAgICBPTVhfQlVGRkVSSEVBREVSVFlQRSAqaGVhZGVyID0gKE9NWF9CVUZGRVJIRUFERVJUWVBFICopYnVmZmVyOworCisgICAgbUltcGwtPnJlbmRlcigKKyAgICAgICAgICAgIGhlYWRlci0+cEJ1ZmZlciArIGhlYWRlci0+bk9mZnNldCwKKyAgICAgICAgICAgIGhlYWRlci0+bkZpbGxlZExlbiwKKyAgICAgICAgICAgIGhlYWRlci0+cFBsYXRmb3JtUHJpdmF0ZSk7Cit9CisKK30gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKZGlmZiAt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UuCisgKi8KKworI2lmbmRlZiBBTkRST0lEX09NWF9IXworI2RlZmluZSBBTkRST0lEX09NWF9IXworCisjaW5jbHVkZSA8bWVkaWEvSU9NWC5oPgorI2luY2x1ZGUgPHV0aWxzL3RocmVhZHMuaD4KKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitjbGFzcyBOb2RlTWV0YTsKKworY2xhc3MgT01YIDogcHVibGljIEJuT01YIHsKK3B1YmxpYzoKKyAgICBPTVgoKTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgbGlzdF9ub2RlcyhMaXN0PFN0cmluZzg+ICpsaXN0KTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgYWxsb2NhdGVfbm9kZShjb25zdCBjaGFyICpuYW1lLCBub2RlX2lkICpub2RlKTsKKyAgICB2aXJ0dWFsIHN0YXR1c190IGZyZWVfbm9kZShub2RlX2lkIG5vZGUpOworCisgICAgdmlydHVhbCBzdGF0dXNfdCBzZW5kX2NvbW1hbmQoCisgICAgICAgICAgICBub2RlX2lkIG5vZGUsIE9NWF9DT01NQU5EVFlQRSBjbWQsIE9NWF9TMzIgcGFyYW0pOworCisgICAgdmlydHVhbCBzdGF0dXNfdCBnZXRfcGFyYW1ldGVyKAorICAgICAgICAgICAgbm9kZV9pZCBub2RlLCBPTVhfSU5ERVhUWVBFIGluZGV4LAorICAgICAgICAgICAgdm9pZCAqcGFyYW1zLCBzaXplX3Qgc2l6ZSk7CisKKyAgICB2aXJ0dWFsIHN0YXR1c190IHNldF9wYXJhbWV0ZXIoCisgICAgICAgICAgICBub2RlX2lkIG5vZGUsIE9NWF9JTkRFWFRZUEUgaW5kZXgsCisgICAgICAgICAgICBjb25zdCB2b2lkICpwYXJhbXMsIHNpemVfdCBzaXplKTsKKworICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0X2NvbmZpZygKKyAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX0lOREVYVFlQRSBpbmRleCwKKyAgICAgICAgICAgIHZva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k9SVFlQRSBPbkV2ZW50KAorICAgICAgICAgICAgT01YX0lOIE9NWF9IQU5ETEVUWVBFIGhDb21wb25lbnQsCisgICAgICAgICAgICBPTVhfSU4gT01YX1BUUiBwQXBwRGF0YSwKKyAgICAgICAgICAgIE9NWF9JTiBPTVhfRVZFTlRUWVBFIGVFdmVudCwKKyAgICAgICAgICAgIE9NWF9JTiBPTVhfVTMyIG5EYXRhMSwKKyAgICAgICAgICAgIE9NWF9JTiBPTVhfVTMyIG5EYXRhMiwKKyAgICAgICAgICAgIE9NWF9JTiBPTVhfUFRSIHBFdmVudERhdGEpOworCisgICAgc3RhdGljIE9NWF9FUlJPUlRZUEUgT25FbXB0eUJ1ZmZlckRvbmUoCisgICAgICAgICAgICBPTVhfSU4gT01YX0hBTkRMRVRZUEUgaENvbXBvbmVudCwKKyAgICAgICAgICAgIE9NWF9JTiBPTVhfUFRSIHBBcHBEYXRhLAorICAgICAgICAgICAgT01YX0lOIE9NWF9CVUZGRVJIRUFERVJUWVBFKiBwQnVmZmVyKTsKKworICAgIHN0YXRpYyBPTVhfRVJST1JUWVBFIE9uRmlsbEJ1ZmZlckRvbmUoCisgICAgICAgICAgICBPTVhfSU4gT01YX0hBTkRMRVRZUEUgaENvbXBvbmVudCwKKyAgICAgICAgICAgIE9NWF9JTiBPTVhfUFRSIHBBcHBEYXRhLAorICAgICAgICAgICAgT01YX0lOIE9NWF9CVUZGRVJIRUFERVJUWVBFKiBwQnVmZmVyKTsKKworICAgIE9NWF9FUlJPUlRZUEUgT25FdmVudCgKKyAgICAgICAgICAgIE5vZGVNZXRhICptZXRhLAorICAgICAgICAgICAgT01YX0lOIE9NWF9FVkVOVFRZUEUgZUV2ZW50LAorICAgICAgICAgICAgT01YX0lOIE9NWF9VMzIgbkRhdGExLAorICAgICAgICAgICAgT01YX0lOIE9NWF9VMzIgbkRhdGEyLAorICAgICAgICAgICAgT01YX0lOIE9NWF9QVFIgcEV2ZW50RGF0YSk7CisgICAgICAgIAorICAgIE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ICAgICAgaWYgKG1NZW1vcnlIZWFwLmdldCgpID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBwdWJsaXNoQnVmZmVycyhpbmZvLT5wbWVtX2ZkKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1NZW1vcnlIZWFwLmdldCgpID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICpvZmZzZXQgPSBpbmZvLT5vZmZzZXQ7CisKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIGZhbHNlOworfQorCit2b2lkIFFDb21IYXJkd2FyZVJlbmRlcmVyOjpwdWJsaXNoQnVmZmVycyh1aW50MzJfdCBwbWVtX2ZkKSB7CisgICAgc3A8TWVtb3J5SGVhcEJhc2U+IG1hc3RlciA9CisgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8TWVtb3J5SGVhcEJhc2UgKj4ocG1lbV9mZCk7CisKKyAgICBtYXN0ZXItPnNldERldmljZSgiL2Rldi9wbWVtIik7CisKKyAgICBtTWVtb3J5SGVhcCA9IG5ldyBNZW1vcnlIZWFwUG1lbShtYXN0ZXIsIDApOworICAgIG1NZW1vcnlIZWFwLT5zbGFwKCk7CisKKyAgICBJU3VyZmFjZTo6QnVmZmVySGVhcCBidWZmZXJIZWFwKAorICAgICAgICAgICAgbURpc3BsYXlXaWR0aCwgbURpc3BsYXlIZWlnaHQsCisgICAgICAgICAgICBtRGVjb2RlZFdpZHRoLCBtRGVjb2RlZEhlaWdodCwKKyAgICAgICAgICAgIFBJWEVMX0ZPUk1BVF9ZQ2JDcl80MjBfU1AsCisgICAgICAgICAgICBtTWVtb3J5SGVhcCk7CisKKyAgICBzdGF0dXNfdCBlcnIgPSBtSVN1cmZhY2UtPnJlZ2lzdGVyQnVmZmVycyhidWZmZXJIZWFwKTsKKyAgICBDSEVDS19FUShlc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ICB9CisgICAgQ0hFQ0soc2l6ZSA+PSAobURlY29kZWRXaWR0aCAqIG1EZWNvZGVkSGVpZ2h0ICogMykgLyAyKTsKKworICAgIHN0YXRpYyBjb25zdCBzaWduZWQga0NsaXBNaW4gPSAtMjc4OworICAgIHN0YXRpYyBjb25zdCBzaWduZWQga0NsaXBNYXggPSA1MzU7CisgICAgc3RhdGljIHVpbnQ4X3Qga0NsaXBba0NsaXBNYXggLSBrQ2xpcE1pbiArIDFdOworICAgIHN0YXRpYyB1aW50OF90ICprQWRqdXN0ZWRDbGlwID0gJmtDbGlwWy1rQ2xpcE1pbl07CisKKyAgICBzdGF0aWMgYm9vbCBjbGlwSW5pdGlhbGl6ZWQgPSBmYWxzZTsKKworICAgIGlmICghY2xpcEluaXRpYWxpemVkKSB7CisgICAgICAgIGZvciAoc2lnbmVkIGkgPSBrQ2xpcE1pbjsgaSA8PSBrQ2xpcE1heDsgKytpKSB7CisgICAgICAgICAgICBrQ2xpcFtpIC0ga0NsaXBNaW5dID0gKGkgPCAwKSA/IDAgOiAoaSA+IDI1NSkgPyAyNTUgOiAodWludDhfdClpOworICAgICAgICB9CisgICAgICAgIGNsaXBJbml0aWFsaXplZCA9IHRydWU7CisgICAgfQorCisgICAgc2l6ZV90IG9mZnNldCA9IG1JbmRleCAqIG1GcmFtZVNpemU7CisKKyAgICB2b2lkICpkc3QgPSAodWludDhfdCAqKW1NZW1vcnlIZWFwLT5nZXRCYXNlKCkgKyBvZmZzZXQ7CisKKyAgICB1aW50MzJfdCAqZHN0X3B0ciA9ICh1aW50MzJfdCAqKWRzdDsKKworICAgIGNvbnN0IHVpbnQ4X3QgKnNyY195ID0gKGNvbnN0IHVpbnQ4X3QgKilkYXRhOworCisgICAgY29uc3QgdWludDhfdCAqc3JjX3UgPQorICAgICAgICAoY29uc3QgdWludDhfdCAqKXNyY195ICsgbURlY29kZWRXaWR0aCAqIG1EZWNvZGVkSGVpZ2h0OworCisjaWYgIVFDT01fWVVWCisgICAgY29uc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MjIzCisKKyAgICAgICAgICAgIC8vIG1heF9CID0gKDI5OCAqICgyNTUgLSAxNikgKyA1MTcgKiAoMjU1IC0gMTI4KSkgLyAyNTYgPSA1MzQKKyAgICAgICAgICAgIC8vIG1heF9HID0gKDI5OCAqICgyNTUgLSAxNikgLSAyMDggKiAoLSAxMjgpIC0gMTAwICogKC0gMTI4KSkgLyAyNTYgPSA0MzIKKyAgICAgICAgICAgIC8vIG1heF9SID0gKDI5OCAqICgyNTUgLSAxNikgKyA0MDkgKiAoMjU1IC0gMTI4KSkgLyAyNTYgPSA0ODEKKworICAgICAgICAgICAgLy8gY2xpcCByYW5nZSAtMjc4IC4uIDUzNQorCisgICAgICAgICAgICBzaWduZWQgeTEgPSAoc2lnbmVkKXNyY195W3hdIC0gMTY7CisgICAgICAgICAgICBzaWduZWQgeTIgPSAoc2lnbmVkKXNyY195W3ggKyAxXSAtIDE2OworCisjaWYgUUNPTV9ZVVYKKyAgICAgICAgICAgIHNpZ25lZCB1ID0gKHNpZ25lZClzcmNfdVt4ICYgfjFdIC0gMTI4OworICAgICAgICAgICAgc2lnbmVkIHYgPSAoc2lnbmVkKXNyY191Wyh4ICYgfjEpICsgMV0gLSAxMjg7CisjZWxzZQorICAgICAgICAgICAgc2lnbmVkIHUgPSAoc2lnbmVkKXNyY191W3ggLyAyXSAtIDEyODsKKyAgICAgICAgICAgIHNpZ25lZCB2ID0gKHNpZ25lZClzcmNfdlt4IC8gMl0gLSAxMjg7CisjZW5kaWYKKworICAgICAgICAgICAgc2lnbmVkIHVfYiA9IHUgKiA1MTc7CisgICAgICAgICAgICBzaWduZWQgdV9nID0gLXUgKiAxMDA7CisgICAgICAgICAgICBzaWduZWQgdl9nID0gLXYgKiAyMDg7CisgICAgICAgICAgICBzaWduZWQgdl9yID0gdiAqIDQwOTsKKworICAgICAgICAgICAgc2lnbmVkIHRtcDEgPSB5MSAqIDI5ODsKKyAgICAgICAgICAgIHNpZ25lZCBiMSA9ICh0bXAxICsgdV9iKSAvIDI1NjsKKyAgICAgICAgICAgIHNpZ25lZCBnMSA9ICh0bXAxICsgdl9nICsgdV9nKSAvIDI1NjsKKyAgICAgICAgICAgIHNpZ25lZCByMSA9ICh0bXAxICsgdl9yKSAvIDI1NjsKKworICAgICAgICAgICAgc2lnbmVkIHRtcDIgPSB5MiAqIDI5ODsKKyAgICAgICAgICAgIHNpZ25lZCBiMiA9ICh0bXAyICsgdV9iKSAvIDI1NjsKKyAgICAgICAgICAgIHNpZ25lZCBnMiA9ICh0bXAyICsgdl9nICsgdV9nKSAvIDI1NjsKKyAgICAgICAgICAgIHNpZ25lZCByMiA9ICh0bXAyICsgdl9yKSAvIDI1NjsKKworICAgICAgICAgICAgdWludDMyX3QgcmdiMSA9CisgICAgICAgICAgICAgICAgKChrQWRqdXN0ZWRDbGlwW3IxXSA+PiAzKSA8PCAxMSkKKyAgICAgICAgICAgICAgICB8ICgoa0FkanVzdGVkQ2xpcFtnMV0gPj4gMikgPDwgNSkKKyAgICAgICAgICAgICAgICB8IChrQWRqdXN0ZWRDbGlwW2IxXSA+PiAzKTsKKworICAgICAgICAgICAgdWludDMyX3QgcmdiMiA9CisgICAgICAgICAgICAgICAgKChrQWRqdXN0ZWRDbGlwW3IyXSA+PiAzKSA8PCAxMSkKKyAgICAgICAgICAgICAgICB8ICgoa0FkanVzdGVkQ2xpcFtnMl0gPj4gMikgPDwgNSkKKyAgICAgICAgICAgICAgICB8IChrQWRqdXN0ZWRDbGlwW2IyXSA+PiAzKTsKKworICAgICAgICAgICAgZHN0X3B0clt4IC8gMl0gPSAocmdiMiA8PCAxNikgfCByZ2IxOworICAgICAgICB9CisKKyAgICAgICAgc3JjX3kgKz0gbURlY29kZWRXaWR0aDsKKworICAgICAgICBpZiAoeSAmIDEpIHsKKyNpZiBRQ09NX1lVVgorICAgICAgICAgICAgc3JjX3UgKz0gbURlY29kZWRXaWR0aDsKKyNlbHNlCisgICAgICAgICAgICBzcmNfdSArPSBtRGVjb2RlZFdpZHRoIC8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ICAgIChtYXBwaW5nX2RhdGFfdCAqKW1PdmVybGF5LT5nZXRCdWZmZXJBZGRyZXNzKCh2b2lkICopaSk7CisKKyAgICAgICAgbU92ZXJsYXlBZGRyZXNzZXMucHVzaChkYXRhLT5wdHIpOworICAgIH0KK30KKworVElIYXJkd2FyZVJlbmRlcmVyOjp+VElIYXJkd2FyZVJlbmRlcmVyKCkgeworICAgIGlmIChtT3ZlcmxheS5nZXQoKSAhPSBOVUxMKSB7CisgICAgICAgIG1PdmVybGF5LT5kZXN0cm95KCk7CisgICAgICAgIG1PdmVybGF5LmNsZWFyKCk7CisKKyAgICAgICAgLy8gWFhYIGFwcGFyZW50bHkgZGVzdHJveWluZyBhbiBvdmVybGF5IGlzIGFuIGFzeW5jaHJvbm91cyBwcm9jZXNzLi4uCisgICAgICAgIHNsZWVwKDEpOworICAgIH0KK30KKwordm9pZCBUSUhhcmR3YXJlUmVuZGVyZXI6OnJlbmRlcigKKyAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwgc2l6ZV90IHNpemUsIHZvaWQgKnBsYXRmb3JtUHJpdmF0ZSkgeworICAgIC8vIENIRUNLX0VRKHNpemUsIG1GcmFtZVNpemUpOworCisgICAgaWYgKG1PdmVybGF5LmdldCgpID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworI2lmIDAKKyAgICBzaXplX3QgaSA9IDA7CisgICAgZm9yICg7IGkgPCBtT3ZlcmxheUFkZHJlc3Nlcy5zaXplKCk7ICsraSkgeworICAgICAgICBpZiAobU92ZXJsYXlBZGRyZXNzZXNbaV0gPT0gZGF0YSkgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAobUlzRmlyc3RGcmFtZSkgeworICAgICAgICAgICAgTE9HSSgib3ZlcmxheSBidWZmZXIgIyVkOiAlcCIsIGksIG1PdmVybGF5QWRkcmVzc2VzW2ldKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChpID09IG1PdmV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ICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIHNldFVwKCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICBzdXBlci5zZXRVcCgpOworICAgICAgbVBsYXllciA9IG5ldyBNZWRpYVBsYXllcigpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIHRlYXJEb3duKCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgIG1QbGF5ZXIucmVsZWFzZSgpOworICAgICAgICBzdXBlci50ZWFyRG93bigpOworICAgIH0KKworICAgIC8vIEdlbmVyYXRlIGEgcmFuZG9tIG51bWJlciwgc2VuZHMgaXQgdG8gdGhlIHBpbmcgdGVzdCBwbGF5ZXIuCisgICAgQE1lZGl1bVRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0UGluZygpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBtUGxheWVyLnNldERhdGFTb3VyY2UoInRlc3Q6aW52b2tlX21vY2tfbWVkaWFfcGxheWVyLnNvP3VybD1waW5nIik7CisKKyAgICAgICAgUGFyY2VsIHJlcXVlc3QgPSBtUGxheWVyLm5ld1JlcXVlc3QoKTsKKyAgICAgICAgUGFyY2VsIHJlcGx5ID0gUGFyY2VsLm9idGFpbigpOworCisgICAgICAgIGludCB2YWwgPSBybmQubmV4dEludCgpOworICAgICAgICByZXF1ZXN0LndyaXRlSW50KHZhbCk7CisgICAgICAgIGFzc2VydEVxdWFscygwLCBtUGxheWVyLmludm9rZShyZXF1ZXN0LCByZXBseSkpOworICAgICAgICBhc3NlcnRFcXVhbHModmFsLCByZXBseS5yZWFkSW50KCkpOworICAgfQorfQpkaWZmIC0tZ2l0IGEvbWVkaWEvdGVzdHMvTWVkaWFGcmFtZXdvcmtUZXN0L3NyYy9jb20vYW5kcm9pZC9tZWRpYWZyYW1ld29ya3Rlc3QvcGVyZm9ybWFuY2UvTWVkaWFQbGF5ZXJQZXJmb3JtYW5j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bnQoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgd3JpdGVJbnRSZWNvcmQoTWV0YWRhdGEuQ0RfVFJBQ0tfTlVNLCAxKTsKKyAgICAgICAgYWRqdXN0U2l6ZSgpOworICAgICAgICBhc3NlcnRQYXJzZSgpOworCisgICAgICAgIGFzc2VydEVxdWFscygxLCBtTWV0YWRhdGEuZ2V0SW50KE1ldGFkYXRhLkNEX1RSQUNLX05VTSkpOworICAgIH0KKworICAgIC8vIGdldEJvb2xlYW4KKyAgICBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdEdldEJvb2xlYW4oKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgd3JpdGVCb29sZWFuUmVjb3JkKE1ldGFkYXRhLkRSTV9DUklQUExFRCwgdHJ1ZSk7CisgICAgICAgIGFkanVzdFNpemUoKTsKKyAgICAgICAgYXNzZXJ0UGFyc2UoKTsKKworICAgICAgICBhc3NlcnRFcXVhbHModHJ1ZSwgbU1ldGFkYXRhLmdldEJvb2xlYW4oTWV0YWRhdGEuRFJNX0NSSVBQTEVEKSk7CisgICAgfQorCisgICAgLy8gZ2V0TG9uZworICAgIEBTbWFsbFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0R2V0TG9uZygpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICB3cml0ZUxvbmdSZWNvcmQoTWV0YWRhdGEuRFVSQVRJT04sIDFMKTsKKyAgICAgICAgYWRqdXN0U2l6ZSgpOworICAgICAgICBhc3NlcnRQYXJzZSgpOworCisgICAgICAgIGFzc2VydEVxdWFscygxTCwgbU1ldGFkYXRhLmdldExvbmcoTWV0YWRhdGEuRFVSQVRJT04pKTsKKyAgICB9CisKKyAgICAvLyBnZXREb3VibGUKKyAgICBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdEdldERvdWJsZSgpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICB3cml0ZURvdWJsZVJlY29yZChN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Bjb3VudCA9IDAKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBieXRlIFBIT05FQk9PS1NJWkVfVEFHSUQgPSAweDA4OworCisgICAgICAgIC8vIG9ubHkgdXNlZCBpbiAibWNoIiBpbiByZXNwb25zZQorICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGJ5dGUgTkVXTUlTU0VEQ0FMTFNfVEFHSUQgPSAweDA5OworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgVFJJUExFVF9WQUxVRSB7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgT1JERVIgeworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBieXRlIE9SREVSX0JZX0lOREVYID0gMHgwMDsKKworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBieXRlIE9SREVSX0JZX0FMUEhBTlVNRVJJQyA9IDB4MDE7CisKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgYnl0ZSBPUkRFUl9CWV9QSE9ORVRJQyA9IDB4MDI7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgc3RhdGljIGNsYXNzIFNFQVJDSEFUVFJJQlVURSB7CisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGJ5dGUgU0VBUkNIX0JZX05BTUUgPSAweDAwOworCisgICAgICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGJ5dGUgU0VBUkNIX0JZX05VTUJFUiA9IDB4MDE7CisKKyAgICAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgYnl0ZSBTRUFSQ0hfQllfU09VTkQgPSAweDAyOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBGT1JNQVQgeworICAgICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBieXRlIFZDQVJEX1ZFUlNJT05fMjEgPSAweDAwOworCisgICAgICAgICAgICBwdWJsaWMgc3Rhd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7CisgICAgICAgIG1Qcml2YXRlT3V0cHV0ID0gbnVsbDsKKworICAgICAgICBtUmVwbHlIZWFkZXIgPSBuZXcgSGVhZGVyU2V0KCk7CisKKyAgICAgICAgbVJlcXVlc3RIZWFkZXIgPSBuZXcgSGVhZGVyU2V0KCk7CisKKyAgICAgICAgaW50W10gaGVhZGVyTGlzdCA9IGhlYWRlci5nZXRIZWFkZXJMaXN0KCk7CisKKyAgICAgICAgaWYgKGhlYWRlckxpc3QgIT0gbnVsbCkgeworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGhlYWRlckxpc3QubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICBtUmVxdWVzdEhlYWRlci5zZXRIZWFkZXIoaGVhZGVyTGlzdFtpXSwgaGVhZGVyLmdldEhlYWRlcihoZWFkZXJMaXN0W2ldKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoKGhlYWRlcikubUF1dGhDaGFsbCAhPSBudWxsKSB7CisgICAgICAgICAgICBtUmVxdWVzdEhlYWRlci5tQXV0aENoYWxsID0gbmV3IGJ5dGVbKGhlYWRlcikubUF1dGhDaGFsbC5sZW5ndGhdOworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weSgoaGVhZGVyKS5tQXV0aENoYWxsLCAwLCBtUmVxdWVzdEhlYWRlci5tQXV0aENoYWxsLCAwLAorICAgICAgICAgICAgICAgICAgICAoaGVhZGVyKS5tQXV0aENoYWxsLmxlbmd0aCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKGhlYWRlcikubUF1dGhSZXNwICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1SZXF1ZXN0SGVhZGVyLm1BdXRoUmVzcCA9IG5ldyBieXRlWyhoZWFkZXIpLm1BdXRoUmVzcC5sZW5ndGhdOworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weSgoaGVhZGVyKS5tQXV0aFJlc3AsIDAsIG1SZXF1ZXN0SGVhZGV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W5zcG9ydCBsYXllciBkdXJpbmcKKyAgICAgKiAgICAgICAgIHRoZSB0cmFuc2FjdGlvbjsgaWYgdGhpcyBtZXRob2QgaXMgY2FsbGVkIG9uIGEKKyAgICAgKiAgICAgICAgIDxjb2RlPkhlYWRlclNldDwvY29kZT4gb2JqZWN0IGNyZWF0ZWQgYnkgY2FsbGluZworICAgICAqICAgICAgICAgPGNvZGU+Y3JlYXRlSGVhZGVyU2V0PC9jb2RlPiBpbiBhIDxjb2RlPkNsaWVudFNlc3Npb248L2NvZGU+CisgICAgICogICAgICAgICBvYmplY3QKKyAgICAgKi8KKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRSZXNwb25zZUNvZGUoKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICAvL2F2b2lkIGR1cCB2YWxpZGF0ZUNvbm5lY3Rpb24KKyAgICAgICAgaWYgKChtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID09IC0xKQorICAgICAgICAgICAgICAgIHx8IChtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID09IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFKSkgeworICAgICAgICAgICAgdmFsaWRhdGVDb25uZWN0aW9uKCk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbVJlcGx5SGVhZGVyLnJlc3BvbnNlQ29kZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIG1ldGhvZCB3aWxsIGFsd2F5cyByZXR1cm4gPGNvZGU+bnVsbDwvY29kZT4KKyAgICAgKiBAcmV0dXJuIDxjb2RlPm51bGw8L2NvZGU+CisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRFbmNvZGluZygpIHsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgdHlwZSBvZiBjb250ZW50IHRoYXQgdGhlIHJlc291cmNlIGNvbm5lY3RlZCB0byBpcy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SB7CisgICAgICAgICAgICBMb25nIHRlbXAgPSAoTG9uZyltUmVwbHlIZWFkZXIuZ2V0SGVhZGVyKEhlYWRlclNldC5MRU5HVEgpOworCisgICAgICAgICAgICBpZiAodGVtcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdGVtcC5sb25nVmFsdWUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogT3BlbiBhbmQgcmV0dXJuIGFuIGlucHV0IHN0cmVhbSBmb3IgYSBjb25uZWN0aW9uLgorICAgICAqIEByZXR1cm4gYW4gaW5wdXQgc3RyZWFtCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBpZiBhbiBJL08gZXJyb3Igb2NjdXJzCisgICAgICovCisgICAgcHVibGljIElucHV0U3RyZWFtIG9wZW5JbnB1dFN0cmVhbSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgZW5zdXJlT3BlbigpOworCisgICAgICAgIGlmIChtUHJpdmF0ZUlucHV0T3BlbikKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigibm8gbW9yZSBpbnB1dCBzdHJlYW1zIGF2YWlsYWJsZSIpOworICAgICAgICBpZiAobUdldE9wZXJhdGlvbikgeworICAgICAgICAgICAgLy8gc2VuZCB0aGUgR0VUIHJlcXVlc3QgaGVyZQorICAgICAgICAgICAgdmFsaWRhdGVDb25uZWN0aW9uKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobVByaXZhdGVJbnB1dCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVByaXZhdGVJbnB1dCA9IG5ldyBQcml2YXRlSW5wdXRTdHJlYW0odGhpcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBtUHJpdmF0ZUlucHV0T3BlbiA9IHRydWU7CisKKyAgICAgICAgcmV0dXJuIG1Qcml2YXRlSW5wdXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogT3BlbiBhbmQgcmV0dXJuIGEgZGF0YSBpbnB1dCBzdHJlYW0gZm9yIGEgY29ubmVjdGlvbi4KKyAgICAgKiBAcmV0dXJuIGFuIGlucHV0IHN0cmVhbQorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gaWYgYW4gSS9PIGVycm9yIG9jY3VycworICAgICAqLworICAgIHB1YmxpYyBEYXRhSW5wdXRTdHJlYW0gb3BlbkRhdGFJbnB1dFN0cmVhbSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIHJldHVybiBuZXcgRGF0YUlucHV0U3RyZWFtKG9wZW5JbnB1dFN0cmVhbSgpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBPcGVuIGFuZCByZXR1cm4gYW4gb3V0cHV0IHN0cmVhbSBmb3IgYSBjb25uZWN0aW9uLgorICAgICAqIEByZXR1cm4gYW4gb3V0cHV0IHN0cmVhbQorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gaWYgYW4gSS9PIGVycm9yIG9jY3VycworICAgICAqLworICAgIHB1YmxpYyBPdXRwdXRTdHJlYW0gb3Blbk91dHB1dFN0cmVhbSgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgZW5zdXJlT3BlbigpOworICAgICAgICBlbnN1cmVOb3REb25lKCk7CisKKyAgICAgICAgaWYgKG1Qcml2YXRlT3V0cHV0T3BlbikKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigibm8gbW9yZSBvdXRwdXQgc3RyZWFtcyBhdmFpbGFibGUiKTsKKworICAgICAgICBpZiAobVByaXZhdGVPdXRwdXQgPT0gbnVsbCkgeworICAgICAgICAgICAgLy8g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5ndGgpID4gbU1heFBhY2tldFNpemUpIHsKKyAgICAgICAgICAgIGludCBlbmQgPSAwOworICAgICAgICAgICAgaW50IHN0YXJ0ID0gMDsKKyAgICAgICAgICAgIC8vIHNwbGl0ICYgc2VuZCB0aGUgaGVhZGVyQXJyYXkgaW4gbXVsdGlwbGUgcGFja2V0cy4KKworICAgICAgICAgICAgd2hpbGUgKGVuZCAhPSBoZWFkZXJBcnJheS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAvL3NwbGl0IHRoZSBoZWFkZXJBcnJheQorICAgICAgICAgICAgICAgIGVuZCA9IE9iZXhIZWxwZXIuZmluZEhlYWRlckVuZChoZWFkZXJBcnJheSwgc3RhcnQsIG1NYXhQYWNrZXRTaXplCisgICAgICAgICAgICAgICAgICAgICAgICAtIE9iZXhIZWxwZXIuQkFTRV9QQUNLRVRfTEVOR1RIKTsKKyAgICAgICAgICAgICAgICAvLyBjYW4gbm90IHNwbGl0IAorICAgICAgICAgICAgICAgIGlmIChlbmQgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgbU9wZXJhdGlvbkRvbmUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBhYm9ydCgpOworICAgICAgICAgICAgICAgICAgICBtRXhjZXB0aW9uTWVzc2FnZSA9ICJIZWFkZXIgbGFyZ2VyIHRoZW4gY2FuIGJlIHNlbnQgaW4gYSBwYWNrZXQiOworICAgICAgICAgICAgICAgICAgICBtSW5wdXRPcGVuID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Qcml2YXRlSW5wdXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVJbnB1dC5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Qcml2YXRlT3V0cHV0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlT3V0cHV0LmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJPQkVYIFBhY2tldCBleGNlZWRzIG1heCBwYWNrZXQgc2l6ZSIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGJ5dGVbXSBzZW5kSGVhZGVyID0gbmV3IGJ5dGVbZW5kIC0gc3RhcnRdOworICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZGVyQXJyYXksIHN0YXJ0LCBzZW5kSGVhZGVyLCAwLCBzZW5kSGVhZGVyLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgaWYgKCFtUGFyZW50LnNlbmRSZXF1ZXN0KG9wQ29kZSwgc2VuZEhlYWRlciwgbVJlcGx5SGVhZGVyLCBtUHJpdmF0ZUlucHV0KSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgIT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHN0YXJ0ID0gZW5kOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoYm9keUxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgb3V0LndyaXRlKGhlYWRlckFycmF5KTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChib2R5TGVuZ3RoID4gMCkgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIERldGVybWluZSBpZiB3ZSBjYW4gc2VuZCB0aGUgd2hvbGUgYm9keSBvciBqdXN0IHBhcnQgb2YKKyAgICAgICAgICAgICAqIHRoZSBib2R5LiAgUmVtZW1iZXIgdGhhdCB0aGVyZSBpcyB0aGUgMyBieXRlcyBmb3IgdGhlCisgICAgICAgICAgICAgKiByZXNwb25zZSBtZXNzYWdlIGFuZCAzIGJ5dGVzIGZvciB0aGUgaGVhZGVyIElEIGFuZCBsZW5ndGgKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKGJvZHlMZW5ndGggPiAobU1heFBhY2tldFNpemUgLSBoZWFkZXJBcnJheS5sZW5ndGggLSA2KSkgeworICAgICAgICAgICAgICAgIHJldHVyblZhbHVlID0gdHJ1ZTsKKworICAgICAgICAgICAgICAgIGJvZHlMZW5ndGggPSBtTWF4UGFja2V0U2l6ZSAtIGhlYWRlckFycmF5Lmxlbmd0aCAtIDY7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJ5dGVbXSBib2R5ID0gbVByaXZhdGVPdXRwdXQucmVhZEJ5dGVzKGJvZHlMZW5ndGgpOworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogU2luY2UgdGhpcyBpcyBhIHB1dCByZXF1ZXN0IGlmIHRoZSBmaW5hbCBiaXQgaXMgc2V0IG9yCisgICAgICAgICAgICAgKiB0aGUgb3V0cHV0IHN0cmVhbSBpcyBjbG9zZWQgd2UgbmVlZCB0byBzZW5kIHRoZSAweDQ5CisgICAgICAgICAgICAgKiAoRW5kIG9mIEJvZHkpIG90aGVyd2lzZSwgd2UgbmVlZCB0byBzZW5kIDB4NDggKEJvZHkpCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmICgobVByaXZhdGVPdXRwdXQuaXNDbG9zZWQoKSkgJiYgKCFyZXR1cm5WYWx1ZSkgJiYgKCFtRW5kT2ZCb2R5U2VudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKChvcENvZGUgJiAweDgwKSAhPSAwKSkgeworICAgICAgICAgICAgICAgIG91dC53cml0ZSgweDQ5KTsKKyAgICAgICAgICAgICAgICBtRW5kT2ZCb2R5U2VudCA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG91dC53cml0ZSgweDQ4KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYm9keUxlbmd0aCArPSAzOworICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKShib2R5TGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgIG91dC53cml0ZSgoYnl0ZSlib2R5TGVuZ3RoKTsKKworICAgICAgICAgICAgaWYgKGJvZHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dC53cml0ZShib2R5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChtUHJpdmF0ZU91dHB1dE9wZW4gJiYgYm9keUxlbmd0aCA8PSAwICYmICFtRW5kT2ZCb2R5U2VudCkgeworICAgICAgICAgICAgLy8gb25seSAweDgyIG9yIDB4ODMgY2FuIHNlbmQgMHg0OQorICAgICAgICAgICAgaWYgKChvcENvZGUgJiAweDgwKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKDB4NDgpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoMHg0OSk7CisgICAgICAgICAgICAgICAgbUVuZE9mQm9keVNlbnQgPSB0cnVlOworCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJvZHlMZW5ndGggPSAzOworICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKShib2R5TGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgIG91dC53cml0ZSgoYnl0ZSlib2R5TGVuZ3RoKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChvdXQuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgIGlmICghbVBhcmVudC5zZW5kUmVxdWVzdChvcENvZGUsIG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0UHJvY2Vzc2luZygpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgaWYgKG1Qcml2YXRlSW5wdXQgPT0gbnVsbCkgeworICAgICAgICAgICAgbVByaXZhdGVJbnB1dCA9IG5ldyBQcml2YXRlSW5wdXRTdHJlYW0odGhpcyk7CisgICAgICAgIH0KKyAgICAgICAgYm9vbGVhbiBtb3JlID0gdHJ1ZTsKKworICAgICAgICBpZiAobUdldE9wZXJhdGlvbikgeworICAgICAgICAgICAgaWYgKCFtT3BlcmF0aW9uRG9uZSkgeworICAgICAgICAgICAgICAgIG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRTsKKyAgICAgICAgICAgICAgICB3aGlsZSAoKG1vcmUpICYmIChtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID09IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFKSkgeworICAgICAgICAgICAgICAgICAgICBtb3JlID0gc2VuZFJlcXVlc3QoMHgwMyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgbVBhcmVudC5zZW5kUmVxdWVzdCgweDgzLCBudWxsLCBtUmVwbHlIZWFkZXIsIG1Qcml2YXRlSW5wdXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobVJlcGx5SGVhZGVyLnJlc3BvbnNlQ29kZSAhPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRSkgeworICAgICAgICAgICAgICAgICAgICBtT3BlcmF0aW9uRG9uZSA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworCisgICAgICAgICAgICBpZiAoIW1PcGVyYXRpb25Eb25lKSB7CisgICAgICAgICAgICAgICAgbVJlcGx5SGVhZGVyLnJlc3BvbnNlQ29kZSA9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFOworICAgICAgICAgICAgICAgIHdoaWxlICgobW9yZSkgJiYgKG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpKSB7CisgICAgICAgICAgICAgICAgICAgIG1vcmUgPSBzZW5kUmVxdWVzdCgweDAyKTsKKworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpIHsKKyAgICAgICAgICAgICAgICBtUGFyZW50LnNlbmRSZXF1ZXN0KDB4ODIsIG51bGwsIG1SZXBseUhlYWRlciwgbVByaXZhdGVJbnB1dCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlICE9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFKSB7CisgICAgICAgICAgICAgICAgbU9wZXJhdGlvbkRvbmUgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29udGludWVzIHRoZSBvcGVyYXRpb24gc2luY2UgdGhlcmUgaXMgbm8gZGF0YSB0byByZWFkLgorICAgICAqIEBwYXJhbSBzZW5kRW1wdHkgPGNvZGU+dHJ1ZTwvY29kZT4gaWYgdGhlIG9wZXJhdGlvbiBzaG91bGQgc2VuZCBhbiBlbXB0eQorICAgICAqICAgICAgICBwYWNrZXQgb3Igbm90IHNlbmQgYW55dGhpbmcgaWYgdGhlcmUgaXMgbm8gZGF0YSB0byBzZW5kCisgICAgICogQHBhcmFtIGluU3RyZWFtIDxjb2RlPnRydWU8L2NvZGU+IGlmIHRoZSBzdHJlYW0gaXMgaW5wdXQgc3RyZWFtIG9yIGlzCisgICAgICogICAgICAgIG91dHB1dCBzdHJlYW0KKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIGlmIGFuIElPIGVycm9yIG9jY3VycworICAgICAqLworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBjb250aW51ZU9wZXJhdGlvbihib29sZWFuIHNlbmRFbXB0eSwgYm9vbGVhbiBpblN0cmVhbSkKKyAgICAgICAgICAgIHRocm93cyBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgaWYgKG1HZXRPcGVyYXRpb24pIHsKKyAgICAgICAgICAgIGlmICgoaW5TdHJlYW0pICYmICghbU9wZXJhdGlvbkRvbmUpKSB7CisgICAgICAgICAgICAgICAgLy8gdG8gZGVhbCB3aXRoIGlucHV0c3RyZWFtIGluIGdldCBvcGVyYXRpb24KKyAgICAgICAgICAgICAgICBtUGFyZW50LnNlbmRSZXF1ZXN0KDB4ODMsIG51bGwsIG1SZXBseUhlYWRlciwgbVByaXZhdGVJbnB1dCk7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICogRGV0ZXJtaW5lIGlmIHRoYXQgd2FzIG5vdCB0aGUgbGFzdCBwYWNrZXQgaW4gdGhlIG9wZXJhdGlvbgorICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAobVJlcGx5SGVhZGVyLnJlc3BvbnNlQ29kZSAhPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRSkgeworICAgICAgICAgICAgICAgICAgICBtT3BlcmF0aW9uRG9uZSA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoKCFpblN0cmVhbSkgJiYgKCFtT3BlcmF0aW9uRG9uZSkpIHsKKyAgICAgICAgICAgICAgICAvLyB0byBkZWFsIHdpdGggb3V0cHV0c3RyZWFtIGluIGdldCBvcGVyYXRpb24KKworICAgICAgICAgICAgICAgIGlmIChtUHJpdmF0ZUlucHV0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVJbnB1dCA9IG5ldyBQcml2YXRlSW5wdXRTdHJlYW0odGhpcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNlbmRSZXF1ZXN0KDB4MDMpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworCisgICAgICAgICAgICB9IGVsc2UgaWYgKG1PcGVyYXRpb25Eb25lKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoKCFpblN0cmVhbSkgJiYgKCFtT3BlcmF0aW9uRG9uZSkpIHsKKyAgICAgICAgICAgICAgICAvLyB0byBkZWFsIHdpdGggb3V0cHV0c3RyZWFtIGluIHB1dCBvcGVyYXRpb24KKyAgICAgICAgICAgICAgICBpZiAobVJlcGx5SGVhZGVyLnJlc3BvbnNlQ29kZSA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICBtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNlbmRSZXF1ZXN0KDB4MDIpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmICgoaW5TdHJlYW0pICYmICghbU9wZXJhdGlvbkRvbmUpKSB7CisgICAgICAgICAgICAgICAgLy8gSG93IHRvIGRlYWwgd2l0aCBpbnB1dHN0cmVhbSAgaW4gcHV0IG9wZXJhdGlvbiA/CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworCisgICAgICAgICAgICB9IGVsc2UgaWYgKG1PcGVyYXRpb25Eb25lKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCB3aGVuIHRoZSBvdXRwdXQgb3IgaW5wdXQgc3RyZWFtIGlzIGNsb3NlZC4KKyAgICAgKiBAcGFyYW0gaW5TdHJlYW0gPGNvZGU+dHJ1ZTwvY29kZT4gaWYgdGhlIGlucHV0IHN0cmVhbSBpcyBjbG9zZWQ7CisgICAgICogICAgICAgIDxjb2RlPmZhbHNlPC9jb2RlPiBpZiB0aGUgb3V0cHV0IHN0cmVhbSBpcyBjbG9zZWQKKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIGlmIGFuIElPIGVycm9yIG9jY3VycworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHN0cmVhbUNsb3NlZChib29sZWFuIGluU3RyZWFtKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpZiAoIW1HZXRPcGVyYXRpb24pIHsKKyAgICAgICAgICAgIGlmICgoIWluU3RyZWFtKSAmJiAoIW1PcGVyYXRpb25Eb25lKSkgeworICAgICAgICAgICAgICAgIC8vIHRvIGRlYWwgd2l0aCBvdXRwdXRzdHJlYW0gaW4gcHV0IG9wZXJhdGlvbgorCisgICAgICAgICAgICAgICAgYm9vbGVhbiBtb3JlID0gdHJ1ZTsKKworICAgICAgICAgICAgICAgIGlmICgobVByaXZhdGVPdXRwdXQgIT0gbnVsbCkgJiYgKG1Qcml2YXRlT3V0cHV0LnNpemUoKSA8PSAwKSkgeworICAgICAgICAgICAgICAgICAgICBieXRlW10gaGVhZGVyQXJyYXkgPSBPYmV4SGVscGVyLmNyZWF0ZUhlYWRlcihtUmVxdWVzdEhlYWRlciwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBpZiAoaGVhZGVyQXJyYXkubGVuZ3RoIDw9IDApCisgICAgICAgICAgICAgICAgICAgICAgICBtb3JlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIElmIGhhdmUgbm90IHNlbnQgYW55IGRhdGEgc28gc2VuZCAgYWxsIG5vdworICAgICAgICAgICAgICAgIGlmIChtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB3aGlsZSAoKG1vcmUpICYmIChtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID09IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFKSkgeworICAgICAgICAgICAgICAgICAgICBtb3JlID0gc2VuZFJlcXVlc3QoMHgwMik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBBY2NvcmRpbmcgdG8gdGhlIElyT0JFWCBzcGVjaWZpY2F0aW9uLCBhZnRlciB0aGUgZmluYWwgcHV0LCB5b3UKKyAgICAgICAgICAgICAgICAgKiBvbmx5IGhhdmUgYSBzaW5nbGUgcmVwbHkgdG8gc2VuZC4gIHNvIHdlIGRvbid0IG5lZWQgdGhlIHdoaWxlCisgICAgICAgICAgICAgICAgICogbG9vcC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICB3aGlsZSAobVJlcGx5SGVhZGVyLnJlc3BvbnNlQ29kZSA9PSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRSkgeworCisgICAgICAgICAgICAgICAgICAgIHNlbmRSZXF1ZXN0KDB4ODIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtT3BlcmF0aW9uRG9uZSA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKChpblN0cmVhbSkgJiYgKG1PcGVyYXRpb25Eb25lKSkgeworICAgICAgICAgICAgICAgIC8vIGhvdyB0byBkZWFsIHdpdGggaW5wdXQgc3RyZWFtIGluIHB1dCBzdHJlYW0gPworICAgICAgICAgICAgICAgIG1PcGVyYXRpb25Eb25lID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmICgoaW5TdHJlYW0pICYmICghbU9wZXJhdGlvbkRvbmUpKSB7CisKKyAgICAgICAgICAgICAgICAvLyB0byBkZWFsIHdpdGggaW5wdXRzdHJlYW0gaW4gZ2V0IG9wZXJhdGlvbgorICAgICAgICAgICAgICAgIC8vIEhhdmUgbm90IHNlbnQgYW55IGRhdGEgc28gc2VuZCBpdCBhbGwgbm93CisKKyAgICAgICAgICAgICAgICBpZiAobVJlcGx5SGVhZGVyLnJlc3BvbnNlQ29kZSA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICBtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgd2hpbGUgKG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFzZW5kUmVxdWVzdCgweDgzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgd2hpbGUgKG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgbVBhcmVudC5zZW5kUmVxdWVzdCgweDgzLCBudWxsLCBtUmVwbHlIZWFkZXIsIG1Qcml2YXRlSW5wdXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtT3BlcmF0aW9uRG9uZSA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKCghaW5TdHJlYW0pICYmICghbU9wZXJhdGlvbkRvbmUpKSB7CisgICAgICAgICAgICAgICAgLy8gdG8gZGVhbCB3aXRoIG91dHB1dHN0cmVhbSBpbiBnZXQgb3BlcmF0aW9uCisgICAgICAgICAgICAgICAgLy8gcGFydCBvZiB0aGUgZGF0YSBtYXkgaGF2ZSBiZWVuIHNlbnQgaW4gY29udGludWVPcGVyYXRpb24uCisKKyAgICAgICAgICAgICAgICBib29sZWFuIG1vcmUgPSB0cnVlOworCisgICAgICAgICAgICAgICAgaWYgKChtUHJpdmF0ZU91dHB1dCAhPSBudWxsKSAmJiAobVByaXZhdGVPdXRwdXQuc2l6ZSgpIDw9IDApKSB7CisgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBoZWFkZXJBcnJheSA9IE9iZXhIZWxwZXIuY3JlYXRlSGVhZGVyKG1SZXF1ZXN0SGVhZGVyLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChoZWFkZXJBcnJheS5sZW5ndGggPD0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vcmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobVByaXZhdGVJbnB1dCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSW5wdXQgPSBuZXcgUHJpdmF0ZUlucHV0U3RyZWFtKHRoaXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKG1Qcml2YXRlT3V0cHV0ICE9IG51bGwpICYmIChtUHJpdmF0ZU91dHB1dC5zaXplKCkgPD0gMCkpCisgICAgICAgICAgICAgICAgICAgIG1vcmUgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRTsKKyAgICAgICAgICAgICAgICB3aGlsZSAoKG1vcmUpICYmIChtUmVwbHlIZWFkZXIucmVzcG9uc2VDb2RlID09IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFKSkgeworICAgICAgICAgICAgICAgICAgICBtb3JlID0gc2VuZFJlcXVlc3QoMHgwMyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNlbmRSZXF1ZXN0KDB4ODMpOworICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgIHBhcmVudC5zZW5kUmVxdWVzdCgweDgzLCBudWxsLCByZXBseUhlYWRlcnMsIHByaXZhdGVJbnB1dCk7CisgICAgICAgICAgICAgICAgaWYgKG1SZXBseUhlYWRlci5yZXNwb25zZUNvZGUgIT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpIHsKKyAgICAgICAgICAgICAgICAgICAgbU9wZXJhdGlvbkRvbmUgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL29iZXgvamF2YXgvb2JleC9DbGllbnRTZXNzaW9uLmphdmEgYi9vYmV4L2phdmF4L29iZXgvQ2xpZW50U2Vzc2lvbi5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjA5MzUzODMKLS0tIC9kZXYvbnVsbAorKysgYi9vYmV4L2phdmF4L29iZXgvQ2xpZW50U2Vzc2lvbi5qYXZhCkBAIC0wLDAgKzEsNTIzIEBACisvKgorICogQ29weXJpZ2h0IChjKSAyMDA4LTIwMDksIE1vdG9yb2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cHV0U3RyZWFtKCk7CisgICAgICAgIG1PcGVuID0gdHJ1ZTsKKyAgICAgICAgbVJlcXVlc3RBY3RpdmUgPSBmYWxzZTsKKyAgICB9CisKKyAgICBwdWJsaWMgSGVhZGVyU2V0IGNvbm5lY3QoZmluYWwgSGVhZGVyU2V0IGhlYWRlcikgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgZW5zdXJlT3BlbigpOworICAgICAgICBpZiAobU9iZXhDb25uZWN0ZWQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiQWxyZWFkeSBjb25uZWN0ZWQgdG8gc2VydmVyIik7CisgICAgICAgIH0KKyAgICAgICAgc2V0UmVxdWVzdEFjdGl2ZSgpOworCisgICAgICAgIGludCB0b3RhbExlbmd0aCA9IDQ7CisgICAgICAgIGJ5dGVbXSBoZWFkID0gbnVsbDsKKworICAgICAgICAvLyBEZXRlcm1pbmUgdGhlIGhlYWRlciBieXRlIGFycmF5CisgICAgICAgIGlmIChoZWFkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKGhlYWRlci5ub25jZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUNoYWxsZW5nZURpZ2VzdCA9IG5ldyBieXRlWzE2XTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRlci5ub25jZSwgMCwgbUNoYWxsZW5nZURpZ2VzdCwgMCwgMTYpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaGVhZCA9IE9iZXhIZWxwZXIuY3JlYXRlSGVhZGVyKGhlYWRlciwgZmFsc2UpOworICAgICAgICAgICAgdG90YWxMZW5ndGggKz0gaGVhZC5sZW5ndGg7CisgICAgICAgIH0KKyAgICAgICAgLyoKKyAgICAgICAgKiBXcml0ZSB0aGUgT0JFWCBDT05ORUNUIHBhY2tldCB0byB0aGUgc2VydmVyLgorICAgICAgICAqIEJ5dGUgMDogMHg4MAorICAgICAgICAqIEJ5d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VuZ3RoICsgMykgPiBPYmV4SGVscGVyLk1BWF9QQUNLRVRfU0laRV9JTlQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiUGFja2V0IHNpemUgZXhjZWVkcyBtYXggcGFja2V0IHNpemUiKTsKKyAgICAgICAgfQorCisgICAgICAgIEhlYWRlclNldCByZXR1cm5IZWFkZXJTZXQgPSBuZXcgSGVhZGVyU2V0KCk7CisgICAgICAgIHNlbmRSZXF1ZXN0KE9iZXhIZWxwZXIuT0JFWF9PUENPREVfQ09OTkVDVCwgcmVxdWVzdFBhY2tldCwgcmV0dXJuSGVhZGVyU2V0LCBudWxsKTsKKworICAgICAgICAvKgorICAgICAgICAqIFJlYWQgdGhlIHJlc3BvbnNlIGZyb20gdGhlIE9CRVggc2VydmVyLgorICAgICAgICAqIEJ5dGUgMDogUmVzcG9uc2UgQ29kZSAoSWYgc3VjY2Vzc2Z1bCB0aGVuIE9CRVhfSFRUUF9PSykKKyAgICAgICAgKiBCeXRlIDEmMjogUGFja2V0IExlbmd0aAorICAgICAgICAqIEJ5dGUgMzogT0JFWCBWZXJzaW9uIE51bWJlcgorICAgICAgICAqIEJ5dGUgNDogRmxhZ3MzCisgICAgICAgICogQnl0ZSA1JjY6IE1heCBPQkVYIHBhY2tldCBMZW5ndGgKKyAgICAgICAgKiBCeXRlIDcgdG8gbjogT3B0aW9uYWwgSGVhZGVyU2V0CisgICAgICAgICovCisgICAgICAgIGlmIChyZXR1cm5IZWFkZXJTZXQucmVzcG9uc2VDb2RlID09IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX09LKSB7CisgICAgICAgICAgICBtT2JleENvbm5lY3RlZCA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgc2V0UmVxdWVzdEluYWN0aXZlKCk7CisKKyAgICAgICAgcmV0dXJuIHJldHVybkhlYWRlclNldDsKKyAgICB9CisKKyAgICBwdWJsaWMgT3BlcmF0aW9uIGdldChIZWFkZXJTZXQgaGVhZGVyKSB0aHJvd3MgSU9FeGNlcHRpb24geworCisgICAgICAgIGlmICghbU9iZXhDb25uZWN0ZWQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiTm90IGNvbm5lY3RlZCB0byB0aGUgc2VydmVyIik7CisgICAgICAgIH0KKyAgICAgICAgc2V0UmVxdWVzdEFjdGl2ZSgpOworCisgICAgICAgIGVuc3VyZU9wZW4oKTsKKworICAgICAgICBIZWFkZXJTZXQgaGVhZDsKKyAgICAgICAgaWYgKGhlYWRlciA9PSBudWxsKSB7CisgICAgICAgICAgICBoZWFkID0gbmV3IEhlYWRlclNldCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaGVhZCA9IGhlYWRlcjsKKyAgICAgICAgICAgIGlmIChoZWFkLm5vbmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQ2hhbGxlbmdlRGlnZXN0ID0gbmV3IGJ5dGVbMTZdOworICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZC5ub25jZSwgMCwgbUNoYWxsZW5nZURpZ2VzdCwgMCwgMTYpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vIEFkZCB0aGUgY29ubmVjdGlvbiBJRCBpZiBvbmUgZXhpc3RzCisgICAgICAgIGlmIChtQ29ubmVjdGlvbklkICE9IG51bGwpIHsKKyAgICAgICAgICAgIGhlYWQubUNvbm5lY3Rpb25JRCA9IG5ldyBieXRlWzRdOworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtQ29ubmVjdGlvbklkLCAwLCBoZWFkLm1Db25uZWN0aW9uSUQsIDAsIDQpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG5ldyBDbGllbnRPcGVyYXRpb24obWF4UGFja2V0U2l6ZSwgdGhpcywgaGVhZCwgdHJ1ZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogMHhDQiBDb25uZWN0aW9uIElkIGFuIGlkZW50aWZpZXIgdXNlZCBmb3IgT0JFWCBjb25uZWN0aW9uIG11bHRpcGxleGluZworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldENvbm5lY3Rpb25JRChsb25nIGlkKSB7CisgICAgICAgIGlmICgoaWQgPCAwKSB8fCAoaWQgPiAweEZGRkZGRkZGTCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNvbm5lY3Rpb24gSUQgaXMgbm90IGluIGEgdmFsaWQgcmFuZ2UiKTsKKyAgICAgICAgfQorICAgICAgICBtQ29ubmVjdGlvbklkID0gT2JleEhlbHBlci5jb252ZXJ0VG9CeXRlQXJyYXkoaWQpOworICAgIH0KKworICAgIHB1YmxpYyBIZWFkZXJTZXQgZGVsZXRlKEhlYWRlclNldCBoZWFkZXIpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgT3BlcmF0aW9uIG9wID0gcHV0KGhlYWRlcik7CisgICAgICAgIG9wLmdldFJlc3BvbnNlQ29kZSgpOworICAgICAgICBIZWFkZXJTZXQgcmV0dXJuVmFsdWUgPSBvcC5nZXRSZWNlaXZlZEhlYWRlcigpOworICAgICAgICBvcC5jbG9zZSgpOworCisgICAgICAgIHJldHVybiByZXR1cm5WYWx1ZTsKKyAgICB9CisKKyAgICBwdWJsaWMgSGVhZGVyU2V0IGRpc2Nvbm5lY3QoSGVhZGVyU2V0IGhlYWRlcikgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKCFtT2JleENvbm5lY3RlZCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJOb3QgY29ubmVjdGVkIHRvIHRoZSBzZXJ2ZXIiKTsKKyAgICAgICAgfQorICAgICAgICBzZXRSZXF1ZXN0QWN0aXZlKCk7CisKKyAgICAgICAgZW5zdXJlT3BlbigpOworICAgICAgICAvLyBEZXRlcm1pbmUgdGhlIGhlYWRlciBieXRlIGFycmF5CisgICAgICAgIGJ5dGVbXSBoZWFkID0gbnVsbDsKKyAgICAgICAgaWYgKGhlYWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAoaGVhZGVyLm5vbmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQ2hhbGxlbmdlRGlnZXN0ID0gbmV3IGJ5dGVbMTZdOworICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZGVyLm5vbmNlLCAwLCBtQ2hhbGxlbmdlRGlnZXN0LCAwLCAxNik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBBZGQgdGhlIGNvbm5lY3Rpb24gSUQgaWYgb25lIGV4aXN0cworICAgICAgICAgICAgaWYgKG1Db25uZWN0aW9uSWQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGhlYWRlci5tQ29ubmVjdGlvbklEID0gbmV3IGJ5dGVbNF07CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtQ29ubmVjdGlvbklkLCAwLCBoZWFkZXIubUNvbm5lY3Rpb25JRCwgMCwgNCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBoZWFkID0gT2JleEhlbHBlci5jcmVhdGVIZWFkZXIoaGVhZGVyLCBmYWxzZSk7CisKKyAgICAgICAgICAgIGlmICgoaGVhZC5sZW5ndGggKyAzKSA+IG1heFBhY2tldFNpemUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oIlBhY2tldCBzaXplIGV4Y2VlZHMgbWF4IHBhY2tldCBzaXplIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBBZGQgdGhlIGNvbm5lY3Rpb24gSUQgaWYgb25lIGV4aXN0cworICAgICAgICAgICAgaWYgKG1Db25uZWN0aW9uSWQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGhlYWQgPSBuZXcgYnl0ZVs1XTsKKyAgICAgICAgICAgICAgICBoZWFkWzBdID0gKGJ5dGUpSGVhZGVyU2V0LkNPTk5FQ1RJT05fSUQ7CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtQ29ubmVjdGlvbklkLCAwLCBoZWFkLCAxLCA0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEhlYWRlclNldCByZXR1cm5IZWFkZXJTZXQgPSBuZXcgSGVhZGVyU2V0KCk7CisgICAgICAgIHNlbmRSZXF1ZXN0KE9iZXhIZWxwZXIuT0JFWF9PUENPREVfRElTQ09OTkVDVCwgaGVhZCwgcmV0dXJuSGVhZGVyU2V0LCBudWxsKTsKKworICAgICAgICAvKgorICAgICAgICAgKiBBbiBPQkVYIERJU0NPTk5FQ1QgcmVwbHkgZnJvbSB0aGUgc2VydmVyOgorICAgICAgICAgKiBCeXRlIDE6IFJlc3BvbnNlIGNvZGUKKyAgICAgICAgICogQnl0ZXMgMiAmIDM6IHBhY2tldCBzaXplCisgICAgICAgICAqIEJ5dGVzIDQgJiB1cDogaGVhZGVycworICAgICAgICAgKi8KKworICAgICAgICAvKiByZXNwb25zZSBjb2RlICwgYW5kIGhlYWRlciBhcmUgaWdub3JlZAorICAgICAgICAgKiAqLworCisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgbU9iZXhDb25uZWN0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHNldFJlcXVlc3RJbmFjdGl2ZSgpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHJldHVybkhlYWRlclNldDsKKyAgICB9CisKKyAgICBwdWJsaWMgbG9uZyBnZXRDb25uZWN0aW9uSUQoKSB7CisKKyAgICAgICAgaWYgKG1Db25uZWN0aW9uSWQgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9CisgICAgICAgIHJldHVybiBPYmV4SGVscGVyLmNvbnZlcnRUb0xvbmcobUNvbm5lY3Rpb25JZCk7CisgICAgfQorCisgICAgcHVibGljIE9wZXJhdGlvbiBwdXQoSGVhZGVyU2V0IGhlYWRlcikgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKCFtT2JleENvbm5lY3RlZCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJOb3QgY29ubmVjdGVkIHRvIHRoZSBzZXJ2ZXIiKTsKKyAgICAgICAgfQorICAgICAgICBzZXRSZXF1ZXN0QWN0aXZlKCk7CisKKyAgICAgICAgZW5zdXJlT3BlbigpOworICAgICAgICBIZWFkZXJTZXQgaGVhZDsKKyAgICAgICAgaWYgKGhlYWRlciA9PSBudWxsKSB7CisgICAgICAgICAgICBoZWFkID0gbmV3IEhlYWRlclNldCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaGVhZCA9IGhlYWRlcjsKKyAgICAgICAgICAgIC8vIHdoZW4gYXV0aCBpcyBpbml0aWF0ZWQgYnkgY2xpZW50ICxzYXZlIHRoZSBkaWdlc3QKKyAgICAgICAgICAgIGlmIChoZWFkLm5vbmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQ2hhbGxlbmdlRGlnZXN0ID0gbmV3IGJ5dGVbMTZdOworICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZC5ub25jZSwgMCwgbUNoYWxsZW5nZURpZ2VzdCwgMCwgMTYpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gQWRkIHRoZSBjb25uZWN0aW9uIElEIGlmIG9uZSBleGlzdHMKKyAgICAgICAgaWYgKG1Db25uZWN0aW9uSWQgIT0gbnVsbCkgeworCisgICAgICAgICAgICBoZWFkLm1Db25uZWN0aW9uSUQgPSBuZXcgYnl0ZVs0XTsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkobUNvbm5lY3Rpb25JZCwgMCwgaGVhZC5tQ29ubmVjdGlvbklELCAwLCA0KTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBuZXcgQ2xpZW50T3BlcmF0aW9uKG1heFBhY2tldFNpemUsIHRoaXMsIGhlYWQsIGZhbHNlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRBdXRoZW50aWNhdG9yKEF1dGhlbnRpY2F0b3IgYXV0aCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaWYgKGF1dGggPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJBdXRoZW50aWNhdG9yIG1heSBub3QgYmUgbnVsbCIpOworICAgICAgICB9CisgICAgICAgIG1BdXRoZW50aWNhdG9yID0gYXV0aDsKKyAgICB9CisKKyAgICBwdWJsaWMgSGVhZGVyU2V0IHNldFBhdGgoSGVhZGVyU2V0IGhlYWRlciwgYm9vbGVhbiBiYWNrdXAsIGJvb2xlYW4gY3JlYXRlKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpZiAoIW1PYmV4Q29ubmVjdGVkKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oIk5vdCBjb25uZWN0ZWQgdG8gdGhlIHNlcnZlciIpOworICAgICAgICB9CisgICAgICAgIHNldFJlcXVlc3RBY3RpdmUoKTsKKyAgICAgICAgZW5zdXJlT3BlbigpOworCisgICAgICAgIGludCB0b3RhbExlbmd0aCA9IDI7CisgICAgICAgIGJ5dGVbXSBoZWFkID0gbnVsbDsKKyAgICAgICAgSGVhZGVyU2V0IGhlYWRzZXQ7CisgICAgICAgIGlmIChoZWFkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgaGVhZHNldCA9IG5ldyBIZWFkZXJTZXQoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGhlYWRzZXQgPSBoZWFkZXI7CisgICAgICAgICAgICBpZiAoaGVhZHNldC5ub25jZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUNoYWxsZW5nZURpZ2VzdCA9IG5ldyBieXRlWzE2XTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRzZXQubm9uY2UsIDAsIG1DaGFsbGVuZ2VEaWdlc3QsIDAsIDE2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIHdoZW4gYXV0aCBpcyBpbml0aWF0ZWQgYnkgY2xpZW50ICxzYXZlIHRoZSBkaWdlc3QKKyAgICAgICAgaWYgKGhlYWRzZXQubm9uY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgbUNoYWxsZW5nZURpZ2VzdCA9IG5ldyBieXRlWzE2XTsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZHNldC5ub25jZSwgMCwgbUNoYWxsZW5nZURpZ2VzdCwgMCwgMTYpOworICAgICAgICB9CisKKyAgICAgICAgLy8gQWRkIHRoZSBjb25uZWN0aW9uIElEIGlmIG9uZSBleGlzdHMKKyAgICAgICAgaWYgKG1Db25uZWN0aW9uSWQgIT0gbnVsbCkgeworICAgICAgICAgICAgaGVhZHNldC5tQ29ubmVjdGlvbklEID0gbmV3IGJ5dGVbNF07CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1Db25uZWN0aW9uSWQsIDAsIGhlYWRzZXQubUNvbm5lY3Rpb25JRCwgMCwgNCk7CisgICAgICAgIH0KKworICAgICAgICBoZWFkID0gT2JleEhlbHBlci5jcmVhdGVIZWFkZXIoaGVhZHNldCwgZmFsc2UpOworICAgICAgICB0b3RhbExlbmd0aCArPSBoZWFkLmxlbmd0aDsKKworICAgICAgICBpZiAodG90YWxMZW5ndGggPiBtYXhQYWNrZXRTaXplKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oIlBhY2tldCBzaXplIGV4Y2VlZHMgbWF4IHBhY2tldCBzaXplIik7CisgICAgICAgIH0KKworICAgICAgICBpbnQgZmxhZ3MgPSAwOworICAgICAgICAvKgorICAgICAgICAgKiBUaGUgYmFja3VwIGZsYWcgYml0IGlzIGJpdCAwIHNvIGlmIHdlIGFkZCAxLCB0aGlzIHdpbGwgc2V0IHRoYXQgYml0CisgICAgICAgICAqLworICAgICAgICBpZiAoYmFja3VwKSB7CisgICAgICAgICAgICBmbGFncysrOworICAgICAgICB9CisgICAgICAgIC8qCisgICAgICAgICAqIFRoZSBjcmVhdGUgYml0IGlzIGJpdCAxIHNvIGlmIHdlIG9yIHdpdGggMiB0aGUgYml0IHdpbGwgYmUgc2V0LgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKCFjcmVhdGUpIHsKKyAgICAgICAgICAgIGZsYWdzIHw9IDI7CisgICAgICAgIH0KKworICAgICAgICAvKgorICAgICAgICAgKiBBbiBPQkVYIFNFVFBBVEggcGFja2V0IHRvIHRoZSBzZXJ2ZXI6CisgICAgICAgICAqIEJ5dGUgMTogMHg4NQorICAgICAgICAgKiBCeXRlIDIgJiAzOiBwYWNrZXQgc2l6ZQorICAgICAgICAgKiBCeXRlIDQ6IGZsYWdzCisgICAgICAgICAqIEJ5dGUgNTogY29uc3RhbnRzCisgICAgICAgICAqIEJ5dGUgNiAmIHVwOiBoZWFkZXJzCisgICAgICAgICAqLworICAgICAgICBieXRlW10gcGFja2V0ID0gbmV3IGJ5dGVbdG90YWxMZW5ndGhdOworICAgICAgICBwYWNrZXRbMF0gPSAoYnl0ZSlmbGFnczsKKyAgICAgICAgcGFja2V0WzFdID0gKGJ5dGUpMHgwMDsKKyAgICAgICAgaWYgKGhlYWRzZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShoZWFkLCAwLCBwYWNrZXQsIDIsIGhlYWQubGVuZ3RoKTsKKyAgICAgICAgfQorCisgICAgICAgIEhlYWRlclNldCByZXR1cm5IZWFkZXJTZXQgPSBuZXcgSGVhZGVyU2V0KCk7CisgICAgICAgIHNlbmRSZXF1ZXN0KE9iZXhIZWxwZXIuT0JFWF9PUENPREVfU0VUUEFUSCwgcGFja2V0LCByZXR1cm5IZWFkZXJTZXQsIG51bGwpOworCisgICAgICAgIC8qCisgICAgICAgICAqIEFuIE9CRVggU0VUUEFUSCByZXBseSBmcm9tIHRoZSBzZXJ2ZXI6CisgICAgICAgICAqIEJ5dGUgMTogUmVzcG9uc2UgY29kZQorICAgICAgICAgKiBCeXRlcyAyICYgMzogcGFja2V0IHNpemUKKyAgICAgICAgICogQnl0ZXMgNCAmIHVwOiBoZWFkZXJzCisgICAgICAgICAqLworCisgICAgICAgIHNldFJlcXVlc3RJbmFjdGl2ZSgpOworCisgICAgICAgIHJldHVybiByZXR1cm5IZWFkZXJTZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVmVyaWZpZXMgdGhhdCB0aGUgY29ubmVjdGlvbiBpcyBvcGVuLgorICAgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gaWYgdGhlIGNvbm5lY3Rpb24gaXMgY2xvc2VkCisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIGVuc3VyZU9wZW4oKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpZiAoIW1PcGVuKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oIkNvbm5lY3Rpb24gY2xvc2VkIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgcmVxdWVzdCBpbmFjdGl2ZS4gQWxsb3dzIFB1dCBhbmQgZ2V0IG9wZXJhdGlvbiBvYmplY3RzIHRvIHRlbGwgdGhpcworICAgICAqIG9iamVjdCB3aGVuIHRoZXkgYXJlIGRvbmUuCisgICAgICovCisgICAgLypwYWNrYWdlKi9zeW5jaHJvbml6ZWQgdm9pZCBzZXRSZXF1ZXN0SW5hY3RpdmUoKSB7CisgICAgICAgIG1SZXF1ZXN0QWN0aXZlID0gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHJlcXVlc3QgdG8gYWN0aX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GVyZSBhcmUgYW55IGhlYWRlcnMgdG8gc2VuZAorICAgICAgICBpZiAoaGVhZCA9PSBudWxsKSB7CisgICAgICAgICAgICBvdXQud3JpdGUoMHgwMCk7CisgICAgICAgICAgICBvdXQud3JpdGUoMHgwMyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpKChoZWFkLmxlbmd0aCArIDMpID4+IDgpKTsKKyAgICAgICAgICAgIG91dC53cml0ZSgoYnl0ZSkoaGVhZC5sZW5ndGggKyAzKSk7CisgICAgICAgICAgICBvdXQud3JpdGUoaGVhZCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBXcml0ZSB0aGUgcmVxdWVzdCB0byB0aGUgb3V0cHV0IHN0cmVhbSBhbmQgZmx1c2ggdGhlIHN0cmVhbQorICAgICAgICBtT3V0cHV0LndyaXRlKG91dC50b0J5dGVBcnJheSgpKTsKKyAgICAgICAgbU91dHB1dC5mbHVzaCgpOworCisgICAgICAgIGhlYWRlci5yZXNwb25zZUNvZGUgPSBtSW5wdXQucmVhZCgpOworCisgICAgICAgIGludCBsZW5ndGggPSAoKG1JbnB1dC5yZWFkKCkgPDwgOCkgfCAobUlucHV0LnJlYWQoKSkpOworCisgICAgICAgIGlmIChsZW5ndGggPiBPYmV4SGVscGVyLk1BWF9QQUNLRVRfU0laRV9JTlQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiUGFja2V0IHJlY2VpdmVkIGV4Y2VlZHMgcGFja2V0IHNpemUgbGltaXQiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobGVuZ3RoID4gT2JleEhlbHBlci5CQVNFX1BBQ0tFVF9MRU5HVEgpIHsKKyAgICAgICAgICAgIGJ5dGVbXSBkYXRhID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChvcENvZGUgPT0gT2JleEhlbHBlci5PQkVYX09QQ09ERV9DT05ORUNUKSB7CisgICAgICAgICAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCisgICAgICAgICAgICAgICAgaW50IHZlcnNpb24gPSBtSW5wdXQucmVhZCgpOworICAgICAgICAgICAgICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bnVzZWQiKQorICAgICAgICAgICAgICAgIGludCBmbGFncyA9IG1JbnB1dC5yZWFkKCk7CisgICAgICAgICAgICAgICAgbWF4UGFja2V0U2l6ZSA9IChtSW5wdXQucmVhZCgpIDw8IDgpICsgbUlucHV0LnJlYWQoKTsKKworICAgICAgICAgICAgICAgIC8vY2hlY2sgd2l0aCBsb2NhbCBtYXggc2l6ZQorICAgICAgICAgICAgICAgIGlmIChtYXhQYWNrZXRTaXplID4gT2JleEhlbHBlci5NQVhfUEFDS0VUX1NJWkVfSU5UKSB7CisgICAgICAgICAgICAgICAgICAgIG1heFBhY2tldFNpemUgPSBPYmV4SGVscGVyLk1BWF9QQUNLRVRfU0laRV9JTlQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA+IDcpIHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YSA9IG5ldyBieXRlW2xlbmd0aCAtIDddOworCisgICAgICAgICAgICAgICAgICAgIGJ5dGVzUmVjZWl2ZWQgPSBtSW5wdXQucmVhZChkYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGJ5dGVzUmVjZWl2ZWQgIT0gKGxlbmd0aCAtIDcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlY2VpdmVkICs9IG1JbnB1dC5yZWFkKGRhdGEsIGJ5dGVzUmVjZWl2ZWQsIGRhdGEubGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gYnl0ZXNSZWNlaXZlZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgYnl0ZVtsZW5ndGggLSAzXTsKKyAgICAgICAgICAgICAgICBieXRlc1JlY2VpdmVkID0gbUlucHV0LnJlYWQoZGF0YSk7CisKKyAgICAgICAgICAgICAgICB3aGlsZSAoYnl0ZXNSZWNlaXZlZCAhPSAobGVuZ3RoIC0gMykpIHsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZXNSZWNlaXZlZCArPSBtSW5wdXQucmVhZChkYXRhLCBieXRlc1JlY2VpdmVkLCBkYXRhLmxlbmd0aCAtIGJ5dGVzUmVjZWl2ZWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAob3BDb2RlID09IE9iZXhIZWxwZXIuT0JFWF9PUENPREVfQUJPUlQpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBieXRlW10gYm9keSA9IE9iZXhIZWxwZXIudXBkYXRlSGVhZGVyU2V0KGhlYWRlciwgZGF0YSk7CisgICAgICAgICAgICBpZiAoKHByaXZhdGVJbnB1dCAhPSBudWxsKSAmJiAoYm9keSAhPSBudWxsKSkgeworICAgICAgICAgICAgICAgIHByaXZhdGVJbnB1dC53cml0ZUJ5dGVzKGJvZHksIDEpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoaGVhZGVyLm1Db25uZWN0aW9uSUQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uSWQgPSBuZXcgYnl0ZVs0XTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRlci5tQ29ubmVjdGlvbklELCAwLCBtQ29ubmVjdGlvbklkLCAwLCA0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGhlYWRlci5tQXV0aFJlc3AgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmICghaGFuZGxlQXV0aFJlc3AoaGVhZGVyLm1BdXRoUmVzcCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0UmVxdWVzdEluYWN0aXZlKCk7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiQXV0aGVudGljYXRpb24gRmFpbGVkIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoKGhlYWRlci5yZXNwb25zZUNvZGUgPT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfVU5BVVRIT1JJWkVEKQorICAgICAgICAgICAgICAgICAgICAmJiAoaGVhZGVyLm1BdXRoQ2hhbGwgIT0gbnVsbCkpIHsKKworICAgICAgICAgICAgICAgIGlmIChoYW5kbGVBdXRoQ2hhbGwoaGVhZGVyKSkgeworICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpSGVhZGVyU2V0LkFVVEhfUkVTUE9OU0UpOworICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpKChoZWFkZXIubUF1dGhSZXNwLmxlbmd0aCArIDMpID4+IDgpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKShoZWFkZXIubUF1dGhSZXNwLmxlbmd0aCArIDMpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKGhlYWRlci5tQXV0aFJlc3ApOworICAgICAgICAgICAgICAgICAgICBoZWFkZXIubUF1dGhDaGFsbCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGhlYWRlci5tQXV0aFJlc3AgPSBudWxsOworCisgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBzZW5kSGVhZGVycyA9IG5ldyBieXRlW291dC5zaXplKCkgLSAzXTsKKyAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShvdXQudG9CeXRlQXJyYXkoKSwgMywgc2VuZE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ICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRIZWFkZXIoaW50IGhlYWRlcklELCBPYmplY3QgaGVhZGVyVmFsdWUpIHsKKyAgICAgICAgbG9uZyB0ZW1wID0gLTE7CisKKyAgICAgICAgc3dpdGNoIChoZWFkZXJJRCkgeworICAgICAgICAgICAgY2FzZSBDT1VOVDoKKyAgICAgICAgICAgICAgICBpZiAoIShoZWFkZXJWYWx1ZSBpbnN0YW5jZW9mIExvbmcpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChoZWFkZXJWYWx1ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ291bnQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ291bnQgbXVzdCBiZSBhIExvbmciKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdGVtcCA9ICgoTG9uZyloZWFkZXJWYWx1ZSkubG9uZ1ZhbHVlKCk7CisgICAgICAgICAgICAgICAgaWYgKCh0ZW1wIDwgMEwpIHx8ICh0ZW1wID4gMHhGRkZGRkZGRkwpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNvdW50IG11c3QgYmUgYmV0d2VlbiAwIGFuZCAweEZGRkZGRkZGIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1Db3VudCA9IChMb25nKWhlYWRlclZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBOQU1FOgorICAgICAgICAgICAgICAgIGlmICgoaGVhZGVyVmFsdWUgIT0gbnVsbCkgJiYgKCEoaGVhZGVyVmFsdWUgaW5zdGFuY2VvZiBTdHJpbmcpKSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJOYW1lIG11c3QgYmUgYSBTdHJpbmciKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbU5hbWUgPSAoU3RyaW5nKWhlYWRlclZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBUWVBFOgorICAgICAgICAgICAgICAgIGlmICgoaGVhZGVyVmFsdWUgIT0gbnVsbCkgJiYgKCEoaGVhZGVyVmFsdWUgaW5zdGFuY2VvZiBTdHJpbmcpKSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJUeXBlIG11c3QgYmUgYSBTdHJpbmciKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVR5cGUgPSAoU3RyaW5nKWhlYWRlclZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBMRU5HVEg6CisgICAgICAgICAgICAgICAgaWYgKCEoaGVhZGVyVmFsdWUgaW5zdGFuY2VvZiBMb25nKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoaGVhZGVyVmFsdWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUxlbmd0aCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJMZW5ndGggbXVzdCBiZSBhIExvbmciKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdGVtcCA9ICgoTG9uZyloZWFkZXJWYWx1ZSkubG9uZ1ZhbHVlKCk7CisgICAgICAgICAgICAgICAgaWYgKCh0ZW1wIDwgMEwpIHx8ICh0ZW1wID4gMHhGRkZGRkZGRkwpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkxlbmd0aCBtdXN0IGJlIGJldHdlZW4gMCBhbmQgMHhGRkZGRkZGRiIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtTGVuZ3RoID0gKExvbmcpaGVhZGVyVmFsdWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFRJTUVfSVNPXzg2MDE6CisgICAgICAgICAgICAgICAgaWYgKChoZWFkZXJWYWx1ZSAhPSBudWxsKSAmJiAoIShoZWFkZXJWYWx1ZSBpbnN0YW5jZW9mIENhbGVuZGFyKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVGltZSBJU08gODYwMSBtdXN0IGJlIGEgQ2FsZW5kYXIiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUlzb1RpbWUgPSAoQ2FsZW5kYXIpaGVhZGVyVmFsdWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFRJTUVfNF9CWVRFOgorICAgICAgICAgICAgICAgIGlmICgoaGVhZGVyVmFsdWUgIT0gbnVsbCkgJiYgKCEoaGVhZGVyVmFsdWUgaW5zdGFuY2VvZiBDYWxlbmRhcikpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlRpbWUgNCBCeXRlIG11c3QgYmUgYSBDYWxlbmRhciIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtQnl0ZVRpbWUgPSAoQ2FsZW5kYXIpaGVhZGVyVmFsdWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIERFU0NSSVBUSU9OOgorICAgICAgICAgICAgICAgIGlmICgoaGVhZGVyVmFsdWUgIT0gbnVsbCkgJiYgKCEoaGVhZGVyVmFsdWUgaW5zdGFuY2VvZiBTdHJpbmcpKSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJEZXNjcmlwdGlvbiBtdXN0IGJlIGEgU3RyaW5nIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1EZXNjcmlwdGlvbiA9IChTdHJpbmcpaGVhZGVyVmFsdWU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFRBUkdFVDoKKyAgICAgICAgICAgICAgICBpZiAoaGVhZGVyVmFsdWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0ID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoIShoZWFkZXJWYWx1ZSBpbnN0YW5jZW9mIGJ5dGVbXSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlRhcmdldCBtdXN0IGJlIGEgYnl0ZSBhcnJheSIpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldCA9IG5ldyBieXRlWygoYnl0ZVtdKWhlYWRlclZhbHVlKS5sZW5ndGhdOworICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShoZWFkZXJWYWx1ZSwgMCwgbVRhcmdldCwgMCwgbVRhcmdldC5sZW5ndGgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBIVFRQOgorICAgICAgICAgICAgICAgIGlmIChoZWFkZXJWYWx1ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1IdHRwSGVhZGVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoIShoZWFkZXJWYWx1ZSBpbnN0YW5jZW9mIGJ5dGVbXSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkhUVFAgbXVzdCBiZSBhIGJ5dGUgYXJyYXkiKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1IdHRwSGVhZGVyID0gbmV3IGJ5dGVbKChieXRlW10paGVhZGVyVmFsdWUpLmxlbmd0aF07CisgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRlclZhbHVlLCAwLCBtSHR0cEhlYWRlciwgMCwgbUh0dHBIZWFkZXIubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgV0hPOgorICAgICAgICAgICAgICAgIGlmIChoZWFkZXJWYWx1ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1XaG8gPSBudWxsOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghKGhlYWRlclZhbHVlIGluc3RhbmNlb2YgYnl0ZVtdKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiV0hPIG11c3QgYmUgYSBieXRlIGFycmF5Iik7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2hvID0gbmV3IGJ5dGVbKChieXRlW10paGVhZGVyVmFsdWUpLmxlbmd0aF07CisgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRlclZhbHVlLCAwLCBtV2hvLCAwLCBtV2hvLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9DTEFTUzoKKyAgICAgICAgICAgICAgICBpZiAoaGVhZGVyVmFsdWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtT2JqZWN0Q2xhc3MgPSBudWxsOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghKGhlYWRlclZhbHVlIGluc3RhbmNlb2YgYnl0ZVtdKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiT2JqZWN0IENsYXNzIG11c3QgYmUgYSBieXRlIGFycmF5Iik7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtT2JqZWN0Q2xhc3MgPSBuZXcgYnl0ZVsoKGJ5dGVbXSloZWFkZXJWYWx1ZSkubGVuZ3RoXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZGVyVmFsdWUsIDAsIG1PYmplY3RDbGFzcywgMCwgbU9iamVjdENsYXNzLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEFQUExJQ0FUSU9OX1BBUkFNRVRFUjoKKyAgICAgICAgICAgICAgICBpZiAoaGVhZGVyVmFsdWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtQXBwUGFyYW0gPSBudWxsOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghKGhlYWRlclZhbHVlIGluc3RhbmNlb2YgYnl0ZVtdKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkFwcGxpY2F0aW9uIFBhcmFtZXRlciBtdXN0IGJlIGEgYnl0ZSBhcnJheSIpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbUFwcFBhcmFtID0gbmV3IGJ5dGVbKChieXRlW10paGVhZGVyVmFsdWUpLmxlbmd0aF07CisgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRlclZhbHVlLCAwLCBtQXBwUGFyYW0sIDAsIG1BcHBQYXJhbS5sZW5ndGgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAvLyBWZXJpZnkgdGhhdCBpdCB3YXMgbm90IGEgVW5pY29kZSBTdHJpbmcgdXNlciBEZWZpbmVkCisgICAgICAgICAgICAgICAgaWYgKChoZWFkZXJJRCA+PSAweDMwKSAmJiAoaGVhZGVySUQgPD0gMHgzRikpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChoZWFkZXJWYWx1ZSAhPSBudWxsKSAmJiAoIShoZWFkZXJWYWx1ZSBpbnN0YW5jZW9mIFN0cmluZykpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5pY29kZSBTdHJpbmcgVXNlciBEZWZpbmVkIG11c3QgYmUgYSBTdHJpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtVW5pY29kZVVzZXJEZWZpbmVkW2hlYWRlcklEIC0gMHgzMF0gPSAoU3RyaW5nKWhlYWRlclZhbHVlOworCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBWZXJpZnkgdGhhdCBpdCB3YXMgbm90IGEgYnl0ZSBzZXF1ZW5jZSB1c2VyIGRlZmluZWQgdmFsdWUKKyAgICAgICAgICAgICAgICBpZiAoKGhlYWRlcklEID49IDB4NzApICYmIChoZWFkZXJJRCA8PSAweDdGKSkgeworCisgICAgICAgICAgICAgICAgICAgIGlmIChoZWFkZXJWYWx1ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2VxdWVuY2VVc2VyRGVmaW5lZFtoZWFkZXJJRCAtIDB4NzBdID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKGhlYWRlclZhbHVlIGluc3RhbmNlb2YgYnl0ZVtdKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQnl0ZSBTZXF1ZW5jZSBVc2VyIERlZmluZWQgbXVzdCBiZSBhIGJ5dGUgYXJyYXkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlcXVlbmNlVXNlckRlZmluZWRbaGVhZGVySUQgLSAweDcwXSA9IG5ldyBieXRlWygoYnl0ZVtdKWhlYWRlclZhbHVlKS5sZW5ndGhdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZGVyVmFsdWUsIDAsIG1TZXF1ZW5jZVVzZXJEZWZpbmVkW2hlYWRlcklEIC0gMHg3MF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBtU2VxdWVuY2VVc2VyRGVmaW5lZFtoZWFkZXJJRCAtIDB4NzBdLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIFZlcmlmeSB0aGF0IGl0IHdhcyBub3QgYSBCeXRlIHVzZXIgRGVmaW5lZAorICAgICAgICAgICAgICAgIGlmICgoaGVhZGVySUQgPj0gMHhCMCkgJiYgKGhlYWRlcklEIDw9IDB4QkYpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoaGVhZGVyVmFsdWUgIT0gbnVsbCkgJiYgKCEoaGVhZGVyVmFsdWUgaW5zdGFuY2VvZiBCeXRlKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkJ5dGVVc2VyIERlZmluZWQgbXVzdCBiZSBhIEJ5dGUiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtQnl0ZVVzZXJEZWZpbmVkW2hlYWRlcklEIC0gMHhCMF0gPSAoQnl0ZSloZWFkZXJWYWx1ZTsKKworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gVmVyaWZ5IHRoYXQgaXMgd2FzIG5vdCB0aGUgNCBieXRlIHVuc2lnbmVkIGludGVnZXIgdXNlcgorICAgICAgICAgICAgICAgIC8vIGRlZmluZWQgaGVhZGVyCisgICAgICAgICAgICAgICAgaWYgKChoZWFkZXJJRCA+PSAweEYwKSAmJiAoaGVhZGVySUQgPD0gMHhGRikpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCEoaGVhZGVyVmFsdWUgaW5zdGFuY2VvZiBMb25nKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhlYWRlclZhbHVlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50ZWdlclVzZXJEZWZpbmVkW2hlYWRlcklEIC0gMHhGMF0gPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiSW50ZWdlciBVc2VyIERlZmluZWQgbXVzdCBiZSBhIExvbmciKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKChMb25nKWhlYWRlclZhbHVlKS5sb25nVmFsdWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCh0ZW1wIDwgMEwpIHx8ICh0ZW1wID4gMHhGRkZGRkZGRkwpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW50ZWdlciBVc2VyIERlZmluZWQgbXVzdCBiZSBiZXR3ZWVuIDAgYW5kIDB4RkZGRkZGRkYiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtSW50ZWdlclVzZXJEZWZpbmVkW2hlYWRlcklEIC0gMHhGMF0gPSAoTG9uZyloZWFkZXJWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkludmFsaWQgSGVhZGVyIElkZW50aWZpZXIiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHJpZXZlcyB0aGUgdmFsdWUgb2YgdGhlIGhlYWRlciBpZGVudGlmaWVyIHByb3ZpZGVkLiBU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c2UgTkFNRToKKyAgICAgICAgICAgICAgICByZXR1cm4gbU5hbWU7CisgICAgICAgICAgICBjYXNlIFRZUEU6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1UeXBlOworICAgICAgICAgICAgY2FzZSBMRU5HVEg6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1MZW5ndGg7CisgICAgICAgICAgICBjYXNlIFRJTUVfSVNPXzg2MDE6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1Jc29UaW1lOworICAgICAgICAgICAgY2FzZSBUSU1FXzRfQllURToKKyAgICAgICAgICAgICAgICByZXR1cm4gbUJ5dGVUaW1lOworICAgICAgICAgICAgY2FzZSBERVNDUklQVElPTjoKKyAgICAgICAgICAgICAgICByZXR1cm4gbURlc2NyaXB0aW9uOworICAgICAgICAgICAgY2FzZSBUQVJHRVQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1UYXJnZXQ7CisgICAgICAgICAgICBjYXNlIEhUVFA6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1IdHRwSGVhZGVyOworICAgICAgICAgICAgY2FzZSBXSE86CisgICAgICAgICAgICAgICAgcmV0dXJuIG1XaG87CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9DTEFTUzoKKyAgICAgICAgICAgICAgICByZXR1cm4gbU9iamVjdENsYXNzOworICAgICAgICAgICAgY2FzZSBBUFBMSUNBVElPTl9QQVJBTUVURVI6CisgICAgICAgICAgICAgICAgcmV0dXJuIG1BcHBQYXJhbTsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgLy8gVmVyaWZ5IHRoYXQgaXQgd2FzIG5vdCBhIFVuaWNvZGUgU3RyaW5nIHVzZXIgRGVmaW5lZAorICAgICAgICAgICAgICAgIGlmICgoaGVhZGVySUQgPj0gMHgzMCkgJiYgKGhlYWRlcklEIDw9IDB4M0YpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtVW5pY29kZVVzZXJEZWZpbmVkW2hlYWRlcklEIC0gMHgzMF07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIFZlcmlmeSB0aGF0IGl0IHdhcyBub3QgYSBieXRlIHNlcXVlbmNlIHVzZXIgZGVmaW5lZCBoZWFkZXIKKyAgICAgICAgICAgICAgICBpZiAoKGhlYWRlcklEID49IDB4NzApICYmIChoZWFkZXJJRCA8PSAweDdGKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbVNlcXVlbmNlVXNlckRlZmluZWRbaGVhZGVySUQgLSAweDcwXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gVmVyaWZ5IHRoYXQgaXQgd2FzIG5vdCBhIGJ5dGUgdXNlciBkZWZpbmVkIGhlYWRlcgorICAgICAgICAgICAgICAgIGlmICgoaGVhZGVySUQgPj0gMHhCMCkgJiYgKGhlYWRlcklEIDw9IDB4QkYpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtQnl0ZVVzZXJEZWZpbmVkW2hlYWRlcklEIC0gMHhCMF07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIFZlcmlmeSB0aGF0IGl0IHdhcyBub3QgYSBpbnRlZ2VyIHVzZXIgZGVmaW5lZCBoZWFkZXIKKyAgICAgICAgICAgICAgICBpZiAoKGhlYWRlcklEID49IDB4RjApICYmIChoZWFkZXJJRCA8PSAweEZGKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbUludGVnZXJVc2VyRGVmaW5lZFtoZWFkZXJJRCAtIDB4RjBdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJJbnZhbGlkIEhlYWRlciBJZGVudGlmaWVyIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXRyaWV2ZXMgdGhlIGxpc3Qgb2YgaGVhZGVycyB0aGF0IG1heSBiZSByZX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orICAgICAgICBpZiAobUxlbmd0aCAhPSBudWxsKSB7CisgICAgICAgICAgICBvdXQud3JpdGUoTEVOR1RIKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUlzb1RpbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgb3V0LndyaXRlKFRJTUVfSVNPXzg2MDEpOworICAgICAgICB9CisgICAgICAgIGlmIChtQnl0ZVRpbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgb3V0LndyaXRlKFRJTUVfNF9CWVRFKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobURlc2NyaXB0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgIG91dC53cml0ZShERVNDUklQVElPTik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1UYXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgb3V0LndyaXRlKFRBUkdFVCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1IdHRwSGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG91dC53cml0ZShIVFRQKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVdobyAhPSBudWxsKSB7CisgICAgICAgICAgICBvdXQud3JpdGUoV0hPKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUFwcFBhcmFtICE9IG51bGwpIHsKKyAgICAgICAgICAgIG91dC53cml0ZShBUFBMSUNBVElPTl9QQVJBTUVURVIpOworICAgICAgICB9CisgICAgICAgIGlmIChtT2JqZWN0Q2xhc3MgIT0gbnVsbCkgeworICAgICAgICAgICAgb3V0LndyaXRlKE9CSkVDVF9DTEFTUyk7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGludCBpID0gMHgzMDsgaSA8IDB4NDA7IGkrKykgeworICAgICAgICAgICAgaWYgKG1Vbmljb2RlVXNlckRlZmluZWRbaSAtIDB4MzBdICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoaSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGludCBpID0gMHg3MDsgaSA8IDB4ODA7IGkrKykgeworICAgICAgICAgICAgaWYgKG1TZXF1ZW5jZVVzZXJEZWZpbmVkW2kgLSAweDcwXSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDB4QjA7IGkgPCAweEMwOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChtQnl0ZVVzZXJEZWZpbmVkW2kgLSAweEIwXSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDB4RjA7IGkgPCAweDEwMDsgaSsrKSB7CisgICAgICAgICAgICBpZiAobUludGVnZXJVc2VyRGVmaW5lZFtpIC0gMHhGMF0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dC53cml0ZShpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGJ5dGVbXSBoZWFkZXJzID0gb3V0LnRvQnl0ZUFycmF5KCk7CisgICAgICAgIG91dC5jbG9zZSgpOworCisgICAgICAgIGlmICgoaGVhZGVycyA9PSBudWxsKSB8fCAoaGVhZGVycy5sZW5ndGggPT0gMCkpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgaW50W10gcmVzdWx0ID0gbmV3IGludFtoZWFkZXJzLmxlbmd0aF07CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaGVhZGVycy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgLy8gQ29udmVydCB0aGUgYnl0ZSB0byBhIHBvc2l0aXZlIGludGVnZXIuICBUaGF0IGlzLCBhbiBpbnRlZ2VyCisgICAgICAgICAgICAvLyBiZXR3ZWVuIDAgYW5kIDI1Ni4KKyAgICAgICAgICAgIHJlc3VsdFtp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gd2FzIGZvdW5kCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBieXRlW10gdXBkYXRlSGVhZGVyU2V0KEhlYWRlclNldCBoZWFkZXIsIGJ5dGVbXSBoZWFkZXJBcnJheSkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaW50IGluZGV4ID0gMDsKKyAgICAgICAgaW50IGxlbmd0aCA9IDA7CisgICAgICAgIGludCBoZWFkZXJJRDsKKyAgICAgICAgYnl0ZVtdIHZhbHVlID0gbnVsbDsKKyAgICAgICAgYnl0ZVtdIGJvZHkgPSBudWxsOworICAgICAgICBIZWFkZXJTZXQgaGVhZGVySW1wbCA9IGhlYWRlcjsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHdoaWxlIChpbmRleCA8IGhlYWRlckFycmF5Lmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGhlYWRlcklEID0gMHhGRiAmIGhlYWRlckFycmF5W2luZGV4XTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKGhlYWRlcklEICYgKDB4QzApKSB7CisKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogMHgwMCBpcyBhIHVuaWNvZGUgbnVsbCB0ZXJtaW5hdGUgc3RyaW5nIHdpdGggdGhlIGZpcnN0CisgICAgICAgICAgICAgICAgICAgICAqIHR3byBieXRlcyBhZnRlciB0aGUgaGVhZGVyIGlkZW50aWZpZXIgYmVpbmcgdGhlIGxlbmd0aAorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgY2FzZSAweDAwOgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gRmFsbCB0aHJvdWdoCisgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgICogMHg0MCBpcyBhIGJ5dGUgc2VxdWVuY2Ugd2l0aCB0aGUgZmlyc3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHR3byBieXRlcyBhZnRlciB0aGUgaGVhZGVyIGlkZW50aWZpZXIgYmVpbmcgdGhlIGxlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGNhc2UgMHg0MDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdHJpbVRhaWwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IDB4RkYgJiBoZWFkZXJBcnJheVtpbmRleF07CisgICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBsZW5ndGggPDwgODsKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CisgICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggKz0gMHhGRiAmIGhlYWRlckFycmF5W2luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCAtPSAzOworICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gbmV3IGJ5dGVbbGVuZ3RoXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZGVyQXJyYXksIGluZGV4LCB2YWx1ZSwgMCwgbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPT0gMCB8fCAobGVuZ3RoID4gMCAmJiAodmFsdWVbbGVuZ3RoIC0gMV0gIT0gMCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpbVRhaWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoaGVhZGVySUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEhlYWRlclNldC5UWVBFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIHRyYWlsaW5nIG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0cmltVGFpbCA9PSBmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlckltcGwuc2V0SGVhZGVyKGhlYWRlcklELCBuZXcgU3RyaW5nKHZhbHVlLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUubGVuZ3RoLCAiSVNPODg1OV8xIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJJbXBsLnNldEhlYWRlcihoZWFkZXJJRCwgbmV3IFN0cmluZyh2YWx1ZSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLmxlbmd0aCAtIDEsICJJU084ODU5XzEiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkRW5jb2RpbmdFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgSGVhZGVyU2V0LkFVVEhfQ0hBTExFTkdFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJJbXBsLm1BdXRoQ2hhbGwgPSBuZXcgYnl0ZVtsZW5ndGhdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRlckFycmF5LCBpbmRleCwgaGVhZGVySW1wbC5tQXV0aENoYWxsLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBIZWFkZXJTZXQuQVVUSF9SRVNQT05TRToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVySW1wbC5tQXV0aFJlc3AgPSBuZXcgYnl0ZVtsZW5ndGhdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGhlYWRlckFycmF5LCBpbmRleCwgaGVhZGVySW1wbC5tQXV0aFJlc3AsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEhlYWRlclNldC5CT0RZOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGYWxsIFRocm91Z2ggKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEhlYWRlclNldC5FTkRfT0ZfQk9EWToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9IG5ldyBieXRlW2xlbmd0aCArIDFdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5WzBdID0gKGJ5dGUpaGVhZGVySUQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZGVyQXJyYXksIGluZGV4LCBib2R5LCAxLCBsZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgSGVhZGVyU2V0LlRJTUVfSVNPXzg2MDE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZGF0ZVN0cmluZyA9IG5ldyBTdHJpbmcodmFsdWUsICJJU084ODU5XzEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbGVuZGFyIHRlbXAgPSBDYWxlbmRhci5nZXRJbnN0YW5jZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkYXRlU3RyaW5nLmxlbmd0aCgpID09IDE2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoZGF0ZVN0cmluZy5jaGFyQXQoMTUpID09ICdaJykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnNldFRpbWVab25lKFRpbWVab25lLmdldFRpbWVab25lKCJVVEMiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnNldChDYWxlbmRhci5ZRUFSLCBJbnRlZ2VyLnBhcnNlSW50KGRhdGVTdHJpbmcuc3Vic3RyaW5nKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCA0KSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5zZXQoQ2FsZW5kYXIuTU9OVEgsIEludGVnZXIucGFyc2VJbnQoZGF0ZVN0cmluZy5zdWJzdHJpbmcoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQsIDYpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnNldChDYWxlbmRhci5EQVlfT0ZfTU9OVEgsIEludGVnZXIucGFyc2VJbnQoZGF0ZVN0cmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3Vic3RyaW5nKDYsIDgpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnNldChDYWxlbmRhci5IT1VSX09GX0RBWSwgSW50ZWdlci5wYXJzZUludChkYXRlU3RyaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdWJzdHJpbmcoOSwgMTEpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnNldChDYWxlbmRhci5NSU5VVEUsIEludGVnZXIucGFyc2VJbnQoZGF0ZVN0cmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3Vic3RyaW5nKDExLCAxMykpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuc2V0KENhbGVuZGFyLlNFQ09ORCwgSW50ZWdlci5wYXJzZUludChkYXRlU3RyaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdWJzdHJpbmcoMTMsIDE1KSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVySW1wbC5zZXRIZWFkZXIoSGVhZGVyU2V0LlRJTUVfSVNPXzg2MDEsIHRlbXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGhlYWRlcklEICYgMHhDMCkgPT0gMHgwMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVySW1wbC5zZXRIZWFkZXIoaGVhZGVySUQsIE9iZXhIZWxwZXIuY29udmVydFRvVW5pY29kZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUsIHRydWUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlckltcGwuc2V0SGVhZGVyKGhlYWRlcklELCB2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggKz0gbGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogMHg4MCBpcyBhIGJ5dGUgaGVhZGVyLiAgVGhlIG9ubHkgdmFsaWQgYnl0ZSBoZWFkZXJzIGFyZQorICAgICAgICAgICAgICAgICAgICAgKiB0aGUgMTYgdXNlciBkZWZpbmVkIGJ5dGUgaGVhZGVycy4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGNhc2UgMHg4MDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlckltcGwuc2V0SGVhZGVyKGhlYWRlcklELCBCeXRlLnZhbHVlT2YoaGVhZGVyQXJyYXlbaW5kZXhdKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdCBhIHZhbGlkIGhlYWRlciBzbyBpZ25vcmUKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgKiAweEMwIGlzIGEgNCBieXRlIHVuc2lnbmVkIGludGVnZXIgaGVhZGVyIGFuZCB3aXRoIHRoZQorICAgICAgICAgICAgICAgICAgICAgKiBleGNlcHRpb24gb2YgVElNRV80X0JZVEUgd2lsbCBiZSBjb252ZXJ0ZWQgdG8gYSBMb25nCisgICAgICAgICAgICAgICAgICAgICAqIGFuZCBhZGRlZC4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGNhc2UgMHhDMDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IG5ldyBieXRlWzRdOworICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShoZWFkZXJBcnJheSwgaW5kZXgsIHZhbHVlLCAwLCA0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhlYWRlcklEICE9IEhlYWRlclNldC5USU1FXzRfQllURSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBEZXRlcm1pbmUgaWYgaXQgaXMgYSBjb25uZWN0aW9uIElELiAgVGhlc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbmVlZCB0byBiZSBoYW5kbGVkIGRpZmZlcmVudGx5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoZWFkZXJJRCA9PSBIZWFkZXJTZXQuQ09OTkVDVElPTl9JRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVySW1wbC5tQ29ubmVjdGlvbklEID0gbmV3IGJ5dGVbNF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHZhbHVlLCAwLCBoZWFkZXJJbXBsLm1Db25uZWN0aW9uSUQsIDAsIDQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVySW1wbC5zZXRIZWFkZXIoaGVhZGVySUQsIExvbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnZhbHVlT2YoY29udmVydFRvTG9uZyh2YWx1ZSkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbGVuZGFyIHRlbXAgPSBDYWxlbmRhci5nZXRJbnN0YW5jZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnNldFRpbWUobmV3IERhdGUoY29udmVydFRvTG9uZyh2YWx1ZSkgKiAxMDAwTCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJJbXBsLnNldEhlYWRlcihIZWFkZXJTZXQuVElNRV80X0JZVEUsIHRlbXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm90IGEgdmFsaWQgaGVhZGVyIHNvIGlnbm9yZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiSGVhZGVyIHdhcyBub3QgZm9ybWF0dGVkIHByb3Blcmx5Iik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpbm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aGUgaGVhZGVyIG9mIGFuIE9CRVggcGFja2V0CisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBieXRlW10gY3JlYXRlSGVhZGVyKEhlYWRlclNldCBoZWFkLCBib29sZWFuIG51bGxPdXQpIHsKKyAgICAgICAgTG9uZyBpbnRIZWFkZXIgPSBudWxsOworICAgICAgICBTdHJpbmcgc3RyaW5nSGVhZGVyID0gbnVsbDsKKyAgICAgICAgQ2FsZW5kYXIgZGF0ZUhlYWRlciA9IG51bGw7CisgICAgICAgIEJ5dGUgYnl0ZUhlYWRlciA9IG51bGw7CisgICAgICAgIFN0cmluZ0J1ZmZlciBidWZmZXIgPSBudWxsOworICAgICAgICBieXRlW10gdmFsdWUgPSBudWxsOworICAgICAgICBieXRlW10gcmVzdWx0ID0gbnVsbDsKKyAgICAgICAgYnl0ZVtdIGxlbmd0aEFycmF5ID0gbmV3IGJ5dGVbMl07CisgICAgICAgIGludCBsZW5ndGg7CisgICAgICAgIEhlYWRlclNldCBoZWFkSW1wbCA9IG51bGw7CisgICAgICAgIEJ5dGVBcnJheU91dHB1dFN0cmVhbSBvdXQgPSBuZXcgQnl0ZUFycmF5T3V0cHV0U3RyZWFtKCk7CisgICAgICAgIGhlYWRJbXBsID0gaGVhZDsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIERldGVybWluZSBpZiB0aGVyZSBpcyBhIGNvbm5lY3Rpb24gSUQgdG8gc2VuZC4gIElmIHRoZXJlIGlzLAorICAgICAgICAgICAgICogdGhlbiBpdCBzaG91bGQgYmUgdGhlIGZpcnN0IGhlYWRlciBpbiB0aGUgcGFja2V0LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoKGhlYWRJbXBsLm1Db25uZWN0aW9uSUQgIT0gbnVsbCkgJiYgKGhlYWRJbXBsLmdldEhlYWRlcihIZWFkZXJTZXQuVEFSR0VUKSA9PSBudWxsKSkgeworCisgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKUhlYWRlclNldC5DT05ORUNUSU9OX0lEKTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoaGVhZEltcGwubUNvbm5lY3Rpb25JRCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIENvdW50IEhlYWRlcgorICAgICAgICAgICAgaW50SGVhZGVyID0gKExvbmcpaGVhZEltcGwuZ2V0SGVhZGVyKEhlYWRlclNldC5DT1VOVCk7CisgICAgICAgICAgICBpZiAoaW50SGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpSGVhZGVyU2V0LkNPVU5UKTsKKyAgICAgICAgICAgICAgICB2YWx1ZSA9IE9iZXhIZWxwZXIuY29udmVydFRvQnl0ZUFycmF5KGludEhlYWRlci5sb25nVmFsdWUoKSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICBpZiAobnVsbE91dCkgeworICAgICAgICAgICAgICAgICAgICBoZWFkSW1wbC5zZXRIZWFkZXIoSGVhZGVyU2V0LkNPVU5ULCBudWxsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIE5hbWUgSGVhZGVyCisgICAgICAgICAgICBzdHJpbmdIZWFkZXIgPSAoU3RyaW5nKWhlYWRJbXBsLmdldEhlYWRlcihIZWFkZXJTZXQuTkFNRSk7CisgICAgICAgICAgICBpZiAoc3RyaW5nSGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpSGVhZGVyU2V0Lk5BTUUpOworICAgICAgICAgICAgICAgIHZhbHVlID0gT2JleEhlbHBlci5jb252ZXJ0VG9Vbmljb2RlQnl0ZUFycmF5KHN0cmluZ0hlYWRlcik7CisgICAgICAgICAgICAgICAgbGVuZ3RoID0gdmFsdWUubGVuZ3RoICsgMzsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVswXSA9IChieXRlKSgweEZGICYgKGxlbmd0aCA+PiA4KSk7CisgICAgICAgICAgICAgICAgbGVuZ3RoQXJyYXlbMV0gPSAoYnl0ZSkoMHhGRiAmIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGxlbmd0aEFycmF5KTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUodmFsdWUpOworICAgICAgICAgICAgICAgIGlmIChudWxsT3V0KSB7CisgICAgICAgICAgICAgICAgICAgIGhlYWRJbXBsLnNldEhlYWRlcihIZWFkZXJTZXQuTkFNRSwgbnVsbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBUeXBlIEhlYWRlcgorICAgICAgICAgICAgc3RyaW5nSGVhZGVyID0gKFN0cmluZyloZWFkSW1wbC5nZXRIZWFkZXIoSGVhZGVyU2V0LlRZUEUpOworICAgICAgICAgICAgaWYgKHN0cmluZ0hlYWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKUhlYWRlclNldC5UWVBFKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHN0cmluZ0hlYWRlci5nZXRCeXRlcygiSVNPODg1OV8xIik7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IGU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbGVuZ3RoID0gdmFsdWUubGVuZ3RoICsgNDsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVswXSA9IChieXRlKSgyNTUgJiAobGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVsxXSA9IChieXRlKSgyNTUgJiBsZW5ndGgpOworICAgICAgICAgICAgICAgIG91dC53cml0ZShsZW5ndGhBcnJheSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoMHgwMCk7CisgICAgICAgICAgICAgICAgaWYgKG51bGxPdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgaGVhZEltcGwuc2V0SGVhZGVyKEhlYWRlclNldC5UWVBFLCBudWxsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIExlbmd0aCBIZWFkZXIKKyAgICAgICAgICAgIGludEhlYWRlciA9IChMb25nKWhlYWRJbXBsLmdldEhlYWRlcihIZWFkZXJTZXQuTEVOR1RIKTsKKyAgICAgICAgICAgIGlmIChpbnRIZWFkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dC53cml0ZSgoYnl0ZSlIZWFkZXJTZXQuTEVOR1RIKTsKKyAgICAgICAgICAgICAgICB2YWx1ZSA9IE9iZXhIZWxwZXIuY29udmVydFRvQnl0ZUFycmF5KGludEhlYWRlci5sb25nVmFsdWUoKSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICBpZiAobnVsbE91dCkgeworICAgICAgICAgICAgICAgICAgICBoZWFkSW1wbC5zZXRIZWFkZXIoSGVhZGVyU2V0LkxFTkdUSCwgbnVsbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBUaW1lIElTTyBIZWFkZXIKKyAgICAgICAgICAgIGRhdGVIZWFkZXIgPSAoQ2FsZW5kYXIpaGVhZEltcGwuZ2V0SGVhZGVyKEhlYWRlclNldC5USU1FX0lTT184NjAxKTsKKyAgICAgICAgICAgIGlmIChkYXRlSGVhZGVyICE9IG51bGwpIHsKKworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogVGhlIElTTyBIZWFkZXIgc2hvdWxkIHRha2UgdGhlIGZvcm0gWVlZWU1NRERUSEhNTVNTWi4gIFRoZQorICAgICAgICAgICAgICAgICAqICdaJyB3aWxsIG9ubHkgYmUgaW5jbHVkZWQgaWYgaXQgaXMgYSBVVEMgdGltZS4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBidWZmZXIgPSBuZXcgU3RyaW5nQnVmZmVyKCk7CisgICAgICAgICAgICAgICAgaW50IHRlbXAgPSBkYXRlSGVhZGVyLmdldChDYWxlbmRhci5ZRUFSKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdGVtcDsgaSA8IDEwMDA7IGkgPSBpICogMTApIHsKKyAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiMCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKHRlbXApOworICAgICAgICAgICAgICAgIHRlbXAgPSBkYXRlSGVhZGVyLmdldChDYWxlbmRhci5NT05USCk7CisgICAgICAgICAgICAgICAgaWYgKHRlbXAgPCAxMCkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIwIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQodGVtcCk7CisgICAgICAgICAgICAgICAgdGVtcCA9IGRhdGVIZWFkZXIuZ2V0KENhbGVuZGFyLkRBWV9PRl9NT05USCk7CisgICAgICAgICAgICAgICAgaWYgKHRlbXAgPCAxMCkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIwIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQodGVtcCk7CisgICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiVCIpOworICAgICAgICAgICAgICAgIHRlbXAgPSBkYXRlSGVhZGVyLmdldChDYWxlbmRhci5IT1VSX09GX0RBWSk7CisgICAgICAgICAgICAgICAgaWYgKHRlbXAgPCAxMCkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIwIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQodGVtcCk7CisgICAgICAgICAgICAgICAgdGVtcCA9IGRhdGVIZWFkZXIuZ2V0KENhbGVuZGFyLk1JTlVURSk7CisgICAgICAgICAgICAgICAgaWYgKHRlbXAgPCAxMCkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIwIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQodGVtcCk7CisgICAgICAgICAgICAgICAgdGVtcCA9IGRhdGVIZWFkZXIuZ2V0KENhbGVuZGFyLlNFQ09ORCk7CisgICAgICAgICAgICAgICAgaWYgKHRlbXAgPCAxMCkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIwIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQodGVtcCk7CisKKyAgICAgICAgICAgICAgICBpZiAoZGF0ZUhlYWRlci5nZXRUaW1lWm9uZSgpLmdldElEKCkuZXF1YWxzKCJVVEMiKSkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCJaIik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBidWZmZXIudG9TdHJpbmcoKS5nZXRCeXRlcygiSVNPODg1OV8xIik7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IGU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbGVuZ3RoID0gdmFsdWUubGVuZ3RoICsgMzsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVswXSA9IChieXRlKSgyNTUgJiAobGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVsxXSA9IChieXRlKSgyNTUgJiBsZW5ndGgpOworICAgICAgICAgICAgICAgIG91dC53cml0ZShIZWFkZXJTZXQuVElNRV9JU09fODYwMSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGxlbmd0aEFycmF5KTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUodmFsdWUpOworICAgICAgICAgICAgICAgIGlmIChudWxsT3V0KSB7CisgICAgICAgICAgICAgICAgICAgIGhlYWRJbXBsLnNldEhlYWRlcihIZWFkZXJTZXQuVElNRV9JU09fODYwMSwgbnVsbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBUaW1lIDQgQnl0ZSBIZWFkZXIKKyAgICAgICAgICAgIGRhdGVIZWFkZXIgPSAoQ2FsZW5kYXIpaGVhZEltcGwuZ2V0SGVhZGVyKEhlYWRlclNldC5USU1FXzRfQllURSk7CisgICAgICAgICAgICBpZiAoZGF0ZUhlYWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKEhlYWRlclNldC5USU1FXzRfQllURSk7CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIE5lZWQgdG8gY2FsbCBnZXRUaW1lKCkgdHdpY2UuICBUaGUgZmlyc3QgY2FsbCB3aWxsIHJldHVybgorICAgICAgICAgICAgICAgICAqIGEgamF2YS51dGlsLkRhdGUgb2JqZWN0LiAgVGhlIHNlY29uZCBjYWxsIHJldHVybnMgdGhlIG51bWJlcgorICAgICAgICAgICAgICAgICAqIG9mIG1pbGxpc2Vjb25kcyBzaW5jZSBKYW51YXJ5IDEsIDE5NzAuICBXZSBuZWVkIHRvIGNvbnZlcnQKKyAgICAgICAgICAgICAgICAgKiBpdCB0byBzZWNvbmRzIHNpbmNlIHRoZSBUSU1FXzRfQllURSBleHBlY3RzIHRoZSBudW1iZXIgb2YKKyAgICAgICAgICAgICAgICAgKiBzZWNvbmRzIHNpbmNlIEphbnVhcnkgMSwgMTk3MC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICB2YWx1ZSA9IE9iZXhIZWxwZXIuY29udmVydFRvQnl0ZUFycmF5KGRhdGVIZWFkZXIuZ2V0VGltZSgpLmdldFRpbWUoKSAvIDEwMDBMKTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUodmFsdWUpOworICAgICAgICAgICAgICAgIGlmIChudWxsT3V0KSB7CisgICAgICAgICAgICAgICAgICAgIGhlYWRJbXBsLnNldEhlYWRlcihIZWFkZXJTZXQuVElNRV80X0JZVEUsIG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gRGVzY3JpcHRpb24gSGVhZGVyCisgICAgICAgICAgICBzdHJpbmdIZWFkZXIgPSAoU3RyaW5nKWhlYWRJbXBsLmdldEhlYWRlcihIZWFkZXJTZXQuREVTQ1JJUFRJT04pOworICAgICAgICAgICAgaWYgKHN0cmluZ0hlYWRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKUhlYWRlclNldC5ERVNDUklQVElPTik7CisgICAgICAgICAgICAgICAgdmFsdWUgPSBPYmV4SGVscGVyLmNvbnZlcnRUb1VuaWNvZGVCeXRlQXJyYXkoc3RyaW5nSGVhZGVyKTsKKyAgICAgICAgICAgICAgICBsZW5ndGggPSB2YWx1ZS5sZW5ndGggKyAzOworICAgICAgICAgICAgICAgIGxlbmd0aEFycmF5WzBdID0gKGJ5dGUpKDI1NSAmIChsZW5ndGggPj4gOCkpOworICAgICAgICAgICAgICAgIGxlbmd0aEFycmF5WzFdID0gKGJ5dGUpKDI1NSAmIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGxlbmd0aEFycmF5KTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUodmFsdWUpOworICAgICAgICAgICAgICAgIGlmIChudWxsT3V0KSB7CisgICAgICAgICAgICAgICAgICAgIGhlYWRJbXBsLnNldEhlYWRlcihIZWFkZXJTZXQuREVTQ1JJUFRJT04sIG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gVGFyZ2V0IEhlYWRlcgorICAgICAgICAgICAgdmFsdWUgPSAoYnl0ZVtdKWhlYWRJbXBsLmdldEhlYWRlcihIZWFkZXJTZXQuVEFSR0VUKTsKKyAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKUhlYWRlclNldC5UQVJHRVQpOworICAgICAgICAgICAgICAgIGxlbmd0aCA9IHZhbHVlLmxlbmd0aCArIDM7CisgICAgICAgICAgICAgICAgbGVuZ3RoQXJyYXlbMF0gPSAoYnl0ZSkoMjU1ICYgKGxlbmd0aCA+PiA4KSk7CisgICAgICAgICAgICAgICAgbGVuZ3RoQXJyYXlbMV0gPSAoYnl0ZSkoMjU1ICYgbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUobGVuZ3RoQXJyYXkpOworICAgICAgICAgICAgICAgIG91dC53cml0ZSh2YWx1ZSk7CisgICAgICAgICAgICAgICAgaWYgKG51bGxPdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgaGVhZEltcGwuc2V0SGVhZGVyKEhlYWRlclNldC5UQVJHRVQsIG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gSFRUUCBIZWFkZXIKKyAgICAgICAgICAgIHZhbHVlID0gKGJ5dGVbXSloZWFkSW1wbC5nZXRIZWFkZXIoSGVhZGVyU2V0LkhUVFApOworICAgICAgICAgICAgaWYgKHZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpSGVhZGVyU2V0LkhUVFApOworICAgICAgICAgICAgICAgIGxlbmd0aCA9IHZhbHVlLmxlbmd0aCArIDM7CisgICAgICAgICAgICAgICAgbGVuZ3RoQXJyYXlbMF0gPSAoYnl0ZSkoMjU1ICYgKGxlbmd0aCA+PiA4KSk7CisgICAgICAgICAgICAgICAgbGVuZ3RoQXJyYXlbMV0gPSAoYnl0ZSkoMjU1ICYgbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUobGVuZ3RoQXJyYXkpOworICAgICAgICAgICAgICAgIG91dC53cml0ZSh2YWx1ZSk7CisgICAgICAgICAgICAgICAgaWYgKG51bGxPdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgaGVhZEltcGwuc2V0SGVhZGVyKEhlYWRlclNldC5IVFRQLCBudWxsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFdobyBIZWFkZXIKKyAgICAgICAgICAgIHZhbHVlID0gKGJ5dGVbXSloZWFkSW1wbC5nZXRIZWFkZXIoSGVhZGVyU2V0LldITyk7CisgICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dC53cml0ZSgoYnl0ZSlIZWFkZXJTZXQuV0hPKTsKKyAgICAgICAgICAgICAgICBsZW5ndGggPSB2YWx1ZS5sZW5ndGggKyAzOworICAgICAgICAgICAgICAgIGxlbmd0aEFycmF5WzBdID0gKGJ5dGUpKDI1NSAmIChsZW5ndGggPj4gOCkpOworICAgICAgICAgICAgICAgIGxlbmd0aEFycmF5WzFdID0gKGJ5dGUpKDI1NSAmIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGxlbmd0aEFycmF5KTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUodmFsdWUpOworICAgICAgICAgICAgICAgIGlmIChudWxsT3V0KSB7CisgICAgICAgICAgICAgICAgICAgIGhlYWRJbXBsLnNldEhlYWRlcihIZWFkZXJTZXQuV0hPLCBudWxsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIENvbm5lY3Rpb24gSUQgSGVhZGVyCisgICAgICAgICAgICB2YWx1ZSA9IChieXRlW10paGVhZEltcGwuZ2V0SGVhZGVyKEhlYWRlclNldC5BUFBMSUNBVElPTl9QQVJBTUVURVIpOworICAgICAgICAgICAgaWYgKHZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpSGVhZGVyU2V0LkFQUExJQ0FUSU9OX1BBUkFNRVRFUik7CisgICAgICAgICAgICAgICAgbGVuZ3RoID0gdmFsdWUubGVuZ3RoICsgMzsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVswXSA9IChieXRlKSgyNTUgJiAobGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVsxXSA9IChieXRlKSgyNTUgJiBsZW5ndGgpOworICAgICAgICAgICAgICAgIG91dC53cml0ZShsZW5ndGhBcnJheSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICBpZiAobnVsbE91dCkgeworICAgICAgICAgICAgICAgICAgICBoZWFkSW1wbC5zZXRIZWFkZXIoSGVhZGVyU2V0LkFQUExJQ0FUSU9OX1BBUkFNRVRFUiwgbnVsbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBPYmplY3QgQ2xhc3MgSGVhZGVyCisgICAgICAgICAgICB2YWx1ZSA9IChieXRlW10paGVhZEltcGwuZ2V0SGVhZGVyKEhlYWRlclNldC5PQkpFQ1RfQ0xBU1MpOworICAgICAgICAgICAgaWYgKHZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpSGVhZGVyU2V0Lk9CSkVDVF9DTEFTUyk7CisgICAgICAgICAgICAgICAgbGVuZ3RoID0gdmFsdWUubGVuZ3RoICsgMzsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVswXSA9IChieXRlKSgyNTUgJiAobGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVsxXSA9IChieXRlKSgyNTUgJiBsZW5ndGgpOworICAgICAgICAgICAgICAgIG91dC53cml0ZShsZW5ndGhBcnJheSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICBpZiAobnVsbE91dCkgeworICAgICAgICAgICAgICAgICAgICBoZWFkSW1wbC5zZXRIZWFkZXIoSGVhZGVyU2V0Lk9CSkVDVF9DTEFTUywgbnVsbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDaGVjayBVc2VyIERlZmluZWQgSGVhZGVycworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxNjsgaSsrKSB7CisKKyAgICAgICAgICAgICAgICAvL1VuaWNvZGUgU3RyaW5nIEhlYWRlcgorICAgICAgICAgICAgICAgIHN0cmluZ0hlYWRlciA9IChTdHJpbmcpaGVhZEltcGwuZ2V0SGVhZGVyKGkgKyAweDMwKTsKKyAgICAgICAgICAgICAgICBpZiAoc3RyaW5nSGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKWkgKyAweDMwKTsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBPYmV4SGVscGVyLmNvbnZlcnRUb1VuaWNvZGVCeXRlQXJyYXkoc3RyaW5nSGVhZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gdmFsdWUubGVuZ3RoICsgMzsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoQXJyYXlbMF0gPSAoYnl0ZSkoMjU1ICYgKGxlbmd0aCA+PiA4KSk7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aEFycmF5WzFdID0gKGJ5dGUpKDI1NSAmIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZShsZW5ndGhBcnJheSk7CisgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZSh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChudWxsT3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBoZWFkSW1wbC5zZXRIZWFkZXIoaSArIDB4MzAsIG51bGwpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gQnl0ZSBTZXF1ZW5jZSBIZWFkZXIKKyAgICAgICAgICAgICAgICB2YWx1ZSA9IChieXRlW10paGVhZEltcGwuZ2V0SGVhZGVyKGkgKyAweDcwKTsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoKGJ5dGUpaSArIDB4NzApOworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSB2YWx1ZS5sZW5ndGggKyAzOworICAgICAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVswXSA9IChieXRlKSgyNTUgJiAobGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoQXJyYXlbMV0gPSAoYnl0ZSkoMjU1ICYgbGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKGxlbmd0aEFycmF5KTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG51bGxPdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRJbXBsLnNldEhlYWRlcihpICsgMHg3MCwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBCeXRlIEhlYWRlcgorICAgICAgICAgICAgICAgIGJ5dGVIZWFkZXIgPSAoQnl0ZSloZWFkSW1wbC5nZXRIZWFkZXIoaSArIDB4QjApOworICAgICAgICAgICAgICAgIGlmIChieXRlSGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKWkgKyAweEIwKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKGJ5dGVIZWFkZXIuYnl0ZVZhbHVlKCkpOworICAgICAgICAgICAgICAgICAgICBpZiAobnVsbE91dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaGVhZEltcGwuc2V0SGVhZGVyKGkgKyAweEIwLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIEludGVnZXIgaGVhZGVyCisgICAgICAgICAgICAgICAgaW50SGVhZGVyID0gKExvbmcpaGVhZEltcGwuZ2V0SGVhZGVyKGkgKyAweEYwKTsKKyAgICAgICAgICAgICAgICBpZiAoaW50SGVhZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKWkgKyAweEYwKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKE9iZXhIZWxwZXIuY29udmVydFRvQnl0ZUFycmF5KGludEhlYWRlci5sb25nVmFsdWUoKSkpOworICAgICAgICAgICAgICAgICAgICBpZiAobnVsbE91dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaGVhZEltcGwuc2V0SGVhZGVyKGkgKyAweEYwLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQWRkIHRoZSBhdXRoZW50aWNhdGlvbiBjaGFsbGVuZ2UgaGVhZGVyCisgICAgICAgICAgICBpZiAoaGVhZEltcGwubUF1dGhDaGFsbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKUhlYWRlclNldC5BVVRIX0NIQUxMRU5HRSk7CisgICAgICAgICAgICAgICAgbGVuZ3RoID0gaGVhZEltcGwubUF1dGhDaGFsbC5sZW5ndGggKyAzOworICAgICAgICAgICAgICAgIGxlbmd0aEFycmF5WzBdID0gKGJ5dGUpKDI1NSAmIChsZW5ndGggPj4gOCkpOworICAgICAgICAgICAgICAgIGxlbmd0aEFycmF5WzFdID0gKGJ5dGUpKDI1NSAmIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGxlbmd0aEFycmF5KTsKKyAgICAgICAgICAgICAgICBvdXQud3JpdGUoaGVhZEltcGwubUF1dGhDaGFsbCk7CisgICAgICAgICAgICAgICAgaWYgKG51bGxPdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgaGVhZEltcGwubUF1dGhDaGFsbCA9IG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBBZGQgdGhlIGF1dGhlbnRpY2F0aW9uIHJlc3BvbnNlIGhlYWRlcgorICAgICAgICAgICAgaWYgKGhlYWRJbXBsLm1BdXRoUmVzcCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKUhlYWRlclNldC5BVVRIX1JFU1BPTlNFKTsKKyAgICAgICAgICAgICAgICBsZW5ndGggPSBoZWFkSW1wbC5tQXV0aFJlc3AubGVuZ3RoICsgMzsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVswXSA9IChieXRlKSgyNTUgJiAobGVuZ3RoID4+IDgpKTsKKyAgICAgICAgICAgICAgICBsZW5ndGhBcnJheVsxXSA9IChieXRlKSgyNTUgJiBsZW5ndGgpOworICAgICAgICAgICAgICAgIG91dC53cml0ZShsZW5ndGhBcnJheSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKGhlYWRJbXBsLm1BdXRoUmVzcCk7CisgICAgICAgICAgICAgICAgaWYgKG51bGxPdXQpIHsKKyAgICAgICAgICAgICAgICAgICAgaGVhZEltcGwubUF1dGhSZXNwID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgcmVzdWx0ID0gb3V0LnRvQnl0ZUFycmF5KCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG91dC5jbG9zZSgpOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcmVzdWx0OworCisgICAgfQorCisgICAgLyoqCisgICAgICogRGV0ZXJtaW5lcyB3aGVyZSB0aGUgbWF4aW11bSBkaXZpZGUgaXMgYmV0d2VlbiBoZWFkZXJzLiBUaGlzIG1ldGhvZCBpcworICAgICAqIHVzZWQgYnkgcHV0IGFuZCBnZXQgb3BlcmF0aW9ucyB0byBzZXBhcmF0ZSBoZWFkZXJzIHRvIGEgc2l6ZSB0aGF0IG1lZXRzCisgICAgICogdGhlIG1heCBwYWNrZXQgc2l6ZSBhbGxvd2VkLgorICAgICAqIEBwYXJhbSBoZWFkZXJBcnJheSB0aGUgaGVhZGVycyB0byBzZXBhcmF0ZQorICAgICAqIEBwYXJhbSBzdGFydCB0aGUgc3RhcnRpbmcgaW5kZXggdG8gc2VhcmNoCisgICAgICogQHBhcmFtIG1heFNpemUgdGhlIG1heGltdW0gc2l6ZSBvZiBhIHBhY2tldAorICAgICAqIEByZXR1cm4gdGhlIGluZGV4IG9mIHRoZSBlbmQgb2YgdGhlIGhlYWRlciBibG9jayB0byBzZW5kIG9yIC0xIGlmIHRoZQorICAgICAqICAgICAgICAgaGVhZGVyIGNvdWxkIG5vdCBiZSBkaXZpZGVkIGJlY2F1c2UgdGhlIGhlYWRlciBpcyB0b28gbGFyZ2UKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGludCBmaW5kSGVhZGVyRW5kKGJ5dGVbXSBoZWFkZXJBcnJheSwgaW50IHN0YXJ0LCBpbnQgbWF4U2l6ZSkgeworCisgICAgICAgIGludCBmdWxsTGVuZ3RoID0gMDsKKyAgICAgICAgaW50IGxhc3RMZW5ndGggPSAtMTsKKyAgICAgICAgaW50IGluZGV4ID0gc3RhcnQ7CisgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgIHdoaWxlICgoZnVsbExlbmd0aCA8IG1heFNpemUpICYmIChpbmRleCA8IGhlYWRlckFycmF5Lmxlbmd0aCkpIHsKKyAgICAgICAgICAgIGludCBoZWFkZXJJRCA9IChoZWFkZXJBcnJheVtpbmRleF0gPCAwID8gaGVhZGVyQXJyYXlbaW5kZXhdICsgMjU2IDogaGVhZGVyQXJyYXlbaW5kZXhdKTsKKyAgICAgICAgICAgIGxhc3RMZW5ndGggPSBmdWxsTGVuZ3RoOworCisgICAgICAgICAgICBzd2l0Y2ggKGhlYWRlcklEICYgKDB4QzApKSB7CisKKyAgICAgICAgICAgICAgICBjYXNlIDB4MDA6CisgICAgICAgICAgICAgICAgICAgIC8vIEZhbGwgdGhyb3VnaAorICAgICAgICAgICAgICAgIGNhc2UgMHg0MDoKKworICAgICAgICAgICAgICAgICAgICBpbmRleCsrOworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSAoaGVhZGVyQXJyYXlbaW5kZXhdIDwgMCA/IGhlYWRlckFycmF5W2luZGV4XSArIDI1NgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogaGVhZGVyQXJyYXlbaW5kZXhdKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gbGVuZ3RoIDw8IDg7CisgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCArPSAoaGVhZGVyQXJyYXlbaW5kZXhdIDwgMCA/IGhlYWRlckFycmF5W2luZGV4XSArIDI1NgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogaGVhZGVyQXJyYXlbaW5kZXhdKTsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIC09IDM7CisgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CisgICAgICAgICAgICAgICAgICAgIGluZGV4ICs9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgZnVsbExlbmd0aCArPSBsZW5ndGggKyAzOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgMHg4MDoKKworICAgICAgICAgICAgICAgICAgICBpbmRleCsrOworICAgICAgICAgICAgICAgICAgICBpbmRleCsrOworICAgICAgICAgICAgICAgICAgICBmdWxsTGVuZ3RoICs9IDI7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSAweEMwOgorCisgICAgICAgICAgICAgICAgICAgIGluZGV4ICs9IDU7CisgICAgICAgICAgICAgICAgICAgIGZ1bGxMZW5ndGggKz0gNTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogRGV0ZXJtaW5lIGlmIHRoaXMgaXMgdGhlIGxhc3QgaGVhZGVyIG9yIG5vdAorICAgICAgICAgKi8KKyAgICAgICAgaWYgKGxhc3RMZW5ndGggPT0gMCkgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIFNpbmNlIHRoaXMgaXMgdGhlIGxhc3QgaGVhZGVyLCBjaGVjayB0byBzZWUgaWYgdGhlIHNpemUgb2YgdGhpcworICAgICAgICAgICAgICogaGVhZGVyIGlzIGxlc3MgdGhlbiBtYXhTaXplLiAgSWYgaXQgaXMsIHJldHVybiB0aGUgbGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICogaGVhZGVyLCBvdGhlcndpc2UgcmV0dXJuIC0xLiAgVGhlIGxlbmd0aCBvZiB0aGUgaGVhZGVyIGlzCisgICAgICAgICAgICAgKiByZXR1cm5lZCBzaW5jZSBpdCB3b3VsZCBiZSB0aGUgc3RhcnQgb2YgdGhlIG5leHQgaGVhZGVyCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChmdWxsTGVuZ3RoIDwgbWF4U2l6ZSkgeworICAgICAgICAgICAgICAgIHJldHVybiBoZWFkZXJBcnJheS5sZW5ndGg7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBsYXN0TGVuZ3RoICsgc3RhcnQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb252ZXJ0cyB0aGUgYnl0ZSBhcnJheSB0byBhIGxvbmcuCisgICAgICogQHBhcmFtIGIgdGhlIGJ5dGUgYXJyYXkgdG8gY29udmVydCB0byBhIGxvbmcKKyAgICAgKiBAcmV0dXJuIHRoZSBieXRlIGFycmF5IGFzIGEgbG9uZworICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgbG9uZyBjb252ZXJ0VG9Mb25nKGJ5dGVbXSBiKSB7CisgICAgICAgIGxvbmcgcmVzdWx0ID0gMDsKKyAgICAgICAgbG9uZyB2YWx1ZSA9IDA7CisgICAgICAgIGxvbmcgcG93ZXIgPSAwOworCisgICAgICAgIGZvciAoaW50IGkgPSAoYi5sZW5ndGggLSAxKTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgIHZhbHVlID0gYltpXTsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA8IDApIHsKKyAgICAgICAgICAgICAgICB2YWx1ZSArPSAyNTY7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdCB8ICh2YWx1ZSA8PCBwb3dlcik7CisgICAgICAgICAgICBwb3dlciArPSA4OworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb252ZXJ0cyB0aGUgbG9uZyB0byBhIDQgYnl0ZSBhcnJheS4gVGhlIGxvbmcgbXVzdCBiZSBub24gbmVnYXRpdmUuCisgICAgICogQHBhcmFtIGwgdGhlIGxvbmcgdG8gY29udmVydAorICAgICAqIEByZXR1cm4gYSBieXRlIGFycmF5IHRoYXQgaXMgdGhlIHNhbWUgYXMgdGhlIGxvbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGJ5dGVbXSBjb252ZXJ0VG9CeXRlQXJyYXkobG9uZyBsKSB7CisgICAgICAgIGJ5dGVbXSBiID0gbmV3IGJ5dGVbNF07CisKKyAgICAgICAgYlswXSA9IChieXRlKSgyNTUgJiAobCA+PiAyNCkpOworICAgICAgICBiWzFdID0gKGJ5dGUpKDI1NSAmIChsID4+IDE2KSk7CisgICAgICAgIGJbMl0gPSAoYnl0ZSkoMjU1ICYgKGwgPj4gOCkpOworICAgICAgICBiWzNdID0gKGJ5dGUpKDI1NSAmIGwpOworCisgICAgICAgIHJldHVybiBiOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnZlcnRzIHRoZSBTdHJpbmcgdG8gYSBVTklDT0RFIGJ5dGUgYXJyYXkuIEl0IHdpbGwgYWxzbyBhZGQgdGhlIGVuZGluZworICAgICAqIG51bGwgY2hhcmFjdGVycyB0byB0aGUgZW5kIG9mIHRoZSBzdHJpbmcuCisgICAgICogQHBhcmFtIHMgdGhlIHN0cmluZyB0byBjb252ZXJ0CisgICAgICogQHJldHVybiB0aGUgdW5pY29kZSBieXRlIGFycmF5IG9mIHRoZSBzdHJpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGJ5dGVbXSBjb252ZXJ0VG9Vbmljb2RlQnl0ZUFycmF5KFN0cmluZyBzKSB7CisgICAgICAgIGlmIChzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworIC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GV0KSB7CisKKyAgICAgICAgaW50IGluZGV4ID0gZmluZFRhZyh0YWcsIHRyaXBsZXQpOworICAgICAgICBpZiAoaW5kZXggPT0gLTEpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgaW50IGxlbmd0aCA9IHRyaXBsZXRbaW5kZXhdICYgMHhGRjsKKworICAgICAgICBieXRlW10gcmVzdWx0ID0gbmV3IGJ5dGVbbGVuZ3RoXTsKKyAgICAgICAgaW5kZXgrKzsKKyAgICAgICAgU3lzdGVtLmFycmF5Y29weSh0cmlwbGV0LCBpbmRleCwgcmVzdWx0LCAwLCBsZW5ndGgpOworCisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogRmluZHMgdGhlIGluZGV4IHRoYXQgc3RhcnRzIHRoZSB0YWcgdmFsdWUgcGFpciBpbiB0aGUgYnl0ZSBhcnJheSBwcm92aWRlLgorICAgICAqIEBwYXJhbSB0YWcgdGhlIHRhZyB0byBsb29rIGZvcgorICAgICAqIEBwYXJhbSB2YWx1ZSB0aGUgYnl0ZSBhcnJheSB0byBzZWFyY2gKKyAgICAgKiBAcmV0dXJuIHRoZSBzdGFydGluZyBpbmRleCBvZiB0aGUgdGFnIG9yIC0xIGlmIHRoZSB0YWcgY291bGQgbm90IGJlIGZvdW5kCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBpbnQgZmluZFRhZyhieXRlIHRhZywgYnl0ZVtdIHZhbHVlKSB7CisgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0KKworICAgICAgICBpbnQgaW5kZXggPSAwOworCisgICAgICAgIHdoaWxlICgoaW5kZXggPCB2YWx1ZS5sZW5ndGgpICYmICh2YWx1ZVtpbmRleF0gIT0gdGFnKSkgeworICAgICAgICAgICAgbGVuZ3RoID0gdmFsdWVbaW5kZXggKyAxXSAmIDB4RkY7CisgICAgICAgICAgICBpbmRleCArPSBsZW5ndGggKyAyOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGluZGV4ID49IHZhbHVlLmxlbmd0aCkgeworICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGluZGV4OworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnZlcnRzIHRoZSBieXRlIGFycmF5IHByb3ZpZGVkIHRvIGEgdW5pY29kZSBzdHJpbmcuCisgICAgICogQHBhcmFtIGIgdGhlIGJ5dGUgYXJyYXkgdG8gY29udmVydCB0byBhIHN0cmluZworICAgICAqIEBwYXJhbSBpbmNsdWRlc051bGwgZGV0ZXJtaW5lIGlmIHRoZSBieXRlIHN0cmluZyBwcm92aWRlZCBjb250YWlucyB0aGUKKyAgICAgKiAgICAgICAgVU5JQ09ERSBudWxsIGNoYXJhY3RlciBhdCB0aGUgZW5kIG9yIG5vdDsgaWYgaXQgZG9lcywgaXQgd2lsbCBiZQorICAgICAqICAgICAgICByZW1vdmVkCisgICAgICogQHJldHVybiBhIFVuaWNvZGUgc3RyaW5nCisgICAgICogQHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gaWYgdGhlIGJ5dGUgYXJyYXkgaGFzIGFuIG9kZCBsZW5ndGgKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBjb252ZXJ0VG9Vbmljb2RlKGJ5dGVbXSBiLCBib29sZWFuIGluY2x1ZGVzTnVsbCkgeworICAgICAgICBpZiAoYiA9PSBudWxsIHx8IGIubGVuZ3RoID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIGludCBhcnJheUxlbmd0aCA9IGIubGVuZ3RoOworICAgICAgICBpZiAoISgoYXJyYXlMZW5ndGggJSAyKSA9PSAwKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQnl0ZSBhcnJheSBub3Qgb2YgYSB2YWxpZCBmb3JtIik7CisgICAgICAgIH0KKyAgICAgICAgYXJyYXlMZW5ndGggPSAoYXJyYXlMZW5ndGggPj4gMSk7CisgICAgICAgIGlmIChpbmNsdWRlc051bGwpIHsKKyAgICAgICAgICAgIGFycmF5TGVuZ3RoIC09IDE7CisgICAgICAgIH0KKworICAgICAgICBjaGFyW10gYyA9IG5ldyBjaGFyW2FycmF5TGVuZ3RoXTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhcnJheUxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBpbnQgdXBwZXIgPSBiWzIgKiBpXTsKKyAgICAgICAgICAgIGludCBsb3dlciA9IGJbKDIgKiBpKSArIDFdOworICAgICAgICAgICAgaWYgKHVwcGVyIDwgMCkgeworICAgICAgICAgICAgICAgIHVwcGVyICs9IDI1NjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChsb3dlciA8IDApIHsKKyAgICAgICAgICAgICAgICBsb3dlciArPSAyNTY7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBJZiB1cHBlciBhbmQgbG93ZXIgYm90aCBlcXVhbCAwLCBpdCBzaG91bGQgYmUgdGhlIGVuZCBvZiBzdHJpbmcuCisgICAgICAgICAgICAvLyBJZ25vcmUgbGVmdCBieXRlcyBmcm9tIGFycmF5IHRvIGF2b2lkIHBvdGVudGlhbCBpc3N1ZXMKKyAgICAgICAgICAgIGlmICh1cHBlciA9PSAwICYmIGxvd2VyID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0cmluZyhjLCAwLCBpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY1tpXSA9IChjaGFyKSgodXBwZXIgPDwgOCkgfCBsb3dlcik7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbmV3IFN0cmluZyhjKTsKK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ZSB3aWxsIHVzZQorICAgICAgICAgKiAgICAgICAgICB0aGUgSVNPIDg4NTktMSBlbmNvZGluZyBzY2hlbWUgc2luY2UgaXQgaXMgcGFydCBvZiB0aGUgS1ZNCisgICAgICAgICAqIGJ5dGUgMjQgJiB1cDogdGhlIHJlYWxtIGlmIG9uZSBpcyBzcGVjaWZpZWQuCisgICAgICAgICAqLworICAgICAgICBpZiAocmVhbG0gPT0gbnVsbCkgeworICAgICAgICAgICAgYXV0aENoYWxsID0gbmV3IGJ5dGVbMjFdOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKHJlYWxtLmxlbmd0aCgpID49IDI1NSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlJlYWxtIG11c3QgYmUgbGVzcyB0aGVuIDI1NSBieXRlcyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYXV0aENoYWxsID0gbmV3IGJ5dGVbMjQgKyByZWFsbS5sZW5ndGgoKV07CisgICAgICAgICAgICBhdXRoQ2hhbGxbMjFdID0gMHgwMjsKKyAgICAgICAgICAgIGF1dGhDaGFsbFsyMl0gPSAoYnl0ZSkocmVhbG0ubGVuZ3RoKCkgKyAxKTsKKyAgICAgICAgICAgIGF1dGhDaGFsbFsyM10gPSAweDAxOyAvLyBJU08gODg1OS0xIEVuY29kaW5nCisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHJlYWxtLmdldEJ5dGVzKCJJU084ODU5XzEiKSwgMCwgYXV0aENoYWxsLCAyNCwgcmVhbG0ubGVuZ3RoKCkpOworICAgICAgICB9CisKKyAgICAgICAgLy8gSW5jbHVkZSB0aGUgbm9uY2UgZmllbGQgaW4gdGhlIGhlYWRlcgorICAgICAgICBhdXRoQ2hhbGxbMF0gPSAweDAwOworICAgICAgICBhdXRoQ2hhbGxbMV0gPSAweDEwOworICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG5vbmNlLCAwLC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hhbGwpOworICAgICAgICBieXRlW10gZGVzY3JpcHRpb24gPSBPYmV4SGVscGVyLmdldFRhZ1ZhbHVlKChieXRlKTB4MDIsIGhlYWRlci5tQXV0aENoYWxsKTsKKworICAgICAgICBTdHJpbmcgcmVhbG0gPSBudWxsOworICAgICAgICBpZiAoZGVzY3JpcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgYnl0ZVtdIHJlYWxtU3RyaW5nID0gbmV3IGJ5dGVbZGVzY3JpcHRpb24ubGVuZ3RoIC0gMV07CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGRlc2NyaXB0aW9uLCAxLCByZWFsbVN0cmluZywgMCwgcmVhbG1TdHJpbmcubGVuZ3RoKTsKKworICAgICAgICAgICAgc3dpdGNoIChkZXNjcmlwdGlvblswXSAmIDB4RkYpIHsKKworICAgICAgICAgICAgICAgIGNhc2UgT2JleEhlbHBlci5PQkVYX0FVVEhfUkVBTE1fQ0hBUlNFVF9BU0NJSToKKyAgICAgICAgICAgICAgICAgICAgLy8gQVNDSUkgZW5jb2RpbmcKKyAgICAgICAgICAgICAgICAgICAgLy8gRmFsbCB0aHJvdWdoCisgICAgICAgICAgICAgICAgY2FzZSBPYmV4SGVscGVyLk9CRVhfQVVUSF9SRUFMTV9DSEFSU0VUX0lTT184ODU5XzE6CisgICAgICAgICAgICAgICAgICAgIC8vIElTTy04ODU5LTEgZW5jb2RpbmcKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlYWxtID0gbmV3IFN0cmluZyhyZWFsbVN0cmluZywgIklTTzg4NTlfMSIpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJVbnN1cHBvcnRlZCBFbmNvZGluZyBTY2hlbWUiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgT2JleEhlbHBlci5PQkVYX0FVVEhfUkVBTE1fQ0hBUlNFVF9VTklDT0RFOgorICAgICAgICAgICAgICAgICAgICAvLyBVTklDT0RFIEVuY29kaW5nCisgICAgICAgICAgICAgICAgICAgIHJlYWxtID0gT2JleEhlbHBlci5jb252ZXJ0VG9Vbmljb2RlKHJlYWxtU3RyaW5nLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJVbnN1cHBvcnRlZCBFbmNvZGluZyBTY2hlbWUiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gaXNVc2VySURSZXF1aXJlZCA9IGZhbHNlOworICAgICAgICBib29sZWFuIGlzRnVsbEFjY2VzcyA9IHRydWU7CisgICAgICAgIGlmIChvcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKChvcHRpb25bMF0gJiAweDAxKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgaXNVc2VySURSZXF1aXJlZCA9IHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICgob3B0aW9uWzBdICYgMHgwMikgIT0gMCkgeworICAgICAgICAgICAgICAgIGlzRnVsbEFjY2VzcyA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgUGFzc3dvcmRBdXRoZW50aWNhdGlvbiByZXN1bHQgPSBudWxsOworICAgICAgICBoZWFkZXIubUF1dGhDaGFsbCA9IG51bGw7CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlc3VsdCA9IG1BdXRoZW50aWNhdG9yCisgICAgICAgICAgICAgICAgICAgIC5vbkF1dGhlbnRpY2F0aW9uQ2hhbGxlbmdlKHJlYWxtLCBpc1VzZXJJRFJlcXVpcmVkLCBpc0Z1bGxBY2Nlc3MpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogSWYgbm8gcGFzc3dvcmQgaXMgcHJvdmlkZWQgdGhlbiB3ZSBub3QgcmVzZW50IHRoZSByZXF1ZXN0CisgICAgICAgICAqLworICAgICAgICBpZiAocmVzdWx0ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGJ5dGVbXSBwYXNzd29yZCA9IHJlc3VsdC5nZXRQYXNzd29yZCgpOworICAgICAgICBpZiAocGFzc3dvcmQgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgYnl0ZVtdIHVzZXJOYW1lID0gcmVzdWx0LmdldFVzZXJOYW1lKCk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogQ3JlYXRlIHRoZSBhdXRoZW50aWNhdGlvbiByZXNwb25zZSBoZWFkZXIuIEl0IGluY2x1ZGVzIDEgcmVxdWlyZWQgYW5kCisgICAgICAgICAqIDIgb3B0aW9uIHRhZyBsZW5ndGggdmFsdWUgdHJpcGxlcy4gVGhlIHJlcXVpcmVkIHRyaXBsZSBoYXMgYSB0YWcgb2YKKyAgICAgICAgICogMHgwMCBhbmQgaXMgdGhlIHJlc3BvbnNlIGRpZ2VzdC4gVGhlIGZpcnN0IG9wdGlvbmFsIHRhZyBpcyAweDAxIGFuZAorICAgICAgICAgKiByZXByZXNlbnRzIHRoZSB1c2VyIElELiBJZiBubyB1c2VyIElEIGlzIHByb3ZpZGVkLCB0aGVuIG5vIHVzZXIgSUQKKyAgICAgICAgICogd2lsbCBiZSBzZW50LiBUaGUgc2Vjb25kIG9wdGlvbmFsIHRhZyBpcyAweDAyIGFuZCBpcyB0aGUgY2hh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93cyBJT0V4Y2VwdGlvbiBpZiBhbiBJL08gZXJyb3Igb2NjdXJzCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHN5bmNocm9uaXplZCBpbnQgcmVhZCgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIGVuc3VyZU9wZW4oKTsKKyAgICAgICAgd2hpbGUgKG1EYXRhLmxlbmd0aCA9PSBtSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICghbVBhcmVudC5jb250aW51ZU9wZXJhdGlvbih0cnVlLCB0cnVlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gKG1EYXRhW21JbmRleCsrXSAmIDB4RkYpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBpbnQgcmVhZChieXRlW10gYikgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgcmV0dXJuIHJlYWQoYiwgMCwgYi5sZW5ndGgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IHJlYWQoYnl0ZVtdIGIsIGludCBvZmZzZXQsIGludCBsZW5ndGgpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgaWYgKGIgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJidWZmZXIgaXMgbnVsbCIpOworICAgICAgICB9CisgICAgICAgIGlmICgob2Zmc2V0IHwgbGVuZ3RoKSA8IDAgfHwgbGVuZ3RoID4gYi5sZW5ndGggLSBvZmZzZXQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBBcnJheUluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oImluZGV4IG91dG9mIGJvdW5kIik7CisgICAgICAgIH0KKyAgICAgICAgZW5zdXJlT3BlbigpOworCisgICAgICAgIGludCBjdXJyZW50RGF0YUxlbmd0aCA9IG1EYXRhLmxlbmd0aCAtIG1JbmRleDsKKyAgICAgICAgaW50IHJlbWFpblJlYWRMZW5ndGggPSBsZW5ndGg7CisgICAgICAgIGludCBvZmZzZXQxID0gb2Zmc2V0OworICAgICAgICBpbnQgcmVzdWx0ID0gMDsKKworICAgICAgICB3aGlsZSAoY3VycmVudERhdGFMZW5ndGggPD0gcmVtYWluUmVhZExlbmd0aCkgeworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtRGF0YSwgbUluZGV4LCBiLCBvZmZzZXQxLCBjdXJyZW50RGF0YUxlbmd0aCk7CisgICAgICAgICAgICBtSW5kZXggKz0gY3VycmVudERhdGFMZW5ndGg7CisgICAgICAgICAgICBvZmZzZXQxICs9IGN1cnJlbnREYXRhTGVuZ3RoOworICAgICAgICAgICAgcmVzdWx0ICs9IGN1cnJlbnREYXRhTGVuZ3RoOworICAgICAgICAgICAgcmVtYWluUmVhZExlbmd0aCAtPSBjdXJyZW50RGF0YUxlbmd0aDsKKworICAgICAgICAgICAgaWYgKCFtUGFyZW50LmNvbnRpbnVlT3BlcmF0aW9uKHRydWUsIHRydWUpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCA9PSAwID8gLTEgOiByZXN1bHQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjdXJyZW50RGF0YUxlbmd0aCA9IG1EYXRhLmxlbmd0aCAtIG1JbmRleDsKKyAgICAgICAgfQorICAgICAgICBpZiAocmVtYWluUmVhZExlbmd0aCA+IDApIHsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkobURhdGEsIG1JbmRleCwgYiwgb2Zmc2V0MSwgcmVtYWluUmVhZExlbmd0aCk7CisgICAgICAgICAgICBtSW5kZXggKz0gcmVtYWluUmVhZExlbmd0aDsKKyAgICAgICAgICAgIHJlc3VsdCArPSByZW1haW5SZWFkTGVuZ3RoOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7Cisg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IG9mZnNldCwgaW50IGNvdW50KSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpbnQgb2Zmc2V0MSA9IG9mZnNldDsKKyAgICAgICAgaW50IHJlbWFpbkxlbmd0aCA9IGNvdW50OworCisgICAgICAgIGlmIChidWZmZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJidWZmZXIgaXMgbnVsbCIpOworICAgICAgICB9CisgICAgICAgIGlmICgob2Zmc2V0IHwgY291bnQpIDwgMCB8fCBjb3VudCA+IGJ1ZmZlci5sZW5ndGggLSBvZmZzZXQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uKCJpbmRleCBvdXRvZiBib3VuZCIpOworICAgICAgICB9CisKKyAgICAgICAgZW5zdXJlT3BlbigpOworICAgICAgICBtUGFyZW50LmVuc3VyZU5vdERvbmUoKTsKKyAgICAgICAgaWYgKGNvdW50IDwgbU1heFBhY2tldFNpemUpIHsKKyAgICAgICAgICAgIG1BcnJheS53cml0ZShidWZmZXIsIG9mZnNldCwgY291bnQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgd2hpbGUgKHJlbWFpbkxlbmd0aCA+PSBtTWF4UGFja2V0U2l6ZSkgeworICAgICAgICAgICAgICAgIG1BcnJheS53cml0ZShidWZmZXIsIG9mZnNldDEsIG1NYXhQYWNrZXRTaXplKTsKKyAgICAgICAgICAgICAgICBvZmZzZXQxICs9IG1NYXhQYWNrZXRTaXplOworICAgICAgICAgICAgICAgIHJlbWFpbkxlbmd0aCA9IGNvdW50IC0gb2Zmc2V0MTsKKyAgICAgICAgICAgICAgICBtUGFyZW50LmNvbnRpbnVlT3BlcmF0aW9uKHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChyZW1haW5MZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgbUFycmF5LndyaXRlKGJ1ZmZlciwgb2Zmc2V0MSwgcmVtYWluTGVuZ3RoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJlYWRzIHRoZSBieXRlcyB0aGF0IGhhdmUgYmVlbiB3cml0dGVuIHRvIHRoaXMgc3RyZWFtLgorICAgICAqIEBwYXJhbSBzaXplIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byByZXR1cm4KKyAgICAgKiBAcmV0dXJuIHRoZSBieXRlIGFycmF5IHRoYXQgaXMgd3JpdHRlbgorICAgICAqLworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYnl0ZVtdIHJlYWRCeXRlcyhpbnQgc2l6ZSkgeworICAgICAgICBpZiAobUFycmF5LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIGJ5dGVbXSB0ZW1wID0gbUFycmF5LnRvQnl0ZUFycmF5KCk7CisgICAgICAgICAgICBtQXJyYXkucmVzZXQoKTsKKyAgICAgICAgICAgIGJ5dGVbXSByZXN1bHQgPSBuZXcgYnl0ZVtzaXplXTsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkodGVtcCwgMCwgcmVzdWx0LCAwLCBzaXplKTsKKyAgICAgICAgICAgIGlmICh0ZW1wLmxlbmd0aCAhPSBzaXplKSB7CisgICAgICAgICAgICAgICAgbUFycmF5LndyaXRlKHRlbXAsIHNpemUsIHRlbXAubGVuZ3RoIC0gc2l6ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBWZXJpZmllcyB0aGF0IHRoaXMgc3RyZWFtIGlzIG9wZW4KKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIGlmIHRoZSBzdHJlYW0gaXMgbm90IG9wZW4KKyAgICAgKi8KKyAgICBwcml2YX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HRoZSByZXF1ZXN0CisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBpZiBhbiBJTyBlcnJvciBvY2N1cnMKKyAgICAgKi8KKyAgICBwdWJsaWMgU2VydmVyT3BlcmF0aW9uKFNlcnZlclNlc3Npb24gcCwgSW5wdXRTdHJlYW0gaW4sIGludCByZXF1ZXN0LCBpbnQgbWF4U2l6ZSwKKyAgICAgICAgICAgIFNlcnZlclJlcXVlc3RIYW5kbGVyIGxpc3RlbikgdGhyb3dzIElPRXhjZXB0aW9uIHsKKworICAgICAgICBpc0Fib3J0ZWQgPSBmYWxzZTsKKyAgICAgICAgbVBhcmVudCA9IHA7CisgICAgICAgIG1JbnB1dCA9IGluOworICAgICAgICBtTWF4UGFja2V0TGVuZ3RoID0gbWF4U2l6ZTsKKyAgICAgICAgbUNsb3NlZCA9IGZhbHNlOworICAgICAgICByZXF1ZXN0SGVhZGVyID0gbmV3IEhlYWRlclNldCgpOworICAgICAgICByZXBseUhlYWRlciA9IG5ldyBIZWFkZXJTZXQoKTsKKyAgICAgICAgbVByaXZhdGVJbnB1dCA9IG5ldyBQcml2YXRlSW5wdXRTdHJlYW0odGhpcyk7CisgICAgICAgIG1SZXNwb25zZVNpemUgPSAzOworICAgICAgICBtTGlzdGVuZXIgPSBsaXN0ZW47CisgICAgICAgIG1SZXF1ZXN0RmluaXNoZWQgPSBmYWxzZTsKKyAgICAgICAgbVByaXZhdGVPdXRwdXRPcGVuID0gZmFsc2U7CisgICAgICAgIG1IYXNCb2R5ID0gZmFsc2U7CisgICAgICAgIGludCBieXRlc1JlY2VpdmVkOworCisgICAgICAgIC8qCisgICAgICAgICAqIERldGVybWluZSBpZiB0aGlzIGlzIGEgUFVUIHJlcXVlc3QKKyAgICAgICAgICovCisgICAgICAgIGlmICgocmVxdWVzdCA9PSAweDAyKSB8fCAocmVxdWVzdCA9PSAweDgyKSkgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIEl0IGlzIGEgUFVUIHJlcXVlc3QuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIG1HZXRPcGVyYXRpb24gPSBmYWxzZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBJdCBpcyBhIEdFVCByZXF1ZXN0LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBtR2V0T3BlcmF0aW9uID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIERldGVybWluZSBpZiB0aGUgZmluYWwgYml0IGlzIHNldAorICAgICAgICAgKi8KKyAgICAgICAgaWYgKChyZXF1ZXN0ICYgMHg4MCkgPT0gMCkgeworICAgICAgICAgICAgZmluYWxCaXRTZXQgPSBmYWxzZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGZpbmFsQml0U2V0ID0gdHJ1ZTsKKyAgICAgICAgICAgIG1SZXF1ZXN0RmluaXNoZWQgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgaW50IGxlbmd0aCA9IGluLnJlYWQoKTsKKyAgICAgICAgbGVuZ3RoID0gKGxlbmd0aCA8PCA4KSArIGluLnJlYWQoKTsKKworICAgICAgICAvKgorICAgICAgICAgKiBEZXRlcm1pbmUgaWYgdGhlIHBhY2tldCBsZW5ndGggaXMgbGFyZ2VyIHRoYW4gdGhpcyBkZXZpY2UgY2FuIHJlY2VpdmUKKyAgICAgICAgICovCisgICAgICAgIGlmIChsZW5ndGggPiBPYmV4SGVscGVyLk1BWF9QQUNLRVRfU0laRV9JTlQpIHsKKyAgICAgICAgICAgIG1QYXJlbnQuc2VuZFJlc3BvbnNlKFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1JFUV9UT09fTEFSR0UsIG51bGwpOworICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJQYWNrZXQgcmVjZWl2ZWQgd2FzIHRvbyBsYXJnZSIpOworICAgICAgICB9CisKKyAgICAgICAgLyoKKyAgICAgICAgICogRGV0ZXJtaW5lIGlmIGFueSBoZWFkZXJzIHdlcmUgc2VudCBpbiB0aGUgaW5pdGlhbCByZXF1ZXN0CisgICAgICAgICAqLworICAgICAgICBpZiAobGVuZ3RoID4gMykgeworICAgICAgICAgICAgYnl0ZVtdIGRhdGEgPSBuZXcgYnl0ZVtsZW5ndGggLSAzXTsKKyAgICAgICAgICAgIGJ5dGVzUmVjZWl2ZWQgPSBpbi5yZWFkKGRhdGEpOworCisgICAgICAgICAgICB3aGlsZSAoYnl0ZXNSZWNlaXZlZCAhPSBkYXRhLmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGJ5dGVzUmVjZWl2ZWQgKz0gaW4ucmVhZChkYXRhLCBieXRlc1JlY2VpdmVkLCBkYXRhLmxlbmd0aCAtIGJ5dGVzUmVjZWl2ZWQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBieXRlW10gYm9keSA9IE9iZXhIZWxwZXIudXBkYXRlSGVhZGVyU2V0KHJlcXVlc3RIZWFkZXIsIGRhdGEpOworCisgICAgICAgICAgICBpZiAoYm9keSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUhhc0JvZHkgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocmVxdWVzdEhlYWRlci5tQ29ubmVjdGlvbklEICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtTGlzdGVuZXIuc2V0Q29ubmVjdGlvbklkKE9iZXhIZWxwZXIuY29udmVydFRvTG9uZyhyZXF1ZXN0SGVhZGVyLm1Db25uZWN0aW9uSUQpKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUxpc3RlbmVyLnNldENvbm5lY3Rpb25JZCgwKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHJlcXVlc3RIZWFkZXIubUF1dGhSZXNwICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW1QYXJlbnQuaGFuZGxlQXV0aFJlc3AocmVxdWVzdEhlYWRlci5tQXV0aFJlc3ApKSB7CisgICAgICAgICAgICAgICAgICAgIG1FeGNlcHRpb25TdHJpbmcgPSAiQXV0aGVudGljYXRpb24gRmFpbGVkIjsKKyAgICAgICAgICAgICAgICAgICAgbVBhcmVudC5zZW5kUmVzcG9uc2UoUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfVU5BVVRIT1JJWkVELCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgbUNsb3NlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RIZWFkZXIubUF1dGhSZXNwID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHJlcXVlc3RIZWFkZXIubUF1dGhDaGFsbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVBhcmVudC5oYW5kbGVBdXRoQ2hhbGwocmVxdWVzdEhlYWRlcik7CisgICAgICAgICAgICAgICAgLy8gc2VuZCB0aGUgIGF1dGhSZXNwIHRvIHRoZSBjbGllbnQKKyAgICAgICAgICAgICAgICByZXBseUhlYWRlci5tQXV0aFJlc3AgPSBuZXcgYnl0ZVtyZXF1ZXN0SGVhZGVyLm1BdXRoUmVzcC5sZW5ndGhdOworICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkocmVxdWVzdEhlYWRlci5tQXV0aFJlc3AsIDAsIHJlcGx5SGVhZGVyLm1BdXRoUmVzcCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5SGVhZGVyLm1BdXRoUmVzcC5sZW5ndGgpOworICAgICAgICAgICAgICAgIHJlcXVlc3RIZWFkZXIubUF1dGhSZXNwID0gbnVsbDsKKyAgICAgICAgICAgICAgICByZXF1ZXN0SGVhZGVyLm1BdXRoQ2hhbGwgPSBudWxsOworCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChib2R5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUHJpdmF0ZUlucHV0LndyaXRlQnl0ZXMoYm9keSwgMSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHdoaWxlICgoIW1HZXRPcGVyYXRpb24pICYmICghZmluYWxCaXRTZXQpKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbmRSZXBseShSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtUHJpdmF0ZUlucHV0LmF2YWlsYWJsZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB3aGlsZSAoKCFtR2V0T3BlcmF0aW9uKSAmJiAoIWZpbmFsQml0U2V0KSAmJiAobVByaXZhdGVJbnB1dC5hdmFpbGFibGUoKSA9PSAwKSkgeworICAgICAgICAgICAgc2VuZFJlcGx5KFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFKTsKKyAgICAgICAgICAgIGlmIChtUHJpdmF0ZUlucHV0LmF2YWlsYWJsZSgpID4gMCkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gd2FpdCBmb3IgZ2V0IHJlcXVlc3QgZmluaXNoZWQgISEhIQorICAgICAgICB3aGlsZSAobUdldE9wZXJhdGlvbiAmJiAhZmluYWxCaXRTZXQpIHsKKyAgICAgICAgICAgIHNlbmRSZXBseShSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZpbmFsQml0U2V0ICYmIG1HZXRPcGVyYXRpb24pIHsKKyAgICAgICAgICAgIG1SZXF1ZXN0RmluaXNoZWQgPS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dHJlYW0pCisgICAgICAgICAgICB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBpZiAoIW1HZXRPcGVyYXRpb24pIHsKKyAgICAgICAgICAgIGlmICghZmluYWxCaXRTZXQpIHsKKyAgICAgICAgICAgICAgICBpZiAoc2VuZEVtcHR5KSB7CisgICAgICAgICAgICAgICAgICAgIHNlbmRSZXBseShSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgobVJlc3BvbnNlU2l6ZSA+IDMpIHx8IChtUHJpdmF0ZU91dHB1dC5zaXplKCkgPiAwKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZFJlcGx5KFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0NPTlRJTlVFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzZW5kUmVwbHkoUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZW5kcyBhIHJlcGx5IHRvIHRoZSBjbGllbnQuIElmIHRoZSByZXBseSBpcyBhIE9CRVhfSFRUUF9DT05USU5VRSwgaXQKKyAgICAgKiB3aWxsIHdhaXQgZm9yIGEgcmVzcG9uc2UgZnJvbSB0aGUgY2xpZW50IG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XIuY3JlYXRlSGVhZGVyKHJlcGx5SGVhZGVyLCB0cnVlKTsKKyAgICAgICAgaW50IGJvZHlMZW5ndGggPSAtMTsKKyAgICAgICAgaW50IG9yZ2luYWxCb2R5TGVuZ3RoID0gLTE7CisKKyAgICAgICAgaWYgKG1Qcml2YXRlT3V0cHV0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGJvZHlMZW5ndGggPSBtUHJpdmF0ZU91dHB1dC5zaXplKCk7CisgICAgICAgICAgICBvcmdpbmFsQm9keUxlbmd0aCA9IGJvZHlMZW5ndGg7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKE9iZXhIZWxwZXIuQkFTRV9QQUNLRVRfTEVOR1RIICsgaGVhZGVyQXJyYXkubGVuZ3RoKSA+IG1NYXhQYWNrZXRMZW5ndGgpIHsKKworICAgICAgICAgICAgaW50IGVuZCA9IDA7CisgICAgICAgICAgICBpbnQgc3RhcnQgPSAwOworCisgICAgICAgICAgICB3aGlsZSAoZW5kICE9IGhlYWRlckFycmF5Lmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGVuZCA9IE9iZXhIZWxwZXIuZmluZEhlYWRlckVuZChoZWFkZXJBcnJheSwgc3RhcnQsIG1NYXhQYWNrZXRMZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgIC0gT2JleEhlbHBlci5CQVNFX1BBQ0tFVF9MRU5HVEgpOworICAgICAgICAgICAgICAgIGlmIChlbmQgPT0gLTEpIHsKKworICAgICAgICAgICAgICAgICAgICBtQ2xvc2VkID0gdHJ1ZTsKKworICAgICAgICAgICAgICAgICAgICBpZiAobVByaXZhdGVJbnB1dCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUlucHV0LmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAobVByaXZhdGVPdXRwdXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVPdXRwdXQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtUGFyZW50LnNlbmRSZXNwb25zZShSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9JTlRFUk5BTF9FUlJPUiwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiT0JFWCBQYWNrZXQgZXhjZWVkcyBtYXggcGFja2V0IHNpemUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnl0ZVtdIHNlbmRIZWFkZXIgPSBuZXcgYnl0ZVtlbmQgLSBzdGFydF07CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShoZWFkZXJBcnJheSwgc3RhcnQsIHNlbmRIZWFkZXIsIDAsIHNlbmRIZWFkZXIubGVuZ3RoKTsKKworICAgICAgICAgICAgICAgIG1QYXJlbnQuc2VuZFJlc3BvbnNlKHR5cGUsIHNlbmRIZWFkZXIpOworICAgICAgICAgICAgICAgIHN0YXJ0ID0gZW5kOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoYm9keUxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBvdXQud3JpdGUoaGVhZGVyQXJyYXkpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKChmaW5hbEJpdFNldCkgfHwgKGhlYWRlckFycmF5Lmxlbmd0aCA8IChtTWF4UGFja2V0TGVuZ3RoIC0gMjApKSkgeworICAgICAgICAgICAgaWYgKGJvZHlMZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBEZXRlcm1pbmUgaWYgSSBjYW4gc2VuZCB0aGUgd2hvbGUgYm9keSBvciBqdXN0IHBhcnQgb2YKKyAgICAgICAgICAgICAgICAgKiB0aGUgYm9keS4gIFJlbWVtYmVyIHRoYXQgdGhlcmUgaXMgdGhlIDMgYnl0ZXMgZm9yIHRoZQorICAgICAgICAgICAgICAgICAqIHJlc3BvbnNlIG1lc3NhZ2UgYW5kIDMgYnl0ZXMgZm9yIHRoZSBoZWFkZXIgSUQgYW5kIGxlbmd0aAorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGlmIChib2R5TGVuZ3RoID4gKG1NYXhQYWNrZXRMZW5ndGggLSBoZWFkZXJBcnJheS5sZW5ndGggLSA2KSkgeworICAgICAgICAgICAgICAgICAgICBib2R5TGVuZ3RoID0gbU1heFBhY2tldExlbmd0aCAtIGhlYWRlckFycmF5Lmxlbmd0aCAtIDY7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgYnl0ZVtdIGJvZHkgPSBtUHJpdmF0ZU91dHB1dC5yZWFkQnl0ZXMoYm9keUxlbmd0aCk7CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFNpbmNlIHRoaXMgaXMgYSBwdXQgcmVxdWVzdCBpZiB0aGUgZmluYWwgYml0IGlzIHNldCBvcgorICAgICAgICAgICAgICAgICAqIHRoZSBvdXRwdXQgc3RyZWFtIGlzIGNsb3NlZCB3ZSBuZWVkIHRvIHNlbmQgdGhlIDB4NDkKKyAgICAgICAgICAgICAgICAgKiAoRW5kIG9mIEJvZHkpIG90aGVyd2lzZSwgd2UgbmVlZCB0byBzZW5kIDB4NDggKEJvZHkpCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKChmaW5hbEJpdFNldCkgfHwgKG1Qcml2YXRlT3V0cHV0LmlzQ2xvc2VkKCkpKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC53cml0ZSgweDQ5KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBvdXQud3JpdGUoMHg0OCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgYm9keUxlbmd0aCArPSAzOworICAgICAgICAgICAgICAgIG91dC53cml0ZSgoYnl0ZSkoYm9keUxlbmd0aCA+PiA4KSk7CisgICAgICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKWJvZHlMZW5ndGgpOworICAgICAgICAgICAgICAgIG91dC53cml0ZShib2R5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICgoZmluYWxCaXRTZXQpICYmICh0eXBlID09IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX09LKSAmJiAob3JnaW5hbEJvZHlMZW5ndGggPD0gMCkpIHsKKyAgICAgICAgICAgIG91dC53cml0ZSgweDQ5KTsKKyAgICAgICAgICAgIG9yZ2luYWxCb2R5TGVuZ3RoID0gMzsKKyAgICAgICAgICAgIG91dC53cml0ZSgoYnl0ZSkob3JnaW5hbEJvZHlMZW5ndGggPj4gOCkpOworICAgICAgICAgICAgb3V0LndyaXRlKChieXRlKW9yZ2luYWxCb2R5TGVuZ3RoKTsKKworICAgICAgICB9CisKKyAgICAgICAgbVJlc3BvbnNlU2l6ZSA9IDM7CisgICAgICAgIG1QYXJlbnQuc2VuZFJlc3BvbnNlKHR5cGUsIG91dC50b0J5dGVBcnJheSgpKTsKKworICAgICAgICBpZiAodHlwZSA9PSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9DT05USU5VRSkgeworICAgICAgICAgICAgaW50IGhlYWRlcklEID0gbUlucHV0LnJlYWQoKTsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSBtSW5wdXQucmVhZCgpOworICAgICAgICAgICAgbGVuZ3RoID0gKGxlbmd0aCA8PCA4KSArIG1JbnB1dC5yZWFkKCk7CisgICAgICAgICAgICBpZiAoKGhlYWRlcklEICE9IE9iZXhIZWxwZXIuT0JFWF9PUENPREVfUFVUKQorICAgICAgICAgICAgICAgICAgICAmJiAoaGVhZGVySUQgIT0gT2JleEhlbHBlci5PQkVYX09QQ09ERV9QVVRfRklOQUwpCisgICAgICAgICAgICAgICAgICAgICYmIChoZWFkZXJJRCAhPSBPYmV4SGVscGVyLk9CRVhfT1BDT0RFX0dFVCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGhlYWRlcklEICE9IE9iZXhIZWxwZXIuT0JFWF9PUENPREVfR0VUX0ZJTkFMKSkgeworCisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA+IDMpIHsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIHRlbXAgPSBuZXcgYnl0ZVtsZW5ndGhdOworICAgICAgICAgICAgICAgICAgICBieXRlc1JlY2VpdmVkID0gbUlucHV0LnJlYWQodGVtcCk7CisKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGJ5dGVzUmVjZWl2ZWQgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlY2VpdmVkICs9IG1JbnB1dC5yZWFkKHRlbXAsIGJ5dGVzUmVjZWl2ZWQsIGxlbmd0aCAtIGJ5dGVzUmVjZWl2ZWQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBEZXRlcm1pbmUgaWYgYW4gQUJPUlQgd2FzIHNlbnQgYXMgdGhlIHJlcGx5CisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKGhlYWRlcklEID09IE9iZXhIZWxwZXIuT0JFWF9PUENPREVfQUJPUlQpIHsKKyAgICAgICAgICAgICAgICAgICAgbVBhcmVudC5zZW5kUmVzcG9uc2UoUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfT0ssIG51bGwpOworICAgICAgICAgICAgICAgICAgICBtQ2xvc2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaXNBYm9ydGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgbUV4Y2VwdGlvblN0cmluZyA9ICJBYm9ydCBSZWNlaXZlZCI7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigiQWJvcnQgUmVjZWl2ZWQiKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtUGFyZW50LnNlbmRSZXNwb25zZShSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9CQURfUkVRVUVTVCwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIG1DbG9zZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBtRXhjZXB0aW9uU3RyaW5nID0gIkJhZCBSZXF1ZXN0IFJlY2VpdmVkIjsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElPRXhjZXB0aW9uKCJCYWQgUmVxdWVzdCBSZWNlaXZlZCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisKKyAgICAgICAgICAgICAgICBpZiAoKGhlYWRlcklEID09IE9iZXhIZWxwZXIuT0JFWF9PUENPREVfUFVUX0ZJTkFMKQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGhlYWRlcklEID09IE9iZXhIZWxwZXIuT0JFWF9PUENPREVfR0VUX0ZJTkFMKSkgeworICAgICAgICAgICAgICAgICAgICBmaW5hbEJpdFNldCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBEZXRlcm1pbmUgaWYgdGhlIHBhY2tldCBsZW5ndGggaXMgbGFyZ2VyIHRoZW4gdGhpcyBkZXZpY2UgY2FuIHJlY2VpdmUKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoID4gT2JleEhlbHBlci5NQVhfUEFDS0VUX1NJWkVfSU5UKSB7CisgICAgICAgICAgICAgICAgICAgIG1QYXJlbnQuc2VuZFJlc3BvbnNlKFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1JFUV9UT09fTEFSR0UsIG51bGwpOworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSU9FeGNlcHRpb24oIlBhY2tldCByZWNlaXZlZCB3YXMgdG9vIGxhcmdlIik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgKiBEZXRlcm1pbmUgaWYgYW55IGhlYWRlcnMgd2VyZSBzZW50IGluIHRoZSBpbml0aWFsIHJlcXVlc3QKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoID4gMykgeworICAgICAgICAgICAgICAgICAgICBieXRlW10gZGF0YSA9IG5ldyBieXRlW2xlbmd0aCAtIDNdOworICAgICAgICAgICAgICAgICAgICBieXRlc1JlY2VpdmVkID0gbUlucHV0LnJlYWQoZGF0YSk7CisKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGJ5dGVzUmVjZWl2ZWQgIT0gZGF0YS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVzUmVjZWl2ZWQgKz0gbUlucHV0LnJlYWQoZGF0YSwgYnl0ZXNSZWNlaXZlZCwgZGF0YS5sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBieXRlc1JlY2VpdmVkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBieXRlW10gYm9keSA9IE9iZXhIZWxwZXIudXBkYXRlSGVhZGVyU2V0KHJlcXVlc3RIZWFkZXIsIGRhdGEpOworICAgICAgICAgICAgICAgICAgICBpZiAoYm9keSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtSGFzQm9keSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlcXVlc3RIZWFkZXIubUNvbm5lY3Rpb25JRCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIuc2V0Q29ubmVjdGlvbklkKE9iZXhIZWxwZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNvbnZlcnRUb0xvbmcocmVxdWVzdEhlYWRlci5tQ29ubmVjdGlvbklEKSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIuc2V0Q29ubmVjdGlvbklkKDEpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlcXVlc3RIZWFkZXIubUF1dGhSZXNwICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbVBhcmVudC5oYW5kbGVBdXRoUmVzcChyZXF1ZXN0SGVhZGVyLm1BdXRoUmVzcCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRXhjZXB0aW9uU3RyaW5nID0gIkF1dGhlbnRpY2F0aW9uIEZhaWxlZCI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBhcmVudC5zZW5kUmVzcG9uc2UoUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfVU5BVVRIT1JJWkVELCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ2xvc2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0SGVhZGVyLm1BdXRoUmVzcCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdEhlYWRlci5tQXV0aFJlc3AgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlcXVlc3RIZWFkZXIubUF1dGhDaGFsbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUGFyZW50LmhhbmRsZUF1dGhDaGFsbChyZXF1ZXN0SGVhZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlbmQgdGhlIGF1aHRSZXNwIHRvIHRoZSBjbGllbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5SGVhZGVyLm1BdXRoUmVzcCA9IG5ldyBieXRlW3JlcXVlc3RIZWFkZXIubUF1dGhSZXNwLmxlbmd0aF07CisgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHJlcXVlc3RIZWFkZXIubUF1dGhSZXNwLCAwLCByZXBseUhlYWRlci5tQXV0aFJlc3AsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5SGVhZGVyLm1BdXRoUmVzcC5sZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdEhlYWRlci5tQXV0aFJlc3AgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdEhlYWRlci5tQXV0aENoYWxsID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChib2R5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSW5wdXQud3JpdGVCeXRlcyhib2R5LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2VuZHMgYW4gQUJPUlQgbWVzc2FnZSB0byB0aGUgc2VydmVyLiBCeSBjYWxsaW5nIHRoaXMgbWV0aG9kLCB0aGUKKyAgICAgKiBjb3JyZXNwb25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gICAgKiBAcmV0dXJuIDxjb2RlPm51bGw8L2NvZGU+CisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRFbmNvZGluZygpIHsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgdHlwZSBvZiBjb250ZW50IHRoYXQgdGhlIHJlc291cmNlIGNvbm5lY3RlZCB0byBpcyBwcm92aWRpbmcuCisgICAgICogRS5nLiBpZiB0aGUgY29ubmVjdGlvbiBpcyB2aWEgSFRUUCwgdGhlbiB0aGUgdmFsdWUgb2YgdGhlIGNvbnRlbnQtdHlwZQorICAgICAqIGhlYWRlciBmaWVsZCBpcyByZXR1cm5lZC4KKyAgICAgKiBAcmV0dXJuIHRoZSBjb250ZW50IHR5cGUgb2YgdGhlIHJlc291cmNlIHRoYXQgdGhlIFVSTCByZWZlcmVuY2VzLCBvcgorICAgICAqICAgICAgICAgPGNvZGU+bnVsbDwvY29kZT4gaWYgbm90IGtub3duCisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRUeXBlKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIChTdHJpbmcpcmVxdWVzdEhlYWRlci5nZXRIZWFkZXIoSGVhZGVyU2V0LlRZUEUpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGxlbmd0aCBvZiB0aGUgY29udGVudCB3aGljaCBpcyBiZWluZyBwcm92aWRlZC4gRS5nLiBpZiB0aGUKKyAgICAgKiBjb25uZWN0aW9uIGlzIHZpYSBIVFRQLCB0aGVuIHRoZSB2YWx1ZSBvZiB0aGUgY29udGVudC1sZW5ndGggaGVhZGVyIGZpZWxkCisgICAgICogaXMgcmV0dXJuZWQuCisgICAgICogQHJldHVybiB0aGUgY29udGVudCBsZW5ndGggb2YgdGhlIHJlc291cmNlIHRoYXQgdGhpcyBjb25uZWN0aW9uJ3MgVVJMCisgICAgICogICAgICAgICByZWZlcmVuY2VzLCBvciAtMSBpZiB0aGUgY29udGVudCBsZW5ndGggaXMgbm90IGtub3duCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0TGVuZ3RoKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgTG9uZyB0ZW1wID0gKExvbmcpcmVxdWVzdEhlYWRlci5nZXRIZWFkZXIoSGVhZGVyU2V0LkxFTkdUSCk7CisKKyAgICAgICAgICAgIGlmICh0ZW1wID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiB0ZW1wLmxvbmdWYWx1ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldE1heFBhY2tldFNpemUoKSB7CisgICAgICAgIHJldHVybiBtTWF4UGFja2V0TGVuZ3RoIC0gNjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBPcGVuIGFuZCByZXR1cm4gYW4gaW5wdXQgc3RyZWFtIGZvciBhIGNvbm5lY3Rpb24uCisgICAgICogQHJldHVybiBhbiBpbnB1dCBzdHJlYW0KKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uIGlmIGFuIEkvTyBlcnJvciBvY2N1cnMKKyAgICAgKi8KKyAgICBwdWJsaWMgSW5wdXRTdHJlYW0gb3BlbklucHV0U3RyZWFtKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgZW5zdXJlT3BlbigpOworICAgICAgICByZXR1cm4gbVByaXZhdGVJbnB1dDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBPcGVuIGFuZCByZXR1cm4gYSBkYXRhIGlucHV0IHN0cmVhbSBmb3IgYSBjb25uZWN0aW9uLgorICAgICAqIEByZXR1cm4gYW4gaW5wdXQgc3RyZWFtCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBpZiBhbiBJL08gZXJyb3Igb2NjdXJzCisgICAgICovCisgICAgcHVibGljIERhdGFJbnB1dFN0cmVhbSBvcGVuRGF0YUlucHV0U3RyZWFtKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgcmV0dXJuIG5ldyBEYXRhSW5wdXRTdHJlYW0ob3BlbklucHV0U3RyZWFtKCkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIE9wZW4gYW5kIHJldHVybiBhbiBvdXRwdXQgc3RyZWFtIGZvciBhIGNvbm5lY3Rpb24uCisgICAgICogQHJldHVybiBhbiBvdXRwdXQgc3RyZWFtCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBpZiBhbiBJL08gZXJyb3Igb2NjdXJzCisgICAgICovCisgICAgcHVibGljIE91dHB1dFN0cmVhbSBvcGVuT3V0cHV0U3RyZWFtKCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgZW5zdXJlT3BlbigpOworCisgICAgICAgIGlmIChtUHJpdmF0ZU91dHB1dE9wZW4pIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigibm8gbW9yZSBpbnB1dCBzdHJlYW1zIGF2YWlsYWJsZSwgc3RyZWFtIGFscmVhZHkgb3BlbmVkIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1SZXF1ZXN0RmluaXNoZWQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJT0V4Y2VwdGlvbigibm8gIG91dHB1dCBzdHJlYW1zIGF2YWlsYWJsZSAscmVxdWVzdCBub3QgZmluaXNoZWQiKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtUHJpdmF0ZU91dHB1dCA9PSBudWxsKSB7CisgICAgICAgICAgICBtUHJ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bm90IGluIHRoZSByYW5nZQorICAgICAqICAgICAgICAgLTEgdG8gMjxzdXA+MzI8L3N1cD4tMQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldENvbm5lY3Rpb25JZChmaW5hbCBsb25nIGNvbm5lY3Rpb25JZCkgeworICAgICAgICBpZiAoKGNvbm5lY3Rpb25JZCA8IC0xKSB8fCAoY29ubmVjdGlvbklkID4gMHhGRkZGRkZGRkwpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJJbGxlZ2FsIENvbm5lY3Rpb24gSUQiKTsKKyAgICAgICAgfQorICAgICAgICBtQ29ubmVjdGlvbklkID0gY29ubmVjdGlvbklkOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHJpZXZlcyB0aGUgY29ubmVjdGlvbiBJRCB0aGF0IGlzIGJlaW5nIHVzZWQgaW4gdGhlIHByZXNlbnQgY29ubmVjdGlvbi4KKyAgICAgKiBUaGlzIG1ldGhvZCB3aWxsIHJldHVybiAtMSBpZiBubyBjb25uZWN0aW9uIElEIGlzIGJlaW5nIHVzZWQuCisgICAgICogQHJldHVybiB0aGUgY29ubmVjdGlvbiBpZCBiZWluZyB1c2VkIG9yIC0xIGlmIG5vIGNvbm5lY3Rpb24gSUQgaXMgYmVpbmcKKyAgICAgKiAgICAgICAgIHVzZWQKKyAgICAgKi8KKyAgICBwdWJsaWMgbG9uZyBnZXRDb25uZWN0aW9uSWQoKSB7CisgICAgICAgIHJldHVybiBtQ29ubmVjdGlvbklkOworICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCB3aGVuIGEgQ09OTkVDVCByZXF1ZXN0IGlzIHJlY2VpdmVkLgorICAgICAqIDxQPgorICAgICAqIElmIHRoaXMgbWV0aG9kIGlzIG5vdCBpbXBsZW1lbnRlZCBieSB0aGUgY2xhc3MgdGhhdCBleHRlbmRzIHRoaXMgY2xhc3MsCisgICAgICogPGNvZGU+b25Db25uZW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QgPSBmYWxzZTsKKyAgICAgICAgbVByb2Nlc3NUaHJlYWQgPSBuZXcgVGhyZWFkKHRoaXMpOworICAgICAgICBtUHJvY2Vzc1RocmVhZC5zdGFydCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFByb2Nlc3NlcyByZXF1ZXN0cyBtYWRlIHRvIHRoZSBzZXJ2ZXIgYW5kIGZvcndhcmRzIHRoZW0gdG8gdGhlCisgICAgICogYXBwcm9wcmlhdGUgZXZlbnQgbGlzdGVuZXIuCisgICAgICovCisgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICB0cnkgeworCisgICAgICAgICAgICBib29sZWFuIGRvbmUgPSBmYWxzZTsKKyAgICAgICAgICAgIHdoaWxlICghZG9uZSAmJiAhbUNsb3NlZCkgeworICAgICAgICAgICAgICAgIGludCByZXF1ZXN0VHlwZSA9IG1JbnB1dC5yZWFkKCk7CisgICAgICAgICAgICAgICAgc3dpdGNoIChyZXF1ZXN0VHlwZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIE9iZXhIZWxwZXIuT0JFWF9PUENPREVfQ09OTkVDVDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUNvbm5lY3RSZXF1ZXN0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICBjYXNlIE9iZXhIZWxwZXIuT0JFWF9PUENPREVfRElTQ09OTkVDVDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZURpc2Nvbm5lY3RSZXF1ZXN0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBkb25lID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgT2JleEhlbHBlci5PQkVYX09QQ09ERV9HRVQ6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT2JleEhlbHBlci5PQkVYX09QQ09ERV9HRVRfRklOQUw6CisgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVHZXRSZXF1ZXN0KHJlcXVlc3RUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgT2JleEhlbHBlci5PQkVYX09QQ09ERV9QVVQ6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgT2JleEhlbHBlci5PQkVYX09QQ09ERV9QVVRfRklOQUw6CisgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVQdXRSZXF1ZXN0KHJlcXVlc3RUeXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgT2JleEhlbHBlci5PQkVYX09QQ09ERV9TRVRQQVRIOgorICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlU2V0UGF0aFJlcXVlc3QoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGNhc2UgLTE6CisgICAgICAgICAgICAgICAgICAgICAgICBkb25lID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBSZWNlaXZlZCBhIHJlcXVlc3QgdHlwZSB0aGF0IGlzIG5vdCByZWNvZ25pemVkIHNvIEkgYW0KKyAgICAgICAgICAgICAgICAgICAgICAgICAqIGp1c3QgZ29pbmcgdG8gcmVhZCB0aGUgcGFja2V0IGFuZCBzZW5kIGEgbm90IGltcGxlbWVudGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgKiB0byB0aGUgY2xpZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGggPSBtSW5wdXQucmVhZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gKGxlbmd0aCA8PCA4KSArIG1JbnB1dC5yZWFkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMzsgaSA8IGxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUlucHV0LnJlYWQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRSZXNwb25zZShSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9OT1RfSU1QTEVNRU5URUQsIG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICB9IGNhdGNoIChOdWxsUG9pbnRlckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsIGUudG9TdHJpbmcoKSk7CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsIGUudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICAgICAgY2xvc2UoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBIYW5kbGVzIGEgUFVUIHJlcXVlc3QgZnJvbSBhIGNsaWVudC4gVGhpcyBtZXRob2Qgd2lsbCBwcm92aWRlIGEKKyAgICAgKiA8Y29kZT5TZXJ2ZXJPcGVyYXRpb248L2NvZGU+IG9iamVjdCB0byB0aGUgcmVxdWVzdCBoYW5kbGVyLiBUaGUKKyAgICAgKiA8Y29kZT5TZXJ2ZXJPcGVyYXRpb248L2NvZGU+IG9iamVjdCB3aWxsIGhhbmRsZSB0aGUgcmVzdCBvZiB0aGUgcmVxdWVzdC4KKyAgICAgKiBJdCB3aWxsIGFsc28gc2VuZCByZXBsaWVzIGFuZCByZWNlaXZlIHJlcXVlc3RzIHVudGlsIHRoZSBmaW5hbCByZXBseQorICAgICAqIHNob3VsZCBiZSBzZW50LiBXaGVuIHRoZSBmaW5hbCByZXBseSBzaG91bGQ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sc2UgeworICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gdmFsaWRhdGVSZXNwb25zZUNvZGUobUxpc3RlbmVyLm9uUHV0KG9wKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT0gUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfT0sgJiYgIW9wLmlzQWJvcnRlZCkgeworICAgICAgICAgICAgICAgIG9wLnNlbmRSZXBseShyZXNwb25zZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKCFvcC5pc0Fib3J0ZWQpIHsKKyAgICAgICAgICAgICAgICAvLyB3YWl0IGZvciB0aGUgZmluYWwgYml0CisgICAgICAgICAgICAgICAgd2hpbGUgKCFvcC5maW5hbEJpdFNldCkgeworICAgICAgICAgICAgICAgICAgICBvcC5zZW5kUmVwbHkoUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfQ09OVElOVUUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvcC5zZW5kUmVwbHkocmVzcG9uc2UpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLypUbyBmaXggYnVncyBpbiBhYm9ydGVkIGNhc2VzLAorICAgICAgICAgICAgICooY2xpZW50IGFib3J0IGZpbGUgdHJhbnNmZXIgcHJpb3IgdG8gdGhlIGxhc3QgcGFja2V0IHdoaWNoIGhhcyB0aGUgZW5kIG9mIGJvZHkgaGVhZGVyLAorICAgICAgICAgICAgICppbnRlcm5hbCBlcnJvciBzaG91bGQgbm90IGJlIHNlbnQgYmVjYXVzZSBzZXJ2ZXIgaGFzIGFscmVhZHkgcmVwbGllZCB3aXRoCisgICAgICAgICAgICAgKk9LIHJlc3BvbnNlIGluICJzZW5kUmVwbHkiKQorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoIW9wLmlzQWJvcnRlZCkgeworICAgICAgICAgICAgICAgIHNlbmRSZXNwb25zZShS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b2JqZWN0LiBBZnRlciB0aGUgaGFuZGxlciBwcm9jZXNzZXMgdGhlCisgICAgICogcmVxdWVzdCwgdGhpcyBtZXRob2Qgd2lsbCBjcmVhdGUgYSByZXBseSBtZXNzYWdlIHRvIHNlbmQgdG8gdGhlIHNlcnZlcgorICAgICAqIHdpdGggdGhlIHJlc3BvbnNlIGNvZGUgcHJvdmlkZWQuCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbiBpZiBhbiBlcnJvciBvY2N1cnJlZCBhdCB0aGUgdHJhbnNwb3J0IGxheWVyCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZVNldFBhdGhSZXF1ZXN0KCkgdGhyb3dzIElPRXhjZXB0aW9uIHsKKyAgICAgICAgaW50IGxlbmd0aDsKKyAgICAgICAgaW50IGZsYWdzOworICAgICAgICBAU3VwcHJlc3NXYXJuaW5ncygidW51c2VkIikKKyAgICAgICAgaW50IGNvbnN0YW50czsKKyAgICAgICAgaW50IHRvdGFsTGVuZ3RoID0gMzsKKyAgICAgICAgYnl0ZVtdIGhlYWQgPSBudWxsOworICAgICAgICBpbnQgY29kZSA9IC0xOworICAgICAgICBpbnQgYnl0ZXNSZWNlaXZlZDsKKyAgICAgICAgSGVhZGVyU2V0IHJlcXVlc3QgPSBuZXcgSGVhZGVyU2V0KCk7CisgICAgICAgIEhlYWRlclNldCByZXBseSA9IG5ldyBIZWFkZXJTZXQoKTsKKworICAgICAgICBsZW5ndGggPSBtSW5wdXQucmVhZCgpOworICAgICAgICBsZW5ndGggPSAobGVuZ3RoIDw8IDgpICsgbUlucHV0LnJlYWQoKTsKKyAgICAgICAgZmxhZ3MgPSBtSW5wdXQucmVhZCgpOworICAgICAgICBjb25zdGFudHMgPSBtSW5wdXQucmVhZCgpOworCisgICAgICAgIGlmIChsZW5ndGggPiBPYmV4SGVscGVyLk1BWF9QQUNLRVRfU0laRV9JTlQpIHsKKyAgICAgICAgICAgIGNvZGUgPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9SRVFfVE9PX0xBUkdFOworICAgICAgICAgICAgdG90YWxMZW5ndGggPSAzOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKGxlbmd0aCA+IDUpIHsKKyAgICAgICAgICAgICAgICBieXRlW10gaGVhZGVycyA9IG5ldyBieXRlW2xlbmd0aCAtIDVdOworICAgICAgICAgICAgICAgIGJ5dGVzUmVjZWl2ZWQgPSBtSW5wdXQucmVhZChoZWFkZXJzKTsKKworICAgICAgICAgICAgICAgIHdoaWxlIChieXRlc1JlY2VpdmVkICE9IGhlYWRlcnMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgIGJ5dGVzUmVjZWl2ZWQgKz0gbUlucHV0LnJlYWQoaGVhZGVycywgYnl0ZXNSZWNlaXZlZCwgaGVhZGVycy5sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIGJ5dGVzUmVjZWl2ZWQpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIE9iZXhIZWxwZXIudXBkYXRlSGVhZGVyU2V0KHJlcXVlc3QsIGhlYWRlcnMpOworCisgICAgICAgICAgICAgICAgaWYgKHJlcXVlc3QubUNvbm5lY3Rpb25JRCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1MaXN0ZW5lci5zZXRDb25uZWN0aW9uSWQoT2JleEhlbHBlci5jb252ZXJ0VG9Mb25nKHJlcXVlc3QubUNvbm5lY3Rpb25JRCkpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1MaXN0ZW5lci5zZXRDb25uZWN0aW9uSWQoLTEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyB0aGUgQXV0aCBjaGFuIGlzIGluaXRpYXRlZCBieSB0aGUgc2VydmVyLCBjbGllbnQgc2VudCBiYWNrIHRoZSBhdXRoUmVzcCAuCisgICAgICAgICAgICAgICAgaWYgKHJlcXVlc3QubUF1dGhSZXNwICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFoYW5kbGVBdXRoUmVzcChyZXF1ZXN0Lm1BdXRoUmVzcCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9VTkFVVEhPUklaRUQ7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIub25BdXRoZW50aWNhdGlvbkZhaWx1cmUoT2JleEhlbHBlci5nZXRUYWdWYWx1ZSgoYnl0ZSkweDAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0Lm1BdXRoUmVzcCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QubUF1dGhSZXNwID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChjb2RlICE9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1VOQVVUSE9SSVpFRCkgeworICAgICAgICAgICAgICAgIC8vIHRoZSBBdXRoIGNoYWxsZW5nZSBpcyBpbml0aWF0ZWQgYnkgdGhlIGNsaWVudAorICAgICAgICAgICAgICAgIC8vIHRoZSBzZXJ2ZXIgd2lsbCBzZW5kIGJhY2sgdGhlIGF1dGhSZXNwIHRvIHRoZSBjbGllbnQKKyAgICAgICAgICAgICAgICBpZiAocmVxdWVzdC5tQXV0aENoYWxsICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlQXV0aENoYWxsKHJlcXVlc3QpOworICAgICAgICAgICAgICAgICAgICByZXBseS5tQXV0aFJlc3AgPSBuZXcgYnl0ZVtyZXF1ZXN0Lm1BdXRoUmVzcC5sZW5ndGhdOworICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHJlcXVlc3QubUF1dGhSZXNwLCAwLCByZXBseS5tQXV0aFJlc3AsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHkubUF1dGhSZXNwLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QubUF1dGhDaGFsbCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QubUF1dGhSZXNwID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYm9vbGVhbiBiYWNrdXAgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBib29sZWFuIGNyZWF0ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKCEoKGZsYWdzICYgMSkgPT0gMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgYmFja3VwID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKChmbGFncyAmIDIpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgY3JlYXRlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgY29kZSA9IG1MaXN0ZW5lci5vblNldFBhdGgocmVxdWVzdCwgcmVwbHksIGJhY2t1cCwgY3JlYXRlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBzZW5kUmVzcG9uc2UoUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfSU5URVJOQUxfRVJST1IsIG51bGwpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY29kZSA9IHZhbGlkYXRlUmVzcG9uc2VDb2RlKGNvZGUpOworCisgICAgICAgICAgICAgICAgaWYgKHJlcGx5Lm5vbmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUNoYWxsZW5nZURpZ2VzdCA9IG5ldyBieXRlWzE2XTsKKyAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShyZXBseS5ub25jZSwgMCwgbUNoYWxsZW5nZURpZ2VzdCwgMCwgMTYpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1DaGFsbGVuZ2VEaWdlc3QgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGxvbmcgaWQgPSBtTGlzdGVuZXIuZ2V0Q29ubmVjdGlvbklkKCk7CisgICAgICAgICAgICAgICAgaWYgKGlkID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5Lm1Db25uZWN0aW9uSUQgPSBudWxsOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJlcGx5Lm1Db25uZWN0aW9uSUQgPSBPYmV4SGVscGVyLmNvbnZlcnRUb0J5dGVBcnJheShpZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaGVhZCA9IE9iZXhIZWxwZXIuY3JlYXRlSGVhZGVyKHJlcGx5LCBmYWxzZSk7CisgICAgICAgICAgICAgICAgdG90YWxMZW5ndGggKz0gaGVhZC5sZW5ndGg7CisKKyAgICAgICAgICAgICAgICBpZiAodG90YWxMZW5ndGggPiBtTWF4UGFja2V0TGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgIHRvdGFsTGVuZ3RoID0gMzsKKyAgICAgICAgICAgICAgICAgICAgaGVhZCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGNvZGUgPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9JTlRFUk5BTF9FUlJPUjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBDb21wdXRlIExlbmd0aCBvZiBPQkVYIFNFVFBBVEggcGFja2V0CisgICAgICAgIGJ5dGVbXSByZXBseURhdGEgPSBuZXcgYnl0ZVt0b3RhbExlbmd0aF07CisgICA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gICB3aGlsZSAoYnl0ZXNSZWNlaXZlZCAhPSBoZWFkZXJzLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICBieXRlc1JlY2VpdmVkICs9IG1JbnB1dC5yZWFkKGhlYWRlcnMsIGJ5dGVzUmVjZWl2ZWQsIGhlYWRlcnMubGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBieXRlc1JlY2VpdmVkKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBPYmV4SGVscGVyLnVwZGF0ZUhlYWRlclNldChyZXF1ZXN0LCBoZWFkZXJzKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHJlcXVlc3QubUNvbm5lY3Rpb25JRCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUxpc3RlbmVyLnNldENvbm5lY3Rpb25JZChPYmV4SGVscGVyLmNvbnZlcnRUb0xvbmcocmVxdWVzdC5tQ29ubmVjdGlvbklEKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1MaXN0ZW5lci5zZXRDb25uZWN0aW9uSWQoMSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChyZXF1ZXN0Lm1BdXRoUmVzcCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKCFoYW5kbGVBdXRoUmVzcChyZXF1ZXN0Lm1BdXRoUmVzcCkpIHsKKyAgICAgICAgICAgICAgICAgICAgY29kZSA9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1VOQVVUSE9SSVpFRDsKKyAgICAgICAgICAgICAgICAgICAgbUxpc3RlbmVyLm9uQXV0aGVudGljYXRpb25GYWlsdXJlKE9iZXhIZWxwZXIuZ2V0VGFnVmFsdWUoKGJ5dGUpMHgwMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0Lm1BdXRoUmVzcCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXF1ZXN0Lm1BdXRoUmVzcCA9IG51bGw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChjb2RlICE9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1VOQVVUSE9SSVpFRCkgeworCisgICAgICAgICAgICAgICAgaWYgKHJlcXVlc3QubUF1dGhDaGFsbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZUF1dGhDaGFsbChyZXF1ZXN0KTsKKyAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5tQXV0aENoYWxsID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXIub25EaXNjb25uZWN0KHJlcXVlc3QsIHJlcGx5KTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBzZW5kUmVzcG9uc2UoUmVzcG9uc2VDb2Rlcy5PQkVYX0hUVFBfSU5URVJOQUxfRVJST1IsIG51bGwpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbG9uZyBpZCA9IG1MaXN0ZW5lci5nZXRDb25uZWN0aW9uSWQoKTsKKyAgICAgICAgICAgICAgICBpZiAoaWQgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVwbHkubUNvbm5lY3Rpb25JRCA9IG51bGw7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmVwbHkubUNvbm5lY3Rpb25JRCA9IE9iZXhIZWxwZXIuY29udmVydFRvQnl0ZUFycmF5KGlkKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBoZWFkID0gT2JleEhlbHBlci5jcmVhdGVIZWFkZXIocmVwbHksIGZhbHNlKTsKKyAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCArPSBoZWFkLmxlbmd0aDsKKworICAgICAgICAgICAgICAgIGlmICh0b3RhbExlbmd0aCA+IG1NYXhQYWNrZXRMZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgdG90YWxMZW5ndGggPSAzOworICAgICAgICAgICAgICAgICAgICBoZWFkID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgY29kZSA9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0lOVEVSTkFMX0VSUk9SOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIENvbXB1dGUgTGVuZ3RoIG9mIE9CRVggQ09OTkVDVCBwYWNrZXQKKyAgICAgICAgYnl0ZVtdIHJlcGx5RGF0YTsKKyAgICAgICAgaWYgKGhlYWQgIT0gbnVsbCkgeworICAgICAgICAgICAgcmVwbHlEYXRhID0gbmV3IGJ5dGVbMyArIGhlYWQubGVuZ3RoXTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJlcGx5RGF0YSA9IG5ldyBieXRlWzNdOworICAgICAgICB9CisgICAgICAgIHJlcGx5RGF0YVswXSA9IChieXRlKWNvZGU7CisgICAgICAgIHJlcGx5RGF0YVsxXSA9IChieXRlKSh0b3RhbExlbmd0aCA+PiA4KTsKKyAgICAgICAgcmVwbHlEYXRhWzJdID0gKGJ5dGUpdG90YWxMZW5ndGg7CisgICAgICAgIGlmIChoZWFkICE9IG51bGwpIHsKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoaGVhZCwgMCwgcmVwbHlEYXRhLCAzLCBoZWFkLmxlbmd0aCk7CisgICAgICAgIH0KKyAgICAgICAgLyoKKyAgICAgICAgICogV3JpdGUgdGhlIE9CRVggRElTQ09OTkVDVCBwYWNrZXQgdG8gdGhlIHNlcnZlci4gQnl0ZSAwOiByZXNwb25zZSBjb2RlCisgICAgICAgICAqIEJ5dGUgMSYyOiBDb25uZWN0IFBh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FnczsKKyAgICAgICAgaW50IHRvdGFsTGVuZ3RoID0gNzsKKyAgICAgICAgYnl0ZVtdIGhlYWQgPSBudWxsOworICAgICAgICBpbnQgY29kZSA9IC0xOworICAgICAgICBIZWFkZXJTZXQgcmVxdWVzdCA9IG5ldyBIZWFkZXJTZXQoKTsKKyAgICAgICAgSGVhZGVyU2V0IHJlcGx5ID0gbmV3IEhlYWRlclNldCgpOworICAgICAgICBpbnQgYnl0ZXNSZWNlaXZlZDsKKworICAgICAgICAvKgorICAgICAgICAgKiBSZWFkIGluIHRoZSBsZW5ndGggb2YgdGhlIE9CRVggcGFja2V0LCBPQkVYIHZlcnNpb24sIGZsYWdzLCBhbmQgbWF4CisgICAgICAgICAqIHBhY2tldCBsZW5ndGgKKyAgICAgICAgICovCisgICAgICAgIHBhY2tldExlbmd0aCA9IG1JbnB1dC5yZWFkKCk7CisgICAgICAgIHBhY2tldExlbmd0aCA9IChwYWNrZXRMZW5ndGggPDwgOCkgKyBtSW5wdXQucmVhZCgpOworICAgICAgICB2ZXJzaW9uID0gbUlucHV0LnJlYWQoKTsKKyAgICAgICAgZmxhZ3MgPSBtSW5wdXQucmVhZCgpOworICAgICAgICBtTWF4UGFja2V0TGVuZ3RoID0gbUlucHV0LnJlYWQoKTsKKyAgICAgICAgbU1heFBhY2tldExlbmd0aCA9IChtTWF4UGFja2V0TGVuZ3RoIDw8IDgpICsgbUlucHV0LnJlYWQoKTsKKworICAgICAgICAvLyBzaG91bGQgd2UgY2hlY2sgaXQ/CisgICAgICAgIGlmIChtTWF4UGFja2V0TGVuZ3RoID4gT2JleEhlbHBlci5NQVhfUEFDS0VUX1NJWkVfSU5UKSB7CisgICAgICAgICAgICBtTWF4UGFja2V0TGVuZ3RoID0gT2JleEhlbHBlci5NQVhfUEFDS0VUX1NJWkVfSU5UOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBhY2tldExlbmd0aCA+IE9iZXhIZWxwZXIuTUFYX1BBQ0tFVF9TSVpFX0lOVCkgeworICAgICAgICAgICAgY29kZSA9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1JFUV9UT09fTEFSR0U7CisgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDc7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAocGFja2V0TGVuZ3RoID4gNykgeworICAgICAgICAgICAgICAgIGJ5dGVbXSBoZWFkZXJzID0gbmV3IGJ5dGVbcGFja2V0TGVuZ3RoIC0gN107CisgICAgICAgICAgICAgICAgYnl0ZXNSZWNlaXZlZCA9IG1JbnB1dC5yZWFkKGhlYWRlcnMpOworCisgICAgICAgICAgICAgICAgd2hpbGUgKGJ5dGVzUmVjZWl2ZWQgIT0gaGVhZGVycy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZXNSZWNlaXZlZCArPSBtSW5wdXQucmVhZChoZWFkZXJzLCBieXRlc1JlY2VpdmVkLCBoZWFkZXJzLmxlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gYnl0ZXNSZWNlaXZlZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgT2JleEhlbHBlci51cGRhdGVIZWFkZXJTZXQocmVxdWVzdCwgaGVhZGVycyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChyZXF1ZXN0Lm1Db25uZWN0aW9uSUQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1MaXN0ZW5lci5zZXRDb25uZWN0aW9uSWQoT2JleEhlbHBlci5jb252ZXJ0VG9Mb25nKHJlcXVlc3QubUNvbm5lY3Rpb25JRCkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtTGlzdGVuZXIuc2V0Q29ubmVjdGlvbklkKDEpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocmVxdWVzdC5tQXV0aFJlc3AgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmICghaGFuZGxlQXV0aFJlc3AocmVxdWVzdC5tQXV0aFJlc3ApKSB7CisgICAgICAgICAgICAgICAgICAgIGNvZGUgPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9VTkFVVEhPUklaRUQ7CisgICAgICAgICAgICAgICAgICAgIG1MaXN0ZW5lci5vbkF1dGhlbnRpY2F0aW9uRmFpbHVyZShPYmV4SGVscGVyLmdldFRhZ1ZhbHVlKChieXRlKTB4MDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5tQXV0aFJlc3ApKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVxdWVzdC5tQXV0aFJlc3AgPSBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoY29kZSAhPSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9VTkFVVEhPUklaRUQpIHsKKyAgICAgICAgICAgICAgICBpZiAocmVxdWVzdC5tQXV0aENoYWxsICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlQXV0aENoYWxsKHJlcXVlc3QpOworICAgICAgICAgICAgICAgICAgICByZXBseS5tQXV0aFJlc3AgPSBuZXcgYnl0ZVtyZXF1ZXN0Lm1BdXRoUmVzcC5sZW5ndGhdOworICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHJlcXVlc3QubUF1dGhSZXNwLCAwLCByZXBseS5tQXV0aFJlc3AsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHkubUF1dGhSZXNwLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QubUF1dGhDaGFsbCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QubUF1dGhSZXNwID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBjb2RlID0gbUxpc3RlbmVyLm9uQ29ubmVjdChyZXF1ZXN0LCByZXBseSk7CisgICAgICAgICAgICAgICAgICAgIGNvZGUgPSB2YWxpZGF0ZVJlc3BvbnNlQ29kZShjb2RlKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAocmVwbHkubm9uY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUNoYWxsZW5nZURpZ2VzdCA9IG5ldyBieXRlWzE2XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkocmVwbHkubm9uY2UsIDAsIG1DaGFsbGVuZ2VEaWdlc3QsIDAsIDE2KTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DaGFsbGVuZ2VEaWdlc3QgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGxvbmcgaWQgPSBtTGlzdGVuZXIuZ2V0Q29ubmVjdGlvbklkKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChpZCA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHkubUNvbm5lY3Rpb25JRCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXBseS5tQ29ubmVjdGlvbklEID0gT2JleEhlbHBlci5jb252ZXJ0VG9CeXRlQXJyYXkoaWQpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaGVhZCA9IE9iZXhIZWxwZXIuY3JlYXRlSGVhZGVyKHJlcGx5LCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIHRvdGFsTGVuZ3RoICs9IGhlYWQubGVuZ3RoOworCisgICAgICAgICAgICAgICAgICAgIGlmICh0b3RhbExlbmd0aCA+IG1NYXhQYWNrZXRMZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsTGVuZ3RoID0gNzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgY29kZSA9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0lOVEVSTkFMX0VSUk9SOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgZS5wcmludFN0YWNrVHJhY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgdG90YWxMZW5ndGggPSA3OworICAgICAgICAgICAgICAgICAgICBoZWFkID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgY29kZSA9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0lOVEVSTkFMX0VSUk9SOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gQ29tcHV0ZSBMZW5ndGggb2YgT0JFWCBDT05ORUNUIHBhY2tldAorICAgICAgICBieXRlW10gbGVuZ3RoID0gT2JleEhlbHBlci5jb252ZXJ0VG9CeXRlQXJyYXkodG90YWxMZW5ndGgpOworCisgICAgICAgIC8qCisgICAgICAgICAqIFdyaXRlIHRoZSBPQkVYIENPTk5FQ1QgcGFja2V0IHRvIHRoZSBzZXJ2ZXIuIEJ5dGUgMDogcmVzcG9uc2UgY29kZQorICAgICAgICAgKiBCeXRlIDEmMjogQ29ubmVjdCBQYWNrZXQgTGVuZ3RoIEJ5dGUgMzogT0JFWCBWZXJzaW9uIE51bWJlcgorICAgICAgICAgKiAoUHJlc2VudGx5LCAweDEwKSBCeXRlIDQ6IEZsYWdzIChGb3IgVENQIDB4MDApIEJ5dGUgNSY2OiBNYXggT0JFWAorICAgICAgICAgKiBQYWNrZXQgTGVuZ3RoIChEZWZpbmVkIGluIE1BWF9QQUNLRVRfU0laRSkgQnl0ZSA3IHRvIG46IGhlYWRlcnMKKyAgICAgICAgICovCisgICAgICAgIGJ5dGVbXSBzZW5kRGF0Y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yAgICAgICAgaWYgKChjb2RlID49IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX01VTFRfQ0hPSUNFKQorICAgICAgICAgICAgICAgICYmIChjb2RlIDw9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1VTRV9QUk9YWSkpIHsKKyAgICAgICAgICAgIHJldHVybiBjb2RlOworICAgICAgICB9CisgICAgICAgIGlmICgoY29kZSA+PSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9CQURfUkVRVUVTVCkKKyAgICAgICAgICAgICAgICAmJiAoY29kZSA8PSBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9VTlNVUFBPUlRFRF9UWVBFKSkgeworICAgICAgICAgICAgcmV0dXJuIGNvZGU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChjb2RlID49IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX0lOVEVSTkFMX0VSUk9SKQorICAgICAgICAgICAgICAgICYmIChjb2RlIDw9IFJlc3BvbnNlQ29kZXMuT0JFWF9IVFRQX1ZFUlNJT04pKSB7CisgICAgICAgICAgICByZXR1cm4gY29kZTsKKyAgICAgICAgfQorICAgICAgICBpZiAoKGNvZGUgPj0gUmVzcG9uc2VDb2Rlcy5PQkVYX0RBVEFCQVNFX0ZVTEwpCisgICAgICAgICAgICAgICAgJiYgKGNvZGUgPD0gUmVzcG9uc2VDb2Rlcy5PQkVYX0RBVEFCQVNFX0xPQ0tFRCkpIHsKKyAgICAgICAgICAgIHJldHVybiBjb2RlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBSZXNwb25zZUNvZGVzLk9CRVhfSFRUUF9JTlRFUk5BTF9FUlJPUjsKKyAgICB9CisKK30KZGlmZiAtLWdpdCBhL29iZXgvamF2YXgvb2JleC9TZXNzaW9uTm90aWZpZXIuamF2YSBiL29iZXgvamF2YXgvb2JleC9TZXNzaW9uTm90aWZpZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMD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yb20KLSAgICAgKi8KLSAgICBpbnQgICAgICAgICBmZDsKLSAgICAKLSAgICAvKgotICAgICAqICBNZW1vcnkgdHlwZSB0aGUgc3VyZmFjZSByZXNpZGVzIGludG8KLSAgICAgKi8KLSAgICB1aW50OF90ICAgICBtZW1vcnlfdHlwZTsKLSAgICAKLSAgICAvKgotICAgICAqIFJlc2VydmVkIGZvciBmdXR1cmUgdXNlLiBNVVNUIEJFIFpFUk8uCi0gICAgICovCi0gICAgdWludDhfdCAgICAgcmVzZXJ2ZWRfcGFkWzNdOwotICAgIGludCAgICAgICAgIHJlc2VydmVkWzhdOwotICAgIAotICAgIC8qCi0gICAgICogVmVydGljYWwgc3RyaWRlIChvbmx5IHJlbGV2YW50IHdpdGggcGxhbmFyIGZvcm1hdHMpIAotICAgICAqLwotICAgIAotICAgIGludCAgICAgICAgIHZzdHJpZGU7Ci0KLSAgICAvKgotICAgICAqIEhvb2sgY2FsbGVkIGJ5IEVHTCB0byBob2xkIGEgcmVmZXJlbmNlIG9uIHRoaXMgc3RydWN0dXJlCi0gICAgICovCi0gICAgdm9pZCAgICAgICAgKCppbmNSZWYpKHN0cnVjdCBlZ2xfbmF0aXZlX3dpbmRvd190KiB3aW5kb3cpOwotCi0gICAgLyoKLSAgICAgKiBIb29rIGNhbGxlZCBieSBFR0wgdG8gcmVsZWFzZSBhIHJlZmVyZW5jZSBvbiB0aGlzIHN0cnVjdHVyZQotICAgICAqLwotICAgIHZvaWQgICAgICAgICgqZGVjUmVmKShzdHJ1Y3QgZWdsX25hdGl2ZV93aW5kb3dfdCogd2luZG93KTsKLQotICAgIC8qCi0gICAgICogSG9vayBjYWxsZWQgYnkgRUdMIHRvIHBlcmZvcm0gYSBwYWdlIGZsaXAuIFRoaXMgZnVuY3Rpb24KLSAgICAgKiBtYXkgdXBkYXRlIHRoZSBzaXplIGF0dHJpYnV0ZXMgYWJvdmUsIGluIHdoaWNoIGNhc2UgaXQgcmV0dXJucwotICAgICAqIHRoZSBFR0xfTk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AKLSAgICAvKgotICAgICAqIFJlc2VydmVkIGZvciBmdXR1cmUgdXNlLiBNVVNUIEJFIFpFUk8uCi0gICAgICovCi0gICAgdm9pZCAgICAgICAgKCpyZXNlcnZlZF9wcm9jWzExXSkodm9pZCk7Ci0gICAgCi0gICAgLyoKLSAgICAgKiAgU29tZSBzdG9yYWdlIHJlc2VydmVkIGZvciB0aGUgb2VtIGRyaXZlci4KLSAgICAgKi8KLSAgICBpbnRwdHJfdCAgICBvZW1bNF07Ci19OwotCi0KLXN0cnVjdCBlZ2xfbmF0aXZlX3BpeG1hcF90Ci17Ci0gICAgaW50MzJfdCAgICAgdmVyc2lvbjsgICAgLyogbXVzdCBiZSAzMiAqLwotICAgIGludDMyX3QgICAgIHdpZHRoOwotICAgIGludDMyX3QgICAgIGhlaWdodDsKLSAgICBpbnQzMl90ICAgICBzdHJpZGU7Ci0gICAgdWludDhfdCogICAgZGF0YTsKLSAgICB1aW50OF90ICAgICBmb3JtYXQ7Ci0gICAgdWludDhfdCAgICAgcmZ1WzNdOwotICAgIHVuaW9uIHsKLSAgICAgICAgdWludDMyX3QgICAgY29tcHJlc3NlZEZvcm1hdDsKLSAgICAgICAgaW50MzJfdCAgICAgdnN0cmlkZTsKLSAgICB9OwotICAgIGludDMyX3QgICAgIHJlc2VydmVkOwotfTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiAKLSAqIFRoaXMgYSBjb252ZW5pZW5jZSBmdW5jdGlvbiB0byBjcmVhdGUgYSBOYXRpdmVXaW5kb3dUeXBlIHN1cmZhY2UKLSAqIHRoYXQgbWFwcyB0byB0aGUgd2hvbGUgc2NyZWVuCi0gKiBUaGlzIGZ1bmN0aW9uIGlzIGFjdHVhbGx5IGltcGxlbWVudGVkIGluIGxpYnVpLnNvCi0gKi8KLQotc3RydWN0IGVnbF9uYXRpdmVfd2luZG93X3QqIGFuZH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ICAgICAgICAgICAgICAgICAgICAgICAxCisKKy8qIEJlZ2luTW9kZSAqLworI2RlZmluZSBHTF9QT0lOVFMgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwCisjZGVmaW5lIEdMX0xJTkVTICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDEKKyNkZWZpbmUgR0xfTElORV9MT09QICAgICAgICAgICAgICAgICAgICAgIDB4MDAwMgorI2RlZmluZSBHTF9MSU5FX1NUUklQICAgICAgICAgICAgICAgICAgICAgMHgwMDAzCisjZGVmaW5lIEdMX1RSSUFOR0xFUyAgICAgICAgICAgICAgICAgICAgICAweDAwMDQKKyNkZWZpbmUgR0xfVFJJQU5HTEVfU1RSSVAgICAgICAgICAgICAgICAgIDB4MDAwNQorI2RlZmluZSBHTF9UUklBTkdMRV9GQU4gICAgICAgICAgICAgICAgICAgMHgwMDA2CisKKy8qIEFscGhhRnVuY3Rpb24gKG5vdCBzdXBwb3J0ZWQgaW4gRVMyMCkgKi8KKy8qICAgICAgR0xfTkVWRVIgKi8KKy8qICAgICAgR0xfTEVTUyAqLworLyogICAgICBHTF9FUVVBTCAqLworLyogICAgICBHTF9MRVFVQUwgKi8KKy8qICAgICAgR0xfR1JFQVRFUiAqLworLyogICAgICBHTF9OT1RFUVVBTCAqLworLyogICAgICBHTF9HRVFVQUwgKi8KKy8qICAgICAgR0xfQUxXQVlTICovCisKKy8qIEJsZW5kaW5nRmFjdG9yRGVzdCAqLworI2RlZmluZSBHTF9aRVJPICAgICAgICAgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBHTF9PTkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBHTF9TUkNfQ09MT1IgICAgICAgICAgICAgICAgICAgICAgMHgwMzAwCisjZGVmaW5lIEdMX09ORV9NSU5VU19TUkNfQ09MT1IgICAgICAgICAgICAweDAzMDEKKyNkZWZpbmUgR0xfU1JDX0FMUEhBICAgICAgICAgICAgICAgICAgICAgIDB4MDMwMgorI2RlZmluZSBHTF9PTkVfTUlOVVNfU1JDX0FMUEhBICAgICAgICAgICAgMHgwMzAzCisjZGVmaW5lIEdMX0RTVF9BTFBIQSAgICAgICAgICAgICAgICAgICAgICAweDAzMDQKKyNkZWZpbmUgR0xfT05FX01JTlVTX0RTVF9BTFBIQSAgICAgICAgICAgIDB4MDMwNQorCisvKiBCbGVuZGluZ0ZhY3RvclNyYyAqLworLyogICAgICBHTF9aRVJPICovCisvKiAgICAgIEdMX09ORSAqLworI2RlZmluZSBHTF9EU1RfQ09MT1IgICAgICAgICAgICAgICAgICAgICAgMHgwMzA2CisjZGVmaW5lIEdMX09ORV9NSU5VU19EU1RfQ09MT1IgICAgICAgICAgICAweDAzMDcKKyNkZWZpbmUgR0xfU1JDX0FMUEhBX1NBVFVSQVRFICAgICAgICAgICAgIDB4MDMwOAorLyogICAgICBHTF9TUkNfQUxQSEEgKi8KKy8qICAgICAgR0xfT05FX01JTlVTX1NSQ19BTFBIQSAqLworLyogICAgICBHTF9EU1RfQUxQSEEgKi8KKy8qICAgICAgR0xfT05FX01JTlVTX0RTVF9BTFBIQSAqLworCisvKiBCbGVuZEVxdWF0aW9uU2VwYXJhdGUgKi8KKyNkZWZpbmUgR0xfRlVOQ19BREQgICAgICAgICAgICAgICAgICAgICAgIDB4ODAwNgorI2RlZmluZSBHTF9CTEVORF9FUVVBVElPTiAgICAgICAgICAgICAgICAgMHg4MDA5CisjZGVmaW5lIEdMX0JMRU5EX0VRVUFUSU9OX1JHQiAgICAgICAgICAgICAweDgwMDkgICAgLyogc2FtZSBhcyBCTEVORF9FUVVBVElPTiAqLworI2RlZmluZSBHTF9CTEVORF9FUVVBVElPTl9BTFBIQSAgICAgICAgICAgMHg4ODNECisKKy8qIEJsZW5kU3VidHJhY3QgKi8KKyNkZWZpbmUgR0xfRlVOQ19TVUJUUkFDVCAgICAgICAgICAgICAgICAgIDB4ODAwQQorI2RlZmluZSBHTF9GVU5DX1JFVkVSU0VfU1VCVFJBQ1QgICAgICAgICAgMHg4MDBCCisKKy8qIFNlcGFyYXRlIEJsZW5kIEZ1bmN0aW9ucyAqLworI2RlZmluZSBHTF9CTEVORF9EU1RfUkdCICAgICAgICAgICAgICAgICAgMHg4MEM4CisjZGVmaW5lIEdMX0JMRU5EX1NSQ19SR0IgICAgICAgICAgICAgICAgICAweDgwQzkKKyNkZWZpbmUgR0xfQkxFTkRfRFNUX0FMUEhBICAgICAgICAgICAgICAgIDB4ODBDQQorI2RlZmluZSBHTF9CTEVORF9TUkNfQUxQSEEgICAgICAgICAgICAgICAgMHg4MENCCisjZGVmaW5lIEdMX0NPTlNUQU5UX0NPTE9SICAgICAgICAgICAgICAgICAweDgwMDEKKyNkZWZpbmUgR0xfT05FX01JTlVTX0NPTlNUQU5UX0NPTE9SICAgICAgIDB4ODAwMgorI2RlZmluZSBHTF9DT05TVEFOVF9BTFBIQSAgICAgICAgICAgICAgICAgMHg4MDAzCisjZGVmaW5lIEdMX09ORV9NSU5VU19DT05TVEFOVF9BTFBIQSAgICAgICAweDgwMDQKKyNkZWZpbmUgR0xfQkxFTkRfQ09MT1IgICAgICAgICAgICAgICAgICAgIDB4ODAwNQorCisvKiBCdWZmZXIgT2JqZWN0cyAqLworI2RlZmluZSBHTF9BUlJBWV9CVUZGRVIgICAgICAgICAgICAgICAgICAgMHg4ODkyCisjZGVmaW5lIEdMX0VMRU1FTlRfQVJSQVlfQlVGRkVSICAgICAgICAgICAweDg4OTMKKyNkZWZpbmUgR0xfQVJSQVlfQlVGRkVSX0JJTkRJTkcgICAgICAgICAgIDB4ODg5NAorI2RlZmluZSBHTF9FTEVNRU5UX0FSUkFZX0JVRkZFUl9CSU5ESU5HICAgMHg4ODk1CisKKyNkZWZpbmUgR0xfU1RSRUFNX0RSQVcgICAgICAgICAgICAgICAgICAgIDB4ODhFMAorI2RlZmluZSBHTF9TVEFUSUNfRFJBVyAgICAgICAgICAgICAgICAgICAgMHg4OEU0CisjZGVmaW5lIEdMX0RZTkFNSUNfRFJBVyAgICAgICAgICAgICAgICAgICAweDg4RTgKKworI2RlZmluZSBHTF9CVUZGRVJfU0laRSAgICAgICAgICAgICAgICAgICAgMHg4NzY0CisjZGVmaW5lIEdMX0JVRkZFUl9VU0FHRSAgICAgICAgICAgICAgICAgICAweDg3NjUKKworI2RlZmluZSBHTF9DVVJSRU5UX1ZFUlRFWF9BVFRSSUIgICAgICAgICAgMHg4NjI2CisKKy8qIEN1bGxGYWNlTW9kZSAqLworI2RlZmluZSBHTF9GUk9OVCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNDA0CisjZGVmaW5lIEdMX0JBQ0sgICAgICAgICAgICAgICAgICAgICAgICAgICAweDA0MDUKKyNkZWZpbmUgR0xfRlJPTlRfQU5EX0JBQ0sgICAgICAgICAgICAgICAgIDB4MDQwOAorCisvKiBEZXB0aEZ1bmN0aW9uICovCisvKiAgICAgIEdMX05FVkVSICovCisvKiAgICAgIEdMX0xFU1MgKi8KKy8qICAgICAgR0xfRVFVQUwgKi8KKy8qICAgICAgR0xfTEVRVUFMICovCisvKiAgICAgIEdMX0dSRUFURVIgKi8KKy8qICAgICAgR0xfTk9URVFVQUwgKi8KKy8qICAgICAgR0xfR0VRVUFMICovCisvKiAgICAgIEdMX0FMV0FZUyAqLworCisvKiBFbmFibGVDYXAgKi8KKyNkZWZpbmUgR0xfVEVYVFVSRV8yRCAgICAgICAgICAgICAgICAgICAgIDB4MERFMQorI2RlZmluZSBHTF9DVUxMX0ZBQ0UgICAgICAgICAgICAgICAgICAgICAgMHgwQjQ0CisjZGVmaW5lIEdMX0JMRU5EICAgICAgICAgICAgICAgICAgICAgICAgICAweDBCRTIKKyNkZWZpbmUgR0xfRElUSEVSICAgICAgICAgICAgICAgICAgICAgICAgIDB4MEJEMAorI2RlZmluZSBHTF9TVEVOQ0lMX1RFU1QgICAgICAgICAgICAgICAgICAgMHgwQjkwCisjZGVmaW5lIEdMX0RFUFRIX1RFU1QgICAgICAgICAgICAgICAgICAgICAweDBCNzEKKyNkZWZpbmUgR0xfU0NJU1NPUl9URVNUICAgICAgICAgICAgICAgICAgIDB4MEMxMQorI2RlZmluZSBHTF9QT0xZR09OX09GRlNFVF9GSUxMICAgICAgICAgICAgMHg4MDM3CisjZGVmaW5lIEdMX1NBTVBMRV9BTFBIQV9UT19DT1ZFUkFHRSAgICAgICAweDgwOUUKKyNkZWZpbmUgR0xfU0FNUExFX0NPVkVSQUdFICAgICAgICAgICAgICAgIDB4ODBBMAorCisvKiBFcnJvckNvZGUgKi8KKyNkZWZpbmUgR0xfTk9fRVJST1IgICAgICAgICAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgR0xfSU5WQUxJRF9FTlVNICAgICAgICAgICAgICAgICAgIDB4MDUwMAorI2RlZmluZSBHTF9JTlZBTElEX1ZBTFVFICAgICAgICAgICAgICAgICAgMHgwNTAxCisjZGVmaW5lIEdMX0lOVkFMSURfT1BFUkFUSU9OICAgICAgICAgICAgICAweDA1MDIKKyNkZWZpbmUgR0xfT1VUX09GX01FTU9SWSAgICAgICAgICAgICAgICAgIDB4MDUwNQorCisvKiBGcm9udEZhY2VEaXJlY3Rpb24gKi8KKyNkZWZpbmUgR0xfQ1cgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDkwMAorI2RlZmluZSBHTF9DQ1cgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwOTAxCisKKy8qIEdldFBOYW1lICovCisjZGVmaW5lIEdMX0xJTkVfV0lEVEggICAgICAgICAgICAgICAgICAgICAweDBCMjEKKyNkZWZpbmUgR0xfQUxJQVNFRF9QT0lOVF9TSVpFX1JBTkdFICAgICAgIDB4ODQ2RAorI2RlZmluZSBHTF9BTElBU0VEX0xJTkVfV0lEVEhfUkFOR0UgICAgICAgMHg4NDZFCisjZGVmaW5lIEdMX0NVTExfRkFDRV9NT0RFICAgICAgICAgICAgICAgICAweDBCNDUKKyNkZWZpbmUgR0xfRlJPTlRfRkFDRSAgICAgICAgICAgICAgICAgICAgIDB4MEI0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gICAweDhDQTMKKyNkZWZpbmUgR0xfU1RFTkNJTF9CQUNLX1ZBTFVFX01BU0sgICAgICAgIDB4OENBNAorI2RlZmluZSBHTF9TVEVOQ0lMX0JBQ0tfV1JJVEVNQVNLICAgICAgICAgMHg4Q0E1CisjZGVmaW5lIEdMX1ZJRVdQT1JUICAgICAgICAgICAgICAgICAgICAgICAweDBCQTIKKyNkZWZpbmUgR0xfU0NJU1NPUl9CT1ggICAgICAgICAgICAgICAgICAgIDB4MEMxMAorLyogICAgICBHTF9TQ0lTU09SX1RFU1QgKi8KKyNkZWZpbmUgR0xfQ09MT1JfQ0xFQVJfVkFMVUUgICAgICAgICAgICAgIDB4MEMyMgorI2RlZmluZSBHTF9DT0xPUl9XUklURU1BU0sgICAgICAgICAgICAgICAgMHgwQzIzCisjZGVmaW5lIEdMX1VOUEFDS19BTElHTk1FTlQgICAgICAgICAgICAgICAweDBDRjUKKyNkZWZpbmUgR0xfUEFDS19BTElHTk1FTlQgICAgICAgICAgICAgICAgIDB4MEQwNQorI2RlZmluZSBHTF9NQVhfVEVYVFVSRV9TSVpFICAgICAgICAgICAgICAgMHgwRDMzCisjZGVmaW5lIEdMX01BWF9WSUVXUE9SVF9ESU1TICAgICAgICAgICAgICAweDBEM0EKKyNkZWZpbmUgR0xfU1VCUElYRUxfQklUUyAgICAgICAgICAgICAgICAgIDB4MEQ1MAorI2RlZmluZSBHTF9SRURfQklUUyAgICAgICAgICAgICAgICAgICAgICAgMHgwRDUyCisjZGVmaW5lIEdMX0dSRUVOX0JJVFMgICAgICAgICAgICAgICAgICAgICAweDBENTMKKyNkZWZpbmUgR0xfQkxVRV9CSVRTICAgICAgICAgICAgICAgICAgICAgIDB4MEQ1NAorI2RlZmluZSBHTF9BTFBIQV9CSVRTICAgICAgICAgICAgICAgICAgICAgMHgwRDU1CisjZGVmaW5lIEdMX0RFUFRIX0JJVFMgICAgICAgICAgICAgICAgICAgICAweDBENTYKKyNkZWZpbmUgR0xfU1RFTkNJTF9CSVRTICAgICAgICAgICAgICAgICAgIDB4MEQ1NworI2RlZmluZSBHTF9QT0xZR09OX09GRlNFVF9VTklUUyAgICAgICAgICAgMHgyQTAwCisvKiAgICAgIEdMX1BPTFlHT05fT0ZGU0VUX0ZJTEwgKi8KKyNkZWZpbmUgR0xfUE9MWUdPTl9PRkZTRVRfRkFDVE9SICAgICAgICAgIDB4ODAzOAorI2RlZmluZSBHTF9URVhUVVJFX0JJTkRJTkdfMkQgICAgICAgICAgICAgMHg4MDY5CisjZGVmaW5lIEdMX1NBTVBMRV9CVUZGRVJTICAgICAgICAgICAgICAgICAweDgwQTgKKyNkZWZpbmUgR0xfU0FNUExFUyAgICAgICAgICAgICAgICAgICAgICAgIDB4ODBBOQorI2RlZmluZSBHTF9TQU1QTEVfQ09WRVJBR0VfVkFMVUUgICAgICAgICAgMHg4MEFBCisjZGVmaW5lIEdMX1NBTVBMRV9DT1ZFUkFHRV9JTlZFUlQgICAgICAgICAweDgwQUIKKworLyogR2V0VGV4dHVyZVBhcmFtZXRlciAqLworLyogICAgICBHTF9URVhUVVJFX01BR19GSUxURVIgKi8KKy8qICAgICAgR0xfVEVYVFVSRV9NSU5fRklMVEVSICovCisvKiAgICAgIEdMX1RFWFRVUkVfV1JBUF9TICovCisvKiAgICAgIEdMX1RFWFRVUkVfV1JBUF9UICovCisKKyNkZWZpbmUgR0xfTlVNX0NPTVBSRVNTRURfVEVYVFVSRV9GT1JNQVRTIDB4ODZBMgorI2RlZmluZSBHTF9DT01QUkVTU0VEX1RFWFRVUkVfRk9STUFUUyAgICAgMHg4NkEzCisKKy8qIEhpbnRNb2RlICovCisjZGVmaW5lIEdMX0RPTlRfQ0FSRSAgICAgICAgICAgICAgICAgICAgICAweDExMDAKKyNkZWZpbmUgR0xfRkFTVEVTVCAgICAgICAgICAgICAgICAgICAgICAgIDB4MTEwMQorI2RlZmluZSBHTF9OSUNFU1QgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMTAyCisKKy8qIEhpbnRUYXJnZXQgKi8KKyNkZWZpbmUgR0xfR0VORVJBVEVfTUlQTUFQX0hJTlQgICAgICAgICAgICAweDgxOTIKKworLyogRGF0YVR5cGUgKi8KKyNkZWZpbmUgR0xfQllURSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTQwMAorI2RlZmluZSBHTF9VTlNJR05FRF9CWVRFICAgICAgICAgICAgICAgICAgMHgxNDAxCisjZGVmaW5lIEdMX1NIT1JUICAgICAgICAgICAgICAgICAgICAgICAgICAweDE0MDIKKyNkZWZpbmUgR0xfVU5TSUdORURfU0hPUlQgICAgICAgICAgICAgICAgIDB4MTQwMworI2RlZmluZSBHTF9JTlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxNDA0CisjZGVmaW5lIEdMX1VOU0lHTkVEX0lOVCAgICAgICAgICAgICAgICAgICAweDE0MDUKKyNkZWZpbmUgR0xfRkxPQVQgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTQwNgorI2RlZmluZSBHTF9GSVhFRCAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxNDBDCisKKy8qIFBpeGVsRm9ybWF0ICovCisjZGVmaW5lIEdMX0RFUFRIX0NPTVBPTkVOVCAgICAgICAgICAgICAgICAweDE5MDIKKyNkZWZpbmUgR0xfQUxQSEEgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTkwNgorI2RlZmluZSBHTF9SR0IgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxOTA3CisjZGVmaW5lIEdMX1JHQkEgICAgICAgICAgICAgICAgICAgICAgICAgICAweDE5MDgKKyNkZWZpbmUgR0xfTFVNSU5BTkNFICAgICAgICAgICAgICAgICAgICAgIDB4MTkwOQorI2RlZmluZSBHTF9MVU1JTkFOQ0VfQUxQSEEgICAgICAgICAgICAgICAgMHgxOTBBCisKKy8qIFBpeGVsVHlwZSAqLworLyogICAgICBHTF9VTlNJR05FRF9CWVRFICovCisjZGVmaW5lIEdMX1VOU0lHTkVEX1NIT1JUXzRfNF80XzQgICAgICAgICAweDgwMzMKKyNkZWZpbmUgR0xfVU5TSUdORURfU0hPUlRfNV81XzVfMSAgICAgICAgIDB4ODAzNAorI2RlZmluZSBHTF9VTlNJR05FRF9TSE9SVF81XzZfNSAgICAgICAgICAgMHg4MzYzCisKKy8qIFNoYWRlcnMgKi8KKyNkZWZpbmUgR0xfRlJBR01FTlRfU0hBREVSICAgICAgICAgICAgICAgICAgMHg4QjMwCisjZGVmaW5lIEdMX1ZFUlRFWF9TSEFERVIgICAgICAgICAgICAgICAgICAgIDB4OEIzMQorI2RlZmluZSBHTF9NQVhfVkVSVEVYX0FUVFJJQlMgICAgICAgICAgICAgICAweDg4NjkKKyNkZWZpbmUgR0xfTUFYX1ZFUlRFWF9VTklGT1JNX1ZFQ1RPUlMgICAgICAgMHg4REZCCisjZGVmaW5lIEdMX01BWF9WQVJZSU5HX1ZFQ1RPUlMgICAgICAgICAgICAgIDB4OERGQworI2RlZmluZSBHTF9NQVhfQ09NQklORURfVEVYVFVSRV9JTUFHRV9VTklUUyAweDhCNEQKKyNkZWZpbmUgR0xfTUFYX1ZFUlRFWF9URVhUVVJFX0lNQUdFX1VOSVRTICAgMHg4QjRDCisjZGVmaW5lIEdMX01BWF9URVhUVVJFX0lNQUdFX1VOSVRTICAgICAgICAgIDB4ODg3MgorI2RlZmluZSBHTF9NQVhfRlJBR01FTlRfVU5JRk9STV9WRUNUT1JTICAgICAweDhERkQKKyNkZWZpbmUgR0xfU0hBREVSX1RZUEUgICAgICAgICAgICAgICAgICAgICAgMHg4QjRGCisjZGVmaW5lIEdMX0RFTEVURV9TVEFUVVMgICAgICAgICAgICAgICAgICAgIDB4OEI4MAorI2RlZmluZSBHTF9MSU5LX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAweDhCODIKKyNkZWZpbmUgR0xfVkFMSURBVEVfU1RBVFVTICAgICAgICAgICAgICAgICAgMHg4QjgzCisjZGVmaW5lIEdMX0FUVEFDSEVEX1NIQURFUlMgICAgICAgICAgICAgICAgIDB4OEI4NQorI2RlZmluZSBHTF9BQ1RJVkVfVU5JRk9STVMgICAgICAgICAgICAgICAgICAweDhCODYKKyNkZWZpbmUgR0xfQUNUSVZFX1VOSUZPUk1fTUFYX0xFTkdUSCAgICAgICAgMHg4Qjg3CisjZGVmaW5lIEdMX0FDVElWRV9BVFRSSUJVVEVTICAgICAgICAgICAgICAgIDB4OEI4OQorI2RlZmluZSBHTF9BQ1RJVkVfQVRUUklCVVRFX01BWF9MRU5HVEggICAgICAweDhCOEEKKyNkZWZpbmUgR0xfU0hBRElOR19MQU5HVUFHRV9WRVJTSU9OICAgICAgICAgMHg4QjhDCisjZGVmaW5lIEdMX0NVUlJFTlRfUFJPR1JBTSAgICAgICAgICAgICAgICAgIDB4OEI4RAorCisvKiBTdGVuY2lsRnVuY3Rpb24gKi8KKyNkZWZpbmUgR0xfTkVWRVIgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwMAorI2RlZmluZSBHTF9MRVNTICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMjAxCisjZGVmaW5lIEdMX0VRVUFMICAgICAgICAgICAgICAgICAgICAgICAgICAweDAyMDIKKyNkZWZpbmUgR0xfTEVRVUFMICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwMworI2RlZmluZSBHTF9HUkVBVEVSICAgICAgICAgICAgICAgICAgICAgICAgMHgwMjA0CisjZGVmaW5lIEdMX05PVEVRVUFMICAgICAgICAgICAgICAgICAgICAgICAweDAyMDUKKyNkZWZpbmUgR0xfR0VRVUFMICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDIwNgorI2RlZmluZSBHTF9BTFdBWVMgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMjA3CisKKy8qIFN0ZW5jaWxPcCAqLworLyogICAgICBHTF9aRVJPICovCisjZGVmaW5lIEdMX0tFRVAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDFFMDAKKyNkZWZpbmUgR0xfUkVQTEFDRSAgICAgICAgICAgICAgICAgICAgICAgIDB4MUUwMQorI2RlZmluZSBHTF9JTkNSICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxRTAyCisjZGVmaW5lIEdMX0RFQ1IgICAgICAgICAgICAgICAgICAgICAgICAgICAweDFFMDMKKyNkZWZpbmUgR0xfSU5WRVJUICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTUwQQorI2RlZmluZSBHTF9JTkNSX1dSQVAgICAgICAgICAgICAgICAgICAgICAgMHg4NTA3CisjZGVmaW5lIEdMX0RFQ1JfV1JBUCAgICAgICAgICAgICAgICAgICAgICAweDg1MDgKKworLyogU3RyaW5nTmFtZSAqLworI2RlZmluZSBHTF9WRU5ET1IgICAgICAgICAgICAgICAgICAgICAgICAgMHgxRjAwCisjZGVmaW5lIEdMX1JFTkRFUkVSICAgICAgICAgICAgICAgICAgICAgICAweDFGMDEKKyNkZWZpbmUgR0xfVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgICAgIDB4MUYwMgorI2RlZmluZSBHTF9FWFRFTlNJT05TICAgICAgICAgICAgICAgICAgICAgMHgxRjAzCisKKy8qIFRleHR1cmVNYWdGaWx0ZXIgKi8KKyNkZWZpbmUgR0xfTkVBUkVTVCAgICAgICAgICAgICAgICAgICAgICAgIDB4MjYwMAorI2RlZmluZSBHTF9MSU5FQVIgICAgICAgICAgICAgICAgICAgICAgICAgMHgyNjAxCisKKy8qIFRleHR1cmVNaW5GaWx0ZXIgKi8KKy8qICAgICAgR0xfTkVBUkVTVCAqLworLyogICAgICBHTF9MSU5FQVIgKi8KKyNkZWZpbmUgR0xfTkVBUkVTVF9NSVBNQVBfTkVBUkVTVCAgICAgICAgIDB4MjcwMAorI2RlZmluZSBHTF9MSU5FQVJfTUlQTUFQX05FQVJFU1QgICAgICAgICAgMHgyNzAxCisjZGVmaW5lIEdMX05FQVJFU1RfTUlQTUFQX0xJTkVBUiAgICAgICAgICAweDI3MDIKKyNkZWZpbmUgR0xfTElORUFSX01JUE1BUF9MSU5FQVIgIC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AgICAgICAgICAgICAgICAgICAgICAgIDB4ODRDMAorI2RlZmluZSBHTF9URVhUVVJFMSAgICAgICAgICAgICAgICAgICAgICAgMHg4NEMxCisjZGVmaW5lIEdMX1RFWFRVUkUyICAgICAgICAgICAgICAgICAgICAgICAweDg0QzIKKyNkZWZpbmUgR0xfVEVYVFVSRTMgICAgICAgICAgICAgICAgICAgICAgIDB4ODRDMworI2RlZmluZSBHTF9URVhUVVJFNCAgICAgICAgICAgICAgICAgICAgICAgMHg4NEM0CisjZGVmaW5lIEdMX1RFWFRVUkU1ICAgICAgICAgICAgICAgICAgICAgICAweDg0QzUKKyNkZWZpbmUgR0xfVEVYVFVSRTYgICAgICAgICAgICAgICAgICAgICAgIDB4ODRDNgorI2RlZmluZSBHTF9URVhUVVJFNyAgICAgICAgICAgICAgICAgICAgICAgMHg4NEM3CisjZGVmaW5lIEdMX1RFWFRVUkU4ICAgICAgICAgICAgICAgICAgICAgICAweDg0QzgKKyNkZWZpbmUgR0xfVEVYVFVSRTkgICAgICAgICAgICAgICAgICAgICAgIDB4ODRDOQorI2RlZmluZSBHTF9URVhUVVJFMTAgICAgICAgICAgICAgICAgICAgICAgMHg4NENBCisjZGVmaW5lIEdMX1RFWFRVUkUxMSAgICAgICAgICAgICAgICAgICAgICAweDg0Q0IKKyNkZWZpbmUgR0xfVEVYVFVSRTEyICAgICAgICAgICAgICAgICAgICAgIDB4ODRDQworI2RlZmluZSBHTF9URVhUVVJFMTMgICAgICAgICAgICAgICAgICAgICAgMHg4NENECisjZGVmaW5lIEdMX1RFWFRVUkUxNCAgICAgICAgICAgICAgICAgICAgICAweDg0Q0UKKyNkZWZpbmUgR0xfVEVYVFVSRTE1ICAgICAgICAgICAgICAgICAgICAgIDB4ODRDRgorI2RlZmluZSBHTF9URVhUVVJFMTYgICAgICAgICAgICAgICAgICAgICAgMHg4NEQwCisjZGVmaW5lIEdMX1RFWFRVUkUxNyAgICAgICAgICAgICAgICAgICAgICAweDg0RDEKKyNkZWZpbmUgR0xfVEVYVFVSRTE4ICAgICAgICAgICAgICAgICAgICAgIDB4ODREMgorI2RlZmluZSBHTF9URVhUVVJFMTkgICAgICAgICAgICAgICAgICAgICAgMHg4NEQzCisjZGVmaW5lIEdMX1RFWFRVUkUyMCAgICAgICAgICAgICAgICAgICAgICAweDg0RDQKKyNkZWZpbmUgR0xfVEVYVFVSRTIxICAgICAgICAgICAgICAgICAgICAgIDB4ODRENQorI2RlZmluZSBHTF9URVhUVVJFMjIgICAgICAgICAgICAgICAgICAgICAgMHg4NEQ2CisjZGVmaW5lIEdMX1RFWFRVUkUyMyAgICAgICAgICAgICAgICAgICAgICAweDg0RDcKKyNkZWZpbmUgR0xfVEVYVFVSRTI0ICAgICAgICAgICAgICAgICAgICAgIDB4ODREOAorI2RlZmluZSBHTF9URVhUVVJFMjUgICAgICAgICAgICAgICAgICAgICAgMHg4NEQ5CisjZGVmaW5lIEdMX1RFWFRVUkUyNiAgICAgICAgICAgICAgICAgICAgICAweDg0REEKKyNkZWZpbmUgR0xfVEVYVFVSRTI3ICAgICAgICAgICAgICAgICAgICAgIDB4ODREQgorI2RlZmluZSBHTF9URVhUVVJFMjggICAgICAgICAgICAgICAgICAgICAgMHg4NERDCisjZGVmaW5lIEdMX1RFWFRVUkUyOSAgICAgICAgICAgICAgICAgICAgICAweDg0REQKKyNkZWZpbmUgR0xfVEVYVFVSRTMwICAgICAgICAgICAgICAgICAgICAgIDB4ODRERQorI2RlZmluZSBHTF9URVhUVVJFMzEgICAgICAgICAgICAgICAgICAgICAgMHg4NERGCisjZGVmaW5lIEdMX0FDVElWRV9URVhUVVJFICAgICAgICAgICAgICAgICAweDg0RTAKKworLyogVGV4dHVyZVdyYXBNb2RlICovCisjZGVmaW5lIEdMX1JFUEVBVCAgICAgICAgICAgICAgICAgICAgICAgICAweDI5MDEKKyNkZWZpbmUgR0xfQ0xBTVBfVE9fRURHRSAgICAgICAgICAgICAgICAgIDB4ODEyRgorI2RlZmluZSBHTF9NSVJST1JFRF9SRVBFQVQgICAgICAgICAgICAgICAgMHg4MzcwCisKKy8qIFVuaWZvcm0gVHlwZXMgKi8KKyNkZWZpbmUgR0xfRkxPQVRfVkVDMiAgICAgICAgICAgICAgICAgICAgIDB4OEI1MAorI2RlZmluZSBHTF9GTE9BVF9WRUMzICAgICAgICAgICAgICAgICAgICAgMHg4QjUxCisjZGVmaW5lIEdMX0ZMT0FUX1ZFQzQgICAgICAgICAgICAgICAgICAgICAweDhCNTIKKyNkZWZpbmUgR0xfSU5UX1ZFQzIgICAgICAgICAgICAgICAgICAgICAgIDB4OEI1MworI2RlZmluZSBHTF9JTlRfVkVDMyAgICAgICAgICAgICAgICAgICAgICAgMHg4QjU0CisjZGVmaW5lIEdMX0lOVF9WRUM0ICAgICAgICAgICAgICAgICAgICAgICAweDhCNTUKKyNkZWZpbmUgR0xfQk9PTCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4OEI1NgorI2RlZmluZSBHTF9CT09MX1ZFQzIgICAgICAgICAgICAgICAgICAgICAgMHg4QjU3CisjZGVmaW5lIEdMX0JPT0xfVkVDMyAgICAgICAgICAgICAgICAgICAgICAweDhCNTgKKyNkZWZpbmUgR0xfQk9PTF9WRUM0ICAgICAgICAgICAgICAgICAgICAgIDB4OEI1OQorI2RlZmluZSBHTF9GTE9BVF9NQVQyICAgICAgICAgICAgICAgICAgICAgMHg4QjVBCisjZGVmaW5lIEdMX0ZMT0FUX01BVDMgICAgICAgICAgICAgICAgICAgICAweDhCNUIKKyNkZWZpbmUgR0xfRkxPQVRfTUFUNCAgICAgICAgICAgICAgICAgICAgIDB4OEI1QworI2RlZmluZSBHTF9TQU1QTEVSXzJEICAgICAgICAgICAgICAgICAgICAgMHg4QjVFCisjZGVmaW5lIEdMX1NBTVBMRVJfQ1VCRSAgICAgICAgICAgICAgICAgICAweDhCNjAKKworLyogVmVydGV4IEFycmF5cyAqLworI2RlZmluZSBHTF9WRVJURVhfQVRUUklCX0FSUkFZX0VOQUJMRUQgICAgIC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AqLworI2RlZmluZSBHTF9MT1dfRkxPQVQgICAgICAgICAgICAgICAgICAgICAgMHg4REYwCisjZGVmaW5lIEdMX01FRElVTV9GTE9BVCAgICAgICAgICAgICAgICAgICAweDhERjEKKyNkZWZpbmUgR0xfSElHSF9GTE9BVCAgICAgICAgICAgICAgICAgICAgIDB4OERGMgorI2RlZmluZSBHTF9MT1dfSU5UICAgICAgICAgICAgICAgICAgICAgICAgMHg4REYzCisjZGVmaW5lIEdMX01FRElVTV9JTlQgICAgICAgICAgICAgICAgICAgICAweDhERjQKKyNkZWZpbmUgR0xfSElHSF9JTlQgICAgICAgICAgICAgICAgICAgICAgIDB4OERGNQorCisvKiBGcmFtZWJ1ZmZlciBPYmplY3QuICovCisjZGVmaW5lIEdMX0ZSQU1FQlVGRkVSICAgICAgICAgICAgICAgICAgICAweDhENDAKKyNkZWZpbmUgR0xfUkVOREVSQlVGRkVSICAgICAgICAgICAgICAgICAgIDB4OEQ0MQorCisjZGVmaW5lIEdMX1JHQkE0ICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwNTYKKyNkZWZpbmUgR0xfUkdCNV9BMSAgICAgICAgICAgICAgICAgICAgICAgIDB4ODA1NworI2RlZmluZSBHTF9SR0I1NjUgICAgICAgICAgICAgICAgICAgICAgICAgMHg4RDYyCisjZGVmaW5lIEdMX0RFUFRIX0NPTVBPTkVOVDE2ICAgICAgICAgICAgICAweDgxQTUKKyNkZWZpbmUgR0xfU1RFTkNJTF9JTkRFWCAgICAgICAgICAgICAgICAgIDB4MTkwMQorI2RlZmluZSBHTF9TVEVOQ0lMX0lOREVYOCAgICAgICAgICAgICAgICAgMHg4RDQ4CisKKyNkZWZpbmUgR0xfUkVOREVSQlVGRkVSX1dJRFRIICAgICAgICAgICAgIDB4OEQ0MgorI2RlZmluZSBHTF9SRU5ERVJCVUZGRVJfSEVJR0hUICAgICAgICAgICAgMHg4RDQzCisjZGVmaW5lIEdMX1JFTkRFUkJVRkZFUl9JTlRFUk5BTF9GT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fRVRDMV9SR0I4X3RleHR1cmUKKyNkZWZpbmUgR0xfRVRDMV9SR0I4X09FUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhENjQKKyNlbmRpZgorCisvKiBHTF9PRVNfY29tcHJlc3NlZF9wYWxldHRlZF90ZXh0dXJlICovCisjaWZuZGVmIEdMX09FU19jb21wcmVzc2VkX3BhbGV0dGVkX3RleHR1cmUKKyNkZWZpbmUgR0xfUEFMRVRURTRfUkdCOF9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTAKKyNkZWZpbmUgR0xfUEFMRVRURTRfUkdCQThfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTEKKyNkZWZpbmUgR0xfUEFMRVRURTRfUjVfRzZfQjVfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTIKKyNkZWZpbmUgR0xfUEFMRVRURTRfUkdCQTRfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTMKKyNkZWZpbmUgR0xfUEFMRVRURTRfUkdCNV9BMV9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTQKKyNkZWZpbmUgR0xfUEFMRVRURThfUkdCOF9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTUKKyNkZWZpbmUgR0xfUEFMRVRURThfUkdCQThfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTYKKyNkZWZpbmUgR0xfUEFMRVRURThfUjVfRzZfQjVfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTcKKyNkZWZpbmUgR0xfUEFMRVRURThfUkdCQTRfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTgKKyNkZWZpbmUgR0xfUEFMRVRURThfUkdCNV9BMV9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhCOTkKKyNlbmRpZgorCisvKiBHTF9PRVNfZGVwdGgyNCAqLworI2lmbmRlZiBHTF9PRVNfZGVwdGgyNAorI2RlZmluZSBHTF9ERVBUSF9DT01QT05FTlQyNF9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODFBNgorI2VuZGlmCisKKy8qIEdMX09FU19kZXB0aDMyICovCisjaWZuZGVmIEdMX09FU19kZXB0aDMyCisjZGVmaW5lIEdMX0RFUFRIX0NPTVBPTkVOVDMyX09FUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MUE3CisjZW5kaWYKKworLyogR0xfT0VTX2RlcHRoX3RleHR1cmUgKi8KKy8qIE5vIG5ldyB0b2tlbnMgaW50cm9kdWNlZCBieSB0aGlzIGV4dGVuc2lvbi4gKi8KKworLyogR0xfT0VTX0VHTF9pbWFnZSAqLworI2lmbmRlZiBHTF9PRVNfRUdMX2ltYWdlCit0eXBlZGVmIHZvaWQqIEdMZWdsSW1hZ2VPRVM7CisjZW5kaWYKKworLyogR0xfT0VTX2dldF9wcm9ncmFtX2JpbmFyeSAqLworI2lmbmRlZiBHTF9PRVNfZ2V0X3Byb2dyYW1fYmluYXJ5CisjZGVmaW5lIEdMX1BST0dSQU1fQklOQVJZX0xFTkdUSF9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4NzQxCisjZGVmaW5lIEdMX05VTV9QUk9HUkFNX0JJTkFSWV9GT1JNQVRTX09FUyAgICAgICAgICAgICAgICAgICAgICAgMHg4N0ZFCisjZGVmaW5lIEdMX1BST0dSQU1fQklOQVJZX0ZPUk1BVFNfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4N0ZGCisjZW5kaWYKKworLyogR0xfT0VTX21hcGJ1ZmZlciAqLworI2lmbmRlZiBHTF9PRVNfbWFwYnVmZmVyCisjZGVmaW5lIEdMX1dSSVRFX09OTFlfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4OEI5CisjZGVmaW5lIEdMX0JVRkZFUl9BQ0NFU1NfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4OEJCCisjZGVmaW5lIEdMX0JVRkZFUl9NQVBQRURfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4OEJDCisjZGVmaW5lIEdMX0JVRkZFUl9NQVBfUE9JTlRFUl9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4OEJECisjZW5kaWYKKworLyogR0xfT0VTX3BhY2tlZF9kZXB0aF9zdGVuY2lsICovCisjaWZuZGVmIEdMX09FU19wYWNrZWRfZGVwdGhfc3RlbmNpbAorI2RlZmluZSBHTF9ERVBUSF9TVEVOQ0lMX09FUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODRGOQorI2RlZmluZSBHTF9VTlNJR05FRF9JTlRfMjRfOF9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODRGQQorI2RlZmluZSBHTF9ERVBUSDI0X1NURU5DSUw4X09FUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODhGMAorI2VuZGlmCisKKy8qIEdMX09FU19yZ2I4X3JnYmE4ICovCisjaWZuZGVmIEdMX09FU19yZ2I4X3JnYmE4CisjZGVmaW5lIEdMX1JHQjhfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDUxCisjZGVmaW5lIEdMX1JHQkE4X09FUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDU4CisjZW5kaWYKKworLyogR0xfT0VTX3N0YW5kYXJkX2Rlcml2YXRpdmVzICovCisjaWZuZGVmIEdMX09FU19zdGFuZGFyZF9kZXJpdmF0aXZlcworI2RlZmluZSBHTF9GUkFHTUVOVF9TSEFERVJfREVSSVZBVElWRV9ISU5UX09FUyAgICAgICAgICAgICAgICAgIDB4OEI4QgorI2VuZGlmCisKKy8qIEdMX09FU19zdGVuY2lsMSAqLworI2lmbmRlZiBHTF9PRVNfc3RlbmNpbDEKKyNkZWZpbmUgR0xfU1RFTkNJTF9JTkRFWDFfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhENDYKKyNlbmRpZgorCisvKiBHTF9PRVNfc3RlbmNpbDQgKi8KKyNpZm5kZWYgR0xfT0VTX3N0ZW5jaWw0CisjZGVmaW5lIEdMX1NURU5DSUxfSU5ERVg0X09FUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4RDQ3CisjZW5kaWYKKworLyogR0xfT0VTX3RleHR1cmUzRCAqLworI2lmbmRlZiBHTF9PRVNfdGV4dHVyZTNECisjZGVmaW5lIEdMX1RFWFRVUkVfV1JBUF9SX09FUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDcyCisjZGVmaW5lIEdMX1RFWFRVUkVfM0RfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDZGCisjZGVmaW5lIEdMX1RFWFRVUkVfQklORElOR18zRF9PRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDZBCisjZGVmaW5lIEdMX01BWF8zRF9URVhUVVJFX1NJWkVfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MDczCisjZGVmaW5lIEdMX1NBTVBMRVJfM0RfT0VTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4QjVGCisjZGVmaW5lIEdMX0ZSQU1FQlVGRkVSX0FUVEFDSE1FTlRfVEVYVFVSRV8zRF9aT0ZGU0VUX09FUyAgICAgICAgMHg4Q0Q0CisjZW5kaWYKKworLyogR0xfT0VTX3RleHR1cmVfaGFsZl9mbG9hdCAqLworI2lmbmRlZiBHTF9PRVNfdGV4dHVyZV9oYWxmX2Zsb2F0CisjZGVmaW5lIEdMX0hBTEZf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1cmUgKi8KKyNpZm5kZWYgR0xfQU1EX2NvbXByZXNzZWRfQVRDX3RleHR1cmUKKyNkZWZpbmUgR0xfQVRDX1JHQl9BTUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDhDOTIKKyNkZWZpbmUgR0xfQVRDX1JHQkFfRVhQTElDSVRfQUxQSEFfQU1EICAgICAgICAgICAgICAgICAgICAgICAgICAweDhDOTMKKyNkZWZpbmUgR0xfQVRDX1JHQkFfSU5URVJQT0xBVEVEX0FMUEhBX0FNRCAgICAgICAgICAgICAgICAgICAgICAweDg3RUUKKyNlbmRpZgorCisvKiBHTF9BTURfcHJvZ3JhbV9iaW5hcnlfWjQwMCAqLworI2lmbmRlZiBHTF9BTURfcHJvZ3JhbV9iaW5hcnlfWjQwMAorI2RlZmluZSBHTF9aNDAwX0JJTkFSWV9BTUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODc0MAorI2VuZGlmCisKKy8qIEdMX0FNRF9wZXJmb3JtYW5jZV9tb25pdG9yICovCisjaWZuZGVmIEdMX0FNRF9wZXJmb3JtYW5jZV9tb25pdG9yCisjZGVmaW5lIEdMX0NPVU5URVJfVFlQRV9BTUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4QkMwCisjZGVmaW5lIEdMX0NPVU5URVJfUkFOR0VfQU1EICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4QkMxCisjZGVmaW5lIEdMX1VOU0lHTkVEX0lOVDY0X0FNRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4QkMyCisjZGVmaW5lIEdMX1BFUkNFTlRBR0VfQU1EICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4QkMzCisjZGVmaW5lIEdMX1BFUkZNT05fUkVTVUxUX0FWQUlMQUJMRV9BTUQgICAgICAgICAgICAgICAgICAgICAgICAgMHg4QkM0CisjZGVmaW5lIE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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODBFMQorI2VuZGlmCisKKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgorICogSU1HIGV4dGVuc2lvbiB0b2tlbnMKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKworLyogR0xfSU1HX3JlYWRfZm9ybWF0ICovCisjaWZuZGVmIEdMX0lNR19yZWFkX2Zvcm1hdAorI2RlZmluZSBHTF9CR1JBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODBFMQorI2RlZmluZSBHTF9VTlNJR05FRF9TSE9SVF80XzRfNF80X1JFViAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODM2NQorI2RlZmluZSBHTF9VTlNJR05FRF9TSE9SVF8xXzVfNV81X1JFViAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ODM2NgorI2VuZGlmCisKKy8qIEdMX0lNR190ZXh0dXJlX2NvbXByZXNzaW9uX3B2cnRjICovCisjaWZuZGVmIEdMX0lNR190ZXh0dXJlX2NvbXByZXNzaW9uX3B2cnRjCisjZGVmaW5lIEdMX0NPTVBSRVNTRURfUkdCX1BWUlRDXzRCUFBWMV9JTUcgICAgICAgICAgICAgICAgICAgICAgMHg4QzAwCisjZGVmaW5lIEdMX0NPTVBSRVNTRURfUkdCX1BWUlRDXzJCUFBWMV9JTUcgICAgICAgICAgICAgICAgICAgICAgMHg4QzAxCisjZGVmaW5lIEdMX0NPTVBSRVNTRURfUkdCQV9QVlJUQ180QlBQVjFfSU1HICAgICAgICAgICAgICAgICAgICAgMHg4QzAyCisjZGVmaW5lIEdMX0NPTVBSRVNTRURfUkdCQV9QVlJUQ18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ICAgIEVHTDEwLkVHTF9HUkVFTl9TSVpFLCAwKTsKLSAgICAgICAgICAgICAgICBpbnQgYiA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9CTFVFX1NJWkUsIDApOwotICAgICAgICAgICAgICAgIGludCBhID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywKLSAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9BTFBIQV9TSVpFLCAwKTsKICAgICAgICAgICAgICAgICBpbnQgZCA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsCiAgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfREVQVEhfU0laRSwgMCk7CiAgICAgICAgICAgICAgICAgaW50IHMgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLAogICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1NURU5DSUxfU0laRSwgMCk7Ci0gICAgICAgICAgICAgICAgaW50IGRpc3RhbmNlID0gTWF0aC5hYnMociAtIG1SZWRTaXplKQotICAgICAgICAgICAgICAgICAgICArIE1hdGguYWJzKGcgLSBtR3JlZW5TaXplKQotICAgICAgICAgICAgICAgICAgICArIE1hdGguYWJzKGIgLSBtQmx1ZVNpemUpICsgTWF0aC5hYnMoYSAtIG1BbHBoYVNpemUpCi0gICAgICAgICAgICAgICAgICAgICsgTWF0aC5hYnMoZCAtIG1EZXB0aFNpemUpICsgTWF0aC5hYnMocyAtIG1TdGVuY2lsU2l6ZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGRpc3RhbmNlIDwgY2xvc2VzdERpc3RhbmNlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNsb3Nlc3REaXN0YW5jZSA9IGRpc3RhbmNlOwotICAgICAgICAgICAgICAgICAgICBjbG9zZXN0Q29uZmlnID0gY29uZmlnOworICAgICAgICAgICAgICAgIGlmIChkID49IG1EZXB0aFNpemUgJiYgcz49IG1TdGVuY2lsU2l6ZSkgeworICAgICAgICAgICAgICAgICAgICBpbnQgciA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1JFRF9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGcgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfR1JFRU5fU0laRSwgMCk7CisgICAgICAgICAgICAgICAgICAgIGludCBiID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9CTFVFX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpbnQgYSA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0FMUEhBX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpbnQgZGlzdGFuY2UgPSBNYXRoLmFicyhyIC0gbVJlZFNpemUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTWF0aC5hYnMoZyAtIG1HcmVlblNpemUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTWF0aC5hYnMoYiAtIG1CbHVlU2l6ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBNYXRoLmFicyhhIC0gbUFscGhhU2l6ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkaXN0YW5jZSA8IGNsb3Nlc3REaXN0YW5jZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2xv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F0dXNfdCAgICAgICAgICAgIHJlYWxsb2NhdGUoR0xpbnQgbGV2ZWwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHcsIGludCBoLCBpbnQgcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZm9ybWF0LCBpbnQgY29tcHJlc3NlZEZvcm1hdCwgaW50IGJwcik7Ci0gICAgaW5saW5lICBzaXplX3QgICAgICBzaXplKCkgY29uc3Q7CisgICAgaW5saW5lICBzaXplX3QgICAgICBzaXplKCkgY29uc3QgeyByZXR1cm4gbVNpemU7IH0KICAgICBjb25zdCBHR0xTdXJmYWNlJiAgIG1pcChpbnQgbG9kKSBjb25zdDsKICAgICBHR0xTdXJmYWNlJiAgICAgICAgIGVkaXRNaXAoaW50IGxvZCk7CiAgICAgYm9vbCAgICAgICAgICAgICAgICBoYXNNaXBtYXBzKCkgY29uc3QgeyByZXR1cm4gbU1pcG1hcHMhPTA7IH0KQEAgLTY1LDcgKzY1LDYgQEAKICAgICAgICAgc3RhdHVzX3QgICAgICAgIGFsbG9jYXRlTWlwbWFwcygpOwogICAgICAgICAgICAgdm9pZCAgICAgICAgZnJlZU1pcG1hcHMoKTsKICAgICAgICAgICAgIHZvaWQgICAgICAgIGluaXQoKTsKLSAgICBtdXRhYmxlIGludDMyX3QgICAgIG1Db3VudDsKICAgICBzaXplX3QgICAgICAgICAgICAgIG1TaXplOwogICAgIEdHTFN1cmZhY2UgICAgICAgICAgKm1NaXBtYXBzOwogICAgIGludCAgICAgICAgICAgICAgICAgbU51bUV4dHJhTG9kOwpAQCAtODEsMzYgKzgwLDIyIEBACiAgICAgR0xpbnQgICAgICAgICAgICAgICBjcm9wX3JlY3RbNF07CiAgICAgR0xpbnQgICAgICAgICAgICAgICBnZW5lcmF0ZV9taXBtYXA7CiAgICAgR0xpbnQgICAgICAgICAgICAgICBkaXJlY3Q7CisjaWZkZWYgTElCQUdMX1VTRV9HUkFMTE9DX0NPUFlCSVRTCisgICAgYm9vb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J0ZXhfY2FjaGVfdDo6VkVSVEVYX0NBQ0hFX1NJWkUpOwogICAgIGRvIHsKICAgICAgICAgdmVydGV4X3QqIHYgPSBjLT52Yy52QnVmZmVyOwotICAgICAgICBHTHNpemVpIG51bSA9IGNvdW50ID4gdmNzID8gdmNzIDogY291bnQ7IAorICAgICAgICBHTHNpemVpIG51bSA9IGNvdW50ID4gdmNzID8gdmNzIDogY291bnQ7CiAgICAgICAgIGMtPmFycmF5cy5jdWxsID0gdmVydGV4X3Q6OkNMSVBfQUxMOwogICAgICAgICBjLT5hcnJheXMuY29tcGlsZUVsZW1lbnRzKGMsIHYsIGZpcnN0LCBudW0pOwogICAgICAgICBmaXJzdCArPSBudW07CkBAIC01NjksMTMgKzU3MiwxMyBAQAogICAgIGNvdW50IC09IDE7CiAKICAgICAvLyB2ZXJ0ZXggY2FjaGUgc2l6ZSBtdXN0IGJlIG11bHRpcGxlIG9mIDEKLSAgICBjb25zdCBHTHNpemVpIHZjcyA9IAorICAgIGNvbnN0IEdMc2l6ZWkgdmNzID0KICAgICAgICAgKHZlcnRleF9jYWNoZV90OjpWRVJURVhfQlVGRkVSX1NJWkUgKwogICAgICAgICAgdmVydGV4X2NhY2hlX3Q6OlZFUlRFWF9DQUNIRV9TSVpFIC0gMSk7CiAgICAgZG8gewotICAgICAgICB2MCA9IGMtPnZjLnZCdWZmZXIgKyAwOyAKKyAgICAgICAgdjAgPSBjLT52Yy52QnVmZmVyICsgMDsKICAgICAgICAgdiAgPSBjLT52Yy52QnVmZmVyICsgMTsKLSAgICAgICAgR0xzaXplaSBudW0gPSBjb3VudCA+IHZjcyA/IHZjcyA6IGNvdW50OyAKKyAgICAgICAgR0xzaXplaSBudW0gPSBjb3VudCA+IHZjcyA/IHZjcyA6IGNvdW50OwogICAgICAgICBjLT5hcnJheXMuY29tcGlsZUVsZW1lbnRzKGMsIHYsIGZpcnN0LCBudW0pOwogICAgICAgICBmaXJzdCArPSBudW07CiAgICAgICAgIGNvdW50IC09IG51bTsKQEAgLTYwMiw3ICs2MDUsNyBAQAogICAgICAgICByZXR1cm47CiAgICAgZHJhd1ByaW1pdGl2ZXNMaW5lU3RyaXAoYywgZmlyc3QsIGNvdW50KTsKICAgICBpZiAoZ2dsX2xpa2VseShjb3VudCA+PSAzKSkgewotICAgICAgICB2ZXJ0ZXhfdCogdjAgPSBjLT52Yy52QnVmZmVyOyAKKyAgICAgICAgdmVydGV4X3QqIHYwID0gYy0+dmMudkJ1ZmZlcjsKICAgICAgICAgdmVydGV4X3QqIHYxID0gYy0+dmMudkJ1ZmZlciArIDE7CiAgICAgICAgIGMtPmFycmF5cy5jb21waWxlRWxlbWVudChjLCB2MSwgZmlyc3QpOwogICAgICAgICBjb25zdCB1aW50MzJfdCBjYyA9IHYwLT5mbGFncyAmIHYxLT5mbGFnczsKQEAgLTYxNywxMiArNjIwLDEyIEBACiAgICAgICAgIHJldHVybjsKIAogICAgIC8vIHZlcnRleCBjYWNoZSBzaXplIG11c3QgYmUgbXVsdGlwbGUgb2YgMgotICAgIGNvbnN0IEdMc2l6ZWkgdmNzID0gCisgICAgY29uc3QgR0xzaXplaSB2Y3MgPQogICAgICAgICAoKHZlcnRleF9jYWNoZV90OjpWRVJURVhfQlVGRkVSX1NJWkUgKwogICAgICAgICB2ZXJ0ZXhfY2FjaGVfdDo6VkVSVEVYX0NBQ0hFX1NJWkUpIC8gMikgKiAyOwogICAgIGRvIHsKICAgICAgICAgdmVydGV4X3QqIHYgPSBjLT52Yy52QnVmZmVyOwotICAgICAgICBHTHNpemVpIG51bSA9IGNvdW50ID4gdmNzID8gdmNzIDogY291bnQ7IAorICAgICAgICBHTHNpemVpIG51bSA9IGNvdW50ID4gdmNzID8gdmNzIDogY291bnQ7CiAgICAgICAgIGMtPmFycmF5cy5jdWxsID0gdmVydGV4X3Q6OkNMSVBfQUxMOwogICAgICAgICBjLT5hcnJheXMuY29tcGlsZUVsZW1lbnRzKGMsIHYsIGZpcnN0LCBudW0pOwogICAgICAgICBmaX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+IHZjcyA/IHZjcyA6IGNvdW50OyAKKyAgICAgICAgR0xzaXplaSBudW0gPSBjb3VudCA+IHZjcyA/IHZjcyA6IGNvdW50OwogICAgICAgICBjLT5hcnJheXMuY3VsbCA9IHZlcnRleF90OjpDTElQX0FMTDsKICAgICAgICAgYy0+YXJyYXlzLmNvbXBpbGVFbGVtZW50cyhjLCB2LCBmaXJzdCwgbnVtKTsKICAgICAgICAgZmlyc3QgKz0gbnVtOwpAQCAtNzc5LDExICs3ODgsMTEgQEAKIHsKICAgICBpZiAoZ2dsX3VubGlrZWx5KGNvdW50IDwgMikpCiAgICAgICAgIHJldHVybjsKLSAgICAKKwogICAgIHZlcnRleF90ICogY29uc3QgdiA9IGMtPnZjLnZCdWZmZXI7CiAgICAgdmVydGV4X3QqIHYwID0gdjsKICAgICB2ZXJ0ZXhfdCogdjE7Ci0gICAgCisKICAgICBjb25zdCBpbnQgdHlwZSA9IChjLT5hcnJheXMuaW5kaWNlc1R5cGUgPT0gR0xfVU5TSUdORURfQllURSk7CiAgICAgYy0+YXJyYXlzLmNvbXBpbGVFbGVtZW50KGMsIHYwLCByZWFkX2luZGV4KHR5cGUsIGluZGljZXMpKTsKICAgICBjb3VudCAtPSAxOwpAQCAtODA2LDExICs4MTUsMTEgQEAKICAgICAgICAgZHJhd0luZGV4ZWRQcmltaXRpdmVzTGluZXMoYywgY291bnQsIGluZGljZXMpOwogICAgICAgICByZXR1cm47CiAgICAgfQotIAorCiAgICAgdmVydGV4X3QgKiBjb25zdCB2ID0gYy0+dmMudkJ1ZmZlcjsKICAgICB2ZXJ0ZXhfdCogdjAgPSB2OwogICAgIHZlcnRleF90KiB2MTsKLSAgICAKKwogICAgIGNvbnN0IGludCB0eXBlID0gKGMtPmFycmF5cy5pbmRpY2VzVHlwZSA9PSBHTF9VTlNJR05FRF9CWVRFKTsKICAgICBjLT5hcnJheXMuY29tcGlsZUVsZW1lbnQoYywgdjAsIHJlYWRfaW5kZXgodHlwZSwgaW5kaWNlcyk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0ZXguc2l6ZSAtIDJdOwotICAgIAorCiAgICAgLyoKICAgICAgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgICAqICBwaWNrIGZldGNoZXJzCiAgICAgICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgICAgKi8KLSAgICAKKwogICAgIGFycmF5X21hY2hpbmVfdCYgYW0gPSBjLT5hcnJheXM7CiAgICAgYW0udmVydGV4LmZldGNoID0gZmV0Y2hOb3A7CiAgICAgYW0ubm9ybWFsLmZldGNoID0gY3VycmVudE5vcm1hbDsKICAgICBhbS5jb2xvci5mZXRjaCA9IGN1cnJlbnRDb2xvcjsKLSAgICAKKwogICAgIGlmIChhbS52ZXJ0ZXguZW5hYmxlKSB7CiAgICAgICAgIGFtLnZlcnRleC5yZXNvbHZlKCk7CiAgICAgICAgIGlmIChhbS52ZXJ0ZXguYm8gfHwgYW0udmVydGV4LnBvaW50ZXIpIHsKQEAgLTEzNjYsOSArMTM3NSwxOCBAQAogICAgIGlmICgoYy0+Y3VsbC5lbmFibGUpICYmIChjLT5jdWxsLmN1bGxGYWNlID09IEdMX0ZST05UX0FORF9CQUNLKSkKICAgICAgICAgcmV0dXJuOyAvLyBhbGwgdHJpYW5nbGVzIGFyZSBjdWxsZWQKIAorCiAgICAgdmFsaWRhdGVfYXJyYXlzKGMsIG1vZGUpOworCisgICAgY29uc3QgdWludDMyX3QgZW5hYmxlcyA9IGMtPnJhc3Rlcml6ZXIuc3RhdGUuZW5hYmxlczsKKyAgICBpZiAoZW5hYmxlcyAmIEdHTF9FTkFCTEVfVE1VUykKKyAgICAgICAgb2dsZXNfbG9ja190ZXh0dXJlcyhjKTsKKwogICAgIGRyYXdBcnJheXNQcmltc1ttb2RlXShjLCBmaXJzdCwgY291bnQpOwogCisgICAgaWYgKGVuYWJsZXMgJ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gYXJlIHN1cHBvcnRlZCBieSB0aGUgaGFyZHdhcmUgYW5kCisgICAgLy8gZG8gbm90IGhhdmUgYW4gYWxwaGEgY2hhbm5lbC4gU28gd2UgZG9uJ3QgaGF2ZSB0byByZS1jaGVjayB0aGF0IGhlcmUuCisKKyAgICBzdGF0aWMgY29uc3QgaW50IHRtdSA9IDA7CisgICAgdGV4dHVyZV91bml0X3QmIHUoYy0+dGV4dHVyZXMudG11W3RtdV0pOworICAgIEVHTFRleHR1cmVPYmplY3QqIHRleHR1cmVPYmplY3QgPSB1LnRleHR1cmU7CisKKyAgICBpZiAoIXN1cHBvcnRlZENvcHliaXRzRm9ybWF0KHRleHR1cmVPYmplY3QtPnN1cmZhY2UuZm9ybWF0KSkgeworICAgICAgICBMT0dEX0lGKERFQlVHX0NPUFlCSVQsICJ0ZXh0dXJlIGZvcm1hdCBub3Qgc3VwcG9ydGVkIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgcmV0dXJuIHRydWU7Cit9CisKKworc3RhdGljIGJvb2wgY29weWJpdChHTGludCB4LCBHTGludCB5LAorICAgICAgICBHTGludCB3LCBHTGludCBoLAorICAgICAgICBFR0xUZXh0dXJlT2JqZWN0KiB0ZXh0dXJlT2JqZWN0LAorICAgICAgICBjb25zdCBHTGludCogY3JvcF9yZWN0LAorICAgICAgICBpbnQgdHJhbnNmb3JtLAorICAgICAgICBvZ2xlc19jb250ZXh0X3QqIGMpCit7CisgICAgLy8gV2UgYXNzdW1lIGNoZWNrQ29udGV4dCBoYXMgYWxyZWFkeSBiZWVuIGNhbGxlZCBhbmQgaGFzIGFscmVhZHkKKyAgICAvLyByZXR1cm5lZCB0cnVlLgorCisgICAgY29uc3QgR0dMU3VyZmFjZSYgY2JTdXJmYWNlID0gYy0+cmFzdGVyaXplci5zdGF0ZS5idWZmZXJzLmNvbG9yLnM7CisKKyAgICB5ID0gY2JTdXJmYWNlLmhlaWdodCAtICh5ICsgaCk7CisKKyAgICBjb25z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E9IEdMX0xJTkVBUikgeworICAgICAgICAvLyBOb24tbGluZWFyIGZpbHRlcmluZyBvbiBhbiB0ZXh0dXJlIHNocmluay4KKyAgICAgICAgTE9HRF9JRihERUJVR19DT1BZQklULCAibWluIGZpbHRlciBpcyBub3QgR0xfTElORUFSIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisjZW5kaWYKKyAgICAKKyAgICBjb25zdCB1aW50MzJfdCBlbmFibGVzID0gYy0+cmFzdGVyaXplci5zdGF0ZS5lbmFibGVzOworICAgIGludCBwbGFuZUFscGhhID0gMjU1OworICAgIHN0YXRpYyBjb25zdCBpbnQgdG11ID0gMDsKKyAgICB0ZXh0dXJlX3QmIHRldihjLT5yYXN0ZXJpemVyLnN0YXRlLnRleHR1cmVbdG11XSk7CisgICAgYm9vbCBzcmNUZXh0dXJlSGFzQWxwaGEgPSBoYXNBbHBoYSh0ZXh0dXJlT2JqZWN0LT5zdXJmYWNlLmZvcm1hdCk7CisgICAgaWYgKCFzcmNUZXh0dXJlSGFzQWxwaGEpIHsKKyAgICAgICAgcGxhbmVBbHBoYSA9IGZpeGVkVG9CeXRlKGMtPmN1cnJlbnRDb2xvckNsYW1wZWQuYSk7CisgICAgfQorCisgICAgc3dpdGNoICh0ZXYuZW52KSB7CisgICAgY2FzZSBHR0xfUkVQTEFDRToKKyAgICAgICAgYnJlYWs7CisgICAgY2FzZSBHR0xfTU9EVUxBVEU6CisgICAgICAgIGlmICghIChjLT5jdXJyZW50Q29sb3JDbGFtcGVkLnIgPT0gRklYRURfT05FICYmCisgICAgICAgICAgICAgICBjLT5jdXJyZW50Q29sb3JDbGFtcGVkLmcgPT0gRklYRURfT05FICYmCisgICAgICAgICAgICAgICBjLT5jdXJyZW50Q29sb3JDbGFtcGVkLmIgPT0gRklYRURfT05FKSkgeworICAgICAgICAgICAgTE9HRF9JRihERUJVR19DT1BZQklULCAKKyAgICAgICAgICAgICAgICAgICAgIk1PRFVMQVRFIGFuZCBub24gd2hpdGUgY29sb3IgKCUwOHgsICUwOHgsICUwOHgpIiwKKyAgICAgICAgICAgICAgICAgICAgYy0+Y3VycmVudENvbG9yQ2xhbXBlZC5yLAorICAgICAgICAgICAgICAgICAgICBjLT5jdXJyZW50Q29sb3JDbGFtcGVkLmcsCisgICAgICAgICAgICAgICAgICAgIGMtPmN1cnJlbnRDb2xvckNsYW1wZWQuYik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHNyY1RleHR1cmVIYXNBbHBoYSAmJiBjLT5jdXJyZW50Q29sb3JDbGFtcGVkLmEgPCBGSVhFRF9PTkUpIHsKKyAgICAgICAgICAgIExPR0RfSUYoREVCVUdfQ09QWUJJVCwgCisgICAgICAgICAgICAgICAgICAgICJNT0RVTEFURSBhbmQgdGV4dHVyZSB3L2FscGhhIGFuZCBhbHBoYT0lMDh4KSIsCisgICAgICAgICAgICAgICAgICAgIGMtPmN1cnJlbnRDb2xvckNsYW1wZWQuYSk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisKKyAgICBkZWZhdWx0OgorICAgICAgICAvLyBJbmNvbXBhdGlibGUgdGV4dHVyZSBlbnZpcm9ubWVudC4KKyAgICAgICAgTE9HRF9JRihERUJVR19DT1BZQklULCAiaW5jb21wYXRpYmxlIHRleHR1cmUgZW52aXJvbm1lbnQiKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIGJvb2wgYmxlbmRpbmcgPSBmYWxzZTsKKyAgICBpZiAoKGVuYWJsZXMgJiBHR0xfRU5BQkxFX0JMRU5ESU5HKQorICAgICAgICAgICAgJiYgIShjLT5yYXN0ZXJpemVyLnN0YXRlLmJsZW5kLnNyYyA9PSBHTF9PTkUKKyAgICAgICAgICAgICAgICAgICAgJiYgYy0+cmFzdGVyaXplci5zdGF0ZS5ibGVuZC5kc3QgPT0gR0xfWkVSTykpIHsKKyAg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G93OworICAgIGludCBsID0gbWluKHYwLngsIHYyLngpOworICAgIGludCBiID0gbWluKHYwLnksIHYyLnkpOworICAgIGludCByID0gbWF4KHYwLngsIHYyLngpOworICAgIGludCB0ID0gbWF4KHYwLnksIHYyLnkpOworICAgIGlmICgobCAhPSBtaW4odjEueCwgdjMueCkpIHx8IChiICE9IG1pbih2MS55LCB2My55KSkgfHwKKyAgICAgICAgKHIgIT0gbWF4KHYxLngsIHYzLngpKSB8fCAodCAhPSBtYXgodjEueSwgdjMueSkpKSB7CisgICAgICAgIExPR0RfSUYoREVCVUdfQ09QWUJJVCwgImdlb21ldHJ5IG5vdCBhIHJlY3RhbmdsZSIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLy8gZmV0Y2ggYW5kIHRyYW5zZm9ybSB0ZXh0dXJlIGNvb3JkaW5hdGVzCisgICAgLy8gTk9URTogbWF5YmUgaXQgd291bGQgYmUgYmV0dGVyIHRvIGhhdmUgYSAiY29tcGlsZUVsZW1lbnRzQWxsIiBtZXRob2QKKyAgICAvLyB0aGF0IHdvdWxkIGVuc3VyZSBhbGwgdmVydGV4IGRhdGEgYXJlIGZldGNoZWQgYW5kIHRyYW5zZm9ybWVkCisgICAgY29uc3QgdHJhbnNmb3JtX3QmIHRyID0gYy0+dHJhbnNmb3Jtcy50ZXh0dXJlWzBdLnRyYW5zZm9ybTsgCisgICAgZm9yIChzaXplX3QgaT0wIDsgaTw0IDsgaSsrKSB7CisgICAgICAgIGNvbnN0IEdMdWJ5dGUqIHRwID0gYy0+YXJyYXlzLnRleHR1cmVbMF0uZWxlbWVudChpKTsKKyAgICAgICAgdmVydGV4X3QqIGNvbnN0IHYgPSAmYy0+dmMudkJ1ZmZlcltpXTsKKyAgICAgICAgYy0+YXJyYXlzLnRleHR1cmVbMF0uZmV0Y2goYywgdi0+dGV4dHVyZVswXS52LCB0cCk7CisgICAgICAgIC8vIEZJWE1FOiB3ZSBzaG91bGQgYmFpbCBpZiBxIT0xCisgICAgICAgIGMtPmFycmF5cy50ZXhfdHJhbnNmb3JtWzBdKCZ0ciwgJnYtPnRleHR1cmVbMF0sICZ2LT50ZXh0dXJlWzBdKTsKKyAgICB9CisgICAgCisgICAgY29uc3QgdmVjNF90JiB0MCA9IGMtPnZjLnZCdWZmZXJbMF0udGV4dHVyZVswXTsKKyAgICBjb25zdCB2ZWM0X3QmIHQxID0gYy0+dmMudkJ1ZmZlclsxXS50ZXh0dXJlWzBdOworICAgIGNvbnN0IHZlYzRfdCYgdDIgPSBjLT52Yy52QnVmZmVyWzJdLnRleHR1cmVbMF07CisgICAgY29uc3QgdmVjNF90JiB0MyA9IGMtPnZjLnZCdWZmZXJbM10udGV4dHVyZVswXTsKKyAgICBpbnQgdHhsID0gbWluKHQwLngsIHQyLngpOworICAgIGludCB0eGIgPSBtaW4odDAueSwgdDIueSk7CisgICAgaW50IHR4ciA9IG1heCh0MC54LCB0Mi54KTsKKyAgICBpbnQgdHh0ID0gbWF4KHQwLnksIHQyLnkpOworICAgIGlmICgodHhsICE9IG1pbih0MS54LCB0My54KSkgfHwgKHR4YiAhPSBtaW4odDEueSwgdDMueSkpIHx8CisgICAgICAgICh0eHIgIT0gbWF4KHQxLngsIHQzLngpKSB8fCAodHh0ICE9IG1heCh0MS55LCB0My55KSkpIHsKKyAgICAgICAgTE9HRF9JRihERUJVR19DT1BZQklULCAidGV4Y29vcmQgbm90IGEgcmVjdGFuZ2xlIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgaWYgKCh0eGwgIT0gMCkgfHwgKHR4YiAhPSAwKSB8fAorICAgICAgICAodHhyICE9IEZJWEVEX09ORSkgfHwgKHR4dCAhPSBGSVhFRF9PTkUpKSB7CisgICAgICAgIC8vIHdlIGNvdWxkIHByb2JhYmx5IGhhbmRsZSB0aGlzIGNhc2UsIGlmIHdlIHdhbnRlZCB0bworICAgICAgICBMT0dEX0lGKERFQlVHX0NPUFlCSVQsICJ0ZXh0dXJlIGlz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xlOworICAgIGNvcHliaXRfZGV2aWNlX3QqICAgICAgICAgIGJsaXRlbmdpbmU7CisgICAgaW50IHdpZHRoOworICAgIGludCBoZWlnaHQ7CisgICAgdm9pZCogYml0czsKKyAgICBHR0xGb3JtYXQgY29uc3QqIHBpeGVsRm9ybWF0VGFibGU7CisgICAgCisgICAgc3RydWN0IFJlY3QgeworICAgICAgICBpbmxpbmUgUmVjdCgpIHsgfTsKKyAgICAgICAgaW5saW5lIFJlY3QoaW50MzJfdCB3LCBpbnQzMl90IGgpCisgICAgICAgICAgICA6IGxlZnQoMCksIHRvcCgwKSwgcmlnaHQodyksIGJvdHRvbShoKSB7IH0KKyAgICAgICAgaW5saW5lIFJlY3QoaW50MzJfdCBsLCBpbnQzMl90IHQsIGludDMyX3QgciwgaW50MzJfdCBiKQorICAgICAgICAgICAgOiBsZWZ0KGwpLCB0b3AodCksIHJpZ2h0KHIpLCBib3R0b20oYikgeyB9CisgICAgICAgIFJlY3QmIGFuZFNlbGYoY29uc3QgUmVjdCYgcikgeworICAgICAgICAgICAgbGVmdCAgID0gbWF4KGxlZnQsIHIubGVmdCk7CisgICAgICAgICAgICB0b3AgICAgPSBtYXgodG9wLCByLnRvcCk7CisgICAgICAgICAgICByaWdodCAgPSBtaW4ocmlnaHQsIHIucmlnaHQpOworICAgICAgICAgICAgYm90dG9tID0gbWluKGJvdHRvbSwgci5ib3R0b20pOworICAgICAgICAgICAgcmV0dXJuICp0aGlzOworICAgICAgICB9CisgICAgICAgIGJvb2wgaXNFbXB0eSgpIGNvbnN0IHsKKyAgICAgICAgICAgIHJldHVybiAobGVmdD49cmlnaHQgfHwgdG9wPj1ib3R0b20pOworICAgICAgICB9CisgICAgICAgIHZvaWQgZHVtcChjaGFyIGNvbnN0KiB3aGF0KSB7CisgICAgICAgICAgICBMT0dEKCIlcyB7ICU1ZCwgJTVkLCB3PSU1ZCwgaD0lNWQgfSIsIAorICAgICAgICAgICAgICAgICAgICB3aGF0LCBsZWZ0LCB0b3AsIHJpZ2h0LWxlZnQsIGJvdHRvbS10b3ApOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpbnQzMl90IGxlZnQ7CisgICAgICAgIGludDMyX3QgdG9wOworICAgICAgICBpbnQzMl90IHJpZ2h0OworICAgICAgICBpbnQzMl90IGJvdHRvbTsKKyAgICB9OworCisgICAgc3RydWN0IFJlZ2lvbiB7CisgICAgICAgIGlubGluZSBSZWdpb24oKSA6IGNvdW50KDApIHsgfQorICAgICAgICB0eXBlZGVmIFJlY3QgY29uc3QqIGNvbnN0X2l0ZXJhdG9yOworICAgICAgICBjb25zdF9pdGVyYXRvciBiZWdpbigpIGNvbnN0IHsgcmV0dXJuIHN0b3JhZ2U7IH0KKyAgICAgICAgY29uc3RfaXRlcmF0b3IgZW5kKCkgY29uc3QgeyByZXR1cm4gc3RvcmFnZStjb3VudDsgfQorICAgICAgICBzdGF0aWMgUmVnaW9uIHN1YnRyYWN0KGNvbnN0IFJlY3QmIGxocywgY29uc3QgUmVjdCYgcmhzKSB7CisgICAgICAgICAgICBSZWdpb24gcmVnOworICAgICAgICAgICAgUmVjdCogc3RvcmFnZSA9IHJlZy5zdG9yYWdlOworICAgICAgICAgICAgaWYgKCFsaHMuaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgaWYgKGxocy50b3AgPCByaHMudG9wKSB7IC8vIHRvcCByZWN0CisgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UtPmxlZnQgICA9IGxocy5sZWZ0OworICAgICAgICAgICAgICAgICAgICBzdG9yYWdlLT50b3AgICAgPSBsaHMudG9wOworICAgICAgICAgICAgICAgICAgICBzdG9yYWdlLT5yaWdodCAgPSBsaHMucmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UtPmJvdHRvbSA9IHJocy50b3A7CisgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY29uc3QgaW50MzJfdCB0b3AgPSBtYXgobGhzLnRvcCwgcmhzLnRvcCk7CisgICAgICAgICAgICAgICAgY29uc3QgaW50MzJfdCBib3QgPSBtaW4obGhzLmJvdHRvbSwgcmhzLmJvdHRvbSk7CisgICAgICAgICAgICAgICAgaWYgKHRvcCA8IGJvdCkgeworICAgICAgICAgICAgICAgICAgICBpZiAobGhzLmxlZnQgPCByaHMubGVmdCkgeyAvLyBsZWZ0LXNpZGUgcmVjdAorICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZS0+bGVmdCAgID0gbGhzLmxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlLT50b3AgICAgPSB0b3A7CisgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlLT5yaWdodCAgPSByaHMubGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UtPmJvdHRvbSA9IGJvdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UrKzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobGhzLnJpZ2h0ID4gcmhzLnJpZ2h0KSB7IC8vIHJpZ2h0LXNpZGUgcmVjdAorICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZS0+bGVmdCAgID0gcmhzLnJpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZS0+dG9wICAgID0gdG9wOworICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZS0+cmlnaHQgID0gbGhzLnJpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZS0+Ym90dG9tID0gYm90OworICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChsaHMuYm90dG9tID4gcmhzLmJvdHRvbSkgeyAvLyBib3R0b20gcmVjdAorICAgICAgICAgICAgICAgICAgICBzdG9yYWdlLT5sZWZ0ICAgPSBsaHMubGVmdDsKKyAgICAgICAgICAgICAgICAgICAgc3RvcmFnZS0+dG9wICAgID0gcmhzLmJvdHRvbTsKKyAgICAgICAgICAgICAgICAgICAgc3RvcmFnZS0+cmlnaHQgID0gbGhzLnJpZ2h0OworICAgICAgICAgICAgICAgICAgICBzdG9yYWdlLT5ib3R0b20gPSBsaHMuYm90dG9tOworICAgICAgICAgICAgICAgICAgICBzdG9yYWdlKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlZy5jb3VudCA9IHN0b3JhZ2UgLSByZWcuc3RvcmFnZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiByZWc7CisgICAgICAgIH0KKyAgICAgICAgYm9vbCBpc0VtcHR5KCkgY29uc3QgeworICAgICAgICAgICAgcmV0dXJuIGNvdW50PD0wOworICAgICAgICB9CisgICAgcHJpdmF0ZToKKyAgICAgICAgUmVjdCBzdG9yYWdlWzRdOworICAgICAgICBzc2l6ZV90IGNvdW50OworICAgIH07CisgICAgCisgICAgc3RydWN0IHJlZ2lvbl9pdGVyYXRvciA6IHB1YmxpYyBjb3B5Yml0X3JlZ2lvbl90IHsKKyAgICAgICAgcmVnaW9uX2l0ZXJhdG9yKGNvbnN0IFJlZ2lvbiYgcmVnaW9uKQorICAgICAgICAgICAgOiBiKHJlZ2lvbi5iZWdpbigpKSwgZShyZWdpb24uZW5kKCkpIHsKKyAgICAgICAgICAgIHRoaXMtPm5leHQgPSBpdGVyYXRlOworICAgICAgICB9CisgICAgcHJpdmF0ZToKKyAgICAgICAgc3RhdGljIGludCBpdGVyYXRlKGNvcHliaXRfcmVnaW9uX3QgY29uc3QgKiBzZWxmLCBjb3B5Yml0X3JlY3RfdCogcmVjdCkgeworICAgICAgICAgICAgcmVnaW9uX2l0ZXJhdG9yIGNvbnN0KiBtZSA9IHN0YXRpY19jYXN0PHJlZ2lvbl9pdGVyYXRvciBjb25zdCo+KHNlbGYpOworICAgICAgICAgICAgaWYgKG1lLT5iICE9IG1lLT5lKSB7CisgICAgICAgICAgICAgICAgKnJlaW50ZXJwcmV0X2Nhc3Q8UmVjdCo+KHJlY3QpID0gKm1lLT5iKys7CisgICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICBtdXRhYmxlIFJlZ2lvbjo6Y29uc3RfaXRlcmF0b3IgYjsKKyAgICAgICAgUmVnaW9uOjpjb25zdF9pdGVyYXRvciBjb25zdCBlOworICAgIH07CisKKyAgICB2b2lkIGNvcHlCbHQoCisgICAgICAgICAgICBhbmRyb2lkX25hdGl2ZV9idWZmZXJfdCogZHN0LCB2b2lkKiBkc3RfdmFkZHIsCisgICAgICAgICAgICBhbmRyb2lkX25hdGl2ZV9idWZmZXJfdCogc3JjLCB2b2lkIGNvbnN0KiBzcmNfdmFkZHIsCisgICAgICAgICAgICBjb25zdCBSZWdpb24mIGNsaXApOworCisgICAgUmVjdCBkaXJ0eVJlZ2lvbjsKKyAgICBSZWN0IG9sZERpcnR5UmVnaW9uOwogfTsKIAotZWdsX3dpbmRvd19zdXJmYWNlX3Q6OmVnbF93aW5kb3dfc3VyZmFjZV90KEVHTERpc3BsYXkgZHB5LAorZWdsX3dpbmRvd19zdXJmYWNlX3YyX3Q6OmVnbF93aW5kb3dfc3VyZmFjZV92Ml90KEVHTERpc3BsYXkgZHB5LAogICAgICAgICBFR0xDb25maWcgY29uZmlnLAogICAgICAgICBpbnQzMl90IGRlcHRoRm9ybWF0LAotICAgICAgICBlZ2xfbmF0aXZlX3dpbmRvd190KiB3aW5kb3cpCi0gICAgOiBlZ2xfc3VyZmFjZV90KGRweSwgY29uZmlnLCBkZXB0aEZvcm1hdCksIG5hdGl2ZVdpbmRvdyh3aW5kb3cpCisgICAgICAgIGFuZHJvaWRfbmF0aXZlX3dpbmRvd190KiB3aW5kb3cpCisgICAgOiBlZ2xfc3VyZmFjZV90K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BibGl0ZW5naW5lOworICAgIGlmIChjb3B5Yml0KSAgeworICAgICAgICBjb3B5Yml0X2ltYWdlX3Qgc2ltZzsKKyAgICAgICAgc2ltZy53ID0gc3JjLT53aWR0aDsKKyAgICAgICAgc2ltZy5oID0gc3JjLT5oZWlnaHQ7CisgICAgICAgIHNpbWcuZm9ybWF0ID0gc3JjLT5mb3JtYXQ7CisgICAgICAgIHNpbWcuaGFuZGxlID0gY29uc3RfY2FzdDxuYXRpdmVfaGFuZGxlX3QqPihzcmMtPmhhbmRsZSk7CisKKyAgICAgICAgY29weWJpdF9pbWFnZV90IGRpbWc7CisgICAgICAgIGRpbWcudyA9IGRzdC0+d2lkdGg7CisgICAgICAgIGRpbWcuaCA9IGRzdC0+aGVpZ2h0OworICAgICAgICBkaW1nLmZvcm1hdCA9IGRzdC0+Zm9ybWF0OworICAgICAgICBkaW1nLmhhbmRsZSA9IGNvbnN0X2Nhc3Q8bmF0aXZlX2hhbmRsZV90Kj4oZHN0LT5oYW5kbGUpOworICAgICAgICAKKyAgICAgICAgY29weWJpdC0+c2V0X3BhcmFtZXRlcihjb3B5Yml0LCBDT1BZQklUX1RSQU5TRk9STSwgMCk7CisgICAgICAgIGNvcHliaXQtPnNldF9wYXJhbWV0ZXIoY29weWJpdCwgQ09QWUJJVF9QTEFORV9BTFBIQSwgMjU1KTsKKyAgICAgICAgY29weWJpdC0+c2V0X3BhcmFtZXRlcihjb3B5Yml0LCBDT1BZQklUX0RJVEhFUiwgQ09QWUJJVF9ESVNBQkxFKTsKKyAgICAgICAgcmVnaW9uX2l0ZXJhdG9yIGl0KGNsaXApOworICAgICAgICBlcnIgPSBjb3B5Yml0LT5ibGl0KGNvcHliaXQsICZkaW1nLCAmc2ltZywgJml0KTsKKyAgICAgICAgaWYgKGVyciAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgTE9HRSgiY29weWJpdCBmYWlsZWQgKCVzKSIsIHN0cmVycm9yKGVycikpOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKCFjb3B5Yml0IHx8IGVycikgeworICAgICAgICBSZWdpb246OmNvbnN0X2l0ZXJhdG9yIGN1ciA9IGNsaXAuYmVnaW4oKTsKKyAgICAgICAgUmVnaW9uOjpjb25zdF9pdGVyYXRvciBlbmQgPSBjbGlwLmVuZCgpOworICAgICAgICAKKyAgICAgICAgY29uc3Qgc2l6ZV90IGJwcCA9IHBpeGVsRm9ybWF0VGFibGVbc3JjLT5mb3JtYXRdLnNpemU7CisgICAgICAgIGNvbnN0IHNpemVfdCBkYnByID0gZHN0LT5zdHJpZGUgKiBicHA7CisgICAgICAgIGNvbnN0IHNpemVfdCBzYnByID0gc3JjLT5zdHJpZGUgKiBicHA7CisKKyAgICAgICAgdWludDhfdCBjb25zdCAqIGNvbnN0IHNyY19iaXRzID0gKHVpbnQ4X3QgY29uc3QgKilzcmNfdmFkZHI7CisgICAgICAgIHVpbnQ4X3QgICAgICAgKiBjb25zdCBkc3RfYml0cyA9ICh1aW50OF90ICAgICAgICopZHN0X3ZhZGRyOworCisgICAgICAgIHdoaWxlIChjdXIgIT0gZW5kKSB7CisgICAgICAgICAgICBjb25zdCBSZWN0JiByKCpjdXIrKyk7CisgICAgICAgICAgICBzc2l6ZV90IHcgPSByLnJpZ2h0IC0gci5sZWZ0OworICAgICAgICAgICAgc3NpemVfdCBoID0gci5ib3R0b20gLSByLnRvcDsKKyAgICAgICAgICAgIGlmICh3IDw9IDAgfHwgaDw9MCkgY29udGludWU7CisgICAgICAgICAgICBzaXplX3Qgc2l6ZSA9IHcgKiBicHA7CisgICAgICAgICAgICB1aW50OF90IGNvbnN0ICogcyA9IHNyY19iaXRzICsgKHIubGVmdCArIHNyYy0+c3RyaWRlICogci50b3ApICogYnBwOworICAgICAgICAgICAgdWludDhfdCAgICAgICAqIGQgPSBkc3RfYml0cyArIChyLmxlZnQgKyBkc3QtPnN0cmlkZSAqIHIudG9wKSAqIGJwcDsKKyAgICAgICAgICAgIGlmIChkYnByPT1zYnByICYmIHNpemU9PXNicHIpIHsKKyAgICAgICAgICAgICAgICBzaXplICo9IGg7CisgICAgICAgICAgICAgICAgaCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgbWVtY3B5KGQsIHMsIHNpemUpOworICAgICAgICAgICAgICAgIGQgKz0gZGJwcjsKKyAgICAgICAgICAgICAgICBzICs9IHNicHI7CisgICAgICAgICAgICB9IHdoaWxlICgtLWggPiAwKTsKKyAgICAgICAgfQorICAgIH0KK30KKworRUdMQm9vbGVhbiBlZ2xfd2luZG93X3N1cmZhY2VfdjJfdDo6c3dhcEJ1ZmZlcnMoKQoreworICAgIGlmICghYnVmZmVyKSB7CisgICAgICAgIHJldHVybiBzZXRFcnJvcihFR0xfQkFEX0FDQ0VTUywgRUdMX0ZBTFNFKTsKKyAgICB9CisgICAgCisgICAgLyoKKyAgICAgKiBIYW5kbGUgZWdsU2V0U3dhcFJlY3RhbmdsZUFORFJPSUQoKQorICAgICAqIFdlIGNvcHliYWNrIGZyb20gdGhlIGZyb250IGJ1ZmZlciAKKyAgICAgKi8KKyAgICBpZiAoIWRpcnR5UmVnaW9uLmlzRW1wdHkoKSkgeworICAgICAgICBkaXJ0eVJlZ2lvbi5hbmRTZWxmKFJlY3QoYnVmZmVyLT53aWR0aCwgYnVmZmVyLT5oZWlnaHQpKTsKKyAgICAgICAgaWYgKHByZXZpb3VzQnVmZmVyKSB7CisgICAgICAgICAgICBjb25zdCBSZWdpb24gY29weUJhY2soUmVnaW9uOjpzdWJ0cmFjdChvbGREaXJ0eVJlZ2lvbiwgZGlydHlSZWdpb24pKTsKKyAgICAgICAgICAgIGlmICghY29weUJhY2suaXNFbXB0eSgpKSB7CisgICAgICAgICAgICAgICAgdm9pZCogcHJldkJpdHM7CisgICAgICAgICAgICAgICAgaWYgKGxvY2socHJldmlvdXNCdWZmZXIsIAorICAgICAgICAgICAgICAgICAgICAgICAgR1JBTExPQ19VU0FHRV9TV19SRUFEX09GVEVOLCAmcHJldkJpdHMpID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGNvcHkgZnJvbSBwcmV2aW91c0J1ZmZlciB0byBidWZmZXIKKyAgICAgICAgICAgICAgICAgICAgY29weUJsdChidWZmZXIsIGJpdHMsIHByZXZpb3VzQnVmZmVyLCBwcmV2Qml0cywgY29weUJhY2spOworICAgICAgICAgICAgICAgICAgICB1bmxvY2socHJldmlvdXNCdWZmZXIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBvbGREaXJ0eVJlZ2lvbiA9IGRpcnR5UmVnaW9uOworICAgIH0KKworICAgIGlmIChwcmV2aW91c0J1ZmZlcikgeworICAgICAgICBwcmV2aW91c0J1ZmZlci0+Y29tbW9uLmRlY1JlZigmcHJldmlvdXNCdWZmZXItPmNvbW1vbik7IAorICAgICAgICBwcmV2aW91c0J1ZmZlciA9IDA7CisgICAgfQorICAgIAorICAgIHVubG9jayhidWZmZXIpOworICAgIHByZXZpb3VzQnVmZmVyID0gYnVmZmVyOworICAgIG5hdGl2ZVdpbmRvdy0+cXVldWVCdWZmZXIobmF0aXZlV2luZG93LCBidWZmZXIpOworICAgIGJ1ZmZlciA9IDA7CisKKyAgICAvLyBkZXF1ZXVlIGEgbmV3IGJ1ZmZlcgorICAgIG5hdGl2ZVdpbmRvdy0+ZGVxdWV1ZUJ1ZmZlcihuYXRpdmVXaW5kb3csICZidWZmZXIpOworICAgIAorICAgIC8vIFRPRE86IGxvY2tCdWZmZXIgc2hvdWxkIHJhdGhlciBiZSBleGVjdXRlZCB3aGVuIHRoZSB2ZXJ5IGZpcnN0CisgICAgLy8gZGlyZWN0IHJlbmRlcmluZyBvY2N1cnMuCisgICAgbmF0aXZlV2luZG93LT5sb2NrQnVmZmVyKG5hdGl2ZVdpbmRvdywgYnVmZmVyKTsKKyAgICAKKyAgICAvLyByZWFsbG9jYXRlIHRoZSBkZXB0aC1idWZmZXIgaWY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BsaXN0cyBiZWxvdywgYXR0cmlidXRlcyBuYW1lcyBNVVNUIGJlIHNvcnRlZC4KICAqIEFkZGl0aW9uYWxseSwgYWxsIGNvbmZpZ3MgbXVzdCBiZSBzb3J0ZWQgYWNjb3JkaW5nIHRvCiAgKiB0aGUgRUdMIHNwZWNpZmljYXRpb24uCkBAIC01MjMsNyArOTM3LDcgQEAKICAgICAgICAgeyBFR0xfQ09ORklHX0NBVkVBVCwgICAgICAgICAgICAgIEVHTF9TTE9XX0NPTkZJRyAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICB7IEVHTF9MRVZFTCwgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgIHsgRUdMX01BWF9QQlVGRkVSX0hFSUdIVCwgICAgICAgICBHR0xfTUFYX1ZJRVdQT1JUX0RJTVMgICAgICAgICAgICAgfSwKLSAgICAgICAgeyBFR0xfTUFYX1BCVUZGRVJfUElYRUxTLCAgICAgICAgIAorICAgICAgICB7IEVHTF9NQVhfUEJVRkZFUl9QSVhFTFMsCiAgICAgICAgICAgICAgICAgR0dMX01BWF9WSUVXUE9SVF9ESU1TKkdHTF9NQVhfVklFV1BPUlRfRElNUyAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgeyBFR0xfTUFYX1BCVUZGRVJfV0lEVEgsICAgICAgICAgIEdHTF9NQVhfVklFV1BPUlRfRElNUyAgICAgICAgICAgICB9LAogICAgICAgICB7IEVHTF9OQVRJVkVfUkVOREVSQUJMRSwgICAgICAgICAgRUdMX1RSVUUgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCkBAIC02NjAsOSArMTA3NCw5IEBACiB7CiAgICB3aGlsZSAoZmlyc3QgPD0gbGFzdCkgewogICAgICAgIGludCBtaWQgPSAoZmlyc3QgKyBsYXN0KSAvIDI7Ci0gICAgICAgaWYgKGtleSA+IHNvcnRlZEFycmF5W21pZF0ua2V5KSB7IAorICAgICAgIGlmIChr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1BMQVlfU0NBTElORykgLyBocjsKICAgICAgICAgfSBicmVhazsKICAgICAgICAgY2FzZSBFR0xfU1dBUF9CRUhBVklPUjoKLSAgICAgICAgICAgICp2YWx1ZSA9IHN1cmZhY2UtPmdldFN3YXBCZWhhdmlvcigpOyAKKyAgICAgICAgICAgICp2YWx1ZSA9IHN1cmZhY2UtPmdldFN3YXBCZWhhdmlvcigpOwogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICByZXQgPSBzZXRFcnJvcihFR0xfQkFEX0FUVFJJQlVURSwgRUdMX0ZBTFNFKTsKQEAgLTEyODgsMTMgKzE3MTksMjMgQEAKICAgICAgICAgcmV0dXJuIHNldEVycm9yKEVHTF9CQURfRElTUExBWSwgRUdMX0ZBTFNFKTsKICAgICBpZiAoZHJhdykgewogICAgICAgICBlZ2xfc3VyZmFjZV90KiBzID0gKGVnbF9zdXJmYWNlX3QqKWRyYXc7CisgICAgICAgIGlmICghcy0+aXNWYWxpZCgpKQorICAgICAgICAgICAgcmV0dXJuIHNldEVycm9yKEVHTF9CQURfU1VSRkFDRSwgRUdMX0ZBTFNFKTsKICAgICAgICAgaWYgKHMtPmRweSAhPSBkcHkpCiAgICAgICAgICAgICByZXR1cm4gc2V0RXJyb3IoRUdMX0JBRF9ESVNQTEFZLCBFR0xfRkFMU0UpOwotICAgICAgICAvLyBUT0RPOiBjaGVjayB0aGF0IGRyYXcgYW5kIHJlYWQgYXJlIGNvbXBhdGlibGUgd2l0aCB0aGUgY29udGV4dAorICAgICAgICAvLyBUT0RPOiBjaGVjayB0aGF0IGRyYXcgaXMgY29tcGF0aWJsZSB3aXRoIHRoZSBjb250ZXh0CisgICAgfQorICAgIGlmIChyZWFkICYmIHJlYWQhPWRyYXcpIHsKKyAgICAgICAgZWdsX3N1cmZhY2VfdCogcyA9IChlZ2xfc3VyZmFjZV90KilyZWFkOworICAgICAgICBpZiAoIXMtPmlzVmFsaWQoKSkKKyAgICA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XNjb25uZWN0IG9uIHRoZSBzdXJmYWNlCi0KICAgICBvZ2xlc19jb250ZXh0X3QqIGdsID0gKG9nbGVzX2NvbnRleHRfdCopY3R4OwogICAgIGlmIChtYWtlQ3VycmVudChnbCkgPT0gMCkgewogICAgICAgICBpZiAoY3R4KSB7CiAgICAgICAgICAgICBlZ2xfY29udGV4dF90KiBjID0gZWdsX2NvbnRleHRfdDo6Y29udGV4dChjdHgpOwogICAgICAgICAgICAgZWdsX3N1cmZhY2VfdCogZCA9IChlZ2xfc3VyZmFjZV90KilkcmF3OwogICAgICAgICAgICAgZWdsX3N1cmZhY2VfdCogciA9IChlZ2xfc3VyZmFjZV90KilyZWFkOwotICAgICAgICAgICAgYy0+cmVhZCA9IHJlYWQ7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChjLT5kcmF3KSB7CisgICAgICAgICAgICAgICAgZWdsX3N1cmZhY2VfdCogcyA9IHJlaW50ZXJwcmV0X2Nhc3Q8ZWdsX3N1cmZhY2VfdCo+KGMtPmRyYXcpOworICAgICAgICAgICAgICAgIHMtPmRpc2Nvbm5lY3QoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChjLT5yZWFkKSB7CisgICAgICAgICAgICAgICAgLy8gRklYTUU6IHVubG9jay9kaXNjb25uZWN0IHRoZSByZWFkIHN1cmZhY2UgdG9vIAorICAgICAgICAgICAgfQorICAgICAgICAgICAgCiAgICAgICAgICAgICBjLT5kcmF3ID0gZHJhdzsKKyAgICAgICAgICAgIGMtPnJlYWQgPSByZWFkOworCiAgICAgICAgICAgICBpZiAoYy0+ZmxhZ3MgJiBlZ2xfY29udGV4dF90OjpORVZFUl9DVVJSRU5UKSB7CiAgICAgICAgICAgICAgICAgYy0+ZmxhZ3MgJj0gfmVnbF9jb250ZXh0X3Q6Ok5FVkVSX0NVUlJFTlQ7CiAgICAgICAgICAgICAgICAgR0xpbnQgdyA9IDA7CkBAIC0xMzM4LDEwICsxNzg3LDE0IEBACiAgICAgICAgICAgICAgICAgb2dsZXNfc2Npc3NvcihnbCwgMCwgMCwgdywgaCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoZCkgeworICAgICAgICAgICAgICAgIGlmIChkLT5jb25uZWN0KCkgPT0gRUdMX0ZBTFNFKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBFR0xfRkFMU0U7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGQtPmN0eCA9IGN0eDsKICAgICAgICAgICAgICAgICBkLT5iaW5kRHJhd1N1cmZhY2UoZ2wpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKHIpIHsKKyAgICAgICAgICAgICAgICAvLyBGSVhNRTogbG9jay9jb25uZWN0IHRoZSByZWFkIHN1cmZhY2UgdG9vIAogICAgICAgICAgICAgICAgIHItPmN0eCA9IGN0eDsKICAgICAgICAgICAgICAgICByLT5iaW5kUmVhZFN1cmZhY2UoZ2wpOwogICAgICAgICAgICAgfQpAQCAtMTM1Miw4ICsxODA1LDE2IEBACiAgICAgICAgICAgICAgICAgZWdsX2NvbnRleHRfdCogYyA9IGVnbF9jb250ZXh0X3Q6OmNvbnRleHQoY3VycmVudF9jdHgpOwogICAgICAgICAgICAgICAgIGVnbF9zdXJmYWNlX3QqIGQgPSAoZWdsX3N1cmZhY2VfdCopYy0+ZHJhdzsKICAgICAgICAgICAgICAgICBlZ2xfc3VyZmFjZV90KiByID0gKGVnbF9zdXJmYWNlX3QqKWMtPnJlYWQ7Ci0gICAgICAgICAgICAgICAgaWYgKGQpIGQtPmN0eCA9IEVHTF9OT19DT05URVhUOwotICAgICAgICAgICAgICAgIGlmIChyKSByLT5jdHggPSBFR0xfTk9fQ09OVEVYVDsKKyAgICAgICAgICAgICAgICBpZiAoZCkgeworICAgICAgICAgICAgICAgICAgICBjLT5kcmF3ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgZC0+Y3R4ID0gRUdMX05PX0NPTlRFWFQ7CisgICAgICAg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AgICAgICAgaWYgKGdnbF91bmxpa2VseShzICYmIGwuaW1wbGljaXRTcGVjdWxhci52WzNdKSkgewogICAgICAgICAgICAgICAgIHZlYzRfdCBoOwotICAgICAgICAgICAgICAgIGgueCA9IGQueDsKLSAgICAgICAgICAgICAgICBoLnkgPSBkLnk7Ci0gICAgICAgICAgICAgICAgaC56ID0gZC56ICsgMHgxMDAwMDsKKyAgICAgICAgICAgICAgICBoLnggPSBkLnggKyBsLm9ialZpZXdlci54OworICAgICAgICAgICAgICAgIGgueSA9IGQueSArIGwub2JqVmlld2VyLnk7CisgICAgICAgICAgICAgICAgaC56ID0gZC56ICsgbC5vYmpWaWV3ZXIuejsKICAgICAgICAgICAgICAgICB2bm9ybTMoaC52LCBoLnYpOwogICAgICAgICAgICAgICAgIHMgPSBkb3QzKG4udiwgaC52KTsKICAgICAgICAgICAgICAgICBzID0gKHM8MCkgPyAodHdvU2lkZT8oLXMpOjApIDogczsKZGlmZiAtLWdpdCBhL29wZW5nbC9saWJhZ2wvbWF0cml4LmNwcCBiL29wZW5nbC9saWJhZ2wvbWF0cml4LmNwcAppbmRleCAwYjY4ZGMwLi4yMWVmNTBlIDEwMDY0NAotLS0gYS9vcGVuZ2wvbGliYWdsL21hdHJpeC5jcHAKKysrIGIvb3BlbmdsL2xpYmFnbC9tYXRyaXguY3BwCkBAIC02OTYsNiArNjk2LDggQEAKICAgICBmWzJdID0gMDsgICBmWzZdID0gMDsgICBmWzEwXSA9IEE7ICBmWzE0XSA9IEI7CiAgICAgZlszXSA9IDA7ICAgZls3XSA9IDA7ICAgZlsxMV0gPSAwOyAgZlsxNV0gPSAxOwogICAgIGMtPnRyYW5zZm9ybXMuZGlydHkgfD0gdHJhbnNmb3JtX3N0YXRlX3Q6OlZJRVdQT1JUOworICAgIGlmIChjLT50cmFuc2Zvcm1zLm12cDQuZmxhZ3MgJiB0cmFuc2Zvcm1fdDo6RkxBR1NfMkRfUFJPSkVDVElPTikKKyAgICAgICAgYy0+dHJhbnN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bnN0IGdWZXJzaW9uU3RyaW5nICAgID0gIk9wZW5HTCBFUy1DTSAxLjAiOwogc3RhdGljIGNoYXIgY29uc3QgKiBjb25zdCBnRXh0ZW5zaW9uc1N0cmluZyA9CiAgICAgIkdMX09FU19ieXRlX2Nvb3JkaW5hdGVzICIgICAgICAgICAgICAgIC8vIE9LCkBAIC00Niw5ICs1MCw5IEBACiAgICAgIkdMX09FU19xdWVyeV9tYXRyaXggIiAgICAgICAgICAgICAgICAgIC8vIE9LCiAgICAgLy8gICAgICAgICJHTF9PRVNfcG9pbnRfc2l6ZV9hcnJheSAiICAgICAgICAgICAgICAvLyBUT0RPCiAgICAgLy8gICAgICAgICJHTF9PRVNfcG9pbnRfc3ByaXRlICIgICAgICAgICAgICAgICAgICAvLyBUT0RPCisgICAgIkdMX09FU19FR0xfaW1hZ2UgIiAgICAgICAgICAgICAgICAgICAgIC8vIE9LCiAgICAgIkdMX0FSQl90ZXh0dXJlX2NvbXByZXNzaW9uICIgICAgICAgICAgIC8vIE9LCiAgICAgIkdMX0FSQl90ZXh0dXJlX25vbl9wb3dlcl9vZl90d28gIiAgICAgIC8vIE9LCi0gICAgIkdMX0FORFJPSURfZGlyZWN0X3RleHR1cmUgIiAgICAgICAgICAgIC8vIE9LCiAgICAgIkdMX0FORFJPSURfdXNlcl9jbGlwX3BsYW5lICIgICAgICAgICAgIC8vIE9LCiAgICAgIkdMX0FORFJPSURfdmVydGV4X2J1ZmZlcl9vYmplY3QgIiAgICAgIC8vIE9LCiAgICAgIkdMX0FORFJPSURfZ2VuZXJhdGVfbWlwbWFwICIgICAgICAgICAgIC8vIE9LCkBAIC02MiwxMyArNjYsMTMgQEAKIG9nbGVzX2NvbnRleHRfdCAqb2dsZXNfaW5pdChzaXplX3QgZXh0cmEpCiB7CiAgICAgdm9pZCogY29uc3QgYmFzZSA9IG1hbGxvYyhleHRyYSArIHNpemVvZihvZ2xlc19jb250ZXh0X3QpICsgMzIpOwotCWlmICghYmFzZSkgcmV0dX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ZmFjZUJ1ZmZlciA9IDA7CisKKyNpZmRlZiBMSUJBR0xfVVNFX0dSQUxMT0NfQ09QWUJJVFMKKyAgICBod19tb2R1bGVfdCBjb25zdCogbW9kdWxlOworICAgIGlmIChod19nZXRfbW9kdWxlKENPUFlCSVRfSEFSRFdBUkVfTU9EVUxFX0lELCAmbW9kdWxlKSA9PSAwKSB7CisgICAgICAgIHN0cnVjdCBjb3B5Yml0X2RldmljZV90KiBjb3B5Qml0czsKKyAgICAgICAgaWYgKGNvcHliaXRfb3Blbihtb2R1bGUsICZjb3B5Qml0cykgPT0gMCkgeworICAgICAgICAgICAgYy0+Y29weWJpdHMuYmxpdEVuZ2luZSA9IGNvcHlCaXRzOworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBtaW5MaW0gPSBjb3B5Qml0cy0+Z2V0KGNvcHlCaXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgQ09QWUJJVF9NSU5JRklDQVRJT05fTElNSVQpOworICAgICAgICAgICAgICAgIGlmIChtaW5MaW0gIT0gLUVJTlZBTCAmJiBtaW5MaW0gPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGMtPmNvcHliaXRzLm1pblNjYWxlID0gKDEgPDwgMTYpIC8gbWluTGltOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgbWFnTGltID0gY29weUJpdHMtPmdldChjb3B5Qml0cywKKyAgICAgICAgICAgICAgICAgICAgICAgIENPUFlCSVRfTUFHTklGSUNBVElPTl9MSU1JVCk7CisgICAgICAgICAgICAgICAgaWYgKG1hZ0xpbSAhPSAtRUlOVkFMICYmIG1hZ0xpbSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgYy0+Y29weWJpdHMubWF4U2NhbGUgPSBtaW4oMzIqMTAyNC0xLCBtYWdMaW0pIDw8IDE2OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAg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pbWFsCisgKiAKKyAqLworCit2b2lkIG9nbGVzX2xvY2tfdGV4dHVyZXMob2dsZXNfY29udGV4dF90KiBjKQoreworICAgIGZvciAoaW50IGk9MCA7IGk8R0dMX1RFWFRVUkVfVU5JVF9DT1VOVCA7IGkrKykgeworICAgICAgICBpZiAoYy0+cmFzdGVyaXplci5zdGF0ZS50ZXh0dXJlW2ldLmVuYWJsZSkgeworICAgICAgICAgICAgdGV4dHVyZV91bml0X3QmIHUoYy0+dGV4dHVyZXMudG11W2ldKTsKKyAgICAgICAgICAgIGFuZHJvaWRfbmF0aXZlX2J1ZmZlcl90KiBuYXRpdmVfYnVmZmVyID0gdS50ZXh0dXJlLT5idWZmZXI7CisgICAgICAgICAgICBpZiAobmF0aXZlX2J1ZmZlcikgeworICAgICAgICAgICAgICAgIGMtPnJhc3Rlcml6ZXIucHJvY3MuYWN0aXZlVGV4dHVyZShjLCBpKTsKKyAgICAgICAgICAgICAgICBod19tb2R1bGVfdCBjb25zdCogcE1vZHVsZTsKKyAgICAgICAgICAgICAgICBpZiAoaHdfZ2V0X21vZHVsZShHUkFMTE9DX0hBUkRXQVJFX01PRFVMRV9JRCwgJnBNb2R1bGUpKQorICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKworICAgICAgICAgICAgICAgIGdyYWxsb2NfbW9kdWxlX3QgY29uc3QqIG1vZHVsZSA9CisgICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Z3JhbGxvY19tb2R1bGVfdCBjb25zdCo+KHBNb2R1bGUpOworCisgICAgICAgICAgICAgICAgdm9pZCogdmFkZHI7CisgICAgICAgICAgICAgICAgaW50IGVyciA9IG1vZHVsZS0+bG9jayhtb2R1bGUsIG5hdGl2ZV9idWZmZXItPmhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEdSQUxMT0NfVVNBR0VfU1dfUkVBRF9PRlRFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgIDAsIDAsIG5hdGl2ZV9idWZmZXItPndpZHRoLCBuYXRpdmVfYnVmZmVyLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAmdmFkZHIpOworCisgICAgICAgICAgICAgICAgdS50ZXh0dXJlLT5zZXRJbWFnZUJpdHModmFkZHIpOworICAgICAgICAgICAgICAgIGMtPnJhc3Rlcml6ZXIucHJvY3MuYmluZFRleHR1cmUoYywgJih1LnRleHR1cmUtPnN1cmZhY2UpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZCBvZ2xlc191bmxvY2tfdGV4dHVyZXMob2dsZXNfY29udGV4dF90KiBjKQoreworICAgIGZvciAoaW50IGk9MCA7IGk8R0dMX1RFWFRVUkVfVU5JVF9DT1VOVCA7IGkrKykgeworICAgICAgICBpZiAoYy0+cmFzdGVyaXplci5zdGF0ZS50ZXh0dXJlW2ldLmVuYWJsZSkgeworICAgICAgICAgICAgdGV4dHVyZV91bml0X3QmIHUoYy0+dGV4dHVyZXMudG11W2ldKTsKKyAgICAgICAgICAgIGFuZHJvaWRfbmF0aXZlX2J1ZmZlcl90KiBuYXRpdmVfYnVmZmVyID0gdS50ZXh0dXJlLT5idWZmZXI7CisgICAgICAgICAgICBpZiAobmF0aXZlX2J1ZmZlcikgeworICAgICAgICAgICAgICAgIGMtPnJhc3Rlcml6ZXIucHJvY3MuYWN0aXZlVGV4dHVyZShjLCBpKTsKKyAgICAgICAgICAgICAgICBod19tb2R1bGVfdCBjb25zdCogcE1vZHVsZTsKKyAgICAgICAgICAgICAgICBpZiAoaHdfZ2V0X21vZHVsZShHUkFMTE9DX0hBUkRXQVJFX01PRFVMRV9JRCwgJnBNb2R1bGUpKQorICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKworICAgICAgICAgICAgICAgIGdyYWxsb2NfbW9kdWxlX3QgY29uc3QqIG1vZHVsZSA9CisgICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Z3JhbGxvY19tb2R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gICAgIGNvbnN0IEdMaW50IFVjciA9IHRleHR1cmVPYmplY3QtPmNyb3BfcmVjdFswXTsKICAgICAgICAgICAgIGNvbnN0IEdMaW50IFZjciA9IHRleHR1cmVPYmplY3QtPmNyb3BfcmVjdFsxXTsKICAgICAgICAgICAgIGNvbnN0IEdMaW50IHMwICA9IFVjciAtIHg7CiAgICAgICAgICAgICBjb25zdCBHTGludCB0MCAgPSAoVmNyICsgSGNyKSAtIHk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgY29uc3QgR0x1aW50IHR3ID0gdGV4dHVyZU9iamVjdC0+c3VyZmFjZS53aWR0aDsKICAgICAgICAgICAgIGNvbnN0IEdMdWludCB0aCA9IHRleHR1cmVPYmplY3QtPnN1cmZhY2UuaGVpZ2h0OwogICAgICAgICAgICAgaWYgKCh1aW50MzJfdChzMCt4K3cpID4gdHcpIHx8ICh1aW50MzJfdCh0MCt5K2gpID4gdGgpKSB7CkBAIC02OTQsNyArNzg1LDkgQEAKICAgICAgICAgICAgICAgICAvLyBpbiB0aGlzIGNhc2UsIHNvIHdlIGp1c3QgdXNlIHRoZSBzbG93IGNhc2UsIHdoaWNoCiAgICAgICAgICAgICAgICAgLy8gYXQgbGVhc3Qgd29uJ3QgY3Jhc2gKICAgICAgICAgICAgICAgICBnb3RvIHNsb3dfY2FzZTsKLSAgICAgICAgICAgIH0gCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG9nbGVzX2xvY2tfdGV4dHVyZXMoYyk7CiAKICAgICAgICAgICAgIGMtPnJhc3Rlcml6ZXIucHJvY3MudGV4Q29vcmQyaShjLCBzMCwgdDApOwogICAgICAgICAgICAgY29uc3QgdWludDMyX3QgZW5hYmxlcyA9IGMtPnJhc3Rlcml6ZXIuc3RhdGUuZW5hYmxlczsKQEAgLTcwNiwxMiArNzk5LDE1IEBACiAgICAgICAgICAgICBjLT5yYXN0ZXJpemVyLnByb2NzLmRpc2FibGUoYywgR0dMX0FBKTsKICAgICAgICAgICAgIGMtPnJhc3Rlcml6ZXIucHJvY3Muc2hhZGVNb2RlbChjLCBHTF9GTEFUKTsKICAgICAgICAgICAgIGMtPnJhc3Rlcml6ZXIucHJvY3MucmVjdGkoYywgeCwgeSwgeCt3LCB5K2gpOworICAgICAgICAgICAgCisgICAgICAgICAgICBvZ2xlc191bmxvY2tfdGV4dHVyZXMoYyk7CisKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgIH0KIAogc2xvd19jYXNlOgotICAgIGRyYXdUZXh4T0VTKAorICAgIGRyYXdUZXh4T0VTSW1wKAogICAgICAgICAgICAgZ2dsSW50VG9GaXhlZCh4KSwgZ2dsSW50VG9GaXhlZCh5KSwgZ2dsSW50VG9GaXhlZCh6KSwKICAgICAgICAgICAgIGdnbEludFRvRml4ZWQodyksIGdnbEludFRvRml4ZWQoaCksCiAgICAgICAgICAgICBjKTsKQEAgLTc0OSw3ICs4NDUsNyBAQAogICAgIH0KIAogICAgIC8vIEJpbmQgb3IgY3JlYXRlIGEgdGV4dHVyZQotICAgIHNwPEVHTFRleHR1cmVPYmplY3Q+IHRleDsgICAgCisgICAgc3A8RUdMVGV4dHVyZU9iamVjdD4gdGV4OwogICAgIGlmICh0ZXh0dXJlID09IDApIHsKICAgICAgICAgLy8gMCBpcyBvdXIgbG9jYWwgdGV4dHVyZSBvYmplY3QKICAgICAgICAgdGV4ID0gYy0+dGV4dHVyZXMuZGVmYXVsdFRleHR1cmU7CkBAIC04MzcsNyArOTMzLDcgQEAKICAgICBpZiAoKHBuYW1lICE9IEdMX1BBQ0tfQUxJR05NRU5UKSAmJiAocG5hbWUgIT0gR0xfVU5QQUNLX0FMSUdOTUVOVCkpIHsKICAgICAgICAgb2dsZXNfZXJyb3IoYywgR0xfSU5WQUxJRF9FTlVNKTsKICAgICAgICAgcmV0dXJuOwotICAgIH0gICAgCisgICAgfQogICAgIGlmICgocGFyYW08PTAgfHwgcGFyYW0+OCkgfHwgKHBhcmFtICYgKHBhcmFtLTEpK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2xlc19lcnJvcihjLCBHTF9JTlZBTElEX09QRVJBVElPTik7CiAgICAgICAgIHJldHVybjsKICAgICB9CkBAIC0xMDM0LDE2ICsxMTMwLDEwIEBACiAKICAgICBpbnQzMl90IHNpemUgPSAwOwogICAgIEdHTFN1cmZhY2UqIHN1cmZhY2UgPSAwOwotICAgIGlmICh0YXJnZXQgIT0gR0xfRElSRUNUX1RFWFRVUkVfMkRfUVVBTENPTU0pIHsKLSAgICAgICAgaW50IGVycm9yID0gY3JlYXRlVGV4dHVyZVN1cmZhY2UoYywgJnN1cmZhY2UsICZzaXplLAotICAgICAgICAgICAgICAgIGxldmVsLCBmb3JtYXQsIHR5cGUsIHdpZHRoLCBoZWlnaHQpOwotICAgICAgICBpZiAoZXJyb3IpIHsKLSAgICAgICAgICAgIG9nbGVzX2Vycm9yKGMsIGVycm9yKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgIH0gZWxzZSBpZiAocGl4ZWxzID09IDAgfHwgbGV2ZWwgIT0gMCkgewotICAgICAgICAvLyBwaXhlbCBjYW4ndCBiZSBudWxsIGZvciBkaXJlY3QgdGV4dHVyZQotICAgICAgICBvZ2xlc19lcnJvcihjLCBHTF9JTlZBTElEX09QRVJBVElPTik7CisgICAgaW50IGVycm9yID0gY3JlYXRlVGV4dHVyZVN1cmZhY2UoYywgJnN1cmZhY2UsICZzaXplLAorICAgICAgICAgICAgbGV2ZWwsIGZvcm1hdCwgdHlwZSwgd2lkdGgsIGhlaWdodCk7CisgICAgaWYgKGVycm9yKSB7CisgICAgICAgIG9nbGVzX2Vycm9yKGMsIGVycm9yKTsKICAgICAgICAgcmV0dXJuOwogICAgIH0KIApAQCAtMTA2NCwxOCArMTE1NCwxMiBAQAogICAgICAgICB1c2VyU3VyZmFjZS5jb21wcmVzc2VkRm9ybWF0ID0gMDsKICAgICAgICAgdXNlclN1cmZhY2UuZGF0YSA9IChHTHVieXRlKilwaXhlbHM7CiAKLSAgICAgICAgaWYgKH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CwgdXNpbmcgZGVmYXVsdCBjb25maWciKTsKKyAgICAgICAgZ0NvbmZpZy5hZGQoIGVudHJ5X3QoMCwgMCwgImFuZHJvaWQiKSApOworICAgIH0gZWxzZSB7CisgICAgICAgIHdoaWxlIChmZ2V0cyhsaW5lLCAyNTYsIGNmZykpIHsKKyAgICAgICAgICAgIGludCBkcHk7CisgICAgICAgICAgICBpbnQgaW1wbDsKKyAgICAgICAgICAgIGlmIChzc2NhbmYobGluZSwgIiV1ICV1ICVzIiwgJmRweSwgJmltcGwsIHRhZykgPT0gMykgeworICAgICAgICAgICAgICAgIC8vTE9HRCgiPj4+ICV1ICV1ICVzIiwgZHB5LCBpbXBsLCB0YWcpOworICAgICAgICAgICAgICAgIGdDb25maWcuYWRkKCBlbnRyeV90KGRweSwgaW1wbCwgdGFnKSApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGZjbG9zZShjZmcpOworICAgIH0KK30KKworTG9hZGVyOjp+TG9hZGVyKCkKK3sKK30KKworY29uc3QgY2hhciogTG9hZGVyOjpnZXRUYWcoaW50IGRweSwgaW50IGltcGwpCit7CisgICAgY29uc3QgVmVjdG9yPGVudHJ5X3Q+JiBjZmdzKGdDb25maWcpOyAgICAKKyAgICBjb25zdCBzaXplX3QgYyA9IGNmZ3Muc2l6ZSgpOworICAgIGZvciAoc2l6ZV90IGk9MCA7IGk8YyA7IGkrKykgeworICAgICAgICBpZiAoZHB5ID09IGNmZ3NbaV0uZHB5KQorICAgICAgICAgICAgaWYgKGltcGwgPT0gY2Znc1tpXS5pbXBsKQorICAgICAgICAgICAgICAgIHJldHVybiBjZmdzW2ldLnRhZy5zdHJpbmcoKTsKKyAgICB9CisgICAgcmV0dXJuIDA7Cit9CisKK3ZvaWQqIExvYWRlcjo6b3BlbihFR0xOYXRpdmVEaXNwbGF5VHlwZSBkaXNwbGF5LCBpbnQgaW1wbCwgZ2xfaG9va3NfdCogaG9va3MpCit7CisgICAgLyoKKyAgICAgKiBUT0RPOiBpZiB3ZSBkb24ndCBmaW5kIGRpc3BsYXkvMCwgdGhlbiB1c2UgMC8wCisgICAgICogKDAvMCBzaG91bGQgYWx3YXlzIHdvcmspCisgICAgICovCisgICAgCisgICAgdm9pZCogZHNvOworICAgIGNoYXIgcGF0aFtQQVRIX01BWF07CisgICAgaW50IGluZGV4ID0gaW50KGRpc3BsYXkpOworICAgIGRyaXZlcl90KiBobmQgPSAwOworICAgIGNvbnN0IGNoYXIqIGNvbnN0IGZvcm1hdCA9ICIvc3lzdGVtL2xpYi9lZ2wvbGliJXNfJXMuc28iOworICAgIAorICAgIGNoYXIgY29uc3QqIHRhZyA9IGdldFRhZyhpbmRleCwgaW1wbCk7CisgICAgaWYgKHRhZykgeworICAgICAgICBzbnByaW50ZihwYXRoLCBQQVRIX01BWCwgZm9ybWF0LCAiR0xFUyIsIHRhZyk7CisgICAgICAgIGRzbyA9IGxvYWRfZHJpdmVyKHBhdGgsIGhvb2tzLCBFR0wgfCBHTEVTdjFfQ00gfCBHTEVTdjIpOworICAgICAgICBpZiAoZHNvKSB7CisgICAgICAgICAgICBobmQgPSBuZXcgZHJpdmVyX3QoZHNvKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIEFsd2F5cyBsb2FkIEVHTCBmaXJzdAorICAgICAgICAgICAgc25wcmludGYocGF0aCwgUEFUSF9NQVgsIGZvcm1hdCwgIkVHTCIsIHRhZyk7CisgICAgICAgICAgICBkc28gPSBsb2FkX2RyaXZlcihwYXRoLCBob29rcywgRUdMKTsKKyAgICAgICAgICAgIGlmIChkc28pIHsKKyAgICAgICAgICAgICAgICBobmQgPSBuZXcgZHJpdmVyX3QoZHNvKTsKKworICAgICAgICAgICAgICAgIC8vIFRPRE86IG1ha2UgdGhpcyBtb3JlIGF1dG9tYXRlZAorICAgICAgICAgICAgICAgIHNucHJpbnRmKHBhdGgsIFBBVEhfTUFYLCBmb3JtYXQsICJHTEVTdjFfQ00iLCB0YWcpOworICAgICAgICAgICAgICAgIGhuZC0+c2V0KCBsb2FkX2RyaXZlcihwYXRoLCBob29rcywgR0xFU3YxX0NNKSwgR0xFU3YxX0NNICk7CisKKyAgICAgICAgICAgICAgICBzbnByaW50ZihwYXRoLCBQQVRIX01BWCwgZm9ybWF0LCAiR0xFU3YyIiwgdGFnKTsKKyAgICAgICAgICAgICAgICBobmQtPnNldCggbG9hZF9kcml2ZXIocGF0aCwgaG9va3MsIEdMRVN2MiksIEdMRVN2MiApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgTE9HX0ZBVEFMX0lGKCFpbmRleCAmJiAhaW1wbCAmJiAhaG5kLCAKKyAgICAgICAgICAgICJjb3VsZG4ndCBmaW5kIHRoZSBkZWZhdWx0IE9wZW5HTCBFUyBpbXBsZW1lbnRhdGlvbiAiCisgICAgICAgICAgICAiZm9yIGRlZmF1bHQgZGlzcGxheSIpOworICAgIAorICAgIHJldHVybiAodm9pZCopaG5kOworfQorCitzdGF0dXNfdCBMb2FkZXI6OmNsb3NlKHZvaWQqIGRyaXZlcikKK3sKKyAgICBkcml2ZXJfdCogaG5kID0gKGRyaXZlcl90Kilkcml2ZXI7CisgICAgZGVsZXRlIGhuZDsKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKK3ZvaWQgTG9hZGVyOjppbml0X2FwaSh2b2lkKiBkc28sIAorICAgICAgICBjaGFyIGNvbnN0ICogY29uc3QgKiBhcGksIAorICAgICAgICBfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlKiBjdXJyLCAKKyAgICAgICAgZ2V0UHJvY0FkZHJlc3NUeXBlIGdldFByb2NBZGRyZXNzKSAKK3sKKyAgICBjaGFyIHNjcmFwWzI1Nl07CisgICAgd2hpbGUgKCphcGkpIHsKKyAgICAgICAgY2hhciBjb25zdCAqIG5hbWUgPSAqYXBpOworICAgICAgICBfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlIGYgPSAKKyAgICAgICAgICAgIChfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlKWRsc3ltKGRzbywgbmFtZSk7CisgICAgICAgIGlmIChmID09IE5VTEwpIHsKKyAgICAgICAgICAgIC8vIGNvdWxkbid0IGZpbmQgdGhlIGVudHJ5LXBvaW50LCB1c2UgZWdsR2V0UHJvY0FkZHJlc3MoKQorICAgICAgICAgICAgZiA9IGdldFByb2NBZGRyZXNzKG5hbWUpOworICAgICAgICB9CisgICAgICAgIGlmIChmID09IE5VTEwpIHsKKyAgICAgICAgICAgIC8vIFRyeSB3aXRob3V0IHRoZSBPRVMgcG9zdGZpeAorICAgICAgICAgICAgc3NpemVfdCBpbmRleCA9IHNzaXplX3Qoc3RybGVuKG5hbWUpKSAtIDM7CisgICAgICAgICAgICBpZiAoKGluZGV4PjAgJiYgKGluZGV4PDI1NSkpICYmICghc3RyY21wKG5hbWUraW5kZXgsICJPRVMiKSkpIHsKKyAgICAgICAgICAgICAgICBzdHJuY3B5KHNjcmFwLCBuYW1lLCBpbmRleCk7CisgICAgICAgICAgICAgICAgc2NyYXBbaW5kZXhdID0gMDsKKyAgICAgICAgICAgICAgICBmID0gKF9fZWdsTXVzdENhc3RUb1Byb3BlckZ1bmN0aW9uUG9pbnRlclR5cGUpZGxzeW0oZHNvLCBzY3JhcCk7CisgICAgICAgICAgICAgICAgLy9MT0dEX0lGKGYsICJmb3VuZCA8JXM+IGluc3RlYWQiLCBzY3JhcCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKGYgPT0gTlVMTCkgeworICAgICAgICAgICAgLy8gVHJ5IHdpdGggdGhlIE9FUyBwb3N0Zml4CisgICAgICAgICAgICBzc2l6ZV90IGluZGV4ID0gc3NpemVfdChzdHJsZW4obmFtZSkpIC0gMzsKKyAgICAgICAgICAgIGlmICgoaW5kZXg+MCAmJiAoaW5kZXg8MjUyKSkgJiYgKHN0cmNtcChuYW1lK2luZGV4LCAiT0VTIikpKSB7CisgICAgICAgICAgICAgICAgc3RybmNweShzY3JhcCwgbmFtZSwgaW5kZXgpOworICAgICAgICAgICAgICAgIHNjcmFwW2luZGV4XSA9IDA7CisgICAgICAgICAgICAgICAgc3RyY2F0KHNjcmFwLCAiT0VTIik7CisgICAgICAgICAgICAgICAgZiA9IChfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlKWRsc3ltKGRzbywgc2NyYXApOworICAgICAgICAgICAgICAgIC8vTE9HRF9JRihmLCAiZm91bmQgPCVzPiBpbnN0ZWFkIiwgc2NyYXApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChmID09IE5VTEwpIHsKKyAgICAgICAgICAgIC8vTE9HRCgiJXMiLCBuYW1lKTsKKyAgICAgICAgICAgIGYgPSAoX19lZ2xNdXN0Q2FzdFRvUHJvcGVyRnVuY3Rpb25Qb2ludGVyVHlwZSlnbF91bmltcGxlbWVudGVkOworICAgICAgICB9CisgICAgICAgICpjdXJyKysgPSBmOworICAgICAgICBhcGkrKzsKKyAgICB9Cit9CisKK3ZvaWQgKkxvYWRlcjo6bG9hZF9kcml2ZXIoY29uc3QgY2hhciogZHJpdmVyLCBnbF9ob29rc190KiBob29rcywgdWludDMyX3QgbWFzaykKK3sKKyAgICB2b2lkKiBkc28gPSBkbG9wZW4oZHJpdmVyLCBSVExEX05PVyB8IFJUTERfTE9DQUwpOworICAgIGlmIChkc28gPT0gMCkKKyAgICAgICAgcmV0dXJuIDA7CisKKyAgICBMT0dEKCJsb2FkZWQgJXMiLCBkcml2ZXIpOworCisgICAgaWYgKG1hc2sgJiBFR0wpIHsKKyAgICAgICAgZ2V0UHJvY0FkZHJlc3MgPSAoZ2V0UHJvY0FkZHJlc3NUeXBlKWRsc3ltKGRzbywgImVnbEdldFByb2NBZGRyZXNzIik7CisKKyAgICAgICAgTE9HRV9JRighZ2V0UHJvY0FkZHJlc3MsIAorICAgICAgICAgICAgICAgICJjYW4ndCBmaW5kIGVnbEdldFByb2NBZGRyZXNzKCkgaW4gJXMiLCBkcml2ZXIpOyAgICAgICAgCisKKyAgICAgICAgZ2xfaG9va3NfdDo6ZWdsX3QqIGVnbCA9ICZob29rcy0+ZWdsOworICAgICAgICBfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlKiBjdXJyID0KKyAgICAgICAgICAgIChfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlKillZ2w7CisgICAgICAgIGNoYXIgY29uc3QgKiBjb25zdCAqIGFwaSA9IGVnbF9uYW1lczsKKyAgICAgICAgd2hpbGUgKCphcGkpIHsKKyAgICAgICAgICAgIGNoYXIgY29uc3QgKiBuYW1lID0gKmFwaTsKKyAgICAgICAgICAgIF9fZWdsTXVzdENhc3RUb1Byb3BlckZ1bmN0aW9uUG9pbnRlclR5cGUgZiA9IAorICAgICAgICAgICAgICAgIChfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlKWRsc3ltKGRzbywgbmFtZSk7CisgICAgICAgICAgICBpZiAoZiA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgLy8gY291bGRuJ3QgZmluZCB0aGUgZW50cnktcG9pbnQsIHVzZSBlZ2xHZXRQcm9jQWRkcmVzcygpCisgICAgICAgICAgICAgICAgZiA9IGdldFByb2NBZGRyZXNzKG5hbWUpOworICAgICAgICAgICAgICAgIGlmIChmID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgZiA9IChfX2VnbE11c3RDYXN0VG9Qcm9wZXJGdW5jdGlvblBvaW50ZXJUeXBlKTA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgKmN1cnIrKyA9IGY7CisgICAgICAgICAgICBhcGkrKzsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBpZiAobWFzayAmIEdM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g+CisKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KK25hbWVzcGFjZSBhbmRyb2lkIHsKKy8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworc3RydWN0IGdsX2hvb2tzX3Q7CisKK2NsYXNzIExvYWRlciA6IHB1YmxpYyBTaW5nbGV0b248TG9hZGVyPgoreworICAgIGZyaWVuZCBjbGFzcyBTaW5nbGV0b248TG9hZGVyPjsKKworICAgIHR5cGVkZWYgX19lZ2xNdXN0Q2FzdFRvUHJvcGVyRnVuY3Rpb25Qb2ludGVyVHlwZSAoKmdldFByb2NBZGRyZXNzVHlwZSkoCisgICAgICAgICAgICBjb25zdCBjaGFyKik7CisgICAKKyAgICBlbnVtIHsKKyAgICAgICAgRUdMICAgICAgICAgPSAweDAxLAorICAgICAgICBHTEVTdjFfQ00gICA9IDB4MDIsCisgICAgICAgIEdMRVN2MiAgICAgID0gMHgwNAorICAgIH07CisgICAgc3RydWN0IGRyaXZlcl90IHsKKyAgICAgICAgZHJpdmVyX3Qodm9pZCogZ2xlcyk7CisgICAgICAgIH5kcml2ZXJfdCgpOworICAgICAgICBzdGF0dXNfdCBzZXQodm9pZCogaG5kLCBpbnQzMl90IGFwaSk7CisgICAgICAgIHZvaWQqIGRzb1szXTsKKyAgICB9OworICAgIAorICAgIHN0cnVjdCBlbnRyeV90IHsKKyAgICAgICAgZW50cnlfdCgpIHsgfQorICAgICAgICBlbnRyeV90KGludCBkcHksIGludCBpbXBsLCBjb25zdCBjaGFyKiB0YWcpOworICAgICAgICBpbnQgZHB5OworICAgICAgICBpbnQgaW1wbDsKKyAgICAgICAgU3RyaW5nOCB0YWc7CisgICAgfTsKKworICAgIFZlY3Rvc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2xfb2JqZWN0X3QgeworICAgIHN0YXRpYyBTb3J0ZWRWZWN0b3I8ZWdsX29iamVjdF90Kj4gc09iamVjdHM7CisgICAgc3RhdGljIE11dGV4IHNMb2NrOworCisgICAgICAgICAgICB2b2xhdGlsZSBpbnQzMl90ICB0ZXJtaW5hdGVkOworICAgIG11dGFibGUgdm9sYXRpbGUgaW50MzJfdCAgY291bnQ7CisKK3B1YmxpYzoKKyAgICBlZ2xfb2JqZWN0X3QoKSA6IHRlcm1pbmF0ZWQoMCksIGNvdW50KDEpIHsgCisgICAgICAgIE11dGV4OjpBdXRvbG9jayBfbChzTG9jayk7CisgICAgICAgIHNPYmplY3RzLmFkZCh0aGlzKTsKKyAgICB9CisKKyAgICBpbmxpbmUgYm9vbCBpc0FsaXZlKCkgY29uc3QgeyByZXR1cm4gIXRlcm1pbmF0ZWQ7IH0KKwogcHJpdmF0ZToKLSAgICB1aW50MzJfdCAgICBtYWdpYzsKKyAgICBib29sIGdldCgpIHsKKyAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKHNMb2NrKTsKKyAgICAgICAgaWYgKGVnbF9vYmplY3RfdDo6c09iamVjdHMuaW5kZXhPZih0aGlzKSA+PSAwKSB7CisgICAgICAgICAgICBhbmRyb2lkX2F0b21pY19pbmMoJmNvdW50KTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBib29sIHB1dCgpIHsKKyAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKHNMb2NrKTsKKyAgICAgICAgaWYgKGFuZHJvaWRfYXRvbWljX2RlYygmY291bnQpID09IDEpIHsKKyAgICAgICAgICAgIHNPYmplY3RzLnJlbW92ZSh0aGlzKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9ICAgIAorCitwdWJsaWM6CisgICAgdGVtcGxhdGUgPHR5cGVuYW1lIE4sIHR5cGVuYW1lIFQ+CisgICAgc3RydWN0IExvY2FsUmVmIHsKKyAgICAgICAgTiogcmVmOworICAgICAgICBMb2NhbFJlZihUIG8pIDogcmVmKDApIHsKKyAgICAgICAgICAgIE4qIG5hdGl2ZSA9IHJlaW50ZXJwcmV0X2Nhc3Q8Tio+KG8pOworICAgICAgICAgICAgaWYgKG8gJiYgbmF0aXZlLT5nZXQoKSkgeworICAgICAgICAgICAgICAgIHJlZiA9IG5hdGl2ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB+TG9jYWxSZWYoKSB7IAorICAgICAgICAgICAgaWYgKHJlZiAmJiByZWYtPnB1dCgpKSB7CisgICAgICAgICAgICAgICAgZGVsZXRlIHJlZjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpbmxpbmUgTiogZ2V0KCkgeworICAgICAgICAgICAgcmV0dXJuIHJlZjsKKyAgICAgICAgfQorICAgICAgICB2b2lkIGFjcXVpcmUoKSBjb25zdCB7CisgICAgICAgICAgICBpZiAocmVmKSB7CisgICAgICAgICAgICAgICAgYW5kcm9pZF9hdG9taWNfaW5jKCZyZWYtPmNvdW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB2b2lkIHJlbGVhc2UoKSBjb25zdCB7CisgICAgICAgICAgICBpZiAocmVmKSB7CisgICAgICAgICAgICAgICAgaW50MzJfdCBjID0gYW5kcm9pZF9hdG9taWNfZGVjKCZyZWYtPmNvdW50KTsKKyAgICAgICAgICAgICAgICAvLyByZWYtPmNvdW50IGNhbm5vdCBiZSAxIHByaW9yIGF0b21pY19kZWMgYmVjYXVzZSB3ZSBoYXZlCisgICAgICAgICAgICAgICAgLy8gYSByZWZlcmVuY2UsIGFuZCBpZiB3ZSBoYXZlIG9uZSwgaXQgbWVhbnMgdGhlcmUgd2FzCisgICAgICAgICAgICAgICAgLy8gYWxyZWFkeSBvbmUgYmVmb3JlIHVzLgorICAgICAgICAgICAgICAgIExPR0VfSUYoYz09MSwgInJlZmNvdW50IGlzIG5vdyAwIGluIHJlbGVhc2UoKSIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHZvaWQgdGVybWluYXRlKCkgeworICAgICAgICAgICAgaWYgKHJlZikgeworICAgICAgICAgICAgICAgIHJlZi0+dGVybWluYXRlZCA9IDE7CisgICAgICAgICAgICAgICAgcmVsZWFzZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKIH07CiAKLXN0cnVjdCBlZ2xfZGlzcGxheV90IDogcHVibGljIGVnbF9vYmplY3RfdDwnX2RweSc+Ci17Ci0gICAgRUdMRGlzcGxheSAgZHB5c1tJTVBMX05VTV9EUklWRVJTX0lNUExFTUVOVEFUSU9OU107Ci0gICAgRUdMQ29uZmlnKiAgY29uZmlnc1tJTVBMX05VTV9EUklWRVJTX0lNUExFTUVOVEFUSU9OU107Ci0gICAgRUdMaW50ICAgICAgbnVtQ29uZmlnc1tJTVBMX05VTV9EUklWRVJTX0lNUExFTUVOVEFUSU9OU107Ci0gICAgRUdMaW50ICAgICAgbnVtVG90YWxDb25maWdzOwotICAgIGNoYXIgY29uc3QqIGV4dGVuc2lvbnNTdHJpbmc7Ci0gICAgdm9sYXRpbGUgaW50MzJfdCByZWZzOworU29ydGVkVmVjdG9yPGVnbF9vYmplY3RfdCo+IGVnbF9vYmplY3RfdDo6c09iamVjdHM7CitNdXRleCBlZ2xfb2JqZWN0X3Q6OnNMb2NrOworCitzdHJ1Y3QgZWdsX2Rpc3BsYXlfdCB7CisgICAgZW51bSB7IE5PVF9JTklUSUFMSVpFRCwgSU5JVElBTElaRUQsIFRFUk1JTkFURUQgfTsKKyAgICAKICAgICBzdHJ1Y3Qgc3RyaW5nc190IHsKICAgICAgICAgY2hhciBjb25zdCAqIHZlbmRvcjsKICAgICAgICAgY2hhciBjb25zdCAqIHZlcnNpb247CiAgICAgICAgIGNoYXIgY29uc3QgKiBjbGllbnRBcGk7CiAgICAgICAgIGNoYXIgY29uc3QgKiBleHRlbnNpb25zOwogICAgIH07Ci0gICAgc3RyaW5nc190ICAgcXVlcnlTdHJpbmdbSU1QTF9OVU1fRFJJVkVSU19JTVBMRU1FTlRBVElPTlNdOworCisgICAgc3RydWN0IERpc3BsYXlJbXBsIHsKKyAgICAgICAgRGlzcGxheUltcGwoKSA6IGRweShFR0xfTk9fRElTUExBWSksIGNvbmZpZygwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlKE5PVF9JTklUSUFMSVpFRCksIG51bUNvbmZpZ3MoMCkgeyB9CisgICAgICAgIEVHTERpc3BsYXkgIGRweTsKKyAgICAgICAgRUdMQ29uZmlnKiAgY29uZmlnOworICAgICAgICBFR0xpbnQgICAgICBzdGF0ZTsKKyAgICAgICAgRUdMaW50ICAgICAgbnVtQ29uZmlnczsKKyAgICAgICAgc3RyaW5nc190ICAgcXVlcnlTdHJpbmc7CisgICAgfTsKKworICAgIHVpbnQzMl90ICAgIG1hZ2ljOworICAgIERpc3BsYXlJbXBsIGRpc3BbSU1QTF9OVU1fRFJJVkVSU19JTVBMRU1FTlRBVElPTlNdOworICAgIEVHTGludCAgICAgIG51bVRvdGFsQ29uZmlnczsKKyAgICB2b2xhdGlsZSBpbnQzMl90IHJlZnM7CisgICAgCisgICAgZWdsX2Rpc3BsYXlfdCgpIDogbWFnaWMoJ19kcHknKSwgbnVtVG90YWxDb25maWdzKDApIHsgfQorICAgIH5lZ2xfZGlzcGxheV90KCkgeyBtYWdpYyA9IDA7IH0KKyAgICBpbmxpbmUgYm9vbCBpc1ZhbGlkKCkgY29uc3QgeyByZXR1cm4gbWFnaWMgPT0gJ19kcHknOyB9CisgICAgaW5saW5lIGJvb2wgaXNBbGl2ZSgpIGNvbnN0IHsgcmV0dXJuIGlzVmFsaWQoKTsgfQogfTsKIAotc3RydWN0IGVnbF9zdXJmYWNlX3QgOiBwdWJsaWMgZWdsX29iamVjdF90PCdfc3JmJz4KK3N0cnVjdCBlZ2xfc3VyZmFjZV90IDogcHVibGljIGVnbF9vYmplY3RfdAogeworICAgIHR5cGVkZWYgZWdsX29iamVjdF90OjpMb2NhbFJlZjxlZ2xfc3VyZmFjZV90LCBFR0xTdXJmYWNlPiBSZWY7CisKICAgICBlZ2xfc3VyZmFjZV90KEVHTERpc3BsYXkgZHB5LCBFR0xTdXJmYWNlIHN1cmZhY2UsCi0gICAgICAgICAgICBOYXRpdmVXaW5kb3dUeXBlIHdpbmRvdywgaW50IGltcGwsIGVnbF9jb25uZWN0aW9uX3QgY29uc3QqIGNueCkgCi0gICAgOiBkcHkoZHB5KSwgc3VyZmFjZShzdXJmYWNlKSwgd2luZG93KHdpbmRvdyksIGltcGwoaW1wbCksIGNueChjbngpCi0gICAgewotICAgICAgICAvLyBOT1RFOiB3aW5kb3cgbXVzdCBiZSBpbmNSZWYnZWQgYW5kIGNvbm5lY3RlZCBhbHJlYWR5CisgICAgICAgICAgICBpbnQgaW1wbCwgZWdsX2Nvbm5lY3Rpb25fdCBjb25zdCogY254KSAKKyAgICA6IGRweShkcHkpLCBzdXJmYWNlKHN1cmZhY2UpLCBpbXBsKGltcGwpLCBjbngoY254KSB7CiAgICAgfQogICAgIH5lZ2xfc3VyZmFjZV90KCkgewotICAgICAgICBpZiAod2luZG93KSB7Ci0gICAgICAgICAgICBpZiAod2luZG93LT5kaXNjb25uZWN0KQotICAgICAgICAgICAgICAgIHdpbmRvdy0+ZGlzY29ubmVjdCh3aW5kb3cpOwotICAgICAgICAgICAgd2luZG93LT5kZWNSZWYod2luZG93KTsKLSAgICAgICAgfQogICAgIH0KICAgICBFR0xEaXNwbGF5ICAgICAgICAgICAgICAgICAgZHB5OwogICAgIEVHTFN1cmZhY2UgICAgICAgICAgICAgICAgICBzdXJmYWNlOwotICAgIE5hdGl2ZVdpbmRvd1R5cGUgICAgICAgICAgICB3aW5kb3c7CiAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIGltcGw7CiAgICAgZW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HJlc3MoKQotICAgICAgICAgICAgICAgIGYgPSBnZXRQcm9jQWRkcmVzcyhuYW1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChmID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAvLyBUcnkgd2l0aG91dCB0aGUgT0VTIHBvc3RmaXgKLSAgICAgICAgICAgICAgICBzc2l6ZV90IGluZGV4ID0gc3NpemVfdChzdHJsZW4obmFtZSkpIC0gMzsKLSAgICAgICAgICAgICAgICBpZiAoKGluZGV4PjAgJiYgKGluZGV4PDI1NSkpICYmICghc3RyY21wKG5hbWUraW5kZXgsICJPRVMiKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgc3RybmNweShzY3JhcCwgbmFtZSwgaW5kZXgpOwotICAgICAgICAgICAgICAgICAgICBzY3JhcFtpbmRleF0gPSAwOwotICAgICAgICAgICAgICAgICAgICBmID0gKF9fZWdsTXVzdENhc3RUb1Byb3BlckZ1bmN0aW9uUG9pbnRlclR5cGUpZGxzeW0oZHNvLCBzY3JhcCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vTE9HRF9JRihmLCAiZm91bmQgPCVzPiBpbnN0ZWFkIiwgc2NyYXApOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChmID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAvLyBUcnkgd2l0aCB0aGUgT0VTIHBvc3RmaXgKLSAgICAgICAgICAgICAgICBzc2l6ZV90IGluZGV4ID0gc3NpemVfdChzdHJsZW4obmFtZSkpIC0gMzsKLSAgICAgICAgICAgICAgICBpZiAoKGluZGV4PjAgJiYgKGluZGV4PDI1MikpICYmIChzdHJjbXAobmFtZStpbmRleCwgIk9FUyIpKSkgewotICAgICAgICAgICAgICAgICAgICBzdHJuY3B5KHNjcmFwLCBuYW1lLCBpbmRleCk7Ci0gICAgICAgICAgICAgICAgICAgIHNjcmFwW2luZGV4XSA9IDA7Ci0gICAgICAgICAg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X0RJU1BMQVksIDAsIGNueC0+aG9va3MpOworICAgICAgICBpZiAoY254LT5kc28pIHsKKyAgICAgICAgICAgIEVHTERpc3BsYXkgZHB5ID0gY254LT5ob29rcy0+ZWdsLmVnbEdldERpc3BsYXkoRUdMX0RFRkFVTFRfRElTUExBWSk7CisgICAgICAgICAgICBMT0dFX0lGKGRweT09RUdMX05PX0RJU1BMQVksICJObyBFR0xEaXNwbGF5IGZvciBzb2Z0d2FyZSBFR0whIik7CisgICAgICAgICAgICBkLT5kaXNwW0lNUExfU09GVFdBUkVdLmRweSA9IGRweTsgCisgICAgICAgICAgICBpZiAoZHB5ID09IEVHTF9OT19ESVNQTEFZKSB7CisgICAgICAgICAgICAgICAgbG9hZGVyLmNsb3NlKGNueC0+ZHNvKTsKKyAgICAgICAgICAgICAgICBjbngtPmRzbyA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KICAgICB9CiAKICAgICBjbnggPSAmZ0VHTEltcGxbSU1QTF9IQVJEV0FSRV07Ci0gICAgaWYgKGNueC0+ZHNvID09IDAgJiYgY254LT51bmF2YWlsYWJsZSA9PSAwKSB7CisgICAgaWYgKGNueC0+ZHNvID09IDApIHsKICAgICAgICAgY2hhciB2YWx1ZVtQUk9QRVJUWV9WQUxVRV9NQVhdOwogICAgICAgICBwcm9wZXJ0eV9nZXQoImRlYnVnLmVnbC5odyIsIHZhbHVlLCAiMSIpOwogICAgICAgICBpZiAoYXRvaSh2YWx1ZSkgIT0gMCkgewogICAgICAgICAgICAgY254LT5ob29rcyA9ICZnSG9va3NbSU1QTF9IQVJEV0FSRV07Ci0gICAgICAgICAgICBjbngtPmRzbyA9IGxvYWRfZHJpdmVyKCJsaWJoZ2wuc28iLCBjbngtPmhvb2tzKTsKKyAgICAgICAgICAgIGNueC0+ZHNvID0gbG9hZGVyLm9wZW4oRUdMX0RFRkFVTFRfRElTUExBWSwgMSwgY254LT5ob29rcyk7CisgICAgICAgICAgICBpZiAoY254LT5kc28pIHsKKyAgICAgICAgICAgICAgICBFR0xEaXNwbGF5IGRweSA9IGNueC0+aG9va3MtPmVnbC5lZ2xHZXREaXNwbGF5KEVHTF9ERUZBVUxUX0RJU1BMQVkpOworICAgICAgICAgICAgICAgIExPR0VfSUYoZHB5PT1FR0xfTk9fRElTUExBWSwgIk5vIEVHTERpc3BsYXkgZm9yIGhhcmR3YXJlIEVHTCEiKTsKKyAgICAgICAgICAgICAgICBkLT5kaXNwW0lNUExfSEFSRFdBUkVdLmRweSA9IGRweTsgCisgICAgICAgICAgICAgICAgaWYgKGRweSA9PSBFR0xfTk9fRElTUExBWSkgeworICAgICAgICAgICAgICAgICAgICBsb2FkZXIuY2xvc2UoY254LT5kc28pOworICAgICAgICAgICAgICAgICAgICBjbngtPmRzbyA9IE5VTEw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgTE9HRCgiM0QgaGFyZHdhcmUgYWNjZWxlcmF0aW9uIGlzIGRpc2FibGVkIik7CiAgICAgICAgIH0KICAgICB9Ci0gICAgaWYgKGNueC0+ZHNvICYmIGQtPmRweXNbSU1QTF9IQVJEV0FSRV09PUVHTF9OT19ESVNQTEFZKSB7Ci0gICAgICAgIGFuZHJvaWRfbWVtc2V0MzIoCi0gICAgICAgICAgICAgICAgKHVpbnQzMl90Kikodm9pZCopJmdIb29rc1tJTVBMX0NPTlRFWFRfTE9TVF0uZ2wsCi0gICAgICAgICAgICAgICAgKHVpbnQzMl90KSgodm9pZCopZ2xfY29udGV4dF9sb3N0KSwKLSAgICAgICAgICAgICAgICBzaXplb2YoZ0hvb2tzW0lNUExfQ09OVEVYVF9MT1NUXS5nbCkpOwotICAgICAgICBhbmRyb2lkX21lbXNldDMyKAotICAgICAgICAgICAgICAgICh1aW50MzJfdCopKHZvaWQqKSZnSG9va3NbSU1QTF9DT05URVhUX0xPU1RdLmVnbCwKLSAgICAgICAgICAgICAgICAodWludDMyX3QpKCh2b2lkKillZ2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mhvb2tzLT5lZ2wuZWdsR2V0RXJyb3IoKSkpOwogICAgICAgICB9CiAgICAgfQogCkBAIC02ODMsMTUgKzcwMiwxNiBAQAogICAgICAgICBlZ2xfY29ubmVjdGlvbl90KiBjb25zdCBjbnggPSAmZ0VHTEltcGxbaV07CiAgICAgICAgIGlmIChjbngtPmRzbyAmJiBjbngtPm1ham9yPj0wICYmIGNueC0+bWlub3I+PTApIHsKICAgICAgICAgICAgIEVHTGludCBuOwotICAgICAgICAgICAgaWYgKGNueC0+aG9va3MtPmVnbC5lZ2xHZXRDb25maWdzKGRwLT5kcHlzW2ldLCAwLCAwLCAmbikpIHsKLSAgICAgICAgICAgICAgICBkcC0+Y29uZmlnc1tpXSA9IChFR0xDb25maWcqKW1hbGxvYyhzaXplb2YoRUdMQ29uZmlnKSpuKTsKLSAgICAgICAgICAgICAgICBpZiAoZHAtPmNvbmZpZ3NbaV0pIHsKKyAgICAgICAgICAgIGlmIChjbngtPmhvb2tzLT5lZ2wuZWdsR2V0Q29uZmlncyhkcC0+ZGlzcFtpXS5kcHksIDAsIDAsICZuKSkgeworICAgICAgICAgICAgICAgIGRwLT5kaXNwW2ldLmNvbmZpZyA9IChFR0xDb25maWcqKW1hbGxvYyhzaXplb2YoRUdMQ29uZmlnKSpuKTsKKyAgICAgICAgICAgICAgICBpZiAoZHAtPmRpc3BbaV0uY29uZmlnKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChjbngtPmhvb2tzLT5lZ2wuZWdsR2V0Q29uZmlncygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcC0+ZHB5c1tpXSwgZHAtPmNvbmZpZ3NbaV0sIG4sICZkcC0+bnVtQ29uZmlnc1tpXSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHAtPmRpc3BbaV0uZHB5LCBkcC0+ZGlzcFtpXS5jb25maWcsIG4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRwLT5kaXNwW2ldLm51bUNvbmZpZ3MpKQogICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzb3J0IHRoZSBjb25maWd1cmF0aW9ucyBzbyB3ZSBjYW4gZG8gYmluYXJ5IHNlYXJjaGVzCi0gICAgICAgICAgICAgICAgICAgICAgICBxc29ydCggIGRwLT5jb25maWdzW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcC0+bnVtQ29uZmlnc1tpXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHFzb3J0KCAgZHAtPmRpc3BbaV0uY29uZmlnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcC0+ZGlzcFtpXS5udW1Db25maWdzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoRUdMQ29uZmlnKSwgY21wX2NvbmZpZ3MpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBkcC0+bnVtVG90YWxDb25maWdzICs9IG47CkBAIC03MTIsMzMgKzczMiwzNiBAQAogCiBFR0xCb29sZWFuIGVnbFRlcm1pbmF0ZShFR0xEaXNwbGF5IGRweSkKIHsKKyAgICAvLyBOT1RFOiBkb24ndCB1bmxvYWQgdGhlIGRyaXZlcnMgYi9jIHNvbWUgQVBJcyBjYW4gYmUgY2FsbGVkCisgICAgLy8gYWZ0ZXIgZWdsVGVybWluYXRlKCkgaGFzIGJlZW4gY2FsbGVkLiBlZ2xUZXJtaW5hdGUoKSBvbmx5CisgICAgLy8gdGVybWluYXRlcyBhbiBFR0xEaXNwbGF5LCBub3QgYSBFR0wgaXRzZWxmLgorCiAgICAgZWdsX2Rpc3BsYXlfdCogY29uc3QgZHAgPSBnZXRfZGlzcGxheShkcHkpOwogICAgIGlmICghZHApIHJldHVybiBzZXRFcnJvcihFR0xfQkFEX0RJU1BMQVksIEVHTF9GQUxTRSk7CiAgICAgaWYgKGFuZHJvaWRfYXRvbWljX2RlYygmZHAtPnJlZnMpICE9IDEpCiAgICAgICAgIHJldHVybiBFR0xfVFJVRTsKLSAgICAgICAgCisKICAgICBFR0xCb29sZWFuIHJlcyA9IEVHTF9GQUxTRTsKICAgICBmb3IgKGludCBpPTAgOyBpPElNUExfTlVNX0RSSVZFUlNfSU1QTEVNRU5UQVRJT05TIDsgaSsrKSB7CiAgICAgICAgIGVnbF9jb25uZWN0aW9uX3QqIGNvbnN0IGNueCA9ICZnRUdMSW1wbFtpXTsKLSAgICAgICAgaWYgKGNueC0+ZHNvKSB7Ci0gICAgICAgICAgICBjbngtPmhvb2tzLT5lZ2wuZWdsVGVybWluYXRlKGRwLT5kcHlzW2ldKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgLyogUkVWSVNJVDogaXQncyB1bmNsZWFyIHdoYXQgdG8gZG8gaWYgZWdsVGVybWluYXRlKCkgZmFpbHMsCi0gICAgICAgICAgICAgKiBvbiBvbmUgZW5kIHdlIHNob3VsZG4ndCBjYXJlLCBvbiB0aGUgb3RoZXIgZW5kIGlmIGl0IGZhaWxzCi0gICAgICAgICAgICAgKiBpdCBtaWdodCBub3QgYmUgc2FmZSB0byBjYWxsIGRsY2xvc2UoKSAodGhlcmUgY291bGQgYmUgc29tZQotICAgICAgICAgICAgICogdGhyZWFkcyBhcm91bmQpLiAqLwotICAgICAgICAgICAgCi0gICAgICAgICAgICBmcmVlKGRwLT5jb25maWdzW2ldKTsKLSAgICAgICAgICAgIGZyZWUoKHZvaWQqKWRwLT5xdWVyeVN0cmluZ1tpXS5leHRlbnNpb25zKTsKLSAgICAgICAgICAgIGRwLT5udW1Db25maWdzW2ldID0gMDsKLSAgICAgICAgICAgIGRwLT5kcHlzW2ldID0gRUdMX05PX0RJU1BMQVk7Ci0gICAgICAgICAgICBkbGNsb3NlKCh2b2lkKiljbngtPmRzbyk7Ci0gICAgICAgICAgICBjbngtPmRzbyA9IDA7CisgICAgICAgIGlmIChjbngtPmRzbyAmJiBkcC0+ZGlzcFtpXS5zdGF0ZSA9PSBlZ2xfZGlzcGxheV90OjpJTklUSUFMSVpFRCkgeworICAgICAgICAgICAgaWYgKGNueC0+aG9va3MtPmVnbC5lZ2xUZXJtaW5hdGUoZHAtPmRpc3BbaV0uZHB5KSA9PSBFR0xfRkFMU0UpIHsKKyAgICAgICAgICAgICAgICBMT0dXKCIlZDogZWdsVGVybWluYXRlKCVwKSBmYWlsZWQgKCVzKSIsIGksIGRwLT5kaXNwW2ldLmRweSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVnbF9zdHJlcnJvcihjbngtPmhvb2tzLT5lZ2wuZWdsR2V0RXJyb3IoKSkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gUkVWSVNJVDogaXQncyB1bmNsZWFyIHdoYXQgdG8gZG8gaWYgZWdsVGVybWluYXRlKCkgZmFpbHMKKyAgICAgICAgICAgIGZyZWUoZHAtPmRpc3BbaV0uY29uZmlnKTsKKworICAgICAgICAgICAgZHAtPmRpc3BbaV0ubnVtQ29uZmlncyA9IDA7CisgICAgICAgICAgICBkcC0+ZGlzcFtpXS5jb25maWcgPSAwOworICAgICAgICAgICAgZHAtPmRpc3BbaV0uc3RhdGUgPSBlZ2xfZGlzcGxheV90OjpURVJNSU5BVEVEOworCiAgICAgICAgICAgICByZXMgPSBFR0xfVFJVRTsKICAgICAgICAgfQogICAgIH0KLSAgICBmcmVlKCh2b2lkKilkcC0+ZXh0ZW5zaW9uc1N0cmluZyk7Ci0gICAgZHAtPmV4dGVuc2lvbnNTdHJpbmcgPSAwOworICAgIAorICAgIC8vIFRPRE86IGFsbCBlZ2xfb2JqZWN0X3Qgc2hvdWxkIGJlIG1hcmtlZCBmb3IgdGVybWluYXRpb24KKyAgICAKICAgICBkcC0+bnVtVG90YWxDb25maWdzID0gMDsKICAgICBjbGVhclRMUygpOwogICAgIHJldHVybiByZXM7CkBAIC03NjIsNyArNzg1LDcgQEAKICAgICB9CiAgICAgR0xpbnQgbiA9IDA7CiAgICAgZm9yIChpbnQgaj0wIDsgajxJTVBMX05VTV9EUklWRVJTX0lNUExFTUVOVEFUSU9OUyA7IGorKykgewotICAgICAgICBmb3IgKGludCBpPTAgOyBpPGRwLT5udW1Db25maWdzW2pdICYmIGNvbmZpZ19zaXplIDsgaSsrKSB7CisgICAgICAgIGZvciAoaW50IGk9MCA7IGk8ZHAtPmRpc3Bbal0ubnVtQ29uZmlncyAmJiBjb25maWdfc2l6ZSA7IGkrKykgewogICAgICAgICAgICAgKmNvbmZpZ3MrKyA9IE1BS0VfQ09ORklHKGosIGkpOwogICAgICAgICAgICAgY29uZmlnX3NpemUtLTsKICAgICAgICAgICAgIG4rKzsKQEAgLTgxOSw3ICs4NDIsNyBAQAogICAgICAgICBlZ2xfY29ubmVjdGlvbl90KiBjb25zdCBjbnggPSAmZ0VHTEltcGxbaV07CiAgICAgICAgIGlmIChjbngtPmRzbykgewogICAgICAgICAgICAgY254LT5ob29rcy0+ZWdsLmVnbEdldENvbmZpZ0F0dHJpYigKLSAgICAgICAgICAgICAgICAgICAgZHAtPmRweXNbaV0sIGRwLT5jb25maWdzW2ldW2luZGV4XSwgCisgICAgICAgICAgICAgICAgICAgIGRwLT5kaXNwW2ldLmRweSwgZHAtPmRpc3BbaV0uY29uZmlnW2luZGV4XSwgCiAgICAgICAgICAgICAgICAgICAgIEVHTF9DT05GSUdfSUQsICZjb25maWdJZCk7CiAKICAgICAgICAgICAgIC8vIGFuZCBzd2l0Y2ggdG8gdGhlIG5ldyBsaXN0CkBAIC04MzQsNyArODU3LDcgQEAKICAgICAgICAgICAgIC8vIHdoaWNoIG9uZS4KIAogICAgICAgICAgICAgcmVzID0gY254LT5ob29rcy0+ZWdsLmVnbENob29zZUNvbmZpZygKLSAgICAgICAgICAgICAgICAgICAgZHAtPmRweXNbaV0sIGF0dHJpYl9saXN0LCBjb25maWdzLCBjb25maWdfc2l6ZSwgJm4pOworICAgICAgICAgICAgICAgICAgICBkcC0+ZGlzcFtpXS5kcHksIGF0dHJpYl9saXN0LCBjb25maWdzLCBjb25maWdfc2l6ZSwgJm4pOwogICAgICAgICAgICAgaWYgKHJlcyAmJiBuPjApIHsKICAgICAgICAgICAgICAgICAvLyBuIGhhcyB0byBiZSAwIG9yIDEsIGJ5IGNvbnN0cnVjdGlvbiwgYW5kIHdlIGFscmVhZHkga25vdwogICAgICAgICAgICAgICAgIC8vIHdoaWNoIGNvbmZpZyBpdCB3aWxsIHJldHVybiAoc2luY2UgdGhlcmUgY2FuIGJlIG9ubHkgb25lKS4KQEAgLTg1MywxMyArODc2LDE0IEBACiAgICAgICAgIGVnbF9jb25uZWN0aW9uX3QqIGNvbnN0IGNueCA9ICZnRUdMSW1wbFtpXTsKICAgICAgICAgaWYgKGNueC0+ZHNvKSB7CiAgICAgICAgICAgICBpZiAoY254LT5ob29rcy0+ZWdsLmVnbENob29zZUNvbmZpZygKLSAgICAgICAgICAgICAgICAgICAgZHAtPmRweXNbaV0sIGF0dHJpYl9saXN0LCBjb25maWdzLCBjb25maWdfc2l6ZSwgJm4pKSB7CisgICAgICAgICAgICAgICAgICAgIGRwLT5kaXNwW2ldLmRweSwgYXR0cmliX2xpc3QsIGNvbmZpZ3MsIGNvbmZpZ19zaXplLCAmbikpIHsKICAgICAgICAgICAgICAgICBpZiAoY29uZmlncykgewogICAgICAgICAgICAgICAgICAgICAvLyBub3cgd2UgbmVlZCB0byBjb252ZXJ0IHRoZXNlIGNsaWVudCBFR0xDb25maWcgdG8gb3VyCiAgICAgICAgICAgICAgICAgICAgIC8vIGludGVybmFsIEVHTENvbmZpZyBmb3JtYXQuIFRoaXMgaXMgZG9uZSBpbiBPKG4gbG9nIG4pLgogICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqPTAgOyBqPG4gOyBqKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCA9IGJpbmFyeVNlYXJjaDxFR0xDb25maWc+KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcC0+Y29uZmlnc1tpXSwgMCwgZHAtPm51bUNvbmZpZ3NbaV0tMSwgY29uZmlnc1tqXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRwLT5kaXNwW2ldLmNvbmZpZywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHAtPmRpc3BbaV0ubnVtQ29uZmlncy0xLCBjb25maWdzW2pdKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZ3MpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnc1tqXSA9IE1BS0VfQ09ORklHKGksIGluZGV4KTsKQEAgLTg5NCw3ICs5MTgsNyBAQAogICAgICAgICByZXR1cm4gRUdMX1RSVUU7CiAgICAgfQogICAgIHJldHVybiBjbngtPmhvb2tzLT5lZ2wuZWdsR2V0Q29uZmlnQXR0cmliKAotICAgICAgICAgICAgZHAtPmRweXNbaV0sIGRwLT5jb25maWdzW2ldW2luZGV4XSwgYXR0cmlidXRlLCB2YWx1ZSk7CisgICAgICAgICAgICBkcC0+ZGlzcFtpXS5kcHksIGRwLT5kaXNwW2ldLmNvbmZpZ1tpbmRleF0sIGF0dHJpYnV0ZSwgdmFsdWUpOwogfQogCiAvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCkBAIC05MDksMjYgKzkzMywxMiBAQAogICAgIGludCBpPTAsIGluZGV4PTA7CiAgICAgZWdsX2Nvbm5lY3Rpb25fdCogY254ID0gdmFsaWRhdGVfZGlzcGxheV9jb25maWcoZHB5LCBjb25maWcsIGRwLCBpLCBpbmRleCk7CiAgICAgaWYgKGNueCkgewotICAgICAgICAvLyB3aW5kb3cgbXVzdCBiZSBjb25uZWN0ZWQgdXBvbiBjYWxsaW5nIHVuZGVybHlpbmcKLSAgICAgICAgLy8gZWdsQ3JlYXRlV2luZG93U3VyZmFjZQotICAgICAgICBpZiAod2luZG93KSB7Ci0gICAgICAgICAgICB3aW5kb3ctPmluY1JlZih3aW5kb3cpOwotICAgICAgICAgICAgaWYgKHdpbmRvdy0+Y29ubmVjdCkKLSAgICAgICAgICAgICAgICB3aW5kb3ctPmNvbm5lY3Qod2luZG93KTsKLSAgICAgICAgfQotCiAgICAgICAgIEVHTFN1cmZhY2Ugc3VyZmFjZSA9IGNueC0+aG9va3MtPmVnbC5lZ2xDcmVhdGVXaW5kb3dTdXJmYWNlKAotICAgICAgICAgICAgICAgIGRwLT5kcHlzW2ldLCBkcC0+Y29uZmlnc1tpXVtpbmRleF0sIHdpbmRvdywgYXR0cmliX2xpc3QpOyAgICAgICAKKyAgICAgICAgICAgICAgICBkcC0+ZGlzcFtpXS5kcHksIGRwLT5kaXNwW2ldLmNvbmZpZ1tpbmRleF0sIHdpbmRvdywgYXR0cmliX2xpc3QpOyAgICAgICAKICAgICAgICAgaWYgKHN1cmZhY2UgIT0gRUdMX05PX1NVUkZBQ0UpIHsKLSAgICAgICAgICAgIGVnbF9zdXJmYWNlX3QqIHMgPSBuZXcgZWdsX3N1cmZhY2VfdChkcHksIHN1cmZhY2UsIHdpbmRvdywgaSwgY254KTsKKyAgICAgICAgICAgIGVnbF9zdXJmYWNlX3QqIHMgPSBuZXcgZWdsX3N1cmZhY2VfdChkcHksIHN1cmZhY2UsIGksIGNueCk7CiAgICAgICAgICAgICByZXR1cm4gczsKICAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgLy8gc29tZXRoaW5nIHdlbnQgd3JvbmcsIGRpc2Nvbm5lY3QgYW5kIGZyZWUgd2luZG93Ci0gICAgICAgIC8vICh3aWxsIGRpc2Nvbm5lY3QoKSBhdXRvbWF0aWNhbGx5KQotICAgICAgICBpZiAod2luZG93KSB7Ci0gICAgICAgICAgICB3aW5kb3ctPmRlY1JlZih3aW5kb3cpOwotICAgICAgICB9ICAgICAgICAKICAgICB9CiAgICAgcmV0dXJuIEVHTF9OT19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zW0lNUExfTlVNX0RSSVZFUlNfSU1QTEVNRU5UQVRJT05TXTsKKyAgICAgICAgYm9vbCBzdWNjZXNzID0gZmFsc2U7CisgICAgICAgIGZvciAoaW50IGk9MCA7IGk8SU1QTF9OVU1fRFJJVkVSU19JTVBMRU1FTlRBVElPTlMgOyBpKyspIHsKKyAgICAgICAgICAgIGVnbF9jb25uZWN0aW9uX3QqIGNvbnN0IGNueCA9ICZnRUdMSW1wbFtpXTsKKyAgICAgICAgICAgIGltcGxJbWFnZXNbaV0gPSBFR0xfTk9fSU1BR0VfS0hSOworICAgICAgICAgICAgaWYgKGNueC0+ZHNvKSB7CisgICAgICAgICAgICAgICAgaWYgKGNueC0+aG9va3MtPmVnbC5lZ2xDcmVhdGVJbWFnZUtIUikgeworICAgICAgICAgICAgICAgICAgICBpbXBsSW1hZ2VzW2ldID0gY254LT5ob29rcy0+ZWdsLmVnbENyZWF0ZUltYWdlS0hSKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRwLT5kaXNwW2ldLmRweSwgY3R4LCB0YXJnZXQsIGJ1ZmZlciwgYXR0cmliX2xpc3QpOworICAgICAgICAgICAgICAgICAgICBpZiAoaW1wbEltYWdlc1tpXSAhPSBFR0xfTk9fSU1BR0VfS0hSKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoIXN1Y2Nlc3MpCisgICAgICAgICAgICByZXR1cm4gRUdMX05PX0lNQUdFX0tIUjsKKyAgICAgICAgCisgICAgICAgIGVnbF9pbWFnZV90KiByZXN1bHQgPSBuZXcgZWdsX2ltYWdlX3QoZHB5LCBjdHgpOworICAgICAgICBtZW1jcHkocmVzdWx0LT5pbWFnZXMsIGltcGxJbWFnZXMsIHNpemVvZihpbXBsSW1hZ2VzKSk7CisgICAgICAgIHJldHVybi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ZpbmUgQVBJX0VOVFJZKF9hcGkpIF9fYXR0cmlidXRlX18oKG5ha2VkKSkgX2FwaQorCisgICAgI2RlZmluZSBDQUxMX0dMX0FQSShfYXBpLCAuLi4pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgYXNtIHZvbGF0aWxlKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICJtb3YgICByMTIsICMweEZGRkYwRkZGICAgXG4iICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAibGRyICAgcjEyLCBbcjEyLCAjLTE1XSAgIFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgImxkciAgIHIxMiwgW3IxMiwgJVt0bHNdXSBcbiIgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICJjbXAgICByMTIsICMwICAgICAgICAgICAgXG4iICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAibGRybmUgcGMsICBbcjEyLCAlW2FwaV1dIFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgImJ4ICAgIGxyICAgICAgICAgICAgICAgICBcbiIgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICA6IFt0bHNdICJKIihUTFNfU0xPVF9PUEVOR0xfQVBJKjQpLCAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBbYXBpXSAiSiIoX19idWlsdGluX29mZnNldG9mKGdsX2hvb2tzX3QsIGdsMi5fYXBpKSkgICAgXAorICAgICAgICAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICk7CisgICAgCisgICAgI2RlZmluZSBDQUxMX0dMX0FQSV9SRVRVUk4oX2FwaSwgLi4uKSBcCisgICAgICAgIENBTExfR0xfQVBJKF9hcGksIF9fVkFfQVJHU19fKSBcCisgICAgICAgIHJldHVybiAwOyAvLyBwbGFjYXRlIGdjYydzIHdhcm5pbmdzLiBuZXZlciByZWFjaGVkLgorCisjZWxzZQorCisgICAgI2RlZmluZSBBUElfRU5UUlkoX2FwaSkgX2FwaQorCisgICAgI2RlZmluZSBDQUxMX0dMX0FQSShfYXBpLCAuLi4pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBnbF9ob29rc190OjpnbDJfdCBjb25zdCAqIGNvbnN0IF9jID0gJmdldEdsVGhyZWFkU3BlY2lmaWMoKS0+Z2wyOyBcCisgICAgICAgIF9jLT5fYXBpKF9fVkFfQVJHU19fKQorICAgIAorICAgICNkZWZpbmUgQ0FMTF9HTF9BUElfUkVUVVJOKF9hcGksIC4uLikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgZ2xfaG9va3NfdDo6Z2wyX3QgY29uc3QgKiBjb25zdCBfYyA9ICZnZXRHbFRocmVhZFNwZWNpZmljKCktPmdsMjsgXAorICAgICAgICByZXR1cm4gX2MtPl9hcGkoX19WQV9BUkdTX18pCisKKyNlbmRpZgorCisKK2V4dGVybiAiQyIgeworI2luY2x1ZGUgImdsMl9hcGkuaW4iCisjaW5jbHVkZSAiZ2wyZXh0X2FwaS5pbiIKK30KKworI3VuZGVmIEFQSV9FTlRSWQorI3VuZGVmIENBTExfR0xfQVBJCisjdW5kZWYgQ0FMTF9HTF9BUElfUkVUVVJOCisKKworLyoKKyAqIFRoZXNlIEdMIGNhbGxzIGFyZSBzcGVjaWFsIGJlY2F1c2UgdGhleSBuZWVkIHRvIEVHTCB0byByZXRyaWV2ZSBzb21lCisgKiBpbmZvcm1hdGlvbnMgYmVmb3JlIHRoZXkgY2FuIGV4ZWN1dGUuCisgKi8KKworZXh0ZXJuICJDIiB2b2lkIF9fZ2xFR0xJbWFnZVRhcmdldF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2wvbGlicy90b29scy9lbnVtZXh0cmFjdC5zaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNTcwNzMwMi4uMDAwMDAwMAotLS0gYS9vcGVuZ2wvbGlicy90b29scy9lbnVtZXh0cmFjdC5zaAorKysgL2Rldi9udWxsCkBAIC0xLDMyICswLDAgQEAKLSMhL2Jpbi9zaAotCi1hd2sgJwotL14jZGVmaW5lIEdMXy8gewotICAgIG5hbWVzW2NvdW50XSA9ICQyOwotICAgIHZhbHVlc1tjb3VudF0gPSAkMzsKLSAgICBzb3J0W2NvdW50XSA9ICQzICsgMDsKLSAgICBjb3VudCsrOwotfQotRU5EIHsKLSAgICBmb3IgKGkgPSAxOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICBmb3IgKGogPSAwOyBqIDwgaTsgaisrKSB7Ci0gICAgICAgICAgICBpZiAoc29ydFtpXSA8IHNvcnRbal0pIHsKLSAgICAgICAgICAgICAgICB0biA9IG5hbWVzW2ldOwotICAgICAgICAgICAgICAgIHR2ID0gdmFsdWVzW2ldOwotICAgICAgICAgICAgICAgIHRzID0gc29ydFtpXTsKLSAgICAgICAgICAgICAgICBuYW1lc1tpXSA9IG5hbWVzW2pdOwotICAgICAgICAgICAgICAgIHZhbHVlc1tpXSA9IHZhbHVlc1tqXTsKLSAgICAgICAgICAgICAgICBzb3J0W2ldID0gc29ydFtqXTsKLSAgICAgICAgICAgICAgICBuYW1lc1tqXSA9IHRuOwotICAgICAgICAgICAgICAgIHZhbHVlc1tqXSA9IHR2OwotICAgICAgICAgICAgICAgIHNvcnRbal0gPSB0czsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAKLSAgICBmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICBwcmludGYoIkdMRU5VTSglcywgJXMpXG4iLCBuYW1lc1tpXSwgdmFsdWVzW2ldKTsKLSAgICB9Ci19Ci0nIDwgJDEKLQpkaWZmIC0tZ2l0IGE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Vycm9yICYmIGVycm9yICE9IEVHTF9TVUNDRVNTKQotICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkVHTCBFcnJvcjogMHglMDR4XG4iLCAoaW50KWVycm9yKTsKLX0KLQotc3RhdGljIGludCBpbml0R3JhcGhpY3MoKQotewotICAgIEVHTGludCBzX2NvbmZpZ0F0dHJpYnNbXSA9IHsKLSAgICAgICAgIEVHTF9SRURfU0laRSwgICAgICAgNSwKLSAgICAgICAgIEVHTF9HUkVFTl9TSVpFLCAgICAgNiwKLSAgICAgICAgIEVHTF9CTFVFX1NJWkUsICAgICAgNSwKLSAjaWYgMQotICAgICAgICAgRUdMX0RFUFRIX1NJWkUsICAgICAxNiwKLSAgICAgICAgIEVHTF9TVEVOQ0lMX1NJWkUsICAgMCwKLSAjZWxzZQotICAgICAgICAgRUdMX0FMUEhBX1NJWkUsICAgICBFR0xfRE9OVF9DQVJFLAotICAgICAgICAgRUdMX0RFUFRIX1NJWkUsICAgICBFR0xfRE9OVF9DQVJFLAotICAgICAgICAgRUdMX1NURU5DSUxfU0laRSwgICBFR0xfRE9OVF9DQVJFLAotICAgICAgICAgRUdMX1NVUkZBQ0VfVFlQRSwgICBFR0xfRE9OVF9DQVJFLAotICNlbmRpZgotICAgICAgICAgRUdMX05PTkUKLSAgICAgfTsKLSAgICAgCi0gICAgIEVHTGludCBudW1Db25maWdzID0gLTE7Ci0gICAgIEVHTGludCBtYWpvclZlcnNpb247Ci0gICAgIEVHTGludCBtaW5vclZlcnNpb247Ci0gICAgIEVHTENvbmZpZyBjb25maWc7Ci0gICAgIEVHTENvbnRleHQgY29udGV4dDsKLSAgICAgRUdMU3VyZmFjZSBzdXJmYWNlOwotICAgICAKLSAgICAgRUdMRGlzcGxheSBkcHk7Ci0KLSAgICAgZHB5ID0gZWdsR2V0RGlzcGxheShFR0xfREVGQVVMVF9ESVNQTEFZKTsKLSAgICAgZWdsX2Vycm9yKCJlZ2xHZXREaXNwbGF5Iik7Ci0gICAgIGZwcmlud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ycz8KKyAgICBpZiAoZXJyb3IgJiYgZXJyb3IgIT0gRUdMX1NVQ0NFU1MpCisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiRUdMIEVycm9yOiAweCUwNHhcbiIsIChpbnQpZXJyb3IpOworfQorCitzdGF0aWMgaW50IGluaXRHcmFwaGljcygpCit7CisgICAgRUdMaW50IGNvbmZpZ0F0dHJpYnNbXSA9IHsKKyAgICAgICAgIEVHTF9ERVBUSF9TSVpFLCAxNiwKKyAgICAgICAgIEVHTF9OT05FCisgICAgIH07CisgICAgIAorICAgICBFR0xpbnQgbWFqb3JWZXJzaW9uOworICAgICBFR0xpbnQgbWlub3JWZXJzaW9uOworICAgICBFR0xDb250ZXh0IGNvbnRleHQ7CisgICAgIEVHTENvbmZpZyBjb25maWc7CisgICAgIEVHTFN1cmZhY2Ugc3VyZmFjZTsKKyAgICAgRUdMaW50IHcsIGg7CisgICAgIEVHTERpc3BsYXkgZHB5OworCisgICAgIEVHTE5hdGl2ZVdpbmRvd1R5cGUgd2luZG93ID0gYW5kcm9pZF9jcmVhdGVEaXNwbGF5U3VyZmFjZSgpOworICAgICAKKyAgICAgZHB5ID0gZWdsR2V0RGlzcGxheShFR0xfREVGQVVMVF9ESVNQTEFZKTsKKyAgICAgZWdsSW5pdGlhbGl6ZShkcHksICZtYWpvclZlcnNpb24sICZtaW5vclZlcnNpb24pOworICAgICAgICAgIAorICAgICBzdGF0dXNfdCBlcnIgPSBFR0xVdGlsczo6c2VsZWN0Q29uZmlnRm9yTmF0aXZlV2luZG93KAorICAgICAgICAgICAgIGRweSwgY29uZmlnQXR0cmlicywgd2luZG93LCAmY29uZmlnKTsKKyAgICAgaWYgKGVycikgeworICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZG4ndCBmaW5kIGFuIEVHTENvbmZpZyBtYXRjaGluZyB0aGUgc2NyZWVuIGZvcm1hdFxuIik7CisgICAgICAgICByZXR1cm4gMDsKKyAgICAgfQorCisgICAgIHN1cmZhY2U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Rlcm1pbmF0ZShzRWdsRGlzcGxheSk7Cit9CisKKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKK3sKKyAgICAvLyBub3QgcmVmZXJlbmNlZDoKKyAgICBhcmdjID0gYXJnYzsKKyAgICBhcmd2ID0gYXJndjsKKworICAgIGlmICghaW5pdEdyYXBoaWNzKCkpCisgICAgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkdyYXBoaWNzIGluaXRpYWxpemF0aW9uIGZhaWxlZC5cbiIpOworICAgICAgICByZXR1cm4gRVhJVF9GQUlMVVJFOworICAgIH0KKworICAgIGFwcEluaXQoKTsKKyAgICAKKyAgICB3aGlsZSAoZ0FwcEFsaXZlKQorICAgIHsKKyAgICAgICAgc3RydWN0IHRpbWV2YWwgdGltZU5vdzsKKworICAgICAgICBpZiAoZ0FwcEFsaXZlKQorICAgICAgICB7CisgICAgICAgICAgICBnZXR0aW1lb2ZkYXkoJnRpbWVOb3csIE5VTEwpOworICAgICAgICAgICAgYXBwUmVuZGVyKHRpbWVOb3cudHZfc2VjICogMTAwMCArIHRpbWVOb3cudHZfdXNlYyAvIDEwMDAsCisgICAgICAgICAgICAgICAgICAgICAgc1dpbmRvd1dpZHRoLCBzV2luZG93SGVpZ2h0KTsKKyAgICAgICAgICAgIGNoZWNrR0xFcnJvcnMoKTsKKyAgICAgICAgICAgIGVnbFN3YXBCdWZmZXJzKHNFZ2xEaXNwbGF5LCBzRWdsU3VyZmFjZSk7CisgICAgICAgICAgICBjaGVja0VHTEVycm9ycygpOworICAgICAgICB9CisgICAgfQorCisgICAgYXBwRGVpbml0KCk7CisgICAgZGVpbml0R3JhcGhpY3MoKTsKKworICAgIHJldHVybiBFWElUX1NVQ0NFU1M7Cit9CmRpZmYgLS1naXQgYS9vcGVuZ2wvdGVzdHMvY29weWJpdHMvQW5kcm9pZC5tayBiL29wZW5nbC90ZXN0cy9jb3B5Yml0cy9BbmRyb2lkLm1rCm5ldyBmaWxlIG1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CBmcmVlX2dsX3N1cmZhY2UoKTsKK3ZvaWQgaW5pdF9zY2VuZSgpOworCitpbnQgY3JlYXRlX3BoeXNpY2FsX3RleHR1cmUoKTsKK2ludCByZWFkVGltZXIoKTsKKworLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisvLyBCdWZmZXIgYW4gaW1wbGVtZW50YXRpb24gb2YgYW5kcm9pZF9uYXRpdmVfYnVmZmVyX3QKKy8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCitjbGFzcyBOYXRpdmVCdWZmZXI7CisKK2NsYXNzIEJ1ZmZlciA6IHB1YmxpYyBhbmRyb2lkOjpTdXJmYWNlQnVmZmVyCit7CitwdWJsaWM6CisgICAgLy8gY3JlYXRlcyB3ICogaCBidWZmZXIKKyAgICBCdWZmZXIodWludDMyX3QgdywgdWludDMyX3QgaCwgUGl4ZWxGb3JtYXQgZm9ybWF0LCB1aW50MzJfdCB1c2FnZSk7CisKKyAgICAvLyByZXR1cm4gc3RhdHVzCisgICAgc3RhdHVzX3QgaW5pdENoZWNrKCkgY29uc3Q7CisKKyAgICB1aW50MzJfdCBnZXRXaWR0aCgpIGNvbnN0ICAgICAgICAgICB7IHJldHVybiB3aWR0aDsgfQorICAgIHVpbnQzMl90IGdldEhlaWdodCgpIGNvbnN0ICAgICAgICAgIHsgcmV0dXJuIGhlaWdodDsgfQorICAgIHVpbnQzMl90IGdldFN0cmlkZSgpIGNvbnN0ICAgICAgICAgIHsgcmV0dXJuIHN0cmlkZTsgfQorICAgIHVpbnQzMl90IGdldFVzYWdlKCkgY29uc3QgICAgICAgICAgIHsgcmV0dXJuIHVzYWdlOyB9CisgICAgUGl4ZWxGb3JtYXQgZ2V0UGl4ZWxGb3JtYXQoKSBjb25zdCAgeyByZXR1cm4gZm9ybWF0OyB9Cisg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yAgICBpZiAodz4wICYmIGg+MCkgeworICAgICAgICBtSW5pdENoZWNrID0gaW5pdFNpemUodywgaCk7CisgICAgfQorfQorCitCdWZmZXI6On5CdWZmZXIoKQoreworICAgIGlmIChoYW5kbGUpIHsKKyAgICAgICAgc0FsbG9jRGV2LT5mcmVlKHNBbGxvY0RldiwgaGFuZGxlKTsKKyAgICB9Cit9CisKK3N0YXR1c190IEJ1ZmZlcjo6aW5pdENoZWNrKCkgY29uc3QgeworICAgIHJldHVybiBtSW5pdENoZWNrOworfQorCithbmRyb2lkX25hdGl2ZV9idWZmZXJfdCogQnVmZmVyOjpnZXROYXRpdmVCdWZmZXIoKSBjb25zdAoreworICAgIHJldHVybiBzdGF0aWNfY2FzdDxhbmRyb2lkX25hdGl2ZV9idWZmZXJfdCo+KGNvbnN0X2Nhc3Q8QnVmZmVyKj4odGhpcykpOworfQorCitzdGF0dXNfdCBCdWZmZXI6OmluaXRTaXplKHVpbnQzMl90IHcsIHVpbnQzMl90IGgpCit7CisgICAgc3RhdHVzX3QgZXJyID0gTk9fRVJST1I7CisKKyAgICBlcnIgPSBzQWxsb2NEZXYtPmFsbG9jKHNBbGxvY0RldiwgdywgaCwgZm9ybWF0LCB1c2FnZSwgJmhhbmRsZSwgJnN0cmlkZSk7CisgICAgCisgICAgaWYgKGVyciA9PSBOT19FUlJPUikgeworICAgICAgICBpZiAoZXJyID09IE5PX0VSUk9SKSB7CisgICAgICAgICAgICB3aWR0aCAgPSB3OworICAgICAgICAgICAgaGVpZ2h0ID0gaDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiBlcnI7Cit9CisKK3N0YXR1c190IEJ1ZmZlcjo6bG9jayhHR0xTdXJmYWNlKiBzdXIsIHVpbnQzMl90IHVzYWdlKSAKK3sKKyAgICB2b2lkKiB2YWRkcjsKKyAgICBzdGF0dXNfdCByZXMgPSBTdXJmYWNlQnVmZmVyOjpsb2NrKHVzYWdlLCAmdmFkZHIpOworICAgIGlmIChyZXMgPT0gTk9fRVJST1IgJiYgc3VyKSB7CisgICAgICAgIHN1ci0+dmVyc2lvbiA9IHNpemVvZihHR0xTdXJmYWNlKTsKKyAgICAgICAgc3VyLT53aWR0aCA9IHdpZHRoOworICAgICAgICBzdXItPmhlaWdodCA9IGhlaWdodDsKKyAgICAgICAgc3VyLT5zdHJpZGUgPSBzdHJpZGU7CisgICAgICAgIHN1ci0+Zm9ybWF0ID0gZm9ybWF0OworICAgICAgICBzdXItPmRhdGEgPSBzdGF0aWNfY2FzdDxHR0x1Ynl0ZSo+KHZhZGRyKTsKKyAgICB9CisgICAgcmV0dXJuIHJlczsKK30KKworCit2b2lkIEJ1ZmZlcjo6c2V0UGl4ZWwoaW50IHgsIGludCB5LCBpbnQgciwgaW50IGcsIGludCBiLCBpbnQgYSkgeworICAgIGlmICh4IDwgMCB8fCAodW5zaWduZWQgaW50KSB4ID49IHdpZHRoCisgICAgICAgICAgICB8fCB5IDwgMCB8fCAodW5zaWduZWQgaW50KSB5ID49IGhlaWdodCkgeworICAgICAgICAvLyBjbGlwcGVkCisgICAgICAgIHJldHVybjsKKyAgICB9CisgICAgaW50IGluZGV4ID0gc3RyaWRlICogeSArIHg7CisgICAgc3dpdGNoIChmb3JtYXQpIHsKKyAgICBjYXNlIEhBTF9QSVhFTF9GT1JNQVRfUkdCXzU2NTogeworICAgICAgICAgICAgdW5zaWduZWQgc2hvcnQgdmFsID0gKHVuc2lnbmVkIHNob3J0KSAoCisgICAgICAgICAgICAgICAgICAgICgoMHgxZiAmIChyID4+IDMpKSA8PCAxMSkKKyAgICAgICAgICAgICAgICAgICAgfCAoKDB4M2YgJiAoZyA+PiAyKSkgPDwgNSkKKyAgICAgICAgICAgICAgICAgICAgfCAoMHgxZiAmIChiID4+IDMpKSk7CisgICAgICAgICAgICAoKHVuc2lnbmVkIHNob3J0KikgbURhdGEpW2luZGV4XT0gdmFsOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGNhc2UgSEFMX1BJWEVMX0ZPUk1BVF9SR0JBXzg4ODg6IHsgLy8gQUJHUgorICAgICAgICB1bnNpZ25lZCBpbnQgdmFsID0gKHVuc2lnbmVkIGludCkKKyAgICAgICAgICAgICgoKGEgJiAweGZmKSA8PCAyNCkKKyAgICAgICAgICAgICAgICAgICAgfCAoKGIgJiAweGZmKSA8PCAxNikKKyAgICAgICAgICAgICAgICAgICAgfCAoKGcgJiAweGZmKSA8PCA4KQorICAgICAgICAgICAgICAgICAgICB8IChyICYgMHhmZikpOworICAgICAgICAgICAgKCh1bnNpZ25lZCBpbnQqKSBtRGF0YSlbaW5kZXhdID0gdmFsOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICAgIC8vIFVuc3VwcG9ydGVkIHBpeGVsIGZvcm1hdAorICAgICAgICBicmVhazsKKyAgICB9Cit9CisKKworc3RhdGljIHZvaWQgZ2x1TG9va0F0KGZsb2F0IGV5ZVgsIGZsb2F0IGV5ZVksIGZsb2F0IGV5ZVosCisgICAgICAgIGZsb2F0IGNlbnRlclgsIGZsb2F0IGNlbnRlclksIGZsb2F0IGNlbnRlclosIGZsb2F0IHVwWCwgZmxvYXQgdXBZLAorICAgICAgICBmbG9hdCB1cFopCit7CisgICAgLy8gU2VlIHRoZSBPcGVuR0wgR0xVVCBkb2N1bWVudGF0aW9uIGZvciBnbHVMb29rQXQgZm9yIGEgZGVzY3JpcHRpb24KKyAgICAvLyBvZiB0aGUgYWxnb3JpdGhtLiBXZSBpbXBsZW1lbnQgaXQgaW4gYSBzdHJhaWdodGZvcndhcmQgd2F5OgorCisgICAgZmxvYXQgZnggPSBjZW50ZXJYIC0gZXllWDsKKyAgICBmbG9hdCBmeSA9IGNlbnRlclkgLSBleWVZOworICAgIGZsb2F0IGZ6ID0gY2VudGVyWiAtIGV5ZVo7CisKKyAgICAvLyBOb3JtYWxpemUgZgorICAgIGZsb2F0IHJsZiA9IDEuMGYgLyBzcXJ0ZihmeCpmeCArIGZ5KmZ5ICsgZnoqZnopOworICAgIGZ4ICo9IHJsZjsKKyAgICBmeSAqPSBybGY7CisgICAgZnogKj0gcmxmOworCisgICAgLy8gTm9ybWFsaXplIHVwCisgICAgZmxvYXQgcmx1cCA9IDEuMGYgLyBzcXJ0Zih1cFgqdXBYICsgdXBZKnVwWSArIHVwWip1cFopOworICAgIHVwWCAqPSBybHVwOworICAgIHVwWSAqPSBybHVwOworICAgIHVwWiAqPSBybHVwOworCisgICAgLy8gY29tcHV0ZSBzID0gZiB4IHVwICh4IG1lYW5zICJjcm9zcyBwcm9kdWN0IikKKworICAgIGZsb2F0IHN4ID0gZnkgKiB1cFogLSBmeiAqIHVwWTsKKyAgICBmbG9hdCBzeSA9IGZ6ICogdXBYIC0gZnggKiB1cFo7CisgICAgZmxvYXQgc3ogPSBmeCAqIHVwWSAtIGZ5ICogdXBYOworCisgICAgLy8gY29tcHV0ZSB1ID0gcyB4IGYKKyAgICBmbG9hdCB1eCA9IHN5ICogZnogLSBzeiAqIGZ5OworICAgIGZsb2F0IHV5ID0gc3ogKiBmeCAtIHN4ICogZno7CisgICAgZmxvYXQgdXogPSBzeCAqIGZ5IC0gc3kgKiBmeDsKKworICAgIGZsb2F0IG1bMTZdIDsKKyAgICBtWzBdID0gc3g7CisgICAgbVsxXSA9IHV4OworICAgIG1bMl0gPSAtZng7CisgICAgbVszXSA9IDAuMGY7CisKKyAgICBtWzRdID0gc3k7CisgICAgbVs1XSA9IHV5OworICAgIG1bNl0gPSAtZnk7CisgICAgbVs3XSA9IDAuMGY7CisKKyAgICBtWzhdID0gc3o7CisgICAgbVs5XSA9IHV6OworICAgIG1bMTBdID0gLWZ6OworICAgIG1bMTFdID0gMC4wZjsKKworICAgIG1bMTJdID0gMC4wZjsKKyAgICBtWzEzXSA9IDAuMGY7CisgICAgbVsxNF0gPSAwLjBmOworICAgIG1bMTVdID0gMS4wZjsKKworICAgIGdsTXVsdE1hdHJpeGYobSk7CisgICAgZ2xUcmFuc2xhdGVmKC1leWVYLCAtZXllWSwgLWV5ZVopOworfQorCitpbnQgaW5pdF9ncmFsbG9jKCkgeworICAgIGludCBlcnIgPSBod19nZXRfbW9kdWxlKEdSQUxMT0NfSEFSRFdBUkVfTU9EVUxFX0lELCAmZ3JhbGxvY19tb2R1bGUpOworICAgIExPR0VfSUYoZXJyLCAiRkFUQUw6IGNhbid0IGZpbmQgdGhlICVzIG1vZHVsZSIsIEdSQUxMT0NfSEFSRFdBUkVfTU9EVUxFX0lEKTsKKworICAgIGlmIChlcnIgPT0gMCkgeworICAgICAgICBncmFsbG9jX29wZW4oZ3JhbGxvY19tb2R1bGUsICZzQWxsb2NEZXYpOworICAgIH0KKyAgICByZXR1cm4gZXJyOworfQorCitpbnQgaW5pdF9nbF9zdXJmYWNlKHZvaWQpCit7CisgICAgRUdMaW50IG51bUNvbmZpZ3MgPSAxOworICAgIEVHTENvbmZpZyBteUNvbmZpZyA9IHswfTsKKyAgICBFR0xpbnQgYXR0cmliW10gPQorICAgIHsKKyAgICAgICAgICAgIEVHTF9ERVBUSF9TSVpFLCAgICAgMTYsCisgICAgICAgICAgICBFR0xfTk9ORQorICAgIH07CisKKyAgICBFR0xOYXRpdmVXaW5kb3dUeXBlIHdpbmRvdyA9IGFuZHJvaWRfY3JlYXRlRGlzcGxheVN1cmZhY2UoKTsKKworICAgIHByaW50ZigiaW5pdF9nbF9zdXJmYWNlXG4iKTsKKyAgICBpZiAoIChlZ2xEaXNwbGF5ID0gZWdsR2V0RGlzcGxheShFR0xfREVGQVVMVF9ESVNQTEFZKSkgPT0gRUdMX05PX0RJU1BMQVkgKQorICAgIHsKKyAgICAgICAgcHJpbnRmKCJlZ2xHZXREaXNwbGF5IGZhaWxlZFxuIik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIGlmICggZWdsSW5pdGlhbGl6ZShlZ2xEaXNwbGF5LCBOVUxMLCBOVUxMKSAhPSBFR0xfVFJVRSApCisgICAgeworICAgICAgICBwcmludGYoImVnbEluaXRpYWxpemUgZmFpbGVkXG4iKTsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgaWYgKCBFR0xVdGlsczo6c2VsZWN0Q29uZmlnRm9yTmF0aXZlV2luZG93KGVnbERpc3BsYXksIGF0dHJpYiwgd2luZG93LCAmbXlDb25maWcpICE9IDApCisgICAgeworICAgICAgICBwcmludGYoIkVHTFV0aWxzOjpzZWxlY3RDb25maWdGb3JOYXRpdmVXaW5kb3cgZmFpbGVkXG4iKTsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgICAgICAKKworICAgIGlmICggKGVnbFN1cmZhY2UgPSBlZ2xDcmVhdGVXaW5kb3dTdXJmYWNlKGVnbERpc3BsYXksIG15Q29uZmlnLAorICAgICAgICAgICAgd2luZG93LCAwKSkgPT0gRUdMX05PX1NVUkZBQ0UgKQorICAgIHsKKyAgICAgICAgcHJpbnRmKCJlZ2xDcmVhdGVXaW5kb3dTdXJmYWNlIGZhaWxlZFxuIik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIGlmICggKGVnbENvbnRleHQgPSBlZ2xDcmVhdGVDb250ZXh0KGVnbERpc3BsYXksIG15Q29uZmlnLCAwLCAwKSkgPT0gRUdMX05PX0NPTlRFWFQgKQorICAgIHsKKyAgICAgICAgcHJpbnRmKCJlZ2xDcmVhdGVDb250ZXh0IGZhaWxlZFxuIik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIGlmICggZWdsTWFrZUN1cnJlbnQoZWdsRGlzcGxheSwgZWdsU3VyZmFjZSwgZWdsU3VyZmFjZSwgZWdsQ29udGV4dCkgIT0gRUdMX1RSVUUgKQorICAgIHsKKyAgICAgICAgcHJpbnRmKCJlZ2xNYWtlQ3VycmVudCBmYWlsZWRcbiIpOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyNpZiBFR0xfQU5EUk9JRF9zd2FwX3JlY3RhbmdsZQorICAgIGVnbFNldFN3YXBSZWN0YW5nbGVBTkRST0lEKGVnbERpc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jVmLCAyLjBmLCAyLjVmLCAzLjBmLCAzLjVmLCA0LjBmLCA1LjBmCisgICAgfTsKKyAgICByZXR1cm4gYmFzZSAqIGtUYWJsZVtmYWN0b3JdOworfQorCitjbGFzcyBUaW1lciB7CisgICAgc3RydWN0IHRpbWV2YWwgIGZpcnN0OworICAgIGRvdWJsZSBlbGFwc2VkU2Vjb25kczsKKworcHVibGljOgorICAgIFRpbWVyKCkge30KKyAgICB2b2lkIHN0YXJ0KCkgeworICAgICAgICBnZXR0aW1lb2ZkYXkoJmZpcnN0LCBOVUxMKTsKKyAgICB9CisKKyAgICB2b2lkIHN0b3AoKSB7CisgICAgICAgIHN0cnVjdCB0aW1ldmFsICBzZWNvbmQsCisgICAgICAgICAgICAgICAgICAgICAgICBlbGFwc2VkOworICAgICAgICBnZXR0aW1lb2ZkYXkoJnNlY29uZCwgTlVMTCk7CisKKyAgICAgICAgaWYgKGZpcnN0LnR2X3VzZWMgPiBzZWNvbmQudHZfdXNlYykgeworICAgICAgICAgICBzZWNvbmQudHZfdXNlYyArPSAxMDAwMDAwOworICAgICAgICAgICBzZWNvbmQudHZfc2VjLS07CisgICAgICAgIH0KKworICAgICAgICBlbGFwc2VkU2Vjb25kcyA9IChzZWNvbmQudHZfc2VjICAtIGZpcnN0LnR2X3NlYykgKworICAgICAgICAgICAgKHNlY29uZC50dl91c2VjIC0gZmlyc3QudHZfdXNlYykgLyAxMDAwMDAwLjA7CisgICAgfQorCisgICAgZG91YmxlIGdldEVsYXBzZWRTZWNvbmRzKCkgeworICAgICAgICByZXR1cm4gZWxhcHNlZFNlY29uZHM7CisgICAgfQorCisgICAgZG91YmxlIGdldEVsYXBzZWRNcygpIHsKKyAgICAgICAgcmV0dXJuIGVsYXBzZWRTZWNvbmRzKiAxMDAwLjBmOworICAgIH0KK307CisKK2ludCB0ZXN0VGltZSgpCit7CisgICAgc3RhdGljIGNvbnN0IGludCBXSURUSCA9IDMyMDsKKyAgICBzdGF0aWMgY29uc3QgaW50IEh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AgICBnbERpc2FibGUoR0xfQ1VMTF9GQUNFKTsKKworICAgIGZvcihpbnQgZnJhbWUgPSAwOyBmcmFtZSA8IDI7IGZyYW1lKyspIHsKKyAgICAgICAgTE9HRCgiZnJhbWUgPSAlZCIsIGZyYW1lKTsKKyAgICAgICAgZ2xDbGVhcihHTF9ERVBUSF9CVUZGRVJfQklUIHwgR0xfQ09MT1JfQlVGRkVSX0JJVCk7CisgICAgICAgIGludCBiYXNlWCA9IDEwOworICAgICAgICBmb3IgKGludCB4ID0gMDsgeCA8IFNDQUxFX0NPVU5UOyB4KyspIHsKKyAgICAgICAgICAgIGludCBiYXNlWSA9IDEwOworICAgICAgICAgICAgaW50IHdpZHRoID0gc2NhbGUoV0lEVEgsIHgpOworICAgICAgICAgICAgZm9yIChpbnQgeSA9IDA7IHkgPCBTQ0FMRV9DT1VOVDsgeSsrKSB7CisgICAgICAgICAgICAgICAgaW50IGhlaWdodCA9IHNjYWxlKEhFSUdIVCwgeSk7CisKKyAgICAgICAgICAgICAgICAvLyBDb2RlIGNvcGllZCBmcm9tIFN1cmZhY2VGbGluZ2VyIExheWVyQmFzZS5jcHAKKworICAgICAgICAgICAgICAgIGNvbnN0IEdMZml4ZWQgdGV4Q29vcmRzWzRdWzJdID0geworICAgICAgICAgICAgICAgICAgICAgICAgeyAwLCAgICAgICAgMCB9LAorICAgICAgICAgICAgICAgICAgICAgICAgeyAwLCAgICAgICAgMHgxMDAwMCB9LAorICAgICAgICAgICAgICAgICAgICAgICAgeyAweDEwMDAwLCAgMHgxMDAwMCB9LAorICAgICAgICAgICAgICAgICAgICAgICAgeyAweDEwMDAwLCAgMCB9CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIEdMZml4ZWQgZnggPSBiYXNlWCA8PCAxNjsKKyAgICAgICAgICAgICAgICBHTGZpeGVkIGZ5ID0gYmFzZVkgPDwgMTY7CisgICAgICAgICAgICAgICAgR0xmaXhlZCBmdyA9IHdpZHRoIDw8IDE2OworICAgICAgICAgICAgICAgIEdMZml4ZWQgZmggPSBoZWlnaHQgPDwgMTY7CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFZlcnRleCBwYXR0ZXJuOgorICAgICAgICAgICAgICAgICAqICAgICgyKS0tKDMpCisgICAgICAgICAgICAgICAgICogICAgIHxcICAgfAorICAgICAgICAgICAgICAgICAqICAgICB8IFwgIHwKKyAgICAgICAgICAgICAgICAgKiAgICAgfCAgXCB8CisgICAgICAgICAgICAgICAgICogICAgIHwgICBcfAorICAgICAgICAgICAgICAgICAqICAgICgxKS0tKDApCisgICAgICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgICAgIGNvbnN0IEdMZml4ZWQgdmVydGljZXNbNF1bMl0gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICB7ZnggKyBmdywgZnl9LAorICAgICAgICAgICAgICAgICAgICAgICAge2Z4LCAgICAgIGZ5fSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHtmeCwgICAgICBmeSArIGZofSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHtmeCArIGZ3LCBmeSArIGZofQorICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBzdGF0aWMgY29uc3QgYm9vbCByb3RhdGU5MCA9IHRydWU7CisKKyAgICAgICAgICAgICAgICBnbE1hdHJpeE1vZGUoR0xfVEVYVFVSRSk7CisgICAgICAgICAgICAgICAgZ2xMb2FkSWRlbnRpdHkoKTsKKworICAgICAgICAgICAgICAgIGdsRW5hYmxlQ2xpZW50U3RhdGUoR0xfVkVSVEVYX0FSUkFZKTsKKyAgICAgICAgICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX1RFWFRVUkVfQ09PUkRfQVJSQVkpOworICAgICAgICAgICAgICAgIGdsVmVydGV4UG9pbnRlcigyLCBHTF9GSVhFRCwgMCwgdmVydGljZXMpOworICAgICAgICAgICAgICAgIGdsVGV4Q29vcmRQb2ludGVyKDIsIEdMX0ZJWEVELCAwLCB0ZXhDb29yZHMpOworCisgICAgICAgICAgICAgICAgTE9HRCgidGVzdFJvdDkwICVkLCAlZCAlZCwgJWQiLCBiYXNlWCwgYmFzZVksIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICAgIGdsRHJhd0FycmF5cyhHTF9UUklBTkdMRV9GQU4sIDAsIDQpOworCisgICAgICAgICAgICAgICAgYmFzZVkgKz0gaGVpZ2h0ICsgMTA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBiYXNlWCArPSB3aWR0aCArIDEwOworICAgICAgICB9CisKKyAgICAgICAgZWdsU3dhcEJ1ZmZlcnMoZWdsRGlzcGxheSwgZWdsU3VyZmFjZSk7CisgICAgfQorICAgIHJldHVybiAwOworfQorCitpbnQgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisKKyAgICBpbnQgcTsKKyAgICBpbnQgc3RhcnQsIGVuZDsKKworICAgIGlmIChpbml0X2dyYWxsb2MoKSkgeworICAgICAgICBwcmludGYoImdyYWxsb2MgaW5pdGlhbGl6YXRpb24gZmFpbGVkIC0gZXhpdGluZ1xuIik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHByaW50ZigiSW5pdGlhbGl6aW5nIEVHTC4uLlxuIik7CisKKyAgICBpZighaW5pdF9nbF9zdXJmYWNlKCkpCisgICAgeworICAgICAgICBwcmludGYoIkdMIGluaXRpYWxpc2F0aW9uIGZhaWxlZCAtIGV4aXRpbmdcbiIpOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBpbml0X3NjZW5lKCk7CisKKyAgICBwcmludGYoIlN0YXJ0IHRlc3QuLi5cbiIpOworICAgIC8vIHRlc3RUaW1lKCk7CisgICAgIHRlc3RTdHJldGNoKCk7CisgICAgLy90ZXN0Um90OTAoKTsKKyAgICBmcmVlX2dsX3N1cmZhY2UoKTsKKworICAgIHJldHVybiAwOworfQpkaWZmIC0tZ2l0IGE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cioqIGFyZ3YpCit7CisgICAgRUdMaW50IGNvbmZpZ0F0dHJpYnNbXSA9IHsKKyAgICAgICAgIEVHTF9ERVBUSF9TSVpFLCAwLAorICAgICAgICAgRUdMX05PTkUKKyAgICAgfTsKKyAgICAgCisgICAgIEVHTGludCBtYWpvclZlcnNpb247CisgICAgIEVHTGludCBtaW5vclZlcnNpb247CisgICAgIEVHTENvbnRleHQgY29udGV4dDsKKyAgICAgRUdMQ29uZmlnIGNvbmZpZzsKKyAgICAgRUdMU3VyZmFjZSBzdXJmYWNlOworICAgICBFR0xpbnQgdywgaDsKKyAgICAgRUdMRGlzcGxheSBkcHk7CisKKyAgICAgRUdMTmF0aXZlV2luZG93VHlwZSB3aW5kb3cgPSBhbmRyb2lkX2NyZWF0ZURpc3BsYXlTdXJmYWNlKCk7CisgICAgIAorICAgICBkcHkgPSBlZ2xHZXREaXNwbGF5KEVHTF9ERUZBVUxUX0RJU1BMQVkpOworICAgICBlZ2xJbml0aWFsaXplKGRweSwgJm1ham9yVmVyc2lvbiwgJm1pbm9yVmVyc2lvbik7CisgICAgICAgICAgCisgICAgIHN0YXR1c190IGVyciA9IEVHTFV0aWxzOjpzZWxlY3RDb25maWdGb3JOYXRpdmVXaW5kb3coCisgICAgICAgICAgICAgZHB5LCBjb25maWdBdHRyaWJzLCB3aW5kb3csICZjb25maWcpOworICAgICBpZiAoZXJyKSB7CisgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkbid0IGZpbmQgYW4gRUdMQ29uZmlnIG1hdGNoaW5nIHRoZSBzY3JlZW4gZm9ybWF0XG4iKTsKKyAgICAgICAgIHJldHVybiAwOworICAgICB9CisKKyAgICAgc3VyZmFjZSA9IGVnbENyZWF0ZVdpbmRvd1N1cmZhY2UoZHB5LCBjb25maWcsIHdpbmRvdywgTlVMTCk7CisgICAgIGNvbnRleHQgPSBlZ2xDcmVhdGVDb250ZXh0KGRweSwgY29uZmlnLCBOVUxMLCBOVUxMKTsKKyAgICAgZW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AgIGZvciAoaW50IHk9MCA7IHk8NTEyIDsgeSsrKSB7CisgICAgICAgICBmb3IgKGludCB4PTAgOyB4PDUxMiA7IHgrKykgeworICAgICAgICAgICAgIGludCB1ID0geC0yNTY7CisgICAgICAgICAgICAgaW50IHYgPSB5LTI1NjsKKyAgICAgICAgICAgICBpZiAodSp1K3YqdiA8IDI1NioyNTYpIHsKKyAgICAgICAgICAgICAgICAgdDMyW3greSo1MTJdID0gMHgxMEZGRkZGRjsKKyAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICB0MzJbeCt5KjUxMl0gPSAweDIwRkYwMDAwOworICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAgICAgfQorCisgICAgIGNvbnN0IEdMZmxvYXQgdmVydGljZXNbNF1bMl0gPSB7CisgICAgICAgICAgICAgeyAwLCAgMCB9LAorICAgICAgICAgICAgIHsgMCwgIGggfSwKKyAgICAgICAgICAgICB7IHcsICBoIH0sCisgICAgICAgICAgICAgeyB3LCAgMCB9CisgICAgIH07CisKKyAgICAgY29uc3QgR0xmbG9hdCB0ZXhDb29yZHNbNF1bMl0gPSB7CisgICAgICAgICAgICAgeyAwLCAgMCB9LAorICAgICAgICAgICAgIHsgMCwgIDEgfSwKKyAgICAgICAgICAgICB7IDEsICAxIH0sCisgICAgICAgICAgICAgeyAxLCAgMCB9CisgICAgIH07CisKKyAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsIEdMX1JHQkEsIDUxMiwgNTEyLCAwLCBHTF9SR0JBLCBHTF9VTlNJR05FRF9CWVRFLCB0MzIpOworCisgICAgIGdsVmlld3BvcnQoMCwgMCwgdywgaCk7CisgICAgIGdsTWF0cml4TW9kZShHTF9QUk9KRUNUSU9OKTsKKyAgICAgZ2xMb2FkSWRlbnRpdHkoKTsKKyAgICAgZ2xPcnRob2YoMCwgdywgMCwgaCwgMCwgMSk7CisKKyAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9WRVJURVhfQVJSQVkpOworICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX1RFWFRVUkVfQ09PUkRfQVJSQVkpOworICAgICBnbFZlcnRleFBvaW50ZXIoMiwgR0xfRkxPQVQsIDAsIHZlcnRpY2VzKTsKKyAgICAgZ2xUZXhDb29yZFBvaW50ZXIoMiwgR0xfRkxPQVQsIDAsIHRleENvb3Jkcyk7CisKKyAgICAgZWdsU3dhcEludGVydmFsKGRweSwgMSk7CisKKyAgICAgZ2xDbGVhckNvbG9yKDEsMCwwLDApOworICAgICBnbENsZWFyKEdMX0NPTE9SX0JVRkZFUl9CSVQpOworICAgICBnbERyYXdBcnJheXMoR0xfVFJJQU5HTEVfRkFOLCAwLCA0KTsgCisgICAgIGVnbFN3YXBCdWZmZXJzKGRweSwgc3VyZmFjZSk7CisgICAgIAorCisgICAgIG5zZWNzX3QgdGltZXNbMzJdOworCisgICAgIGZvciAoaW50IGM9MSA7IGM8MzIgOyBjKyspIHsKKyAgICAgICAgIGdsQ2xlYXIoR0xfQ09MT1JfQlVGRkVSX0JJVCk7CisgICAgICAgICBmb3IgKGludCBpPTAgOyBpPGMgOyBpKyspIHsKKyAgICAgICAgICAgICBnbERyYXdBcnJheXMoR0xfVFJJQU5HTEVfRkFOLCAwLCA0KTsgCisgICAgICAgICB9CisgICAgICAgICBlZ2xTd2FwQnVmZmVycyhkcHksIHN1cmZhY2UpOworICAgICB9CisKKworICAgICAvLyAgICAgZm9yIChpbnQgYz0zMSA7IGM+PTEgOyBjLS0pIHsKKyAgICAgaW50IGo9MDsKKyAgICAgZm9yIChpbnQgYz0xIDsgYzwzMiA7IGMrKykgeworICAgICAgICAgZ2xDbGVhcihHTF9DT0xPUl9CVUZGRVJfQklUKTsKKyAgICAgICAgIG5zZWNzX3Qgbm93ID0gc3lzdGVtVGltZSgpOworICAgICAgICAgZm9yIChpbnQgaT0wIDsgaTxjIDsgaSsrKSB7CisgICAgICAgICAgICAgZ2xEcmF3QXJyYXlzK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zIDwwLTY+IFtwYnVmZmVyXVxuIiwgYXJndlswXSk7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICAKKyAgICBjb25zdCBpbnQgdGVzdCA9IGF0b2koYXJndlsxXSk7CisgICAgaW50IHVzZVBidWZmZXIgPSBhcmdjPT0zICYmICFzdHJjbXAoYXJndlsyXSwgInBidWZmZXIiKTsKKyAgICBFR0xpbnQgc19jb25maWdBdHRyaWJzW10gPSB7CisgICAgICAgICBFR0xfU1VSRkFDRV9UWVBFLCBFR0xfUEJVRkZFUl9CSVR8RUdMX1dJTkRPV19CSVQsCisgICAgICAgICBFR0xfUkVEX1NJWkUsICAgICAgIDUsCisgICAgICAgICBFR0xfR1JFRU5fU0laRSwgICAgIDYsCisgICAgICAgICBFR0xfQkxVRV9TSVpFLCAgICAgIDUsCisgICAgICAgICBFR0xfTk9ORQorICAgICB9OworICAgICAKKyAgICAgRUdMaW50IG51bUNvbmZpZ3MgPSAtMTsKKyAgICAgRUdMaW50IG1ham9yVmVyc2lvbjsKKyAgICAgRUdMaW50IG1pbm9yVmVyc2lvbjsKKyAgICAgRUdMQ29uZmlnIGNvbmZpZzsKKyAgICAgRUdMQ29udGV4dCBjb250ZXh0OworICAgICBFR0xTdXJmYWNlIHN1cmZhY2U7CisgICAgIEVHTGludCB3LCBoOworICAgICAKKyAgICAgRUdMRGlzcGxheSBkcHk7CisKKyAgICAgRUdMTmF0aXZlV2luZG93VHlwZSB3aW5kb3cgPSAwOworICAgICBpZiAoIXVzZVBidWZmZXIpIHsKKyAgICAgICAgIHdpbmRvdyA9IGFuZHJvaWRfY3JlYXRlRGlzcGxheVN1cmZhY2UoKTsKKyAgICAgfQorICAgICAKKyAgICAgZHB5ID0gZWdsR2V0RGlzcGxheShFR0xfREVGQVVMVF9ESVNQTEFZKTsKKyAgICAgZWdsSW5pdGlhbGl6ZShkcHksICZtYWpvclZlcnNpb24sICZtaW5vclZlcnNpb24pOworICAgICBpZiAoIXVzZVBidWZmZXIpIHsKKyAgICAgICAgIEVHTFV0aWxzOjpzZWxlY3RDb25maWdGb3JOYXRpdmVXaW5kb3coCisgICAgICAgICAgICAgICAgIGRweSwgc19jb25maWdBdHRyaWJzLCB3aW5kb3csICZjb25maWcpOworICAgICAgICAgc3VyZmFjZSA9IGVnbENyZWF0ZVdpbmRvd1N1cmZhY2UoZHB5LCBjb25maWcsIHdpbmRvdywgTlVMTCk7CisgICAgIH0gZWxzZSB7CisgICAgICAgICBwcmludGYoInVzaW5nIHBidWZmZXJcbiIpOworICAgICAgICAgZWdsQ2hvb3NlQ29uZmlnKGRweSwgc19jb25maWdBdHRyaWJzLCAmY29uZmlnLCAxLCAmbnVtQ29uZmlncyk7CisgICAgICAgICBFR0xpbnQgYXR0cmlic1tdID0geyBFR0xfV0lEVEgsIDMyMCwgRUdMX0hFSUdIVCwgNDgwLCBFR0xfTk9ORSB9OworICAgICAgICAgc3VyZmFjZSA9IGVnbENyZWF0ZVBidWZmZXJTdXJmYWNlKGRweSwgY29uZmlnLCBhdHRyaWJzKTsKKyAgICAgICAgIGlmIChzdXJmYWNlID09IEVHTF9OT19TVVJGQUNFKSB7CisgICAgICAgICAgICAgcHJpbnRmKCJlZ2xDcmVhdGVQYnVmZmVyU3VyZmFjZSBlcnJvciAleFxuIiwgZWdsR2V0RXJyb3IoKSk7CisgICAgICAgICB9CisgICAgIH0KKyAgICAgY29udGV4dCA9IGVnbENyZWF0ZUNvbnRleHQoZHB5LCBjb25maWcsIE5VTEwsIE5VTEwpOworICAgICBlZ2xNYWtlQ3VycmVudChkcHksIHN1cmZhY2UsIHN1cmZhY2UsIGNvbnRleHQpOyAgIAorICAgICBlZ2xRdWVyeVN1cmZhY2UoZHB5LCBzdXJmYWNlLCBFR0xfV0lEVEgsICZ3KTsKKyAgICAgZWdsUXVlcnlTdXJmYWNlKGRweSwgc3VyZmFjZSwgRUdMX0hFSUdIVCwgJmgpOworICAgICBHTGludCBkaW0gPSB3PGggPyB3IDogaDsKKworICAgICBnbFZpZXdwb3J0KDAsIDAsIHcsIGgpOworICAgICBnbE1hdHJpeE1vZGUoR0xfUFJPSkVDVElPTik7CisgICAgIGdsTG9hZElkZW50aXR5KCk7CisgICAgIGdsT3J0aG9mKDAsIHcsIDAsIGgsIDAsIDEpOworCisgICAgIGdsQ2xlYXJDb2xvcigwLDAsMCwwKTsKKyAgICAgZ2xDbGVhcihHTF9DT0xPUl9CVUZGRVJfQklUKTsKKworICAgICBHTGludCBjcm9wWzRdID0geyAwLCA0LCA0LCAtNCB9OworICAgICBnbEJpbmRUZXh0dXJlKEdMX1RFWFRVUkVfMkQsIDApOworICAgICBnbFRleFBhcmFtZXRlcml2KEdMX1RFWFRVUkVfMkQsIEdMX1RFWFRVUkVfQ1JPUF9SRUNUX09FUywgY3JvcCk7CisgICAgIGdsVGV4UGFyYW1ldGVyeChHTF9URVhUVVJFXzJELCBHTF9URVhUVVJFX01BR19GSUxURVIsIEdMX0xJTkVBUik7CisgICAgIGdsVGV4UGFyYW1ldGVyeChHTF9URVhUVVJFXzJELCBHTF9URVhUVVJFX01JTl9GSUxURVIsIEdMX0xJTkVBUik7CisgICAgIGdsVGV4RW52eChHTF9URVhUVVJFX0VOViwgR0xfVEVYVFVSRV9FTlZfTU9ERSwgR0xfUkVQTEFDRSk7CisgICAgIGdsRW5hYmxlKEdMX1RFWFRVUkVfMkQpOworICAgICBnbENvbG9yNGYoMSwxLDEsMSk7CisKKyAgICAgLy8gcGFja2luZyBpcyBhbHdheXMgNAorICAgICB1aW50OF90IHQ4W10gID0geyAKKyAgICAgICAgICAgICAweDAwLCAweDU1LCAweDAwLCAweDU1LCAKKyAgICAgICAgICAgICAweEFBLCAweEZGLCAweEFBLCAweEZGLAorICAgICAgICAgICAgIDB4MDAsIDB4NTUsIDB4MDAsIDB4NTUsIAorICAgICAgICAgICAgIDB4QUEsIDB4RkYsIDB4QUEsIDB4RkYgIH07CisKKyAgICAgdWludDE2X3QgdDE2W10gID0geyAKKyAgICAgICAgICAgICAweDAwMDAsIDB4NTU1NSwgMHgwMDAwLCAweDU1NTUsIAorICAgICAgICAgICAgIDB4QUFBQSwgMHhGRkZGLCAweEFBQUEsIDB4RkZGRiwKKyAgICAgICAgICAgICAweDAwMDAsIDB4NTU1NSwgMHgwMDAwLCAweDU1NTUsIAorICAgICAgICAgICAgIDB4QUFBQSwgMHhGRkZGLCAweEFBQUEsIDB4RkZGRiAgfTsKKworICAgICB1aW50MTZfdCB0NTU1MVtdICA9IHsgCisgICAgICAgICAgICAgMHgwMDAwLCAweEZGRkYsIDB4MDAwMCwgMHhGRkZGLCAKKyAgICAgICAgICAgICAweEZGRkYsIDB4MDAwMCwgMHhGRkZGLCAweDAwMDAsCisgICAgICAgICAgICAgMHgwMDAwLCAweEZGRkYsIDB4MDAwMCwgMHhGRkZGLCAKKyAgICAgICAgICAgICAweEZGRkYsIDB4MDAwMCwgMHhGRkZGLCAweDAwMDAgIH07CisKKyAgICAgdWludDMyX3QgdDMyW10gID0geyAKKyAgICAgICAgICAgICAweEZGMDAwMDAwLCAweEZGMDAwMEZGLCAweEZGMDBGRjAwLCAweEZGRkYwMDAwLCAKKyAgICAgICAgICAgICAweEZGMDBGRjAwLCAweEZGRkYwMDAwLCAweEZGMDAwMDAwLCAweEZGMDAwMEZGLCAKKyAgICAgICAgICAgICAweEZGMDBGRkZGLCAweEZGMDBGRjAwLCAweDAwRkYwMEZGLCAweEZGRkZGRjAwLCAKKyAgICAgICAgICAgICAweEZGMDAwMDAwLCAweEZGRkYwMEZGLCAweEZGMDBGRkZGLCAweEZGRkZGRkZGCisgICAgIH07CisKKyAgICAgc3dpdGNoKHRlc3QpIAorICAgICB7CisgICAgIGNhc2UgMToKKyAgICAgICAgIGdsVGV4SW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLCBHTF9MVU1JTkFOQ0UsCisgICAgICAgICAgICAgICAgIDQsIDQsIDAsIEdMX0xVTUlOQU5DRSwgR0xfVU5TSUdORURfQllURSwgdDgpOworICAgICAgICAgYnJlYWs7CisgICAgIGNhc2UgMjoKKyAgICAgICAgIGdsVGV4SW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLCBHTF9SR0IsCisgICAgICAgICAgICAgICAgIDQsIDQsIDAsIEdMX1JHQiwgR0xfVU5TSUdORURfU0hPUlRfNV82XzUsIHQxNik7CisgICAgICAgICBicmVhazsKKyAgICAgY2FzZSAzOgorICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsIEdMX1JHQkEsCisgICAgICAgICAgICAgICAgIDQsIDQsIDAsIEdMX1JHQkEsIEdMX1VOU0lHTkVEX1NIT1JUXzRfNF80XzQsIHQxNik7CisgICAgICAgICBicmVhazsKKyAgICAgY2FzZSA0OgorICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsIEdMX0xVTUlOQU5DRV9BTFBIQSwKKyAgICAgICAgICAgICAgICAgNCwgNCwgMCwgR0xfTFVNSU5BTkNFX0FMUEhBLCBHTF9VTlNJR05FRF9CWVRFLCB0MTYpOworICAgICAgICAgYnJlYWs7CisgICAgIGNhc2UgNToKKyAgICAgICAgIGdsVGV4SW1hZ2UyRChHTF9URVhUVVJFXzJELCAwLCBHTF9SR0JBLAorICAgICAgICAgICAgICAgICA0LCA0LCAwLCBHTF9SR0JBLCBHTF9VTlNJR05FRF9TSE9SVF81XzVfNV8xLCB0NTU1MSk7CisgICAgICAgICBicmVhazsKKyAgICAgY2FzZSA2OgorICAgICAgICAgZ2xUZXhJbWFnZTJEKEdMX1RFWFRVUkVfMkQsIDAsIEdMX1JHQkEsCisgICAgICAgICAgICAgICAgIDQsIDQsIDAsIEdMX1JHQkEsIEdMX1VOU0lHTkVEX0JZVEUsIHQzMik7CisgICAgICAgICBicmVhazsKKyAgICAgfQorCisgICAgIC8vZ2xEcmF3VGV4aU9FUygwLCAwLCAwLCBkaW0sIGRpbSk7CisgICAgIAorICAgICBjb25zdCBHTGZsb2F0IHZlcnRpY2VzWzRdWzJdID0geworICAgICAgICAgICAgIHsgMCwgICAgMCAgIH0sCisgICAgICAgICAgICAgeyAwLCAgICBkaW0gfSwKKyAgICAgICAgICAgICB7IGRpbSwgIGRpbSB9LAorICAgICAgICAgICAgIHsgZGltLCAgMCAgIH0KKyAgICAgfTsKKworICAgICBjb25zdCBHTGZsb2F0IHRleENvb3Jkc1s0XVsyXSA9IHsKKyAgICAgICAgICAgICB7IDAsICAwIH0sCisgICAgICAgICAgICAgeyAwLCAgMSB9LAorICAgICAgICAgICAgIHsgMSwgIDEgfSwKKyAgICAgICAgICAgICB7IDEsICAwIH0KKyAgICAgfTsKKyAgICAgCisgICAgIGlmICghdXNlUGJ1ZmZlcikgeworICAgICAgICAgZWdsU3dhcEJ1ZmZlcnMoZHB5LCBzdXJmYWNlKTsKKyAgICAgfQorICAgICAKKyAgICAgZ2xNYXRyaXhNb2RlKEdMX01PREVMVklFVyk7CisgICAgIGdsU2Npc3NvcigwLGRpbSxkaW0saC1kaW0pOworICAgICBnbERpc2FibGUoR0xfU0NJU1NPUl9URVNUKTsKKyAgICAgCisgICAgIGZvciAoaW50IHk9MCA7IHk8ZGltIDsgeSsrKSB7CisgICAgICAgICAvL2dsRGlzYWJsZShHTF9TQ0lTU09SX1RFU1QpOworICAgICAgICAgZ2xDbGVhcihHTF9DT0xPUl9CVUZGRVJfQklUKTsKKworICAgICAgICAgLy9nbEVuYWJsZShHTF9TQ0lTU09SX1RFU1QpOworCisjaWYgVVNFX0RSQVdfVEVYVFVSRSAmJiBHTF9PRVNfZHJhd190ZXh0dXJlCisgICAgICAgICBnbERyYXdUZXhpT0VTKDAsIHksIDEsIGRpbSwgZGltKTsKKyNlbHNlCisgICAgICAgICBnbExvYWRJZGVudGl0eSgpOworICAgICAgICAgZ2xUcmFuc2xhdGVmKDAsIHksIDApOworICAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9WRVJURVhfQVJSQVkpOworICAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZSh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spIHsKKyAgICAgICAgIG5vdyA9IHN5c3RlbVRpbWUoKTsKKyAgICAgICAgIG1lbWNweShkc3QsIHRleGVscywgMzIwKjQ4MCoyKTsKKyAgICAgICAgIHQgPSBzeXN0ZW1UaW1lKCk7CisgICAgICAgICBwcmludGYoIm1lbWNweSgpIHRpbWUgPSAlbGx1IHVzXG4iLCAodC1ub3cpLzEwMDApOworICAgICAgICAgZmZsdXNoKHN0ZG91dCk7CisgICAgIH0KKyAgICAgZnJlZShkc3QpOworCisgICAgIGZyZWUodGV4ZWxzKTsKKworICAgICBzZXRwcmlvcml0eShQUklPX1BST0NFU1MsIDAsIC0yMCk7CisgICAgIAorICAgICBwcmludGYoIjUxMng1MTIgdW5tb2RpZmllZCB0ZXh0dXJlLCA1MTJ4NTEyIGJsaXQ6XG4iKTsKKyAgICAgZ2xDbGVhcihHTF9DT0xPUl9CVUZGRVJfQklUKTsKKyAgICAgZm9yIChpPTAgOyBpPDQgOyBpKyspIHsKKyAgICAgICAgIEdMaW50IGNyb3BbNF0gPSB7IDAsIDUxMiwgNTEyLCAtNTEyIH07CisgICAgICAgICBnbFRleFBhcmFtZXRlcml2KEdMX1RFWFRVUkVfMkQsIEdMX1RFWFRVUkVfQ1JPUF9SRUNUX09FUywgY3JvcCk7CisgICAgICAgICBub3cgPSBzeXN0ZW1UaW1lKCk7CisgICAgICAgICBnbERyYXdUZXhpT0VTKDAsIDAsIDAsIDUxMiwgNTEyKTsKKyAgICAgICAgIGdsRmluaXNoKCk7CisgICAgICAgICB0ID0gc3lzdGVtVGltZSgpOworICAgICAgICAgcHJpbnRmKCJnbEZpbmlzaCgpIHRpbWUgPSAlbGx1IHVzXG4iLCAodC1ub3cpLzEwMDApOworICAgICAgICAgZmZsdXNoKHN0ZG91dCk7CisgICAgICAgICBlZ2xTd2FwQnVmZmVycyhkcHksIHN1cmZhY2UpOworICAgICB9CisgICAgIAorICAgICBwcmludGYoIjUxMng1MTIgdW5tb2RpZmllZCB0ZXh0dXJlLC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0IGNoYXIgKilnbEdldFN0cmluZyhzKTsKKyAgICAgaWYgKHYpCisgICAgICAgICBwcmludGYoIkdMICVzID0gJXNcbiIsIG5hbWUsIHYpOworICAgICBlbHNlCisgICAgICAgICBwcmludGYoIkdMICVzID0gKG51bGwpXG4iLCBuYW1lKTsKK30KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIqKiBhcmd2KQoreworICAgIEVHTGludCBzX2NvbmZpZ0F0dHJpYnNbXSA9IHsKKyAgICAgICAgIEVHTF9TVVJGQUNFX1RZUEUsIEVHTF9XSU5ET1dfQklULAorICAgICAgICAgRUdMX1JFRF9TSVpFLCAgICAgICA1LAorICAgICAgICAgRUdMX0dSRUVOX1NJWkUsICAgICA2LAorICAgICAgICAgRUdMX0JMVUVfU0laRSwgICAgICA1LAorICAgICAgICAgRUdMX05PTkUKKyAgICAgfTsKKworICAgICBFR0xpbnQgbnVtQ29uZmlncyA9IC0xOworICAgICBFR0xpbnQgbWFqb3JWZXJzaW9uOworICAgICBFR0xpbnQgbWlub3JWZXJzaW9uOworICAgICBFR0xDb25maWcgY29uZmlnOworICAgICBFR0xDb250ZXh0IGNvbnRleHQ7CisgICAgIEVHTFN1cmZhY2Ugc3VyZmFjZTsKKyAgICAgRUdMaW50IHcsIGg7CisKKyAgICAgRUdMRGlzcGxheSBkcHk7CisKKyAgICAgRUdMTmF0aXZlV2luZG93VHlwZSB3aW5kb3cgPSAwOworICAgICB3aW5kb3cgPSBhbmRyb2lkX2NyZWF0ZURpc3BsYXlTdXJmYWNlKCk7CisKKyAgICAgZHB5ID0gZWdsR2V0RGlzcGxheShFR0xfREVGQVVMVF9ESVNQTEFZKTsKKyAgICAgZWdsSW5pdGlhbGl6ZShkcHksICZtYWpvclZlcnNpb24sICZtaW5vclZlcnNpb24pOworICAgICBFR0xVdGlsczo6c2VsZWN0Q29uZmlnRm9yTmF0aXZlV2luZG93KGRweSwgc19jb25maWdBdHRyaWJzLCB3aW5kb3csICZjb25maWcpOworICAgICB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ZmlnOworICAgIEVHTGludCBudW1Db25maWdzPTA7CisgICAgRUdMU3VyZmFjZSBzdXJmYWNlOworICAgIEVHTGludCB3LCBoOworICAgIEVHTERpc3BsYXkgZHB5OworCisgICAgCisgICAgRUdMTmF0aXZlV2luZG93VHlwZSB3aW5kb3cgPSBhbmRyb2lkX2NyZWF0ZURpc3BsYXlTdXJmYWNlKCk7CisKKyAgICBkcHkgPSBlZ2xHZXREaXNwbGF5KEVHTF9ERUZBVUxUX0RJU1BMQVkpOworICAgIGVnbEluaXRpYWxpemUoZHB5LCAwICwwKSA7Ly8mbWFqb3JWZXJzaW9uLCAmbWlub3JWZXJzaW9uKTsKKyAgICBlZ2xHZXRDb25maWdzKGRweSwgTlVMTCwgMCwgJm51bUNvbmZpZ3MpOworICAgIHByaW50ZigiIyBjb25maWdzID0gJWRcbiIsIG51bUNvbmZpZ3MpOworCisgICAgc3RhdHVzX3QgZXJyID0gRUdMVXRpbHM6OnNlbGVjdENvbmZpZ0Zvck5hdGl2ZVdpbmRvdygKKyAgICAgICAgICAgIGRweSwgY29uZmlnQXR0cmlicywgd2luZG93LCAmY29uZmlnKTsKKyAgICBpZiAoZXJyKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiY291bGRuJ3QgZmluZCBhbiBFR0xDb25maWcgbWF0Y2hpbmcgdGhlIHNjcmVlbiBmb3JtYXRcbiIpOworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBFR0xpbnQgcixnLGIsYTsKKyAgICBlZ2xHZXRDb25maWdBdHRyaWIoZHB5LCBjb25maWcsIEVHTF9SRURfU0laRSwgICAmcik7CisgICAgZWdsR2V0Q29uZmlnQXR0cmliKGRweSwgY29uZmlnLCBFR0xfR1JFRU5fU0laRSwgJmcpOworICAgIGVnbEdldENvbmZpZ0F0dHJpYihkcHksIGNvbmZpZywgRUdMX0JMVUVfU0laRSwgICZiKTsKKyAgICBlZ2xHZXRDb25maWdBdHRyaWIoZHB5LCBjb25maWcsIEV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gICAgIEVHTENvbmZpZyBjb25maWc7CisgICAgIEVHTFN1cmZhY2Ugc3VyZmFjZTsKKyAgICAgRUdMaW50IHcsIGg7CisgICAgIEVHTERpc3BsYXkgZHB5OworCisgICAgIEVHTE5hdGl2ZVdpbmRvd1R5cGUgd2luZG93ID0gYW5kcm9pZF9jcmVhdGVEaXNwbGF5U3VyZmFjZSgpOworICAgICAKKyAgICAgZHB5ID0gZWdsR2V0RGlzcGxheShFR0xfREVGQVVMVF9ESVNQTEFZKTsKKyAgICAgZWdsSW5pdGlhbGl6ZShkcHksICZtYWpvclZlcnNpb24sICZtaW5vclZlcnNpb24pOworICAgICAgICAgIAorICAgICBzdGF0dXNfdCBlcnIgPSBFR0xVdGlsczo6c2VsZWN0Q29uZmlnRm9yTmF0aXZlV2luZG93KAorICAgICAgICAgICAgIGRweSwgY29uZmlnQXR0cmlicywgd2luZG93LCAmY29uZmlnKTsKKyAgICAgaWYgKGVycikgeworICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZG4ndCBmaW5kIGFuIEVHTENvbmZpZyBtYXRjaGluZyB0aGUgc2NyZWVuIGZvcm1hdFxuIik7CisgICAgICAgICByZXR1cm4gMDsKKyAgICAgfQorCisgICAgIHN1cmZhY2UgPSBlZ2xDcmVhdGVXaW5kb3dTdXJmYWNlKGRweSwgY29uZmlnLCB3aW5kb3csIE5VTEwpOworICAgICBjb250ZXh0ID0gZWdsQ3JlYXRlQ29udGV4dChkcHksIGNvbmZpZywgTlVMTCwgTlVMTCk7CisgICAgIGVnbE1ha2VDdXJyZW50KGRweSwgc3VyZmFjZSwgc3VyZmFjZSwgY29udGV4dCk7ICAgCisgICAgIGVnbFF1ZXJ5U3VyZmFjZShkcHksIHN1cmZhY2UsIEVHTF9XSURUSCwgJncpOworICAgICBlZ2xRdWVyeVN1cmZhY2UoZHB5LCBzdXJmYWNlLCBFR0xfSEVJR0hULCAmaCk7CisgICAgIEdMaW50IGRpbSA9IHc8aCA/IHcgOiBoOworC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dHlwZSB0byB0aGUgbGlzdCBvZgorICAgICAgICAgICAgLy8gdHlwZXMgYWZmZWN0ZWQgYnkgcmluZ2VyIG1vZGVzIChzaWxlbnQsIHZpYnJhdGUsIGV0Yy4pCisgICAgICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGRiLmV4ZWNTUUwoIkRFTEVURSBGUk9NIHN5c3RlbSBXSEVSRSBuYW1lPSciCisgICAgICAgICAgICAgICAgICAgICAgICArIFNldHRpbmdzLlN5c3RlbS5NT0RFX1JJTkdFUl9TVFJFQU1TX0FGRkVDVEVEICsgIiciKTsKKyAgICAgICAgICAgICAgICBpbnQgbmV3VmFsdWUgPSAoMSA8PCBBdWRpb01hbmFnZXIuU1RSRUFNX1JJTkcpCisgICAgICAgICAgICAgICAgICAgICAgICB8ICgxIDw8IEF1ZGlvTWFuYWdlci5TVFJFQU1fTk9USUZJQ0FUSU9OKQorICAgICAgICAgICAgICAgICAgICAgICAgfCAoMSA8PCBBdWRpb01hbmFnZXIuU1RSRUFNX1NZU1RFTSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHwgKDEgPDwgQXVkaW9NYW5hZ2VyLlNUUkVBTV9TWVNURU1fRU5GT1JDRUQpOworICAgICAgICAgICAgICAgIGRiLmV4ZWNTUUwoIklOU0VSVCBJTlRPIHN5c3RlbSAoJ25hbWUnLCAndmFsdWUnKSB2YWx1ZXMgKCciCisgICAgICAgICAgICAgICAgICAgICAgICArIFNldHRpbmdzLlN5c3RlbS5NT0RFX1JJTkdFUl9TVFJFQU1TX0FGRkVDVEVEICsgIicsICciCisgICAgICAgICAgICAgICAgICAgICAgICArIFN0cmluZy52YWx1ZU9mKG5ld1ZhbHVlKSArICInKSIpOworICAgICAgICAgICAgICAgIGRiLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBkYi5lbmRUcmFuc2FjdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBncmFkZVZlcnNpb24gPSAzNzsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh1cGdyYWRlVmVyc2lvbiA9PSAzNykgeworICAgICAgICAgICAgZGIuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgc3RtdCA9IGRiLmNvbXBpbGVTdGF0ZW1lbnQoIklOU0VSVCBPUiBJR05PUkUgSU5UTyBzeXN0ZW0obmFtZSx2YWx1ZSkiCisgICAgICAgICAgICAgICAgICAgICAgICArICIgVkFMVUVTKD8sPyk7Iik7CisgICAgICAgICAgICAgICAgbG9hZFN0cmluZ1NldHRpbmcoc3RtdCwgU2V0dGluZ3MuU3lzdGVtLkFJUlBMQU5FX01PREVfVE9HR0xFQUJMRV9SQURJT1MsCisgICAgICAgICAgICAgICAgICAgICAgICBSLnN0cmluZy5haXJwbGFuZV9tb2RlX3RvZ2dsZWFibGVfcmFkaW9zKTsKKyAgICAgICAgICAgICAgICBzdG10LmNsb3NlKCk7CisgICAgICAgICAgICAgICAgZGIuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGRiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB1cGdyYWRlVmVyc2lvbiA9IDM4OworICAgICAgICB9CisKKyAgICAgICAgaWYgKHVwZ3JhZGVWZXJzaW9uID09IDM4KSB7CisgICAgICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9CisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRCb29sZWFuKFIuYm9vbC5hc3Npc3RlZF9ncHNfZW5hYmxlZCkgPyAiMSIgOiAiMCI7CisgICAgICAgICAgICAgICAgZGIuZXhlY1NRTCgiSU5TRVJUIE9SIElHTk9SRSBJTlRPIHNlY3VyZShuYW1lLHZhbHVlKSB2YWx1ZXMoJyIgKworICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkFTU0lTVEVEX0dQU19FTkFCTEVEICsgIicsJyIgKyB2YWx1ZSArICInKTsiKTsKKyAgICAgICAgICAgICAgICBkYi5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgZGIuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdXBncmFkZVZlcnNpb24gPSAzOTsKKyAgICAgICAgfQorCiAgICAgICAgIGlmICh1cGdyYWRlVmVyc2lvbiAhPSBjdXJyZW50VmVyc2lvbikgewogICAgICAgICAgICAgTG9nLncoVEFHLCAiR290IHN0dWNrIHRyeWluZyB0byB1cGdyYWRlIGZyb20gdmVyc2lvbiAiICsgdXBncmFkZVZlcnNpb24KICAgICAgICAgICAgICAgICAgICAgKyAiLCBtdXN0IHdpcGUgdGhlIHNldHRpbmdzIHByb3ZpZGVyIik7CkBAIC01NjAsNyArNjE3LDcgQEAKICAgICAgICAgLy8gQnkgZGVmYXVsdCwgb25seSB0aGUgcmluZy9ub3RpZmljYXRpb24gYW5kIHN5c3RlbSBzdHJlYW1zIGFyZSBhZmZlY3RlZAogICAgICAgICBsb2FkU2V0dGluZyhzdG10LCBTZXR0aW5ncy5TeXN0ZW0uTU9ERV9SSU5HRVJfU1RSRUFNU19BRkZFQ1RFRCwKICAgICAgICAgICAgICAgICAoMSA8PCBBdWRpb01hbmFnZXIuU1RSRUFNX1JJTkcpIHwgKDEgPDwgQXVkaW9NYW5hZ2VyLlNUUkVBTV9OT1RJRklDQVRJT04pIHw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oa2V5KSkgeworICAgICAgICAgICAgfSBlbHNlIGlmIChLRVlfV0lGSV9TVVBQTElDQU5ULmVxdWFscyhrZXkpKSB7CisgICAgICAgICAgICAgICAgaW50IHJldGFpbmVkV2lmaVN0YXRlID0gZW5hYmxlV2lmaShmYWxzZSk7CiAgICAgICAgICAgICAgICAgcmVzdG9yZUZpbGUoRklMRV9XSUZJX1NVUFBMSUNBTlQsIGRhdGEpOwogICAgICAgICAgICAgICAgIEZpbGVVdGlscy5zZXRQZXJtaXNzaW9ucyhGSUxFX1dJRklfU1VQUExJQ0FOVCwKICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGVVdGlscy5TX0lSVVNSIHwgRmlsZVV0aWxzLlNfSVdVU1IgfAogICAgICAgICAgICAgICAgICAgICAgICAgRmlsZVV0aWxzLlNfSVJHUlAgfCBGaWxlVXRpbHMuU19JV0dSUCwKICAgICAgICAgICAgICAgICAgICAgICAgIFByb2Nlc3MubXlVaWQoKSwgUHJvY2Vzcy5XSUZJX1VJRCk7CisgICAgICAgICAgICAgICAgLy8gcmV0YWluIHRoZSBwcmV2aW91cyBXSUZJIHN0YXRlLgorICAgICAgICAgICAgICAgIGVuYWJsZVdpZmkocmV0YWluZWRXaWZpU3RhdGUgPT0gV2lmaU1hbmFnZXIuV0lGSV9TVEFURV9FTkFCTEVEIHx8CisgICAgICAgICAgICAgICAgICAgICAgICByZXRhaW5lZFdpZmlTdGF0ZSA9PSBXaWZpTWFuYWdlci5XSUZJX1NUQVRFX0VOQUJMSU5HKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoS0VZX1NZTkMuZXF1YWxzKGtleSkpIHsKICAgICAgICAgICAgICAgICBtU2V0dGluZ3NIZWxwZXIuc2V0U3luY1Byb3ZpZGVycyhkYXRhKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoS0VZX0xPQ0FMRS5lcXVhbHMoa2V5KSkgewpAQCAtMjU3LDcgKzI2Niw3IEBACiAgICAgfQogCiAgICAgLyoqCi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IHN5bmNbMF0gPSAoYnl0ZSkgKG1Db250ZW50U2VydmljZS5nZXRMaXN0ZW5Gb3JOZXR3b3JrVGlja2xlcygpID8gMSA6IDApOwogICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBQUk9WSURFUlMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICBzeW5jW2kgKyAxXSA9IChieXRlKSAKLSAgICAgICAgICAgICAgICAgICAgICAgIChtQ29udGVudFNlcnZpY2UuZ2V0U3luY1Byb3ZpZGVyQXV0b21hdGljYWxseShQUk9WSURFUlNbaV0pID8gMSA6IDApOworICAgICAgICAgICAgICAgICAgICAgICAgKG1Db250ZW50U2VydmljZS5nZXRTeW5jQXV0b21hdGljYWxseShQUk9WSURFUlNbaV0pID8gMSA6IDApOwogICAgICAgICAgICAgfQogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gcmUpIHsKICAgICAgICAgICAgIExvZy53KFRBRywgIlVuYWJsZSB0byBiYWNrdXAgc3luYyBwcm92aWRlcnMiKTsKICAgICAgICAgICAgIHJldHVybiBzeW5jOwogICAgICAgICB9CisgICAgICAgICovCiAgICAgICAgIHJldHVybiBzeW5jOwogICAgIH0KIApAQCAtMTM2LDEyICsxMzksMTUgQEAKIAogICAgICAgICB0cnkgewogICAgICAgICAgICAgYmFja3VwLnJlYWRFbnRpdHlEYXRhKHN5bmMsIDAsIHN5bmMubGVuZ3RoKTsKKyAgICAgICAgICAgIC8vIFRPRE86IFN5bmMgYmFja3VwIG5lZWRzIHRvIGJlIG1vdmVkIHRvIFN5c3RlbUJhY2t1cEFnZW50CisgICAgICAgICAgICAvKgogICAgICAgICAgICAgbUNvbnRlbnRTZXJ2aWNlLnNldExpc3RlbkZvck5ldHdvcmtUaWNrbGVzKHN5bmNbMF0gPT0gMSk7CiAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IFBST1ZJREVSUy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAg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ICBpZiAoaXNEcm1BdXRob3JpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgRFJNIGFjY2VzcyBwZXJtaXNzaW9uIGhlcmUsIHNpbmNlIG9uY2Ugd2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkbyB0aGUgYmVsb3cgY2FsbCB0aGUgRFJNIHdpbGwgYmUgY2hlY2tpbmcgb3VyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGVybWlzc2lvbiwgbm90IG91ciBjYWxsZXIncyBwZXJtaXNzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRHJtU3RvcmUuZW5mb3JjZUFjY2Vzc0RybVBlcm1pc3Npb24oY29udGV4dCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChTZWN1cml0eUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZpbGVOb3RGb3VuZEV4Y2VwdGlvbihlLmdldE1lc3NhZ2UoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvciBwZmQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgcGZkID0gY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5vcGVuRmlsZURlc2NyaXB0b3Ioc291bmRVcmksIG1vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBBc3NldEZpbGVEZXNjcmlwdG9yKHBmZCwgMCwgLTEpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaCBhbmQgb3BlbiB0aGUgZmFsbGJhY2sgcmluZ3RvbmUgYmVsb3cKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdXBlci5vcGVuQXNzZXRGaWxlKHNvdW5kVXJpLCBtb2RlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2luY2UgYSBub24tbnVsbCBVcmkgd2FzIHNwZWNpZmllZCwgYnV0IGNvdWxkbid0IGJlIG9wZW5lZCwKKyAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCBiYWNrIHRvIHRoZSBidWlsdC1pbiByaW5ndG9uZS4KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRleHQuZ2V0UmVzb3VyY2VzKCkub3BlblJhd1Jlc291cmNlRmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5yYXcuZmFsbGJhY2tyaW5nKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBubyBuZWVkIHRvIGZhbGwgdGhyb3VnaCBhbmQgaGF2ZSBvcGVuRmlsZSgpIHRyeSBhZ2Fpbiwgc2luY2Ugd2UKKyAgICAgICAgICAgIC8vIGFscmVhZHkga25vdyB0aGF0IHdpbGwgZmFpbC4KKyAgICAgICAgICAgIHRocm93IG5ldyBGaWxlTm90Rm91bmRFeGNlcHRpb24oKTsgLy8gb3IgcmV0dXJuIG51bGwgPworICAgICAgICB9CisKKyAgICAgICAgLy8gTm90ZSB0aGF0IHRoaXMgd2lsbCBlbmQgdXAgY2FsbGluZyBvcGVuRmlsZSgpIGFib3ZlLgorICAgICAgICByZXR1cm4gc3VwZXIub3BlbkFzc2V0RmlsZS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FN0cmluZ0V4dHJhKCJhY2NvdW50Iik7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHRva2VuID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKCJtZXNzYWdlX3Rva2VuIik7CisgICAgICAgICAgICAgICAgU3RyaW5nIGFjY291bnROYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKCJhY2NvdW50Iik7CisgICAgICAgICAgICAgICAgU3RyaW5nIHRva2VuID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKEludGVudC5FWFRSQV9SRU1PVEVfSU5URU5UX1RPS0VOKTsKIAotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShhY2NvdW50KSB8fCBUZXh0VXRpbHMuaXNFbXB0eSh0b2tlbikpIHsKKyAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoYWNjb3VudE5hbWUpIHx8IFRleHRVdGlscy5pc0VtcHR5KHRva2VuKSkgewogICAgICAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkxPR0QpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIklnbm9yaW5nIG1hbGZvcm1lZCB0aWNrbGUgLS0gbWlzc2luZyBhY2NvdW50IG9yIHRva2VuLiIpOwogICAgICAgICAgICAgICAgICAgICB9CkBAIC02NywxMCArNjksMTAgQEAKIAogICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgewogICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJSZWNlaXZlZCBuZXR3b3JrIHRpY2tsZSBmb3IgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYWNjb3VudCArICIgLSAiICsgdG9rZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYWNjb3VudE5hbWUgKyAiIC0gIiArIHRva2VuKTsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBoYW5kbGVUaWNrbGUodGhpcywgYWNjb3VudCwg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W50KGFjY291bnROYW1lLCAiY29tLmdvb2dsZS5HQUlBIik7CiAgICAgICAgICAgICBjID0gY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeShTdWJzY3JpYmVkRmVlZHMuRmVlZHMuQ09OVEVOVF9VUkksCi0gICAgICAgICAgICAgICAgICAgIG51bGwsIHdoZXJlLCBuZXcgU3RyaW5nW117YWNjb3VudCwgZmVlZH0sIG51bGwpOworICAgICAgICAgICAgICAgICAgICBudWxsLCB3aGVyZSwgbmV3IFN0cmluZ1tde2FjY291bnQubmFtZSwgYWNjb3VudC50eXBlLCBmZWVkfSwgbnVsbCk7CiAgICAgICAgICAgICBpZiAoYy5nZXRDb3VudCgpID09IDApIHsKICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJyZWNlaXZlZCB0aWNrbGUgZm9yIG5vbi1leGlzdGVudCBmZWVkOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICArICJhY2NvdW50ICIgKyBhY2NvdW50ICsgIiwgZmVlZCAiICsgZmVlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICArICJhY2NvdW50ICIgKyBhY2NvdW50TmFtZSArICIsIGZlZWQgIiArIGZlZWQpOwogICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoTE9HX1RJQ0tMRSwgInVua25vd24iKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHdoaWxlIChjLm1vdmVUb05leHQoKSkgewpAQCAtMTE5LDIxICsxMjQsMTQgQEAKICAgICAgICAgICAgICAgICBTdHJpbmcgYXV0aG9yaXR5ID0gYy5nZXRTdHJpbmcoYy5nZXRDb2x1bW5JbmRleE9yVGhyb3coCiAgICAgICAgICAgICAgICAgICAgICAgICBTdWJzY3JpYmVkRmVlZHMuRmVlZHMuQVVUSE9SSVRZKSk7CiAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfVElDS0xFLCBhdXRob3JpdHkpOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghQ29udGVudFJlc29sdmVyLmdldENvbnRlbnRTZXJ2aWNlKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0U3luY1Byb3ZpZGVyQXV0b21hdGljYWxseShhdXRob3JpdHkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJzdXByZXNzaW5nIHRpY2tsZSBzaW5jZSBwcm92aWRlciAiICsgYXV0aG9yaXR5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBpcyBjb25maWd1cmVkIHRvIG5vdCBzeW5jIGF1dG9tYXRpY2FsbHkiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBpZiAoIUNvbnRlbnRSZXNvbHZlci5nZXRTeW5jQXV0b21hdGljYWxseShhY2NvdW50LCBhdXRob3JpdHkpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInN1cHJlc3NpbmcgdGlja2xlIHNpbmNlIHByb3ZpZGVyICIgKyBhdXRob3JpdHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgaXMgY29uZmlndXJlZCB0byBub3Qgc3luYyBhdXRvbWF0aWNhbGx5Iik7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBVcmkgdXJpID0gVXJpLnBhcnNlKCJjb250ZW50Oi8vIiArIGF1dGhvcml0eSk7CiAgICAgICAgICAgICAgICAgQnVuZGxlIGV4dHJhcyA9IG5ldyBCdW5kbGUoKTsKLSAgICAgICAgICAgICAgICBleHRyYXMucHV0U3RyaW5nKENvbnRlbnRSZXNvbHZlci5TWU5DX0VYVFJBU19BQ0NPVU5ULCBhY2NvdW50KTsKICAgICAgICAgICAgICAgICBleHRyYXMucHV0U3RyaW5nKCJmZWVkIiwgZmVlZCk7Ci0gICAgICAgICAgICAgICAgY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5zdGFydFN5bmModXJpLCBleHRyYXMpOworICAgICAgICAgICAgICAgIENvbnRlbnRSZXNvbHZlci5yZXF1ZXN0U3luYyhhY2NvdW50LCBhdXRob3JpdHksIGV4dHJhcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSBjLmRlYWN0aXZhdGUoKTsKQEAgLTE1MCwzMSArMTQ4LDM1IEBACiAgICAgICovCiAgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZVJlZnJlc2hBbGFybShDb250ZXh0IGNvbnRleHQpIHsKICAgICAgICAgLy8gcmV0cmlldmUgdGhlIGxpc3Qgb2YgYWNjb3VudHMgZnJvbSB0aGUgc3Vic2NyaWJlZCBmZWVkcwotICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBhY2NvdW50cyA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOworICAgICAgICBBcnJheUxpc3Q8QWNjb3VudD4gYWNjb3VudHMgPSBMaXN0cy5uZXdBcnJheUxpc3QoKTsKICAgICAgICAgQ29udGVudFJlc29sdmVyIGNvbnRlbnRSZXNvbHZlciA9IGNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7CiAgICAgICAgIEN1cnNvciBjID0gY29udGVudFJlc29sdmVyLnF1ZXJ5KFN1YnNjcmliZWRGZWVkcy5BY2NvdW50cy5DT05URU5UX1VSSSwKICAgICAgICAgICAgICAgICBzQWNjb3VudFByb2plY3Rpb24sIG51bGwsIG51bGwsIG51bGwpOwotICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKLSAgICAgICAgICAgIFN0cmluZyBhY2NvdW50ID0gYy5nZXRTdHJp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JpZ2dlciBhIHN5bmMuCiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBhY2NvdW50IDogYWNjb3VudHMpIHsKLSAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KFN5bmNDb25zdFZhbHVlLl9TWU5DX0FDQ09VTlQsIGFjY291bnQpOworICAgICAgICAgICAgZm9yIChBY2NvdW50IGFjY291bnQgOiBhY2NvdW50cykgeworICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoU3luY0NvbnN0VmFsdWUuX1NZTkNfQUNDT1VOVCwgYWNjb3VudC5uYW1lKTsKKyAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KFN5bmNDb25zdFZhbHVlLl9TWU5DX0FDQ09VTlRfVFlQRSwgYWNjb3VudC50eXBlKTsKICAgICAgICAgICAgICAgICBjb250ZW50UmVzb2x2ZXIudXBkYXRlKFN1YnNjcmliZWRGZWVkcy5GZWVkcy5DT05URU5UX1VSSSwgdmFsdWVzLAotICAgICAgICAgICAgICAgICAgICAgICAgU3Vic2NyaWJlZEZlZWRzLkZlZWRzLl9TWU5DX0FDQ09VTlQgKyAiPT8iLCBuZXcgU3RyaW5nW10ge2FjY291bnR9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN1YnNjcmliZWRGZWVkcy5GZWVkcy5fU1lOQ19BQ0NPVU5UICsgIj0/IEFORCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgU3Vic2NyaWJlZEZlZWRzLkZlZWRzLl9TWU5DX0FDQ09VTlRfVFlQRSArICI9PyIsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW10ge2FjY291bnQubmFtZSwgYWNjb3VudC50eXBlfSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUZ1bGxFeGNlcHRpb24gZ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3MgU3Vic2NyaWJlZEZlZWRzUHJvdmlkZXIgZXh0ZW5kcyBBYnN0cmFjdFN5bmNhYmxlQ29udGVudFByb3ZpZGVyIHsKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEFHID0gIlN1YnNjcmliZWRGZWVkc1Byb3ZpZGVyIjsKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgREFUQUJBU0VfTkFNRSA9ICJzdWJzY3JpYmVkZmVlZHMuZGIiOwotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBEQVRBQkFTRV9WRVJTSU9OID0gMTA7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERBVEFCQVNFX1ZFUlNJT04gPSAxMTsKIAogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBGRUVEUyA9IDE7CiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEZFRURfSUQgPSAyOwpAQCAtODgsNiArODksNyBAQAogICAgICAgICBkYi5leGVjU1FMKCJDUkVBVEUgVEFCTEUgZmVlZHMgKCIgKwogICAgICAgICAgICAgICAgICAgICAiX2lkIElOVEVHRVIgUFJJTUFSWSBLRVksIiArCiAgICAgICAgICAgICAgICAgICAgICJfc3luY19hY2NvdW50IFRFWFQsIiArIC8vIEZyb20gdGhlIHN5bmMgc291cmNlCisgICAgICAgICAgICAgICAgICAgICJfc3luY19hY2NvdW50X3R5cGUgVEVYVCwiICsgLy8gRnJvbSB0aGUgc3luYyBzb3VyY2UKICAgICAgICAgICAgICAgICAgICAgIl9zeW5jX2lkIFRFWFQsIiArIC8vIEZyb20gdGhlIHN5bmMgc291cmNlCiAgICAgICAgICAgICAgICAgICAgICJfc3luY190aW1lIFRFWFQsIiArIC8vIEZyb20gdGhlIHN5bmMgc291cmNlCiAgICAgICAgICAgICAgICAgICAgICJfc3luY192ZXJzaW9uIFRFWFQsIiArIC8vIEZyb20gdGhlIHN5bmMgc291cmNlCkBAIC0xMDYsOCArMTA4LDggQEAKICAgICAgICAgICAgICAgICAgICAgIldIRU4gb2xkLl9zeW5jX2lkIGlzIG5vdCBudWxsICIgKwogICAgICAgICAgICAgICAgICAgICAiQkVHSU4gIiArCiAgICAgICAgICAgICAgICAgICAgICAgICAiSU5TRVJUIElOVE8gX2RlbGV0ZWRfZmVlZHMgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIihfc3luY19pZCwgX3N5bmNfYWNjb3VudCwgX3N5bmNfdmVyc2lvbikgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIlZBTFVFUyAob2xkLl9zeW5jX2lkLCBvbGQuX3N5bmNfYWNjb3VudCwgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIihfc3luY19pZCwgX3N5bmNfYWNjb3VudCwgX3N5bmNfYWNjb3VudF90eXBlLCBfc3luY192ZXJzaW9uKSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVkFMVUVTIChvbGQuX3N5bmNfaWQsIG9sZC5fc3luY19hY2NvdW50LCBvbGQuX3N5bmNfYWNjb3VudF90eXBlLCAiICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib2xkLl9zeW5jX3ZlcnNpb24pOyIgKwogICAgICAgICAgICAgICAgICAgICAiRU5EIik7CiAKQEAgLTExNiwxMSArMTE4LDIyIEBACiAgICAgICAgICAgICAgICAgICAgICJfc3luY19pZCBURVhULCIgKwogICAgICAgICAgICAgICAgICAgICAoaXNUZW1wb3JhcnkoKSA/ICJfc3luY19sb2NhbF9pZCBJTlRFR0VSLCIgOiAiIikgKyAvLyBVc2VkIHdoaWxlIHN5bmNpbmcsCiAgICAgICAgICAgICAgICAgICAgICJfc3luY19hY2NvdW50IFRFWFQsIiArCisgICAgICAgICAgICAgICAgICAgICJfc3luY19hY2NvdW50X3R5cGUgVEVYVCwiICsKICAgICAgICAgICAgICAgICAgICAgIl9zeW5jX21hcmsgSU5URUdFUiwgIiArIC8vIFVzZWQgdG8gZmlsdGVyIG91dCBuZXcgcm93cwogICAgICAgICAgICAgICAgICAgICAiVU5JUVVFKF9zeW5jX2lkKSkiKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkFjY291bnRzQ2hhbmdlZChBY2NvdW50W10gYWNjb3VudHNBcnJheSkgeworICAgICAgICBzdXBlci5vbkFjY291bnRzQ2hhbmdlZChhY2NvdW50c0FycmF5KTsKKyAgICAgICAgZm9yIChBY2NvdW50IGFjY291bnQgOiBhY2NvdW50c0FycmF5KSB7CisgICAgICAgICAgICBpZiAoYWNjb3VudC50eXBlLmVxdWFscygiY29tLmdvb2dsZS5HQUlBIikpIHsKKyAgICAgICAgICAgICAgICBDb250ZW50UmVzb2x2ZXIuc2V0U3luY0F1dG9tYXRpY2FsbHkoYWNjb3VudCwgInN1YnNjcmliZWRmZWVkcyIsIHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgb25EYXRhYmFzZU9wZW5lZChTUUxpdGVEYXRhYmFzZSBkYikgewogICAgICAgICBkYi5tYXJrVGFibGVTeW5jYWJsZSgiZmVlZHMiLCAiX2RlbGV0ZWRfZmVlZHMiKTsKICAgICB9CkBAIC0xNzAsNyArMTgzLDggQEAKICAgICAgICAgICAgICAgICBxYi5zZXREaXN0aW5jdCh0cnVlKTsKICAgICAgICAgICAgICAgICBxYi5zZXRQcm9qZWN0aW9uTWFwKEFDQ09VTlRTX1BST0pFQ1RJT05fTUFQKTsKICAgICAgICAgICAgICAgICByZXR1cm4gcWIucXVlcnkoZ2V0RGF0YWJhc2UoKSwgcHJvamVjdGlvbiwgc2VsZWN0aW9uLCBzZWxlY3Rpb25BcmdzLAotICAgICAgICAgICAgICAgICAgICAgICAgU3Vic2NyaWJlZEZlZWRzLkZlZWRzLl9TWU5DX0FDQ09VTlQsIG51bGwsIHNvcnRP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AgICAgICAgICB1aW50MzJfdCBmb3JtYXQsIGludCBjaGFubmVsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50OF90IComd2F2LCBzaXplX3QgJmJ1ZmZlclNpemUsIHR0c19zeW50aF9zdGF0dXMgc3RhdHVzKSB7CiAgICAgLy9MT0dWKCJ0dHNTeW50aERvbmVDYWxsYmFjazogJWQgYnl0ZXMiLCBidWZmZXJTaXplKTsKIApAQCAtMjg0LDcgKzI4NCw3IEBACiAgICAgICAgIH0KIAogICAgICAgICBpZiAoYnVmZmVyU2l6ZSA+IDApIHsKLSAgICAgICAgICAgIHByZXBBdWRpb1RyYWNrKHBKbmlEYXRhLCBwRm9yQWZ0ZXItPnN0cmVhbVR5cGUsIHJhdGUsIGZvcm1hdCwgY2hhbm5lbCk7CisgICAgICAgICAgICBwcmVwQXVkaW9UcmFjayhwSm5pRGF0YSwgcEZvckFmdGVyLT5zdHJlYW1UeXBlLCByYXRlLCAoQXVkaW9TeXN0ZW06OmF1ZGlvX2Zvcm1hdClmb3JtYXQsIGNoYW5uZWwpOwogICAgICAgICAgICAgaWYgKHBKbmlEYXRhLT5tQXVkaW9PdXQpIHsKICAgICAgICAgICAgICAgICBhcHBseUZpbHRlcigoaW50MTZfdCopd2F2LCBidWZmZXJTaXplLzIpOwogICAgICAgICAgICAgICAgIHBKbmlEYXRhLT5tQXVkaW9PdXQtPndyaXRlKHdhdiwgYnVmZmVyU2l6ZSk7CkBAIC03MjEsNiArNzIxLDI3IEBACiB9CiAKIAorc3RhdGljIGludAorYW5kcm9pZF90dHNfU3ludGhQcm94eV9zdG9wU3luYyhKTklFbnYgKmVudiwgam9iamVjdCB0aGl6LCBqaW50IGpuaURhdGEpCit7CisgICAgaW50IHJlc3VsdCA9IFRUU19GQUlMVVJFOworCisgICAgaWYgKGpuaURhdGEgPT0gMCkgeworICAgICAgICBMT0dFKCJhbmRyb2lkX3R0c19TeW50aFByb3h5X3N0b3AoKTogaW52YWxpZCBKTkkgZGF0YSIpOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8vIHBlcmZvcm0gYSByZWd1bGFyIHN0b3AKKyAgICByZXN1bHQgPSBhbmRyb2lkX3R0c19TeW50aFByb3h5X3N0b3AoZW52LCB0aGl6LCBqbmlEYXRhKTsKKyAgICAvLyBidXQgd2FpdCBvbiB0aGUgZW5naW5lIGhhdmluZyByZWxlYXNlZCB0aGUgZW5naW5lIG11dGV4IHdoaWNoIHByb3RlY3RzCisgICAgLy8gdGhlIHN5bnRoZXNpemVyIHJlc291cmNlcy4KKyAgICBlbmdpbmVNdXRleC5sb2NrKCk7CisgICAgZW5naW5lTXV0ZXgudW5sb2NrKCk7CisKKyAgICByZXR1cm4gcmVzdWx0OworfQorCisKIHN0YXRpYyBqb2JqZWN0QXJyYXkKIGFuZHJvaWRfdHRzX1N5bnRoUHJveHlfZ2V0TGFuZ3VhZ2UoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwgamludCBqbmlEYXRhKQogewpAQCAtNzc4LDYgKzc5OSwxMCBAQAogICAgICAgICAiKEkpSSIsCiAgICAgICAgICh2b2lkKilhbmRyb2lkX3R0c19TeW50aFByb3h5X3N0b3AKICAgICB9LAorICAgIHsgICAibmF0aXZlX3N0b3BTeW5jIiwKKyAgICAgICAgIihJKUkiLAorICAgICAgICAodm9pZCopYW5kcm9pZF90dHNfU3ludGhQcm94eV9zdG9wU3luYworICAgIH0sCiAgICAgeyAgICJuYXRpdmVfc3BlYWsiLAogICAgICAgICAiKElMamF2YS9sYW5nL1N0cmluZztJKUkiLAogICAgICAgICAodm9pZCopYW5kcm9pZF90dHNfU3ludGhQcm94eV9zcGVhawpkaWZmIC0tZ2l0IGEvcGFja2FnZXMvVHRzU2VydmljZS9zcmMvYW5kcm9pZC90dHMvU3ludGhQcm94eS5qYXZhIGIvcGFja2FnZXMvVHRzU2VydmljZS9zcmMvYW5kcm9pZC90dHMvU3ludGhQcm94eS5qYXZhCmluZGV4IGEwODE0YW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KTsKICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gbVNwZWVjaFF1ZXVlLnNpemUoKSAtIDE7IGkgPiAtMTsgaS0tKXsKICAgICAgICAgICAgICAgICAgICAgaWYgKG1TcGVlY2hRdWV1ZS5nZXQoaSkubUNhbGxpbmdBcHAuZXF1YWxzKGNhbGxpbmdBcHApKXsKICAgICAgICAgICAgICAgICAgICAgICAgIG1TcGVlY2hRdWV1ZS5yZW1vdmUoaSk7CkBAIC00NjEsMTAgKzQ2MywxMyBAQAogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFRleHRUb1NwZWVjaC5TVUNDRVNTOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBMb2cuaSgiVHRzU2VydmljZSIsICJTdG9wcGVkIik7CisgICAgICAgICAgICAgICAgTG9nLmkoU0VSVklDRV9UQUcsICJTdG9wcGVkIik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIExvZy5lKFNFUlZJQ0VfVEFHLCAiVFRTIHN0b3AoKTogcXVldWUgbG9ja2VkIGxvbmdlciB0aGFuIGV4cGVjdGVkIik7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gVGV4dFRvU3BlZWNoLkVSUk9SOwogICAgICAgICAgICAgfQogICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgTG9nLmUoIlR0c1NlcnZpY2UiLCAiVFRTIHN0b3A6IHRyeUxvY2sgaW50ZXJydXB0ZWQiKTsKKyAgICAgICAgICBMb2cuZShTRVJWSUNFX1RBRywgIlRUUyBzdG9wOiB0cnlMb2NrIGludGVycnVwdGVkIik7CiAgICAgICAgICAgZS5wcmludFN0YWNrVHJhY2UoKTsKICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIC8vIFRoaXMgY2hlY2sgaXMgbmVlZGVkIGJlY2F1c2U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gICAgICAgICAgICAgICByZXN1bHQgPSBzTmF0aXZlU3ludGguc3RvcFN5bmMoKTsKKyAgICAgICAgICAgICAgICAgICAgbUtpbGxMaXN0LnB1dChtQ3VycmVudFNwZWVjaEl0ZW0sIHRydWUpOworICAgICAgICAgICAgICAgICAgICBtSXNTcGVha2luZyA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgIC8vIHdhcyB0aGUgZW5naW5lIHdyaXRpbmcgdG8gYSBmaWxlPworICAgICAgICAgICAgICAgICAgICBpZiAobUN1cnJlbnRTcGVlY2hJdGVtLm1UeXBlID09IFNwZWVjaEl0ZW0uVEVYVF9UT19GSUxFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBkZWxldGUgdGhlIGZpbGUgdGhhdCB3YXMgYmVpbmcgd3JpdHRlbgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50U3BlZWNoSXRlbS5tRmlsZW5hbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUgdGVtcEZpbGUgPSBuZXcgRmlsZShtQ3VycmVudFNwZWVjaEl0ZW0ubUZpbGVuYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihTRVJWSUNFX1RBRywgIkxlYXZpbmcgYmVoaW5kICIgKyBtQ3VycmVudFNwZWVjaEl0ZW0ubUZpbGVuYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGVtcEZpbGUuZXhpc3RzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoU0VSVklDRV9UQUcsICJBYm91dCB0byBkZWxldGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUN1cnJlbnRTcGVlY2hJdGVtLm1GaWxlbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wRmlsZS5kZWxldGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoU0VSVklDRV9UQUcsICJmaWxlIHN1Y2Nlc3NmdWxseSBkZWxldGVkIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFNwZWVjaEl0ZW0gPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgTG9nLmUoU0VSVklDRV9UQUcsICJUVFMga2lsbEFsbFV0dGVyYW5jZXMoKTogcXVldWUgbG9ja2VkIGxvbmdlciB0aGFuIGV4cGVjdGVkIik7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gVGV4dFRvU3BlZWNoLkVSUk9SOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShTRVJWSUNFX1RBRywgIlRUUyBraWxsQWxsVXR0ZXJhbmNlcygpOiB0cnlMb2NrIGludGVycnVwdGVkIik7CisgICAgICAgICAgICByZXN1bHQgPSBUZXh0VG9TcGVlY2guRVJST1I7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAvLyBUaGlzIGNoZWNrIGlzIG5lZWRlZCBiZWNhdXNlIGZpbmFsbHkgd2lsbCBhbHdheXMgcnVuLCBldmVuIGlmIHRoZQorICAgICAgICAgICAgLy8gbWV0aG9kIHJldHVybnMgc29tZXdoZXJlIGluIHRoZSB0cnkgYmxvY2suCisgICAgICAgICAgICBpZiAoc3BlZWNoUXVldWVBdmFpbGFibGUpIHsKKyAgICAgICAgICAgICAgICBzcGVlY2hRdWV1ZUxvY2sudW5sb2NrKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICB9CisgICAgfQorCiAKICAgICAvKioKICAgICAgKiBTdG9wcyBhbGwgc3BlZWNoIG91dHB1dCBhbmQgcmVtb3ZlcyBhbnkgdXR0ZXJhbmNlcyBzdGlsbCBpbiB0aGUgcXVldWUgZ2xvYmFsbHksIGV4Y2VwdApAQCAtNTE2LDEwICs1NzgsMTMgQEAKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBUZXh0VG9TcGVlY2guU1VDQ0VTUzsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgTG9nLmkoIlR0c1NlcnZpY2UiLCAiU3RvcHBlZCBhbGwiKTsKKyAgICAgICAgICAgICAgICBMb2cuaShTRVJWSUNFX1RBRywgIlN0b3BwZWQgYWxsIik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIExvZy5lKFNFUlZJQ0VfVEFHLCAiVFRTIHN0b3BBbGwoKTogcXVldWUgbG9ja2VkIGxvbmdlciB0aGFuIGV4cGVjdGVkIik7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gVGV4dFRvU3BlZWNoLkVSUk9SOwogICAgICAgICAgICAgfQogICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgTG9nLmUoIlR0c1NlcnZpY2UiLCAiVFRTIHN0b3BBbGw6IHRyeUxvY2sgaW50ZXJydXB0ZWQiKTsKKyAgICAgICAgICBMb2cuZShTRVJWSUNFX1RBRywgIlRUUyBzdG9wQWxsOiB0cnlMb2NrIGludGVycnVwdGVkIik7CiAgICAgICAgICAgZS5wcmludFN0YWNrVHJhY2UoKTsKICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIC8vIFRoaXMgY2hlY2sgaXMgbmVlZGVkIGJlY2F1c2UgZmluYWxseSB3aWxsIGFsd2F5cyBydW47IGV2ZW4gaWYgdGhlCkBAIC02NDYsMTEgKzcxMSwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNOYXRpdmVTeW50aC5zcGVhayhzcGVlY2hJdGVtLm1UZXh0LCBzdHJlYW1UeXBlKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE51bGxQb2ludGVyRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzeW50aCB3aWxsIGJlY29tZSBudWxsIGR1cmluZyBvbkRlc3Ryb3koKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KCJUdHNTZXJ2aWNlIiwgIiBudWxsIHN5bnRoLCBjYW4ndCBzcGVhayIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFNFUlZJQ0VfVEFHLCAiIG51bGwgc3ludGgsIGNhbid0IHNwZWFrIik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKCJUdHNTZXJ2aWNlIiwgIlRUUyBzcGVha0ludGVybmFsT25seSgpOiB0cnlMb2NrIGludGVycnVwdGVkIik7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFNFUlZJQ0VfVEFHLCAiVFRTIHNwZWFrSW50ZXJuYWxPbmx5KCk6IHRyeUxvY2sgaW50ZXJydXB0ZWQiKTsKICAgICAgICAgICAgICAgICAgICAgZS5wcmludFN0YWNrVHJhY2UoKTsKICAgICAgICAgICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGNoZWNrIGlzIG5lZWRlZCBiZWNhdXNlIGZpbmFsbHkgd2lsbCBhbHdheXMgcnVuOwpAQCAtNjY3LDcgKzczMiw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgVGhyZWFkIHN5bnRoID0gKG5ldyBUaHJlYWQobmV3IFN5bnRoVGhyZWFkKCkpKTsKLSAgICAgICAgLy9zeW50aC5zZXRQcmlvcml0eShUaHJlYWQuTUlOX1BSSU9SSVRZKTsKKyAgICAgICAgc3ludGguc2V0UHJpb3JpdHkoVGhyZWFkLk1BWF9QUklPUklUWSk7CiAgICAgICAgIHN5bnRoLnN0YXJ0KCk7CiAgICAgfQogCkBAIC02NzYsNyArNzQxLDcgQEAKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKICAgICAgICAgICAgICAgICBib29sZWFuIHN5bnRoQXZhaWxhYmxlID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgU3RyaW5nIHV0dGVyYW5jZUlkID0gIiI7Ci0gICAgICAgICAgICAgICAgTG9nLmkoIlR0c1NlcnZpY2UiLCAiU3ludGhlc2l6aW5nIHRvICIgKyBzcGVlY2hJdGVtLm1GaWxlbmFtZSk7CisgICAgICAgICAgICAgICAgTG9nLmkoU0VSVklDRV9UQUcsICJTeW50aGVzaXppbmcgdG8gIiArIHNwZWVjaEl0ZW0ubUZpbGVuYW1lKTsKICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICBzeW50aEF2YWlsYWJsZSA9IHN5bnRoZXNpemVyTG9jay50cnlMb2NrKCk7CiAgICAgICAgICAgICAgICAgICAgIGlmICghc3ludGhBdmFpbGFibGUpIHsKQEAgLTcyMCwxMSArNzg1LDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc05hdGl2ZVN5bnRoLnN5bnRoZXNpemVUb0ZpbGUoc3BlZWNoSXRlbS5tVGV4dCwgc3BlZWNoSXRlbS5tRmlsZW5hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVsbFBvaW50ZXJFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN5bnRoIHdpbGwgYmVjb21lIG51bGwgZHVyaW5nIG9uRGVzdHJveSgpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoIlR0c1NlcnZpY2UiLCAiIG51bGwgc3ludGgsIGNhbid0IHN5bnRoZXNpemUgdG8gZmlsZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFNFUlZJQ0VfVEFHLCAiIG51bGwgc3ludGgsIGNhbid0IHN5bnRoZXNpemUgdG8gZmlsZSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZSgiVHRzU2VydmljZSIsICJUVFMgc3ludGhUb0ZpbGVJbnRlcm5hbE9ubHkoKTogdHJ5TG9jayBpbnRlcnJ1cHRlZCIpOworICAgICAgICAgICAgICAgICAgICBMb2cuZShTRVJWSUNFX1RBRywgIlRUUyBzeW50aFRvRmlsZUludGVybmFsT25seSgpOiB0cnlMb2NrIGludGVycnVwdGVkIik7CiAgICAgICAgICAgICAgICAgICAgIGUucHJpbnRTdGFja1RyYWNlKCk7CiAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBjaGVjayBpcyBuZWVkZWQgYmVjYXVzZSBmaW5hbGx5IHdpbGwgYWx3YXlzIHJ1bjsKQEAgLTc0MSw3ICs4MDYsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIFRocmVhZCBzeW50aCA9IChuZXcgVGhyZWFkKG5ldyBTeW50aFRocmVhZCgpKSk7Ci0gICAgICAgIC8vc3ludGguc2V0UHJpb3JpdHkoVGhyZWFkLk1JTl9QUklPUklUWSk7CisgICAgICAgIHN5bnRoLnNldFByaW9yaXR5KFRocmVhZC5NQVhfUFJJT1JJVFkpOwogICAgICAgICBzeW50aC5zdGFydCgpOwogICAgIH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QAogCiAgICAgcHJpdmF0ZSB2b2lkIHdhaXRVbnRpbENvbm5lY3RlZE9yVGltZWRvdXQoKSB0aHJvd3MgSU9FeGNlcHRpb24gewogICAgICAgICBzbGVlcCgyMDAwKTsgLy8gMiBzZWNvbmRzCi0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgNjA7IGkrKykgeworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDgwOyBpKyspIHsKICAgICAgICAgICAgIGlmIChtU3RhdGUgIT0gVnBuU3RhdGUuQ09OTkVDVElORykgewogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfSBlbHNlIGlmIChWUE5fSVNfVVAuZXF1YWxzKApAQCAtNDY0LDIyICs0NjAsOCBAQAogCiAgICAgICAgIHN5bmNocm9uaXplZCBpbnQgZ2V0U29ja2V0RXJyb3IoKSB7CiAgICAgICAgICAgICBmb3IgKERhZW1vblByb3h5IHMgOiBtRGFlbW9uTGlzdCkgewotICAgICAgICAgICAgICAgIHN3aXRjaCAoZ2V0UmVzdWx0RnJvbVNvY2tldChzKSkgewotICAgICAgICAgICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLQotICAgICAgICAgICAgICAgICAgICBjYXNlIEFVVEhfRVJST1JfQ09ERToKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBWcG5NYW5hZ2VyLlZQTl9FUlJPUl9BVVRIOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgQ0hBTExFTkdFX0VSUk9SX0NPREU6Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gVnBuTWFuYWdlci5WUE5fRVJST1JfQ0hBTExFTkdFOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgUkVNT1RFX0hVTkdfVVBfRVJST1JfQ09ERToKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBWcG5NYW5hZ2VyLlZQTl9FUlJPUl9SRU1PVEVfS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0b21pY1JlZmVyZW5jZQogamF2YS51dGlsLmNvbmN1cnJlbnQuYXRvbWljLlVuc2FmZUFjY2VzcwogamF2YS51dGlsLmNvbmN1cnJlbnQubG9ja3MuQWJzdHJhY3RRdWV1ZWRTeW5jaHJvbml6ZXIKK2phdmEudXRpbC5jb25jdXJyZW50LmxvY2tzLkFic3RyYWN0UXVldWVkU3luY2hyb25pemVyJENvbmRpdGlvbk9iamVjdAoramF2YS51dGlsLmNvbmN1cnJlbnQubG9ja3MuQWJzdHJhY3RRdWV1ZWRTeW5jaHJvbml6ZXIkTm9kZQoramF2YS51dGlsLmNvbmN1cnJlbnQubG9ja3MuTG9jaworamF2YS51dGlsLmNvbmN1cnJlbnQubG9ja3MuTG9ja1N1cHBvcnQKIGphdmEudXRpbC5jb25jdXJyZW50LmxvY2tzLlJlZW50cmFudExvY2sKK2phdmEudXRpbC5jb25jdXJyZW50LmxvY2tzLlJlZW50cmFudExvY2skRmFpclN5bmMKK2phdmEudXRpbC5jb25jdXJyZW50LmxvY2tzLlJlZW50cmFudExvY2skTm9uZmFpclN5bmMKIGphdmEudXRpbC5jb25jdXJyZW50LmxvY2tzLlJlZW50cmFudExvY2skU3luYworamF2YS51dGlsLmNvbmN1cnJlbnQubG9ja3MuUmVlbnRyYW50UmVhZFdyaXRlTG9jaworamF2YS51dGlsLmNvbmN1cnJlbnQubG9ja3MuUmVlbnRyYW50UmVhZFdyaXRlTG9jayROb25mYWlyU3luYworamF2YS51dGlsLmNvbmN1cnJlbnQubG9ja3MuVW5zYWZlQWNjZXNzCitqYXZhLnV0aWwuamFyLkF0dHJpYnV0ZXMKIGphdmEudXRpbC5qYXIuQXR0cmlidXRlcyROYW1lCitqYXZhLnV0aWwuamFyLkluaXRNYW5pZmVzdAoramF2YS51dGlsLmphci5KYXJFbnRyeQogamF2YS51dGlsLmphci5KYXJGaWxlCitqYXZhLnV0aWwuamFyLkphckZpbGUkMUphckZpbGVFbnVtZXJhdG9yCitqYXZhLnV0aWwuamF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GNvbnRpbnVlIHRoZSByZWNvcmRrZWVwaW5nLgorICAgICAgICAgICAgaWYgKG1FdmVyU3RvcmVkLmV4aXN0cygpKSB7CisgICAgICAgICAgICAgICAgUmFuZG9tQWNjZXNzRmlsZSB0ZW1wID0gbmV3IFJhbmRvbUFjY2Vzc0ZpbGUodGVtcFByb2Nlc3NlZEZpbGUsICJydyIpOworICAgICAgICAgICAgICAgIG1FdmVyU3RvcmVkU3RyZWFtID0gbmV3IFJhbmRvbUFjY2Vzc0ZpbGUobUV2ZXJTdG9yZWQsICJyIik7CisKKyAgICAgICAgICAgICAgICAvLyBwYXJzZSBpdHMgZXhpc3RpbmcgY29udGVudHMKKyAgICAgICAgICAgICAgICBtRXZlclN0b3JlZFN0cmVhbS5zZWVrKDApOworICAgICAgICAgICAgICAgIHRlbXAuc2VlaygwKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgUGFja2FnZUluZm8gaW5mbzsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwa2cgPSBtRXZlclN0b3JlZFN0cmVhbS5yZWFkVVRGKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8gPSBtUGFja2FnZU1hbmFnZXIuZ2V0UGFja2FnZUluZm8ocGtnLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRXZlclN0b3JlZEFwcHMuYWRkKHBrZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC53cml0ZVVURihwa2cpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiICAgKyAiICsgcGtnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgIC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2thZ2UiKTsKKyAgICAgICAgbUNvbnRleHQucmVnaXN0ZXJSZWNlaXZlcihtQnJvYWRjYXN0UmVjZWl2ZXIsIGZpbHRlcik7CisgICAgfQorCiAgICAgcHJpdmF0ZSB2b2lkIG1ha2VKb3VybmFsTG9ja2VkKCkgewogICAgICAgICB0cnkgewogICAgICAgICAgICAgbUpvdXJuYWwgPSBGaWxlLmNyZWF0ZVRlbXBGaWxlKCJqb3VybmFsIiwgbnVsbCwgbUpvdXJuYWxEaXIpOwpAQCAtNDcyLDcgKzU1NywxMiBAQAogICAgICAgICAgICAgTG9nLnYoVEFHLCAiQWRkaW5nICIgKyB0YXJnZXRQa2dzLnNpemUoKSArICIgYmFja3VwIHBhcnRpY2lwYW50czoiKTsKICAgICAgICAgICAgIGZvciAoUGFja2FnZUluZm8gcCA6IHRhcmdldFBrZ3MpIHsKICAgICAgICAgICAgICAgICBMb2cudihUQUcsICIgICAgIiArIHAgKyAiIGFnZW50PSIgKyBwLmFwcGxpY2F0aW9uSW5mby5iYWNrdXBBZ2VudE5hbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICsgIiB1aWQ9IiArIHAuYXBwbGljYXRpb25JbmZvLnVpZCk7CisgICAgICAgICAgICAgICAgICAgICAgICArICIgdWlkPSIgKyBwLmFwcGxpY2F0aW9uSW5mby51aWQKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBraWxsQWZ0ZXJSZXN0b3JlPSIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgKCgocC5hcHBsaWNhdGlvbkluZm8uZmxhZ3MgJiBBcHBsaWNhdGlvbkluZm8uRkxBR19LSUxMX0FGVEVSX1JFU1RPUkUpICE9IDApID8gInRydWUiIDogImZhbHNlIikKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiByZXN0b3JlTmVlZHNBcHBsaWNhdGlvbj0iCisgICAgICAgICAgICAgICAgICAgICAgICArICgoKHAuYXBwbGljYXRpb25JbmZvLmZsYWdzICYgQXBwbGljYXRpb25JbmZvLkZMQUdfUkVTVE9SRV9ORUVEU19BUFBMSUNBVElPTikgIT0gMCkgPyAidHJ1ZSIgOiAiZmFsc2UiKQorICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC00ODUsNiArNTc1LDE3IEBACiAgICAgICAgICAgICAgICAgICAgIG1CYWNrdXBQYXJ0aWNpcGFudHMucHV0KHVpZCwgc2V0KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgc2V0LmFkZChwa2cuYXBwbGljYXRpb25JbmZvKTsKKworICAgICAgICAgICAgICAgIC8vIElmIHdlJ3ZlIG5ldmVyIHNlZW4gdGhpcyBhcHAgYmVmb3JlLCBzY2hlZHVsZSBhIGJhY2t1cCBmb3IgaXQKKyAgICAgICAgICAgICAgICBpZiAoIW1FdmVyU3RvcmVkQXBwcy5jb250YWlucyhwa2cucGFja2FnZU5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmkoVEFHLCAiTmV3IGFwcCAiICsgcGtnLnBhY2thZ2VOYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG5ldmVyIGJhY2tlZCB1cDsgc2NoZWR1bGluZyIpOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUNoYW5nZWQocGtnLnBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbid0IGhhcHBlbjsgaXQncyBhIGxvY2FsIG1ldGhvZCBjYWxsCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC01MjgsNiArNjI5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgZm9yIChBcHBsaWNhd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uYXBwbGljYXRpb25JbmZvOworICAgICAgICAgICAgUGFja2FnZUluZm8gcGtnID0gcGFja2FnZXMuZ2V0KGEpOworICAgICAgICAgICAgQXBwbGljYXRpb25JbmZvIGFwcCA9IHBrZy5hcHBsaWNhdGlvbkluZm87CiAgICAgICAgICAgICBpZiAoKChhcHAuZmxhZ3MmQXBwbGljYXRpb25JbmZvLkZMQUdfQUxMT1dfQkFDS1VQKSA9PSAwKQotICAgICAgICAgICAgICAgICAgICB8fCBhcHAuYmFja3VwQWdlbnROYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgfHwgYXBwLmJhY2t1cEFnZW50TmFtZSA9PSBudWxsCisgICAgICAgICAgICAgICAgICAgIHx8IChtUGFja2FnZU1hbmFnZXIuY2hlY2tQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CQUNLVVBfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwa2cucGFja2FnZU5hbWUpICE9IFBhY2thZ2VNYW5hZ2VyLlBFUk1JU1NJT05fR1JBTlRFRCkpIHsKICAgICAgICAgICAgICAgICBwYWNrYWdlcy5yZW1vdmUoYSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTU3MCw2ICs2NzUsNjUgQEAKICAgICAgICAgYWRkUGFja2FnZVBhcnRpY2lwYW50c0xvY2tlZElubmVyKHBhY2thZ2VOYW1lLCBhbGxBcHBzKTsKICAgICB9CiAKKyAgICAvLyBDYWxsZWQgZnJvbSB0aGUgYmFja3VwIHRocmVhZDogcmVjb3JkIHRoYXQgdGhlIGdpdmVuIGFwcCBoYXMgYmVlbiBzdWNjZXNzZnVsbHkKKyAgICAvLyBiYWNrZWQgdXAgYXQgbGVhc3Qgb25jZQorICAgIHZvaWQgbG9nQmFja3VwQ29tcGxldGUoU3RyaW5nIHBhY2thZ2VOYW1lKSB7CisgICAgICAgIGlmIChtRXZlclN0b3JlZFN0cmVhbSAhPSBudWxsICYmICFwYWNrYWdlTmFtZS5lcXVhbHMoUEFDS0FHRV9NQU5BR0VSX1NFTlRJTkVMKSkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChtRXZlclN0b3JlZEFwcHMpIHsKKyAgICAgICAgICAgICAgICBpZiAobUV2ZXJTdG9yZWRBcHBzLmFkZChwYWNrYWdlTmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1FdmVyU3RvcmVkU3RyZWFtLndyaXRlVVRGKHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiVW5hYmxlIHRvIGxvZyBiYWNrdXAgb2YgIiArIHBhY2thZ2VOYW1lICsgIiwgY2Vhc2luZyBsb2ciKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUV2ZXJTdG9yZWRTdHJlYW0uY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGlvZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIGRyb3BwaW5nIGl0OyBubyBuZWVkIHRvIGhhbmRsZSBhbiBleGNlcHRpb24gb24gY2xvc2UgaGVyZQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbUV2ZXJTdG9yZWRTdHJlYW0gPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLy8gUmVtb3ZlIG91ciBhd2FyZW5lc3Mgb2YgaGF2aW5nIGV2ZXIgYmFja2VkIHVwIHRoZSBnaXZlbiBwYWNrYWdlCisgICAgdm9pZCByZW1v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gIGtub3duLndyaXRlVVRGKHMpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICIgICAgIiArIHMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGtub3duLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgIHRlbXBLbm93bkZpbGUucmVuYW1lVG8obUV2ZXJTdG9yZWQpOworICAgICAgICAgICAgICAgICAgICBtRXZlclN0b3JlZFN0cmVhbSA9IG5ldyBSYW5kb21BY2Nlc3NGaWxlKG1FdmVyU3RvcmVkLCAicndkIik7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBCYWQ6IHdlIGNvdWxkbid0IGNyZWF0ZSB0aGUgbmV3IGNvcHkuICBGb3Igc2FmZXR5J3Mgc2FrZSB3ZQorICAgICAgICAgICAgICAgICAgICAvLyBhYmFuZG9uIHRoZSB3aG9sZSBwcm9jZXNzIGFuZCByZW1vdmUgYWxsIHdoYXQncy1iYWNrZWQtdXAKKyAgICAgICAgICAgICAgICAgICAgLy8gc3RhdGUgZW50aXJlbHksIG1lYW5pbmcgd2UnbGwgZm9yY2UgYSBiYWNrdXAgcGFzcyBmb3IgZXZlcnkKKyAgICAgICAgICAgICAgICAgICAgLy8gcGFydGljaXBhbnQgb24gdGhlIG5leHQgYm9vdCBvciBbcmVdaW5zdGFsbC4KKyAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRXJyb3IgcmV3cml0aW5nIGJhY2tlZC11cCBzZXQ7IGhhbHRpbmcgbG9nIik7CisgICAgICAgICAgICAgICAgICAgIG1FdmVyU3RvcmVkU3RyZWFtID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgbUV2ZXJTdG9yZWRBcHBzLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgIHRlbXBLbm93bkZpbGUuZGVsZXRlKCk7CisgICAgICAgICAgICAgICAgICAgIG1FdmVyU3RvcmVkLmRlbGV0ZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKwogICAgIC8vIFJldHVybiB0aGUgZ2l2ZW4gdHJhbnNwb3J0CiAgICAgcHJpdmF0ZSBJQmFja3VwVHJhbnNwb3J0IGdldFRyYW5zcG9ydChTdHJpbmcgdHJhbnNwb3J0TmFtZSkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1UcmFuc3BvcnRzKSB7CkBAIC02MzcsNiArODAxLDE0IEBACiAKICAgICAgICAgc3luY2hyb25pemVkKG1DbGVhckRhdGFMb2NrKSB7CiAgICAgICAgICAgICBtQ2xlYXJpbmdEYXRhID0gdHJ1ZTsKKyAgICAgICAgICAgIC8qIFRoaXMgaXMgY2F1c2luZyBzb21lIGNyaXRpY2FsIHByb2Nlc3NlcyB0byBiZSBraWxsZWQgZHVyaW5nIHNldHVwLgorICAgICAgICAgICAgICAgVGVtcG9yYXJpbHkgcmV2ZXJ0IHRoaXMgY2hhbmdlIHVudGlsIHdlIGZpbmQgYSBiZXR0ZXIgc29sdXRpb24uCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1BY3Rpdml0eU1hbmFnZXIuY2xlYXJBcHBsaWNhdGlvblVzZXJEYXRhKHBhY2thZ2VOYW1lLCBvYnNlcnZlcik7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8vIGNhbid0IGhhcHBlbiBiZWNhdXNlIHRoZSBhY3Rpdml0eSBtYW5hZ2VyIGlzIGluIHRoaXMgcHJvY2VzcworICAgICAgICAgICAgfQorICAgICAgICAgICAgKi8KICAgICAgICAgICAgIG1QYWNrYWdlTWFuYWdlci5jbGVhckFwcGxpY2F0aW9uVXNlckRhdGEocGFja2FnZU5hbWUsIG9ic2VydmVyKTsKIAogICAgICAgICAgICAgLy8gb25seSB3YWl0I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GluZyBhbW9uZyB2YXJpb3VzIHRyYW5zcG9ydHMgYXQgcnVuIHRpbWUuCisgICAgICAgICAgICAgICAgUGFja2FnZU1hbmFnZXJCYWNrdXBBZ2VudCBwbUFnZW50ID0gbmV3IFBhY2thZ2VNYW5hZ2VyQmFja3VwQWdlbnQoCisgICAgICAgICAgICAgICAgICAgICAgICBtUGFja2FnZU1hbmFnZXIsIGFsbEFnZW50UGFja2FnZXMoKSk7CisgICAgICAgICAgICAgICAgQmFja3VwUmVxdWVzdCBwbVJlcXVlc3QgPSBuZXcgQmFja3VwUmVxdWVzdChuZXcgQXBwbGljYXRpb25JbmZvKCksIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBwbVJlcXVlc3QuYXBwSW5mby5wYWNrYWdlTmFtZSA9IFBBQ0tBR0VfTUFOQUdFUl9TRU5USU5FTDsKKyAgICAgICAgICAgICAgICBwcm9jZXNzT25lQmFja3VwKHBtUmVxdWVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIElCYWNrdXBBZ2VudC5TdHViLmFzSW50ZXJmYWNlKHBtQWdlbnQub25CaW5kKCkpLCBtVHJhbnNwb3J0KTsKKworICAgICAgICAgICAgICAgIC8vIE5vdyBydW4gYWxsIHRoZSBiYWNrdXBzIGluIG91ciBxdWV1ZQorICAgICAgICAgICAgICAgIGludCBjb3VudCA9IG1RdWV1ZS5zaXplKCk7CisgICAgICAgICAgICAgICAgZG9RdWV1ZWRCYWNrdXBzKG1UcmFuc3BvcnQpOworCisgICAgICAgICAgICAgICAgLy8gRmluYWxseSwgdGVhciBkb3duIHRoZSB0cmFuc3BvcnQKKyAgICAgICAgICAgICAgICBpZiAobVRyYW5zcG9ydC5maW5pc2hCYWNrdXAoKSkgeworICAgICAgICAgICAgICAgICAgICBpbnQgbWlsbGlzID0gKGludCkgKFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpIC0gc3RhcnRSZWFsdGltZSk7CisgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoQkFDS1VQX1NVQ0NFU1NfRVZFTlQsIGNvdW50LCBtaWxsaXMpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoQkFDS1VQX1RSQU5TUE9SVF9GQUlMVVJFX0VWRU5ULCAiIik7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlRyYW5zcG9ydCBlcnJvciBpbiBmaW5pc2hCYWNrdXAoKSIpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgaW4gZmluaXNoQmFja3VwKCkiLCBlKTsKLSAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKCFtSm91cm5hbC5kZWxldGUoKSkgewotICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlVuYWJsZSB0byByZW1vdmUgYmFja3VwIGpvdXJuYWwgZmlsZSAiICsgbUpvdXJuYWwuZ2V0QWJzb2x1dGVQYXRoKCkpOworICAgICAgICAgICAgICAgIGlmICghbUpvdXJuYWwuZGVsZXRlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiVW5hYmxlIHRvIHJlbW92ZSBiYWNrdXAgam91cm5hbCBmaWxlICIgKyBtSm91cm5hbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBpbiBiYWNrdXAgdGhyZWFkIiwgZSk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIC8vIE9ubHkgb25jZSB3ZSdyZSBlbnRpcmVseSBmaW5pc2hlZCBkbyB3ZSByZWxlYXNlIHRoZSB3YWtlbG9jaworICAgICAgICAgICAgICAgIG1XYWtlbG9jay5yZWxlYXNlKCk7CiAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIE9ubHkgb25jZSB3ZSdyZSBlbnRpcmVseSBmaW5pc2hlZCBkbyB3ZSByZWxlYXNlIHRoZSB3YWtlbG9jawotICAgICAgICAgICAgbVdha2Vsb2NrLnJlbGVhc2UoKTsKICAgICAgICAgfQogCiAgICAgICAgIHByaXZhdGUgdm9pZCBkb1F1ZXVlZEJhY2t1cHMoSUJhY2t1cFRyYW5zcG9ydCB0cmFuc3BvcnQpIHsKICAgICAgICAgICAgIGZvciAoQmFja3VwUmVxdWVzdCByZXF1ZXN0IDogbVF1ZXVlKSB7CiAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAic3RhcnRpbmcgYWdlbnQgZm9yIGJhY2t1cCBvZiAiICsgcmVxdWVzdCk7CiAKKyAgICAgICAgICAgICAgICAvLyBEb24ndCBydW4gYmFja3VwLCBldmVuIGlmIHJlcXVlc3RlZCwgaWYgdGhlIHRhcmdldCBhcHAgZG9lcyBub3QgaGF2ZQorICAgICAgICAgICAgICAgIC8vIHRoZSByZXF1aXNpdGUgcGVybWlzc2lvbgorICAgICAgICAgICAgICAgIGlmIChtUGFja2FnZU1hbmFnZXIuY2hlY2tQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CQUNLVVBfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwSW5mby5wYWNrYWdlTmFtZSkgIT0gUGFja2FnZU1hbmFnZXIuUEVSTUlTU0lPTl9HUkFOVEVEKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlNraXBwaW5nIGJhY2t1cCBvZiB1bnByaXZpbGVnZWQgcGFja2FnZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyByZXF1ZXN0LmFwcEluZm8ucGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICAgICBJQmFja3VwQWdlbnQgYWdlbnQgPSBudWxsOwogICAgICAgICAgICAgICAgIGludCBtb2RlID0gKHJlcXVlc3QuZnVsbEJhY2t1cCkKICAgICAgICAgICAgICAgICAgICAgICAgID8gSUFwcGxpY2F0aW9uVGhyZWFkLkJBQ0tVUF9NT0RFX0ZVTEwKQEAgLTc0OSwxOSArOTM2LDI3IEBACiAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgImJpbmQvYmFja3VwIHRocmV3Iik7CiAgICAgICAgICAgICAgICAgICAgIGUucHJpbnRTdGFja1RyYWNlKCk7CiAgICAgICAgICAgICAgICAgfQotCiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICB2b2lkIHByb2Nlc3NPbmVCYWNrdXAoQmFja3VwUmVxdWVzdCByZXF1ZXN0LCBJQmFja3VwQWdlbnQgYWdlbnQsIElCYWNrdXBUcmFuc3BvcnQgdHJhbnNwb3J0KSB7CiAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGFja2FnZU5hbWUgPSByZXF1ZXN0LmFwcEluZm8ucGFja2FnZU5hbWU7Ci0gICAgICAgICAgICBMb2cuZChUQUcsICJwcm9jZXNzT25lQmFja3VwIGRvQmFja3VwKCkgb24gIiArIHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAicHJvY2Vzc09uZUJhY2t1cCBkb0JhY2t1cCgpIG9uICIgKyBwYWNrYWdlTmFtZSk7CiAKKyAgICAgICAgICAgIC8vICEhISBUT0RPOiBnZXQgdGhlIHN0YXRlIGZpbGUgZGlyIGZyb20gdGhlIHRyYW5zcG9ydAorICAgICAgICAgICAgRmlsZSBzYXZlZFN0YXRlTmFtZSA9IG5ldyBGaWxlKG1TdGF0ZURpciwgcGFja2FnZU5hbWUpOworICAgICAgICAgICAgRmlsZSBiYWNrdXBEYXRhTmFtZSA9IG5ldyBGaWxlKG1EYXRhRGlyLCBwYWNrYWdlTmFtZSArICIuZGF0YSIpOworICAgICAgICAgICAgRmlsZSBuZXdTdGF0ZU5hbWUgPSBuZXcgRmlsZShtU3RhdGVEaXIsIHBhY2thZ2VOYW1lICsgIi5uZXciKTsKKworICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3Igc2F2ZWRTdGF0ZSA9IG51bGw7CisgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvciBiYWNrdXBEYXRhID0gbnVsbDsKKyAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIG5ld1N0YXRlID0gbnVsbDsKKworICAgICAgICAgICAgUGFja2FnZUluZm8gcGFja0luZm87CiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIC8vIExvb2sgdXAgdGhlIHBhY2thZ2UgaW5mbyAmIHNpZ25hdHVyZXMuICBUaGlzIGlzIGZpcnN0IHNvIHRoYXQgaWYgaXQKICAgICAgICAgICAgICAgICAvLyB0aHJvd3MgYW4gZXhjZXB0aW9uLCB0aGVyZSdzIG5vIGZpbGUgc2V0dXAgeWV0IHRoYXQgd291bGQgbmVlZCB0bwogICAgICAgICAgICAgICAgIC8vIGJlIHVucmF2ZWxlZC4KLSAgICAgICAgICAgICAgICBQYWNrYWdlSW5mbyBwYWNrSW5mbzsKICAgICAgICAgICAgICAgICBpZiAocGFja2FnZU5hbWUuZXF1YWxzKFBBQ0tBR0VfTUFOQUdFUl9TRU5USU5FTCkpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIG1ldGFkYXRhICdwYWNrYWdlJyBpcyBzeW50aGV0aWMKICAgICAgICAgICAgICAgICAgICAgcGFja0luZm8gPSBuZXcgUGFja2FnZUluZm8oKTsKQEAgLTc3MSw2OCArOTY2LDY1IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBQYWNrYWdlTWFuYWdlci5HRVRfU0lHTkFUVVJFUyk7CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgLy8gISEhIFRPRE86IGdldCB0aGUgc3RhdGUgZmlsZSBkaXIgZnJvbSB0aGUgdHJhbnNwb3J0Ci0gICAgICAgICAgICAgICAgRmlsZSBzYXZlZFN0YXRlTmFtZSA9IG5ldyBGaWxlKG1TdGF0ZURpciwgcGFja2FnZU5hbWUpOwotICAgICAgICAgICAgICAgIEZpbGUgYmFja3VwRGF0YU5hbWUgPSBuZXcgRmlsZShtRGF0YURpciwgcGFja2FnZU5hbWUgKyAiLmRhdGEiKTsKLSAgICAgICAgICAgICAgICBGaWxlIG5ld1N0YXRlTmFtZSA9IG5ldyBGaWxlKG1TdGF0ZURpciwgcGFja2FnZU5hbWUgKyAiLm5ldyIpOwotCiAgICAgICAgICAgICAgICAgLy8gSW4gYSBmdWxsIGJhY2t1cCwgd2UgcGFzcyBhIG51bGwgUGFyY2VsRmlsZURlc2NyaXB0b3IgYXMKICAgICAgICAgICAgICAgICAvLyB0aGUgc2F2ZWQtc3RhdGUgImZpbGUiCi0gICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3Igc2F2ZWRTdGF0ZSA9IChyZXF1ZXN0LmZ1bGxCYWNrdXApID8gbnVsbAotICAgICAgICAgICAgICAgICAgICAgICAgOiBQYXJjZWxGaWxlRGVzY3JpcHRvci5vcGVuKHNhdmVkU3RhdGVOYW1lLAorICAgICAgICAgICAgICAgIGlmICghcmVxdWVzdC5mdWxsQmFja3VwKSB7CisgICAgICAgICAgICAgICAgICAgIHNhdmVkU3RhdGUgPSBQYXJjZWxGaWxlRGVzY3JpcHRvci5vcGVuKHNhdmVkU3RhdGVOYW1lLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfUkVBRF9PTkxZIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX0NSRUFURSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9DUkVBVEUpOyAgLy8gTWFrZSBhbiBlbXB0eSBmaWxlIGlmIG5lY2Vzc2FyeQorICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGJhY2t1cERhdGFOYW1lLmRlbGV0ZSgpOwotICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGJhY2t1cERhdGEgPQotICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3Iub3BlbihiYWNrdXBEYXRhTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9SRUFEX1dSSVRFIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9DUkVBVEUpOworICAgICAgICAgICAgICAgIGJhY2t1cERhdGEgPSBQYXJjZWxGaWxlRGVzY3JpcHRvci5vcGVuKGJhY2t1cERhdGFOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9SRUFEX1dSSVRFIHwKKyAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfQ1JFQVRFIHwKKyAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfVFJVTkNBVEUpOwogCi0gICAgICAgICAgICAgICAgbmV3U3RhdGVOYW1lLmRlbGV0ZSgpOwotICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIG5ld1N0YXRlID0KLSAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4obmV3U3RhdGVOYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX1JFQURfV1JJVEUgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX0NSRUFURSk7CisgICAgICAgICAgICAgICAgbmV3U3RhdGUgPSBQYXJjZWxGaWxlRGVzY3JpcHRvci5vcGVuKG5ld1N0YXRlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfUkVBRF9XUklURSB8CisgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX0NSRUFURSB8CisgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX1RSVU5DQVRFKTsKIAogICAgICAgICAgICAgICAgIC8vIFJ1biB0aGUgdGFyZ2V0J3MgYmFja3VwIHBhc3MKLSAgICAgICAgICAgICAgICBib29sZWFuIHN1Y2Nlc3MgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBhZ2VudC5kb0JhY2t1cChzYXZlZFN0YXRlLCBiYWNrdXBEYXRhLCBuZXdTdGF0ZSk7Ci0gICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzYXZlZFN0YXRlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVkU3RhdGUuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBiYWNrdXBEYXRhLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgICAgIG5ld1N0YXRlLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gTm93IHByb3BhZ2F0ZSB0aGUgbmV3bHktYmFja2VkLXVwIGRhdGEgdG8gdGhlIHRyYW5zcG9ydAotICAgICAgICAgICAgICAgIGlmIChzdWNjZXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiZG9CYWNrdXAoKSBzdWNjZXNzIik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChiYWNrdXBEYXRhTmFtZS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJhY2t1cERhdGEgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4oYmFja3VwRGF0YU5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX1JFQURfT05MWSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRyYW5zcG9ydC5wZXJmb3JtQmFja3VwKHBhY2tJbmZvLCBiYWNrdXBEYXRhKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNUT1BTSElQIFRPRE86IGhhbmRsZSBlcnJvcnMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJCYWNrdXAgZmFpbHVyZSBpbiBwZXJmb3JtQmFja3VwKCkiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIm5vIGJhY2t1cCBkYXRhIHdyaXR0ZW47IG5vdCBjYWxsaW5nIHRyYW5zcG9ydCIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gQWZ0ZXIgc3VjY2Vzc2Z1bCB0cmFuc3BvcnQsIGRlbGV0ZSB0aGUgbm93LXN0YWxlIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgLy8gYW5kIGp1Z2dsZSB0aGUgZmlsZXMgc28gdGhhdCBuZXh0IHRpbWUgd2Ugc3VwcGx5IHRoZSBhZ2VudAotICAgICAgICAgICAgICAgICAgICAvLyB3aXRoIHRoZSBuZXcgc3RhdGUgZmlsZSBpdCBqdXN0IGNyZWF0ZWQuCi0gICAgICAgICAgICAgICAgICAgIGJhY2t1cERhdGFOYW1lLmRlbGV0ZSgpOwotICAgICAgICAgICAgICAgICAgICBuZXdTdGF0ZU5hbWUucmVuYW1lVG8oc2F2ZWRTdGF0ZU5hbWUpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBhZ2VudC5kb0JhY2t1cChzYXZlZFN0YXRlLCBiYWNrdXBEYXRhLCBuZXdTdGF0ZSk7CisgICAgICAgICAgICAgICAgbG9nQmFja3VwQ29tcGxldGUocGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiZG9CYWNrdXAoKSBzdWNjZXNzIik7CiAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIGJhY2tpbmcgdXAgIiArIHBhY2thZ2VOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEJBQ0tVUF9BR0VOVF9GQUlMVVJFX0VWRU5ULCBwYWNrYWdlTmFtZSwgZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgICAgICBiYWNrdXBEYXRhTmFtZS5kZWxldGUoKTsKKyAgICAgICAgICAgICAgICBuZXdTdGF0ZU5hbWUuZGVsZXRlKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICB0cnkgeyBpZiAoc2F2ZWRTdGF0ZSAhPSBudWxsKSBzYXZlZFN0YXRlLmNsb3NlKCk7IH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHt9CisgICAgICAgICAgICAgICAgdHJ5IHsgaWYgKGJhY2t1cERhdGEgIT0gbnVsbCkgYmFja3VwRGF0YS5jbG9zZSgpOyB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7fQorICAgICAgICAgICAgICAgIHRyeSB7IGlmIChuZXdTdGF0ZSAhPSBudWxsKSBuZXdTdGF0ZS5jbG9zZSgpOyB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7fQorICAgICAgICAgICAgICAgIHNhdmVkU3RhdGUgPSBiYWNrdXBEYXRhID0gbmV3U3RhdGUgPSBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBOb3cgcHJvcGFnYXRlIHRoZSBuZXdseS1iYWNrZWQtdXAgZGF0YSB0byB0aGUgdHJhbnNwb3J0CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGludCBzaXplID0gKGludCkgYmFja3VwRGF0YU5hbWUubGVuZ3RoKCk7CisgICAgICAgICAgICAgICAgaWYgKHNpemUgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGJhY2t1cERhdGEgPSBQYXJjZWxGaWxlRGVzY3JpcHRvci5vcGVuKGJhY2t1cERhdGFOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfUkVBRF9PTkxZKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIXRyYW5zcG9ydC5wZXJmb3JtQmFja3VwKHBhY2tJbmZvLCBiYWNrdXBEYXRhKSkgdGhyb3cgbmV3IEV4Y2VwdGlvbigpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmkoVEFHLCAibm8gYmFja3VwIGRhdGEgd3JpdHRlbjsgbm90IGNhbGxpbmcgdHJhbnNwb3J0Iik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gQWZ0ZXIgc3VjY2Vzc2Z1bCB0cmFuc3BvcnQsIGRlbGV0ZSB0aGUgbm93LXN0YWxlIGRhdGEKKyAgICAgICAgICAgICAgICAvLyBhbmQganVnZ2xlIHRoZSBmaWxlcyBzbyB0aGF0IG5leHQgdGltZSB3ZSBzdXBwbHkgdGhlIGFnZW50CisgICAgICAgICAgICAgICAgLy8gd2l0aCB0aGUgbmV3IHN0YXRlIGZpbGUgaXQganVzdCBjcmVhdGVkLgorICAgICAgICAgICAgICAgIGJhY2t1cERhdGFOYW1lLmRlbGV0ZSgpOworICAgICAgICAgICAgICAgIG5ld1N0YXRlTmFtZS5yZW5hbWVUbyhzYXZlZFN0YXRlTmFtZSk7CisgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChCQUNLVVBfUEFDS0FHRV9FVkVOVCwgcGFja2FnZU5hbWUsIHNpemUpOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJUcmFuc3BvcnQgZXJyb3IgYmFja2luZyB1cCAiICsgcGFja2FnZU5hbWUsIGUpOworICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoQkFDS1VQX1RSQU5TUE9SVF9GQUlMVVJFX0VWRU5ULCBwYWNrYWdlTmFtZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICB0cnkgeyBpZiAoYmFja3VwRGF0YSAhPSBudWxsKSBiYWNrdXBEYXRhLmNsb3NlKCk7IH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHt9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC04NzgsNyArMTA3MCw2IEBACiAgICAgICAgIHByaXZhdGUgSUJhY2t1cFRyYW5zcG9ydCBtVHJ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IHF1ZXVlCisgICAgICAgICAgICAgKiAgICAyLmEuIGlmIGl0J3MgcmVzdG9yYWJsZSBvbiB0aGlzIGRldmljZSwgYWRkIGl0IHRvIHRoZSByZXN0b3JlIHF1ZXVlCiAgICAgICAgICAgICAgKiAzLiBmb3IgZWFjaCBhcHAgaW4gdGhlIHJlc3RvcmUgcXVldWU6CiAgICAgICAgICAgICAgKiAgICAzLmEuIGNsZWFyIHRoZSBhcHAgZGF0YQogICAgICAgICAgICAgICogICAgMy5iLiBnZXQgdGhlIHJlc3RvcmUgZGF0YSBmb3IgdGhlIGFwcCBmcm9tIHRoZSB0cmFuc3BvcnQKQEAgLTkyMywyNSArMTExNSwxOCBAQAogICAgICAgICAgICAgICogICAgMy5kLiBhZ2VudC5kb1Jlc3RvcmUoKSB3aXRoIHRoZSBkYXRhIGZyb20gdGhlIHNlcnZlcgogICAgICAgICAgICAgICogICAgMy5lLiB1bmJpbmQgdGhlIGFnZW50IFthbmQga2lsbCB0aGUgYXBwP10KICAgICAgICAgICAgICAqIDQuIHNodXQgZG93biB0aGUgdHJhbnNwb3J0CisgICAgICAgICAgICAgKgorICAgICAgICAgICAgICogT24gZXJyb3JzLCB3ZSB0cnkgb3VyIGJlc3QgdG8gcmVjb3ZlciBhbmQgbW92ZSBvbiB0byB0aGUgbmV4dAorICAgICAgICAgICAgICogYXBwbGljYXRpb24sIGJ1dCBpZiBuZWNlc3Nhcnkgd2UgYWJvcnQgdGhlIHdob2xlIG9wZXJhdGlvbiAtLQorICAgICAgICAgICAgICogdGhlIHVzZXIgaXMgd2FpdGluZywgYWZ0ZXIgYWwuCiAgICAgICAgICAgICAgKi8KIAogICAgICAgICAgICAgaW50IGVycm9yID0gLTE7IC8vIGFzc3VtZSBlcnJvcgogCiAgICAgICAgICAgICAvLyBidWlsZCB0aGUgc2V0IG9mIGFwcHMgdG8gcmVzdG9yZQogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBSZXN0b3JlU2V0W10gaW1hZ2VzID0gbVRyYW5zcG9ydC5nZXRBdmFpbGFibGVSZXN0b3JlU2V0cygpOwotICAgICAgICAgICAgICAgIGlmIChpbWFnZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAvLyBTVE9QU0hJUCBUT0RPOiBIYW5kbGUgdGhlIGZhaWx1cmUgc29tZWhvdz8KLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgZ2V0dGluZyByZXN0b3JlIHNldHMiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChpbWFnZXMubGVuZ3RoID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiTm8gcmVzdG9yZSBzZXRzIGF2YWlsYWJsZSIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbUltYWdlID0gaW1hZ2VzWzBdOworICAgICAgICAgICAgICAgIC8vIFRPRE86IExvZyB0aGlzIGJlZm9yZSBnZXRBdmFpbGFibGVSZXN0b3JlU2V0cywgc29tZWhvdworICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoUkVTVE9SRV9TVEFSVF9FVkVOVCwgbVRyYW5zcG9ydC50cmFuc3BvcnREaXJOYW1lKCkpOwogCiAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBsaXN0IG9mIGFsbCBwYWNrYWdlcyB3aGljaCBoYXZlIGJhY2t1cCBlbmFibGVkLgogICAgICAgICAgICAgICAgIC8vIChJbmNsdWRlIHRoZSBQYWNrYWdlIE1hbmFnZXIgbWV0YWRhdGEgcHNldWRvLXBhY2thZ2UgZmlyc3QuKQpAQCAtOTY2LDIyICsxMTUxLDI2IEBACiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgaWYgKCFtVHJhbnNwb3J0LnN0YXJ0UmVzdG9yZShtVG9rZW4sIHJlc3RvcmVQYWNrYWdlcy50b0FycmF5KG5ldyBQYWNrYWdlSW5mb1swXSkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFNUT1BTSElQIFRPRE86IEhhbmRsZSB0aGUgZmFpbHVyZSBzb21laG93PwogICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBzdGFydGluZyByZXN0b3JlIG9wZXJhdGlvbiIpOworICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KFJFU1RPUkVfVFJBTlNQT1JUX0ZBSUxVUkVfRVZFTlQpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgU3RyaW5nIHBhY2thZ2VOYW1lID0gbVRyYW5zcG9ydC5uZXh0UmVzdG9yZVBhY2thZ2UoKTsKICAgICAgICAgICAgICAgICBpZiAocGFja2FnZU5hbWUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAvLyBTVE9QU0hJUCBUT0RPOiBIYW5kbGUgdGhlIGZhaWx1cmUgc29tZWhvdz8KICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgZ2V0dGluZyBmaXJzdCByZXN0b3JlIHBhY2thZ2UiKTsKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChSRVNUT1JFX1RSQU5TUE9SVF9GQUlMVVJFX0VWRU5UKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFja2FnZU5hbWUuZXF1YWxzKCIiKSkgewogICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJObyByZXN0b3JlIGRhdGEgYXZhaWxhYmxlIik7CisgICAgICAgICAgICAgICAgICAgIGludCBtaWxsaXMgPSAoaW50KSAoU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCkgLSBzdGFydFJlYWx0aW1lKTsKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChSRVNUT1JFX1NVQ0NFU1NfRVZFTlQsIDAsIG1pbGxpcyk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFwYWNrYWdlTmFtZS5lcXVhbHMoUEFDS0FHRV9NQU5BR0VSX1NFTlRJTkVMKSkgewogICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFeHBlY3RlZCByZXN0b3JlIGRhdGEgZm9yIFwiIiArIFBBQ0tBR0VfTUFOQUdFUl9TRU5USU5FTAogICAgICAgICAgICAgICAgICAgICAgICAgICArICJcIiwgZm91bmQgb25seSBcIiIgKyBwYWNrYWdlTmFtZSArICJcIiIpOworICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KFJFU1RPUkVfQUdFTlRfRkFJTFVSRV9FVkVOVCwgUEFDS0FHRV9NQU5BR0VSX1NFTlRJTkVMLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQYWNrYWdlIG1hbmFnZXIgZGF0YSBtaXNzaW5nIik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAKQEAgLTk5NCwyMyArMTE4MywyNSBAQAogICAgICAgICAgICAgICAgIC8vIHNpZ25hdHVyZS92ZXJzaW9uIHZlcmlmaWNhdGlvbiBldGMsIHNvIHdlIHNpbXBseSBkbyBub3QgcHJvY2VlZCB3aXRoCiAgICAgICAgICAgICAgICAgLy8gdGhlIHJlc3RvcmUgb3BlcmF0aW9uLgogICAgICAgICAgICAgICAgIGlmICghcG1BZ2VudC5oYXNNZXRhZGF0YSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIk5vIHJlc3RvcmUgbWV0YWRhdGEgYXZhaWxhYmxlLCBzbyBub3QgcmVzdG9yaW5nIHNldHRpbmdzIik7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIk5vIHJlc3RvcmUgbWV0YWRhdGEgYXZhaWxhYmxlLCBzbyBub3QgcmVzdG9yaW5nIHNldHRpbmdzIik7CisgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoUkVTVE9SRV9BR0VOVF9GQUlMVVJFX0VWRU5ULCBQQUNLQUdFX01BTkFHRVJfU0VOVElORUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlBhY2thZ2UgbWFuYWdlciByZXN0b3JlIG1ldGFkYXRhIG1pc3NpbmciKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIGludCBjb3VudCA9IDA7CiAgICAgICAgICAgICAgICAgZm9yICg7OykgewogICAgICAgICAgICAgICAgICAgICBwYWNrYWdlTmFtZSA9IG1UcmFuc3BvcnQubmV4dFJlc3RvcmVQYWNrYWdlKCk7CisKICAgICAgICAgICAgICAgICAgICAgaWYgKHBhY2thZ2VOYW1lID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNUT1BTSElQIFRPRE86IEhhbmRsZSB0aGUgZmFpbHVyZSBzb21laG93PwogICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgZ2V0dGluZyBuZXh0IHJlc3RvcmUgcGFja2FnZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChSRVNUT1JFX1RSQU5TUE9SVF9GQUlMVVJFX0VWRU5UKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwYWNrYWdlTmFtZS5lcXVhbHMoIiIpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIGlmIChtT2JzZXJ2ZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgKytjb3VudDsKICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU9ic2VydmVyLm9uVXBkYXRlKGNvdW50KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CkBAIC0xMDIyLDIxICsxMjEzLDM0IEBACiAgICAgICAgICAgICAgICAgICAgIE1ldGFkYXRhIG1ldGFJbmZvID0gcG1BZ2VudC5nZXRSZXN0b3JlZE1ldGFkYXRhKHBhY2thZ2VOYW1lKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGFJbmZvID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIk1pc3NpbmcgbWV0YWRhdGEgZm9yICIgKyBwYWNrYWdlTmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KFJFU1RPUkVfQUdFTlRfRkFJTFVSRV9FVkVOVCwgcGFja2FnZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQYWNrYWdlIG1ldGFkYXRhIG1pc3NpbmciKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAgICAgaW50IGZsYWdzID0gUGFja2FnZU1hbmFnZXIuR0VUX1NJR05BVFVSRVM7Ci0gICAgICAgICAgICAgICAgICAgIFBhY2thZ2VJbmZvIHBhY2thZ2VJbmZvID0gbVBhY2thZ2VNYW5hZ2VyLmdldFBhY2thZ2VJbmZvKHBhY2thZ2VOYW1lLCBmbGFncyk7CisgICAgICAgICAgICAgICAgICAgIFBhY2thZ2VJbmZvIHBhY2thZ2VJbmZvOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZsYWdzID0gUGFja2FnZU1hbmFnZXIuR0VUX1NJR05BVFVSRVM7CisgICAgICAgICAgICAgICAgICAgICAgICBwYWNrYWdlSW5mbyA9IG1QYWNrYWdlTWFuYWdlci5nZXRQYWNrYWdlSW5mbyhwYWNrYWdlTmFtZSwgZmxhZ3MpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChOYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSW52YWxpZCBwYWNrYWdlIHJlc3RvcmluZyBkYXRhIiwgZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KFJFU1RPUkVfQUdFTlRfRkFJTFVSRV9FVkVOVCwgcGFja2FnZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQYWNrYWdlIG1pc3Npbmcgb24gZGV2aWNlIik7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgICAgIGlmIChtZXRhSW5mby52ZXJzaW9uQ29kZSA+IHBhY2thZ2VJbmZvLnZlcnNpb25Db2RlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJQYWNrYWdlICIgKyBwYWNrYWdlTmFtZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgcmVzdG9yZSB2ZXJzaW9uIFsiICsgbWV0YUluZm8udmVyc2lvbkNvZGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiXSBpcyB0b28gbmV3IGZvciBpbnN0YWxsZWQgdmVyc2lvbiBbIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHBhY2thZ2VJbmZvLnZlcnNpb25Db2RlICsgIl0iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBtZXNzYWdlID0gIlZlcnNpb24gIiArIG1ldGFJbmZvLnZlcnNpb25Db2RlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiA+IGluc3RhbGxlZCB2ZXJzaW9uICIgKyBwYWNrYWdlSW5mby52ZXJzaW9uQ29kZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlBhY2thZ2UgIiArIHBhY2thZ2VOYW1lICsgIjogIiArIG1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChSRVNUT1JFX0FHRU5UX0ZBSUxVUkVfRVZFTlQsIHBhY2thZ2VOYW1lLCBtZXNzYWdlKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgaWYgKCFzaWduYXR1cmVzTWF0Y2gobWV0YUluZm8uc2lnbmF0dXJlcywgcGFja2FnZUluZm8uc2lnbmF0dXJlcykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlNpZ25hdHVyZSBtaXNtYXRjaCByZXN0b3JpbmcgIiArIHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoUkVTVE9SRV9BR0VOVF9GQUlMVVJFX0VWRU5ULCBwYWNrYWdlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNpZ25hdHVyZSBtaXNtYXRjaCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgIH0KIApAQCAtMTA0NSw0MSArMTI0OSw2NiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIl0gaXMgY29tcGF0aWJsZSB3aXRoIGluc3RhbGxlZCB2ZXJzaW9uIFsiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBwYWNrYWdlSW5mby52ZXJzaW9uQ29kZSArICJdIik7CiAKLSAgICAgICAgICAgICAgICAgICAgLy8gTm93IHBlcmZvcm0gdGhlIGFjdHVhbCByZXN0b3JlCisgICAgICAgICAgICAgICAgICAgIC8vIE5vdyBwZXJmb3JtIHRoZSBhY3R1YWwgcmVzdG9yZTogIGZpcnN0IGNsZWFyIHRoZSBhcHAncyBkYXRhCisgICAgICAgICAgICAgICAgICAgIC8vIGlmIGFwcHJvcHJpYXRlCiAgICAgICAgICAgICAgICAgICAgIGNsZWFyQXBwbGljYXRpb25EYXRhU3luY2hyb25vdXMocGFja2FnZU5hbWUpOworCisgICAgICAgICAgICAgICAgICAgIC8vIFRoZW4gc2V0IHVwIGFuZCBiaW5kIHRoZSBhZ2VudCAod2l0aCBhIHJlc3RyaWN0ZWQgQXBwbGljYXRpb24gb2JqZWN0CisgICAgICAgICAgICAgICAgICAgIC8vIHVubGVzcyB0aGUgYXBwbGljYXRpb24gc2F5cyBvdGhlcndpc2UpCisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNlUmVhbEFwcCA9IChwYWNrYWdlSW5mby5hcHBsaWNhdGlvbkluZm8uZmxhZ3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmIEFwcGxpY2F0aW9uSW5mby5GTEFHX1JFU1RPUkVfTkVFRFNfQVBQTElDQVRJT04pICE9IDA7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRyAmJiB1c2VSZWFsQXBwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJhZ2VudCByZXF1aXJlcyByZWFsIEFwcGxpY2F0aW9uIHN1YmNsYXNzIGZvciByZXN0b3JlIik7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgSUJhY2t1cEFnZW50IGFnZW50ID0gYmluZFRvQWdlbnRTeW5jaHJvbm91cygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWNrYWdlSW5mby5hcHBsaWNhdGlvbkluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSUFwcGxpY2F0aW9uVGhyZWFkLkJBQ0tVUF9NT0RFX1JFU1RPUkUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1c2VSZWFsQXBwID8gSUFwcGxpY2F0aW9uVGhyZWFkLkJBQ0tVUF9NT0RFX0lOQ1JFTUVOVEFMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IElBcHBsaWNhdGlvblRocmVhZC5CQUNLVVBfTU9ERV9SRVNUT1JFKSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChhZ2VudCA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJDYW4ndCBmaW5kIGJhY2t1cCBhZ2VudCBmb3IgIiArIHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoUkVTVE9SRV9BR0VOVF9GQUlMVVJFX0VWRU5ULCBwYWNrYWdlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlc3RvcmUgYWdlbnQgbWlzc2luZyIpOwogICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgICAgICAgICAvLyBBbmQgdGhlbiBmaW5hbGx5IHJ1biB0aGUgcmVzdG9yZSBvbiB0aGlzIGFnZW50CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzT25lUmVzdG9yZShwYWNrYWdlSW5mbywgbWV0YUluZm8udmVyc2lvbkNvZGUsIGFnZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICsrY291bnQ7CiAgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyB1bmJpbmQgZXZlbiBvbiB0aW1lb3V0IG9yIGZhaWx1cmUsIGp1c3QgaW4gY2FzZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdW5iaW5kIGFuZCB0aWR5IHVwIGV2ZW4gb24gdGltZW91dCBvciBmYWlsdXJlLCBqdXN0IGluIGNhc2UKICAgICAgICAgICAgICAgICAgICAgICAgIG1BY3Rpdml0eU1hbmFnZXIudW5iaW5kQmFja3VwQWdlbnQocGFja2FnZUluZm8uYXBwbGljYXRpb25JbmZvKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGFnZW50IHdhcyBwcm9iYWJseSBydW5uaW5nIHdpdGggYSBzdHViIEFwcGxpY2F0aW9uIG9iamVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoaWNoIGlzbid0IGEgdmFsaWQgcnVuIG1vZGUgZm9yIHRoZSBtYWluIGFwcCBsb2dpYy4gIFNodXQKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvd24gdGhlIGFwcCBzbyB0aGF0IG5leHQgdGltZSBpdCdzIGxhdW5jaGVkLCBpdCBnZXRzIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXN1YWwgZnVsbCBpbml0aWFsaXphdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocGFja2FnZUluZm8uYXBwbGljYXRpb25JbmZvLmZsYWdzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYgQXBwbGljYXRpb25JbmZvLkZMQUdfS0lMTF9BRlRFUl9SRVNUT1JFKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJSZXN0b3JlIGNvbXBsZXRlLCBraWxsaW5nIGhvc3QgcHJvY2VzcyBvZiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHBhY2thZ2VJbmZvLmFwcGxpY2F0aW9uSW5mby5wcm9jZXNzTmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2aXR5TWFuYWdlci5raWxsQXBwbGljYXRpb25Qcm9jZXNzKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZUluZm8uYXBwbGljYXRpb25JbmZvLnByb2Nlc3NOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZUluZm8uYXBwbGljYXRpb25JbmZvLnVpZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAvLyBpZiB3ZSBnZXQgdGhpcyBmYXIsIHJlcG9ydCBzdWNjZXNzIHRvIHRoZSBvYnNlcnZlcgogICAgICAgICAgICAgICAgIGVycm9yID0gMDsKLSAgICAgICAgICAgIH0gY2F0Y2ggKE5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgLy8gU1RPUFNISVAgVE9ETzogSGFuZGxlIHRoZSBmYWlsdXJlIHNvbWVob3c/Ci0gICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSW52YWxpZCBwYWFja2FnZSByZXN0b3JpbmcgZGF0YSIsIGUpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAvLyBTVE9QU0hJUCBUT0RPOiBIYW5kbGUgdGhlIGZhaWx1cmUgc29tZWhvdz8KLSAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciByZXN0b3JpbmcgZGF0YSIsIGUpOworICAgICAgICAgICAgICAgIGludCBtaWxsaXMgPSAoaW50KSAoU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCkgLSBzdGFydFJlYWx0aW1lKTsKKyAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KFJFU1RPUkVfU1VDQ0VTU19FVkVOVCwgY291bnQsIG1pbGxpcyk7CisgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIGluIHJlc3RvcmUgdGhyZWFkIiwgZSk7CiAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiZmluaXNoaW5nIHJlc3RvcmUgbU9ic2VydmVyPSIgKyBtT2JzZXJ2ZXIpOworCiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgbVRyYW5zcG9ydC5maW5pc2hSZXN0b3JlKCk7CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRXJyb3IgZmluaXNoaW5nIHJlc3RvcmUiLCBlKTsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJmaW5pc2hpbmcgcmVzdG9yZSBtT2JzZXJ2ZXI9IiArIG1PYnNlcnZlcik7Ci0KICAgICAgICAgICAgICAgICBpZiAobU9ic2VydmVyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1PYnNlcnZlci5yZXN0b3JlRmluaXNoZWQoZXJyb3IpOwpAQCAtMTA5OCw1MSArMTMyNyw2NCBAQAogICAgICAgICAgICAgLy8gISEhIFRPRE86IGFjdHVhbGx5IHJ1biB0aGUgcmVzdG9yZSB0aHJvdWdoIG1UcmFuc3BvcnQKICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBwYWNrYWdlTmFtZSA9IGFwcC5wYWNrYWdlTmFtZTsKIAotICAgICAgICAgICAgTG9nLmQoVEFHLCAicHJvY2Vzc09uZVJlc3RvcmUgcGFja2FnZU5hbWU9IiArIHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAicHJvY2Vzc09uZVJlc3RvcmUgcGFja2FnZU5hbWU9IiArIHBhY2thZ2VOYW1lKTsKKworICAgICAgICAgICAgLy8gRG9uJ3QgcmVzdG9yZSB0byB1bnByaXZpbGVnZWQgcGFja2FnZXMKKyAgICAgICAgICAgIGlmIChtUGFja2FnZU1hbmFnZXIuY2hlY2tQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CQUNLVVBfREFUQSwKKyAgICAgICAgICAgICAgICAgICAgcGFja2FnZU5hbWUpICE9IFBhY2thZ2VNYW5hZ2VyLlBFUk1JU1NJT05fR1JBTlRFRCkgeworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlNraXBwaW5nIHJlc3RvcmUgb2YgdW5wcml2aWxlZ2VkIHBhY2thZ2UgIiArIHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgLy8gISEhIFRPRE86IGdldCB0aGUgZGlycyBmcm9tIHRoZSB0cmFuc3BvcnQKICAgICAgICAgICAgIEZpbGUgYmFja3VwRGF0YU5hbWUgPSBuZXcgRmlsZShtRGF0YURpciwgcGFja2FnZU5hbWUgKyAiLnJlc3RvcmUiKTsKLSAgICAgICAgICAgIGJhY2t1cERhdGFOYW1lLmRlbGV0ZSgpOwotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvciBiYWNrdXBEYXRhID0KLSAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3Iub3BlbihiYWNrdXBEYXRhTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX1JFQURfV1JJVEUgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfQ1JFQVRFKTsKKyAgICAgICAgICAgIEZpbGUgbmV3U3RhdGVOYW1lID0gbmV3IEZpbGUobVN0YXRlRGlyLCBwYWNrYWdlTmFtZSArICIubmV3Iik7CisgICAgICAgICAgICBGaWxlIHNhdmVkU3RhdGVOYW1lID0gbmV3IEZpbGUobVN0YXRlRGlyLCBwYWNrYWdlTmFtZSk7CiAKKyAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIGJhY2t1cERhdGEgPSBudWxsOworICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IgbmV3U3RhdGUgPSBudWxsOworCisgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIC8vIFJ1biB0aGUgdHJhbnNwb3J0J3MgcmVzdG9yZSBwYXNzCi0gICAgICAgICAgICAgICAgLy8gUnVuIHRoZSB0YXJnZXQncyBiYWNrdXAgcGFzcwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbVRyYW5zcG9ydC5nZXRSZXN0b3JlRGF0YShiYWNrdXBEYXRhKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gU1RPUFNISVAgVE9ETzogSGFuZGxlIHRoaXMgZXJyb3Igc29tZWhvdz8KLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIGdldHRpbmcgcmVzdG9yZSBkYXRhIGZvciAiICsgcGFja2FnZU5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgYmFja3VwRGF0YS5jbG9zZSgpOworICAgICAgICAgICAgICAgIGJhY2t1cERhdGEgPSBQYXJjZWxGaWxlRGVzY3JpcHRvci5vcGVuKGJhY2t1cERhdGFOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfUkVBRF9XUklURSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9DUkVBVEUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfVFJVTkNBVEUpOworCisgICAgICAgICAgICAgICAgaWYgKCFtVHJhbnNwb3J0LmdldFJlc3RvcmVEYXRhKGJhY2t1cERhdGEpKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIGdldHRpbmcgcmVzdG9yZSBkYXRhIGZvciAiICsgcGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KFJFU1RPUkVfVFJBTlNQT1JUX0ZBSUxVUkVfRVZFTlQpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgLy8gT2theSwgd2UgaGF2ZSB0aGUgZGF0YS4gIE5vdyBoYXZlIHRoZSBhZ2VudCBkbyB0aGUgcmVzdG9yZS4KLSAgICAgICAgICAgICAgICBGaWxlIG5ld1N0YXRlTmFtZSA9IG5ldyBGaWxlKG1TdGF0ZURpciwgcGFja2FnZU5hbWUgKyAiLm5ldyIpOwotICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIG5ld1N0YXRlID0KLSAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3Iub3BlbihuZXdTdGF0ZU5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9SRUFEX1dSSVRFIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvci5NT0RFX0NSRUFURSk7Ci0KKyAgICAgICAgICAgICAgICBiYWNrdXBEYXRhLmNsb3NlKCk7CiAgICAgICAgICAgICAgICAgYmFja3VwRGF0YSA9IFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4oYmFja3VwRGF0YU5hbWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9SRUFEX09OTFkpOwogCi0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgYWdlbnQuZG9SZXN0b3JlKGJhY2t1cERhdGEsIGFwcFZlcnNpb25Db2RlLCBuZXdTdGF0ZSk7Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgbmV3U3RhdGUuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgYmFja3VwRGF0YS5jbG9zZSgpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9IFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4obmV3U3RhdGVOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfUkVBRF9XUklURSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsRmlsZURlc2NyaXB0b3IuTU9ERV9DUkVBVEUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yLk1PREVfVFJVTkNBVEUpOworCisgICAgICAgICAgICAgICAgYWdlbnQuZG9SZXN0b3JlKGJhY2t1cERhdGEsIGFwcFZlcnNpb25Db2RlLCBuZXdTdGF0ZSk7CiAKICAgICAgICAgICAgICAgICAvLyBpZiBldmVyeXRoaW5nIHdlbnQgb2theSwgcmVtZW1iZXIgdGhlIHJlY29yZGVkIHN0YXRlIG5vdwotICAgICAgICAgICAgICAgIEZpbGUgc2F2ZWRTdGF0ZU5hbWUgPSBuZXcgRmlsZShtU3RhdGVEaXIsIHBhY2thZ2VOYW1lKTsKICAgICAgICAgICAgICAgICBuZX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yIgKyBwYWNrYWdlTmFtZSArICInIgorICAgICAgICAgICAgICAgICAgICArICIgdWlkPSIgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTI4OCwxMCArMTUzMiwxMiBAQAogICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiRm91bmQgdGhlIGFwcCAtIHJ1bm5pbmcgY2xlYXIgcHJvY2VzcyIpOwogICAgICAgICAgICAgICAgIC8vIGZvdW5kIGl0OyBmaXJlIG9mZiB0aGUgY2xlYXIgcmVxdWVzdAogICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVF1ZXVlTG9jaykgeworICAgICAgICAgICAgICAgICAgICBsb25nIG9sZElkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgICAgICAgICAgICAgIG1XYWtlbG9jay5hY3F1aXJlKCk7CiAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gbUJhY2t1cEhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfUlVOX0NMRUFSLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBDbGVhclBhcmFtcyhnZXRUcmFuc3BvcnQobUN1cnJlbnRUcmFuc3BvcnQpLCBpbmZvKSk7CiAgICAgICAgICAgICAgICAgICAgIG1CYWNrdXBIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KG9sZElkKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CkBAIC0xMzAxLDcgKzE1NDcsNyBAQAogICAgIC8vIFJ1biBhIGJhY2t1cCBwYXNzIGltbWVkaWF0ZWx5IGZvciBhbnkgYXBwbGljYXRpb25zIHRoYXQgaGF2ZSBkZWNsYXJlZAogICAgIC8v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7CisgICAgICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJBQ0tVUCwKICAgICAgICAgICAgICAgICAgICAgImdldEF2YWlsYWJsZVJlc3RvcmVTZXRzIik7CiAKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgewotICAgICAgICAgICAgICAgIGlmIChtUmVzdG9yZVNldHMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChtUmVzdG9yZVRyYW5zcG9ydCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIk51bGwgdHJhbnNwb3J0IGdldHRpbmcgcmVzdG9yZSBzZXRzIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobVJlc3RvcmVTZXRzID09IG51bGwpIHsgLy8gdmFsaWQgdHJhbnNwb3J0OyBkbyB0aGUgb25lLXRpbWUgZmV0Y2gKICAgICAgICAgICAgICAgICAgICAgbVJlc3RvcmVTZXRzID0gbVJlc3RvcmVUcmFuc3BvcnQuZ2V0QXZhaWxhYmxlUmVzdG9yZVNldHMoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1SZXN0b3JlU2V0cyA9PSBudWxsKSBFdmVudExvZy53cml0ZUV2ZW50KFJFU1RPUkVfVFJBTlNQT1JUX0ZBSUxVUkVfRVZFTlQpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm4gbVJlc3RvcmVTZXRzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiZ2V0QXZhaWxhYmxlUmVzdG9yZVNldHMgZXhjZXB0aW9uIik7Ci0gICAgICAgICAgICAgICAgZS5wcmludFN0YWNrVHJhY2UoKTsKLSAgICAgICAgICAgICAgICB0aHJvdyBlOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBpbiBnZXRBdmFpbGFibGVSZXN0b3JlU2V0cyIsIGUpOworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgcHVibGljIGludCBwZXJmb3JtUmVzdG9yZShsb25nIHRva2VuLCBJUmVzdG9yZU9ic2VydmVyIG9ic2VydmVyKQotICAgICAgICAgICAgICAgIHRocm93cyBhbmRyb2lkLm9zLlJlbW90ZUV4Y2VwdGlvbiB7Ci0gICAgICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ1Blcm1pc3Npb24oYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJBQ0tVUCwgInBlcmZvcm1SZXN0b3JlIik7CisgICAgICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IHBlcmZvcm1SZXN0b3JlKGxvbmcgdG9rZW4sIElSZXN0b3JlT2JzZXJ2ZXIgb2JzZXJ2ZXIpIHsKKyAgICAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uQkFDS1VQLAorICAgICAgICAgICAgICAgICAgICAicGVyZm9ybVJlc3RvcmUiKTsKIAotICAgICAgICAgICAgTG9nLmQoVEFHLCAicGVyZm9ybVJlc3RvcmUgdG9rZW49IiArIHRva2VuICsgIiBvYnNlcnZlcj0iICsgb2JzZXJ2ZXIpOworICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJwZXJmb3JtUmVzdG9yZSB0b2tlbj0iICsgTG9uZy50b0hleFN0cmluZyh0b2tlbikKKyAgICAgICAgICAgICAgICAgICAgKyAiIG9ic2VydmVyPSIgKyBvYnNlcnZlcik7CiAKLSAgICAgICAgICAgIGlmIChtUmVzdG9yZVNldHMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbVJlc3RvcmVTZXRzLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbiA9PSBtUmVzdG9yZVNldHNbaV0udG9rZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1XYWtlbG9jay5hY3F1aXJlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1CYWNrdXBIYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX1JVTl9SRVNUT1JFKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5vYmogPSBuZXcgUmVzdG9yZVBhcmFtcyhtUmVzdG9yZVRyYW5zcG9ydCwgb2JzZXJ2ZXIsIHRva2VuKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CYWNrdXBIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJObyBjdXJyZW50IHJlc3RvcmUgc2V0LCBub3QgZG9pbmcgcmVzdG9yZSIpOworICAgICAgICAgICAgaWYgKG1SZXN0b3JlVHJhbnNwb3J0ID09IG51bGwgfHwgbVJlc3RvcmVTZXRzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJZ25vcmluZyBwZXJmb3JtUmVzdG9yZSgpIHdpdGggbm8gcmVzdG9yZSBzZXQiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbVJlc3RvcmVTZXRzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgaWYgKHRva2VuID09IG1SZXN0b3JlU2V0c1tpXS50b2tlbikgeworICAgICAgICAgICAgICAgICAgICBsb25nIG9sZElkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgICAgICAgICAgICAgIG1XYWtlbG9jay5hY3F1aXJlKCk7CisgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gbUJhY2t1cEhhbmRsZXIub2J0YWluTWVzc2FnZShNU0dfUlVOX1JFU1RPUkUpOworICAgICAgICAgICAgICAgICAgICBtc2cub2JqID0gbmV3IFJlc3RvcmVQYXJhbXMobVJlc3RvcmVUcmFuc3BvcnQsIG9ic2VydmVyLCB0b2tlbik7CisgICAgICAgICAgICAgICAgICAgIG1CYWNrdXBIYW5kbGVyLnNlbmRNZXNzYWdlKG1zZyk7CisgICAgICAgICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KG9sZElkKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBMb2cudyhUQUcsICJSZXN0b3JlIHRva2VuICIgKyBMb25nLnRvSGV4U3RyaW5nKHRva2VuKSArICIgbm90IGZvdW5kIik7CiAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgIH0KIAotICAgICAgICBwdWJsaWMgdm9pZCBlbmRSZXN0b3JlU2Vzc2lvbigpIHRocm93cyBhbmRyb2lkLm9zLlJlbW90ZUV4Y2VwdGlvbiB7Ci0gICAgICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ1Blcm1pc3Npb24oYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJBQ0tVUCwKKyAgICAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIGVuZFJlc3RvcmVTZXNzaW9uKCkgeworICAgICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CQUNLVVAsCiAgICAgICAgICAgICAgICAgICAgICJlbmRSZXN0b3JlU2Vzc2lvbiIpOwogCi0gICAgICAgICAgICBMb2cuZChUQUcsICJlbmRSZXN0b3JlU2Vzc2lvbiIpOworICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJlbmRSZXN0b3JlU2Vzc2lvbiIpOwogCi0gICAgICAgICAgICBtUmVzdG9yZVRyYW5zcG9ydC5maW5pc2hSZXN0b3JlKCk7Ci0gICAgICAgICAgICBtUmVzdG9yZVRyYW5zcG9ydCA9IG51bGw7Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQoQmFja3VwTWFuYWdlclNlcnZpY2UudGhpcykgeworICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1SZXN0b3JlVHJhbnNwb3J0ICE9IG51bGwpIG1SZXN0b3JlVHJhbnNwb3J0LmZpbmlzaFJlc3RvcmUoKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBpbiBmaW5pc2hSZXN0b3JlIiwgZSk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgbVJlc3RvcmVUcmFuc3BvcnQgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3luY2hyb25pemVkIChCYWNrdXBNYW5hZ2VyU2VydmljZS50aGlzKSB7CiAgICAgICAgICAgICAgICAgaWYgKEJhY2t1cE1hbmFnZXJTZXJ2aWNlLnRoaXMubUFjdGl2ZVJlc3RvcmVTZXNzaW9uID09IHRoaXMpIHsKICAgICAgICAgICAgICAgICAgICAgQmFja3VwTWFuYWdlclNlcnZpY2UudGhpcy5tQWN0aXZlUmVzdG9yZVNlc3Npb24gPSBudWxsOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC0xNTQ2LDggKzE4MDgsNiBAQAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIGR1bXAoRmlsZURlc2NyaXB0b3IgZmQsIFByaW50V3JpdGVyIHB3LCBTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVF1ZXVlTG9jaykgewotICAgICAgICAgICAgbG9uZyBvbGRJZCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwotCiAgICAgICAgICAgICBwdy5wcmludGxuKCJCYWNrdXAgTWFuYWdlciBpcyAiICsgKG1FbmFibGVkID8gImVuYWJsZWQiIDogImRpc2FibGVkIikKICAgICAgICAgICAgICAgICAgICAgKyAiIC8gIiArICghbVByb3Zpc2lvbmVkID8gIm5vdCAiIDogIiIpICsgInByb3Zpc2lvbmVkIik7CiAgICAgICAgICAgICBwdy5wcmludGxuKCJBdmFpbGFibGUgdHJhbnNwb3J0czoiKTsKQEAgLTE1NjYsMTIgKzE4MjYsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICAgICIgKyBhcHAudG9TdHJpbmcoKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgcHcucHJpbnRsbigiRXZlciBiYWNrZWQgdXA6ICIgKyBtRXZlclN0b3JlZEFwcHMuc2l6ZSgpKTsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHBrZyA6IG1FdmVyU3RvcmVkQXBwcykgeworICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgICAiICsgcGtn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fTEVWRUw7CiAgICAgICAgIGlmIChtQWNPbmxpbmUpIHsKICAgICAgICAgICAgIG1QbHVnVHlwZSA9IEJhdHRlcnlNYW5hZ2VyLkJBVFRFUllfUExVR0dFRF9BQzsKQEAgLTI1MCwxNiArMjcxLDI4IEBACiAgICAgICAgICAgICAvLyBTZXBhcmF0ZSBicm9hZGNhc3QgaXMgc2VudCBmb3IgcG93ZXIgY29ubmVjdGVkIC8gbm90IGNvbm5lY3RlZAogICAgICAgICAgICAgLy8gc2luY2UgdGhlIHN0YW5kYXJkIGludGVudCB3aWxsIG5vdCB3YWtlIGFueSBhcHBsaWNhdGlvbnMgYW5kIHNvbWUKICAgICAgICAgICAgIC8vIGFwcGxpY2F0aW9ucyBtYXkgd2FudCB0byBoYXZlIHNtYXJ0IGJlaGF2aW9yIGJhc2VkIG9uIHRoaXMuCisgICAgICAgICAgICBJbnRlbnQgc3RhdHVzSW50ZW50ID0gbmV3IEludGVudCgpOworICAgICAgICAgICAgc3RhdHVzSW50ZW50LnNldEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWV9CRUZPUkVfQk9PVCk7CiAgICAgICAgICAgICBpZiAobVBsdWdUeXBlICE9IDAgJiYgbUxhc3RQbHVnVHlwZSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9QT1dFUl9DT05ORUNURUQpOwotICAgICAgICAgICAgICAgIGludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19SRUNFSVZFUl9SRUdJU1RFUkVEX09OTFlfQkVGT1JFX0JPT1QpOwotICAgICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoaW50ZW50KTsKKyAgICAgICAgICAgICAgICBzdGF0dXNJbnRlbnQuc2V0QWN0aW9uKEludGVudC5BQ1RJT05fUE9XRVJfQ09OTkVDVEVEKTsKKyAgICAgICAgICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KHN0YXR1c0ludGVudCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBlbHNlIGlmIChtUGx1Z1R5cGUgPT0gMCAmJiBtTGFzdFBsdWdUeXBlICE9IDApIHsKLSAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX1BPV0VSX0RJU0NPTk5FQ1RFRCk7Ci0gICAgICAgICAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWV9CRUZPUkVfQk9PVCk7Ci0gICAgICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQpOworICAgICAgICAgICAgICAgIHN0YXR1c0ludGVudC5zZXRBY3Rpb24oSW50ZW50LkFDVElPTl9QT1dFUl9ESVNDT05ORUNURUQpOworICAgICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3Qoc3RhdHVzSW50ZW50KTsKICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBwbHVnZ2VkID0gbVBsdWdUeXBlICE9IEJBVFRFUllfUExVR0dFRF9OT05FOworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBvbGRQbHVnZ2VkID0gbUxhc3RQbHVnVHlwZSAhPSBCQVRURVJZX1BMVUdHRURfTk9ORTsKKworICAgICAgICAgICAgLyogVGhlIEFDVElPTl9CQVRURVJZX0xPVyBicm9hZGNhc3QgaXMgc2VudCBpbiB0aGVzZSBzaXR1YXRpb25zOgorICAgICAgICAgICAgICogLSBpcyBqdXN0IHVuLXBsdWdnZWQgKHByZXZpb3VzbHkgd2FzIHBsdWdnZWQpIGFuZCBiYXR0ZXJ5IGxldmVsIGlzIHVuZGVyIFdBUk5JTkcsIG9yCisgICAgICAgICAgICAgKiAtIGlzIG5vdCBwbHVnZ2VkIGFuZCBiYXR0ZXJ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S5lcXVhbHMoImRlZmF1bHQiKSkgeworICAgICAgICAgICAgICAgIG1UeXBlID0gbVJhZGlvOworICAgICAgICAgICAgfSBlbHNlIGlmIChtTmFtZS5lcXVhbHMoIm1tcyIpKSB7CisgICAgICAgICAgICAgICAgbVR5cGUgPSBDb25uZWN0aXZpdHlNYW5hZ2VyLlRZUEVfTU9CSUxFX01NUzsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobU5hbWUuZXF1YWxzKCJzdXBsIikpIHsKKyAgICAgICAgICAgICAgICBtVHlwZSA9IENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9NT0JJTEVfU1VQTDsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobU5hbWUuZXF1YWxzKCJkdW4iKSkgeworICAgICAgICAgICAgICAgIG1UeXBlID0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRV9EVU47CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1OYW1lLmVxdWFscygiaGlwcmkiKSkgeworICAgICAgICAgICAgICAgIG1UeXBlID0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRV9ISVBSSTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Qcmlvcml0eSA9IEludGVnZXIucGFyc2VJbnQoZnJhZ21lbnRzWzJdKTsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc0RlZmF1bHQoKSB7CisgICAgICAgICAgICByZXR1cm4gKG1UeXBlID09IG1SYWRpbyk7CisgICAgICAgIH0KKyAgICB9CisgICAgTmV0d29ya0F0dHJpYnV0ZXNbXSBtTmV0QXR0cmlidXRlczsKKworICAgIHByaXZhdGUgY2xhc3MgUmFkaW9BdHRyaWJ1dGVzIHsKKyAgICAgICAgcHVibGljIFN0cmluZyBtTmFtZTsKKyAgICAgICAgcHVibGljIGludCBtUHJpb3JpdHk7CisgICAgICAgIHB1YmxpYyBpbnQgbVNpbXVsdGFuZWl0eTsKKyAgICAgICAgcHVibGljIGludCBtVHlwZTsKKyAgICAgICAgcHVibGljIFJhZGlvQXR0cmlidXRlcyhTdHJpbmcgaW5pdCkgeworICAgICAgICAgICAgU3RyaW5nIGZyYWdtZW50c1tdID0gaW5pdC5zcGxpdCgiLCIpOworICAgICAgICAgICAgbU5hbWUgPSBmcmFnbWVudHNbMF0udG9Mb3dlckNhc2UoKTsKKyAgICAgICAgICAgIG1Qcmlvcml0eSA9IEludGVnZXIucGFyc2VJbnQoZnJhZ21lbnRzWzFdKTsKKyAgICAgICAgICAgIG1TaW11bHRhbmVpdHkgPSBJbnRlZ2VyLnBhcnNlSW50KGZyYWdtZW50c1syXSk7CisgICAgICAgICAgICBpZiAobU5hbWUuZXF1YWxzKCJ3aWZpIikpIHsKKyAgICAgICAgICAgICAgICBtVHlwZSA9IENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9XSUZJOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtVHlwZSA9IENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9NT0JJTEU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgUmFkaW9BdHRyaWJ1dGVzW10gbVJhZGlvQXR0cmlidXRlczsKKwogICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIENvbm5lY3Rpdml0eVRocmVhZCBleHRlbmRzIFRocmVhZCB7CiAgICAgICAgIHByaXZhdGUgQ29udGV4dCBtQ29udGV4dDsKLSAgICAgICAgCisKICAgICAgICAgcHJpdmF0ZSBDb25uZWN0aXZpdHlUaHJlYWQoQ29udGV4dCBjb250ZXh0KSB7CiAgICAgICAgICAgICBzdXBlcigiQ29ubmVjdGl2aXR5VGhyZWFkIik7CiAgICAgICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CkBAIC04OSwxMSArMTc0LDExIEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBMb29wZXIubG9vcCgpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgQ29ubmVjdGl2aXR5U2VydmljZSBnZXRTZXJ2aWNlSW5zdGFuY2UoQ29udGV4dCBjb250ZXh0KSB7CiAgICAgICAgICAgICBDb25uZWN0aXZpdHlUaHJlYWQgdGhyZWFkID0gbmV3IENvbm5lY3Rpdml0eVRocmVhZChjb250ZXh0KTsKICAgICAgICAgICAgIHRocmVhZC5zdGFydCgpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhyZWFkKSB7CiAgICAgICAgICAgICAgICAgd2hpbGUgKHNTZXJ2aWNlSW5zdGFuY2UgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICB0cnkgewpAQCAtMTAxLDI3ICsxODYsNzEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHRocmVhZC53YWl0KCk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGlnbm9yZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVbmV4cGVjdGVkIEludGVycnVwdGVkRXhjZXB0aW9uIHdoaWxlIHdhaXRpbmcgZm9yIENvbm5lY3Rpdml0eVNlcnZpY2UgdGhyZWFkIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuZXhwZWN0ZWQgSW50ZXJydXB0ZWRFeGNlcHRpb24gd2hpbGUgd2FpdGluZyIrCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBmb3IgQ29ubmVjdGl2aXR5U2VydmljZSB0aHJlYWQiKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICByZXR1cm4gc1NlcnZpY2VJbnN0YW5jZTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB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gICAgICAgICAgICBDb25uZWN0aXZpdHlNYW5hZ2VyLk1BWF9SQURJT19UWVBFKzFdOworICAgICAgICBTdHJpbmdbXSBuYVN0cmluZ3MgPSBjb250ZXh0LmdldFJlc291cmNlcygpLmdldFN0cmluZ0FycmF5KAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXJyYXkubmV0d29ya0F0dHJpYnV0ZXMpOworICAgICAgICAvLyBUT0RPIC0gd2hhdCBpZiB0aGUgc2V0dGluZyBoYXMgZ2Fwcy91bmtub3duIHR5cGVzPworICAgICAgICBmb3IgKFN0cmluZyBhIDogbmFTdHJpbmdzKSB7CisgICAgICAgICAgICBOZXR3b3JrQXR0cmlidXRlcyBuID0gbmV3IE5ldHdvcmtBdHRyaWJ1dGVzKGEpOworICAgICAgICAgICAgbU5ldEF0dHJpYnV0ZXNbbi5tVHlwZV0gPSBuOworICAgICAgICB9CisgICAgICAgIFN0cmluZ1tdIHJhU3RyaW5ncyA9IGNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0U3RyaW5nQXJyYXkoCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hcnJheS5yYWRpb0F0dHJpYnV0ZXMpOworICAgICAgICBmb3IgKFN0cmluZyBhIDogcmFTdHJpbmdzKSB7CisgICAgICAgICAgICBSYWRpb0F0dHJpYnV0ZXMgciA9IG5ldyBSYWRpb0F0dHJpYnV0ZXMoYSk7CisgICAgICAgICAgICBtUmFkaW9BdHRyaWJ1dGVzW3IubVR5cGVdID0gcjsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGhpZ2ggcHJpb3JpdHkgZmlyc3QKKyAgICAgICAgbVByaW9yaXR5TGlzdCA9IG5ldyBpbnRbbmFTdHJpbmdzLmxlbmd0aF07CisgICAgICAgIHsKKyAgICAgICAgICAgIGludCBwcmlvcml0eSA9IDA7IC8vbG93ZXN0CisgICAgICAgICAgICBpbnQgbmV4dFBvcyA9IG5hU3RyaW5ncy5sZW5ndGgtMTsKKyAgICAgICAgICAgIHdoaWxlIChuZXh0UG9zPi0xKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTmV0QXR0cmlidXRlcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBpZihtTmV0QXR0cmlidXRlc1tpXS5tUHJpb3JpdHkgPT0gcHJpb3JpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Qcmlvcml0eUxpc3RbbmV4dFBvcy0tXSA9IGk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJpb3JpdHkrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIG1OZXRSZXF1ZXN0ZXJzUGlkcyA9CisgICAgICAgICAgICAgICAgbmV3IEFycmF5TGlzdFtDb25uZWN0aXZpdHlNYW5hZ2VyLk1BWF9ORVRXT1JLX1RZUEUrMV07CisgICAgICAgIGZvciAoaW50IGk9MDsgaTw9Q29ubmVjdGl2aXR5TWFuYWdlci5NQVhfTkVUV09SS19UWVBFOyBpKyspIHsKKyAgICAgICAgICAgIG1OZXRSZXF1ZXN0ZXJzUGlkc1tpXSA9IG5ldyBBcnJheUxpc3QoKTsKKyAgICAgICAgfQorCisgICAgICAgIG1GZWF0dXJlVXNlcnMgPSBuZXcgQXJyYXlMaXN0KCk7CisKICAgICAgICAgLyoKICAgICAgICAgICogQ3JlYXRlIHRoZSBuZXR3b3JrIHN0YXRlIHRyYWNrZXJzIGZvciBXaS1GaSBhbmQgbW9iaWxlCiAgICAgICAgICAqIGRhdGEuIE1heWJlIHRoaXMgY291bGQgYmUgZG9uZSB3aXRoIGEgZmFjdG9yeSBjbGFzcywKQEAgLTEzMCwxNSArMjU5LDM2IEBACiAgICAgICAgICAqIHRvIGNoYW5nZSB2ZXJ5IG9mdGVuLgogICAgICAgICAgKi8KICAgICAgICAga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HsKLSAgICAgICAgICAgIGlmICh0ID09IG1BY3RpdmVOZXR3b3JrKSB7Ci0gICAgICAgICAgICAgICAgaW50IG5ldFR5cGUgPSB0LmdldE5ldHdvcmtJbmZvKCkuZ2V0VHlwZSgpOwotICAgICAgICAgICAgICAgIGludCBvdGhlck5ldFR5cGUgPSAoKG5ldFR5cGUgPT0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX1dJRkkpID8KLSAgICAgICAgICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9NT0JJTEUgOgotICAgICAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX1dJRkkpOworICAgICAgICBpZiAoIW1OZXRUcmFja2Vyc1ttTmV0d29ya1ByZWZlcmVuY2VdLmlzQXZhaWxhYmxlKCkpCisgICAgICAgICAgICByZXR1cm47CiAKLSAgICAgICAgICAgICAgICBpZiAodC5nZXROZXR3b3JrSW5mbygpLmdldFR5cGUoKSAhPSBtTmV0d29ya1ByZWZlcmVuY2UpIHsKLSAgICAgICAgICAgICAgICAgICAgTmV0d29ya1N0YXRlVHJhY2tlciBvdGhlclRyYWNrZXIgPSBtTmV0VHJhY2tlcnNbb3RoZXJOZXRUeXBlXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG90aGVyVHJhY2tlci5pc0F2YWlsYWJsZSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZWFyZG93bih0KTsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICBmb3IgKGludCB0PTA7IHQgPD0gQ29ubmVjdGl2aXR5TWFuYWdlci5NQVhfUkFESU9fVFlQRTsgdCsrKSB7CisgICAgICAgICAgICBpZiAodCAhPSBtTmV0d29ya1ByZWZlcmVuY2UgJiYKKyAgICAgICAgICAgICAgICAgICAgbU5ldFRyYWNrZXJzW3RdLmdldE5ldHdvcmtJbmZvKCkuaXNDb25uZWN0ZWQoKSkgeworICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAidGVhcmluZyBkb3duICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OZXRUcmFja2Vyc1t0XS5nZXROZXR3b3JrSW5mbygpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGluIGVuZm9yY2VQcmVmZXJlbmNlIik7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRlYXJkb3duKG1OZXRUcmFja2Vyc1t0XSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0yMjksMTMgKzM4MCwyMSBAQAogICAgICAqIFJldHVybiBOZXR3b3JrSW5mbyBmb3IgdGhlIGFjdGl2ZSAoaS5lLiwgY29ubmVjdGVkKSBuZXR3b3JrIGludGVyZmFjZS4KICAgICAgKiBJdCBpcyBhc3N1bWVkIHRoYXQgYXQgbW9zdCBvbmUgbmV0d29yayBpcyBhY3RpdmUgYXQgYSB0aW1lLiBJZiBtb3JlCiAgICAgICogdGhhbiBvbmUgaXMgYWN0aXZlLCBpdCBpcyBpbmRldGVybWluYXRlIHdoaWNoIHdpbGwgYmUgcmV0dXJuZWQuCi0gICAgICogQHJldHVybiB0aGUgaW5mbyBmb3IgdGhlIGFjdGl2ZSBuZXR3b3JrLCBvciB7QGNvZGUgbnVsbH0gaWYgbm9uZSBpcyBhY3RpdmUKKyAgICAgKiBAcmV0dXJuIHRoZSBpbmZvIGZvciB0aGUgYWN0aXZlIG5ldHdvcmssIG9yIHtAY29kZSBudWxsfSBpZiBub25lIGlzCisgICAgICogYWN0aXZlCiAgICAgICovCiAgICAgcHVibGljIE5ldHdvcmtJbmZvIGdldEFjdGl2ZU5ldHdvcmtJbmZvKCkgewogICAgICAgICBlbmZvcmNlQWNjZXNzUGVybWlzc2lvbigpOwotICAgICAgICBmb3IgKE5ldHdvcmtTdGF0ZVRyYWNrZXIgdCA6IG1OZXRUcmFja2VycykgeworICAgICAgICBmb3IgKGludCB0eXBlPTA7IHR5cGUgPD0gQ29ubmVjdGl2aXR5TWFuYWdlci5NQVhfTkVUV09SS19UWVBFOyB0eXBlKyspIHsKKyAgICAgICAgICAgIGlmICghbU5ldEF0dHJpYnV0ZXNbdHlwZV0uaXNEZWZhdWx0KCkpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgdCA9IG1OZXRUcmFja2Vyc1t0eXBlXTsKICAgICAgICAgICAgIE5ldHdvcmtJbmZvIGluZm8gPSB0LmdldE5ldHdvcmtJbmZvKCk7CiAgICAgICAgICAgICBpZiAoaW5mby5pc0Nvbm5lY3RlZCgpKSB7CisgICAgICAgICAgICAgICAgaWYgKERCRyAmJiB0eXBlICE9IG1BY3RpdmVEZWZhdWx0TmV0d29yaykgTG9nLmUoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgImNvbm5lY3RlZCBkZWZhdWx0IG5ldHdvcmsgaXMgbm90ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgIm1BY3RpdmVEZWZhdWx0TmV0d29yayEiKTsKICAgICAgICAgICAgICAgICByZXR1cm4gaW5mbzsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMjgwLDM2ICs0MzksMTk5IEBACiAgICAgICAgIHJldHVybiB0cmFja2VyICE9IG51bGwgJiYgdHJhY2tlci5zZXRSYWRpbyh0dXJuT24pOwogICAgIH0KIAotICAgIHB1YmxpYyBpbnQgc3RhcnRVc2luZ05ldHdvcmtGZWF0dXJlKGludCBuZXR3b3JrVHlwZSwgU3RyaW5nIGZlYXR1cmUpIHsKKyAgICBwcml2YXRlIGNsYXNzIEZlYXR1cmVVc2VyIGltcGxlbWVudHMgSUJpbmRlci5EZWF0aFJlY2lwaWVudCB7CisgICAgICAgIGludCBtTmV0d29ya1R5cGU7CisgICAgICAgIFN0cmluZyBtRmVhdHVyZTsKKyAgICAgICAgSUJpbmRlciBtQmluZGVyOworICAgICAgICBpbnQgbVBpZDsKKyAgICAgICAgaW50IG1VaWQ7CisKKyAgICAgICAgRmVhdHVyZVVzZXIoaW50IHR5cGUsIFN0cmluZyBmZWF0dXJlLCBJQmluZGVyIGJpbmRlcikgeworICAgICAgICAgICAgc3VwZXIoKTsKKyAgICAgICAgICAgIG1OZXR3b3JrVHlwZSA9IHR5cGU7CisgICAgICAgICAgICBtRmVhdHVyZSA9IGZlYXR1cmU7CisgICAgICAgICAgICBtQmluZGVyID0gYmluZGVyOworICAgICAgICAgICAgbVBpZCA9IGdldENhbGxpbmdQaWQoKTsKKyAgICAgICAgICAgIG1VaWQgPSBnZXRDYWxsaW5nVWlkKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1CaW5kZXIubGlua1RvRGVhdGgodGhpcywgMCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIGJpbmRlckRpZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHZvaWQgdW5saW5rRGVhdGhSZWNpcGllbnQoKSB7CisgICAgICAgICAgICBtQmluZGVyLnVubGlua1RvRGVhdGgodGhpcywgMCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBiaW5kZXJEaWVkKCkgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAiQ29ubmVjdGl2aXR5U2VydmljZSBGZWF0dXJlVXNlciBiaW5kZXJEaWVkKCIgKworICAgICAgICAgICAgICAgICAgICBtTmV0d29ya1R5cGUgKyAiLCAiICsgbUZlYXR1cmUgKyAiLCAiICsgbUJpbmRlcik7CisgICAgICAgICAgICBzdG9wVXNpbmdOZXR3b3JrRmVhdHVyZShtTmV0d29ya1R5cGUsIG1GZWF0dXJlLCBtUGlkLCBtVWlkKTsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgcHVibGljIGludCBzdGFydFVzaW5nTmV0d29ya0ZlYXR1cmUoaW50IG5ldHdvcmtUeXBlLCBTdHJpbmcgZmVhdHVyZSwKKyAgICAgICAgICAgIElCaW5kZXIgYmluZGVyKSB7CisgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgInN0YXJ0VXNpbmdOZXR3b3JrRmVhdHVyZSBmb3IgbmV0ICIgKyBuZXR3b3JrVHlwZSArCisgICAgICAgICAgICAgICAgICAgICI6ICIgKyBmZWF0dXJlKTsKKyAgICAgICAgfQogICAgICAgICBlbmZvcmNlQ2hhbmdlUGVybWlzc2lvbigpOwogICAgICAgICBpZiAoIUNvbm5lY3Rpdml0eU1hbmFnZXIuaXNOZXR3b3JrVHlwZVZhbGlkKG5ldHdvcmtUeXBlKSkgewotICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgcmV0dXJuIFBob25lLkFQTl9SRVFVRVNUX0ZBSUxFRDsKICAgICAgICAgfQotICAgICAgICBOZXR3b3JrU3RhdGVUcmFja2VyIHRyYWNrZXIgPSBtTmV0VHJhY2tlcnNbbmV0d29ya1R5cGVdOwotICAgICAgICBpZiAodHJhY2tlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJhY2tlci5zdGFydFVzaW5nTmV0d29ya0ZlYXR1cmUoZmVhdHVyZSwgZ2V0Q2FsbGluZ1BpZCgpLCBnZXRDYWxsaW5nVWlkKCkpOworCisgICAgICAgIHN5bmNocm9uaXplZCAobUZlYXR1cmVVc2VycykgeworICAgICAgICAgICAgbUZlYXR1cmVVc2Vycy5hZGQobmV3IEZlYXR1cmVVc2VyKG5ldHdvcmtUeXBlLCBmZWF0dXJlLCBiaW5kZXIpKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gLTE7CisKKyAgICAgICAgLy8gVE9ETyAtIG1vdmUgdGhpcyBpbnRvIHRoZSBNb2JpbGVEYXRhU3RhdGVUcmFja2VyCisgICAgICAgIGludCB1c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E5ldHdvcmtUeXBlICE9IG5ldHdvcmtUeXBlKSB7CisgICAgICAgICAgICAgICAgSW50ZWdlciBjdXJyZW50UGlkID0gbmV3IEludGVnZXIoZ2V0Q2FsbGluZ1BpZCgpKTsKKworICAgICAgICAgICAgICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgcmFkaW8gPSBtTmV0VHJhY2tlcnNbbmV0d29ya1R5cGVdOworICAgICAgICAgICAgICAgIE5ldHdvcmtJbmZvIG5pID0gbmV0d29yay5nZXROZXR3b3JrSW5mbygpOworCisgICAgICAgICAgICAgICAgaWYgKG5pLmlzQXZhaWxhYmxlKCkgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAic3BlY2lhbCBuZXR3b3JrIG5vdCBhdmFpbGFibGUiKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBob25lLkFQTl9UWVBFX05PVF9BVkFJTEFCTEU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKCFtTmV0UmVxdWVzdGVyc1BpZHNbdXNlZE5ldHdvcmtUeXBlXS5jb250YWlucyhjdXJyZW50UGlkKSkgeworICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGdldHMgdXNlZCBmb3IgcGVyLXBpZCBkbnMgd2hlbiBjb25uZWN0ZWQKKyAgICAgICAgICAgICAgICAgICAgbU5ldFJlcXVlc3RlcnNQaWRzW3VzZWROZXR3b3JrVHlwZV0uYWRkKGN1cnJlbnRQaWQpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICgobmkuaXNDb25uZWN0ZWRPckNvbm5lY3RpbmcoKSA9PSB0cnVlKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgIW5ldHdvcmsuaXNUZWFyZG93blJlcXVlc3RlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChuaS5pc0Nvbm5lY3RlZCgpID09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgcGlkLXNwZWNpZmljIGRucworICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlRG5zQ29uZmlndXJhdGlvbkNoYW5nZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAic3BlY2lhbCBuZXR3b3JrIGFscmVhZHkgYWN0aXZlIik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX0FMUkVBRFlfQUNUSVZFOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgInNwZWNpYWwgbmV0d29yayBhbHJlYWR5IGNvbm5lY3RpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBob25lLkFQTl9SRVFVRVNUX1NUQVJURUQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIHJhZGlvIGluIHBsYXkgY2FuIG1ha2UgYW5vdGhlciBjb250YWN0CisgICAgICAgICAgICAgICAgLy8gYXNzdW1lIGlmIGNhbm5vdCBmb3Igbm93CisKKyAgICAgICAgICAgICAgICAvLyBzaW5jZSB3ZSBoYXZlIHRvIGRyb3AgdGhlIGRlZmF1bHQgb24gdGhpcyByYWRpbywgc2V0dXAKKyAgICAgICAgICAgICAgICAvLyBhbiBhdXRvbWF0aWMgZXZlbnQgdG8gc3dpdGNoIGJhY2sKKyAgICAgICAgICAgICAgICBpZihtSGFuZGxlci5oYXNNZXNzYWdlcyhOZXR3b3JrU3RhdGVUcmFja2VyLgorICAgICAgICAgICAgICAgICAgICAgICAgRVZFTlRfUkVTVE9SRV9ERUZBVUxUX05FVFdPUkssIHJhZGlvKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgcmFkaW8uZ2V0TmV0d29ya0luZm8oKS5pc0Nvbm5lY3RlZE9yQ29ubmVjdGluZygpKSB7CisgICAgICAgICAgICAgICAgICAgIG1IYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE5ldHdvcmtTdGF0ZVRyYWNrZXIuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRVZFTlRfUkVTVE9SRV9ERUZBVUxUX05FVFdPUkssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFkaW8pOworICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobUhhbmRsZXIub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX1JFU1RPUkVfREVGQVVMVF9ORVRXT1JLLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhZGlvKSwgZ2V0UmVzdG9yZURlZmF1bHROZXR3b3JrRGVsYXkoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgInJlY29ubmVjdGluZyB0byBzcGVjaWFsIG5ldHdvcmsiKTsKKyAgICAgICAgICAgICAgICBuZXR3b3JrLnJlY29ubmVjdCgpOworICAgICAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fUkVRVUVTVF9TVEFSVEVEOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV0d29yay5zdGFydFVzaW5nTmV0d29ya0ZlYXR1cmUoZmVhdHVyZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldENhbGxpbmdQaWQoKSwgZ2V0Q2FsbGluZ1VpZCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1RZUEVfTk9UX0FWQUlMQUJMRTsKICAgICB9CiAKICAgICBwdWJsaWMgaW50IHN0b3BVc2luZ05ldHdvcmtGZWF0dXJlKGludCBuZXR3b3JrVHlwZSwgU3RyaW5nIGZlYXR1cmUp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ciB1ID0gKEZlYXR1cmVVc2VyKW1GZWF0dXJlVXNlcnMuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmICh1aWQgPT0gdS5tVWlkICYmIHBpZCA9PSB1Lm1QaWQgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldHdvcmtUeXBlID09IHUubU5ldHdvcmtUeXBlICYmCisgICAgICAgICAgICAgICAgICAgICAgICBUZXh0VXRpbHMuZXF1YWxzKGZlYXR1cmUsIHUubUZlYXR1cmUpKSB7CisgICAgICAgICAgICAgICAgICAgIHUudW5saW5rRGVhdGhSZWNpcGllbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgbUZlYXR1cmVVc2Vycy5yZW1vdmUoaSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICByZXR1cm4gLTE7CisKKyAgICAgICAgLy8gVE9ETyAtIG1vdmUgdG8gTW9iaWxlRGF0YVN0YXRlVHJhY2tlcgorICAgICAgICBpbnQgdXNlZE5ldHdvcmtUeXBlID0gbmV0d29ya1R5cGU7CisgICAgICAgIGlmIChuZXR3b3JrVHlwZSA9PSBDb25uZWN0aXZpdHlNYW5hZ2VyLlRZUEVfTU9CSUxFKSB7CisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmVxdWFscyhmZWF0dXJlLCBQaG9uZS5GRUFUVVJFX0VOQUJMRV9NTVMpKSB7CisgICAgICAgICAgICAgICAgdXNlZE5ldHdvcmtUeXBlID0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRV9NTVM7CisgICAgICAgICAgICB9IGVsc2UgaWYgKFRleHRVdGlscy5lcXVhbHMoZmVhdHVyZSwgUGhvbmUuRkVBVFVSRV9FTkFCTEVfU1VQTCkpIHsKKyAgICAgICAgICAgICAgICB1c2VkTmV0d29ya1R5cGUgPSBDb25uZWN0aXZpdHlNYW5hZ2VyLlRZUEVfTU9CSUxFX1NVUEw7CisgICAgICAgICAgICB9IGVsc2UgaWYgKFRleHRVdGlscy5lcXVhbHMoZmVhdHVyZSwgUGhvbmUuRkVBVFVSRV9FTkFCTEVfRFVOKSkgeworICAgICAgICAgICAgICAgIHVzZWROZXR3b3JrVHlwZSA9IENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9NT0JJTEVfRFVOOworICAgICAgICAgICAgfSBlbHNlIGlmIChUZXh0VXRpbHMuZXF1YWxzKGZlYXR1cmUsIFBob25lLkZFQVRVUkVfRU5BQkxFX0hJUFJJKSkgeworICAgICAgICAgICAgICAgIHVzZWROZXR3b3JrVHlwZSA9IENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9NT0JJTEVfSElQUkk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgTmV0d29ya1N0YXRlVHJhY2tlciB0cmFja2VyID0gIG1OZXRUcmFja2Vyc1t1c2VkTmV0d29ya1R5cGVdOworICAgICAgICBpZih1c2VkTmV0d29ya1R5cGUgIT0gbmV0d29ya1R5cGUpIHsKKyAgICAgICAgICAgIEludGVnZXIgY3VycmVudFBpZCA9IG5ldyBJbnRlZ2VyKHBpZCk7CisgICAgICAgICAgICBpZiAobU5ldFJlcXVlc3RlcnNQaWRzW3VzZWROZXR3b3JrVHlwZV0ucmVtb3ZlKGN1cnJlbnRQaWQpKSB7CisgICAgICAgICAgICAgICAgcmVhc3Nlc3NQaWREbnMocGlkLCB0cnVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtTmV0UmVxdWVzdGVyc1BpZHNbdXNlZE5ldHdvcmtUeXBlXS5zaXplKCkgIT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIm5vdCB0ZWFyaW5nIGRvd24gc3BlY2lhbCBuZXR3b3JrIC0gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAib3RoZXJzIHN0aWxsIHVzaW5nIGl0Iik7CisgICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRyYWNrZXIudGVhcmRvd24oKTsKKyAgICAgICAgICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgcmFkaW8gPSBtTmV0VHJhY2tlcnNbbmV0d29ya1R5cGVdOworICAgICAgICAgICAgLy8gQ2hlY2sgaWYgd2Ugd2FudCB0byByZXZlcnQgdG8gdGhlIGRlZmF1bHQKKyAgICAgICAgICAgIGlmIChtSGFuZGxlci5oYXNNZXNzYWdlcyhOZXR3b3JrU3RhdGVUcmFja2VyLgorICAgICAgICAgICAgICAgICAgICBFVkVOVF9SRVNUT1JFX0RFRkFVTFRfTkVUV09SSywgcmFkaW8pKSB7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTmV0d29ya1N0YXRlVHJhY2tlci4KKyAgICAgICAgICAgICAgICAgICAgICAgIEVWRU5UX1JFU1RPUkVfREVGQVVMVF9ORVRXT1JLLCByYWRpbyk7CisgICAgICAgICAgICAgICAgcmFkaW8ucmVjb25uZWN0KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiB0cmFja2VyLnN0b3BVc2luZ05ldHdvcmtGZWF0dXJlKGZlYXR1cmUsIHBpZCwgdWlkKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgogICAgICAqIEVuc3VyZSB0aGF0IGEgbmV0d29yayByb3V0ZSBleGlzdHMgdG8gZGVsaXZlciB0cmFmZmljIHRvIHRoZSBzcGVjaWZpZWQKICAgICAgKiBob3N0IHZpYSB0aGUgc3BlY2lmaWVkIG5ldHdvcmsgaW50ZXJmYWNlLgotICAgICAqIEBwYXJhbSBuZXR3b3JrVHlwZSB0aGUgdHlwZSBvZiB0aGUgbmV0d29yayBvdmVyIHdoaWNoIHRyYWZmaWMgdG8gdGhlIHNwZWNpZmll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fQogCkBAIC0zNDAsNyArNjYzLDcgQEAKICAgICAgICAgcmV0dXJuIFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCiAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLkJBQ0tHUk9VTkRfREFUQSwgMSkgPT0gMTsKICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBAc2VlIENvbm5lY3Rpdml0eU1hbmFnZXIjc2V0QmFja2dyb3VuZERhdGFTZXR0aW5nKGJvb2xlYW4pCiAgICAgICovCkBAIC0zNDgsODcgKzY3MSw3MyBAQAogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oCiAgICAgICAgICAgICAgICAgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkNIQU5HRV9CQUNLR1JPVU5EX0RBVEFfU0VUVElORywKICAgICAgICAgICAgICAgICAiQ29ubmVjdGl2aXR5U2VydmljZSIpOwotICAgICAgICAKKwogICAgICAgICBpZiAoZ2V0QmFja2dyb3VuZERhdGFTZXR0aW5nKCkgPT0gYWxsb3dCYWNrZ3JvdW5kRGF0YVVzYWdlKSByZXR1cm47CiAKICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuQkFDS0dST1VORF9EQVRBLCBhbGxvd0JhY2tncm91bmREYXRhVXNhZ2UgPyAxIDogMCk7Ci0gICAgICAgIAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5CQUNLR1JPVU5EX0RBVEEsCisgICAgICAgICAgICAgICAgYWxsb3dCYWNrZ3JvdW5kRGF0YVVzYWdlID8gMSA6IDApOworCiAgICAgICAgIEludGVudCBicm9hZGNhc3QgPSBuZXcgSW50ZW50KAogICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuQUNUSU9OX0JBQ0tHUk9VTkRfREFUQV9TRVRUSU5HX0NIQU5HRUQpOwogICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGJyb2FkY2FzdCk7Ci0gICAgfSAgICAKLSAgICAKKyAgICB9CisKICAgICBwcml2YXRlIGludCBnZXROdW1Db25uZWN0ZWROZXR3b3JrcygpIHsKICAgICAgICAgaW50IG51bUNvbm5lY3RlZE5ldHMgPSAwOwogCiAgICAgICAgIGZvciAoTmV0d29ya1N0YXRlVHJhY2tlciBudCA6IG1OZXRUcmFja2VycykgewotICAgICAgICAgICAgaWYgKG50LmdldE5ldHdvcmtJbmZvKCkuaXNDb25uZWN0ZWQoKSAmJiAhbnQuaXNUZWFyZG93blJlcXVlc3RlZCgpKSB7CisgICAgICAgICAgICBpZiAobnQuZ2V0TmV0d29ya0luZm8oKS5pc0Nvbm5lY3RlZCgpICYmCisgICAgICAgICAgICAgICAgICAgICFudC5pc1RlYXJkb3duUmVxdWVzdGVkKCkpIHsKICAgICAgICAgICAgICAgICArK251bUNvbm5lY3RlZE5ldHM7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAibnVtQ29ubmVjdGVkTmV0cyByZXR1cm5pbmcgIitudW1Db25uZWN0ZWROZXRzKTsKICAgICAgICAgcmV0dXJuIG51bUNvbm5lY3RlZE5ldHM7CiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIGVuZm9yY2VBY2Nlc3NQZXJtaXNzaW9uKCkgewotICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkFDQ0VTU19ORVRXT1JLX1NUQVRFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvbm5lY3Rpdml0eVNlcnZpY2UiKTsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAorICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5BQ0NFU1NfTkVUV09SS19TVEFURSwKKyAgICAgICAgICAgICAgICAiQ29ubmVjdGl2aXR5U2VydmljZSIpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBlbmZvcmNlQ2hhbmdlUGVybWlzc2lvbigpIHsKLSAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5DSEFOR0VfTkVUV09SS19TVEFURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDb25uZWN0aXZpdHlTZXJ2aWNlIik7Ci0KKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAorICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5DSEFOR0VfTkVUV09SS19TVEFURSwKKyAgICAgICAgICAgICAgICAiQ29ubmVjdGl2aXR5U2VydmljZSIpOwogICAgIH0KIAogICAgIC8qKgotICAgICAqIEhhbmRsZSBhIHtAY29kZSBESVNDT05ORUNURUR9IGV2ZW50LiBJZiB0aGlzIHBlcnRhaW5zIHRvIHRoZSBub24tYWN0aXZlIG5ldHdvcmssCi0gICAgICogd2UgaWdub3JlIGl0LiBJZiBpdCBpcyBmb3IgdGhlIGFjdGl2ZSBuZXR3b3JrLCB3ZSBzZW5kIG91dCBhIGJyb2FkY2FzdC4KLSAgICAgKiBCdXQgZmlyc3QsIHdlIGNoZWNrIHdoZXRoZXIgaXQgbWlnaHQgYmUgcG9zc2libGUgdG8gY29ubmVjdCB0byBhIGRpZmZlcmVudAotICAgICAqIG5ldHdvcmsuCisgICAgICogSGFuZGxlIGEge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1wdGluZyB0byBmYWlsIG92ZXIuCi0gICAgICAgICAqLwotICAgICAgICBOZXR3b3JrSW5mbyBzd2l0Y2hUbyA9IG51bGw7Ci0gICAgICAgIGlmIChuZXdOZXQuaXNBdmFpbGFibGUoKSkgewotICAgICAgICAgICAgbUFjdGl2ZU5ldHdvcmsgPSBuZXdOZXQ7Ci0gICAgICAgICAgICBzd2l0Y2hUbyA9IG5ld05ldC5nZXROZXR3b3JrSW5mbygpOwotICAgICAgICAgICAgc3dpdGNoVG8uc2V0RmFpbG92ZXIodHJ1ZSk7Ci0gICAgICAgICAgICBpZiAoIXN3aXRjaFRvLmlzQ29ubmVjdGVkT3JDb25uZWN0aW5nKCkpIHsKLSAgICAgICAgICAgICAgICBuZXdOZXQucmVjb25uZWN0KCk7CisgICAgICAgIGlmICghbU5ldEF0dHJpYnV0ZXNbcHJldk5ldFR5cGVdLmlzRGVmYXVsdCgpKSB7CisgICAgICAgICAgICBMaXN0IHBpZHMgPSBtTmV0UmVxdWVzdGVyc1BpZHNbcHJldk5ldFR5cGVdOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGk8cGlkcy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEludGVnZXIgcGlkID0gKEludGVnZXIpcGlkcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgLy8gd2lsbCByZW1vdmUgdGhlbSBiZWNhdXNlIHRoZSBuZXQncyBubyBsb25nZXIgY29ubmVjdGVkCisgICAgICAgICAgICAgICAgLy8gbmVlZCB0byBkbyB0aGlzIG5vdyBhcyBvbmx5IG5vdyBkbyB3ZSBrbm93IHRoZSBwaWRzIGFuZAorICAgICAgICAgICAgICAgIC8vIGNhbiBwcm9wZXJseSBudWxsIHRoaW5ncyB0aGF0IGFyZSBubyBsb25nZXIgcmVmZXJlbmNlZC4KKyAgICAgICAgICAgICAgICByZWFzc2Vzc1BpZERucyhwaWQuaW50VmFsdWUoKSwgZmFsc2UpOwogICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbmV3TmV0LnJlY29ubmVjdCgpOwogICAgICAgICB9CiAKLSAgICAgICAgYm9vbGVhbiBvdGhlck5ldHdvcmtDb25uZWN0ZWQgPSBmYWxzZTsKICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoQ29ubmVjdGl2aXR5TWFuYWdlci5DT05ORUNUSVZJVFlfQUNUSU9OKTsKICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfTkVUV09SS19JTkZPLCBpbmZvKTsKICAgICAgICAgaWYgKGluZm8uaXNGYWlsb3ZlcigpKSB7CkBAIC00MzksMzEgKzc0OCw5NiBAQAogICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfUkVBU09OLCBpbmZvLmdldFJlYXNvbigpKTsKICAgICAgICAgfQogICAgICAgICBpZiAoaW5mby5nZXRFeHRyYUluZm8oKSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQ29ubmVjdGl2aXR5TWFuYWdlci5FWFRSQV9FWFRSQV9JTkZPLCBpbmZvLmdldEV4dHJhSW5mbygpKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShDb25uZWN0aXZpdHlNYW5hZ2VyLkVYVFJBX0VYVFJBX0lORk8sCisgICAgICAgICAgICAgICAgICAgIGluZm8uZ2V0RXh0cmFJbmZvKCkpOwogICAgICAgICB9Ci0gICAgICAgIGlmIChzd2l0Y2hUbyAhPSBudWxsKSB7Ci0gICAgICAgICAgICBvdGhlck5ldHdvcmtDb25uZWN0ZWQgPSBzd2l0Y2hUby5pc0Nvbm5lY3RlZCgpOwotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIGlmIChvdGhlck5ldHdvcmtDb25uZWN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiU3dpdGNoaW5nIHRvIGFscmVhZHkgY29ubmVjdGVkICIgKyBzd2l0Y2hUby5nZXRUeXBlTmFtZSgpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJBdHRlbXB0aW5nIHRvIHN3aXRjaCB0byAiICsgc3dpdGNoVG8uZ2V0VHlwZU5hbWUoKSk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogSWYgdGhpcyBpcyBhIGRlZmF1bHQgbmV0d29yaywgY2hlY2sgaWYgb3RoZXIgZGVmYXVsdHMgYXJlIGF2YWlsYWJsZQorICAgICAgICAgKiBvciBhY3RpdmUKKyAgICAgICAgICovCisgICAgICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgbmV3TmV0ID0gbnVsbDsKKyAgICAgICAgaWYgKG1OZXRBdHRyaWJ1dGVzW3ByZXZOZXRUeXBlXS5pc0RlZmF1bHQoKSkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiZGlzY29ubmVjdGluZyBhIGRlZmF1bHQgbmV0d29yayIpOworICAgICAgICAgICAgaWYgKG1BY3RpdmVEZWZhdWx0TmV0d29yayA9PSBwcmV2TmV0VHlwZSkgeworICAgICAgICAgICAgICAgIG1BY3RpdmVEZWZhdWx0TmV0d29yayA9IC0xOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpbnQgbmV3VHlwZSA9IC0xOworICAgICAgICAgICAgaW50IG5ld1ByaW9yaXR5ID0gLTE7CisgICAgICAgICAgICBmb3IgKGludCBjaGVja1R5cGU9MDsgY2hlY2tUeXBlIDw9CisgICAgICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuTUFYX05FVFdPUktfVFlQRTsgY2hlY2tUeXBlKyspIHsKKyAgICAgICAgICAgICAgICBpZiAoY2hlY2tUeXBlID09IHByZXZOZXRUeXBlKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobU5ldEF0dHJpYnV0ZXNbY2hlY2tUeXBlXS5pc0RlZmF1bHQoKSkgeworICAgICAgICAgICAgICAgICAgICAvKiBUT0RPIC0gaWYgd2UgaGF2ZSBtdWx0aXBsZSBuZXRzIHdlIGNvdWxkIHVzZQorICAgICAgICAgICAgICAgICAgICAgKiB3ZSBtYXkgd2FudCB0byBwdXQgbW9yZSB0aG91Z2h0IGludG8gd2hpY2ggd2UgY2hvb3NlCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tUeXBlID09IG1OZXR3b3JrUHJlZmVyZW5jZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV3VHlwZSA9IGNoZWNrVHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtUmFkaW9BdHRyaWJ1dGVzW21OZXRBdHRyaWJ1dGVzW2NoZWNrVHlwZV0ubVJhZGlvXS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpb3JpdHkgPiBuZXdQcmlvcml0eSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV3VHlwZSA9IGNoZWNrVHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld1ByaW9yaXR5ID0gbVJhZGlvQXR0cmlidXRlc1ttTmV0QXR0cmlidXRlc1tuZXdUeXBlXS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJhZGlvXS5tUHJpb3JpdHk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQ29ubmVjdGl2aXR5TWFuYWdlci5FWFRSQV9PVEhFUl9ORVRXT1JLX0lORk8sIHN3aXRjaFRvKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShDb25uZWN0aXZpdHlNYW5hZ2VyLkVYVFJBX05PX0NPTk5FQ1RJVklUWSwgdHJ1ZSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiU2VuZGluZyBESVNDT05ORUNUIGJjYXN0IGZvciAiICsgaW5mby5nZXRUeXBlTmFtZSgpICsKLSAgICAgICAgICAgICAgICAoc3dpdGNoVG8gPT0gbnVsbCA/ICIiIDogIiBvdGhlcj0iICsgc3dpdGNoVG8uZ2V0VHlwZU5hbWUoKSkpOwogCi0gICAgICAgIG1Db250ZXh0LnNlbmRTdGlja3lCcm9hZGNhc3QoaW50ZW50KTsKKyAgICAgICAgICAgIGlmIChuZXdUeXBlICE9IC0xKSB7CisgICAgICAgICAgICAgICAgbmV3TmV0ID0gbU5ldFRyYWNrZXJzW25ld1R5cGVdOworICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAqIFNlZSBpZiB0aGUgb3RoZXIgbmV0d29yayBpcyBhdmFpbGFibGUgdG8gZmFpbCBvdmVyIHRvLgorICAgICAgICAgICAgICAgICAqIElmIGlzIG5vdCBhdmFpbGFibGUsIHdlIGVuYWJsZSBpdCBhbnl3YXksIHNvIHRoYXQgaXQKKyAgICAgICAgICAgICAgICAgKiB3aWxsIGJlIGFibGUgdG8gY29ubmVjdCB3aGVuIGl0IGRvZXMgYmVjb21lIGF2YWlsYWJsZSwKKyAgICAgICAgICAgICAgICAgKiBidXQgd2UgcmVwb3J0IGEgdG90YWwgbG9zcyBvZiBjb25uZWN0aXZpdHkgcmF0aGVyIHRoYW4KKyAgICAgICAgICAgICAgICAgKiByZXBvcnQgdGhhdCB3ZSBhcmUgYXR0ZW1wdGluZyB0byBmYWlsIG92ZXIuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKG5ld05ldC5pc0F2YWlsYWJsZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIE5ldHdvcmtJbmZvIHN3aXRjaFRvID0gbmV3TmV0LmdldE5ldHdvcmtJbmZvKCk7CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaFRvLnNldEZhaWxvdmVyKHRydWUpOworICAgICAgICAgICAgICAgICAgICBpZiAoIXN3aXRjaFRvLmlzQ29ubmVjdGVkT3JDb25uZWN0aW5nKCkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdOZXQuaXNUZWFyZG93blJlcXVlc3RlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXdOZXQucmVjb25uZWN0KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN3aXRjaFRvLmlzQ29ubmVjdGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJTd2l0Y2hpbmcgdG8gYWxyZWFkeSBjb25uZWN0ZWQgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hUby5nZXRUeXBlTmFtZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiQXR0ZW1wdGluZyB0byBzd2l0Y2ggdG8gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hUby5nZXRUeXBlTmFtZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQ29ubmVjdGl2aXR5TWFuYWdlci4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBFWFRSQV9PVEhFUl9ORVRXT1JLX0lORk8sIHN3aXRjaFRvKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBuZXdOZXQucmVjb25uZWN0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQ29ubmVjdGl2aXR5TWFuYWdlci5FWFRSQV9OT19DT05ORUNUSVZJVFksCisgICAgICAgICAgICAgICAgICAgICAgICB0cnVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGRvIHRoaXMgYmVmb3JlIHdlIGJyb2FkY2FzdCB0aGUgY2hhbmdlCisgICAgICAgIGhhbmRsZUNvbm5lY3Rpdml0eUNoYW5nZSgpOworCisgICAgICAgIGlmIChEQkcpIExvZy52KFRBRywgIlNlbmRpbmcgRElTQ09OTkVDVCBiY2FzdCBmb3IgIiArCisgICAgICAgICAgICAgICAgaW5mby5nZXRUeXBlTmFtZSgpICsKKyAgICAgICAgICAgICAgICAobmV3TmV0ID09IG51bGwgfHwgIW5ld05ldC5pc0F2YWlsYWJsZSgpID8gIiIgOiAiIG90aGVyPSIgKworICAgICAgICAgICAgICAgIG5ld05ldC5nZXROZXR3b3JrSW5mbygpLmdldFR5cGVOYW1lKCkpKTsKKworICAgICAgICBzZW5kU3RpY2t5QnJvYWRjYXN0KGludGVudCk7CiAgICAgICAgIC8qCi0gICAgICAgICAqIElmIHRoZSBmYWlsb3ZlciBuZXR3b3JrIGlzIGFscmVhZHkgY29ubmVjdGVkLCB0aGVuIGltbWVkaWF0ZWx5IHNlbmQgb3V0Ci0gICAgICAgICAqIGEgZm9sbG93dXAgYnJvYWRjYXN0IGluZGljYXRpbmcgc3VjY2Vzc2Z1bCBmYWlsb3ZlcgorICAgICAgICAgKiBJZiB0aGUgZmFpbG92ZXIgbmV0d29yayBpcyBhbHJlYWR5IGNvbm5lY3RlZCwgdGhlbiBpbW1lZGlhdGVseSBzZW5kCisgICAgICAgICAqIG91dCBhIGZvbGxvd3VwIGJyb2FkY2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Kzg2MywxMjggQEAKICAgICAgKi8KICAgICBwcml2YXRlIHZvaWQgaGFuZGxlQ29ubmVjdGlvbkZhaWx1cmUoTmV0d29ya0luZm8gaW5mbykgewogICAgICAgICBtTmV0VHJhY2tlcnNbaW5mby5nZXRUeXBlKCldLnNldFRlYXJkb3duUmVxdWVzdGVkKGZhbHNlKTsKLSAgICAgICAgaWYgKGdldEFjdGl2ZU5ldHdvcmtJbmZvKCkgPT0gbnVsbCkgewotICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiA9IGluZm8uZ2V0UmVhc29uKCk7Ci0gICAgICAgICAgICBTdHJpbmcgZXh0cmFJbmZvID0gaW5mby5nZXRFeHRyYUluZm8oKTsKIAotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIFN0cmluZyByZWFzb25UZXh0OwotICAgICAgICAgICAgICAgIGlmIChyZWFzb24gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICByZWFzb25UZXh0ID0gIi4iOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlYXNvblRleHQgPSAiICgiICsgcmVhc29uICsgIikuIjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiQXR0ZW1wdCB0byBjb25uZWN0IHRvICIgKyBpbmZvLmdldFR5cGVOYW1lKCkgKyAiIGZhaWxlZCIgKyByZWFzb25UZXh0KTsKKyAgICAgICAgU3RyaW5nIHJlYXNvbiA9IGluZm8uZ2V0UmVhc29uKCk7CisgICAgICAgIFN0cmluZyBleHRyYUluZm8gPSBpbmZvLmdldEV4dHJhSW5mbygpOworCisgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgIFN0cmluZyByZWFzb25UZXh0OworICAgICAgICAgICAgaWYgKHJlYXNvbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmVhc29uVGV4dCA9ICIuIjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmVhc29uVGV4dCA9ICIgKCIgKyByZWFzb24gKyAiKS4iOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChDb25uZWN0aXZpdHlNYW5hZ2VyLkNPTk5FQ1RJVklUWV9BQ1RJT04pOwotICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfTkVUV09SS19JTkZPLCBpbmZvKTsKKyAgICAgICAgICAgIExvZy52KFRBRywgIkF0dGVtcHQgdG8gY29ubmVjdCB0byAiICsgaW5mby5nZXRUeXBlTmFtZSgpICsKKyAgICAgICAgICAgICAgICAgICAgIiBmYWlsZWQiICsgcmVhc29uVGV4dCk7CisgICAgICAgIH0KKworICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChDb25uZWN0aXZpdHlNYW5hZ2VyLkNPTk5FQ1RJVklUWV9BQ1RJT04pOworICAgICAgICBpbnRlbnQucHV0RXh0cmEoQ29ubmVjdGl2aXR5TWFuYWdlci5FWFRSQV9ORVRXT1JLX0lORk8sIGluZm8pOworICAgICAgICBpZiAoZ2V0QWN0aXZlTmV0d29ya0luZm8oKSA9PSBudWxsKSB7CiAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoQ29ubmVjdGl2aXR5TWFuYWdlci5FWFRSQV9OT19DT05ORUNUSVZJVFksIHRydWUpOwotICAgICAgICAgICAgaWYgKHJlYXNvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfUkVBU09OLCByZWFzb24pOworICAgICAgICB9CisgICAgICAgIGlmIChyZWFzb24gIT0gbnVsbCkgeworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfUkVBU09OLCByZWFzb24pOworICAgICAgICB9CisgICAgICAgIGlmIChleHRyYUluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfRVhUUkFfSU5GTywgZXh0cmFJbmZvKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoaW5mby5pc0ZhaWxvdmVyKCkpIHsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShDb25uZWN0aXZpdHlNYW5hZ2VyLkVYVFJBX0lTX0ZBSUxPVkVSLCB0cnVlKTsKKyAgICAgICAgICAgIGluZm8uc2V0RmFpbG92ZXIoZmFsc2UpOworICAgICAgICB9CisgICAgICAgIHNlbmRTdGlja3lCcm9hZGNhc3QoaW50ZW50KTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2VuZFN0aWNreUJyb2FkY2FzdChJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICBpZiAobVN5c3RlbVJlYWR5KSB7CisgICAgICAgICAgICAgICAgbUNvbnRleHQuc2VuZFN0aWNreUJyb2FkY2FzdChpbnRlbnQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobURlZmVycmVkQnJvYWRjYXN0cyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1EZWZlcnJlZEJyb2FkY2FzdHMgPSBuZXcgQXJyYXlMaXN0PEludGVudD4oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbURlZmVycmVkQnJvYWRjYXN0cy5hZGQoaW50ZW50KTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChleHRyYUluZm8gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShDb25uZWN0aXZpdHlNYW5hZ2VyLkVYVFJBX0VYVFJBX0lORk8sIGV4dHJhSW5mbyk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHN5c3RlbVJlYWR5KCkgeworICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgeworICAgICAgICAgICAgbVN5c3RlbVJlYWR5ID0gdHJ1ZTsKKyAgICAgICAgICAgIGlmIChtRGVmZXJyZWRCcm9hZGNhc3RzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbnQgY291bnQgPSBtRGVmZXJyZWRCcm9hZGNhc3RzLnNpemUoKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuc2VuZFN0aWNreUJyb2FkY2FzdChtRGVmZXJyZWRCcm9hZGNhc3RzLmdldChpKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1EZWZlcnJlZEJyb2FkY2FzdHMgPSBudWxsOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGluZm8uaXNGYWlsb3ZlcigpKSB7Ci0gICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfSVNfRkFJTE9WRVIsIHRydWUpOwotICAgICAgICAgICAgICAgIGluZm8uc2V0RmFpbG92ZXIoZmFsc2UpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUNvbnRleHQuc2VuZFN0aWNreUJyb2FkY2FzdChpbnRlbnQpOwogICAgICAgICB9CiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZUNvbm5lY3QoTmV0d29ya0luZm8gaW5mbykgewotICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJIYW5kbGUgQ09OTkVDVCBmb3IgIiArIGluZm8uZ2V0VHlwZU5hbWUoKSk7CisgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIkhhbmRsZSBDT05ORUNUIGZvciAiICsgaW5mby5nZXRUeXBlTmFtZSgpKTs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GVzW3R5cGVdLm1Qcmlvcml0eSkgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1OZXR3b3JrUHJlZmVyZW5jZSA9PSBtQWN0aXZlRGVmYXVsdE5ldHdvcmspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IGFjY2VwdCB0aGlzIG9uZQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiTm90IGJyb2FkY2FzdGluZyBDT05ORUNUX0FDVElPTiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvIHRvcm4gZG93biBuZXR3b3JrICIgKyBpbmZvLmdldFR5cGVOYW1lKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgdGVhcmRvd24odGhpc05ldCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdGVhciBkb3duIHRoZSBvdGhlcgorICAgICAgICAgICAgICAgICAgICBOZXR3b3JrU3RhdGVUcmFja2VyIG90aGVyTmV0ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTmV0VHJhY2tlcnNbbUFjdGl2ZURlZmF1bHROZXR3b3JrXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiUG9saWN5IHJlcXVpcmVzICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyTmV0LmdldE5ldHdvcmtJbmZvKCkuZ2V0VHlwZU5hbWUoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiB0ZWFyZG93biIpOworICAgICAgICAgICAgICAgICAgICBpZiAoIXRlYXJkb3duKG90aGVyTmV0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiTmV0d29yayBkZWNsaW5lZCB0ZWFyZG93biByZXF1ZXN0Iik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzRmFpbG92ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyTmV0LnJlbGVhc2VXYWtlTG9jaygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgbUFjdGl2ZURlZmF1bHROZXR3b3JrID0gdHlwZTsKKyAgICAgICAgfQogICAgICAgICB0aGlzTmV0LnNldFRlYXJkb3duUmVxdWVzdGVkKGZhbHNlKTsKLSAgICAgICAgaWYgKCFtVGVzdE1vZGUgJiYgZGVhZG5ldCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJQb2xpY3kgcmVxdWlyZXMgIiArCi0gICAgICAgICAgICAgICAgICBkZWFkbmV0LmdldE5ldHdvcmtJbmZvKCkuZ2V0VHlwZU5hbWUoKSArICIgdGVhcmRvd24iKTsKLSAgICAgICAgICAgIHRvcmVkb3duID0gdGVhcmRvd24oZGVhZG5ldCk7Ci0gICAgICAgICAgICBpZiAoREJHICYmICF0b3JlZG93bikgewotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIk5ldHdvcmsgZGVjbGluZWQgdGVhcmRvd24gcmVxdWVzdCIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogTm90ZSB0aGF0IGlmIHRvcmVkb3duIGlzIHRydWUsIGRlYWRuZXQgY2Fubm90IGJlIG51bGwsIHNvIHRoZXJlIGlzCi0gICAgICAgICAqIG5vIGRhbmdlciBvZiBhIG51bGwgcG9pbnRlciBleGNlcHRpb24gaGVyZS4uCi0gICAgICAgICAqLwotICAgICAgICBpZiAoIXRvcmVkb3duIHx8IGRlYWRuZXQuZ2V0TmV0d29ya0luZm8oKS5nZXRUeXBlKCkgIT0gaW5mby5nZXRUeXBlKCkpIHsKLSAgIC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GSSkgewotICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiR290IFNjYW5SZXN1bHRzQXZhaWxhYmxlIGZvciAiICsgaW5mby5nZXRUeXBlTmFtZSgpICsgIiBuZXR3b3JrLiIKLSAgICAgICAgICAgICAgICArICIgRG9uJ3Qga25vdyBob3cgdG8gaGFuZGxlLiIpOworICAgICAgICAgICAgaWYgKERCRykgTG9nLnYoVEFHLCAiR290IFNjYW5SZXN1bHRzQXZhaWxhYmxlIGZvciAiICsKKyAgICAgICAgICAgICAgICAgICAgaW5mby5nZXRUeXBlTmFtZSgpICsgIiBuZXR3b3JrLiBEb24ndCBrbm93IGhvdyB0byBoYW5kbGUuIik7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgbU5ldFRyYWNrZXJzW25ldHdvcmtUeXBlXS5pbnRlcnByZXRTY2FuUmVzdWx0c0F2YWlsYWJsZSgpOwogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBoYW5kbGVOb3RpZmljYXRpb25DaGFuZ2UoYm9vbGVhbiB2aXNpYmxlLCBpbnQgaWQsIE5vdGlmaWNhdGlvbiBub3RpZmljYXRpb24pIHsKKyAgICBwcml2YXRlIHZvaWQgaGFuZGxlTm90aWZpY2F0aW9uQ2hhbmdlKGJvb2xlYW4gdmlzaWJsZSwgaW50IGlkLAorICAgICAgICAgICAgTm90aWZpY2F0aW9uIG5vdGlmaWNhdGlvbikgewogICAgICAgICBOb3RpZmljYXRpb25NYW5hZ2VyIG5vdGlmaWNhdGlvbk1hbmFnZXIgPSAoTm90aWZpY2F0aW9uTWFuYWdlcikgbUNvbnRleHQKICAgICAgICAgICAgICAgICAuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0Lk5PVElGSUNBVElPTl9TRVJWSUNFKTsKLSAgICAgICAgCisKICAgICAgICAgaWYgKHZpc2libGUpIHsKICAgICAgICAgICAgIG5vdGlmaWNhdGlvbk1hbmFnZXIubm90aWZ5KGlkLCBub3RpZmljYXRp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LmQoVEFHLCAicmVhc3Nlc3NQaWREbnMgZm9yIHBpZCAiICsgbXlQaWQpOworICAgICAgICBmb3IoaW50IGkgOiBtUHJpb3JpdHlMaXN0KSB7CisgICAgICAgICAgICBpZiAobU5ldEF0dHJpYnV0ZXNbaV0uaXNEZWZhdWx0KCkpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE5ldHdvcmtTdGF0ZVRyYWNrZXIgbnQgPSBtTmV0VHJhY2tlcnNbaV07CisgICAgICAgICAgICBpZiAobnQuZ2V0TmV0d29ya0luZm8oKS5pc0Nvbm5lY3RlZCgpICYmCisgICAgICAgICAgICAgICAgICAgICFudC5pc1RlYXJkb3duUmVxdWVzdGVkKCkpIHsKKyAgICAgICAgICAgICAgICBMaXN0IHBpZHMgPSBtTmV0UmVxdWVzdGVyc1BpZHNbaV07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaj0wOyBqPHBpZHMuc2l6ZSgpOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgSW50ZWdlciBwaWQgPSAoSW50ZWdlcilwaWRzLmdldChqKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBpZC5pbnRWYWx1ZSgpID09IG15UGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBkbnNMaXN0ID0gbnQuZ2V0TmFtZVNlcnZlcnMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlUGlkRG5zKGRuc0xpc3QsIG15UGlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb0J1bXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBidW1wRG5zKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBub3RoaW5nIGZvdW5kIC0gZGVsZXRlCisgICAgICAgIGZvciAoaW50IGkgPSAxOyA7IGkrKykgeworICAgICAgICAgICAgU3RyaW5nIHByb3AgPSAibmV0LmRucyIgKyBpICsgIi4iICsgbXlQaWQ7CisgICAgICAgICAgICBpZiAoU3lzdGVtUHJvcGVydGllcy5nZXQocHJvcCkubGVuZ3RoKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChkb0J1bXApIHsKKyAgICAgICAgICAgICAgICAgICAgYnVtcERucygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTeXN0ZW1Qcm9wZXJ0aWVzLnNldChwcm9wLCAiIik7CisgICAgICAgIH0KKyAgICB9CiAKLSAgICAgICAgZm9yIChpbnQgbmV0VHlwZSA9IENvbm5lY3Rpdml0eU1hbmFnZXIuVFlQRV9XSUZJOyBuZXRUeXBlICE9IHN0b3BWYWx1ZTsgbmV0VHlwZSArPSBpbmNyVmFsdWUpIHsKKyAgICBwcml2YXRlIHZvaWQgd3JpdGVQaWREbnMoU3RyaW5nW10gZG5zTGlzdCwgaW50IHBpZCkgeworICAgICAgICBpbnQgaiA9IDE7CisgICAgICAgIGZvciAoU3RyaW5nIGRucyA6IGRuc0xpc3QpIHsKKyAgICAgICAgICAgIGlmIChkbnMgIT0gbnVsbCAmJiAhVGV4dFV0aWxzLmVxdWFscyhkbnMsICIwLjAuMC4wIikpIHsKKyAgICAgICAgICAgICAgICBTeXN0ZW1Qcm9wZXJ0aWVzLnNldCgibmV0LmRucyIgKyBqKysgKyAiLiIgKyBwaWQsIGRucyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgYnVtcERucygpIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogQnVtcCB0aGUgcHJvcGVydHkgdGhhdCB0ZWxscyB0aGUgbmFtZSByZXNvbHZlciBs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gICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICIgY2hlY2tpbmcgIiArIG50KTsKKyAgICAgICAgICAgIGlmIChudCAhPSBudWxsICYmIG50LmdldE5ldHdvcmtJbmZvKCkuaXNDb25uZWN0ZWQoKSAmJgorICAgICAgICAgICAgICAgICAgICAhbnQuaXNUZWFyZG93blJlcXVlc3RlZCgpKSB7CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiICBjb25uZWN0ZWQiKTsKICAgICAgICAgICAgICAgICBTdHJpbmdbXSBkbnNMaXN0ID0gbnQuZ2V0TmFtZVNlcnZlcnMoKTsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGRuc0xpc3QubGVuZ3RoICYmIGRuc0xpc3RbaV0gIT0gbnVsbDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHNraXAgZHVwbGljYXRlIGVudHJpZXMKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFkbnNMaXN0W2ldLmVxdWFscyhsYXN0RG5zKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtUHJvcGVydGllcy5zZXQoIm5ldC5kbnMiICsgaW5kZXgrKywgZG5zTGlzdFtpXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYXN0RG5zID0gZG5zTGlzdFtpXTsKKyAgICAgICAgICAgICAgICBpZiAobU5ldEF0dHJpYnV0ZXNbbmV0VHlwZV0uaXNEZWZhdWx0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IGogPSAxOworICAgICAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBkbnMgOiBkbnNMaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG5zICE9IG51bGwgJiYgIVRleHRVdGlscy5lcXVhbHMoZG5zLCAiMC4wLjAuMCIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiICBhZGRpbmcgIitkbnMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuc2V0KCJuZXQuZG5zIiArIGorKywgZG5zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBrPWogOyBrPG1OdW1EbnNFbnRyaWVzOyBrKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgImVyYXNpbmcgbmV0LmRucyIgKyBrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuc2V0KCJuZXQuZG5zIiArIGssICIiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtTnVtRG5zRW50cmllcyA9IGo7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gc2V0IHBlci1waWQgZG5zIGZvciBhdHRhY2hlZCBzZWNvbmRhcnkgbmV0cworICAgICAgICAgICAgICAgICAgICBMaXN0IHBpZHMgPSBtTmV0UmVxdWVzdGVyc1BpZHNbbmV0VHlwZV07CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IHk9MDsgeTwgcGlkcy5zaXplKCk7IHkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgSW50ZWdlciBwaWQgPSAoSW50ZWdlcilwaWRzLmdldCh5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlUGlkRG5zKGRuc0xpc3QsIHBpZC5pbnRWYWx1ZSgpKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAvLyBOdWxsIG91dCBhbnkgRE5TIHByb3BlcnRpZXMgdGhhdCBhcmUgbm8gbG9uZ2VyIHVzZWQKLSAgICAgICAgZm9yIChpbnQgaSA9IGluZGV4OyBpIDw9IG1OdW1EbnNFbnRyaWVzOyBpKyspIHsKLSAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuc2V0KCJuZXQuZG5zIiArIGksICIiKTsKKworICAgICAgICBidW1wRG5zKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgZ2V0UmVzdG9yZURlZmF1bHROZXR3b3JrRGVsYXkoKSB7CisgICAgICAgIFN0cmluZyByZXN0b3JlRGVmYXVsdE5ldHdvcmtEZWxheVN0ciA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KAorICAgICAgICAgICAgICAgIE5FVFdPUktfUkVTVE9SRV9ERUxBWV9QUk9QX05BTUUpOworICAgICAgICBpZihyZXN0b3JlRGVmYXVsdE5ldHdvcmtEZWxheVN0ciAhPSBudWxsICYmCisgICAgICAgICAgICAgICAgcmVzdG9yZURlZmF1bHROZXR3b3JrRGVsYXlTdHIubGVuZ3RoKCkgIT0gMCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gSW50ZWdlci52YWx1ZU9mKHJlc3RvcmVEZWZhdWx0TmV0d29ya0RlbGF5U3RyKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgbU51bURuc0VudHJpZXMgPSBpbmRleCAtIDE7Ci0gICAgICAgIC8vIE5vdGlmeSB0aGUgbmFtZSByZXNvbHZlciBsaWJyYXJ5IG9mIHRoZSBjaGFuZ2UKLSAgICAgICAgU3lzdGVtUHJvcGVydGllcy5zZXQoIm5ldC5kbnNjaGFuZ2UiLCBTdHJpbmcudmFsdWVPZihzRG5zQ2hhbmdlQ291bnRlcisrKSk7Ci0gICAgICAgIHJldHVybiBudW1Db25uZWN0ZWROZXRzOworICAgICAgICByZXR1cm4gUkVTVE9SRV9ERUZBVUxUX05FVFdPUktfREVMQVk7CiAgICAgfQogCiAgICAgQE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cub2JqOwotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cudihUQUcsICJDb25uZWN0aXZpdHlDaGFuZ2UgZm9yICIgKyBpbmZvLmdldFR5cGVOYW1lKCkgKyAiOiAiICsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiQ29ubmVjdGl2aXR5Q2hhbmdlIGZvciAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLmdldFR5cGVOYW1lKCkgKyAiOiAiICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLmdldFN0YXRlKCkgKyAiLyIgKyBpbmZvLmdldERldGFpbGVkU3RhdGUoKSk7CiAKICAgICAgICAgICAgICAgICAgICAgLy8gQ29ubmVjdGl2aXR5IHN0YXRlIGNoYW5nZWQ6CiAgICAgICAgICAgICAgICAgICAgIC8vIFszMS0xM10gUmVzZXJ2ZWQgZm9yIGZ1dHVyZSB1c2UKLSAgICAgICAgICAgICAgICAgICAgLy8gWzEyLTldIE5ldHdvcmsgc3VidHlwZSAoZm9yIG1vYmlsZSBuZXR3b3JrLCBhcyBkZWZpbmVkIGJ5IFRlbGVwaG9ueU1hbmFnZXIpCi0gICAgICAgICAgICAgICAgICAgIC8vIFs4LTNdIERldGFpbGVkIHN0YXRlIG9yZGluYWwgKGFzIGRlZmluZWQgYnkgTmV0d29ya0luZm8uRGV0YWlsZWRTdGF0ZSkKKyAgICAgICAgICAgICAgICAgICAgLy8gWzEyLTldIE5ldHdvcmsgc3VidHlwZSAoZm9yIG1vYmlsZSBuZXR3b3JrLCBhcyBkZWZpbmVkCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgYnkgVGVsZXBob255TWFuYWdlcikKKyAgICAgICAgICAgICAgICAgICAgLy8gWzgtM10gRGV0YWlsZWQgc3RhdGUgb3JkaW5hbCAoYXMgZGVmaW5lZCBieQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgIE5ldHdvcmtJbmZvLkRldGFpbGVkU3RhdGUpCiAgICAgICAgICAgICAgICAgICAgIC8vIFsyLTBdIE5ldHdvcmsgdHlwZSAoYXMgZGVmaW5lZCBieSBDb25uZWN0aXZpdHlNYW5hZ2VyKQogICAgICAgICAgICAgICAgICAgICBpbnQgZXZlbnRMb2dQYXJhbSA9IChpbmZvLmdldFR5cGUoKSAmIDB4NykgfAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoaW5mby5nZXREZXRhaWxlZFN0YXRlKCkub3JkaW5hbCgpICYgMHgzZikgPDwgMykgfAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbmZvLmdldFN1YnR5cGUoKSA8PCA5KTsKLSAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19DT05ORUNUSVZJVFlfU1RBVEVfQ0hBTkdFRCwgZXZlbnRMb2dQYXJhbSk7Ci0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICBpZiAoaW5mby5nZXREZXRhaWxlZFN0YXRlKCkgPT0gTmV0d29ya0luZm8uRGV0YWlsZWRTdGF0ZS5GQUlMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFVkVOVExPR19DT05ORUNUSVZJVFlfU1RBVEVfQ0hBTkdFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudExvZ1BhcmFtKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoaW5mby5nZXREZXRhaWxlZFN0YXRlKCkgPT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrSW5mby5EZXRhaWxlZFN0YXRlLkZBSUxFRCkgewogICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlQ29ubmVjdGlvbkZhaWx1cmUoaW5mbyk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5mby5nZXRTdGF0ZSgpID09IE5ldHdvcmtJbmZvLlN0YXRlLkRJU0NPTk5FQ1RFRCkgeworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGluZm8uZ2V0U3RhdGUoKSA9PQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5ldHdvcmtJbmZvLlN0YXRlLkRJU0NPTk5FQ1RFRCkgewogICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlRGlzY29ubmVjdChpbmZvKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbmZvLmdldFN0YXRlKCkgPT0gTmV0d29ya0luZm8uU3RhdGUuU1VTUEVOREVEKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBuZWVkIHRvIHRoaW5rIHRoaXMgb3Zlci4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBsb2dpYyBoZXJlIGlzLCBoYW5kbGUgU1VTUEVOREVEIHRoZSBzYW1lIGFzIERJU0NPTk5FQ1RFRC4gVGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IGRpZmZlcmVuY2UgYmVpbmcgd2UgYXJlIGJyb2FkY2FzdGluZyBhbiBpbnRlbnQgd2l0aCBOZXR3b3JrSW5mbwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhhdCdzIHN1c3BlbmRlZC4gVGhpcyBhbGxvd3MgdGhlIGFwcGxpY2F0aW9ucyBhbiBvcHBvcnR1bml0eSB0bwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gaGFuZGxlIERJU0NPTk5FQ1RFRCBhbmQgU1VTUEVOREVEIGRpZmZlcmVudGx5LCBvciBub3QuCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgbG9naWMgaGVyZSBpcywgaGFuZGxlIFNVU1BFTkRFRCB0aGUgc2FtZSBhcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRElTQ09OTkVDVEVELiBUaGUgb25seSBkaWZmZXJlbmNlIGJlaW5nIHdlIGFyZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnJvYWRjYXN0aW5nIGFuIGludGVudCB3aXRoIE5ldHdvcmtJbmZvIHRoYXQncworICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3VzcGVuZGVkLiBUaGlzIGFsbG93cyB0aGUgYXBwbGljYXRpb25zIGFuCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBvcHBvcnR1bml0eSB0byBoYW5kbGUgRElTQ09OTkVDVEVEIGFuZCBTVVNQRU5ERUQKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRpZmZlcmVudGx5LCBvciBub3QuCiAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVEaXNjb25uZWN0KGluZm8pOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGluZm8uZ2V0U3RhdGUoKSA9PSBOZXR3b3JrSW5mby5TdGF0ZS5DT05ORUNURUQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUNvbm5lY3QoaW5mbyk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlQ29ubmVjdGl2aXR5Q2hhbmdlKCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICAgICAgY2FzZSBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX1NDQU5fUkVTVUxUU19BVkFJTEFCTEU6CiAgICAgICAgICAgICAgICAgICAgIGluZm8gPSAoTmV0d29ya0luZm8pIG1zZy5vYmo7CiAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVNjYW5SZXN1bHRzQXZhaWxhYmxlKGluZm8pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBjYXNlIE5ldHdvcmtTdGF0ZVRyYWNrZXIuRVZFTlRfTk9USUZJQ0FUSU9OX0NIQU5HRUQ6Ci0gICAgICAgICAgICAgICAgICAgIGhhbmRsZU5vdGlmaWNhdGlvbkNoYW5nZShtc2cuYXJnMSA9PSAxLCBtc2cuYXJnMiwgKE5vdGlmaWNhdGlvbikgbXNnLm9iaik7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZU5vdGlmaWNhdGlvbkNoYW5nZShtc2cuYXJnMSA9PSAxLCBtc2cuYXJnMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTm90aWZpY2F0aW9uKSBtc2cub2JqKTsKIAogICAgICAgICAgICAgICAgIGNhc2UgTmV0d29ya1N0YXRlVHJhY2tlci5FVkVOVF9DT05GSUdVUkFUSU9OX0NIQU5HRUQ6Ci0gICAgICAgICAgICAgICAgICAgIGhhbmRsZUNvbmZpZ3VyYXRpb25DaGFuZ2UoKTsKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlRG5zQ29uZmlndXJhdGlvbkNoYW5nZSgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgIGNhc2UgTmV0d29ya1N0YXRlVHJhY2tlci5FVkVOVF9ST0FNSU5HX0NIQU5HRUQ6CkBAIC03MzQsNiArMTIzNCwxOSBAQAogICAgICAgICAgICAgICAgIGNhc2UgTmV0d29ya1N0YXRlVHJhY2tlci5FVkVOVF9ORVRXT1JLX1NVQlRZUEVfQ0hBTkdFRDoKICAgICAgICAgICAgICAgICAgICAgLy8gZmlsbCBtZSBpbgogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE5ldHdvcmtTdGF0ZVRyYWNrZXIuRVZFTlRfUkVTVE9SRV9ERUZBVUxUX05FVFdPUks6CisgICAgICAgICAgICAgICAgICAgIGZvciAoTmV0d29ya1N0YXRlVHJhY2tlciBuZXQgOiBtTmV0VHJhY2tlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIE5ldHdvcmtJbmZvIGkgPSBuZXQuZ2V0TmV0d29ya0luZm8oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpLmlzQ29ubmVjdGVkKCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIW1OZXRBdHRyaWJ1dGVzW2kuZ2V0VHlwZSgpXS5pc0RlZmF1bHQoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAidGVhcmluZyBkb3duICIgKyBpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHRvIHJlc3RvcmUgdGhlIGRlZmF1bHQgbmV0d29yayIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWFyZG93bihuZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvRG9ja09ic2VydmVyLmphdmEgYi9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9Eb2NrT2JzZXJ2ZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43Mzg1MzU5Ci0tLSAvZGV2L251bGwKKysrIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvRG9ja09ic2VydmVyLmphdmEKQEAgLTAsMCArMSwxMTIgQEAKKy8qCisgKiBDb3B5cmlnaHQgKEMpIDIwMDggVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcH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AgfQorCisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpbnQgbmV3U3RhdGUgPSBJbnRlZ2VyLnBhcnNlSW50KGV2ZW50LmdldCgiU1dJVENIX1NUQVRFIikpOworICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSAhPSBtRG9ja1N0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgIG1Eb2NrU3RhdGUgPSBuZXdTdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1TeXN0ZW1SZWFkeSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkNvdWxkIG5vdCBwYXJzZSBzd2l0Y2ggc3RhdGUgZnJvbSBldmVudCAiICsgZXZlbnQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCB2b2lkIGluaXQoKSB7CisgICAgICAgIGNoYXJbXSBidWZmZXIgPSBuZXcgY2hhclsxMDI0XTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgRmlsZVJlYWRlciBmaWxlID0gbmV3IEZpbGVSZWFkZXIoRE9DS19TVEFURV9QQVRIKTsKKyAgICAgICAgICAgIGludCBsZW4gPSBmaWxlLnJlYWQoYnVmZmVyLCAwLCAxMDI0KTsKKyAgICAgICAgICAgIG1Eb2NrU3RhdGUgPSBJbnRlZ2VyLnZhbHVlT2YoKG5ldyBTdHJpbmcoYnVmZmVyLCAwLCBsZW4pKS50cmltKCkpOworCisgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cudyhUQUcsICJUaGlzIGtlcm5lbCBkb2VzIG5vdCBoYXZlIGRvY2sgc3RhdGlvbiBzdXBwb3J0Iik7CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICIiICwgZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIHN5c3RlbVJlYWR5KCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIC8vIGRvbid0IGJvdGhlciBicm9hZGNhc3RpbmcgdW5kb2NrZWQgaGVyZQorICAgICAgICAgICAgaWYgKG1Eb2NrU3RhdGUgIT0gSW50ZW50LkVYVFJBX0RPQ0tfU1RBVEVfVU5ET0NLRUQpIHsKKyAgICAgICAgICAgICAgICB1cGRhdGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1TeXN0ZW1SZWFkeSA9IHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHZvaWQgdXBkYXRlKCkgeworICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKDApOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgSGFuZGxlciBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiQnJvYWRjYXN0aW5nIGRvY2sgc3RhdGUgIiArIG1Eb2NrU3RhdGUpOworICAgICAgICAgICAgICAgIC8vIFBhY2sgdXAgdGhlIHZhbHVlcyBhbmQgYnJvYWRjYXN0IHRoZW0gdG8gZXZlcnlvbmUKKyAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX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KIAorICAgIHByaXZhdGUgZmluYWwgTGlua2VkTGlzdDxWaWJyYXRpb24+IG1WaWJyYXRpb25zOworICAgIHByaXZhdGUgVmlicmF0aW9uIG1DdXJyZW50VmlicmF0aW9uOworCiAgICAgcHJpdmF0ZSBib29sZWFuIG1BdHRlbnRpb25MaWdodE9uOwogICAgIHByaXZhdGUgYm9vbGVhbiBtUHVsc2luZzsKIAorICAgIHByaXZhdGUgY2xhc3MgVmlicmF0aW9uIGltcGxlbWVudHMgSUJpbmRlci5EZWF0aFJlY2lwaWVudCB7CisgICAgICAgIHByaXZhdGUgZmluYWwgSUJpbmRlciBtVG9rZW47CisgICAgICAgIHByaXZhdGUgZmluYWwgbG9uZyAgICBtVGltZW91dDsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBsb25nICAgIG1TdGFydFRpbWU7CisgICAgICAgIHByaXZhdGUgZmluYWwgbG9uZ1tdICBtUGF0dGVybjsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBpbnQgICAgIG1SZXBlYXQ7CisKKyAgICAgICAgVmlicmF0aW9uKElCaW5kZXIgdG9rZW4sIGxvbmcgbWlsbGlzKSB7CisgICAgICAgICAgICB0aGlzKHRva2VuLCBtaWxsaXMsIG51bGwsIDApOworICAgICAgICB9CisKKyAgICAgICAgVmlicmF0aW9uKElCaW5kZXIgdG9rZW4sIGxvbmdbXSBwYXR0ZXJuLCBpbnQgcmVwZWF0KSB7CisgICAgICAgICAgICB0aGlzKHRva2VuLCAwLCBwYXR0ZXJuLCByZXBlYXQpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBWaWJyYXRpb24oSUJpbmRlciB0b2tlbiwgbG9uZyBtaWxsaXMsIGxvbmdbXSBwYXR0ZXJuLAorICAgICAgICAgICAgICAgIGludCByZXBlYXQpIHsKKyAgICAgICAgICAgIG1Ub2tlbiA9IHRva2VuOworICAgICAgICAgICAgbVRpbWVvdXQgPSBtaWxsaXM7CisgICAgICAgICAgICBtU3RhcnRUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICBtUGF0dGVybiA9IHBhdHRlcm47CisgICAgICAgICAgICBtUmVwZWF0ID0gcmVwZWF0OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgYmluZGVyRGllZCgpIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVZpYnJhdGlvbnMpIHsKKyAgICAgICAgICAgICAgICBtVmlicmF0aW9ucy5yZW1vdmUodGhpcyk7CisgICAgICAgICAgICAgICAgaWYgKHRoaXMgPT0gbUN1cnJlbnRWaWJyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgZG9DYW5jZWxWaWJyYXRlTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgIHN0YXJ0TmV4dFZpYnJhdGlvbkxvY2tlZCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBib29sZWFuIGhhc0xvbmdlclRpbWVvdXQobG9uZyBtaWxsaXMpIHsKKyAgICAgICAgICAgIGlmIChtVGltZW91dCA9PSAwKSB7CisgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyBhIHBhdHRlcm4sIHJldHVybiBmYWxzZSB0byBwbGF5IHRoZSBzaW1wbGUKKyAgICAgICAgICAgICAgICAvLyB2aWJyYXRpb24uCisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChtU3RhcnRUaW1lICsgbVRpbWVvdXQpCisgICAgICAgICAgICAgICAgICAgIDwgKFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpICsgbWlsbGlzKSkgeworICAgICAgICAgICAgICAgIC8vIElmIHRoaXMgdmlicmF0aW9uIHdpbGwgZW5kIGJlZm9yZSB0aGUgdGltZSBwYXNzZWQgaW4sIGxldAorICAgICAgICAgICAgICAgIC8vIHRoZSBuZXcgdmlic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ICAgICAgICAgICAgZG9DYW5jZWxWaWJyYXRlTG9ja2VkKCk7CisgICAgICAgICAgICBtQ3VycmVudFZpYnJhdGlvbiA9IHZpYjsKKyAgICAgICAgICAgIHN0YXJ0VmlicmF0aW9uTG9ja2VkKHZpYik7CisgICAgICAgIH0KICAgICB9CiAKICAgICBwcml2YXRlIGJvb2xlYW4gaXNBbGwwKGxvbmdbXSBwYXR0ZXJuKSB7CkBAIC0xMjEsMzQgKzE5MywyNSBAQAogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICAgICAgRGVhdGggZGVhdGggPSBuZXcgRGVhdGgodG9rZW4pOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHRva2VuLmxpbmtUb0RlYXRoKGRlYXRoLCAwKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICBWaWJyYXRpb24gdmliID0gbmV3IFZpYnJhdGlvbih0b2tlbiwgcGF0dGVybiwgcmVwZWF0KTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgdG9rZW4ubGlua1RvRGVhdGgodmliLCAwKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1WaWJyYXRpb25zKSB7CisgICAgICAgICAgICAgICAgcmVtb3ZlVmlicmF0aW9uTG9ja2VkKHRva2VuKTsKKyAgICAgICAgICAgICAgICBkb0NhbmNlbFZpYnJhdGVMb2NrZWQoKTsKKyAgICAgICAgICAgICAgICBpZiAocmVwZWF0ID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgbVZpYnJhdGlvbnMuYWRkRmlyc3QodmliKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhcnROZXh0VmlicmF0aW9uTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gQSBuZWdhdGl2ZSByZXBlYXQgbWVhbnMgdGhhdCB0aGlzIHBhdHRlcm4gaXMgbm90IG1lYW50CisgICAgICAgICAgICAgICAgICAgIC8vIHRvIHJlcGVhdC4gVHJlYXQgaXQgbGlrZSBhIHNpbXBsZSB2aWJyYXRpb24uCisgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50VmlicmF0aW9uID0gdmliOworICAgICAgICAgICAgICAgICAgICBzdGFydFZpYnJhdGlvbkxvY2tlZCh2aWIpOwogICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIFRocmVhZCBvbGRUaHJlYWQgPSBtVGhyZWFkOwotCi0gICAgICAgICAgICAgICAgaWYgKG9sZFRocmVhZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHN0b3AgdGhlIG9sZCBvbmUKLSAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtVGhyZWFkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVGhyZWFkLm1Eb25lID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1UaHJlYWQubm90aWZ5KCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAobURlYXRoICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbVRva2VuLnVubGlua1RvRGVhdGgobURlYXRoLCAwKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtRGVhdGggPSBkZWF0aDsKLSAgICAgICAgICAgICAgICBtVG9rZW4gPSB0b2tlbjsKLQotICAgICAgICAgICAgICAgIC8vIHN0YXJ0IHRoZSBuZXcgdGhyZWFkCi0gICAgICAgICAgICAgICAgbVRocmVhZCA9IG5ldyBWaWJyYXRlVGhyZWFkKHBhdHRlcm4sIHJlcGVhdCk7Ci0gICAgICAgICAgICAgICAgbVRocmVhZC5zdGFydCgpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGZpbmFsbHkgewpAQCAtMTU2LDcgKzIxOSw3IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCBjYW5jZWxWaWJyYXRlKCkgeworICAgIHB1YmxpYyB2b2lkIGNhbmNlbFZpYnJhdGUoSUJpbmRlciB0b2tlbikgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oCiAgICAgICAgICAgICAgICAgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLlZJQlJBVEUsCiAgICAgICAgICAgICAgICAgImNhbmNlbFZpYnJhdGUiKTsKQEAgLTE2NCw3ICsyMjcsMTMgQEAKICAgICAgICAgLy8gc28gd2FrZWxvY2sgY2FsbHMgd2lsbCBzdWNjZWVkCiAgICAgICAgIGxvbmcgaWRlbnRpdHkgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGRvQ2FuY2VsVmlicmF0ZSgpOworICAgICAgICAgICAgc3luY2hyb25pemVkIChtVmlicmF0aW9ucykgeworICAgICAgICAgICAgICAgIGZpbmFsIFZpYnJhdGlvbiB2aWIgPSByZW1vdmVWaWJyYXRpb25Mb2NrZWQodG9rZW4pOworICAgICAgICAgICAgICAgIGlmICh2aWIgPT0gbUN1cnJlbnRWaWJyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgZG9DYW5jZWxWaWJyYXRlTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgIHN0YXJ0TmV4dFZpYnJhdGlvbkxvY2tlZCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBmaW5hbGx5IHsKICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50aXR5KTsKQEAgLTI3NywyNyArMzQ2LDc0IEBACiAgICAgICAgIH0KICAgICB9OwogCi0gICAgcHJpdmF0ZSB2b2lkIGRvQ2FuY2VsVmlicmF0ZSgpIHsKLSAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7Ci0gICAgICAgICAgICBpZiAobVRocmVhZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtVGhyZWFkKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1UaHJlYWQubURvbmUgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtVGhyZWFkLm5vdGlmeSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtVGhyZWFkID0gbnVsbDsKKyAgICBwcml2YXRlIGZpbmFsIFJ1bm5hYmxlIG1WaWJyYXRpb25SdW5uYWJsZSA9IG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChtVmlicmF0aW9ucykgeworICAgICAgICAgICAgICAgIGRvQ2FuY2VsVmlicmF0ZUxvY2tlZCgpOworICAgICAgICAgICAgICAgIHN0YXJ0TmV4dFZpYnJhdGlvbkxvY2tlZCgpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgdmlicmF0b3JPZmYoKTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICAvLyBMb2NrIGhlbGQgb24gbVZpYnJhdGlvbnMKKyAgICBwcml2YXRlIHZvaWQgZG9DYW5jZWxWaWJyYXRlTG9ja2VkKCkgeworICAgICAgICBpZiAobVRocmVhZCAhPSBudWxsKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1UaHJlYWQpIHsKKyAgICAgICAgICAgICAgICBtVGhyZWFkLm1Eb25lID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtVGhyZWFkLm5vdGlmeSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVRocmVhZCA9IG51bGw7CisgICAgICAgIH0KKyAgICAgICAgdmlicmF0b3JPZmYoKTsKKyAgICAgICAgbUgucmVtb3ZlQ2FsbGJhY2tzKG1WaWJyYXRpb25SdW5uYWJsZSk7CisgICAgfQorCisgICAgLy8gTG9jayBoZWxkIG9uIG1WaWJyYXRpb25zCisgICAgcHJpdmF0ZSB2b2lkIHN0YXJ0TmV4dFZpYnJhdGlvbkxvY2tlZCgpIHsKKyAgICAgICAgaWYgKG1WaWJyYXRpb25zLnNpemUoKSA8PSAwKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbUN1cnJlbnRWaWJyYXRpb24gPSBtVmlicmF0aW9ucy5nZXRGaXJzdCgpOworICAgICAgICBzdGFydFZpYnJhdGlvbkxvY2tlZChtQ3VycmVudFZpYnJhdGlvbik7CisgICAgfQorCisgICAgLy8gTG9jayBoZWxkIG9uIG1WaWJyYXRpb25zCisgICAgcHJpdmF0ZSB2b2lkIHN0YXJ0VmlicmF0aW9uTG9ja2VkKGZpbmFsIFZpYnJhdGlvbiB2aWIpIHsKKyAgICAgICAgaWYgKHZpYi5tVGltZW91dCAhPSAwKSB7CisgICAgICAgICAgICB2aWJyYXRvck9uKHZpYi5tVGltZW91dCk7CisgICAgICAgICAgICBtSC5wb3N0RGVsYXllZChtVmlicmF0aW9uUnVubmFibGUsIHZpYi5tVGltZW91dCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBtVGhyZWFkIGJldHRlciBiZSBudWxsIGhlcmUuIGRvQ2FuY2VsVmlicmF0ZSBzaG91bGQgYWx3YXlzIGJlCisgICAgICAgICAgICAvLyBjYWxsZWQgYmVmb3JlIHN0YXJ0TmV4dFZpYnJhdGlvbkxvY2tlZCBvciBzdGFydFZpYnJhdGlvbkxvY2tlZC4KKyAgICAgICAgICAgIG1UaHJlYWQgPSBuZXcgVmlicmF0ZVRocmVhZCh2aWIpOworICAgICAgICAgICAgbVRocmVhZC5zdGFydCgpOwogICAgICAgICB9CiAgICAgfQogCisgICAgLy8gTG9jayBoZWxkIG9uIG1WaWJyYXRpb25zCisgICAgcHJpdmF0ZSBWaWJyYXRpb24gcmVtb3ZlVmlicmF0aW9uTG9ja2VkKElCaW5kZXIgdG9rZW4pIHsKKyAgICAgICAgTGlzdEl0ZXJhdG9yPFZpYnJhdGlvbj4gaXRlciA9IG1WaWJyYXRpb25zLmxpc3RJdGVyYXRvcigwKTsKKyAgICAgICAgd2hpbGUgKGl0ZXIuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICBWaWJyYXRpb24gdmliID0gaXRlci5uZXh0KCk7CisgICAgICAgICAgICBpZiAodmliLm1Ub2tlbiA9PSB0b2tlbikgeworICAgICAgICAgICAgICAgIGl0ZXIucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHZpYjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBXZSBtaWdodCBiZSBsb29raW5nIGZvciBhIHNpbXBsZSB2aWJyYXRpb24gd2hpY2ggaXMgb25seSBzdG9yZWQgaW4KKyAgICAgICAgLy8gbUN1cnJlbnRWaWJyYXRpb24uCisgICAgICAgIGlmIChtQ3VycmVudFZpYnJhdGlvbiAhPSBudWxsICYmIG1DdXJyZW50VmlicmF0aW9uLm1Ub2tlbiA9PSB0b2tlbikgeworICAgICAgICAgICAgcmV0dXJuIG1DdXJyZW50VmlicmF0aW9uOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKwogICAgIHByaXZhdGUgY2xhc3MgVmlicmF0ZVRocmVhZCBleHRlbmRzIFRocmVhZCB7Ci0gICAgICAgIGxvbmdbXSBtUGF0dGVybjsKLSAgICAgICAgaW50IG1SZXBlYXQ7CisgICAgICAgIGZpbmFsIFZpYnJhdGlvbiBtVmlicmF0aW9uOwogICAgICAgICBib29sZWFuIG1Eb25lOwogICAgIAotICAgICAgICBWaWJyYXRlVGhyZWFkKGxvbmdbXSBwYXR0ZXJuLCBpbnQgcmVwZWF0KSB7Ci0gICAgICAgICAgICBtUGF0dGVybiA9IHBhdHRlcm47Ci0gICAgICAgICAgICBtUmVwZWF0ID0gcmVwZWF0OworICAgICAgICBWaWJyYXRlVGhyZWFkKFZpYnJhdGlvbiB2aWIpIHsKKyAgICAgICAgICAgIG1WaWJyYXRpb24gPSB2aWI7CiAgICAgICAgICAgICBtV2FrZUxvY2suYWNxdWlyZSgpOwogICAgICAgICB9CiAKQEAgLTMyMyw4ICs0MzksOSBAQAogICAgICAgICAgICAgUHJvY2Vzcy5zZXRUaHJlYWRQcmlvcml0eShQcm9jZXNzLlRIUkVBRF9QUklPUklUWV9VUkdFTlRfRElTUExBWSk7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgICAgICBpbnQgaW5kZXggPSAwOwotICAgICAgICAgICAgICAgIGxvbmdbXSBwYXR0ZXJuID0gbVBhdHRlcm47CisgICAgICAgICAgICAgICAgbG9uZ1tdIHBhdHRlcm4gPSBtVmlicmF0aW9uLm1QYXR0ZXJuOwogICAgICAgICAgICAgICAgIGludCBsZW4gPSBwYXR0ZXJuLmxlbmd0aDsKKyAgICAgICAgICAgICAgICBpbnQgcmVwZWF0ID0gbVZpYnJhdGlvbi5tUmVwZWF0OwogICAgICAgICAgICAgICAgIGxvbmcgZHVyYXRpb24gPSAwOwogCiAgICAgICAgICAgICAgICAgd2hpbGUgKCFtRG9uZSkgewpAQCAtMzQ3LDUwICs0NjQsMzcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIYXJkd2FyZVNlcnZpY2UudGhpcy52aWJyYXRvck9uKGR1cmF0aW9uKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtUmVwZWF0IDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcGVhdCA8IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBtUmVwZWF0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gcmVwZWF0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAobURvbmUpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBzdXJlIHZpYnJhdG9yIGlzIG9mZiBpZiB3ZSB3ZXJlIGNhbmNlbGxlZC4KLSAgICAgICAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlLCBpdCB3aWxsIHR1cm4gb2ZmIGF1dG9tYXRpY2FsbHkgCi0gICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gdGhlIGxhc3QgdGltZW91dCBleHBpcmVzLgotICAgICAgICAgICAgICAgICAgICBIYXJkd2FyZVNlcnZpY2UudGhpcy52aWJyYXRvck9mZigpOwotICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtV2FrZUxvY2sucmVsZWFzZSgpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgc3luY2hyb25pemVkIChIYXJkd2FyZVNlcnZpY2UudGhpcykgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChtVmlicmF0aW9ucykgewogICAgICAgICAgICAgICAgIGlmIChtVGhyZWFkID09IHRoaXMpIHsKICAgICAgICAgICAgICAgICAgICAgbVRocmVhZCA9IG51bGw7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghbURvbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyB2aWJyYXRpb24gZmluaXNoZWQgbmF0dXJhbGx5LCBzdGFydCB0aGUgbmV4dAorICAgICAgICAgICAgICAgICAgICAvLyB2aWJyYXRpb24uCisgICAgICAgICAgICAgICAgICAgIG1WaWJyYXRpb25zLnJlbW92ZShtVmlicmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhcnROZXh0VmlicmF0aW9uTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfTsKIAotICAgIHByaXZhdGUgY2xhc3MgRGVhdGggaW1wbGVtZW50cyBJQmluZGVyLkRlYXRoUmVjaXBpZW50IHsKLSAgICAgICAgSUJpbmRlciBtTWU7Ci0KLSAgICAgICAgRGVhdGgoSUJpbmRlciBtZSkgewotICAgICAgICAgICAgbU1lID0gbWU7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBiaW5kZXJEaWVkKCkgewotICAgICAgICAgICAgc3luY2hyb25pemVkIChIYXJkd2FyZVNlcnZpY2UudGhpcykgewotICAgICAgICAgICAgICAgIGlmIChtTWUgPT0gbVRva2VuKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRvQ2FuY2VsVmlicmF0ZSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQogICAgIEJyb2FkY2FzdFJlY2VpdmVyIG1JbnRlbnRSZWNlaXZlciA9IG5ldyBCcm9hZGNhc3RSZWNlaXZlcigpIHsKICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgewogICAgICAgICAgICAgaWYgKGludGVudC5nZXRBY3Rpb24oKS5lcXVhbHMoSW50ZW50LkFDVElPTl9TQ1JFRU5fT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F9USFJFU0hPTEQsCiAgICAgICAgICAgICBUUkFDS0JBTExfTU9WRU1FTlRfVEhSRVNIT0xEKTsKQEAgLTQ4LDE0NiArNTcsNTAzIEBACiAgICAgICAgIGZsb2F0IHlNb3ZlU2NhbGU7CiAgICAgICAgIE1vdGlvbkV2ZW50IGN1cnJlbnRNb3ZlID0gbnVsbDsKICAgICAgICAgYm9vbGVhbiBjaGFuZ2VkID0gZmFsc2U7Ci0gICAgICAgIGJvb2xlYW4gZG93biA9IGZhbHNlOwotICAgICAgICBib29sZWFuIGxhc3REb3duID0gZmFsc2U7Ci0gICAgICAgIGxvbmcgZG93blRpbWUgPSAwOwotICAgICAgICBpbnQgeCA9IDA7Ci0gICAgICAgIGludCB5ID0gMDsKLSAgICAgICAgaW50IHByZXNzdXJlID0gMTsKLSAgICAgICAgaW50IHNpemUgPSAwOworICAgICAgICBsb25nIG1Eb3duVGltZSA9IDA7CisgICAgICAgIAorICAgICAgICAvLyBUaGUgY3VycmVudGx5IGFzc2lnbmVkIHBvaW50ZXIgSURzLCBjb3JyZXNwb25kaW5nIHRvIHRoZSBsYXN0IGRhdGEuCisgICAgICAgIGludFtdIG1Qb2ludGVySWRzID0gbmV3IGludFtNQVhfUE9JTlRFUlNdOworICAgICAgICAKKyAgICAgICAgLy8gVGhpcyBpcyB0aGUgbGFzdCBnZW5lcmF0ZWQgcG9pbnRlciBkYXRhLCBvcmRlcmVkIHRvIG1hdGNoCisgICAgICAgIC8vIG1Qb2ludGVySWRzLgorICAgICAgICBpbnQgbUxhc3ROdW1Qb2ludGVycyA9IDA7CisgICAgICAgIGZpbmFsIGludFtdIG1MYXN0RGF0YSA9IG5ldyBpbnRbTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBICogTUFYX1BPSU5URVJTXTsKKyAgICAgICAgCisgICAgICAgIC8vIFRoaXMgaXMgdGhlIG5leHQgc2V0IG9mIHBvaW50ZXIgZGF0YSBiZWluZyBnZW5lcmF0ZWQuICBJdCBpcyBub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RhID0gbmV3IGZsb2F0W01vdGlvbkV2ZW50Lk5VTV9TQU1QTEVfREFUQSAqIE1BWF9QT0lOVEVSU107CisgICAgICAgIAorICAgICAgICAvLyBUaGlzIGlzIG5vdCB1c2VkIGhlcmUsIGJ1dCBjYW4gYmUgdXNlZCBieSBjYWxsZXJzIGZvciBzdGF0ZSB0cmFja2luZy4KKyAgICAgICAgaW50IG1BZGRpbmdQb2ludGVyT2Zmc2V0ID0gMDsKKyAgICAgICAgZmluYWwgYm9vbGVhbltdIG1Eb3duID0gbmV3IGJvb2xlYW5bTUFYX1BPSU5URVJTXTsKICAgICAgICAgCiAgICAgICAgIE1vdGlvblN0YXRlKGludCBteCwgaW50IG15KSB7CiAgICAgICAgICAgICB4UHJlY2lzaW9uID0gbXg7CiAgICAgICAgICAgICB5UHJlY2lzaW9uID0gbXk7CiAgICAgICAgICAgICB4TW92ZVNjYWxlID0gbXggIT0gMCA/ICgxLjBmL214KSA6IDEuMGY7CiAgICAgICAgICAgICB5TW92ZVNjYWxlID0gbXkgIT0gMCA/ICgxLjBmL215KSA6IDEuMGY7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TUFYX1BPSU5URVJTOyBpKyspIHsKKyAgICAgICAgICAgICAgICBtUG9pbnRlcklkc1tpXSA9IGk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgCi0gICAgICAgIE1vdGlvbkV2ZW50IGdlbmVyYXRlTW90aW9uKElucHV0RGV2aWNlIGRldmljZSwgbG9uZyBjdXJUaW1lLAotICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNBYnMsIERpc3BsYXkgZGlzcGxheSwgaW50IG9yaWVudGF0aW9uLAorICAgICAgICBwcml2YXRlIGJvb2xlYW4gYXNzaWduUG9pbnRlcihpbnQgbmV4dEluZGV4LCBib29sZWFuIGFsbG93T3ZlcmxhcCkgeworICAgICAgICAgICAgZmluYWwgaW50IGxhc3ROdW1Qb2ludGVycyA9IG1MYXN0TnVtUG9pbnRlcnM7CisgICAgICAgICAgICBmaW5hbCBpbnRbXSBuZXh0Mkxhc3QgPSBtTmV4dDJMYXN0OworICAgICAgICAgICAgZmluYWwgbG9uZ1tdIG5leHQyTGFzdERpc3RhbmNlID0gbU5leHQyTGFzdERpc3RhbmNlOworICAgICAgICAgICAgZmluYWwgaW50W10gbGFzdDJOZXh0ID0gbUxhc3QyTmV4dDsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIGxhc3REYXRhID0gbUxhc3REYXRhOworICAgICAgICAgICAgZmluYWwgaW50W10gbmV4dERhdGEgPSBtTmV4dERhdGE7CisgICAgICAgICAgICBmaW5hbCBpbnQgaWQgPSBuZXh0SW5kZXggKiBNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEE7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgTG9nLnYoIklucHV0RGV2aWNlIiwgImFzc2lnblBvaW50ZXI6IG5leHRJbmRleD0iCisgICAgICAgICAgICAgICAgICAgICsgbmV4dEluZGV4ICsgIiBkYXRhT2ZmPSIgKyBpZCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgeDEgPSBuZXh0RGF0YVtpZCArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXTsKKyAgICAgICAgICAgIGZpbmFsIGludCB5MSA9IG5leHREYXRhW2lkICsgTW90aW9uRXZlbnQuU0FNUExFX1ldOworICAgICAgICAgICAgCisgICAgICAgICAgICBsb25nIGJlc3REaXN0YW5jZSA9IC0xOworICAgICAgICAgICAgaW50IGJlc3RJbmRleCA9IC0xOworICAgICAgICAgICAgZm9yIChpbnQgaj0wOyBqPGxhc3ROdW1Qb2ludGVyczsgaisrKSB7CisgICAgICAgICAgICAgICAgaWYgKCFhbGxvd092ZXJsYXAgJiYgbGFzdDJOZXh0W2pdIDwgMCkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZmluYWwgaW50IGpkID0gaiAqIE1vdGlvbkV2ZW50Lk5VTV9TQU1QTEVfREFUQTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgeGQgPSBsYXN0RGF0YVtqZCArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXSAtIHgxOworICAgICAgICAgICAgICAgIGZpbmFsIGludCB5ZCA9IGxhc3REYXRhW2pkICsgTW90aW9uRXZlbnQuU0FNUExFX1ldIC0geTE7CisgICAgICAgICAgICAgICAgZmluYWwgbG9uZyBkaXN0YW5jZSA9IHhkKihsb25nKXhkICsgeWQqKGxvbmcpeWQ7CisgICAgICAgICAgICAgICAgaWYgKGogPT0gMCB8fCBkaXN0YW5jZSA8IGJlc3REaXN0YW5jZSkgeworICAgICAgICAgICAgICAgICAgICBiZXN0RGlzdGFuY2UgPSBkaXN0YW5jZTsKKyAgICAgICAgICAgICAgICAgICAgYmVzdEluZGV4ID0gajsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgTG9nLnYoIklucHV0RGV2aWNlIiwgIk5ldyBpbmRleCAiICsgbmV4dEluZGV4CisgICAgICAgICAgICAgICAgICAgICsgIiBiZXN0IG9sZCBpbmRleD0iICsgYmVzdEluZGV4ICsgIiAoZGlzdGFuY2U9IgorICAgICAgICAgICAgICAgICAgICArIGJlc3REaXN0YW5jZSArICIpIik7CisgICAgICAgICAgICBuZXh0Mkxhc3RbbmV4dEluZGV4XSA9IGJlc3RJbmRleDsKKyAgICAgICAgICAgIG5leHQyTGFzdERpc3RhbmNlW25leHRJbmRleF0gPSBiZXN0RGlzdGFuY2U7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChiZXN0SW5kZXggPCAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChsYXN0Mk5leHRbYmVzdEluZGV4XSA9PSAtMSkgeworICAgICAgICAgICAgICAgIGxhc3QyTmV4dFtiZXN0SW5kZXhdID0gbmV4dEluZGV4OworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKERFQlVHX1BPSU5URVJTKSBMb2cudigiSW5wdXREZXZpY2UiLCAiT2xkIGluZGV4ICIgKyBiZXN0SW5kZXgKKyAgICAgICAgICAgICAgICAgICAgKyAiIGhhcyBtdWx0aXBsZSBiZXN0IG5ldyBwb2ludGVycyEiKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbGFzdDJOZXh0W2Jlc3RJbmRleF0gPSAtMjsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwcml2YXRlIGludCB1cGRhdGVQb2ludGVySWRlbnRpZmllcnMoKSB7CisgICAgICAgICAgICBmaW5hbCBpbnRbXSBsYXN0RGF0YSA9IG1MYXN0RGF0YTsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIG5leHREYXRhID0gbU5leHREYXRhOworICAgICAgICAgICAgZmluYWwgaW50IG5leHROdW1Qb2ludGVycyA9IG1OZXh0TnVtUG9pbnRlcnM7CisgICAgICAgICAgICBmaW5hbCBpbnQgbGFzdE51bVBvaW50ZXJzID0gbUxhc3ROdW1Qb2ludGVyczsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG5leHROdW1Qb2ludGVycyA9PSAxICYmIGxhc3ROdW1Qb2ludGVycyA9PSAxKSB7CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShuZXh0RGF0YSwgMCwgbGFzdERhdGEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEpOworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gQ2xlYXIgb3VyIG9sZCBzdGF0ZS4KKyAgICAgICAgICAgIGZpbmFsIGludFtdIGxhc3QyTmV4dCA9IG1MYXN0Mk5leHQ7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bGFzdE51bVBvaW50ZXJzOyBpKyspIHsKKyAgICAgICAgICAgICAgICBsYXN0Mk5leHRbaV0gPSAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKERFQlVHX1BPSU5URVJTKSBMb2cudigiSW5wdXREZXZpY2UiLAorICAgICAgICAgICAgICAgICAgICAiVXBkYXRlIHBvaW50ZXJzOiBsYXN0TnVtUG9pbnRlcnM9IiArIGxhc3ROdW1Qb2ludGVycworICAgICAgICAgICAgICAgICAgICArICIgbmV4dE51bVBvaW50ZXJzPSIgKyBuZXh0TnVtUG9pbnRlcnMpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBGaWd1cmUgb3V0IHRoZSBjbG9zZXMgbmV3IHBvaW50cyB0byB0aGUgcHJldmlvdXMgcG9pbnRzLgorICAgICAgICAgICAgZmluYWwgaW50W10gbmV4dDJMYXN0ID0gbU5leHQyTGFzdDsKKyAgICAgICAgICAgIGZpbmFsIGxvbmdbXSBuZXh0Mkxhc3REaXN0YW5jZSA9IG1OZXh0Mkxhc3REaXN0YW5jZTsKKyAgICAgICAgICAgIGJvb2xlYW4gY29uZmxpY3RzID0gZmFsc2U7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bmV4dE51bVBvaW50ZXJzOyBpKyspIHsKKyAgICAgICAgICAgICAgICBjb25mbGljdHMgfD0gYXNzaWduUG9pbnRlcihpLCB0cnVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gUmVzb2x2ZSBhbWJpZ3VpdGllcyBpbiBwb2ludGVyIG1hcHBpbmdzLCB3aGVuIHR3byBvciBtb3JlCisgICAgICAgICAgICAvLyBuZXcgcG9pbnRlciBsb2NhdGlvbnMgZmluZCB0aGVpciBiZXN0IHByZXZpb3VzIGxvY2F0aW9uIGlzCisgICAgICAgICAgICAvLyB0aGUgc2FtZS4KKyAgICAgICAgICAgIGlmIChjb25mbGljdHMpIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KCJJbnB1dERldmljZSIsICJSZXNvbHZpbmcgY29uZmxpY3RzIik7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPGxhc3ROdW1Qb2ludGVyczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsYXN0Mk5leHRbaV0gIT0gLTIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAvLyBOb3RlIHRoYXQgdGhpcyBhbGdvcml0aG0gaXMgZmFyIGZyb20gcGVyZmVjdC4gIElkZWFsbHkKKyAgICAgICAgICAgICAgICAgICAgLy8gd2Ugc2hvdWxkIGRvIHNvbWV0aGluZyBsaWtlIHRoZSBvbmUgZGVzY3JpYmVkIGF0CisgICAgICAgICAgICAgICAgICAgIC8vIGh0dHA6Ly9wb3J0YWwuYWNtLm9yZy9jaXRhdGlvbi5jZm0/aWQ9OTk3ODU2CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KCJJbnB1dERldmljZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlc29sdmluZyBsYXN0IGluZGV4ICMiICsgaSk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpbnQgbnVtRm91bmQ7CisgICAgICAgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bUZvdW5kID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgd29yc3REaXN0YW5jZSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd29yc3RKID0gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqPTA7IGo8bmV4dE51bVBvaW50ZXJzOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dDJMYXN0W2pdICE9IGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bUZvdW5kKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdvcnN0RGlzdGFuY2UgPCBuZXh0Mkxhc3REaXN0YW5jZVtqXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b3JzdERpc3RhbmNlID0gbmV4dDJMYXN0RGlzdGFuY2Vbal07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdvcnN0SiA9IGo7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAod29yc3RKID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KCJJbnB1dERldmljZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiV29yc3QgbmV3IHBvaW50ZXI6ICIgKyB3b3JzdEoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiAoZGlzdGFuY2U9IiArIHdvcnN0RGlzdGFuY2UgKyAiKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhc3NpZ25Qb2ludGVyKHdvcnN0SiwgZmFsc2UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluIHRoaXMgY2FzZSB0aGVyZSBpcyBubyBsYXN0IHBvaW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVtYWluaW5nIGZvciB0aGlzIG5ldyBvbmUhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQyTGFzdFt3b3JzdEpdID0gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChudW1Gb3VuZCA+IDIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaW50IHJldEluZGV4ID0gLTE7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChsYXN0TnVtUG9pbnRlcnMgPCBuZXh0TnVtUG9pbnRlcnMpIHsKKyAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIG9uZSBvciBtb3JlIG5ldyBwb2ludGVycyB0aGF0IGFyZSBkb3duLiAgQ3JlYXRlIGEKKyAgICAgICAgICAgICAgICAvLyBuZXcgcG9pbnRlciBpZGVudGlmaWVyIGZvciBvbmUgb2YgdGhlbS4KKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KCJJbnB1dERldmljZSIsICJBZGRpbmcgbmV3IHBvaW50ZXIiKTsKKyAgICAgICAgICAgICAgICBpbnQgbmV4dElkID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgaT0wOworICAgICAgICAgICAgICAgIHdoaWxlIChpIDwgbGFzdE51bVBvaW50ZXJzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtUG9pbnRlcklkc1tpXSA+IG5leHRJZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRm91bmQgYSBob2xlLCBpbnNlcnQgdGhlIHBvaW50ZXIgaGVyZS4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgTG9nLnYoIklucHV0RGV2aWNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkluc2VydGluZyBuZXcgcG9pbnRlciBhdCBob2xlICIgKyBpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkobVBvaW50ZXJJZHMsIGksIG1Qb2ludGVySWRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKzEsIGxhc3ROdW1Qb2ludGVycy1pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkobGFzdERhdGEsIGkqTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0RGF0YSwgKGkrMSkqTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGFzdE51bVBvaW50ZXJzLWkpKk1vdGlvbkV2ZW50Lk5VTV9TQU1QTEVfREFUQSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICAgICAgICAgIG5leHRJZCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KCJJbnB1dERldmljZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAiTmV3IHBvaW50ZXIgaWQgIiArIG5leHRJZCArICIgYXQgaW5kZXggIiArIGkpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIG1MYXN0TnVtUG9pbnRlcnMrKzsKKyAgICAgICAgICAgICAgICByZXRJbmRleCA9IGk7CisgICAgICAgICAgICAgICAgbVBvaW50ZXJJZHNbaV0gPSBuZXh0SWQ7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLy8gQW5kIGFzc2lnbiB0aGlzIGlkZW50aWZpZXIgdG8gdGhlIGZpcnN0IG5ldyBwb2ludGVyLgorICAgICAgICAgICAgICAgIGZvciAoaW50IGo9MDsgajxuZXh0TnVtUG9pbnRlcnM7IGorKykgeworICAgICAgICAgICAgICAgICAgICBpZiAobmV4dDJMYXN0W2pdIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX1BPSU5URVJTKSBMb2cudigiSW5wdXREZXZpY2UiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQXNzaWduaW5nIG5ldyBpZCB0byBuZXcgcG9pbnRlciBpbmRleCAiICsgaik7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXh0Mkxhc3Rbal0gPSBpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIFByb3BhZ2F0ZSBhbGwgb2YgdGhlIGN1cnJlbnQgZGF0YSBpbnRvIHRoZSBhcHByb3ByaWF0ZQorICAgICAgICAgICAgLy8gbG9jYXRpb24gaW4gdGhlIG9sZCBkYXRhIHRvIG1hdGNoIHRoZSBwb2ludGVyIElEIHRoYXQgd2FzCisgICAgICAgICAgICAvLyBhc3NpZ25lZCB0byBpdC4KKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxuZXh0TnVtUG9pbnRlcnM7IGkrKykgeworICAgICAgICAgICAgICAgIGludCBsYXN0SW5kZXggPSBuZXh0Mkxhc3RbaV07CisgICAgICAgICAgICAgICAgaWYgKGxhc3RJbmRleCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgTG9nLnYoIklucHV0RGV2aWNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ29weWluZyBuZXh0IHBvaW50ZXIgaW5kZXggIiArIGkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgdG8gbGFzdCBpbmRleCAiICsgbGFzdEluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShuZXh0RGF0YSwgaSpNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdERhdGEsIGxhc3RJbmRleCpNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChsYXN0TnVtUG9pbnRlcnMgPiBuZXh0TnVtUG9pbnRlcnMpIHsKKyAgICAgICAgICAgICAgICAvLyBPbmUgb3IgbW9yZSBwb2ludGVycyBoYXMgZ29uZSB1cC4gIEZpbmQgdGhlIGZpcnN0IG9uZSwKKyAgICAgICAgICAgICAgICAvLyBhbmQgYWRqdXN0IGFjY29yZGluZ2x5LgorICAgICAgICAgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgTG9nLnYoIklucHV0RGV2aWNlIiwgIlJlbW92aW5nIG9sZCBwb2ludGVyIik7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPGxhc3ROdW1Qb2ludGVyczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsYXN0Mk5leHRbaV0gPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgTG9nLnYoIklucHV0RGV2aWNlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlJlbW92aW5nIG9sZCBwb2ludGVyIGF0IGluZGV4ICIgKyBpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldEluZGV4ID0gaTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICByZXR1cm4gcmV0SW5kZXg7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHZvaWQgcmVtb3ZlT2xkUG9pbnRlcihpbnQgaW5kZXgpIHsKKyAgICAgICAgICAgIGZpbmFsIGludCBsYXN0TnVtUG9pbnRlcnMgPSBtTGFzdE51bVBvaW50ZXJzOworICAgICAgICAgICAgaWYgKGluZGV4ID49IDAgJiYgaW5kZXggPCBsYXN0TnVtUG9pbnRlcnMpIHsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1Qb2ludGVySWRzLCBpbmRleCsxLCBtUG9pbnRlcklkcywKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4LCBsYXN0TnVtUG9pbnRlcnMtaW5kZXgtMSk7CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtTGFzdERhdGEsIChpbmRleCsxKSpNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEsCisgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERhdGEsIChpbmRleCkqTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBLAorICAgICAgICAgICAgICAgICAgICAgICAgKGxhc3ROdW1Qb2ludGVycy1pbmRleC0xKSpNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEpOworICAgICAgICAgICAgICAgIG1MYXN0TnVtUG9pbnRlcnMtLTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgTW90aW9uRXZlbnQgZ2VuZXJhdGVBYnNNb3Rpb24oSW5wdXREZXZpY2UgZGV2aWNlLCBsb25nIGN1clRpbWUsCisgICAgICAgICAgICAgICAgbG9uZyBjdXJUaW1lTmFubywgRGlzcGxheSBkaXNwbGF5LCBpbnQgb3JpZW50YXRpb24sCiAgICAgICAgICAgICAgICAgaW50IG1ldGFTdGF0ZSkgewotICAgICAgICAgICAgaWYgKCFjaGFuZ2VkKSB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChtTmV4dE51bVBvaW50ZXJzIDw9IDAgJiYgbUxhc3ROdW1Qb2ludGVycyA8PSAwKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKLSAgICAgICAgICAgIGZsb2F0IHNjYWxlZFggPSB4OwotICAgICAgICAgICAgZmxvYXQgc2NhbGVkWSA9IHk7Ci0gICAgICAgICAgICBmbG9hdCB0ZW1wOwotICAgICAgICAgICAgZmxvYXQgc2NhbGVkUHJlc3N1cmUgPSAxLjBmOwotICAgICAgICAgICAgZmxvYXQgc2NhbGVkU2l6ZSA9IDA7CisgICAgICAgICAgICBmaW5hbCBpbnQgbGFzdE51bVBvaW50ZXJzID0gbUxhc3ROdW1Qb2ludGVyczsKKyAgICAgICAgICAgIGZpbmFsIGludCBuZXh0TnVtUG9pbnRlcnMgPSBtTmV4dE51bVBvaW50ZXJzOworICAgICAgICAgICAgaWYgKG1OZXh0TnVtUG9pbnRlcnMgPiBNQVhfUE9JTlRFUlMpIHsKKyAgICAgICAgICAgICAgICBMb2cudygiSW5wdXREZXZpY2UiLCAiTnVtYmVyIG9mIHBvaW50ZXJzICIgKyBtTmV4dE51bVBvaW50ZXJzCisgICAgICAgICAgICAgICAgICAgICAgICArICIgZXhjZWVkZWQgbWF4aW11bSBvZiAiICsgTUFYX1BPSU5URVJTKTsKKyAgICAgICAgICAgICAgICBtTmV4dE51bVBvaW50ZXJzID0gTUFYX1BPSU5URVJTOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpbnQgdXBPckRvd25Qb2ludGVyID0gdXBkYXRlUG9pbnRlcklkZW50aWZpZXJzKCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0W10gcmVwb3J0RGF0YSA9IG1SZXBvcnREYXRhOworICAgICAgICAgICAgZmluYWwgaW50W10gcmF3RGF0YSA9IG1MYXN0RGF0YTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgZmluYWwgaW50IG51bVBvaW50ZXJzID0gbUxhc3ROdW1Qb2ludGVyczsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKERFQlVHX1BPSU5URVJTKSBMb2cudigiSW5wdXREZXZpY2UiLCAiUHJvY2Vzc2luZyAiCisgICAgICAgICAgICAgICAgICAgICsgbnVtUG9pbnRlcnMgKyAiIHBvaW50ZXJzIChnb2luZyBmcm9tICIgKyBsYXN0TnVtUG9pbnRlcnMKKyAgICAgICAgICAgICAgICAgICAgKyAiIHRvICIgKyBuZXh0TnVtUG9pbnRlcnMgKyAiKSIpOworICAgICAgICAgICAgCisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bnVtUG9pbnRlcnM7IGkrKykgeworICAgICAgICAgICAgICAgIGZpbmFsIGludCBwb3MgPSBpICogTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBOworICAgICAgICAgICAgICAgIHJlcG9ydERhdGFbcG9zICsgTW90aW9uRXZlbnQuU0FNUExFX1hdID0gcmF3RGF0YVtwb3MgKyBNb3Rpb25FdmVudC5TQU1QTEVfWF07CisgICAgICAgICAgICAgICAgcmVwb3J0RGF0YVtwb3MgKyBNb3Rpb25FdmVudC5TQU1QTEVfWV0gPSByYXdEYXRhW3BvcyArIE1vdGlvbkV2ZW50LlNBTVBMRV9ZXTsKKyAgICAgICAgICAgICAgICByZXBvcnREYXRhW3BvcyArIE1vdGlvbkV2ZW50LlNBTVBMRV9QUkVTU1VSRV0gPSByYXdEYXRhW3BvcyArIE1vdGlvbkV2ZW50LlNBTVBMRV9QUkVTU1VSRV07CisgICAgICAgICAgICAgICAgcmVwb3J0RGF0YVtwb3MgKyBNb3Rpb25FdmVudC5TQU1QTEVfU0laRV0gPSByYXdEYXRhW3BvcyArIE1vdGlvbkV2ZW50LlNBTVBMRV9TSVpFXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgaW50IGFjdGlvbjsKICAgICAgICAgICAgIGludCBlZGdlRmxhZ3MgPSAwOwotICAgICAgICAgICAgaWYgKGlzQWJzKSB7Ci0gICAgICAgICAgICAgICAgaW50IHcgPSBkaXNwbGF5LmdldFdpZHRoKCktMTsKLSAgICAgICAgICAgICAgICBpbnQgaCA9IGRpc3BsYXkuZ2V0SGVpZ2h0KCktMTsKLSAgICAgICAgICAgICAgICBpZiAob3JpZW50YXRpb24gPT0gU3VyZmFjZS5ST1RBVElPTl85MAotICAgICAgICAgICAgICAgICAgICAgICAgfHwgb3JpZW50YXRpb24gPT0gU3VyZmFjZS5ST1RBVElPTl8yNzApIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IHRtcCA9IHc7Ci0gICAgICAgICAgICAgICAgICAgIHcgPSBoOwotICAgICAgICAgICAgICAgICAgICBoID0gdG1wOworICAgICAgICAgICAgaWYgKG5leHROdW1Qb2ludGVycyAhPSBsYXN0TnVtUG9pbnRlcnMpIHsKKyAgICAgICAgICAgICAgICBpZiAobmV4dE51bVBvaW50ZXJzID4gbGFzdE51bVBvaW50ZXJzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsYXN0TnVtUG9pbnRlcnMgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gTW90aW9uRXZlbnQuQUNUSU9OX0RPV047CisgICAgICAgICAgICAgICAgICAgICAgICBtRG93blRpbWUgPSBjdXJUaW1lOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfRE9XTgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICh1cE9yRG93blBvaW50ZXIgPDwgTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfSURfU0hJRlQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG51bVBvaW50ZXJzID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbiA9IE1vdGlvbkV2ZW50LkFDVElPTl9VUDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbiA9IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgKHVwT3JEb3duUG9pbnRlciA8PCBNb3Rpb25FdmVudC5BQ1RJT05fUE9JTlRFUl9JRF9TSElGVCk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGRldmljZS5hYnNYICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgc2NhbGVkWCA9ICgoc2NhbGVkWC1kZXZpY2UuYWJzWC5taW5WYWx1ZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyBkZXZpY2UuYWJzWC5yYW5nZSkgKiB3OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoZGV2aWNlLmFic1kgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBzY2FsZWRZID0gKChzY2FsZWRZLWRldmljZS5hYnNZLm1pblZhbHVlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIGRldmljZS5hYnNZLnJhbmdlKSAqIGg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChkZXZpY2UuYWJzUHJlc3N1cmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBzY2FsZWRQcmVzc3VyZSA9IAotICAgICAgICAgICAgICAgICAgICAgICAgKChwcmVzc3VyZS1kZXZpY2UuYWJzUHJlc3N1cmUubWluVmFsdWUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gKGZsb2F0KWRldmljZS5hYnNQcmVzc3VyZS5yYW5nZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChkZXZpY2UuYWJzU2l6ZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNjYWxlZFNpemUgPSAKLSAgICAgICAgICAgICAgICAgICAgICAgICgoc2l6ZS1kZXZpY2UuYWJzU2l6ZS5taW5WYWx1ZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAoZmxvYXQpZGV2aWNlLmFic1NpemUucmFuZ2UpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBzd2l0Y2ggKG9yaWVudGF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgU3VyZmFjZS5ST1RBVElPTl85MDoKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSBzY2FsZWRYOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWCA9IHNjYWxlZFk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRZID0gdy10ZW1wOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgU3VyZmFjZS5ST1RBVElPTl8xODA6Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRYID0gdy1zY2FsZWRYOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWSA9IGgtc2NhbGVkWTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIFN1cmZhY2UuUk9UQVRJT05fMjcwOgotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9IHNjYWxlZFg7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRYID0gaC1zY2FsZWRZOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc2NhbGVkWCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGVkZ2VGbGFncyArPSBNb3Rpb25FdmVudC5FREdFX0xFRlQ7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzY2FsZWRYID09IGRpc3BsYXkuZ2V0V2lkdGgoKSAtIDEuMGYpIHsKLSAgICAgICAgICAgICAgICAgICAgZWRnZUZsYWdzICs9IE1vdGlvbkV2ZW50LkVER0VfUklHSFQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIGlmIChzY2FsZWRZID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgZWRnZUZsYWdzICs9IE1vdGlvbkV2ZW50LkVER0VfVE9QOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NhbGVkWSA9PSBkaXNwbGF5LmdldEhlaWdodCgpIC0gMS4wZikgewotICAgICAgICAgICAgICAgICAgICBlZGdlRmxhZ3MgKz0gTW90aW9uRXZlbnQuRURHRV9CT1RUT007Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGN1cnJlbnRNb3ZlID0gbnVsbDsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc2NhbGVkWCAqPSB4TW92ZVNjYWxlOwotICAgICAgICAgICAgICAgIHNjYWxlZFkgKj0geU1vdmVTY2FsZTsKKyAgICAgICAgICAgICAgICBhY3Rpb24gPSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgZmluYWwgaW50IGRpc3BXID0gZGlzcGxheS5nZXRXaWR0aCgpLTE7CisgICAgICAgICAgICBmaW5hbCBpbnQgZGlzcEggPSBkaXNwbGF5LmdldEhlaWdodCgpLTE7CisgICAgICAgICAgICBpbnQgdyA9IGRpc3BXOworICAgICAgICAgICAgaW50IGggPSBkaXNwSDsKKyAgICAgICAgICAgIGlmIChvcmllbnRhdGlvbiA9PSBTdXJmYWNlLlJPVEFUSU9OXzkwCisgICAgICAgICAgICAgICAgICAgIHx8IG9yaWVudGF0aW9uID09IFN1cmZhY2UuUk9UQVRJT05fMjcwKSB7CisgICAgICAgICAgICAgICAgaW50IHRtcCA9IHc7CisgICAgICAgICAgICAgICAgdyA9IGg7CisgICAgICAgICAgICAgICAgaCA9IHRtcDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgZmluYWwgQWJzb2x1dGVJbmZvIGFic1ggPSBkZXZpY2UuYWJzWDsKKyAgICAgICAgICAgIGZpbmFsIEFic29sdXRlSW5mbyBhYnNZID0gZGV2aWNlLmFic1k7CisgICAgICAgICAgICBmaW5hbCBBYnNvbHV0ZUluZm8gYWJzUHJlc3N1cmUgPSBkZXZpY2UuYWJzUHJlc3N1cmU7CisgICAgICAgICAgICBmaW5hbCBBYnNvbHV0ZUluZm8gYWJzU2l6ZSA9IGRldmljZS5hYnNTaXplOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG51bVBvaW50ZXJzOyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaiA9IGkgKiBNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEE7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoYWJzWCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChyZXBvcnREYXRhW2ogKyBNb3Rpb25FdmVudC5TQU1QTEVfWF0tYWJzWC5taW5WYWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyBhYnNYLnJhbmdlKSAqIHc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChhYnNZICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1ldID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9ZXS1hYnNZLm1pblZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIGFic1kucmFuZ2UpICogaDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGFic1ByZXNzdXJlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1BSRVNTVVJFXSA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1BSRVNTVVJFXS1hYnNQcmVzc3VyZS5taW5WYWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAoZmxvYXQpYWJzUHJlc3N1cmUucmFuZ2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoYWJzU2l6ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9TSVpFXSA9IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1NJWkVdLWFic1NpemUubWluVmFsdWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gKGZsb2F0KWFic1NpemUucmFuZ2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICBzd2l0Y2ggKG9yaWVudGF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgU3VyZmFjZS5ST1RBVElPTl85MDoKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSBzY2FsZWRYOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWCA9IHNjYWxlZFk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRZID0gLXRlbXA7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU3VyZmFjZS5ST1RBVElPTl85MDogeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgdGVtcCA9IHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXSA9IHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9ZXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9ZXSA9IHctdGVtcDsKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIFN1cmZhY2UuUk9UQVRJT05fMTgwOgotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWCA9IC1zY2FsZWRYOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWSA9IC1zY2FsZWRZOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGNhc2UgU3VyZmFjZS5ST1RBVElPTl8xODA6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXSA9IHctcmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1hdOworICAgICAgICAgICAgICAgICAgICAgICAgcmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1ldID0gaC1yZXBvcnREYXRhW2ogKyBNb3Rpb25FdmVudC5TQU1QTEVfWV07CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBTdXJmYWNlLlJPVEFUSU9OXzI3MDoKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSBzY2FsZWRYOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWCA9IC1zY2FsZWRZOwotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkWSA9IHRlbXA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgY2FzZSBTdXJmYWNlLlJPVEFUSU9OXzI3MDogeworICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgdGVtcCA9IHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9ydERhdGFbaiArIE1vdGlvbkV2ZW50LlNBTVBMRV9YXSA9IGgtcmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1ldOworICAgICAgICAgICAgICAgICAgICAgICAgcmVwb3J0RGF0YVtqICsgTW90aW9uRXZlbnQuU0FNUExFX1ldID0gdGVtcDsKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgCi0gICAgICAgICAgICBjaGFuZ2VkID0gZmFsc2U7Ci0gICAgICAgICAgICBpZiAoZG93biAhPSBsYXN0RG93bikgewotICAgICAgICAgICAgICAgIGludCBhY3Rpb247Ci0gICAgICAgICAgICAgICAgbGFzdERvd24gPSBkb3duOwotICAgICAgICAgICAgICAgIGlmIChkb3duKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFjdGlvbiA9IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOwotICAgICAgICAgICAgICAgICAgICBkb3duVGltZSA9IGN1clRpbWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gTW90aW9uRXZlbnQuQUNUSU9OX1VQOworICAgICAgICAgICAgLy8gV2Ugb25seSBjb25zaWRlciB0aGUgZmlyc3QgcG9pbnRlciB3aGVuIGNvbXB1dGluZyB0aGUgZWRnZQorICAgICAgICAgICAgLy8gZmxhZ3MsIHNpbmNlIHRoZXkgYXJlIGdsb2JhbCB0byB0aGUgZXZlbnQuCisgICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOKSB7CisgICAgICAgICAgICAgICAgaWYgKHJlcG9ydERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1hdIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZWRnZUZsYWdzIHw9IE1vdGlvbkV2ZW50LkVER0VfTEVGVDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlcG9ydERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1hdID49IGRpc3BXKSB7CisgICAgICAgICAgICAgICAgICAgIGVkZ2VGbGFncyB8PSBNb3Rpb25FdmVudC5FREdFX1JJR0hUOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjdXJyZW50TW92ZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgaWYgKCFpc0FicykgewotICAgICAgICAgICAgICAgICAgICB4ID0geSA9IDA7CisgICAgICAgICAgICAgICAgaWYgKHJlcG9ydERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1ldIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZWRnZUZsYWdzIHw9IE1vdGlvbkV2ZW50LkVER0VfVE9QOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVwb3J0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWV0gPj0gZGlzcEgpIHsKKyAgICAgICAgICAgICAgICAgICAgZWRnZUZsYWdzIHw9IE1vdGlvbkV2ZW50LkVER0VfQk9UVE9NOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZXR1cm4gTW90aW9uRXZlbnQub2J0YWluKGRvd25UaW1lLCBjdXJUaW1lLCBhY3Rpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRYLCBzY2FsZWRZLCBzY2FsZWRQcmVzc3VyZSwgc2NhbGVkU2l6ZSwgbWV0YVN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgeFByZWNpc2lvbiwgeVByZWNpc2lvbiwgZGV2aWNlLmlkLCBlZGdlRmxhZ3MpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoY3VycmVudE1vdmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoZmFsc2UpIExvZy5pKCJJbnB1dERldmljZSIsICJBZGRpbmcgYmF0Y2ggeD0iICsgc2NhbGVkWAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiB5PSIgKyBzY2FsZWRZICsgIiB0byAiICsgY3VycmVudE1vdmUpOwotICAgICAgICAgICAgICAgICAgICBjdXJyZW50TW92ZS5hZGRCYXRjaChjdXJUaW1lLCBzY2FsZWRYLCBzY2FsZWRZLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZFByZXNzdXJlLCBzY2FsZWRTaXplLCBtZXRhU3RhdGUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoV2luZG93TWFuYWdlclBvbGljeS5XQVRDSF9QT0lOVEVSKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuaSgiS2V5SW5wdXRRdWV1ZSIsICJVcGRhdGluZzogIiArIGN1cnJlbnRNb3ZlKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgTW90aW9uRXZlbnQgbWUgPSBNb3Rpb25FdmVudC5vYnRhaW4oZG93blRpbWUsIGN1clRpbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSwgc2NhbGVkWCwgc2NhbGVkWSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZFByZXNzdXJlLCBzY2FsZWRTaXplLCBtZXRhU3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICB4UHJlY2lzaW9uLCB5UHJlY2lzaW9uLCBkZXZpY2UuaWQsIGVkZ2VGbGFncyk7Ci0gICAgICAgICAgICAgICAgY3VycmVudE1vdmUgPSBtZTsKLSAgICAgICAgICAgICAgICByZXR1cm4gbWU7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChjdXJyZW50TW92ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKGZhbHNlKSBMb2cuaSgiSW5wdXREZXZpY2UiLCAiQWRkaW5nIGJhdGNoIHg9IgorICAgICAgICAgICAgICAgICAgICAgICAgKyByZXBvcnREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9YXQorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHk9IiArIHJlcG9ydERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1ldCisgICAgICAgICAgICAgICAgICAgICAgICArICIgdG8gIiArIGN1cnJlbnRNb3ZlKTsKKyAgICAgICAgICAgICAgICBjdXJyZW50TW92ZS5hZGRCYXRjaChjdXJUaW1lLCByZXBvcnREYXRhLCBtZXRhU3RhdGUpOworICAgICAgICAgICAgICAgIGlmIChXaW5kb3dNYW5hZ2VyUG9saWN5LldBVENIX1BPSU5URVIpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmkoIktleUlucHV0UXVldWUiLCAiVXBkYXRpbmc6ICIgKyBjdXJyZW50TW92ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBNb3Rpb25FdmVudCBtZSA9IE1vdGlvbkV2ZW50Lm9idGFpbk5hbm8obURvd25UaW1lLCBjdXJUaW1lLAorICAgICAgICAgICAgICAgICAgICBjdXJUaW1lTmFubywgYWN0aW9uLCBudW1Qb2ludGVycywgbVBvaW50ZXJJZHMsIHJlcG9ydERhdGEsCisgICAgICAgICAgICAgICAgICAgIG1ldGFTdGF0ZSwgeFByZWNpc2lvbiwgeVByZWNpc2lvbiwgZGV2aWNlLmlkLCBlZGdlRmxhZ3MpOworICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSkgeworICAgICAgICAgICAgICAgIGN1cnJlbnRNb3ZlID0gbWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChuZXh0TnVtUG9pbnRlcnMgPCBsYXN0TnVtUG9pbnRlcnMpIHsKKyAgICAgICAgICAgICAgICByZW1vdmVPbGRQb2ludGVyKHVwT3JEb3duUG9pbnRlcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHJldHVybiBtZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgYm9vbGVhbiBoYXNNb3JlKCkgeworICAgICAgICAgICAgcmV0dXJuIG1MYXN0TnVtUG9pbnRlcnMgIT0gbU5leHROdW1Qb2ludGVyczsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdm9pZCBmaW5pc2goKSB7CisgICAgICAgICAgICBtTmV4dE51bVBvaW50ZXJzID0gbUFkZGluZ1BvaW50ZXJPZmZzZXQgPSAwOworICAgICAgICAgICAgbU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9QUkVTU1VSRV0gPSAwOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBNb3Rpb25FdmVudCBnZW5lcmF0ZVJlbE1vdGlvbihJbnB1dERldmljZSBkZXZpY2UsIGxvbmcgY3VyVGltZSwKKyAgICAgICAgICAgICAgICBsb25nIGN1clRpbWVOYW5vLCBpbnQgb3JpZW50YXRpb24sIGludCBtZXRhU3RhdGUpIHsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgZmluYWwgZmxvYXRbXSBzY2FsZWQgPSBtUmVwb3J0RGF0YTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gRm9yIG5vdyB3ZSBvbmx5IHN1cHBvcnQgMSBwb2ludGVyIHdpdGggcmVsYXRpdmUgbW90aW9ucy4KKyAgICAgICAgICAgIHNjYWxlZFtNb3Rpb25FdmVudC5TQU1QTEVfWF0gPSBtTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1hdOworICAgICAgICAgICAgc2NhbGVkW01vdGlvbkV2ZW50LlNBTVBMRV9ZXSA9IG1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWV07CisgICAgICAgICAgICBzY2FsZWRbTW90aW9uRXZlbnQuU0FNUExFX1BSRVNTVVJFXSA9IDEuMGY7CisgICAgICAgICAgICBzY2FsZWRbTW90aW9uRXZlbnQuU0FNUExFX1NJWkVdID0gMDsKKyAgICAgICAgICAgIGludCBlZGdlRmxhZ3MgPSAwOworICAgICAgICAgICAgCisgICAgICAgICAgICBpbnQgYWN0aW9uOworICAgICAgICAgICAgaWYgKG1OZXh0TnVtUG9pbnRlcnMgIT0gbUxhc3ROdW1Qb2ludGVycykgeworICAgICAgICAgICAgICAgIG1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWF0gPQorICAgICAgICAgICAgICAgICAgICAgICAgbU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9ZXSA9IDA7CisgICAgICAgICAgICAgICAgaWYgKG1OZXh0TnVtUG9pbnRlcnMgPiAwICYmIG1MYXN0TnVtUG9pbnRlcnMgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTjsKKyAgICAgICAgICAgICAgICAgICAgbURvd25UaW1lID0gY3VyVGltZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1OZXh0TnVtUG9pbnRlcnMgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSBNb3Rpb25FdmVudC5BQ1RJT05fVVA7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gTW90aW9uRXZlbnQuQUNUSU9OX01PVkU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1MYXN0TnVtUG9pbnRlcnMgPSBtTmV4dE51bVBvaW50ZXJzOworICAgICAgICAgICAgICAgIGN1cnJlbnRNb3ZlID0gbnVsbDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYWN0aW9uID0gTW90aW9uRXZlbnQuQUNUSU9OX01PVkU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjYWxlZFtNb3Rpb25FdmVudC5TQU1QTEVfWF0gKj0geE1vdmVTY2FsZTsKKyAgICAgICAgICAgIHNjYWxlZFtNb3Rpb25FdmVudC5TQU1QTEVfWV0gKj0geU1vdmVTY2FsZTsKKyAgICAgICAgICAgIHN3aXRjaCAob3JpZW50YXRpb24pIHsKKyAgICAgICAgICAgICAgICBjYXNlIFN1cmZhY2UuUk9UQVRJT05fOTA6IHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgZmxvYXQgdGVtcCA9IHNjYWxlZFtNb3Rpb25FdmVudC5TQU1QTEVfWF07CisgICAgICAgICAgICAgICAgICAgIHNjYWxlZFtNb3Rpb25FdmVudC5TQU1QTEVfWF0gPSBzY2FsZWRbTW90aW9uRXZlbnQuU0FNUExFX1ldOworICAgICAgICAgICAgICAgICAgICBzY2FsZWRbTW90aW9uRXZlbnQuU0FNUExFX1ldID0gLXRlbXA7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIFN1cmZhY2UuUk9UQVRJT05fMTgwOiB7CisgICAgICAgICAgICAgICAgICAgIHNjYWxlZFtNb3Rpb25FdmVudC5TQU1QTEVfWF0gPSAtc2NhbGVkW01vdGlvbkV2ZW50LlNBTVBMRV9YXTsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGVkW01vdGlvbkV2ZW50LlNBTVBMRV9ZXSA9IC1zY2FsZWRbTW90aW9uRXZlbnQuU0FNUExFX1ldOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBTdXJmYWNlLlJPVEFUSU9OXzI3MDogeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBmbG9hdCB0ZW1wID0gc2NhbGVkW01vdGlvbkV2ZW50LlNBTVBMRV9YXTsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGVkW01vdGlvbkV2ZW50LlNBTVBMRV9YXSA9IC1zY2FsZWRbTW90aW9uRXZlbnQuU0FNUExFX1ldOworICAgICAgICAgICAgICAgICAgICBzY2FsZWRbTW90aW9uRXZlbnQuU0FNUExFX1ldID0gdGVtcDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoY3VycmVudE1vdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgTG9nLmkoIklucHV0RGV2aWNlIiwgIkFkZGluZyBiYXRjaCB4PSIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgc2NhbGVkW01vdGlvbkV2ZW50LlNBTVBMRV9YXQorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHk9IiArIHNjYWxlZFtNb3Rpb25FdmVudC5TQU1QTEVfWV0KKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiB0byAiICsgY3VycmVudE1vdmUpOworICAgICAgICAgICAgICAgIGN1cnJlbnRNb3ZlLmFkZEJhdGNoKGN1clRpbWUsIHNjYWxlZCwgbWV0YVN0YXRlKTsKKyAgICAgICAgICAgICAgICBpZiAoV2luZG93TWFuYWdlclBvbGljeS5XQVRDSF9QT0lOVEVSKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5pKCJLZXlJbnB1dFF1ZXVlIiwgIlVwZGF0aW5nOiAiICsgY3VycmVudE1vdmUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgTW90aW9uRXZlbnQgbWUgPSBNb3Rpb25FdmVudC5vYnRhaW5OYW5vKG1Eb3duVGltZSwgY3VyVGltZSwKKyAgICAgICAgICAgICAgICAgICAgY3VyVGltZU5hbm8sIGFjdGlvbiwgMSwgbVBvaW50ZXJJZHMsIHNjYWxlZCwgbWV0YVN0YXRlLAorICAgICAgICAgICAgICAgICAgICB4UHJlY2lzaW9uLCB5UHJlY2lzaW9uLCBkZXZpY2UuaWQsIGVkZ2VGbGFncyk7CisgICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFKSB7CisgICAgICAgICAgICAgICAgY3VycmVudE1vdmUgPSBtZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBtZTsKICAgICAgICAgfQogICAgIH0KICAgICAKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL0lucHV0TWV0aG9kTWFuYWdlclNlcnZpY2UuamF2YSBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL0lucHV0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cCkgeworICAgICAgICAgICAgaWYgKCFtU3lzdGVtUmVhZHkpIHsKKyAgICAgICAgICAgICAgICBtU3lzdGVtUmVhZHkgPSB0cnVlOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHN0YXJ0SW5wdXRJbm5lckxvY2tlZCgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmV4cGVjdGVkIGV4Y2VwdGlvbiIsIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQogICAgIH0KICAgICAKICAgICBwdWJsaWMgTGlzdDxJbnB1dE1ldGhvZEluZm8+IGdldElucHV0TWV0aG9kTGlzdCgpIHsKQEAgLTcyNyw2ICs3NDMsMjAgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICAKKyAgICAgICAgcmV0dXJuIHN0YXJ0SW5wdXRJbm5lckxvY2tlZCgpOworICAgIH0KKyAgICAKKyAgICBJbnB1dEJpbmRSZXN1bHQgc3RhcnRJbnB1dElubmVyTG9ja2VkKCkgeworICAgICAgICBpZiAobUN1ck1ldGhvZElkID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBtTm9CaW5kaW5nOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoIW1TeXN0ZW1SZWFkeSkgeworICAgICAgICAgICAgLy8gSWYgdGhlIHN5c3RlbSBpcyBub3QgeWV0IHJlYWR5LCB3ZSBzaG91bGRuJ3QgYmUgcnVubmluZyB0aGlyZAorICAgICAgICAgICAgLy8gcGFydHkgY29kZS4KKyAgICAgICAgICAgIHJldHVybiBuZXcgSW5wdXRCaW5kUmVzdWx0KG51bGwsIG1DdXJNZXRob2RJZCwgbUN1clNlcSk7CisgICAgICAgIH0KKyAgICAgICAgCiAgICAgICAgIElucHV0TWV0aG9kSW5mbyBpbmZvID0gbU1ldGhvZE1hcC5nZXQobUN1ck1ldGhvZElkKTsKICAgICAgICAgaWYgKGluZm8gPT0gbnVsbCkgewogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBpZDogIiArIG1DdXJNZXRob2RJZCk7CkBAIC03MzYsNiArNzY2LDEwIEBACiAgICAgICAgIAogICAgICAgICBtQ3VySW50ZW50ID0gbmV3IEludGVudChJbnB1dE1ldGhvZC5TRVJWSUNFX0lOVEVSRkFDRSk7CiAgICAgICAgIG1DdXJJbnRlbnQuc2V0Q29tcG9uZW50KGluZm8uZ2V0Q29tcG9uZW50KCkpOworICAgICAgICBtQ3VySW50ZW50LnB1dEV4dHJhKEludGVudC5FWFRSQV9DTElFTlRfTEFCRUwsCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuaW5wdXRfbWV0aG9kX2JpbmRpbmdfbGFiZWwpOworICAgICAgICBtQ3VySW50ZW50LnB1dEV4dHJhKEludGVudC5FWFRSQV9DTElFTlRfSU5URU5ULCBQZW5kaW5nSW50ZW50LmdldEFjdGl2aXR5KAorICAgICAgICAgICAgICAgIG1Db250ZXh0LCAwLCBuZXcgSW50ZW50KFNldHRpbmdzLkFDVElPTl9JTlBVVF9NRVRIT0RfU0VUVElOR1MpLCAwKSk7CiAgICAgICAgIGlmIChtQ29udGV4dC5iaW5kU2VydmljZShtQ3VySW50ZW50LCB0aGlzLCBDb250ZXh0LkJJTkRfQVVUT19DUkVBVEUpKSB7CiAgICAgICAgICAgICBtTGFzdEJpbmRUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CiAgICAgICAgICAgICBtSGF2ZUNvbm5lY3Rpb24gPSB0cnVlOwpAQCAtNzc3LDE3ICs4MTEsMjAgQEAKICAgICAgICAgc3luY2hyb25pemVkIChtTWV0aG9kTWFwKSB7CiAgICAgICAgICAgICBpZiAobUN1ckludGVudCAhPSBudWxsICYmIG5hbWUuZXF1YWxzKG1DdXJJbnRlbnQuZ2V0Q29tcG9uZW50KCkpKSB7CiAgICAgICAgICAgICAgICAgbUN1ck1ldGhvZCA9IElJbnB1dE1ldGhvZC5TdHViLmFzSW50ZXJmYWNlKHNlcnZpY2UpOworICAgICAgICAgICAgICAgIGlmIChtQ3VyVG9rZW4gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJTZXJ2aWNlIGNvbm5lY3RlZCB3aXRob3V0IGEgdG9rZW4hIik7CisgICAgICAgICAgICAgICAgICAgIHVuYmluZEN1cnJlbnRNZXRob2RMb2NrZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiSW5pdGlhdGluZyBhdHRhY2ggd2l0aCB0b2tlbjogIiArIG1DdXJUb2tlbik7CisgICAgICAgICAgICAgICAgZXhlY3V0ZU9yU2VuZE1lc3NhZ2UobUN1ck1ldGhvZCwgbUNhbGxlci5vYnRhaW5NZXNzYWdlT08oCisgICAgICAgICAgICAgICAgICAgICAgICBNU0dfQVRUQUNIX1RPS0VOLCBtQ3VyTWV0aG9kLCBtQ3VyVG9rZW4pKTsKICAgICAgICAgICAgICAgICBpZiAobUN1ckNsaWVudCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiSW5pdGlhdGluZyBhdHRhY2ggd2l0aCB0b2tlbjogIiArIG1DdXJUb2tlbik7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiQ3JlYXRpbmcgZmlyc3Qgc2Vzc2lvbiB3aGlsZSB3aXRoIGNsaWVudCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtQ3VyQ2xpZW50KTsKICAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZU9yU2VuZE1lc3NhZ2UobUN1ck1ldGhvZCwgbUNhbGxlci5vYnRhaW5NZXNzYWdlT08oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVNHX0FUVEFDSF9UT0tFTiwgbUN1ck1ldGhvZCwgbUN1clRva2VuKSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtQ3VyQ2xpZW50ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiQ3JlYXRpbmcgZmlyc3Qgc2Vzc2lvbiB3aGlsZSB3aXRoIGNsaWVudCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUN1ckNsaWVudCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlT3JTZW5kTWVzc2FnZShtQ3VyTWV0aG9kLCBtQ2FsbGVyLm9idGFpbk1lc3NhZ2VPTygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVNHX0NSRUFURV9TRVNTSU9OLCBtQ3VyTWV0aG9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgTWV0aG9kQ2FsbGJhY2sobUN1ck1ldGhvZCkpKTsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1TR19DUkVBVEVfU0VTU0lPTiwgbUN1ck1ldGhvZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgTWV0aG9kQ2FsbGJhY2sobUN1ck1ldGhvZCkpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTk3Nyw2ICsxMDE0LDExIEBACiAgICAgICAgICAgICBtU2hvd0V4cGxpY2l0bHlSZXF1ZXN0ZWQgPSB0cnVlOwogICAgICAgICAgICAgbVNob3dGb3JjZWQgPSB0cnVlOwogICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoIW1TeXN0ZW1S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RseSBkZWxldGUuCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1SZWFsLmNyZWF0ZU5ld0ZpbGUoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBJZ25vcmUKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChtVGVtcC5leGlzdHMoKSkgeworICAgICAgICAgICAgbVRlbXAuZGVsZXRlKCk7CisgICAgICAgIH0KKyAgICAgICAgbVdyaXRpbmcgPSB0cnVlOworICAgICAgICByZXR1cm4gbVRlbXA7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29tbWl0IGNoYW5nZXMuCisgICAgICovCisgICAgcHVibGljIHZvaWQgY29tbWl0KCkgeworICAgICAgICBpZiAoIW1Xcml0aW5nKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJubyBmaWxlIHRvIGNvbW1pdCIpOworICAgICAgICB9CisgICAgICAgIG1Xcml0aW5nID0gZmFsc2U7CisgICAgICAgIG1UZW1wLnJlbmFtZVRvKG1SZWFsKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSb2xsIGJhY2sgY2hhbmdlcy4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCByb2xsYmFjaygpIHsKKyAgICAgICAgaWYgKCFtV3JpdGluZykgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigibm8gZmlsZSB0byByb2xsIGJhY2siKTsKKyAgICAgICAgfQorICAgICAgICBtV3JpdGluZyA9IGZhbHNlOworICAgICAgICBtVGVtcC5kZWxldGUoKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9LZXlJbnB1dFF1ZXVlLmphdmEgYi9zZXJ2aWNlcy9qYXZhL2Nv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bHRlckV2ZW50KFF1ZXVlZEV2ZW50IGV2KTsKICAgICB9CiAgICAgCisgICAgcHVibGljIGludGVyZmFjZSBIYXB0aWNGZWVkYmFja0NhbGxiYWNrIHsKKyAgICAgICAgdm9pZCB2aXJ0dWFsS2V5RmVlZGJhY2soS2V5RXZlbnQgZXZlbnQpOworICAgIH0KKyAgICAKICAgICBzdGF0aWMgY2xhc3MgUXVldWVkRXZlbnQgewogICAgICAgICBJbnB1dERldmljZSBpbnB1dERldmljZTsKLSAgICAgICAgbG9uZyB3aGVuOworICAgICAgICBsb25nIHdoZW5OYW5vOwogICAgICAgICBpbnQgZmxhZ3M7IC8vIEZyb20gdGhlIHJhdyBldmVudAogICAgICAgICBpbnQgY2xhc3NUeXBlOyAvLyBPbmUgb2YgdGhlIGNsYXNzIGNvbnN0YW50cyBpbiBJbnB1dEV2ZW50CiAgICAgICAgIE9iamVjdCBldmVudDsKQEAgLTg4LDcgKzEyMyw3IEBACiAKICAgICAgICAgdm9pZCBjb3B5RnJvbShRdWV1ZWRFdmVudCB0aGF0KSB7CiAgICAgICAgICAgICB0aGlzLmlucHV0RGV2aWNlID0gdGhhdC5pbnB1dERldmljZTsKLSAgICAgICAgICAgIHRoaXMud2hlbiA9IHRoYXQud2hlbjsKKyAgICAgICAgICAgIHRoaXMud2hlbk5hbm8gPSB0aGF0LndoZW5OYW5vOwogICAgICAgICAgICAgdGhpcy5mbGFncyA9IHRoYXQuZmxhZ3M7CiAgICAgICAgICAgICB0aGlzLmNsYXNzVHlwZSA9IHRoYXQuY2xhc3NUeXBlOwogICAgICAgICAgICAgdGhpcy5ldmVudCA9IHRoYXQuZXZlbnQ7CkBAIC0xMDYsNyArMTQxLDE0NCBAQAogICAgICAgICBRdWV1ZWRFdmVudCBuZXh0OwogICAgIH0KIAotICAgIEtleUlucHV0UXVldWUoQ29udGV4dCBjb250ZXh0KSB7CisgICAgLyoqCisgICAgICogQSBrZXkgdGhhdCBleGlzdHMgYXMgYSBwYXJ0IG9mIHRoZSB0b3VjaC1zY3JlZW4sIG91dHNpZGUgb2YgdGhlIG5vcm1hbAorICAgICAqIGRpc3BsYXkgYXJlYSBvZiB0aGUgc2NyZWVuLgorICAgICAqLworICAgIHN0YXRpYyBjbGFzcyBWaXJ0dWFsS2V5IHsKKyAgICAgICAgaW50IHNjYW5jb2RlOworICAgICAgICBpbnQgY2VudGVyeDsKKyAgICAgICAgaW50IGNlbnRlcnk7CisgICAgICAgIGludCB3aWR0aDsKKyAgICAgICAgaW50IGhlaWdodDsKKyAgICAgICAgCisgICAgICAgIGludCBoaXRMZWZ0OworICAgICAgICBpbnQgaGl0VG9wOworICAgICAgICBpbnQgaGl0UmlnaHQ7CisgICAgICAgIGludCBoaXRCb3R0b207CisgICAgICAgIAorICAgICAgICBJbnB1dERldmljZSBsYXN0RGV2aWNlOworICAgICAgICBpbnQgbGFzdEtleWNvZGU7CisgICAgICAgIAorICAgICAgICBib29sZWFuIGNoZWNrSGl0KGludCB4LCBpbnQgeSkgeworICAgICAgICAgICAgcmV0dXJuICh4ID49IGhpdExlZnQgJiYgeCA8PSBoaXRSaWdodAorICAgICAgICAgICAgICAgICAgICAmJiB5ID49IGhpdFRvcCAmJiB5IDw9IGhpdEJvdHRvbSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHZvaWQgY29tcHV0ZUhpdFJlY3QoSW5wdXREZXZpY2UgZGV2LCBpbnQgZHcsIGludCBkaCkgeworICAgICAgICAgICAgaWYgKGRldiA9PSBsYXN0RGV2aWNlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoREVCVUdfVklSVFVBTF9LRVlTKSBMb2cudihUQUcsICJjb21wdXRlSGl0UmVjdCBmb3IgIiArIHNjYW5jb2RlCisgICAgICAgICAgICAgICAgICAgICsgIjogZGV2PSIgKyBkZXYgKyAiIGFic1g9IiArIGRldi5hYnNYICsgIiBhYnNZPSIgKyBkZXYuYWJzWSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGxhc3REZXZpY2UgPSBkZXY7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGludCBtaW54ID0gZGV2LmFic1gubWluVmFsdWU7CisgICAgICAgICAgICBpbnQgbWF4eCA9IGRldi5hYnNYLm1heFZhbHVlOworICAgICAgICAgICAgCisgICAgICAgICAgICBpbnQgaGFsZncgPSB3aWR0aC8yOworICAgICAgICAgICAgaW50IGxlZnQgPSBjZW50ZXJ4IC0gaGFsZnc7CisgICAgICAgICAgICBpbnQgcmlnaHQgPSBjZW50ZXJ4ICsgaGFsZnc7CisgICAgICAgICAgICBoaXRMZWZ0ID0gbWlueCArICgobGVmdCptYXh4LW1pbngpL2R3KTsKKyAgICAgICAgICAgIGhpdFJpZ2h0ID0gbWlueCArICgocmlnaHQqbWF4eC1taW54KS9kdyk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGludCBtaW55ID0gZGV2LmFic1kubWluVmFsdWU7CisgICAgICAgICAgICBpbnQgbWF4eSA9IGRldi5hYnNZLm1heFZhbHVlOworICAgICAgICAgICAgCisgICAgICAgICAgICBpbnQgaGFsZmggPSBoZWlnaHQvMjsKKyAgICAgICAgICAgIGludCB0b3AgPSBjZW50ZXJ5IC0gaGFsZmg7CisgICAgICAgICAgICBpbnQgYm90dG9tID0gY2VudGVyeSArIGhhbGZoOworICAgICAgICAgICAgaGl0VG9wID0gbWlueSArICgodG9wKm1heHktbWlueSkvZGgpOworICAgICAgICAgICAgaGl0Qm90dG9tID0gbWlueSArICgoYm90dG9tKm1heHktbWlueSkvZGgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlYWRWaXJ0dWFsS2V5cyhTdHJpbmcgZGV2aWNlTmFtZSkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgRmlsZUlucHV0U3RyZWFtIGZpcyA9IG5ldyBGaWxlSW5wdXRTdHJlYW0oCisgICAgICAgICAgICAgICAgICAgICIvc3lzL2JvYXJkX3Byb3BlcnRpZXMvdmlydHVhbGtleXMuIiArIGRldmljZU5hbWUpOworICAgICAgICAgICAgSW5wdXRTdHJlYW1SZWFkZXIgaXNyID0gbmV3IElucHV0U3RyZWFtUmVhZGVyKGZpcyk7CisgICAgICAgICAgICBCdWZmZXJlZFJlYWRlciBiciA9IG5ldyBCdWZmZXJlZFJlYWRlcihpc3IpOworICAgICAgICAgICAgU3RyaW5nIHN0ciA9IGJyLnJlYWRMaW5lKCk7CisgICAgICAgICAgICBpZiAoc3RyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmdbXSBpdCA9IHN0ci5zcGxpdCgiOiIpOworICAgICAgICAgICAgICAgIGlmIChERUJVR19WSVJUVUFMX0tFWVMpIExvZy52KFRBRywgIioqKioqIFZJUlRVQUwgS0VZUzogIiArIGl0KTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IGl0Lmxlbmd0aC02OworICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTw9TjsgaSs9NikgeworICAgICAgICAgICAgICAgICAgICBpZiAoISIweDAxIi5lcXVhbHMoaXRbaV0pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmtub3duIHZpcnR1YWwga2V5IHR5cGUgYXQgZWxlbSAjIiArIGkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiAiICsgaXRbaV0pOworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFZpcnR1YWxLZXkgc2IgPSBuZXcgVmlydHVhbEtleSgpOworICAgICAgICAgICAgICAgICAgICAgICAgc2Iuc2NhbmNvZGUgPSBJbnRlZ2VyLnBhcnNlSW50KGl0W2krMV0pOworICAgICAgICAgICAgICAgICAgICAgICAgc2IuY2VudGVyeCA9IEludGVnZXIucGFyc2VJbnQoaXRbaSsyXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzYi5jZW50ZXJ5ID0gSW50ZWdlci5wYXJzZUludChpdFtpKzNdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNiLndpZHRoID0gSW50ZWdlci5wYXJzZUludChpdFtpKzRdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNiLmhlaWdodCA9IEludGVnZXIucGFyc2VJbnQoaXRbaSs1XSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfVklSVFVBTF9LRVlTKSBMb2cudihUQUcsICJWaXJ0dWFsIGtleSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2Iuc2NhbmNvZGUgKyAiOiBjZW50ZXI9IiArIHNiLmNlbnRlcnggKyAiLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzYi5jZW50ZXJ5ICsgIiBzaXplPSIgKyBzYi53aWR0aCArICJ4IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNiLmhlaWdodCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVmlydHVhbEtleXMuYWRkKHNiKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkJhZCBudW1iZXIgYXQgcmVnaW9uICIgKyBpICsgIiBpbjogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHN0ciwgZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBici5jbG9zZSgpOworICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmkoVEFHLCAiTm8gdmlydHVhbCBrZXlzIGZvdW5kIik7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy53KFRBRywgIkVycm9yIHJlYWRpbmcgdmlydHVhbCBrZXlzIiwgZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVhZEV4Y2x1ZGVkRGV2aWNlcygpIHsKKyAgICAgICAgLy8gUmVhZCBwYXJ0bmVyLXByb3ZpZGVkIGxpc3Qgb2YgZXhjbHVkZWQgaW5wdXQgZGV2aWNlcworICAgICAgICBYbWxQdWxsUGFyc2VyIHBhcnNlciA9IG51bGw7CisgICAgICAgIC8vIEVudmlyb25tZW50LmdldFJvb3REaXJlY3RvcnkoKSBpcyBhIGZhbmN5IHdheSBvZiBzYXlpbmcgQU5EUk9JRF9ST09UIG9yICIvc3lzdGVtIi4KKyAgICAgICAgRmlsZSBjb25mRmlsZSA9IG5ldyBGaWxlKEVudmlyb25tZW50LmdldFJvb3REaXJlY3RvcnkoKSwgRVhDTFVERURfREVWSUNFU19QQVRIKTsKKyAgICAgICAgRmlsZVJlYWRlciBjb25mcmVhZGVyID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGNvbmZyZWFkZXIgPSBuZXcgRmlsZVJlYWRlcihjb25mRmlsZSk7CisgICAgICAgICAgICBwYXJzZXIgPSBYbWwubmV3UHVsbFBhcnNlcigpOworICAgICAgICAgICAgcGFyc2VyLnNldElucHV0KGNvbmZyZWFkZXIpOworICAgICAgICAgICAgWG1sVXRpbHMuYmVnaW5Eb2N1bWVudChwYXJzZXIsICJkZXZpY2VzIik7CisKKyAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgICAgICAgWG1sVXRpbHMubmV4dEVsZW1lbnQocGFyc2VyKTsKKyAgICAgICAgICAgICAgICBpZiAoISJkZXZpY2UiLmVxdWFscyhwYXJzZXIuZ2V0TmFtZSgpKSkgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgIm5hbWUiKTsKKyAgICAgICAgICAgICAgICBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImFkZEV4Y2x1ZGVkRGV2aWNlICIgKyBuYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgYWRkRXhjbHVkZWREZXZpY2UobmFtZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gSXQncyBvayBpZiB0aGUgZmlsZSBkb2VzIG5vdCBleGlzdC4KKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIkV4Y2VwdGlvbiB3aGlsZSBwYXJzaW5nICciICsgY29uZkZpbGUuZ2V0QWJzb2x1dGVQYXRoKCkgKyAiJyIsIGUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgdHJ5IHsgaWYgKGNvbmZyZWFkZXIgIT0gbnVsbCkgY29uZnJlYWRlci5jbG9zZSgpOyB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7IH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEtleUlucHV0UXVldWUoQ29udGV4dCBjb250ZXh0LCBIYXB0aWNGZWVkYmFja0NhbGxiYWNrICBoYXB0aWNGZWVkYmFja0NhbGxiYWNrKSB7CisgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kpIHsKKyAgICAgICAgICAgIGx0ID0gbmV3IExhdGVuY3lUaW1lcigxMDAsIDEwMDApOworICAgICAgICB9CisKKyAgICAgICAgbUhhcHRpY0ZlZWRiYWNrQ2FsbGJhY2sgPSBoYXB0aWNGZWVkYmFja0NhbGxiYWNrOworICAgICAgICAKKyAgICAgICAgcmVhZEV4Y2x1ZGVkRGV2aWNlcygpOworICAgICAgICAKICAgICAgICAgUG93ZXJNYW5hZ2VyIHBtID0gKFBvd2VyTWFuYWdlciljb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbnRleHQuUE9XRVJfU0VSVklDRSk7CiAgICAgICAgIG1XYWtlTG9jayA9IHBtLm5ld1dha2VMb2NrKFBvd2VyTWFuYWdlci5QQVJUSUFMX1dBS0VfTE9DSywKQEAgLTEyMyw2ICsyOTUsMTIgQEAKIAogICAgIHB1YmxpYyB2b2lkIHNldERpc3BsYXkoRGlzcGxheSBkaXNwbGF5KSB7CiAgICAgICAgIG1EaXNwbGF5ID0gZGlzcGxheTsKKyAgICAgICAgCisgICAgICAgIC8vIFdlIGFzc3VtZSBhdCB0aGlzIHBvaW50IHRoYXQgdGhlIGRpc3BsYXkgZGltZW5zaW9ucyByZWZsZWN0IHRoZQorICAgICAgICAvLyBuYXR1cmFsLCB1bnJvdGF0ZWQgZGlzcGxheS4gIFdlIHdpbGwgcGVyZm9ybSBoaXQgdGVzdHMgZm9yIHNvZnQKKyAgICAgICAgLy8gYnV0dG9ucyBiYXNlZCBvbiB0aGF0IGRpc3BsYXkuCisgICAgICAgIG1EaXNwbGF5V2lkdGggPSBkaXNwbGF5LmdldFdpZHRoKCk7CisgICAgICAgIG1EaXNwbGF5SGVpZ2h0ID0gZGlzcGxheS5nZXRIZWlnaHQoKTsKICAgICB9CiAgICAgCiAgICAgcHVibGljIHZvaWQgZ2V0SW5wdXRDb25maWd1cmF0aW9uKENvbmZpZ3VyYXRpb24gY29uZmlnKSB7CkBAIC0xNDksNiArMzI3LDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcubmF2aWdhdGlvbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IENvbmZpZ3VyYXRpb24uTkFWSUdBVElPTl9UUkFDS0JBTEw7CiAgICAgICAgICAgICAgICAgICAgICAgICAvL0xvZy5pKCJmb28iLCAiKioqKiogSEFWRSBUUkFDS0JBTEwhIik7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGQuY2xhc3NlcyZSYXdJbnB1dEV2ZW50LkNMQVNTX0RQQUQpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5uYXZpZ2F0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gQ29uZmlndXJhdGlvbi5OQVZJR0FUSU9OX0RQQUQ7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0xvZy5pKCJmb28iLCAiKioqKiogSEFWRSBEUEFEISIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQpAQCAtMTU3LDYgKzMzOSw3IEBACiAgICAgCiAgICAgcHVibGljIHN0YXRpYyBuYXRpdmUgU3RyaW5nIGdldERldmljZU5hbWUoaW50IGRldmljZUlkKTsKICAgICBwdWJsaWMgc3RhdGljIG5hdGl2ZSBpbnQgZ2V0RGV2aWNlQ2xhc3NlcyhpbnQgZGV2aWNlSWQpOworICAgIHB1YmxpYyBzdGF0aWMgbmF0aXZlIHZvaWQgYWRkRXhjbHVkZWREZXZpY2UoU3RyaW5nIGRldmljZU5hbWUpOwogICAgIHB1YmxpYyBzdGF0aWMgbmF0aXZlIGJvb2xlYW4gZ2V0QWJzb2x1dGVJbmZvKGludCBkZXZpY2VJZCwgaW50IGF4aXMsCiAgICAgICAgICAgICBJbnB1dERldmljZS5BYnNvbHV0ZUluZm8gb3V0SW5mbyk7CiAgICAgcHVibGljIHN0YXRpYyBuYXRpdmUgaW50IGdldFN3aXRjaFN0YXRlKGludCBzdyk7CkBAIC0xNjUsNiArMzQ4LDcgQEAKICAgICBwdWJsaWMgc3RhdGljIG5hdGl2ZSBpbnQgZ2V0U2NhbmNvZGVTdGF0ZShpbnQgZGV2aWNlSWQsIGludCBzdyk7CiAgICAgcHVibGljIHN0YXRpYyBuYXRpdmUgaW50IGdldEtleWNvZGVTdGF0ZShpbnQgc3cpOwogICAgIHB1YmxpYyBzdGF0aWMgbmF0aXZlIGludCBnZXRLZXljb2RlU3RhdGUoaW50IGRldmljZUlkLCBpbnQgc3cpOworICAgIHB1YmxpYyBzdGF0aWMgbmF0aXZlIGludCBzY2FuY29kZVRvS2V5Y29kZShpbnQgZGV2aWNlSWQsIGludCBzY2FuY29kZSk7CiAgICAgcHVibGljIHN0YXRpYyBuYXRpdmUgYm9vbGVhbiBoYXNLZXlzKGludFtdIGtleWNvZGVzLCBib29sZWFuW10ga2V5RXhpc3RzKTsKICAgICAKICAgICBwdWJsaWMgc3RhdGljIEtleUV2ZW50IG5ld0tleUV2ZW50KElucHV0RGV2aWNlIGRldmljZSwgbG9uZyBkb3duVGltZSwKQEAgLTE4MSwxMiArMzY1LDEzIEBACiAgICAgCiAgICAgVGhyZWFkIG1UaHJlYWQgPSBuZXcgVGhyZWFkKCJJbnB1dERldmljZVJlYWRlciIpIHsKICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAiSW5wdXREZXZpY2VSZWFkZXIucnVuKCkiKTsKICAgICAgICAgICAgIGFuZHJvaWQub3MuUHJvY2Vzcy5zZXRUaHJlYWRQcmlvcml0eSgKICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5vcy5Qcm9jZXNzLlRIUkVBRF9QUklPUklUWV9VUkdFTlRfRElTUExBWSk7CiAgICAgICAgICAgICAKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgUmF3SW5wdXRFdmVudCBldiA9IG5ldyBSYXdJbnB1dEV2ZW50KCk7Ci0gICAgICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgIFJhd0lucHV0RXZlbnQgZXYgPSBuZXcgUmF3SW5wdXRFdmVudCgpOworICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICBJbnB1dERldmljZSBkaTsKIAogICAgICAgICAgICAgICAgICAgICAvLyBibG9jaywgZG9lc24ndCByZWxlYXNlIHRoZSBtb25pdG9yCkBAIC0yMDcsMjMgKzM5Miw1MCBAQAogICAgICAgICAgICAgICAgICAgICBpZiAoZXYudHlwZSA9PSBSYXdJbnB1dEV2ZW50LkVWX0RFVklDRV9BRERFRCkgewogICAgICAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtRmlyc3QpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaSA9IG5ld0lucHV0RGV2aWNlKGV2LmRldmljZUlkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGV2aWNlcy5wdXQoZXYuZGV2aWNlSWQsIGRpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdDaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGkuY2xhc3NlcyAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoaXMgZGV2aWNlIGlzIHNvbWUga2luZCBvZiBpbnB1dCBjbGFzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgY2FyZSBhYm91dCBpdC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURldmljZXMucHV0KGV2LmRldmljZUlkLCBkaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZGkuY2xhc3NlcyAmIFJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4pICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRWaXJ0dWFsS2V5cyhkaS5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgY29uZmlndXJhdGlvbiBtYXkgaGF2ZSBjaGFuZ2VkIGJlY2F1c2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb2YgdGhpcyBkZXZpY2UuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ0NoYW5nZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIHdvbid0IGRvIGFueXRoaW5nIHdpdGggdGhpcyBkZXZpY2UuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JZ25vcmVkRGV2aWNlcy5wdXQoZXYuZGV2aWNlSWQsIGRpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiSWdub3Jpbmcgbm9uLWlucHV0IGRldmljZTogaWQ9MHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGRpLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgbmFtZT0iICsgZGkubmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2LnR5cGUgPT0gUmF3SW5wdXRFdmVudC5FVl9ERVZJQ0VfUkVNT1ZFRCkgewogICAgICAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtRmlyc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJEZXZpY2UgcmVtb3ZlZDogaWQ9MHgiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIEludGVnZXIudG9IZXhTdHJpbmcoZXYuZGV2aWNlSWQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiRGV2aWNlIHJlbW92ZWQ6IGlkPTB4IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyhldi5kZXZpY2VJZCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaSA9IG1EZXZpY2VzLmdldChldi5kZXZpY2VJZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURldmljZXMuZGVsZXRlKGV2LmRldmljZUlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGNvbmZpZ3VyYXRpb24gbWF5IGhhdmUgY2hhbmdlZCBiZWNhdXNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9mIHRoaXMgZGV2aWNlLgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdDaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChkaT1tSWdub3JlZERldmljZXMuZ2V0KGV2LmRldmljZUlkKSkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSWdub3JlZERldmljZXMucmVtb3ZlKGV2LmRldmljZUlkKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJCYWQgZGV2aWNlIGlkOiAiICsgZXYuZGV2aWNlSWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJSZW1vdmluZyBiYWQgZGV2aWNlIGlkOiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGV2LmRldmljZUlkKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGRpID0gZ2V0SW5wdXREZXZpY2UoZXYuZGV2aWNlSWQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIG1heSBiZSBzb21lIGp1bmsgZnJvbSBhbiBpZ25vcmVkIGRldmljZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmlyc3QgY3JhY2sgYXQgaXQKICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmQgPSBwcmVwcm9jZXNzRXZlbnQoZGksIGV2KTsKQEAgLTIzNSwxMyArNDQ3LDkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgIGlmIChkaSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZ0NoYW5nZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUZpcnN0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTG9ja2VkKGRpLCBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRMb2NrZWQoZGksIFN5c3RlbS5uYW5vVGltZSgpLCAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmF3SW5wdXRFdmVudC5DTEFTU19DT05GSUdVUkFUSU9OX0NIQU5HRUQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTI1Niw2ICs0NjQsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGltZWJhc2UgYXMgU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkuCiAgICAgICAgICAgICAgICAgICAgICAgICAvL2N1clRpbWUgPSBnb3RPbmUgPyBldi53aGVuIDogU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGN1clRpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgY3VyVGltZU5hbm8gPSBTeXN0ZW0ubmFub1RpbWUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vTG9nLmkoVEFHLCAiY3VyVGltZT0iICsgY3VyVGltZSArICIsIHN5c3RlbUNsb2NrPSIgKyBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBjbGFzc2VzID0gZGkuY2xhc3NlczsKQEAgLTI3MSw0NCArNDgwLDkyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBkb3duOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldi52YWx1ZSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd24gPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tRG93blRpbWUgPSBjdXJUaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tS2V5RG93blRpbWUgPSBjdXJUaW1lOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd24gPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGtleWNvZGUgPSByb3RhdGVLZXlDb2RlTG9ja2VkKGV2LmtleWNvZGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZExvY2tlZChkaSwgY3VyVGltZSwgZXYuZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTG9ja2VkKGRpLCBjdXJUaW1lTmFubywgZXYuZmxhZ3MsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSYXdJbnB1dEV2ZW50LkNMQVNTX0tFWUJPQVJELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3S2V5RXZlbnQoZGksIGRpLm1Eb3duVGltZSwgY3VyVGltZSwgZG93biwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0tleUV2ZW50KGRpLCBkaS5tS2V5RG93blRpbWUsIGN1clRpbWUsIGRvd24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleWNvZGUsIDAsIHNjYW5jb2RlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGV2LmZsYWdzICYgV2luZG93TWFuYWdlclBvbGljeS5GTEFHX1dPS0VfSEVSRSkgIT0gMCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gS2V5RXZlbnQuRkxBR19XT0tFX0hFUkUgOiAwKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2LnR5cGUgPT0gUmF3SW5wdXRFdmVudC5FVl9LRVkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXYuc2NhbmNvZGUgPT0gUmF3SW5wdXRFdmVudC5CVE5fVE9VQ0ggJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbGFzc2VzJlJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4pICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbGFzc2VzJihSYXdJbnB1dEV2ZW50LkNMQVNTX1RPVUNIU0NSRUVOCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxSYXdJbnB1dEV2ZW50LkNMQVNTX1RPVUNIU0NSRUVOX01UKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gUmF3SW5wdXRFdmVudC5DTEFTU19UT1VDSFNDUkVFTikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLmNoYW5nZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLmRvd24gPSBldi52YWx1ZSAhPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXYuc2NhbmNvZGUgPT0gUmF3SW5wdXRFdmVudC5CVE5fTU9VU0UgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubUFicy5tRG93blswXSA9IGV2LnZhbHVlICE9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LkJUTl8yICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2xhc3NlcyYoUmF3SW5wdXRFdmVudC5DTEFTU19UT1VDSFNDUkVFTgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8UmF3SW5wdXRFdmVudC5DTEFTU19UT1VDSFNDUkVFTl9NVCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubUFicy5jaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubUFicy5tRG93blsxXSA9IGV2LnZhbHVlICE9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LkJUTl9NT1VTRSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNsYXNzZXMmUmF3SW5wdXRFdmVudC5DTEFTU19UUkFDS0JBTEwpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubVJlbC5jaGFuZ2VkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubVJlbC5kb3duID0gZXYudmFsdWUgIT0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubVJlbC5tTmV4dE51bVBvaW50ZXJzID0gZXYudmFsdWUgIT0gMCA/IDEgOiAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2LnR5cGUgPT0gUmF3SW5wdXRFdmVudC5FVl9BQlMgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNsYXNzZXMmUmF3SW5wdXRFdmVudC5DTEFTU19UT1VDSFNDUkVFTl9NVCkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LkFCU19NVF9UT1VDSF9NQUpPUikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLmNoYW5nZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLm1OZXh0RGF0YVtkaS5tQWJzLm1BZGRpbmdQb2ludGVyT2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBNb3Rpb25FdmVudC5TQU1QTEVfUFJFU1NVUkVdID0gZXYudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LkFCU19NVF9QT1NJVElPTl9YKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMuY2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMubU5leHREYXRhW2RpLm1BYnMubUFkZGluZ1BvaW50ZXJPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTW90aW9uRXZlbnQuU0FNUExFX1hdID0gZXYudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19QT0lOVEVSUykgTG9nLnYoVEFHLCAiTVQgQCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGRpLm1BYnMubUFkZGluZ1BvaW50ZXJPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgWDoiICsgZXYudmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXYuc2NhbmNvZGUgPT0gUmF3SW5wdXRFdmVudC5BQlNfTVRfUE9TSVRJT05fWSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLmNoYW5nZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLm1OZXh0RGF0YVtkaS5tQWJzLm1BZGRpbmdQb2ludGVyT2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIE1vdGlvbkV2ZW50LlNBTVBMRV9ZXSA9IGV2LnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KFRBRywgIk1UIEAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBkaS5tQWJzLm1BZGRpbmdQb2ludGVyT2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIFk6IiArIGV2LnZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2LnNjYW5jb2RlID09IFJhd0lucHV0RXZlbnQuQUJTX01UX1dJRFRIX01BSk9SKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMuY2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMubU5leHREYXRhW2RpLm1BYnMubUFkZGluZ1BvaW50ZXJPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTW90aW9uRXZlbnQuU0FNUExFX1NJWkVdID0gZXYudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldi50eXBlID09IFJhd0lucHV0RXZlbnQuRVZfQUJTICYmCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbGFzc2VzJlJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4pICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaW5nZXIgMQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LkFCU19YKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMuY2hhbmdlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMueCA9IGV2LnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5jdXJUb3VjaFZhbHNbTW90aW9uRXZlbnQuU0FNUExFX1hdID0gZXYudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LkFCU19ZKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMuY2hhbmdlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMueSA9IGV2LnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5jdXJUb3VjaFZhbHNbTW90aW9uRXZlbnQuU0FNUExFX1ldID0gZXYudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LkFCU19QUkVTU1VSRSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLmNoYW5nZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLnByZXNzdXJlID0gZXYudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLmN1clRvdWNoVmFsc1tNb3Rpb25FdmVudC5TQU1QTEVfUFJFU1NVUkVdID0gZXYudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLmN1clRvdWNoVmFsc1tNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIE1vdGlvbkV2ZW50LlNBTVBMRV9QUkVTU1VSRV0gPSBldi52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2LnNjYW5jb2RlID09IFJhd0lucHV0RXZlbnQuQUJTX1RPT0xfV0lEVEgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubUFicy5jaGFuZ2VkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubUFicy5zaXplID0gZXYudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLmN1clRvdWNoVmFsc1tNb3Rpb25FdmVudC5TQU1QTEVfU0laRV0gPSBldi52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkuY3VyVG91Y2hWYWxzW01vdGlvbkV2ZW50Lk5VTV9TQU1QTEVfREFUQQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTW90aW9uRXZlbnQuU0FNUExFX1NJWkVdID0gZXYudmFsdWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaW5nZXIgMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXYuc2NhbmNvZGUgPT0gUmF3SW5wdXRFdmVudC5BQlNfSEFUMFgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubUFicy5jaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkuY3VyVG91Y2hWYWxzW01vdGlvbkV2ZW50Lk5VTV9TQU1QTEVfREFUQSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBNb3Rpb25FdmVudC5TQU1QTEVfWF0gPSBldi52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2LnNjYW5jb2RlID09IFJhd0lucHV0RXZlbnQuQUJTX0hBVDBZKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1BYnMuY2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLmN1clRvdWNoVmFsc1tNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIE1vdGlvbkV2ZW50LlNBTVBMRV9ZXSA9IGV2LnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXYudHlwZSA9PSBSYXdJbnB1dEV2ZW50LkVWX1JFTCAmJgpAQCAtMzE2LDUwICs1NzMsMjc3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRkIHRoaXMgcmVsYXRpdmUgbW92ZW1lbnQgaW50byBvdXIgdG90YWxzLgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldi5zY2FuY29kZSA9PSBSYXdJbnB1dEV2ZW50LlJFTF9YKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1SZWwuY2hhbmdlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1SZWwueCArPSBldi52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubVJlbC5tTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1hdICs9IGV2LnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXYuc2NhbmNvZGUgPT0gUmF3SW5wdXRFdmVudC5SRUxfWSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tUmVsLmNoYW5nZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tUmVsLnkgKz0gZXYudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpLm1SZWwubU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9ZXSArPSBldi52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZW5kIHx8IGV2LnR5cGUgPT0gUmF3SW5wdXRFdmVudC5FVl9TWU4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldi50eXBlID09IFJhd0lucHV0RXZlbnQuRVZfU1lOCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGV2LnNjYW5jb2RlID09IFJhd0lucHV0RXZlbnQuU1lOX01UX1JFUE9SVAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBkaS5tQWJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLmNoYW5nZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaS5tQWJzLm1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfUFJFU1NVUkVdID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgdmFsdWUgaXMgPD0gMCwgdGhlIHBvaW50ZXIgaXMgbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvd24sIHNvIGtlZXAgaXQgaW4gdGhlIGNvdW50LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpLm1BYnMubU5leHREYXRhW2RpLm1BYnMubUFkZGluZ1BvaW50ZXJPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTW90aW9uRXZlbnQuU0FNUExFX1BSRVNTVVJFXSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbnVtID0gZGkubUFicy5tTmV4dE51bVBvaW50ZXJzKzE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLm1OZXh0TnVtUG9pbnRlcnMgPSBudW07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk1UX1JFUE9SVDogbm93IGhhdmUgIiArIG51bSArICIgcG9pbnRlcnMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBuZXdPZmZzZXQgPSAobnVtIDw9IElucHV0RGV2aWNlLk1BWF9QT0lOVEVSUykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAobnVtICogTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChJbnB1dERldmljZS5NQVhfUE9JTlRFUlMgKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vdGlvbkV2ZW50Lk5VTV9TQU1QTEVfREFUQSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaS5tQWJzLm1BZGRpbmdQb2ludGVyT2Zmc2V0ID0gbmV3T2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGkubUFicy5tTmV4dERhdGFbbmV3T2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgTW90aW9uRXZlbnQuU0FNUExFX1BSRVNTVVJFXSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfUE9JTlRFUlMpIExvZy52KFRBRywgIk1UX1JFUE9SVDogbm8gcG9pbnRlciIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZW5kIHx8IChldi50eXBlID09IFJhd0lucHV0RXZlbnQuRVZfU1lOCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGV2LnNjYW5jb2RlID09IFJhd0lucHV0RXZlbnQuU1lOX1JFUE9SVCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobURpc3BsYXkgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1IYXZlR2xvYmFsTWV0YVN0YXRlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlR2xvYmFsTWV0YVN0YXRlTG9ja2VkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vdGlvbkV2ZW50IG1lOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZSA9IGRpLm1BYnMuZ2VuZXJhdGVNb3Rpb24oZGksIGN1clRpbWUsIHRydWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURpc3BsYXksIG1PcmllbnRhdGlvbiwgbUdsb2JhbE1ldGFTdGF0ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgTG9nLnYoVEFHLCAiQWJzb2x1dGU6IHg9IiArIGRpLm1BYnMueAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiB5PSIgKyBkaS5tQWJzLnkgKyAiIGV2PSIgKyBtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoV2luZG93TWFuYWdlclBvbGljeS5XQVRDSF9QT0lOVEVSKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiRW5xdWV1ZWluZzogIiArIG1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElucHV0RGV2aWNlLk1vdGlvblN0YXRlIG1zID0gZGkubUFiczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1zLmNoYW5nZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zLmNoYW5nZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjbGFzc2VzJihSYXdJbnB1dEV2ZW50LkNMQVNTX1RPVUNIU0NSRUVOCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxSYXdJbnB1dEV2ZW50LkNMQVNTX1RPVUNIU0NSRUVOX01UKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gUmF3SW5wdXRFdmVudC5DTEFTU19UT1VDSFNDUkVFTikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zLm1OZXh0TnVtUG9pbnRlcnMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtcy5tRG93blswXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGRpLmN1clRvdWNoVmFscywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcy5tTmV4dERhdGEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXMubU5leHROdW1Qb2ludGVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobXMubURvd25bMV0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShkaS5jdXJUb3VjaFZhbHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zLm1OZXh0RGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcy5tTmV4dE51bVBvaW50ZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBNb3Rpb25FdmVudC5OVU1fU0FNUExFX0RBVEEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQuTlVNX1NBTVBMRV9EQVRBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXMubU5leHROdW1Qb2ludGVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZExvY2tlZChkaSwgY3VyVGltZSwgZXYuZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4sIG1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBkb01vdGlvbiA9ICFtb25pdG9yVmlydHVhbEtleShkaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXYsIGN1clRpbWUsIGN1clRpbWVOYW5vKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRvTW90aW9uICYmIG1zLm1OZXh0TnVtUG9pbnRlcnMgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG1zLm1MYXN0TnVtUG9pbnRlcnMgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvTW90aW9uID0gIWdlbmVyYXRlVmlydHVhbEtleURvd24oZGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldiwgY3VyVGltZSwgY3VyVGltZU5hbm8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG9Nb3Rpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBYWFggTmVlZCB0byBiZSBhYmxlIHRvIGdlbmVyYXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbXVsdGlwbGUgZXZlbnRzIGhlcmUsIGZvciBleGFtcGxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdHdvIGZpbmdlcnMgY2hhbmdlIHVwL2Rvd24gc3RhdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhdCB0aGUgc2FtZSB0aW1lLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWUgPSBtcy5nZW5lcmF0ZUFic01vdGlvbihkaSwgY3VyVGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJUaW1lTmFubywgbURpc3BsYXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU9yaWVudGF0aW9uLCBtR2xvYmFsTWV0YVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZhbHNlKSBMb2cudihUQUcsICJBYnNvbHV0ZTogeD0iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBkaS5tQWJzLm1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWF0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgeT0iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBkaS5tQWJzLm1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZXY9IiArIG1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChXaW5kb3dNYW5hZ2VyUG9saWN5LldBVENIX1BPSU5URVIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJFbnF1ZXVlaW5nOiAiICsgbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTG9ja2VkKGRpLCBjdXJUaW1lTmFubywgZXYuZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4sIG1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKG1zLmhhc01vcmUoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zLmZpbmlzaCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lID0gZGkubVJlbC5nZW5lcmF0ZU1vdGlvbihkaSwgY3VyVGltZSwgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURpc3BsYXksIG1PcmllbnRhdGlvbiwgbUdsb2JhbE1ldGFTdGF0ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgTG9nLnYoVEFHLCAiUmVsYXRpdmU6IHg9IiArIGRpLm1SZWwueAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiB5PSIgKyBkaS5tUmVsLnkgKyAiIGV2PSIgKyBtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRMb2NrZWQoZGksIGN1clRpbWUsIGV2LmZsYWdzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSYXdJbnB1dEV2ZW50LkNMQVNTX1RSQUNLQkFMTCwgbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXMgPSBkaS5tUmVsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobXMuY2hhbmdlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXMuY2hhbmdlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZSA9IG1zLmdlbmVyYXRlUmVsTW90aW9uKGRpLCBjdXJUaW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJUaW1lTmFubywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU9yaWVudGF0aW9uLCBtR2xvYmFsTWV0YVN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgTG9nLnYoVEFHLCAiUmVsYXRpdmU6IHg9IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGRpLm1SZWwubU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9YXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgeT0iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgZGkubVJlbC5tTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1ldCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBldj0iICsgbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRMb2NrZWQoZGksIGN1clRpbWVOYW5vLCBldi5mbGFncywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJhd0lucHV0RXZlbnQuQ0xBU1NfVFJBQ0tCQUxMLCBtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zLmZpbmlzaCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBleGMpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSW5wdXRSZWFkZXJUaHJlYWQgdW5jYXVnaHQgZXhjZXB0aW9uIiwgZXhjKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBleGMpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJbnB1dFJlYWRlclRocmVhZCB1bmNhdWdodCBleGNlcHRpb24iLCBleGMpOwotICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfTsKIAorICAgIHByaXZhdGUgYm9vbGVhbiBpc0luc2lkZURpc3BsYXkoSW5wdXREZXZpY2UgZGV2KSB7CisgICAgICAgIGZpbmFsIElucHV0RGV2aWNlLkFic29sdXRlSW5mbyBhYnN4ID0gZGV2LmFic1g7CisgICAgICAgIGZpbmFsIElucHV0RGV2aWNlLkFic29sdXRlSW5mbyBhYnN5ID0gZGV2LmFic1k7CisgICAgICAgIGZpbmFsIElucHV0RGV2aWNlLk1vdGlvblN0YXRlIGFic20gPSBkZXYubUFiczsKKyAgICAgICAgaWYgKGFic3ggPT0gbnVsbCB8fCBhYnN5ID09IG51bGwgfHwgYWJzbSA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKGFic20ubU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9YXSA+PSBhYnN4Lm1pblZhbHVlCisgICAgICAgICAgICAgICAgJiYgYWJzbS5tTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1hdIDw9IGFic3gubWF4VmFsdWUKKyAgICAgICAgICAgICAgICAmJiBhYnNtLm1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWV0gPj0gYWJzeS5taW5WYWx1ZQorICAgICAgICAgICAgICAgICYmIGFic20ubU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9ZXSA8PSBhYnN5Lm1heFZhbHVlKSB7CisgICAgICAgICAgICBpZiAoREVCVUdfVklSVFVBTF9LRVlTKSBMb2cudihUQUcsICJJbnB1dCAoIgorICAgICAgICAgICAgICAgICAgICArIGFic20ubU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9YXQorICAgICAgICAgICAgICAgICAgICArICIsIiArIGFic20ubU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9ZXQorICAgICAgICAgICAgICAgICAgICArICIpIGluc2lkZSBvZiBkaXNwbGF5Iik7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIFZpcnR1YWxLZXkgZmluZFZpcnR1YWxLZXkoSW5wdXREZXZpY2UgZGV2KSB7CisgICAgICAgIGZpbmFsIGludCBOID0gbVZpcnR1YWxLZXlzLnNpemUoKTsKKyAgICAgICAgaWYgKE4gPD0gMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGZpbmFsIElucHV0RGV2aWNlLk1vdGlvblN0YXRlIGFic20gPSBkZXYubUFiczsKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgVmlydHVhbEtleSBzYiA9IG1WaXJ0dWFsS2V5cy5nZXQoaSk7CisgICAgICAgICAgICBzYi5jb21wdXRlSGl0UmVjdChkZXYsIG1EaXNwbGF5V2lkdGgsIG1EaXNwbGF5SGVpZ2h0KTsKKyAgICAgICAgICAgIGlmIChERUJVR19WSVJUVUFMX0tFWVMpIExvZy52KFRBRywgIkhpdCB0ZXN0ICgiCisgICAgICAgICAgICAgICAgICAgICsgYWJzbS5tTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1hdICsgIiwiCisgICAgICAgICAgICAgICAgICAgICsgYWJzbS5tTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1ldICsgIikgaW4gY29kZSAiCisgICAgICAgICAgICAgICAgICAgICsgc2Iuc2NhbmNvZGUgKyAiIC0gKCIgKyBzYi5oaXRMZWZ0CisgICAgICAgICAgICAgICAgICAgICsgIiwiICsgc2IuaGl0VG9wICsgIiktKCIgKyBzYi5oaXRSaWdodCArICIsIgorICAgICAgICAgICAgICAgICAgICArIHNiLmhpdEJvdHRvbSArICIpIik7CisgICAgICAgICAgICBpZiAoc2IuY2hlY2tIaXQoYWJzbS5tTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1hdLAorICAgICAgICAgICAgICAgICAgICBhYnNtLm1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWV0pKSB7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1ZJUlRVQUxfS0VZUykgTG9nLnYoVEFHLCAiSGl0ISIpOworICAgICAgICAgICAgICAgIHJldHVybiBzYjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgYm9vbGVhbiBnZW5lcmF0ZVZpcnR1YWxLZXlEb3duKElucHV0RGV2aWNlIGRpLCBSYXdJbnB1dEV2ZW50IGV2LAorICAgICAgICAgICAgbG9uZyBjdXJUaW1lLCBsb25nIGN1clRpbWVOYW5vKSB7CisgICAgICAgIGlmIChpc0luc2lkZURpc3BsYXkoZGkpKSB7CisgICAgICAgICAgICAvLyBEaWRuJ3QgY29uc3VtZSBldmVudC4KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgCisgICAgICAgIFZpcnR1YWxLZXkgdmsgPSBmaW5kVmlydHVhbEtleShkaSk7CisgICAgICAgIGlmICh2ayAhPSBudWxsKSB7CisgICAgICAgICAgICBmaW5hbCBJbnB1dERldmljZS5Nb3Rpb25TdGF0ZSBtcyA9IGRpLm1BYnM7CisgICAgICAgICAgICBtUHJlc3NlZFZpcnR1YWxLZXkgPSB2azsKKyAgICAgICAgICAgIHZrLmxhc3RLZXljb2RlID0gc2NhbmNvZGVUb0tleWNvZGUoZGkuaWQsIHZrLnNjYW5jb2RlKTsKKyAgICAgICAgICAgIG1zLm1MYXN0TnVtUG9pbnRlcnMgPSBtcy5tTmV4dE51bVBvaW50ZXJzOworICAgICAgICAgICAgZGkubUtleURvd25UaW1lID0gY3VyVGltZTsKKyAgICAgICAgICAgIGlmIChERUJVR19WSVJUVUFMX0tFWVMpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgIkdlbmVyYXRlIGtleSBkb3duIGZvcjogIiArIHZrLnNjYW5jb2RlCisgICAgICAgICAgICAgICAgICAgICsgIiAoa2V5Y29kZT0iICsgdmsubGFzdEtleWNvZGUgKyAiKSIpOworICAgICAgICAgICAgS2V5RXZlbnQgZXZlbnQgPSBuZXdLZXlFdmVudChkaSwgZGkubUtleURvd25UaW1lLCBjdXJUaW1lLCB0cnVlLAorICAgICAgICAgICAgICAgICAgICB2ay5sYXN0S2V5Y29kZSwgMCwgdmsuc2NhbmNvZGUsCisgICAgICAgICAgICAgICAgICAgIEtleUV2ZW50LkZMQUdfVklSVFVBTF9IQVJEX0tFWSk7CisgICAgICAgICAgICBtSGFwdGljRmVlZGJhY2tDYWxsYmFjay52aXJ0dWFsS2V5RmVlZGJhY2soZXZlbnQpOworICAgICAgICAgICAgYWRkTG9ja2VkKGRpLCBjdXJUaW1lTmFubywgZXYuZmxhZ3MsIFJhd0lucHV0RXZlbnQuQ0xBU1NfS0VZQk9BUkQsCisgICAgICAgICAgICAgICAgICAgIGV2ZW50KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gV2UgYWx3YXlzIGNvbnN1bWUgdGhlIGV2ZW50LCBldmVuIGlmIHdlIGRpZG4ndA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90aW9uRXZlbnQuU0FNUExFX1hdICsgIiwiCisgICAgICAgICAgICAgICAgKyBhYnNtLm1OZXh0RGF0YVtNb3Rpb25FdmVudC5TQU1QTEVfWV0gKyAiKTogb3V0c2lkZSBvZiAoIgorICAgICAgICAgICAgICAgICsgYWJzeC5taW5WYWx1ZSArICIsIiArIGFic3kubWluVmFsdWUKKyAgICAgICAgICAgICAgICArICIpLSgiICsgYWJzeC5tYXhWYWx1ZSArICIsIgorICAgICAgICAgICAgICAgICsgYWJzeC5tYXhWYWx1ZSArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgYm9vbGVhbiBtb25pdG9yVmlydHVhbEtleShJbnB1dERldmljZSBkaSwgUmF3SW5wdXRFdmVudCBldiwKKyAgICAgICAgICAgIGxvbmcgY3VyVGltZSwgbG9uZyBjdXJUaW1lTmFubykgeworICAgICAgICBWaXJ0dWFsS2V5IHZrID0gbVByZXNzZWRWaXJ0dWFsS2V5OworICAgICAgICBpZiAodmsgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBmaW5hbCBJbnB1dERldmljZS5Nb3Rpb25TdGF0ZSBtcyA9IGRpLm1BYnM7CisgICAgICAgIGlmIChtcy5tTmV4dE51bVBvaW50ZXJzIDw9IDApIHsKKyAgICAgICAgICAgIG1QcmVzc2VkVmlydHVhbEtleSA9IG51bGw7CisgICAgICAgICAgICBtcy5tTGFzdE51bVBvaW50ZXJzID0gMDsKKyAgICAgICAgICAgIGlmIChERUJVR19WSVJUVUFMX0tFWVMpIExvZy52KFRBRywgIkdlbmVyYXRlIGtleSB1cCBmb3I6ICIgKyB2ay5zY2FuY29kZSk7CisgICAgICAgICAgICBLZXlFdmVudCBldmVudCA9IG5ld0tleUV2ZW50KGRpLCBkaS5tS2V5RG93blRpbWUsIGN1clRpbWUsIGZhbHNlLAorICAgICAgICAgICAgICAgICAgICB2ay5sYXN0S2V5Y29kZSwgMCwgdmsuc2NhbmNvZGUsCisgICAgICAgICAgICAgICAgICAgIEtleUV2ZW50LkZMQUdfVklSVFVBTF9IQVJEX0tFWSk7CisgICAgICAgICAgICBtSGFwdGljRmVlZGJhY2tDYWxsYmFjay52aXJ0dWFsS2V5RmVlZGJhY2soZXZlbnQpOworICAgICAgICAgICAgYWRkTG9ja2VkKGRpLCBjdXJUaW1lTmFubywgZXYuZmxhZ3MsIFJhd0lucHV0RXZlbnQuQ0xBU1NfS0VZQk9BUkQsCisgICAgICAgICAgICAgICAgICAgIGV2ZW50KTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgCisgICAgICAgIH0gZWxzZSBpZiAoaXNJbnNpZGVEaXNwbGF5KGRpKSkgeworICAgICAgICAgICAgLy8gV2hvb3BzIHRoZSBwb2ludGVyIGhhcyBtb3ZlZCBpbnRvCisgICAgICAgICAgICAvLyB0aGUgZGlzcGxheSBhcmVhISAgQ2FuY2VsIHRoZQorICAgICAgICAgICAgLy8gdmlydHVhbCBrZXkgYW5kIHN0YXJ0IGEgcG9pbnRlcgorICAgICAgICAgICAgLy8gbW90aW9uLgorICAgICAgICAgICAgbVByZXNzZWRWaXJ0dWFsS2V5ID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChERUJVR19WSVJUVUFMX0tFWVMpIExvZy52KFRBRywgIkNhbmNlbCBrZXkgdXAgZm9yOiAiICsgdmsuc2NhbmNvZGUpOworICAgICAgICAgICAgS2V5RXZlbnQgZXZlbnQgPSBuZXdLZXlFdmVudChkaSwgZGkubUtleURvd25UaW1lLCBjdXJUaW1lLCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgdmsubGFzdEtleWNvZGUsIDAsIHZrLnNjYW5jb2RlLAorICAgICAgICAgICAgICAgICAgICBLZXlFdmVudC5GTEFHX0NBTkNFTEVEIHwgS2V5RXZlbnQuRkxBR19WSVJUVUFMX0hBUkRfS0VZKTsKKyAgICAgICAgICAgIG1IYXB0aWNGZWVkYmFja0NhbGxiYWNrLnZpcnR1YWxLZXlGZWVkYmFjayhldmVudCk7CisgICAgICAgICAgICBhZGRMb2NrZWQoZGksIGN1clRpbWVOYW5vLCBldi5mbGFncywgUmF3SW5wdXRFdmVudC5DTEFTU19LRVlCT0FSRCwKKyAgICAgICAgICAgICAgICAgICAgZXZlbnQpOworICAgICAgICAgICAgbXMubUxhc3ROdW1Qb2ludGVycyA9IDA7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICAKICAgICAvKioKICAgICAgKiBSZXR1cm5zIGEgbmV3IG1ldGEgc3RhdGUgZm9yIHRoZSBnaXZlbiBrZXlzIGFuZCBvbGQgc3RhdGUuCiAgICAgICovCkBAIC01MDYsOCArOTkwLDggQEAKICAgICAgICAgICAgIGlmIChldi5ldmVudCA9PSBldi5pbnB1dERldmljZS5tUmVsLmN1cnJlbnRNb3ZlKSB7CiAgICAgICAgICAgICAgICAgaWYgKGZhbHNlKSBMb2cuaShUQUcsICJEZXRhY2ggcmVsICIgKyBldi5ldmVudCk7CiAgICAgICAgICAgICAgICAgZXYuaW5wdXREZXZpY2UubVJlbC5jdXJyZW50TW92ZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgZXYuaW5wdXREZXZpY2UubVJlbC54ID0gMDsKLSAgICAgICAgICAgICAgICBldi5pbnB1dERldmljZS5tUmVsLnkgPSAwOworICAgICAgICAgICAgICAgIGV2LmlucHV0RGV2aWNlLm1SZWwubU5leHREYXRhW01vdGlvbkV2ZW50LlNBTVBMRV9YXSA9IDA7CisgICAgICAgICAgICAgICAgZXYuaW5wdXREZXZpY2UubVJlbC5tTmV4dERhdGFbTW90aW9uRXZlbnQuU0FNUExFX1ldID0gMDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJlY3ljbGVMb2NrZWQoZXYpOwogICAgICAgICB9CkBAIC01MzAsNyArMTAxNCw3IEBACiAgICAgICAgIH0KICAgICB9CiAgICAgCi0gICAgcHJpdmF0ZSBRdWV1ZWRFdmVudCBvYnRhaW5Mb2NrZWQoSW5wdXREZXZpY2UgZGV2aWNlLCBsb25nIHdoZW4sCisgICAgcHJpdmF0ZSBRdWV1ZWRFdmVudCBvYnRhaW5Mb2NrZWQoSW5wdXREZXZpY2UgZGV2aWNlLCBsb25nIHdoZW5OYW5vLAogICAgICAgICAgICAgaW50IGZsYWdzLCBpbnQgY2xhc3NUeXBlLCBPYmplY3QgZXZlbnQpIHsKICAgICAgICAgUXVldWVkRXZlbnQgZXY7CiAgICAgICAgIGlmIChtQ2FjaGVDb3VudCA9PSAwKSB7CkBAIC01NDIsNyArMTAyNiw3IEBACiAgICAgICAgICAgICBtQ2FjaGVDb3VudC0tOwogICAgICAgICB9CiAgICAgICAgIGV2LmlucHV0RGV2aWNlID0gZGV2aWNlOwotICAgICAgICBldi53aGVuID0gd2hlbjsKKyAgICAgICAgZXYud2hlbk5hbm8gPSB3aGVuTmFubzsKICAgICAgICAgZXYuZmxhZ3MgPSBmbGFnczsKICAgICAgICAgZXYuY2xhc3NUeXBlID0gY2xhc3NUeXBlOwogICAgICAgICBldi5ldmVudCA9IGV2ZW50OwpAQCAtNTYxLDEzICsxMDQ1LDEzIEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgYWRkTG9ja2VkKElucHV0RGV2aWNlIGRldmljZSwgbG9uZyB3aGVuLCBpbnQgZmxhZ3MsCisgICAgcHJpdmF0ZSB2b2lkIGFkZExvY2tlZChJbnB1dERldmljZSBkZXZpY2UsIGxvbmcgd2hlbk5hbm8sIGludCBmbGFncywKICAgICAgICAgICAgIGludCBjbGFzc1R5cGUsIE9iamVjdCBldmVudCkgewogICAgICAgICBib29sZWFuIHBva2UgPSBtRmlyc3QubmV4dCA9PSBtTGFzdDsKIAotICAgICAgICBRdWV1ZWRFdmVudCBldiA9IG9idGFpbkxvY2tlZChkZXZpY2UsIHdoZW4sIGZsYWdzLCBjbGFzc1R5cGUsIGV2ZW50KTsKKyAgICAgICAgUXVldWVkRXZlbnQgZXYgPSBvYnRhaW5Mb2NrZWQoZGV2aWNlLCB3aGVuTmFubywgZmxhZ3MsIGNsYXNzVHlwZSwgZXZlbnQpOwogICAgICAgICBRdWV1ZWRFdmVudCBwID0gbUxhc3QucHJldjsKLSAgICAgICAgd2hpbGUgKHAgIT0gbUZpcnN0ICYmIGV2LndoZW4gPCBwLndoZW4pIHsKKyAgICAgICAgd2hpbGUgKHAgIT0gbUZpcnN0ICYmIGV2LndoZW5OYW5vIDwgcC53aGVuTmFubykgewogICAgICAgICAgICAgcCA9IHAucHJldjsKICAgICAgICAgfQogCkBAIC01NzgsMzEgKzEwNjIsNDggQEAKICAgICAgICAgZXYuaW5RdWV1ZSA9IHRydWU7CiAKICAgICAgICAgaWYgKHBva2UpIHsKKyAgICAgICAgICAgIGxvbmcgdGltZTsKKyAgICAgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kpIHsKKyAgICAgICAgICAgICAgICB0aW1lID0gU3lzdGVtLm5hbm9UaW1lKCk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBtRmlyc3Qubm90aWZ5KCk7CiAgICAgICAgICAgICBtV2FrZUxvY2suYWNxdWlyZSgpOworICAgICAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSkgeworICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiMSBhZGRMb2NrZWQtcXVldWVkIGV2ZW50ICIsIFN5c3RlbS5uYW5vVGltZSgpIC0gdGltZSk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKICAgICBwcml2YXRlIElucHV0RGV2aWNlIG5ld0lucHV0RGV2aWNlKGludCBkZXZpY2VJZCkgewogICAgICAgICBpbnQgY2xhc3NlcyA9IGdldERldmljZUNsYXNzZXMoZGV2aWNlSWQpOwogICAgICAgICBTdH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gPSBudWxsOwotICAgICAgICAgICAgYWJzUHJlc3N1cmUgPSBudWxsOwotICAgICAgICAgICAgYWJzU2l6ZSA9IG51bGw7CisgICAgICAgIElucHV0RGV2aWNlLkFic29sdXRlSW5mbyBhYnNYID0gbnVsbDsKKyAgICAgICAgSW5wdXREZXZpY2UuQWJzb2x1dGVJbmZvIGFic1kgPSBudWxsOworICAgICAgICBJbnB1dERldmljZS5BYnNvbHV0ZUluZm8gYWJzUHJlc3N1cmUgPSBudWxsOworICAgICAgICBJbnB1dERldmljZS5BYnNvbHV0ZUluZm8gYWJzU2l6ZSA9IG51bGw7CisgICAgICAgIGlmIChjbGFzc2VzICE9IDApIHsKKyAgICAgICAgICAgIExvZy5pKFRBRywgIkRldmljZSBhZGRlZDogaWQ9MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhkZXZpY2VJZCkKKyAgICAgICAgICAgICAgICAgICAgKyAiLCBuYW1lPSIgKyBuYW1lCisgICAgICAgICAgICAgICAgICAgICsgIiwgY2xhc3Nlcz0iICsgSW50ZWdlci50b0hleFN0cmluZyhjbGFzc2VzKSk7CisgICAgICAgICAgICBpZiAoKGNsYXNzZXMmUmF3SW5wdXRFdmVudC5DTEFTU19UT1VDSFNDUkVFTl9NVCkgIT0gMCkgeworICAgICAgICAgICAgICAgIGFic1ggPSBsb2FkQWJzb2x1dGVJbmZvKGRldmljZUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgUmF3SW5wdXRFdmVudC5BQlNfTVRfUE9TSVRJT05fWCwgIlgiKTsKKyAgICAgICAgICAgICAgICBhYnNZID0gbG9hZEFic29sdXRlSW5mbyhkZXZpY2VJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFJhd0lucHV0RXZlbnQuQUJTX01UX1BPU0lUSU9OX1ksICJZIik7CisgICAgICAgICAgICAgICAgYWJzUHJlc3N1cmUgPSBsb2FkQWJzb2x1dGVJbmZvKGRldmljZUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgUmF3SW5wdXRFdmVudC5BQlNfTVRfVE9VQ0hfTUFKT1IsICJQcmVzc3VyZSIpOworICAgICAgICAgICAgICAgIGFic1NpemUgPSBsb2FkQWJzb2x1dGVJbmZvKGRldmljZUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgUmF3SW5wdXRFdmVudC5BQlNfTVRfV0lEVEhfTUFKT1IsICJTaXplIik7CisgICAgICAgICAgICB9IGVsc2UgaWYgKChjbGFzc2VzJlJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4pICE9IDApIHsKKyAgICAgICAgICAgICAgICBhYnNYID0gbG9hZEFic29sdXRlSW5mbyhkZXZpY2VJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFJhd0lucHV0RXZlbnQuQUJTX1gsICJYIik7CisgICAgICAgICAgICAgICAgYWJzWSA9IGxvYWRBYnNvbHV0ZUluZm8oZGV2aWNlSWQsCisgICAgICAgICAgICAgICAgICAgICAgICBSYXdJbnB1dEV2ZW50LkFCU19ZLCAiWSIpOworICAgICAgICAgICAgICAgIGFic1ByZXNzdXJlID0gbG9hZEFic29sdXRlSW5mbyhkZXZpY2VJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFJhd0lucHV0RXZlbnQuQUJTX1BSRVNTVVJFLCAiUHJlc3N1cmUiKTsKKyAgICAgICAgICAgICAgICBhYnNTaXplID0gbG9hZEFic29sdXRlSW5mbyhkZXZpY2VJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIFJhd0lucHV0RXZlbnQuQUJTX1RPT0xfV0lEVEgsICJTaXplIik7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgCiAgICAgICAgIHJldHVybiBuZXcgSW5wdXREZXZpY2UoZGV2aWNlSWQsIGNsYXNzZXMsIG5hbWUsIGFic1gsIGFic1ksIGFic1ByZXNzdXJlLCBhYnNTaXplKTsKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL0xvY2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FJlYWRlciByZWFkZXIgPSBuZXcgQnVmZmVyZWRSZWFkZXIobmV3IEZpbGVSZWFkZXIoZiksIDI1Nik7Ci0gICAgICAgICAgICBzID0gcmVhZGVyLnJlYWRMaW5lKCk7Ci0gICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy53KFRBRywgIlVuYWJsZSB0byByZWFkIGxhc3Qga25vd24gbG9jYXRpb24iLCBlKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChzID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBTdHJpbmdbXSB0b2tlbnMgPSBQQVRURVJOX0NPTU1BLnNwbGl0KHMpOwotICAgICAgICAgICAgaW50IGlkeCA9IDA7Ci0gICAgICAgICAgICBsb25nIHRpbWUgPSBMb25nLnBhcnNlTG9uZyh0b2tlbnNbaWR4KytdKTsKLSAgICAgICAgICAgIGRvdWJsZSBsYXRpdHVkZSA9IERvdWJsZS5wYXJzZURvdWJsZSh0b2tlbnNbaWR4KytdKTsKLSAgICAgICAgICAgIGRvdWJsZSBsb25naXR1ZGUgPSBEb3VibGUucGFyc2VEb3VibGUodG9rZW5zW2lkeCsrXSk7Ci0gICAgICAgICAgICBkb3VibGUgYWx0aXR1ZGUgPSBEb3VibGUucGFyc2VEb3VibGUodG9rZW5zW2lkeCsrXSk7Ci0gICAgICAgICAgICBmbG9hdCBiZWFyaW5nID0gRmxvYXQucGFyc2VGbG9hdCh0b2tlbnNbaWR4KytdKTsKLSAgICAgICAgICAgIGZsb2F0IHNwZWVkID0gRmxvYXQucGFyc2VGbG9hdCh0b2tlbnNbaWR4KytdKTsKLQotICAgICAgICAgICAgbG9jYXRpb24gPSBuZXcgTG9jYXRpb24ocHJvdmlkZXIpOwotICAgICAgICAgICAgbG9jYXRpb24uc2V0VGltZSh0aW1lKTsKLSAgICAgICAgICAgIGx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gICAgd3JpdGVyLndyaXRlKHNiLnRvU3RyaW5nKCkpOwotICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cudyhUQUcsICJVbmFibGUgdG8gd3JpdGUgbG9jYXRpb24iLCBlKTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGlmICh3cml0ZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgd3JpdGVyLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJFeGNlcHRpb24gY2xvc2luZyBmaWxlIiwgZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCiAgICAgcHJpdmF0ZSB2b2lkIGFkZFByb3ZpZGVyKExvY2F0aW9uUHJvdmlkZXJQcm94eSBwcm92aWRlcikgewogICAgICAgICBtUHJvdmlkZXJzLmFkZChwcm92aWRlcik7CiAgICAgICAgIG1Qcm92aWRlcnNCeU5hbWUucHV0KHByb3ZpZGVyLmdldE5hbWUoKSwgcHJvdmlkZXIpOwpAQCAtNTQxLDYgKzQzOCw3IEBACiAgICAgICAgICAgICAvLyBDcmVhdGUgYSBncHMgbG9jYXRpb24gcHJvdmlkZXIKICAgICAgICAgICAgIEdwc0xvY2F0aW9uUHJvdmlkZXIgcHJvdmlkZXIgPSBuZXcgR3BzTG9jYXRpb25Qcm92aWRlcihtQ29udGV4dCwgdGhpcyk7CiAgICAgICAgICAgICBtR3BzU3RhdHVzUHJvdmlkZXIgPSBwcm92aWRlci5nZXRHcHNTdGF0dXNQcm92aWRlcigpOworICAgICAgICAgICAgbU5ldEluaXRpYXRlZExpc3RlbmVyID0gcHJvdmlkZXIuZ2V0TmV0SW5pdGlhdGVkTGlzdGVuZXIoKTsKICAgICAgICAgICAgIExvY2F0aW9uUHJvdmlkZXJQcm94eSBwcm94eSA9IG5ldyBMb2NhdGlvblByb3ZpZGVyUHJveHkoTG9jYXRpb25NYW5hZ2VyLkdQU19QUk9WSURFUiwgcHJvdmlkZXIpOwogICAgICAgICAgICAgYWRkUHJvdmlkZXIocHJveHkpOwogICAgICAgICAgICAgbUdwc0xvY2F0aW9uUHJvdmlkZXIgPSBwcm94eTsKQEAgLTg1MCw3ICs3NDgsOSBAQAogICAgICAgICAgKi8KICAgICAgICAgdm9pZCBkaXNwb3NlTG9ja2VkKCkgewogICAgICAgICAgICAgQXJyYXlMaXN0PFVwZGF0ZVJlY29yZD4gcmVjb3JkcyA9IG1SZWNvcmRzQnlQcm92aWRlci5nZXQodGhpcy5tUHJvdmlkZXIpOwotICAgICAgICAgICAgcmVjb3Jkcy5yZW1vdmUodGhpcyk7CisgICAgICAgICAgICBpZiAocmVjb3JkcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmVjb3Jkcy5yZW1vdmUodGhpcyk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBAT3ZlcnJpZGUKQEAgLTg2OSwxNSArNzY5LDYgQEAKICAgICAgICAgICAgIG1MYXN0Rml4QnJvYWRjYXN0LmR1bXAobmV3IFByaW50V3JpdGVyUHJpbnRlcihwdyksIHByZWZpeCArICIgICIpOwogICAgICAgICAgICAgcHcucHJpbnRsbihwcmVmaXggKyAibUxhc3RTdGF0dXNCcm9hZGNhc3Q9IiArIG1MYXN0U3RhdHVzQnJvYWRjYXN0KTsKICAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgLyoqCi0gICAgICAgICAqIENhbGxzIGRpc3Bvc2UoKS4KLSAgICAgICAgICovCi0gICAgICAgIEBPdmVycmlkZSBwcm90ZWN0ZWQgdm9pZCBmaW5hbGl6ZSgpIHsKLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKLSAgICAgICAgICAgICAgICBkaXNwb3NlTG9ja2VkKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KICAgICB9CiAKICAgICBwcml2YXRlIFJlY2VpdmVyIGdldFJlY2VpdmVyKElMb2NhdGlvbkxpc3RlbmVyIGxpc3RlbmVyKSB7CkBAIC0xMTA4LDYgKzk5OSwxMSBAQAogICAgIH0KIAogICAgIHB1YmxpYyBib29sZWFuIHNlbmRFeHRyYUNvbW1hbmQoU3RyaW5nIHByb3ZpZGVyLCBTdHJpbmcgY29tbWFuZCwgQnVuZGxlIGV4dHJhcykgeworICAgICAgICBpZiAocHJvdmlkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgLy8gdGhyb3cgTnVsbFBvaW50ZXJFeGNlcHRpb24gdG8gcmVtYWluIGNvbXBhdGlibGUgd2l0aCBwcmV2aW91cyBpbXBsZW1lbnRhdGlvbgorICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCk7CisgICAgICAgIH0KKwogICAgICAgICAvLyBmaXJzdCBjaGVjayBmb3IgcGVybWlzc2lvbiB0byB0aGUgcHJvdmlkZXIKICAgICAgICAgY2hlY2tQZXJtaXNzaW9uc1NhZmUocHJvdmlkZXIpOwogICAgICAgICAvLyBhbmQgY2hlY2sgZm9yIEFDQ0VTU19MT0NBVElPTl9FWFRSQV9DT01NQU5EUwpAQCAtMTExOCw3ICsxMDE0LDcgQEAKIAogICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CiAgICAgICAgICAgICBMb2NhdGlvblByb3ZpZGVyUHJveHkgcHJveHkgPSBtUHJvdmlkZXJzQnlOYW1lLmdldChwcm92aWRlcik7Ci0gICAgICAgICAgICBpZiAocHJvdmlkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKHByb3h5ID09IG51bGwpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgCkBAIC0xMTI2LDYgKzEwMjIsMjIgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHB1YmxpYyBib29sZWFuIHNlbmROaVJlc3BvbnNlKGludCBub3RpZklkLCBpbnQgdXNlclJlc3BvbnNlKQorICAgIHsKKyAgICAgICAgaWYgKEJpbmRlci5nZXRDYWxsaW5nVWlkKCkgIT0gUHJvY2Vzcy5teVVpZCgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJjYWxsaW5nIHNlbmROaVJlc3BvbnNlIGZyb20gb3V0c2lkZSBvZiB0aGUgc3lzdGVtIGlzIG5vdCBhbGxvd2VkIik7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtTmV0SW5pdGlhdGVkTGlzdGVuZXIuc2VuZE5pUmVzcG9uc2Uobm90aWZJZCwgdXNlclJlc3BvbnNlKTsKKyAgICAgICAgfQorICAgICAgICBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpCisgICAgICAgIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIlJlbW90ZUV4Y2VwdGlvbiBpbiBMb2NhdGlvbk1hbmFnZXJTZXJ2aWNlLnNlbmROaVJlc3BvbnNlIik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKICAgICBjbGFzcyBQcm94aW1pdHlBbGVydCB7CiAgICAgICAgIGZpbmFsIGludCAgbVVpZDsKICAgICAgICAgZmluYWwgZG91YmxlIG1MYXRpdHVkZTsKQEAgLTE0ODcsMTYgKzEzOTksNyBAQAogICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KIAotICAgICAgICBMb2NhdGlvbiBsb2NhdGlvbiA9IG1MYXN0S25vd25Mb2NhdGlvbi5nZXQocHJvdmlkZXIpOwotICAgICAgICBpZiAobG9jYXRpb24gPT0gbnVsbCkgewotICAgICAgICAgICAgLy8gR2V0IHRoZSBwZXJzaX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m5lY3RlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgdXBkYXRlQWRiTm90aWZpY2F0aW9uKCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9VTVNfRElTQ09OTkVDVEVEKSkgeworICAgICAgICAgICAgICAgIG1Vc2JDb25uZWN0ZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICB1cGRhdGVBZGJOb3RpZmljYXRpb24oKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVNT1ZFRCkKICAgICAgICAgICAgICAgICAgICAgfHwgYWN0aW9uLmVxdWFscyhJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVTVEFSVEVEKSkgewpAQCAtMzIzLDcgKzMyOSw3IEBACiAgICAgICAgICAgICAgICAgaWYgKHBrZ05hbWUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhbmNlbEFsbE5vdGlmaWNhdGlvbnMocGtnTmFtZSk7CisgICAgICAgICAgICAgICAgY2FuY2VsQWxsTm90aWZpY2F0aW9uc0ludChwa2dOYW1lLCAwLCAwKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH07CkBAIC0zODAsNiArMzg2LDggQEAKICAgICAgICAgLy8gcmVnaXN0ZXIgZm9yIGJhdHRlcnkgY2hhbmdlZCBub3RpZmljYXRpb25zCiAgICAgICAgIEludGVudEZpbHRlciBmaWx0ZXIgPSBuZXcgSW50ZW50RmlsdGVyKCk7CiAgICAgICAgIGZpbHRlci5hZGRBY3Rpb24oSW50ZW50LkFDVElPTl9CQVRURVJZX0NIQU5HRUQpOworICAgICAgICBmaWx0ZXIuYWRkQWN0aW9uKEludGVudC5BQ1RJT05fVU1TX0NPTk5FQ1RFRCk7CisgICAgICAgIGZpbHRlci5hZGRBY3Rpb24oSW50ZW50LkFDVElPTl9VTVNfRElTQ09OTkVDVEVEKTsKICAgICAgICAgZmlsdGVyLmFkZEFjdGlvbihJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVNT1ZFRCk7CiAgICAgICAgIGZpbHRlci5hZGRBY3Rpb24oSW50ZW50LkFDVElPTl9QQUNLQUdFX1JFU1RBUlRFRCk7CiAgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobUludGVudFJlY2VpdmVyLCBmaWx0ZXIpOwpAQCAtNTc1LDYgKzU4Myw4IEBACiAgICAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgIHB1YmxpYyB2b2lkIGVucXVldWVOb3RpZmljYXRpb24oU3RyaW5nIHBrZywgaW50IGlkLCBOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uLCBpbnRbXSBpZE91dCkKICAgICB7CisgICAgICAgIGNoZWNrSW5jb21pbmdDYWxsKHBrZyk7CisgICAgICAgIAogICAgICAgICAvLyBUaGlzIGNvbmRpdGlvbmFsIGlzIGEgZGlydHkgaGFjayB0byBsaW1pdCB0aGUgbG9nZ2luZyBkb25lIG9uCiAgICAgICAgIC8vICAgICBiZWhhbGYgb2YgdGhlIGRvd25sb2FkIG1hbmFnZXIgd2l0aG91dCBhZmZlY3Rpbmcgb3RoZXIgYXBwcy4KICAgICAgICAgaWYgKCFwa2cuZXF1YWxzKCJjb20uYW5kcm9pZC5wcm92aWRlcnMuZG93bmxvYWRzIikKQEAgLTYwNyw3ICs2MTcsMjAgQEAKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgb2xkID0gbU5vdGlmaWNhdGlvbkxpc3QucmVtb3ZlKGluZGV4KTsKICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uTGlzdC5hZGQoaW5kZXgsIHIpOworICAgICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB3ZSBkb24ndCBsb3NlIHRoZSBmb3JlZ3JvdW5kIHNlcnZpY2Ugc3RhdGUuCisgICAgICAgICAgICAgICAgaWYgKG9sZCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5mbGFncyB8PQorICAgICAgICAgICAgICAgICAgICAgICAgb2xkLm5vdGlmaWNhdGlvbi5mbGFncyZOb3RpZmljYXRpb24uRkxBR19GT1JFR1JPVU5EX1NFUlZJQ0U7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBFbnN1cmUgaWYgdGhpcyBpcyBhIGZvcmVncm91bmQgc2VydmljZSB0aGF0IHRoZSBwcm9wZXIgYWRkaXRpb25hbAorICAgICAgICAgICAgLy8gZmxhZ3MgYXJlIHNldC4KKyAgICAgICAgICAgIGlmICgobm90aWZpY2F0aW9uLmZsYWdzJk5vdGlmaWNhdGlvbi5GTEFHX0ZPUkVHUk9VTkRfU0VSVklDRSkgIT0gMCkgeworICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5mbGFncyB8PSBOb3RpZmljYXRpb24uRkxBR19PTkdPSU5HX0VWRU5UCisgICAgICAgICAgICAgICAgICAgICAgICB8IE5vdGlmaWNhdGlvbi5GTEFHX05PX0NMRUFSOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCiAgICAgICAgICAgICBpZiAobm90aWZpY2F0aW9uLmljb24gIT0gMCkgewogICAgICAgICAgICAgICAgIEljb25EYXRhIGljb24gPSBJY29uRGF0YS5tYWtlSWNvbihudWxsLCBwa2csIG5vdGlmaWNhdGlvbi5pY29uLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5pY29uTGV2ZWwsCkBAIC04MDIsOSArODI1LDExIEBACiAgICAgfQogCiAgICAgLyoqCi0gICAgICogQ2FuY2VscyBhIG5vdGlmaWNhdGlvbiBPTkxZIGlmIGl0IGhhcyBhbGwgb2YgdGhlIHtAY29kZSBtdXN0SGF2ZUZsYWdzfS4gCisgICAgICogQ2FuY2VscyBhIG5vdGlmaWNhdGlvbiBPTkxZIGlmIGl0IGhhcyBhbGwgb2YgdGhlIHtAY29kZSBtdXN0SGF2ZUZsYWdzfQorICAgICAqIGFuZCBub25lIG9mIHRoZSB7QGNvZGUgbXVzdE5vdEhhdmVGbGFnc30uIAogICAgICAqLwotICAgIHByaXZhdGUgdm9pZCBjYW5jZWxOb3RpZmljYXRpb24oU3RyaW5nIHBrZywgaW50IGlkLCBpbnQgbXVzdEhhdmVGbGFncykgeworICAgIHByaXZhdGUgdm9pZCBjYW5jZWxOb3RpZmljYXRpb24oU3RyaW5nIHBrZywgaW50IGlkLCBpbnQgbXVzdEhhdmVGbGFncywKKyAgICAgICAgICAgIGludCBtdXN0Tm90SGF2ZUZsYWdzKSB7CiAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRVZFTlRfTE9HX0NBTkNFTCwgcGtnLCBpZCwgbXVzdEhhdmVGbGFncyk7CiAKICAgICAgICAgc3luY2hyb25pemVkIChtTm90aWZpY2F0aW9uTGlzdCkgewpAQCAtODE3LDYgKzg0Miw5IEBACiAgICAgICAgICAgICAgICAgaWYgKChyLm5vdGlmaWNhdGlvbi5mbGFncyAmIG11c3RIYXZlRmxhZ3MpICE9IG11c3RIYXZlRmxhZ3MpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKHIubm90aWZpY2F0aW9uLmZsYWdzICYgbXVzdE5vdEhhdmVGbGFncykgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgIG1Ob3RpZmljYXRpb25MaXN0LnJlbW92ZShpbmRleCk7CiAKQEAgLTgzMCw3ICs4NTgsOCBAQAogICAgICAqIENhbmNlbHMgYWxsIG5vdGlmaWNhdGlvbnMgZnJvbSBhIGdpdmVuIHBhY2thZ2UgdGhhdCBoYXZlIGFsbCBvZiB0aGUKICAgICAgKiB7QGNvZGUgbXVzdEhhdmVGbGFnc30uCiAgICAgICovCi0gICAgcHJpdmF0ZSB2b2lkIGNhbmNlbEFsbE5vdGlmaWNhdGlvbnNJbnQoU3RyaW5nIHBrZywgaW50IG11c3RIYXZlRmxhZ3MpIHsKKyAgICB2b2lkIGNhbmNlbEFsbE5vdGlmaWNhdGlvbnNJbnQoU3RyaW5nIHBrZywgaW50IG11c3RIYXZlRmxhZ3MsCisgICAgICAgICAgICBpbnQgbXVzdE5vdEhhdmVGbGFncykgewogICAgICAgICBFdmVudExvZy53cml0ZUV2ZW50KEVWRU5UX0xPR19DQU5DRUxfQUxMLCBwa2csIG11c3RIYXZlRmxhZ3MpOwogCiAgICAgICAgIHN5bmNocm9uaXplZCAobU5vdGlmaWNhdGlvbkxpc3QpIHsKQEAgLTg0MSw2ICs4NzAsOSBAQAogICAgICAgICAgICAgICAgIGlmICgoci5ub3RpZmljYXRpb24uZmxhZ3MgJiBtdXN0SGF2ZUZsYWdzKSAhPSBtdXN0SGF2ZUZsYWdzKSB7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKHIubm90aWZpY2F0aW9uLmZsYWdzICYgbXVzdE5vdEhhdmVGbGFncykgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKCFyLnBrZy5lcXVhbHMocGtnKSkgewogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9CkBAIC04NTUsMTcgKzg4Nyw0MCBAQAogICAgIH0KIAogICAgIAotICAgIHB1YmxpYyB2b2lkIGNhbmNlbE5vdGlmaWNhdGlvbihTdHJpbmcgcGtnLCBpbnQgaWQpCi0gICAgewotICAgICAgICBjYW5jZWxOb3RpZmljYXRpb24ocGtnLCBpZCwgMCk7CisgICAgcHVibGljIHZvaWQgY2FuY2VsTm90aWZpY2F0aW9uKFN0cmluZyBwa2csIGludCBpZCkgeworICAgICAgICBjaGVja0luY29taW5nQ2FsbChwa2cpOworICAgICAgICAvLyBEb24ndCBhbGxvdyBjbGllbnQgYXBwbGljYXRpb25zIHRvIGNhbmNlbCBmb3JlZ3JvdW5kIHNlcnZpY2Ugbm90aXMuCisgICAgICAgIGNhbmNlbE5vdGlmaWNhdGlvbihwa2csIGlkLCAwLAorICAgICAgICAgICAgICAgIEJpbmRlci5nZXRDYWxsaW5nVWlkKCkgPT0gUHJvY2Vzcy5TWVNURU1fVUlECisgICAgICAgICAgICAgICAgPyAwIDogTm90aWZpY2F0aW9uLkZMQUdfRk9SRUdST1VORF9TRVJWSUNFKTsKICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCBjYW5jZWxBbGxOb3RpZmljYXRpb25zKFN0cmluZyBwa2cpCi0gICAgewotICAgICAgICBjYW5jZWxBbGxOb3RpZmljYXRpb25zSW50KHBrZywgMCk7CisgICAgcHVibGljIHZvaWQgY2FuY2VsQWxsTm90aWZpY2F0aW9ucyhTdHJpbmcgcGtnKSB7CisgICAgICAgIGNoZWNrSW5jb21pbmdDYWxsKHBrZyk7CisgICAgICAgIAorICAgICAgICAvLyBDYWxsaW5nIGZyb20gdXNlciBzcGFjZSwgZG9uJ3QgYWxsb3cgdGhlIGNhbmNlbGluZyBvZiBhY3RpdmVseQorICAgICAgICAvLyBydW5uaW5nIGZvcmVncm91bmQgc2VydmljZXMuCisgICAgICAgIGNhbmNlbEFsbE5vdGlmaWNhdGlvbnNJbnQocGtnLCAwLCBOb3RpZmljYXRpb24uRkxBR19GT1JFR1JPVU5EX1NFUlZJQ0UpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIGNhbmNlbEFsbCgpIHsKKyAgICB2b2lkIGNoZWNrSW5jb21pbmdDYWxsKFN0cmluZyBwa2cpIHsKKyAgICAgICAgaW50IHVpZCA9IEJpbmRlci5nZXRDYWxsaW5nVWlkKCk7CisgICAgICAgIGlmICh1aWQgPT0gUHJvY2Vzcy5TWVNURU1fVUlEIHx8IHVpZCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIEFwcGxpY2F0aW9uSW5mbyBhaSA9IG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCkuZ2V0QXBwbGljYXRpb25JbmZvKAorICAgICAgICAgICAgICAgICAgICBwa2csIDApOworICAgICAgICAgICAgaWYgKGFpLnVpZCAhPSB1aWQpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24oIkNhbGxpbmcgdWlkICIgKyB1aWQgKyAiIGdhdmUgcGFja2FnZSIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgcGtnICsgIiB3aGljaCBpcyBvd25lZCBieSB1aWQgIiArIGFpLnVpZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKFBhY2thZ2VNYW5hZ2VyLk5hbWVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24oIlVua25vd24gcGFja2FnZSAiICsgcGtnKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIGNhbmNlbEFsbCgpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtTm90aWZpY2F0aW9uTGlzdCkgewogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtTm90aWZpY2F0aW9uTGlzdC5zaXplKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpPU4tMTsgaT49MDsgaS0tKSB7CkBAIC05MDIsOCArOTU3LDE1IEBACiAgICAgewogICAgICAgICAvLyBCYXR0ZXJ5IGxvdyBhbHdheXMgc2hvd3MsIG90aGVyIHN0YXRlcyBvbmx5IHNob3cgaWYgY2hhcmdpbmcuCiAgICAgICAgIGlmIChtQmF0dGVyeUxvdykgewotICAgICAgICAgICAgbUhhcmR3YXJlLnNldExpZ2h0Rmxhc2hpbmdfVU5DSEVDS0VEKEhhcmR3YXJlU2VydmljZS5MSUdIVF9JRF9CQVRURVJZLCBCQVRURVJZX0xPV19BUkdCLAotICAgICAgICAgICAgICAgICAgICBIYXJkd2FyZVNlcnZpY2UuTElHSFRfRkxBU0hfVElNRUQsIEJBVFRFUllfQkxJTktfT04sIEJBVFRFUllfQkxJTktfT0ZGKTsKKyAgICAgICAgICAgIGlmIChtQmF0dGVyeUNoYXJnaW5nKSB7CisgICAgICAgICAgICAgICAgbUhhcmR3YXJlLnNldExpZ2h0Q29sb3JfVU5DSEVDS0VEKEhhcmR3YXJlU2VydmljZS5MSUdIVF9JRF9CQVRURVJZLAorICAgICAgICAgICAgICAgICAgICBCQVRURVJZX0xPV19BUkdCKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gRmxhc2ggd2hlbiBiYXR0ZXJ5IGlzIGxvdyBhbmQgbm90IGNoYXJnaW5nCisgICAgICAgICAgICAgICAgbUhhcmR3YXJlLnNldExpZ2h0Rmxhc2hpbmdfVU5DSEVDS0VEKEhhcmR3YXJlU2VydmljZS5MSUdIVF9JRF9CQVRURVJZLAorICAgICAgICAgICAgICAgICAgICBCQVRURVJZX0xPV19BUkdCLCBIYXJkd2FyZVNlcnZpY2UuTElHSFRfRkxBU0hfVElNRUQsCisgICAgICAgICAgICAgICAgICAgIEJBVFRFUllfQkxJTktfT04sIEJBVFRFUllfQkxJTktfT0ZGKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIGlmIChtQmF0dGVyeUNoYXJnaW5nKSB7CiAgICAgICAgICAgICBpZiAob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Agc3RhdGljIGZpbmFsIGludCBTRU5EX1BFTkRJTkdfQlJPQURDQVNUID0gMTsKKyAgICAvLyBEZWxheSB0aW1lIGluIG1pbGxpc2VjcworICAgIHN0YXRpYyBmaW5hbCBpbnQgQlJPQURDQVNUX0RFTEFZID0gMTAgKiAxMDAwOworCisgICAgY2xhc3MgUGFja2FnZUhhbmRsZXIgZXh0ZW5kcyBIYW5kbGVyIHsKKyAgICAgICAgUGFja2FnZUhhbmRsZXIoTG9vcGVyIGxvb3BlcikgeworICAgICAgICAgICAgc3VwZXIobG9vcGVyKTsKKyAgICAgICAgfQorICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBTRU5EX1BFTkRJTkdfQlJPQURDQVNUIDogeworICAgICAgICAgICAgICAgICAgICBpbnQgc2l6ZSA9IDA7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBicm9hZGNhc3RMaXN0W107CisgICAgICAgICAgICAgICAgICAgIEhhc2hNYXA8U3RyaW5nLCBTdHJpbmc+IHRtcE1hcDsKKyAgICAgICAgICAgICAgICAgICAgaW50IHVpZHNbXTsKKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtUGFja2FnZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBtUGVuZGluZ0Jyb2FkY2FzdHMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpemUgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdGhpbmcgdG8gYmUgZG9uZS4gSnVzdCByZXR1cm4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicm9hZGNhc3RMaXN0ID0gbmV3IFN0cmluZ1tzaXplXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1QZW5kaW5nQnJvYWRjYXN0cy5rZXlTZXQoKS50b0FycmF5KGJyb2FkY2FzdExpc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgdG1wTWFwID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBTdHJpbmc+KG1QZW5kaW5nQnJvYWRjYXN0cyk7CisgICAgICAgICAgICAgICAgICAgICAgICB1aWRzID0gbmV3IGludFtzaXplXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFja2FnZVNldHRpbmcgcHMgPSBtU2V0dGluZ3MubVBhY2thZ2VzLmdldChtUGVuZGluZ0Jyb2FkY2FzdHMuZ2V0KGJyb2FkY2FzdExpc3RbaV0pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aWRzW2ldID0gKHBzICE9IG51bGwpID8gcHMudXNlcklkIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ0Jyb2FkY2FzdHMuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBTZW5kIGJyb2FkY2FzdHMKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBjbGFzc05hbWUgPSBicm9hZGNhc3RMaXN0W2ldOworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZFBhY2thZ2VDaGFuZ2VkQnJvYWRjYXN0KGNsYXNzTmFtZSwgdHJ1ZSwgdG1wTWFwLmdldChjbGFzc05hbWUpLCB1aWRzW2ldKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBJUGFja2FnZU1hbmFnZXIgbWFpbihDb250ZXh0IGNvbnRleHQsIGJvb2xlYW4gZmFjdG9yeVRlc3QpIHsKICAgICAgICAgUGFja2FnZU1hbmFnZXJTZXJ2aWNlIG0gPSBuZXcgUGFja2FnZU1hbmFnZXJTZXJ2aWNlKGNvbnRleHQsIGZhY3RvcnlUZXN0KTsKICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZSgicGFja2FnZSIsIG0pOwpAQCAtMzA5LDYgKzM2NSwxMCBAQAogICAgICAgICAgICAgICAgIE1VTFRJUExFX0FQUExJQ0FUSU9OX1VJRFMKICAgICAgICAgICAgICAgICAgICAgICAgID8gUkFESU9fVUlEIDogRklSU1RfQVBQTElDQVRJT05fVUlELAogICAgICAgICAgICAgICAgIEFwcGxpY2F0aW9uSW5mby5GTEFHX1NZU1RFTSk7CisgICAgICAgIG1TZXR0aW5ncy5hZGRTaGFyZWRVc2VyTFAoImFuZHJvaWQudWlkLmxvZyIsCisgICAgICAgICAgICAgICAgTVVMVElQTEVfQVBQTElDQVRJT05fVUlEUworICAgICAgICAgICAgICAgICAgICAgICAgPyBMT0dfVUlEIDogRklSU1RfQVBQTElDQVRJT05fVUlELAorICAgICAgICAgICAgICAgIEFwcGxpY2F0aW9uSW5mby5GTEFHX1NZU1RFTSk7CiAKICAgICAgICAgU3RyaW5nIHNlcGFyYXRlUHJvY2Vzc2VzID0gU3lzdGVtUHJvcGVydGllcy5nZXQoImRlYnVnLnNlcGFyYXRlX3Byb2Nlc3NlcyIpOwogICAgICAgICBpZiAoc2VwYXJhdGVQcm9jZXNzZXMgIT0gbnVsbCAmJiBzZXBhcmF0ZVByb2Nlc3Nlcy5sZW5ndGgoKSA+IDApIHsKQEAgLTM0NSw3ICs0MDUsNyBAQAogICAgICAgICBzeW5jaHJvbml6ZWQgKG1JbnN0YWxsTG9jaykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYWNrYWdlcykgewogICAgICAgICAgICAgbUhhbmRsZXJUaHJlYWQuc3RhcnQoKTsKLSAgICAgICAgICAgIG1IYW5kbGVyID0gbmV3IEhhbmRsZXIobUhhbmRsZXJUaHJlYWQuZ2V0TG9vcGVyKCkpOworICAgICAgICAgICAgbUhhbmRsZXIgPSBuZXcgUGFja2FnZUhhbmRsZXIobUhhbmRsZXJUaHJlYWQuZ2V0TG9vcGVyKCkpOwogICAgICAgICAgICAgCiAgICAgICAgICAgICBGaWxlIGRhdGFEaXIgPSBFbnZpcm9ubWVudC5nZXREYXRhRGlyZWN0b3J5KCk7CiAgICAgICAgICAgICBtQXBwRGF0YURpciA9IG5ldyBGaWxlKGRhdGFEaXIsICJkYXRhIik7CkBAIC02NzEsNyArNzMxLDIxIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgcGFyc2VyLmdldFBvc2l0aW9uRGVzY3JpcHRpb24oKSk7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJHb3QgbGlicmFyeSAiICsgbG5hbWUgKyAiIGluICIgKyBsZmlsZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1TaGFyZWRMaWJyYXJpZXMucHV0KGxuYW1lLCBsZmlsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2hhcmVkTGlicmFyaWVzLnB1dChsbmFtZSwgbGZpbGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIFhtbFV0aWxzLnNraXBDdXJyZW50VGFnKHBhcnNlcik7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJmZWF0dXJlIi5lcXVhbHMobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGZuYW1lID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJuYW1lIik7CisgICAgICAgICAgICAgICAgICAgIGlmIChmbmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICI8ZmVhdHVyZT4gd2l0aG91dCBuYW1lIGF0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBwYXJzZXIuZ2V0UG9zaXRpb25EZXNjcmlwdGlvbigpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkdvdCBmZWF0dXJlICIgKyBmbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBGZWF0dXJlSW5mbyBmaSA9IG5ldyBGZWF0dXJlSW5mbygpOworICAgICAgICAgICAgICAgICAgICAgICAgZmkubmFtZSA9IGZuYW1lOworICAgICAgICAgICAgICAgICAgICAgICAgbUF2YWlsYWJsZUZlYXR1cmVzLnB1dChmbmFtZSwgZmkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIFhtbFV0aWxzLnNraXBDdXJyZW50VGFnKHBhcnNlcik7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwpAQCAtMTAwMSwxMiArMTA3NSwzMCBAQAogICAgICAgICBTZXQ8U3RyaW5nPiBsaWJTZXQ7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVBhY2thZ2VzKSB7CiAgICAgICAgICAgICBsaWJTZXQgPSBtU2hhcmVkTGlicmFyaWVzLmtleVNldCgpOworICAgICAgICAgICAgaW50IHNpemUgPSBsaWJTZXQuc2l6ZSgpOworICAgICAgICAgICAgaWYgKHNpemUgPiAwKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nW10gbGlicyA9IG5ldyBTdHJpbmdbc2l6ZV07CisgICAgICAgICAgICAgICAgbGliU2V0LnRvQXJyYXkobGlicyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGxpYnM7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgaW50IHNpemUgPSBsaWJTZXQuc2l6ZSgpOwotICAgICAgICBpZiAoc2l6ZSA+IDApIHsKLSAgICAgICAgICAgIFN0cmluZ1tdIGxpYnMgPSBuZXcgU3RyaW5nW3NpemVdOwotICAgICAgICAgICAgbGliU2V0LnRvQXJyYXkobGlicyk7Ci0gICAgICAgICAgICByZXR1cm4gbGliczsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIEZlYXR1cmVJbmZvW10gZ2V0U3lzdGVtQXZhaWxhYmxlRmVhdHVyZXMoKSB7CisgICAgICAgIENvbGxlY3Rpb248RmVhdHVyZUluZm8+IGZlYXRTZXQ7CisgICAgICAgIHN5bmNocm9uaXplZCAobVBhY2thZ2VzKSB7CisgICAgICAgICAgICBmZWF0U2V0ID0gbUF2YWlsYWJsZUZlYXR1cmVzLnZhbHVlcygpOworICAgICAgICAgICAgaW50IHNpemUgPSBmZWF0U2V0LnNpemUoKTsKKyAgICAgICAgICAgIGlmIChzaXplID4gMCkgeworICAgICAgICAgICAgICAgIEZlYXR1cmVJbmZvW10gZmVhdHVyZXMgPSBuZXcgRmVhdHVyZUluZm9bc2l6ZSsxXTsKKyAgICAgICAgICAgICAgICBmZWF0U2V0LnRvQXJyYXkoZmVhdHVyZXMpOworICAgICAgICAgICAgICAgIEZlYXR1cmVJbmZvIGZpID0gbmV3IEZlYXR1cmVJbmZvKCk7CisgICAgICAgICAgICAgICAgZmkucmVxR2xFc1ZlcnNpb24gPSBTeXN0ZW1Qcm9wZXJ0aWVzLmdldEludCgicm8ub3BlbmdsZXMudmVyc2lvbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBGZWF0dXJlSW5mby5HTF9FU19WRVJTSU9OX1VOREVGSU5FRCk7CisgICAgICAgICAgICAgICAgZmVhdHVyZXNbc2l6ZV0gPSBmaTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmVhdHVyZXM7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQpAQCAtMTEzOCwyNSArMTIzMCw1NyBAQAogICAgICAgICAgICAgICAgICAgICB8fCBwMiA9PSBudWxsIHx8IHAyLm1FeHRyYXMgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHJldHVybiBQYWNrYWdlTWFuYWdlci5TSUdOQVRVUkVfVU5LTk9XTl9QQUNLQUdFOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIGNoZWNrU2lnbmF0dXJlc0xQKHAxLCBwMik7CisgICAgICAgICAgICByZXR1cm4gY2hlY2tTaWduYXR1cmVzTFAocDEubVNpZ25hdHVyZXMsIHAyLm1TaWduYXR1cmVzKTsKICAgICAgICAgfQogICAgIH0KIAotICAgIGludCBjaGVja1NpZ25hdHVyZXNMUChQYWNrYWdlUGFyc2VyLlBhY2thZ2UgcDEsIFBhY2thZ2VQYXJzZXIuUGFja2FnZSBwMikgewotICAgICAgICBpZiAocDEubVNpZ25hdHVyZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIHAyLm1TaWduYXR1cmVzID09IG51bGwKKyAgICBwdWJsaWMgaW50IGNoZWNrVWlkU2lnbmF0dXJlcyhpbnQgdWlkMSwgaW50IHVpZDIpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtUGFja2FnZXMpIHsKKyAgICAgICAgICAgIFNpZ25hdHVyZVtdIHMxOworICAgICAgICAgICAgU2lnbmF0dXJlW10gczI7CisgICAgICAgICAgICBPYmplY3Qgb2JqID0gbVNldHRpbmdzLmdldFVzZXJJZExQKHVpZDEpOworICAgICAgICAgICAgaWYgKG9iaiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKG9iaiBpbnN0YW5jZW9mIFNoYXJlZFVzZXJTZXR0aW5nKSB7CisgICAgICAgICAgICAgICAgICAgIHMxID0gKChTaGFyZWRVc2VyU2V0dGluZylvYmopLnNpZ25hdHVyZXMubVNpZ25hdHVyZXM7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvYmogaW5zdGFuY2VvZiBQYWNrYWdlU2V0dGluZykgeworICAgICAgICAgICAgICAgICAgICBzMSA9ICgoUGFja2FnZVNldHRpbmcpb2JqKS5zaWduYXR1cmVzLm1TaWduYXR1cmVzOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBQYWNrYWdlTWFuYWdlci5TSUdOQVRVUkVfVU5LTk9XTl9QQUNLQUdFOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIFBhY2thZ2VNYW5hZ2VyLlNJR05BVFVSRV9VTktOT1dOX1BBQ0tBR0U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBvYmogPSBtU2V0dGluZ3MuZ2V0VXNlcklkTFAodWlkMik7CisgICAgICAgICAgICBpZiAob2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAob2JqIGluc3RhbmNlb2YgU2hhcmVkVXNlclNldHRpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgczIgPSAoKFNoYXJlZFVzZXJTZXR0aW5nKW9iaikuc2lnbmF0dXJlcy5tU2lnbmF0dXJlczsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9iaiBpbnN0YW5jZW9mIFBhY2thZ2VTZXR0aW5nKSB7CisgICAgICAgICAgICAgICAgICAgIHMyID0gKChQYWNrYWdlU2V0dGluZylvYmopLnNpZ25hdHVyZXMubVNpZ25hdHVyZXM7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBhY2thZ2VNYW5hZ2VyLlNJR05BVFVSRV9VTktOT1dOX1BBQ0tBR0U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gUGFja2FnZU1hbmFnZXIuU0lHTkFUVVJFX1VOS05PV05fUEFDS0FHRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBjaGVja1NpZ25hdHVyZXNMUChzMSwgczIpOworICAgICAgICB9CisgICAgfQorCisgICAgaW50IGNoZWNrU2lnbmF0dXJlc0xQKFNpZ25hdHVyZVtdIHMxLCBTaWduYXR1cmVbXSBzMikgeworICAgICAgICBpZiAoczEgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIHMyID09IG51bGwKICAgICAgICAgICAgICAgICAgICAgPyBQYWNrYWdlTWFuYWdlci5TSUdOQVRVUkVfTkVJVEhFUl9TSUdORUQKICAgICAgICAgICAgICAgICAgICAgOiBQYWNrYWdlTWFuYWdlci5TSUdOQVRVUkVfRklSU1RfTk9UX1NJR05FRDsKICAgICAgICAgfQotICAgICAgICBpZiAocDIubVNpZ25hdHVyZXMgPT0gbnVsbCkgeworICAgICAgICBpZiAoczIgPT0gbnVsbCkgewogICAgICAgICAgICAgcmV0dXJuIFBhY2thZ2VNYW5hZ2VyLlNJR05BVFVSRV9TRUNPTkRfTk9UX1NJR05FRDsKICAgICAgICAgfQotICAgICAgICBmaW5hbCBpbnQgTjEgPSBwMS5tU2lnbmF0dXJlcy5sZW5ndGg7Ci0gICAgICAgIGZpbmFsIGludCBOMiA9IHAyLm1TaWduYXR1cmVzLmxlbmd0aDsKKyAgICAgICAgZmluYWwgaW50IE4xID0gczEubGVuZ3RoOworICAgICAgICBmaW5hbCBpbnQgTjIgPSBzMi5sZW5ndGg7CiAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOMTsgaSsrKSB7CiAgICAgICAgICAgICBib29sZWFuIG1hdGNoID0gZmFsc2U7CiAgICAgICAgICAgICBmb3IgKGludCBqPTA7IGo8TjI7IGorKykgewotICAgICAgICAgICAgICAgIGlmIChwMS5tU2lnbmF0dXJlc1tpXS5lcXVhbHMocDIubVNpZ25hdHVyZXNbal0pKSB7CisgICAgICAgICAgICAgICAgaWYgKHMxW2ldLmVxdWFscyhzMltqXSkpIHsKICAgICAgICAgICAgICAgICAgICAgbWF0Y2ggPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CkBAIC0xNjc3LDYgKzE4MDEsOSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgLyoqCisgICAgICogQGRlcHJlY2F0ZWQKKyAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBxdWVyeVN5bmNQcm92aWRlcnMoTGlzdCBvdXROYW1lcywgTGlzdCBvdXRJbmZvKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVBhY2thZ2VzKSB7CiAgICAgICAgICAgICBJdGVyYXRvcjxNYXAuRW50cnk8U3RyaW5nLCBQYWNrYWdlUGFyc2VyLlByb3ZpZGVyPj4gaQpAQCAtMjAzMCwxNyArMjE1Nyw2MiBAQAogICAgICAgICAKICAgICAgICAgc3luY2hyb25pemVkIChtUGFja2FnZXMpIHsKICAgICAgICAgICAgIC8vIENoZWNrIGFsbCBzaGFyZWQgbGlicmFyaWVzIGFuZCBtYXAgdG8gdGhlaXIgYWN0dWFsIGZpbGUgcGF0aC4KLSAgICAgICAgICAgIGlmIChwa2cudXNlc0xpYnJhcnlGaWxlcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPHBrZy51c2VzTGlicmFyeUZpbGVzLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBmaWxlID0gbVNoYXJlZExpYnJhcmllcy5nZXQocGtnLnVzZXNMaWJyYXJ5RmlsZXNbaV0pOworICAgICAgICAgICAgaWYgKHBrZy51c2VzTGlicmFyaWVzICE9IG51bGwgfHwgcGtnLnVzZXNPcHRpb25hbExpYnJhcmllcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKG1UbXBTaGFyZWRMaWJyYXJpZXMgPT0gbnVsbCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgbVRtcFNoYXJlZExpYnJhcmllcy5sZW5ndGggPCBtU2hhcmVkTGlicmFyaWVzLnNpemUoKSkgeworICAgICAgICAgICAgICAgICAgICBtVG1wU2hhcmVkTGlicmFyaWVzID0gbmV3IFN0cmluZ1ttU2hhcmVkTGlicmFyaWVzLnNpemUoKV07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBudW0gPSAwOworICAgICAgICAgICAgICAgIGludCBOID0gcGtnLnVzZXNMaWJyYXJpZXMgIT0gbnVsbCA/IHBrZy51c2VzTGlicmFyaWVzLnNpemUoKSA6IDA7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmlsZSA9IG1TaGFyZWRMaWJyYXJpZXMuZ2V0KHBrZy51c2VzTGlicmFyaWVzLmdldChpKSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIlBhY2thZ2UgIiArIHBrZy5wYWNrYWdlTmFtZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgcmVxdWlyZXMgdW5hdmFpbGFibGUgc2hhcmVkIGxpYnJhcnkgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHBrZy51c2VzTGlicmFyeUZpbGVzW2ldICsgIjsgaWdub3JpbmchIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgcGtnLnVzZXNMaWJyYXJpZXMuZ2V0KGkpICsgIjsgZmFpbGluZyEiKTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0U2NhbkVycm9yID0gUGFja2FnZU1hbmFnZXIuSU5TVEFMTF9GQUlMRURfTUlTU0lOR19TSEFSRURfTElCUkFSWTsKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBrZy51c2VzTGlicmFyeUZpbGVzW2ldID0gZmlsZTsKKyAgICAgICAgICAgICAgICAgICAgbVRtcFNoYXJlZExpYnJhcmllc1tudW1dID0gZmlsZTsKKyAgICAgICAgICAgICAgICAgICAgbnVtKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIE4gPSBwa2cudXNlc09wdGlvbmFsTGlicmFyaWVzICE9IG51bGwgPyBwa2cudXNlc09wdGlvbmFsTGlicmFyaWVzLnNpemUoKSA6IDA7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmlsZSA9IG1TaGFyZWRMaWJyYXJpZXMuZ2V0KHBrZy51c2VzT3B0aW9uYWxMaWJyYXJpZXMuZ2V0KGkpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiUGFja2FnZSAiICsgcGtnLnBhY2thZ2VOYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkZXNpcmVzIHVuYXZhaWxhYmxlIHNoYXJlZCBsaWJyYXJ5ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBwa2cudXNlc09wdGlvbmFsTGlicmFyaWVzLmdldChpKSArICI7IGlnbm9yaW5nISIpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbVRtcFNoYXJlZExpYnJhcmllc1tudW1dID0gZmlsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChudW0gPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIHBrZy51c2VzTGlicmFyeUZpbGVzID0gbmV3IFN0cmluZ1tudW1dOworICAgICAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1UbXBTaGFyZWRMaWJyYXJpZXMsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGtnLnVzZXNMaWJyYXJ5RmlsZXMsIDAsIG51bSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChwa2cucmVxRmVhdHVyZXMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBOID0gcGtnLnJlcUZlYXR1cmVzLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgRmVhdHVyZUluZm8gZmkgPSBwa2cucmVxRmVhdHVyZXMuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmaS5mbGFncyZGZWF0dXJlSW5mby5GTEFHX1JFUVVJUkVEKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3QgY2FyZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpLm5hbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQXZhaWxhYmxlRmVhdHVyZXMuZ2V0KGZpLm5hbWUpID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiUGFja2FnZSAiICsgcGtnLnBhY2thZ2VOYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHJlcXVpcmVzIHVuYXZhaWxhYmxlIGZlYXR1cmUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgZmkubmFtZSArICI7IGZhaWxpbmchIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0U2NhbkVycm9yID0gUGFja2FnZU1hbmFnZXIuSU5TVEFMTF9GQUlMRURfTUlTU0lOR19GRUFUVVJFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKQEAgLTI5MDQsOSArMzA3Niw5IEBACiAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocC5pbmZvLnByb3RlY3Rpb25MZXZlbCA9PSBQZXJtaXNzaW9uSW5mby5QUk9URUNUSU9OX1NJR05BVFVSRQogICAgICAgICAgICAgICAgICAgICAgICAgfHwgcC5pbmZvLnByb3RlY3Rpb25MZXZlbCA9PSBQZXJtaXNzaW9uSW5mby5QUk9URUNUSU9OX1NJR05BVFVSRV9PUl9TWVNURU0pIHsKLSAgICAgICAgICAgICAgICAgICAgYWxsb3dlZCA9IChjaGVja1NpZ25hdHVyZXNMUChwLm93bmVyLCBwa2cpCisgICAgICAgICAgICAgICAgICAgIGFsbG93ZWQgPSAoY2hlY2tTaWduYXR1cmVzTFAocC5vd25lci5tU2lnbmF0dXJlcywgcGtnLm1TaWduYXR1cmVzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gUGFja2FnZU1hbmFnZXIuU0lHTkFUVVJFX01BVENIKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChjaGVja1NpZ25hdHVyZXNMUChtUGxhdGZvcm1QYWNrYWdlLCBwa2cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNoZWNrU2lnbmF0dXJlc0xQKG1QbGF0Zm9ybVBhY2thZ2UubVNpZ25hdHVyZXMsIHBrZy5tU2lnbmF0dXJlcykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFBhY2thZ2VNYW5hZ2VyLlNJR05BVFVSRV9NQVRDSCk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChwLmluZm8ucHJvdGVjdGlvbkxldmVsID09IFBlcm1pc3Npb25JbmZvLlBST1RFQ1RJT05fU0lHTkFUVVJFX09SX1NZU1RFTSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwa2cuYXBwbGljYXRpb25JbmZvLmZsYWdzJkFwcGxpY2F0aW9uSW5mby5GTEFHX1NZU1RFTSkgIT0gMCkgewpAQCAtMzU1Myw3ICszNzI1LDggQEAKICAgICAgICAgLy8gRmlyc3QgZmluZCB0aGUgb2xkIHBhY2thZ2UgaW5mbyBhbmQgY2hlY2sgc2lnbmF0dXJlcwogICAgICAgICBzeW5jaHJvbml6ZWQobVBhY2thZ2VzKSB7CiAgICAgICAgICAgICBvbGRQYWNrYWdlID0gbVBhY2thZ2VzLmdldChwa2dOYW1lKTsKLSAgICAgICAgICAgIGlmKGNoZWNrU2lnbmF0dXJlc0xQKHBrZywgb2xkUGFja2FnZSkgIT0gUGFja2FnZU1hbmFnZXIuU0lHTkFUVVJFX01BVENIKSB7CisgICAgICAgICAgICBpZihjaGVja1NpZ25hdHVyZXNMUChwa2cubVNpZ25hdHVyZXMsIG9sZFBhY2thZ2UubVNpZ25hdHVyZXMpCisgICAgICAgICAgICAgICAgICAgICE9IFBhY2thZ2VNYW5hZ2VyLlNJR05BVFVSRV9NQVRDSCkgewogICAgICAgICAgICAgICAgIHJlcy5yZXR1cm5Db2RlID0gUGFja2FnZU1hbmFnZXIuSU5TVEFMTF9QQVJTRV9GQUlMRURfSU5DT05TSVNURU5UX0NFUlR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sKTsKKyAgICAgICAgU3RyaW5nIGtleSA9IGlzQXBwID8gcGFja2FnZU5hbWUgOiBjbGFzc05hbWU7CiAgICAgICAgIGludCBwYWNrYWdlVWlkID0gLTE7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVBhY2thZ2VzKSB7Ci0gICAgICAgICAgICBwa2dTZXR0aW5nID0gbVNldHRpbmdzLm1QYWNrYWdlcy5nZXQocGFja2FnZU5hbWVTdHIpOworICAgICAgICAgICAgcGtnU2V0dGluZyA9IG1TZXR0aW5ncy5tUGFja2FnZXMuZ2V0KHBhY2thZ2VOYW1lKTsKICAgICAgICAgICAgIGlmIChwa2dTZXR0aW5nID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBpZiAoY2xhc3NOYW1lU3RyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoY2xhc3NOYW1lID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5rbm93biBwYWNrYWdlOiAiICsgcGFja2FnZU5hbWVTdHIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVbmtub3duIHBhY2thZ2U6ICIgKyBwYWNrYWdlTmFtZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCi0gICAgICAgICAgICAgICAgICAgICAgICAiVW5rbm93biBjb21wb25lbnQ6ICIgKyBwYWNrYWdlTmFtZVN0cgotICAgICAgICAgICAgICAgICAgICAgICAgKyAiLyIgKyBjbGFzc05hbWVTdHIpOworICAgICAgICAgICAgICAgICAgICAgICAgIlVua25vd24gY29tcG9uZW50OiAiICsgcGFja2FnZU5hbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIi8iICsgY2xhc3NOYW1lKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICghYWxsb3dlZEJ5UGVybWlzc2lvbiAmJiAodWlkICE9IHBrZ1NldHRpbmcudXNlcklkKSkgewogICAgICAgICAgICAgICAgIHRocm93IG5ldyBTZWN1cml0eUV4Y2VwdGlvbigKQEAgLTQ3NzMsNDEgKzQ5NDksNjcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICsgQmluZGVyLmdldENhbGxpbmdQaWQoKQogICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCB1aWQ9IiArIHVpZCArICIsIHBhY2thZ2UgdWlkPSIgKyBwa2dTZXR0aW5nLnVzZXJJZCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBwYWNrYWdlVWlkID0gcGtnU2V0dGluZy51c2VySWQ7Ci0gICAgICAgICAgICBpZiAoY2xhc3NOYW1lU3RyID09IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChjbGFzc05hbWUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIC8vIFdlJ3JlIGRlYWxpbmcgd2l0aCBhbiBhcHBsaWNhdGlvbi9wYWNrYWdlIGxldmVsIHN0YXRlIGNoYW5nZQogICAgICAgICAgICAgICAgIHBrZ1NldHRpbmcuZW5hYmxlZCA9IG5ld1N0YXRlOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAvLyBXZSdyZSBkZWFsaW5nIHdpdGggYSBjb21wb25lbnQgbGV2ZWwgc3RhdGUgY2hhbmdlCiAgICAgICAgICAgICAgICAgc3dpdGNoIChuZXdTdGF0ZSkgewogICAgICAgICAgICAgICAgIGNhc2UgQ09NUE9ORU5UX0VOQUJMRURfU1RBVEVfRU5BQkxFRDoKLSAgICAgICAgICAgICAgICAgICAgcGtnU2V0dGluZy5lbmFibGVDb21wb25lbnRMUChjbGFzc05hbWVTdHIpOworICAgICAgICAgICAgICAgICAgICBwa2dTZXR0aW5nLmVuYWJsZUNvbXBvbmVudExQKGNsYXNzTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgQ09NUE9ORU5UX0VOQUJMRURfU1RBVEVfRElTQUJMRUQ6Ci0gICAgICAgICAgICAgICAgICAgIHBrZ1NldHRpbmcuZGlzYWJsZUNvbXBvbmVudExQKGNsYXNzTmFtZVN0cik7CisgICAgICAgICAgICAgICAgICAgIHBrZ1NldHRpbmcuZGlzYWJsZUNvbXBvbmVudExQKGNsYXNzTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgQ09NUE9ORU5UX0VOQUJMRURfU1RBVEVfREVGQVVMVDoKLSAgICAgICAgICAgICAgICAgICAgcGtnU2V0dGluZy5yZXN0b3JlQ29tcG9uZW50TFAoY2xhc3NOYW1lU3RyKTsKKyAgICAgICAgICAgICAgICAgICAgcGtnU2V0dGluZy5yZXN0b3JlQ29tcG9uZW50TFAoY2xhc3NOYW1lKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSW52YWxpZCBuZXcgY29tcG9uZW50IHN0YXRlOiAiICsgbmV3U3RhdGUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgbVNldHRpbmdzLndyaXRlTFAoKTsKKyAgICAgICAgICAgIHBhY2thZ2VVaWQgPSBwa2dTZXR0aW5nLnVzZXJJZDsKKyAgICAgICAgICAgIGlmICgoZmxhZ3MmUGFja2FnZU1hbmFnZXIuRE9OVF9LSUxMX0FQUCkgPT0gMCkgeworICAgICAgICAgICAgICAgIHNlbmROb3cgPSB0cnVlOworICAgICAgICAgICAgICAgIC8vIFB1cmdlIGVudHJ5IGZyb20gcGVuZGluZyBicm9hZGNhc3QgbGlzdCBpZiBhbm90aGVyIG9uZSBleGlzdHMgYWxyZWFkeQorICAgICAgICAgICAgICAgIC8vIHNpbmNlIHdlIGFyZSBzZW5kaW5nIG9uZSByaWdodCBhd2F5LgorICAgICAgICAgICAgICAgIGlmIChtUGVuZGluZ0Jyb2FkY2FzdHMuZ2V0KGtleSkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ0Jyb2FkY2FzdHMucmVtb3ZlKGtleSk7CisgICAgICAgICAgICAgICAgICAgIC8vIENhbiBpZ25vcmUgZW1wdHkgbGlzdCBzaW5jZSBpdHMgaGFuZGxlZCBpbiB0aGUgaGFuZGxlciBhbnl3YXkKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtUGVuZGluZ0Jyb2FkY2FzdHMuZ2V0KGtleSkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ0Jyb2FkY2FzdHMucHV0KGtleSwgcGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIW1IYW5kbGVyLmhhc01lc3NhZ2VzKFNFTkRfUEVORElOR19CUk9BRENBU1QpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFNjaGVkdWxlIGEgbWVzc2FnZQorICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlRGVsYXllZChTRU5EX1BFTkRJTkdfQlJPQURDQVNULCBCUk9BRENBU1RfREVMQVkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBsb25nIGNhbGxpbmdJZCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICB0cnkgewotICAgICAgICAgICAgQnVuZGxlIGV4dHJhcyA9IG5ldyBCdW5kbGUoMik7Ci0gICAgICAgICAgICBleHRyYXMucHV0Qm9vbGVhbihJbnRlbnQuRVhUUkFfRE9OVF9LSUxMX0FQUCwKLSAgICAgICAgICAgICAgICAgICAgKGZsYWdzJlBhY2thZ2VNYW5hZ2VyLkRPTlRfS0lMTF9BUFApICE9IDApOwotICAgICAgICAgICAgZXh0cmFzLnB1dEludChJbnRlbnQuRVhUUkFfVUlELCBwYWNrYWdlVWlkKTsKLSAgICAgICAgICAgIHNlbmRQYWNrYWdlQnJvYWRjYXN0KEludGVudC5BQ1RJT05fUEFDS0FHRV9DSEFOR0VELCBwYWNrYWdlTmFtZVN0ciwgZXh0cmFzKTsKKyAgICAgICAgICAgIGlmIChzZW5kTm93KSB7CisgICAgICAgICAgICAgICAgc2VuZFBhY2thZ2VDaGFuZ2VkQnJvYWRjYXN0KHBhY2thZ2VOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgKGZsYWdzJlBhY2thZ2VNYW5hZ2VyLkRPTlRfS0lMTF9BUFApICE9IDAsIGtleSwgcGFja2FnZVVpZCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShjYWxsaW5nSWQpOwogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIHNlbmRQYWNrYWdlQ2hhbmdlZEJyb2FkY2FzdChTdHJpbmcgcGFja2FnZU5hbWUsCisgICAgICAgICAgICBib29sZWFuIGtpbGxGbGFnLCBTdHJpbmcgY29tcG9uZW50TmFtZSwgaW50IHBhY2thZ2VVaWQpIHsKKyAgICAgICAgQnVuZGxlIGV4dHJhcyA9IG5ldyBCdW5kbGUoMik7CisgICAgICAgIGV4dHJhcy5wdXRTdHJpbmcoSW50ZW50LkVYVFJBX0NIQU5HRURfQ09NUE9ORU5UX05BTUUsIGNvbXBvbmVudE5hbWUpOworICAgICAgICBleHRyYXMucHV0Qm9vbGVhbihJbnRlbnQuRVhUUkFfRE9OVF9LSUxMX0FQUCwga2lsbEZsYWcpOworICAgICAgICBleHRyYXMucHV0SW50KEludGVudC5FWFRSQV9VSUQsIHBhY2thZ2VVaWQpOworICAgICAgICBzZW5kUGFja2FnZUJyb2FkY2FzdChJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfQ0hBTkdFRCwgIHBhY2thZ2VOYW1lLCBleHRyYXMpOyAgIAorICAgIH0KKwogICAgIHB1YmxpYyBTdHJpbmcgZ2V0SW5zdGFsbGVyUGFja2FnZU5hbWUoU3RyaW5nIHBhY2thZ2VOYW1lKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVBhY2thZ2VzKSB7CiAgICAgICAgICAgICBQYWNrYWdlU2V0dGluZyBwa2cgPSBtU2V0dGluZ3MubVBhY2thZ2VzLmdldChwYWNrYWdlTmFtZSk7CkBAIC01MDI5LDYgKzUyMzEsMTUgQEAKICAgICAgICAgICAgIHB3LnByaW50bG4oIlNldHRpbmdzIHBhcnNlIG1lc3NhZ2VzOiIpOwogICAgICAgICAgICAgcHcucHJpbnRsbihtU2V0dGluZ3MubVJlYWRNZXNzYWdlcy50b1N0cmluZygpKTsKICAgICAgICAgfQorCisgICAgICAgIHN5bmNocm9uaXplZCAobVByb3ZpZGVycykgeworICAgICAgICAgICAgcHcucHJpbnRsbigiICIpOworICAgICAgICAgICAgcHcucHJpbnRsbigiUmVnaXN0ZXJlZCBDb250ZW50UHJvdmlkZXJzOiIpOworICAgICAgICAgICAgZm9yIChQYWNrYWdlUGFyc2VyLlByb3ZpZGVyIHAgOiBtUHJvdmlkZXJzLnZhbHVlcygpKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICBbIik7IHB3LnByaW50bG4ocC5pbmZvLmF1dGhvcml0eSk7IHB3LnByaW50bG4oIl06ICIpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihwLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgfQogCiAgICAgc3RhdGljIGZpbmFsIGNsYXNzIEJhc2VQZXJtaXNzaW9uIHsKZGlmZiAtLWdpdC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Nvck1hbmFnZXIgbVNlbnNvck1hbmFnZXI7CisgICAgcHJpdmF0ZSBTZW5zb3IgbVByb3hpbWl0eVNlbnNvcjsKICAgICBwcml2YXRlIGJvb2xlYW4gbURpbVNjcmVlbiA9IHRydWU7CiAgICAgcHJpdmF0ZSBsb25nIG1OZXh0VGltZW91dDsKICAgICBwcml2YXRlIHZvbGF0aWxlIGludCBtUG9rZXkgPSAwOwpAQCAtNTM2LDYgKzU0Niw3IEBACiAgICAgICAgICAgICAgICAgICAgIHdsLm1pblN0YXRlID0gU0NSRUVOX0RJTTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBQb3dlck1hbmFnZXIuUEFSVElBTF9XQUtFX0xPQ0s6CisgICAgICAgICAgICAgICAgY2FzZSBQb3dlck1hbmFnZXIuUFJPWElNSVRZX1NDUkVFTl9PRkZfV0FLRV9MT0NLOgogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICAvLyBqdXN0IGxvZyBhbmQgYmFpbC4gIHdlJ3JlIGluIHRoZSBzZXJ2ZXIsIHNvIGRvbid0CkBAIC01ODMsNiArNTk0LDExIEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgUG93ZXIuYWNxdWlyZVdha2VMb2NrKFBvd2VyLlBBUlRJQUxfV0FLRV9MT0NLLFBBUlRJQUxfTkFNRSk7CisgICAgICAgIH0gZWxzZSBpZiAoKGZsYWdzICYgTE9DS19NQVNLKSA9PSBQb3dlck1hbmFnZXIuUFJPWElNSVRZX1NDUkVFTl9PRkZfV0FLRV9MT0NLKSB7CisgICAgICAgICAgICBtUHJveGltaXR5Q291bnQrKzsKKyAgICAgICAgICAgIGlmIChtUHJveGltaXR5Q291bnQgPT0gMSkgeworICAgICAgICAgICAgICAgIGVuYWJsZVByb3hpbWl0eUxvY2tMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBpZiAobmV3bG9jaykgewogICAgICAgICAgICAgYWNxdWlyZVVpZCA9IHdsLnVpZDsKQEAgLTYzOSw2ICs2NTUsMTEgQEAKICAgICAgICAgICAgICAgICBpZiAoTE9HX1BBUlRJQUxfV0wpIEV2ZW50TG9nLndyaXRlRXZlbnQoTE9HX1BPV0VSX1BBUlRJQUxfV0FLRV9TVEFURSwgMCwgd2wudGFnKTsKICAgICAgICAgICAgICAgICBQb3dlci5yZWxlYXNlV2FrZUxvY2soUEFSVElBTF9OQU1FKTsKICAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmICgod2wuZmxhZ3MgJiBMT0NLX01BU0spID09IFBvd2VyTWFuYWdlci5QUk9YSU1JVFlfU0NSRUVOX09GRl9XQUtFX0xPQ0spIHsKKyAgICAgICAgICAgIG1Qcm94aW1pdHlDb3VudC0tOworICAgICAgICAgICAgaWYgKG1Qcm94aW1pdHlDb3VudCA9PSAwKSB7CisgICAgICAgICAgICAgICAgZGlzYWJsZVByb3hpbWl0eUxvY2tMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICAvLyBVbmxpbmsgdGhlIGxvY2sgZnJvbSB0aGUgYmluZGVyLgogICAgICAgICB3bC5iaW5kZXIudW5saW5rVG9EZWF0aCh3bCwgMCk7CkBAIC03NDUsMTUgKzc2NiwxNyBAQAogICAgICAgICBzd2l0Y2ggKHR5cGUpCiAgICAgICAgIHsKICAgICAgICAgICAgIGNhc2UgUG93ZXJNYW5hZ2VyLkZVTExfV0FLRV9MT0NLOgotICAgICAgICAgICAgICAgIHJldHVybiAiRlVMTF9XQUtFX0xPQ0sgICAgICAgICAiOworICAgICAgICAgICAgICAgIHJldHVybiAiRlVMTF9XQUtFX0xPQ0sgICAgICAgICAgICAgICAgIjsKICAgICAgICAgICAgIGNhc2UgUG93ZXJNYW5hZ2VyLlNDUkVFTl9CUklHSFRfV0FLRV9MT0NLOgotICAgICAgICAgICAgICAgIHJldHVybiAiU0NSRUVOX0JSSUdIVF9XQUtFX0xPQ0siOworICAgICAgICAgICAgICAgIHJldHVybiAiU0NSRUVOX0JSSUdIVF9XQUtFX0xPQ0sgICAgICAgIjsKICAgICAgICAgICAgIGNhc2UgUG93ZXJNYW5hZ2VyLlNDUkVFTl9ESU1fV0FLRV9MT0NLOgotICAgICAgICAgICAgICAgIHJldHVybiAiU0NSRUVOX0RJTV9XQUtFX0xPQ0sgICAiOworICAgICAgICAgICAgICAgIHJldHVybiAiU0NSRUVOX0RJTV9XQUtFX0xPQ0sgICAgICAgICAgIjsKICAgICAgICAgICAgIGNhc2UgUG93ZXJNYW5hZ2VyLlBBUlRJQUxfV0FLRV9MT0NLOgotICAgICAgICAgICAgICAgIHJldHVybiAiUEFSVElBTF9XQUtFX0xPQ0sgICAgICAiOworICAgICAgICAgICAgICAgIHJldHVybiAiUEFSVElBTF9XQUtFX0xPQ0sgICAgICAgICAgICAgIjsKKyAgICAgICAgICAgIGNhc2UgUG93ZXJNYW5hZ2VyLlBST1hJTUlUWV9TQ1JFRU5fT0ZGX1dBS0VfTE9DSzoKKyAgICAgICAgICAgICAgICByZXR1cm4gIlBST1hJTUlUWV9TQ1JFRU5fT0ZGX1dBS0VfTE9DSyI7CiAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIHJldHVybiAiPz8/ICAgICAgICAgICAgICAgICAgICAiOworICAgICAgICAgICAgICAgIHJldHVybiAiPz8/ICAgICAgICAgICAgICAgICAgICAgICAgICAgIjsKICAgICAgICAgfQogICAgIH0KIApAQCAtOTI2LDYgKzk0OSw5IEBACiAKICAgICBwcml2YXRlIHZvaWQgc2VuZE5vdGlmaWNhdGlvbkxvY2tlZChib29sZWFuIG9uLCBpbnQgd2h5KQogICAgIHsKKyAgICAgICAgaWYgKG1Qcm94aW1pdHlTZW5zb3JBY3RpdmUpIHsKKyAgICAgICAgICAgIHdoeSA9IFdpbmRvd01hbmFnZXJQb2xpY3kuT0ZGX0JFQ0FVU0VfT0ZfUFJPWElNSVRZX1NFTlNPUjsKKyAgICAgICAgfQogICAgICAgICBpZiAoIW9uKSB7CiAgICAgICAgICAgICBtU3RpbGxOZWVkU2xlZXBOb3RpZmljYXRpb24gPSBmYWxzZTsKICAgICAgICAgfQpAQCAtMTIzMCw2ICsxMjU2LDEwIEBACiAgICAgICAgICAgICBpZiAobm9DaGFuZ2VMaWdodHMpIHsKICAgICAgICAgICAgICAgICBuZXdTdGF0ZSA9IChuZXdTdGF0ZSAmIH5MSUdIVFNfTUFTSykgfCAobVBvd2VyU3RhdGUgJiBMSUdIVFNfTUFTSyk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVByb3hpbWl0eVNlbnNvckFjdGl2ZSkgeworICAgICAgICAgICAgICAgIC8vIGRvbid0IHR1cm4gb24gdGhlIHNjcmVlbiB3aGVuIHRoZSBwcm94aW1pdHkgc2Vuc29yIGxvY2sgaXMgaGVsZAorICAgICAgICAgICAgICAgIG5ld1N0YXRlID0gKG5ld1N0YXRlICYgflNDUkVFTl9CUklHSFQpOworICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoYmF0dGVyeUlzTG93KCkpIHsKICAgICAgICAgICAgICAgICBuZXdTdGF0ZSB8PSBCQVRURVJZX0xPV19CSVQ7CkBAIC0xNzI2LDExICsxNzU2LDEzIEBACiAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAidXNlckFjdGl2aXR5IG1MYXN0RXZlbnRUaW1lPSIgKyBtTGFzdEV2ZW50VGltZSArICIgdGltZT0iICsgdGltZQogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1Vc2VyQWN0aXZpdHlBbGxvd2VkPSIgKyBtVXNlckFjdGl2aXR5QWxsb3dlZAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1Vc2VyU3RhdGU9MHgiICsgSW50ZWdlci50b0hleFN0cmluZyhtVXNlclN0YXRlKQotICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1XYWtlTG9ja1N0YXRlPTB4IiArIEludGVnZXIudG9IZXhTdHJpbmcobVdha2VMb2NrU3RhdGUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtV2FrZUxvY2tTdGF0ZT0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKG1XYWtlTG9ja1N0YXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1Qcm94aW1pdHlTZW5zb3JBY3RpdmU9IiArIG1Qcm94aW1pdHlTZW5zb3JBY3RpdmUKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBmb3JjZT0iICsgZm9yY2UpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKG1MYXN0RXZlbnRUaW1lIDw9IHRpbWUgfHwgZm9yY2UpIHsKICAgICAgICAgICAgICAgICBtTGFzdEV2ZW50VGltZSA9IHRpbWU7Ci0gICAgICAgICAgICAgICAgaWYgKG1Vc2VyQWN0aXZpdHlBbGxvd2VkIHx8IGZvcmNlKSB7CisgICAgICAgICAgICAgICAgaWYgKChtVXNlckFjdGl2aXR5QWxsb3dlZCAmJiAhbVByb3hpbWl0eVNlbnNvckFjdGl2ZSkgfHwgZm9yY2UpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gT25seSB0dXJuIG9uIGJ1dHRvbiBiYWNrbGlnaHRzIGlmIGEgYnV0dG9uIHdhcyBwcmVzc2VkLgogICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnRUeXBlID09IEJVVFRPTl9FVkVOVCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVVzZXJTdGF0ZSA9IChtS2V5Ym9hcmRWaXNpYmxlID8gQUxMX0JSSUdIVCA6IFNDUkVFTl9CVVRUT05fQlJJR0hUKTsKQEAgLTE5OTYsNCArMjAyOCw3MCBAQAogICAgIHB1YmxpYyB2b2lkIG1vbml0b3IoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2tzKSB7IH0KICAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFN1cHBvcnRlZFdha2VMb2NrRmxhZ3MoKSB7CisgICAgICAgIGludCByZXN1bHQgPSBQb3dlck1hbmFnZXIuUEFSVElBTF9XQUtFX0xPQ0sKKyAgICAgICAgICAgICAgICAgICB8IFBvd2VyTWFuYWdlci5GVUxMX1dBS0VfTE9DSworICAgICAgICAgICAgICAgICAgIHwgUG93ZXJNYW5hZ2VyLlNDUkVFTl9ESU1fV0FLRV9MT0NLOworCisgICAgICAgIC8vIGNhbGwgZ2V0U2Vuc29yTWFuYWdlcigpIHRvIG1ha2Ugc3VyZSBtUHJveGltaXR5U2Vuc29yIGlzIGluaXRpYWxpemVkCisgICAgICAgIGdldFNlbnNvck1hbmFnZXIoKTsKKyAgICAgICAgaWYgKG1Qcm94aW1pdHlTZW5zb3IgIT0gbnVsbCkgeworICAgICAgICAgICAgcmVzdWx0IHw9IFBvd2VyTWFuYWdlci5QUk9YSU1JVFlfU0NSRUVOX09GRl9XQUtFX0xPQ0s7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHByaXZhdGUgU2Vuc29yTWFuYWdlciBnZXRTZW5zb3JNYW5hZ2VyKCkgeworICAgICAgICBpZiAobVNlbnNvck1hbmFnZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgbVNlbnNvck1hbmFnZXIgPSBuZXcgU2Vuc29yTWFuYWdlcihtSGFuZGxlclRocmVhZC5nZXRMb29wZXIoKSk7CisgICAgICAgICAgICBtUHJveGltaXR5U2Vuc29yID0gbVNlbnNvck1hbmFnZXIuZ2V0RGVmYXVsdFNlbnNvcihTZW5zb3IuVFlQRV9QUk9YSU1JVFkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtU2Vuc29yTWFuYWdlcjsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZW5hYmxlUHJveGltaXR5TG9ja0xvY2tlZCgpIHsKKyAgICAgICAgaWYgKG1TcGV3KSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJlbmFibGVQcm94aW1pdHlMb2NrTG9ja2VkIik7CisgICAgICAgIH0KKyAgICAgICAgbVNlbnNvck1hbmFnZXIucmVnaXN0ZXJMaXN0ZW5lcih0aGlzLCBtUHJveGltaXR5U2Vuc29yLCBTZW5zb3JNYW5hZ2VyLlNFTlNPUl9ERUxBWV9OT1JNQUwpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBkaXNhYmxlUHJveGltaXR5TG9ja0xvY2tlZCgpIHsKKyAgICAgICAgaWYgKG1TcGV3KSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJkaXNhYmxlUHJveGltaXR5TG9ja0xvY2tlZCIpOworICAgICAgICB9CisgICAgICAgIG1TZW5zb3JNYW5hZ2VyLnVucmVnaXN0ZXJMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbVByb3hpbWl0eVNlbnNvckFjdGl2ZSA9IGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uU2Vuc29yQ2hhbmdlZChTZW5zb3JFdmVudCBldmVudCkgeworICAgICAgICBsb25nIG1pbGxpc2Vjb25kcyA9IGV2ZW50LnRpbWVzdGFtcCAvIDEwMDAwMDA7CisgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2tzKSB7CisgICAgICAgICAgICBpZiAoZXZlbnQudmFsdWVzWzBdID09IDAuMCkgeworICAgICAgICAgICAgICAgIGlmIChtU3BldykgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJvblNlbnNvckNoYW5nZWQ6IHByb3hpbWl0eSBhY3RpdmUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZ29Ub1NsZWVwTG9ja2VkKG1pbGxpc2Vjb25kcyk7CisgICAgICAgICAgICAgICAgbVByb3hpbWl0eVNlbnNvckFjdGl2ZSA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8v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2VlZjM5Zi4uNGRmZWI5ZCAxMDA2NDQKLS0tIGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvU2Vuc29yU2VydmljZS5qYXZhCisrKyBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL1NlbnNvclNlcnZpY2UuamF2YQpAQCAtODQsMTIgKzg0LDE2IEBACiAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNTZW5zb3Ioc2Vuc29yKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlU2Vuc29yKHNlbnNvcik7CiAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYWN0aXZhdGVJZlVudXNlZChzZW5zb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYWN0aXZhdGVJZlVudXNlZExvY2tlZChzZW5zb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJSZW1vdGVFeGNlcHRpb24gaW4gYmluZGVyRGllZCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtTGlzdGVuZXJzLnNpemUoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIF9zZW5zb3JzX2NvbnRyb2xfd2FrZSgpOworICAgICAgICAgICAgICAgICAgICBfc2Vuc29yc19jb250cm9sX2Nsb3NlKCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1MaXN0ZW5lcnMubm90aWZ5KCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTEwMiw5ICsxMDYsMTIgQEAKICAgICB9CiAgICAgCiAgICAgcHVibGljIEJ1bmRsZSBnZXREYXRhQ2hhbm5lbCgpIHRocm93cyBSZW1vdGVFeGNlcHRpb24gewotICAgICAgICByZXR1cm4gX3NlbnNvcnNfY29udHJvbF9vcGVuKCk7CisgICAgICAgIC8vIHN5bmNocm9uaXplIHNvIHdlIGRvIG5vdCByZXF1aXJlIHNlbnNvciBIQUwgdG8gYmUgdGhyZWFkLXNhZmUuCisgICAgICAgIHN5bmNocm9uaXplZChtTGlzdGVuZXJzKSB7CisgICAgICAgICAgICByZXR1cm4gX3NlbnNvcnNfY29udHJvbF9vcGVuKCk7CisgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgYm9vbGVhbiBlbmFibGVTZW5zb3IoSUJpbmRlciBiaW5kZXIsIFN0cmluZyBuYW1lLCBpbnQgc2Vuc29yLCBpbnQgZW5hYmxlKQogICAgICAgICAgICAgIHRocm93cyBSZW1vdGVFeGNlcHRpb24gewogICAgICAgICBpZiAobG9jYWxMT0dWKSBMb2cuZChUQUcsICJlbmFibGVTZW5zb3IgIiArIG5hbWUgKyAiKCMiICsgc2Vuc29yICsgIikgIiArIGVuYWJsZSk7CkBAIC0xNjMsNyArMTcwLDcgQEAKICAgICAgICAgICAgICAgICBsLmFkZFNlbnNvcihzZW5zb3IsIGVuYWJsZSk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGwucmVtb3ZlU2Vuc29yKHNlbnNvcik7Ci0gICAgICAgICAgICAgICAgZGVhY3RpdmF0ZUlmVW51c2VkKHNlbnNvcik7CisgICAgICAgICAgICAgICAgZGVhY3RpdmF0ZUlmVW51c2VkTG9ja2VkKHNlbnNvcik7CiAgICAgICAgICAgICAgICAgaWYgKGwubVNlbnNvcnMgPT0gMCkgewogICAgICAgICAgICAgICAgICAgICBtTGlzdGVuZXJzLnJlbW92ZShsKTsKICAgICAgICAgICAgICAgICAgICAgYmluZGVyLnVubGlua1RvRGVhdGgobCwgMCk7CkBAIC0xNzMsMTIgKzE4MCwxMyBAQAogICAgICAgICAgIC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gbnVsbDsKICAgICAgICAgSVBhY2thZ2VNYW5hZ2VyIHBtID0gbnVsbDsKICAgICAgICAgQ29udGV4dCBjb250ZXh0ID0gbnVsbDsKICAgICAgICAgV2luZG93TWFuYWdlclNlcnZpY2Ugd20gPSBudWxsOwotICAgICAgICBCbHVldG9vdGhEZXZpY2VTZXJ2aWNlIGJsdWV0b290aCA9IG51bGw7CisgICAgICAgIEJsdWV0b290aFNlcnZpY2UgYmx1ZXRvb3RoID0gbnVsbDsKICAgICAgICAgQmx1ZXRvb3RoQTJkcFNlcnZpY2UgYmx1ZXRvb3RoQTJkcCA9IG51bGw7CiAgICAgICAgIEhlYWRzZXRPYnNlcnZlciBoZWFkc2V0ID0gbnVsbDsKKyAgICAgICAgRG9ja09ic2VydmVyIGRvY2sgPSBudWxsOwogCiAgICAgICAgIC8vIENyaXRpY2FsIHNlcnZpY2VzLi4uCiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBFbnRyb3B5IFNlcnZpY2UuIik7CisgICAgICAgICAgICBMb2cuaShUQUcsICJFbnRyb3B5IFNlcnZpY2UiKTsKICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoImVudHJvcHkiLCBuZXcgRW50cm9weVNlcnZpY2UoKSk7CiAKLSAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIFBvd2VyIE1hbmFnZXIuIik7CisgICAgICAgICAgICBMb2cuaShUQUcsICJQb3dlciBNYW5hZ2VyIik7CiAgICAgICAgICAgICBwb3dlciA9IG5ldyBQb3dlck1hbmFnZXJTZXJ2aWNlKCk7CiAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuUE9XRVJfU0VSVklDRSwgcG93ZXIpOwogCi0gICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBBY3Rpdml0eSBNYW5hZ2VyLiIpOworICAgICAgICAgICAgTG9nLmkoVEFHLCAiQWN0aXZpdHkgTWFuYWdlciIpOwogICAgICAgICAgICAgY29udGV4dCA9IEFjdGl2aXR5TWFuYWdlclNlcnZpY2UubWFpbihmYWN0b3J5VGVzdCk7CiAKLSAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIHRlbGVwaG9ueSByZWdpc3RyeSIpOworICAgICAgICAgICAgTG9nLmkoVEFHLCAiVGVsZXBob255IFJlZ2lzdHJ5Iik7CiAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKCJ0ZWxlcGhvbnkucmVnaXN0cnkiLCBuZXcgVGVsZXBob255UmVnaXN0cnkoY29udGV4dCkpOwogCiAgICAgICAgICAgICBBdHRyaWJ1dGVDYWNoZS5pbml0KGNvbnRleHQpOwogCi0gICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBQYWNrYWdlIE1hbmFnZXIuIik7CisgICAgICAgICAgICBMb2cuaShUQUcsICJQYWNrYWdlIE1hbmFnZXIiKTsKICAgICAgICAgICAgIHBtID0gUGFja2FnZU1hbmFnZXJTZXJ2aWNlLm1haW4oY29udGV4dCwKICAgICAgICAgICAgICAgICAgICAgZmFjdG9yeVRlc3QgIT0gU3lzdGVtU2VydmVyLkZBQ1RPUllfVEVTVF9PRkYpOwogCkBAIC0xMTYsMTggKzExOSwyNiBAQAogCiAgICAgICAgICAgICBtQ29udGVudFJlc29sdmVyID0gY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKTsKIAotICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgQ29udGVudCBNYW5hZ2VyLiIpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJBY2NvdW50IE1hbmFnZXIiKTsKKyAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuQUNDT1VOVF9TRVJWSUNFLAorICAgICAgICAgICAg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29lcyBmaXJzdAotICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgU2Vuc29yIFNlcnZpY2UuIik7CisgICAgICAgICAgICBMb2cuaShUQUcsICJTZW5zb3IgU2VydmljZSIpOwogICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0LlNFTlNPUl9TRVJWSUNFLCBuZXcgU2Vuc29yU2VydmljZShjb250ZXh0KSk7CiAKLSAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIFdpbmRvdyBNYW5hZ2VyLiIpOworICAgICAgICAgICAgTG9nLmkoVEFHLCAiV2luZG93IE1hbmFnZXIiKTsKICAgICAgICAgICAgIHdtID0gV2luZG93TWFuYWdlclNlcnZpY2UubWFpbihjb250ZXh0LCBwb3dlciwKICAgICAgICAgICAgICAgICAgICAgZmFjdG9yeVRlc3QgIT0gU3lzdGVtU2VydmVyLkZBQ1RPUllfVEVTVF9MT1dfTEVWRUwpOwogICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0LldJTkRPV19TRVJWSUNFLCB3bSk7CkBAIC0xNjQsMTEgKzE3NiwxMSBAQAogICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlJlZ2lzdGVyaW5nIG51bGwgQmx1ZXRvb3RoIFNlcnZpY2UgKGZhY3RvcnkgdGVzdCkiKTsKICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuQkxVRVRPT1RIX1NFUlZJQ0UsIG51bGwpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBCbHVldG9vdGggU2VydmljZS4iKTsKLSAgICAgICAgICAgICAgICBibHVldG9vdGggPSBuZXcgQmx1ZXRvb3RoRGV2aWNlU2VydmljZShjb250ZXh0KTsKLSAgICAgICAgICAgICAgICBibHVldG9vdGguaW5pdCgpOworICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkJsdWV0b290aCBTZXJ2aWNlIik7CisgICAgICAgICAgICAgICAgYmx1ZXRvb3RoID0gbmV3IEJsdWV0b290aFNlcnZpY2UoY29udGV4dCk7CiAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0LkJMVUVUT09USF9TRVJWSUNFLCBibHVldG9vdGgpOwotICAgICAgICAgICAgICAgIGJsdWV0b290aEEyZHAgPSBuZXcgQmx1ZXRvb3RoQTJkcFNlcnZpY2UoY29udGV4dCk7CisgICAgICAgICAgICAgICAgYmx1ZXRvb3RoLmluaXRBZnRlclJlZ2lzdHJhdGlvbigpOworICAgICAgICAgICAgICAgIGJsdWV0b290aEEyZHAgPSBuZXcgQmx1ZXRvb3RoQTJkcFNlcnZpY2UoY29udGV4dCwgYmx1ZXRvb3RoKTsKICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKEJsdWV0b290aEEyZHBTZXJ2aWNlLkJMVUVUT09USF9BMkRQX1NFUlZJQ0UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVldG9vdGhBMmRwKTsKIApAQCAtMTg3LDEwICsxOTksMTEgQEAKICAgICAgICAgSW5wdXRNZXRob2RNYW5hZ2VyU2VydmljZSBpbW0gPSBudWxsOwogICAgICAgICBBcHBXaWRnZXRTZXJ2aWNlIGFwcFdpZGdldCA9IG51bGw7CiAgICAgICAgIE5vdGlmaWNhdGlvbk1hbmFnZXJTZXJ2aWNlIG5vdGlmaWNhdGlvbiA9IG51bGw7CisgICAgICAgIFdhbGxwYXBlck1hbmFnZXJTZXJ2aWNlIHdhbGxwYXBlciA9IG51bGw7CiAKICAgICAgICAgaWYgKGZhY3RvcnlUZXN0ICE9IFN5c3RlbVNlcnZlci5GQUNUT1JZX1RFU1RfTE9XX0xFVkVMKSB7CiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIFN0YXR1cyBCYXIgU2VydmljZS4iKTsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJTdGF0dXMgQmFyIik7CiAgICAgICAgICAgICAgICAgc3RhdHVzQmFyID0gbmV3IFN0YXR1c0JhclNlcnZpY2UoY29udGV4dCk7CiAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZSgic3RhdHVzYmFyIiwgc3RhdHVzQmFyKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7CkBAIC0xOTgsMTQgKzIxMSwxNCBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIENsaXBib2FyZCBTZXJ2aWNlLiIpOworICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkNsaXBib2FyZCBTZXJ2aWNlIik7CiAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZSgiY2xpcGJvYXJkIiwgbmV3IENsaXBib2FyZFNlcnZpY2UoY29udGV4dCkpOwogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIENsaXBib2FyZCBTZXJ2aWNlIiwgZSk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgSW5wdXQgTWV0aG9kIFNlcnZpY2UuIik7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiSW5wdXQgTWV0aG9kIFNlcnZpY2UiKTsKICAgICAgICAgICAgICAgICBpbW0gPSBuZXcgSW5wdXRNZXRob2RNYW5hZ2VyU2VydmljZShjb250ZXh0LCBzdGF0dXNCYXIpOwogICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoQ29udGV4dC5JTlBVVF9NRVRIT0RfU0VSVklDRSwgaW1tKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7CkBAIC0yMTMsMjIgKzIyNiwyMiBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIE5ldFN0YXQgU2VydmljZS4iKTsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJOZXRTdGF0IFNlcnZpY2UiKTsKICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKCJuZXRzdGF0IiwgbmV3IE5ldFN0YXRTZXJ2aWNlKGNvbnRleHQpKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7CiAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRmFpbHVyZSBzdGFydGluZyBOZXRTdGF0IFNlcnZpY2UiLCBlKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBDb25uZWN0aXZpdHkgU2VydmljZS4iKTsKLSAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuQ09OTkVDVElWSVRZX1NFUlZJQ0UsCi0gICAgICAgICAgICAgICAgICAgICAgICBDb25uZWN0aXZpdHlTZXJ2aWNlLmdldEluc3RhbmNlKGNvbnRleHQpKTsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJDb25uZWN0aXZpdHkgU2VydmljZSIpOworICAgICAgICAgICAgICAgIGNvbm5lY3Rpdml0eSA9IENvbm5lY3Rpdml0eVNlcnZpY2UuZ2V0SW5zdGFuY2UoY29udGV4dCk7CisgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0LkNPTk5FQ1RJVklUWV9TRVJWSUNFLCBjb25uZWN0aXZpdHkpOwogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIENvbm5lY3Rpdml0eSBTZXJ2aWNlIiwgZSk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIEFjY2Vzc2liaWxpdHkgTWFuYWdlci4iKTsKKyAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiQWNjZXNzaWJpbGl0eSBNYW5hZ2VyIik7CiAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoQ29udGV4dC5BQ0NFU1NJQklMSVRZX1NFUlZJQ0UsCiAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFjY2Vzc2liaWxpdHlNYW5hZ2VyU2VydmljZShjb250ZXh0KSk7CiAgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgewpAQCAtMjM2LDcgKzI0OSw3IEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgTm90aWZpY2F0aW9uIE1hbmFnZXIuIik7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiTm90aWZpY2F0aW9uIE1hbmFnZXIiKTsKICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24gPSBuZXcgTm90aWZpY2F0aW9uTWFuYWdlclNlcnZpY2UoY29udGV4dCwgc3RhdHVzQmFyLCBoYXJkd2FyZSk7CiAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0Lk5PVElGSUNBVElPTl9TRVJWSUNFLCBub3RpZmljYXRpb24pOwogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKQEAgLTI0NSwxNCArMjU4LDE0IEBACiAKICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgLy8gTW91bnRTZXJ2aWNlIG11c3Qgc3RhcnQgYWZ0ZXIgTm90aWZpY2F0aW9uTWFuYWdlclNlcnZpY2UKLSAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBNb3VudCBTZXJ2aWNlLiIpOworICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIk1vdW50IFNlcnZpY2UiKTsKICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKCJtb3VudCIsIG5ldyBNb3VudFNlcnZpY2UoY29udGV4dCkpOwogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIE1vdW50IFNlcnZpY2UiLCBlKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBEZXZpY2VTdG9yYWdlTW9uaXRvciBzZXJ2aWNlIik7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiRGV2aWNlIFN0b3JhZ2UgTW9uaXRvciIpOwogICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoRGV2aWNlU3RvcmFnZU1vbml0b3JTZXJ2aWNlLlNFUlZJQ0UsCiAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgRGV2aWNlU3RvcmFnZU1vbml0b3JTZXJ2aWNlKGNvbnRleHQpKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7CkBAIC0yNjAsMTQgKzI3MywxNCBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIExvY2F0aW9uIE1hbmFnZXIuIik7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiTG9jYXRpb24gTWFuYWdlciIpOwogICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoQ29udGV4dC5MT0NBVElPTl9TRVJWSUNFLCBuZXcgTG9jYXRpb25NYW5hZ2VyU2VydmljZShjb250ZXh0KSk7CiAgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgewogICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWx1cmUgc3RhcnRpbmcgTG9jYXRpb24gTWFuYWdlciIsIGUpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIFNlYXJjaCBTZXJ2aWNlLiIpOworICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlNlYXJjaCBTZXJ2aWNlIik7CiAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZSggQ29udGV4dC5TRUFSQ0hfU0VSVklDRSwgbmV3IFNlYXJjaE1hbmFnZXJTZXJ2aWNlKGNvbnRleHQpICk7CiAgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgewogICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWx1cmUgc3RhcnRpbmcgU2VhcmNoIFNlcnZpY2UiLCBlKTsKQEAgLTI3OSw3ICsyOTIsNyBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0YXJ0aW5nIENoZWNraW4gU2VydmljZS4iKTsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJDaGVja2luIFNlcnZpY2UiKTsKICAgICAgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCgpLnNldENvbXBvbmVudChuZXcgQ29tcG9uZW50TmFtZSgKICAgICAgICAgICAgICAgICAgICAgICAgICJjb20uZ29vZ2xlLmFuZHJvaWQuc2VydmVyLmNoZWNraW4iLAogICAgICAgICAgICAgICAgICAgICAgICAgImNvbS5nb29nbGUuYW5kcm9pZC5zZXJ2ZXIuY2hlY2tpbi5DaGVja2luU2VydmljZSIpKTsKQEAgLTI5MiwyMSArMzA1LDIyIEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgV2FsbHBhcGVyIFNlcnZpY2UiKTsKLSAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuV0FMTFBBUEVSX1NFUlZJQ0UsIG5ldyBXYWxscGFwZXJTZXJ2aWNlKGNvbnRleHQpKTsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJXYWxscGFwZXIgU2VydmljZSIpOworICAgICAgICAgICAgICAgIHdhbGxwYXBlciA9IG5ldyBXYWxscGFwZXJNYW5hZ2VyU2VydmljZShjb250ZXh0KTsKKyAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuV0FMTFBBUEVSX1NFUlZJQ0UsIHdhbGxwYXBlcik7CiAgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgewogICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkZhaWx1cmUgc3RhcnRpbmcgV2FsbHBhcGVyIFNlcnZpY2UiLCBlKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJTdGFydGluZyBBdWRpbyBTZXJ2aWNlIik7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiQXVkaW8gU2VydmljZSIpOwogICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoQ29udGV4dC5BVURJT19TRVJWSUNFLCBuZXcgQXVkaW9TZXJ2aWNlKGNvbnRleHQpKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7CiAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiRmFpbHVyZSBzdGFydGluZyBBdWRpbyBTZXJ2aWNlIiwgZSk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgSGVhZHNldE9ic2VydmVyIik7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiSGVhZHNldCBPYnNlcnZlciIpOwogICAgICAgICAgICAgICAgIC8vIExpc3RlbiBmb3Igd2lyZWQgaGVhZHNldCBjaGFuZ2VzCiAgICAgICAgICAgICAgICAgaGVhZHNldCA9IG5ldyBIZWFkc2V0T2JzZXJ2ZXIoY29udGV4dCk7CiAgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgewpAQCAtMzE0LDE2ICszMjgsMjIgQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBpZiAoSU5DTFVERV9CQUNLVVApIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgQmFja3VwIFNlcnZpY2UiKTsKLSAgICAgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0LkJBQ0tVUF9TRVJWSUNFLCBuZXcgQmFja3VwTWFuYWdlclNlcnZpY2UoY29udGV4dCkpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJEb2NrIE9ic2VydmVyIik7CisgICAgICAgICAgICAgICAgLy8gTGlzdGVuIGZvciBkb2NrIHN0YXRpb24gY2hhbmdlcworICAgICAgICAgICAgICAgIGRvY2sgPSBuZXcgRG9ja09ic2VydmVyKGNvbnRleHQpOworICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIERvY2tPYnNlcnZlciIsIGUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkJhY2t1cCBTZXJ2aWNlIik7CisgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuYWRkU2VydmljZShDb250ZXh0LkJBQ0tVUF9TRVJWSUNFLCBuZXcgQmFja3VwTWFuYWdlclNlcnZpY2UoY29udGV4dCkpOwogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIEJhY2t1cCBTZXJ2aWNlIiwgZSk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiU3RhcnRpbmcgQXBwV2lkZ2V0IFNlcnZpY2UiKTsKKyAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJBcHBXaWRnZXQgU2VydmljZSIpOwogICAgICAgICAgICAgICAgIGFwcFdpZGdldCA9IG5ldyBBcHBXaWRnZXRTZXJ2aWNlKGNvbnRleHQpOwogICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoQ29udGV4dC5BUFBXSURHRVRfU0VSVklDRSwgYXBwV2lkZ2V0KTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7CkBAIC0zNDYsNyArMzY2LDcgQEAKICAgICAgICAgICAgICAgICBmYWxzZSwgbmV3IEFkYlNldHRpbmdzT2JzZXJ2ZXIoKSk7CiAKICAgICAgICAgLy8gSXQgaXMgbm93IHRpbWUgdG8g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AgICAgICAgICAuc3lzdGVtUmVhZHkobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIk1ha2luZyBzZXJ2aWNlcyByZWFkeSIpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChiYXR0ZXJ5RiAhPSBudWxsKSBiYXR0ZXJ5Ri5zeXN0ZW1SZWFkeSgpOworICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aXZpdHlGICE9IG51bGwpIGNvbm5lY3Rpdml0eUYuc3lzdGVtUmVhZHkoKTsKKyAgICAgICAgICAgICAgICBpZiAoZG9ja0YgIT0gbnVsbCkgZG9ja0Yuc3lzdGVtUmVhZHkoKTsKKyAgICAgICAgICAgICAgICBXYXRjaGRvZy5nZXRJbnN0YW5jZSgpLnN0YXJ0KCk7CiAKLSAgICAgICAgV2F0Y2hkb2cuZ2V0SW5zdGFuY2UoKS5zdGFydCgpOwotCisgICAgICAgICAgICAgICAgLy8gSXQgaXMgbm93IG9rYXkgdG8gbGV0IHRoZSB2YXJpb3VzIHN5c3RlbSBzZXJ2aWNlcyBzdGFydCB0aGVpcgorICAgICAgICAgICAgICAgIC8vIHRoaXJkIHBhcnR5IGNvZGUuLi4KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoYXBwV2lkZ2V0RiAhPSBudWxsKSBhcHBXaWRnZXRGLnN5c3RlbVJlYWR5KHNhZmVNb2RlKTsKKyAgICAgICAgICAgICAgICBpZiAod2FsbHBhcGVyRiAhPSBudWxsKSB3YWxscGFwZXJGLnN5c3RlbVJlYWR5KCk7CisgICAgICAgICAgICAgICAgaWYgKGltbUYgIT0gbnVsbCkgaW1tRi5zeXN0ZW1SZWFkeSgpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgCiAgICAgICAgIExvb3Blci5sb29wKCk7CiAgICAgICAgIExvZy5kKFRBRyw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OwogICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uUmVhc29uID0gcmVhc29uOwogICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uQXBuID0gYXBuOworICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uQXBuVHlwZXMgPSBhcG5UeXBlczsKICAgICAgICAgICAgIG1EYXRhQ29ubmVjdGlvbkludGVyZmFjZU5hbWUgPSBpbnRlcmZhY2VOYW1lOwogICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1SZWNvcmRzLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgICAgICAgICAgUmVjb3JkIHIgPSBtUmVjb3Jkcy5nZXQoaSk7CkBAIC0zNTksNyArMzYyLDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBicm9hZGNhc3REYXRhQ29ubmVjdGlvblN0YXRlQ2hhbmdlZChzdGF0ZSwgaXNEYXRhQ29ubmVjdGl2aXR5UG9zc2libGUsIHJlYXNvbiwgYXBuLAotICAgICAgICAgICAgICAgIGludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgICAgIGFwblR5cGVzLCBpbnRlcmZhY2VOYW1lKTsKICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCBub3RpZnlEYXRhQ29ubmVjdGlvbkZhaWxlZChTdHJpbmcgcmVhc29uKSB7CkBAIC01MTcsOCArNTIwLDkgQEAKICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQsIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5SRUFEX1BIT05FX1NUQVRFKTsKICAgICB9CiAKLSAgICBwcml2YXRlIHZvaWQgYnJvYWRjYXN0RGF0YUNvbm5lY3Rpb25TdGF0ZUNoYW5nZWQoaW50IHN0YXRlLCBib29sZWFuIGlzRGF0YUNvbm5lY3Rpdml0eVBvc3NpYmxlLAotICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiwgU3RyaW5nIGFwbiwgU3Rya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GV2ZXJ5dGltZSB0aGUgd2FsbHBhcGVyIGlzIGNoYW5nZWQuCisgICAgICovCisgICAgcHJpdmF0ZSBmaW5hbCBGaWxlT2JzZXJ2ZXIgbVdhbGxwYXBlck9ic2VydmVyID0gbmV3IEZpbGVPYnNlcnZlcigKKyAgICAgICAgICAgIFdBTExQQVBFUl9ESVIuZ2V0QWJzb2x1dGVQYXRoKCksIENSRUFURSB8IENMT1NFX1dSSVRFIHwgREVMRVRFIHwgREVMRVRFX1NFTEYpIHsKKyAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkV2ZW50KGludCBldmVudCwgU3RyaW5nIHBhdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBhdGggPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNoYW5naW5nIHRoZSB3YWxscGFwZXIgbWVhbnMgd2UnbGwgbmVlZCB0byBiYWNrIHVwIHRoZSBuZXcgb25lCisgICAgICAgICAgICAgICAgICAgICAgICBsb25nIG9yaWdJZCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICAgICAgICAgICAgICAgICAgQmFja3VwTWFuYWdlciBibSA9IG5ldyBCYWNrdXBNYW5hZ2VyKG1Db250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJtLmRhdGFDaGFuZ2VkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShvcmlnSWQpOworCisgICAgICAgICAgICAgICAgICAgICAgICBGaWxlIGNoYW5nZWRGaWxlID0gbmV3IEZpbGUoV0FMTFBBUEVSX0RJUiwgcGF0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoV0FMTFBBUEVSX0ZJTEUuZXF1YWxzKGNoYW5nZWRGaWxlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeUNhbGxiYWNrc0xvY2tlZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAKKyAgICBmaW5hbCBDb250ZXh0IG1Db250ZXh0OworICAgIGZpbmFsIElXaW5kb3dNYW5hZ2VyIG1JV2luZG93TWFuYWdlcjsKKworICAgIGludCBtV2lkdGggPSAtMTsKKyAgICBpbnQgbUhlaWdodCA9IC0xOworICAgIFN0cmluZyBtTmFtZSA9ICIiOworICAgIENvbXBvbmVudE5hbWUgbVdhbGxwYXBlckNvbXBvbmVudDsKKyAgICBXYWxscGFwZXJDb25uZWN0aW9uIG1XYWxscGFwZXJDb25uZWN0aW9uOworICAgIGxvbmcgbUxhc3REaWVkVGltZTsKKyAgICAKKyAgICBjbGFzcyBXYWxscGFwZXJDb25uZWN0aW9uIGV4dGVuZHMgSVdhbGxwYXBlckNvbm5lY3Rpb24uU3R1YgorICAgICAgICAgICAgaW1wbGVtZW50cyBTZXJ2aWNlQ29ubmVjdGlvbiB7CisgICAgICAgIGZpbmFsIFdhbGxwYXBlckluZm8gbUluZm87CisgICAgICAgIGZpbmFsIEJpbmRlciBtVG9rZW4gPSBuZXcgQmluZGVyKCk7CisgICAgICAgIElXYWxscGFwZXJTZXJ2aWNlIG1TZXJ2aWNlOworICAgICAgICBJV2FsbHBhcGVyRW5naW5lIG1FbmdpbmU7CisKKyAgICAgICAgcHVibGljIFdhbGxwYXBlckNvbm5lY3Rpb24oV2FsbHBhcGVySW5mbyBpbmZvKSB7CisgICAgICAgICAgICBtSW5mbyA9IGluZm87CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2VydmljZUNvbm5lY3RlZChDb21wb25lbnROYW1lIG5hbWUsIElCaW5kZXIgc2VydmljZSkgeworICAgICAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyQ29ubmVjdGlvbiA9PSB0aGlzKSB7CisgICAgICAgICAgICAgICAgICAgIG1TZXJ2aWNlID0gSVdhbGxwYXBlclNlcnZpY2UuU3R1Yi5hc0ludGVyZmFjZShzZXJ2aWNlKTsKKyAgICAgICAgICAgICAgICAgICAgYXR0YWNoU2VydmljZUxvY2tlZCh0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gWFhYIHNob3VsZCBwcm9iYWJseSBkbyBzYXZlU2V0dGluZ3NMb2NrZWQoKSBsYXRlcgorICAgICAgICAgICAgICAgICAgICAvLyB3aGVuIHdlIGhhdmUgYW4gZW5naW5lLCBidXQgSSdtIG5vdCBzdXJlIGFib3V0CisgICAgICAgICAgICAgICAgICAgIC8vIGxvY2tpbmcgdGhlcmUgYW5kIGFueXdheSB3ZSBhbHdheXMgbmVlZCB0byBiZSBhYmxlIHRvCisgICAgICAgICAgICAgICAgICAgIC8vIHJlY292ZXIgaWYgdGhlcmUgaXMgc29tZXRoaW5nIHdyb25nLgorICAgICAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblNlcnZpY2VEaXNjb25uZWN0ZWQoQ29tcG9uZW50TmFtZSBuYW1lKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICAgICAgbVNlcnZpY2UgPSBudWxsOworICAgICAgICAgICAgICAgIG1FbmdpbmUgPSBudWxsOworICAgICAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyQ29ubmVjdGlvbiA9PSB0aGlzKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIldhbGxwYXBlciBzZXJ2aWNlIGdvbmU6ICIgKyBtV2FsbHBhcGVyQ29tcG9uZW50KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChtTGFzdERpZWRUaW1lK01JTl9XQUxMUEFQRVJfQ1JBU0hfVElNRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJSZXZlcnRpbmcgdG8gYnVpbHQtaW4gd2FsbHBhcGVyISIpOworICAgICAgICAgICAgICAgICAgICAgICAgYmluZFdhbGxwYXBlckNvbXBvbmVudExvY2tlZChudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIHZvaWQgYXR0YWNoRW5naW5lKElXYWxscGFwZXJFbmdpbmUgZW5naW5lKSB7CisgICAgICAgICAgICBtRW5naW5lID0gZW5naW5lOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgUGFyY2VsRmlsZURlc2NyaXB0b3Igc2V0V2FsbHBhcGVyKFN0cmluZyBuYW1lKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICAgICAgaWYgKG1XYWxscGFwZXJDb25uZWN0aW9uID09IHRoaXMpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZVdhbGxwYXBlckJpdG1hcExvY2tlZChuYW1lKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIFdhbGxwYXBlck1hbmFnZXJTZXJ2aWNlKENvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgIldhbGxwYXBlclNlcnZpY2Ugc3RhcnR1cCIpOworICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CisgICAgICAgIG1JV2luZG93TWFuYWdlciA9IElXaW5kb3dNYW5hZ2VyLlN0dWIuYXNJbnRlcmZhY2UoCisgICAgICAgICAgICAgICAgU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZShDb250ZXh0LldJTkRPV19TRVJWSUNFKSk7CisgICAgICAgIFdBTExQQVBFUl9ESVIubWtkaXJzKCk7CisgICAgICAgIGxvYWRTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICBtV2FsbHBhcGVyT2JzZXJ2ZXIuc3RhcnRXYXRjaGluZygpOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBmaW5hbGl6ZSgpIHRocm93cyBUaHJvd2FibGUgeworICAgICAgICBzdXBlci5maW5hbGl6ZSgpOworICAgICAgICBtV2FsbHBhcGVyT2JzZXJ2ZXIuc3RvcFdhdGNoaW5nKCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHN5c3RlbVJlYWR5KCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGJpbmRXYWxscGFwZXJDb21wb25lbnRMb2NrZWQobVdhbGxwYXBlckNvbXBvbmVudCk7CisgICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIHByZXZpb3VzIHdhbGxwYXBlciIsIGUpOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGJpbmRXYWxscGFwZXJDb21wb25lbnRMb2NrZWQobnVsbCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBlMikgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIGRlZmF1bHQgd2FsbHBhcGVyIiwgZTIpOworICAgICAgICAgICAgICAgICAgICBjbGVhcldhbGxwYXBlckNvbXBvbmVudExvY2tlZCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBjbGVhcldhbGxwYXBlcigpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgRmlsZSBmID0gV0FMTFBBUEVSX0ZJTEU7CisgICAgICAgICAgICBpZiAoZi5leGlzdHMoKSkgeworICAgICAgICAgICAgICAgIGYuZGVsZXRlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmaW5hbCBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGJpbmRXYWxscGFwZXJDb21wb25lbnRMb2NrZWQobnVsbCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldERpbWVuc2lvbkhpbnRzKGludCB3aWR0aCwgaW50IGhlaWdodCkgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIGNoZWNrUGVybWlzc2lvbihhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uU0VUX1dBTExQQVBFUl9ISU5UUyk7CisKKyAgICAgICAgaWYgKHdpZHRoIDw9IDAgfHwgaGVpZ2h0IDw9IDApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIndpZHRoIGFuZCBoZWlnaHQgbXVzdCBiZSA+IDAiKTsKKyAgICAgICAgfQorCisgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgIGlmICh3aWR0aCAhPSBtV2lkdGggfHwgaGVpZ2h0ICE9IG1IZWlnaHQpIHsKKyAgICAgICAgICAgICAgICBtV2lkdGggPSB3aWR0aDsKKyAgICAgICAgICAgICAgICBtSGVpZ2h0ID0gaGVpZ2h0OworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyQ29ubmVjdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyQ29ubmVjdGlvbi5tRW5naW5lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdhbGxwYXBlckNvbm5lY3Rpb24ubUVuZ2luZS5zZXREZXNpcmVkU2l6ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeUNhbGxiYWNrc0xvY2tlZCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRXaWR0aEhpbnQoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgcmV0dXJuIG1XaWR0aDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0SGVpZ2h0SGludCgpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICByZXR1cm4gbUhlaWdodDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBQYXJjZWxGaWxlRGVzY3JpcHRvciBnZXRXYWxscGFwZXIoSVdhbGxwYXBlck1hbmFnZXJDYWxsYmFjayBjYiwKKyAgICAgICAgICAgIEJ1bmRsZSBvdXRQYXJhbXMpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAob3V0UGFyYW1zICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0UGFyYW1zLnB1dEludCgid2lkdGgiLCBtV2lkdGgpOworICAgICAgICAgICAgICAgICAgICBvdXRQYXJhbXMucHV0SW50KCJoZWlnaHQiLCBtSGVpZ2h0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUNhbGxiYWNrcy5yZWdpc3RlcihjYik7CisgICAgICAgICAgICAgICAgRmlsZSBmID0gV0FMTFBBUEVSX0ZJTEU7CisgICAgICAgICAgICAgICAgaWYgKCFmLmV4aXN0cygpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gUGFyY2VsRmlsZURlc2NyaXB0b3Iub3BlbihmLCBNT0RFX1JFQURfT05MWSk7CisgICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8qIFNob3VsZG4ndCBoYXBwZW4gYXMgd2UgY2hlY2sgdG8gc2VlIGlmIHRoZSBmaWxlIGV4aXN0cyAqLworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkVycm9yIGdldHRpbmcgd2FsbHBhcGVyIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBXYWxscGFwZXJJbmZvIGdldFdhbGxwYXBlckluZm8oKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyQ29ubmVjdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1XYWxscGFwZXJDb25uZWN0aW9uLm1JbmZvOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIFBhcmNlbEZpbGVEZXNjcmlwdG9yIHNldFdhbGxwYXBlcihTdHJpbmcgbmFtZSkgeworICAgICAgICBjaGVja1Blcm1pc3Npb24oYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLlNFVF9XQUxMUEFQRVIpOworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICBmaW5hbCBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIHBmZCA9IHVwZGF0ZVdhbGxwYXBlckJpdG1hcExvY2tlZChuYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAocGZkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYmluZFdhbGxwYXBlckNvbXBvbmVudExvY2tlZChudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBwZmQ7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIFBhcmNlbEZpbGVEZXNjcmlwdG9yIHVwZGF0ZVdhbGxwYXBlckJpdG1hcExvY2tlZChTdHJpbmcgbmFtZSkgeworICAgICAgICBpZiAobmFtZSA9PSBudWxsKSBuYW1lID0gIiI7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBQYXJjZWxGaWxlRGVzY3JpcHRvciBmZCA9IFBhcmNlbEZpbGVEZXNjcmlwdG9yLm9wZW4oV0FMTFBBUEVSX0ZJTEUsCisgICAgICAgICAgICAgICAgICAgIE1PREVfQ1JFQVRFfE1PREVfUkVBRF9XUklURSk7CisgICAgICAgICAgICBtTmFtZSA9IG5hbWU7CisgICAgICAgICAgICByZXR1cm4gZmQ7CisgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cudyhUQUcsICJFcnJvciBzZXR0aW5nIHdhbGxwYXBlciIsIGUpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFdhbGxwYXBlckNvbXBvbmVudChDb21wb25lbnROYW1lIG5hbWUpIHsKKyAgICAgICAgY2hlY2tQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5TRVRfV0FMTFBBUEVSX0NPTVBPTkVOVCk7CisgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgIGZpbmFsIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgYmluZFdhbGxwYXBlckNvbXBvbmVudExvY2tlZChuYW1lKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIHZvaWQgYmluZFdhbGxwYXBlckNvbXBvbmVudExvY2tlZChDb21wb25lbnROYW1lIG5hbWUpIHsKKyAgICAgICAgLy8gSGFzIHRoZSBjb21wb25lbnQgY2hhbmdlZD8KKyAgICAgICAgaWYgKG1XYWxscGFwZXJDb25uZWN0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyQ29tcG9uZW50ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAobmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFN0aWxsIHVzaW5nIGRlZmF1bHQgd2FsbHBhcGVyLgorICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChtV2FsbHBhcGVyQ29tcG9uZW50LmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgIC8vIENoYW5naW5nIHRvIHNhbWUgd2FsbHBhcGVyLgorICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIENvbXBvbmVudE5hbWUgcmVhbE5hbWUgPSBuYW1lOworICAgICAgICAgICAgaWYgKHJlYWxOYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBUaGUgZGVmYXVsdCBjb21wb25lbnQgaXMgb3VyIHN0YXRpYyBpbWFnZSB3YWxscGFwZXIuCisgICAgICAgICAgICAgICAgcmVhbE5hbWUgPSBuZXcgQ29tcG9uZW50TmFtZSgiYW5kcm9pZCIsCisgICAgICAgICAgICAgICAgICAgICAgICBJbWFnZVdhbGxwYXBlci5jbGFzcy5nZXROYW1lKCkpOworICAgICAgICAgICAgICAgIC8vY2xlYXJXYWxscGFwZXJDb21wb25lbnRMb2NrZWQoKTsKKyAgICAgICAgICAgICAgICAvL3JldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFNlcnZpY2VJbmZvIHNpID0gbUNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKS5nZXRTZXJ2aWNlSW5mbyhyZWFsTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgUGFja2FnZU1hbmFnZXIuR0VUX01FVEFfREFUQSB8IFBhY2thZ2VNYW5hZ2VyLkdFVF9QRVJNSVNTSU9OUyk7CisgICAgICAgICAgICBpZiAoIWFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CSU5EX1dBTExQQVBFUi5lcXVhbHMoc2kucGVybWlzc2lvbikpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24oIlNlbGVjdGVkIHNlcnZpY2UgZG9lcyBub3QgcmVxdWlyZSAiCisgICAgICAgICAgICAgICAgICAgICAgICArIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CSU5EX1dBTExQQVBFUgorICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiAiICsgcmVhbE5hbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBXYWxscGFwZXJJbmZvIHdpID0gbnVsbDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoV2FsbHBhcGVyU2VydmljZS5TRVJWSUNFX0lOVEVSRkFDRSk7CisgICAgICAgICAgICBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoZSBzZWxlY3RlZCBzZXJ2aWNlIGlzIGFjdHVhbGx5IGEgd2FsbHBhcGVyIHNlcnZpY2UuCisgICAgICAgICAgICAgICAgTGlzdDxSZXNvbHZlSW5mbz4gcmlzID0gbUNvbnRleHQuZ2V0UGFja2FnZU1hbmFnZXIoKQorICAgICAgICAgICAgICAgICAgICAgICAgLnF1ZXJ5SW50ZW50U2VydmljZXMoaW50ZW50LCBQYWNrYWdlTWFuYWdlci5HRVRfTUVUQV9EQVRBKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8cmlzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIFNlcnZpY2VJbmZvIHJzaSA9IHJpcy5nZXQoaSkuc2VydmljZUluZm87CisgICAgICAgICAgICAgICAgICAgIGlmIChyc2kubmFtZS5lcXVhbHMoc2kubmFtZSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByc2kucGFja2FnZU5hbWUuZXF1YWxzKHNpLnBhY2thZ2VOYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aSA9IG5ldyBXYWxscGFwZXJJbmZvKG1Db250ZXh0LCByaXMuZ2V0KGkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFhtbFB1bGxQYXJzZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICh3aSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTZWN1cml0eUV4Y2VwdGlvbigiU2VsZWN0ZWQgc2VydmljZSBpcyBub3QgYSB3YWxscGFwZXI6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHJlYWxOYW1lKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIEJpbmQgdGhlIHNlcnZpY2UhCisgICAgICAgICAgICBXYWxscGFwZXJDb25uZWN0aW9uIG5ld0Nvbm4gPSBuZXcgV2FsbHBhcGVyQ29ubmVjdGlvbih3aSk7CisgICAgICAgICAgICBpbnRlbnQuc2V0Q29tcG9uZW50KHJlYWxOYW1lKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShJbnRlbnQuRVhUUkFfQ0xJRU5UX0xBQkVMLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy53YWxscGFwZXJfYmluZGluZ19sYWJlbCk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoSW50ZW50LkVYVFJBX0NMSUVOVF9JTlRFTlQsIFBlbmRpbmdJbnRlbnQuZ2V0QWN0aXZpdHkoCisgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LCAwLAorICAgICAgICAgICAgICAgICAgICBJbnRlbnQuY3JlYXRlQ2hvb3NlcihuZXcgSW50ZW50KEludGVudC5BQ1RJT05fU0VUX1dBTExQQVBFUiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0VGV4dChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5jaG9vc2VyX3dhbGxwYXBlcikpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKTsKKyAgICAgICAgICAgIGlmICghbUNvbnRleHQuYmluZFNlcnZpY2UoaW50ZW50LCBuZXdDb25uLAorICAgICAgICAgICAgICAgICAgICBDb250ZXh0LkJJTkRfQVVUT19DUkVBVEUpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5hYmxlIHRvIGJpbmQgc2VydmljZTogIgorICAgICAgICAgICAgICAgICAgICAgICAgKyBuYW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2xlYXJXYWxscGFwZXJDb21wb25lbnRMb2NrZWQoKTsKKyAgICAgICAgICAgIG1XYWxscGFwZXJDb21wb25lbnQgPSBuYW1lOworICAgICAgICAgICAgbVdhbGxwYXBlckNvbm5lY3Rpb24gPSBuZXdDb25uOworICAgICAgICAgICAgbUxhc3REaWVkVGltZSA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIkFkZGluZyB3aW5kb3cgdG9rZW46ICIgKyBuZXdDb25uLm1Ub2tlbik7CisgICAgICAgICAgICAgICAgbUlXaW5kb3dNYW5hZ2VyLmFkZFdpbmRvd1Rva2VuKG5ld0Nvbm4ubVRva2VuLAorICAgICAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuVFlQRV9XQUxMUEFQRVIpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICB9IGNhdGNoIChQYWNrYWdlTWFuYWdlci5OYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBjb21wb25lbnQgIiArIG5hbWUpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHZvaWQgY2xlYXJXYWxscGFwZXJDb21wb25lbnRMb2NrZWQoKSB7CisgICAgICAgIG1XYWxscGFwZXJDb21wb25lbnQgPSBudWxsOworICAgICAgICBpZiAobVdhbGxwYXBlckNvbm5lY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKG1XYWxscGFwZXJDb25uZWN0aW9uLm1FbmdpbmUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIG1XYWxscGFwZXJDb25uZWN0aW9uLm1FbmdpbmUuZGVzdHJveSgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgbUNvbnRleHQudW5iaW5kU2VydmljZShtV2FsbHBhcGVyQ29ubmVjdGlvbik7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiUmVtb3Zpbmcgd2luZG93IHRva2VuOiAiCisgICAgICAgICAgICAgICAgICAgICAgICArIG1XYWxscGFwZXJDb25uZWN0aW9uLm1Ub2tlbik7CisgICAgICAgICAgICAgICAgbUlXaW5kb3dNYW5hZ2VyLnJlbW92ZVdpbmRvd1Rva2VuKG1XYWxscGFwZXJDb25uZWN0aW9uLm1Ub2tlbik7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVdhbGxwYXBlckNvbm5lY3Rpb24gPSBudWxsOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHZvaWQgYXR0YWNoU2VydmljZUxvY2tlZChXYWxscGFwZXJDb25uZWN0aW9uIGNvbm4pIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGNvbm4ubVNlcnZpY2UuYXR0YWNoKGNvbm4sIGNvbm4ubVRva2VuLAorICAgICAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5UWVBFX1dBTExQQVBFUiwgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgIG1XaWR0aCwgbUhlaWdodCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4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h0LmNoZWNrQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24ocGVybWlzc2lvbikpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBTZWN1cml0eUV4Y2VwdGlvbigiQWNjZXNzIGRlbmllZCB0byBwcm9jZXNzOiAiICsgQmluZGVyLmdldENhbGxpbmdQaWQoKQorICAgICAgICAgICAgICAgICAgICArICIsIG11c3QgaGF2ZSBwZXJtaXNzaW9uICIgKyBwZXJtaXNzaW9uKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIEpvdXJuYWxlZEZpbGUgbWFrZUpvdXJuYWxlZEZpbGUoKSB7CisgICAgICAgIGZpbmFsIFN0cmluZyBiYXNlID0gIi9kYXRhL3N5c3RlbS93YWxscGFwZXJfaW5mby54bWwiOworICAgICAgICByZXR1cm4gbmV3IEpvdXJuYWxlZEZpbGUobmV3IEZpbGUoYmFzZSksIG5ldyBGaWxlKGJhc2UgKyAiLnRtcCIpKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2F2ZVNldHRpbmdzTG9ja2VkKCkgeworICAgICAgICBKb3VybmFsZWRGaWxlIGpvdXJuYWwgPSBtYWtlSm91cm5hbGVkRmlsZSgpOworICAgICAgICBGaWxlT3V0cHV0U3RyZWFtIHN0cmVhbSA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBzdHJlYW0gPSBuZXcgRmlsZU91dHB1dFN0cmVhbShqb3VybmFsLmNob29zZUZvcldyaXRlKCksIGZhbHNlKTsKKyAgICAgICAgICAgIFhtbFNlcmlhbGl6ZXIgb3V0ID0gbmV3IEZhc3RYbWxTZXJpYWxpemVyKCk7CisgICAgICAgICAgICBvdXQuc2V0T3V0cHV0KHN0cmVhbSwgInV0Zi04Iik7CisgICAgICAgICAgICBvdXQuc3RhcnREb2N1bWVudChudWxsLCB0cnVlKTsKKworICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJ3cCIpOworICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAid2lkdGgiLCBJbnRlZ2VyLnRvU3RyaW5nKG1XaWR0aCkpOworICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAiaGVpZ2h0IiwgSW50ZWdlci50b1N0cmluZyhtSGVpZ2h0KSk7CisgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJuYW1lIiwgbU5hbWUpOworICAgICAgICAgICAgaWYgKG1XYWxscGFwZXJDb21wb25lbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgImNvbXBvbmVudCIsCisgICAgICAgICAgICAgICAgICAgICAgICBtV2FsbHBhcGVyQ29tcG9uZW50LmZsYXR0ZW5Ub1Nob3J0U3RyaW5nKCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAid3AiKTsKKworICAgICAgICAgICAgb3V0LmVuZERvY3VtZW50KCk7CisgICAgICAgICAgICBzdHJlYW0uY2xvc2UoKTsKKyAgICAgICAgICAgIGpvdXJuYWwuY29tbWl0KCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgaWYgKHN0cmVhbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgLy8gSWdub3JlCisgICAgICAgICAgICB9CisgICAgICAgICAgICBqb3VybmFsLnJvbGxiYWNrKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgbG9hZFNldHRpbmdzTG9ja2VkKCkgeworICAgICAgICBKb3VybmFsZWRGaWxlIGpvdXJuYWwgPSBtYWtlSm91cm5hbGVkRmlsZSgpOworICAgICAgICBGaWxlSW5wdXRTdHJlYW0gc3RyZWFtID0gbnVsbDsKKyAgICAgICAgRmlsZSBmaWxlID0gam91cm5hbC5jaG9vc2VGb3JSZWFkKCk7CisgICAgICAgIGJvb2xlYW4gc3VjY2VzcyA9IGZhbHNlOworICAgICAgICB0cnkgeworICAgICAgICAgICAgc3RyZWFtID0gbmV3IEZpbGVJbnB1dFN0cmVhbShmaWxlKTsKKyAgICAgICAgICAgIFhtbFB1bGxQYXJzZXIgcGFyc2VyID0gWG1sLm5ld1B1bGxQYXJzZXIoKTsKKyAgICAgICAgICAgIHBhcnNlci5zZXRJbnB1dChzdHJlYW0sIG51bGwpOworCisgICAgICAgICAgICBpbnQgdHlwZTsKKyAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICB0eXBlID0gcGFyc2VyLm5leHQoKTsKKyAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdGFnID0gcGFyc2VyLmdldE5hbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCJ3cCIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XaWR0aCA9IEludGVnZXIucGFyc2VJbnQocGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ3aWR0aCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1IZWlnaHQgPSBJbnRlZ2VyLnBhcnNlSW50KHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAiaGVpZ2h0IikpOworICAgICAgICAgICAgICAgICAgICAgICAgbU5hbWUgPSBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgIm5hbWUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBjb21wID0gcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJjb21wb25lbnQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XYWxscGFwZXJDb21wb25lbnQgPSBjb21wICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDb21wb25lbnROYW1lLnVuZmxhdHRlbkZyb21TdHJpbmcoY29tcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSB3aGlsZSAodHlwZSAhPSBYbWxQdWxsUGFyc2VyLkVORF9ET0NVTUVOVCk7CisgICAgICAgICAgICBzdWNjZXNzID0gdHJ1ZTsKKyAgICAgICAgfSBjYXRjaCAoTnVsbFBvaW50ZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiZmFpbGVkIHBhcnNpbmcgIiArIGZpbGUgKyAiICIgKyBlKTsKKyAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy53KFRBRywgImZhaWxlZCBwYXJzaW5nICIgKyBmaWxlICsgIiAiICsgZSk7CisgICAgICAgIH0gY2F0Y2ggKFhtbFB1bGxQYXJzZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiZmFpbGVkIHBhcnNpbmcgIiArIGZpbGUgKyAiICIgKyBlKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLncoVEFHLCAiZmFpbGVkIHBhcnNpbmcgIiArIGZpbGUgKyAiICIgKyBlKTsKKyAgICAgICAgfSBjYXRjaCAoSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cudyhUQUcsICJmYWlsZWQgcGFyc2luZyAiICsgZmlsZSArICIgIiArIGUpOworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAoc3RyZWFtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzdHJlYW0uY2xvc2UoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gSWdub3JlCisgICAgICAgIH0KKworICAgICAgICBpZiAoIXN1Y2Nlc3MpIHsKKyAgICAgICAgICAgIG1XaWR0aCA9IC0xOworICAgICAgICAgICAgbUhlaWdodCA9IC0xOworICAgICAgICAgICAgbU5hbWUgPSAiIjsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgc2V0dGluZ3NSZXN0b3JlZCgpIHsKKyAgICAgICAgYm9vbGVhbiBzdWNjZXNzID0gZmFsc2U7CisgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgIGxvYWRTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgLy8gSWYgdGhlcmUncyBhIHdhbGxwYXBlciBuYW1lLCB3ZSB1c2UgdGhhdC4gIElmIHRoYXQgY2FuJ3QgYmUgbG9hZGVkLCB0aGVuIHdlCisgICAgICAgICAgICAvLyB1c2UgdGhlIGRlZmF1bHQuCisgICAgICAgICAgICBpZiAoIiIuZXF1YWxzKG1OYW1lKSkgeworICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzdWNjZXNzID0gcmVzdG9yZU5hbWVkUmVzb3VyY2VMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICghc3VjY2VzcykgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiRmFpbGVkIHRvIHJlc3RvcmUgd2FsbHBhcGVyOiAnIiArIG1OYW1lICsgIiciKTsKKyAgICAgICAgICAgIG1OYW1lID0gIiI7CisgICAgICAgICAgICBXQUxMUEFQRVJfRklMRS5kZWxldGUoKTsKKyAgICAgICAgfQorICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICB9CisKKyAgICBib29sZWFuIHJlc3RvcmVOYW1lZFJlc291cmNlTG9ja2VkKCkgeworICAgICAgICBpZiAobU5hbWUubGVuZ3RoKCkgPiA0ICYmICJyZXM6Ii5lcXVhbHMobU5hbWUuc3Vic3RyaW5nKDAsIDQpKSkgeworICAgICAgICAgICAgU3RyaW5nIHJlc05hbWUgPSBtTmFtZS5zdWJzdHJpbmcoNCk7CisKKyAgICAgICAgICAgIFN0cmluZyBwa2cgPSBudWxsOworICAgICAgICAgICAgaW50IGNvbG9uID0gcmVzTmFtZS5pbmRleE9mKCc6Jyk7CisgICAgICAgICAgICBpZiAoY29sb24gPiAwKSB7CisgICAgICAgICAgICAgICAgcGtnID0gcmVzTmFtZS5zdWJzdHJpbmcoMCwgY29sb24pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmcgaWRlbnQgPSBudWxsOworICAgICAgICAgICAgaW50IHNsYXNoID0gcmVzTmFtZS5sYXN0SW5kZXhPZignLycpOworICAgICAgICAgICAgaWYgKHNsYXNoID4gMCkgeworICAgICAgICAgICAgICAgIGlkZW50ID0gcmVzTmFtZS5zdWJzdHJpbmcoc2xhc2grMSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZyB0eXBlID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChjb2xvbiA+IDAgJiYgc2xhc2ggPiAwICYmIChzbGFzaC1jb2xvbikgPiAxKSB7CisgICAgICAgICAgICAgICAgdHlwZSA9IHJlc05hbWUuc3Vic3RyaW5nKGNvbG9uKzEsIHNsYXNoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHBrZyAhPSBudWxsICYmIGlkZW50ICE9IG51bGwgJiYgdHlwZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW50IHJlc0lkID0gLTE7CisgICAgICAgICAgICAgICAgSW5wdXRTdHJlYW0gcmVzID0gbnVsbDsKKyAgICAgICAgICAgICAgICBGaWxlT3V0cHV0U3RyZWFtIGZvcyA9IG51bGw7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgQ29udGV4dCBjID0gbUNvbnRleHQuY3JlYXRlUGFja2FnZUNvbnRleHQocGtnLCBDb250ZXh0LkNPTlRFWFRfUkVTVFJJQ1RFRCk7CisgICAgICAgICAgICAgICAgICAgIFJlc291cmNlcyByID0gYy5nZXRSZXNvdXJjZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzSWQgPSByLmdldElkZW50aWZpZXIocmVzTmFtZSwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNJZCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJjb3VsZG4ndCByZXNvbHZlIGlkZW50aWZpZXIgcGtnPSIgKyBwa2cgKyAiIHR5cGU9IiArIHR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlkZW50PSIgKyBpZGVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICByZXMgPSByLm9wZW5SYXdSZXNvdXJjZShyZXNJZCk7CisgICAgICAgICAgICAgICAgICAgIGZvcyA9IG5ldyBGaWxlT3V0cHV0U3RyZWFtKFdBTExQQVBFUl9GSUxFKTsKKworICAgICAgICAgICAgICAgICAgICBieXRlW10gYnVmZmVyID0gbmV3IGJ5dGVbMzI3NjhdOworICAgICAgICAgICAgICAgICAgICBpbnQgYW10OworICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKGFtdD1yZXMucmVhZChidWZmZXIpKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcy53cml0ZShidWZmZXIsIDAsIGFtdCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gbVdhbGxwYXBlck9ic2VydmVyIHdpbGwgbm90aWNlIHRoZSBjbG9zZSBhbmQgc2VuZCB0aGUgY2hhbmdlIGJyb2FkY2FzdAorCisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlJlc3RvcmVkIHdhbGxwYXBlcjogIiArIHJlc05hbWUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChOYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJQYWNrYWdlIG5hbWUgIiArIHBrZyArICIgbm90IGZvdW5kIik7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVzb3VyY2VzLk5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiUmVzb3VyY2Ugbm90IGZvdW5kOiAiICsgcmVzSWQpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSU9FeGNlcHRpb24gd2hpbGUgcmVzdG9yaW5nIHdhbGxwYXBlciAiLCBlKTsKKyAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICBpZiAocmVzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleCkge30KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoZm9zICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9zLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBleCkge30KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGR1bXAoRmlsZURlc2NyaXB0b3IgZmQsIFByaW50V3JpdGVyIHB3LCBTdHJpbmdbXSBhcmdzKSB7CisgICAgICAgIGlmIChtQ29udGV4dC5jaGVja0NhbGxpbmdPclNlbGZQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5EVU1QKQorICAgICAgICAgICAgICAgICE9IFBhY2thZ2VNYW5hZ2VyLlBFUk1JU1NJT05fR1JBTlRFRCkgeworICAgICAgICAgICAgCisgICAgICAgICAgICBwdy5wcmludGxuKCJQZXJtaXNzaW9uIERlbmlhbDogY2FuJ3QgZHVtcCB3YWxscGFwZXIgc2VydmljZSBmcm9tIGZyb20gcGlkPSIKKyAgICAgICAgICAgICAgICAgICAgKyBCaW5kZXIuZ2V0Q2FsbGluZ1BpZCgpCisgICAgICAgICAgICAgICAgICAgICsgIiwgdWlkPSIgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIkN1cnJlbnQgV2FsbHBhcGVyIFNlcnZpY2Ugc3RhdGU6Iik7CisgICAgICAgICAgICBwdy5wcmludCgiICBtV2lkdGg9Iik7IHB3LnByaW50KG1XaWR0aCk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbUhlaWdodD0iKTsgcHcucHJpbnRsbihtSGVpZ2h0KTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgIG1OYW1lPSIpOyBwdy5wcmludGxuKG1OYW1lKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgIG1XYWxscGFwZXJDb21wb25lbnQ9Iik7IHB3LnByaW50bG4obVdhbGxwYXBlckNvbXBvbmVudCk7CisgICAgICAgICAgICBpZiAobVdhbGxwYXBlckNvbm5lY3Rpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFdhbGxwYXBlckNvbm5lY3Rpb24gY29ubiA9IG1XYWxscGFwZXJDb25uZWN0aW9uOworICAgICAgICAgICAgICAgIHB3LnByaW50KCIgIFdhbGxwYXBlciBjb25uZWN0aW9uICIpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoY29ubik7IHB3LnByaW50bG4oIjoiKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIG1JbmZvLmNvbXBvbmVudD0iKTsgcHcucHJpbnRsbihjb25uLm1JbmZvLmdldENvbXBvbmVudCgpKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIG1Ub2tlbj0iKTsgcHcucHJpbnRsbihjb25uLm1Ub2tlbik7CisgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgICBtU2VydmljZT0iKTsgcHcucHJpbnRsbihjb25uLm1TZXJ2aWNlKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIG1FbmdpbmU9Iik7IHB3LnByaW50bG4oY29ubi5tRW5naW5lKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIG1MYXN0RGllZFRpbWU9Iik7CisgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1MYXN0RGllZFRpbWUgLSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9XYWxscGFwZXJTZXJ2aWNlLm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WYsIHRydWUpIHsKICAgICAgICAgICAgICAgICAvKgpAQCAtMjQ2LDYgKzIyMiw4IEBACiAgICAgICAgICAgICAgICAgbmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgewogICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2xlYXIgb3VyIGZsYWcgaW5kaWNhdGluZyB0aGUgdXNlciBoYXMgb3ZlcndyaWRkZW4gYWlycGxhbmUgbW9kZQorICAgICAgICAgICAgICAgICAgICAgICAgbUFpcnBsYW5lTW9kZU92ZXJ3cmlkZGVuID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVXaWZpU3RhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0sCkBAIC0yNTQsMTU1ICsyMzIsNiBAQAogICAgICAgICBzZXRXaWZpRW5hYmxlZEJsb2NraW5nKHdpZmlFbmFibGVkLCBmYWxzZSwgUHJvY2Vzcy5teVVpZCgpKTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBJbml0aWFsaXplcyB0aGUgaGlkZGVuIG5ldHdvcmtzIHN0YXRlLiBNdXN0IGJlIGNhbGxlZCB3aGVuIHdlCi0gICAgICogZW5hYmxlIFdpLUZpLgotICAgICAqLwotICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgaW5pdGlhbGl6ZUhpZGRlbk5ldHdvcmtzU3RhdGUoKSB7Ci0gICAgICAgIC8vIEZpcnN0LCByZXNldCB0aGUgc3RhdGUKLSAgICAgICAgcmVzZXRIaWRkZW5OZXR3b3Jrc1N0YXRlKCk7Ci0KLSAgICAgICAgLy8gLi4uIHRoZW4gYWRkIG5ldHdvcmtzIHRoYXQgYXJlIG1hcmtlZCBhcyBoaWRkZW4KLSAgICAgICAgTGlzdDxXaWZpQ29uZmlndXJhdGlvbj4gbmV0d29ya3MgPSBnZXRDb25maWd1cmVkTmV0d29ya3MoKTsKLSAgICAgICAgaWYgKCFuZXR3b3Jrcy5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIGZvciAoV2lmaUNvbmZpZ3VyYXRpb24gY29uZmlnIDogbmV0d29ya3MpIHsKLSAgICAgICAgICAgICAgICBpZiAoY29uZmlnICE9IG51bGwgJiYgY29uZmlnLmhpZGRlblNTSUQpIHsKLSAgICAgICAgICAgICAgICAgICAgYWRkT3JVcGRhdGVIaWRkZW5OZXR3b3JrKAotICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLm5ldHdvcmtJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5zdGF0dXMgIT0gV2lmaUNvbmZpZ3VyYXRpb24uU3RhdHVzLkRJU0FCTEVEKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJlc2V0cyB0aGUgaGlkZGVuIG5ldHdvcmtzIHN0YXRlLgotICAgICAqLwotICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgcmVzZXRIaWRkZW5OZXR3b3Jrc1N0YXRlKCkgewotICAgICAgICBtTnVtSGlkZGVuTmV0d29ya1ByZXNlbnQgPSAwOwotICAgICAgICBtSXNIaWRkZW5OZXR3b3JrUHJlc2VudC5jbGVhcigpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIE1hcmtzIGFsbCBidXQgbmV0SWQgbmV0d29yayBhcyBub3QgcHJlc2VudC4KLSAgICAgKi8KLSAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIG1hcmtBbGxIaWRkZW5OZXR3b3Jrc0J1dE9uZUFzTm90UHJlc2VudChpbnQgbmV0SWQpIHsKLSAgICAgICAgZm9yIChNYXAuRW50cnk8SW50ZWdlciwgQm9vbGV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ZUhpZGRlbk5ldHdvcmsoaW50IG5ldElkLCBib29sZWFuIHByZXNlbnQpIHsKLSAgICAgICAgaWYgKDAgPD0gbmV0SWQpIHsKLQotICAgICAgICAgICAgLy8gSWYgd2UgYXJlIGFkZGluZyBhIG5ldyBlbnRyeSBvciBtb2RpZnlpbmcgYW4gZXhpc3Rpbmcgb25lCi0gICAgICAgICAgICBCb29sZWFuIGlzUHJlc2VudCA9IG1Jc0hpZGRlbk5ldHdvcmtQcmVzZW50LmdldChuZXRJZCk7Ci0gICAgICAgICAgICBpZiAoaXNQcmVzZW50ID09IG51bGwgfHwgaXNQcmVzZW50ICE9IHByZXNlbnQpIHsKLSAgICAgICAgICAgICAgICBpZiAocHJlc2VudCkgewotICAgICAgICAgICAgICAgICAgICBpbmNyZW1lbnRIaWRkZW50TmV0d29ya1ByZXNlbnRDb3VudGVyKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgYWRkIGEgbmV3IGhpZGRlbiBuZXR3b3JrLCBubyBuZWVkIHRvIGNoYW5nZQotICAgICAgICAgICAgICAgICAgICAvLyB0aGUgY291bnRlciAoaXQgbXVzdCBiZSAwKQotICAgICAgICAgICAgICAgICAgICBpZiAoaXNQcmVzZW50ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlY3JlbWVudEhpZGRlbnROZXR3b3JrUHJlc2VudENvdW50ZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtSXNIaWRkZW5OZXR3b3JrUHJlc2VudC5wdXQobmV0SWQsIHByZXNlbnQpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgTG9nLmUoVEFHLCAiYWRkT3JVcGRhdGVIaWRkZW5OZXR3b3JrKCk6IEludmFsaWQgKG5lZ2F0aXZlKSBuZXR3b3JrIGlkISIpOwotICAgICA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ICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInJlbW92ZUhpZGRlbk5ldHdvcmsoKTogUmVtb3ZpbmcgYSBub24tZXhpc3RlbnQgbmV0d29yayEiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICJyZW1vdmVIaWRkZW5OZXR3b3JrKCk6IEludmFsaWQgKG5lZ2F0aXZlKSBuZXR3b3JrIGlkISIpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUmV0dXJucyB0cnVlIGlmIG5ldElkIGlzIGFuIGV4aXN0aW5nIGhpZGRlbiBuZXR3b3JrLgotICAgICAqLwotICAgIHByaXZhdGUgc3luY2hyb25pemVkIGJvb2xlYW4gaXNIaWRkZW5OZXR3b3JrKGludCBuZXRJZCkgewotICAgICAgICByZXR1cm4gbUlzSGlkZGVuTmV0d29ya1ByZXNlbnQuY29udGFpbnNLZXkobmV0SWQpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIEluY3JlbWVudHMgdGhlIHByZXNlbnQgKGVuYWJsZWQpIGhpZGRlbiBuZXR3b3JrcyBjb3VudGVyLiBJZiB0aGUKLSAgICAgKiBjb3VudGVyIHZhbHVlIGdvZXMgZnJvbSAwIHRvIDEsIGNoYW5nZXMgdGhlIHNjYW4gbW9kZSB0byBhY3RpdmUuCi0gICAgICovCi0gICAgcHJpdmF0ZSB2b2lkIGluY3JlbWVudEhpZGRlbnROZXR3b3JrUHJlc2VudENvdW50ZXIoKSB7Ci0gICAgICAgICsrbU51bUhpZGRlbk5ldHdvcmtQcmVzZW50OwotICAgICAgICBpZiAoMSA9PSBtTnVtSGlkZGVuTmV0d29ya1ByZXNlbnQpIHsKLSAgICAgICAgICAgIC8vIFN3aXRja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jciA9IG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpOwogICAgICAgICB0cnkgewpAQCAtNDY4LDYgKzI5Nyw4IEBACiAgICAgICAgIHN5bmNocm9uaXplZCAobVdpZmlIYW5kbGVyKSB7CiAgICAgICAgICAgICBzV2FrZUxvY2suYWNxdWlyZSgpOwogICAgICAgICAgICAgbUxhc3RFbmFibGVVaWQgPSBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpOworICAgICAgICAgICAgLy8gc2V0IGEgZmxhZyBpZiB0aGUgdXNlciBpcyBlbmFibGluZyBXaWZpIHdoaWxlIGluIGFpcnBsYW5lIG1vZGUKKyAgICAgICAgICAgIG1BaXJwbGFuZU1vZGVPdmVyd3JpZGRlbiA9IChlbmFibGUgJiYgaXNBaXJwbGFuZU1vZGVPbigpICYmIGlzQWlycGxhbmVUb2dnbGVhYmxlKCkpOwogICAgICAgICAgICAgc2VuZEVuYWJsZU1lc3NhZ2UoZW5hYmxlLCB0cnVlLCBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpKTsKICAgICAgICAgfQogCkBAIC00ODgsNyArMzE5LDcgQEAKICAgICAgICAgaWYgKG1XaWZpU3RhdGUgPT0gZXZlbnR1YWxXaWZpU3RhdGUpIHsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9Ci0gICAgICAgIGlmIChlbmFibGUgJiYgaXNBaXJwbGFuZU1vZGVPbigpKSB7CisgICAgICAgIGlmIChlbmFibGUgJiYgaXNBaXJwbGFuZU1vZGVPbigpICYmICFtQWlycGxhbmVNb2RlT3ZlcndyaWRkZW4pIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCkBAIC01MjIsNyArMzUzLDcgQEAKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgLy8gV2UgbXVzdCByZXNldCB0aGUgaW50ZXJmYWNlIGJlZm9yZSB3ZSB1bmxvYWQgdGhlIGRyaXZlcgotICAgICAgICAgICAgbV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LyoKLSAgICAgICAgICogSWYgd2UgaGF2ZSBoaWRkZW4gbmV0d29ya3MsIHdlIG1heSBoYXZlIHRvIGNoYW5nZSB0aGUgc2NhbiBtb2RlCi0gICAgICAgICAqLwotICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKLSAgICAgICAgICAgICBpZiAoZGlzYWJsZU90aGVycykgewotICAgICAgICAgICAgICAgICBtYXJrQWxsSGlkZGVuTmV0d29ya3NCdXRPbmVBc05vdFByZXNlbnQobmV0SWQpOwotICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICB1cGRhdGVOZXR3b3JrSWZIaWRkZW4obmV0SWQsIHRydWUpOwotICAgICAgICAgfQotCiAgICAgICAgIHN5bmNocm9uaXplZCAobVdpZmlTdGF0ZVRyYWNrZXIpIHsKLSAgICAgICAgICAgIHJldHVybiBXaWZpTmF0aXZlLmVuYWJsZU5ldHdvcmtDb21tYW5kKG5ldElkLCBkaXNhYmxlT3RoZXJzKTsKKyAgICAgICAgICAgIFN0cmluZyBpZm5hbWUgPSBtV2lmaVN0YXRlVHJhY2tlci5nZXRJbnRlcmZhY2VOYW1lKCk7CisgICAgICAgICAgICBOZXR3b3JrVXRpbHMuZW5hYmxlSW50ZXJmYWNlKGlmbmFtZSk7CisgICAgICAgICAgICBib29sZWFuIHJlc3VsdCA9IFdpZmlOYXRpdmUuZW5hYmxlTmV0d29ya0NvbW1hbmQobmV0SWQsIGRpc2FibGVPdGhlcnMpOworICAgICAgICAgICAgaWYgKCFyZXN1bHQpIHsKKyAgICAgICAgICAgICAgICBOZXR3b3JrVXRpbHMuZGlzYWJsZUludGVyZmFjZShpZm5hbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTI3MywxMSArMTA4NCw2IEBACiAgICAgcHVibGljIGJvb2xlYW4gZGlzYWJsZU5ldHdvcmsoaW50IG5ldElkKSB7CiAgICAgICAgIGVuZm9yY2VDaGFuZ2VQZXJtaXNzaW9uKCk7CiAKLSAgICAgICAgLyoKLSAgICAgICAgICogSWYgd2UgaGF2ZSBoaWRkZW4gbmV0d29ya3MsIHdlIG1heSBoYXZlIHRvIGNoYW5nZSB0aGUgc2NhbiBtb2RlCi0gICAgICAgICAqLwotICAgICAgICB1cGRhdGVOZXR3b3JrSWZIaWRkZW4obmV0SWQsIGZhbHNlKTsKLQogICAgICAgICBzeW5jaHJvbml6ZWQgKG1XaWZpU3RhdGVUcmFja2VyKSB7CiAgICAgICAgICAgICByZXR1cm4gV2lmaU5hdGl2ZS5kaXNhYmxlTmV0d29ya0NvbW1hbmQobmV0SWQpOwogICAgICAgICB9CkBAIC0xMzc1LDQ1ICsxMTgxLDQ5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBsZXZlbCA9IDA7CiAgICAgICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgICAgICAvLyBic3NpZCBpcyB0aGUgaGFzaCBrZXkKLSAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdCA9IG1TY2FuUmVzdWx0Q2FjaGUuZ2V0KGJzc2lkKTsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogVGhlIGZvcm1hdHRpbmcgb2YgdGhlIHJlc3VsdHMgcmV0dXJuZWQgYnkKKyAgICAgICAgICAgICAgICAgICAgICogd3BhX3N1cHBsaWNhbnQgaXMgaW50ZW5kZWQgdG8gbWFrZSB0aGUgZmllbGRzCisgICAgICAgICAgICAgICAgICAgICAqIGxpbmUgdXAgbmljZWx5IHdoZW4gcHJpbnRlZCwKKyAgICAgICAgICAgICAgICAgICAgICogbm90IHRvIG1ha2UgdGhlbSBlYXN5IHRvIHBhcnNlLiBTbyB3ZSBoYXZlIHRvCisgICAgICAgICAgICAgICAgICAgICAqIGFwcGx5IHNvbWUgaGV1cmlzdGljcyB0byBmaWd1cmUgb3V0IHdoaWNoIGZpZWxkCisgICAgICAgICAgICAgICAgICAgICAqIGlzIHRoZSBTU0lEIGFuZCB3aGljaCBmaWVsZCBpcyB0aGUgZmxhZ3MuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc3NpZDsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGZsYWdzOworICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0Lmxlbmd0aCA9PSA0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0WzNdLmNoYXJBdCgwKSA9PSAnWycpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFncyA9IHJlc3VsdFszXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzc2lkID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3NpZCA9IHJlc3VsdFszXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQubGVuZ3RoID09IDUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzID0gcmVzdWx0WzNdOworICAgICAgICAgICAgICAgICAgICAgICAgc3NpZCA9IHJlc3VsdFs0XTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEhlcmUsIHdlIG11c3QgaGF2ZSAzIGZpZWxkczogbm8gZmxhZ3MgYW5kIHNzaWQKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNldAorICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNzaWQgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIGJzc2lkICsgc3NpZCBpcyB0aGUgaGFzaCBrZXkKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGtleSA9IGJzc2lkICsgc3NpZDsKKyAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdCA9IG1TY2FuUmVzdWx0Q2FjaGUuZ2V0KGtleSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChzY2FuUmVzdWx0ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHNjYW5SZXN1bHQubGV2ZWwgPSBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjYW5SZXN1bHQuU1NJRCA9IHNzaWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBzY2FuUmVzdWx0LmNhcGFiaWxpdGllcyA9IGZsYWdzOworICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdC5mcmVxdWVuY3kgPSBmcmVxdWVuY3k7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICogVGhlIGZvcm1hdHRpbmcgb2YgdGhlIHJlc3VsdHMgcmV0dXJuZWQgYnkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHdwYV9zdXBwbGljYW50IGlzIGludGVuZGVkIHRvIG1ha2UgdGhlIGZpZWxkcwotICAgICAgICAgICAgICAgICAgICAgICAgICogbGluZSB1cCBuaWNlbHkgd2hlbiBwcmludGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICogbm90IHRvIG1ha2UgdGhlbSBlYXN5IHRvIHBhcnNlLiBTbyB3ZSBoYXZlIHRvCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBhcHBseSBzb21lIGhldXJpc3RpY3MgdG8gZmlndXJlIG91dCB3aGljaCBmaWVsZAotICAgICAgICAgICAgICAgICAgICAgICAgICogaXMgdGhlIFNTSUQgYW5kIHdoaWNoIGZpZWxkIGlzIHRoZSBmbGFncy4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHNzaWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmxhZ3M7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0Lmxlbmd0aCA9PSA0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdFszXS5jaGFyQXQoMCkgPT0gJ1snKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzID0gcmVzdWx0WzNdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzc2lkID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAiIjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3NpZCA9IHJlc3VsdFszXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdC5sZW5ndGggPT0gNSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzID0gcmVzdWx0WzNdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzaWQgPSByZXN1bHRbNF07Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEhlcmUsIHdlIG11c3QgaGF2ZSAzIGZpZWxkczogbm8gZmxhZ3MgYW5kIHNzaWQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFncyA9ICIiOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzaWQgPSAiIjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG8gbm90IGFkZCBzY2FuIHJlc3VsdHMgdGhhdCBoYXZlIG5vIFNTSUQgc2V0CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA8IHNzaWQudHJpbSgpLmxlbmd0aCgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhblJlc3VsdCA9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTY2FuUmVzdWx0KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3NpZCwgYnNzaWQsIGZsYWdzLCBsZXZlbCwgZnJlcXVlbmN5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2NhblJlc3VsdENhY2hlLnB1dChic3NpZCwgc2NhblJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNjYW5SZXN1bHRDYWNoZS5wdXQoa2V5LCBzY2FuUmVzdWx0KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC0xNDc5LDE0ICsxMjg5LDE3IEBACiAgICAgICogU2V0IHRoZSBudW1iZXIgb2YgcmFkaW8gZnJlcXVlbmN5IGNoYW5uZWxzIHRoYXQgYXJlIGFsbG93ZWQgdG8gYmUgdXNlZAogICAgICAqIGluIHRoZSBjdXJyZW50IHJlZ3VsYXRvcnkgZG9tYWluLiBUaGlzIG1ldGhvZCBzaG91bGQgYmUgdXNlZCBvbmx5CiAgICAgICogaWYgdGhlIGNvcnJlY3QgbnVtYmVyIG9mIGNoYW5uZWxzIGNhbm5vdCBiZSBkZXRlcm1pbmVkIGF1dG9tYXRpY2FsbHkKLSAgICAgKiBmb3Igc29tZSByZWFzb24uIElmIHRoZSBvcGVyYXRpb24gaXMgc3VjY2Vzc2Z1bCwgdGhlIG5ldyB2YWx1ZSBpcworICAgICAqIGZvciBzb21lIHJlYXNvbi4gSWYgdGhlIG9wZXJhdGlvbiBpcyB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ArMTMxOCwxMSBAQAogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAKLSAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuV0lGSV9OVU1fQUxMT1dFRF9DSEFOTkVMUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1DaGFubmVscyk7CisgICAgICAgIGlmIChwZXJzaXN0KSB7CisgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUucHV0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuV0lGSV9OVU1fQUxMT1dFRF9DSEFOTkVMUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtQ2hhbm5lbHMpOworICAgICAgICB9CiAgICAgICAgIG1XaWZpU3RhdGVUcmFja2VyLnNldE51bUFsbG93ZWRDaGFubmVscyhudW1DaGFubmVscyk7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KQEAgLTE2ODgsNyArMTUwMyw3IEBACiAKICAgICBwcml2YXRlIHZvaWQgdXBkYXRlV2lmaVN0YXRlKCkgewogICAgICAgICBib29sZWFuIHdpZmlFbmFibGVkID0gZ2V0UGVyc2lzdGVkV2lmaUVuYWJsZWQoKTsKLSAgICAgICAgYm9vbGVhbiBhaXJwbGFuZU1vZGUgPSBpc0FpcnBsYW5lTW9kZU9uKCk7CisgICAgICAgIGJvb2xlYW4gYWlycGxhbmVNb2RlID0gaXNBaXJwbGFuZU1vZGVPbigpICYmICFtQWlycGxhbmVNb2RlT3ZlcndyaWRkZW47CiAgICAgICAgIGJvb2xlYW4gbG9ja0hlbGQgPSBtTG9ja3MuaGFzTG9ja3MoKTsKICAgICAg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iB0aGUgbWlkZGxlIG9mIGFuaW1hdGluZyBmcm9tIG9uZSB3YWxscGFwZXIgdGFyZ2V0CisgICAgLy8gdG8gYW5vdGhlciwgYW5kIHRoaXMgaXMgdGhlIGhpZ2hlciBvbmUgaW4gWi1vcmRlci4KKyAgICBXaW5kb3dTdGF0ZSBtVXBwZXJXYWxscGFwZXJUYXJnZXQgPSBudWxsOworICAgIGludCBtV2FsbHBhcGVyQW5pbUxheWVyQWRqdXN0bWVudDsKKyAgICBmbG9hdCBtTGFzdFdhbGxwYXBlclg7CisgICAgZmxvYXQgbUxhc3RXYWxscGFwZXJZOworICAgIAogICAgIEFwcFdpbmRvd1Rva2VuIG1Gb2N1c2VkQXBwID0gbnVsbDsKIAogICAgIFBvd2VyTWFuYWdlclNlcnZpY2UgbVBvd2VyTWFuYWdlcjsKQEAgLTUxMiw2ICs1MzYsMTAgQEAKIAogICAgIHByaXZhdGUgV2luZG93TWFuYWdlclNlcnZpY2UoQ29udGV4dCBjb250ZXh0LCBQb3dlck1hbmFnZXJTZXJ2aWNlIHBtLAogICAgICAgICAgICAgYm9vbGVhbiBoYXZlSW5wdXRNZXRob2RzKSB7CisgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kpIHsKKyAgICAgICAgICAgIGx0ID0gbmV3IExhdGVuY3lUaW1lcigxMDAsIDEwMDApOworICAgICAgICB9CisgICAgICAgIAogICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CiAgICAgICAgIG1IYXZlSW5wdXRNZXRob2RzID0gaGF2ZUlucHV0TWV0aG9kczsKICAgICAgICAgbUxpbWl0ZWRBbHBoYUNvbXBvc2l0aW5nID0gY29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRCb29sZWFuKApAQCAtNjY2LDcgKzY5NCwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGktLTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0LndpbmRvd3Muc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBoYXZlbid0IHJlYWNoZWQgdGhlIHRva2VuIHlldDsgaWYgdGhpcyB0b2tlbgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgbm90IGdvaW5nIHRvIHRoZSBib3R0b20gYW5kIGhhcyB3aW5kb3dzLCB3ZSBjYW4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVzZSBpdCBhcyBhbiBhbmNob3IgZm9yIHdoZW4gd2UgZG8gcmVhY2ggdGhlIHRva2VuLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0LnNlbmRpbmdUb0JvdHRvbSAmJiB0LndpbmRvd3Muc2l6ZSgpID4gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcyA9IHQud2luZG93cy5nZXQoMCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTY4OCw2ICs3MjAsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2VXaW5kb3dCZWZvcmUocG9zLCB3aW4pOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ29udGludWUgbG9va2luZyBkb3duIHVudGlsIHdlIGZpbmQgdGhlIGZpcnN0CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0b2tlbiB0aGF0IGhhcyB3aW5kb3dzLgogICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGkgPj0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFwcFdpbmRvd1Rva2VuIHQgPSBtQXBwVG9rZW5zLmdldChpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgTlcgPSB0LndpbmRvd3Muc2l6ZSgpOwpAQCAtMTE1OSw2ICsxMTkzLDQ1MSBAQAogICAgICAgICBtb3ZlSW5wdXRNZXRob2REaWFsb2dzTG9ja2VkKGZpbmREZXNpcmVkSW5wdXRNZXRob2RXaW5kb3dJbmRleExvY2tlZCh0cnVlKSk7CiAgICAgfQogCisgICAgZmluYWwgYm9vbGVhbiBpc1dhbGxwYXBlclZpc2libGUoV2luZG93U3RhdGUgd2FsbHBhcGVyVGFyZ2V0KSB7CisgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywgIldhbGxwYXBlciB2aXM6IHRhcmdldCBvYnNjdXJlZD0iCisgICAgICAgICAgICAgICAgKyAod2FsbHBhcGVyVGFyZ2V0ICE9IG51bGwgPyBCb29sZWFuLnRvU3RyaW5nKHdhbGxwYXBlclRhcmdldC5tT2JzY3VyZWQpIDogIj8/IikKKyAgICAgICAgICAgICAgICArICIgYW5pbT0iICsgKCh3YWxscGFwZXJUYXJnZXQgIT0gbnVsbCAmJiB3YWxscGFwZXJUYXJnZXQubUFwcFRva2VuICE9IG51bGwpCisgICAgICAgICAgICAgICAgICAgICAgICA/IHdhbGxwYXBlclRhcmdldC5tQXBwVG9rZW4uYW5pbWF0aW9uIDogbnVsbCkKKyAgICAgICAgICAgICAgICArICIgdXBwZXI9IiArIG1VcHBlcldhbGxwYXBlclRhcmdldAorICAgICAgICAgICAgICAgICsgIiBsb3dlcj0iICsgbUxvd2VyV2FsbHBhcGVyVGFyZ2V0KTsKKyAgICAgICAgcmV0dXJuICh3YWxscGFwZXJUYXJnZXQgIT0gbnVsbAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCF3YWxscGFwZXJUYXJnZXQubU9ic2N1cmVkIHx8ICh3YWxscGFwZXJUYXJnZXQubUFwcFRva2VuICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgd2FsbHBhcGVyVGFyZ2V0Lm1BcHBUb2tlbi5hbmltYXRpb24gIT0gbnVsbCkpKQorICAgICAgICAgICAgICAgIHx8IG1VcHBlcldhbGxwYXBlclRhcmdldCAhPSBudWxsCisgICAgICAgICAgICAgICAgfHwgbUxvd2VyV2FsbHBhcGVyVGFyZ2V0ICE9IG51bGw7CisgICAgfQorICAgIAorICAgIHN0YXRpYyBmaW5hbCBpbnQgQURKVVNUX1dBTExQQVBFUl9MQVlFUlNfQ0hBTkdFRCA9IDE8PDE7CisgICAgc3RhdGljIGZpbmFsIGludCBBREpVU1RfV0FMTFBBUEVSX1ZJU0lCSUxJVFlfQ0hBTkdFRCA9IDE8PDI7CisgICAgCisgICAgaW50IGFkanVzdFdhbGxwYXBlcldpbmRvd3NMb2NrZWQoKSB7CisgICAgICAgIGludCBjaGFuZ2VkID0gMDsKKyAgICAgICAgCisgICAgICAgIGZpbmFsIGludCBkdyA9IG1EaXNwbGF5LmdldFdpZHRoKCk7CisgICAgICAgIGZpbmFsIGludCBkaCA9IG1EaXNwbGF5LmdldEhlaWdodCgpOworICAgICAgICAKKyAgICAgICAgLy8gRmlyc3QgZmluZCB0b3AtbW9zdCB3aW5kb3cgdGhhdCBoYXMgYXNrZWQgdG8gYmUgb24gdG9wIG9mIHRoZQorICAgICAgICAvLyB3YWxscGFwZXI7IGFsbCB3YWxscGFwZXJzIGdvIGJlaGluZCBpdC4KKyAgICAgICAgZmluYWwgQXJyYXlMaXN0IGxvY2FsbVdpbmRvd3MgPSBtV2luZG93czsKKyAgICAgICAgaW50IE4gPSBsb2NhbG1XaW5kb3dzLnNpemUoKTsKKyAgICAgICAgV2luZG93U3RhdGUgdyA9IG51bGw7CisgICAgICAgIFdpbmRvd1N0YXRlIGZvdW5kVyA9IG51bGw7CisgICAgICAgIGludCBmb3VuZEkgPSAwOworICAgICAgICBpbnQgaSA9IE47CisgICAgICAgIHdoaWxlIChpID4gMCkgeworICAgICAgICAgICAgaS0tOworICAgICAgICAgICAgdyA9IChXaW5kb3dTdGF0ZSlsb2NhbG1XaW5kb3dzLmdldChpKTsKKyAgICAgICAgICAgIGlmICh3Lm1BcHBUb2tlbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyB3aW5kb3cncyBhcHAgdG9rZW4gaXMgaGlkZGVuIGFuZCBub3QgYW5pbWF0aW5nLAorICAgICAgICAgICAgICAgIC8vIGl0IGlzIG9mIG5vIGludGVyZXN0IHRvIHVzLgorICAgICAgICAgICAgICAgIGlmICh3Lm1BcHBUb2tlbi5oaWRkZW4gJiYgdy5tQXBwVG9rZW4uYW5pbWF0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTa2lwcGluZyBoaWRkZW4gb3IgYW5pbWF0aW5nIHRva2VuOiAiICsgdyk7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBJZiB0aGlzIHdpbmRvdydzIGFwcCB0b2tlbiBpcyBvdCBmdWxsc2NyZWVuLCBhbHNvIGlycmVsZXZhbnQuCisgICAgICAgICAgICAgICAgaWYgKCF3Lm1BcHBUb2tlbi5hcHBGdWxsc2NyZWVuKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU2tpcHBpbmcgbm9uLWZ1bGxzY3JlZW4gdG9rZW46ICIgKyB3KTsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLCAiV2luICIgKyB3ICsgIjogcmVhZHlmb3JkaXNwbGF5PSIKKyAgICAgICAgICAgICAgICAgICAgKyB3LmlzUmVhZHlGb3JEaXNwbGF5KCkgKyAiIGRyYXdwZW5kaW5nPSIgKyB3Lm1EcmF3UGVuZGluZworICAgICAgICAgICAgICAgICAgICArICIgY29tbWl0ZHJhd3BlbmRpbmc9IiArIHcubUNvbW1pdERyYXdQZW5kaW5nKTsKKyAgICAgICAgICAgIGlmICgody5tQXR0cnMuZmxhZ3MmRkxBR19TSE9XX1dBTExQQVBFUikgIT0gMCAmJiB3LmlzUmVhZHlGb3JEaXNwbGF5KCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKG1XYWxscGFwZXJUYXJnZXQgPT0gdworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghdy5tRHJhd1BlbmRpbmcgJiYgIXcubUNvbW1pdERyYXdQZW5kaW5nKSkpIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0FMTFBBUEVSKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAiRm91bmQgd2FsbHBhcGVyIGFjdGl2aXR5OiAjIiArIGkgKyAiPSIgKyB3KTsKKyAgICAgICAgICAgICAgICBmb3VuZFcgPSB3OworICAgICAgICAgICAgICAgIGZvdW5kSSA9IGk7CisgICAgICAgICAgICAgICAgaWYgKHcgPT0gbVdhbGxwYXBlclRhcmdldCAmJiB3Lm1BcHBUb2tlbiAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICAgICAmJiB3Lm1BcHBUb2tlbi5hbmltYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAvLyBUaGUgY3VycmVudCB3YWxscGFwZXIgdGFyZ2V0IGlzIGFuaW1hdGluZywgc28gd2UnbGwKKyAgICAgICAgICAgICAgICAgICAgLy8gbG9vayBiZWhpbmQgaXQgZm9yIGFub3RoZXIgcG9zc2libGUgdGFyZ2V0IGFuZCBmaWd1cmUKKyAgICAgICAgICAgICAgICAgICAgLy8gb3V0IHdoYXQgaXMgZ29pbmcgb24gYmVsb3cuCisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywgIldpbiAiICsgdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogdG9rZW4gYW5pbWF0aW5nLCBsb29raW5nIGJlaGluZC4iKTsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKG1OZXh0QXBwVHJhbnNpdGlvbiAhPSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfTk9ORSkgeworICAgICAgICAgICAgLy8gSWYgd2UgYXJlIGN1cnJlbnRseSB3YWl0aW5nIGZvciBhbiBhcHAgdHJhbnNpdGlvbiwgYW5kIGVpdGhlcgorICAgICAgICAgICAgLy8gdGhlIGN1cnJlbnQgdGFyZ2V0IG9yIHRoZSBuZXh0IHRhcmdldCBhcmUgaW52b2x2ZWQgd2l0aCBpdCwKKyAgICAgICAgICAgIC8vIHRoZW4gaG9sZCBvZmYgb24gZG9pbmcgYW55dGhpbmcgd2l0aCB0aGUgd2FsbHBhcGVyLgorICAgICAgICAgICAgLy8gTm90ZSB0aGF0IHdlIGFyZSBjaGVja2luZyBoZXJlIGZvciBqdXN0IHdoZXRoZXIgdGhlIHRhcmdldAorICAgICAgICAgICAgLy8gaXMgcGFydCBvZiBhbiBhcHAgdG9rZW4uLi4gIHdoaWNoIGlzIHBvdGVudGlhbGx5IG92ZXJseSBhZ2dyZXNzaXZlCisgICAgICAgICAgICAvLyAodGhlIGFwcCB0b2tlbiBtYXkgbm90IGJlIGludm9sdmVkIGluIHRoZSB0cmFuc2l0aW9uKSwgYnV0IGdvb2QKKyAgICAgICAgICAgIC8vIGVub3VnaCAod2UnbGwganVzdCB3YWl0IHVudGlsIHdoYXRldmVyIHRyYW5zaXRpb24gaXMgcGVuZGluZworICAgICAgICAgICAgLy8gZXhlY3V0ZXMpLgorICAgICAgICAgICAgaWYgKG1XYWxscGFwZXJUYXJnZXQgIT0gbnVsbCAmJiBtV2FsbHBhcGVyVGFyZ2V0Lm1BcHBUb2tlbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgIldhbGxwYXBlciBub3QgY2hhbmdpbmc6IHdhaXRpbmcgZm9yIGFwcCBhbmltIGluIGN1cnJlbnQgdGFyZ2V0Iik7CisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZm91bmRXICE9IG51bGwgJiYgZm91bmRXLm1BcHBUb2tlbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgIldhbGxwYXBlciBub3QgY2hhbmdpbmc6IHdhaXRpbmcgZm9yIGFwcCBhbmltIGluIGZvdW5kIHRhcmdldCIpOworICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobVdhbGxwYXBlclRhcmdldCAhPSBmb3VuZFcpIHsKKyAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJOZXcgd2FsbHBhcGVyIHRhcmdldDogIiArIGZvdW5kVworICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG9sZFRhcmdldDogIiArIG1XYWxscGFwZXJUYXJnZXQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBtTG93ZXJXYWxscGFwZXJUYXJnZXQgPSBudWxsOworICAgICAgICAgICAgbVVwcGVyV2FsbHBhcGVyVGFyZ2V0ID0gbnVsbDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgV2luZG93U3RhdGUgb2xkVyA9IG1XYWxscGFwZXJUYXJnZXQ7CisgICAgICAgICAgICBtV2FsbHBhcGVyVGFyZ2V0ID0gZm91bmRXOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBOb3cgd2hhdCBpcyBoYXBwZW5pbmcuLi4gIGlmIHRoZSBjdXJyZW50IGFuZCBuZXcgdGFyZ2V0cyBhcmUKKyAgICAgICAgICAgIC8vIGFuaW1hdGluZywgdGhlbiB3ZSBhcmUgaW4gb3VyIHN1cGVyIHNwZWNpYWwgbW9kZSEKKyAgICAgICAgICAgIGlmIChmb3VuZFcgIT0gbnVsbCAmJiBmb3VuZFcubUFwcFRva2VuICE9IG51bGwgJiYgb2xkVyAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICYmIG9sZFcubUFwcFRva2VuICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0FMTFBBUEVSKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIk5ldyBhbmltYXRpb246ICIgKyBmb3VuZFcubUFwcFRva2VuLmFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBvbGQgYW5pbWF0aW9uOiAiICsgb2xkVy5tQXBwVG9rZW4uYW5pbWF0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGZvdW5kVy5tQXBwVG9rZW4uYW5pbWF0aW9uICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZFcubUFwcFRva2VuLmFuaW1hdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBvbGRJID0gbG9jYWxtV2luZG93cy5pbmRleE9mKG9sZFcpOworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0FMTFBBUEVSKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJOZXcgaTogIiArIGZvdW5kSSArICIgb2xkIGk6ICIgKyBvbGRJKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAob2xkSSA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0FMTFBBUEVSKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiQW5pbWF0aW5nIHdhbGxwYXBlcnM6IG9sZCMiICsgb2xkSQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiPSIgKyBvbGRXICsgIjsgbmV3IyIgKyBmb3VuZEkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIj0iICsgZm91bmRXKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBuZXcgdGFyZ2V0IGNvcnJlY3RseS4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmb3VuZFcubUFwcFRva2VuLmhpZGRlblJlcXVlc3RlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiT2xkIHdhbGxwYXBlciBzdGlsbCB0aGUgdGFyZ2V0LiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2FsbHBhcGVyVGFyZ2V0ID0gb2xkVzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm93IHNldCB0aGUgdXBwZXIgYW5kIGxvd2VyIHdhbGxwYXBlciB0YXJnZXRzCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb3JyZWN0bHksIGFuZCBtYWtlIHN1cmUgdGhhdCB3ZSBhcmUgcG9zaXRpb25pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSB3YWxscGFwZXIgYmVsb3cgdGhlIGxvd2VyLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvdW5kSSA+IG9sZEkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgbmV3IHRhcmdldCBpcyBvbiB0b3Agb2YgdGhlIG9sZCBvbmUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJGb3VuZCB0YXJnZXQgYWJvdmUgb2xkIHRhcmdldC4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVVwcGVyV2FsbHBhcGVyVGFyZ2V0ID0gZm91bmRXOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Mb3dlcldhbGxwYXBlclRhcmdldCA9IG9sZFc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm91bmRXID0gb2xkVzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZEkgPSBvbGRJOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgbmV3IHRhcmdldCBpcyBiZWxvdyB0aGUgb2xkIG9uZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0FMTFBBUEVSKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIkZvdW5kIHRhcmdldCBiZWxvdyBvbGQgdGFyZ2V0LiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVXBwZXJXYWxscGFwZXJUYXJnZXQgPSBvbGRXOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Mb3dlcldhbGxwYXBlclRhcmdldCA9IGZvdW5kVzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gSXMgaXQgdGltZSB0byBzdG9wIGFuaW1hdGluZz8KKyAgICAgICAgICAgIGlmIChtTG93ZXJXYWxscGFwZXJUYXJnZXQgPT0gbnVsbAorICAgICAgICAgICAgICAgICAgICB8fCBtTG93ZXJXYWxscGFwZXJUYXJnZXQubUFwcFRva2VuLmFuaW1hdGlvbiA9PSBudWxsCisgICAgICAgICAgICAgICAgICAgIHx8IG1VcHBlcldhbGxwYXBlclRhcmdldCA9PSBudWxsCisgICAgICAgICAgICAgICAgICAgIHx8IG1VcHBlcldhbGxwYXBlclRhcmdldC5tQXBwVG9rZW4uYW5pbWF0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0FMTFBBUEVSKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIk5vIGxvbmdlciBhbmltYXRpbmcgd2FsbHBhcGVyIHRhcmdldHMhIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1Mb3dlcldhbGxwYXBlclRhcmdldCA9IG51bGw7CisgICAgICAgICAgICAgICAgbVVwcGVyV2FsbHBhcGVyVGFyZ2V0ID0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgYm9vbGVhbiB2aXNpYmxlID0gZm91bmRXICE9IG51bGw7CisgICAgICAgIGlmICh2aXNpYmxlKSB7CisgICAgICAgICAgICAvLyBUaGUgd2luZG93IGlzIHZpc2libGUgdG8gdGhlIGNvbXBvc2l0b3IuLi4gIGJ1dCBpcyBpdCB2aXNpYmxlCisgICAgICAgICAgICAvLyB0byB0aGUgdXNlcj8gIFRoYXQgaXMgd2hhdCB0aGUgd2FsbHBhcGVyIGNhcmVzIGFib3V0LgorICAgICAgICAgICAgdmlzaWJsZSA9IGlzV2FsbHBhcGVyVmlzaWJsZShmb3VuZFcpOworICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLCAiV2FsbHBhcGVyIHZpc2liaWxpdHk6ICIgKyB2aXNpYmxlKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gSWYgdGhlIHdhbGxwYXBlciB0YXJnZXQgaXMgYW5pbWF0aW5nLCB3ZSBtYXkgbmVlZCB0byBjb3B5CisgICAgICAgICAgICAvLyBpdHMgbGF5ZXIgYWRqdXN0bWVudC4gIE9ubHkgZG8gdGhpcyBpZiB3ZSBhcmUgbm90IHRyYW5zZmVyaW5nCisgICAgICAgICAgICAvLyBiZXR3ZWVuIHR3byB3YWxscGFwZXIgdGFyZ2V0cy4KKyAgICAgICAgICAgIG1XYWxscGFwZXJBbmltTGF5ZXJBZGp1c3RtZW50ID0KKyAgICAgICAgICAgICAgICAgICAgKG1Mb3dlcldhbGxwYXBlclRhcmdldCA9PSBudWxsICYmIGZvdW5kVy5tQXBwVG9rZW4gIT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgPyBmb3VuZFcubUFwcFRva2VuLmFuaW1MYXllckFkanVzdG1lbnQgOiAwOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBOb3cgdyBpcyB0aGUgd2luZG93IHdlIGFyZSBzdXBwb3NlZCB0byBiZSBiZWhpbmQuLi4gIGJ1dCB3ZQorICAgICAgICAgICAgLy8gbmVlZCB0byBiZSBzdXJlIHRvIGFsc28gYmUgYmVoaW5kIGFueSBvZiBpdHMgYXR0YWNoZWQgd2luZG93cywKKyAgICAgICAgICAgIC8vIEFORCBhbnkgc3RhcnRpbmcgd2luZG93IGFzc29jaWF0ZWQgd2l0aCBpdC4KKyAgICAgICAgICAgIHdoaWxlIChmb3VuZEkgPiAwKSB7CisgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgd2IgPSAoV2luZG93U3RhdGUpbG9jYWxtV2luZG93cy5nZXQoZm91bmRJLTEpOworICAgICAgICAgICAgICAgIGlmICh3Yi5tQXR0YWNoZWRXaW5kb3cgIT0gZm91bmRXICYmCisgICAgICAgICAgICAgICAgICAgICAgICAod2IubUF0dHJzLnR5cGUgIT0gVFlQRV9BUFBMSUNBVElPTl9TVEFSVElORyB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3Yi5tVG9rZW4gIT0gZm91bmRXLm1Ub2tlbikpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyB3aW5kb3cgaXMgbm90IHJlbGF0ZWQgdG8gdGhlIHByZXZpb3VzIG9uZSBpbiBhbnkKKyAgICAgICAgICAgICAgICAgICAgLy8gaW50ZXJlc3Rpbmcgd2F5LCBzbyBzdG9wIGhlcmUuCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3VuZFcgPSB3YjsKKyAgICAgICAgICAgICAgICBmb3VuZEktLTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywgIldhbGxwYXBlciBub3QgdmlzaWJsZSIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBPa2F5IGkgaXMgdGhlIHBvc2l0aW9uIGltbWVkaWF0ZWx5IGFib3ZlIHRoZSB3YWxscGFwZXIuICBMb29rIGF0CisgICAgICAgIC8vIHdoYXQgaXMgYmVsb3cgaXQgZm9yIGxhdGVyLgorICAgICAgICBmb3VuZFcgPSBmb3VuZEkgPiAwID8gKFdpbmRvd1N0YXRlKWxvY2FsbVdpbmRvd3MuZ2V0KGZvdW5kSS0xKSA6IG51bGw7CisgICAgICAgIAorICAgICAgICBpZiAodmlzaWJsZSkgeworICAgICAgICAgICAgbUxhc3RXYWxscGFwZXJYID0gbVdhbGxwYXBlclRhcmdldC5tV2FsbHBhcGVyWDsKKyAgICAgICAgICAgIG1MYXN0V2FsbHBhcGVyWSA9IG1XYWxscGFwZXJUYXJnZXQubVdhbGxwYXBlclk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIFN0YXJ0IHN0ZXBwaW5nIGJhY2t3YXJkcyBmcm9tIGhlcmUsIGVuc3VyaW5nIHRoYXQgb3VyIHdhbGxwYXBlciB3aW5kb3dzCisgICAgICAgIC8vIGFyZSBjb3JyZWN0bHkgcGxhY2VkLgorICAgICAgICBpbnQgY3VyVG9rZW5JbmRleCA9IG1XYWxscGFwZXJUb2tlbnMuc2l6ZSgpOworICAgICAgICB3aGlsZSAoY3VyVG9rZW5JbmRleCA+IDApIHsKKyAgICAgICAgICAgIGN1clRva2VuSW5kZXgtLTsKKyAgICAgICAgICAgIFdpbmRvd1Rva2VuIHRva2VuID0gbVdhbGxwYXBlclRva2Vucy5nZXQoY3VyVG9rZW5JbmRleCk7CisgICAgICAgICAgICBpZiAodG9rZW4uaGlkZGVuID09IHZpc2libGUpIHsKKyAgICAgICAgICAgICAgICBjaGFuZ2VkIHw9IEFESlVTVF9XQUxMUEFQRVJfVklTSUJJTElUWV9DSEFOR0VEOworICAgICAgICAgICAgICAgIHRva2VuLmhpZGRlbiA9ICF2aXNpYmxlOworICAgICAgICAgICAgICAgIC8vIE5lZWQgdG8gZG8gYSBsYXlvdXQgdG8gZW5zdXJlIHRoZSB3YWxscGFwZXIgbm93IGhhcyB0aGUKKyAgICAgICAgICAgICAgICAvLyBjb3JyZWN0IHNpemUuCisgICAgICAgICAgICAgICAgbUxheW91dE5lZWRlZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGludCBjdXJXYWxscGFwZXJJbmRleCA9IHRva2VuLndpbmRvd3Muc2l6ZSgpOworICAgICAgICAgICAgd2hpbGUgKGN1cldhbGxwYXBlckluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIGN1cldhbGxwYXBlckluZGV4LS07CisgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgd2FsbHBhcGVyID0gdG9rZW4ud2luZG93cy5nZXQoY3VyV2FsbHBhcGVySW5kZXgpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVdhbGxwYXBlck9mZnNldExvY2tlZCh3YWxscGFwZXIsIGR3LCBkaCk7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIC8vIEZpcnN0LCBtYWtlIHN1cmUgdGhlIGNsaWVudCBoYXMgdGhlIGN1cnJlbnQgdmlzaWJpbGl0eQorICAgICAgICAgICAgICAgIC8vIHN0YXRlLgorICAgICAgICAgICAgICAgIGlmICh3YWxscGFwZXIubVdhbGxwYXBlclZpc2libGUgIT0gdmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICB3YWxscGFwZXIubVdhbGxwYXBlclZpc2libGUgPSB2aXNpYmxlOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX1ZJU0lCSUxJVFkgfHwgREVCVUdfV0FMTFBBUEVSKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTZXR0aW5nIHZpc2liaWxpdHkgb2Ygd2FsbHBhcGVyICIgKyB3YWxscGFwZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiAiICsgdmlzaWJsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB3YWxscGFwZXIubUNsaWVudC5kaXNwYXRjaEFwcFZpc2liaWxpdHkodmlzaWJsZSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgd2FsbHBhcGVyLm1BbmltTGF5ZXIgPSB3YWxscGFwZXIubUxheWVyICsgbVdhbGxwYXBlckFuaW1MYXllckFkanVzdG1lbnQ7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX0xBWUVSUyB8fCBERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywgIldhbGxwYXBlciB3aW4gIgorICAgICAgICAgICAgICAgICAgICAgICAgKyB3YWxscGFwZXIgKyAiIGFuaW0gbGF5ZXI6ICIgKyB3YWxscGFwZXIubUFuaW1MYXllcik7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLy8gRmlyc3QsIGlmIHRoaXMgd2luZG93IGlzIGF0IHRoZSBjdXJyZW50IGluZGV4LCB0aGVuIGFsbAorICAgICAgICAgICAgICAgIC8vIGlzIHdlbGwuCisgICAgICAgICAgICAgICAgaWYgKHdhbGxwYXBlciA9PSBmb3VuZFcpIHsKKyAgICAgICAgICAgICAgICAgICAgZm91bmRJLS07CisgICAgICAgICAgICAgICAgICAgIGZvdW5kVyA9IGZvdW5kSSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IChXaW5kb3dTdGF0ZSlsb2NhbG1XaW5kb3dzLmdldChmb3VuZEktMSkgOiBudWxsOworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLy8gVGhlIHdpbmRvdyBkaWRuJ3QgbWF0Y2guLi4gIHRoZSBjdXJyZW50IHdhbGxwYXBlciB3aW5kb3csCisgICAgICAgICAgICAgICAgLy8gd2hlcmV2ZXIgaXQgaXMsIGlzIGluIHRoZSB3cm9uZyBwbGFjZSwgc28gbWFrZSBzdXJlIGl0IGlzCisgICAgICAgICAgICAgICAgLy8gbm90IGluIHRoZSBsaXN0LgorICAgICAgICAgICAgICAgIGludCBvbGRJbmRleCA9IGxvY2FsbVdpbmRvd3MuaW5kZXhPZih3YWxscGFwZXIpOworICAgICAgICAgICAgICAgIGlmIChvbGRJbmRleCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGxvY2FsbVdpbmRvd3MucmVtb3ZlKG9sZEluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG9sZEluZGV4IDwgZm91bmRJKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZEktLTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAvLyBOb3cgc3RpY2sgaXQgaW4uCisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLCAiTW92aW5nIHdhbGxwYXBlciAiICsgd2FsbHBhcGVyCisgICAgICAgICAgICAgICAgICAgICAgICArICIgZnJvbSAiICsgb2xkSW5kZXggKyAiIHRvICIgKyBmb3VuZEkpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGxvY2FsbVdpbmRvd3MuYWRkKGZvdW5kSSwgd2FsbHBhcGVyKTsKKyAgICAgICAgICAgICAgICBjaGFuZ2VkIHw9IEFESlVTVF9XQUxMUEFQRVJfTEFZRVJTX0NIQU5HRUQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBjaGFuZ2VkOworICAgIH0KKworICAgIHZvaWQgc2V0V2FsbHBhcGVyQW5pbUxheWVyQWRqdXN0bWVudExvY2tlZChpbnQgYWRqKSB7CisgICAgICAgIGlmIChERUJVR19MQVlFUlMgfHwgREVCVUdfV0FMTFBBUEVSKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgIlNldHRpbmcgd2FsbHBhcGVyIGxheWVyIGFkaiB0byAiICsgYWRqKTsKKyAgICAgICAgbVdhbGxwYXBlckFuaW1MYXllckFkanVzdG1lbnQgPSBhZGo7CisgICAgICAgIGludCBjdXJUb2tlbkluZGV4ID0gbVdhbGxwYXBlclRva2Vucy5zaXplKCk7CisgICAgICAgIHdoaWxlIChjdXJUb2tlbkluZGV4ID4gMCkgeworICAgICAgICAgICAgY3VyVG9rZW5JbmRleC0tOworICAgICAgICAgICAgV2luZG93VG9rZW4gdG9rZW4gPSBtV2FsbHBhcGVyVG9rZW5zLmdldChjdXJUb2tlbkluZGV4KTsKKyAgICAgICAgICAgIGludCBjdXJXYWxscGFwZXJJbmRleCA9IHRva2VuLndpbmRvd3Muc2l6ZSgpOworICAgICAgICAgICAgd2hpbGUgKGN1cldhbGxwYXBlckluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIGN1cldhbGxwYXBlckluZGV4LS07CisgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgd2FsbHBhcGVyID0gdG9rZW4ud2luZG93cy5nZXQoY3VyV2FsbHBhcGVySW5kZXgpOworICAgICAgICAgICAgICAgIHdhbGxwYXBlci5tQW5pbUxheWVyID0gd2FsbHBhcGVyLm1MYXllciArIGFkajsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfTEFZRVJTIHx8IERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLCAiV2FsbHBhcGVyIHdpbiAiCisgICAgICAgICAgICAgICAgICAgICAgICArIHdhbGxwYXBlciArICIgYW5pbSBsYXllcjogIiArIHdhbGxwYXBlci5tQW5pbUxheWVyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGJvb2xlYW4gdXBkYXRlV2FsbHBhcGVyT2Zmc2V0TG9ja2VkKFdpbmRvd1N0YXRlIHdhbGxwYXBlcldpbiwgaW50IGR3LCBpbnQgZGgpIHsKKyAgICAgICAgYm9vbGVhbiBjaGFuZ2VkID0gZmFsc2U7CisgICAgICAgIGJvb2xlYW4gcmF3Q2hhbmdlZCA9IGZhbHNlOworICAgICAgICBpZiAobUxhc3RXYWxscGFwZXJYID49IDApIHsKKyAgICAgICAgICAgIGludCBhdmFpbHcgPSB3YWxscGFwZXJXaW4ubUZyYW1lLnJpZ2h0LXdhbGxwYXBlcldpbi5tRnJhbWUubGVmdC1kdzsKKyAgICAgICAgICAgIGludCBvZmZzZXQgPSBhdmFpbHcgPiAwID8gLShpbnQpKGF2YWlsdyptTGFzdFdhbGxwYXBlclgrLjVmKSA6IDA7CisgICAgICAgICAgICBjaGFuZ2VkID0gd2FsbHBhcGVyV2luLm1YT2Zmc2V0ICE9IG9mZnNldDsKKyAgICAgICAgICAgIGlmIChjaGFuZ2VkKSB7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLCAiVXBkYXRlIHdhbGxwYXBlciAiCisgICAgICAgICAgICAgICAgICAgICAgICArIHdhbGxwYXBlcldpbiArICIgeDogIiArIG9mZnNldCk7CisgICAgICAgICAgICAgICAgd2FsbHBhcGVyV2luLm1YT2Zmc2V0ID0gb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHdhbGxwYXBlcldpbi5tV2FsbHBhcGVyWCAhPSBtTGFzdFdhbGxwYXBlclgpIHsKKyAgICAgICAgICAgICAgICB3YWxscGFwZXJXaW4ubVdhbGxwYXBlclggPSBtTGFzdFdhbGxwYXBlclg7CisgICAgICAgICAgICAgICAgcmF3Q2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtTGFzdFdhbGxwYXBlclkgPj0gMCkgeworICAgICAgICAgICAgaW50IGF2YWlsaCA9IHdhbGxwYXBlcldpbi5tRnJhbWUuYm90dG9tLXdhbGxwYXBlcldpbi5tRnJhbWUudG9wLWRoOworICAgICAgICAgICAgaW50IG9mZnNldCA9IGF2YWlsaCA+IDAgPyAtKGludCkoYXZhaWxoKm1MYXN0V2FsbHBhcGVyWSsuNWYpIDogMDsKKyAgICAgICAgICAgIGlmICh3YWxscGFwZXJXaW4ubVlPZmZzZXQgIT0gb2Zmc2V0KSB7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLCAiVXBkYXRlIHdhbGxwYXBlciAiCisgICAgICAgICAgICAgICAgICAgICAgICArIHdhbGxwYXBlcldpbiArICIgeTogIiArIG9mZnNldCk7CisgICAgICAgICAgICAgICAgY2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgd2FsbHBhcGVyV2luLm1ZT2Zmc2V0ID0gb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHdhbGxwYXBlcldpbi5tV2FsbHBhcGVyWSAhPSBtTGFzdFdhbGxwYXBlclkpIHsKKyAgICAgICAgICAgICAgICB3YWxscGFwZXJXaW4ubVdhbGxwYXBlclkgPSBtTGFzdFdhbGxwYXBlclk7CisgICAgICAgICAgICAgICAgcmF3Q2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChyYXdDaGFuZ2VkKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywgIlJlcG9ydCBuZXcgd3Agb2Zmc2V0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgd2FsbHBhcGVyV2luICsgIiB4PSIgKyB3YWxscGFwZXJXaW4ubVdhbGxwYXBlclgKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiB5PSIgKyB3YWxscGFwZXJXaW4ubVdhbGxwYXBlclkpOworICAgICAgICAgICAgICAgIHdhbGxwYXBlcldpbi5tQ2xpZW50LmRpc3BhdGNoV2FsbHBhcGVyT2Zmc2V0cygKKyAgICAgICAgICAgICAgICAgICAgICAgIHdhbGxwYXBlcldpbi5tV2FsbHBhcGVyWCwgd2FsbHBhcGVyV2luLm1XYWxscGFwZXJZKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBjaGFuZ2VkOworICAgIH0KKyAgICAKKyAgICBib29sZWFuIHVwZGF0ZVdhbGxwYXBlck9mZnNldExvY2tlZCgpIHsKKyAgICAgICAgZmluYWwgaW50IGR3ID0gbURpc3BsYXkuZ2V0V2lkdGgoKTsKKyAgICAgICAgZmluYWwgaW50IGRoID0gbURpc3BsYXkuZ2V0SGVpZ2h0KCk7CisgICAgICAgIAorICAgICAgICBib29sZWFuIGNoYW5nZWQgPSBmYWxzZTsKKyAgICAgICAgCisgICAgICAgIFdpbmRvd1N0YXRlIHRhcmdldCA9IG1XYWxscGFwZXJUYXJnZXQ7CisgICAgICAgIGlmICh0YXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgbUxhc3RXYWxscGFwZXJYID0gdGFyZ2V0Lm1XYWxscGFwZXJYOworICAgICAgICAgICAgbUxhc3RXYWxscGFwZXJZID0gdGFyZ2V0Lm1XYWxscGFwZXJZOworICAgICAgICAgICAgaW50IGN1clRva2VuSW5kZXggPSBtV2FsbHBhcGVyVG9rZW5zLnNpemUoKTsKKyAgICAgICAgICAgIHdoaWxlIChjdXJUb2tlbkluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIGN1clRva2VuSW5kZXgtLTsKKyAgICAgICAgICAgICAgICBXaW5kb3dUb2tlbiB0b2tlbiA9IG1XYWxscGFwZXJUb2tlbnMuZ2V0KGN1clRva2VuSW5kZXgpOworICAgICAgICAgICAgICAgIGludCBjdXJXYWxscGFwZXJJbmRleCA9IHRva2VuLndpbmRvd3Muc2l6ZSgpOworICAgICAgICAgICAgICAgIHdoaWxlIChjdXJXYWxscGFwZXJJbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgY3VyV2FsbHBhcGVySW5kZXgtLTsKKyAgICAgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgd2FsbHBhcGVyID0gdG9rZW4ud2luZG93cy5nZXQoY3VyV2FsbHBhcGVySW5kZXgpOworICAgICAgICAgICAgICAgICAgICBpZiAodXBkYXRlV2FsbHBhcGVyT2Zmc2V0TG9ja2VkKHdhbGxwYXBlciwgZHcsIGRoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgd2FsbHBhcGVyLmNvbXB1dGVTaG93bkZyYW1lTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFuZ2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcmV0dXJuIGNoYW5nZWQ7CisgICAgfQorICAgIAorICAgIHZvaWQgdXBkYXRlV2FsbHBhcGVyVmlzaWJpbGl0eUxvY2tlZCgpIHsKKyAgICAgICAgZmluYWwgYm9vbGVhbiB2aXNpYmxlID0gaXNXYWxscGFwZXJWaXNpYmxlKG1XYWxscGFwZXJUYXJnZXQpOworICAgICAgICBmaW5hbCBpbnQgZHcgPSBtRGlzcGxheS5nZXRXaWR0aCgpOworICAgICAgICBmaW5hbCBpbnQgZGggPSBtRGlzcGxheS5nZXRIZWlnaHQoKTsKKyAgICAgICAgCisgICAgICAgIGludCBjdXJUb2tlbkluZGV4ID0gbVdhbGxwYXBlclRva2Vucy5zaXplKCk7CisgICAgICAgIHdoaWxlIChjdXJUb2tlbkluZGV4ID4gMCkgeworICAgICAgICAgICAgY3VyVG9rZW5JbmRleC0tOworICAgICAgICAgICAgV2luZG93VG9rZW4gdG9rZW4gPSBtV2FsbHBhcGVyVG9rZW5zLmdldChjdXJUb2tlbkluZGV4KTsKKyAgICAgICAgICAgIGlmICh0b2tlbi5oaWRkZW4gPT0gdmlzaWJsZSkgeworICAgICAgICAgICAgICAgIHRva2VuLmhpZGRlbiA9ICF2aXNpYmxlOworICAgICAgICAgICAgICAgIC8vIE5lZWQgdG8gZG8gYSBsYXlvdXQgdG8gZW5zdXJlIHRoZSB3YWxscGFwZXIgbm93IGhhcyB0aGUKKyAgICAgICAgICAgICAgICAvLyBjb3JyZWN0IHNpemUuCisgICAgICAgICAgICAgICAgbUxheW91dE5lZWRlZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGludCBjdXJXYWxscGFwZXJJbmRleCA9IHRva2VuLndpbmRvd3Muc2l6ZSgpOworICAgICAgICAgICAgd2hpbGUgKGN1cldhbGxwYXBlckluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIGN1cldhbGxwYXBlckluZGV4LS07CisgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgd2FsbHBhcGVyID0gdG9rZW4ud2luZG93cy5nZXQoY3VyV2FsbHBhcGVySW5kZXgpOworICAgICAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVdhbGxwYXBlck9mZnNldExvY2tlZCh3YWxscGFwZXIsIGR3LCBkaCk7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmICh3YWxscGFwZXIubVdhbGxwYXBlclZpc2libGUgIT0gdmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICB3YWxscGFwZXIubVdhbGxwYXBlclZpc2libGUgPSB2aXNpYmxlOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX1ZJU0lCSUxJVFkgfHwgREVCVUdfV0FMTFBBUEVSKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVcGRhdGluZyB2aXNpYmlsaXR5IG9mIHdhbGxwYXBlciAiICsgd2FsbHBhcGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogIiArIHZpc2libGUpOworICAgICAgICAgICAgICAgICAgICAgICAgd2FsbHBhcGVyLm1DbGllbnQuZGlzcGF0Y2hBcHBWaXNpYmlsaXR5KHZpc2libGUpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIHZvaWQgc2VuZFBvaW50ZXJUb1dhbGxwYXBlckxvY2tlZChXaW5kb3dTdGF0ZSBzcmNXaW4sCisgICAgICAgICAgICBNb3Rpb25FdmVudCBwb2ludGVyLCBsb25nIGV2ZW50VGltZSkgeworICAgICAgICBpbnQgY3VyVG9rZW5JbmRleCA9IG1XYWxscGFwZXJUb2tlbnMuc2l6ZSgpOworICAgICAgICB3aGlsZSAoY3VyVG9rZW5JbmRleCA+IDApIHsKKyAgICAgICAgICAgIGN1clRva2VuSW5kZXgtLTsKKyAgICAgICAgICAgIFdpbmRvd1Rva2VuIHRva2VuID0gbVdhbGxwYXBlclRva2Vucy5nZXQoY3VyVG9rZW5JbmRleCk7CisgICAgICAgICAgICBpbnQgY3VyV2FsbHBhcGVySW5kZXggPSB0b2tlbi53aW5kb3dzLnNpemUoKTsKKyAgICAgICAgICAgIHdoaWxlIChjdXJXYWxscGFwZXJJbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICBjdXJXYWxscGFwZXJJbmRleC0tOworICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIHdhbGxwYXBlciA9IHRva2VuLndpbmRvd3MuZ2V0KGN1cldhbGxwYXBlckluZGV4KTsKKyAgICAgICAgICAgICAgICBpZiAoKHdhbGxwYXBlci5tQXR0cnMuZmxhZ3MgJgorICAgICAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19OT1RfVE9VQ0hBQkxFKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBNb3Rpb25FdmVudCBldiA9IE1vdGlvbkV2ZW50Lm9idGFpbk5vSGlzdG9yeShwb2ludGVyKTsKKyAgICAgICAgICAgICAgICAgICAgZXYub2Zmc2V0TG9jYXRpb24oc3JjV2luLm1GcmFtZS5sZWZ0LXdhbGxwYXBlci5tRnJhbWUubGVmdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNXaW4ubUZyYW1lLnRvcC13YWxscGFwZXIubUZyYW1lLnRvcCk7CisgICAgICAgICAgICAgICAgICAgIHdhbGxwYXBlci5tQ2xpZW50LmRpc3BhdGNoUG9pbnRlcihldiwgZXZlbnRUaW1lLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRmFpbHVyZSBzZW5kaW5nIHBvaW50ZXIgdG8gd2FsbHBhcGVyIiwgZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAogICAgIHB1YmxpYyBpbnQgYWRkV2luZG93KFNlc3Npb24gc2Vzc2lvbiwgSVdpbmRvdyBjbGllbnQsCiAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyBhdHRycywgaW50IHZpZXdWaXNpYmlsaXR5LAogICAgICAgICAgICAgUmVjdCBvdXRDb250ZW50SW5zZXRzKSB7CkBAIC0xMjE2LDYgKzE2OTUsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBhdHRycy50b2tlbiArICIuICBBYm9ydGluZy4iKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFdpbmRvd01hbmFnZXJJbXBsLkFERF9CQURfQVBQX1RPS0VOOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoYXR0cnMudHlwZSA9PSBUWVBFX1dBTExQQVBFUikgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJBdHRlbXB0ZWQgdG8gYWRkIHdhbGxwYXBlciB3aW5kb3cgd2l0aCB1bmtub3duIHRva2VuICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKyBhdHRycy50b2tlbiArICIuICBBYm9ydGluZy4iKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFdpbmRvd01hbmFnZXJJbXBsLkFERF9CQURfQVBQX1RPS0VOOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB0b2tlbiA9IG5ldyBXaW5kb3dUb2tlbihhdHRycy50b2tlbiwgLTEsIGZhbHNlKTsKICAgICAgICAgICAgICAgICBhZGRUb2tlbiA9IHRydWU7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKGF0dHJzLnR5cGUgPj0gRklSU1RfQVBQTElDQVRJT05fV0lORE9XCkBAIC0xMjQyLDYgKzE3MjYsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGF0dHJzLnRva2VuICsgIi4gIEFib3J0aW5nLiIpOwogICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBXaW5kb3dNYW5hZ2VySW1wbC5BRERfQkFEX0FQUF9UT0tFTjsKICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKGF0dHJzLnR5cGUgPT0gVFlQRV9XQUxMUEFQRVIpIHsKKyAgICAgICAgICAgICAgICBpZiAodG9rZW4ud2luZG93VHlwZSAhPSBUWVBFX1dBTExQQVBFUikgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJBdHRlbXB0ZWQgdG8gYWRkIHdhbGxwYXBlciB3aW5kb3cgd2l0aCBiYWQgdG9rZW4gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYXR0cnMudG9rZW4gKyAiLiAgQWJvcnRpbmcuIik7CisgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFdpbmRvd01hbmFnZXJJbXBsLkFERF9CQURfQVBQX1RPS0VOOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgd2luID0gbmV3IFdpbmRvd1N0YXRlKHNlc3Npb24sIGNsaWVudCwgdG9rZW4sCkBAIC0xMjkyLDYgKzE3ODIsMTAgQEAKICAgICAgICAgICAgICAgICBpbU1heU1vdmUgPSBmYWxzZTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgYWRkV2luZG93VG9MaXN0SW5PcmRlckxvY2tlZCh3aW4sIHRydWUpOworICAgICAgICAgICAgICAgIGlmIChhdHRycy50eXBlID09IFRZUEVfV0FMTFBBUEVSIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAoYXR0cnMuZmxhZ3MmRkxBR19TSE9XX1dBTExQQVBFUikgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBhZGp1c3RXYWxscGFwZXJXaW5kb3dzTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICB3aW4ubUVudGVyQW5pbWF0aW9uUGVuZGluZyA9IHRydWU7CkBAIC0xNDMyLDYgKzE5MjYsOCBAQAogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCByZW1vdmVXaW5kb3dJbm5lckxvY2tlZChTZXNzaW9uIHNlc3Npb24sIFdpbmRvd1N0YXRlIHdpbikgeworICAgICAgICBtS2V5V2FpdGVyLmZpbmlzaGVkS2V5KHNlc3Npb24sIHdpbi5tQ2xpZW50LCB0cnVlLAorICAgICAgICAgICAgICAgIEtleVdhaXRlci5SRVRVUk5fTk9USElORyk7CiAgICAgICAgIG1LZXlXYWl0ZXIucmVsZWFzZVBlbmRpbmdQb2ludGVyTG9ja2VkKHdpbi5tU2Vzc2lvbik7CiAgICAgICAgIG1LZXlXYWl0ZXIucmVsZWFzZVBlbmRpbmdUcmFja2JhbGxMb2NrZWQod2luLm1TZXNzaW9uKTsKIApAQCAtMTQ0MSw2ICsxOTM3LDEyIEBACiAgICAgICAgICAgICBtb3ZlSW5wdXRNZXRob2RXaW5kb3dzSWZOZWVkZWRMb2NrZWQoZmFsc2UpOwogICAgICAgICB9CiAKKyAgICAgICAgaWYgKGZhbHNlKSB7CisgICAgICAgICAgICBSdW50aW1lRXhjZXB0aW9uIGUgPSBuZXcgUnVudGltZUV4Y2VwdGlvbigiaGVyZSIpOworICAgICAgICAgICAgZS5maWxsSW5TdGFja1RyYWNlKCk7CisgICAgICAgICAgICBMb2cudyhUQUcsICJSZW1vdmluZyB3aW5kb3cgIiArIHdpbiwgZSk7CisgICAgICAgIH0KKyAgICAgICAgCiAgICAgICAgIG1Qb2xpY3kucmVtb3ZlV2luZG93THcod2luKTsKICAgICAgICAgd2luLnJlbW92ZUxvY2tlZCgpOwogCkBAIC0xNDkwLDYgKzE5OTIsMTEgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCisgICAgICAgIGlmICh3aW4ubUF0dHJzLnR5cGUgPT0gVFlQRV9XQUxMUEFQRVIgfHwKKyAgICAgICAgICAgICAgICAod2luLm1BdHRycy5mbGFncyZGTEFHX1NIT1dfV0FMTFBBUEVSKSAhPSAwKSB7CisgICAgICAgICAgICBhZGp1c3RXYWxscGFwZXJXaW5kb3dzTG9ja2VkKCk7CisgICAgICAgIH0KKyAgICAgICAgCiAgICAgICAgIGlmICghbUluTGF5b3V0KSB7CiAgICAgICAgICAgICBhc3NpZ25MYXllcnNMb2NrZWQoKTsKICAgICAgICAgICAgIG1MYXlvdXROZWVkZWQgPSB0cnVlOwpAQCAtMTUwNiwxMCArMjAxMywxNSBAQAogICAgICAgICAgICAgc3luY2hyb25pemVkIChtV2luZG93TWFwKSB7CiAgICAgICAgICAgICAgICAgV2luZG93U3RhdGUgdyA9IHdpbmRvd0ZvckNsaWVudExvY2tlZChzZXNzaW9uLCBjbGllbnQpOwogICAgICAgICAgICAgICAgIGlmICgodyAhPSBudWxsKSAmJiAody5tU3VyZmFjZSAhPSBudWxsKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoU0hPV19UUkFOU0FDVElPTlMpIExvZy5pKFRBRywgIj4+PiBPUEVOIFRSQU5TQUNUSU9OIik7CiAgICAgICAgICAgICAgICAgICAgIFN1cmZhY2Uub3BlblRyYW5zYWN0aW9uKCk7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU0hPV19UUkFOU0FDVElPTlMpIExvZy5pKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUQUcsICIgIFNVUkZBQ0UgIiArIHcubVN1cmZhY2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiB0cmFuc3BhcmVudFJlZ2lvbkhpbnQ9IiArIHJlZ2lvbik7CiAgICAgICAgICAgICAgICAgICAgICAgICB3Lm1TdXJmYWNlLnNldFRyYW5zcGFyZW50UmVnaW9uSGludChyZWdpb24pOwogICAgICAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBMb2cuaShUQUcsICI8PDwgQ0xPU0UgVFJBTlNBQ1RJT04iKTsKICAgICAgICAgICAgICAgICAgICAgICAgIFN1cmZhY2UuY2xvc2VUcmFuc2FjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQpAQCAtMTU1Miw2ICsyMDY0LDE5IEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwdWJsaWMgdm9pZCBzZXRXaW5kb3dXYWxscGFwZXJQb3NpdGlvbkxvY2tlZChXaW5kb3dTdGF0ZSB3aW5kb3csIGZsb2F0IHgsIGZsb2F0IHkpIHsKKyAgICAgICAgaWYgKHdpbmRvdy5tV2FsbHBhcGVyWCAhPSB4IHx8IHdpbmRvdy5tV2FsbHBhcGVyWSAhPSB5KSAgeworICAgICAgICAgICAgd2luZG93Lm1XYWxscGFwZXJYID0geDsKKyAgICAgICAgICAgIHdpbmRvdy5tV2FsbHBhcGVyWSA9IHk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyVGFyZ2V0ID09IHdpbmRvdykgeworICAgICAgICAgICAgICAgIGlmICh1cGRhdGVXYWxscGFwZXJPZmZzZXRMb2NrZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBwZXJmb3JtTGF5b3V0QW5kUGxhY2VTdXJmYWNlc0xvY2tlZCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKICAgICBwdWJsaWMgaW50IHJlbGF5b3V0V2luZG93KFNlc3Npb24gc2Vzc2lvbiwgSVdpbmRvdyBjbGllbnQsCiAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyBhdHRycywgaW50IHJlcXVlc3RlZFdpZHRoLAogICAgICAgICAgICAgaW50IHJlcXVlc3RlZEhlaWdodCwgaW50IHZpZXdWaXNpYmlsaXR5LCBib29sZWFuIGluc2V0c1BlbmRpbmcsCkBAIC0xNjEwLDYgKzIxMzUsOSBAQAogICAgICAgICAgICAgICAgICAgICB8fCAoKGZsYWdDaGFuZ2VzJldpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLkZMQUdfTk9UX0ZPQ1VTQUJMRSkgIT0gMCkKICAgICAgICAgICAgICAgICAgICAgfHwgKCF3aW4ubVJlbGF5b3V0Q2FsbGVkKTsKIAorICAgICAgICAgICAgYm9vbGVhbiB3YWxscGFwZXJNYXlNb3ZlID0gd2luLm1WaWV3VmlzaWJpbGl0eSAhPSB2aWV3VmlzaWJpbGl0eQorICAgICAgICAgICAgICAgICAgICAmJiAod2luLm1BdHRycy5mbGFncyAmIEZMQUdfU0hPV19XQUxMUEFQRVIpICE9IDA7CisgICAgICAgICAgICAKICAgICAgICAgICAgIHdpbi5tUmVsYXlvdXRDYWxsZWQgPSB0cnVlOwogICAgICAgICAgICAgZmluYWwgaW50IG9sZFZpc2liaWxpdHkgPSB3aW4ubVZpZXdWaXNpYmlsaXR5OwogICAgICAgICAgICAgd2luLm1WaWV3VmlzaWJpbGl0eSA9IHZpZXdWaXNpYmlsaXR5OwpAQCAtMTY0MCwxMyArMjE2OCwxNyBAQAogICAgICAgICAgICAgICAgICAgICBTdXJmYWNlIHN1cmZhY2UgPSB3aW4uY3JlYXRlU3VyZmFjZUxvY2tlZCgpOwogICAgICAgICAgICAgICAgICAgICBpZiAoc3VyZmFjZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBvdXRTdXJmYWNlLmNvcHlGcm9tKHN1cmZhY2UpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBMb2cuaShUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgIE9VVCBTVVJGQUNFICIgKyBvdXRTdXJmYWNlICsgIjogY29waWVkIik7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvdXRTdXJmYWNlLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBGb3Igc29tZSByZWFzb24gdGhlcmUgaXNuJ3QgYSBzdXJmYWNlLiAgQ2xlYXIgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjYWxsZXIncyBvYmplY3Qgc28gdGhleSBzZWUgdGhlIHNhbWUgc3RhdGUuCisgICAgICAgICAgICAgICAgICAgICAgICBvdXRTdXJmYWNlLnJlbGVhc2UoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkV4Y2VwdGlvbiB0aHJvd24gd2hlbiBjcmVhdGluZyBzdXJmYWNlIGZvciBjbGllbnQgIgotICAgICAgICAgICAgICAgICAgICAgICAgICsgY2xpZW50ICsgIiAoIiArIHdpbi5tQXR0cnMuZ2V0VGl0bGUoKSArICIpIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjbGllbnQgKyAiICgiICsgd2luLm1BdHRycy5nZXRUaXRsZSgpICsgIikiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlKTsKICAgICAgICAgICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkob3JpZ0lkKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgICAgICAgfQpAQCAtMTY4Nyw3ICsyMjE5LDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3V0U3VyZmFjZS5jbGVhcigpOworICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBiZWluZyBjYWxsZWQgZnJvbSBhIGxvY2FsIHByb2Nlc3MsIHdoaWNoCisgICAgICAgICAgICAgICAgLy8gbWVhbnMgb3V0U3VyZmFjZSBob2xkcyBpdHMgY3VycmVudCBzdXJmYWNlLiAgRW5zdXJlIHRoZQorICAgICAgICAgICAgICAgIC8vIHN1cmZhY2Ugb2JqZWN0IGlzIGNsZWFyZWQsIGJ1dCB3ZSBkb24ndCB3YW50IGl0IGFjdHVhbGx5CisgICAgICAgICAgICAgICAgLy8gZGVzdHJveWVkIGF0IHRoaXMgcG9pbnQuCisgICAgICAgICAgICAgICAgb3V0U3VyZmFjZS5yZWxlYXNlKCk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChmb2N1c01heUNoYW5nZSkgewpAQCAtMTcwNyw2ICsyMjQzLDExIEBACiAgICAgICAgICAgICAgICAgICAgIGFzc2lnbkxheWVycyA9IHRydWU7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHdhbGxwYXBlck1heU1vdmUpIHsKKyAgICAgICAgICAgICAgICBpZiAoKGFkanVzdFdhbGxwYXBlcldpbmRvd3NMb2NrZWQoKSZBREpVU1RfV0FMTFBBUEVSX0xBWUVSU19DSEFOR0VEKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGFzc2lnbkxheWVycyA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBtTGF5b3V0TmVlZGVkID0gdHJ1ZTsKICAgICAgICAgICAgIHdpbi5tR2l2ZW5JbnNldHNQZW5kaW5nID0gaW5zZXRzUGVuZGluZzsKQEAgLTE3MTUsNiArMjI1NiwxMCBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgbmV3Q29uZmlnID0gdXBkYXRlT3JpZW50YXRpb25Gcm9tQXBwVG9rZW5zTG9ja2VkKG51bGwsIG51bGwpOwogICAgICAgICAgICAgcGVyZm9ybUxheW91dEFuZFBsYWNlU3VyZmFjZXNMb2NrZWQoKTsKKyAgICAgICAgICAgIGlmIChkaXNwbGF5ZWQgJiYgd2luLm1Jc1dhbGxwYXBlcikgeworICAgICAgICAgICAgICAgIHVwZGF0ZVdhbGxwYXBlck9mZnNldExvY2tlZCh3aW4sIG1EaXNwbGF5LmdldFdpZHRoKCksCisgICAgICAgICAgICAgICAgICAgICAgICBtRGlzcGxheS5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAod2luLm1BcHBUb2tlbiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgd2luLm1BcHBUb2tlbi51cGRhdGVSZXBvcnRlZFZpc2liaWxpdHlMb2NrZWQoKTsKICAgICAgICAgICAgIH0KQEAgLTE3NTAsNiArMjI5NSw5IEBACiAgICAgICAgIHN5bmNocm9uaXplZChtV2luZG93TWFwKSB7CiAgICAgICAgICAgICBXaW5kb3dTdGF0ZSB3aW4gPSB3aW5kb3dGb3JDbGllbnRMb2NrZWQoc2Vzc2lvbiwgY2xpZW50KTsKICAgICAgICAgICAgIGlmICh3aW4gIT0gbnVsbCAmJiB3aW4uZmluaXNoRHJhd2luZ0xvY2tlZCgpKSB7CisgICAgICAgICAgICAgICAgaWYgKCh3aW4ubUF0dHJzLmZsYWdzJkZMQUdfU0hPV19XQUxMUEFQRVIpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgYWRqdXN0V2FsbHBhcGVyV2luZG93c0xvY2tlZCgpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtTGF5b3V0TmVlZGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBwZXJmb3JtTGF5b3V0QW5kUGxhY2VTdXJmYWNlc0xvY2tlZCgpOwogICAgICAgICAgICAgfQpAQCAtMTkwNiw2ICsyNDU0LDI2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tUb0JhY2tFbnRlckFuaW1hdGlvbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrVG9CYWNrRXhpdEFuaW1hdGlvbjsKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIFdpbmRvd01hbmFnZXJQb2xpY3kuVFJBTlNJVF9XQUxMUEFQRVJfT1BFTjoKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVyT3BlbkVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dhbGxwYXBlck9wZW5FeGl0QW5pbWF0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgV2luZG93TWFuYWdlclBvbGljeS5UUkFOU0lUX1dBTExQQVBFUl9DTE9TRToKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVyQ2xvc2VFbnRlckFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93YWxscGFwZXJDbG9zZUV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX09QRU46CisgICAgICAgICAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dhbGxwYXBlckludHJhT3BlbkVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dhbGxwYXBlckludHJhT3BlbkV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX0NMT1NFOgorICAgICAgICAgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93YWxscGFwZXJJbnRyYUNsb3NlRW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVySW50cmFDbG9zZUV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYSA9IGxvYWRBbmltYXRpb24obHAsIGFuaW1BdHRyKTsKICAgICAgICAgICAgICAgICBpZiAoREVCVUdfQU5JTSkgTG9nLnYoVEFHLCAiYXBwbHlBbmltYXRpb246IHd0b2tlbj0iICsgd3Rva2VuCkBAIC0yMDAyLDYgKzI1NzAsOSBAQAogICAgICAgICAgICAgd3Rva2VuID0gbmV3IFdpbmRvd1Rva2VuKHRva2VuLCB0eXBlLCB0cnVlKTsKICAgICAgICAgICAgIG1Ub2tlbk1hcC5wdXQodG9rZW4sIHd0b2tlbik7CiAgICAgICAgICAgICBtVG9rZW5MaXN0LmFkZCh3dG9rZW4pOworICAgICAgICAgICAgaWYgKHR5cGUgPT0gVFlQRV9XQUxMUEFQRVIpIHsKKyAgICAgICAgICAgICAgICBtV2FsbHBhcGVyVG9rZW5zLmFkZCh3dG9rZW4pOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCkBAIC0yMDQ3LDYgKzI2MTgsOCBAQAogCiAgICAgICAgICAgICAgICAgICAgIGlmIChkZWxheWVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtRXhpdGluZ1Rva2Vucy5hZGQod3Rva2VuKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3dG9rZW4ud2luZG93VHlwZSA9PSBUWVBFX1dBTExQQVBFUikgeworICAgICAgICAgICAgICAgICAgICAgICAgbVdhbGxwYXBlclRva2Vucy5yZW1vdmUod3Rva2VuKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIApAQCAtMjIwNiwxMCArMjc3OSwxMCBAQAogICAgICAgICBDb25maWd1cmF0aW9uIGNvbmZpZzsKICAgICAgICAgc3luY2hyb25pemVkKG1XaW5kb3dNYXApIHsKICAgICAgICAgICAgIGNvbmZpZyA9IHVwZGF0ZU9yaWVudGF0aW9uRnJvbUFwcFRva2Vuc0xvY2tlZChjdXJyZW50Q29uZmlnLCBmcmVlemVUaGlzT25lSWZOZWVkZWQpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChjb25maWcgIT0gbnVsbCkgewotICAgICAgICAgICAgbUxheW91dE5lZWRlZCA9IHRydWU7Ci0gICAgICAgICAgICBwZXJmb3JtTGF5b3V0QW5kUGxhY2VTdXJmYWNlc0xvY2tlZCgpOworICAgICAgICAgICAgaWYgKGNvbmZpZyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUxheW91dE5lZWRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgcGVyZm9ybUxheW91dEFuZFBsYWNlU3VyZmFjZXNMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gY29uZmlnOwogICAgIH0KQEAgLTIyNTksNyArMjgzMiw2IEBACiAgICAgICAgICAgICAgICAgbVRlbXBDb25maWd1cmF0aW9uLnNldFRvRGVmYXVsdHMoKTsKICAgICAgICAgICAgICAgICBpZiAoY29tcHV0ZU5ld0NvbmZpZ3VyYXRpb25Mb2NrZWQobVRlbXBDb25maWd1cmF0aW9uKSkgewogICAgICAgICAgICAgICAgICAgICBpZiAoYXBwQ29uZmlnLmRpZmYobVRlbXBDb25maWd1cmF0aW9uKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJDb25maWcgY2hhbmdlZDogIiArIG1UZW1wQ29uZmlndXJhdGlvbik7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IENvbmZpZ3VyYXRpb24obVRlbXBDb25maWd1cmF0aW9uKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KQEAgLTI1MTksNiArMzA5MSwyMyBAQAogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgLy8gSWYgdGhpcyBpcyBhIHRyYW5zbHVjZW50IG9yIHdhbGxwYXBlciB3aW5kb3csIHRoZW4gZG9uJ3QKKyAgICAgICAgICAgIC8vIHNob3cgYSBzdGFydGluZyB3aW5kb3cgLS0gdGhlIGN1cnJlbnQgZWZmZWN0IChhIGZ1bGwtc2NyZWVuCisgICAgICAgICAgICAvLyBvcGFxdWUgc3RhcnRpbmcgd2luZG93IHRoYXQgZmFkZXMgYXdheSB0byB0aGUgcmVhbCBjb250ZW50cworICAgICAgICAgICAgLy8gd2hlbiBpdCBpcyByZWFkeSkgZG9lcyBub3Qgd29yayBmb3IgdGhpcy4KKyAgICAgICAgICAgIGlmICh0aGVtZSAhPSAwKSB7CisgICAgICAgICAgICAgICAgQXR0cmlidXRlQ2FjaGUuRW50cnkgZW50ID0gQXR0cmlidXRlQ2FjaGUuaW5zdGFuY2UoKS5nZXQocGtnLCB0aGVtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvdyk7CisgICAgICAgICAgICAgICAgaWYgKGVudC5hcnJheS5nZXRCb29sZWFuKAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93X3dpbmRvd0lzVHJhbnNsdWNlbnQsIGZhbHNlKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChlbnQuYXJyYXkuZ2V0Qm9vbGVhbigKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd193aW5kb3dTaG93V2FsbHBhcGVyLCBmYWxzZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAogICAgICAgICAgICAgbVN0YXJ0aW5nSWNvbkluVHJhbnNpdGlvbiA9IHRydWU7CiAgICAgICAgICAgICB3dG9rZW4uc3RhcnRpbmdEYXRhID0gbmV3IFN0YXJ0aW5nRGF0YSgKICAgICAgICAgICAgICAgICAgICAgcGtnLCB0aGVtZSwgbm9uTG9jYWxpemVkTGFiZWwsCkBAIC0yNjgwLDEyICszMjY5LDE0IEBACiAgICAgICAgICAgICAgICAgd3Rva2VuLnNldER1bW15QW5pbWF0aW9uKCk7CiAgICAgICAgICAgICAgICAgbU9wZW5pbmdBcHBzLnJlbW92ZSh3dG9rZW4pOwogICAgICAgICAgICAgICAgIG1DbG9zaW5nQXBwcy5yZW1vdmUod3Rva2VuKTsKKyAgICAgICAgICAgICAgICB3dG9rZW4ud2FpdGluZ1RvU2hvdyA9IHd0b2tlbi53YWl0aW5nVG9IaWRlID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgd3Rva2VuLmluUGVuZGluZ1RyYW5zYWN0aW9uID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBpZiAodmlzaWJsZSkgewogICAgICAgICAgICAgICAgICAgICBtT3BlbmluZ0FwcHMuYWRkKHd0b2tlbik7CiAgICAgICAgICAgICAgICAgICAgIHd0b2tlbi5hbGxEcmF3biA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICB3dG9rZW4uc3RhcnRpbmdEaXNwbGF5ZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgd3Rva2VuLnN0YXJ0aW5nTW92ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgd3Rva2VuLndhaXRpbmdUb1Nob3cgPSB0cnVlOwogCiAgICAgICAgICAgICAgICAgICAgIGlmICh3dG9rZW4uY2xpZW50SGlkZGVuKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbiB0aGUgY2FzZSB3aGVyZSB3ZSBhcmUgbWFraW5nIGFuIGFwcCB2aXNpYmxlCkBAIC0yNjk5LDYgKzMyOTAsNyBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgbUNsb3NpbmdBcHBzLmFkZCh3dG9rZW4pOworICAgICAgICAgICAgICAgICAgICB3dG9rZW4ud2FpdGluZ1RvSGlkZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KQEAgLTI4MzMsMTAgKzM0MjUsMTIgQEAKICAgICAgICAgICAgICAgICBkZWxheWVkID0gc2V0VG9rZW5WaXNpYmlsaXR5TG9ja2VkKHd0b2tlbiwgbnVsbCwgZmFsc2UsIFdpbmRvd01hbmFnZXJQb2xpY3kuVFJBTlNJVF9OT05FLCB0cnVlKTsKICAgICAgICAgICAgICAgICB3dG9rZW4uaW5QZW5kaW5nVHJhbnNhY3Rpb24gPSBmYWxzZTsKICAgICAgICAgICAgICAgICBtT3BlbmluZ0FwcHMucmVtb3ZlKHd0b2tlbik7CisgICAgICAgICAgICAgICAgd3Rva2VuLndhaXRpbmdUb1Nob3cgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBpZiAobUNsb3NpbmdBcHBzLmNvbnRhaW5zKHd0b2tlbikpIHsKICAgICAgICAgICAgICAgICAgICAgZGVsYXllZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtTmV4dEFwcFRyYW5zaXRpb24gIT0gV2luZG93TWFuYWdlclBvbGljeS5UUkFOU0lUX05PTkUpIHsKICAgICAgICAgICAgICAgICAgICAgbUNsb3NpbmdBcHBzLmFkZCh3dG9rZW4pOworICAgICAgICAgICAgICAgICAgICB3dG9rZW4ud2FpdGluZ1RvSGlkZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIGRlbGF5ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAoREVCVUdfQVBQX1RSQU5TSVRJT05TKSBMb2cudigKQEAgLTI4ODEsMTEgKzM0NzUsMTUgQEAKICAgICAgICAgZmluYWwgaW50IE5XID0gdG9rZW4ud2luZG93cy5zaXplKCk7CiAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOVzsgaSsrKSB7CiAgICAgICAgICAgICBXaW5kb3dTdGF0ZSB3aW4gPSB0b2tlbi53aW5kb3dzLmdldChpKTsKKyAgICAgICAgICAgIGlmIChERUJVR19XSU5ET1dfTU9WRU1FTlQpIExvZy52KFRBRywgIlRtcCByZW1vdmluZyB3aW5kb3cgIiArIHdpbik7CiAgICAgICAgICAgICBtV2luZG93cy5yZW1vdmUod2luKTsKICAgICAgICAgICAgIGludCBqID0gd2luLm1DaGlsZFdpbmRvd3Muc2l6ZSgpOwogICAgICAgICAgICAgd2hpbGUgKGogPiAwKSB7CiAgICAgICAgICAgICAgICAgai0tOwotICAgICAgICAgICAgICAgIG1XaW5kb3dzLnJlbW92ZSh3aW4ubUNoaWxkV2luZG93cy5nZXQoaikpOworICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIGN3aW4gPSAoV2luZG93U3RhdGUpd2luLm1DaGlsZFdpbmRvd3MuZ2V0KGopOworICAgICAgICAgICAgICAgIGlmIChERUJVR19XSU5ET1dfTU9WRU1FTlQpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICJUbXAgcmVtb3ZpbmcgY2hpbGQgd2luZG93ICIgKyBjd2luKTsKKyAgICAgICAgICAgICAgICBtV2luZG93cy5yZW1vdmUoY3dpbik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIE5XID4gMDsKQEAgLTI5MjMsNiArMzUyMSwxMiBAQAogICAgICAgICAgICAgZmluYWwgQXBwV2luZG93VG9rZW4gd3Rva2VuID0gbUFwcFRva2Vucy5nZXQodG9rZW5Qb3MtMSk7CiAgICAgICAgICAgICBpZiAoREVCVUdfUkVPUkRFUikgTG9nLnYoVEFHLCAiTG9va2luZyBmb3IgbG93ZXIgd2luZG93cyBAICIKICAgICAgICAgICAgICAgICAgICAgKyB0b2tlblBvcyArICIgLS0gIiArIHd0b2tlbi50b2tlbik7CisgICAgICAgICAgICBpZiAod3Rva2VuLnNlbmRpbmdUb0JvdHRvbSkgeworICAgICAgICAgICAgICAgIGlmIChERUJVR19SRU9SREVSKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAiU2tpcHBpbmcgdG9rZW4gLS0gY3VycmVudGx5IHNlbmRpbmcgdG8gYm90dG9tIik7CisgICAgICAgICAgICAgICAgdG9rZW5Qb3MtLTsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGludCBpID0gd3Rva2VuLndpbmRvd3Muc2l6ZSgpOwogICAgICAgICAgICAgd2hpbGUgKGkgPiAwKSB7CiAgICAgICAgICAgICAgICAgaS0tOwpAQCAtMjkzMSw3ICszNTM1LDcgQEAKICAgICAgICAgICAgICAgICB3aGlsZSAoaiA+IDApIHsKICAgICAgICAgICAgICAgICAgICAgai0tOwogICAgICAgICAgICAgICAgICAgICBXaW5kb3dTdGF0ZSBjd2luID0gKFdpbmRvd1N0YXRlKXdpbi5tQ2hpbGRXaW5kb3dzLmdldChqKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGN3aW4ubVN1YkxheWVyID49IDAgKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChjd2luLm1TdWJMYXllciA+PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBwb3M9TlctMTsgcG9zPj0wOyBwb3MtLSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtV2luZG93cy5nZXQocG9zKSA9PSBjd2luKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19SRU9SREVSKSBMb2cudihUQUcsCkBAIC0yOTYwLDE0ICszNTY0LDIwIEBACiAgICAgICAgIGZvciAoaW50IGo9MDsgajxOQ1c7IGorKykgewogICAgICAgICAgICAgV2luZG93U3RhdGUgY3dpbiA9IChXaW5kb3dTdGF0ZSl3aW4ubUNoaWxkV2luZG93cy5nZXQoaik7CiAgICAgICAgICAgICBpZiAoIWFkZGVkICYmIGN3aW4ubVN1YkxheWVyID49IDApIHsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0lORE9XX01PVkVNRU5UKSBMb2cudihUQUcsICJSZS1hZGRpbmcgY2hpbGQgd2luZG93IGF0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgaW5kZXggKyAiOiAiICsgY3dpbik7CiAgICAgICAgICAgICAgICAgbVdpbmRvd3MuYWRkKGluZGV4LCB3aW4pOwogICAgICAgICAgICAgICAgIGluZGV4Kys7CiAgICAgICAgICAgICAgICAgYWRkZWQgPSB0cnVlOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKERFQlVHX1dJTkRPV19NT1ZFTUVOVCkgTG9nLnYoVEFHLCAiUmUtYWRkaW5nIHdpbmRvdyBhdCAiCisgICAgICAgICAgICAgICAgICAgICsgaW5kZXggKyAiOiAiICsgY3dpbik7CiAgICAgICAgICAgICBtV2luZG93cy5hZGQoaW5kZXgsIGN3aW4pOwogICAgICAgICAgICAgaW5kZXgrKzsKICAgICAgICAgfQogICAgICAgICBpZiAoIWFkZGVkKSB7CisgICAgICAgICAgICBpZiAoREVCVUdfV0lORE9XX01PVkVNRU5UKSBMb2cudihUQUcsICJSZS1hZGRpbmcgd2luZG93IGF0ICIKKyAgICAgICAgICAgICAgICAgICAgKyBpbmRleCArICI6ICIgKyB3aW4pOwogICAgICAgICAgICAgbVdpbmRvd3MuYWRkKGluZGV4LCB3aW4pOwogICAgICAgICAgICAgaW5kZXgrKzsKICAgICAgICAgfQpAQCAtMzAzNSw2ICszNjQ1LDI2IEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgbW92ZUFwcFdpbmRvd3NMb2NrZWQoQXBwV2luZG93VG9rZW4gd3Rva2VuLCBpbnQgdG9rZW5Qb3MsCisgICAgICAgICAgICBib29sZWFuIHVwZGF0ZUZvY3VzQW5kTGF5b3V0KSB7CisgICAgICAgIC8vIEZpcnN0IHJlbW92ZSBhbGwgb2YgdGhlIHdpbmRvd3MgZnJvbSB0aGUgbGlzdC4KKyAgICAgICAgdG1wUmVtb3ZlQXBwV2luZG93c0xvY2tlZCh3dG9rZW4pOworCisgICAgICAgIC8vIFdoZXJlIHRvIHN0YXJ0IGFkZGluZz8KKyAgICAgICAgaW50IHBvcyA9IGZpbmRXaW5kb3dPZmZzZXRMb2NrZWQodG9rZW5Qb3MpOworCisgICAgICAgIC8vIEFuZCBub3cgYWRkIHRoZW0gYmFjayBhdCB0aGUgY29ycmVjdCBwbGFjZS4KKyAgICAgICAgcG9zID0gcmVBZGRBcHBXaW5kb3dzTG9ja2VkKHBvcywgd3Rva2VuKTsKKworICAgICAgICBpZiAodXBkYXRlRm9jdXNBbmRMYXlvdXQpIHsKKyAgICAgICAgICAgIGlmICghdXBkYXRlRm9jdXNlZFdpbmRvd0xvY2tlZChVUERBVEVfRk9DVVNfV0lMTF9QTEFDRV9TVVJGQUNFUykpIHsKKyAgICAgICAgICAgICAgICBhc3NpZ25MYXllcnNMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1MYXlvdXROZWVkZWQgPSB0cnVlOworICAgICAgICAgICAgcGVyZm9ybUxheW91dEFuZFBsYWNlU3VyZmFjZXNMb2NrZWQoKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHByaXZhdGUgdm9pZCBtb3ZlQXBwV2luZG93c0xvY2tlZChMaXN0PElCaW5kZXI+IHRva2VucywgaW50IHRva2VuUG9zKSB7CiAgICAgICAgIC8vIEZpcnN0IHJlbW92ZSBhbGwgb2YgdGhlIHdpbmRvd3MgZnJvbSB0aGUgbGlzdC4KICAgICAgICAgZmluYWwgaW50IE4gPSB0b2tlbnMuc2l6ZSgpOwpAQCAtMzA1Nyw3ICszNjg3LDkgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIHVwZGF0ZUZvY3VzZWRXaW5kb3dMb2NrZWQoVVBEQVRFX0ZPQ1VTX1dJTExfUExBQ0VfU1VSRkFDRVMpOworICAgICAgICBpZiAoIXVwZGF0ZUZvY3VzZWRXaW5kb3dMb2NrZWQoVVBEQVRFX0ZPQ1VTX1dJTExfUExBQ0VfU1VSRkFDRVMpKSB7CisgICAgICAgICAgICBhc3NpZ25MYXllcnNMb2NrZWQoKTsKKyAgICAgICAgfQogICAgICAgICBtTGF5b3V0TmVlZGVkID0gdHJ1ZTsKICAgICAgICAgcGVyZm9ybUxheW91dEFuZFBsYWNlU3VyZmFjZXNMb2NrZWQoKTsKIApAQCAtMzA3OCw5ICszNzEwLDE5IEBACiAgICAgICAgICAgICAgICAgQXBwV2luZG93VG9rZW4gd3QgPSBmaW5kQXBwV2luZG93VG9rZW4odG9rZW5zLmdldChpKSk7CiAgICAgICAgICAgICAgICAgaWYgKHd0ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgbUFwcFRva2Vucy5hZGQod3QpOworICAgICAgICAgICAgICAgICAgICBpZiAobU5leHRBcHBUcmFuc2l0aW9uICE9IFdpbmRvd01hbmFnZXJQb2xpY3kuVFJBTlNJVF9OT05FKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG9Ub3BBcHBzLnJlbW92ZSh3dCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG9Cb3R0b21BcHBzLnJlbW92ZSh3dCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG9Ub3BBcHBzLmFkZCh3dCk7CisgICAgICAgICAgICAgICAgICAgICAgICB3dC5zZW5kaW5nVG9Cb3R0b20gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHd0LnNlbmRpbmdUb1RvcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBtb3ZlQXBwV2luZG93c0xvY2tlZCh0b2tlbnMsIG1BcHBUb2tlbnMuc2l6ZSgpKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG1OZXh0QXBwVHJhbnNpdGlvbiA9PSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfTk9ORSkgeworICAgICAgICAgICAgICAgIG1vdmVBcHBXaW5kb3dzTG9ja2VkKHRva2VucywgbUFwcFRva2Vucy5zaXplKCkpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KG9yaWdJZCk7CiAgICAgfQpAQCAtMzEwMCwxMCArMzc0MiwyMCBAQAogICAgICAgICAgICAgICAgIEFwcFdpbmRvd1Rva2VuIHd0ID0gZmluZEFwcFdpbmRvd1Rva2VuKHRva2Vucy5nZXQoaSkpOwogICAgICAgICAgICAgICAgIGlmICh3dCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG1BcHBUb2tlbnMuYWRkKHBvcywgd3QpOworICAgICAgICAgICAgICAgICAgICBpZiAobU5leHRBcHBUcmFuc2l0aW9uICE9IFdpbmRvd01hbmFnZXJQb2xpY3kuVFJBTlNJVF9OT05FKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG9Ub3BBcHBzLnJlbW92ZSh3dCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG9Cb3R0b21BcHBzLnJlbW92ZSh3dCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG9Cb3R0b21BcHBzLmFkZChpLCB3dCk7CisgICAgICAgICAgICAgICAgICAgICAgICB3dC5zZW5kaW5nVG9Ub3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHd0LnNlbmRpbmdUb0JvdHRvbSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgcG9zKys7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgbW92ZUFwcFdpbmRvd3NMb2NrZWQodG9rZW5zLCAwKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG1OZXh0QXBwVHJhbnNpdGlvbiA9PSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfTk9ORSkgeworICAgICAgICAgICAgICAgIG1vdmVBcHBXaW5kb3dzTG9ja2VkKHRva2VucywgMCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkob3JpZ0lkKTsKICAgICB9CkBAIC0zNzM1LDE5ICs0Mzg3LDYgQEAKICAgICAgICAgaWYgKCFjb21wdXRlTmV3Q29uZmlndXJhdGlvbkxvY2tlZChjb25maWcpKSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICBMb2cuaShUQUcsICJDb25maWcgY2hhbmdlZDogIiArIGNvbmZpZyk7Ci0gICAgICAgIGxvbmcgbm93ID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7Ci0gICAgICAgIC8vTG9nLmkoVEFHLCAiQ29uZmlnIGNoYW5naW5nLCBnYyBwZW5kaW5nOiAiICsgbUZyZWV6ZUdjUGVuZGluZyArICIsIG5vdyAiICsgbm93KTsKLSAgICAgICAgaWYgKG1GcmVlemVHY1BlbmRpbmcgIT0gMCkgewotICAgICAgICAgICAgaWYgKG5vdyA+IChtRnJlZXplR2NQZW5kaW5nKzEwMDApKSB7Ci0gICAgICAgICAgICAgICAgLy9Mb2cuaShUQUcsICJHYyEgICIgKyBub3cgKyAiID4gIiArIChtRnJlZXplR2NQZW5kaW5nKzEwMDApKTsKLSAgICAgICAgICAgICAgICBtSC5yZW1vdmVNZXNzYWdlcyhILkZPUkNFX0dDKTsKLSAgICAgICAgICAgICAgICBSdW50aW1lLmdldFJ1bnRpbWUoKS5nYygpOwotICAgICAgICAgICAgICAgIG1GcmVlemVHY1BlbmRpbmcgPSBub3c7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtRnJlZXplR2NQZW5kaW5nID0gbm93OwotICAgICAgICB9CiAgICAgICAgIHJldHVybiBjb25maWc7CiAgICAgfQogCkBAIC0zODMzLDcgKzQ0NzIsNyBAQAogICAgIHByaXZhdGUgZmluYWwgdm9pZCB3YWtldXBJZk5lZWRlZChXaW5kb3dTdGF0ZSB0YXJnZXRXaW4sIGludCBldmVudFR5cGUpIHsKICAgICAgICAgbG9uZyBjdXJUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CiAKLSAgICAgICAgaWYgKGV2ZW50VHlwZSA9PSBMT05HX1RPVUNIX0VWRU5UIHx8IGV2ZW50VHlwZSA9PSBDSEVFS19FVkVOVCkgeworICAgICAgICBpZiAoZXZlbnRUeXBlID09IFRPVUNIX0VWRU5UIHx8IGV2ZW50VHlwZSA9PSBMT05HX1RPVUNIX0VWRU5UIHx8IGV2ZW50VHlwZSA9PSBDSEVFS19FVkVOVCkgewogICAgICAgICAgICAgaWYgKG1MYXN0VG91Y2hFdmVudFR5cGUgPT0gZXZlbnRUeXBlICYmCiAgICAgICAgICAgICAgICAgICAgIChjdXJUaW1lIC0gbUxhc3RVc2VyQWN0aXZpdHlDYWxsVGltZSkgPCBNSU5fVElNRV9CRVRXRUVOX1VTRVJBQ1RJVklUSUVTKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwpAQCAtMzg5Myw4ICs0NTMyLDE2IEBACiAgICAgICAgIGlmIChERUJVR19JTlBVVCB8fCBXaW5kb3dNYW5hZ2VyUG9saWN5LldBVENIX1BPSU5URVIpIExvZy52KFRBRywKICAgICAgICAgICAgICAgICAiZGlzcGF0Y2hQb2ludGVyICIgKyBldik7CiAKKyAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSkgeworICAgICAgICAgICAgbHQuc2FtcGxlKCIzIFdhaXQgZm9yIGxhc3QgZGlzcGF0Y2ggIiwgU3lzdGVtLm5hbm9UaW1lKCkgLSBxZXYud2hlbk5hbm8pOworICAgICAgICB9CisKICAgICAgICAgT2JqZWN0IHRhcmdldE9iaiA9IG1LZXlXYWl0ZXIud2FpdEZvck5leHRFdmVudFRhcmdldChudWxsLCBxZXYsCiAgICAgICAgICAgICAgICAgZXYsIHRydWUsIGZhbHNlLCBwaWQsIHVpZCk7CisgICAgICAgIAorICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7CisgICAgICAgICAgICBsdC5zYW1wbGUoIjMgTGFzdCBkaXNwYXRjaCBmaW5pc2hlZCAiLCBTeXN0ZW0ubmFub1RpbWUoKSAtIHFldi53aGVuTmFubyk7CisgICAgICAgIH0KIAogICAgICAgICBpbnQgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCk7CiAKQEAgLTM5MzIsNyArNDU3OSw4IEBACiAgICAgICAgIFdpbmRvd1N0YXRlIHRhcmdldCA9IChXaW5kb3dTdGF0ZSl0YXJnZXRPYmo7CiAKICAgICAgICAgZmluYWwgbG9uZyBldmVudFRpbWUgPSBldi5nZXRFdmVudFRpbWUoKTsKLQorICAgICAgICBmaW5hbCBsb25nIGV2ZW50VGltZU5hbm8gPSBldi5nZXRFdmVudFRpbWVOYW5vKCk7CisgICAgICAgIAogICAgICAgICAvL0xvZy5pKFRBRywgIlNlbmRpbmcgIiArIGV2ICsgIiB0byAiICsgdGFyZ2V0KTsKIAogICAgICAgICBpZiAodWlkICE9IDAgJiYgdWlkICE9IHRhcmdldC5tU2Vzc2lvbi5tVWlkKSB7CkBAIC0zOTQ5LDYgKzQ1OTcsMTAgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gSU5KRUNUX05PX1BFUk1JU1NJT047CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kpIHsKKyAgICAgICAgICAgIGx0LnNhbXBsZSgiNCBpbiBkaXNwYXRjaFBvaW50ZXIgICAgICIsIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnRUaW1lTmFubyk7CisgICAgICAgIH0KIAogICAgICAgICBpZiAoKHRhcmdldC5tQXR0cnMuZmxhZ3MgJgogICAgICAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19JR05PUkVfQ0hFRUtfUFJFU1NFUykgIT0gMCkgewpAQCAtNDAzMiw2ICs0Njg0LDEwIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAorICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7CisgICAgICAgICAgICBsdC5zYW1wbGUoIjUgaW4gZGlzcGF0Y2hQb2ludGVyICAgICAiLCBTeXN0ZW0ubmFub1RpbWUoKSAtIGV2ZW50VGltZU5hbm8pOworICAgICAgICB9CisKICAgICAgICAgc3luY2hyb25pemVkKG1XaW5kb3dNYXApIHsKICAgICAgICAgICAgIGlmIChxZXYgIT0gbnVsbCAmJiBhY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX01PVkUpIHsKICAgICAgICAgICAgICAgICBtS2V5V2FpdGVyLmJpbmRUYXJnZXRXaW5kb3dMb2NrZWQodGFyZ2V0LApAQCAtNDA0Nyw3ICs0NzAzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBSZWN0IGZyYW1lID0gb3V0Lm1GcmFtZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZXYub2Zmc2V0TG9jYXRpb24oLShmbG9hdClmcmFtZS5sZWZ0LCAtKGZsb2F0KWZyYW1lLnRvcCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0Lm1DbGllbnQuZGlzcGF0Y2hQb2ludGVyKG9ldiwgZXZlbnRUaW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0Lm1DbGllbnQuZGlzcGF0Y2hQb2ludGVyKG9ldiwgZXZlbnRUaW1lLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJXSU5ET1cgRElFRCBkdXJpbmcgb3V0c2lkZSBtb3Rpb24gZGlzcGF0Y2g6ICIgKyBvdXQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTQwNjAsNiArNDcxNiwxMiBAQAogICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgZnJhbWUgPSB0YXJnZXQubUZyYW1lOwogICAgICAgICAgICAgICAgIGV2Lm9mZnNldExvY2F0aW9uKC0oZmxvYXQpZnJhbWUubGVmdCwgLShmbG9hdClmcmFtZS50b3ApOwogICAgICAgICAgICAgICAgIG1LZXlXYWl0ZXIuYmluZFRhcmdldFdpbmRvd0xvY2tlZCh0YXJnZXQpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIC8vIElmIHdlIGFyZSBvbiB0b3Agb2YgdGhlIHdhbGxwYXBlciwgdGhlbiB0aGUgd2FsbHBhcGVyIGFsc28KKyAgICAgICAgICAgICAgICAvLyBnZXRzIHRvIHNlZSB0aGlzIG1vdmVtZW50LgorICAgICAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyVGFyZ2V0ID09IHRhcmdldCkgeworICAgICAgICAgICAgICAgICAgICBzZW5kUG9pbnRlclRvV2FsbHBhcGVyTG9ja2VkKHRhcmdldCwgZXYsIGV2ZW50VGltZSk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTQwNjksNyArNDczMSwxNiBAQAogICAgICAgICAgICAgaWYgKERFQlVHX0lOUFVUIHx8IERFQlVHX0ZPQ1VTIHx8IFdpbmRvd01hbmFnZXJQb2xpY3kuV0FUQ0hfUE9JTlRFUikgewogICAgICAgICAgICAgICAgIExvZy52KFRBRywgIkRlbGl2ZXJpbmcgcG9pbnRlciAiICsgcWV2ICsgIiB0byAiICsgdGFyZ2V0KTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHRhcmdldC5tQ2xpZW50LmRpc3BhdGNoUG9pbnRlcihldiwgZXZlbnRUaW1lKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSkgeworICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiNiBiZWZvcmUgc3ZyLT5jbGllbnQgaXBjICIsIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnRUaW1lTmFubyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRhcmdldC5tQ2xpZW50LmRpc3BhdGNoUG9pbnRlcihldiwgZXZlbnRUaW1lLCB0cnVlKTsKKworICAgICAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSkgeworICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiNyBhZnRlciAgc3ZyLT5jbGllbnQgaXBjICIsIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnRUaW1lTmFubyk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gSU5KRUNUX1NVQ0NFRURFRDsKICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgTG9nLmkoVEFHLCAiV0lORE9XIERJRUQgZHVyaW5nIG1vdGlvbiBkaXNwYXRjaDogIiArIHRhcmdldCk7CkBAIC00MTQxLDcgKzQ4MTIsNyBAQAogICAgICAgICB9CiAKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGZvY3VzLm1DbGllbnQuZGlzcGF0Y2hUcmFja2JhbGwoZXYsIGV2ZW50VGltZSk7CisgICAgICAgICAgICBmb2N1cy5tQ2xpZW50LmRpc3BhdGNoVHJhY2tiYWxsKGV2LCBldmVudFRpbWUsIHRydWUpOwogICAgICAgICAgICAgcmV0dXJuIElOSkVDVF9TVUNDRUVERUQ7CiAgICAgICAgIH0gY2F0Y2ggKGFuZHJvaWQub3MuUmVtb3RlRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIExvZy5pKFRBRywgIldJTkRPVyBESUVEIGR1cmluZyBrZXkgZGlzcGF0Y2g6ICIgKyBmb2N1cyk7CkBAIC00NjY0LDcgKzUzMzUsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGluZ1BpZCwgY2FsbGluZ1VpZCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IFBhY2thZ2VNYW5hZ2VyLlBFUk1JU1NJT05fR1JBTlRFRCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeS5pbnRlcmNlcHRLZXlUaShudWxsLCBrZXljb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0S2V5LmdldE1ldGFTdGF0ZSgpLCBkb3duLCByZXBlYXRDb3VudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRLZXkuZ2V0TWV0YVN0YXRlKCksIGRvd24sIHJlcGVhdENvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0S2V5LmdldEZsYWdzKCkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkV2ZW50IHRpbWVvdXQgZHVyaW5nIGFwcCBzd2l0Y2g6IGRyb3BwaW5nICIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG5leHRLZXkpOwpAQCAtNDY4Nyw3ICs1MzU5LDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGluZ1BpZCwgY2FsbGluZ1VpZCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gUGFja2FnZU1hbmFnZXIuUEVSTUlTU0lPTl9HUkFOVEVEKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChtUG9saWN5LmludGVyY2VwdEtleVRpKGZvY3VzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleWNvZGUsIG5leHRLZXkuZ2V0TWV0YVN0YXRlKCksIGRvd24sIHJlcGVhdENvdW50KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleWNvZGUsIG5leHRLZXkuZ2V0TWV0YVN0YXRlKCksIGRvd24sIHJlcGVhdENvdW50LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0S2V5LmdldEZsYWdzKCkpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ09OU1VNRURfRVZFTlRfVE9LRU47CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CkBAIC00OTE0LDE0ICs1NTg3LDE2IEBACiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICB9CiAKKyAgICAgICAgICAgIE1vdGlvbkV2ZW50IHJlcyA9IG51bGw7CisgICAgICAgICAgICBRdWV1ZWRFdmVudCBxZXYgPSBudWxsOworICAgICAgICAgICAgV2luZG93U3RhdGUgd2luID0gbnVsbDsKKyAgICAgICAgICAgIAogICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0lOUFVUKSBMb2cudigKICAgICAgICAgICAgICAgICAgICAgVEFHLCAiZmluaXNoZWRLZXk6IGNsaWVudD0iICsgY2xpZW50LmFzQmluZGVyKCkKICAgICAgICAgICAgICAgICAgICAgKyAiLCBmb3JjZT0iICsgZm9yY2UgKyAiLCBsYXN0PSIgKyBtTGFzdEJpbmRlcgogICAgICAgICAgICAgICAgICAgICArICIgKHRva2VuPSIgKyAobUxhc3RXaW4gIT0gbnVsbCA/IG1MYXN0V2luLm1Ub2tlbiA6IG51bGwpICsgIikiKTsKIAotICAgICAgICAgICAgICAgIFF1ZXVlZEV2ZW50IHFldiA9IG51bGw7Ci0gICAgICAgICAgICAgICAgV2luZG93U3RhdGUgd2luID0gbnVsbDsKICAgICAgICAgICAgICAgICBpZiAocmV0dXJuV2hhdCA9PSBSRVRVUk5fUEVORElOR19QT0lOVEVSKSB7CiAgICAgICAgICAgICAgICAgICAgIHFldiA9IHNlc3Npb24ubVBlbmRpbmdQb2ludGVyTW92ZTsKICAgICAgICAgICAgICAgICAgICAgd2luID0gc2Vzc2lvbi5tUGVuZGluZ1BvaW50ZXJXaW5kb3c7CkBAIC00OTUxLDE3ICs1NjI2LDI1IEBACiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgaWYgKHFldiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIE1vdGlvbkV2ZW50IHJlcyA9IChNb3Rpb25FdmVudClxZXYuZXZlbnQ7CisgICAgICAgICAgICAgICAgICAgIHJlcyA9IChNb3Rpb25FdmVudClxZXYuZXZlbnQ7CiAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19JTlBVVCkgTG9nLnYoVEFHLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICJSZXR1cm5pbmcgcGVuZGluZyBtb3Rpb246ICIgKyByZXMpOwogICAgICAgICAgICAgICAgICAgICBtUXVldWUucmVjeWNsZUV2ZW50KHFldik7CiAgICAgICAgICAgICAgICAgICAgIGlmICh3aW4gIT0gbnVsbCAmJiByZXR1cm5XaGF0ID09IFJFVFVSTl9QRU5ESU5HX1BPSU5URVIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5vZmZzZXRMb2NhdGlvbigtd2luLm1GcmFtZS5sZWZ0LCAtd2luLm1GcmFtZS50b3ApOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAocmVzICE9IG51bGwgJiYgcmV0dXJuV2hhdCA9PSBSRVRVUk5fUEVORElOR19QT0lOVEVSKSB7CisgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtV2luZG93TWFwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtV2FsbHBhcGVyVGFyZ2V0ID09IHdpbikgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZFBvaW50ZXJUb1dhbGxwYXBlckxvY2tlZCh3aW4sIHJlcywgcmVzLmdldEV2ZW50VGltZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgcmV0dXJuIHJlczsKICAgICAgICAgfQogCiAgICAgICAgIHZvaWQgdGlja2xlKCkgewpAQCAtNTEwNyw3ICs1NzkwLDcgQEAKICAgICAgICAgUG93ZXJNYW5hZ2VyLldha2VMb2NrIG1Ib2xkaW5nU2NyZWVuOwogCiAgICAgICAgIEtleVEoKSB7Ci0gICAgICAgICAgICBzdXBlcihtQ29udGV4dCk7CisgICAgICAgICAgICBzdXBlcihtQ29udGV4dCwgV2luZG93TWFuYWdlclNlcnZpY2UudGhpcyk7CiAgICAgICAgICAgICBQb3dlck1hbmFnZXIgcG0gPSAoUG93ZXJNYW5hZ2VyKW1Db250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5QT1dFUl9TRVJWSUNFKTsKICAgICAgICAgICAgIG1Ib2xkaW5nU2NyZWVuID0gcG0ubmV3V2FrZUxvY2soUG93ZXJNYW5hZ2VyLlNDUkVFTl9CUklHSFRfV0FLRV9MT0NLLAogICAgICAgICAgICAgICAgICAgICAiS0VFUF9TQ1JFRU5fT05fRkxBRyIpOwpAQCAtNTIzOCw3ICs1OTIxLDcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICB9OworICAgIH0KIAogICAgIHB1YmxpYyBib29sZWFuIGRldGVjdFNhZmVNb2RlKCkgewogICAgICAgICBtU2FmZU1vZGUgPSBtUG9saWN5LmRldGVjdFNhZmVNb2RlKCk7CkBAIC01MzAzLDkgKzU5ODYsMTMgQEAKICAgICAgICAgICAgICAgICBpZiAoREVCVUdfSU5QVVQgJiYgZXYgIT0gbnVsbCkgTG9nLnYoCiAgICAgICAgICAgICAgICAgICAgICAgICBUQUcsICJFdmVudDogdHlwZT0iICsgZXYuY2xhc3NUeXBlICsgIiBkYXRhPSIgKyBldi5ldmVudCk7CiAKKyAgICAgICAgICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7CisgICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiMiBnb3QgZXZlbnQgICAgICAgICAgICAgICIsIFN5c3RlbS5uYW5vVGltZSgpIC0gZXYud2hlbk5hbm8pOworICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChldiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjdXJUaW1lID0gZXYud2hlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1clRpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGludCBldmVudFR5cGU7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXYuY2xhc3NUeXBlID09IFJhd0lucHV0RXZlbnQuQ0xBU1NfVE9VQ0hTQ1JFRU4pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFR5cGUgPSBldmVudFR5cGUoKE1vdGlvbkV2ZW50KWV2LmV2ZW50KTsKQEAgLTUzMTYsMTcgKzYwMDMsMjkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFR5cGUgPSBMb2NhbFBvd2VyTWFuYWdlci5PVEhFUl9FVkVOVDsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBub3cgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobm93IC0gbUxhc3RCYXR0ZXJ5U3RhdHNDYWxsVGltZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGN1clRpbWUgLSBtTGFzdEJhdHRlcnlTdGF0c0NhbGxUaW1lKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPj0gTUlOX1RJTUVfQkVUV0VFTl9VU0VSQUNUSVZJVElFUykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdEJhdHRlcnlTdGF0c0NhbGxUaW1lID0gbm93OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdEJhdHRlcnlTdGF0c0NhbGxUaW1lID0gY3VyVGltZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJhdHRlcnlTdGF0cy5ub3RlSW5wdXRFdmVudCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWdub3JlCiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnVzZXJBY3Rpdml0eShjdXJUaW1lLCBmYWxzZSwgZXZlbnRUeXBlLCBmYWxzZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldmVudFR5cGUgIT0gVE9VQ0hfRVZFTlQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXZlbnRUeXBlICE9IExPTkdfVE9VQ0hfRVZFTlQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXZlbnRUeXBlICE9IENIRUVLX0VWRU5UKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvd2VyTWFuYWdlci51c2VyQWN0aXZpdHkoY3VyVGltZSwgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFR5cGUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUxhc3RUb3VjaEV2ZW50VHlwZSAhPSBldmVudFR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGN1clRpbWUgLSBtTGFzdFVzZXJBY3Rpdml0eUNhbGxUaW1lKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+PSBNSU5fVElNRV9CRVRXRUVOX1VTRVJBQ1RJVklUSUVTKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RVc2VyQWN0aXZpdHlDYWxsVGltZSA9IGN1clRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaEV2ZW50VHlwZSA9IGV2ZW50VHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnVzZXJBY3Rpdml0eShjdXJUaW1lLCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50VHlwZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGV2LmNsYXNzVHlwZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgUmF3SW5wdXRFdmVudC5DTEFTU19LRVlCT0FSRDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQga2UgPSAoS2V5RXZlbnQpZXYuZXZlbnQ7CkBAIC01NTkyLDExICs2MjkxLDI1IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAorICAgICAgICBwdWJsaWMgdm9pZCBzZXRXYWxscGFwZXJQb3NpdGlvbihJQmluZGVyIHdpbmRvdywgZmxvYXQgeCwgZmxvYXQgeSkgeworICAgICAgICAgICAgc3luY2hyb25pemVkKG1XaW5kb3dNYXApIHsKKyAgICAgICAgICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgc2V0V2luZG93V2FsbHBhcGVyUG9zaXRpb25Mb2NrZWQod2luZG93Rm9yQ2xpZW50TG9ja2VkKHRoaXMsIHdpbmRvdyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeSk7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKICAgICAgICAgdm9pZCB3aW5kb3dBZGRlZExvY2tlZCgpIHsKICAgICAgICAgICAgIGlmIChtU3VyZmFjZVNlc3Npb24gPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGlmIChsb2NhbExPR1YpIExvZy52KAogICAgICAgICAgICAgICAgICAgICBUQUcsICJGaXJzdCB3aW5kb3cgYWRkZWQgdG8gIiArIHRoaXMgKyAiLCBjcmVhdGluZyBTdXJmYWNlU2Vzc2lvbiIpOwogICAgICAgICAgICAgICAgIG1TdXJmYWNlU2Vzc2lvbiA9IG5ldyBTdXJmYWNlU2Vzc2lvbigpOworICAgICAgICAgICAgICAgIGlmIChTSE9XX1RSQU5TQUNUSU9OUykgTG9nLmkoCisgICAgICAgICAgICAgICAgICAgICAgICBUQUcsICIgIE5FVyBTVVJGQUNFIFNFU1NJT04gIiArIG1TdXJmYWNlU2Vzc2lvbik7CiAgICAgICAgICAgICAgICAgbVNlc3Npb25zLmFkZCh0aGlzKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1OdW1XaW5kb3crKzsKQEAgLTU2MTQsNiArNjMyNyw4IEBACiAgICAgICAgICAgICAgICAgICAgIGlmIChsb2NhbExPR1YpIExvZy52KAogICAgICAgICAgICAgICAgICAgICAgICAgVEFHLCAiTGFzdCB3aW5kb3cgcmVtb3ZlZCBmcm9tICIgKyB0aGlzCiAgICAgICAgICAgICAgICAgICAgICAgICArICIsIGRlc3Ryb3lpbmcgIiArIG1TdXJmYWNlU2Vzc2lvbik7CisgICAgICAgICAgICAgICAgICAgIGlmIChTSE9XX1RSQU5TQUNUSU9OUykgTG9nLmkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEFHLCAiICBLSUxMIFNVUkZBQ0UgU0VTU0lPTiAiICsgbVN1cmZhY2VTZXNzaW9uKTsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1TdXJmYWNlU2Vzc2lvbi5raWxsKCk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CkBAIC01NjY3LDYgKzYzODIsOCBAQAogICAgICAgICBmaW5hbCBpbnQgbVN1YkxheWVyOwogICAgICAgICBmaW5hbCBib29sZWFuIG1MYXlvdXRBdHRhY2hlZDsKICAgICAgICAgZmluYWwgYm9vbGVhbiBtSXNJbVdpbmRvdzsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBtSXNXYWxscGFwZXI7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbUlzRmxvYXRpbmdMYXllcjsKICAgICAgICAgaW50IG1WaWV3VmlzaWJpbGl0eTsKICAgICAgICAgYm9vbGVhbiBtUG9saWN5VmlzaWJpbGl0eSA9IHRydWU7CiAgICAgICAgIGJvb2xlYW4gbVBvbGljeVZpc2liaWxpdHlBZnRlckFuaW0gPSB0cnVlOwpAQCAtNTY3NCwxNiArNjM5MSwxNiBAQAogICAgICAgICBTdXJmYWNlIG1TdXJmYWNlOwogICAgICAgICBib29sZWFuIG1BdHRhY2hlZEhpZGRlbjsgICAgLy8gaXMgb3VyIHBhcmVudCB3aW5kb3cgaGlkZGVuPwogICAgICAgICBib29sZWFuIG1MYXN0SGlkZGVuOyAgICAgICAgLy8gd2FzIHRoaXMgd2luZG93IGxhc3QgaGlkZGVuPworICAgICAgICBib29sZWFuIG1XYWxscGFwZXJWaXNpYmxlOyAgLy8gZm9yIHdhbGxwYXBlciwgd2hhdCB3YXMgbGFzdCB2aXMgcmVwb3J0PwogICAgICAgICBpbnQgbVJlcXVlc3RlZFdpZHRoOwogICAgICAgICBpbnQgbVJlcXVlc3RlZEhlaWdodDsKICAgICAgICAgaW50IG1MYXN0UmVxdWVzdGVkV2lkdGg7CiAgICAgICAgIGludCBtTGFzdFJlcXVlc3RlZEhlaWdodDsKLSAgICAgICAgaW50IG1SZXFYUG9zOwotICAgICAgICBpbnQgbVJlcVlQb3M7CiAgICAgICAgIGludCBtTGF5ZXI7CiAgIC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ZhY2UsIGJ1dCBzaG91bGQgaGF2ZSBvbmUgc29vbiwgc28KQEAgLTU4MjQsNiArNjU1MCw4IEBACiAgICAgICAgICAgICAgICAgbUF0dGFjaGVkV2luZG93ID0gbnVsbDsKICAgICAgICAgICAgICAgICBtTGF5b3V0QXR0YWNoZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBtSXNJbVdpbmRvdyA9IGZhbHNlOworICAgICAgICAgICAgICAgIG1Jc1dhbGxwYXBlciA9IGZhbHNlOworICAgICAgICAgICAgICAgIG1Jc0Zsb2F0aW5nTGF5ZXIgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBtQmFzZUxheWVyID0gMDsKICAgICAgICAgICAgICAgICBtU3ViTGF5ZXIgPSAwOwogICAgICAgICAgICAgICAgIHJldHVybjsKQEAgLTU4NDQsNiArNjU3Miw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5UWVBFX0FQUExJQ0FUSU9OX0FUVEFDSEVEX0RJQUxPRzsKICAgICAgICAgICAgICAgICBtSXNJbVdpbmRvdyA9IGF0dGFjaGVkV2luZG93Lm1BdHRycy50eXBlID09IFRZUEVfSU5QVVRfTUVUSE9ECiAgICAgICAgICAgICAgICAgICAgICAgICB8fCBhdHRhY2hlZFdpbmRvdy5tQXR0cnMudHlwZSA9PSBUWVBFX0lOUFVUX01FVEhPRF9ESUFMT0c7CisgICAgICAgICAgICAgICAgbUlzV2FsbHBhcGVyID0gYXR0YWNoZWRXaW5kb3cubUF0dHJzLnR5cGUgPT0gVFlQRV9XQUxMUEFQRVI7CisgICAgICAgICAgICAgICAgbUlzRmxvYXRpbmdMYXllciA9IG1Jc0ltV2luZG93IHx8IG1Jc1dhbGxwYXBlcjsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgLy8gVGhlIG11bHRpcGxpZXIgaGVyZSBpcyB0byByZXNlcnZlIHNwYWNlIGZvciBtdWx0aXBsZQogICAgICAgICAgICAgICAgIC8vIHdpbmRvd3MgaW4gdGhlIHNhbWUgdHlwZSBsYXllci4KQEAgLTU4NTUsNiArNjU4NSw4IEBACiAgICAgICAgICAgICAgICAgbUxheW91dEF0dGFjaGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgbUlzSW1XaW5kb3cgPSBtQXR0cnMudHlwZSA9PSBUWVBFX0lOUFVUX01FVEhPRAogICAgICAgICAgICAgICAgICAgICAgICAgfHwgbUF0dHJzLnR5cGUgPT0gVFlQRV9JTlBVVF9NRVRIT0RfRElBTE9HOworICAgICAgICAgICAgICAgIG1Jc1dhbGxwYXBlciA9IG1BdHRycy50eXBlID09IFRZUEVfV0FMTFBBUEVSOworICAgICAgICAgICAgICAgIG1Jc0Zsb2F0aW5nTGF5ZXIgPSBtSXNJbVdpbmRvdyB8fCBtSXNXYWxscGFwZXI7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIFdpbmRvd1N0YXRlIGFwcFdpbiA9IHRoaXM7CkBAIC01ODc3LDggKzY2MDksOCBAQAogICAgICAgICAgICAgbVJlcXVlc3RlZEhlaWdodCA9IDA7CiAgICAgICAgICAgICBtTGFzdFJlcXVlc3RlZFdpZHRoID0gMDsKICAgICAgICAgICAgIG1MYXN0UmVxdWVzdGVkSGVpZ2h0ID0gMDsKLSAgICAgICAgICAgIG1SZXFYUG9zID0gMDsKLSAgICAgICAgICAgIG1SZXFZUG9zID0gMDsKKyAgICAgICAgICAgIG1YT2Zmc2V0ID0gMDsKKyAgICAgICAgICAgIG1ZT2Zmc2V0ID0gMDsKICAgICAgICAgICAgIG1MYXllciA9IDA7CiAgICAgICAgICAgICBtQW5pbUxheWVyID0gMDsKICAgICAgICAgICAgIG1MYXN0TGF5ZXIgPSAwOwpAQCAtNTkyNiw2ICs2NjU4LDggQEAKICAgICAgICAgICAgIHZpc2libGUuc2V0KHZmKTsKIAogICAgICAgICAgICAgZmluYWwgUmVjdCBmcmFtZSA9IG1GcmFtZTsKKyAgICAgICAgICAgIGZpbmFsIGludCBmdyA9IGZyYW1lLndpZHRoKCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgZmggPSBmcmFtZS5oZWlnaHQoKTsKIAogICAgICAgICAgICAgLy9TeXN0ZW0ub3V0LnByaW50bG4oIkluOiB3PSIgKyB3ICsgIiBoPSIgKyBoICsgIiBjb250YWluZXI9IiArCiAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBjb250YWluZXIgKyAiIHg9IiArIG1BdHRycy54ICsgIiB5PSIgKyBtQXR0cnMueSk7CkBAIC01OTYyLDYgKzY2OTYsMTEgQEAKICAgICAgICAgICAgIHZpc2libGVJbnNldHMucmlnaHQgPSBmcmFtZS5yaWdodC12aXNpYmxlLnJpZ2h0OwogICAgICAgICAgICAgdmlzaWJsZUluc2V0cy5ib3R0b20gPSBmcmFtZS5ib3R0b20tdmlzaWJsZS5ib3R0b207CiAKKyAgICAgICAgICAgIGlmIChtSXNXYWxscGFwZXIgJiYgKGZ3ICE9IGZyYW1lLndpZHRoKCkgfHwgZmggIT0gZnJhbWUuaGVpZ2h0KCkpKSB7CisgICAgICAgICAgICAgICAgdXBkYXRlV2FsbHBhcGVyT2Zmc2V0TG9ja2VkKHRoaXMsIG1EaXNwbGF5LmdldFdpZHRoKCksCisgICAgICAgICAgICAgICAgICAgICAgICBtRGlzcGxheS5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKICAgICAgICAgICAgIGlmIChsb2NhbExPR1YpIHsKICAgICAgICAgICAgICAgICAvL2lmICgiY29tLmdvb2dsZS5hbmRyb2lkLnlvdXR1YmUiLmVxdWFscyhtQXR0cnMucGFja2FnZU5hbWUpCiAgICAgICAgICAgICAgICAgLy8gICAgICAgICYmIG1BdHRycy50eXBlID09IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLlRZUEVfQVBQTElDQVRJT05fUEFORUwpIHsKQEAgLTYwNTksMTEgKzY3OTgsNyBAQAogICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIGludCBmbGFncyA9IDA7Ci0gICAgICAgICAgICAgICAgaWYgKG1BdHRycy5tZW1vcnlUeXBlID09IE1FTU9SWV9UWVBFX0hBUkRXQVJFKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZsYWdzIHw9IFN1cmZhY2UuSEFSRFdBUkU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtQXR0cnMubWVtb3J5VHlwZSA9PSBNRU1PUllfVFlQRV9HUFUpIHsKLSAgICAgICAgICAgICAgICAgICAgZmxhZ3MgfD0gU3VyZmFjZS5HUFU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtQXR0cnMubWVtb3J5VHlwZSA9PSBNRU1PUllfVFlQRV9QVVNIX0JVRkZFUlMpIHsKKyAgICAgICAgICAgICAgICBpZiAobUF0dHJzLm1lbW9yeVR5cGUgPT0gTUVNT1JZX1RZUEVfUFVTSF9CVUZGRVJTKSB7CiAgICAgICAgICAgICAgICAgICAgIGZsYWdzIHw9IFN1cmZhY2UuUFVTSF9CVUZGRVJTOwogICAgICAgICAgICAgICAgIH0KIApAQCAtNjA5MCw2ICs2ODI1LDEyIEBACiAgICAgICAgICAgICAgICAgICAgIG1TdXJmYWNlID0gbmV3IFN1cmZhY2UoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb24ubVN1cmZhY2VTZXNzaW9uLCBtU2Vzc2lvbi5tUGlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIHcsIGgsIG1BdHRycy5mb3JtYXQsIGZsYWdzKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBMb2cuaShUQUcsICIgIENSRUFURSBTVVJGQUNFICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1TdXJmYWNlICsgIiBJTiBTRVNTSU9OICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1TZXNzaW9uLm1TdXJmYWNlU2Vzc2lvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIjogcGlkPSIgKyBtU2Vzc2lvbi5tUGlkICsgIiBmb3JtYXQ9IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUF0dHJzLmZvcm1hdCArICIgZmxhZ3M9MHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGZsYWdzKSk7CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoU3VyZmFjZS5PdXRPZlJlc291cmNlc0V4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIk91dE9mUmVzb3VyY2VzRXhjZXB0aW9uIGNyZWF0aW5nIHN1cmZhY2UiKTsKICAgICAgICAgICAgICAgICAgICAgcmVjbGFpbVNvbWVTdXJmYWNlTWVtb3J5TG9ja2VkKHRoaXMsICJjcmVhdGUiKTsKQEAgLTYxMTQsMTAgKzY4NTUsMTMgQEAKICAgICAgICAgICAgICAgICBTdXJmYWNlLm9wZW5UcmFuc2FjdGlvbigpOwogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZS5zZXRQb3NpdGlvbihtRnJhbWUubGVmdCwgbUZyYW1lLnRvcCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZS5zZXRQb3NpdGlvbihtRnJhbWUubGVmdCArIG1YT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRnJhbWUudG9wICsgbVlPZmZzZXQpOwogICAgICAgICAgICAgICAgICAgICAgICAgbVN1cmZhY2Uuc2V0TGF5ZXIobUFuaW1MYXllcik7CiAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZS5oaWRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG1BdHRycy5mbGFncyZXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5GTEFHX0RJVEhFUikgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChTSE9XX1RSQU5TQUNUSU9OUykgTG9nLmkoVEFHLCAiICBTVVJGQUNFICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbVN1cmZhY2UgKyAiOiBESVRIRVIiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZS5zZXRGbGFncyhTdXJmYWNlLlNVUkZBQ0VfRElUSEVSLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3VyZmFjZS5TVVJGQUNFX0RJVEhFUik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CkBAIC02MTQ5LDE4ICs2ODkzLDIxIEBACiAgICAgICAgICAgICAgICAgbUFwcFRva2VuLnN0YXJ0aW5nRGlzcGxheWVkID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChsb2NhbExPR1YpIExvZy52KAotICAgICAgICAgICAgICAgIFRBRywgIldpbmRvdyAiICsgdGhpcwotICAgICAgICAgICAgICAgICsgIiBkZXN0cm95aW5nIHN1cmZhY2UgIiArIG1TdXJmYWNlICsgIiwgc2Vzc2lvbiAiICsgbVNlc3Npb24pOwogICAgICAgICAgICAgaWYgKG1TdXJmYWNlICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfVklTSUJJTElUWSkgeworICAgICAgICAgICAgICAgICAgICAgICAgUnVudGltZUV4Y2VwdGlvbiBlID0gbmV3IFJ1bnRpbWVFeGNlcHRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGUuZmlsbEluU3RhY2tUcmFjZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiV2luZG93ICIgKyB0aGlzICsgIiBkZXN0cm95aW5nIHN1cmZhY2UgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1TdXJmYWNlICsgIiwgc2Vzc2lvbiAiICsgbVNlc3Npb24sIGUpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChTSE9XX1RSQU5TQUNUSU9OUykgewogICAgICAgICAgICAgICAgICAgICAgICAgUnVudGltZUV4Y2VwdGlvbiBleCA9IG5ldyBSdW50aW1lRXhjZXB0aW9uKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBleC5maWxsSW5TdGFja1RyYWNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICIgIFNVUkZBQ0UgIiArIG1TdXJmYWNlICsgIjogREVTVFJPWSAoIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1BdHRycy5nZXRUaXRsZSgpICsgIikiLCBleCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbVN1cmZhY2UuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgbVN1cmZhY2UuZGVzdHJveSgpOwogICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJFeGNlcHRpb24gdGhyb3duIHdoZW4gZGVzdHJveWluZyBXaW5kb3cgIiArIHRoaXMKICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBzdXJmYWNlICIgKyBtU3VyZmFjZSArICIgc2Vzc2lvbiAiICsgbVNlc3Npb24KQEAgLTYxOTIsMTAgKzY5MzksMTAgQEAKICAgICAgICAgfQogCiAgICAgICAgIC8vIFRoaXMgbXVzdCBiZSBjYWxsZWQgd2hpbGUgaW5zaWRlIGEgdHJhbnNhY3Rpb24uCi0gICAgICAgIHZvaWQgY29tbWl0RmluaXNoRHJhd2luZ0xvY2tlZChsb25nIGN1cnJlbnRUaW1lKSB7CisgICAgICAgIGJvb2xlYW4gY29tbWl0RmluaXNoRHJhd2luZ0xvY2tlZChsb25nIGN1cnJlbnRUaW1lKSB7CiAgICAgICAgICAgICAvL0xvZy5pKFRBRywgImNvbW1pdEZpbmlzaERyYXdpbmdMb2NrZWQ6ICIgKyBtU3VyZmFjZSk7CiAgICAgICAgICAgICBpZiAoIW1Db21taXREcmF3UGVuZGluZykgewotICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtQ29tbWl0RHJhd1BlbmRpbmcgPSBmYWxzZTsKICAgICAgICAgICAgIG1SZWFkeVRvU2hvdyA9IHRydWU7CkBAIC02MjA0LDYgKzY5NTEsNyBAQAogICAgICAgICAgICAgaWYgKGF0b2tlbiA9PSBudWxsIHx8IGF0b2tlbi5hbGxEcmF3biB8fCBzdGFydGluZykgewogICAgICAgICAgICAgICAgIHBlcmZvcm1TaG93TG9ja2VkKCk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogCiAgICAgICAgIC8vIFRoaXMgbXVzdCBiZSBjYWxsZWQgd2hpbGUgaW5zaWRlIGEgdHJhbnNhY3Rpb24uCkBAIC02MzAyLDcgKzcwNTAsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtSGFzTG9jYWxUcmFuc2Zvcm1hdGlvbiA9IGZhbHNlOwogICAgICAgICAgICAgICAgIGlmICgoIW1Mb2NhbEFuaW1hdGluZyB8fCBtQW5pbWF0aW9uSXNFbnRyYW5jZSkgJiYgbUFwcFRva2VuICE9IG51bGwKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIG1BcHBUb2tlbi5oYXNUcmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgJiYgbUFwcFRva2VuLmFuaW1hdGlvbiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gb3VyIGFwcCB0b2tlbiBpcyBhbmltYXRpbmcsIHdlIGtpbmQtb2YgcHJldGVuZCBsaWtlCiAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGFyZSBhcyB3ZWxsLiAgTm90ZSB0aGUgbUxvY2FsQW5pbWF0aW5nIG1BbmltYXRpb25Jc0VudHJhbmNlCiAgICAgICAgICAgICAgICAgICAgIC8vIHBhcnQgb2YgdGhpcyBjaGVjayBtZWFucyB0aGF0IHdlIHdpbGwgb25seSBkbyB0aGlzIGlmCkBAIC02MzQ0LDYgKzcwOTIsOCBAQAogICAgICAgICAgICAgbUFuaW1MYXllciA9IG1MYXllcjsKICAgICAgICAgICAgIGlmIChtSXNJbVdpbmRvdykgewogICAgICAgICAgICAgICAgIG1BbmltTGF5ZXIgKz0gbUlucHV0TWV0aG9kQW5pbUxheWVyQWRqdXN0bWVudDsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobUlzV2FsbHBhcGVyKSB7CisgICAgICAgICAgICAgICAgbUFuaW1MYXllciArPSBtV2FsbHBhcGVyQW5pbUxheWVyQWRqdXN0bWVudDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChERUJVR19MQVlFUlMpIExvZy52KFRBRywgIlN0ZXBwaW5nIHdpbiAiICsgdGhpcwogICAgICAgICAgICAgICAgICAgICArICIgYW5pbSBsYXllcjogIiArIG1BbmltTGF5ZXIpOwpAQCAtNjQzMCw2ICs3MTgwLDI2IEBACiAgICAgICAgICAgICBUcmFuc2Zvcm1hdGlvbiBhcHBUcmFuc2Zvcm1hdGlvbiA9CiAgICAgICAgICAgICAgICAgICAgIChtQXBwVG9rZW4gIT0gbnVsbCAmJiBtQXBwVG9rZW4uaGFzVHJhbnNmb3JtYXRpb24pCiAgICAgICAgICAgICAgICAgICAgID8gbUFwcFRva2VuLnRyYW5zZm9ybWF0aW9uIDogbnVsbDsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gV2FsbHBhcGVycyBhcmUgYW5pbWF0ZWQgYmFzZWQgb24gdGhlICJyZWFsIiB3aW5kb3cgdGhleQorICAgICAgICAgICAgLy8gYXJlIGN1cnJlbnRseSB0YXJnZXRpbmcuCisgICAgICAgICAgICBpZiAobUF0dHJzLnR5cGUgPT0gVFlQRV9XQUxMUEFQRVIgJiYgbUxvd2VyV2FsbHBhcGVyVGFyZ2V0ID09IG51bGwKKyAgICAgICAgICAgICAgICAgICAgJiYgbVdhbGxwYXBlclRhcmdldCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKG1XYWxscGFwZXJUYXJnZXQubUhhc0xvY2FsVHJhbnNmb3JtYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgYXR0YWNoZWRUcmFuc2Zvcm1hdGlvbiA9IG1XYWxscGFwZXJUYXJnZXQubVRyYW5zZm9ybWF0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobVdhbGxwYXBlclRhcmdldC5tQXBwVG9rZW4gIT0gbnVsbCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgbVdhbGxwYXBlclRhcmdldC5tQXBwVG9rZW4uaGFzVHJhbnNmb3JtYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgYXBwVHJhbnNmb3JtYXRpb24gPSBtV2FsbHBhcGVyVGFyZ2V0Lm1BcHBUb2tlbi50cmFuc2Zvcm1hdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUiAmJiBhdHRhY2hlZFRyYW5zZm9ybWF0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiV1AgdGFyZ2V0IGF0dGFjaGVkIHhmb3JtOiAiICsgYXR0YWNoZWRUcmFuc2Zvcm1hdGlvbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIgJiYgYXBwVHJhbnNmb3JtYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJXUCB0YXJnZXQgYXBwIHhmb3JtOiAiICsgYXBwVHJhbnNmb3JtYXRpb24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAogICAgICAgICAgICAgaWYgKHNlbGZUcmFuc2Zvcm1hdGlvbiB8fCBhdHRhY2hlZFRyYW5zZm9ybWF0aW9uICE9IG51bGwKICAgICAgICAgICAgICAgICAgICAgfHwgYXBwVHJhbnNmb3JtYXRpb24gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIC8vIGNhY2hlIG9mdGVuIHVzZWQgYXR0cmlidXRlcyBsb2NhbGx5CkBAIC02NDYwLDggKzcyMzAsOCBAQAogICAgICAgICAgICAgICAgIG1EdER4ID0gdG1wRmxvYXRzW01hdHJpeC5NU0tFV19YXTsKICAgICAgICAgICAgICAgICBtRHNEeSA9IHRtcEZsb2F0c1tNYXRyaXguTVNLRVdfWV07CiAgICAgICAgICAgICAgICAgbUR0RHkgPSB0bXBGbG9hdHNbTWF0cml4Lk1TQ0FMRV9ZXTsKLSAgICAgICAgICAgICAgICBpbnQgeCA9IChpbnQpdG1wRmxvYXRzW01hdHJpeC5NVFJBTlNfWF07Ci0gICAgICAgICAgICAgICAgaW50IHkgPSAoaW50KXRtcEZsb2F0c1tNYXRyaXguTVRSQU5TX1ldOworICAgICAgICAgICAgICAgIGludCB4ID0gKGludCl0bXBGbG9hdHNbTWF0cml4Lk1UUkFOU19YXSArIG1YT2Zmc2V0OworICAgICAgICAgICAgICAgIGludCB5ID0gKGludCl0bXBGbG9hdHNbTWF0cml4Lk1UUkFOU19ZXSArIG1ZT2Zmc2V0OwogICAgICAgICAgICAgICAgIGludCB3ID0gZnJhbWUud2lkdGgoKTsKICAgICAgICAgICAgICAgICBpbnQgaCA9IGZyYW1lLmhlaWdodCgpOwogICAgICAgICAgICAgICAgIG1TaG93bkZyYW1lLnNldCh4LCB5LCB4K3csIHkraCk7CkBAIC02NDk4LDYgKzcyNjgsOSBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBtU2hvd25GcmFtZS5zZXQobUZyYW1lKTsKKyAgICAgICAgICAgIGlmIChtWE9mZnNldCAhPSAwIHx8IG1ZT2Zmc2V0ICE9IDApIHsKKyAgICAgICAgICAgICAgICBtU2hvd25GcmFtZS5vZmZzZXQobVhPZmZzZXQsIG1ZT2Zmc2V0KTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1TaG93bkFscGhhID0gbUFscGhhOwogICAgICAgICAgICAgbURzRHggPSAxOwogICAgICAgICAgICAgbUR0RHggPSAwOwpAQCAtNjU2MSwxMCArNzMzNCwxMCBAQAogICAgICAgICAgICAgaWYgKGF0b2tlbiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG1TdXJmYWNlICE9IG51bGwgJiYgbVBvbGljeVZpc2liaWxpdHkgJiYgIW1EZXN0cm95aW5nCiAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKCFtQXR0YWNoZWRIaWRkZW4gJiYgIWF0b2tlbi5oaWRkZW5SZXF1ZXN0ZWQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1BbmltYXRpbmcgfHwgYXRva2VuLmFuaW1hdGluZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1BbmltYXRpb24gIT0gbnVsbCB8fCBhdG9rZW4uYW5pbWF0aW9uICE9IG51bGwpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICByZXR1cm4gbVN1cmZhY2UgIT0gbnVsbCAmJiBtUG9saWN5VmlzaWJpbGl0eSAmJiAhbURlc3Ryb3lpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICYmICghbUF0dGFjaGVkSGlkZGVuIHx8IG1BbmltYXRpbmcpOworICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFtQXR0YWNoZWRIaWRkZW4gfHwgbUFuaW1hdGlvbiAhPSBudWxsKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC02NTczLDExICs3MzQ2LDE3IEBACiAgICAgICAgICAqIG9mIGEgdHJhbnNpdGlvbiB0aGF0IGhhcyBub3QgeWV0IGJlZW4gc3RhcnRlZC4KICAgICAgICAgICovCiAgICAgICAgIGJvb2xlYW4gaXNSZWFkeUZvckRpc3BsYXkoKSB7CisgICAgICAgICAgICBpZiAobVJvb3RUb2tlbi53YWl0aW5nVG9TaG93ICYmCisgICAgICAgICAgICAgICAgICAgIG1OZXh0QXBwVHJhbnNpdGlvbiAhPSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfTk9ORSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGZpbmFsIEFwcFdpbmRvd1Rva2VuIGF0b2tlbiA9IG1BcHBUb2tlbjsKLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gYW5pbWF0aW5nID0gYXRva2VuICE9IG51bGwgPyBhdG9rZW4uYW5pbWF0aW5nIDogZmFsc2U7CisgICAgICAgICAgICBmaW5hbCBib29sZWFuIGFuaW1hdGluZyA9IGF0b2tlbiAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgID8gKGF0b2tlbi5hbmltYXRpb24gIT0gbnVsbCkgOiBmYWxzZTsKICAgICAgICAgICAgIHJldHVybiBtU3VyZmFjZSAhPSBudWxsICYmIG1Qb2xpY3lWaXNpYmlsaXR5ICYmICFtRGVzdHJveWluZwotICAgICAgICAgICAgICAgICAgICAmJiAoKCFtQXR0YWNoZWRIaWRkZW4gJiYgIW1Sb290VG9rZW4uaGlkZGVuKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1BbmltYXRpbmcgfHwgYW5pbWF0aW5nKTsKKyAgICAgICAgICAgICAgICAgICAgJiYgKCghbUF0dGFjaGVkSGlkZGVuICYmIG1WaWV3VmlzaWJpbGl0eSA9PSBWaWV3LlZJU0lCTEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFtUm9vdFRva2VuLmhpZGRlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtQW5pbWF0aW9uICE9IG51bGwgfHwgYW5pbWF0aW5nKTsKICAgICAgICAgfQogCiAgICAgICAgIC8qKiBJcyB0aGUgd2luZG93IG9yIGl0cyBjb250YWluZXIgY3VycmVudGx5IGFuaW1hdGluZz8gKi8KQEAgLTY2MzUsMTEgKzc0MTQsMTUgQEAKICAgICAgICAgfQogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBSZXR1cm4gdHJ1ZSBpZiB0aGUgd2luZG93IGlzIG9wYXF1ZSBhbmQgZnVsbHkgZHJhd24uCisgICAgICAgICAqIFJldHVybiB0cnVlIGlmIHRoZSB3aW5kb3cgaXMgb3BhcXVlIGFuZCBmdWxseSBkcmF3bi4gIFRoaXMgaW5kaWNhdGVzCisgICAgICAgICAqIGl0IG1heSBvYnNjdXJlIHdpbmRvd3MgYmVoaW5kIGl0LgogICAgICAgICAgKi8KICAgICAgICAgYm9vbGVhbiBpc09wYXF1ZURyYXduKCkgewotICAgICAgICAgICAgcmV0dXJuIG1BdHRycy5mb3JtYXQgPT0gUGl4ZWxGb3JtYXQuT1BBUVVFICYmIG1TdXJmYWNlICE9IG51bGwKLSAgICAgICAgICAgICAgICAgICAgJiYgbUFuaW1hdGlvbiA9PSBudWxsICYmICFtRHJhd1BlbmRpbmcgJiYgIW1Db21taXREcmF3UGVuZGluZzsKKyAgICAgICAgICAgIHJldHVybiAobUF0dHJzLmZvcm1hdCA9PSBQaXhlbEZvcm1hdC5PUEFRVUUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtQXR0cnMudHlwZSA9PSBUWVBFX1dBTExQQVBFUikKKyAgICAgICAgICAgICAgICAgICAgJiYgbVN1cmZhY2UgIT0g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ltV2luZG93KSB7Ci0gICAgICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIm1Jc0ltV2luZG93PSIpOyBwdy5wcmludGxuKG1Jc0ltV2luZG93KTsKKyAgICAgICAgICAgIGlmIChtSXNJbVdpbmRvdyB8fCBtSXNXYWxscGFwZXIgfHwgbUlzRmxvYXRpbmdMYXllcikgeworICAgICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtSXNJbVdpbmRvdz0iKTsgcHcucHJpbnQobUlzSW1XaW5kb3cpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtSXNXYWxscGFwZXI9Iik7IHB3LnByaW50KG1Jc1dhbGxwYXBlcik7CisgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1Jc0Zsb2F0aW5nTGF5ZXI9Iik7IHB3LnByaW50KG1Jc0Zsb2F0aW5nTGF5ZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtV2FsbHBhcGVyVmlzaWJsZT0iKTsgcHcucHJpbnRsbihtV2FsbHBhcGVyVmlzaWJsZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibUJhc2VMYXllcj0iKTsgcHcucHJpbnQobUJhc2VMYXllcik7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbVN1YkxheWVyPSIpOyBwdy5wcmludChtU3ViTGF5ZXIpOwpAQCAtNjc3Myw3ICs3NTU5LDggQEAKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtVmlld1Zpc2liaWxpdHk9MHgiKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoSW50ZWdlci50b0hleFN0cmluZyhtVmlld1Zpc2liaWxpdHkpKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtTGFzdEhpZGRlbj0iKTsgcHcucHJpbnQobUxhc3RIaWRkZW4pOwotICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1IYXZlRnJhbWU9Iik7IHB3LnByaW50bG4obUhhdmVGcmFtZSk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbUhhdmVGcmFtZT0iKTsgcHcucHJpbnQobUhhdmVGcmFtZSk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbU9ic2N1cmVkPSIpOyBwdy5wcmludGxuKG1PYnNjdXJlZCk7CiAgICAgICAgICAgICBpZiAoIW1Qb2xpY3lWaXNpYmlsaXR5IHx8ICFtUG9saWN5VmlzaWJpbGl0eUFmdGVyQW5pbSB8fCBtQXR0YWNoZWRIaWRkZW4pIHsKICAgICAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibVBvbGljeVZpc2liaWxpdHk9Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludChtUG9saWN5VmlzaWJpbGl0eSk7CkBAIC02NzgyLDkgKzc1NjksMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbUF0dGFjaGVkSGlkZGVuPSIpOyBwdy5wcmludGxuKG1BdHRhY2hlZEhpZGRlbik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgiUmVxdWVzdGVkIHc9Iik7IHB3LnByaW50KG1SZXF1ZXN0ZWRXaWR0aCk7Ci0gICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgaD0iKTsgcHcucHJpbnQobVJlcXVlc3RlZEhlaWdodCk7Ci0gICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgeD0iKTsgcHcucHJpbnQobVJlcVhQb3MpOwotICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIHk9Iik7IHB3LnByaW50bG4obVJlcVlQb3MpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGg9Iik7IHB3LnByaW50bG4obVJlcXVlc3RlZEhlaWdodCk7CisgICAgICAgICAgICBpZiAobVhPZmZzZXQgIT0gMCB8fCBtWU9mZnNldCAhPSAwKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIk9mZnNldHMgeD0iKTsgcHcucHJpbnQobVhPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiB5PSIpOyBwdy5wcmludGxuKG1ZT2Zmc2V0KTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtR2l2ZW5Db250ZW50SW5zZXRzPSIpOwogICAgICAgICAgICAgICAgICAgICBtR2l2ZW5Db250ZW50SW5zZXRzLnByaW50U2hvcnRTdHJpbmcocHcpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1HaXZlblZpc2libGVJbnNldHM9Iik7CkBAIC02ODUyLDYgKzc2NDEsMTAgQEAKICAgICAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibUhTY2FsZT0iKTsgcHcucHJpbnQobUhTY2FsZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1WU2NhbGU9Iik7IHB3LnByaW50bG4obVZTY2FsZSk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVdhbGxwYXBlclggIT0gLTEgfHwgbVdhbGxwYXBlclkgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibVdhbGxwYXBlclg9Iik7IHB3LnByaW50KG1XYWxscGFwZXJYKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbVdhbGxwYXBlclk9Iik7IHB3LnByaW50bG4obVdhbGxwYXBlclkpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCkBAIC02ODk1LDYgKzc2ODgsMj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leHBsaWNpdCkgewogICAgICAgICAgICAgdG9rZW4gPSBfdG9rZW47CiAgICAgICAgICAgICB3aW5kb3dUeXBlID0gdHlwZTsKQEAgLTY5MDcsNiArNzcxNiwxMiBAQAogICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIndpbmRvd1R5cGU9Iik7IHB3LnByaW50KHdpbmRvd1R5cGUpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGhpZGRlbj0iKTsgcHcucHJpbnQoaGlkZGVuKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBoYXNWaXNpYmxlPSIpOyBwdy5wcmludGxuKGhhc1Zpc2libGUpOworICAgICAgICAgICAgaWYgKHdhaXRpbmdUb1Nob3cgfHwgd2FpdGluZ1RvSGlkZSB8fCBzZW5kaW5nVG9Cb3R0b20gfHwgc2VuZGluZ1RvVG9wKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIndhaXRpbmdUb1Nob3c9Iik7IHB3LnByaW50KHdhaXRpbmdUb1Nob3cpOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiB3YWl0aW5nVG9IaWRlPSIpOyBwdy5wcmludCh3YWl0aW5nVG9IaWRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgc2VuZGluZ1RvQm90dG9tPSIpOyBwdy5wcmludChzZW5kaW5nVG9Cb3R0b20pOworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBzZW5kaW5nVG9Ub3A9Iik7IHB3LnByaW50bG4oc2VuZGluZ1RvVG9wKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIEBPdmVycmlkZQpAQCAtNzAzNiw2ICs3ODUxLDkgQEAKICAgICAgICAgICAgICAgICBpZiAodyA9PSBtSW5wdXRNZXRob2RUYXJnZXQpIHsKICAgICAgICAgICAgICAgICAgICAgc2V0SW5wdXRNZXRob2RBbmltTGF5ZXJBZGp1c3RtZW50KGFkaik7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICh3ID09IG1XYWxscGFwZXJUYXJnZXQgJiYgbUxvd2VyV2FsbHBhcGVyVGFyZ2V0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0V2FsbHBhcGVyQW5pbUxheWVyQWRqdXN0bWVudExvY2tlZChhZGopOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC03MDczLDcgKzc4OTEsNyBAQAogCiAgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGlvbiA9PSBzRHVtbXlBbmltYXRpb24pIHsKICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBndXkgaXMgZ29pbmcgdG8gYW5pbWF0ZSwgYnV0IG5vdCB5ZXQuICBGb3Igbm93IGNvdW50Ci0gICAgICAgICAgICAgICAgICAgIC8vIGl0IGlzIG5vdCBhbmltYXRpbmcgZm9yIHB1cnBvc2VzIG9mIHNjaGVkdWxpbmcgdHJhbnNhY3Rpb25zOworICAgICAgICAgICAgICAgICAgICAvLyBpdCBhcyBub3QgYW5pbWF0aW5nIGZvciBwdXJwb3NlcyBvZiBzY2hlZHVsaW5nIHRyYW5zYWN0aW9uczsKICAgICAgICAgICAgICAgICAgICAgLy8gd2hlbiBpdCBpcyByZWFsbHkgdGltZSB0byBhbmltYXRlLCB0aGlzIHdpbGwgYmUgc2V0IHRvCiAgICAgICAgICAgICAgICAgICAgIC8vIGEgcmVhbCBhbmltYXRpb24gYW5kIHRoZSBuZXh0IGNhbGwgd2lsbCBleGVjdXRlIG5vcm1hbGx5LgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CkBAIC03MjEzLDYgKzgwMzEsNyBAQAogICAgICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJhbGxBcHBXaW5kb3dzPSIpOyBwdy5wcmludGxuKGFsbEFwcFdpbmRvd3MpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoImdyb3VwSWQ9Iik7IHB3LnByaW50KGdyb3VwSWQpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGFwcEZ1bGxzY3JlZW49Iik7IHB3LnByaW50KGFwcEZ1bGxzY3JlZW4pOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIHJlcXVlc3RlZE9yaWVudGF0aW9uPSIpOyBwdy5wcmludGxuKHJlcXVlc3RlZE9yaWVudGF0aW9uKTsKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJoaWRkZW5SZXF1ZXN0ZWQ9Iik7IHB3LnByaW50KGhpZGRlblJlcXVlc3RlZCk7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgY2xpZW50SGlkZGVuPSIpOyBwdy5wcmludChjbGllbnRIaWRkZW4pOwpAQCAtNzc3OCw2ICs4NTk3LDQwIEBACiAgICAgICAgIHJldHVybiB3aW47CiAgICAgfQogCisgICAgZmluYWwgdm9pZCByZWJ1aWxkQXBwV2luZG93TGlzdExvY2tlZCgpIHsKKyAgICAgICAgaW50IE5XID0gbVdpbmRvd3Muc2l6ZSgpOworICAgICAgICBpbnQgaTsKKyAgICAgICAgCisgICAgICAgIC8vIEZpcnN0IHJlbW92ZSBhbGwgZXhpc3RpbmcgYXBwIHdpbmRvd3MuCisgICAgICAgIGk9MDsKKyAgICAgICAgd2hpbGUgKGkgPCBOVykgeworICAgICAgICAgICAgaWYgKCgoV2luZG93U3RhdGUpbVdpbmRvd3MuZ2V0KGkpKS5tQXBwVG9rZW4gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIHdpbiA9IChXaW5kb3dTdGF0ZSltV2luZG93cy5yZW1vdmUoaSk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dJTkRPV19NT1ZFTUVOVCkgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgIlJlYnVpbGQgcmVtb3Zpbmcgd2luZG93OiAiICsgd2luKTsKKyAgICAgICAgICAgICAgICBOVy0tOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaSsrOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBGaXJzdCBhZGQgYWxsIG9mIHRoZSBleGl0aW5nIGFwcCB0b2tlbnMuLi4gIHRoZXNlIGFyZSBubyBsb25nZXIKKyAgICAgICAgLy8gaW4gdGhlIG1haW4gYXBwIGxpc3QsIGJ1dCBzdGlsbCBoYXZlIHdpbmRvd3Mgc2hvd24uICBXZSBwdXQgdGhlbQorICAgICAgICAvLyBpbiB0aGUgYmFjayBiZWNhdXNlIG5vdyB0aGF0IHRoZSBhbmltYXRpb24gaXMgb3ZlciB3ZSBubyBsb25nZXIKKyAgICAgICAgLy8gd2lsbCBjYXJlIGFib3V0IHRoZW0uCisgICAgICAgIGludCBOVCA9IG1FeGl0aW5nQXBwVG9rZW5zLnNpemUoKTsKKyAgICAgICAgaSA9IDA7CisgICAgICAgIGZvciAoaW50IGo9MDsgajxOVDsgaisrKSB7CisgICAgICAgICAgICBpID0gcmVBZGRBcHBXaW5kb3dzTG9ja2VkKGksIG1FeGl0aW5nQXBwVG9rZW5zLmdldChqKSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIEFuZCBhZGQgaW4gdGhlIHN0aWxsIGFjdGl2ZSBhcHAgdG9rZW5zIGluIFogb3JkZXIuCisgICAgICAgIE5UID0gbUFwcFRva2Vucy5zaXplKCk7CisgICAgICAgIGZvciAoaW50IGo9MDsgajxOVDsgaisrKSB7CisgICAgICAgICAgICBpID0gcmVBZGRBcHBXaW5kb3dzTG9ja2VkKGksIG1BcHBUb2tlbnMuZ2V0KGopKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKICAgICBwcml2YXRlIGZpbmFsIHZvaWQgYXNzaWduTGF5ZXJzTG9ja2VkKCkgewogICAgICAgICBpbnQgTiA9IG1XaW5kb3dzLnNpemUoKTsKICAgICAgICAgaW50IGN1ckJhc2VMYXllciA9IDA7CkBAIC03Nzg2LDcgKzg2MzksOCBAQAogCiAgICAgICAgIGZvciAoaT0wOyBpPE47IGkrKykgewogICAgICAgICAgICAgV2luZG93U3RhdGUgdyA9IChXaW5kb3dTdGF0ZSltV2luZG93cy5nZXQoaSk7Ci0gICAgICAgICAgICBpZiAody5tQmFzZUxheWVyID09IGN1ckJhc2VMYXllciB8fCB3Lm1Jc0ltV2luZG93KSB7CisgICAgICAgICAgICBpZiAody5tQmFzZUxheWVyID09IGN1ckJhc2VMYXllciB8fCB3Lm1Jc0ltV2luZG93CisgICAgICAgICAgICAgICAgICAgIHx8IChpID4gMCAmJiB3Lm1Jc1dhbGxwYXBlcikpIHsKICAgICAgICAgICAgICAgICBjdXJMYXllciArPSBXSU5ET1dfTEFZRVJfTVVMVElQTElFUjsKICAgICAgICAgICAgICAgICB3Lm1MYXllciA9IGN1ckxheWVyOwogICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTc4MDIsNiArODY1Niw4IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAody5tSXNJbVdpbmRvdykgewogICAgICAgICAgICAgICAgIHcubUFuaW1MYXllciArPSBtSW5wdXRNZXRob2RBbmltTGF5ZXJBZGp1c3RtZW50OworICAgICAgICAgICAgfSBlbHNlIGlmICh3Lm1Jc1dhbGxwYXBlcikgeworICAgICAgICAgICAgICAgIHcubUFuaW1MYXllciArPSBtV2FsbHBhcGVyQW5pbUxheWVyQWRqdXN0bWVudDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChERUJVR19MQVlFUlMpIExvZy52KFRBRywgIkFzc2lnbiBsYXllciAiICsgdyArICI6ICIKICAgICAgICAgICAgICAgICAgICAgKyB3Lm1BbmltTGF5ZXIpOwpAQCAtNzk1Miw3ICs4ODA4LDYgQEAKICAgICAgICAgZmluYWwgaW50IGR3ID0gbURpc3BsYXkuZ2V0V2lkdGgoKTsKICAgICAgICAgZmluYWwgaW50IGRoID0gbURpc3BsYXkuZ2V0SGVpZ2h0KCk7CiAKLSAgICAgICAgZmluYWwgaW50IE4gPSBtV2luZG93cy5zaXplKCk7CiAgICAgICAgIGludCBpOwogCiAgICAgICAgIC8vIEZJUlNUIExPT1A6IFBlcmZvcm0gYSBsYXlvdXQsIGlmIG5lZWRlZC4KQEAgLTgwMDgsOSArODg2MywxMiBAQAogICAgICAgICAgICAgICAgIHJlc3RhcnQgPSBmYWxzZTsKIAogICAgICAgICAgICAgICAgIGJvb2xlYW4gdG9rZW5NYXlCZURyYXduID0gZmFsc2U7CisgICAgICAgICAgICAgICAgYm9vbGVhbiB3YWxscGFwZXJNYXlDaGFuZ2UgPSBmYWxzZTsKIAogICAgICAgICAgICAgICAgIG1Qb2xpY3kuYmVnaW5BbmltYXRpb25MdyhkdywgZGgpOwogCisgICAgICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtV2luZG93cy5zaXplKCk7CisgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgZm9yIChpPU4tMTsgaT49MDsgaS0tKSB7CiAgICAgICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIHcgPSAoV2luZG93U3RhdGUpbVdpbmRvd3MuZ2V0KGkpOwogCkBAIC04MDE4LDcgKzg4NzYsMTQgQEAKIAogICAgICAgICAgICAgICAgICAgICBpZiAody5tU3VyZmFjZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBFeGVjdXRlIGFuaW1hdGlvbi4KLSAgICAgICAgICAgICAgICAgICAgICAgIHcuY29tbWl0RmluaXNoRHJhd2luZ0xvY2tlZChjdXJyZW50VGltZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAody5jb21taXRGaW5pc2hEcmF3aW5nTG9ja2VkKGN1cnJlbnRUaW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgody5tQXR0cnMuZmxhZ3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuRkxBR19TSE9XX1dBTExQQVBFUikgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfV0FMTFBBUEVSKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpcnN0IGRyYXcgZG9uZSBpbiBwb3RlbnRpYWwgd2FsbHBhcGVyIHRhcmdldCAiICsgdyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhbGxwYXBlck1heUNoYW5nZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcuc3RlcEFuaW1hdGlvbkxvY2tlZChjdXJyZW50VGltZSwgZHcsIGRoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGluZyA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy93LmR1bXAoIiAgIik7CkBAIC04MTQ5LDEyICs5MDE0LDk5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBtTmV4dEFwcFRyYW5zaXRpb24gPSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfTk9ORTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1BcHBUcmFuc2l0aW9uUmVhZHkgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BcHBUcmFuc2l0aW9uUnVubmluZyA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICBtQXBwVHJhbnNpdGlvblRpbWVvdXQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1TdGFydGluZ0ljb25JblRyYW5zaXRpb24gPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Ta2lwQXBwVHJhbnNpdGlvbkFuaW1hdGlvbiA9IGZhbHNlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBtSC5yZW1vdmVNZXNzYWdlcyhILkFQUF9UUkFOU0lUSU9OX1RJTUVPVVQpOwogCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGVyZSBhcmUgYXBwbGljYXRpb25zIHdhaXRpbmcgdG8gY29tZSB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvcCBvZiB0aGUgc3RhY2ssIG5vdyBpcyB0aGUgdGltZSB0byBtb3ZlIHRoZWlyIHdpbmRvd3MuCisgICAgICAgICAgICAgICAgICAgICAgICAvLyAoTm90ZSB0aGF0IHdlIGRvbid0IGRvIGFwcHMgZ29pbmcgdG8gdGhlIGJvdHRvbQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gaGVyZSAtLSB3ZSB3YW50IHRvIGtlZXAgdGhlaXIgd2luZG93cyBpbiB0aGUgb2xkCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBaLW9yZGVyIHVudGlsIHRoZSBhbmltYXRpb24gY29tcGxldGVzLikKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtVG9Ub3BBcHBzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOTiA9IG1BcHBUb2tlbnMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaT0wOyBpPE5OOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXBwV2luZG93VG9rZW4gd3Rva2VuID0gbUFwcFRva2Vucy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3dG9rZW4uc2VuZGluZ1RvVG9wKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3dG9rZW4uc2VuZGluZ1RvVG9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3ZlQXBwV2luZG93c0xvY2tlZCh3dG9rZW4sIE5OLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvVG9wQXBwcy5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBXaW5kb3dTdGF0ZSBvbGRXYWxscGFwZXIgPSBtV2FsbHBhcGVyVGFyZ2V0OworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBhZGp1c3RXYWxscGFwZXJXaW5kb3dzTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB3YWxscGFwZXJNYXlDaGFuZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0FQUF9UUkFOU0lUSU9OUykgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmV3IHdhbGxwYXBlciB0YXJnZXQ9IiArIG1XYWxscGFwZXJUYXJnZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCBsb3dlciB0YXJnZXQ9IiArIG1Mb3dlcldhbGxwYXBlclRhcmdldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIHVwcGVyIHRhcmdldD0iICsgbVVwcGVyV2FsbHBhcGVyVGFyZ2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3VuZFdhbGxwYXBlcnMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Mb3dlcldhbGxwYXBlclRhcmdldCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTmVlZCB0byBkZXRlcm1pbmUgaWYgYm90aCB0aGUgY2xvc2luZyBhbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvcGVuaW5nIGFwcCB0b2tlbiBzZXRzIGFyZSB3YWxscGFwZXIgdGFyZ2V0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbiB3aGljaCBjYXNlIHNwZWNpYWwgYW5pbWF0aW9ucyBhcmUgbmVlZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gKHNpbmNlIHRoZSB3YWxscGFwZXIgbmVlZHMgdG8gc3RheSBzdGF0aWMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBiZWhpbmQgdGhlbSkuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTk4gPSBtQ2xvc2luZ0FwcHMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaT0wOyBpPE5OOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXBwV2luZG93VG9rZW4gd3Rva2VuID0gbUNsb3NpbmdBcHBzLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Mb3dlcldhbGxwYXBlclRhcmdldC5tQXBwVG9rZW4gPT0gd3Rva2VuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZFdhbGxwYXBlcnMgfD0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVVwcGVyV2FsbHBhcGVyVGFyZ2V0Lm1BcHBUb2tlbiA9PSB3dG9rZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kV2FsbHBhcGVycyB8PSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5OID0gbU9wZW5pbmdBcHBzLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGk9MDsgaTxOTjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFwcFdpbmRvd1Rva2VuIHd0b2tlbiA9IG1PcGVuaW5nQXBwcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtTG93ZXJXYWxscGFwZXJUYXJnZXQubUFwcFRva2VuID09IHd0b2tlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm91bmRXYWxscGFwZXJzIHw9IDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1VcHBlcldhbGxwYXBlclRhcmdldC5tQXBwVG9rZW4gPT0gd3Rva2VuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZFdhbGxwYXBlcnMgfD0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvdW5kV2FsbHBhcGVycyA9PSAzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0FQUF9UUkFOU0lUSU9OUykgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldhbGxwYXBlciBhbmltYXRpb24hIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0cmFuc2l0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV2luZG93TWFuYWdlclBvbGljeS5UUkFOU0lUX0FDVElWSVRZX09QRU46CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV2luZG93TWFuYWdlclBvbGljeS5UUkFOU0lUX1RBU0tfT1BFTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfVEFTS19UT19GUk9OVDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXQgPSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX09QRU47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfQUNUSVZJVFlfQ0xPU0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV2luZG93TWFuYWdlclBvbGljeS5UUkFOU0lUX1RBU0tfQ0xPU0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV2luZG93TWFuYWdlclBvbGljeS5UUkFOU0lUX1RBU0tfVE9fQkFDSzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXQgPSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX0NMT1NFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19BUFBfVFJBTlNJVElPTlMpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZXcgdHJhbnNpdDogIiArIHRyYW5zaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvbGRXYWxscGFwZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGFyZSB0cmFuc2l0aW9uaW5nIGZyb20gYW4gYWN0aXZpdHkgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGEgd2FsbHBhcGVyIHRvIG9uZSB3aXRob3V0LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXQgPSBXaW5kb3dNYW5hZ2VyUG9saWN5LlRSQU5TSVRfV0FMTFBBUEVSX0NMT1NFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19BUFBfVFJBTlNJVElPTlMpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZXcgdHJhbnNpdCBhd2F5IGZyb20gd2FsbHBhcGVyOiAiICsgdHJhbnNpdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1XYWxscGFwZXJUYXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGFyZSB0cmFuc2l0aW9uaW5nIGZyb20gYW4gYWN0aXZpdHkgd2l0aG91dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGEgd2FsbHBhcGVyIHRvIG5vdyBzaG93aW5nIHRoZSB3YWxscGFwZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0ID0gV2luZG93TWFuYWdlclBvbGljeS5UUkFOU0lUX1dBTExQQVBFUl9PUEVOOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19BUFBfVFJBTlNJVElPTlMpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZXcgdHJhbnNpdCBpbnRvIHdhbGxwYXBlcjogIiArIHRyYW5zaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBuZWVkIHRvIGZpZ3VyZSBvdXQgd2hpY2ggYW5pbWF0aW9uIHRvIHVzZS4uLgogICAgICAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMgbHAgPSBmaW5kQW5pbWF0aW9ucyhtQXBwVG9rZW5zLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtT3BlbmluZ0FwcHMsIG1DbG9zaW5nQXBwcyk7CkBAIC04MTY2LDggKzkxMTgsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOb3cgb3BlbmluZyBhcHAiICsgd3Rva2VuKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3dG9rZW4ucmVwb3J0ZWRWaXNpYmxlID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3Rva2VuLmluUGVuZGluZ1RyYW5zYWN0aW9uID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3Rva2VuLmFuaW1hdGlvbiA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VG9rZW5WaXNpYmlsaXR5TG9ja2VkKHd0b2tlbiwgbHAsIHRydWUsIHRyYW5zaXQsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3dG9rZW4udXBkYXRlUmVwb3J0ZWRWaXNpYmlsaXR5TG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3Rva2VuLndhaXRpbmdUb1Nob3cgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3dG9rZW4uc2hvd0FsbFdpbmRvd3NMb2NrZWQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIE5OID0gbUNsb3NpbmdBcHBzLnNpemUoKTsKQEAgLTgxNzYsOCArOTEzMCwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19BUFBfVFJBTlNJVElPTlMpIExvZy52KFRBRywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOb3cgY2xvc2luZyBhcHAiICsgd3Rva2VuKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3dG9rZW4uaW5QZW5kaW5nVHJhbnNhY3Rpb24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3dG9rZW4uYW5pbWF0aW9uID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUb2tlblZpc2liaWxpdHlMb2NrZWQod3Rva2VuLCBscCwgZmFsc2UsIHRyYW5zaXQsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3dG9rZW4udXBkYXRlUmVwb3J0ZWRWaXNpYmlsaXR5TG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3Rva2VuLndhaXRpbmdUb0hpZGUgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGb3JjZSB0aGUgYWxsRHJhd24gZmxhZywgYmVjYXVzZSB3ZSB3YW50IHRvIHN0YXJ0CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyBndXkncyBhbmltYXRpb25zIHJlZ2FyZGxlc3Mgb2Ygd2hldGhlciBpdCdzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZ290dGVuIGRyYXduLgpAQCAtODE5OSw2ICs5MTU1LDQ3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICByZXN0YXJ0ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoIWFuaW1hdGluZyAmJiBtQXBwVHJhbnNpdGlvblJ1bm5pbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gV2UgaGF2ZSBmaW5pc2hlZCB0aGUgYW5pbWF0aW9uIG9mIGFuIGFwcCB0cmFuc2l0aW9uLiAgVG8gZG8KKyAgICAgICAgICAgICAgICAgICAgLy8gdGhpcywgd2UgaGF2ZSBkZWxheWVkIGEgbG90IG9mIG9wZXJhdGlvbnMgbGlrZSBzaG93aW5nIGFuZAorICAgICAgICAgICAgICAgICAgICAvLyBoaWRpbmcgYXBwcywgbW92aW5nIGFwcHMgaW4gWi1vcmRlciwgZXRjLiAgVGhlIGFwcCB0b2tlbiBsaXN0CisgICAgICAgICAgICAgICAgICAgIC8vIHJlZmxlY3RzIHRoZSBjb3JyZWN0IFotb3JkZXIsIGJ1dCB0aGUgd2luZG93IGxpc3QgbWF5IG5vdworICAgICAgICAgICAgICAgICAgICAvLyBiZSBvdXQgb2Ygc3luYyB3aXRoIGl0LiAgU28gaGVyZSB3ZSB3aWxsIGp1c3QgcmVidWlsZCB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gZW50aXJlIGFwcCB3aW5kb3cgbGlzdC4gIEZ1biEKKyAgICAgICAgICAgICAgICAgICAgbUFwcFRyYW5zaXRpb25SdW5uaW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIC8vIENsZWFyIGluZm9ybWF0aW9uIGFib3V0IGFwcHMgdGhhdCB3ZXJlIG1vdmluZy4KKyAgICAgICAgICAgICAgICAgICAgbVRvQm90dG9tQXBwcy5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgcmVidWlsZEFwcFdpbmRvd0xpc3RMb2NrZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzdGFydCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG1vdmVJbnB1dE1ldGhvZFdpbmRvd3NJZk5lZWRlZExvY2tlZChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIHdhbGxwYXBlck1heUNoYW5nZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG1MYXlvdXROZWVkZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAod2FsbHBhcGVyTWF5Q2hhbmdlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiV2FsbHBhcGVyIG1heSBjaGFuZ2UhICBBZGp1c3RpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGFkalJlc3VsdCA9IGFkanVzdFdhbGxwYXBlcldpbmRvd3NMb2NrZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChhZGpSZXN1bHQmQURKVVNUX1dBTExQQVBFUl9MQVlFUlNfQ0hBTkdFRCkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX1dBTExQQVBFUikgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiV2FsbHBhcGVyIGxheWVyIGNoYW5nZWQ6IGFzc2lnbmluZyBsYXllcnMgKyByZWxheW91dCIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdGFydCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBtTGF5b3V0TmVlZGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFzc2lnbkxheWVyc0xvY2tlZCgpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChhZGpSZXN1bHQmQURKVVNUX1dBTExQQVBFUl9WSVNJQklMSVRZX0NIQU5HRUQpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldhbGxwYXBlciB2aXNpYmlsaXR5IGNoYW5nZWQ6IHJlbGF5b3V0Iik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN0YXJ0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1MYXlvdXROZWVkZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtTGF5b3V0TmVlZGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN0YXJ0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm1MYXlvdXRMb2NrZWRJbm5lcigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgfSB3aGlsZSAocmVzdGFydCk7CiAKICAgICAgICAgICAgIC8vIFRISVJEIExPT1A6IFVwZGF0ZSB0aGUgc3VyZmFjZXMgb2YgYWxsIHdpbmRvd3MuCkBAIC04MjEyLDYgKzkyMDksOCBAQAogICAgICAgICAgICAgYm9vbGVhbiBzeXN3aW4gPSBmYWxzZTsKICAgICAgICAgICAgIGJvb2xlYW4gYmFja2dyb3VuZEZpbGxlclNob3duID0gZmFsc2U7CiAKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbVdpbmRvd3Muc2l6ZSgpOworICAgICAgICAgICAgCiAgICAgICAgICAgICBmb3IgKGk9Ti0xOyBpPj0wOyBpLS0pIHsKICAgICAgICAgICAgICAgICBXaW5kb3dTdGF0ZSB3ID0gKFdpbmRvd1N0YXRlKW1XaW5kb3dzLmdldChpKTsKIApAQCAtODIzOSw2ICs5MjM4LDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICB3Lm1MYXN0UmVxdWVzdGVkSGVpZ2h0ID0gaGVpZ2h0OwogICAgICAgICAgICAgICAgICAgICAgICAgdy5tTGFzdFNob3duRnJhbWUuc2V0KHcubVNob3duRnJhbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU0hPV19UUkFOU0FDVElPTlMpIExvZy5pKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEFHLCAiICBTVVJGQUNFICIgKyB3Lm1TdXJmYWNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICI6IFBPUyAiICsgdy5tU2hvd25GcmFtZS5sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsICIgKyB3Lm1TaG93bkZyYW1lLnRvcCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy5tU3VyZmFjZS5zZXRQb3NpdGlvbih3Lm1TaG93bkZyYW1lLmxlZnQsIHcubVNob3duRnJhbWUudG9wKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkVycm9yIHBvc2l0aW9uaW5nIHN1cmZhY2UgaW4gIiArIHcsIGUpOwpAQCAtODI1MSwxNCArOTI1NCw2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IHcubVNob3duRnJhbWUud2lkdGgoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IHcubVNob3duRnJhbWUuaGVpZ2h0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB3Lm1MYXN0U2hvd25GcmFtZS5zZXQody5tU2hvd25GcmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzaXplKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBMb2cuaSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRBRywgIiAgU1VSRkFDRSAiICsgdy5tU3VyZmFjZSArICI6ICgiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubVNob3duRnJhbWUubGVmdCArICIsIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1TaG93bkZyYW1lLnRvcCArICIpICgiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubVNob3duRnJhbWUud2lkdGgoKSArICJ4IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1TaG93bkZyYW1lLmhlaWdodCgpICsgIikiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNpemUpIHsKQEAgLTgyNjYsNiArOTI2MSwxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhlaWdodCA8IDEpIGhlaWdodCA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAody5tU3VyZmFjZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBMb2cuaSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUQUcsICIgIFNVUkZBQ0UgIiArIHcubVN1cmZhY2UgKyAiOiBQT1MgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdy5tU2hvd25GcmFtZS5sZWZ0ICsgIiwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1TaG93bkZyYW1lLnRvcCArICIgU0laRSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1TaG93bkZyYW1lLndpZHRoKCkgKyAieCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubVNob3duRnJhbWUuaGVpZ2h0KCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3Lm1TdXJmYWNlLnNldFNpemUod2lkdGgsIGhlaWdodCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcubVN1cmZhY2Uuc2V0UG9zaXRpb24ody5tU2hvd25GcmFtZS5sZWZ0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcubVNob3duRnJhbWUudG9wKTsKQEAgLTgyOTQsNiArOTI5NSwyMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcubUxhc3RGcmFtZS5zZXQody5tRnJhbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcubUxhc3RDb250ZW50SW5zZXRzLnNldCh3Lm1Db250ZW50SW5zZXRzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3Lm1MYXN0VmlzaWJsZUluc2V0cy5zZXQody5tVmlzaWJsZUluc2V0cyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHNjcmVlbiBpcyBjdXJyZW50bHkgZnJvemVuLCB0aGVuIGtlZXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpdCBmcm96ZW4gdW50aWwgdGhpcyB3aW5kb3cgZHJhd3MgYXQgaXRzIG5ldworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9yaWVudGF0aW9uLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGlzcGxheUZyb3plbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfT1JJRU5UQVRJT04pIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmVzaXppbmcgd2hpbGUgZGlzcGxheSBmcm96ZW46ICIgKyB3KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy5tT3JpZW50YXRpb25DaGFuZ2luZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtV2luZG93c0ZyZWV6aW5nU2NyZWVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2luZG93c0ZyZWV6aW5nU2NyZWVuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFhYWCBzaG91bGQgcHJvYmFibHkga2VlcCB0aW1lb3V0IGZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gd2UgZmlyc3QgZnJvemUgdGhlIGRpc3BsYXkuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSC5yZW1vdmVNZXNzYWdlcyhILldJTkRPV19GUkVFWkVfVElNRU9VVCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSC5zZW5kTWVzc2FnZURlbGF5ZWQobUgub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSC5XSU5ET1dfRlJFRVpFX1RJTUVPVVQpLCAyMDAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgb3JpZW50YXRpb24gaXMgY2hhbmdpbmcsIHRoZW4gd2UgbmVlZCB0bwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGhvbGQgb2ZmIG9uIHVuZnJlZXppbmcgdGhlIGRpc3BsYXkgdW50aWwgdGhpcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdpbmRvdyBoYXMgYmVlbiByZWRyYXduOyB0byBkbyB0aGF0LCB3ZSBuZWVkCkBAIC04Mzk1LDcgKzk0MTIsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHcubUxhc3RWU2NhbGUgPSB3Lm1WU2NhbGU7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU0hPV19UUkFOU0FDVElPTlMpIExvZy5pKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUQUcsICIgIFNVUkZBQ0UgIiArIHcubVN1cmZhY2UgKyAiOiBhbHBoYT0iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdy5tU2hvd25BbHBoYSArICIgbGF5ZXI9IiArIHcubUFuaW1MYXllcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdy5tU2hvd25BbHBoYSArICIgbGF5ZXI9IiArIHcubUFuaW1MYXllcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbWF0cml4PVsiICsgKHcubURzRHgqdy5tSFNjYWxlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIiArICh3Lm1EdER4KncubVZTY2FsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiXVsiICsgKHcubURzRHkqdy5tSFNjYWxlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIsIiArICh3Lm1EdER5KncubVZTY2FsZSkgKyAiXSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcubVN1cmZhY2UgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcubVN1cmZhY2Uuc2V0QWxwaGEody5tU2hvd25BbHBoYSk7CkBAIC04NDY0LDggKzk0ODUsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgZm9jdXNEaXNwbGF5ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gb2JzY3VyZWRDaGFuZ2VkID0gdy5tT2JzY3VyZWQgIT0gb2JzY3VyZWQ7CisgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIGVmZmVjdC4KLSAgICAgICAgICAgICAgICBpZiAoIW9ic2N1cmVkKSB7CisgICAgICAgICAgICAgICAgaWYgKCEody5tT2JzY3VyZWQ9b2JzY3VyZWQpKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmICh3Lm1TdXJmYWNlICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYXR0ckZsYWdzJkZMQUdfS0VFUF9TQ1JFRU5fT04pICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBob2xkU2NyZWVuID0gdy5tU2Vzc2lvbjsKQEAgLTg0ODEsNyArOTUwNCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgICAgICBib29sZWFuIG9wYXF1ZURyYXduID0gdy5pc09wYXF1ZURyYXduKCk7CisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gb3BhcXVlRHJhd24gPSBjYW5CZVNlZW4gJiYgdy5pc09wYXF1ZURyYXduKCk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChvcGFxdWVEcmF3biAmJiB3LmlzRnVsbHNjcmVlbihkdywgZGgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIHdpbmRvdyBjb21wbGV0ZWx5IGNvdmVycyBldmVyeXRoaW5nIGJlaGluZCBpdCwKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNvIHdlIHdhbnQgdG8gbGVhdmUgYWxsIG9mIHRoZW0gYXMgdW5ibHVycmVkIChmb3IKQEAgLTg1NjQsNiArOTU4NywxMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChvYnNjdXJlZENoYW5nZWQgJiYgbVdhbGxwYXBlclRhcmdldCA9PSB3KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIHdhbGxwYXBlciB0YXJnZXQgYW5kIGl0cyBvYnNjdXJlZCBzdGF0ZQorICAgICAgICAgICAgICAgICAgICAvLyBjaGFuZ2VkLi4uIG1ha2Ugc3VyZSB0aGUgY3VycmVudCB3YWxsYXBlcidzIHZpc2liaWxpdHkKKyAgICAgICAgICAgICAgICAgICAgLy8gaGFzIGJlZW4gdXBkYXRlZCBhY2NvcmRpbmdseS4KKyAgICAgICAgICAgICAgICAgICAgdXBkYXRlV2FsbHBhcGVyVmlzaWJpbGl0eUxvY2tlZCgpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIAogICAgICAgICAgICAgaWYgKGJhY2tncm91bmRGaWxsZXJTaG93biA9PSBmYWxzZSAmJiBtQmFja2dyb3VuZEZpbGxlclNob3duKSB7CkBAIC04NjE3LDYgKzk2NDcsOCBAQAogICAgICAgICAgICAgICAgIGktLTsKICAgICAgICAgICAgICAgICBXaW5kb3dTdGF0ZSB3aW4gPSBtUmVzaXppbmdXaW5kb3dzLmdldChpKTsKICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfT1JJRU5UQVRJT04pIExvZy52KFRBRywgIlJlcG9ydGluZyBuZXcgZnJhbWUgdG8gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgd2luICsgIjogIiArIHdpbi5tRnJhbWUpOwogICAgICAgICAgICAgICAgICAgICB3aW4ubUNsaWVudC5yZXNpemVkKHdpbi5tRnJhbWUud2lkdGgoKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW4ubUZyYW1lLmhlaWdodCgpLCB3aW4ubUxhc3RDb250ZW50SW5zZXRzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbi5tTGFzdFZpc2libGVJbnNldHMsIHdpbi5tRHJhd1BlbmRpbmcpOwpAQCAtODYzMCw2ICs5NjYyLDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIC8vIERlc3Ryb3kgdGhlIHN1cmZhY2Ugb2YgYW55IHdpbmRvd3MgdGhhdCBhcmUgbm8gbG9uZ2VyIHZpc2libGUuCisgICAgICAgIGJvb2xlYW4gd2FsbHBhcGVyRGVzdHJveWVkID0gZmFsc2U7CiAgICAgICAgIGkgPSBtRGVzdHJveVN1cmZhY2Uuc2l6ZSgpOwogICAgICAgICBpZiAoaSA+IDApIHsKICAgICAgICAgICAgIGRvIHsKQEAgLTg2MzksNiArOTY3Miw5IEBACiAgICAgICAgICAgICAgICAgaWYgKG1JbnB1dE1ldGhvZFdpbmRvdyA9PSB3aW4pIHsKICAgICAgICAgICAgICAgICAgICAgbUlucHV0TWV0aG9kV2luZG93ID0gbnVsbDsKICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHdpbiA9PSBtV2FsbHBhcGVyVGFyZ2V0KSB7CisgICAgICAgICAgICAgICAgICAgIHdhbGxwYXBlckRlc3Ryb3llZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHdpbi5kZXN0cm95U3VyZmFjZUxvY2tlZCgpOwogICAgICAgICAgICAgfSB3aGlsZSAoaSA+IDApOwogICAgICAgICAgICAgbURlc3Ryb3lTdXJmYWNlLmNsZWFyKCk7CkBAIC04NjQ5LDYgKzk2ODUsOSBAQAogICAgICAgICAgICAgV2luZG93VG9rZW4gdG9rZW4gPSBtRXhpdGluZ1Rva2Vucy5nZXQoaSk7CiAgICAgICAgICAgICBpZiAoIXRva2VuLmhhc1Zpc2libGUpIHsKICAgICAgICAgICAgICAgICBtRXhpdGluZ1Rva2Vucy5yZW1vdmUoaSk7CisgICAgICAgICAgICAgICAgaWYgKHRva2VuLndpbmRvd1R5cGUgPT0gVFlQRV9XQUxMUEFQRVIpIHsKKyAgICAgICAgICAgICAgICAgICAgbVdhbGxwYXBlclRva2Vucy5yZW1vdmUodG9rZW4pOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC04NjYxLDEwICs5NzAwLDMxIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAorICAgICAgICBib29sZWFuIG5lZWRSZWxheW91dCA9IGZhbHNlOworICAgICAgICAKKyAgICAgICAgaWYgKCFhbmltYXRpbmcgJiYgbUFwcFRyYW5zaXRpb25SdW5uaW5nKSB7CisgICAgICAgICAgICAvLyBXZSBoYXZlIGZpbmlzaGVkIHRoZSBhbmltYXRpb24gb2YgYW4gYXBwIHRyYW5zaXRpb24uICBUbyBkbworICAgICAgICAgICAgLy8gdGhpcywgd2UgaGF2ZSBkZWxheWVkIGEgbG90IG9mIG9wZXJhdGlvbnMgbGlrZSBzaG93aW5nIGFuZAorICAgICAgICAgICAgLy8gaGlkaW5nIGFwcHMsIG1vdmluZyBhcHBzIGluIFotb3JkZXIsIGV0Yy4gIFRoZSBhcHAgdG9rZW4gbGlzdAorICAgICAgICAgICAgLy8gcmVmbGVjdHMgdGhlIGNvcnJlY3QgWi1vcmRlciwgYnV0IHRoZSB3aW5kb3cgbGlzdCBtYXkgbm93CisgICAgICAgICAgICAvLyBiZSBvdXQgb2Ygc3luYyB3aXRoIGl0LiAgU28gaGVyZSB3ZSB3aWxsIGp1c3QgcmVidWlsZCB0aGUKKyAgICAgICAgICAgIC8vIGVudGlyZSBhcHAgd2luZG93IGxpc3QuICBGdW4hCisgICAgICAgICAgICBtQXBwVHJhbnNpdGlvblJ1bm5pbmcgPSBmYWxzZTsKKyAgICAgICAgICAgIG5lZWRSZWxheW91dCA9IHRydWU7CisgICAgICAgICAgICByZWJ1aWxkQXBwV2luZG93TGlzdExvY2tlZCgpOworICAgICAgICAgICAgLy8gQ2xlYXIgaW5mb3JtYXRpb24gYWJvdXQgYXBwcyB0aGF0IHdlcmUgbW92aW5nLgorICAgICAgICAgICAgbVRvQm90dG9tQXBwcy5jbGVhcigpOworICAgICAgICB9CisgICAgICAgIAogICAgICAgICBpZiAoZm9jdXNEaXNwbGF5ZWQpIHsKICAgICAgICAgICAgIG1ILnNlbmRFbXB0eU1lc3NhZ2UoSC5SRVBPUlRfTE9TSU5HX0ZPQ1VTKTsKICAgICAgICAgfQotICAgICAgICBpZiAoYW5pbWF0aW5nKSB7CisgICAgICAgIGlmICh3YWxscGFwZXJEZXN0cm95ZWQpIHsKKyAgICAgICAgICAgIG5lZWRSZWxheW91dCA9IGFkanVzdFdhbGxwYXBlcldpbmRvd3NMb2NrZWQoKSAhPSAwOworICAgICAgICB9CisgICAgICAgIGlmIChuZWVkUmVsYXlvdXQpIHsKKyAgICAgICAgICAgIHJlcXVlc3RBbmltYXRpb25Mb2NrZWQoMCk7CisgICAgICAgIH0gZWxzZSBpZiAoYW5pbWF0aW5nKSB7CiAgICAgICAgICAgICByZXF1ZXN0QW5pbWF0aW9uTG9ja2VkKGN1cnJlbnRUaW1lKygxMDAwLzYwKS1TeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSk7CiAgICAgICAgIH0KICAgICAgICAgbVF1ZXVlLnNldEhvbGRTY3JlZW5Mb2NrZWQoaG9sZFNjcmVlbiAhPSBudWxsKTsKQEAgLTg3MzgsNyArOTc5OCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiB0b2tlbj0iICsgd2luLm1Ub2tlbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgcGlkPSIgKyB3cy5tU2Vzc2lvbi5tUGlkCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiB1aWQ9IiArIHdzLm1TZXNzaW9uLm1VaWQpOwotICAgICAgICAgICAgICAgICAgICAgICAgd3MubVN1cmZhY2UuY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdzLm1TdXJmYWNlLmRlc3Ryb3koKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHdzLm1TdXJmYWNlID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Gb3JjZVJlbW92ZXMuYWRkKHdzKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGktLTsKQEAgLTg3NDgsNyArOTgwOCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJMRUFLRUQgU1VSRkFDRSAoYXBwIHRva2VuIGhpZGRlbik6ICIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3cyArICIgc3VyZmFjZT0iICsgd3MubVN1cmZhY2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHRva2VuPSIgKyB3aW4ubUFwcFRva2VuKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdzLm1TdXJmYWNlLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB3cy5tU3VyZmFjZS5kZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB3cy5tU3VyZmFjZSA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgICBsZWFrZWRTdXJmYWNlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgfQpAQCAtODc4NCw3ICs5ODQ0LDcgQEAKICAgICAgICAgICAgICAgICAvLyBzdXJmYWNlIGFuZCBhc2sgdGhlIGFwcCB0byByZXF1ZXN0IGFub3RoZXIgb25lLgogICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkxvb2tzIGxpa2Ugd2UgaGF2ZSByZWNsYWltZWQgc29tZSBtZW1vcnksIGNsZWFyaW5nIHN1cmZhY2UgZm9yIHJldHJ5LiIpOwogICAgICAgICAgICAgICAgIGlmIChzdXJmYWNlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgc3VyZmFjZS5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICBzdXJmYWNlLmRlc3Ryb3koKTsKICAgICAgICAgICAgICAgICAgICAgd2luLm1TdXJmYWNlID0gbnVsbDsKICAgICAgICAgICAgICAgICB9CiAKQEAgLTkwNDMsNiArMTAxMDMsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgdy5kdW1wKHB3LCAiICAgICIpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtUmVzaXppbmdXaW5kb3dzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgICAgICBwdy5wcmludGxuKCIgIik7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICBXaW5kb3dzIHdhaXRpbmcgdG8gcmVzaXplOiIpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGk9bVJlc2l6aW5nV2luZG93cy5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIHcgPSBtUmVzaXppbmdXaW5kb3dzLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgUmVzaXppbmcgIyIpOyBwdy5wcmludChpKTsgcHcucHJpbnQoJyAnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCh3KTsgcHcucHJpbnRsbigiOiIpOworICAgICAgICAgICAgICAgICAgICB3LmR1bXAocHcsICIgICAgIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKG1TZXNzaW9ucy5zaXplKCkgPiAwKSB7CiAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICIpOwogICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgQWxsIGFjdGl2ZSBzZXNzaW9uczoiKTsKQEAgLTkwNzEsNiArMTAxNDEsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1Ub2tlbkxpc3QuZ2V0KGkpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVdhbGxwYXBlclRva2Vucy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICIpOworICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgV2FsbHBhcGVyIHRva2VuczoiKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpPW1XYWxscGFwZXJUb2tlbnMuc2l6ZSgpLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgICAgICBXaW5kb3dUb2tlbiB0b2tlbiA9IG1XYWxscGFwZXJUb2tlbnMuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICBXYWxscGFwZXIgIyIpOyBwdy5wcmludChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgnICcpOyBwdy5wcmludCh0b2tlbik7IHB3LnByaW50bG4oJzonKTsKKyAgICAgICAgICAgICAgICAgICAgdG9rZW4uZHVtcChwdywgIiAgICAiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAobUFwcFRva2Vucy5zaXplKCkgPiAwKSB7CiAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICIpOwogICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgQXBwbGljYXRpb24gdG9rZW5zIGluIFogb3JkZXI6Iik7CkBAIC05MTE1LDYgKzEwMTk1LDExIEBACiAgICAgICAgICAgICBwdy5wcmludCgiICBtRm9jdXNlZEFwcD0iKTsgcHcucHJpbnRsbihtRm9jdXNlZEFwcCk7CiAgICAgICAgICAgICBwdy5wcmludCgiICBtSW5wdXRNZXRob2RUYXJnZXQ9Iik7IHB3LnByaW50bG4obUlucHV0TWV0aG9kVGFyZ2V0KTsKICAgICAgICAgICAgIHB3LnByaW50KCIgIG1JbnB1dE1ldGhvZFdpbmRvdz0iKTsgcHcucHJpbnRsbihtSW5wdXRNZXRob2RXaW5kb3cpOworICAgICAgICAgICAgcHcucHJpbnQoIiAgbVdhbGxwYXBlclRhcmdldD0iKTsgcHcucHJpbnRsbihtV2FsbHBhcGVyVGFyZ2V0KTsKKyAgICAgICAgICAgIGlmIChtTG93ZXJXYWxscGFwZXJUYXJnZXQgIT0gbnVsbCAmJiBtVXBwZXJXYWxscGFwZXJUYXJnZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHB3LnByaW50KCIgIG1Mb3dlcldhbGxwYXBlclRhcmdldD0iKTsgcHcucHJpbnRsbihtTG93ZXJXYWxscGFwZXJUYXJnZXQpOworICAgICAgICAgICAgICAgIHB3LnByaW50KCIgIG1VcHBlcldhbGxwYXBlclRhcmdldD0iKTsgcHcucHJpbnRsbihtVXBwZXJXYWxscGFwZXJUYXJnZXQpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgcHcucHJpbnQoIiAgbUluVG91Y2hNb2RlPSIpOyBwdy5wcmludGxuKG1JblRvdWNoTW9kZSk7CiAgICAgICAgICAgICBwdy5wcmludCgiICBtU3lzdGVtQm9vdGVkPSIpOyBwdy5wcmludChtU3lzdGVtQm9vdGVkKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtRGlzcGxheUVuYWJsZWQ9Iik7IHB3LnByaW50bG4obURpc3BsYXlFbmFibGVkKTsKQEAgLTkxMjYsNyArMTAyMTEsMTEgQEAKICAgICAgICAgICAgICAgICBwdy5wcmludCggIiAgbm8gRGltQW5pbWF0b3IgIik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBwdy5wcmludCgiICBtSW5wdXRNZXRob2RBbmltTGF5ZXJBZGp1c3RtZW50PSIpOwotICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1JbnB1dE1ldGhvZEFuaW1MYXllckFkanVzdG1lbnQpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludChtSW5wdXRNZXRob2RBbmltTGF5ZXJBZGp1c3RtZW50KTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgbVdhbGxwYXBlckFuaW1MYXllckFkanVzdG1lbnQ9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obVdhbGxwYXBlckFuaW1MYXllckFkanVzdG1lbnQpOworICAgICAgICAgICAgcHcucHJpbnQoIiAgbUxhc3RXYWxscGFwZXJYPSIpOyBwdy5wcmludChtTGFzdFdhbGxwYXBlclgpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1MYXN0V2FsbHBhcGVyWT0iKTsgcHcucHJpbnRsbihtTGFzdFdhbGxwYXBlclkpOwogICAgICAgICAgICAgcHcucHJpbnQoIiAgbURpc3BsYXlGcm96ZW49Iik7IHB3LnByaW50KG1EaXNwbGF5RnJvemVuKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtV2luZG93c0ZyZWV6aW5nU2NyZWVuPSIpOyBwdy5wcmludChtV2luZG93c0ZyZWV6aW5nU2NyZWVuKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtQXBwc0ZyZWV6aW5nU2NyZWVuPSIpOyBwdy5wcmludGxuKG1BcHBzRnJlZXppbmdTY3JlZW4pOwpAQCAtOTEzOSw2ICsxMDIyOCw3IEBACiAgICAgICAgICAgICBwdy5wcmludCgiICBtTmV4dEFwcFRyYW5zaXRpb249MHgiKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoSW50ZWdlci50b0hleFN0cmluZyhtTmV4dEFwcFRyYW5zaXRpb24pKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiwgbUFwcFRyYW5zaXRpb25SZWFkeT0iKTsgcHcucHJpbnQobUFwcFRyYW5zaXRpb25SZWFkeSk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIsIG1BcHBUcmFuc2l0aW9uUnVubmluZz0iKTsgcHcucHJpbnQobUFwcFRyYW5zaXRpb25SdW5uaW5nKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiwgbUFwcFRyYW5zaXRpb25UaW1lb3V0PSIpOyBwdy5wcmludGxuKCBtQXBwVHJhbnNpdGlvblRpbWVvdXQpOwogICAgICAgICAgICAgcHcucHJpbnQoIiAgbVN0YXJ0aW5nSWNvbkluVHJhbnNpdGlvbj0iKTsgcHcucHJpbnQobVN0YXJ0aW5nSWNvbkluVHJhbnNpdGlvbik7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIsIG1Ta2lwQXBwVHJhbnNpdGlvbkFuaW1hdGlvbj0iKTsgcHcucHJpbnRsbihtU2tpcEFwcFRyYW5zaXRpb25BbmltYXRpb24pOwpAQCAtOTE0OCw2ICsxMDIzOCwxMiBAQAogICAgICAgICAgICAgaWYgKG1DbG9zaW5nQXBwcy5zaXplKCkgPiAwKSB7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgbUNsb3NpbmdBcHBzPSIpOyBwdy5wcmludGxuKG1DbG9zaW5nQXBwcyk7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVRvVG9wQXBwcy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgcHcucHJpbnQoIiAgbVRvVG9wQXBwcz0iKTsgcHcucHJpbnRsbihtVG9Ub3BBcHBzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtVG9Cb3R0b21BcHBzLnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgICAgICBwdy5wcmludCgiICBtVG9Cb3R0b21BcHBzPSIpOyBwdy5wcmludGxuKG1Ub0JvdHRvbUFwcHMpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgcHcucHJpbnQoIiAgRGlzcGxheVdpZHRoPSIpOyBwdy5wcmludChtRGlzcGxheS5nZXRXaWR0aCgpKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBEaXNwbGF5SGVpZ2h0PSIpOyBwdy5wcmludGxuKG1EaXNwbGF5LmdldEhlaWdodCgpKTsKICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgS2V5V2FpdGVyIHN0YXRlOiIpOwpAQCAtOTE2Niw2ICsxMDI2MiwxMCBAQAogICAgICAgICBzeW5jaHJvbml6ZWQgKG1LZXlXYWl0ZXIpIHsgfQogICAgIH0KIAorICAgIHB1YmxpYyB2b2lkIHZpcnR1YWxLZXlGZWVkYmFjayhLZXlFdmVudCBldmVudCkgeworICAgICAgICBtUG9saWN5LmtleUZlZWRiYWNrRnJvbUlucHV0KGV2ZW50KTsKKyAgICB9CisgICAgCiAgICAgLyoqCiAgICAgICogRGltQW5pbWF0b3IgY2xhc3MgdGhhdCBjb250cm9scyB0aGUgZGltIGFuaW1hdGlvbi4gVGhpcyBob2xkcyB0aGUgc3VyZmFjZSBhbmQKICAgICAgKiBhbGwgc3RhdGUgdXNlZCBmb3IgZGltIGFuaW1hdGlvbi4gCkBAIC05MjE1LDcgKzEwMzE1LDggQEAKICAgICAgICAgICAgIG1EaW1TdXJmYWNlLnNldExheWVyKHcubUFuaW1MYXllci0xKTsKIAogICAgICAgICAgICAgZmluYWwgZmxvYXQgdGFyZ2V0ID0gdy5tRXhpdGluZyA/IDAgOiB3Lm1BdHRycy5kaW1BbW91bnQ7Ci0gICAgICAgICAgICBpZiAoU0hPV19UUkFOU0FDVElPTlMpIExvZy5pKFRBRywgImxheWVyPSIgKyAody5tQW5pbUxheWVyLTEpICsgIiwgdGFyZ2V0PSIgKyB0YXJnZXQpOworICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBMb2cuaShUQUcsICIgIERJTSAiICsgbURpbVN1cmZhY2UKKyAgICAgICAgICAgICAgICAgICAgKyAiOiBsYXllcj0iICsgKHcubUFuaW1MYXllci0xKSArICIgdGFyZ2V0PSIgKyB0YXJnZXQpOwogICAgICAgICAgICAgaWYgKG1EaW1UYXJnZXRBbHBoYSAhPSB0YXJnZXQpIHsKICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgZGVzaXJlZCBkaW0gbGV2ZWwgaGFzIGNoYW5nZWQsIHRoZW4KICAgICAgICAgICAgICAgICAvLyBzdGFydCBhb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RUlWRVJfUFJPUEVSVFkgPSAicm8uZXJyb3IucmVjZWl2ZXIuc3lzdGVtLmFwcHMiOworCisgICAgLy8gU3lzdGVtIHByb3BlcnR5IGRlZmluaW5nIGRlZmF1bHQgZXJyb3IgcmVwb3J0IHJlY2VpdmVyCisgICAgc3RhdGljIGZpbmFsIFN0cmluZyBERUZBVUxUX0VSUk9SX1JFQ0VJVkVSX1BST1BFUlRZID0gInJvLmVycm9yLnJlY2VpdmVyLmRlZmF1bHQiOworCiAgICAgLy8gQ29ycmVzcG9uZGluZyBtZW1vcnkgbGV2ZWxzIGZvciBhYm92ZSBhZGp1c3RtZW50cy4KICAgICBmaW5hbCBpbnQgRU1QVFlfQVBQX01FTTsKICAgICBmaW5hbCBpbnQgSElEREVOX0FQUF9NRU07CkBAIC03NjMsNiArNzczLDggQEAKICAgICBTdHJpbmcgbVRvcERhdGE7CiAgICAgYm9vbGVhbiBtU3lzdGVtUmVhZHkgPSBmYWxzZTsKICAgICBib29sZWFuIG1Cb290aW5nID0gZmFsc2U7CisgICAgYm9vbGVhbiBtV2FpdGluZ1VwZGF0ZSA9IGZhbHNlOworICAgIGJvb2xlYW4gbURpZFVwZGF0ZSA9IGZhbHNlOwogCiAgICAgQ29udGV4dCBtQ29udGV4dDsKIApAQCAtOTgwLDYgKzk5Miw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc2V0KDApOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGVuc3VyZUJvb3RDb21wbGV0ZWQoKTsKICAgICAgICAgICAgIH0gYnJlYWs7CiAgICAgICAgICAgICBjYXNlIFNIT1dfTk9UX1JFU1BPTkRJTkdfTVNHOiB7CiAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChBY3Rpdml0eU1hbmFnZXJTZXJ2aWNlLnRoaXMpIHsKQEAgLTEwMDAsMTMgKzEwMTQsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgcHJvYy5hbnJEaWFsb2cgPSBkOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBlbnN1cmVTY3JlZW5FbmFibGVkKCk7CisgICAgICAgICAgICAgICAgZW5zdXJlQm9vdENvbXBsZXRlZCgpOwogICAgICAgICAgICAgfSBicmVhazsKICAgICAgICAgICAgIGNhc2UgU0hPV19GQUNUT1JZX0VSUk9SX01TRzogewogICAgICAgICAgICAgICAgIERpYWxvZyBkID0gbmV3IEZhY3RvcnlFcnJvckRpYWxvZygKICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQsIG1zZy5nZXREYXRhKCkuZ2V0Q2hhclNlcXVlbmNlKCJtc2ciKSk7CiAgICAgICAgICAgICAgICAgZC5zaG93KCk7Ci0gICAgICAgICAgICAgICAgZW5hYmxlU2NyZWVuQWZ0ZXJCb290KCk7CisgICAgICAgICAgICAgICAgZW5zdXJlQm9vdENvbXBsZXRlZCgpOwogICAgICAgICAgICAgfSBicmVhazsKICAgICAgICAgICAgIGNhc2UgVVBEQVRFX0NPTkZJR1VSQVRJT05fTVNHOiB7CiAgICAgICAgICAgICAgICAgZmluYWwgQ29udGVudFJlc29sdmVyIHJlc29sdmVyID0gbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCk7CkBAIC0xODUwLDEyICsxODY0LDEyIEBACiAgICAgICAgIH0KIAogICAgICAgICBzdGFydFByb2Nlc3NMb2NrZWQoci5wcm9jZXNzTmFtZSwgci5pbmZvLmFwcGxpY2F0aW9uSW5mbywgdHJ1ZSwgMCwKLSAgICAgICAgICAgICAgICAiYWN0aXZpdHkiLCByLmludGVudC5nZXRDb21wb25lbnQoKSk7CisgICAgICAgICAgICAgICAgImFjdGl2aXR5Iiwgci5pbnRlbnQuZ2V0Q29tcG9uZW50KCksIGZhbHNlKTsKICAgICB9CiAKICAgICBwcml2YXRlIGZpbmFsIFByb2Nlc3NSZWNvcmQgc3RhcnR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xhdW5jaCBtb2RlICh0aGF0IGlzLCBub3QKICAgICAgICAgICAgICAgICAvLyBleHBlY3Rpbmcgb25OZXdJbnRlbnQoKSksIHRoZW4gd2Ugd2lsbCBmaW5pc2ggdGhlIGN1cnJlbnQKICAgICAgICAgICAgICAgICAvLyBpbnN0YW5jZSBvZiB0aGUgYWN0aXZpdHkgc28gYSBuZXcgZnJlc2ggb25lIGNhbiBiZSBzdGFydGVkLgotICAgICAgICAgICAgICAgIGlmIChyZXQubGF1bmNoTW9kZSA9PSBBY3Rpdml0eUluZm8uTEFVTkNIX01VTFRJUExFKSB7CisgICAgICAgICAgICAgICAgaWYgKHJldC5sYXVuY2hNb2RlID09IEFjdGl2aXR5SW5mby5MQVVOQ0hfTVVMVElQTEUKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIChsYXVuY2hGbGFncyZJbnRlbnQuRkxBR19BQ1RJVklUWV9TSU5HTEVfVE9QKSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmICghcmV0LmZpbmlzaGluZykgewogICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4ID0gaW5kZXhPZlRva2VuTG9ja2VkKHJldCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPj0gMCkgewpAQCAtMzMzOCw3ICszMzU4LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhc2VzIHRoaXMgbWVhbnMgd2UgYXJlIHJlc2V0dGluZyB0aGUgdGFzayB0byBpdHMKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluaXRpYWwgc3RhdGUuCiAgICAgICAgICAgICAgICAgICAgICAgICBIaXN0b3J5UmVjb3JkIHRvcCA9IHBlcmZvcm1DbGVhclRhc2tMb2NrZWQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhc2tUb3AudGFzay50YXNrSWQsIHIsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXNrVG9wLnRhc2sudGFza0lkLCByLCBsYXVuY2hGbGFncywgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9wICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9wLmZyb250T2ZUYXNrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFjdGl2aXR5IGFsaWFzZXMgbWF5IG1lYW4gd2UgdXNlIGRpZmZlcmVudApAQCAtMzQ4MSw3ICszNTAxLDcgQEAKICAgICAgICAgICAgICAgICAvLyB0YXNrLCBidXQgdGhlIGNhbGxlciBoYXMgYXNrZWQgdG8gY2xlYXIgdGhhdCB0YXNrIGlmIHRoZQogICAgICAgICAgICAgICAgIC8vIGFjdGl2aXR5IGlzIGFscmVhZHkgcnVubmluZy4KICAgICAgICAgICAgICAgICBIaXN0b3J5UmVjb3JkIHRvcCA9IHBlcmZvcm1DbGVhclRhc2tMb2NrZWQoCi0gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VSZWNvcmQudGFzay50YXNrSWQsIHIsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlUmVjb3JkLnRhc2sudGFza0lkLCByLCBsYXVuY2hGbGFncywgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgaWYgKHRvcCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGxvZ1N0YXJ0QWN0aXZpdHkoTE9HX0FNX05FV19JTlRFTlQsIHIsIHRvcC50YXNrKTsKICAgICAgICAgICAgICAgICAgICAgZGVsaXZlck5ld0ludGVudExvY2tlZCh0b3AsIHIuaW50ZW50KTsKQEAgLTQ4NzcsNiArNDg5Nyw1MiBAQAogICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShvcmlnSWQpOwogICAgIH0KICAgICAKKyAgICBwdWJsaWMgdm9pZCBnZXRQcm9jZXNzTWVtb3J5SW5mbyhpbnQgcGlkLCBEZWJ1Zy5NZW1vcnlJbmZvIG1pKQorICAgICAgICAgICAgdGhyb3dzIFJlbW90ZUV4Y2VwdGlvbiB7CisgICAgICAgIFByb2Nlc3NSZWNvcmQgcHJvYzsKKyAgICAgICAgc3luY2hyb25pemVkIChtUGlkc1NlbGZMb2NrZWQpIHsKKyAgICAgICAgICAgIHByb2MgPSBtUGlkc1NlbGZMb2NrZWQuZ2V0KHBpZCk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChwcm9jID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSZW1vdGVFeGNlcHRpb24oKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgSUFwcGxpY2F0aW9uVGhyZWFkIHRocmVhZCA9IHByb2MudGhyZWFkOworICAgICAgICBpZiAodGhyZWFkID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSZW1vdGVFeGNlcHRpb24oKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdGhyZWFkLmdldE1lbW9yeUluZm8obWkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGtpbGxBcHBsaWNhdGlvblByb2Nlc3MoU3RyaW5nIHByb2Nlc3NOYW1lLCBpbnQgdWlkKSB7CisgICAgICAgIGlmIChwcm9jZXNzTmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpbnQgY2FsbGVyVWlkID0gQmluZGVyLmdldENhbGxpbmdVaWQoKTsKKyAgICAgICAgLy8gT25seSB0aGUgc3lzdGVtIHNlcnZlciBjYW4ga2lsbCBhbiBhcHBsaWNhdGlvbgorICAgICAgICBpZiAoY2FsbGVyVWlkID09IFByb2Nlc3MuU1lTVEVNX1VJRCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgUHJvY2Vzc1JlY29yZCBhcHAgPSBnZXRQcm9jZXNzUmVjb3JkTG9ja2VkKHByb2Nlc3NOYW1lLCB1aWQpOworICAgICAgICAgICAgICAgIGlmIChhcHAgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgYXBwLnRocmVhZC5zY2hlZHVsZVN1aWNpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBvdGhlciBlbmQgYWxyZWFkeSBkaWVkLCB0aGVuIG91ciB3b3JrIGhlcmUgaXMgZG9uZS4KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlByb2Nlc3MvdWlkIG5vdCBmb3VuZCBhdHRlbXB0aW5nIGtpbGwgb2YgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgcHJvY2Vzc05hbWUgKyAiIC8gIiArIHVpZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhyb3cgbmV3IFNlY3VyaXR5RXhjZXB0aW9uKGNhbGxlclVpZCArICIgY2Fubm90IGtpbGwgYXBwIHByb2Nlc3M6ICIgKworICAgICAgICAgICAgICAgICAgICBwcm9jZXNzTmFtZSk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQgcmVzdGFydFBhY2thZ2VMb2NrZWQoZmluYWwgU3RyaW5nIHBhY2thZ2VOYW1lLCBpbnQgdWlkKSB7CiAgICAgICAgIHVuaW5zdGFsbFBhY2thZ2VMb2NrZWQocGFja2FnZU5hbWUsIHVpZCwgZmFsc2UpOwogICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVTVEFSVEVELApAQCAtNTEwMSw4ICs1MTY3LDEzIEBACiAK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AobUJhY2t1cFRhcmdldCAhPSBudWxsICYmIG1CYWNrdXBBcHBOYW1lLmVxdWFscyhwcm9jZXNzTmFtZSkpIHsKICAgICAgICAgICAgICAgICBpc1Jlc3RyaWN0ZWRCYWNrdXBNb2RlID0gKG1CYWNrdXBUYXJnZXQuYmFja3VwTW9kZSA9PSBCYWNrdXBSZWNvcmQuUkVTVE9SRSkKICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChtQmFja3VwVGFyZ2V0LmJhY2t1cE1vZGUgPT0gQmFja3VwUmVjb3JkLkJBQ0tVUF9GVUxMKTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAogICAgICAgICAgICAgZW5zdXJlUGFja2FnZURleE9wdChhcHAuaW5zdHJ1bWVudGF0aW9uSW5mbyAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgID8gYXBwLmluc3RydW1lbnRhdGlvbkluZm8ucGFja2FnZU5hbWUKICAgICAgICAgICAgICAgICAgICAgOiBhcHAuaW5mby5wYWNrYWdlTmFtZSk7CkBAIC01MTM0LDcgKzUyMDcsOCBAQAogICAgICAgICAgICAgICAgICAgICA/IGFwcC5pbnN0cnVtZW50YXRpb25JbmZvIDogYXBwLmluZm8sIHByb3ZpZGVycywKICAgICAgICAgICAgICAgICAgICAgYXBwLmluc3RydW1lbnRhdGlvbkNsYXNzLCBhcHAuaW5zdHJ1bWVudGF0aW9uUHJvZmlsZUZpbGUsCiAgICAgICAgICAgICAgICAgICAgIGFwcC5pbnN0cnVtZW50YXRpb25Bcmd1bWVudHMsIGFwcC5pbnN0cnVtZW50YXRpb25XYXRjaGVyLCB0ZXN0TW9kZSwgCi0gICAgICAgICAgICAgICAgICAgIGlzUmVzdHJpY3RlZEJhY2t1cE1vZGUsIG1Db25maWd1cmF0aW9uLCBnZXRDb21tb25TZXJ2aWNlc0xvY2tlZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgaXNSZXN0cmljdGVkQmFja3VwTW9kZSB8fCAhbm9ybWFsTW9kZSwKKyAgICAgICAgICAgICAgICAgICAgbUNvbmZpZ3VyYXRpb24sIGdldENvbW1vblNlcnZpY2VzTG9ja2VkKCkpOwogICAgICAgICAgICAgdXBkYXRlTFJVTGlzdExvY2tlZChhcHAsIGZhbHNlKTsKICAgICAgICAgICAgIGFwcC5sYXN0UmVxdWVzdGVkR2MgPSBhcHAubGFzdExvd01lbW9yeSA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOwogICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewpAQCAtNTMwMCw2ICs1Mzc0LDggQEAKICAgICB9CiAKICAgICB2b2lkIGVuYWJsZVNjcmVlbkFmdGVyQm9vdCgpIHsKKyAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfQk9PVF9QUk9HUkVTU19FTkFCTEVfU0NSRUVOLAorICAgICAgICAgICAgICAgIFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpKTsKICAgICAgICAgbVdpbmRvd01hbmFnZXIuZW5hYmxlU2NyZWVuQWZ0ZXJCb290KCk7CiAgICAgfQogCkBAIC01NDEwLDI2ICs1NDg2LDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChib290aW5nKSB7Ci0gICAgICAgICAgICAvLyBFbnN1cmUgdGhhdCBhbnkgcHJvY2Vzc2VzIHdlIGhhZCBwdXQgb24gaG9sZCBhcmUgbm93IHN0YXJ0ZWQKLSAgICAgICAgICAgIC8vIHVwLgotICAgICAgICAgICAgZmluYWwgaW50IE5QID0gbVByb2Nlc3Nlc09uSG9sZC5zaXplKCk7Ci0gICAgICAgICAgICBpZiAoTlAgPiAwKSB7Ci0gICAgICAgICAgICAgICAgQXJyYXlMaXN0PFByb2Nlc3NSZWNvcmQ+IHByb2NzID0KLSAgICAgICAgICAgICAgICAgICAgbmV3IEFycmF5TGlzdDxQcm9jZXNzUmVjb3JkPihtUHJvY2Vzc2VzT25Ib2xkKTsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpcD0wOyBpcDxOUDsgaXArKykgewotICAgICAgICAgICAgICAgICAgICB0aGlzLnN0YXJ0UHJvY2Vzc0xvY2tlZChwcm9jcy5nZXQoaXApLCAib24taG9sZCIsIG51bGwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtRmFjdG9yeVRlc3QgIT0gU3lzdGVtU2VydmVyLkZBQ1RPUllfVEVTVF9MT1dfTEVWRUwpIHsKLSAgICAgICAgICAgICAgICAvLyBUZWxsIGFueW9uZSBpbnRlcmVzdGVkIHRoYXQgd2UgYXJlIGRvbmUgYm9vdGluZyEKLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJvYWRjYXN0SW50ZW50TG9ja2VkKG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEludGVudChJbnRlbnQuQUNUSU9OX0JPT1RfQ09NUExFVEVELCBudWxsKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCAwLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5SRUNFSVZFX0JPT1RfQ09NUExFVEVELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBmYWxzZSwgTVlfUElELCBQcm9jZXNzLlNZU1RFTV9VSUQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZpbmlzaEJvb3RpbmcoKTsKICAgICAgICAgfQogCiAgICAgICAgIHRyaW1BcHBsaWNhdGlvbnMoKTsKQEAgLTU0MzcsMjIgKzU0OTQsNDggQEAKICAgICAgICAgLy9tV2luZG93TWFuYWdlci5kdW1wKCk7CiAKICAgICAgICAgaWYgKGVuYWJsZVNjcmVlbikgewotICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfQk9PVF9QUk9HUkVTU19FTkFCTEVfU0NSRUVOLAotICAgICAgICAgICAgICAgIFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpKTsKICAgICAgICAgICAgIGVuYWJsZVNjcmVlbkFmdGVyQm9vdCgpOwogICAgICAgICB9CiAgICAgfQogCi0gICAgZmluYWwgdm9pZCBlbnN1cmVTY3JlZW5FbmFibGVkKCkgeworICAgIGZpbmFsIHZvaWQgZmluaXNoQm9vdGluZygpIHsKKyAgICAgICAgLy8gRW5zdXJlIHRoYXQgYW55IHByb2Nlc3NlcyB3ZSBoYWQgcHV0IG9uIGhvbGQgYXJlIG5vdyBzdGFydGVkCisgICAgICAgIC8vIHVwLgorICAgICAgICBmaW5hbCBpbnQgTlAgPSBtUHJvY2Vzc2VzT25Ib2xkLnNpemUoKTsKKyAgICAgICAgaWYgKE5QID4gMCkgeworICAgICAgICAgICAgQXJyYXlMaXN0PFByb2Nlc3NSZWNvcmQ+IHByb2NzID0KKyAgICAgICAgICAgICAgICBuZXcgQXJyYXlMaXN0PFByb2Nlc3NSZWNvcmQ+KG1Qcm9jZXNzZXNPbkhvbGQpOworICAgICAgICAgICAgZm9yIChpbnQgaXA9MDsgaXA8TlA7IGlwKyspIHsKKyAgICAgICAgICAgICAgICB0aGlzLnN0YXJ0UHJvY2Vzc0xvY2tlZChwcm9jcy5nZXQoaXApLCAib24taG9sZCIsIG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtRmFjdG9yeVRlc3QgIT0gU3lzdGVtU2VydmVyLkZBQ1RPUllfVEVTVF9MT1dfTEVWRUwpIHsKKyAgICAgICAgICAgIC8vIFRlbGwgYW55b25lIGludGVyZXN0ZWQgdGhhdCB3ZSBhcmUgZG9uZSBib290aW5nIQorICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICAgICAgYnJvYWRjYXN0SW50ZW50TG9ja2VkKG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fQk9PVF9DT01QTEVURUQsIG51bGwpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgMCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5SRUNFSVZFX0JPT1RfQ09NUExFVEVELAorICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsIGZhbHNlLCBNWV9QSUQsIFByb2Nlc3MuU1lTVEVNX1VJRCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgZmluYWwgdm9pZCBlbnN1cmVCb290Q29tcGxldGVkKCkgeworICAgICAgICBib29sZWFuIGJvb3Rpbmc7CiAgICAgICAgIGJvb2xlYW4gZW5hYmxlU2NyZWVuOwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGJvb3RpbmcgPSBtQm9vdGluZzsKKyAgICAgICAgICAgIG1Cb290aW5nID0gZmFsc2U7CiAgICAgICAgICAgICBlbmFibGVTY3JlZW4gPSAhbUJvb3RlZDsKICAgICAgICAgICAgIG1Cb290ZWQgPSB0cnVlOwogICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoYm9vdGluZykgeworICAgICAgICAgICAgZmluaXNoQm9vdGluZygpOworICAgICAgICB9CiAKICAgICAgICAgaWYgKGVuYWJsZVNjcmVlbikgewotICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfQk9PVF9QUk9HUkVTU19FTkFCTEVfU0NSRUVOLAotICAgICAgICAgICAgICAgIFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpKTsKICAgICAgICAgICAgIGVuYWJsZVNjcmVlbkFmdGVyQm9vdCgpOwogICAgICAgICB9CiAgICAgfQpAQCAtNTYwNCw2ICs1Njg3LDEzIEBACiAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJGaWxlIGRlc2NyaXB0b3JzIHBhc3NlZCBpbiBJbnRlbnQiKTsKICAgICAgICAgfQogCisgICAgICAgIGlmICh0eXBlID09IElOVEVOVF9TRU5ERVJfQlJPQURDQVNUKSB7CisgICAgICAgICAgICBpZiAoKGludGVudC5nZXRGbGFncygpJkludGVudC5GTEFHX1JFQ0VJVkVSX0JPT1RfVVBHUkFERSkgIT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiQ2FuJ3QgdXNlIEZMQUdfUkVDRUlWRVJfQk9PVF9VUEdSQURFIGhlcmUiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKICAgICAgICAgICAgIGludCBjYWxsaW5nVWlkID0gQmluZGVyLmdldENhbGxpbmdVaWQoKTsKICAgICAgICAgICAgIHRyeSB7CkBAIC03MzIyLDkgKzc0MTIsMTMgQEAKIAogICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgb3JpZ0lkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAKLSAgICAgICAgICAgICAgICAvLyBJbiB0aGlzIGNhc2UgdGhlIHByb3ZpZGVyIGlzIGEgc2luZ2xlIGluc3RhbmNlLCBzbyB3ZSBjYW4KKyAgICAgICAgICAgICAgICAvLyBJbiB0aGlzIGNhc2UgdGhlIHByb3ZpZGVyIGluc3RhbmNlIGFscmVhZHkgZXhpc3RzLCBzbyB3ZSBjYW4KICAgICAgICAgICAgICAgICAvLyByZXR1cm4gaXQgcmlnaHQgYXdheS4KICAgICAgICAgICAgICAgICBpZiAociAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19QUk9WSURFUikgTG9nLnYoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBZGRpbmcgcHJvdmlkZXIgcmVxdWVzdGVkIGJ5ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHIucHJvY2Vzc05hbWUgKyAiIGZyb20gcHJvY2VzcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjcHIuaW5mby5wcm9jZXNzTmFtZSk7ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgci5jb25Qcm92aWRlcnMuYWRkKGNwcik7CiAgICAgICAgICAgICAgICAgICAgIGNwci5jbGllbnRzLmFkZChyKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewpAQCAtNzM4MiwxMCArNzQ3NiwxMCBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3ByOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgewotICAgICAgICAgICAgICAgICAgICBSdW50aW1lRXhjZXB0aW9uIGUgPSBuZXcgUnVudGltZUV4Y2VwdGlvbigiZm9vIik7Ci0gICAgICAgICAgICAgICAgICAgIC8vTG9nLncoVEFHLCAiTEFVTkNISU5HIFJFTU9URSBQUk9WSURFUiAobXl1aWQgIiArIHIuaW5mby51aWQKLSAgICAgICAgICAgICAgICAgICAgLy8gICAgICArICIgcHJ1aWQgIiArIGFpLnVpZCArICIpOiAiICsgY3BpLmNsYXNzTmFtZSwgZSk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHX1BST1ZJREVSKSB7CisgICAgICAgICAgICAgICAgICAgIFJ1bnRpbWVFeGNlcHRpb24gZSA9IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJoZXJlIik7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkxBVU5DSElORyBSRU1PVEUgUFJPVklERVIgKG15dWlkICIgKyByLmluZm8udWlkCisgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBwcnVpZCAiICsgY3ByLmFwcEluZm8udWlkICsgIik6ICIgKyBjcHIuaW5mby5uYW1lLCBlKTsKICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIHNpbmdsZSBwcm9jZXNzLCBhbmQgb3VyIGFwcCBpcyBub3cgY29ubmVjdGluZyB0byBpdC4KQEAgLTczOTcsMTQgKzc0OTEsNiBAQAogICAgICAgICAgICAgICAgICAgICBpZiAobUxhdW5jaGluZ1Byb3ZpZGVycy5nZXQoaSkgPT0gY3ByKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoZmFsc2UpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIENvbnRlbnRQcm92aWRlclJlY29yZCByZWMgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChDb250ZW50UHJvdmlkZXJSZWNvcmQpbUxhdW5jaGluZ1Byb3ZpZGVycy5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVjLmluZm8ubmFtZS5lcXVhbHMoY3ByLmluZm8ubmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcHIgPSByZWM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgcHJvdmlkZXIgaXMgbm90IGFscmVhZHkgYmVpbmcgbGF1bmNoZWQsIHRoZW4gZ2V0IGl0CkBAIC03NDE0LDcgKzc1MDAsNyBAQAogICAgICAgICAgICAgICAgICAgICBQcm9jZXNzUmVjb3JkIHByb2MgPSBzdGFydFByb2Nlc3NMb2NrZWQoY3BpLnByb2Nlc3NOYW1lLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNwci5hcHBJbmZvLCBmYWxzZSwgMCwgImNvbnRlbnQgcHJvdmlkZXIiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBDb21wb25lbnROYW1lKGNwaS5hcHBsaWNhdGlvbkluZm8ucGFja2FnZU5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcGkubmFtZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3BpLm5hbWUpLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChwcm9jID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlVuYWJsZSB0byBsYXVuY2ggYXBwICIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjcGkuYXBwbGljYXRpb25JbmZvLnBhY2thZ2VOYW1lICsgIi8iCkBAIC03NDM1LDYgKzc1MjEsMTAgQEAKICAgICAgICAgICAgICAgICBtUHJvdmlkZXJzQnlOYW1lLnB1dChuYW1lLCBjcHIpOwogCiAgICAgICAgICAgICAgICAgaWYgKHIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfUFJPVklERVIpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQWRkaW5nIHByb3ZpZGVyIHJlcXVlc3RlZCBieSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyByLnByb2Nlc3NOYW1lICsgIiBmcm9tIHByb2Nlc3MgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgY3ByLmluZm8ucHJvY2Vzc05hbWUpOyAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgIHIuY29uUHJvdmlkZXJzLmFkZChjcHIpOwogICAgICAgICAgICAgICAgICAgICBjcHIuY2xpZW50cy5hZGQocik7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTc0ODksOCArNzU3OSw5IEBACiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyUmVjb3JkIGNwciA9IChDb250ZW50UHJvdmlkZXJSZWNvcmQpbVByb3ZpZGVyc0J5TmFtZS5nZXQobmFtZSk7CiAgICAgICAgICAgICBpZihjcHIgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vcmVtb3ZlIGZyb20gbVByb3ZpZGVyc0J5Q2xhc3MKLSAgICAgICAgICAgICAgICBpZihsb2NhbExPR1YpIExvZy52KFRBRywgbmFtZSsiIGNvbnRlbnQgcHJvdmlkZXIgbm90IGZvdW5kIGluIHByb3ZpZGVycyBsaXN0Iik7CisgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGZyb20gbVByb3ZpZGVyc0J5Q2xhc3MKKyAgICAgICAgICAgICAgICBpZiAoREVCVUdfUFJPVklERVIpIExvZy52KFRBRywgbmFtZSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIHByb3ZpZGVyIG5vdCBmb3VuZCBpbiBwcm92aWRlcnMgbGlzdCIpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGZpbmFsIFByb2Nlc3NSZWNvcmQgciA9IGdldFJlY29yZEZvckFwcExvY2tlZChjYWxsZXIpOwpAQCAtNzUwMCwxMiArNzU5MSwxNSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgIiB3aGVuIHJlbW92aW5nIGNvbnRlbnQgcHJvdmlkZXIgIiArIG5hbWUpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy91cGRhdGUgY29udGVudCBwcm92aWRlciByZWNvcmQgZW50cnkgaW5mbwotICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyUmVjb3JkIGxvY2FsQ3ByID0gKENvbnRlbnRQcm92aWRlclJlY29yZCkgbVByb3ZpZGVyc0J5Q2xhc3MuZ2V0KGNwci5pbmZvLm5hbWUpOwotICAgICAgICAgICAgaWYobG9jYWxMT0dWKSBMb2cudihUQUcsICJSZW1vdmluZyBjb250ZW50IHByb3ZpZGVyIHJlcXVlc3RlZCBieSAiKwotICAgICAgICAgICAgICAgICAgICByLmluZm8ucHJvY2Vzc05hbWUrIiBmcm9tIHByb2Nlc3MgIitsb2NhbENwci5hcHBJbmZvLnByb2Nlc3NOYW1lKTsKLSAgICAgICAgICAgIGlmKGxvY2FsQ3ByLmFwcEluZm8ucHJvY2Vzc05hbWUgPT0gIHIuaW5mby5wcm9jZXNzTmFtZSkgeworICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyUmVjb3JkIGxvY2FsQ3ByID0gKENvbnRlbnRQcm92aWRlclJlY29yZCkKKyAgICAgICAgICAgICAgICAgICAgbVByb3ZpZGVyc0J5Q2xhc3MuZ2V0KGNwci5pbmZvLm5hbWUpOworICAgICAgICAgICAgaWYgKERFQlVHX1BST1ZJREVSKSBMb2cudihUQUcsICJSZW1vdmluZyBwcm92aWRlciByZXF1ZXN0ZWQgYnkgIgorICAgICAgICAgICAgICAgICAgICArIHIuaW5mby5wcm9jZXNzTmFtZSArICIgZnJvbSBwcm9jZXNzICIKKyAgICAgICAgICAgICAgICAgICAgKyBsb2NhbENwci5hcHBJbmZvLnByb2Nlc3NOYW1lKTsKKyAgICAgICAgICAgIGlmIChsb2NhbENwci5hcHAgPT0gcikgewogICAgICAgICAgICAgICAgIC8vc2hvdWxkIG5vdCBoYXBwZW4uIHRha2VuIGNhcmUgb2YgYXMgYSBsb2NhbCBwcm92aWRlcgotICAgICAgICAgICAgICAgIGlmKGxvY2FsTE9HVikgTG9nLnYoVEFHLCAibG9jYWwgcHJvdmlkZXIgZG9pbmcgbm90aGluZyBJZ25vcmluZyBvdGhlciBuYW1lcyIpOworICAgICAgICAgICAgICAgIExvZy53KFRBRywgInJlbW92ZUNvbnRlbnRQcm92aWRlciBjYWxsZWQgb24gbG9jYWwgcHJvdmlkZXI6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgY3ByLmluZm8ubmFtZSArICIgaW4gcHJvY2VzcyAiICsgci5wcm9jZXNzTmFtZSk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBsb2NhbENwci5jbGllbnRzLnJlbW92ZShyKTsKQEAgLTgwOTksNyArODE5Myw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBzeXN0ZW1SZWFkeSgpOworICAgICAgICBzeXN0ZW1SZWFkeShudWxsKTsKICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgcmV0cmlldmVTZXR0aW5ncygpIHsKQEAgLTgxMjksNyArODIyMyw3IEBACiAgICAgICAgIHJldHVybiBtU3lzdGVtUmVhZHk7CiAgICAgfQogICAgIAotICAgIHB1YmxpYyB2b2lkIHN5c3RlbVJlYWR5KCkgeworICAgIHB1YmxpYyB2b2lkIHN5c3RlbVJlYWR5KGZpbmFsIFJ1bm5hYmxlIGdvaW5nQ2FsbGJhY2spIHsKICAgICAgICAgLy8gSW4gdGhlIHNpbXVsYXRvciwgc3RhcnRSdW5uaW5nIHdpbGwgbmV2ZXIgaGF2ZSBiZWVuIGNhbGxlZCwgd2hpY2gKICAgICAgICAgLy8gbm9ybWFsbHkgc2V0cyBhIGZldyBjcnVjaWFsIHZhcmlhYmxlcy4gRG8gaXQgaGVyZSBpbnN0ZWFkLgogICAgICAgICBpZiAoIVByb2Nlc3Muc3VwcG9ydHNQcm9jZXNzZXMoKSkgewpAQCAtODEzOSwxOSArODIzMyw5NiBAQAogCiAgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CiAgICAgICAgICAgICBpZiAobVN5c3RlbVJlYWR5KSB7CisgICAgICAgICAgICAgICAgaWYgKGdvaW5nQ2FsbGJhY2sgIT0gbnVsbCkgZ29pbmdDYWxsYmFjay5ydW4oKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIENoZWNrIHRvIHNlZSBpZiB0aGVyZSBhcmUgYW55IHVwZGF0ZSByZWNlaXZlcnMgdG8gcnVuLgorICAgICAgICAgICAgaWYgKCFtRGlkVXBkYXRlKSB7CisgICAgICAgICAgICAgICAgaWYgKG1XYWl0aW5nVXBkYXRlKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9QUkVfQk9PVF9DT01QTEVURUQpOworICAgICAgICAgICAgICAgIExpc3Q8UmVzb2x2ZUluZm8+IHJpcyA9IG51bGw7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgcmlzID0gQWN0aXZpdHlUaHJlYWQuZ2V0UGFja2FnZU1hbmFnZXIoKS5xdWVyeUludGVudFJlY2VpdmVycygKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LCBudWxsLCAwKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAocmlzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT1yaXMuc2l6ZSgpLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChyaXMuZ2V0KGkpLmFjdGl2aXR5SW5mby5hcHBsaWNhdGlvbkluZm8uZmxhZ3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkFwcGxpY2F0aW9uSW5mby5GTEFHX1NZU1RFTSkgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpcy5yZW1vdmUoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX0JPT1RfVVBHUkFERSk7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxyaXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFjdGl2aXR5SW5mbyBhaSA9IHJpcy5nZXQoaSkuYWN0aXZpdHlJbmZvOworICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChuZXcgQ29tcG9uZW50TmFtZShhaS5wYWNrYWdlTmFtZSwgYWkubmFtZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgSUludGVudFJlY2VpdmVyIGZpbmlzaGVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5pc2hlciA9IG5ldyBJSW50ZW50UmVjZWl2ZXIuU3R1YigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcGVyZm9ybVJlY2VpdmUoSW50ZW50IGludGVudCwgaW50IHJlc3VsdENvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGRhdGEsIEJ1bmRsZSBleHRyYXMsIGJvb2xlYW4gb3JkZXJlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoQWN0aXZpdHlNYW5hZ2VyU2VydmljZS50aGlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURpZFVwZGF0ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeXN0ZW1SZWFkeShnb2luZ0NhbGxiYWNrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJTZW5kaW5nIHN5c3RlbSB1cGRhdGUgdG86ICIgKyBpbnRlbnQuZ2V0Q29tcG9uZW50KCkpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJvYWRjYXN0SW50ZW50TG9ja2VkKG51bGwsIG51bGwsIGludGVudCwgbnVsbCwgZmluaXNoZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIG51bGwsIG51bGwsIG51bGwsIHRydWUsIGZhbHNlLCBNWV9QSUQsIFByb2Nlc3MuU1lTVEVNX1VJRCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdhaXRpbmdVcGRhdGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtV2FpdGluZ1VwZGF0ZSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1EaWRVcGRhdGUgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCiAgICAgICAgICAgICBtU3lzdGVtUmVhZHkgPSB0cnVlOwogICAgICAgICAgICAgaWYgKCFtU3RhcnRSdW5uaW5nKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgaWYgKENvbmZpZy5MT0dEKSBMb2cuZChUQUcsICJTdGFydCBydW5uaW5nISIpOworICAgICAgICBBcnJheUxpc3Q8UHJvY2Vzc1JlY29yZD4gcHJvY3NUb0tpbGwgPSBudWxsOworICAgICAgICBzeW5jaHJvbml6ZWQobVBpZHNTZWxmTG9ja2VkKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPW1QaWRzU2VsZkxvY2tlZC5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgUHJvY2Vzc1JlY29yZCBwcm9jID0gbVBpZHNTZWxmTG9ja2VkLnZhbHVlQXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKCFpc0FsbG93ZWRXaGlsZUJvb3RpbmcocHJvYy5pbmZvKSl7CisgICAgICAgICAgICAgICAgICAgIGlmIChwcm9jc1RvS2lsbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwcm9jc1RvS2lsbCA9IG5ldyBBcnJheUxpc3Q8UHJvY2Vzc1JlY29yZD4oKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwcm9jc1RvS2lsbC5hZGQocHJvYyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAocHJvY3NUb0tpbGwgIT0gbnVsbCkgeworICAgICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpPXByb2NzVG9LaWxsLnNpemUoKS0xOyBpPj0wOyBpLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgUHJvY2Vzc1JlY29yZCBwcm9jID0gcHJvY3NUb0tpbGwuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJSZW1vdmluZyBzeXN0ZW0gdXBkYXRlIHByb2M6ICIgKyBwcm9jKTsKKyAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUHJvY2Vzc0xvY2tlZChwcm9jLCB0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIExvZy5pKFRBRywgIlN5c3RlbSBub3cgcmVhZHkiKTsKICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChMT0dfQk9PVF9QUk9HUkVTU19BTVNfUkVBRFksCiAgICAgICAgICAgICBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSk7CiAKICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKKyAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB3ZSBoYXZlIG5vIHByZS1yZWFkeSBwcm9jZXNzZXMgc2l0dGluZyBhcm91bmQuCisgICAgICAgICAgICAKICAgICAgICAgICAgIGlmIChtRmFjdG9yeVRlc3QgPT0gU3lzdGVtU2VydmVyLkZBQ1RPUllfVEVTVF9MT1dfTEVWRUwpIHsKICAgICAgICAgICAgICAgICBSZXNvbHZlSW5mbyByaSA9IG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCkKICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXNvbHZlQWN0aXZpdHkobmV3IEludGVudChJbnRlbnQuQUNUSU9OX0ZBQ1RPUllfVEVTVCksCkBAIC04MTg3LDYgKzgzNTgsOCBAQAogCiAgICAgICAgIHJldHJpZXZlU2V0dGluZ3MoKTsKIAorICAgICAgICBpZiAoZ29pbmdDYWxsYmFjayAhPSBudWxsKSBnb2luZ0NhbGxiYWNrLnJ1bigpOworICAgICAgICAKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpZiAobUZhY3RvcnlUZXN0ICE9IFN5c3RlbVNlcnZlci5GQUNUT1JZX1RFU1RfTE9XX0xFVkVMKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKQEAgLTgyMDksNiArODM4Miw5IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCisgICAgICAgICAgICAvLyBTdGFydCB1cCBpbml0aWFsIGFjdGl2aXR5LgorICAgICAgICAgICAgbUJvb3RpbmcgPSB0cnVlOworICAgICAgICAgICAgCiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIGlmIChBY3Rpdml0eVRocmVhZC5nZXRQYWNrYWdlTWFuYWdlcigpLmhhc1N5c3RlbVVpZEVycm9ycygpKSB7CiAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2UgbXNnID0gTWVzc2FnZS5vYnRhaW4oKTsKQEAgLTgyMTgsOCArODM5NCw2IEBACiAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAvLyBTdGFydCB1cCBpbml0aWFsIGFjdGl2aXR5LgotICAgICAgICAgICAgbUJvb3RpbmcgPSB0cnVlOwogICAgICAgICAgICAgcmVzdW1lVG9wQWN0aXZpdHlMb2NrZWQobnVsbCk7CiAgICAgICAgIH0KICAgICB9CkBAIC04MjM2LDI3ICs4NDEwLDYyIEBACiAKICAgICBwcml2YXRlIENvbXBvbmVudE5hbWUgZ2V0RXJyb3JSZXBvcnRSZWNlaXZlcihQcm9jZXNzUmVjb3JkIGFwcCkgewogICAgICAgICBJUGFja2FnZU1hbmFnZXIgcG0gPSBBY3Rpdml0eVRocmVhZC5nZXRQYWNrYWdlTWFuYWdlcigpOworCiAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAvLyB3YXMgYW4gaW5zdGFsbGVyIHBhY2thZ2UgbmFtZSBzcGVjaWZpZWQgd2hlbiB0aGlzIGFwcCB3YXMKLSAgICAgICAgICAgIC8vIGluc3RhbGxlZD8KLSAgICAgICAgICAgIFN0cmluZyBpbnN0YWxsZXJQYWNrYWdlTmFtZSA9IHBtLmdldEluc3RhbGxlclBhY2thZ2VOYW1lKGFwcC5pbmZvLnBhY2thZ2VOYW1lKTsKLSAgICAgICAgICAgIGlmIChpbnN0YWxsZXJQYWNrYWdlTmFtZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAvLyBsb29rIGZvciByZWNlaXZlciBpbiB0aGUgaW5zdGFsbGVyIHBhY2thZ2UKKyAgICAgICAgICAgIFN0cmluZyBjYW5kaWRhdGUgPSBwbS5nZXRJbnN0YWxsZXJQYWNrYWdlTmFtZShhcHAuaW5mby5wYWNrYWdlTmFtZSk7CisgICAgICAgICAgICBDb21wb25lbnROYW1lIHJlc3VsdCA9IGdldEVycm9yUmVwb3J0UmVjZWl2ZXIocG0sIGFwcC5pbmZvLnBhY2thZ2VOYW1lLCBjYW5kaWRhdGUpOworICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgLy8gaXMgdGhlcmUgYW4gQWN0aXZpdHkgaW4gdGhpcyBwYWNrYWdlIHRoYXQgaGFuZGxlcyBBQ1RJT05fQVBQX0VSUk9SPwotICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9BUFBfRVJST1IpOwotICAgICAgICAgICAgaW50ZW50LnNldFBhY2thZ2UoaW5zdGFsbGVyUGFja2FnZU5hbWUpOwotICAgICAgICAgICAgUmVzb2x2ZUluZm8gaW5mbyA9IHBtLnJlc29sdmVJbnRlbnQoaW50ZW50LCBudWxsLCAwKTsKLSAgICAgICAgICAgIGlmIChpbmZvID09IG51bGwgfHwgaW5mby5hY3Rpdml0eUluZm8gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgLy8gaWYgdGhlIGVycm9yIGFwcCBpcyBvbiB0aGUgc3lzdGVtIGltYWdlLCBsb29rIGZvciBzeXN0ZW0gYXBwcworICAgICAgICAgICAgLy8gZXJyb3IgcmVjZWl2ZXIKKyAgICAgICAgICAgIGlmICgoYXBwLmluZm8uZmxhZ3MmQXBwbGljYXRpb25JbmZvLkZMQUdfU1lTVEVNKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgY2FuZGlkYXRlID0gU3lzdGVtUHJvcGVydGllcy5nZXQoU1lTVEVNX0FQUFNfRVJST1JfUkVDRUlWRVJfUFJPUEVSVFkpOworICAgICAgICAgICAgICAgIHJlc3VsdCA9IGdldEVycm9yUmVwb3J0UmVjZWl2ZXIocG0sIGFwcC5pbmZvLnBhY2thZ2VOYW1lLCBjYW5kaWRhdGUpOworICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgcmV0dXJuIG5ldyBDb21wb25lbnROYW1lKGluc3RhbGxlclBhY2thZ2VOYW1lLCBpbmZvLmFjdGl2aXR5SW5mby5uYW1lKTsKKyAgICAgICAgICAgIC8vIGlmIHRoZXJlIGlzIGEgZGVmYXVsdCByZWNlaXZlciwgdHJ5IHRoYXQKKyAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KERFRkFVTFRfRVJST1JfUkVDRUlWRVJfUFJPUEVSVFkpOworICAgICAgICAgICAgcmV0dXJuIGdldEVycm9yUmVwb3J0UmVjZWl2ZXIocG0sIGFwcC5pbmZvLnBhY2thZ2VOYW1lLCBjYW5kaWRhdGUpOwogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgLy8gd2lsbCByZXR1cm4gbnVsbCBhbmQgbm8gZXJyb3IgcmVwb3J0IHdpbGwgYmUgZGVsaXZlcmVkCisgICAgICAgICAgICAvLyBzaG91bGQgbm90IGhhcHBlbgorICAgICAgICAgICAgTG9nLmUoVEFHLCAiZXJyb3IgdGFsa2luZyB0byBQYWNrYWdlTWFuYWdlciIsIGUpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJuIGFjd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QuQUNUSU9OX0FQUF9FUlJPUik7CisgICAgICAgIGludGVudC5zZXRQYWNrYWdlKHJlY2VpdmVyUGFja2FnZSk7CisgICAgICAgIFJlc29sdmVJbmZvIGluZm8gPSBwbS5yZXNvbHZlSW50ZW50KGludGVudCwgbnVsbCwgMCk7CisgICAgICAgIGlmIChpbmZvID09IG51bGwgfHwgaW5mby5hY3Rpdml0eUluZm8gPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG5ldyBDb21wb25lbnROYW1lKHJlY2VpdmVyUGFja2FnZSwgaW5mby5hY3Rpdml0eUluZm8ubmFtZSk7CiAgICAgfQogCiAgICAgdm9pZCBtYWtlQXBwTm90UmVzcG9uZGluZ0xvY2tlZChQcm9jZXNzUmVjb3JkIGFwcCwKQEAgLTg1NzgsNiArODc4Nyw3IEBACiAgICAgICAgICAgICAgICAgcmVwb3J0LmNyYXNoSW5mby50aHJvd0ZpbGVOYW1lID0gdHJhY2UuZ2V0RmlsZU5hbWUoKTsKICAgICAgICAgICAgICAgICByZXBvcnQuY3Jhc2hJbmZvLnRocm93Q2xhc3NOYW1lID0gdHJhY2UuZ2V0Q2xhc3NOYW1lKCk7CiAgICAgICAgICAgICAgICAgcmVwb3J0LmNyYXNoSW5mby50aHJvd01ldGhvZE5hbWUgPSB0cmFjZS5nZXRNZXRob2ROYW1lKCk7CisgICAgICAgICAgICAgICAgcmVwb3J0LmNyYXNoSW5mby50aHJvd0xpbmVOdW1iZXIgPSB0cmFjZS5nZXRMaW5lTnVtYmVyKCk7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKHIubm90UmVzcG9uZGluZykgewogICAgICAgICAgICAgICAgIHJlcG9ydC50eXBlID0gQXBwbGljYXRpb25FcnJvclJlcG9ydC5UWVBFX0FOUjsKICAgICAgICAgICAgICAgICByZXBvcnQuYW5ySW5mbyA9IG5ldyBBcHBsaWNhdGlvbkVycm9yUmVwb3J0LkFuckluZm8oKTsKQEAgLTg2NDUsNiArODg1NSw3IEBACiAgICAgICAgICAgICAgICAgICAgIEFjdGl2aXR5TWFuYWdlci5SdW5uaW5nQXBwUHJvY2Vzc0luZm8gY3VyckFwcCA9IAogICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFjdGl2aXR5TWFuYWdlci5SdW5uaW5nQXBwUHJvY2Vzc0luZm8oYXBwLnByb2Nlc3NOYW1lLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHAucGlkLCBhcHAuZ2V0UGFja2FnZUxpc3QoKSk7CisgICAgICAgICAgICAgICAgICAgIGN1cnJBcHAudWlkID0gYXBwLmluZm8udWlkOwogICAgICAgICAgICAgICAgICAgICBpbnQgYWRqID0gYXBwLmN1ckFkajsKICAgICAgICAgICAgICAgICAgICAgaWYgKGFkaiA+PSBDT05URU5UX1BST1ZJREVSX0FESikgewogICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFwcC5pbXBvcnRhbmNlID0gQWN0aXZpdHlNYW5hZ2VyLlJ1bm5pbmdBcHBQcm9jZXNzSW5mby5JTVBPUlRBTkNFX0VNUFRZOwpAQCAtODY2MSw2ICs4ODcyLDE2IEBACiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyQXBwLmltcG9ydGFuY2UgPSBBY3Rpdml0eU1hbmFnZXIuUnVubmluZ0FwcFByb2Nlc3NJbmZvLklNUE9SVEFOQ0VfRk9SRUdST1VORDsKICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjdXJyQXBwLmltcG9ydGFuY2VSZWFzb25Db2RlID0gYXBwLmFkalR5cGVDb2RlOworICAgICAgICAgICAgICAgICAgICBpZiAoYXBwLmFkalNvdXJjZSBpbnN0YW5jZW9mIFByb2Nlc3NSZWNvcmQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcHAuaW1wb3J0YW5jZVJlYXNvblBpZCA9ICgoUHJvY2Vzc1JlY29yZClhcHAuYWRqU291cmNlKS5waWQ7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYXBwLmFkalNvdXJjZSBpbnN0YW5jZW9mIEhpc3RvcnlSZWNvcmQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEhpc3RvcnlSZWNvcmQgciA9IChIaXN0b3J5UmVjb3JkKWFwcC5hZGpTb3VyY2U7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoci5hcHAgIT0gbnVsbCkgY3VyckFwcC5pbXBvcnRhbmNlUmVhc29uUGlkID0gci5hcHAucGlkOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChhcHAuYWRqVGFyZ2V0IGluc3RhbmNlb2YgQ29tcG9uZW50TmFtZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFwcC5pbXBvcnRhbmNlUmVhc29uQ29tcG9uZW50ID0gKENvbXBvbmVudE5hbWUpYXBwLmFkalRhcmdldDsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAvL0xvZy52KFRBRywgIlByb2MgIiArIGFwcC5wcm9jZXNzTmFtZSArICI6IGltcD0iICsgY3VyckFwcC5pbXBvcnRhbmNlCiAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICArICIgbHJ1PSIgKyBjdXJyQXBwLmxydSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChydW5MaXN0ID09IG51bGwpIHsKQEAgLTkzODQsNyArOTYwNSw5IEBACiAgICAgICAgICAgICAgICAgc3IuYXBwID0gbnVsbDsKICAgICAgICAgICAgICAgICBzci5leGVjdXRlTmVzdGluZyA9IDA7CiAgICAgICAgICAgICAgICAgbVN0b3BwaW5nU2VydmljZXMucmVtb3ZlKHNyKTsKLSAgICAgICAgICAgICAgICBpZiAoc3IuYmluZGluZ3Muc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFzQ2xpZW50cyA9IHNyLmJpbmRpbmdzLnNpemUoKSA+IDA7CisgICAgICAgICAgICAgICAgaWYgKGhhc0NsaWVudHMpIHsKICAgICAgICAgICAgICAgICAgICAgSXRlcmF0b3I8SW50ZW50QmluZFJlY29yZD4gYmluZGluZ3MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IHNyLmJpbmRpbmdzLnZhbHVlcygpLml0ZXJhdG9yKCk7CiAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChiaW5kaW5ncy5oYXNOZXh0KCkpIHsKQEAgLTk0MDUsNyArOTYyOCwyMCBAQAogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWFsbG93UmVzdGFydCkgewogICAgICAgICAgICAgICAgICAgICBicmluZ0Rvd25TZXJ2aWNlTG9ja2VkKHNyLCB0cnVlKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBzY2hlZHVsZVNlcnZpY2VSZXN0YXJ0TG9ja2VkKHNyKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBjYW5jZWxlZCA9IHNjaGVkdWxlU2VydmljZVJlc3RhcnRMb2NrZWQoc3IsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgLy8gU2hvdWxkIHRoZSBzZXJ2aWNlIHJlbWFpbiBydW5uaW5nPyAgTm90ZSB0aGF0IGluIHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBleHRyZW1lIGNhc2Ugb2Ygc28gbWFueSBhdHRlbXB0cyB0byBkZWxpdmVyIGEgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAvLyB0aGF0IGl0IGZhaWxlZCwgdGhhdCB3ZSBhbHNvIHdpbGwgc3RvcCBpdCBoZXJlLgorICAgICAgICAgICAgICAgICAgICBpZiAoc3Iuc3RhcnRSZXF1ZXN0ZWQgJiYgKHNyLnN0b3BJZktpbGxlZCB8fCBjYW5jZWxlZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzci5wZW5kaW5nU3RhcnRzLnNpemUoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Iuc3RhcnRSZXF1ZXN0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWhhc0NsaWVudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2hvb3BzLCBubyByZWFzb24gdG8gcmVzdGFydCEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJpbmdEb3duU2VydmljZUxvY2tlZChzciwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCkBAIC05NjQ4LDYgKzk4ODQsNyBAQAogICAgICAgICBpZiAoci5hcHAgIT0gbnVsbCkgewogICAgICAgICAgICAgaW5mby5waWQgPSByLmFwcC5waWQ7CiAgICAgICAgIH0KKyAgICAgICAgaW5mby51aWQgPSByLmFwcEluZm8udWlkOwogICAgICAgICBpbmZvLnByb2Nlc3MgPSByLnByb2Nlc3NOYW1lOwogICAgICAgICBpbmZvLmZvcmVncm91bmQgPSByLmlzRm9yZWdyb3VuZDsKICAgICAgICAgaW5mby5hY3RpdmVTaW5jZSA9IHIuY3JlYXRlVGltZTsKQEAgLTk2NTUsNiArOTg5MiwyNSBAQAogICAgICAgICBpbmZvLmNsaWVudENvdW50ID0gci5jb25uZWN0aW9ucy5zaXplKCk7CiAgICAgICAgIGluZm8uY3Jhc2hDb3VudCA9IHIuY3Jhc2hDb3VudDsKICAgICAgICAgaW5mby5sYXN0QWN0aXZpdHlUaW1lID0gci5sYXN0QWN0aXZpdHk7CisgICAgICAgIGlmIChyLmlzRm9yZWdyb3VuZCkgeworICAgICAgICAgICAgaW5mby5mbGFncyB8PSBBY3Rpdml0eU1hbmFnZXIuUnVubmluZ1NlcnZpY2VJbmZvLkZMQUdfRk9SRUdST1VORDsKKyAgICAgICAgfQorICAgICAgICBpZiAoci5zdGFydFJlcXVlc3RlZCkgeworICAgICAgICAgICAgaW5mby5mbGFncyB8PSBBY3Rpdml0eU1hbmFnZXIuUnVubmluZ1NlcnZpY2VJbmZvLkZMQUdfU1RBUlRFRDsKKyAgICAgICAgfQorICAgICAgICBpZiAoci5hcHAgIT0gbnVsbCAmJiByLmFwcC5waWQgPT0gUHJvY2Vzcy5teVBpZCgpKSB7CisgICAgICAgICAgICBpbmZvLmZsYWdzIHw9IEFjdGl2aXR5TWFuYWdlci5SdW5uaW5nU2VydmljZUluZm8uRkxBR19TWVNURU1fUFJPQ0VTUzsKKyAgICAgICAgfQorICAgICAgICBpZiAoci5hcHAgIT0gbnVsbCAmJiByLmFwcC5wZXJzaXN0ZW50KSB7CisgICAgICAgICAgICBpbmZvLmZsYWdzIHw9IEFjdGl2aXR5TWFuYWdlci5SdW5uaW5nU2VydmljZUluZm8uRkxBR19QRVJTSVNURU5UX1BST0NFU1M7CisgICAgICAgIH0KKyAgICAgICAgZm9yIChDb25uZWN0aW9uUmVjb3JkIGNvbm4gOiByLmNvbm5lY3Rpb25zLnZhbHVlcygpKSB7CisgICAgICAgICAgICBpZiAoY29ubi5jbGllbnRMYWJlbCAhPSAwKSB7CisgICAgICAgICAgICAgICAgaW5mby5jbGllbnRQYWNrYWdlID0gY29ubi5iaW5kaW5nLmNsaWVudC5pbmZvLnBhY2thZ2VOYW1lOworICAgICAgICAgICAgICAgIGluZm8uY2xpZW50TGFiZWwgPSBjb25uLmNsaWVudExhYmVsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgICAgIHJldHVybiBpbmZvOwogICAgIH0KICAgICAKQEAgLTk2ODMsNiArOTkzOSwyMCBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgcHVibGljIFBlbmRpbmdJbnRlbnQgZ2V0UnVubmluZ1NlcnZpY2VDb250cm9sUGFuZWwoQ29tcG9uZW50TmFtZSBuYW1lKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgU2VydmljZVJlY29yZCByID0gbVNlcnZpY2VzLmdldChuYW1lKTsKKyAgICAgICAgICAgIGlmIChyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKENvbm5lY3Rpb25SZWNvcmQgY29ubiA6IHIuY29ubmVjdGlvbnMudmFsdWVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm4uY2xpZW50SW50ZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25uLmNsaWVudEludGVudDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisgICAgCiAgICAgcHJpdmF0ZSBmaW5hbCBTZXJ2aWNlUmVjb3JkIGZpbmRTZXJ2aWNlTG9ja2VkKENvbXBvbmVudE5hbWUgbmFtZSwKICAgICAgICAgICAgIElCaW5kZXIgdG9rZW4pIHsKICAgICAgICAgU2VydmljZVJlY29yZCByID0gbVNlcnZpY2VzLmdldChuYW1lKTsKQEAgLTk4NDQsMzUgKzEwMTE0LDU1IEBACiAKICAgICBwcml2YXRlIGZpbmFsIHZvaWQgc2VuZFNlcnZpY2VBcmdzTG9ja2VkKFNlcnZpY2VSZWNvcmQgciwKICAgICAgICAgICAgIGJvb2xlYW4gb29tQWRqdXN0ZWQpIHsKLSAgICAgICAgZmluYWwgaW50IE4gPSByLnN0YXJ0QXJncy5zaXplKCk7CisgICAgICAgIGZpbmFsIGludCBOID0gci5wZW5kaW5nU3RhcnRzLnNpemUoKTsKICAgICAgICAgaWYgKE4gPT0gMCkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKLSAgICAgICAgZmluYWwgaW50IEJBU0VJRCA9IHIubGFzdFN0YXJ0SWQgLSBOICsgMTsKICAgICAgICAgaW50IGkgPSAwOwogICAgICAgICB3aGlsZSAoaSA8IE4pIHsKICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgSW50ZW50IGFyZ3MgPSByLnN0YXJ0QXJncy5nZXQoaSk7CisgICAgICAgICAgICAgICAgU2VydmljZVJlY29yZC5TdGFydEl0ZW0gc2kgPSByLnBlbmRpbmdTdGFydHMuZ2V0KGkpOwogICAgICAgICAgICAgICAgIGlmIChERUJVR19TRVJWSUNFKSBMb2cudihUQUcsICJTZW5kaW5nIGFyZ3VtZW50cyB0byBzZXJ2aWNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIHIubmFtZSArICIgIiArIHIuaW50ZW50ICsgIiBhcmdzPSIgKyBhcmdzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICsgci5uYW1lICsgIiAiICsgci5pbnRlbnQgKyAiIGFyZ3M9IiArIHNpLmludGVudCk7CisgICAgICAgICAgICAgICAgaWYgKHNpLmludGVudCA9PSBudWxsICYmIE4gPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIElmIHNvbWVob3cgd2UgZ290IGEgZHVtbXkgc3RhcnQgYXQgdGhlIGZyb250LCB0aGVuCisgICAgICAgICAgICAgICAgICAgIC8vIGp1c3QgZHJvcCBpdCBoZXJlLgorICAgICAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBidW1wU2VydmljZUV4ZWN1dGluZ0xvY2tlZChyKTsKICAgICAgICAgICAgICAgICBpZiAoIW9vbUFkanVzdGVkKSB7CiAgICAgICAgICAgICAgICAgICAgIG9vbUFkanVzdGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgdXBkYXRlT29tQWRqTG9ja2VkKHIuYXBwKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgci5hcHAudGhyZWFkLnNjaGVkdWxlU2VydmljZUFyZ3MociwgQkFTRUlEK2ksIGFyZ3MpOworICAgICAgICAgICAgICAgIGludCBmbGFncyA9IDA7CisgICAgICAgICAgICAgICAgaWYgKHNpLmRlbGl2ZXJ5Q291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGZsYWdzIHw9IFNlcnZpY2UuU1RBUlRfRkxBR19SRVRSWTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHNpLmRvbmVFeGVjdXRpbmdDb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZmxhZ3MgfD0gU2VydmljZS5TVEFSVF9GTEFHX1JFREVMSVZFUlk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHIuYXBwLnRocmVhZC5zY2hlZHVsZVNlcnZpY2VBcmdzKHIsIHNpLmlkLCBmbGFncywgc2kuaW50ZW50KTsKKyAgICAgICAgICAgICAgICBzaS5kZWxpdmVyZWRUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgci5kZWxpdmVyZWRTdGFydHMuYWRkKHNpKTsKKyAgICAgICAgICAgICAgICBzaS5kZWxpdmVyeUNvdW50Kys7CiAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvLyBSZW1vdGUgcHJvY2VzcyBnb25lLi4uICB3ZSdsbCBsZXQgdGhlIG5vcm1hbCBjbGVhbnVwIHRha2UKKyAgICAgICAgICAgICAgICAvLyBjYXJlIG9mIHRoaXMuCisgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlVuZXhwZWN0ZWQgZXhjZXB0aW9uIiwgZSk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgaWYgKGkgPT0gTikgewotICAgICAgICAgICAgci5zdGFydEFyZ3MuY2xlYXIoKTsKKyAgICAgICAgICAgIHIucGVuZGluZ1N0YXJ0cy5jbGVhcigpOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgd2hpbGUgKGkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgci5zdGFydEFyZ3MucmVtb3ZlKDApOwogICAgICAgICAgICAgICAgIGktLTsKKyAgICAgICAgICAgICAgICByLnBlbmRpbmdTdGFydHMucmVtb3ZlKGkpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtOTkzNiwzNiArMTAyMjYsODEgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGVuc3VyZVBhY2thZ2VEZXhPcHQoci5zZXJ2aWNlSW5mby5wYWNrYWdlTmFtZSk7CiAgICAgICAgICAgICBhcHAudGhyZWFkLnNjaGVkdWxlQ3JlYXRlU2VydmljZShyLCByLnNlcnZpY2VJbmZvKTsKKyAgICAgICAgICAgIHIucG9zdE5vdGlmaWNhdGlvbigpOwogICAgICAgICAgICAgY3JlYXRlZCA9IHRydWU7CiAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICBpZiAoIWNyZWF0ZWQpIHsKICAgICAgICAgICAgICAgICBhcHAuc2VydmljZXMucmVtb3ZlKHIpOwotICAgICAgICAgICAgICAgIHNjaGVkdWxlU2VydmljZVJlc3RhcnRMb2NrZWQocik7CisgICAgICAgICAgICAgICAgc2NoZWR1bGVTZXJ2aWNlUmVzdGFydExvY2tlZChyLCBmYWxzZSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICByZXF1ZXN0U2VydmljZUJpbmRpbmdzTG9ja2VkKHIpOworICAgICAgICAKKyAgICA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UNFX1JFU1RBUlRfRFVSQVRJT047CisgICAgICAgIGxvbmcgcmVzZXRUaW1lID0gU0VSVklDRV9SRVNFVF9SVU5fRFVSQVRJT047CisgICAgICAgIAorICAgICAgICAvLyBBbnkgZGVsaXZlcmVkIGJ1dCBub3QgeWV0IGZpbmlzaGVkIHN0YXJ0cyBzaG91bGQgYmUgcHV0IGJhY2sKKyAgICAgICAgLy8gb24gdGhlIHBlbmRpbmcgbGlzdC4KKyAgICAgICAgZmluYWwgaW50IE4gPSByLmRlbGl2ZXJlZFN0YXJ0cy5zaXplKCk7CisgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT1OLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgIFNlcnZpY2VSZWNvcmQuU3RhcnRJdGVtIHNpID0gci5kZWxpdmVyZWRTdGFydHMuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChzaS5pbnRlbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAvLyBXZSdsbCBnZW5lcmF0ZSB0aGlzIGFnYWluIGlmIG5lZWRlZC4KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFhbGxvd0NhbmNlbCB8fCAoc2kuZGVsaXZlcnlDb3VudCA8IFNlcnZpY2VSZWNvcmQuTUFYX0RFTElWRVJZX0NPVU5UCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBzaS5kb25lRXhlY3V0aW5nQ291bnQgPCBTZXJ2aWNlUmVjb3JkLk1BWF9ET05FX0VYRUNVVElOR19DT1VOVCkpIHsKKyAgICAgICAgICAgICAgICAgICAgci5wZW5kaW5nU3RhcnRzLmFkZCgwLCBzaSk7CisgICAgICAgICAgICAgICAgICAgIGxvbmcgZHVyID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkgLSBzaS5kZWxpdmVyZWRUaW1lOworICAgICAgICAgICAgICAgICAgICBkdXIgKj0gMjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1pbkR1cmF0aW9uIDwgZHVyKSBtaW5EdXJhdGlvbiA9IGR1cjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlc2V0VGltZSA8IGR1cikgcmVzZXRUaW1lID0gZHVyOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNhbmNlbGluZyBzdGFydCBpdGVtICIgKyBzaS5pbnRlbnQgKyAiIGluIHNlcnZpY2UgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgci5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgY2FuY2VsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHIuZGVsaXZlcmVkU3RhcnRzLmNsZWFyKCk7CisgICAgICAgIH0KICAgICAgICAgCiAgICAgICAgIHIudG90YWxSZXN0YXJ0Q291bnQrKzsKICAgICAgICAgaWYgKHIucmVzdGFydERlbGF5ID09IDApIHsKICAgICAgICAgICAgIHIucmVzdGFydENvdW50Kys7Ci0gICAgICAgICAgICByLnJlc3RhcnREZWxheSA9IFNFUlZJQ0VfUkVTVEFSVF9EVVJBVElPTjsKKyAgICAgICAgICAgIHIucmVzdGFydERlbGF5ID0gbWluRHVyYXRpb247CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBJZiBpdCBoYXMgYmVlbiBhICJyZWFzb25hYmx5IGxvbmcgdGltZSIgc2luY2UgdGhlIHNlcnZpY2UKICAgICAgICAgICAgIC8vIHdhcyBzdGFydGVkLCB0aGVuIHJlc2V0IG91ciByZXN0YXJ0IGR1cmF0aW9uIGJhY2sgdG8KICAgICAgICAgICAgIC8vIHRoZSBiZWdpbm5pbmcsIHNvIHdlIGRvbid0IGluZmluaXRlbHkgaW5jcmVhc2UgdGhlIGR1cmF0aW9uCiAgICAgICAgICAgICAvLyBvbiBhIHNlcnZpY2UgdGhhdCBqdXN0IG9jY2FzaW9uYWxseSBnZXRzIGtpbGxlZCAod2hpY2ggaXMKICAgICAgICAgICAgIC8vIGEgbm9ybWFsIGNhc2UsIGR1ZSB0byBwcm9jZXNzIGJlaW5nIGtpbGxlZCB0byByZWNsYWltIG1lbW9yeSkuCi0gICAgICAgICAgICBpZiAobm93ID4gKHIucmVzdGFydFRpbWUrU0VSVklDRV9SRVNFVF9SVU5fRFVSQVRJT04pKSB7CisgICAgICAgICAgICBpZiAobm93ID4gKHIucmVzdGFydFRpbWUrcmVzZXRUaW1lKSkgewogICAgICAgICAgICAgICAgIHIucmVzdGFydENvdW50ID0gMTsKLSAgICAgICAgICAgICAgICByLnJlc3RhcnREZWxheSA9IFNFUlZJQ0VfUkVTVEFSVF9EVVJBVElPTjsKKyAgICAgICAgICAgICAgICByLnJlc3RhcnREZWxheSA9IG1pbkR1cmF0aW9uOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICByLnJlc3RhcnREZWxheSAqPSBTRVJWSUNFX1JFU1RBUlRfRFVSQVRJT05fRkFDVE9SOworICAgICAgICAgICAgICAgIGlmIChyLnJlc3RhcnREZWxheSA8IG1pbkR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgIHIucmVzdGFydERlbGF5ID0gbWluRHVyYXRpb247CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIApAQCAtOTk5NCw2ICsxMDMyOSw4IEBACiAgICAgICAgICAgICBtUmVzdGFydGluZ1NlcnZpY2VzLmFkZChyKTsKICAgICAgICAgfQogICAgICAgICAKKyAgICAgICAgci5jYW5jZWxOb3RpZmljYXRpb24oKTsKKyAgICAgICAgCiAgICAgICAgIG1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhyLnJlc3RhcnRlcik7CiAgICAgICAgIG1IYW5kbGVyLnBvc3RBdFRpbWUoci5yZXN0YXJ0ZXIsIHIubmV4dFJlc3RhcnRUaW1lKTsKICAgICAgICAgci5uZXh0UmVzdGFydFRpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSArIHIucmVzdGFydERlbGF5OwpAQCAtMTAwMDYsNiArMTAzNDMsOCBAQAogICAgICAgICBtc2cud2hhdCA9IFNFUlZJQ0VfRVJST1JfTVNHOwogICAgICAgICBtc2cub2JqID0gcjsKICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2UobXNnKTsKKyAgICAgICAgCisgICAgICAgIHJldHVybiBjYW5jZWxlZDsKICAgICB9CiAKICAgICBmaW5hbCB2b2lkIHBlcmZvcm1TZXJ2aWNlUmVzdGFydExvY2tlZChTZXJ2aWNlUmVjb3JkIHIpIHsKQEAgLTEwMDY1LDcgKzEwNDA0LDcgQEAKICAgICAgICAgICAgIC8vIE5vdCBydW5uaW5nIC0tIGdldCBpdCBzdGFydGVkLCBhbmQgZW5xdWV1ZSB0aGlzIHNlcnZpY2UgcmVjb3JkCiAgICAgICAgICAgICAvLyB0byBiZSBleGVjdXRlZCB3aGVuIHRoZSBhcHAgY29tZXMgdXAuCiAgICAgICAgICAgICBpZiAoc3RhcnRQcm9jZXNzTG9ja2VkKGFwcE5hbWUsIHIuYXBwSW5mbywgdHJ1ZSwgaW50ZW50RmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICJzZXJ2aWNlIiwgci5uYW1lKSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICJzZXJ2aWNlIiwgci5uYW1lLCBmYWxzZSkgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlVuYWJsZSB0byBsYXVuY2ggYXBwICIKICAgICAgICAgICAgICAgICAgICAgICAgICsgci5hcHBJbmZvLnBhY2thZ2VOYW1lICsgIi8iCiAgICAgICAgICAgICAgICAgICAgICAgICArIHIuYXBwSW5mby51aWQgKyAiIGZvciBzZXJ2aWNlICIKQEAgLTEwMTYyLDE1ICsxMDUwMSwyNCBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAKKyAgICAgICAgci5jYW5jZWxOb3RpZmljYXRpb24oKTsKKyAgICAgICAgci5pc0ZvcmVncm91bmQgPSBmYWxzZTsKKyAgICAgICAgci5mb3JlZ3JvdW5kSWQgPSAwOworICAgICAgICByLmZvcmVncm91bmROb3RpID0gbnVsbDsKKyAgICAgICAgCisgICAgICAgIC8vIENsZWFyIHN0YXJ0IGVudHJpZXMuCisgICAgICAgIHIuZGVsaXZlcmVkU3RhcnRzLmNsZWFyKCk7CisgICAgICAgIHIucGVuZGluZ1N0YXJ0cy5jbGVhcigpOworICAgICAgICAKICAgICAgICAgaWYgKHIuYXBwICE9IG51bGwpIHsKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoci5zdGF0cy5nZXRCYXR0ZXJ5U3RhdHMoKSkgewogICAgICAgICAgICAgICAgIHIuc3RhdHMuc3RvcExhdW5jaGVkTG9ja2VkKCk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByLmFwcC5zZXJ2aWNlcy5yZW1vdmUocik7CiAgICAgICAgICAgICBpZiAoci5hcHAudGhyZWFkICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB1cGRhdGVTZXJ2aWNlRm9yZWdyb3VuZExvY2tlZChyLmFwcCwgZmFsc2UpOwogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlN0b3BwaW5nIHNlcnZpY2U6ICIgKyByLnNob3J0TmFtZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19TRVJWSUNFKSBMb2cudihUQUcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlN0b3BwaW5nIHNlcnZpY2U6ICIgKyByLnNob3J0TmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIGJ1bXBTZXJ2aWNlRXhlY3V0aW5nTG9ja2VkKHIpOwogICAgICAgICAgICAgICAgICAgICBtU3RvcHBpbmdTZXJ2aWNlcy5hZGQocik7CiAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZU9vbUFkakxvY2tlZChyLmFwcCk7CkBAIC0xMDE4MCw2ICsxMDUyOCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyByLnNob3J0TmFtZSwgZSk7CiAgICAgICAgICAgICAgICAgICAgIHNlcnZpY2VEb25lRXhlY3V0aW5nTG9ja2VkKHIsIHRydWUpOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB1cGRhdGVTZXJ2aWNlRm9yZWdyb3VuZExvY2tlZChyLmFwcCwgZmFsc2UpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBpZiAoREVCVUdfU0VSVklDRSkgTG9nLnYoCiAgICAgICAgICAgICAgICAgICAgIFRBRywgIlJlbW92ZWQgc2VydmljZSB0aGF0IGhhcyBubyBwcm9jZXNzOiAiICsgci5zaG9ydE5hbWUpOwpAQCAtMTAyMjMsMTEgKzEwNTcyLDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICArIHIuc2hvcnROYW1lKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHIuc3RhcnRSZXF1ZXN0ZWQgPSB0cnVlOwotICAgICAgICAgICAgci5zdGFydEFyZ3MuYWRkKHNlcnZpY2UpOworICAgICAgICAgICAgci5jYWxsU3RhcnQgPSBmYWxzZTsKICAgICAgICAgICAgIHIubGFzdFN0YXJ0SWQrKzsKICAgICAgICAgICAgIGlmIChyLmxhc3RTdGFydElkIDwgMSkgewogICAgICAgICAgICAgICAgIHIubGFzdFN0YXJ0SWQgPSAxOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgci5wZW5kaW5nU3RhcnRzLmFkZChuZXcgU2VydmljZVJlY29yZC5TdGFydEl0ZW0oci5sYXN0U3RhcnRJZCwgc2VydmljZSkpOwogICAgICAgICAgICAgci5sYXN0QWN0aXZpdHkgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoci5zdGF0cy5nZXRCYXR0ZXJ5U3RhdHMoKSkgewogICAgICAgICAgICAgICAgIHIuc3RhdHMuc3RhcnRSdW5uaW5nTG9ja2VkKCk7CkBAIC0xMDI5NSw2ICsxMDY0NSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICByLnJlY29yZC5zdGF0cy5zdG9wUnVubmluZ0xvY2tlZCgpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHIucmVjb3JkLnN0YXJ0UmVxdWVzdGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHIucmVjb3JkLmNhbGxTdGFydCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIG9yaWdJZCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICAgICAgICAgICAgICBicmluZ0Rvd25TZXJ2aWNlTG9ja2VkKHIucmVjb3JkLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KG9yaWdJZCk7CkBAIC0xMDM0MywxMCArMTA2OTQsMzUgQEAKICAgICAgICAgICAgIGlmIChERUJVR19TRVJWSUNFKSBMb2cudihUQUcsICJzdG9wU2VydmljZVRva2VuOiAiICsgY2xhc3NOYW1lCiAgICAgICAgICAgICAgICAgICAgICsgIiAiICsgdG9rZW4gKyAiIHN0YXJ0SWQ9IiArIHN0YXJ0SWQpOwogICAgICAgICAgICAgU2VydmljZVJlY29yZCByID0gZmluZFNlcnZpY2VMb2NrZWQoY2xhc3NOYW1lLCB0b2tlbik7Ci0gICAgICAgICAgICBpZiAociAhPSBudWxsICYmIChzdGFydElkIDwgMCB8fCByLmxhc3RTdGFydElkID09IHN0YXJ0SWQpKSB7CisgICAgICAgICAgICBpZiAociAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKHN0YXJ0SWQgPj0gMCkgeworICAgICAgICAgICAgICAgICAgICAvLyBBc2tlZCB0byBvbmx5IHN0b3AgaWYgZG9uZSB3aXRoIGFsbCB3b3JrLiAgTm90ZSB0aGF0CisgICAgICAgICAgICAgICAgICAgIC8vIHRvIGF2b2lkIGxlYWtzLCB3ZSB3aWxsIHRha2UgdGhpcyBhcyBkcm9wcGluZyBhbGwKKyAgICAgICAgICAgICAgICAgICAgLy8gc3RhcnQgaXRlbXMgdXAgdG8gYW5kIGluY2x1ZGluZyB0aGlzIG9uZS4KKyAgICAgICAgICAgICAgICAgICAgU2VydmljZVJlY29yZC5TdGFydEl0ZW0gc2kgPSByLmZpbmREZWxpdmVyZWRTdGFydChzdGFydElkLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChzaSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoci5kZWxpdmVyZWRTdGFydHMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyLmRlbGl2ZXJlZFN0YXJ0cy5yZW1vdmUoMCkgPT0gc2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpZiAoci5sYXN0U3RhcnRJZCAhPSBzdGFydElkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIGlmIChyLmRlbGl2ZXJlZFN0YXJ0cy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJzdG9wU2VydmljZVRva2VuIHN0YXJ0SWQgIiArIHN0YXJ0SWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlzIGxhc3QsIGJ1dCBoYXZlICIgKyByLmRlbGl2ZXJlZFN0YXJ0cy5zaXplKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHJlbWFpbmluZyBhcmdzIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChyLnN0YXRzLmdldEJhdHRlcnlTdGF0cygpKSB7CiAgICAgICAgICAgICAgICAgICAgIHIuc3RhdHMuc3RvcFJ1bm5pbmdMb2NrZWQoKTsKICAgICAgICAgICAgICAgICAgICAgci5zdGFydFJlcXVlc3RlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICByLmNhbGxTdGFydCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIG9yaWdJZCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICAgICAgICAgIGJyaW5nRG93blNlcnZpY2VMb2NrZWQociwgZmFsc2UpOwpAQCAtMTAzNTgsMjAgKzEwNzM0LDQ1IEBACiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgc2V0U2VydmljZUZvcmVncm91bmQoQ29tcG9uZW50TmFtZSBjbGFzc05hbWUsIElCaW5kZXIgdG9rZW4sCi0gICAgICAgICAgICBib29sZWFuIGlzRm9yZWdyb3VuZCkgeworICAgICAgICAgICAgaW50IGlkLCBOb3RpZmljYXRpb24gbm90aWZpY2F0aW9uLCBib29sZWFuIHJlbW92ZU5vdGlmaWNhdGlvbikgeworICAgICAgICBmaW5hbCBsb25nIG9yaWdJZCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOworICAgICAgICB0cnkgewogICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgewogICAgICAgICAgICAgU2VydmljZVJlY29yZCByID0gZmluZFNlcnZpY2VMb2NrZWQoY2xhc3NOYW1lLCB0b2tlbik7CiAgICAgICAgICAgICBpZiAociAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHIuaXNGb3JlZ3JvdW5kICE9IGlzRm9yZWdyb3VuZCkgewotICAgICAgICAgICAgICAgICAgICBmaW5hbCBsb25nIG9yaWdJZCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwotICAgICAgICAgICAgICAgICAgICByLmlzRm9yZWdyb3VuZCA9IGlzRm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICBpZiAoaWQgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBpZiAobm90aWZpY2F0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIm51bGwgbm90aWZpY2F0aW9uIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHIuZm9yZWdyb3VuZElkICE9IGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByLmNhbmNlbE5vdGlmaWNhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgci5mb3JlZ3JvdW5kSWQgPSBpZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24uZmxhZ3MgfD0gTm90aWZpY2F0aW9uLkZMQUdfRk9SRUdST1VORF9TRVJWSUNFOworICAgICAgICAgICAgICAgICAgICByLmZvcmVncm91bmROb3RpID0gbm90aWZpY2F0aW9uOworICAgICAgICAgICAgICAgICAgICByLmlzRm9yZWdyb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHIucG9zdE5vdGlmaWNhdGlvbigpOwogICAgICAgICAgICAgICAgICAgICBpZiAoci5hcHAgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlU2VydmljZUZvcmVncm91bmRMb2NrZWQoci5hcHAsIHRydWUpOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KG9yaWdJZCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHIuaXNGb3JlZ3JvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByLmlzRm9yZWdyb3VuZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHIuYXBwICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVTZXJ2aWNlRm9yZWdyb3VuZExvY2tlZChyLmFwcCwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlbW92ZU5vdGlmaWNhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgci5jYW5jZWxOb3RpZmljYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHIuZm9yZWdyb3VuZElkID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHIuZm9yZWdyb3VuZE5vdGkgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShvcmlnSWQpOworICAgICAgICB9CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgdXBkYXRlU2VydmljZUZvcmVncm91bmRMb2NrZWQoUHJvY2Vzc1JlY29yZCBwcm9jLCBib29sZWFuIG9vbUFkaikgewpAQCAtMTA0MjAsNiArMTA4MjEsMjkgQEAKICAgICAgICAgICAgICAgICBhY3Rpdml0eSA9IChIaXN0b3J5UmVjb3JkKW1IaXN0b3J5LmdldChhaW5kZXgpOwogICAgICAgICAgICAgfQogCisgICAgICAgICAgICBpbnQgY2xpZW50TGFiZWwgPSAwOworICAgICAgICAgICAgUGVuZGluZ0ludGVudCBjbGllbnRJbnRlbnQgPSBudWxsOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoY2FsbGVyQXBwLmluZm8udWlkID09IFByb2Nlc3MuU1lTVEVNX1VJRCkgeworICAgICAgICAgICAgICAgIC8vIEhhY2t5IGtpbmQgb2YgdGhpbmcgLS0gYWxsb3cgc3lzdGVtIHN0dWZmIHRvIHRlbGwgdXMKKyAgICAgICAgICAgICAgICAvLyB3aGF0IHRoZXkgYXJlLCBzbyB3ZSBjYW4gcmVwb3J0IHRoaXMgZWxzZXdoZXJlIGZvcgorICAgICAgICAgICAgICAgIC8vIG90aGVycyB0byBrbm93IHdoeSBjZXJ0YWluIHNlcnZpY2VzIGFyZSBydW5uaW5nLgorICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGNsaWVudEludGVudCA9IChQZW5kaW5nSW50ZW50KXNlcnZpY2UuZ2V0UGFyY2VsYWJsZUV4dHJhKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludGVudC5FWFRSQV9DTElFTlRfSU5URU5UKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGNsaWVudEludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGNsaWVudExhYmVsID0gc2VydmljZS5nZXRJbnRFeHRyYShJbnRlbnQuRVhUUkFfQ0xJRU5UX0xBQkVMLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNsaWVudExhYmVsICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIGFyZSBubyB1c2VmdWwgZXh0cmFzIGluIHRoZSBpbnRlbnQsIHRyYXNoIHRoZW0uCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBTeXN0ZW0gY29kZSBjYWxsaW5nIHdpdGggdGhpcyBzdHVmZiBqdXN0IG5lZWRzIHRvIGtub3cKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgd2lsbCBoYXBwZW4uCisgICAgICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlID0gc2VydmljZS5jbG9uZUZpbHRlcigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgCiAgICAgICAgICAgICBTZXJ2aWNlTG9va3VwUmVzdWx0IHJlcyA9CiAgICAgICAgICAgICAgICAgcmV0cmlldmVTZXJ2aWNlTG9ja2VkKHNlcnZpY2UsIHJlc29sdmVkVHlwZSwKICAgICAgICAgICAgICAgICAgICAgICAgIEJpbmRlci5nZXRDYWxsaW5nUGlkKCksIEJpbmRlci5nZXRDYWxsaW5nVWlkKCkpOwpAQCAtMTA0NDAsNyArMTA4NjQsNyBAQAogCiAgICAgICAgICAgICBBcHBCaW5kUmVjb3JkIGIgPSBzLnJldHJpZXZlQXBwQmluZGluZ0xvY2tlZChzZXJ2aWNlLCBjYWxsZXJBcHApOwogICAgICAgICAgICAgQ29ubmVjdGlvblJlY29yZCBjID0gbmV3IENvbm5lY3Rpb25SZWNvcmQoYiwgYWN0aXZpdHksCi0gICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24sIGZsYWdzKTsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbiwgZmxhZ3MsIGNsaWVudExhYmVsLCBjbGllbnRJbnRlbnQpOwogCiAgICAgICAgICAgICBJQmluZGVyIGJpbmRlciA9IGNvbm5lY3Rpb24uYXNCaW5kZXIoKTsKICAgICAgICAgICAgIHMuY29ubmVjdGlvbnMucHV0KGJpbmRlciwgYyk7CkBAIC0xMDY2NSw3ICsxMTA4OSw3IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCBzZXJ2aWNlRG9uZUV4ZWN1dGluZyhJQmluZGVyIHRva2VuKSB7CisgICAgcHVibGljIHZvaWQgc2VydmljZURvbmVFeGVjdXRpbmcoSUJpbmRlciB0b2tlbiwgaW50IHR5cGUsIGludCBzdGFydElkLCBpbnQgcmVzKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CiAgICAgICAgICAgICBpZiAoISh0b2tlbiBpbnN0YW5jZW9mIFNlcnZpY2VSZWNvcmQpKSB7CiAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiSW52YWxpZCBzZXJ2aWNlIHRva2VuIik7CkBAIC0xMDY4Myw2ICsxMTEwNyw1MSBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogCisgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIGEgY2FsbCBmcm9tIGEgc2VydmljZSBzdGFydC4uLiAgdGFrZSBjYXJlIG9mCisgICAgICAgICAgICAgICAgICAgIC8vIGJvb2sta2VlcGluZy4KKyAgICAgICAgICAgICAgICAgICAgci5jYWxsU3RhcnQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHJlcykgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTZXJ2aWNlLlNUQVJUX1NUSUNLWV9DT01QQVRJQklMSVRZOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTZXJ2aWNlLlNUQVJUX1NUSUNLWTogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBkb25lIHdpdGggdGhlIGFzc29jaWF0ZWQgc3RhcnQgYXJndW1lbnRzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuZmluZERlbGl2ZXJlZFN0YXJ0KHN0YXJ0SWQsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHN0b3AgaWYga2lsbGVkLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuc3RvcElmS2lsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNlcnZpY2UuU1RBUlRfTk9UX1NUSUNLWTogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGFyZSBkb25lIHdpdGggdGhlIGFzc29jaWF0ZWQgc3RhcnQgYXJndW1lbnRzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuZmluZERlbGl2ZXJlZFN0YXJ0KHN0YXJ0SWQsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyLmxhc3RTdGFydElkID09IHN0YXJ0SWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUgaXMgbm8gbW9yZSB3b3JrLCBhbmQgdGhpcyBzZXJ2aWNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvZXNuJ3Qgd2FudCB0byBoYW5nIGFyb3VuZCBpZiBraWxsZWQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuc3RvcElmS2lsbGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFNlcnZpY2UuU1RBUlRfUkVERUxJVkVSX0lOVEVOVDogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlJ2xsIGtlZXAgdGhpcyBpdGVtIHVudGlsIHRoZXkgZXhwbGljaXRseQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGwgc3RvcCBmb3IgaXQsIGJ1dCBrZWVwIHRyYWNrIG9mIHRoZSBmYWN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhhdCBpdCB3YXMgZGVsaXZlcmVkLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlcnZpY2VSZWNvcmQuU3RhcnRJdGVtIHNpID0gci5maW5kRGVsaXZlcmVkU3RhcnQoc3RhcnRJZCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpLmRlbGl2ZXJ5Q291bnQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaS5kb25lRXhlY3V0aW5nQ291bnQrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3Qgc3RvcCBpZiBraWxsZWQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuc3RvcElmS2lsbGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5rbm93biBzZXJ2aWNlIHN0YXJ0IHJlc3VsdDogIiArIHJlcyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSBTZXJ2aWNlLlNUQVJUX1NUSUNLWV9DT01QQVRJQklMSVRZKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxTdGFydCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgb3JpZ0lkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgICAgICAgICAgc2VydmljZURvbmVFeGVjdXRpbmdMb2NrZWQociwgaW5TdG9wcGluZyk7CiAgICAgICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkob3JpZ0lkKTsKQEAgLTEwNzYxLDcgKzExMjMwLDcgQEAKICAgICAgICAgICAgIENvbXBvbmVudE5hbWUgaG9zdGluZ05hbWUgPSBuZXcgQ29tcG9uZW50TmFtZShhcHAucGFja2FnZU5hbWUsIGFwcC5iYWNrdXBBZ2VudE5hbWUpOwogICAgICAgICAgICAgLy8gc3RhcnRQcm9jZXNzTG9ja2VkKCkgcmV0dXJucyBleGlzdGluZyBwcm9jJ3MgcmVjb3JkIGlmIGl0J3MgYWxyZWFkeSBydW5uaW5nCiAgICAgICAgICAgICBQcm9jZXNzUmVjb3JkIHByb2MgPSBzdGFydFByb2Nlc3NMb2NrZWQoYXBwLnByb2Nlc3NOYW1lLCBhcHAsCi0gICAgICAgICAgICAgICAgICAgIGZhbHNlLCAwLCAiYmFja3VwIiwgaG9zdGluZ05hbWUpOworICAgICAgICAgICAgICAgICAgICBmYWxzZSwgMCwgImJhY2t1cCIsIGhvc3RpbmdOYW1lLCBmYWxzZSk7CiAgICAgICAgICAgICBpZiAocHJvYyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiVW5hYmxlIHRvIHN0YXJ0IGJhY2t1cCBhZ2VudCBwcm9jZXNzICIgKyByKTsKICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CkBAIC0xMTI5OCwxMCArMTE3NjcsMTEgQEAKICAgICAgICAgfQogCiAgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICBpbnQgZmxhZ3MgPSBpbnRlbnQuZ2V0RmxhZ3MoKTsKKyAgICAgICAgICAgIAogICAgICAgICAgICAgaWYgKCFtU3lzdGVtUmVhZHkpIHsKICAgICAgICAgICAgICAgICAvLyBpZiB0aGUgY2FsbGVyIHJlYWxseSB0cnVseSBjbGFpbXMgdG8ga25vdyB3aGF0IHRoZXkncmUgZG9pbmcsIGdvCiAgICAgICAgICAgICAgICAgLy8gYWhlYWQgYW5kIGFsbG93IHRoZSBicm9hZGNhc3Qgd2l0aG91dCBsYXVuY2hpbmcgYW55IHJlY2VpdmVycwotICAgICAgICAgICAgICAgIGludCBmbGFncyA9IGludGVudC5nZXRGbGFncygpOwogICAgICAgICAgICAgICAgIGlmICgoZmxhZ3MmSW50ZW50LkZMQUdfUkVDRUlWRVJfUkVHSVNURVJFRF9PTkxZX0JFRk9SRV9CT09UKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIGludGVudCA9IG5ldyBJbnRlbnQoaW50ZW50KTsKICAgICAgICAgICAgICAgICAgICAgaW50ZW50LmFkZEZsYWdzKEludGVudC5GTEFHX1JFQ0VJVkVSX1JFR0lTVEVSRURfT05MWSk7CkBAIC0xMTMxMiw2ICsxMTc4MiwxMSBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKChmbGFncyZJbnRlbnQuRkxBR19SRUNFSVZFUl9CT09UX1VQR1JBREUpICE9IDApIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIkNhbid0IHVzZSBGTEFHX1JFQ0VJVkVSX0JPT1RfVVBHUkFERSBoZXJlIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKICAgICAgICAgICAgIGZpbmFsIFByb2Nlc3NSZWNvcmQgY2FsbGVyQXBwID0gZ2V0UmVjb3JkRm9yQXBwTG9ja2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AgICAgICAgICAgICAgICAgID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAvLyBBaCwgdGhpcyByZWNpcGllbnQgaXMgdW5hdmFpbGFibGUuICBGaW5pc2ggaXQgaWYgbmVjZXNzYXJ5LAogICAgICAgICAgICAgICAgIC8vIGFuZCBtYXJrIHRoZSBicm9hZGNhc3QgcmVjb3JkIGFzIHJlYWR5IGZvciB0aGUgbmV4dC4KICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmFibGUgdG8gbGF1bmNoIGFwcCAiCkBAIC0xMjEzMiw2ICsxMjYwOCw3IEBACiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgbUNvbmZpZ3VyYXRpb24gPSBuZXdDb25maWc7CisgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiQ29uZmlnIGNoYW5nZWQ6ICIgKyBuZXdDb25maWcpOwogCiAgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtSGFuZGxlci5vYnRhaW5NZXNzYWdlKFVQREFURV9DT05GSUdVUkFUSU9OX01TRyk7CiAgICAgICAgICAgICAgICAgbXNnLm9iaiA9IG5ldyBDb25maWd1cmF0aW9uKG1Db25maWd1cmF0aW9uKTsKQEAgLTEyMzYwLDYgKzEyODM3LDcgQEAKICAgICAgICAgICAgIHJldHVybiAoYXBwLmN1ckFkaj1hcHAubWF4QWRqKTsKICAgICAgICB9CiAgICAgICAgIAorICAgICAgICBhcHAuYWRqVHlwZUNvZGUgPSBBY3Rpdml0eU1hbmFnZXIuUnVubmluZ0FwcFByb2Nlc3NJbmZvLlJFQVNPTl9VTktOT1dOOwogICAgICAgICBhcHAuYWRqU291cmNlID0gbnVsbDsKICAgICAgICAgYXBwLmFkalRhcmdldCA9IG51bGw7CiAKQEAgLTEyNDkzLDYgKzEyOTcxLDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRqID0gY2xpZW50QWRqID4gVklTSUJMRV9BUFBfQURKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjbGllbnRBZGogOiBWSVNJQkxFX0FQUF9BREo7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcC5hZGpUeXBlID0gInNlcnZpY2UiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHAuYWRqVHlwZUNvZGUgPSBBY3Rpdml0eU1hbmFnZXIuUnVubmluZ0FwcFByb2Nlc3NJbmZvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLlJFQVNPTl9TRVJWSUNFX0lOX1VTRTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwLmFkalNvdXJjZSA9IGNyLmJpbmRpbmcuY2xpZW50OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHAuYWRqVGFyZ2V0ID0gcy5zZXJ2aWNlSW5mby5uYW1lOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTEyNTA2LDYgKzEyOTg2LDggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGEuc3RhdGUgPT0gQWN0aXZpdHlTdGF0ZS5QQVVTSU5HKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkaiA9IEZPUkVHUk9VTkRfQVBQX0FESjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHAuYWRqVHlwZSA9ICJzZXJ2aWNlIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHAuYWRqVHlwZUNvZGUgPSBBY3Rpdml0eU1hbmFnZXIuUnVubmluZ0FwcFByb2Nlc3NJbmZvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuUkVBU09OX1NFUlZJQ0VfSU5fVVNFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcC5hZGpTb3VyY2UgPSBhOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcC5hZGpUYXJnZXQgPSBzLnNlcnZpY2VJbmZvLm5hbWU7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CkBAIC0xMjU0OCw2ICsxMzAzMCw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRqID0gY2xpZW50QWRqID4gRk9SRUdST1VORF9BUFBfQURKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGNsaWVudEFkaiA6IEZPUkVHUk9VTkRfQVBQX0FESjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHAuYWRqVHlwZSA9ICJwcm92aWRlciI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwLmFkalR5cGVDb2RlID0gQWN0aXZpdHlNYW5hZ2VyLlJ1bm5pbmdBcHBQcm9jZXNzSW5mbworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLlJFQVNPTl9QUk9WSURFUl9JTl9VU0U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwLmFkalNvdXJjZSA9IGNsaWVudDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHAuYWRqVGFyZ2V0ID0gY3ByLmluZm8ubmFtZTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL0JhdHRlcnlTdGF0c1NlcnZpY2UuamF2YSBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL0JhdHRlcnlTdGF0c1NlcnZpY2UuamF2YQppbmRleCBjODM0YjM0Li5lZDBkNTM0IDEwMDY0NAotLS0gYS9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9hbS9CYXR0ZXJ5U3RhdHNTZXJ2aWNlLmphdmEKKysrIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvYW0vQmF0dGVyeVN0YXRzU2VydmljZS5qYXZhCkBAIC0yNj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OyAgLy8gVGhlIGNsaWVudCBjb25uZWN0aW9uLgogICAgIGZpbmFsIGludCBmbGFnczsgICAgICAgICAgICAgICAgLy8gQmluZGluZyBvcHRpb25zLgorICAgIGZpbmFsIGludCBjbGllbnRMYWJlbDsgICAgICAgICAgLy8gU3RyaW5nIHJlc291cmNlIGxhYmVsaW5nIHRoaXMgY2xpZW50LgorICAgIGZpbmFsIFBlbmRpbmdJbnRlbnQgY2xpZW50SW50ZW50OyAvLyBIb3cgdG8gbGF1bmNoIHRoZSBjbGllbnQuCiAgICAgU3RyaW5nIHN0cmluZ05hbWU7ICAgICAgICAgICAgICAvLyBDYWNoaW5nIG9mIHRvU3RyaW5nLgogICAgIAogICAgIHZvaWQgZHVtcChQcmludFdyaXRlciBwdywgU3RyaW5nIHByZWZpeCkgewpAQCAtNDAsMTEgKzQzLDE0IEBACiAgICAgfQogICAgIAogICAgIENvbm5lY3Rpb25SZWNvcmQoQXBwQmluZFJlY29yZCBfYmluZGluZywgSGlzdG9yeVJlY29yZCBfYWN0aXZpdHksCi0gICAgICAgICAgICAgICBJU2VydmljZUNvbm5lY3Rpb24gX2Nvbm4sIGludCBfZmxhZ3MpIHsKKyAgICAgICAgICAgICAgIElTZXJ2aWNlQ29ubmVjdGlvbiBfY29ubiwgaW50IF9mbGFncywKKyAgICAgICAgICAgICAgIGludCBfY2xpZW50TGFiZWwsIFBlbmRpbmdJbnRlbnQgX2NsaWVudEludGVudCkgewogICAgICAgICBiaW5kaW5nID0gX2JpbmRpbmc7CiAgICAgICAgIGFjdGl2aXR5ID0gX2FjdGl2aXR5OwogICAgICAgICBjb25uID0gX2Nvbm47CiAgICAgICAgIGZsYWdzID0gX2ZsYWdzOworICAgICAgICBjbGllbnRMYWJlbCA9IF9jbGllbnRMYWJlbDsKKyAgICAgICAgY2xpZW50SW50ZW50ID0gX2NsaWVudEludGVudDsKICAgICB9CiAKICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewpkaWZmIC0tZ2l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kZWxpdmVyZWRUaW1lKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNpLmRlbGl2ZXJ5Q291bnQgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBkYz0iKTsgcHcucHJpbnQoc2kuZGVsaXZlcnlDb3VudCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHNpLmRvbmVFeGVjdXRpbmdDb3VudCAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGR4Yz0iKTsgcHcucHJpbnQoc2kuZG9uZUV4ZWN1dGluZ0NvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICIpOworICAgICAgICAgICAgICAgICAgICBpZiAoc2kuaW50ZW50ICE9IG51bGwpIHB3LnByaW50bG4oc2kuaW50ZW50LnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICBlbHNlIHB3LnByaW50bG4oIm51bGwiKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKICAgICB2b2lkIGR1bXAoUHJpbnRXcml0ZXIgcHcsIFN0cmluZyBwcmVmaXgpIHsKICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoImludGVudD17Iik7CiAgICAgICAgICAgICAgICAgcHcucHJpbnQoaW50ZW50LmdldEludGVudCgpLnRvU2hvcnRTdHJpbmcodHJ1ZSwgZmFsc2UpKTsKQEAgLTkzLDIwICsxNDEsMzkgQEAKICAgICAgICAgICAgICAgICBpZiAoIXJlc0Rpci5lcXVhbHMoYmFzZURpcikpIHB3LnByaW50KCIgcmVzRGlyPSIpOyBwdy5wcmludChyZXNEaXIpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KCIgZGF0YURpcj0iKTsgcHcucHJpbnRsbihkYXRhRGlyKTsKICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoImFwcD0iKTsgcHcucHJpbnRsbihhcHApOwotICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgiaXNGb3JlZ3JvdW5kPSIpOyBwdy5wcmludChpc0ZvcmVncm91bmQpOwotICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbGFzdEFjdGl2aXR5PSIpOyBwdy5wcmludGxuKGxhc3RBY3Rpdml0eS1ub3cpOwotICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgic3RhcnRSZXF1ZXN0ZWQ9Iik7IHB3LnByaW50KHN0YXJ0UmVxdWVzdGVkKTsKLSAgICAgICAgICAgICAgICBwdy5wcmludCgiIHN0YXJ0SWQ9Iik7IHB3LnByaW50KGxhc3RTdGFydElkKTsKLSAgICAgICAgICAgICAgICBwdy5wcmludCgiIGV4ZWN1dGVOZXN0aW5nPSIpOyBwdy5wcmludChleGVjdXRlTmVzdGluZyk7CisgICAgICAgIGlmIChpc0ZvcmVncm91bmQgfHwgZm9yZWdyb3VuZElkICE9IDApIHsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJpc0ZvcmVncm91bmQ9Iik7IHB3LnByaW50KGlzRm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgZm9yZWdyb3VuZElkPSIpOyBwdy5wcmludChmb3JlZ3JvdW5kSWQpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGZvcmVncm91bmROb3RpPSIpOyBwdy5wcmludGxuKGZvcmVncm91bmROb3RpKTsKKyAgICAgICAgfQorICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibGFzdEFjdGl2aXR5PSIpOyBwdy5wcmludChsYXN0QWN0aXZpdHktbm93KTsKICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGV4ZWN1dGluZ1N0YXJ0PSIpOyBwdy5wcmludChleGVjdXRpbmdTdGFydC1ub3cpOwotICAgICAgICAgICAgICAgIHB3LnByaW50KCIgY3Jhc2hDb3VudD0iKTsgcHcucHJpbnRsbihjcmFzaENvdW50KTsKLSAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoInRvdGFsUmVzdGFydENvdW50PSIpOyBwdy5wcmludCh0b3RhbFJlc3RhcnRDb3VudCk7Ci0gICAgICAgICAgICAgICAgcHcucHJpbnQoIiByZXN0YXJ0Q291bnQ9Iik7IHB3LnByaW50KHJlc3RhcnRDb3VudCk7Ci0gICAgICAgICAgICAgICAgcHcucHJpbnQoIiByZXN0YXJ0RGVsYXk9Iik7IHB3LnByaW50KHJlc3RhcnREZWxheSk7Ci0gICAgICAgICAgICAgICAgcHcucHJpbnQoIiByZXN0YXJ0VGltZT0iKTsgcHcucHJpbnQocmVzdGFydFRpbWUtbm93KTsKLSAgICAgICAgICAgICAgICBwdy5wcmludCgiIG5leHRSZXN0YXJ0VGltZT0iKTsgcHcucHJpbnRsbihuZXh0UmVzdGFydFRpbWUtbm93KTsKKyAgICAgICAgICAgICAgICBwdy5wcmludCgiIHJlc3RhcnRUaW1lPSIpOyBwdy5wcmludGxuKHJlc3RhcnRUaW1lKTsKKyAgICAgICAgaWYgKHN0YXJ0UmVxdWVzdGVkIHx8IGxhc3RTdGFydElkICE9IDApIHsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJzdGFydFJlcXVlc3RlZD0iKTsgcHcucHJpbnQoc3RhcnRSZXF1ZXN0ZWQpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIHN0b3BJZktpbGxlZD0iKTsgcHcucHJpbnQoc3RvcElmS2lsbGVkKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBjYWxsU3RhcnQ9Iik7IHB3LnByaW50KGNhbGxTdGFydCk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbGFzdFN0YXJ0SWQ9Iik7IHB3LnByaW50bG4obGFzdFN0YXJ0SWQpOworICAgICAgICB9CisgICAgICAgIGlmIChleGVjdXRlTmVzdGluZyAhPSAwIHx8IGNyYXNoQ291bnQgIT0gMCB8fCByZXN0YXJ0Q291bnQgIT0gMAorICAgICAgICAgICAgICAgIHx8IHJlc3RhcnREZWxheSAhPSAwIHx8IG5leHRSZXN0YXJ0VGltZSAhPSAwKSB7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgiZXhlY3V0ZU5lc3Rpbmc9Iik7IHB3LnByaW50KGV4ZWN1dGVOZXN0aW5nKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiByZXN0YXJ0Q291bnQ9Iik7IHB3LnByaW50KHJlc3RhcnRDb3VudCk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgcmVzdGFydERlbGF5PSIpOyBwdy5wcmludChyZXN0YXJ0RGVsYXktbm93KTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBuZXh0UmVzdGFydFRpbWU9Iik7IHB3LnByaW50KG5leHRSZXN0YXJ0VGltZS1ub3cpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGNyYXNoQ291bnQ9Iik7IHB3LnByaW50bG4oY3Jhc2hDb3VudCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGRlbGl2ZXJlZFN0YXJ0cy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludGxuKCJEZWxpdmVyZWQgU3RhcnRzOiIpOworICAgICAgICAgICAgZHVtcFN0YXJ0TGlzdChwdywgcHJlZml4LCBkZWxpdmVyZWRTdGFydHMsIFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocGVuZGluZ1N0YXJ0cy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludGxuKCJQZW5kaW5nIFN0YXJ0czoiKTsKKyAgICAgICAgICAgIGR1bXBTdGFydExpc3QocHcsIHByZWZpeCwgcGVuZGluZ1N0YXJ0cywgMCk7CisgICAgICAgIH0KICAgICAgICAgaWYgKGJpbmRpbmdzLnNpemUoKSA+IDApIHsKICAgICAgICAgICAgIEl0ZXJhdG9yPEludGVudEJpbmRSZWNvcmQ+IGl0ID0gYmluZGluZ3MudmFsdWVzKCkuaXRlcmF0b3IoKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50bG4oIkJpbmRpbmdzOiIpOwogICAgICAgICAgICAgd2hpbGUgKGl0Lmhhc05leHQoKSkgewogICAgICAgICAgICAgICAgIEludGVudEJpbmRSZWNvcmQgYiA9IGl0Lm5leHQoKTsKICAgICAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgiKiBJbnRlbnRCaW5kUmVjb3JkeyIpOwpAQCAtMTY3LDYgKzIzNCw0NSBAQAogICAgICAgICByZXN0YXJ0VGltZSA9IDA7CiAgICAgfQogICAgIAorICAgIHB1YmxpYyBTdGFydEl0ZW0gZmluZERlbGl2ZXJlZFN0YXJ0KGludCBpZCwgYm9vbGVhbiByZW1vdmUpIHsKKyAgICAgICAgZmluYWwgaW50IE4gPSBkZWxpdmVyZWRTdGFydHMuc2l6ZSgpOworICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICBTdGFydEl0ZW0gc2kgPSBkZWxpdmVyZWRTdGFydHMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKHNpLmlkID09IGlkKSB7CisgICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkgZGVsaXZlcmVkU3RhcnRzLnJlbW92ZShpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gc2k7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBwb3N0Tm90aWZpY2F0aW9uKCkgeworICAgICAgICBpZiAoZm9yZWdyb3VuZElkICE9IDAgJiYgZm9yZWdyb3VuZE5vdGkgIT0gbnVsbCkgeworICAgICAgICAgICAgSU5vdGlmaWNhdGlvbk1hbmFnZXIgaW5tID0gTm90aWZpY2F0aW9uTWFuYWdlci5nZXRTZXJ2aWNlKCk7CisgICAgICAgICAgICBpZiAoaW5tICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBpbnRbXSBvdXRJZCA9IG5ldyBpbnRbMV07CisgICAgICAgICAgICAgICAgICAgIGlubS5lbnF1ZXVlTm90aWZpY2F0aW9uKHBhY2thZ2VOYW1lLCBmb3JlZ3JvdW5kSWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZE5vdGksIG91dElkKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBjYW5jZWxOb3RpZmljYXRpb24oKSB7CisgICAgICAgIGlmIChmb3JlZ3JvdW5kSWQgIT0gMCkgeworICAgICAgICAgICAgSU5vdGlmaWNhdGlvbk1hbmFnZXIgaW5tID0gTm90aWZpY2F0aW9uTWFuYWdlci5nZXRTZXJ2aWNlKCk7CisgICAgICAgICAgICBpZiAoaW5tICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBpbm0uY2FuY2VsTm90aWZpY2F0aW9uKHBhY2thZ2VOYW1lLCBmb3JlZ3JvdW5kSWQpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAogICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CiAgICAgICAgIGlmIChzdHJpbmdOYW1lICE9IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybiBzdHJpbmdOYW1lOwpkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvYW0vVXNhZ2VTdGF0c1NlcnZpY2UuamF2YSBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL1VzYWdlU3RhdHNTZXJ2aWNlLmphdmEKb2xkIG1vZGUgMTAwNzU1Cm5ldyBtb2RlIDEwMDY0NAppbmRleCBkNDU4OTExLi42Njg2OGEzCi0tLSBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL2FtL1VzYWdlU3RhdHNTZXJ2aWNlLmphdmEKKysrIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvYW0vVXNhZ2VTdGF0c1NlcnZpY2UuamF2YQpAQCAtNjk1LDcgKzY5NSwxNCBAQAogICAgICAgICAgICAgICAgIGlmIChOQyA+IDApIHsKICAgICAgICAgICAgICAgICAgICAgZm9yIChNYXAuRW50cnk8U3RyaW5nLCBUaW1lU3RhdHM+IGVudCA6IHB1cy5tTGF1bmNoVGltZXMuZW50cnlTZXQoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCJBOiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGVudC5nZXRLZXkoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYWN0aXZpdHkgPSBlbnQuZ2V0S2V5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aXZpdHkuc3RhcnRzV2l0aChwa2dOYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgnKicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChhY3Rpdml0eS5zdWJzdHJpbmcoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwa2dOYW1lLmxlbmd0aCgpLCBhY3Rpdml0eS5sZW5ndGgoKSkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoYWN0aXZpdHkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgVGltZVN0YXRzIHRpbWVzID0gZW50LmdldFZhbHVlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJywnKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCh0aW1lcy5jb3VudCk7CmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9zdGF0dXMvU3RhdHVzQmFyUG9saWN5LmphdmEgYi9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9zdGF0dXMvU3RhdHVzQmFyUG9saWN5LmphdmEKaW5kZXggYTRiNDdiNS4uZjMxMjdmMyAxMDA2NDQKLS0tIGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvc3RhdHVzL1N0YXR1c0JhclBvbGljeS5qYXZhCisrKyBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL3N0YXR1cy9TdGF0dXNCYXJQb2xpY3kuamF2YQpAQCAtMTgsMTAgKzE4LDEwIEBACiAKIGltcG9ydCBhbmRyb2lkLmFwcC5BbGVydERpYWxvZzsKIGltcG9ydCBhbmRyb2lkLmJsdWV0b290aC5CbHVldG9vdGhBMmRwOwotaW1wb3J0IGFuZHJvaWQuYmx1ZXRvb3RoLkJsdWV0b290aERldmljZTsKLWltcG9ydCBhbmRyb2lkLmJsdWV0b290aC5CbHVldG9vdGhFcnJvcjsKK2ltcG9ydCBhbmRyb2lkLmJsdWV0b290aC5CbHVldG9vdGhB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jaygpOwogICAgICAgICAgICAgfQpAQCAtMzc3LDEyICszNTQsMTcgQEAKICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9TWU5DX1NUQVRFX0NIQU5HRUQpKSB7CiAgICAgICAgICAgICAgICAgdXBkYXRlU3luY1N0YXRlKGludGVudCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEludGVudC5BQ1RJT05fQkFUVEVSWV9DSEFOR0VEKSkgewotICAgICAgICAgICAgICAgIHVwZGF0ZUJhdHRlcnkoaW50ZW50KTsKKyAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9CQVRURVJZX0xPVykpIHsKKyAgICAgICAgICAgICAgICBvbkJhdHRlcnlMb3coaW50ZW50KTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoSW50ZW50LkJMVUVUT09USF9TVEFURV9DSEFOR0VEX0FDVElPTikgfHwKKyAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9CQVRURVJZX09LQVkpCisgICAgICAgICAgICAgICAgICAgIHx8IGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9QT1dFUl9DT05ORUNURUQpKSB7CisgICAgICAgICAgICAgICAgb25CYXR0ZXJ5T2theShpbnRlbnQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBZGFwdGVyLkFDVElPTl9TVEFURV9DSEFOR0VEKSB8fAogICAgICAgICAgICAgICAgICAgICBhY3Rpb24uZXF1YWxzKEJsdWV0b290aEludGVudC5IRUFEU0VUX1NUQVRFX0NIQU5HRURfQUNUSU9OKSB8fAotICAgICAgICAgICAgICAgICAgICBhY3Rpb24uZXF1YWxzKEJsdWV0b290aEEyZHAuU0lOS19TVEFURV9DSEFOR0VEX0FDVElPTikpIHsKKyAgICAgICAgICAgICAgICAgICAgYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBMmRwLlNJTktfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pIHx8CisgICAgICAgICAgICAgICAgICAgIGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoUGJhcC5QQkFQX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgewogICAgICAgICAgICAgICAgIHVwZGF0ZUJsdWV0b290aChpbnRlbnQpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhXaWZpTWFuYWdlci5ORVRXT1JLX1NUQVRFX0NIQU5HRURfQUNUSU9OKSB8fApAQCAtNDMwLDEyICs0MTIsNiBAQAogICAgICAgICAgICAgICAgIG51bGwsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUuc3RhdF9zeXNfc2lnbmFsX251bGwsIDAsIDApOwogICAgICAgICBtUGhvbmVJY29uID0gc2VydmljZS5hZGRJY29uKG1QaG9uZURhdGEsIG51bGwpOwogCi0gICAgICAgIC8vIHBob25lX2V2ZG9fc2lnbmFsCi0gICAgICAgIG1QaG9uZUV2ZG9EYXRhID0gSWNvbkRhdGEubWFrZUljb24oInBob25lX2V2ZG9fc2lnbmFsIiwKLSAgICAgICAgICAgICAgICBudWxsLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmRyYXdhYmxlLnN0YXRfc3lzX3NpZ25hbF9ldmRvXzAsIDAsIDApOwotICAgICAgICBtUGhvbmVFdmRvSWNvbiA9IHNlcnZpY2UuYWRkSWNvbihtUGhvbmVFdmRvRGF0YSwgbnVsbCk7Ci0gICAgICAgIHNlcnZpY2Uuc2V0SWNvblZpc2liaWxpdHkobVBob25lRXZkb0ljb24sIGZhbHNlKTsKLQogICAgICAgICAvLyByZWdpc3RlciBmb3I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mxlbmd0aDsKLSAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewotICAgICAgICAgICAgaWYgKGxldmVsID49IG1CYXR0ZXJ5VGhyZXNob2xkc1tpXSkgewotICAgICAgICAgICAgICAgIG1CYXR0ZXJ5VGhyZXNob2xkID0gaTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAobUJhdHRlcnlUaHJlc2hvbGQgPj0gTikgewotICAgICAgICAgICAgbUJhdHRlcnlUaHJlc2hvbGQgPSBOLTE7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBwcml2YXRlIGZpbmFsIHZvaWQgdXBkYXRlQmF0dGVyeShJbnRlbnQgaW50ZW50KSB7CiAgICAgICAgIG1CYXR0ZXJ5RGF0YS5pY29uSWQgPSBpbnRlbnQuZ2V0SW50RXh0cmEoImljb24tc21hbGwiLCAwKTsKICAgICAgICAgbUJhdHRlcnlEYXRhLmljb25MZXZlbCA9IGludGVudC5nZXRJbnRFeHRyYSgibGV2ZWwiLCAwKTsKICAgICAgICAgbVNlcnZpY2UudXBkYXRlSWNvbihtQmF0dGVyeUljb24sIG1CYXR0ZXJ5RGF0YSwgbnVsbCk7CiAKLSAgICAgICAgaW50IHBsdWdnZWQgPSBpbnRlbnQuZ2V0SW50RXh0cmEoInBsdWdnZWQiLCAwKTsKKyAgICAgICAgYm9vbGVhbiBwbHVnZ2VkID0gaW50ZW50LmdldEludEV4dHJhKCJwbHVnZ2VkIiwgMCkgIT0gMDsKICAgICAgICAgaW50IGxldmVsID0gaW50ZW50LmdldEludEV4dHJhKCJsZXZlbCIsIC0xKTsKICAgICAgICAgaWYgKGZhbHNlKSB7CiAgICAgICAgICAgICBMb2cuZChUQUcsICJ1cGRhdGVCYXR0ZXJ5IGxldmVsPSIgKyBsZXZlbAogICAgICAgICAgICAgICAgICAgICArICIgcGx1Z2dlZD0iICsgcGx1Z2dlZAogICAgICAgICAgICAgIC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GxldmVsPSIgKyBsZXZlbCk7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKHBsdWdnZWQgPT0gMAotICAgICAgICAgICAgICAgICYmICgob2xkUGx1Z2dlZCAhPSAwICYmIGxldmVsIDwgbUJhdHRlcnlUaHJlc2hvbGRzW0JBVFRFUllfVEhSRVNIT0xEX1dBUk5JTkddKQotICAgICAgICAgICAgICAgICAgICB8fCAobUJhdHRlcnlUaHJlc2hvbGQgPiBvbGRUaHJlc2hvbGQKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIG1CYXR0ZXJ5VGhyZXNob2xkID4gQkFUVEVSWV9USFJFU0hPTERfV0FSTklORykpKSB7Ci0gICAgICAgICAgICAvLyBCcm9hZGNhc3QgdGhlIGxvdyBiYXR0ZXJ5IHdhcm5pbmcKLSAgICAgICAgICAgIG1TZW50TG93QmF0dGVyeUJyb2FkY2FzdCA9IHRydWU7Ci0gICAgICAgICAgICBJbnRlbnQgYmF0SW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX0JBVFRFUllfTE9XKTsKLSAgICAgICAgICAgIGJhdEludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19SRUNFSVZFUl9SRUdJU1RFUkVEX09OTFlfQkVGT1JFX0JPT1QpOwotICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChiYXRJbnRlbnQpOworICAgIH0KIAotICAgICAgICAgICAgaWYgKFNIT1dfTE9XX0JBVFRFUllfV0FSTklORykgewotICAgICAgICAgICAgICAgIGlmIChmYWxzZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJtUGhvbmVTdGF0ZT0iICsgbVBob25lU3RhdGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbUxvd0JhdHRlcnlEaWFsb2c9IiArIG1Mb3dCYXR0ZXJ5RGlhbG9nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1CYXR0ZXJ5U2hvd0xvd09uRW5kQ2FsbD0iICsgbUJhdHRlcnlTaG93TG93T25FbmRDYWxsKTsKLSAgICAgICAgICAgICAgICB9CisgICAgcHJpdmF0ZSB2b2lkIG9uQmF0dGVyeUxvdyhJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIGlmIChTSE9XX0xPV19CQVRURVJZX1dBUk5JTkcpIHsKKyAgICAgICAgICAgIGlmIChmYWxzZSkgeworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIm1QaG9uZVN0YXRlPSIgKyBtUGhvbmVTdGF0ZQorICAgICAgICAgICAgICAgICAgICAgICsgIiBtTG93QmF0dGVyeURpYWxvZz0iICsgbUxvd0JhdHRlcnlEaWFsb2cKKyAgICAgICAgICAgICAgICAgICAgICArICIgbUJhdHRlcnlTaG93TG93T25FbmRDYWxsPSIgKyBtQmF0dGVyeVNob3dMb3dPbkVuZENhbGwpOworICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgaWYgKG1QaG9uZVN0YXRlID09IFRlbGVwaG9ueU1hbmFnZXIuQ0FMTF9TVEFURV9JRExFKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNob3dMb3dCYXR0ZXJ5V2FybmluZygpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5U2hvd0xvd09uRW5kQ2FsbCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKG1CYXR0ZXJ5VGhyZXNob2xkIDwgQkFUVEVSWV9USFJFU0hPTERfV0FSTklORykgewotICAgICAgICAgICAgaWYgKG1TZW50TG93QmF0dGVyeUJyb2FkY2FzdCA9PSB0cnVlKSB7Ci0gICAgICAgICAgICAgICAgbVNlbnRMb3dCYXR0ZXJ5QnJvYWRjYXN0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgSW50ZW50IGJhdEludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9CQVRURVJZX09LQVkpOwotICAgICAgICAgICAgICAgIGJhdEludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19SRUNFSVZFUl9SRUdJU1RFUkVEX09OTFlfQkVGT1JFX0JPT1QpOwotICAgICAgICAgICAgICAgIG1Db250ZXh0LnNlbmRCcm9hZGNhc3QoYmF0SW50ZW50KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChTSE9XX0xPV19CQVRURVJZX1dBUk5JTkcpIHsKLSAgICAgICAgICAgICAgICBpZiAobUxvd0JhdHRlcnlEaWFsb2cgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtTG93QmF0dGVyeURpYWxvZy5kaXNtaXNzKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5U2hvd0xvd09uRW5kQ2FsbCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtUGhvbmVTdGF0ZSA9PSBUZWxlcGhvbnlNYW5hZ2VyLkNBTExfU1RBVEVfSURMRSkgeworICAgICAgICAgICAgICAgIHNob3dMb3dCYXR0ZXJ5V2FybmluZygpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQmF0dGVyeVNob3dMb3dPbkVuZENhbGwgPSB0cnVlOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIHNob3dCYXR0ZXJ5VmlldygpIHsgICAgCisgICAgcHJpdmF0ZSB2b2lkIG9uQmF0dGVyeU9rYXkoSW50ZW50IGludGVudCkgeworICAgICAgICBpZiAobUxvd0JhdHRlcnlEaWFsb2cgIT0gbnVsbAorICAgICAgICAgICAgICAgICYmIFNIT1dfTE9XX0JBVFRFUllfV0FSTklORykgeworICAgICAgICAgICAgbUxvd0JhdHRlcnlEaWFsb2cuZGlzbWlzcygpOworICAgICAgICAgICAgbUJhdHRlcnlTaG93TG93T25FbmRDYWxsID0gZmFsc2U7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IEBACiAgICAgICAgICAgICAgICAgYi5zZXRWaWV3KHYpOwogICAgICAgICAgICAgICAgIGIuc2V0SWNvbihhbmRyb2lkLlIuZHJhd2FibGUuaWNfZGlhbG9nX2FsZXJ0KTsKICAgICAgICAgICAgICAgICBiLnNldFBvc2l0aXZlQnV0dG9uKGFuZHJvaWQuUi5zdHJpbmcub2ssIG51bGwpOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgZmluYWwgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9QT1dFUl9VU0FHRV9TVU1NQVJZKTsKICAgICAgICAgICAgICAgICBpbnRlbnQuc2V0RmxhZ3MoSW50ZW50LkZMQUdfQUNUSVZJVFlfTkVXX1RBU0sKICAgICAgICAgICAgICAgICAgICAgICAgIHwgSW50ZW50LkZMQUdfQUNUSVZJVFlfTVVMVElQTEVfVEFTSwpAQCAtNzczLDcgKzcyNiw3IEBACiAgICAgICAgIH0KICAgICAgICAgaWYgKG1QaG9uZVN0YXRlID09IFRlbGVwaG9ueU1hbmFnZXIuQ0FMTF9TVEFURV9JRExFKSB7CiAgICAgICAgICAgICBpZiAobUJhdHRlcnlTaG93TG93T25FbmRDYWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1CYXR0ZXJ5UGx1Z2dlZCA9PSAwKSB7CisgICAgICAgICAgICAgICAgaWYgKCFtQmF0dGVyeVBsdWdnZWQpIHsKICAgICAgICAgICAgICAgICAgICAgc2hvd0xvd0JhdHRlcnlXYXJuaW5nKCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1CYXR0ZXJ5U2hvd0xvd09uRW5kQ2FsbCA9IGZhbHNlOwpAQCAtODI2LDYgKzc3OSwxMCBAQAogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIHZvaWQgb25DYWxsU3RhdGVDaGFuZ2VkKGludCBzdGF0ZSwgU3RyaW5nIGluY29taW5nTnVtYmVyKSB7CiAgICAgICAgICAgICB1cGRhdGVDYWxsU3RhdGUoc3RhdGUpOworICAgICAgICAgICAgLy8gSW4gY2RtYSwgaWYgYSB2b2ljZSBjYWxsIGlzIG1hZGUsIFJTU0kgc2hvdWxkIHN3aXRjaCB0byAxeC4KKyAgICAgICAgICAgIGlmIChpc0NkbWEoKSkgeworICAgICAgICAgICAgICAgIHVwZGF0ZVNpZ25hbFN0cmVuZ3RoKCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBAT3ZlcnJpZGUKQEAgLTg1NCw3ICs4MTEsNyBAQAogICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxvY2tlZFJlYXNvbiA9IGludGVudC5nZXRTdHJpbmdFeHRyYShJY2NDYXJkLklOVEVOVF9LRVlfTE9DS0VEX1JFQVNPTik7CiAgICAgICAgICAgICBpZiAoSWNjQ2FyZC5JTlRFTlRfVkFMVUVfTE9DS0VEX09OX1BJTi5lcXVhbHMobG9ja2VkUmVhc29uKSkgewogICAgICAgICAgICAgICAgIG1TaW1TdGF0ZSA9IEljY0NhcmQuU3RhdGUuUElOX1JFUVVJUkVEOwotICAgICAgICAgICAgfSAKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGVsc2UgaWYgKEljY0NhcmQuSU5URU5UX1ZBTFVFX0xPQ0tFRF9PTl9QVUsuZXF1YWxzKGxvY2tlZFJlYXNvbikpIHsKICAgICAgICAgICAgICAgICBtU2ltU3RhdGUgPSBJY2NDYXJkLlN0YXRlLlBVS19SRVFVSVJFRDsKICAgICAgICAgICAgIH0KQEAgLTg3MSw2ICs4MjgsMTQgQEAKICAgICAgICAgcmV0dXJuICgobVBob25lICE9IG51bGwpICYmIChtUGhvbmUuZ2V0UGhvbmVUeXBlKCkgPT0gVGVsZXBob255TWFuYWdlci5QSE9ORV9UWVBFX0NETUEpKTsKICAgICB9CiAKKyAgICBwcml2YXRlIGJvb2xlYW4gaXNFdmRvKCkgeworICAgICAgICByZXR1cm4gKCAobVNlcnZpY2VTdGF0ZSAhPSBudWxsKQorICAgICAgICAgICAgICAgICAmJiAoKG1TZXJ2aWNlU3RhdGUuZ2V0UmFkaW9UZWNobm9sb2d5KCkKKyAgICAgICAgICAgICAgICAgICAgICAgID09IFNlcnZpY2VTdGF0ZS5SQURJT19URUNITk9MT0dZX0VWRE9fMCkKKyAgICAgICAgICAgICAgICAgICAgIHx8IChtU2VydmljZVN0YXRlLmdldFJhZGlvVGVjaG5vbG9neSgpCisgICAgICAgICAgICAgICAgICAgICAgICA9PSBTZXJ2aWNlU3RhdGUuUkFESU9fVEVDSE5PTE9HWV9FVkRPX0EpKSk7CisgICAgfQorCiAgICAgcHJpdmF0ZSBib29sZWFuIGhhc1NlcnZpY2UoKSB7CiAgICAgICAgIGlmIChtU2VydmljZVN0YXRlICE9IG51bGwpIHsKICAgICAgICAgICAgIHN3aXRjaCAobVNlcnZpY2VTdGF0ZS5nZXRTdGF0ZSgpKSB7CkBAIC04ODcsOSArODUyLDcgQEAKIAogICAgIHByaXZhdGUgZmluYWwgdm9pZCB1cGRhdGVTaWduYWxTdHJlbmd0aCgpIHsKICAgICAgICAgaW50IGljb25MZXZlbCA9IC0xOwotICAgICAgICBpbnQgZXZkb0ljb25MZXZlbCA9IC0xOwogICAgICAgICBpbnRbXSBpY29uTGlzdDsKLSAgICAgICAgaW50W10gZXZkb0ljb25MaXN0OwogCiAgICAgICAgIGlmICghaGFzU2VydmljZSgpKSB7CiAgICAgICAgICAgICAvL0xvZy5kKFRBRywgInVwZGF0ZVNpZ25hbFN0cmVuZ3RoOiBubyBzZXJ2aWNlIik7CkBAIC05MDAsNyArODYzLDYgQEAKICAgICAgICAgICAgICAgICBtUGhvbmVEYXRhLmljb25JZCA9IGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUuc3RhdF9zeXNfc2lnbmFsX251bGw7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtU2VydmljZS51cGRhdGVJY29uKG1QaG9uZUljb24sIG1QaG9uZURhdGEsIG51bGwpOwotICAgICAgICAgICAgbVNlcnZpY2Uuc2V0SWNvblZpc2liaWxpdHkobVBob25lRXZkb0ljb24sZmFsc2UpOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTkyMyw2NSArODg1LDY3IEBACiAgICAgICAgICAgICAgICAgaWNvbkxpc3QgPSBzU2lnbmFsSW1hZ2VzOwogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWNvbkxpc3QgPSB0aGlzLnNTaWduYWxJbWFnZXNfY2RtYTsKKyAgICAgICAgICAgIGljb25MaXN0ID0gdGhpcy5zU2lnbmFsSW1hZ2VzOwogCi0gICAgICAgICAgICBpbnQgY2RtYURibSA9IG1TaWduYWxTdHJlbmd0aC5nZXRDZG1hRGJtKCk7Ci0gICAgICAgICAgICBpbnQgY2RtYUVjaW8gPSBtU2lnbmFsU3RyZW5ndGguZ2V0Q2RtYUVjaW8oKTsKLSAgICAgICAgICAgIGludCBsZXZlbERibSA9IDA7Ci0gICAgICAgICAgICBpbnQgbGV2ZWxFY2lvID0gMDsKLQotICAgICAgICAgICAgaWYgKGNkbWFEYm0gPj0gLTc1KSBsZXZlbERibSA9IDQ7Ci0gICAgICAgICAgICBlbHNlIGlmIChjZG1hRGJtID49IC04NSkgbGV2ZWxEYm0gPSAzOwotICAgICAgICAgICAgZWxzZSBpZiAoY2RtYURibSA+PSAtOTUpIGxldmVsRGJtID0gMjsKLSAgICAgICAgICAgIGVsc2UgaWYgKGNkbWFEYm0gPj0gLTEwMCkgbGV2ZWxEYm0gPSAxOwotICAgICAgICAgICAgZWxzZSBsZXZlbERibSA9IDA7Ci0KLSAgICAgICAgICAgIC8vIEVjL0lvIGFyZSBpbiBkQioxMAotICAgICAgICAgICAgaWYgKGNkbWFFY2lvID49IC05MCkgbGV2ZWxFY2lvID0gNDsKLSAgICAgICAgICAgIGVsc2UgaWYgKGNkbWFFY2lvID49IC0xMTApIGxldm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NuciA+IDUpIGxldmVsRXZkb1NuciA9IDM7Ci0gICAgICAgICAgICBlbHNlIGlmIChldmRvU25yID4gMykgbGV2ZWxFdmRvU25yID0gMjsKLSAgICAgICAgICAgIGVsc2UgaWYgKGV2ZG9TbnIgPiAxKSBsZXZlbEV2ZG9TbnIgPSAxOwotICAgICAgICAgICAgZWxzZSBsZXZlbEV2ZG9TbnIgPSAwOwotCi0gICAgICAgICAgICBldmRvSWNvbkxldmVsID0gKGxldmVsRXZkb0VjaW8gPCBsZXZlbEV2ZG9TbnIpID8gbGV2ZWxFdmRvRWNpbyA6IGxldmVsRXZkb1NucjsKLQotICAgICAgICAgICAgbVBob25lRXZkb0RhdGEuaWNvbklkID0gZXZkb0ljb25MaXN0W2V2ZG9JY29uTGV2ZWxdOwotICAgICAgICAgICAgbVNlcnZpY2UudXBkYXRlSWNvbihtUGhvbmVFdmRvSWNvbiwgbVBob25lRXZkb0RhdGEsIG51bGwpOwotICAgICAgICAgICAgbVNlcnZpY2Uuc2V0SWNvblZpc2liaWxpdHkobVBob25lRXZkb0ljb24sdHJ1ZSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtU2VydmljZS5zZXRJY29uVmlzaWJpbGl0eShtUGhvbmVFdmRvSWNvbixmYWxzZSk7Ci0gICAgICAgIH0KLQogICAgICAgICBtUGhvbmVEYXRhLmljb25JZCA9IGljb25MaXN0W2ljb25MZXZlbF07CiAgICAgICAgIG1TZXJ2aWNlLnVwZGF0ZUljb24obVBob25lSWNvbiwgbVBob25lRGF0YSwgbnVsbCk7CiAgICAgfQogCisgICAgcHJpdmF0ZSBpbnQgZ2V0Q2RtYUxldmVsKCkgeworICAgICAgICBmaW5hbCBpbnQgY2RtYURibSA9IG1TaWduYWxTdHJlbmd0aC5nZXRDZG1hRGJtKCk7CisgICAgICAgIGZpbmFsIGludCBjZG1hRWNpbyA9IG1TaWduYWxTdHJlbmd0aC5nZXRDZG1hRWNpbygpOworICAgICAgICBpbnQgbGV2ZWxEYm0gPSAwOworICAgICAgICBpbnQgbGV2ZWxFY2lvID0gMDsKKworICAgICAgICBpZiAoY2RtYURibSA+PSAtNzUpIGxldmVsRGJtID0gNDsKKyAgICAgICAgZWxzZSBpZiAoY2RtYURibSA+PSAtODUpIGxldmVsRGJtID0gMzsKKyAgICAgICAgZWxzZSBpZiAoY2RtYURibSA+PSAtOTUpIGxldmVsRGJtID0gMjsKKyAgICAgICAgZWxzZSBpZiAoY2RtYURibSA+PSAtMTAwKSBsZXZlbERibSA9IDE7CisgICAgICAgIGVsc2UgbGV2ZWxEYm0gPSAwOworCisgICAgICAgIC8vIEVjL0lvIGFyZSBpbiBkQioxMAorICAgICAgICBpZiAoY2RtYUVjaW8gPj0gLTkwKSBsZXZlbEVjaW8gPSA0OworICAgICAgICBlbHNlIGlmIChjZG1hRWNpbyA+PSAtMTEwKSBsZXZlbEVjaW8gPSAzOworICAgICAgICBlbHNlIGlmIChjZG1hRWNpbyA+PSAtMTMwKSBsZXZlbEVjaW8gPSAyOworICAgICAgICBlbHNlIGlmIChjZG1hRWNpbyA+PSAtMTUwKSBsZXZlbEVjaW8gPSAxOworICAgICAgICBlbHNlIGxldmVsRWNpbyA9IDA7CisKKyAgICAgICAgcmV0dXJuIChsZXZlbERibSA8IGxldmVsRWNpbykgPyBsZXZlbERibSA6IGxldmVsRWNpbzsKKyAgICB9CisKKyAgICBwcml2YXRlIGludCBnZXRFdmRvTGV2ZWwoKSB7CisgICAgICAgIGludCBldmRvRGJtID0gbVNpZ25hbFN0cmVuZ3RoLmdldEV2ZG9EYm0oKTsKKyAgICAgICAgaW50IGV2ZG9TbnIgPSBtU2lnbmFsU3RyZW5ndGguZ2V0RXZkb1NucigpOworICAgICAgICBpbnQgbGV2ZWxFdmRvRGJtID0gMDsKKyAgICAgICAgaW50IGxldmVsRXZkb1NuciA9IDA7CisKKyAgICAgICAgaWYgKGV2ZG9EYm0gPj0gLTY1KSBsZXZlbEV2ZG9EYm0gPSA0OworICAgIC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XNlIFRlbGVwaG9ueU1hbmFnZXIuTkVUV09SS19UWVBFX0hTUEE6CisgICAgICAgICAgICBtRGF0YUljb25MaXN0ID0gc0RhdGFOZXRUeXBlX2g7CisgICAgICAgICAgICBicmVhazsKICAgICAgICAgY2FzZSBUZWxlcGhvbnlNYW5hZ2VyLk5FVFdPUktfVFlQRV9DRE1BOgogICAgICAgICAgICAgLy8gZGlzcGxheSAxeFJUVCBmb3IgSVM5NUEvQgotICAgICAgICAgICAgbURhdGFJY29uTGlzdCA9IHRoaXMuc0RhdGFOZXRUeXBlXzF4cnR0OworICAgICAgICAgICAgbURhdGFJY29uTGlzdCA9IHRoaXMuc0RhdGFOZXRUeXBlXzF4OwogICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIGNhc2UgVGVsZXBob255TWFuYWdlci5ORVRXT1JLX1RZUEVfMXhSVFQ6Ci0gICAgICAgICAgICBtRGF0YUljb25MaXN0ID0gdGhpcy5zRGF0YU5ldFR5cGVfMXhydHQ7CisgICAgICAgICAgICBtRGF0YUljb25MaXN0ID0gdGhpcy5zRGF0YU5ldFR5cGVfMXg7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgY2FzZSBUZWxlcGhvbnlNYW5hZ2VyLk5FVFdPUktfVFlQRV9FVkRPXzA6IC8vZmFsbCB0aHJvdWdoCiAgICAgICAgIGNhc2UgVGVsZXBob255TWFuYWdlci5ORVRXT1JLX1RZUEVfRVZET19BOgotICAgICAgICAgICAgbURhdGFJY29uTGlzdCA9IHNEYXRhTmV0VHlwZV9ldmRvOworICAgICAgICAgICAgbURhdGFJY29uTGlzdCA9IHNEYXRhTmV0VHlwZV8zZzsKICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgbURhdGFJY29uTGlzdCA9IHNEYXRhTmV0VHlwZV9nOwpAQCAtMTA1NCw4ICsxMDIzLDYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGljb25JZCA9IG1EYXRhSWNvbkxpc3RbM107CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBUZWxlcGhvbnlNYW5hZ2VyLkRBVEFfQUNUSVZJVFlfRE9STUFOVDoKLSAgICAgICAgICAgICAgICAgICAgICAgIGljb25JZCA9IG1EYXRhSWNvbkxpc3RbNF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgICAgIGljb25JZCA9IG1EYXRhSWNvbkxpc3RbMF07CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTExMDQsMjMgKzEwNzEsMjYgQEAKICAgICAgICAgaW50IGljb25JZCA9IGNvbS5hbmRyb2lkLmludGVybmFsLlIuZHJhd2FibGUuc3RhdF9zeXNfZGF0YV9ibHVldG9vdGg7CiAKICAgICAgICAgU3RyaW5nIGFjdGlvbiA9IGludGVudC5nZXRBY3Rpb24oKTsKLSAgICAgICAgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoSW50ZW50LkJMVUVUT09USF9TVEFURV9DSEFOR0VEX0FDVElPTikpIHsKLSAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhJbnRlbnQuQkxVRVRPT1RIX1NUQVRFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aEVycm9yLkVSUk9SKTsKLSAgICAgICAgICAgIG1CbHVldG9vdGhFbmFibGVkID0gc3RhdGUgPT0gQmx1ZXRvb3RoRGV2aWNlLkJMVUVUT09USF9TVEFURV9PTjsKKyAgICAgICAgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoQWRhcHRlci5BQ1RJT05fU1RBVEVfQ0hBTkdFRCkpIHsKKyAgICAgICAgICAgIGludCBzdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhBZGFwdGVyLkVYVFJBX1NUQVRFLCBCbHVldG9vdGhBZGFwdGVyLkVSUk9SKTsKKyAgICAgICAgICAgIG1CbHVldG9vdGhFbmFibGVkID0gc3RhdGUgPT0gQmx1ZXRvb3RoQWRhcHRlci5TVEFURV9PTjsKICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZXF1YWxzKEJsdWV0b290aEludGVudC5IRUFEU0VUX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgewogICAgICAgICAgICAgbUJsdWV0b290aEhlYWRzZXRTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhJbnRlbnQuSEVBRFNFVF9TVEFURSwKICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoSGVhZHNldC5TVEFURV9FUlJPUik7CiAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhCbHVldG9vdGhBMmRwLlNJTktfU1RBVEVfQ0hBTkdFRF9BQ1RJT04pKSB7CiAgICAgICAgICAgICBtQmx1ZXRvb3RoQTJkcFN0YXRlID0gaW50ZW50LmdldEludEV4dHJhKEJsdWV0b290aEEyZHAuU0lOS19TVEFURSwKICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoQTJkcC5TVEFURV9ESVNDT05ORUNURUQpOworICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQmx1ZXRvb3RoUGJhcC5QQkFQX1NUQVRFX0NIQU5HRURfQUNUSU9OKSkgeworICAgICAgICAgICAgbUJsdWV0b290aFBiYXBTdGF0ZSA9IGludGVudC5nZXRJbnRFeHRyYShCbHVldG9vdGhQYmFwLlBCQVBfU1RBVEUsCisgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aFBiYXAuU1RBVEVfRElTQ09OTkVDVEVEKTsKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChtQmx1ZXRvb3R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HRlcnlUZWNobm9sb2d5LCBlbnYtPk5ld1N0cmluZ1VURihidWYpKTsKIH0KIApAQCAtMjA0LDYgKzIyOCwxMDEgQEAKIAogaW50IHJlZ2lzdGVyX2FuZHJvaWRfc2VydmVyX0JhdHRlcnlTZXJ2aWNlKEpOSUVudiogZW52KQogeworICAgIGNoYXIgICAgcGF0aFtQQVRIX01BWF07CisgICAgc3RydWN0IGRpcmVudCogZW50cnk7CisKKyAgICBESVIqIGRpciA9IG9wZW5kaXIoUE9XRVJfU1VQUExZX1BBVEgpOworICAgIGlmIChkaXIgPT0gTlVMTCkgeworICAgICAgICBMT0dFKCJDb3VsZCBub3Qgb3BlbiAlc1xuIiwgUE9XRVJfU1VQUExZX1BBVEgpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorICAgIHdoaWxlICgoZW50cnkgPSByZWFkZGlyKGRpcikpKSB7CisgICAgICAgIGNvbnN0IGNoYXIqIG5hbWUgPSBlbnRyeS0+ZF9uYW1lOworCisgICAgICAgIC8vIGlnbm9yZSAiLiIgYW5kICIuLiIKKyAgICAgICAgaWYgKG5hbWVbMF0gPT0gJy4nICYmIChuYW1lWzFdID09IDAgfHwgKG5hbWVbMV0gPT0gJy4nICYmIG5hbWVbMl0gPT0gMCkpKSB7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXIgYnVmWzIwXTsKKyAgICAgICAgLy8gTG9vayBmb3IgInR5cGUiIGZpbGUgaW4gZWFjaCBzdWJkaXJlY3RvcnkKKyAgICAgICAgc25wcmludGYocGF0aCwgc2l6ZW9mKHBhdGgpLCAiJXMvJXMvdHlwZSIsIFBPV0VSX1NVUFBMWV9QQVRILCBuYW1lKTsKKyAgICAgICAgaW50IGxlbmd0aCA9IHJlYWRGcm9tRmlsZShwYXRoLCBidWYsIHNpemVvZihidWYpKTsKKyAgICAgICAgaWYgKGxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgIGlmIChidWZbbGVuZ3RoIC0gMV0gPT0gJ1xuJykKKyAgICAgICAgICAgICAgICBidWZbbGVuZ3RoIC0gMV0gPSAwOworCisgICAgICAgICAgICBpZiAoc3RyY21wKGJ1ZiwgIk1haW5zIikgPT0gMCkgeworICAgICAgICAgICAgICAgIHNucHJpbnRmKHBhdGgsIHNpemVvZihwYXRoKSwgIiVzLyVzL29ubGluZSIsIFBPV0VSX1NVUFBMWV9QQVRILCBuYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoYWNjZXNzKHBhdGgsIFJfT0spID09IDApCisgICAgICAgICAgICAgICAgICAgIGdQYXRocy5hY09ubGluZVBhdGggPSBzdHJkdXAocGF0aCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChzdHJjbXAoYnVmLCAiVVNCIikgPT0gMCkgeworICAgICAgICAgICAgICAgIHNucHJpbnRmKHBhdGgsIHNpemVvZihwYXRoKSwgIiVzLyVzL29ubGluZSIsIFBPV0VSX1NVUFBMWV9QQVRILCBuYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoYWNjZXNzKHBhdGgsIFJfT0spID09IDApCisgICAgICAgICAgICAgICAgICAgIGdQYXRocy51c2JPbmxpbmVQYXRoID0gc3RyZHVwKHBhdGgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoc3RyY21wKGJ1ZiwgIkJhdHRlcnkiKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgc25wcmludGYocGF0aCwgc2l6ZW9mKHBhdGgpLCAiJXMvJXMvc3RhdHVzIiwgUE9XRVJfU1VQUExZX1BBVEgsIG5hbWUpOworICAgICAgICAgICAgICAgIGlmIChhY2Nlc3MocGF0aCwgUl9PSykgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgZ1BhdGhzLmJhdHRlcnlTdGF0dXNQYXRoID0gc3RyZHVwKHBhdGgpOworICAgICAgICAgICAgICAgIHNucHJpbnRmKHBhdGgsIHNpemVvZihwYXRoKSwgIiVzLyVzL2hlYWx0aCIsIFBPV0VSX1NVUFBMWV9QQVRILCBuYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoYWNjZXNzKHBhdGgsIFJfT0spID09IDApCisgICAgICAgICAgICAgICAgICAgIGdQYXRocy5iYXR0ZXJ5SGVhbHRoUGF0aCA9IHN0cmR1cChwYXRoKTsKKyAgICAgICAgICAgICAgICBzbnByaW50ZihwYXRoLCBzaXplb2YocGF0aCksICIlcy8lcy9wcmVzZW50IiwgUE9XRVJfU1VQUExZX1BBVEgsIG5hbWUpOworICAgICAgICAgICAgICAgIGlmIChhY2Nlc3MocGF0aCwgUl9PSykgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgZ1BhdGhzLmJhdHRlcnlQcmVzZW50UGF0aCA9IHN0cmR1cChwYXRoKTsKKyAgICAgICAgICAgICAgICBzbnByaW50ZihwYXRoLCBzaXplb2YocGF0aCksICIlcy8lcy9jYXBhY2l0eSIsIFBPV0VSX1NVUFBMWV9QQVRILCBuYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoYWNjZXNzKHBhdGgsIFJfT0spID09IDApCisgICAgICAgICAgICAgICAgICAgIGdQYXRocy5iYXR0ZXJ5Q2FwYWNpdHlQYXRoID0gc3RyZHVwKHBhdGgpOworCisgICAgICAgICAgICAgICAgc25wcmludGYocGF0aCwgc2l6ZW9mKHBhdGgpLCAiJXMvJXMvdm9sdGFnZV9ub3ciLCBQT1dFUl9TVVBQTFlfUEFUSCwgbmFtZSk7CisgICAgICAgICAgICAgICAgaWYgKGFjY2VzcyhwYXRoLCBSX09LKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGdQYXRocy5iYXR0ZXJ5Vm9sdGFnZVBhdGggPSBzdHJkdXAocGF0aCk7CisgICAgICAgICAgICAgICAgICAgIC8vIHZvbHRhZ2Vfbm93IGlzIGluIG1pY3Jvdm9sdHMsIG5vdCBtaWxsaXZvbHRzCisgICAgICAgICAgICAgICAgICAgIGdWb2x0YWdlRGl2aXNvciA9IDEwMDA7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc25wcmludGYocGF0aCwgc2l6ZW9mKHBhdGgpLCAiJXMvJXMvYmF0dF92b2wiLCBQT1dFUl9TVVBQTFlfUEFUSCwgbmFtZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChhY2Nlc3MocGF0aCwgUl9PSykgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGdQYXRocy5iYXR0ZXJ5Vm9sdGFnZVBhdGggPSBzdHJkdXAocGF0aCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc25wcmludGYocGF0aCwgc2l6ZW9mKHBhdGgpLCAiJXMvJXMvdGVtcCIsIFBPV0VSX1NVUFBMWV9QQVRILCBuYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoYWNjZXNzKHBhdGgsIFJfT0spID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZ1BhdGhzLmJhdHRlcnlUZW1wZXJhdHVyZVBhdGggPSBzdHJkdXAocGF0aCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc25wcmludGYocGF0aCwgc2l6ZW9mKHBhdGgpLCAiJXMvJXMvYmF0dF90ZW1wIiwgUE9XRVJfU1VQUExZX1BBVEgsIG5hbWUpOworICAgICAgICAgICAgICAgICAgICBpZiAoYWNjZXNzKHBhdGgsIFJfT0spID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICBnUGF0aHMuYmF0dGVyeVRlbXBlcmF0dXJlUGF0aCA9IHN0cmR1cChwYXRoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBzbnByaW50ZihwYXRoLCBzaXplb2YocGF0aCksICIlcy8lcy90ZWNobm9sb2d5IiwgUE9XRVJfU1VQUExZX1BBVEgsIG5hbWUpOworICAgICAgICAgICAgICAgIGlmIChhY2Nlc3MocGF0aCwgUl9PSykgPT0gMCkKKyAgIC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5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGRldmljZUlkLCBqaW50IGF4aXMsCkBAIC0yMDUsNiArMjIyLDIzIEBACiAgICAgcmV0dXJuIHN0OwogfQogCitzdGF0aWMgamludAorYW5kcm9pZF9zZXJ2ZXJfS2V5SW5wdXRRdWV1ZV9zY2FuY29kZVRvS2V5Y29kZShKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBkZXZpY2VJZCwgamludCBzY2FuY29kZSkKK3sKKyAgICBqaW50IHJlcyA9IDA7CisgICAgZ0xvY2subG9jaygpOworICAgIGlmIChnSHViICE9IE5VTEwpIHsKKyAgICAgICAgaW50MzJfdCBrZXljb2RlOworICAgICAgICB1aW50MzJfdCBmbGFnczsKKyAgICAgICAgZ0h1Yi0+c2NhbmNvZGVUb0tleWNvZGUoZGV2aWNlSWQsIHNjYW5jb2RlLCAma2V5Y29kZSwgJmZsYWdzKTsKKyAgICAgICAgcmVzID0ga2V5Y29kZTsKKyAgICB9CisgICAgZ0xvY2sudW5sb2NrKCk7CisgICAgCisgICAgcmV0dXJuIHJlczsKK30KKwogc3RhdGljIGpib29sZWFuCiBhbmRyb2lkX3NlcnZlcl9LZXlJbnB1dFF1ZXVlX2hhc0tleXMoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludEFycmF5IGtleUNvZGVzLCBqYm9vbGVhbkFycmF5IG91dEZsYWdzKQpAQCAtMjM4LDYgKzI3Miw4IEBACiAgICAgICAgICh2b2lkKikgYW5kcm9pZF9zZXJ2ZXJfS2V5SW5wdXRRdWV1ZV9nZXREZXZpY2VDbGFzc2VzIH0sCiAgICAgeyAiZ2V0RGV2aWNlTmFtZSIsICIoSSlMamF2YS9sYW5n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bnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCkucXVlcnkoCi0gICAgICAgICAgICAgICAgdXJpLCBuZXcgU3RyaW5nW117IENvbnRhY3RzLlBlb3BsZS5QaG9uZXMuTlVNQkVSIH0sCi0gICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgIC8vIENvcnJlY3RseSByZWFkIG91dCB0aGUgcGhvbmUgZW50cnkgYmFzZWQgb24gcmVxdWVzdGVkIHByb3ZpZGVyCisgICAgICAgIGZpbmFsIFN0cmluZyBhdXRob3JpdHkgPSB1cmkuZ2V0QXV0aG9yaXR5KCk7CisgICAgICAgIGlmIChDb250YWN0cy5BVVRIT1JJVFkuZXF1YWxzKGF1dGhvcml0eSkpIHsKKyAgICAgICAgICAgIHBob25lQ29sdW1uID0gQ29udGFjdHMuUGVvcGxlLlBob25lcy5OVU1CRVI7CisgICAgICAgIH0gZWxzZSBpZiAoQ29udGFjdHNDb250cmFjdC5BVVRIT1JJVFkuZXF1YWxzKGF1dGhvcml0eSkpIHsKKyAgICAgICAgICAgIHBob25lQ29sdW1uID0gQ29udGFjdHNDb250cmFjdC5Db21tb25EYXRhS2luZHMuUGhvbmUuTlVNQkVSOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgQ3Vyc29yIGMgPSBjb250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KHVyaSwgbmV3IFN0cmluZ1tdIHsKKyAgICAgICAgICAgIHBob25lQ29sdW1uCisgICAgICAgIH0sIG51bGwsIG51bGwsIG51bGwpOwogICAgICAgICBpZiAoYyAhPSBudWxsKSB7CiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIGlmIChjLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbnVtYmVyID0gYy5nZXRTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYy5nZXRDb2x1bW5JbmRleChDb250YWN0cy5QZW9wbGUuUGhvbmVzLk5VTUJFUikpOworICAgICAgICAgICAgICAgICAgICBudW1iZXIgPSBjLmdldFN0cmluZyhjLmdldENvbHVtbkluZGV4KHBob25lQ29sdW1uKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgICAgICBjLmNsb3NlKCk7CkBAIC0yMTgsNiArMjM1LDkgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIHZvaWQgbG9nKFN0cmluZyBtc2cpIHsKKyAgICAgICAgTG9nLmQoTE9HX1RBRywgbXNnKTsKKyAgICB9CiAgICAgLyoqIGluZGV4IG9mIHRoZSBsYXN0IGNoYXJhY3RlciBvZiB0aGUgbmV0d29yayBwb3J0aW9uCiAgICAgICogIChlZyBhbnl0aGluZyBhZnRlciBpcyBhIHBvc3QtZGlhbCBzdHJpbmcpCiAgICAgICovCkBAIC03MzIsNiArNzUyLDE0IEBACiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNOb25TZXBhcmF0b3IoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IDAsIGNvdW50ID0gYWRkcmVzcy5sZW5ndGgoKTsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIGlmICghaXNOb25TZXBhcmF0b3IoYWRkcmVzcy5jaGFyQXQoaSkpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KICAgICAvKioKICAgICAgKiBOb3RlOiBjYWxscyBleHRyYWN0TmV0d29ya1BvcnRpb24oKSwgc28gZG8gbm90IHVzZSBmb3IKICAgICAgKiBTSU0gRUZbQUROXSBzdHlsZSByZWNvcmRzCkBAIC05MDMsNyArOTMxLDcgQEAKICAgICAgICAgIkpNIiwgLy8gSmFtYWljYQogICAgICAgICAiUFIiLCAvLyBQdWVydG8gUmljbwogICAgICAgICAiTVMiLCAvLyBNb250c2VycmF0Ci0gICAgICAgICJOUCIsIC8vIE5vcnRoZXJuIE1hcmlhbmEgSXNsYW5kcworICAgICAgICAiTVAiLCAvLyBOb3J0aGVybiBNYXJpYW5hIElzbGFuZHMKICAgICAgICAgIktOIiwgLy8gU2FpbnQgS2l0dHMgYW5kIE5ldmlzCiAgICAgICAgICJMQyIsIC8vIFNhaW50IEx1Y2lhCiAgICAgICAgICJWQyIsIC8vIFNhaW50IFZpbmNlbnQgYW5kIHRoZSBHcmVuYWRpbmVzCkBAIC05MzYsMTcgKzk2NCw3IEBACiAgICAgcHVibGljIHN0YXRpYyBpbnQgZ2V0Rm9ybWF0VHlwZUZvckxvY2FsZShMb2NhbGUgbG9jYWxlKSB7CiAgICAgICAgIFN0cmluZyBjb3VudHJ5ID0gbG9jYWxlLmdldENvdW50cnkoKTsKIAotICAgICAgICAvLyBDaGVjayBmb3IgdGhlIE5BTlAgY291bnRyaWVzCi0gICAgICAgIGludCBsZW5ndGggPSBOQU5QX0NPVU5UUklFUy5sZW5ndGg7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgIGlmIChOQU5QX0NPVU5UUklFU1tpXS5lcXVhbHMoY291bnRyeSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRk9STUFUX05BTlA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGxvY2FsZS5lcXVhbHMoTG9jYWxlLkpBUEFOKSkgewotICAgICAgICAgICAgcmV0dXJuIEZPUk1BVF9KQVBBTjsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gRk9STUFUX1VOS05PV047CisgICAgICAgIHJldHVybiBnZXRGb3JtYXRUeXBlRnJvbUNvdW50cnlDb2RlKGNvdW50cnkpOwogICAgIH0KIAogICAgIC8qKgpAQCAtOTkwLDYgKzEwMDgsNyBAQAogICAgICAqIGFzOgogICAgICAqCiAgICAgICogPHA+PGNvZGU+CisgICAgICogeHh4eHgKICAgICAgKiB4eHgteHh4eAogICAgICAqIHh4eC14eHgteHh4eAogICAgICAqIDEteHh4LXh4eC14eHh4CkBAIC0xMDAzLDcgKzEwMjIsMTEgQEAKICAgICAgICAgaWYgKGxlbmd0aCA+ICIrMS1ubm4tbm5uLW5ubm4iLmxlbmd0aCgpKSB7CiAgICAgICAgICAgICAvLyBUaGUgc3RyaW5nIGlzIHRvbyBsb25nIHRvIGJlIGZvcm1hdHRlZAogICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9IGVsc2UgaWYgKGxlbmd0aCA8PSA1KSB7CisgICAgICAgICAgICAvLyBUaGUgc3RyaW5nIGlzIGVpdGhlciBhIHNob3J0Y29kZSBvciB0b28gc2hvcnQgdG8gYmUgZm9ybWF0dGVkCisgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KKwogICAgICAgICBDaGFyU2VxdWVuY2Ugc2F2ZWQgPSB0ZXh0LnN1YlNlcXVlbmNlKDAsIGxlbmd0aCk7CiAKICAgICAgICAgLy8gU3RyaXAgdGhlIGRhc2hlcyBmaXJzdCwgYXMgd2UncmUgZ29pbmcgdG8gYWRkIHRoZW0gYmFjawpAQCAtMTIxNSw0ICsxMjM4LDI4OCBAQAogICAgICAgICBLRVlQQURfTUFQLnB1dCgndycsICc5Jyk7IEtFWVBBRF9NQVAucHV0KCd4JywgJzknKTsgS0VZUEFEX01BUC5wdXQoJ3knLCAnOScpOyBLRVlQQURfTUFQLnB1dCgneicsICc5Jyk7CiAgICAgICAgIEtFWVBBRF9NQVAucHV0KCdXJywgJzknKTsgS0VZUEFEX01BUC5wdXQoJ1gnLCAnOScpOyBLRVlQQURfTUFQLnB1dCgnWScsICc5Jyk7IEtFWVBBRF9NQVAucHV0KCdaJywgJzknKTsKICAgICB9CisKKyAgICAvLz09PT09PT09PT09PT09PT0g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cGVuZGluZyBBUEkgQ291bmNpbCBhcHByb3ZhbAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGNkbWFDaGVja0FuZFByb2Nlc3NQbHVzQ29kZShTdHJpbmcgZGlhbFN0cikgeworICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGRpYWxTdHIpKSB7CisgICAgICAgICAgICBpZiAoaXNSZWFsbHlEaWFsYWJsZShkaWFsU3RyLmNoYXJBdCgwKSkgJiYKKyAgICAgICAgICAgICAgICBpc05vblNlcGFyYXRvcihkaWFsU3RyKSkgeworICAgICAgICAgICAgICAgIFN0cmluZyBjdXJySXNvID0gU3lzdGVtUHJvcGVydGllcy5nZXQoUFJPUEVSVFlfT1BFUkFUT1JfSVNPX0NPVU5UUlksICIiKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgZGVmYXVsdElzbyA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KFBST1BFUlRZX0lDQ19PUEVSQVRPUl9JU09fQ09VTlRSWSwgIiIpOworICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoY3VycklzbykgJiYgIVRleHRVdGlscy5pc0VtcHR5KGRlZmF1bHRJc28pKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjZG1hQ2hlY2tBbmRQcm9jZXNzUGx1c0NvZGVCeU51bWJlckZvcm1hdChkaWFsU3RyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldEZvcm1hdFR5cGVGcm9tQ291bnRyeUNvZGUoY3VycklzbyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Rm9ybWF0VHlwZUZyb21Db3VudHJ5Q29kZShkZWZhdWx0SXNvKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBkaWFsU3RyOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoaXMgZnVuY3Rpb24gc2hvdWxkIGJlIG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HBsaWVkCisgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbmV0d29ya0RpYWxTdHI7CisgICAgICAgICAgICAgICAgICAgIG5ldHdvcmtEaWFsU3RyID0gZXh0cmFjdE5ldHdvcmtQb3J0aW9uKHRlbXBEaWFsU3RyKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlcyB0aGUgY29udmVyc2lvbiB3aXRoaW4gTkFOUAorICAgICAgICAgICAgICAgICAgICBuZXR3b3JrRGlhbFN0ciA9IHByb2Nlc3NQbHVzQ29kZVdpdGhpbk5hbnAobmV0d29ya0RpYWxTdHIpOworCisgICAgICAgICAgICAgICAgICAgIC8vIENvbmNhdGVuYXRlcyB0aGUgc3RyaW5nIHRoYXQgaXMgY29udmVydGVkIGZyb20gbmV0d29yayBwb3J0aW9uCisgICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobmV0d29ya0RpYWxTdHIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmV0U3RyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXRTdHIgPSBuZXR3b3JrRGlhbFN0cjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0U3RyID0gcmV0U3RyLmNvbmNhdChuZXR3b3JrRGlhbFN0cik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIHNob3VsZCBuZXZlciBoYXBwZW4gc2luY2Ugd2UgY2hlY2tlZCB0aGUgaWYgZGlhbFN0ciBpcyBudWxsCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmQgaWYgaXQgY29udGFpbnMgdGhlIHBsdXMgc2lnbiBpbiB0aGUgYmVnaW5uaW5nIG9mIHRoaXMgZnVuY3Rpb24uCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgcGx1cyBzaWduIGlzIHBhcnQgb2YgdGhlIG5ldHdvcmsgcG9ydGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKCJjaGVja0FuZFByb2Nlc3NQbHVzQ29kZTogbnVsbCBuZXdEaWFsU3RyIiwgbmV0d29ya0RpYWxTdHIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRpYWxTdHI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcG9zdERpYWxTdHIgPSBleHRyYWN0UG9zdERpYWxQb3J0aW9uKHRlbXBEaWFsU3RyKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShwb3N0RGlhbFN0cikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaWFsYWJsZUluZGV4ID0gZmluZERpYWxhYmxlSW5kZXhGcm9tUG9zdERpYWxTdHIocG9zdERpYWxTdHIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBkaWFsYWJsZUluZGV4IHNob3VsZCBhbHdheXMgYmUgZ3JlYXRlciB0aGFuIDAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaWFsYWJsZUluZGV4ID49IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXRTdHIgPSBhcHBlbmRQd0NoYXJCYWNrVG9PcmlnRGlhbFN0cihkaWFsYWJsZUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldFN0cixwb3N0RGlhbFN0cik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2tpcHMgdGhlIFAvVyBjaGFyYWN0ZXIsIGV4dHJhY3RzIHRoZSBkaWFsYWJsZSBwb3J0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcERpYWxTdHIgPSBwb3N0RGlhbFN0ci5zdWJzdHJpbmcoZGlhbGFibGVJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vbi1kaWFsYWJsZSBjaGFyYWN0ZXIgc3VjaCBhcyBQL1cgc2hvdWxkIG5vdCBiZSBhdCB0aGUgZW5kIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGRpYWwgc3RyaW5nIGFmdGVyIFAvVyBwcm9jZXNzaW5nIGluIENkbWFDb25uZWN0aW9uLmphdmEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTZXQgdGhlIHBvc3REaWFsU3RyIHRvICIiIHRvIGJyZWFrIG91dCBvZiB0aGUgbG9vcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaWFsYWJsZUluZGV4IDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0RGlhbFN0ciA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZSgid3JvbmcgcG9zdERpYWxTdHI9IiwgcG9zdERpYWxTdHIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIGxvZygiY2hlY2tBbmRQcm9jZXNzUGx1c0NvZGUscG9zdERpYWxTdHI9IiArIHBvc3REaWFsU3RyKTsKKyAgICAgICAgICAgICAgICB9IHdoaWxlICghVGV4dFV0aWxzLmlzRW1wdHkocG9zdERpYWxTdHIpICYmICFUZXh0VXRpbHMuaXNFbXB0eSh0ZW1wRGlhbFN0cikpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBUT0RPOiBTdXBwb3J0IE5BTlAgaW50ZXJuYXRpb25hbCBjb252ZXJzaW9uIGFuZCBvdGhlciB0ZWxlcGhvbmUgbnVtYmVyaW5nIHBsYW5zLgorICAgICAgICAgICAgICAgIC8vIEN1cnJlbnRseSB0aGUgcGhvbmUgaXMgbmV2ZXIgdXNlZCBpbiBub24tTkFOUCBzeXN0ZW0sIHNvIHJldHVybiB0aGUgb3JpZ2luYWwKKyAgICAgICAgICAgICAgICAvLyBkaWFsIHN0cmluZy4KKyAgICAgICAgICAgICAgICBMb2cuZSgiY2hlY2tBbmRQcm9jZXNzUGx1c0NvZGU6bm9uLU5BTlAgbm90IHN1cHBvcnRlZCIsIGRpYWxTdHIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiByZXRTdHI7CisgICAgIH0KKworICAgIC8vIFRoaXMgZnVuY3Rpb24gZ2V0cyB0aGUgZGVmYXVsdCBpbnRlcm5hdGlvbmFsIGRpYWxpbmcgcHJlZml4CisgICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIGdldERlZmF1bHRJZHAoICkgeworICAgICAgICBTdHJpbmcgcHMgPSBudWxsOworICAgICAgICBTeXN0ZW1Qcm9wZXJ0aWVzLmdldChQUk9QRVJUWV9JRFBfU1RSSU5HLCBwcyk7CisgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShwcykpIHsKKyAgICAgICAgICAgIHBzID0gTkFOUF9JRFBfU1RSSU5HOworICAgICAgICB9CisgICAgICAgIHJldHVybiBwczsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzVHdvVG9OaW5lIChjaGFyIGMpIHsKKyAgICAgICAgaWYgKGMgPj0gJzInICYmIGMgPD0gJzknKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGludCBnZXRGb3JtYXRUeXBlRnJvbUNvdW50cnlDb2RlIChTdHJpbmcgY291bnRyeSkgeworICAgICAgICAvLyBDaGVjayBmb3IgdGhlIE5BTlAgY291bnRyaWVzCisgICAgICAgIGludCBsZW5ndGggPSBOQU5QX0NPVU5UUklFUy5sZW5ndGg7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIGlmIChOQU5QX0NPVU5UUklFU1tpXS5jb21wYXJlVG9JZ25vcmVDYXNlKGNvdW50cnkpID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gRk9STUFUX05BTlA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKCJqcCIuY29tcGFyZVRvSWdub3JlQ2FzZShjb3VudHJ5KSA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gRk9STUFUX0pBUEFOOworICAgICAgICB9CisgICAgICAgIHJldHVybiBGT1JNQVRfVU5LTk9XTjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGZ1bmN0aW9uIGNoZWNrcyBpZiB0aGUgcGFzc2VkIGluIHN0cmluZyBjb25mb3JtcyB0byB0aGUgTkFOUCBmb3JtYXQKKyAgICAgKiBpLmUuIE5YWC1OWFgtWFhYWCwgTiBpcyBhbnkgZGlnaXQgMi05IGFuZCBYIGlzIGFueSBkaWdpdCAwLTkKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzTmFucCAoU3RyaW5nIGRpYWxTdHIpIHsKKyAgICAgICAgYm9vbGVhbiByZXRWYWwgPSBmYWxzZTsKKyAgICAgICAgaWYgKGRpYWxTdHIgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKGRpYWxTdHIubGVuZ3RoKCkgPT0gTkFOUF9MRU5HVEgpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNUd29Ub05pbmUoZGlhbFN0ci5jaGFyQXQoMCkpICYmCisgICAgICAgICAgICAgICAgICAgIGlzVHdvVG9OaW5lKGRpYWxTdHIuY2hhckF0KDMpKSkgeworICAgICAgICAgICAgICAgICAgICByZXRWYWwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpPTE7IGk8TkFOUF9MRU5HVEg7IGkrKyApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgYz1kaWFsU3RyLmNoYXJBdChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghUGhvbmVOdW1iZXJVdGlscy5pc0lTT0RpZ2l0KGMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0VmFsID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMb2cuZSgiaXNOYW5wOiBudWxsIGRpYWxTdHIgcGFzc2VkIGluIiwgZGlhbFN0cik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJldFZhbDsKKyAgICB9CisKKyAgIC8qKgorICAgICogVGhpcyBmdW5jdGlvbiBjaGVja3MgaWYgdGhlIHBhc3NlZCBpbiBzdHJpbmcgY29uZm9ybXMgdG8gMS1OQU5QIGZvcm1hdAorICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBpc09uZU5hbnAoU3RyaW5nIGRpYWxTdHIpIHsKKyAgICAgICAgYm9vbGVhbiByZXRWYWwgPSBmYWxzZTsKKyAgICAgICAgaWYgKGRpYWxTdHIgIT0gbnVsbCkgeworICAgICAgICAgICAgU3RyaW5nIG5ld0RpYWxTdHIgPSBkaWFsU3RyLnN1YnN0cmluZygxKTsKKyAgICAgICAgICAgIGlmICgoZGlhbFN0ci5jaGFyQXQoMCkgPT0gJzEnKSAmJiBpc05hbnAobmV3RGlhbFN0cikpIHsKKyAgICAgICAgICAgICAgICByZXRWYWwgPSB0cnVlOworICAgICAgICAgICAgfQor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EaWFsU3RyLmxlbmd0aCgpID4gMSkgeworICAgICAgICAgICAgU3RyaW5nIG5ld1N0ciA9IG5ldHdvcmtEaWFsU3RyLnN1YnN0cmluZygxKTsKKyAgICAgICAgICAgIGlmIChpc09uZU5hbnAobmV3U3RyKSkgeworICAgICAgICAgICAgICAgIC8vIFJlbW92ZSB0aGUgbGVhZGluZyBwbHVzIHNpZ24KKyAgICAgICAgICAgICAgICByZXRTdHIgPSBuZXdTdHI7CisgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgU3RyaW5nIGlkcFN0ciA9IGdldERlZmF1bHRJZHAoKTsKKyAgICAgICAgICAgICAgICAgLy8gUmVwbGFjZXMgdGhlIHBsdXMgc2lnbiB3aXRoIHRoZSBkZWZhdWx0IElEUAorICAgICAgICAgICAgICAgICByZXRTdHIgPSBuZXR3b3JrRGlhbFN0ci5yZXBsYWNlRmlyc3QoIlsrXSIsIGlkcFN0cik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKERCRykgbG9nKCJwcm9jZXNzUGx1c0NvZGVXaXRoaW5OYW5wLHJldFN0cj0iICsgcmV0U3RyKTsKKyAgICAgICAgcmV0dXJuIHJldFN0cjsKKyAgICB9CisKKyAgICAvLyBUaGlzIGZ1bmN0aW9uIGZpbmRzIHRoZSBpbmRleCBvZiB0aGUgZGlhbGFibGUgY2hhcmFjdGVyKHMpCisgICAgLy8gaW4gdGhlIHBvc3QgZGlhbCBzdHJpbmcKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgZmluZERpYWxhYmxlSW5kZXhGcm9tUG9zdERpYWxTdHIoU3RyaW5nIHBvc3REaWFsU3RyKSB7CisgICAgICAgIGZvciAoaW50IGluZGV4ID0gMDtpbmRleCA8IHBvc3REaWFsU3RyLmxlbmd0aCgpO2luZGV4KyspIHsKKyAgICAgICAgICAgICBjaGFyIGMgPSBwb3N0RGlhbFN0ci5jaGFyQXQoaW5kZXgpOworICAgICAgICAgICAgIGlmIChpc1JlYWxseURpYWxhYmxlKGMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGluZGV4OworICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgLy8gVGhpcyBmdW5jdGlvbiBhcHBlbmRzIHRoZSBub24tZGlhYmxhYmxlIFAvVyBjaGFyYWN0ZXIgdG8gdGhlIG9yaWdpbmFsCisgICAgLy8gZGlhbCBzdHJpbmcgYmFzZWQgb24gdGhlIGRpYWxhYmxlIGluZGV4IHBhc3NlZCBpbgorICAgIHByaXZhdGUgc3RhdGljIFN0cmluZworICAgIGFwcGVuZFB3Q2hhckJhY2tUb09yaWdEaWFsU3RyKGludCBkaWFsYWJsZUluZGV4LFN0cmluZyBvcmlnU3RyLCBTdHJpbmcgZGlhbFN0cikgeworICAgICAgICBTdHJpbmcgcmV0U3RyOworCisgICAgICAgIC8vIFRoZXJlIGlzIG9ubHkgMSBQL1cgY2hhcmFjdGVyIGJlZm9yZSB0aGUgZGlhbGFibGUgY2hhcmFjdGVycworICAgICAgICBpZiAoZGlhbGFibGVJbmRleCA9PSAxKSB7CisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHJldCA9IG5ldyBTdHJpbmdCdWlsZGVyKG9yaWdTdHIpOworICAgICAgICAgICAgcmV0ID0gcmV0LmFwcGVuZChkaWFsU3RyLmNoYXJBdCgwKSk7CisgICAgICAgICAgICByZXRTdHIgPSByZXQudG9TdHJpbmcoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIEl0IG1lYW5zIG1vcmUgdGhhbiAxIFAvVyBjaGFyYWN0ZXJzIGluIHRoZSBwb3N0IGRpYWwgc3RyaW5nLAorICAgICAgICAgICAgLy8gYXBwZW5kcyB0byByZXRTdHIKKyAgICAgICAgICAgIFN0cmluZyBub25EaWdpdFN0ciA9IGRpYWxTdHIuc3Vic3RyaW5nKDAsZGlhbGFibGVJbmRleCk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MgZGVsaXZlcmVkIHRvIHRoZSByZWNpcGllbnQuICBUaGUKLSAgICAgKiAgcmF3IHBkdSBvZiB0aGUgc3RhdHVzIHJlcG9ydCBpcyBpbiB0aGUgZXh0ZW5kZWQgZGF0YSAoInBkdSIpLgotICAgICAqLwotICAgIHByaXZhdGUgdm9pZCBzZW5kUmF3UGR1KGJ5dGVbXSBzbXNjLCBieXRlW10gcGR1LCBQZW5kaW5nSW50ZW50IHNlbnRJbnRlbnQsCi0gICAgICAgICAgICBQZW5kaW5nSW50ZW50IGRlbGl2ZXJ5SW50ZW50KSB7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBJU21zIGljY0lTbXMgPSBJU21zLlN0dWIuYXNJbnRlcmZhY2UoU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZSgiaXNtcyIpKTsKICAgICAgICAgICAgIGlmIChpY2NJU21zICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBpY2NJU21zLnNlbmRSYXdQZHUoc21zYywgcGR1LCBzZW50SW50ZW50LCBkZWxpdmVyeUludGVudCk7CisgICAgICAgICAgICAgICAgaWNjSVNtcy5zZW5kRGF0YShkZXN0aW5hdGlvbkFkZHJlc3MsIHNjQWRkcmVzcywgZGVzdGluYXRpb25Qb3J0ICYgMHhGRkZGLAorICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwgc2VudEludGVudCwgZGVsaXZlcnlJbnRlbnQpOwogICAgICAgICAgICAgfQogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgIC8vIGlnbm9yZSBpdApAQCAtNDA5LDQgKzM5NCw2IEBACiAgICAgc3RhdGljIHB1YmxpYyBmaW5hbCBpbnQgUkVTVUxUX0VSUk9SX05VTExfUERVICAgICAgICAgICA9IDM7CiAgICAgLyoqIEZhaWxlZCBiZWNhdXNlIHNlcnZpY2UgaXMgY3VycmVudGx5IHVuYXZhaWxhYmxlICovCiAgICAgc3RhdGljIHB1Ym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GF0aWMgZmluYWwgaW50IE5FVFdPUktfVFlQRV9IU1BBID0gMTA7CiAKICAgICAvKioKICAgICAgKiBSZXR1cm5zIGEgY29uc3RhbnQgaW5kaWNhdGluZyB0aGUgcmFkaW8gdGVjaG5vbG9neSAobmV0d29yayB0eXBlKQpAQCAtMzkyLDM1ICs0MDEsMjUgQEAKICAgICAgKiBAc2VlICNORVRXT1JLX1RZUEVfR1BSUwogICAgICAqIEBzZWUgI05FVFdPUktfVFlQRV9FREdFCiAgICAgICogQHNlZSAjTkVUV09SS19UWVBFX1VNVFMKKyAgICAgKiBAc2VlICNORVRXT1JLX1RZUEVfSFNEUEEKKyAgICAgKiBAc2VlICNORVRXT1JLX1RZUEVfSFNVUEEKKyAgICAgKiBAc2VlICNORVRXT1JLX1RZUEVfSFNQQQogICAgICAqIEBzZWUgI05FVFdPUktfVFlQRV9DRE1BCiAgICAgICogQHNlZSAjTkVUV09SS19UWVBFX0VWRE9fMAogICAgICAqIEBzZWUgI05FVFdPUktfVFlQRV9FVkRPX0EKICAgICAgKiBAc2VlICNORVRXT1JLX1RZUEVfMXhSVFQKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldE5ldHdvcmtUeXBlKCkgewotICAgICAgICBTdHJpbmcgcHJvcCA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfREFUQV9ORVRXT1JLX1RZUEUpOwotICAgICAgICBpZiAoIkdQUlMiLmVxdWFscyhwcm9wKSkgewotICAgICAgICAgICAgcmV0dXJuIE5FVFdPUktfVFlQRV9HUFJTOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKCJFREdFIi5lcXVhbHMocHJvcCkpIHsKLSAgICAgICAgICAgIHJldHVybiBORVRXT1JLX1RZUEVfRURHRTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICgiVU1UUyIuZXF1YWxzKHByb3ApKSB7Ci0gICAgICAgICAgICByZXR1cm4gTkVUV09SS19UWVBFX1VNVFM7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIkNETUEiLmVxdWFscyhwcm9wKSkgewotICAgICAgICAgICAgcmV0dXJuIE5FVFdPUktfVFlQRV9DRE1BOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIkNETUEgLSBFdkRvIHJldi4gMCIuZXF1YWxzKHByb3ApKSB7Ci0gICAgICAgICAgICByZXR1cm4gTkVUV09SS19UWVBFX0VWRE9fMDsKKyAgICAgICAgdHJ5eworICAgICAgICAgICAgSVRlbGVwaG9ueSB0ZWxlcGhvbnkgPSBnZXRJVGVsZXBob255KCk7CisgICAgICAgICAgICBpZiAodGVsZXBob255ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdGVsZXBob255LmdldE5ldHdvcmtUeXBlKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIFRoaXMgY2FuIGhhcHBlbiB3aGVuIHRoZSBJVGVsZXBob255IGludGVyZmFjZSBpcyBub3QgdXAgeWV0LgorICAgICAgICAgICAgICAgIHJldHVybiBORVRXT1JLX1RZUEVfVU5LTk9XTjsKICAgICAgICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIkNETUEgLSBFdkRvIHJldi4gQSIuZXF1YWxzKHByb3ApKSB7Ci0gICAgICAgICAgICByZXR1cm4gTkVUV09SS19UWVBFX0VWRE9fQTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIkNETUEgLSAxeFJUVCIuZXF1YWxzKHByb3ApKSB7Ci0gICAgICAgICAgICByZXR1cm4gTkVUV09SS19UWVBFXzF4UlRUOwotICAgICAgICAgICAgfQotICAgICAgICBlbHNlIHsKKyAgICAgICAgfSBjYXRjaChSZW1vdGVFeGNlcHRpb24gZXgpeworICAgICAgICAgICAgLy8gVGhpcyBzaG91bGRuJ3QgaGFwcGVuIGluIHRoZSBub3JtYWwgY2FzZQogICAgICAgICAgICAgcmV0dXJuIE5FVFdPUktfVFlQRV9VTktOT1dOOwogICAgICAgICB9CiAgICAgfQpAQCAtNDQwLDYgKzQzOSwxMiBAQAogICAgICAgICAgICAgICAgIHJldHVybiAiRURHRSI7CiAgICAgICAgICAgICBjYXNlIE5FVFdPUktfVFlQRV9VTVRTOgogICAgICAgICAgICAgICAgIHJldHVybiAiVU1UUyI7CisgICAgICAgICAgICBjYXNlIE5FVFdPUktfVFlQRV9IU0RQQToKKyAgICAgICAgICAgICAgICByZXR1cm4gIkhTRFBBIjsKKyAgICAgICAgICAgIGNhc2UgTkVUV09SS19UWVBFX0hTVVBBOgorICAgICAgICAgICAgICAgIHJldHVybiAiSFNVUEEiOworICAgICAgICAgICAgY2FzZSBORVRXT1JLX1RZUEVfSFNQQToKKyAgICAgICAgICAgICAgICByZXR1cm4gIkhTUEEiOwogICAgICAgICAgICAgY2FzZSBORVRXT1JLX1RZUEVfQ0RNQToKICAgICAgICAgICAgICAgICByZXR1cm4gIkNETUEiOwogICAgICAgICAgICAgY2FzZSBORVRXT1JLX1RZUEVfRVZET18wOgpAQCAtNDc2LDYgKzQ4MSwxOCBAQAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNJTV9TVEFURV9SRUFEWSA9IDU7CiAKICAgICAvKioKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgYSBJQ0MgY2FyZCBpcyBwcmVzZW50CisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaGFzSWNjQ2FyZCgpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBnZXRJVGVsZXBob255KCkuaGFzSWNjQ2FyZCgpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgIC8vIEFzc3VtZSBubyBJQ0MgY2FyZCBpZiByZW1vdGUgZXhjZXB0aW9uIHdoaWNoIHNob3VsZG4ndCBoYXBwZW4KKyAgICAgICAgICAgI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cGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvQWRuUmVjb3JkLmphdmEgYi90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvQWRuUmVjb3JkLmphdmEKaW5kZXggNWY0MDU3OS4uMDg5NmJhNiAxMDA2NDQKLS0tIGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0FkblJlY29yZC5qYXZhCisrKyBiL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9BZG5SZWNvcmQuamF2YQpAQCAtMjMsNiArMjMsOCBAQAogCiBpbXBvcnQgY29tLmFuZHJvaWQuaW50ZXJuYWwudGVsZXBob255LkdzbUFscGhhYmV0OwogCitpbXBvcnQgamF2YS51dGlsLkFycmF5czsKKwogCiAvKioKICAqCkBAIC0zOCw2ICs0MCw3IEBACiAKICAgICBTdHJpbmcgYWxwaGFUYWcgPSAiIjsKICAgICBTdHJpbmcgbnVtYmVyID0gIiI7CisgICAgU3RyaW5nW10gZW1haWxzOwogICAgIGludCBleHRSZWNvcmQgPSAweGZmOwogICAgIGludCBlZmlkOyAgICAgICAgICAgICAgICAgICAvLyBvciAwIGlmIG5vbmUKICAgICBpbnQgcmVjb3JkTnVtYmVyOyAgICAgICAgICAgLy8gb3IgMCBpZiBub25lCkBAIC03NCwxMyArNzcsMTUgQEAKICAgICAgICAgICAgIGludCByZWNvcmROdW1iZXI7CiAgICAgICAgICAgICBTdHJpbmcgYWxwaGFUYWc7CiAgICAgICAgICAgICBTdHJpbmcgbnVtYmVyOworICAgICAgICAgICAgU3RyaW5nW10gZW1haWxzOwogCiAgICAgICAgICAgICBlZmlkID0gc291cmNlLnJlYWRJbnQoKTsKICAgICAgICAgICAgIHJlY29yZE51bWJlciA9IHNvdXJjZS5yZWFkSW50KCk7CiAgICAgICAgICAgICBhbHBoYVRhZyA9IHNvdXJjZS5yZWFkU3RyaW5nKCk7CiAgICAgICAgICAgICBudW1iZXIgPSBzb3VyY2UucmVhZFN0cmluZygpOworICAgICAgICAgICAgZW1haWxzID0gc291cmNlLnJlYWRTdHJpbmdBcnJheSgpOwogCi0gICAgICAgICAgICByZXR1cm4gbmV3IEFkblJlY29yZChlZmlkLCByZWNvcmROdW1iZXIsIGFscGhhVGFnLCBudW1iZXIpOworICAgICAgICAgICAgcmV0dXJuIG5ldyBBZG5SZWNvcmQoZWZpZCwgcmVjb3JkTnVtYmVyLCBhbHBoYVRhZywgbnVtYmVyLCBlbWFpbHMpOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIEFkblJlY29yZFtdIG5ld0FycmF5KGludCBzaXplKSB7CkBAIC05MCwyOSArOTUsMzggQEAKIAogCiAgICAgLy8qKioqKiBDb25zdHJ1Y3RvcgotICAgIHB1YmxpYwotICAgIEFkblJlY29yZCAoYnl0ZVtdIHJlY29yZCkgeworICAgIHB1YmxpYyBBZG5SZWNvcmQgKGJ5dGVbXSByZWNvcmQpIHsKICAgICAgICAgdGhpcygwLCAwLCByZWNvcmQpOwogICAgIH0KIAotICAgIHB1YmxpYwotICAgIEFkblJlY29yZCAoaW50IGVmaWQsIGludCByZWNvcmROdW1iZXIsIGJ5dGVbXSByZWNvcmQpIHsKKyAgICBwdWJsaWMgQWRuUmVjb3JkIChpbnQgZWZpZCwgaW50IHJlY29yZE51bWJlciwgYnl0ZVtdIHJlY29yZCkgewogICAgICAgICB0aGlzLmVmaWQgPSBlZmlkOwogICAgICAgICB0aGlzLnJlY29yZE51bWJlciA9IHJlY29yZE51bWJlcjsKICAgICAgICAgcGFyc2VSZWNvcmQocmVjb3JkKTsKICAgICB9CiAKLSAgICBwdWJsaWMKLSAgICBBZG5SZWNvcmQgKFN0cmluZyBhbHBoYVRhZywgU3RyaW5nIG51bWJlcikgeworICAgIHB1YmxpYyBBZG5SZWNvcmQgKFN0cmluZyBhbHBoYVRhZywgU3RyaW5nIG51bWJlcikgewogICAgICAgICB0aGlzKDAsIDAsIGFscGhhVGFnLCBudW1iZXIpOwogICAgIH0KIAotICAgIHB1YmxpYwotICAgIEFkblJlY29yZCAoaW50IGVmaWQsIGludCByZWNvcmROdW1iZXIsIFN0cmluZyBhbHBoYVRhZywgU3RyaW5nIG51bWJlcikgeworICAgIHB1YmxpYyBBZG5SZWNvcmQgKFN0cmluZyBhbHBoYVRhZywgU3RyaW5nIG51bWJlciwgU3RyaW5nW10gZW1haWxzKSB7CisgICAgICAgIHRoaXMoMCwgMCwgYWxwaGFUYWcsIG51bWJlciwgZW1haWxzKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQWRuUmVjb3JkIChpbnQgZWZpZCwgaW50IHJlY29yZE51bWJlciwgU3RyaW5nIGFscGhhVGFnLCBTdHJpbmcgbnVtYmVyLCBTdHJpbmdbXSBlbWFpbHMpIHsKICAgICAgICAgdGhpcy5lZmlkID0gZWZpZDsKICAgICAgICAgdGhpcy5yZWNvcmROdW1iZXIgPSByZWNvcmROdW1iZXI7CiAgICAgICAgIHRoaXMuYWxwaGFUYWcgPSBhbHBoYVRhZzsKICAgICAgICAgdGhpcy5udW1iZXIgPSBudW1iZXI7CisgICAgICAgIHRoaXMuZW1haWxzID0gZW1haWxzOworICAgIH0KKworICAgIHB1YmxpYyBBZG5SZWNvcmQoaW50IGVmaWQsIGludCByZWNvcmROdW1iZXIsIFN0cmluZyBhbHBoYVRhZywgU3RyaW5nIG51bWJlcikgeworICAgICAgICB0aGlzLmVmaWQgPSBlZmlkOworICAgICAgICB0aGlzLnJlY29yZE51bWJlciA9IHJlY29yZE51bWJlcjsKKyAgICAgICAgdGhpcy5hbHBoYVRhZyA9IGFscGhhVGFnOworICAgICAgICB0aGlzLm51bWJlciA9IG51bWJlcjsKKyAgICAgICAgdGhpcy5lbWFpbHMgPSBudWxsOwogICAgIH0KIAogICAgIC8vKioqKiogSW5zdGFuY2UgTWV0aG9kcwpAQCAtMTI1LDEyICsxMzksMjAgQEAKICAgICAgICAgcmV0dXJuIG51bWJlcjsKICAgICB9CiAKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0RW1haWxzKCkgeworICAgICAgICByZXR1cm4gZW1haWxzOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEVtYWlscyhTdHJpbmdbXSBlbWFpbHMpIHsKKyAgICAgICAgdGhpcy5lbWFpbHMgPSBlbWFpbHM7CisgICAgfQorCiAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKLSAgICAgICAgcmV0dXJuICJBRE4gUmVjb3JkICciICsgYWxwaGFUYWcgKyAiJyAnIiArIG51bWJlciArICInIjsKKyAgICAgICAgcmV0dXJuICJBRE4gUmVjb3JkICciICsgYWxwaGFUYWcgKyAiJyAnIiArIG51bWJlciArICIgIiArIGVtYWlscyArICInIjsKICAgICB9CiAKICAgICBwdWJsaWMgYm9vbGVhbiBpc0VtcHR5KCkgewotICAgICAgICByZXR1cm4gYWxwaGFUYWcuZXF1YWxzKCIiKSAmJiBudW1iZXIuZXF1YWxzKCIiKTsKKyAgICAgICAgcmV0dXJuIGFscGhhVGFnLmVxdWFscygiIikgJiYgbnVtYmVyLmVxdWFscygiIikgJiYgZW1haWxzID09IG51bGw7CiAgICAgfQogCiAgICAgcHVibGljIGJvb2xlYW4gaGFzRXh0ZW5kZWRSZWNvcmQoKSB7CkBAIC0xMzksNyArMTYxLDggQEAKIAogICAgIHB1YmxpYyBib29sZWFuIGlzRXF1YWwoQWRuUmVjb3JkIGFkbikgewogICAgICAgICByZXR1cm4gKCBhbHBoYVRhZy5lcXVhbHMoYWRuLmdldEFscGhhVGFnKCkpICYmCi0gICAgICAgICAgICAgICAgbnVtYmVyLmVxdWFscyhhZG4uZ2V0TnVtYmVyKCkpICk7CisgICAgICAgICAgICAgICAgbnVtYmVyLmVxdWFscyhhZG4uZ2V0TnVtYmVyKCkpICYmCisgICAgICAgICAgICAgICAgQXJyYXlzLmVxdWFscyhlb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iA8IDApIHsKICAgICAgICAgICAgIC8vIHJlc3BvbmQgd2l0aCBlcnJvciBpZiBub3Qga25vd24gQUROLWxpa2UgcmVjb3JkCiAKICAgICAgICAgICAgIGlmIChyZXNwb25zZSAhPSBudWxsKSB7CkBAIC0yNzIsNyArMjgwLDcgQEAKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCi0gICAgICAgIG5ldyBBZG5SZWNvcmRMb2FkZXIocGhvbmUpLmxvYWRBbGxGcm9tRUYoZWZpZCwgZXh0ZW5zaW9uRUYsCisgICAgICAgIG5ldyBBZG5SZWNvcmRMb2FkZXIocGhvbmUpLmxvYWRBbGxGcm9tRUYoZWZpZCwgZXh0ZW5zaW9uRWYsCiAgICAgICAgICAgICBvYnRhaW5NZXNzYWdlKEVWRU5UX0xPQURfQUxMX0FETl9MSUtFX0RPTkUsIGVmaWQsIDApKTsKICAgICB9CiAKQEAgLTMxMSw3ICszMTksNyBAQAogICAgICAgICAgICAgICAgIGFkbkxpa2VXYWl0ZXJzLmRlbGV0ZShlZmlkKTsKIAogICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBhZG5MaWtlRmlsZXMucHV0KGVmaWQsIChBcnJheUxpc3Q8QWRuUmVjb3JkPikgKGFyLnJlc3VsdCkpOworICAgICAgICAgICAgICAgICAgICBhZG5MaWtlRmlsZXMucHV0KGVmaWQsIChBcnJheUxpc3Q8QWRuUmVjb3JkPikgYXIucmVzdWx0KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgbm90aWZ5V2FpdGVycyh3YWl0ZXJzLCBhcik7CiAgICAgICAgICAgICAgICAgYnJlYWs7CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvQ2FsbC5qYXZhIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvd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QVlfTkFNRSk7CiAgICAgICAgICAgICAgICAgaWYgKGNvbHVtbkluZGV4ICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgIGluZm8ubmFtZSA9IGN1cnNvci5nZXRTdHJpbmcoY29sdW1uSW5kZXgpOwogICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIC8vIExvb2sgZm9yIHRoZSBudW1iZXIKLSAgICAgICAgICAgICAgICBjb2x1bW5JbmRleCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChQaG9uZXMuTlVNQkVSKTsKKyAgICAgICAgICAgICAgICBjb2x1bW5JbmRleCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChQaG9uZUxvb2t1cC5OVU1CRVIpOwogICAgICAgICAgICAgICAgIGlmIChjb2x1bW5JbmRleCAhPSAtMSkgewogICAgICAgICAgICAgICAgICAgICBpbmZvLnBob25lTnVtYmVyID0gY3Vyc29yLmdldFN0cmluZyhjb2x1bW5JbmRleCk7CiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgLy8gTG9vayBmb3IgdGhlIGxhYmVsL3R5cGUgY29tYm8KLSAgICAgICAgICAgICAgICBjb2x1bW5JbmRleCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChQaG9uZXMuTEFCRUwpOworICAgICAgICAgICAgICAgIGNvbHVtbkluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4KFBob25lTG9va3VwLkxBQkVMKTsKICAgICAgICAgICAgICAgICBpZiAoY29sdW1uSW5kZXggIT0gLTEpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IHR5cGVDb2x1bW5JbmRleCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChQaG9uZXMuVFlQRSk7CisgICAgICAgICAgICAgICAgICAgIGludCB0eXBlQ29sdW1uSW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXgoUGhvbmVMb29rdXAuVFlQRSk7CiAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlQ29sdW1uSW5kZXggIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubnVtYmVyVHlwZSA9IGN1cnNvci5nZXRJbnQodHlwZUNvbHVtbkluZGV4KTsKICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubnVtYmVyTGFiZWwgPSBjdXJzb3IuZ2V0U3RyaW5nKGNvbHVtbkluZGV4KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGhvbmVMYWJlbCA9IENvbnRhY3RzLlBob25lcy5nZXREaXNwbGF5TGFiZWwoY29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGhvbmVMYWJlbCA9IFBob25lLmdldERpc3BsYXlMYWJlbChjb250ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLm51bWJlclR5cGUsIGluZm8ubnVtYmVyTGFiZWwpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50b1N0cmluZygpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgLy8gTG9vayBmb3IgdGhlIHBlcnNvbiBJRAotICAgICAgICAgICAgICAgIGNvbHVtbkluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4KFBob25lcy5QRVJTT05fSUQpOworICAgICAgICAgICAgICAgIGNvbHVtbkluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4KFBob25lTG9va3VwLl9JRCk7CiAgICAgICAgICAgICAgICAgaWYgKGNvbHVtbkluZGV4ICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgIGluZm8ucGVyc29uX2lkID0gY3Vyc29yLmdldExvbmcoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbHVtbkluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4KFBlb3BsZS5fSUQpOwotICAgICAgICAgICAgICAgICAgICBpZiAoY29sdW1uSW5kZXggIT0gLTEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGVyc29uX2lkID0gY3Vyc29yLmdldExvbmcoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgLy8gbG9vayBmb3IgdGhlIGN1c3RvbSByaW5ndG9uZSwgY3JlYXRlIGZyb20gdGhlIHN0cmluZyBzdG9yZWQKICAgICAgICAgICAgICAgICAvLyBpbiB0aGUgZGF0YWJhc2UuCi0gICAgICAgICAgICAgICAgY29sdW1uSW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXgoUGVvcGxlLkNVU1RPTV9SSU5HVE9ORSk7CisgICAgICAgICAgICAgICAgY29sdW1uSW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXgoUGhvbmVMb29rdXAuQ1VTVE9NX1JJTkdUT05FKTsKICAgICAgICAgICAgICAgICBpZiAoKGNvbHVtbkluZGV4ICE9IC0xKSAmJiAoY3Vyc29yLmdldFN0cmluZyhjb2x1bW5JbmRleCkgIT0gbnVsbCkpIHsKICAgICAgICAgICAgICAgICAgICAgaW5mby5jb250YWN0UmluZ3RvbmVVcmkgPSBVcmkucGFyc2UoY3Vyc29yLmdldFN0cmluZyhjb2x1bW5JbmRleCkpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC0xODAsNyArMTc0LDcgQEAKIAogICAgICAgICAgICAgICAgIC8vIGxvb2sgZm9yIHRoZSBzZW5kIHRvIHZvaWNlbWFpbCBmbGFnLCBzZXQgaXQgdG8gdHJ1ZSBvbmx5CiAgICAgICAgICAgICAgICAgLy8gdW5kZXIgY2VydGFpbiBjaXJjdW1zdGFuY2VzLgotICAgICAgICAgICAgICAgIGNvbHVtbkluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4KFBlb3BsZS5TRU5EX1RPX1ZPSUNFTUFJTCk7CisgICAgICAgICAgICAgICAgY29sdW1uSW5kZXggPSBjdXJzb3IuZ2V0Q29sdW1uSW5kZXgoUGhvbmVMb29rdXAuU0VORF9UT19WT0lDRU1BSUwpOwogICAgICAgICAgICAgICAgIGluZm8uc2hvdWxkU2VuZFRvVm9pY2VtYWlsID0gKGNvbHVtbkluZGV4ICE9IC0xKSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgKChjdXJzb3IuZ2V0SW50KGNvbHVtbkluZGV4KSkgPT0gMSk7CiAgICAgICAgICAgICAgICAgaW5mby5jb250YWN0RXhpc3RzID0gdHJ1ZTsKQEAgLTI1Niw4ICsyNTAsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgVXJpIGNvbnRhY3RVcmkgPSBVcmkud2l0aEFwcGVuZGVkUGF0aChDb250YWN0cy5QaG9uZXMuQ09OVEVOVF9GSUxURVJfVVJMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVyaS5lbmNvZGUobnVtYmVyKSk7CisgICAgICAgIFVyaSBjb250YWN0VXJpID0gVXJpLndpdGhBcHBlbmRlZFBhdGgoUGhvbmVMb29rdXAuQ09OVEVOVF9GSUxURVJfVVJJLCBudW1iZXIpOwogCiAgICAgICAgIENhbGxlckluZm8gaW5mbyA9IGdldENhbGxlckluZm8oY29udGV4dCwgY29udGFjdFVyaSk7CiAKZGlmZiAtLWdpdCBhL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9DYWxsZXJJbmZvQXN5bmNRdWVyeS5qYXZhIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0NhbGxlckluZm9Bc3luY1F1ZXJ5LmphdmEKaW5kZXggZjgxZjQyYS4uZWY0NTZmMCAxMDA2NDQKLS0tIGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJu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W5nT24oKTsKICAgICBwcm90ZWN0ZWQgYWJzdHJhY3Qgdm9pZCBvblJhZGlvQXZhaWxhYmxlKCk7CkBAIC0yMjksMTAgKzI2MiwzOSBAQAogICAgIHByb3RlY3RlZCBhYnN0cmFjdCB2b2lkIG9uVm9pY2VDYWxsRW5kZWQoKTsKICAgICBwcm90ZWN0ZWQgYWJzdHJhY3Qgdm9pZCBvbkNsZWFuVXBDb25uZWN0aW9uKGJvb2xlYW4gdGVhckRvd24sIFN0cmluZyByZWFzb24pOwogCi0gIC8vKioqKiogT3ZlcnJpZGRlbiBmcm9tIEhhbmRsZXIKKyAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlIChNZXNzYWdlIG1zZykgewogICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CiAKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfRU5BQkxFX0FQTl9SRVFVRVNUOgorICAgICAgICAgICAgICAgIGludCBhcG5JZCA9IG1zZy5hcmcxOworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiZ290IEVWRU5UX0VOQUJMRV9BUE5fUkVRVUVTVCB3aXRoIGFwblR5cGUgPSAiICsgYXBuSWQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGFuZCBlbmFibGUgPSAiICsgbXNnLmFyZzIpOworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImRhdGFFbmFibGVkW2FwbklkXSA9ICIgKyBkYXRhRW5hYmxlZFthcG5JZF0gKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCBlbmFibGVkQ291bnQgPSAiICsgZW5hYmxlZENvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobXNnLmFyZzIgPT0gQVBOX0VOQUJMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVuYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRhRW5hYmxlZFthcG5JZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhRW5hYmxlZFthcG5JZF0gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZWRDb3VudCsrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgb25UcnlTZXR1cERhdGEobnVsbCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBkaXNhYmxlCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YUVuYWJsZWRbYXBuSWRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUVuYWJsZWRbYXBuSWRdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlZENvdW50LS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVuYWJsZWRDb3VudCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xlYW5VcENvbm5lY3Rpb24odHJ1ZSwgUGhvbmUuUkVBU09OX0RBVEFfRElTQUJMRUQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKwogICAgICAgICAgICAgY2FzZSBFVkVOVF9UUllfU0VUVVBfREFUQToKICAgICAgICAgICAgICAgICBTdHJpbmcgcmVhc29uID0gbnVsbDsKICAgICAgICAgICAgICAgICBpZiAobXNnLm9iaiBpbnN0YW5jZW9mIFN0cmluZykgewpAQCAtMjQyLDYgKzMwNCw5IEBACiAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgICAgIGNhc2UgRVZFTlRfUk9BTUlOR19PRkY6CisgICAgICAgICAgICAgICAgaWYgKGdldERhdGFPblJvYW1pbmdFbmFibGVkKCkgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgbVJldHJ5TWdyLnJlc2V0UmV0cnlDb3VudCgpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBvblJvYW1pbmdPZmYoKTsKICAgICAgICAgICAgICAgICBicmVhazsKIApAQCAtMjkwLDI0ICszNTUsMTggQEAKICAgICAgKiBAcmV0dXJuIHtAY29kZSBmYWxzZX0gaWYgZGF0YSBjb25uZWN0aXZpdHkgaGFzIGJlZW4gZXhwbGljaXRseSBkaXNhYmxlZCwKICAgICAgKiB7QGNvZGUgdHJ1ZX0gb3RoZXJ3aXNlLgogICAgICAqLwotICAgIHB1YmxpYyBhYnN0cmFjdCBib29sZWFuIGdldERhdGFFbmFibGVkKCk7CisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGdldERhdGFFbmFibGVkKCkgeworICAgICAgICByZXR1cm4gZGF0YUVuYWJsZWRbQVBOX0RFRkFVTFRfSURdOworICAgIH0KIAogICAgIC8qKgogICAgICAqIFJlcG9ydCBvbiB3aGV0aGVyIGRhdGEgY29ubmVjdGl2aXR5IGlzIGVuYWJsZWQKICAgICAgKiBAcmV0dXJuIHtAY29kZSBmYWxzZX0gaWYgZGF0YSBjb25uZWN0aXZpdHkgaGFzIGJlZW4gZXhwbGljaXRseSBkaXNhYmxlZCwKICAgICAgKiB7QGNvZGUgdHJ1ZX0gb3RoZXJ3aXNlLgogICAgICAqLwotICAgIHB1YmxpYyBhYnN0cmFjdCBib29sZWFuIGdldEFueURhdGFFbmFibGVkKCk7Ci0KLSAgICAvKioKLSAgICAgKiBQcmV2ZW50IG1vYmlsZSBkYXRhIGNvbm5lY3Rpb25zIGZyb20gYmVpbmcgZXN0YW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hIGJyb2FkY2FzdAorICAgICAqIHdpbGwgYmUgc2VudCBieSB0aGUgQ29ubmVjdGl2aXR5TWFuYWdlciB3aGVuIGEgY29ubmVjdGlvbiB0bworICAgICAqIHRoZSBBUE4gaGFzIGJlZW4gZXN0YWJsaXNoZWQuCisgICAgICovCisgICAgcHVibGljIGludCBlbmFibGVBcG5UeXBlKFN0cmluZyB0eXBlKSB7CisgICAgICAgIGludCBpZCA9IGFwblR5cGVUb0lkKHR5cGUpOworICAgICAgICBpZiAoaWQgPT0gQVBOX0lOVkFMSURfSUQpIHsKKyAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fUkVRVUVTVF9GQUlMRUQ7CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiBhbHJlYWR5IGFjdGl2ZSwgcmV0dXJuCisgICAgICAgIGlmKERCRykgTG9nLmQoTE9HX1RBRywgImVuYWJsZUFwblR5cGUoIit0eXBlKyIpLCBpc0FwblR5cGVBY3RpdmUgPSAiCisgICAgICAgICAgICAgICAgKyBpc0FwblR5cGVBY3RpdmUodHlwZSkgKyAiIGFuZCBzdGF0ZSA9ICIgKyBzdGF0ZSk7CisKKyAgICAgICAgaWYgKGlzQXBuVHlwZUFjdGl2ZSh0eXBlKSkgeworICAgICAgICAgICAgaWYgKHN0YXRlID09IFN0YXRlLklOSVRJTkcpIHJldHVybiBQaG9uZS5BUE5fUkVRVUVTVF9TVEFSVEVEOworICAgICAgICAgICAgZWxzZSBpZiAoc3RhdGUgPT0gU3RhdGUuQ09OTkVDVEVEKSByZXR1cm4gUGhvbmUuQVBOX0FMUkVBRFlfQUNUSVZFOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFpc0FwblR5cGVBdmFpbGFibGUodHlwZSkpIHsKKyAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fVFlQRV9OT1RfQVZBSUxBQkxFOworICAgICAgICB9CisKKyAgICAgICAgc2V0RW5hYmxlZChpZCwgdHJ1ZSk7CisgICAgICAgIG1SZXF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2ZShQaG9uZS5BUE5fVFlQRV9ERUZBVUxUKSkgeworICAgICAgICAgICAgICAgIG1SZXF1ZXN0ZWRBcG5UeXBlID0gUGhvbmUuQVBOX1RZUEVfREVGQVVMVDsKKyAgICAgICAgICAgICAgICBpZiAoZGF0YUVuYWJsZWRbQVBOX0RFRkFVTFRfSURdKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fQUxSRUFEWV9BQ1RJVkU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBob25lLkFQTl9SRVFVRVNUX1NUQVJURUQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfU1RBUlRFRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fUkVRVUVTVF9GQUlMRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgdm9pZCBzZXRFbmFibGVkKGludCBpZCwgYm9vbGVhbiBlbmFibGUpIHsKKyAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgInNldEVuYWJsZWQoIiArIGlkICsgIiwgIiArIGVuYWJsZSArICIpIHdpdGggb2xkIHN0YXRlID0gIiArCisgICAgICAgICAgICAgICAgZGF0YUVuYWJsZWRbaWRdICsgIiBhbmQgZW5hYmxlZENvdW50ID0gIiArIGVuYWJsZWRDb3VudCk7CisKKyAgICAgICAgTWVzc2FnZSBtc2cgPSBvYnRhaW5NZXNzYWdlKEVWRU5UX0VOQUJMRV9BUE5fUkVRVUVTVCk7CisgICAgICAgIG1zZy5hcmcxID0gaWQ7CisgICAgICAgIG1zZy5hcmcyID0gKGVuYWJsZSA/IEFQTl9FTkFCTEVEIDogQVBOX0RJU0FCTEVEKTsKKyAgICA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yAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmdldEFjdGl2ZUFwbigpLAorICAgICAgICAgICAgICAgICAgICBzZW5kZXIuZ2V0QWN0aXZlQXBuVHlwZXMoKSwKICAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmdldEludGVyZmFjZU5hbWUobnVsbCkpOwogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgIC8vIHN5c3RlbSBwcm9jZXNzIGlzIGRlYWQKZGlmZiAtLWdpdCBhL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9Hc21BbHBoYWJldC5qYXZhIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0dzbUFscGhhYmV0LmphdmEKaW5kZXggZTgwOTVlMS4uNDYxYjY5NCAxMDA2NDQKLS0tIGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0dzbUFscGhhYmV0LmphdmEKKysrIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0dzbUFscGhhYmV0LmphdmEKQEAgLTE4MywxNSArMTgzLDkgQEAKICAgICAgICAgfQogCiAgICAgICAgIGludCBoZWFkZXJCaXRzID0gKGhlYWRlci5sZW5ndGggKyAxKSAqIDg7Ci0gICAgICAgIGludCBoZWFkZXJTZXB0ZXRzID0gaGVhZGVyQml0cyAvIDc7Ci0gICAgICAgIGhlYWRlclNlcHRldHMgKz0gKGhlYWRlckJpdHMgJSA3KSA+IDAgPyAxIDogMDsKKyAgICAgICAgaW50IGhlYWRlclNlcHRldHMgPSAoaGVhZGVyQml0cyArIDYpIC8gNzsKIAotICAgICAgICBpbnQgc3ogPSBkYXRhLmxlbmd0aCgpOwotICAgICAgICBpbnQgc2VwdGV0Q291bnQ7Ci0gICAgICAgIHNlcHRldENvdW50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gICAgICAgICAgICBwYWNrU21zQ2hhcihyZXQsIGJpdE9mZnNldCwgR1NNX0VYVEVOREVEX0VTQ0FQRSk7CiAgICAgICAgICAgICAgICAgYml0T2Zmc2V0ICs9IDc7CiAgICAgICAgICAgICAgICAgc2VwdGV0cysrOwogICAgICAgICAgICAgfQotCiAgICAgICAgICAgICBwYWNrU21zQ2hhcihyZXQsIGJpdE9mZnNldCwgdik7CiAgICAgICAgICAgICBzZXB0ZXRzKys7CiAgICAgICAgIH0KLQotICAgICAgICAvLyBTZWUgY2hlY2sgZm9yID4gMHhmZiBhYm92ZQotICAgICAgICByZXRbMF0gPSAoYnl0ZSlzZXB0ZXRzOwotCisgICAgICAgIHJldFswXSA9IChieXRlKSAoc2VwdGV0Q291bnQpOyAgLy8gVmFsaWRhdGVkIGJ5IGNoZWNrIGFib3ZlLgogICAgICAgICByZXR1cm4gcmV0OwogICAgIH0KIApkaWZmIC0tZ2l0IGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0lTbXMuYWlkbCBiL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9JU21zLmFpZGwKaW5kZXggMjU3ZjFlNi4uNjViYWQ5NiAxMDA2NDQKLS0tIGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0lTbXMuYWlkbAorKysgYi90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvSVNtcy5haWRsCkBAIC02NywyNCArNjcsNTYgQEAKICAgICBib29sZWFuIGNvcHlNZXNzYWdlVG9JY2NFZihpbnQgc3RhdHVzLCBpbiBieXRlW10gcGR1LCBpbiBieXRlW10gc21zYyk7CiAKICAgICAvKioKLSAgICAgKiBTZW5kIGEgU01TCisgICAgICogU2VuZCBhIGRhdGEgU01TLgogICAgICAqCiAgICAgICogQHBhcmFtIHN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ICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBFVkVOVF9DSEFOR0VfRkFDSUxJVFlfTE9DS19ET05FID0gODsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRVZFTlRfQ0hBTkdFX0lDQ19QQVNTV09SRF9ET05FID0gOTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRVZFTlRfUVVFUllfRkFDSUxJVFlfRkROX0RPTkUgPSAxMDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRVZFTlRfQ0hBTkdFX0ZBQ0lMSVRZX0ZETl9ET05FID0gMTE7CiAKICAgICAvKgogICAgICAgVU5LTk9XTiBpcyBhIHRyYW5zaWVudCBzdGF0ZSwgZm9yIGV4YW1wbGUsIGFmdGVyIHVlc3IgaW5wdXRzIElDQyBwaW4gdW5kZXIKQEAgLTU4LDMzICs5NiwxMDggQEAKICAgICAgICAgUElOX1JFUVVJUkVELAogICAgICAgICBQVUtfUkVRVUlSRUQsCiAgICAgICAgIE5FVFdPUktfTE9DS0VELAotICAgICAgICBSRUFEWTsKKyAgICAgICAgUkVBRFksCisgICAgICAgIE5PVF9SRUFEWTsKIAogICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc1BpbkxvY2tlZCgpIHsKICAgICAgICAgICAgIHJldHVybiAoKHRoaXMgPT0gUElOX1JFUVVJUkVEKSB8fCAodGhpcyA9PSBQVUtfUkVRVUlSRUQpKTsKICAgICAgICAgfQogICAgIH0KIAotICAgIFN0YXRlIGdldFN0YXRlKCk7CisgICAgcHVibGljIFN0YXRlIGdldFN0YXRlKCkgeworICAgICAgICBpZiAobVN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgIHN3aXRjaChtUGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSkgeworICAgICAgICAgICAgICAgIC8qIFRoaXMgc3dpdGNoIGJsb2NrIG11c3Qgbm90IHJldHVybiBhbnl0aGluZyBpbgorICAgICAgICAgICAgICAgICAqIFN0YXRlLmlzTG9ja2VkKCkgb3IgU3RhdGUuQUJTRU5ULgorICAgICAgICAgICAgICAgICAqIElmIGl0IGRvZXMsIGhhbmRsZVNpbVN0YXR1cygpIG1heSBicmVhaworICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGNhc2UgUkFESU9fT0ZGOgorICAgICAgICAgICAgICAgIGNhc2UgUkFESU9fVU5BVkFJTEFCTEU6CisgICAgICAgICAgICAgICAgY2FzZSBTSU1fTk9UX1JFQURZOgorICAgICAgICAgICAgICAgIGNhc2UgUlVJTV9OT1RfUkVBRFk6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBTdGF0ZS5VTktOT1dOOworICAgICAgICAgICAgICAgIGNhc2UgU0lNX0xPQ0tFRF9PUl9BQlNFTlQ6CisgICAgICAgICAgICAgICAgY2FzZSBSVUlNX0xPQ0tFRF9PUl9BQlNFTlQ6CisgICAgICAgICAgICAgICAgICAgIC8vdGhpcyBzaG91bGQgYmUgdHJhbnNpZW50LW9ubHkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLlVOS05PV047CisgICAgICAgICAgICAgICAgY2FzZSBTSU1fUkVBRFk6CisgICAgICAgICAgICAgICAgY2FzZSBSVUlNX1JFQURZOgorICAgICAgICAgICAgICAgIGNhc2UgTlZfUkVBRFk6CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBTdGF0ZS5SRUFEWTsKKyAgICAgICAgICAgICAgICBjYXNlIE5WX05PVF9SRUFEWToKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLkFCU0VOVDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBtU3RhdGU7CisgICAgICAgIH0KIAorICAgICAgICBMb2cuZShtTG9nVGFnLCAiSWNjQ2FyZC5nZXRTdGF0ZSgpOiBjYXNlIHNob3VsZCBuZXZlciBiZSByZWFjaGVkIik7CisgICAgICAg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FfU0lNLAorICAgICAgICAgICAgICAgICBlbmFibGVkLCBwYXNzd29yZCwgc2VydmljZUNsYXNzWCwKKyAgICAgICAgICAgICAgICAgbUhhbmRsZXIub2J0YWluTWVzc2FnZShFVkVOVF9DSEFOR0VfRkFDSUxJVFlfTE9DS19ET05FLCBvbkNvbXBsZXRlKSk7CisgICAgIH0KKworICAgICAvKioKKyAgICAgICogU2V0IHRoZSBJQ0MgZmRuIGVuYWJsZWQgb3IgZGlzYWJsZWQKKyAgICAgICogV2hlbiB0aGUgb3BlcmF0aW9uIGlzIGNvbXBsZXRlLCBvbkNvbXBsZXRlIHdpbGwgYmUgc2VudCB0byBpdHMgaGFuZGxlcgorICAgICAgKgorICAgICAgKiBAcGFyYW0gZW5hYmxlZCAidHJ1ZSIgZm9yIGxvY2tlZCAiZmFsc2UiIGZvciB1bmxvY2tlZC4KKyAgICAgICogQHBhcmFtIHBhc3N3b3JkIG5lZWRlZCB0byBjaGFuZ2UgdGhlIElDQyBmZG4gZW5hYmxlLCBha2EgUGluMgorICAgICAgKiBAcGFyYW0gb25Db21wbGV0ZQorICAgICAgKiAgICAgICAgb25Db21wbGV0ZS5vYmogd2lsbCBiZSBhbiBBc3luY1Jlc3VsdAorICAgICAgKiAgICAgICAgKChBc3luY1Jlc3VsdClvbkNvbXBsZXRlLm9iaikuZXhjZXB0aW9uID09IG51bGwgb24gc3VjY2VzcworICAgICAgKiAgICAgICAgKChBc3luY1Jlc3VsdClvbkNvbXBsZXRlLm9iaikuZXhjZXB0aW9uICE9IG51bGwgb24gZmFpbAorICAgICAgKi8KKyAgICAgcHVibGljIHZvaWQgc2V0SWNjRmRuRW5hYmxlZCAoYm9vbGVhbiBlbmFibGVkLAorICAgICAgICAgICAgIFN0cmluZyBwYXNzd29yZCwgTWVzc2FnZSBvbkNvbXBsZXRlKSB7CisgICAgICAgICBpbnQgc2VydmljZUNsYXNzWDsKKyAgICAgICAgIHNlcnZpY2VDbGFzc1ggPSBDb21tYW5kc0ludGVy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KG1EYmcpIGxvZygiTm90aWZ5IFNJTSBtaXNzaW5nLiIpOworICAgICAgICAgICAgbUFic2VudFJlZ2lzdHJhbnRzLm5vdGlmeVJlZ2lzdHJhbnRzKCk7CisgICAgICAgICAgICBicm9hZGNhc3RJY2NTdGF0ZUNoYW5nZWRJbnRlbnQoSU5URU5UX1ZBTFVFX0lDQ19BQlNFTlQsIG51bGwpOworICAgICAgICB9IGVsc2UgaWYgKHRyYW5zaXRpb25lZEludG9OZXR3b3JrTG9ja2VkKSB7CisgICAgICAgICAgICBpZihtRGJnKSBsb2coIk5vdGlmeSBTSU0gbmV0d29yayBsb2NrZWQuIik7CisgICAgICAgICAgICBtTmV0d29ya0xvY2tlZFJlZ2lzdHJhbnRzLm5vdGlmeVJlZ2lzdHJhbnRzKCk7CisgICAgICAgICAgICBicm9hZGNhc3RJY2NTdGF0ZUNoYW5nZWRJbnRlbnQoSU5URU5UX1ZBTFVFX0lDQ19MT0NLRUQsCisgICAgICAgICAgICAgICAgICBJTlRFTlRfVkFMVUVfTE9DS0VEX05FVFdPUkspOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogSW50ZXJwZXJhdGUgRVZFTlRfUVVFUllfRkFDSUxJVFlfTE9DS19ET05FCisgICAgICogQHBhcmFtIGFyIGlzIGFzeW5jUmVzdWx0IG9mIFF1ZXJ5X0ZhY2lsaXR5X0xvY2tlZAorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBvblF1ZXJ5RmRuRW5hYmxlZChBc3luY1Jlc3VsdCBhcikgeworICAgICAgICBpZihhci5leGNlcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgaWYobURiZykgbG9nKCJFcnJvciBpbiBxdWVyeWluZyBmYWNpbGl0eSBsb2NrOiIgKyBhci5leGNlcHRpb24pOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgaW50W10gaW50cyA9IChpbnRbXSlhci5yZXN1bHQ7CisgICAgICAgIGlmKGludHMubGVuZ3RoICE9IDApIHsKKyAgICAgICAgICAgIG1JY2NGZG5FbmFibGVkID0gKDAhPWludHNbMF0pOworICAgICAgICAgICAgaWYobURiZykgbG9nKCJRdWVyeSBmYWNpbGl0eSBsb2NrIDogIiAgKyBtSWNjRmRuRW5hYmxlZCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMb2cuZShtTG9nVGFnLCAiW0ljY0NhcmRdIEJvZ3VzIGZhY2lsaXR5IGxvY2sgcmVzcG9uc2UiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEludGVycGVyYXRlIEVWRU5UX1FVRVJZX0ZBQ0lMSVRZX0xPQ0tfRE9ORQorICAgICAqIEBwYXJhbSBhciBpcyBhc3luY1Jlc3VsdCBvZiBRdWVyeV9GYWNpbGl0eV9Mb2NrZWQKKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgb25RdWVyeUZhY2lsaXR5TG9jayhBc3luY1Jlc3VsdCBhcikgeworICAgICAgICBpZihhci5leGNlcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKG1EYmcpIGxvZygiRXJyb3IgaW4gcXVlcnlpbmcgZmFjaWxpdHkgbG9jazoiICsgYXIuZXhjZXB0aW9uKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGludFtdIGludHMgPSAoaW50W10pYXIucmVzdWx0OworICAgICAgICBpZihpbnRzLmxlbmd0aCAhPSAwKSB7CisgICAgICAgICAgICBtSWNjUGluTG9ja2VkID0gKDAhPWludHNbMF0pOworICAgICAgICAgICAgaWYobURiZykgbG9nKCJRdWVyeSBmYWNpbGl0eSBsb2NrIDogIiAgKyBtSWNjUGluTG9ja2VkKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExvZy5lKG1Mb2dUYWcsICJbSWNjQ2FyZF0gQm9ndXMgZmFjaWxpdHkgbG9jayByZXNwb25zZSIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYnJvYWRjYXN0SWNjU3RhdGVDaGFuZ2VkSW50ZW50KFN0cmluZyB2YWx1ZSwgU3RyaW5nIHJlYXNvbikgeworICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9TSU1fU1RBVEVfQ0hBTkdFRCk7CisgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5QSE9ORV9OQU1FX0tFWSwgbVBob25lLmdldFBob25lTmFtZSgpKTsKKyAgICAgICAgaW50ZW50LnB1dEV4dHJhKElOVEVOVF9LRVlfSUNDX1NUQVRFLCB2YWx1ZSk7CisgICAgICAgIGludGVudC5wdXRFeHRyYShJTlRFTlRfS0VZX0xPQ0tFRF9SRUFTT04sIHJlYXNvbik7CisgICAgICAgIGlmKG1EYmcpIGxvZygiQnJvYWRjYXN0aW5nIGludGVudCBBQ1RJT05fU0lNX1NUQVRFX0NIQU5HRUQgIiArICB2YWx1ZQorICAgICAgICAgICAgICAgICsgIiByZWFzb24gIiArIHJlYXNvbik7CisgICAgICAgIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5icm9hZGNhc3RTdGlja3lJbnRlbnQoaW50ZW50LCBSRUFEX1BIT05FX1NUQVRFKTsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgSGFuZGxlciBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZyl7CisgICAgICAgICAgICBBc3luY1Jlc3VsdCBhcjsKKyAgICAgICAgICAgIGludCBzZXJ2aWNlQ2xhc3NYOworCisgICAgICAgICAgICBzZXJ2aWNlQ2xhc3NYID0gQ29tbWFuZHNJbnRlcmZhY2UuU0VSVklDRV9DTEFTU19WT0lDRSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29tbWFuZHNJbnRlcmZhY2UuU0VSVklDRV9DTEFTU19EQVRBICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb21tYW5kc0ludGVyZmFjZS5TRVJWSUNFX0NMQVNTX0ZBWDsKKworICAgICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fT0ZGX09SX05PVF9BVkFJTEFCTEU6CisgICAgICAgICAgICAgICAgICAgIG1TdGF0ZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVN0YXRlUHJvcGVydHkoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJvYWRjYXN0SWNjU3RhdGVDaGFuZ2VkSW50ZW50KElOVEVOVF9WQUxVRV9JQ0NfTk9UX1JFQURZLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9JQ0NfUkVBRFk6CisgICAgICAgICAgICAgICAgICAgIC8vVE9ETzogcHV0IGZhY2lsaXR5IHJlYWQgaW4gU0lNX1JFQURZIG5vdywgbWF5YmUgaW4gUkVHX05XCisgICAgICAgICAgICAgICAgICAgIG1QaG9uZS5tQ00uZ2V0SWNjQ2FyZFN0YXR1cyhvYnRhaW5NZXNzYWdlKEVWRU5UX0dFVF9JQ0NfU1RBVFVTX0RPTkUpKTsKKyAgICAgICAgICAgICAgICAgICAgbVBob25lLm1DTS5xdWVyeUZhY2lsaXR5TG9jayAoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29tbWFuZHNJbnRlcmZhY2UuQ0JfRkFDSUxJVFlfQkFfU0lNLCAiIiwgc2VydmljZUNsYXNzWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYnRhaW5NZXNzYWdlKEVWRU5UX1FVRVJZX0ZBQ0lMSVRZX0xPQ0tfRE9ORSkpOworICAgICAgICAgICAgICAgICAgICBtUGhvbmUubUNNLnF1ZXJ5RmFjaWxpdHlMb2NrICgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb21tYW5kc0ludGVyZmFjZS5DQl9GQUNJTElUWV9CQV9GRCwgIiIsIHNlcnZpY2VDbGFzc1gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2J0YWluTWVzc2FnZShFVkVOVF9RVUVSWV9GQUNJTElUWV9GRE5fRE9ORSkpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX0lDQ19MT0NLRURfT1JfQUJTRU5UOgorICAgICAgICAgICAgICAgICAgICBtUGhvbmUubUNNLmdldEljY0NhcmRTdGF0dXMob2J0YWluTWVzc2FnZShFVkVOVF9HRVRfSUNDX1NUQVRVU19ET05FKSk7CisgICAgICAgICAgICAgICAgICAgIG1QaG9uZS5tQ00ucXVlcnlGYWNpbGl0eUxvY2sgKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbW1hbmRzSW50ZXJmYWNlLkNCX0ZBQ0lMSVRZX0JBX1NJTSwgIiIsIHNlcnZpY2VDbGFzc1gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2J0YWluTWVzc2FnZShFVkVOVF9RVUVSWV9GQUNJTElUWV9MT0NLX0RPTkUpKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfSUNDX1NUQVRVU19ET05FOgorICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworCisgICAgICAgICAgICAgICAgICAgIGdldEljY0NhcmRTdGF0dXNEb25lKGFyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9QSU5QVUtfRE9ORToKKyAgICAgICAgICAgICAgICAgICAgLy8gYSBQSU4vUFVLL1BJTjIvUFVLMi9OZXR3b3JrIFBlcnNvbmFsaXphdGlvbgorICAgICAgICAgICAgICAgICAgICAvLyByZXF1ZXN0IGhhcyBjb21wbGV0ZWQuIGFyLnVzZXJPYmogaXMgdGhlIHJlc3BvbnNlIE1lc3NhZ2UKKyAgICAgICAgICAgICAgICAgICAgLy8gUmVwb2xsIGJlZm9yZSByZXR1cm5pbmcKKyAgICAgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyBzaG91bGQgYWJzdHJhY3QgdGhlc2UgZXhjZXB0aW9ucworICAgICAgICAgICAgICAgICAgICBBc3luY1Jlc3VsdC5mb3JNZXNzYWdlKCgoTWVzc2FnZSlhci51c2VyT2JqKSkuZXhjZXB0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gYXIuZXhjZXB0aW9uOworICAgICAgICAgICAgICAgICAgICBtUGhvbmUubUNNLmdldEljY0NhcmRTdGF0dXMoCisgICAgICAgICAgICAgICAgICAgICAgICBvYnRhaW5NZXNzYWdlKEVWRU5UX1JFUE9MTF9TVEFUVVNfRE9ORSwgYXIudXNlck9iaikpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX1JFUE9MTF9TVEFUVVNfRE9ORToKKyAgICAgICAgICAgICAgICAgICAgLy8gRmluaXNoZWQgcmVwb2xsaW5nIHN0YXR1cyBhZnRlciBQSU4gb3BlcmF0aW9uCisgICAgICAgICAgICAgICAgICAgIC8vIGFyLnVzZXJPYmogaXMgdGhlIHJlc3BvbnNlIG1lc3NhZWcKKyAgICAgICAgICAgICAgICAgICAgLy8gYXIudXNlck9iai5vYmogaXMgYWxyZWFkeSBhbiBBc3luY1Jlc3VsdCB3aXRoIGFuCisgICAgICAgICAgICAgICAgICAgIC8vIGFwcHJvcHJpYXRlIGV4Y2VwdGlvbiBmaWxsZWQgaW4gaWYgYXBwbGljYWJsZQorCisgICAgICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgIGdldEljY0NhcmRTdGF0dXNEb25lKGFyKTsKKyAgICAgICAgICAgICAgICAgICAgKChNZXNzYWdlKWFyLnVzZXJPYmopLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX1FVRVJZX0ZBQ0lMSVRZX0xPQ0tfRE9ORToKKyAgICAgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgb25RdWVyeUZhY2lsaXR5TG9jayhhcik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUVVFUllfRkFDSUxJVFlfRkROX0RPTkU6CisgICAgICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7CisgICAgICAgICAgICAgICAgICAgIG9uUXVlcnlGZG5FbmFibGVkKGFyKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9DSEFOR0VfRkFDSUxJVFlfTE9DS19ET05FOgorICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1JY2NQaW5Mb2NrZWQgPSBtRGVzaXJlZFBpbkxvY2tlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGJnKSBsb2coICJFVkVOVF9DSEFOR0VfRkFDSUxJVFlfTE9DS19ET05FOiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm1JY2NQaW5Mb2NrZWQ9ICIgKyBtSWNjUGluTG9ja2VkKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKG1Mb2dUYWcsICJFcnJvciBjaGFuZ2UgZmFjaWxpdHkgbG9jayB3aXRoIGV4Y2VwdGlvbiAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBhci5leGNlcHRpb24pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2UoKChNZXNzYWdlKWFyLnVzZXJPYmopKS5leGNlcHRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBhci5leGNlcHRpb247CisgICAgICAgICAgICAgICAgICAgICgoTWVzc2FnZSlhci51c2VyT2JqKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9DSEFOR0VfRkFDSUxJVFlfRkROX0RPTkU6CisgICAgICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtSWNjRmRuRW5hYmxlZCA9IG1EZXNpcmVkRmRuRW5hYmxlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGJnKSBsb2coIkVWRU5UX0NIQU5HRV9GQUNJTElUWV9GRE5fRE9ORTogIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJtSWNjRmRuRW5hYmxlZD0iICsgbUljY0ZkbkVuYWJsZWQpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUobUxvZ1RhZywgIkVycm9yIGNoYW5nZSBmYWNpbGl0eSBmZG4gd2l0aCBleGNlcHRpb24gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGFyLmV4Y2VwdGlvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZSgoKE1lc3NhZ2UpYXIudXNlck9iaikpLmV4Y2VwdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGFyLmV4Y2VwdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgKChNZXNzYWdlKWFyLnVzZXJPYmopLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX0NIQU5HRV9JQ0NfUEFTU1dPUkRfRE9ORToKKyAgICAgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgaWYoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKG1Mb2dUYWcsICJFcnJvciBpbiBjaGFuZ2Ugc2ltIHBhc3N3b3JkIHdpdGggZXhjZXB0aW9uIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYXIuZXhjZXB0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBBc3luY1Jlc3VsdC5mb3JNZXNzYWdlKCgoTWVzc2FnZSlhci51c2VyT2JqKSkuZXhjZXB0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gYXIuZXhjZXB0aW9uOworICAgICAgICAgICAgICAgICAgICAoKE1lc3NhZ2UpYXIudXNlck9iaikuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIExvZy5lKG1Mb2dUYWcsICJbSWNjQ2FyZF0gVW5rbm93biBFdmVudCAiICsgbXNnLndoYXQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHB1YmxpYyBTdGF0ZSBnZXRJY2NDYXJkU3RhdGUoKSB7CisgICAgICAgIGlmIChtSWNjQ2FyZFN0YXR1cyA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZShtTG9nVGFnLCAiW0ljY0NhcmRdIEljY0NhcmRTdGF0dXMgaXMgbnVsbCIpOworICAgICAgICAgICAgcmV0dXJuIEljY0NhcmQuU3RhdGUuQUJTRU5UOworICAgICAgICB9CisKKyAgICAgICAgLy8gdGhpcyBpcyBjb21tb24gZm9yIGFsbCByYWRpbyB0ZWNobm9sb2dpZXMKKyAgICAgICAgaWYgKCFtSWNjQ2FyZFN0YXR1cy5nZXRDYXJkU3RhdGUoKS5pc0NhcmRQcmVzZW50KCkpIHsKKyAgICAgICAgICAgIHJldHVybiBJY2NDYXJkLlN0YXRlLkFCU0VOVDsKKyAgICAgICAgfQorCisgICAgICAgIFJhZGlvU3RhdGUgY3VycmVudFJhZGlvU3RhdGUgPSBtUGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKTsKKyAgICAgICAgLy8gY2hlY2sgcmFkaW8gdGVjaG5vbG9neQorICAgICAgICBpZiggY3VycmVudFJhZGlvU3RhdGUgPT0gUmFkaW9TdGF0ZS5SQURJT19PRkYgICAgICAgICB8fAorICAgICAgICAgICAgY3VycmVudFJhZGlvU3RhdGUgPT0gUmFkaW9TdGF0ZS5SQURJT19VTkFWQUlMQUJMRSB8fAorICAgICAgICAgICAgY3VycmVudFJhZGlvU3RhdGUgPT0gUmFkaW9TdGF0ZS5TSU1fTk9UX1JFQURZICAgICB8fAorICAgICAgICAgICAgY3VycmVudFJhZGlvU3RhdGUgPT0gUmFkaW9TdGF0ZS5SVUlNX05PVF9SRUFEWSAgICB8fAorICAgICAgICAgICAgY3VycmVudFJhZGlvU3RhdGUgPT0gUmFkaW9TdGF0ZS5OVl9OT1RfUkVBRFkgICAgICB8fAorICAgICAgICAgICAgY3VycmVudFJhZGlvU3RhdGUgPT0gUmFkaW9TdGF0ZS5OVl9SRUFEWSkgeworICAgICAgICAgICAgcmV0dXJuIEljY0NhcmQuU3RhdGUuTk9UX1JFQURZOworICAgICAgICB9CisKKyAgICAgICAgaWYoIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuU0lNX0xPQ0tFRF9PUl9BQlNFTlQgIHx8CisgICAgICAgICAgICBjdXJyZW50UmFkaW9TdGF0ZSA9PSBSYWRpb1N0YXRlLlNJTV9SRUFEWSAgICAgICAgICAgICB8fAorICAgICAgICAgICAgY3VycmVudFJhZGlvU3RhdGUgPT0gUmFkaW9TdGF0ZS5SVUlNX0xPQ0tFRF9PUl9BQlNFTlQgfHwKKyAgICAgICAgICAgIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuUlVJTV9SRUFEWSkgeworCisgICAgICAgICAgICBpbnQgaW5kZXg7CisKKyAgICAgICAgICAgIC8vIGNoZWNrIGZvciBDRE1BIHJhZGlvIHRlY2hub2xvZ3kKKyAgICAgICAgICAgIGlmIChjdXJyZW50UmFkaW9TdGF0ZSA9PSBSYWRpb1N0YXRlLlJVSU1fTE9DS0VEX09SX0FCU0VOVCB8fAorICAgICAgICAgICAgICAgIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuUlVJTV9SRUFEWSkgeworICAgICAgICAgICAgICAgIGluZGV4ID0gbUljY0NhcmRTdGF0dXMuZ2V0Q2RtYVN1YnNjcmlwdGlvbkFwcEluZGV4KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICBpbmRleCA9IG1JY2NDYXJkU3RhdHVzLmdldEdzbVVtdHNTdWJzY3JpcHRpb25BcHBJbmRleCgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBJY2NDYXJkQXBwbGljYXRpb24gYXBwID0gbUljY0NhcmRTdGF0dXMuZ2V0QXBwbGljYXRpb24oaW5kZXgpOworCisgICAgICAgICAgICBpZiAoYXBwID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShtTG9nVGFnLCAiW0ljY0NhcmRdIFN1YnNjcmlwdGlvbiBBcHBsaWNhdGlvbiBpbiBub3QgcHJlc2VudCIpOworICAgICAgICAgICAgICAgIHJldHVybiBJY2NDYXJkLlN0YXRlLkFCU0VOVDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gY2hlY2sgaWYgUElOIHJlcXVpcmVkCisgICAgICAgICAgICBpZiAoYXBwLmFwcF9zdGF0ZS5pc1BpblJlcXVpcmVkKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gSWNjQ2FyZC5TdGF0ZS5QSU5fUkVRVUlSRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXBwLmFwcF9zdGF0ZS5pc1B1a1JlcXVpcmVkKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gSWNjQ2FyZC5TdGF0ZS5QVUtfUkVRVUlSRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXBwLmFwcF9zdGF0ZS5pc1N1YnNjcmlwdGlvblBlcnNvRW5hYmxlZCgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEljY0NhcmQuU3RhdGUuTkVUV09SS19MT0NLRUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXBwLmFwcF9zdGF0ZS5pc0FwcFJlYWR5KCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gSWNjQ2FyZC5TdGF0ZS5SRUFEWTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChhcHAuYXBwX3N0YXRlLmlzQXBwTm90UmVhZHkoKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBJY2NDYXJkLlN0YXRlLk5PVF9SRUFEWTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBJY2NDYXJkLlN0YXRlLk5PVF9SRUFEWTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBJY2NDYXJkLlN0YXRlLkFCU0VOVDsKKyAgICB9CisKKworICAgIHB1YmxpYyBib29sZWFuIGlzQXBwbGljYXRpb25PbkljYyhJY2NDYXJkQXBwbGljYXRpb24uQXBwVHlwZSB0eXBlKSB7CisgICAgICAgIGlmIChtSWNjQ2FyZFN0YXR1cyA9PSBudWxsKSByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDAgOyBpIDwgbUljY0NhcmRTdGF0dXMuZ2V0TnVtQXBwbGljYXRpb25zKCk7IGkrKykgeworICAgICAgICAgICAgSWNjQ2FyZEFwcGxpY2F0aW9uIGFwcCA9IG1JY2NDYXJkU3RhdHVzLmdldEFwcGxpY2F0aW9uKGkpOworICAgICAgICAgICAgaWYgKGFwcCAhPSBudWxsICYmIGFwcC5hcHBfdHlwZSA9PSB0eXBlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBhIElDQyBjYXJkIGlzIHByZXNlbnQKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBoYXNJY2NDYXJkKCkgeworICAgICAgICBib29sZWFuIGlzSWNjUHJlc2VudDsKKyAgICAgICAgaWYgKG1QaG9uZS5nZXRQaG9uZU5hbWUoKS5lcXVhbHMoIkdTTSIpKSB7CisgICAgICAgICAgICByZXR1cm4gbUljY0NhcmRTdGF0dXMuZ2V0Q2FyZFN0YXRlKCkuaXNDYXJkUHJlc2VudCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVE9ETzogTWFrZSB3b3JrIHdpdGggYSBD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RpbWVFeGNlcHRpb24oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVucmVjb2duaXplZCBSSUxfUGluU3RhdGU6ICIgK3N0YXRlKTsKKyAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgbUNhcmRTdGF0ZSA9IENhcmRTdGF0ZS5DQVJEU1RBVEVfQUJTRU5UOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgIG1DYXJkU3RhdGUgPSBDYXJkU3RhdGUuQ0FSRFNUQVRFX1BSRVNFTlQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgbUNhcmRTdGF0ZSA9IENhcmRTdGF0ZS5DQVJEU1RBVEVfRVJST1I7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbnJlY29nbml6ZWQgUklMX0NhcmRTdGF0ZTogIiArIHN0YXRlKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gbmV3U3RhdGU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VW5pdmVyc2FsUGluU3RhdGUoaW50IHN0YXRlKSB7CisgICAgICAgIHN3aXRjaChzdGF0ZSkgeworICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICBtVW5pdmVyc2FsUGluU3RhdGUgPSBQaW5TdGF0ZS5QSU5TVEFURV9VTktOT1dOOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgIG1Vbml2ZXJzYWxQaW5TdGF0ZSA9IFBpblN0YXRlLlBJTlNUQVRFX0VOQUJMRURfTk9UX1ZFUklGSUVEOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgIG1Vbml2ZXJzYWxQaW5TdGF0ZSA9IFBpblN0YXRlLlBJTlNUQVRFX0VOQUJMRURfVkVSSUZJRUQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgbVVuaXZlcnNhbFBpblN0YXRlID0gUGluU3RhdGUuUElOU1RBVEVfRElTQUJMRUQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgbVVuaXZlcnNhbFBpblN0YXRlID0gUGluU3RhdGUuUElOU1RBVEVfRU5BQkxFRF9CTE9DS0VEOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgNToKKyAgICAgICAgICAgIG1Vbml2ZXJzYWxQaW5TdGF0ZSA9IFBpblN0YXRlLlBJTlNUQVRFX0VOQUJMRURfUEVSTV9CTE9DS0VEOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVW5yZWNvZ25pemVkIFJJTF9QaW5TdGF0ZTogIiArIHN0YXRlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0R3NtVW10c1N1YnNjcmlwdGlvbkFwcEluZGV4KCkgeworICAgICAgICByZXR1cm4gbUdzbVVtdHNTdWJzY3JpcHRpb25BcHBJbmRleDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRHc21VbXRzU3Vic2NyaXB0aW9uQXBwSW5kZXgoaW50IGdzbVVtdHNTdWJzY3JpcHRpb25BcHBJbmRleCkgeworICAgICAgICBtR3NtVW10c1N1YnNjcmlwdGlvbkFwcEluZGV4ID0gZ3NtVW10c1N1YnNjcmlwdGlvbkFwcEluZGV4OworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0Q2RtYVN1YnNjcmlwdGlvbkFwcEluZGV4KCkgeworICAgICAgICByZXR1cm4gbUNkbWFTdWJzY3JpcHRpb25BcHBJbmRleDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZC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WNjZXNzID0gYWRkSWNjUmVjb3JkVG9FZihlZlR5cGUsIHRhZywgbnVtYmVyLCBudWxsLCBwaW4yKTsKIAogICAgICAgICBpZiAoIXN1Y2Nlc3MpIHsKICAgICAgICAgICAgIHJldHVybiBudWxsOwpAQCAtMjM4LDYgKzI0MSw3IEBACiAgICAgICAgIC8vIHBhcnNlIHdoZXJlIGNsYXVzZQogICAgICAgICBTdHJpbmcgdGFnID0gbnVsbDsKICAgICAgICAgU3RyaW5nIG51bWJlciA9IG51bGw7CisgICAgICAgIFN0cmluZ1tdIGVtYWlscyA9IG51bGw7CiAgICAgICAgIFN0cmluZyBwaW4yID0gbnVsbDsKIAogICAgICAgICBTdHJpbmdbXSB0b2tlbnMgPSB3aGVyZS5zcGxpdCgiQU5EIik7CkBAIC0yNjEsNiArMjY1LDkgQEAKICAgICAgICAgICAgICAgICB0YWcgPSBub3JtYWxpemVWYWx1ZSh2YWwpOwogICAgICAgICAgICAgfSBlbHNlIGlmIChTVFJfTlVNQkVSLmVxdWFscyhrZXkpKSB7CiAgICAgICAgICAgICAgICAgbnVtYmVyID0gbm9ybWFsaXplVmFsdWUodmFsKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoU1RSX0VNQUlMUy5lcXVhbHMoa2V5KSkgeworICAgICAgICAgICAgICAgIC8vVE9ETygpOiBFbWFpbCBpcyBudWxsLgorICAgICAgICAgICAgICAgIGVtYWlscyA9IG51bGw7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKFNUUl9QSU4yLmVxdWFscyhrZXkpKSB7CiAgICAgICAgICAgICAgICAgcGluMiA9IG5vcm1hbGl6ZVZhbHVlKHZhbCk7CiAgICAgICAgICAgICB9CkBAIC0yNzQsNyArMjgxLDcgQEAKICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICB9CiAKLSAgICAgICAgYm9vbGVhbiBzdWNjZXNzID0gZGVsZXRlSWNjUmVjb3JkRnJvbUVmKGVmVHlwZSwgdGFnLCBudW1iZXIsIH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3JkRnJvbUVmKGludCBlZlR5cGUsIFN0cmluZyBuYW1lLCBTdHJpbmcgbnVtYmVyLCBTdHJpbmdbXSBlbWFpbHMsCisgICAgICAgICAgICBTdHJpbmcgcGluMikgewogICAgICAgICBpZiAoREJHKSBsb2coImRlbGV0ZUljY1JlY29yZEZyb21FZjogZWZUeXBlPSIgKyBlZlR5cGUgKwotICAgICAgICAgICAgICAgICIsIG5hbWU9IiArIG5hbWUgKyAiLCBudW1iZXI9IiArIG51bWJlciArICIsIHBpbjI9IiArIHBpbjIpOworICAgICAgICAgICAgICAgICIsIG5hbWU9IiArIG5hbWUgKyAiLCBudW1iZXI9IiArIG51bWJlciArICIsIGVtYWlscz0iICsgZW1haWxzICsgIiwgcGluMj0iICsgcGluMik7CiAKICAgICAgICAgYm9vbGVhbiBzdWNjZXNzID0gZmFsc2U7CiAKQEAgLTQzOCwxMyArNDQ4LDI2IEBACiAgICAgcHJpdmF0ZSB2b2lkIGxvYWRSZWNvcmQoQWRuUmVjb3JkIHJlY29yZCwKICAgICAgICAgICAgIEFycmF5TGlzdDxBcnJheUxpc3Q+IHJlc3VsdHMpIHsKICAgICAgICAgaWYgKCFyZWNvcmQuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBjb250YWN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KDIpOworICAgICAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gY29udGFjdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwogICAgICAgICAgICAgU3RyaW5nIGFscGhhVGFnID0gcmVjb3JkLmdldEFscGhhVGFnKCk7CiAgICAgICAgICAgICBTdHJpbmcgbnVtYmVyID0gcmVjb3JkLmdldE51bWJlcigpOworICAgICAgICAgICAgU3RyaW5nW10gZW1haWxzID0gcmVjb3JkLmdldEVtYWlscygpOwogCi0gICAgICAgICAgICBpZiAoREJHKSBsb2coImxvYWRSZWNvcmQ6ICIgKyBhbHBoYVRhZyArICIsICIgKyBudW1iZXIpOworICAgICAgICAgICAgaWYgKERCRykgbG9nKCJsb2FkUmVjb3JkOiAiICsgYWxwaGFUYWcgKyAiLCAiICsgbnVtYmVyICsgIiwiKTsKICAgICAgICAgICAgIGNvbnRhY3QuYWRkKGFscGhhVGFnKTsKICAgICAgICAgICAgIGNvbnRhY3QuYWRkKG51bWJlcik7CisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGVtYWlsU3RyaW5nID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKworICAgICAgICAgICAgaWYgKGVtYWlscyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgZW1haWw6IGVtYWlscykgeworICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coIkFkZGluZyBlbWFpbDoiICsgZW1haWwpOworICAgICAgICAgICAgICAgICAgICBlbWFpbFN0cmluZy5hcHBlbmQoZW1haWwpOworICAgICAgICAgICAgICAgICAgICBlbWFpbFN0cmluZy5hcHBlbmQoIiwiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY29udGFjdC5hZGQoZW1haWxTdHJpbmcudG9TdHJpbmcoKSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGNvbnRhY3QuYWRkKG51bGwpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgcmVzdWx0cy5hZGQoY29udGFjdCk7CiAgICAgICAgIH0KICAgICB9CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvSWNjUmVjb3Jkcy5qYXZhIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0ljY1JlY29yZHMuamF2YQppbmRleCBlYTI0YzI1Li5iOGQ5ZTNjIDEwMDY0NAotLS0gYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90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gICAgICAgICAgICAgICAiYW5kcm9pZC5wZXJtaXNzaW9uLlNFTkRfU01TIiwKICAgICAgICAgICAgICAgICAiU2VuZGluZyBTTVMgbWVzc2FnZSIpOwotICAgICAgICBpZiAoREJHKSBsb2coInNlbmRSYXdQZHU6IHNtc2M9IiArIHNtc2MgKwotICAgICAgICAgICAgICAgICIgcGR1PSIrIHBkdSArICIgc2VudEludGVudCIgKyBzZW50SW50ZW50ICsKLSAgICAgICAgICAgICAgICAiIGRlbGl2ZXJ5SW50ZW50IiArIGRlbGl2ZXJ5SW50ZW50KTsKLSAgICAgICAgbURpc3BhdGNoZXIuc2VuZFJhd1BkdShzbXNjLCBwZHUsIHNlbnRJbnRlbnQsIGRlbGl2ZXJ5SW50ZW50KTsKKyAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKCJTTVMiLCBMb2cuVkVSQk9TRSkpIHsKKyAgICAgICAgICAgIGxvZygic2VuZERhdGE6IGRlc3RBZGRyPSIgKyBkZXN0QWRkciArICIgc2NBZGRyPSIgKyBzY0FkZHIgKyAiIGRlc3RQb3J0PSIgKworICAgICAgICAgICAgICAgIGRlc3RQb3J0ICsgIiBkYXRhPSciKyBIZXhEdW1wLnRvSGV4U3RyaW5nKGRhdGEpICArICInIHNlbnRJbnRlbnQ9IiArCisgICAgICAgICAgICAgICAgc2VudEludGVudCArICIgZGVsaXZlcnlJbnRlbnQ9IiArIGRlbGl2ZXJ5SW50ZW50KTsKKyAgICAgICAgfQorICAgICAgICBtRGlzcGF0Y2hlci5zZW5kRGF0YShkZXN0QWRkciwgc2NBZGRyLCBkZXN0UG9ydCwgZGF0YSwgc2VudEludGVudCwgZGVsaXZlcnlJbnRlbnQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNlbmQgYSB0ZXh0IGJhc2VkIFNNUy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBkZXN0QWRkciB0aGUgYWRkcmVzcyB0byBzZW5kIHRoZSBtZXNzYWdlIHRvCisgICAgICogQH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SW50ZW50LiBJZiBzZW50SW50ZW50CisgICAgICogIGlzIE5VTEwgdGhlIGNhbGxlciB3aWxsIGJlIGNoZWNrZWQgYWdhaW5zdCBhbGwgdW5rbm93biBhcHBsaWNhdGlvbnMsCisgICAgICogIHdoaWNoIGNhdXNlIHNtYWxsZXIgbnVtYmVyIG9mIFNNUyB0byBiZSBzZW50IGluIGNoZWNraW5nIHBlcmlvZC4KKyAgICAgKiBAcGFyYW0gZGVsaXZlcnlJbnRlbnQgaWYgbm90IE5VTEwgdGhpcyA8Y29kZT5QZW5kaW5nSW50ZW50PC9jb2RlPiBpcworICAgICAqICBicm9hZGNhc3Qgd2hlbiB0aGUgbWVzc2FnZSBpcyBkZWxpdmVyZWQgdG8gdGhlIHJlY2lwaWVudC4gIFRoZQorICAgICAqICByYXcgcGR1IG9mIHRoZSBzdGF0dXMgcmVwb3J0IGlzIGluIHRoZSBleHRlbmRlZCBkYXRhICgicGR1IikuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2VuZFRleHQoU3RyaW5nIGRlc3RBZGRyLCBTdHJpbmcgc2NBZGRyLAorICAgICAgICAgICAgU3RyaW5nIHRleHQsIFBlbmRpbmdJbnRlbnQgc2VudEludGVudCwgUGVuZGluZ0ludGVudCBkZWxpdmVyeUludGVudCkgeworICAgICAgICBtUGhvbmUuZ2V0Q29udGV4dCgpLmVuZm9yY2VDYWxsaW5nUGVybWlzc2lvbigKKyAgICAgICAgICAgICAgICAiYW5kcm9pZC5wZXJtaXNzaW9uLlNFTkRfU01TIiwKKyAgICAgICAgICAgICAgICAiU2VuZGluZyBTTVMgbWVzc2FnZSIpOworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoIlNNUyIsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgbG9nKCJzZW5kVGV4dDogZGVzdEFkZHI9IiArIGRlc3RBZGRyICsgIiBzY0FkZHI9IiArIHNjQWRkciArCisgICAgICAgICAgICAgICAgIiB0ZXh0PSciKyB0ZXh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BlbmRpbmdJbnRlbnQ+IGRlbGl2ZXJ5SW50ZW50cykgewotICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBtUGhvbmUuZ2V0Q29udGV4dCgpOwotCi0gICAgICAgIGNvbnRleHQuZW5mb3JjZUNhbGxpbmdQZXJtaXNzaW9uKAorICAgICAgICBtUGhvbmUuZ2V0Q29udGV4dCgpLmVuZm9yY2VDYWxsaW5nUGVybWlzc2lvbigKICAgICAgICAgICAgICAgICAiYW5kcm9pZC5wZXJtaXNzaW9uLlNFTkRfU01TIiwKICAgICAgICAgICAgICAgICAiU2VuZGluZyBTTVMgbWVzc2FnZSIpOwotICAgICAgICBpZiAoREJHKSBsb2coInNlbmRNdWx0aXBhcnRUZXh0Iik7Ci0gICAgICAgIG1EaXNwYXRjaGVyLnNlbmRNdWx0aXBhcnRUZXh0KGRlc3RpbmF0aW9uQWRkcmVzcywgc2NBZGRyZXNzLCAoQXJyYXlMaXN0PFN0cmluZz4pIHBhcnRzLAorICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoIlNNUyIsIExvZy5WRVJCT1NFKSkgeworICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgZm9yIChTdHJpbmcgcGFydCA6IHBhcnRzKSB7CisgICAgICAgICAgICAgICAgbG9nKCJzZW5kTXVsdGlwYXJ0VGV4dDogZGVzdEFkZHI9IiArIGRlc3RBZGRyICsgIiwgc3JBZGRyPSIgKyBzY0FkZHIgKworICAgICAgICAgICAgICAgICAgICAgICAgIiwgcGFydFsiICsgKGkrKykgKyAiXT0iICsgcGFydCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbURpc3BhdGNoZXIuc2VuZE11bHRpcGFydFRleHQoZGVzdEFkZHIsIHNjQWRkciwgKEFycmF5TGlzdDxTdHJpbmc+KSBwYXJ0cywKICAgICAgICAgICAgICAgICAoQXJyYXlMaXN0PFBlbmRpbmdJbnRlbnQ+KSBzZW50SW50ZW50cywgKEFycmF5TG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hcmUgYnJva2VuIGRvd24gYXMgZm9sbG93cyAobXNiIHRvIGxzYik6JywKKyAgICAgICAgICAgICAgICAgICAgJyAgICBpc28gY291bnRyeSBjb2RlIDE2IGJpdHMnLAorICAgICAgICAgICAgICAgICAgICAnICAgICh1bnVzZWQpICAgICAgICAgIDEgYml0JywKKyAgICAgICAgICAgICAgICAgICAgJyAgICB3aWZpIGNoYW5uZWwgICAgICA0IGJpdHMnLAorICAgICAgICAgICAgICAgICAgICAnICAgIHNtYWxsZWQgZGlnaXQgICAgIDIgYml0cycsCisgICAgICAgICAgICAgICAgICAgICcgICAgZGVmYXVsdCB0aW1lem9uZSAgNSBiaXRzJywKKyAgICAgICAgICAgICAgICAgICAgJyAgICBkZWZhdWx0IGxhbmd1YWdlICA0IGJpdHMnXSkKK3ByaW50IGZtdF9saXN0KCdpbnRbXSBJTkRfQ09ERVMnLCBpbmRfY29kZXMsIDYpCisKK2RlZiBwYXJzZV9pbmRfY29kZShpbmQpOgorICBtY2MgPSBldmFsKG1jY19jb2Rlc1tpbmRdKQorICBjb2RlID0gZXZhbChpbmRfY29kZXNbaW5kXSkKKyAgaXNvX2xzYiA9IGludCgoY29kZSA+PiAxNikgJiAweDAwRkYpCisgIGlzb19tc2IgPSBpbnQoKGNvZGUgPj4gMjQpICYgMHgwMEZGKQorICBpc28gPSAnJXMlcycgJSAoY2hyKGlzb19tc2IpLCBjaHIoaXNvX2xzYikpCisgIHdpZmkgPSBpbnQoKGNvZGUgPj4gMTEpICYgMHgwMDBGKQorICBzZCA9IGludCgoY29kZSA+PiA5KSAmIDB4MDAwMykKKyAgdHpfaW5kID0gKGNvZGUgPj4gNCkgJiAweDAwMUYKKyAgbGFuZ19pbmQgPSAoY29kZSA+PiAwKSAmIDB4MDAwRgorICByZXR1cm4gKG1jYywgaXNvLCBzZCwgdHpfc2V0W3R6X2luZF0sIGxhbmdfc2V0W2xhbmdfaW5kXSwgd2lmaSkKKworZm10X3N0ciA9ICdtY2MgPSAlcywgaX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aW5nIExPR19UQUcgPSAiTWNjVGFibGUiOworCisgICAgLyoqCisgICAgICogR2l2ZW4gYSBNb2JpbGUgQ291bnRyeSBDb2RlLCByZXR1cm5zIGEgZGVmYXVsdCB0aW1lIHpvbmUgSUQKKyAgICAgKiBpZiBhdmFpbGFibGUuICBSZXR1cm5zIG51bGwgaWYgdW5hdmFpbGFibGUuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZGVmYXVsdFRpbWVab25lRm9yTWNjKGludCBtY2MpIHsKKyAgICAgICAgaW50IGluZGV4ID0gQXJyYXlzLmJpbmFyeVNlYXJjaChNQ0NfQ09ERVMsIChzaG9ydCltY2MpOworICAgICAgICBpZiAoaW5kZXggPCAwKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBpbnQgaW5kQ29kZSA9IElORF9DT0RFU1tpbmRleF07CisgICAgICAgIGludCB0ekluZCA9IChpbmRDb2RlID4+PiA0KSAmIDB4MDAxRjsKKyAgICAgICAgU3RyaW5nIHR6ID0gVFpfU1RSSU5HU1t0ekluZF07CisgICAgICAgIGlmICh0eiA9PSAiIikgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHR6OworICAgIH0KKworICAgIC8qKgorICAgICAqIEdpdmVuIGEgTW9iaWxlIENvdW50cnkgQ29kZSwgcmV0dXJucyBhbiBJU08gdHdvLWNoYXJhY3RlcgorICAgICAqIGNvdW50cnkgY29kZSBpZiBhdmFpbGFibGUuICBSZXR1cm5zICIiIGlmIHVuYXZhaWxhYmxlLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGNvdW50cnlDb2RlRm9yTWNjKGludCBtY2MpIHsKKyAgICAgICAgaW50IGluZGV4ID0gQXJyYXlzLmJpbmFyeVNlYXJjaChNQ0NfQ09ERVMsIChzaG9ydCltY2MpOworICAgICAgICBpZiAoaW5kZXggPCAwKSB7CisgICAgICAgICAgICByZXR1cm4gIiI7CisgICAgICAgIH0KKyAgICAgICAgaW50IGluZENvZGUgPSBJTkRfQ09ERVNbaW5kZXhdOworICAgICAgICBieXRlW10gaXNvID0geyhieXRlKSgoaW5kQ29kZSA+Pj4gMjQpICYgMHgwMEZGKSwgKGJ5dGUpKChpbmRDb2RlID4+PiAxNikgJiAweDAwRkYpfTsKKyAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcoaXNvKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHaXZlbiBhIEdTTSBNb2JpbGUgQ291bnRyeSBDb2RlLCByZXR1cm5zIGFuIElTTyAyLTMgY2hhcmFjdGVyCisgICAgICogbGFuZ3VhZ2UgY29kZSBpZiBhdmFpbGFibGUuICBSZXR1cm5zIG51bGwgaWYgdW5hdmFpbGFibGUuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZGVmYXVsdExhbmd1YWdlRm9yTWNjKGludCBtY2MpIHsKKyAgICAgICAgaW50IGluZGV4ID0gQXJyYXlzLmJpbmFyeVNlYXJjaChNQ0NfQ09ERVMsIChzaG9ydCltY2MpOworICAgICAgICBpZiAoaW5kZXggPCAwKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBpbnQgaW5kQ29kZSA9IElORF9DT0RFU1tpbmRleF07CisgICAgICAgIGludCBsYW5nSW5kID0gaW5kQ29kZSAmIDB4MDAwRjsKKyAgICAgICAgU3RyaW5nIGxhbmcgPSBMQU5HX1NUUklOR1NbbGFuZ0luZF07CisgICAgICAgIGlmIChsYW5nID09ICIiKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbGFuZzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHaXZlbiBhIEdTTSBNb2JpbGUgQ291bnRyeSBDb2RlLCByZXR1cm5zIHRoZSBjb3JyZXNwb25kaW5nCisgICAgICogc21hbGxlc3QgbnVtYmVyIG9mIGRpZ2l0cyBmaWVsZC4gIFJldHVybnMgMiBpZiB1bmF2YWlsYWJsZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGludCBzbWFsbGVzdERpZ2l0c01jY0Zvck1uYyhpbnQgbWNjKSB7CisgICAgICAgIGludCBpbmRleCA9IEFycmF5cy5iaW5hcnlTZWFyY2goTUNDX0NPREVTLCAoc2hvcnQpbWNjKTsKKyAgICAgICAgaWYgKGluZGV4IDwgMCkgeworICAgICAgICAgICAgcmV0dXJuIDI7CisgICAgICAgIH0KKyAgICAgICAgaW50IGluZENvZGUgPSBJTkRfQ09ERVNbaW5kZXhdOworICAgICAgICBpbnQgc21EaWcgPSAoaW5kQ29kZSA+Pj4gOSkgJiAweDAwMDM7CisgICAgICAgIHJldHVybiBzbURpZzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHaXZlbiBhIEdTTSBNb2JpbGUgQ291bnRyeSBDb2RlLCByZXR1cm5zIHRoZSBudW1iZXIgb2Ygd2lmaQorICAgICAqIGNoYW5uZWxzIGFsbG93ZWQgaW4gdGhhdCBjb3VudHJ5LiAgUmV0dXJucyAwIGlmIHVuYXZhaWxhYmxlLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgaW50IHdpZmlDaGFubmVsc0Zvck1jYyhpbnQgbWNjKSB7CisgICAgICAgIGludCBpbmRleCA9IEFycmF5cy5iaW5hcnlTZWFyY2goTUNDX0NPREVTLCAoc2hvcnQpbWNjKTsKKyAgICAgICAgaWYgKGluZGV4IDwgMCkgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICAgICAgaW50IGluZENvZGUgPSBJTkRfQ09ERVNbaW5kZXhdOworICAgICAgICBpbnQgd2lmaSA9IChpbmRDb2RlID4+PiAxMSkgJiAweDAwMEY7CisgICAgICAgIHJldHVybiB3aWZpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFVwZGF0ZXMgTUND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ChtY2MgIT0gMCkgeworICAgICAgICAgICAgY29uZmlnLm1jYyA9IG1jYzsKKyAgICAgICAgICAgIHNldFRpbWV6b25lRnJvbU1jY0lmTmVlZGVkKHBob25lLCBtY2MpOworICAgICAgICAgICAgc2V0TG9jYWxlRnJvbU1jY0lmTmVlZGVkKHBob25lLCBtY2MpOworICAgICAgICAgICAgc2V0V2lmaUNoYW5uZWxzRnJvbU1jY0lmTmVlZGVkKHBob25lLCBtY2MpOworICAgICAgICB9CisgICAgICAgIGlmIChtbmMgIT0gMCkgeworICAgICAgICAgICAgY29uZmlnLm1uYyA9IG1uYzsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgQWN0aXZpdHlNYW5hZ2VyTmF0aXZlLmdldERlZmF1bHQoKS51cGRhdGVDb25maWd1cmF0aW9uKGNvbmZpZyk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiQ2FuJ3QgdXBkYXRlIGNvbmZpZ3VyYXRpb24iLCBlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIElmIHRoZSB0aW1lem9uZSBpcyBub3QgYWxyZWFkeSBzZXQsIHNldCBpdCBiYXNlZCBvbiB0aGUgTUNDIG9mIHRoZSBTSU0uCisgICAgICogQHBhcmFtIHBob25lIFBob25lQmFzZSB0byBhY3Qgb24gKGdldCBjb250ZXh0IGZyb20pLgorICAgICAqIEBwYXJhbSBtY2MgTW9iaWxlIENvdW50cnkgQ29kZSBvZiB0aGUgU0lNIG9yIFNJTS1saWtlIGVudGl0eSAoYnVpbGQgcHJvcCBvbiBDRE1BKQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgc2V0VGltZXpvbmVGcm9tTWNjSWZOZWVkZWQoUGhvbmVCYXNlIHBob25lLCBpbnQgbWNjKSB7CisgICAgICAgIFN0cmluZyB0aW1lem9uZSA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KFNlcnZpY2VTdGF0ZVRyYWNrZXIuVElNRVpPTkVfUFJPUEVSVFkpOworICAgICAgICBpZiAodGltZXpvbmUgPT0gbnVsbCB8fCB0aW1lem9uZS5sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICBTdHJpbmcgem9uZUlkID0gZGVmYXVsdFRpbWVab25lRm9yTWNjKG1jYyk7CisgICAgICAgICAgICBpZiAoem9uZUlkICE9IG51bGwgJiYgem9uZUlkLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgICAgIENvbnRleHQgY29udGV4dCA9IHBob25lLmdldENvbnRleHQoKTsKKyAgICAgICAgICAgICAgICAvLyBTZXQgdGltZSB6b25lIGJhc2VkIG9uIE1DQworICAgICAgICAgICAgICAgIEFsYXJtTWFuYWdlciBhbGFybSA9CisgICAgICAgICAgICAgICAgICAgICAgICAoQWxhcm1NYW5hZ2VyKSBjb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5BTEFSTV9TRVJWSUNFKTsKKyAgICAgICAgICAgICAgICBhbGFybS5zZXRUaW1lWm9uZSh6b25lSWQpOworICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJ0aW1lem9uZSBzZXQgdG8gIit6b25lSWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogSWYgdGhlIGxvY2FsZSBpcyBub3QgYWxyZWFkeSBzZXQsIHNldCBpdCBiYXNlZCBvbiB0aGUgTUNDIG9mIHRoZSBTSU0uCisgICAgICogQHBhcmFtIHBob25lIFBob25lQmFzZSB0byBhY3Qgb24uCisgICAgICogQHBhcmFtIG1jYyBNb2JpbGUgQ291bnRyeSBDb2RlIG9mIHRoZSBTSU0gb3IgU0lNLWxpa2UgZW50aXR5IChidWlsZCBwcm9wIG9uIENETUEpCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBzZXRMb2NhbGVGcm9tTWNjS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gcHJvdGVjdGVkIHN0YXRpYyBmaW5hbCBpbnQgRVZFTlRfU1NOICAgICAgICAgICAgICAgICAgICAgICAgID0gMjsKQEAgLTc5LDIwICs4MywyMiBAQAogICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX1NFVF9DQUxMX0ZPUldBUkRfRE9ORSAgICAgICA9IDEyOwogICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX0dFVF9DQUxMX0ZPUldBUkRfRE9ORSAgICAgICA9IDEzOwogICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX0NBTExfUklORyAgICAgICAgICAgICAgICAgICA9IDE0OworICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX0NBTExfUklOR19DT05USU5VRSAgICAgICAgICA9IDE1OworCiAgICAgLy8gVXNlZCB0byBpbnRlcmNlcHQgdGhlIGNhcnJpZXIgc2VsZWN0aW9uIGNhbGxzIHNvIHRoYXQKICAgICAvLyB3ZSBjYW4gc2F2ZSB0aGUgdmFsdWVzLgotICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX1NFVF9ORVRXT1JLX01BTlVBTF9DT01QTEVURSAgICA9IDE1OwotICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX1NFVF9ORVRXT1JLX0FVVE9NQVRJQ19DT01QTEVURSA9IDE2OwotICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX1NFVF9DTElSX0NPTVBMRVRFICAgICAgICAgICAgICA9IDE3OwotICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX1JFR0lTVEVSRURfVE9fTkVUV09SSyAgICAgICAgICA9IDE4OwotICAgIHByb3RlY3RlZCBzdGF0aWMgZmluYWwgaW50IEVWRU5UX1NFVF9WTV9OVU1CRVJfRE9ORSAgICAgICAgICAgICA9IDE5Owor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Wl2ZWQgc3RhdGU9IiArIGdldFN0YXRlKCkpOworICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7CisgICAgICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIFBob25lLlN0YXRlIHN0YXRlID0gZ2V0U3RhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCghbURvZXNSaWxTZW5kTXVsdGlwbGVDYWxsUmluZykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKHN0YXRlID09IFBob25lLlN0YXRlLlJJTkdJTkcpIHx8IChzdGF0ZSA9PSBQaG9uZS5TdGF0ZS5JRExFKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DYWxsUmluZ0NvbnRpbnVlVG9rZW4gKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRJbmNvbWluZ0NhbGxSaW5nTm90aWZpY2F0aW9uKG1DYWxsUmluZ0NvbnRpbnVlVG9rZW4pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZ5SW5jb21pbmdSaW5nKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0FMTF9SSU5HX0NPTlRJTlVFOgorICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFdmVudCBFVkVOVF9DQUxMX1JJTkdfQ09OVElOVUUgUmVjZWl2ZWQgc3RhdD0iICsgZ2V0U3RhdGUoKSk7CisgICAgICAgICAgICAgICAgaWYgKGdldFN0YXRlKCkgPT0gUGhvbmUuU3RhdGUuUklOR0lORykgeworICAgICAgICAgICAgICAgICAgICBzZW5kSW5jb21pbmdDYWxsUmluZ05vdGlmaWNhdGlvbihtc2cuYXJnMSk7C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ICAgZ2V0UmVzb3VyY2VzKCkuZ2V0VGV4dEFycmF5KFIuYXJyYXkuY2Fycmllcl9sb2NhbGVzKTsKKyAgICAgICAgICAgICAgICBnZXRSZXNvdXJjZXMoKS5nZXRUZXh0QXJyYXkoUi5hcnJheS5jYXJyaWVyX3Byb3BlcnRpZXMpOwogCi0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY2FycmllckxvY2FsZXMubGVuZ3RoLTE7IGkrPTIpIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjYXJyaWVyTG9jYWxlcy5sZW5ndGg7IGkrPTMpIHsKICAgICAgICAgICAgIFN0cmluZyBjID0gY2FycmllckxvY2FsZXNbaV0udG9TdHJpbmcoKTsKLSAgICAgICAgICAgIFN0cmluZyBsID0gY2FycmllckxvY2FsZXNbaSsxXS50b1N0cmluZygpOwogICAgICAgICAgICAgaWYgKGNhcnJpZXIuZXF1YWxzKGMpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIGwgPSBjYXJyaWVyTG9jYWxlc1tpKzFdLnRvU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgaW50IHdpZmlDaGFubmVscyA9IDA7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgd2lmaUNoYW5uZWxzID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXJyaWVyTG9jYWxlc1tpKzJdLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBlKSB7IH0KKwogICAgICAgICAgICAgICAgIFN0cmluZyBsYW5ndWFnZSA9IGwuc3Vic3RyaW5nKDAsIDIpOwogICAgICAgICAgICAgICAgIFN0cmluZyBjb3VudHJ5ID0gIiI7CiAgICAgICAgICAgICAgICAgaWYgKGwubGVuZ3RoKCkgPj01KSB7CiAgICAgICAgICAgICAgICAgICAgIGNvdW50cnkgPSBsLnN1YnN0cmluZygzLCA1KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgc2V0U3lzdGVtTG9jYWxlKGxhbmd1YWdlLCBjb3VudHJ5KTsKKworICAgICAgICAgICAgICAgIGlmICh3aWZpQ2hhbm5lbHMgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLldJRklfTlVNX0FMTE9XRURfQ0hBTk5FTFMpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChTZXR0aW5ncy5TZXR0aW5nTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm90ZSB0aGlzIGlzIG5vdCBwZXJzaXN0aW5nCisgICAgICAgICAgICAgICAgICAgICAgICBXaWZpTWFuYWdlciB3TSA9IChXaWZpTWFuYWdlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LldJRklfU0VSVklDRSk7CisgICAgICAgICAgICAgICAgICAgICAgICB3TS5zZXROdW1BbGxvd2VkQ2hhbm5lbHMod2lmaUNoYW5uZWxzLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC01MzAsMTYgKzYxMiwyMiBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgLyoKLSAgICAgKiBSZXRyaWV2ZXMgdGhlIEhhbmRsZXIgb2YgdGhlIFBob25lIGluc3RhbmNlCisgICAgLyoqCisgICAgICogR2V0IHN0YXRlCiAgICAgICovCi0gIC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AgICAgZGNTdGF0ZSA9IERhdGFDb25uZWN0aW9uVHJhY2tlci5TdGF0ZS5GQUlMRUQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGRjU3RhdGUgPSBEYXRhQ29ubmVjdGlvblRyYWNrZXIuU3RhdGUuQ09OTkVDVElORzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIG1EYXRhQ29ubmVjdGlvbi5zZXRTdGF0ZShkY1N0YXRlKTsKKyAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24obnVsbCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogTm90aWZpeSByZWdpc3RyYW50cyBvZiBhIG5ldyByaW5naW5nIENvbm5lY3Rpb24uCisgICAgICogU3ViY2xhc3NlcyBvZiBQaG9uZSBwcm9iYWJseSB3YW50IHRvIHJlcGxhY2UgdGhpcyB3aXRoIGEKKyAgICAgKiB2ZXJzaW9uIHNjb3BlZCB0byB0aGVpciBwYWNrYWdlcworICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIG5vdGlmeU5ld1JpbmdpbmdDb25uZWN0aW9uUChDb25uZWN0aW9uIGNuKSB7CisgICAgICAgIEFzeW5jUmVzdWx0IGFyID0gbmV3IEFzeW5jUmVzdWx0KG51bGwsIGNuLCBudWxsKTsKKyAgICAgICAgbU5ld1JpbmdpbmdDb25uZWN0aW9uUmVnaXN0cmFudHMubm90aWZ5UmVnaXN0cmFudHMoYXIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIE5vdGlmeSByZWdpc3RyYW50cyBvZiBhIFJJTkcgZXZlbnQuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIG5vdGlmeUluY29taW5nUmluZygpIHsKKyAgICAgICAgQXN5bmNSZXN1bHQgYXIgPSBuZXcgQXN5bmNSZXN1bHQobnVsbCwgdGhpcywgbnVsbCk7CisgICAgICAgIG1JbmNvbWluZ1JpbmdSZWdpc3RyYW50cy5ub3RpZnlSZWdpc3RyYW50cyhhcik7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2VuZCB0aGUgaW5jb21pbmcgY2FsbCBSaW5nIG5vdGlmaWNhdGlvbiBpZiBjb25kaXRpb25zIGFyZSByaWdodC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgc2VuZEluY29taW5nQ2FsbFJpbmdOb3RpZmljYXRpb24oaW50IHRva2VuKSB7CisgICAgICAgIGlmICghbURvZXNSaWxTZW5kTXVsdGlwbGVDYWxsUmluZyAmJiAodG9rZW4gPT0gbUNhbGxSaW5nQ29udGludWVUb2tlbikpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJTZW5kaW5nIG5vdGlmeUluY29taW5nUmluZyIpOworICAgICAgICAgICAgbm90aWZ5SW5jb21pbmdSaW5nKCk7CisgICAgICAgICAgICBzZW5kTWVzc2FnZURlbGF5ZWQoCisgICAgICAgICAgICAgICAgICAgIG9idGFpbk1lc3NhZ2UoRVZFTlRfQ0FMTF9SSU5HX0NPTlRJTlVFLCB0b2tlbiwgMCksIG1DYWxsUmluZ0RlbGF5KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJJZ25vcmluZyByaW5nIG5vdGlmaWNhdGlvbiByZXF1ZXN0LCIKKyAgICAgICAgICAgICAgICAgICAgKyAiIG1Eb2VzUmlsU2VuZE11bHRpcGxlQ2FsbFJpbmc9IiArIG1Eb2VzUmlsU2VuZE11bHRpcGxlQ2FsbFJpbmcKKyAgICAgICAgICAgICAgICAgICAgKyAiIHRva2VuPSIgKyB0b2tlbgorICAgICAgICAgICAgICAgICAgICArICIgbUNhbGxSaW5nQ29udGludWVUb2tlbj0iICsgbUNhbGxSaW5nQ29udGludWVUb2tlbik7CisgICAgICAgIH0KKyAgICB9CiB9CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pb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KyAiPiAiICsgcmVxdWVzdFRvU3RyaW5nKHJyLm1SZXF1ZXN0KSArICIgIgotICAgICAgICAgICAgICAgICsgYXBuKTsKKyAgICAgICAgaWYgKFJJTEpfTE9HRCkgcmlsakxvZyhyci5zZXJpYWxTdHJpbmcoKSArICI+ICIKKyAgICAgICAgICAgICAgICArIHJlcXVlc3RUb1N0cmluZyhyci5tUmVxdWVzdCkgKyAiICIgKyByYWRpb1RlY2hub2xvZ3kgKyAiICIKKyAgICAgICAgICAgICAgICArIHByb2ZpbGUgKyAiICIgKyBhcG4gKyAiICIgKyB1c2VyICsgIiAiCisgICAgICAgICAgICAgICAgKyBwYXNzd29yZCArICIgIiArIGF1dGhUeXBlKTsKIAogICAgICAgICBzZW5kKHJyKTsKICAgICB9CkBAIC0yNTA3LDYgKzI1MTEsNyBAQAogICAgICAgICAgICAgICAgICAgICBtUmVzdHJpY3RlZFN0YXRlUmVnaXN0cmFudC5ub3RpZnlSZWdpc3RyYW50KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBBc3luY1Jlc3VsdCAobnVsbCwgcmV0LCBudWxsKSk7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICBjYXNlIFJJTF9VTlNPTF9SRVNQT05TRV9TSU1fU1RBVFVTX0NIQU5HRUQ6CiAgICAgICAgICAgICAgICAgaWYgKFJJTEpfTE9HRCkgdW5zbGpMb2cocmVzcG9uc2UpOwpAQCAtMjU1Myw3ICsyNTU4LDcgQEAKICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgY2FzZSBSSUxfVU5TT0xfQ0RNQV9DQUxMX1dBSVRJTkc6Ci0gICAgICAgICAgICAgICAgaWYgKFJJTEpfTE9HRCkgdW5zbGpMb2cocmVzcG9uc2UpOworICAgICAgICAgICAgICAgIGlmIChSSUxKX0xPR0QpIHVuc2xqTG9nUmV0KHJlc3BvbnNlLCByZXQpO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EludCgpKTsKQEAgLTI3NjIsNjIgKzI3NjUsOSBAQAogICAgICAgICAgICAgY2EucGluMV9yZXBsYWNlZCAgPSBwLnJlYWRJbnQoKTsKICAgICAgICAgICAgIGNhLnBpbjEgICAgICAgICAgID0gcC5yZWFkSW50KCk7CiAgICAgICAgICAgICBjYS5waW4yICAgICAgICAgICA9IHAucmVhZEludCgpOwotICAgICAgICAgICAgc3RhdHVzLmFwcGxpY2F0aW9uLmFkZChjYSk7CisgICAgICAgICAgICBzdGF0dXMuYWRkQXBwbGljYXRpb24oY2EpOwogICAgICAgICB9Ci0KLSAgICAgICAgLy8gdGhpcyBpcyBjb21tb24gZm9yIGFsbCByYWRpbyB0ZWNobm9sb2dpZXMKLSAgICAgICAgaWYgKCFzdGF0dXMuY2FyZF9zdGF0ZS5pc0NhcmRQcmVzZW50KCkpIHsKLSAgICAgICAgICAgIHJldHVybiBJY2NTdGF0dXMuSUNDX0FCU0VOVDsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIGNoZWNrIHJhZGlvIHRlY2hub2xvZ3kKLSAgICAgICAgaWYoIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuUkFESU9fT0ZGICAgICAgICAgfHwKLSAgICAgICAgICAgIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuUkFESU9fVU5BVkFJTEFCTEUgfHwKLSAgICAgICAgICAgIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuU0lNX05PVF9SRUFEWSAgICAgfHwKLSAgICAgICAgICAgIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuUlVJTV9OT1RfUkVBRFkgICAgfHwKLSAgICAgICAgICAgIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuTlZfTk9UX1JFQURZICAgICAgfHwKLSAgICAgICAgICAgIGN1cnJlbnRSYWRpb1N0YXRlID09IFJhZGlvU3RhdGUuTlZfUkVBRFkgICAg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ZXRyeVJlYyB7CisgICAgICAgIFJldHJ5UmVjKGludCBkZWxheVRpbWUsIGludCByYW5kb21pemF0aW9uVGltZSkgeworICAgICAgICAgICAgbURlbGF5VGltZSA9IGRlbGF5VGltZTsKKyAgICAgICAgICAgIG1SYW5kb21pemF0aW9uVGltZSA9IHJhbmRvbWl6YXRpb25UaW1lOworICAgICAgICB9CisKKyAgICAgICAgaW50IG1EZWxheVRpbWU7CisgICAgICAgIGludCBtUmFuZG9taXphdGlvblRpbWU7CisgICAgfQorCisgICAgLyoqIFRoZSBhcnJheSBvZiByZXRyeSByZWNvcmRzICovCisgICAgcHJpdmF0ZSBBcnJheUxpc3Q8UmV0cnlSZWM+IG1SZXRyeUFycmF5ID0gbmV3IEFycmF5TGlzdDxSZXRyeVJlYz4oKTsKKworICAgIC8qKiBXaGVuIHRydWUgaXNSZXRyeU5lZWRlZCgpIHdpbGwgYWx3YXlzIHJldHVybiB0cnVlICovCisgICAgcHJpdmF0ZSBib29sZWFuIG1SZXRyeUZvcmV2ZXI7CisKKyAgICAvKioKKyAgICAgKiBUaGUgbWF4aW11bSBudW1iZXIgb2YgcmV0cmllcyB0byBhdHRlbXB0IGJlZm9yZQorICAgICAqIGlzUmV0cnlOZWVkZWQgcmV0dXJucyBmYWxzZQorICAgICAqLworICAgIHByaXZhdGUgaW50IG1NYXhSZXRyeUNvdW50OworCisgICAgLyoqIFRoZSBjdXJyZW50IG51bWJlciBvZiByZXRpcmVzICovCisgICAgcHJpdmF0ZSBpbnQgbVJldHJ5Q291bnQ7CisKKyAgICAvKiogUmFuZG9tIG51bWJlciBnZW5lcmF0b3IgKi8KKyAgICBwcml2YXRlIFJhbmRvbSBybmcgPSBuZXcgUmFuZG9tKCk7CisKKyAgICAvKiogQ29uc3RydWN0b3IgKi8KKyAgICBwdWJsaWMgUmV0cnlNYW5hZ2VyKCkgeworICAgICAgICBpZiAoREJHKSBsb2coImNvbnN0cnVjdG9yIik7CisgICAgfQorCisgICAgLyoqCisgICAgIC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dGVOb25OZWdhdGl2ZUludCgicmV0cnlUaW1lIiwgcmV0cnlUaW1lKSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCF2YWxpZGF0ZU5vbk5lZ2F0aXZlSW50KCJyYW5kb21pemF0aW9uVGltZSIsIHJhbmRvbWl6YXRpb25UaW1lKSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgbU1heFJldHJ5Q291bnQgPSBtYXhSZXRyeUNvdW50OworICAgICAgICByZXNldFJldHJ5Q291bnQoKTsKKyAgICAgICAgbVJldHJ5QXJyYXkuY2xlYXIoKTsKKyAgICAgICAgbVJldHJ5QXJyYXkuYWRkKG5ldyBSZXRyeVJlYyhyZXRyeVRpbWUsIHJhbmRvbWl6YXRpb25UaW1lKSk7CisKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ29uZmlndXJlIGZvciB1c2luZyBzdHJpbmcgd2hpY2ggYWxsb3cgYXJiaXRhcnkKKyAgICAgKiBzZXF1ZW5jZXMgb2YgdGltZXMuIFNlZSBjbGFzcyBjb21tZW50cyBmb3IgdGhlCisgICAgICogc3RyaW5nIGZvcm1hdC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gdHJ1ZSBpZiBzdWNjZXNzZnVsbAorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGNvbmZpZ3VyZShTdHJpbmcgY29uZmlnU3RyKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiY29uZmlndXJlOiAnIiArIGNvbmZpZ1N0ciArICInIik7CisKKyAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShjb25maWdTdHIpKSB7CisgICAgICAgICAgICBpbnQgZGVmYXVsdFJhbmRvbWl6YXRpb24gPSAwOworCisgICAgICAgICAgICBpZiAoREJHKSBsb2coImNvbmZpZ3VyZTogbm90IGVtcHR5Iik7CisKKyAgICAgICAgICAgIG1NYXhSZXRyeUNvdW50ID0gMDsKKyAgICAgICAgICAgIHJlc2V0UmV0cnlDb3VudCgpOworICAgICAgICAgICAgbVJldHJ5QXJyYXkuY2xlYXIoKTsKKworICAgICAgICAgICAgU3RyaW5nIHN0ckFycmF5W10gPSBjb25maWdTdHIuc3BsaXQoIiwiKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3RyQXJyYXkubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coImNvbmZpZ3VyZTogc3RyQXJyYXlbIiArIGkgKyAiXT0nIiArIHN0ckFycmF5W2ldICsgIiciKTsKKyAgICAgICAgICAgICAgICBQYWlyPEJvb2xlYW4sIEludGVnZXI+IHZhbHVlOworICAgICAgICAgICAgICAgIFN0cmluZyBzcGxpdFN0cltdID0gc3RyQXJyYXlbaV0uc3BsaXQoIj0iLCAyKTsKKyAgICAgICAgICAgICAgICBzcGxpdFN0clswXSA9IHNwbGl0U3RyWzBdLnRyaW0oKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coImNvbmZpZ3VyZTogc3BsaXRTdHJbMF09JyIgKyBzcGxpdFN0clswXSArICInIik7CisgICAgICAgICAgICAgICAgaWYgKHNwbGl0U3RyLmxlbmd0aCA+IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgc3BsaXRTdHJbMV0gPSBzcGxpdFN0clsxXS50cmltKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIGxvZygiY29uZmlndXJlOiBzcGxpdFN0clsxXT0nIiArIHNwbGl0U3RyWzFdICsgIiciKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5lcXVhbHMoc3BsaXRTdHJbMF0sICJkZWZhdWx0X3JhbmRvbWl6YXRpb24iKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBwYXJzZU5vbk5lZ2F0aXZlSW50KHNwbGl0U3RyWzBdLCBzcGxpdFN0clsxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlLmZpcnN0KSByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0UmFuZG9taXphdGlvbiA9IHZhbHVlLnNlY29uZDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChUZXh0VXRpbHMuZXF1YWxzKHNwbGl0U3RyWzBdLCAibWF4X3JldHJpZXMiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5lcXVhbHMoImluZmluaXRlIixzcGxpdFN0clsxXSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmV0cnlGb3JldmVyID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBwYXJzZU5vbk5lZ2F0aXZlSW50KHNwbGl0U3RyWzBdLCBzcGxpdFN0clsxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF2YWx1ZS5maXJzdCkgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYXhSZXRyeUNvdW50ID0gdmFsdWUuc2Vjb25kOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIlVucmVjb2duaXplZCBjb25maWd1cmF0aW9uIG5hbWUgdmFsdWUgcGFpcjogIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc3RyQXJyYXlbaV0pOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAqIEFzc3VtZSBhIHJldHJ5IHRpbWUgd2l0aCBhbiBvcHRpb25hbCByYW5kb21pemF0aW9uIHZhbHVlCisgICAgICAgICAgICAgICAgICAgICAqIGZvbGxvd2luZyBhICI6IgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgc3BsaXRTdHIgPSBzdHJBcnJheVtpXS5zcGxpdCgiOiIsIDIpOworICAgICAgICAgICAgICAgICAgICBzcGxpdFN0clswXSA9IHNwbGl0U3RyWzBdLnRyaW0oKTsKKyAgICAgICAgICAgICAgICAgICAgUmV0cnlSZWMgcnIgPSBuZXcgUmV0cnlSZWMoMCwgMCk7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcGFyc2VOb25OZWdhdGl2ZUludCgiZGVsYXlUaW1lIiwgc3BsaXRTdHJbMF0pOworICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlLmZpcnN0KSByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHJyLm1EZWxheVRpbWUgPSB2YWx1ZS5zZWNvbmQ7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgaWYgb3B0aW9uYWwgcmFuZG9taXphdGlvbiB2YWx1ZSBwcmVzZW50CisgICAgICAgICAgICAgICAgICAgIGlmIChzcGxpdFN0ci5sZW5ndGggPiAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGxpdFN0clsxXSA9IHNwbGl0U3RyWzFdLnRyaW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIGxvZygiY29uZmlndXJlOiBzcGxpdFN0clsxXT0nIiArIHNwbGl0U3RyWzFdICsgIiciKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcGFyc2VOb25OZWdhdGl2ZUludCgicmFuZG9taXphdGlvblRpbWUiLCBzcGxpdFN0clsxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlLmZpcnN0KSByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICByci5tUmFuZG9taXphdGlvblRpbWUgPSB2YWx1ZS5zZWNvbmQ7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByci5tUmFuZG9taXphdGlvblRpbWUgPSBkZWZhdWx0UmFuZG9taXphdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtUmV0cnlBcnJheS5hZGQocnIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtUmV0cnlBcnJheS5zaXplKCkgPiBtTWF4UmV0cnlDb3VudCkgeworICAgICAgICAgICAgICAgIG1NYXhSZXRyeUNvdW50ID0gbVJldHJ5QXJyYXkuc2l6ZSgpOworICAgICAgICAgICAgICAgIGlmIChEQkcpIGxvZygiY29uZmlndXJlOiBzZXR0aW5nIG1NYXhSZXRyeUNvdW50PSIgKyBtTWF4UmV0cnlDb3VudCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoREJHKSBsb2coImNvbmZpZ3VyZTogdHJ1ZSIpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoREJHKSBsb2coImNvbmZpZ3VyZTogZmFsc2UgaXQncyBlbXB0eSIpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVwb3J0IHdoZXRoZXIgZGF0YSByZWNvbm5lY3Rpb24gc2hvdWxkIGJlIHJldHJpZWQKKyAgICAgKgorICAgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IGlmIHRoZSBtYXggcmV0aXJlcyBoYXMgbm90IGJlZW4gcmVhY2hlZC4ge0Bjb2RlCisgICAgICogICAgICAgICBmYWxzZX0gb3RoZXJ3aXNlLgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGlzUmV0cnlOZWVkZWQoKSB7CisgICAgICAgIGJvb2xlYW4gcmV0VmFsID0gbVJldHJ5Rm9yZXZlciB8fCAobVJldHJ5Q291bnQgPCBtTWF4UmV0cnlDb3VudCk7CisgICAgICAgIGlmIChEQkcpIGxvZygiaXNSZXRyeU5lZWRlZDogIiArIHJldFZhbCk7CisgICAgICAgIHJldHVybiByZXRWYWw7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSB0aW1lciB0aGF0IHNob3VsZCBiZSB1c2VkIHRvIHRyaWdnZXIgdGhlIGRhdGEgcmVjb25uZWN0aW9uCisgICAgICovCisgICAgcHVibGljIGludCBnZXRSZXRyeVRpbWVyKCkgeworICAgICAgICBpbnQgaW5kZXg7CisgICAgICAgIGlmIChtUmV0cnlDb3VudCA8IG1SZXRyeUFycmF5LnNpemUoKSkgeworICAgICAgICAgICAgaW5kZXggPSBtUmV0cnlDb3VudDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGluZGV4ID0gbVJldHJ5QXJyYXkuc2l6ZSgpIC0gMTsKKyAgICAgICAgfQorCisgICAgICAgIGludCByZXRWYWw7CisgICAgICAgIGlmICgoaW5kZXggPj0gMCkgJiYgKGluZGV4IDwgbVJldHJ5QXJyYXkuc2l6ZSgpKSkgeworICAgICAgICAgICAgcmV0VmFsID0gbVJldHJ5QXJyYXkuZ2V0KGluZGV4KS5tRGVsYXlUaW1lICsgbmV4dFJhbmRvbWl6YXRpb25UaW1lKGluZGV4KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldFZhbCA9IDA7CisgICAgICAgIH0KKworICAgICAgICBpZiAoREJHKSBsb2coImdldFJldHJ5VGltZXI6ICIgKyByZXRWYWwpOworICAgICAgICByZXR1cm4gcmV0VmFsOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gcmV0cnkgY291bnQKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFJldHJ5Q291bnQoKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZ2V0UmV0cnlDb3VudDogIiArIG1SZXRyeUNvdW50KTsKKyAgICAgICAgcmV0dXJuIG1SZXRyeUNvdW50OworICAgIH0KKworICAgIC8qKgorICAgICAqIEluY3JlYXNlIHRoZSByZXRyeSBjb3VudGVyLCBkb2VzIG5vdCBjaGFuZ2UgcmV0cnkgZm9yZXZlci4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBpbmNyZWFzZVJldHJ5Q291bnQoKSB7CisgICAgICAgIG1SZXRyeUNvdW50Kys7CisgICAgICAgIGlmIChtUmV0cnlDb3VudCA+IG1NYXhSZXRyeUNvdW50KSB7CisgICAgICAgICAgICBtUmV0cnlDb3VudCA9IG1NYXhSZXRyeUNvdW50OworICAgICAgICB9CisgICAgICAgIGlmIChEQkcpIGxvZygiaW5jcmVzZVJldHJ5Q291bnQ6ICIgKyBtUmV0cnlDb3VudCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHJldHJ5IGNvdW50IHRvIHRoZSBzcGVjaWZpZWQgdmFsdWUKKyAgICAgKiBhbmQgdHVybnMgb2ZmIHJldHJ5aW5nIGZvcmV2ZXIuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0UmV0cnlDb3VudChpbnQgY291bnQpIHsKKyAgICAgICAgbVJldHJ5Q291bnQgPSBjb3VudDsKKyAgICAgICAgaWYgKG1SZXRyeUNvdW50ID4gbU1heFJldHJ5Q291bnQpIHsKKyAgICAgICAgICAgIG1SZXRyeUNvdW50ID0gbU1heFJldHJ5Q291bnQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAobVJldHJ5Q291bnQgPCAwKSB7CisgICAgICAgICAgICBtUmV0cnlDb3VudCA9IDA7CisgICAgICAgIH0KKworICAgICAgICBtUmV0cnlGb3JldmVyID0gZmFsc2U7CisgICAgICAgIGlmIChEQkcpIGxvZygic2V0UmV0cnlDb3VudDogIiArIG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YWw7CisgICAgfQorCisgICAgLyoqCisgICAgICogVmFsaWRhdGUgYW4gaW50ZWdlciBpcyA+PSAwIGFuZCBsb2dzIGFuIGVycm9yIGlmIG5vdAorICAgICAqCisgICAgICogQHBhcmFtIG5hbWUKKyAgICAgKiBAcGFyYW0gdmFsdWUKKyAgICAgKiBAcmV0dXJuIFBhaXIuZmlyc3QKKyAgICAgKi8KKyAgICBwcml2YXRlIGJvb2xlYW4gdmFsaWRhdGVOb25OZWdhdGl2ZUludChTdHJpbmcgbmFtZSwgaW50IHZhbHVlKSB7CisgICAgICAgIGJvb2xlYW4gcmV0VmFsOworICAgICAgICBpZiAodmFsdWUgPCAwKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCBuYW1lICsgIiBiYWQgdmFsdWU6IGlzIDwgMCIpOworICAgICAgICAgICAgcmV0VmFsID0gZmFsc2U7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXRWYWwgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmIChEQkcpIGxvZygidmFsaWRhdGVOb25OZWdhdGl2ZTogIiArIG5hbWUgKyAiLCAiICsgdmFsdWUgKyAiLCAiICsgcmV0VmFsKTsKKyAgICAgICAgcmV0dXJuIHJldFZhbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gbmV4dCByYW5kb20gbnVtYmVyIGZvciB0aGUgaW5kZXgKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBuZXh0UmFuZG9taXphdGlvblRpbWUoaW50IGluZGV4KSB7CisgICAgICAgIGludCByYW5kb21UaW1lID0gbVJldHJ5QXJyYXkuZ2V0KGluZGV4KS5tUmFuZG9taXphdGlvblRpbWU7CisgICAgICAgIGlmIChyYW5kb21UaW1lID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIHJuZy5uZXh0SW50KHJhbmRvbVRpbWUpOworICAgICAgICB9CisgIC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QWN0aXZpdHkuUkVTVUxUX09LKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBSRVNVTFRfT0sgbWVhbnMgdGhhdCBtZXNzYWdlIHdhcyBicm9hZGNhc3QgZm9yIGFwcChzKSB0byBoYW5kbGUuCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBBbnkgb3RoZXIgcmVzdWx0LCB3ZSBzaG91bGQgYWNrIGhlcmUuCi0gICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGhhbmRsZWQgPSAocmVzdWx0ID09IEludGVudHMuUkVTVUxUX1NNU19IQU5ETEVEKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFja25vd2xlZGdlTGFzdEluY29taW5nU21zKGhhbmRsZWQsIHJlc3VsdCwgbnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBhY2tub3dsZWRnZUxhc3RJbmNvbWluZ1NtcyhmYWxzZSwgSW50ZW50cy5SRVNVTFRfU01TX09VVF9PRl9NRU1PUlksIG51bGwpOworICAgICAgICAgICAgICAgIGludCByZXN1bHQgPSBkaXNwYXRjaE1lc3NhZ2Uoc21zLm1XcmFwcGVkU21zTWVzc2FnZSk7CisgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBBY3Rpdml0eS5SRVNVTFRfT0spIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gUkVTVUxUX09LIG1lYW5zIHRoYXQgbWVzc2FnZSB3YXMgYnJvYWRjYXN0IGZvciBhcHAocykgdG8gaGFuZGxlLgorICAgICAgICAgICAgICAgICAgICAvLyBBbnkgb3RoZXIgcmVzdWx0LCB3ZSBzaG91bGQgYWNrIGhlcmUuCisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IChyZXN1bHQgPT0gSW50ZW50cy5SRVNVTFRfU01TX0hBTkRMRUQpOworICAgICAgICAgICAgICAgICAgICBub3RpZnlBbmRBY2tub3dsZWRnZUxhc3RJbmNvbWluZ1NtcyhoYW5kbGVkLCByZXN1bHQsIG51bGwpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gY2F0Y2ggKFJ1bnRpbWVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICBhY2tub3dsZWRnZUxhc3RJbmNvbWluZ1NtcyhmYWxzZSwgSW50ZW50cy5SRVNVTFRfU01TX0dFTkVSSUNfRVJST1IsIG51bGwpOworICAgICAgICAgICAgICAgIG5vdGlmeUFuZEFja25vd2xlZGdlTGFzdEluY29taW5nU21zKGZhbHNlLCBJbnRlbnRzLlJFU1VMVF9TTVNfR0VORVJJQ19FUlJPUiwgbnVsbCk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGJyZWFrOwpAQCAtMzMwLDE3ICszMzIsNDEgQEAKICAgICAgICAgY2FzZSBFVkVOVF9BTEVSVF9USU1FT1VUOgogICAgICAgICAgICAgKChBbGVydERpYWxvZykobXNnLm9iaikpLmRpc21pc3MoKTsKICAgICAgICAgICAgIG1zZy5vYmogPSBudWxsOwotICAgICAgICAgICAgbVNUcmFja2VyID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChtU1RyYWNrZXJzLmlzRW1wdHkoKSA9PSBmYWxzZSkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIFNtc1RyYWNrZXIgc1RyYWNrZXIgPSAoU21zVHJhY2tlciltU1RyYWNrZXJzLnJlbW92ZSgwKTsKKyAgICAgICAgICAgICAgICAgICAgc1RyYWNrZXIubVNlbnRJbnRlbnQuc2VuZChSRVNVTFRfRVJST1JfTElNSVRfRVhDRUVERUQpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKENhbmNlbGVkRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImZhaWxlZCB0byBzZW5kIGJhY2sgUkVTVUxUX0VSUk9SX0xJTUlUX0VYQ0VFREVEIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKENvbmZpZy5MT0dEKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiRVZFTlRfQUxFUlRfVElNRU9VVCwgbWVzc2FnZSBzdG9wIHNlbmRpbmciKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgIGNhc2UgRVZFTlRfU0VORF9DT05GSVJNRURfU01TOgotICAgICAgICAgICAgaWYgKG1TVHJhY2tlciE9bnVsbCkgewotICAgICAgICAgICAgICAgIGlmIChpc011bHRpcGFydFRyYWNrZXIobVNUcmFja2VyKSkgewotICAgICAgICAgICAgICAgICAgICBzZW5kTXVsdGlwYXJ0U21zKG1TVHJhY2tlcik7CisgICAgICAgICAgICBpZiAobVNUcmFja2Vycy5pc0VtcHR5KCkgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICBTbXNUcmFja2VyIHNUcmFja2VyID0gKFNtc1RyYWNrZXIpbVNUcmFja2Vycy5yZW1vdmUobVNUcmFja2Vycy5zaXplKCkgLSAxKTsKKyAgICAgICAgICAgICAgICBpZiAoaXNNdWx0aXBhcnRUcmFja2VyKHNUcmFja2VyKSkgeworICAgICAgICAgICAgICAgICAgICBzZW5kTXVsdGlwYXJ0U21zKHNUcmFja2VyKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBzZW5kU21zKG1TVHJhY2tlcik7CisgICAgICAgICAgICAgICAgICAgIHNlbmRTbXMoc1RyYWNrZXIpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtU1RyYWNrZXIgPSBudWxsOworICAgICAgICAgICAgICAgIHJlbW92ZU1lc3NhZ2VzKEVWRU5UX0FMRVJUX1RJTUVPVVQsIG1zZy5vYmopOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBFVkVOVF9TVE9QX1NFTkRJTkc6CisgICAgICAgICAgICBpZiAobVNUcmFja2Vycy5pc0VtcHR5KCkgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIGxhdGVzdCBvbmUuCisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgU21zVHJhY2tlciBzVHJhY2tlciA9IChTbXNUcmFja2VyKW1TVHJhY2tlcnMucmVtb3ZlKG1TVHJhY2tlcnMuc2l6ZSgpIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIHNUcmFja2VyLm1TZW50SW50ZW50LnNlbmQoUkVTVUxUX0VSUk9SX0xJTUlUX0VYQ0VFREVEKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChDYW5jZWxlZEV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJmYWlsZWQgdG8gc2VuZCBiYWNrIFJFU1VMVF9FUlJPUl9MSU1JVF9FWENFRURFRCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZW1vdmVNZXNzYWdlcyhFVkVOVF9BTEVSVF9USU1FT1VULCBtc2cub2JqKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CkBAIC00NDUsNyArNDcxLDExIEBACiAgICAgICAgICAgICB9IGVsc2UgaWYgKHRyYWNrZXIubVNlbnRJbnRlbnQgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIC8vIERvbmUgcmV0cnlpbmc7IHJldHVybiBhbiBlcnJvciB0byB0aGUgYXBwLgogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyYWNrZXIubVNlbnRJbnRlbnQuc2VuZChSRVNVTFRfRVJST1JfR0VORVJJQ19GQUlMVVJFKTsKKyAgICAgICAgICAgICAgICAgICAgSW50ZW50IGZpbGxJbiA9IG5ldyBJbnRlbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFyLnJlc3VsdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaWxsSW4ucHV0RXh0cmEoImVycm9yQ29kZSIsICgoU21zUmVzcG9uc2UpYXIucmVzdWx0KS5lcnJvckNvZGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRyYWNrZXIubVNlbnRJbnRlbnQuc2VuZChtQ29udGV4dCwgUkVTVUxUX0VSUk9SX0dFTkVSSUNfRkFJTFVSRSwgZmlsbEluKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChDYW5jZWxlZEV4Y2VwdGlvbiBleCkge30KICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtNjAyLDEyICs2MzIsNjYgQEAKICAgICAgICAgZGlzcGF0Y2goaW50ZW50LCAiYW5kcm9pZC5wZXJtaXNzaW9uLlJFQ0VJVkVfU01TIik7CiAgICAgfQogCisgICAgLyoqCisgICAgICogU2VuZCBhIGRhdGEgYmFzZWQgU01TIHRvIGEgc3BlY2lmaWMgYXBwbGljYXRpb24gcG9ydC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBkZXN0QWRkciB0aGUgYWRkcmVzcyB0byBzZW5kIHRoZSBtZXNzYWdlIHRvCisgICAgICogQHBhcmFtIHNjQWRkciBpcyB0aGUgc2VydmljZSBjZW50ZXIgYWRkcmVzcyBvciBudWxsIHRvIHVzZQorICAgICAqICB0aGUgY3VycmVudCBkZWZhdWx0IFNNU0MKKyAgICAgKiBAcGFyYW0gZGVzdFBvcnQgdGhlIHBvcnQgdG8gZGVsaXZlciB0aGUgbWVzc2FnZSB0bworICAgICAqIEBwYXJhbSBkYXRhIHRoZSBib2R5IG9mIHRoZSBtZXNzYWdlIHRvIHNlbmQKKyAgICAgKiBAcGFyYW0gc2VudEludGVudCBpZiBub3QgTlVMTCB0aGlzIDxjb2RlPlBlbmRpbmdJbnRlbnQ8L2NvZGU+IGlzC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AgICAgIH0KIAogICAgICAgICBSZXNvdXJjZXMgciA9IFJlc291cmNlcy5nZXRTeXN0ZW0oKTsKIApAQCAtNjk4LDEzICs3OTEsMTMgQEAKICAgICAgICAgICAgICAgICAuc2V0VGl0bGUoci5nZXRTdHJpbmcoUi5zdHJpbmcuc21zX2NvbnRyb2xfdGl0bGUpKQogICAgICAgICAgICAgICAgIC5zZXRNZXNzYWdlKGFwcE5hbWUgKyAiICIgKyByLmdldFN0cmluZyhSLnN0cmluZy5zbXNfY29udHJvbF9tZXNzYWdlKSkKICAgICAgICAgICAgICAgICAuc2V0UG9zaXRpdmVCdXR0b24oci5nZXRTdHJpbmcoUi5zdHJpbmcuc21zX2NvbnRyb2xfeWVzKSwgbUxpc3RlbmVyKQotICAgICAgICAgICAgICAgIC5zZXROZWdhdGl2ZUJ1dHRvbihyLmdldFN0cmluZyhSLnN0cmluZy5zbXNfY29udHJvbF9ubyksIG51bGwpCisgICAgICAgICAgICAgICAgLnNldE5lZ2F0aXZlQnV0dG9uKHIuZ2V0U3RyaW5nKFIuc3RyaW5nLnNtc19jb250cm9sX25vKSwgbUxpc3RlbmVyKQogICAgICAgICAgICAgICAgIC5jcmVhdGUoKTsKIAogICAgICAgICBkLmdldFdpbmRvdygpLnNldFR5cGUoV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuVFlQRV9TWVNURU1fQUxFUlQpOwogICAgICAgICBkLnNob3coKTsKIAotICAgICAgICBtU1RyYWNrZXIgPSB0cmFja2VyOworICAgICAgICBtU1RyYWNrZXJzLmFkZCh0cmFja2VyKTsKICAgICAgICAgc2VuZE1lc3NhZ2VEZWxheWVkICggb2J0YWluTWVzc2FnZShFVkVOVF9BTEVSVF9USU1FT1VULCBkKSwKICAgICAgICAgICAgICAgICBERUZBVUxUX1NNU19USU1PVUVPVVQpOwogICAgIH0KQEAgLTc3MCw2ICs4NjMsMjUgQEAKICAgICAgICAgICAgIGludCByZXN1bHQsIE1lc3NhZ2UgcmVzcG9uc2U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W5nU21zKHN1Y2Nlc3MsIHJlc3VsdCwgcmVzcG9uc2UpOworICAgIH0KKworICAgIC8qKgogICAgICAqIENoZWNrIGlmIGEgU21zVHJhY2tlciBob2xkcyBtdWx0aS1wYXJ0IFNtcwogICAgICAqCiAgICAgICogQHBhcmFtIHRyYWNrZXIgYSBTbXNUcmFja2VyIGNvdWxkIGhvbGQgYSBtdWx0aS1wYXJ0IFNtcwpAQCAtODE1LDYgKzkyNyw5IEBACiAgICAgICAgICAgICAgICAgaWYgKHdoaWNoID09IERpYWxvZ0ludGVyZmFjZS5CVVRUT05fUE9TSVRJVkUpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiY2xpY2sgWUVTIHRvIHNlbmQgb3V0IHNtcyIpOwogICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShvYnRhaW5NZXNzYWdlKEVWRU5UX1NFTkRfQ09ORklSTUVEX1NNUykpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hpY2ggPT0gRGlhbG9nSW50ZXJmYWNlLkJVVFRPTl9ORUdBVElWRSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJjbGljayBOTyB0byBzdG9wIHNlbmRpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2Uob2J0YWluTWVzc2FnZShFVkVOVF9TVE9QX1NFTkRJTkcpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH07CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvU2VydmljZVN0YXRlVHJhY2tlci5qYXZhIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L1NlcnZpY2VTdGF0ZVRyYWNrZXIuamF2YQppbmRleCBiZGNmM2Y3Li5jYzEzNDUwIDEwMDY0NAotLS0gYS90ZWxlcGhvbnk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Niw2ICsxMTYsMTYgQEAKICAgICAgICAgICogYW5kcm9pZC50ZWxlcGhvbnkuU21zTWVzc2FnZSBFTkNPRElOR18qKS4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBpbnQgY29kZVVuaXRTaXplOworCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICAgICAgcmV0dXJuICJUZXh0RW5jb2RpbmdEZXRhaWxzICIgKworICAgICAgICAgICAgICAgICAgICAieyBtc2dDb3VudD0iICsgbXNnQ291bnQgKworICAgICAgICAgICAgICAgICAgICAiLCBjb2RlVW5pdENvdW50PSIgKyBjb2RlVW5pdENvdW50ICsKKyAgICAgICAgICAgICAgICAgICAgIiwgY29kZVVuaXRzUmVtYWluaW5nPSIgKyBjb2RlVW5pdHNSZW1haW5pbmcgKworICAgICAgICAgICAgICAgICAgICAiLCBjb2RlVW5pdFNpemU9IiArIGNvZGVVbml0U2l6ZSArCisgICAgICAgICAgICAgICAgICAgICIgfSI7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvLyBUT0RPKCk6IFRoaXMgY2xhc3MgaXMgZHVwbGljYXRlZCBpbiBTbXNNZXNzYWdlLmphdmEuIFJlZmFjdG9yIGFjY29yZGluZ2x5LgpAQCAtMzUzLDYwICszNjMsMzAgQEAKICAgICB9CiAKICAgICAvKioKLSAgICAgKiBUcnkgdG8gcGFyc2UgdGhpcyBtZXNzYWdlIGFzIGFuIGVtYWlsIGdhdGV3YXkgbWVzc2FnZSAtPiBOZWl0aGVyCi0gICAgICogb2YgdGhlIHN0YW5kYXJkIHdheXMgYXJlIGN1cnJlbnRseSBzdXBwb3J0ZWQ6IFRoZXJlIGFyZSB0d28gd2F5cwotICAgICAqIHNwZWNpZmllZCBpbiBUUyAyMy4wNDAgU2VjdGlvbiAzLjggKG5vdCBzdXBwb3J0ZWQgdmlhIHRoaXMgbWVjaGFuaXNtKSAtCi0gICAgICogU01TIG1l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8fCBhdFN5bWJvbCA+IHNsYXNoKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBlbWFpbEZyb20gPSBtZXNzYWdlQm9keS5zdWJzdHJpbmcoMCwgc2xhc2gpOwotCi0gICAgICAgICAgICBzbGFzaDIgPSBtZXNzYWdlQm9keS5pbmRleE9mKCIgLyIsIHNsYXNoICsgMik7Ci0KLSAgICAgICAgICAgIGlmIChzbGFzaDIgPT0gLTEpIHsKLSAgICAgICAgICAgICAgICBwc2V1ZG9TdWJqZWN0ID0gbnVsbDsKLSAgICAgICAgICAgICAgICBlbWFpbEJvZHkgPSBtZXNzYWdlQm9keS5zdWJzdHJpbmcoc2xhc2ggKyAyKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHNldWRvU3ViamVjdCA9IG1lc3NhZ2VCb2R5LnN1YnN0cmluZyhzbGFzaCArIDIsIHNsYXNoMik7Ci0gICAgICAgICAgICAgICAgZW1haWxCb2R5ID0gbWVzc2FnZUJvZHkuc3Vic3RyaW5nKHNsYXNoMiArIDIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpc0VtYWlsID0gdHJ1ZTsKLSAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICBMb2cudyhMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAiZXh0cmFjdEVtYWlsQWRkcmVzc0Zyb21NZXNzYWdlQm9keTogZXhjZXB0aW9uIHNsYXNoPSIKLSAgICAgICAgICAgICAgICAgICAgKyBzbGFzaCArICIsIGF0U3ltYm9sPSIgKyBhdFN5bWJvbCArICIsIHNsYXNoMj0iCi0gICAgICAgICAgICAgICAgICAgICsgc2xhc2gyLCBleCk7Ci0gICAgICAgIH0KKyAgICAgICAgIFN0cmluZ1tdIHBhcnRzID0gbWVzc2FnZUJvZHkuc3BsaXQoIiggLyl8KCApIiwgMik7CisgIC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uCisgICAgICovCisgICAgdm9pZCBoYW5kbGVUaW1lckluRW1lcmdlbmN5Q2FsbGJhY2tNb2RlKGludCBhY3Rpb24pIHsKKyAgICAgICAgc3dpdGNoKGFjdGlvbikgeworICAgICAgICBjYXNlIENBTkNFTF9FQ01fVElNRVI6CisgICAgICAgICAgICByZW1vdmVDYWxsYmFja3MobUV4aXRFY21SdW5uYWJsZSk7CisgICAgICAgICAgICBtRWNtVGltZXJSZXNldFJlZ2lzdHJhbnRzLm5vdGlmeVJlc3VsdChuZXcgQm9vbGVhbih0cnVlKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBSRVNUQVJUX0VDTV9USU1FUjoKKyAgICAgICAgICAgIGxvbmcgZGVsYXlJbk1pbGxpcyA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0TG9uZygKKyAgICAgICAgICAgICAgICAgICAgVGVsZXBob255UHJvcGVydGllcy5QUk9QRVJUWV9FQ01fRVhJVF9USU1FUiwgREVGQVVMVF9FQ01fRVhJVF9USU1FUl9WQUxVRSk7CisgICAgICAgICAgICBwb3N0RGVsYXllZChtRXhpdEVjbVJ1bm5hYmxlLCBkZWxheUluTWlsbGlzKTsKKyAgICAgICAgICAgIG1FY21UaW1lclJlc2V0UmVnaXN0cmFudHMubm90aWZ5UmVzdWx0KG5ldyBCb29sZWFuKGZhbHNlKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJoYW5kbGVUaW1lckluRW1lcmdlbmN5Q2FsbGJhY2tNb2RlLCB1bnN1cHBvcnRlZCBhY3Rpb24gIiArIGFjdGlvbik7CiAgICAgICAgIH0KKyAgICB9CiAKLSAgICAgICAgTXlIYW5kbGVyKExvb3BlciBsKSB7Ci0gICAgICAgICAgICBzdXBlcihsKTsKLSAgICAgICAgfQorICAgIC8qKgorICAgICAqIFJlZ2lzdHJhdGlvbiBwb2ludCBmb3IgRWNtIHRpbWVyIHJlc2V0CisgICAgICogQHBhcmFtIGggaGFuZGxlciB0byBub3RpZnkKKyAgICAgKiBAcGFyYW0gd2hhdCBVc2VyLWRlZmluZWQgbWVzc2FnZSBjb2RlCisgICAgICogQHBhcmFtIG9iaiBwbGFjZWQgaW4gTWVzc2FnZS5vYmoKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCByZWdpc3RlckZvckVjbVRpbWVyUmVzZXQoSGFuZGxlciBoLCBpbnQgd2hhdCwgT2JqZWN0IG9iaikgeworICAgICAgICBtRWNtVGltZXJSZXNldFJlZ2lzdHJhbnRzLmFkZFVuaXF1ZShoLCB3aGF0LCBvYmopOworICAgIH0KIAotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgewotICAgICAgICAgICAgQXN5bmNSZXN1bHQgYXI7Ci0gICAgICAgICAgICBNZXNzYWdlICAgICBvbkNvbXBsZXRlOworICAgIHB1YmxpYyB2b2lkIHVucmVnaXN0ZXJGb3JFY21UaW1lclJlc2V0KEhhbmRsZXIgaCkgeworICAgICAgICBtRWNtVGltZXJSZXNldFJlZ2lzdHJhbnRzLnJlbW92ZShoKTsKKyAgICB9CiAKLSAgICAgICAgICAgIHN3aXRjaChtc2cud2hhdCkgewotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fQVZBSUxBQkxFOiB7Ci0gICAgICAgICAgICAgICAgICAgIG1DTS5nZXRCYXNlYmFuZFZlcnNpb24ob2J0YWluTWVzc2FnZShFVkVOVF9HRVRfQkFTRUJBTkRfVkVSU0lPTl9ET05FKSk7CisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICBBc3luY1Jlc3VsdCBhcjsKKyAgICAgICAgTWVzc2FnZSAgICAgb25Db21wbGV0ZTsKIAotICAgICAgICAgICAgICAgICAgICBtQ00uZ2V0RGV2aWNlSWRlbnRpdHkob2J0YWluTWVzc2FnZShFVkVOVF9HRVRfREVWSUNFX0lERU5USVRZX0RPTkUpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIHN3aXRjaChtc2cud2hhdCkgeworICAgICAgICAgICAgY2FzZSBFVkVOVF9SQURJT19BVkFJTEFCTEU6IHsKKyAgICAgICAgICAgICAgICBtQ00uZ2V0QmFzZWJhbmRWZXJzaW9uKG9idGFpbk1lc3NhZ2UoRVZFTlRfR0VUX0JBU0VCQU5EX1ZFUlNJT05fRE9ORSkpOwogCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfQkFTRUJBTkRfVkVSU0lPTl9ET05FOnsKLSAgICAgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKKyAgICAgICAgICAgICAgICBtQ00uZ2V0RGV2aWNlSWRlbnRpdHkob2J0YWluTWVzc2FnZShFVkVOVF9HRVRfREVWSUNFX0lERU5USVRZX0RPTkUpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNhc2UgRVZFTlRfR0VUX0JBU0VCQU5EX1ZFUlNJT05fRE9ORTp7CisgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKIAotICAgICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfREVCVUcpIExvZy5kKExPR19UQUcsICJCYXNlYmFuZCB2ZXJzaW9uOiAiICsgYXIucmVzdWx0KTsKLSAgICAgICAgICAgICAgICAgICAgc2V0U3lzdGVtUHJvcGVydHkoVGVsZXBob255UHJvcGVydGllcy5QUk9QRVJUWV9CQVNFQkFORF9WRVJTSU9OLCAoU3RyaW5nKWFyLnJlc3VsdCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfREVWSUNFX0lERU5USVRZX0RPTkU6ewotICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gcmVzcElkID0gKFN0cmluZ1tdKWFyLnJlc3VsdDsKLSAgICAgICAgICAgICAgICAgICAgbUVzbiAgPSAgcmVzcElkWzJdOwotICAgICAgICAgICAgICAgICAgICBtTWVpZCA9ICByZXNwSWRbM107Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9FTUVSR0VOQ1lfQ0FMTEJBQ0tfTU9ERV9FTlRFUjp7Ci0gICAgICAgICAgICAgICAgICAgIGhhbmRsZUVudGVyRW1lcmdlbmN5Q2FsbGJhY2tNb2RlKG1zZyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSAgRVZFTlRfRVhJVF9FTUVSR0VOQ1lfQ0FMTEJBQ0tfUkVTUE9OU0U6ewotICAgICAgICAgICAgICAgICAgICBoYW5kbGVFeGl0RW1lcmdlbmN5Q2FsbGJhY2tNb2RlKG1zZyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9SVUlNX1JFQ09SRFNfTE9BREVEOnsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkV2ZW50IEVWRU5UX1JVSU1fUkVDT1JEU19MT0FERUQgUmVjZWl2ZWQiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX1JBRElPX09GRl9PUl9OT1RfQVZBSUxBQkxFOnsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkV2ZW50IEVWRU5UX1JBRElPX09GRl9PUl9OT1RfQVZBSUxBQkxFIFJlY2VpdmVkIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9SQURJT19PTjp7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFdmVudCBFVkVOVF9SQURJT19PTiBSZWNlaXZlZCIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfU1NOOnsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkV2ZW50IEVWRU5UX1NTTiBSZWNlaXZlZCIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0FMTF9SSU5HOnsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkV2ZW50IEVWRU5UX0NBTExfUklORyBSZWNlaXZlZCIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUkVHSVNURVJFRF9UT19ORVRXT1JLOnsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkV2ZW50IEVWRU5UX1JFR0lTVEVSRURfVE9fTkVUV09SSyBSZWNlaXZlZCIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfTlZfUkVBRFk6ewotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRXZlbnQgRVZFTlRfTlZfUkVBRFkgUmVjZWl2ZWQiKTsKLSAgICAgICAgICAgICAgICAgICAgLy9JbmZvcm0gdGhlIFNlcnZpY2UgU3RhdGUgVHJhY2tlcgotICAgICAgICAgICAgICAgICAgICBtRXJpTWFuYWdlci5sb2FkRXJpRmlsZSgpOwotICAgICAgICAgICAgICAgICAgICBtTnZMb2FkZWRSZWdpc3RyYW50cy5ub3RpZnlSZWdpc3RyYW50cygpOwotICAgICAgICAgICAgICAgICAgICBpZihtRXJpTWFuYWdlci5pc0VyaUZpbGVMb2FkZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2hlbiB0aGUgRVJJIGZpbGUgaXMgbG9hZGVkCi0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRVJJIHJlYWQsIG5vdGlmeSByZWdpc3RyYW50cyIpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUVyaUZpbGVMb2FkZWRSZWdpc3RyYW50cy5ub3RpZnlSZWdpc3RyYW50cygpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHNldFN5c3RlbVByb3BlcnR5KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfSU5FQ01fTU9ERSwiZmFsc2UiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX1NFVF9WTV9OVU1CRVJfRE9ORTp7Ci0gICAgICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChJY2NFeGNlcHRpb24uY2xhc3MuaXNJbnN0YW5jZShhci5leGNlcHRpb24pKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdG9yZVZvaWNlTWFpbE51bWJlcihtVm1OdW1iZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYXIuZXhjZXB0aW9uID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBvbkNvbXBsZXRlID0gKE1lc3NhZ2UpIGFyLnVzZXJPYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChvbkNvbXBsZXRlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2Uob25Db21wbGV0ZSwgYXIucmVzdWx0LCBhci5leGNlcHRpb24pOwotICAgICAgICAgICAgICAgICAgICAgICAgb25Db21wbGV0ZS5zZW5kVG9UYXJnZXQoKTsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBkZWZhdWx0OnsKLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oInVuZXhwZWN0ZWQgZXZlbnQgbm90IGhhbmRsZWQiKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAiQmFzZWJhbmQgdmVyc2lvbjogIiArIGFyLnJlc3VsdCk7CisgICAgICAgICAgICAgICAgc2V0U3lzdGVtUHJvcGVydHkoVGVsZXBob255UHJvcGVydGllcy5QUk9QRVJUWV9CQVNFQkFORF9WRVJTSU9OLCAoU3RyaW5nKWFyLnJlc3VsdCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfREVWSUNFX0lERU5USVRZX0RPTkU6eworICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7CisKKyAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIFN0cmluZ1tdIHJlc3BJZCA9IChTdHJpbmdbXSlhci5yZXN1bHQ7CisgICAgICAgICAgICAgICAgbUVzbiAgPSAgcmVzcElkWzJdOworICAgICAgICAgICAgICAgIG1NZWlkID0gIHJlc3BJZFszXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEVWRU5UX0VNRVJHRU5DWV9DQUxMQkFDS19NT0RFX0VOVEVSOnsKKyAgICAgICAgICAgICAgICBoYW5kbGVFbnRlckVtZXJnZW5jeUNhbGxiYWNrTW9kZShtc2cpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgIEVWRU5UX0VYSVRfRU1FUkdFTkNZX0NBTExCQUNLX1JFU1BPTlNFOnsKKyAgICAgICAgICAgICAgICBoYW5kbGVFeGl0RW1lcmdlbmN5Q2FsbGJhY2tNb2RlKG1zZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBFVkVOVF9SVUlNX1JFQ09SRFNfTE9BREVEOnsKKyAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRXZlbnQgRVZFTlRfUlVJTV9SRUNPUkRTX0xPQURFRCBSZWNlaXZlZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fT0ZGX09SX05PVF9BVkFJTEFCTEU6eworICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFdmVudCBFVkVOVF9SQURJT19PRkZfT1JfTk9UX0FWQUlMQUJMRSBSZWNlaXZlZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fT046eworICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFdmVudCBFVkVOVF9SQURJT19PTiBSZWNlaXZlZCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfU1NOOnsKKyAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRXZlbnQgRVZFTlRfU1NOIFJlY2VpdmVkIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBFVkVOVF9SRUdJU1RFUkVEX1RPX05FVFdPUks6eworICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFdmVudCBFVkVOVF9SRUdJU1RFUkVEX1RPX05FVFdPUksgUmVjZWl2ZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEVWRU5UX05WX1JFQURZOnsKKyAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRXZlbnQgRVZFTlRfTlZfUkVBRFkgUmVjZWl2ZWQiKTsKKyAgICAgICAgICAgICAgICAvL0luZm9ybSB0aGUgU2VydmljZSBTdGF0ZSBUcmFja2VyCisgICAgICAgICAgICAgICAgbUVyaU1hbmFnZXIubG9hZEVyaUZpbGUoKTsKKyAgICAgICAgICAgICAgICBtTnZMb2FkZWRSZWdpc3RyYW50cy5ub3RpZnlSZWdpc3RyYW50cygpOworICAgICAgICAgICAgICAgIGlmKG1FcmlNYW5hZ2VyLmlzRXJpRmlsZUxvYWRlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gdGhlIEVSSSBmaWxlIGlzIGxvYWRlZAorICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRVJJIHJlYWQsIG5vdGlmeSByZWdpc3RyYW50cyIpOworICAgICAgICAgICAgICAgICAgICBtRXJpRmlsZUxvYWRlZFJlZ2lzdHJhbnRzLm5vdGlmeVJlZ2lzdHJhbnRzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfU0VUX1ZNX05VTUJFUl9ET05FOnsKKyAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgICAgIGlmIChJY2NFeGNlcHRpb24uY2xhc3MuaXNJbnN0YW5jZShhci5leGNlcHRpb24pKSB7CisgICAgICAgICAgICAgICAgICAgIHN0b3JlVm9pY2VNYWlsTnVtYmVyKG1WbU51bWJlcik7CisgICAgICAgICAgICAgICAgICAgIGFyLmV4Y2VwdGlvbiA9IG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG9uQ29tcGxldGUgPSAoTWVzc2FnZSkgYXIudXNlck9iajsKKyAgICAgICAgICAgICAgICBpZiAob25Db21wbGV0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2Uob25Db21wbGV0ZSwgYXIucmVzdWx0LCBhci5leGNlcHRpb24pOworICAgICAgICAgICAgICAgICAgICBvbkNvbXBsZXRlLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OnsKKyAgICAgICAgICAgICAgICBzdXBlci5oYW5kbGVNZXNzYWdlKG1zZyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0xMTAwLDEzICsxMDg1LDYgQEAKICAgICAvKioKICAgICAgKiB7QGluaGVya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gICAgICAgICAoSVM2ODNBX0ZFQVRVUkVfQ09ERV9OVU1fRElHSVRTICsgSVM2ODNBX1NZU19TRUxfQ09ERV9OVU1fRElHSVRTKSkpIHsKLSAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcihkaWFsU3RyKTsKLSAgICAgICAgICAgIC8vIFNlcGFyYXRlIHRoZSBTeXN0ZW0gU2VsZWN0aW9uIENvZGUgaW50byBpdHMgb3duIHN0cmluZwotICAgICAgICAgICAgY2hhcltdIHN5c1NlbCA9IG5ldyBjaGFyWzJdOwotICAgICAgICAgICAgc2IuZGVsZXRlKDAsIElTNjgzQV9TWVNfU0VMX0NPREVfT0ZGU0VUKTsKLSAgICAgICAgICAgIHNiLmdldENoYXJzKDAsIElTNjgzQV9TWVNfU0VMX0NPREVfTlVNX0RJR0lUUywgc3lzU2VsLCAwKTsKLQotICAgICAgICAgICAgaWYgKChQaG9uZU51bWJlclV0aWxzLmlzSVNPRGlnaXQoc3lzU2VsWzBdKSkKLSAgICAgICAgICAgICAgICAgICAgJiYgKFBob25lTnVtYmVyVXRpbHMuaXNJU09EaWdpdChzeXNTZWxbMV0pKSkgewotICAgICAgICAgICAgICAgIFN0cmluZyBzeXNTZWxDb2RlID0gbmV3IFN0cmluZyhzeXNTZWwpOwotICAgICAgICAgICAgICAgIHN5c1NlbENvZGVJbnQgPSBJbnRlZ2VyLnBhcnNlSW50KChTdHJpbmcpc3lzU2VsQ29kZSk7Ci0gICAgICAgICAgICAgICAgc3dpdGNoIChzeXNTZWxDb2RlSW50KSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgSVM2ODNfQ09OU1RfODAwTUhaX0FfQkFORDoKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJUzY4M19DT05TVF84MDBNSFpfQl9CQU5EOgotICAgICAgICAgICAgICAgICAgICBjYXNlIElTNjgzX0NPTlNUXzE5MDBNSFpfQV9CTE9DSzoKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJUzY4M19DT05TVF8xOTAwTUhaX0JfQkxPQ0s6Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgSVM2ODNfQ09OU1RfMTkwME1IWl9DX0JMT0NLOgotICAgICAgICAgICAgICAgICAgICBjYXNlIElTNjgzX0NPTlNUXzE5MDBNSFpfRF9CTE9DSzoKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBJUzY4M19DT05TVF8xOTAwTUhaX0VfQkxPQ0s6Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgSVM2ODNfQ09OU1RfMTkwME1IWl9GX0JMT0NLOgotICAgICAgICAgICAgICAgICAgICAgICAgaXNPdGFzcERpYWxTdHJpbmcgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHN5c1NlbENvZGVJbnQgPSBleHRyYWN0U2VsQ29kZUZyb21PdGFTcE51bShkaWFsU3RyKTsKKyAgICAgICAgICAgIHN3aXRjaCAoc3lzU2VsQ29kZUludCkgeworICAgICAgICAgICAgICAgIGNhc2UgSVM2ODNfQ09OU1RfODAwTUhaX0FfQkFORDoKKyAgICAgICAgICAgICAgICBjYXNlIElTNjgzX0NPTlNUXzgwME1IWl9CX0JBTkQ6CisgICAgICAgICAgICAgICAgY2FzZSBJUzY4M19DT05TVF8xOTAwTUhaX0FfQkxPQ0s6CisgICAgICAgICAgICAgICAgY2FzZSBJUzY4M19DT05TVF8xOTAwTUhaX0JfQkxPQ0s6CisgICAgICAgICAgICAgICAgY2FzZSBJUzY4M19DT05TVF8xOTAwTUhaX0NfQkxPQ0s6CisgICAgICAgICAgICAgICAgY2FzZSBJUzY4M19DT05TVF8xOTAwTUhaX0RfQkxPQ0s6CisgICAgICAgICAgIC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cKLSAgICAgICovCisgICAgICAgIGlmICgoZGlhbFN0ci5yZWdpb25NYXRjaGVzKDAsIElTNjgzQV9GRUFUVVJFX0NPREUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIElTNjgzQV9GRUFUVVJFX0NPREVfTlVNX0RJR0lUUykpICYmCisgICAgICAgICAgICAoZGlhbFN0ckxlbiA+PSAoSVM2ODNBX0ZFQVRVUkVfQ09ERV9OVU1fRElHSVRTICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBJUzY4M0FfU1lTX1NFTF9DT0RFX05VTV9ESUdJVFMpKSkgeworICAgICAgICAgICAgICAgIC8vIFNpbmNlIHdlIGNoZWNrZWQgdGhlIGNvbmRpdGlvbiBhYm92ZSwgdGhlIHN5c3RlbSBzZWxlY3Rpb24gY29kZQorICAgICAgICAgICAgICAgIC8vIGV4dHJhY3RlZCBmcm9tIGRpYWxTdHIgd2lsbCBub3QgY2F1c2UgYW55IGV4Y2VwdGlvbgorICAgICAgICAgICAgICAgIHN5c1NlbENvZGVJbnQgPSBJbnRlZ2VyLnBhcnNlSW50ICgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlhbFN0ci5zdWJzdHJpbmcgKElTNjgzQV9GRUFUVVJFX0NPREVfTlVNX0RJR0lUUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVM2ODNBX0ZFQVRVUkVfQ09ERV9OVU1fRElHSVRTICsgSVM2ODNBX1NZU19TRUxfQ09ERV9OVU1fRElHSVRTKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgImV4dHJhY3RTZWxDb2RlRnJvbU90YVNwTnVtICIgKyBzeXNTZWxDb2RlSW50KTsKKyAgICAgICAgcmV0dXJuIHN5c1NlbENvZGVJbnQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBmdW5jdGlvbiBjaGVja3MgaWYgdGhlIHN5c3RlbSBzZWxlY3Rpb24gY29kZSBleHRyYWN0ZWQgZnJvbQorICAgICAqIHRoZSBkaWFsIHN0cmluZyAic3lzU2VsQ29kZUludCcgaXMgdGhlIHN5c3RlbSBzZWxlY3Rpb24gY29kZSBzcGVjaWZpZWQKKyAgICAgKiBpbiB0aGUgY2FycmllciBvdGEgc3AgbnVtYmVyIHNjaGVtYSAic2NoIi4KKyAgICAgKi8KKyAgICBwcml2YXRlIGJvb2xlYW4KKyAgICBjaGVja090YVNwTnVtQmFzZWRPblN5c1NlbENvZGUgKGludCBzeXNTZWxDb2RlSW50LCBTdHJpbmcgc2NoW10pIHsKKyAgICAgICAgYm9vbGVhbiBpc090YVNwTnVtID0gZmFsc2U7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICAvLyBHZXQgaG93IG1hbnkgbnVtYmVyIG9mIHN5c3RlbSBzZWxlY3Rpb24gY29kZSByYW5nZXMKKyAgICAgICAgICAgIGludCBzZWxSYyA9IEludGVnZXIucGFyc2VJbnQoKFN0cmluZylzY2hbMV0pOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzZWxSYzsgaSsrKSB7CisgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShzY2hbaSsyXSkgJiYgIVRleHRVdGlscy5pc0VtcHR5KHNjaFtpKzNdKSkgeworICAgICAgICAgICAgICAgICAgICBpbnQgc2VsTWluID0gSW50ZWdlci5wYXJzZUludCgoU3RyaW5nKXNjaFtpKzJdKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHNlbE1heCA9IEludGVnZXIucGFyc2VJbnQoKFN0cmluZylzY2hbaSszXSk7CisgICAgICAgICAgICAgICAgICAgIC8vIENoZWNrIGlmIHRoZSBzZWxlY3Rpb24gY29kZSBleHRyYWN0ZWQgZnJvbSB0aGUgZGlhbCBzdHJpbmcgZmFsbHMKKyAgICAgICAgICAgICAgICAgICAgLy8gd2l0aGluIGFueSBvZiB0aGUgcmFuZ2UgcGFpcnMgc3BlY2lmaWVkIGluIHRoZSBzY2hlbWEuCisgICAgICAgICAgICAgICAgICAgIGlmICgoc3lzU2VsQ29kZUludCA+PSBzZWxNaW4pICYmIChzeXNTZWxDb2RlSW50IDw9IHNlbE1heCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzT3RhU3BOdW0gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgLy8gSWYgdGhlIGNhcnJpZXIgb3RhIHNwIG51bWJlciBzY2hlbWEgaXMgbm90IGNvcnJlY3QsIHdlIHN0aWxsIGFsbG93IGRpYWwKKyAgICAgICAgICAgIC8vIGFuZCBvbmx5IGxvZyB0aGUgZXJyb3I6CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiY2hlY2tPdGFTcE51bUJhc2VkT25TeXNTZWxDb2RlLCBlcnJvciIsIGV4KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gaXNPdGFTcE51bTsKKyAgICB9CisKKyAgICAvLyBEZWZpbmUgdGhlIHBhdHRlcm4vZm9ybWF0IGZvciBjYXJyaWVyIHNwZWNpZmllZCBPVEFTUCBudW1iZXIgc2NoZW1hLgorICAgIC8vIEl0IHNlcGFyYXRlcyBieSBjb21tYSBhbmQvb3Igd2hpdGVzcGFjZS4KKyAgICBwcml2YXRlIHN0YXRpYyBQYXR0ZXJuIHBPdGFTcE51bVNjaGVtYSA9IFBhdHRlcm4uY29tcGlsZSgiWyxcXHNdKyIpOworCisgICAgLyoqCisgICAgICogVGhlIGZvbGxvd2luZyBmdW5jdGlvbiBjaGVja3MgaWYgYSBkaWFsIHN0cmluZyBpcyBhIGNhcnJpZXIgc3BlY2lmaWVkCisgICAgICogT1RBU1AgbnVtYmVyIG9yIG5v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QgPSBleHRyYWN0U2VsQ29kZUZyb21PdGFTcE51bShkaWFsU3RyKTsKKyAgICAgICAgaWYgKHN5c1NlbENvZGVJbnQgPT0gSU5WQUxJRF9TWVNURU1fU0VMRUNUSU9OX0NPREUpIHsKKyAgICAgICAgICAgIHJldHVybiBpc090YVNwTnVtOworICAgICAgICB9CisgICAgICAgIC8vIG1DYXJyaWVyT3RhU3BOdW1TY2hlbWEgaXMgcmV0cmlldmVkIGZyb20gUFJPUEVSVFlfT1RBU1BfTlVNX1NDSEVNQToKKyAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShtQ2Fycmllck90YVNwTnVtU2NoZW1hKSkgeworICAgICAgICAgICAgTWF0Y2hlciBtID0gcE90YVNwTnVtU2NoZW1hLm1hdGNoZXIobUNhcnJpZXJPdGFTcE51bVNjaGVtYSk7CisgICAgICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImlzQ2Fycmllck90YVNwTnVtLHNjaGVtYSIgKyBtQ2Fycmllck90YVNwTnVtU2NoZW1hKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG0uZmluZCgpKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nIHNjaFtdID0gcE90YVNwTnVtU2NoZW1hLnNwbGl0KG1DYXJyaWVyT3RhU3BOdW1TY2hlbWEpOworICAgICAgICAgICAgICAgIC8vIElmIGNhcnJpZXIgdXNlcyBzeXN0ZW0gc2VsZWN0aW9uIGNvZGUgbWVjaGFuaXNtCisgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShzY2hbMF0pICYmIHNjaFswXS5lcXVhbHMoIlNFTEMiKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc3lzU2VsQ29kZUludCE9SU5WQUxJRF9TWVNURU1fU0VMRUNUSU9OX0NPREUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzT3RhU3BOdW09Y2hlY2tPdGFTcE51bUJhc2VkT25TeXNTZWxDb2RlKHN5c1NlbENvZGVJbnQsc2NoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiaXNDYXJyaWVyT3RhU3BOdW0sc3lzU2VsQ29kZUludCBpcyBpbnZhbGlkIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShzY2hbMF0pICYmIHNjaFswXS5lcXVhbHMoIkZDIikpIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IGZjTGVuID0gIEludGVnZXIucGFyc2VJbnQoKFN0cmluZylzY2hbMV0pOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmMgPSAoU3RyaW5nKXNjaFsyXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRpYWxTdHIucmVnaW9uTWF0Y2hlcygwLGZjLDAsZmNMZW4pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpc090YVNwTnVtID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJpc0NhcnJpZXJPdGFTcE51bSxub3Qgb3Rhc3AgbnVtYmVyIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiaXNDYXJyaWVyT3RhU3BOdW0sb3RhIHNjaGVtYSBub3Qgc3VwcG9ydGVkIiArIHNjaFswXSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImlzQ2Fycmllck90YVNwTnVtLG90YSBzY2hlbWEgcGF0dGVybiBub3QgcmlnaHQiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbUNhcnJpZXJPdGFTcE51bVNjaGVtYSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgImlzQ2Fycmllck90YVNwTnVtLG90YSBzY2hlbWEgcGF0dGVybiBlbXB0eSIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBpc090YVNwTnVtOworICAgIH0KKworICAgIC8qKgorICAgICAqIGlzT1RBU1BOdW1iZXI6IGNoZWNrcyBhIGdpdmVuIG51bWJlciBhZ2FpbnN0IHRoZSBJUy02ODNBIE9UQVNQIGRpYWwgc3RyaW5nIGFuZCBjYXJyaWVyCisgICAgICogT1RBU1AgZGlhbCBzdHJpbmcuCisgICAgICoKKyAgICAgKiBAcGFyYW0gZGlhbFN0ciB0aGUgbnVtYmVyIHRvIGxvb2sgdXAuCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBudW1iZXIgaXMgaW4gSVMtNjgzQSBPVEFTUCBkaWFsIHN0cmluZyBvciBjYXJyaWVyIE9UQVNQIGRpYWwgc3RyaW5nCisgICAgICovCiAgICAgQE92ZXJyaWRlCi0gICAgIHB1YmxpYyAgYm9vbGVhbiBpc090YVNwTnVtYmVyKFN0cmluZyBkaWFsU3RyKXsKLSAgICAgICAgIGJvb2xlYW4gaXNPdGFTcE51bSA9IGZhbHNlOwotICAgICAgICAgaWYoZGlhbFN0ciAhPSBudWxsKXsKLSAgICAgICAgICAgICBpc090YVNwTnVtPWlzSXM2ODNPdGFTcERpYWxTdHIoZGlhbFN0cik7Ci0gICAgICAgICAgICAgaWYoaXNPdGFTcE51bSA9PSBmYWxzZSl7Ci0gICAgICAgICAgICAgLy9UTyBETzpBZGQgY2FycmllciBzcGVjaWZpYyBPVEFTUCBudW1iZXIgZGV0ZWN0aW9uIGhlcmUuCi0gICAgICAgICAgICAgfQotICAgICAgICAgfQotICAgICAgICAgcmV0dXJuIGlzT3RhU3BOdW07Ci0gICAgIH0KKyAgICBwdWJsaWMgIGJvb2xlYW4gaXNPdGFTcE51bWJlcihTdHJpbmcgZGlhbFN0cil7CisgICAgICAgIGJvb2xlYW4gaXNPdGFTcE51bSA9IGZhbHNlOworICAgICAgICBTdHJpbmcgZGlhbGFibGVTdHIgPSBQaG9uZU51bWJlclV0aWxzLmV4dHJhY3ROZXR3b3JrUG9ydGlvbihkaWFsU3RyKTsKKyAgICAgICAgaWYgKGRpYWxhYmxlU3RyICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlzT3RhU3BOdW0gPSBpc0lzNjgzT3RhU3BEaWFsU3RyKGRpYWxhYmxlU3RyKTsKKyAgICAgICAgICAgIGlmIChpc090YVNwTnVtID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgaXNPdGFTcE51bSA9IGlzQ2Fycmllck90YVNwTnVtKGRpYWxhYmxlU3RyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAiaXNPdGFTcE51bWJlciAiICsgaXNPdGFTcE51bSk7CisgICAgICAgIHJldHVybiBpc090YVNwTnVtOworICAgIH0KIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBpbnQgZ2V0Q2RtYUVyaUljb25JbmRleCgpIHsKQEAgLTEzMTQsMjEgKzE0MDMsNCBAQAogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQogCi0gICAgLyoqCi0gICAgICogVXBkYXRlcyBNQ0MgYW5kIE1OQyBkZXZpY2UgY29uZmlndXJhdGlvbiBpbmZvcm1hdGlvbiBmb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CA9IChzZXJ2aWNlU3RhdGUgIT0gU2VydmljZVN0YXRlLlNUQVRFX1BPV0VSX09GRikgJiYKLSAgICAgICAgICAgICAgICBwZW5kaW5nTU8gPT0gbnVsbAorICAgICAgICByZXQgPSAoc2VydmljZVN0YXRlICE9IFNlcnZpY2VTdGF0ZS5TVEFURV9QT1dFUl9PRkYpCisgICAgICAgICAgICAgICAgJiYgcGVuZGluZ01PID09IG51bGwKICAgICAgICAgICAgICAgICAmJiAhcmluZ2luZ0NhbGwuaXNSaW5naW5nKCkKKyAgICAgICAgICAgICAgICAmJiAhZGlzYWJsZUNhbGwuZXF1YWxzKCJ0cnVlIikKICAgICAgICAgICAgICAgICAmJiAoIWZvcmVncm91bmRDYWxsLmdldFN0YXRlKCkuaXNBbGl2ZSgpCi0gICAgICAgICAgICAgICAgfHwgKGZvcmVncm91bmRDYWxsLmdldFN0YXRlKCkgPT0gQ2RtYUNhbGwuU3RhdGUuQUNUSVZFKQotICAgICAgICAgICAgICAgIHx8ICFiYWNrZ3JvdW5kQ2FsbC5nZXRTdGF0ZSgpLmlzQWxpdmUoKSk7CisgICAgICAgICAgICAgICAgICAgIHx8IChmb3JlZ3JvdW5kQ2FsbC5nZXRTdGF0ZSgpID09IENkbWFDYWxsLlN0YXRlLkFDVElWRSkKKyAgICAgICAgICAgICAgICAgICAgfHwgIWJhY2tncm91bmRDYWxsLmdldFN0YXRlKCkuaXNBbGl2ZSgpKTsKIAogICAgICAgICByZXR1cm4gcmV0OwogICAgIH0KQEAgLTQ3NSw2ICs1MDEsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgLy8gU29tZW9uZSBoYXMgYWxyZWFkeSBhc2tlZCB0byBoYW5ndXAgdGhpcyBjYWxsCiAgICAgICAgICAgICAgICAgICAgIGlmIChoYW5ndXBQZW5kaW5nTU8pIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmd1cFBlbmRpbmdNTyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmUtc3RhcnQgRWNtIHRpbWVyIHdoZW4gYW4gdW5jb21wbGV0ZWQgZW1lcmdlbmN5IGNhbGwgZW5kcworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc0VjbVRpbWVyQ2FuY2VsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVFY21UaW1lcihwaG9uZS5SRVNUQVJUX0VDTV9USU1FUik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFBob25lLkRFQlVHX1BIT05FKSBsb2coCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicG9sbDogaGFuZ3VwUGVuZGluZ01PLCBoYW5ndXAgY29ubiAiICsgaSk7CkBAIC01MjgsMjAgKzU1OSwxNyBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGZvcmVncm91bmRDYWxsLnNldEdlbmVyaWMoZmFsc2UpOworCisgICAgICAgICAgICAgICAgLy8gUmUtc3RhcnQgRWNtIHRpbWVyIHdoZW4gdGhlIGNvbm5lY3RlZCBlbWVyZ2VuY3kgY2FsbCBlbmRzCisgICAgICAgICAgICAgICAgaWYgKG1Jc0VjbVRpbWVyQ2FuY2VsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlRWNtVGltZXIocGhvbmUuUkVTVEFSVF9FQ01fVElNRVIpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1Jc0luRW1lcmdlbmN5Q2FsbCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICAgIC8vIERyb3BwZWQgY29ubmVjdGlvbnMgYXJlIHJlbW92ZWQgZnJvbSB0aGUgQ2FsbFRyYWNrZXIKICAgICAgICAgICAgICAgICAvLyBsaXN0IGJ1dCBrZXB0IGluIHRoZSBDYWxsIGxpc3QKICAgICAgICAgICAgICAgICBjb25uZWN0aW9uc1tpXSA9IG51bGw7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGNvbm4gIT0gbnVsbCAmJiBkYyAhPSBudWxsICYmICFjb25uLmNvbXBhcmVUbyhkYykpIHsKLSAgICAgICAgICAgICAgICAvLyBDb25uZWN0aW9uIGluIENMQ0MgcmVzcG9uc2UgZG9lcyBub3QgbWF0Y2ggd2hhdAotICAgICAgICAgICAgICAgIC8vIHdlIHdlcmUgdHJhY2tpbmcuIEFzc3VtZSBkcm9wcGVkIGNhbGwgYW5kIG5ldyBjYWxsCi0KLSAgICAgICAgICAgICAgICBkcm9wcGVkRHVyaW5nUG9sbC5hZGQoY29ubik7Ci0gICAgICAgICAgICAgICAgY29ubmVjdGlvbnNbaV0gPSBuZXcgQ2RtYUNvbm5lY3Rpb24gKHBob25lLmdldENvbnRleHQoKSwgZGMsIHRoaXMsIGkpOwotCi0gICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb25zW2ldLmdldENhbGwoKSA9PSByaW5naW5nQ2FsbCkgewotICAgICAgICAgICAgICAgICAgICBuZXdSaW5naW5nID0gY29ubmVjdGlvbnNbaV07Ci0gICAgICAgICAgICAgICAgfSAvLyBlbHNlIHNvbWV0aGluZyBzdHJhbmdlIGhhcHBlbmVkCi0gICAgICAgICAgICAgICAgaGFzTm9uSGFuZ3VwU3RhdGVDaGFuZ2VkID0gdHJ1ZTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29ubiAhPSBudWxsICYmIGRjICE9IG51bGwpIHsgLyogaW1wbGljaXQgY29ubi5jb21wYXJlVG8oZGMpICovCiAgICAgICAgICAgICAgICAgYm9vbGVhbiBjaGFuZ2VkOwogICAgICAgICAgICAgICAgIGNoYW5nZWQgPSBjb25uLnVwZGF0ZShkYyk7CkBAIC01NzgsOCArNjA2LDggQEAKICAgICAgICAgICAgIGRyb3BwZWREdXJpbmdQb2xsLmFkZChwZW5kaW5nTU8pOwogICAgICAgICAgICAgcGVuZGluZ01PID0gbnVsbDsKICAgICAgICAgICAgIGhhbmd1cFBlbmRpbmdNTyA9IGZhbHNlOwotICAgICAgICAgICAgaWYoIHBlbmRpbmdDYWxsSW5FQ00pIHsKLSAgICAgICAgICAgICAgICBwZW5kaW5nQ2FsbEluRUNNID0gZmFsc2U7CisgICAgICAgICAgICBpZiggcGVuZGluZ0NhbGxJbkVjbSkgeworICAgICAgICAgICAgICAgIHBlbmRpbmdDYWxsSW5FY20gPSBmYWxzZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC02NDQsNyArNjcyLDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChoYXNOb25IYW5ndXBTdGF0ZUNoYW5nZWQgfHwgbmV3UmluZ2luZyAhPSBudWxsKSB7Ci0gICAgICAgICAgICBwaG9uZS5ub3RpZnlDYWxsU3RhdGVDaGFuZ2VkKCk7CisgICAgICAgICAgICBwaG9uZS5ub3RpZnlQcmVjaXNlQ2FsbFN0YXRlQ2hhbmdlZCgpOwogICAgICAgICB9CiAKICAgICAgICAgLy9kdW1wU3RhdGUoKTsKQEAgLTY3OCw3ICs3MDYsOCBAQAogICAgICAgICAgICAgLy8gdGhlIGhhbmd1cCByZWFzb24gaXMgdXNlciBpZ25vcmluZyBvciB0aW1pbmcgb3V0LiBTbyBjb25uLm9uRGlzY29ubmVjdCgpCiAgICAgICAgICAgICAvLyBpcyBub3QgY2FsbGVkIGhlcmUuIEluc3RlYWQsIGNvbm4ub25Mb2NhbERpc2Nvbm5lY3QoKSBpcyBjYWxsZWQuCiAgICAgICAgICAgICBjb25uLm9uTG9jYWxEaXNjb25uZWN0KCk7Ci0gICAgICAgICAgICBwaG9uZS5ub3RpZnlDYWxsU3RhdGVDaGFuZ2VkKCk7CisgICAgICAgICAgICB1cGRhdGVQaG9uZVN0YXRlKCk7CisgICAgICAgICAgICBwaG9uZS5ub3RpZnlQcmVjaXN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sbHkgbm90aWZ5IGFwcGxpY2F0aW9uCiAgICAgICAgIG5vdGlmeUNhbGxXYWl0aW5nSW5mbyhjdyk7CkBAIC05MjYsNyArOTU3LDcgQEAKIAogICAgICAgICAgICAgICAgIHVwZGF0ZVBob25lU3RhdGUoKTsKIAotICAgICAgICAgICAgICAgIHBob25lLm5vdGlmeUNhbGxTdGF0ZUNoYW5nZWQoKTsKKyAgICAgICAgICAgICAgICBwaG9uZS5ub3RpZnlQcmVjaXNlQ2FsbFN0YXRlQ2hhbmdlZCgpOwogICAgICAgICAgICAgICAgIGRyb3BwZWREdXJpbmdQb2xsLmNsZWFyKCk7CiAgICAgICAgICAgICBicmVhazsKIApAQCAtOTQ1LDkgKzk3Niw5IEBACiAKICAgICAgICAgICAgIGNhc2UgRVZFTlRfRVhJVF9FQ01fUkVTUE9OU0VfQ0RNQToKICAgICAgICAgICAgICAgIC8vbm8gbWF0dGVyIHRoZSByZXN1bHQsIHdlIHN0aWxsIGRvIHRoZSBzYW1lIGhlcmUKLSAgICAgICAgICAgICAgIGlmIChwZW5kaW5nQ2FsbEluRUNNKSB7CisgICAgICAgICAgICAgICBpZiAocGVuZGluZ0NhbGxJbkVjbSkgewogICAgICAgICAgICAgICAgICAgIGNtLmRpYWwocGVuZGluZ01PLmFkZHJlc3MsIHBlbmRpbmdDYWxsQ2xpck1vZGUsIG9idGFpbkNvbXBsZXRlTWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICAgICBwZW5kaW5nQ2FsbEluRUNNID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgcGVuZGluZ0NhbGxJbkVjbSA9IGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcGhvbmUudW5zZXRPbkVjYk1vZGVFeGl0UmVzcG9uc2UodGhpcyk7CiAgICAgICAgICAgICBicmVhazsKQEAgLTk2NSw2ICs5OTYsNyBAQAogICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAvLyBBc3N1bWUgMyB3YXkgY2FsbCBpcyBjb25uZWN0ZWQKICAgICAgICAgICAgICAgICAgICAgcGVuZGluZ01PLm9uQ29ubmVjdGVkSW5Pck91dCgpOworICAgICAgICAgICAgICAgICAgICBwZW5kaW5nTU8gPSBudWxsOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGJyZWFrOwogCkBAIC05NzQsNiArMTAwNiwzOSBAQAogICAgICAgICB9CiAgICAgfQogCisgICAgLyoqCisgICAgICogSGFuZGxlIEVjbSB0aW1lciB0byBiZSBjYW5jZWxlZCBvciByZS1zdGFydGVkCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZUVjbVRpbWVyKGludCBhY3Rpb24pIHsKKyAgICAgICAgcGhvbmUuaGFuZGxlVGltZXJJbkVtZXJnZW5jeUNhbGxiYWNrTW9kZShhY3Rpb24pOworICAgICAgICBzd2l0Y2goYWN0aW9uKSB7CisgICAgICAgIGNhc2UgQ0RNQVBob25lLkNBTkNFTF9FQ01fVElNRVI6IG1Jc0VjbVRpbWVyQ2FuY2VsZWQgPSB0cnVlOyBicmVhazsKKyAgICAgICAgY2FzZSBDRE1BUGhvbmUuUkVTVEFSVF9FQ01fVElNRVI6IG1Jc0VjbVRpbWVyQ2FuY2VsZWQgPSBmYWxzZTsgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiaGFuZGxlRWNtVGltZXIsIHVuc3VwcG9ydGVkIGFjdGlvbiAiICsgYWN0aW9uKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIERpc2FibGUgZGF0YSBjYWxsIHdoZW4gZW1lcmdlbmN5IGNhbGwgaXMgY29ubmVjdGVkCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGRpc2FibGVEYXRhQ2FsbEluRW1lcmdlbmN5Q2FsbChTdHJpbmcgZGlhbFN0cmluZykgewor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L0NkbWFDb25uZWN0aW9uLmphdmEKQEAgLTE2MSw4ICsxNjEsOCBAQAogCiAgICAgICAgIGlzSW5jb21pbmcgPSBmYWxzZTsKICAgICAgICAgY25hcE5hbWUgPSBudWxsOwotICAgICAgICBjbmFwTmFtZVByZXNlbnRhdGlvbiA9IDA7Ci0gICAgICAgIG51bWJlclByZXNlbnRhdGlvbiA9IDA7CisgICAgICAgIGNuYXBOYW1lUHJlc2VudGF0aW9uID0gQ29ubmVjdGlvbi5QUkVTRU5UQVRJT05fQUxMT1dFRDsKKyAgICAgICAgbnVtYmVyUHJlc2VudGF0aW9uID0gQ29ubmVjdGlvbi5QUkVTRU5UQVRJT05fQUxMT1dFRDsKICAgICAgICAgY3JlYXRlVGltZSA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwogCiAgICAgICAgIGlmIChwYXJlbnQgIT0gbnVsbCkgewpAQCAtNDM1LDggKzQzNSwxMCBAQAogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSAhPSBDb21tYW5kc0ludGVyZmFjZS5SYWRpb1N0YXRlLk5WX1JFQURZCiAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwaG9uZS5nZXRJY2NDYXJkKCkuZ2V0U3RhdGUoKSAhPSBSdWltQ2FyZC5TdGF0ZS5SRUFEWSkgewogICAgICAgICAgICAgICAgICAgICByZXR1cm4gRGlzY29ubmVjdENhdXNlLklDQ19FUlJPUjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F1c2VDb2RlPT1DYWxsRmFpbENhdXNlLk5PUk1BTF9DTEVBUklORykgewogICAgICAgICAgICAgICAgICAgICByZXR1cm4gRGlzY29ubmVjdENhdXNlLk5PUk1BTDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gRGlzY29ubmVjdENhdXNlLkVSUk9S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ogICAgICAgICB3aGlsZSAoY3VyckluZGV4IDwgbGVuZ3RoKSB7CiAgICAgICAgICAgICBjID0gcGhvbmVOdW1iZXIuY2hhckF0KGN1cnJJbmRleCk7Ci0gICAgICAgICAgICBpZiAoUGhvbmVOdW1iZXJVdGlscy5pc0RpYWxhYmxlKGMpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGMgPT0gJysnKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBwcyA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbVByb3BlcnRpZXMuZ2V0KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfSURQX1NUUklORywgcHMpOwotICAgICAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocHMpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcyA9ICIwMTEiOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHJldC5hcHBlbmQocHMpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldC5hcHBlbmQoYyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChpc1BhdXNlKGMpIHx8IGlzV2FpdChjKSkgeworICAgICAgICAgICAgaWYgKGlzUGF1c2UoYykgfHwgaXNXYWl0KGMpKSB7CiAgICAgICAgICAgICAgICAgaWYgKGN1cnJJbmRleCA8IGxlbmd0aCAtIDEpIHsKICAgICAgICAgICAgICAgICAgICAgLy8gaWYgUFcgbm90IGF0IHRoZSBlbmQKICAgICAgICAgICAgICAgICAgICAgaW50IG5leHRJbmRleCA9IGZpbmROZXh0UENoYXJPck5vblBPck5vbldDaGFySW5kZXgocGhvbmVOdW1iZXIsIGN1cnJJbmRleCk7CkBAIC05MTEsOCArOTAwLDEwIEBACiAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0SW5kZXggPCBsZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgcEMgPSBmaW5kUE9yV0NoYXJUb0FwcGVuZChwaG9uZU51bWJlciwgY3VyckluZGV4LCBuZXh0SW5kZXgpOwogICAgICAgICAgICAgICAgICAgICAgICAgcmV0LmFwcGVuZChwQyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBQVyBjaGFyIGlzIGltbWVkaWF0ZWx5IGZvbGxvd2VkIGJ5IG5vbi1QVyBjaGFyCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dEluZGV4ID4gKGN1cnJJbmRleCArIDEpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBQVyBjaGFyIHNlcXVlbmNlIGhhcyBtb3JlIHRoYW4gMiBQVyBjaGFyYWN0ZXJzLAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2tpcCB0byB0aGUgbGFzdCBjaGFyYWN0ZXIgc2luY2UgdGhlIHNlcXVlbmNlIGFscmVhZHkgYmUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnRlZCB0byBXQUlUIGNoYXJhY3RlcgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRJbmRleCA+IChjdXJySW5kZXggKyAyKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJJbmRleCA9IG5leHRJbmRleCAtIDE7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV4dEluZGV4ID09IGxlbmd0aCkgewpAQCAtOTI1LDcgKzkxNiw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBjdXJySW5kZXgrKzsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gcmV0LnRvU3RyaW5nKCk7CisgICAgICAgIHJldHVybiBQaG9uZU51bWJlclV0aWxzLmNkbWFDaGVja0FuZFByb2Nlc3NQbHVzQ29kZShyZXQudG9TdHJpbmcoKSk7CiA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0byBhIHNpbXBsZSBsaW5lYXIgc2VxdWVuY2UuCisgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkNvdWxkIG5vdCBjb25maWd1cmUgdXNpbmcgREVGQVVMVF9EQVRBX1JFVFJZX0NPTkZJRz0iCisgICAgICAgICAgICAgICAgICAgICAgICArIERFRkFVTFRfREFUQV9SRVRSWV9DT05GSUcpOworICAgICAgICAgICAgICAgIG1SZXRyeU1nci5jb25maWd1cmUoMjAsIDIwMDAsIDEwMDApOworICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgZGlzcG9zZSgpIHsKLSAgICAgICAgLy9VbnJlZ2lzdGVyIGZyb20gYWxsIGV2ZW50cworICAgICAgICAvLyBVbnJlZ2lzdGVyIGZyb20gYWxsIGV2ZW50cwogICAgICAgICBwaG9uZS5tQ00udW5yZWdpc3RlckZvckF2YWlsYWJsZSh0aGlzKTsKICAgICAgICAgcGhvbmUubUNNLnVucmVnaXN0ZXJGb3JPZmZPck5vdEF2YWlsYWJsZSh0aGlzKTsKICAgICAgICAgbUNkbWFQaG9uZS5tUnVpbVJlY29yZHMudW5yZWdpc3RlckZvclJlY29yZHNMb2FkZWQodGhpcyk7CkBAIC0xOTgsNiArMjE2LDcgQEAKICAgICAgICAgbUNkbWFQaG9uZS5tU1NULnVucmVnaXN0ZXJGb3JDZG1hRGF0YUNvbm5lY3Rpb25EZXRhY2hlZCh0aGlzKTsKICAgICAgICAgbUNkbWFQaG9uZS5tU1NULnVucmVnaXN0ZXJGb3JSb2FtaW5nT24odGhpcyk7CiAgICAgICAgIG1DZG1hUGhvbmUubVNTVC51bnJlZ2lzdGVyRm9yUm9hbWluZ09mZih0aGlzKTsKKyAgICAgICAgcGhvbmUubUNNLnVucmVnaXN0ZXJGb3JDZG1hT3RhUHJvdmlzaW9uKHRoaXMpOwogCiAgICAgICAgIHBob25lLmdldENvbnRleHQoKS51bnJlZ2lzdGVyUmVjZWl2ZXI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IGRlc2lyZWRQb3dlclN0YXRlKSB7CisgICAgICAgICAgICAgICAgJiYgZGVzaXJlZFBvd2VyU3RhdGUKKyAgICAgICAgICAgICAgICAmJiAhbVBlbmRpbmdSZXN0YXJ0UmFkaW8pIHsKIAogICAgICAgICAgICAgcmV0dXJuIHNldHVwRGF0YShyZWFzb24pOwogCkBAIC0zNzUsNyArMzQxLDggQEAKICAgICAgICAgICAgICAgICAgICAgIiBkYXRhRW5hYmxlZD0iICsgZ2V0QW55RGF0YUVuYWJsZWQoKSArCiAgICAgICAgICAgICAgICAgICAgICIgcm9hbWluZz0iICsgcm9hbWluZyArCiAgICAgICAgICAgICAgICAgICAgICIgZGF0YU9uUm9hbWluZ0VuYWJsZT0iICsgZ2V0RGF0YU9uUm9hbWluZ0VuYWJsZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgZGVzaXJlZFBvd2VyU3RhdGU9IiArIGRlc2lyZWRQb3dlclN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgIiBkZXNpcmVkUG93ZXJTdGF0ZT0iICsgZGVzaXJlZFBvd2VyU3RhdGUgKworICAgICAgICAgICAgICAgICAgICAiIFBlbmRpbmdSZXN0YXJ0UmFkaW89IiArIG1QZW5kaW5nUmVzdGFydFJhZGlvKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQpAQCAtNDU5LDkgKzQyNiw3IEBACiAgICAgICAgIHNldFN0YXRlKFN0YXRlLkNPTk5FQ1RFRCk7CiAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIHN0YXJ0TmV0U3RhdFBvbGwoKTsKLSAgICAgICAgLy8gcmVzZXQgcmVjb25uZWN0IHRpbWVyCi0gICAgICAgIG5leHRSZWNvbm5lY3REZWxheSA9IFJFQ09OTkVDVF9ERUxBWV9JTklUSUFMX01JTExJUzsKLSAgICAgICAgbVJlcmVnaXN0ZXJPblJlY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aGFzIGNoYW5nZWQgaW4gdGhlIGludGVyaW0sIHdlIGRvbid0IHdhbnQgdG8KLSAgICAgICAgICogb3ZlcnJpZGUgaXQgd2l0aCBhbiB1bmNvbmRpdGlvbmFsIHBvd2VyIG9uLgotICAgICAgICAgKi8KKyAgICAgICAgc2VuZEVtcHR5TWVzc2FnZURlbGF5ZWQoRVZFTlRfUkVTVEFSVF9SQURJTywgVElNRV9ERUxBWUVEX1RPX1JFU1RBUlRfUkFESU8pOworICAgICAgICBtUGVuZGluZ1Jlc3RhcnRSYWRpbyA9IHRydWU7CiAgICAgfQogCiAgICAgcHJpdmF0ZSBSdW5uYWJsZSBtUG9sbE5ldFN0YXQgPSBuZXcgUnVubmFibGUoKSB7CkBAIC01NDEsMTAgKzUwMSwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgc2VudFNpbmNlTGFzdFJlY3YgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgbmV3QWN0aXZpdHkgPSBBY3Rpdml0eS5EQVRBSU47CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2VudCA9PSAwICYmIHJlY2VpdmVkID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ld0FjdGl2aXR5ID0gQWN0aXZpdHkuTk9ORTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld0FjdGl2aXR5ID0gKGFjdGl2aXR5ID09IEFjdGl2aXR5LkRPUk1BTlQpID8gYWN0aXZpdHkgOiBBY3Rpdml0eS5OT05FOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgc2VudFNpbmNlTGFzdFJlY3YgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgbmV3QWN0aXZpdHkgPSBBY3Rpdml0eS5OT05FOworICAgICAgICAgICAgICAgICAgICAgICAgbmV3QWN0aXZpdHkgPSAoYWN0aXZpdHkgPT0gQWN0aXZpdHkuRE9STUFOVCkgPyBhY3Rpdml0eSA6IEFjdGl2aXR5Lk5PTkU7CiAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aXZpdHkgIT0gbmV3QWN0aXZpdHkpIHsKQEAgLTYwOCw4ICs1NjgsNyBAQAogICAgIHByaXZhdGUgYm9vbGVhbiByZXRyeUFmdGVyRGlzY29ubmVjdGVkKFN0cmluZyByZWFzb24pIHsKICAgICAgICAgYm9vbGVhbiByZXRyeSA9IHRydWU7CiAKLSAgICAgICAgaWYgKCBQaG9uZS5SRUFTT05fUkFESU9fVFVSTkVEX09GRi5lcXVhbHMocmVhc29uKSB8fAotICAgICAgICAgICAgIFBob25lLlJFQVNPTl9EQVRBX0RJU0FCTEVELmVxdWFscyhyZWFzb24pICkgeworICAgICAgICBpZiAoIFBob25lLlJFQVNPTl9SQURJT19UVVJORURfT0ZGLmVxdWFscyhyZWFzb24pICkgewogICAgICAgICAgICAgcmV0cnkgPSBmYWxzZTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gcmV0cnk7CkBAIC02MTcsMjEgKzU3NiwxMyBAQAogCiAgICAgcHJpdmF0ZSB2b2lkIHJlY29ubmVjdEFmdGVyRmFpbChGYWlsQ2F1c2UgbGFzdEZhaWxDYXVzZUNvZGUsIFN0cmluZyByZWFzb24pIHsKICAgICAgICAgaWYgKHN0YXRlID09IFN0YXRlLkZBSUxFRCkgewotICAgICAgICAgICAgaWYgKG5leHRSZWNvbm5lY3REZWxheSA+IFJFQ09OTkVDVF9ERUxBWV9NQVhfTUlMTElTKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1SZXJlZ2lzdGVyT25SZWNvbm5lY3RGYWlsdXJlKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFdlIGhhdmUgYWxyZWFkeSB0cmllZCB0byByZS1yZWdpc3RlciB0byB0aGUgbmV0d29yay4KLSAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBtaWdodCBiZSBhIHByb2JsZW0gd2l0aCB0aGUgZGF0YSBuZXR3b3JrLgotICAgICAgICAgICAgICAgICAgICBuZXh0UmVjb25uZWN0RGVsYXkgPSBSRUNPTk5FQ1RfREVMQVlfTUFYX01JTExJUzsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAvLyBUcnkgdG8gUmUtcmVnaXN0ZXIgdG8gdGhlIG5ldHdvcmsuCi0gICAgICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJQRFAgYWN0aXZhdGUgZmFpbGVkLCBSZXJlZ2lzdGVyaW5nIHRvIHRoZSBuZXR3b3JrIik7Ci0gICAgICAgICAgICAgICAgICAgIG1SZXJlZ2lzdGVyT25SZWNvbm5lY3RGYWlsdXJlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgbUNkbWFQaG9uZS5tU1NULnJlUmVnaXN0ZXJOZXR3b3JrKG51bGwpOwotICAgICAgICAgICAgICAgICAgICBuZXh0UmVjb25uZWN0RGVsYXkgPSBSRUNPTk5FQ1RfREVMQVlfSU5JVElBTF9NSUxMSVM7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogRm9yIG5vdyBXaXRoIENETUEgd2UgbmV2ZXIgdHJ5IHRvIHJlY29ubmVjdCBvbgorICAgICAgICAgICAgICogZXJyb3IgYW5kIGluc3RlYWQganVzdCBjb250aW51ZSB0byByZXRyeQorICAgICAgICAgICAgICogYXQgdGhlIGxhc3QgdGltZSB1bnRpbCB0aGUgc3RhdGUgaXMgY2hhbmdlZC4KKyAgICAgICAgICAgICAqIFRPRE86IE1ha2UgdGhpcyBjb25maWd1cmFibGU/CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGludCBuZXh0UmVjb25uZWN0RGVsYXkgPSBtUmV0cnlNZ3IuZ2V0UmV0cnlUaW1lcigpOwogICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkRhdGEgQ29ubmVjdGlvbiBhY3RpdmF0ZSBmYWlsZWQuIFNjaGVkdWxpbmcgbmV4dCBhdHRlbXB0IGZvciAiCiAgICAgICAgICAgICAgICAgICAgICsgKG5leHRSZWNvbm5lY3REZWxheSAvIDEwMDApICsgInMiKTsKIApAQCAtNjQ1LDggKzU5Niw3IEBACiAgICAgICAgICAgICAgICAgICAgIFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpICsgbmV4dFJlY29ubmVjdERlbGF5LAogICAgICAgICAgICAgICAgICAgICBtUmVjb25uZWN0SW50ZW50KTsKIAotICAgICAgICAgICAgLy8gZG91YmxlIGl0IGZvciBuZXh0IHRpbWUKLSAgICAgICAgICAgIG5leHRSZWNvbm5lY3REZWxheSAqPSAyOworICAgICAgICAgICAgbVJldHJ5TWdyLmluY3JlYXNlUmV0cnlDb3VudCgpOwogCiAgICAgICAgICAgICBpZiAoIXNob3VsZFBvc3ROb3RpZmljYXRpb24obGFzdEZhaWxDYXVzZUNvZGUpKSB7CiAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywiTk9UIFBvc3RpbmcgRGF0YSBDb25uZWN0aW9uIFVuYXZhaWxhYmxlIG5vdGlmaWNhdGlvbiAiCkBAIC02NzgsOCArNjI4LDggQEAKICAgICAvKioKICAgICAgKiBAb3ZlcnJpZGUgY29tLmFuZHJvaWQuaW50ZXJuYWwudGVsZXBob255LkRhdGFDb25uZWN0aW9uVHJhY2tlcgogICAgICAqLwotICAgIHByb3RlY3RlZCB2b2lkIG9uVHJ5U2V0dXBEYXRhKFN0cmluZyByZWFzb24pIHsKLSAgICAgICAgdHJ5U2V0dXBEYXRhKHJlYXNvbik7CisgICAgcHJvdGVjdGVkIGJvb2xlYW4gb25UcnlTZXR1cERhdGEoU3RyaW5nIHJlYXNvbikgeworICAgICAgICByZXR1cm4gdHJ5U2V0dXBEYXRhKHJlYXNvbik7CiAgICAgfQogCiAgICAgLyoqC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dXJlID0gZmFsc2U7CisgICAgICAgICAgICBtUmV0cnlNZ3IucmVzZXRSZXRyeUNvdW50KCk7CiAgICAgICAgICAgICAvLyBpbiBjYXNlIGRhdGEgc2V0dXAgd2FzIGF0dGVtcHRlZCB3aGVuIHdlIHdlcmUgb24gYSB2b2ljZSBjYWxsCiAgICAgICAgICAgICB0cnlTZXR1cERhdGEoUGhvbmUuUkVBU09OX1ZPSUNFX0NBTExfRU5ERUQpOwogICAgICAgICB9CkBAIC04NDAsNyArNzk5LDcgQEAKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBTdGF0ZS5GQUlMRUQpIHsKICAgICAgICAgICAgICAgICBjbGVhblVwQ29ubmVjdGlvbihmYWxzZSwgUGhvbmUuUkVBU09OX0NETUFfREFUQV9ERVRBQ0hFRCk7Ci0gICAgICAgICAgICAgICAgbmV4dFJlY29ubmVjdERlbGF5ID0gUkVDT05ORUNUX0RFTEFZX0lOSVRJQUxfTUlMTElTOworICAgICAgICAgICAgICAgIG1SZXRyeU1nci5yZXNldFJldHJ5Q291bnQoKTsKIAogICAgICAgICAgICAgICAgIENkbWFDZWxsTG9jYXRpb24gbG9jID0gKENkbWFDZWxsTG9jYXRpb24pKHBob25lLmdldENlbGxMb2NhdGlvbigpKTsKICAgICAgICAgICAgICAgICBpbnQgYnNpZCA9IChsb2MgIT0gbnVsbCkgPyBsb2MuZ2V0QmFzZVN0YXRpb25JZCgpIDogLTE7CkBAIC04NTMsNiArODEyLDM3IEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgb25DZG1hT3RhUHJvdmlzaW9uKEFzeW5jUmVzdWx0IGFyKSB7CisgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgaW50IFtdIG90YVByaXZpc2lvbiA9IChpbnQgW10pYXIucmVzdWx0OworICAgICAgICAgICAgaWYgKChvdGFQcml2aXNpb24gIT0gbnVsbCkgJiYgKG90YVByaXZpc2lvbi5sZW5ndGggPiAxKSkgeworICAgICAgICAgICAgICAgIHN3aXRjaCAob3RhUHJpdmlzaW9uWzBdKSB7CisgICAgICAgICAgICAgICAgY2FzZSBQaG9uZS5DRE1BX09UQV9QUk9WSVNJT05fU1RBVFVTX0NPTU1JVFRFRDoKKyAgICAgICAgICAgICAgICBjYXNlIFBob25lLkNETUFfT1RBX1BST1ZJU0lPTl9TVEFUVVNfT1RBUEFfU1RPUFBFRDoKKyAgICAgICAgICAgICAgICAgICAgbVJldHJ5TWdyLnJlc2V0UmV0cnlDb3VudCgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgb25SZXN0YXJ0UmFkaW8oKSB7CisgICAgICAgIGlmIChtUGVuZGluZ1Jlc3RhcnRSYWRpbykgeworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIioqKioqKioqKioqKlRVUk4gT0ZGIFJBRElPKioqKioqKioqKioqKioiKTsKKyAgICAgICAgICAgIHBob25lLm1DTS5zZXRSYWRpb1Bvd2VyKGZhbHNlLCBudWxsKTsKKyAgICAgICAgICAgIC8qIE5vdGU6IG5vIG5lZWQgdG8gY2FsbCBzZXRSYWRpb1Bvd2VyKHRydWUpLiAgQXNzdW1pbmcgdGhlIGRlc2lyZWQKKyAgICAgICAgICAgICAqIHJhZGlvIHBvd2VyIHN0YXRlIGlzIHN0aWxsIE9OIChhcyB0cmFja2VkIGJ5IFNlcnZpY2VTdGF0ZVRyYWNrZXIpLAorICAgICAgICAgICAgICogU2VydmljZVN0YXRlVHJhY2tlciB3aWxsIGNhbGwgc2V0UmFkaW9Qb3dlciB3aGVuIGl0IHJlY2VpdmVzIHRoZQorICAgICAgICAgICAgICogUkFESU9f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lwZSkgewogICAgICAgICBpZiAobUFjdGl2ZURhdGFDb25uZWN0aW9uICE9IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybiBtQWN0aXZlRGF0YUNvbm5lY3Rpb24uZ2V0SXBBZGRyZXNzKCk7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQogCi0gICAgU3RyaW5nIGdldEdhdGV3YXkoKSB7CisgICAgcHJvdGVjdGVkIFN0cmluZyBnZXRHYXRld2F5KFN0cmluZyBhcG5UeXBlKSB7CiAgICAgICAgIGlmIChtQWN0aXZlRGF0YUNvbm5lY3Rpb24gIT0gbnVsbCkgewogICAgICAgICAgICAgcmV0dXJuIG1BY3RpdmVEYXRhQ29ubmVjdGlvbi5nZXRHYXRld2F5QWRkcmVzcygpOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBudWxsOwogICAgIH0KIAotICAgIHByb3RlY3RlZCBTdHJpbmdbXSBnZXREbnNTZXJ2ZXJzKCkgeworICAgIHByb3RlY3RlZCBTdHJpbmdbXSBnZXREbnNTZXJ2ZXJzKFN0cmluZyBhcG5UeXBlKSB7CiAgICAgICAgIGlmIChtQWN0aXZlRGF0YUNvbm5lY3Rpb24gIT0gbnVsbCkgewogICAgICAgICAgICAgcmV0dXJuIG1BY3RpdmVEYXRhQ29ubmVjdGlvbi5nZXREbnNTZXJ2ZXJzKCk7CiAgICAgICAgIH0KQEAgLTk2MSw2ICs5NTEsMTUgQEAKICAgICAgICAgICAgICAgICBvbkRhdGFTdGF0ZUNoYW5nZWQoKEFzeW5jUmVzdWx0KSBtc2cub2JqKTsKICAgICAgICAgICAgICAgICBicmVhazsKIAorICAgICAgICAgICAgY2FzZSBFVkVOVF9DRE1BX09UQV9QUk9WSVNJT046CisgICAgICAgICAgICAgICAgb25DZG1hT3RhUHJvdmlzaW9uKChBc3luY1Jlc3VsdCkgbXNnLm9iaik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2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RzLlJFU1VMVF9TTVNfSEFORExFRDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChTbXNFbnZlbG9wZS5URUxFU0VSVklDRV9XQVAgPT0gdGVsZVNlcnZpY2UpewotICAgICAgICAgICAgcmV0dXJuIHByb2Nlc3NDZG1hV2FwUGR1KHNtcy5nZXRVc2VyRGF0YSgpLCBzbXMubWVzc2FnZVJlZiwKLSAgICAgICAgICAgICAgICAgICAgc21zLmdldE9yaWdpbmF0aW5nQWRkcmVzcygpKTsKLSAgICAgICAgfSBlbHNlIGlmIChTbXNFbnZlbG9wZS5URUxFU0VSVklDRV9WTU4gPT0gdGVsZVNlcnZpY2UpIHsKKyAgICAgICAgaWYgKChTbXNFbnZlbG9wZS5URUxFU0VSVklDRV9WTU4gPT0gdGVsZVNlcnZpY2UpIHx8CisgICAgICAgICAgICAgICAgKFNtc0VudmVsb3BlLlRFTEVTRVJWSUNFX01XSSA9PSB0ZWxlU2VydmljZSkpIHsKICAgICAgICAgICAgIC8vIGhhbmRsaW5nIFZvaWNlbWFpbAogICAgICAgICAgICAgaW50IHZvaWNlbWFpbENvdW50ID0gc21zLmdldE51bU9mVm9pY2VtYWlscygpOwogICAgICAgICAgICAgTG9nLmQoVEFHLCAiVm9pY2VtYWlsIGNvdW50PSIgKyB2b2ljZW1haWxDb3VudCk7CkBAIC0xMDYsMTAgKzEwNCwzOSBAQAogICAgICAgICAgICAgZWRpdG9yLnB1dEludChDRE1BUGhvbmUuVk1fQ09VTlRfQ0RNQSwgdm9pY2VtYWlsQ291bnQpOwogICAgICAgICAgICAgZWRpdG9yLmNvbW1pdCgpOwogICAgICAgICAgICAgKChDRE1BUGhvbmUpIG1QaG9uZSkudXBkYXRlTWVzc2FnZVdhaXRpbmdJbmRpY2F0b3Iodm9pY2VtYWlsQ291bnQpOworICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7CisgICAgICAgIH0gZWxzZSBpZiAoKHNtcy5nZXRVc2VyRGF0YSgpID09IG51bGwpKSB7CisgICAgICAgICAgICBpZiAoQ29uZmlnLkxPR0QpIHsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJSZWNlaXZlZCBTTVMgd2l0aG91dCB1c2VyIGRhdGEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGhhbmRsZWQpIHsKICAgICAgICAgICAgIHJldHVybiBJbnRlbnRzLlJFU1VMVF9TTVNfSEFORExFRDsKICAgICAgICAgfQogCi0gICAgICAgIC8qKgorICAgICAgICBpZiAoIW1TdG9yYWdlQXZhaWxhYmxlICYmIChzbXMuZ2V0TWVzc2FnZUNsYXNzKCkgIT0gTWVzc2FnZUNsYXNzLkNMQVNTXzApKSB7CisgICAgICAgICAgICAvLyBJdCdzIGEgc3RvcmFibGUgbWVzc2FnZSBhbmQgdGhlcmUncyBubyBzdG9yYWdlIGF2YWlsYWJsZS4gIEJhaWwuCisgICAgICAgICAgICAvLyAoU2VlIEMuUzAwMTUtQiB2Mi4wIGZvciBhIGRlc2NyaXB0aW9uIG9mICJJbW1lZGlhdGUgRGlzcGxheSIKKyAgICAgICAgICAgIC8vIG1lc3NhZ2VzLCB3aGljaCB3ZSByZXByZXNlbnQgYXMgQ0xBU1NfMC4pCisgICAgICAgICAgICByZXR1cm4gSW50ZW50cy5SRVNVTFRfU01TX09VVF9PRl9NRU1PUlk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoU21zRW52ZWxvcGUuVEVMRVNFUlZJQ0VfV0FQID09IHRlbGVTZXJ2aWNlKSB7CisgICAgICAgICAgICByZXR1cm4gcHJvY2Vzc0NkbWFXYXBQZHUoc21zLmdldFVzZXJEYXRhKCksIHNtcy5tZXNzYWdlUmVmLAorICAgICAgICAgICAgICAgICAgICBzbXMuZ2V0T3JpZ2luYXRpbmdBZGRyZXNzKCkpOworICAgICAgICB9CisKKyAgICAgICAgLy8gUmVqZWN0IChOQUspIGFueSBtZXN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KyAgICAgICAgICAgIFBlbmRpbmdJbnRlbnQgc2VudEludGVudCwgUGVuZGluZ0ludGVudCBkZWxpdmVyeUludGVudCkgeworICAgICAgICBpZiAoU3lzdGVtUHJvcGVydGllcy5nZXRCb29sZWFuKFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfSU5FQ01fTU9ERSwgZmFsc2UpKSB7CisgICAgICAgICAgICBpZiAoc2VudEludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgc2VudEludGVudC5zZW5kKFNtc01hbmFnZXIuUkVTVUxUX0VSUk9SX05PX1NFUlZJQ0UpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKENhbmNlbGVkRXhjZXB0aW9uIGV4KSB7fQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKENvbmZpZy5MT0dEKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiQmxvY2sgU01TIGluIEVtZXJnZW5jeSBDYWxsYmFjayBtb2RlIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgc2VuZFJhd1BkdShwZHUuZW5jb2RlZFNjQWRkcmVzcywgcGR1LmVuY29kZWRNZXNzYWdlLCBzZW50SW50ZW50LCBkZWxpdmVyeUludGVudCk7CiAgICAgfQogCiAgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KQEAgLTM0Myw2ICszOTcsMTIgQEAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLwogICAgIHByb3RlY3RlZCB2b2lkIGFja25vd2xlZGdlTGFzdEluY29taW5nU21zKGJvb2xlYW4gc3VjY2VzcywgaW50IHJlc3VsdCwgTWVzc2FnZSByZXNwb25zZSl7CiAgICAgICAgIC8vIEZJWE1FIHVuaXQgdGVzdCBsZWF2ZXMgY20gPT0gbnVsbC4gdGhpcyBzaG91bGQgY2hhbmdlCisKKyAgICAgICAgU3RyaW5nIGluRWNtPVN5c3RlbVByb3BlcnRpZXMuZ2V0KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfSU5FQ01fTU9ERSwgImZhbHNlIik7CisgICAgICAgIGlmIChpbkVjbS5lcXVhbHMoInRydWUiKSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKICAgICAgICAgaWYgKG1DbSAhPSBudWxsKSB7CiAgICAgICAgICAgICBtQ20uYWNrbm93bGVkZ2VMYXN0SW5jb21pbmdDZG1hU21zKHN1Y2Nlc3MsIHJlc3VsdFRvQ2F1c2UocmVzdWx0KSwgcmVzcG9uc2UpOwogICAgICAgICB9CkBAIC0zNjUsMTUgKzQyNSwxNyBAQAogCiAgICAgcHJpdmF0ZSBpbnQgcmVzdWx0VG9DYXVzZShpbnQgcmMpIHsKICAgICAgICAgc3dpdGNoIChyYykgewotICAgICAgICAgICAgY2FzZSBBY3Rpdml0eS5SRVNVTFRfT0s6Ci0gICAgICAgICAgICBjYXNlIEludGVudHMuUkVTVUxUX1NNU19IQU5ETEVEOgotICAgICAgICAgICAgICAgIC8vIENhdXNlIGNvZGUgaXMgaWdub3JlZCBvbiBzdWNjZXNzLgotICAgICAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICAgICAgY2FzZSBJbnRlbnRzLlJFU1VMVF9TTVNfT1VUX09GX01FTU9SWToKLSAgICAgICAgICAgICAgICByZXR1cm4gQ29tbWFuZHNJbnRlcmZhY2UuQ0RNQV9TTVNfRkFJTF9DQVVTRV9SRVNPVVJDRV9TSE9SVEFHRTsKLSAgICAgICAgICAgIGNhc2UgSW50ZW50cy5SRVNVTFRfU01TX0dFTkVSSUNfRVJST1I6Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIHJldHVybiBDb21tYW5kc0ludGVyZmFjZS5DRE1BX1NNU19GQUlMX0NBVVNFX09USEVSX1RFUk1JTkFMX1BST0JMRU07CisgICAgICAgIGNhc2UgQWN0aXZpdHkuUkV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GFjZWQgaW4gTWVzc2FnZS5vYmoKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCByZWdpc3RlckZvclN1YnNjcmlwdGlvbkluZm9SZWFkeShIYW5kbGVyIGgsIGludCB3aGF0LCBPYmplY3Qgb2JqKSB7CisgICAgICAgIFJlZ2lzdHJhbnQgciA9IG5ldyBSZWdpc3RyYW50KGgsIHdoYXQsIG9iaik7CisgICAgICAgIGNkbWFGb3JTdWJzY3JpcHRpb25JbmZvUmVhZHlSZWdpc3RyYW50cy5hZGQocik7CisKKyAgICAgICAgaWYgKGlzTWluSW5mb1JlYWR5KCkpIHsKKyAgICAgICAgICAgIHIubm90aWZ5UmVnaXN0cmFudCgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdW5yZWdpc3RlckZvclN1YnNjcmlwdGlvbkluZm9SZWFkeShIYW5kbGVyIGgpIHsKKyAgICAgICAgY2RtYUZvclN1YnNjcmlwdGlvbkluZm9SZWFkeVJlZ2lzdHJhbnRzLnJlbW92ZShoKTsKKyAgICB9CisKICAgICBwdWJsaWMgdm9pZAogICAgIGdldExhY0FuZENpZChNZXNzYWdlIG9uQ29tcGxldGUpIHsKICAgICAgICAgY20uZ2V0UmVnaXN0cmF0aW9uU3RhdGUob2J0YWluTWVzc2FnZSgKQEAgLTI3NiwzNyArMjkzLDQxIEBACiAKICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgewogICAgICAgICBjYXNlIEVWRU5UX1JBRElPX0FWQUlMQUJMRToKLSAgICAgICAgICAgIC8vdGhpcyBpcyB1bm5lY2Vzc2FyeQotICAgICAgICAgICAgLy9zZXRQb3dlclN0YXRlVG9EZXNpcmVkKCk7CiAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICBjYXNlIEVWRU5UX1JVSU1fUkVBRFk6Ci0gICAgICAgICAgICAvLyBUaGUgUlVJTSBpcyBub3cgcmVhZHkgaS5lIGlmIGl0IHdhcyBsb2NrZWQKLSAgICAgICAgICAgIC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SBjaGFuZ2VkCisgICAgICAgICAgICAgICAgLy8gT25seSB1cGRhdGUgaWYgY2VsbCBsb2NhdGlvbiByZWFsbHkgY2hhbmdlZC4KICAgICAgICAgICAgICAgICBpZiAoY2VsbExvYy5nZXRCYXNlU3RhdGlvbklkKCkgIT0gYmFzZVN0YXRpb25EYXRhWzBdCiAgICAgICAgICAgICAgICAgICAgICAgICB8fCBjZWxsTG9jLmdldEJhc2VTdGF0aW9uTGF0aXR1ZGUoKSAhPSBiYXNlU3RhdGlvbkRhdGFbMV0KICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGNlbGxMb2MuZ2V0QmFzZVN0YXRpb25Mb25naXR1ZGUoKSAhPSBiYXNlU3RhdGlvbkRhdGFbMl0pIHsKQEAgLTM3NiwxMSArMzk3LDYxIEBACiAKICAgICAgICAgY2FzZSBFVkVOVF9QT0xMX1NUQVRFX1JFR0lTVFJBVElPTl9DRE1BOgogICAgICAgICBjYXNlIEVWRU5UX1BPTExfU1RBVEVfT1BFUkFUT1JfQ0RNQToKLSAgICAgICAgY2FzZSBFVkVOVF9QT0xMX1NUQVRFX0NETUFfU1VCU0NSSVBUSU9OOgogICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpIG1zZy5vYmo7CiAgICAgICAgICAgICBoYW5kbGVQb2xsU3RhdGVSZXN1bHQobXNnLndoYXQsIGFyKTsKICAgICAgICAgICAgIGJyZWFrOwogCisgICAgICAgIGNhc2UgRVZFTlRfUE9MTF9TVEFURV9DRE1BX1NVQlNDUklQVElPTjogLy8gSGFuZGxlIFJJTF9DRE1BX1NVQlNDUklQVElPTgorICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpIG1zZy5vYmo7CisKKyAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFN0cmluZyBjZG1hU3Vic2NyaXB0aW9uW10gPSAoU3RyaW5nW10pYXIucmVzdWx0OworICAgICAgICAgICAgICAgIGlmIChjZG1hU3Vic2NyaXB0aW9uICE9IG51bGwgJiYgY2RtYVN1YnNjcmlwdGlvbi5sZW5ndGggPj0gNSkgeworICAgICAgICAgICAgICAgICAgICBtTWRuID0gY2RtYVN1YnNjcmlwdGlvblswXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNkbWFTdWJzY3JpcHRpb25bMV0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gc2lkID0gY2RtYVN1YnNjcmlwdGlvblsxXS5zcGxpdCgiLCIpOworICAgICAgICAgICAgICAgICAgICAgICAgbUhvbWVTeXN0ZW1JZCA9IG5ldyBpbnRbc2lkLmxlbmd0aF07CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNpZC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ib21lU3lzdGVtSWRbaV0gPSBJbnRlZ2VyLnBhcnNlSW50KHNpZFtpXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJlcnJvciBwYXJzaW5nIHN5c3RlbSBpZDogIiwgZXgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCJHRVRfQ0RNQV9TVUJTQ1JJUFRJT04gU0lEPSIgKyBjZG1hU3Vic2NyaXB0aW9uWzFdICk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNkbWFTdWJzY3JpcHRpb25bMl0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gbmlkID0gY2RtYVN1YnNjcmlwdGlvblsyXS5zcGxpdCgiLCIpOworICAgICAgICAgICAgICAgICAgICAgICAgbUhvbWVOZXR3b3JrSWQgPSBuZXcgaW50W25pZC5sZW5ndGhdOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuaWQubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSG9tZU5ldHdvcmtJZFtpXSA9IEludGVnZXIucGFyc2VJbnQobmlkW2ldKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgImVycm9yIHBhcnNpbmcgbmV0d29yayBpZDogIiwgZXgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCJHRVRfQ0RNQV9TVUJTQ1JJUFRJT04gTklEPSIgKyBjZG1hU3Vic2NyaXB0aW9uWzJdICk7CisgICAgICAgICAgICAgICAgICAgIG1NaW4gPSBjZG1hU3Vic2NyaXB0aW9uWzNdOworICAgICAgICAgICAgICAgICAgICBtUHJsVmVyc2lvbiA9IGNkbWFTdWJzY3JpcHRpb25bNF07CisgICAgICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsIkdFVF9DRE1BX1NVQlNDUklQVElPTiBNRE49IiArIG1NZG4pOworICAgICAgICAgICAgICAgICAgICAvL05vdGlmeSBhcHBzIHN1YnNjcmlwdGlvbiBpbmZvIGlzIHJlYWR5CisgICAgICAgICAgICAgICAgICAgIGlmIChjZG1hRm9yU3Vic2NyaXB0aW9uSW5mb1JlYWR5UmVnaXN0cmFudHMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2RtYUZvclN1YnNjcmlwdGlvbkluZm9SZWFkeVJlZ2lzdHJhbnRzLm5vdGlmeVJlZ2lzdHJhbnRzKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKCFtSXNNaW5JbmZvUmVhZHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Jc01pbkluZm9SZWFkeSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcGhvbmUuZ2V0SWNjQ2FyZCgpLmJyb2FkY2FzdEljY1N0YXRlQ2hhbmdlZEludGVudChJY2NDYXJkLklOVEVOVF9WQUxVRV9JQ0NfSU1TSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCJlcnJvciBwYXJzaW5nIGNkbWFTdWJzY3JpcHRpb24gcGFyYW1zIG51bT0iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjZG1hU3Vic2NyaXB0aW9uLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgY2FzZSBFVkVOVF9QT0xMX1NJR05BTF9TVFJFTkdUSDoKICAgICAgICAgICAgIC8vIEp1c3QgcG9sbCBzaWduYWwgc3RyZW5ndGguLi5ub3QgcGFydCBvZiBwb2xsU3RhdGUoKQogCkBAIC0zOTcsMTMgKzQ2OCwxMiBAQAogICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgY2FzZSBFVkVOVF9TSUdOQUxfU1RSRU5HVEhfVVBEQVRFOgotICAgICAgICAgICAgLy8gVGhpcyBpcyBhIG5vdGlmaWNhdGlvbiBmcm9tCi0gICAgICAgICAgIC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ZSgpOwogICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgY2FzZSBFVkVOVF9PVEFfUFJPVklTSU9OX1NUQVRVU19DSEFOR0U6CisgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW50cyA9IChpbnRbXSkgYXIucmVzdWx0OworICAgICAgICAgICAgICAgIGludCBvdGFTdGF0dXMgPSBpbnRzWzBdOworICAgICAgICAgICAgICAgIGlmIChvdGFTdGF0dXMgPT0gcGhvbmUuQ0RNQV9PVEFfUFJPVklTSU9OX1NUQVRVU19DT01NSVRURUQKKyAgICAgICAgICAgICAgICAgICAgfHwgb3RhU3RhdHVzID09IHBob25lLkNETUFfT1RBX1BST1ZJU0lPTl9TVEFUVVNfT1RBUEFfU1RPUFBFRCkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiUmVjZWl2ZWQgT1RBX1BST0dSQU1NSU5HIENvbXBsZXRlLFJlbG9hZCBNRE4gIik7CisgICAgICAgICAgICAgICAgICAgIGNtLmdldENETUFTdWJzY3JpcHRpb24oIG9idGFpbk1lc3NhZ2UoRVZFTlRfUE9MTF9TVEFURV9DRE1BX1NVQlNDUklQVElPTikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgRVZFTlRfU0VUX1JBRElPX1BPV0VSX09GRjoKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICAgICAgaWYgKG1QZW5kaW5nUmFkaW9Qb3dlck9mZkFmdGVyRGF0YU9mZikgeworICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coIkVWRU5UX1NFVF9SQURJT19PRkYsIHR1cm4gcmFkaW8gb2ZmIG5vdy4iKTsKKyAgICAgICAgICAgICAgICAg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OTkVDVElORykgewotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coIkRhdGEgc2h1dGRvd24gY29tcGxldGUuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW1QZW5kaW5nUmFkaW9Qb3dlck9mZkFmdGVyRGF0YU9mZikgeworICAgICAgICAgICAgICAgICAgICBEYXRhQ29ubmVjdGlvblRyYWNrZXIuU3RhdGUgY3VycmVudFN0YXRlID0gZGNUcmFja2VyLmdldFN0YXRlKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50U3RhdGUgIT0gRGF0YUNvbm5lY3Rpb25UcmFja2VyLlN0YXRlLkNPTk5FQ1RFRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRTdGF0ZSAhPSBEYXRhQ29ubmVjdGlvblRyYWNrZXIuU3RhdGUuRElTQ09OTkVDVElORykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgbG9nKCJEYXRhIGRpc2Nvbm5lY3RlZCwgdHVybiBvZmYgcmFkaW8gcmlnaHQgYXdheS4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNtLnNldFJhZGlvUG93ZXIoZmFsc2UsIG51bGwpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNlbmRFbXB0eU1lc3NhZ2VEZWxheWVkKEVWRU5UX1NFVF9SQURJT19QT1dFUl9PRkYsIDUwMDApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coIldhaXQgNSBzZWMgZm9yIGRhdGEgdG8gYmUgZGlzY29ubmVjdGVkLCB0aGVuIHR1cm4gb2ZmIHJhZGlvLiIpOworICAgICAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdSYWRpb1Bvd2VyT2ZmQWZ0ZXJEYXRhT2ZmID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJDYW5ub3Qgc2VuZCBkZWxheWVkIE1zZywgdHVybiBvZmYgcmFkaW8gcmlnaHQgYXdheS4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNtLnNldFJhZGlvUG93ZXIoZmFsc2UsIG51bGwpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN5c3RlbUNsb2NrLnNsZWVwKERBVEFfU1RBVEVfUE9MTF9TTEVFUF9NUyk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBJZiBpdCdzIG9uIGFuZCBhdmFpbGFibGUgYW5kIHdlIHdhbnQgaXQgb2ZmLi4KLSAgICAgICAgICAgIGNtLnNldFJhZGlvUG93ZXIoZmFsc2UsIG51bGwpOwogICAgICAgICB9IC8vIE90aGVyd2lzZSwgd2UncmUgaW4gdGhlIGRlc2lyZWQgc3RhdGUKICAgICB9CiAKQEAgLTUxOCw3ICs2MTUsNyBAQAogICAgICAgICBpbnQgaW50c1tdOwogICAgICAgICBTdHJpbmcgc3RhdGVzW107CiAKLSAgICAgICAgLy8gSWdub3JlIHN0YWxlIHJlcXVlc3RzIGZyb20gbGFzdCBwb2xsCisgICAgICAgIC8vIElnbm9yZSBzdGFsZSByZXF1ZXN0cyBmcm9tIGxhc3QgcG9sbC4KICAgICAgICAgaWYgKGFyLnVzZXJPYmogIT0gcG9sbGluZ0NvbnRleHQpIHJldHVybjsKIAogICAgICAgICBpZiAoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKQEAgLTUyOSwxMyArNjI2LDEzIEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChlcnIgPT0gQ29tbWFuZEV4Y2VwdGlvbi5FcnJvci5SQURJT19OT1RfQVZBSUxBQkxFKSB7Ci0gICAgICAgICAgICAgICAgLy8gUmFkaW8gaGFzIGNyYXNoZWQgb3IgdHVybmVkIG9mZgorICAgICAgICAgICAgICAgIC8vIFJhZGlvIGhhcyBjcmFzaGVkIG9yIHR1cm5lZCBvZmYuCiAgICAgICAgICAgICAgICAgY2FuY2VsUG9sbFN0YXRlKCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoIWNtLmdldFJhZGlvU3RhdGUoKS5pc09uKCkpIHsKLSAgICAgICAgICAgICAgICAvLyBSYWRpbyBoYXMgY3Jhc2hlZCBvciB0dXJuZWQgb2ZmCisgICAgICAgICAgICAgICAgLy8gUmFkaW8gaGFzIGNyYXNoZWQgb3IgdHVybmVkIG9mZi4KICAgICAgICAgICAgICAgICBjYW5jZWxQb2xsU3RhdGUoKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CkBAIC01ODksMTAgKzY4NiwxNSBAQAogICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIG1SZWdpc3RyYXRpb25TdGF0ZSA9IHJlZ2lzdHJhdGlvblN0YXRlOwotICAgICAgICAgICAgICAgIG1DZG1hUm9hbWluZyA9IHJlZ0NvZGVJc1JvYW1pbmcocmVnaXN0cmF0aW9uU3RhdGUpOworICAgICAgICAgICAgICAgIC8vIFdoZW4gcmVnaXN0cmF0aW9uIHN0YXRlIGlzIHJvYW1pbmcgYW5kIFRTQjU4CisgICAgICAgICAgICAgICAgLy8gcm9hbWluZyBpbmRpY2F0b3IgaXMgbm90IGluIHRoZSBjYXJyaWVyLXNwZWNpZmllZAorICAgICAgICAgICAgICAgIC8vIGxpc3Qgb2YgRVJJcyBmb3IgaG9tZSBzeXN0ZW0sIG1DZG1hUm9hbWluZyBpcyB0cnVlLgorICAgICAgICAgICAgICAgIG1DZG1hUm9hbWluZyA9CisgICAgICAgICAgICAgICAgICAgICAgICByZWdDb2RlSXNSb2FtaW5nKHJlZ2lzdH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yNyw4IEBACiAKICAgICAgICAgICAgICAgICBpZiAob3BOYW1lcyAhPSBudWxsICYmIG9wTmFtZXMubGVuZ3RoID49IDMpIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKGNtLmdldFJhZGlvU3RhdGUoKS5pc05WUmVhZHkoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW4gQ0RNQSBpbiBjYXNlIG9uIE5WIHRoZSBzcy5tT3BlcmF0b3JBbHBoYUxvbmcgaXMgc2V0IGxhdGVyIHdpdGggdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBFUkkgdGV4dCwgc28gaGVyZSBpdCBpcyBpZ25vcmVkIHdoYXQgaXMgY29taW5nIGZyb20gdGhlIG1vZGVtCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbiBDRE1BIGluIGNhc2Ugb24gTlYsIHRoZSBzcy5tT3BlcmF0b3JBbHBoYUxvbmcgaXMgc2V0IGxhdGVyIHdpdGggdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBFUkkgdGV4dCwgc28gaGVyZSBpdCBpcyBpZ25vcmVkIHdoYXQgaXMgY29taW5nIGZyb20gdGhlIG1vZGVtLgogICAgICAgICAgICAgICAgICAgICAgICAgbmV3U1Muc2V0T3BlcmF0b3JOYW1lKG51bGwsIG9wTmFtZXNbMV0sIG9wTmFtZXNbMl0pOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgbmV3U1Muc2V0T3BlcmF0b3JOYW1lKG9wTmFtZXNbMF0sIG9wTmFtZXNbMV0sIG9wTmFtZXNbMl0pOwpAQCAtNjM2LDI3ICs3MzgsNiBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgY2FzZSBFVkVOVF9QT0xMX1NUQVRFX0NETUFfU1VCU0NSSVBUSU9OOiAvLyBIYW5kbGUgUklMX0NETUFfU1VCU0NSSVBUSU9OCi0gICAgICAgICAgICAgICAgU3RyaW5nIGNkbWFTdWJzY3JpcHRpb25bXSA9IChTdHJpbmdbXSlhci5yZXN1bHQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2RtYVN1YnNjcmlwdGlvbiAhPSBudWxsICYmIGNkbWFTdWJzY3JpcHRpb24ubGVuZ3RoID49IDQpIHsKLSAgICAgICAgICAgICAgICAgICAgbU1kbiA9IGNkbWFTdWJzY3JpcHRpb25bMF07Ci0gICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IE9ubHkgZ3JhYmJpbmcgdGhlIGZpcnN0IFNJRC9OSUQgZm9yIG5vdy4KLSAgICAgICAgICAgICAgICAgICAgaWYgKGNkbWFTdWJzY3JpcHRpb25bMV0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gc2lkID0gY2RtYVN1YnNjcmlwdGlvblsxXS5zcGxpdCgiLCIpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUhvbWVTeXN0ZW1JZCA9IHNpZC5sZW5ndGggPiAwID8gSW50ZWdlci5wYXJzZUludChzaWRbMF0pIDogMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoY2RtYVN1YnNjcmlwdGlvblsyXSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBuaWQgPSBjZG1hU3Vic2NyaXB0aW9uWzJdLnNwbGl0KCIsIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtSG9tZU5ldHdvcmtJZCA9IG5pZC5sZW5ndGggPiAwID8gSW50ZWdlci5wYXJzZUludChuaWRbMF0pIDogMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtTWluID0gY2RtYVN1YnNjcmlwdGlvblszXTsKLQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJlcnJvciBwYXJz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dGVtIGlzIGFjcXVpcmVkLCBwcmwgbWF0Y2gsIG5hbSBtYXRjaCBhbmQgbVJvYW1pbmdJbmRpY2F0b3IgPD0gMgotICAgICAgICAgICAgICAgICAgICAgICAgbmV3U1Muc2V0Q2RtYVJvYW1pbmdJbmRpY2F0b3IoRXJpSW5mby5ST0FNSU5HX0lORElDQVRPUl9PRkYpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFN5c3RlbSBpcyBhY3F1aXJlZCwgcHJsIG1hdGNoLCBubyBuYW0gbWF0Y2ggIG9yIG1Sb2FtaW5nSW5kaWNhdG9yID4gMgotICAgICAgICAgICAgICAgICAgICBuZXdTUy5zZXRDZG1hUm9hbWluZ0luZGljYXRvcihtUm9hbWluZ0luZGljYXRvcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobVJlZ2lzdHJhdGlvblN0YXRlID09IDUpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gU3lzdGVtIGlzIGFjcXVpcmVkIGJ1dCBwcmwgbm90IGxvYWRlZCBvciBubyBwcmwgbWF0Y2gKKyAgICAgICAgICAgIG5ld1NTLnNldENkbWFEZWZhdWx0Um9hbWluZ0luZGljYXRvcihtRGVmYXVsdFJvYW1pbmdJbmRpY2F0b3IpOworICAgICAgICAgICAgbmV3U1Muc2V0Q2RtYVJvYW1pbmdJbmRpY2F0b3IobVJvYW1pbmdJbmRpY2F0b3IpOworICAgICAgICAgICAgYm9vbGVhbiBpc1BybExvYWRlZCA9IHRydWU7CisgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobVBybFZlcnNpb24pKSB7CisgICAgICAgICAgICAgICAgaXNQcmxMb2FkZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghaXNQcmxMb2FkZWQpIHsKKyAgICAgICAgICAgICAgICBuZXdTUy5zZXRDZG1hUm9hbWluZ0luZGljYXRvcihFcmlJbmZvLlJPQU1JTkdfSU5ESUNBVE9SX0ZMQVNIKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoIWlzU2lkc0FsbFplcm9zKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIW5hbU1hdGNoICYmICFtSXNJblBybCkgeworICAgICAgICAgICAgICAgICAgICAvLyBVc2UgZGVmYXVsdAorICAgICAgICAgICAgICAgICAgICBuZXdTUy5zZXRDZG1hUm9hbWluZ0luZGljYXRvcihtRGVmYXVsdFJvYW1pbmdJbmRpY2F0b3IpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtTWF0Y2ggJiYgIW1Jc0luUHJsKSB7CiAgICAgICAgICAgICAgICAgICAgIG5ld1NTLnNldENkbWFSb2FtaW5nSW5kaWNhdG9yKEVyaUluZm8uUk9BTUlOR19JTkRJQ0FUT1JfRkxBU0gpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIW5hbU1hdGNoICYmIG1Jc0luUHJsKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFVzZSB0aGUgb25lIGZyb20gUFJML0VSSQorICAgICAgICAgICAgICAgICAgICBuZXdTUy5zZXRDZG1hUm9hbWluZ0luZGljYXRvcihtUm9hbWluZ0luZGljYXRvcik7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVXNlIHRoZSBkZWZhdWx0IGluZGljYXRvcgorICAgICAgICAgICAgICAgICAgICAvLyBJdCBtZWFucyBuYW1NYXRjaCAmJiBtSXNJblBybAorICAgICAgICAgICAgICAgICAgICBpZiAoKG1Sb2FtaW5nSW5kaWNhdG9yIDw9IDIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXdTUy5zZXRDZG1hUm9hbWluZ0luZGljYXRvcihFcmlJbmZvLlJPQU1JTkdfSU5ESUNBVE9SX09GRik7CisgICAgICAgICAgICAgICAgICAgIH0g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dG9yID0gIiArIG1Sb2FtaW5nSW5kaWNhdG9yCisgICAgICAgICAgICAgICAgICAgICsgIi4gbUNkbWFSb2FtaW5nID0gIiArIG1DZG1hUm9hbWluZyArICIsIGlzUHJsTG9hZGVkID0gIiArIGlzUHJsTG9hZGVkCisgICAgICAgICAgICAgICAgICAgICsgIi4gbmFtTWF0Y2ggPSAiICsgbmFtTWF0Y2ggKyAiICwgbUlzSW5QcmwgPSAiICsgbUlzSW5QcmwKKyAgICAgICAgICAgICAgICAgICAgKyAiLCBtUm9hbWluZ0luZGljYXRvciA9ICIgKyBtUm9hbWluZ0luZGljYXRvcgogICAgICAgICAgICAgICAgICAgICArICIsIG1EZWZhdWx0Um9hbWluZ0luZGljYXRvcj0gIiArIG1EZWZhdWx0Um9hbWluZ0luZGljYXRvcik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBwb2xsU3RhdGVEb25lKCk7CkBAIC03NjQsMTggKzg1NCwxMyBAQAogICAgICAgICAgICAgc2V0U2lnbmFsU3RyZW5ndGhEZWZhdWx0VmFsdWVzKCk7CiAgICAgICAgICAgICBtR290Q291bnRyeUNvZGUgPSBmYWxzZTsKIAotICAgICAgICAgICAgLy9OT1RFOiBwb2xsU3RhdGVEb25lKCkgaXMgbm90IG5lZWRlZCBpbiB0aGlzIGNhc2UKKyAgICAgICAgICAgIC8vIE5PVEU6IHBvbGxTdGF0ZURvbmUoKSBpcyBub3QgbmVlZGVkIGluIHRoaXMgY2FzZQogICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIC8vIElzc3VlIGFsbCBwb2xsLXJlbGF0ZWQgY29tbWFuZHMgYXQgb25jZQotICAgICAgICAgICAgLy8gdGhlbiBjb3VudCBkb3duIHRoZSByZXNwb25zZXMsIHdoaWNoCi0gICAgICAgICAgICAvLyBhcmUgYWxsb3dlZCB0byBhcnJpdmUgb3V0LW9mLW9yZGVyCi0KLSAgICAgICAgICAgIHBvbGxpbmdDb250ZXh0WzBdKys7Ci0gICAgICAgICAgICAvLyBSSUxfUkVRVUVTVF9DRE1BX1NVQlNDUklQVElPTiBpcyBuZWNlc3NhcnkgZm9yIENETUEKLSAgICAgICAgICAgIGNtLmdldENETUFTdWJzY3JpcHRpb24oCi0gICAgICAgICAgICAgICAgICAgIG9idGFpbk1lc3NhZ2UoRVZFTlRfUE9MTF9TVEFURV9DRE1BX1NVQlNDUklQVElPTiwgcG9sbGluZ0NvbnRleHQpKTsKKyAgICAgICAgICAgIC8vIElzc3VlIGFsbCBwb2xsLXJlbGF0ZWQgY29tbWFuZHMgYXQgb25jZSwgdGhlbiBjb3VudAorICAgICAgICAgICAgLy8gZG93biB0aGUgcmVzcG9uc2VzIHdoaWNoIGFyZSBhbGxvd2VkIHRvIGFycml2ZQorICAgICAgICAgICAgLy8gb3V0LW9mLW9yZGVyLgogCiAgICAgICAgICAgICBwb2xsaW5nQ29udGV4dFswXSsrOwogICAgICAgICAgICAgLy8gUklMX1JFUVVFU1RfT1BFUkFUT1IgaXMgbmVjZXNzYXJ5IGZvciBDRE1BCkBAIC05MDQsNyArOTg5LDcgQEAKICAgICAgICAgbmV3U1Muc2V0U3RhdGVPdXRPZlNlcnZpY2UoKTsgLy8gY2xlYW4gc2xhdGUgZm9yIG5leHQgdGltZQogCiAgICAgICAgIGlmIChoYXNOZXR3b3JrVHlwZUNoYW5nZWQpIHsKLSAgICAgICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KFBST1BFUlRZX0RBVEFfTkVUV09SS19UWVBFLAorICAgICAgICAgICAgcGhvbmUuc2V0U3lzdGVtUHJvcGVydHkoVGVsZXBob255UHJvcGVydGllcy5QUk9QRVJUWV9EQVRBX05FVFdPUktfVFlQRSwKICAgICAgICAgICAgICAgICAgICAgbmV0d29ya1R5cGVUb1N0cmluZyhuZXR3b3JrVHlwZSkpOwogICAgICAgICB9CiAKQEAgLTkzMSwxNCArMTAxNiwxNCBAQAogCiAgICAgICAgICAgICBTdHJpbmcgb3BlcmF0b3JOdW1lcmljOwogCi0gICAgICAgICAgICBwaG9uZS5zZXRTeXN0ZW1Qcm9wZXJ0eShQUk9QRVJUWV9PUEVSQVRPUl9BTFBIQSwKKyAgICAgICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfT1BFUkFUT1JfQUxQSEEsCiAgICAgICAgICAgICAgICAgICAgIHNzLmdldE9wZXJhdG9yQWxwaGFMb25nKCkpOwogCiAgICAgICAgICAgICBvcGVyYXRvck51bWVyaWMgPSBzcy5nZXRPcGVyYXRvck51bWVyaWMoKTsKLSAgICAgICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KFBST1BFUlRZX09QRVJBVE9SX05VTUVSSUMsIG9wZXJhdG9yTnVtZXJpYyk7CisgICAgICAgICAgICBwaG9uZS5zZXRTeXN0ZW1Qcm9wZXJ0eShUZWxlcGhvbnlQcm9wZXJ0aWVzLlBST1BFUlRZX09QRVJBVE9SX05VTUVSSUMsIG9wZXJhdG9yTnVtZXJpYyk7CiAKICAgICAgICAgICAgIGlmIChvcGVyYXRvck51bWVyaWMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KFBST1BFUlRZX09QRVJBVE9SX0lTT19DT1VOVFJZLCAiIik7CisgICAgICAgICAgICAgICAgcGhvbmUuc2V0U3lzdGVtUHJvcGVydHkoVGVsZXBob255UHJvcGVydGllcy5QUk9QRVJUWV9PUEVSQVRPUl9JU09fQ09VTlRSWSwgIiIpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBTdHJpbmcgaXNvQ291bnRyeUNvZGUgPSAiIjsKICAgICAgICAgICAgICAgICB0cnl7CkBAIC05NTAsMTQgKzEwMzUsMTUgQEAKICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgImNvdW50cnlDb2RlRm9yTWNjIGVycm9yIiArIGV4KTsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBwaG9uZS5zZXRTeXN0ZW1Qcm9wZXJ0eShQUk9QRVJUWV9PUEVSQVRPUl9JU09fQ09VTlRSWSwgaXNvQ291bnRyeUNvZGUpOworICAgICAgICAgICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfT1BFUkFUT1JfSVNPX0NPVU5UUlksCisgICAgICAgICAgICAgICAgICAgICAgICBpc29Db3VudHJ5Q29kZSk7CiAgICAgICAgICAgICAgICAgbUdvdENvdW50cnlDb2RlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBpZiAobU5lZWRGaXhab25lKSB7CiAgICAgICAgICAgICAgICAgICAgIGZpeFRpbWVab25lKGlzb0NvdW50cnlDb2RlKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KFBST1BFUlRZX09QRVJBVE9SX0lTUk9BTUlORywKKyAgICAgICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfT1BFUkFUT1JfSVNST0FNSU5HLAogICAgICAgICAgICAgICAgICAgICBzcy5nZXRSb2FtaW5nKCkgPyAidHJ1ZSIgOiAiZmFsc2UiKTsKIAogICAgICAgICAgICAgdXBkYXRlU3BuRGlzcGxheSgpOwpAQCAtOTcyLDcgKzEwNTgsNyBAQAogICAgICAgICAgICAgY2RtYURhdGFDb25uZWN0aW9uRGV0YWNoZWRSZWdpc3RyYW50cy5ub3RpZnlSZWdpc3RyYW50cygpOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKGhhc0NkbWFEYXRhQ29ubmVjdGlvbkNoYW5nZWQpIHsKKyAgICAgICAgaWYgKGhhc0NkbWFEYXRhQ29ubmVjdGlvbkNoYW5nZWQgfHwgaGFzTmV0d29ya1R5cGVDaGFuZ2VkKSB7CiAgICAgICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKICAgICAgICAgfQogCkBAIC0xMDQ3LDcgKzExMzMsNyBAQAogCiAgICAgLyoqCiAgICAgICogIHNlbmQgc2lnbmFsLXN0cmVuZ3RoLWNoYW5nZWQgbm90aWZpY2F0aW9uIGlmIGNoYW5nZWQKLSAgICAgKiAgQ2FsbGVkIGJvdGggZm9yIHNvbGljaXRlZCBhbmQgdW5zb2xpY2l0ZWQgc2lnbmFsIHN0ZW5ndGggdXBkYXRlcworICAgICAqICBDYWxsZWQgYm90aCBmb3Igc29saWNpdGVkIGFuZCB1bnNvbGljaXRlZCBzaWduYWwgc3RyZW5ndGggdXBkYXRlcwogICAgICAqLwogICAgIHByaXZhdGUgdm9pZAogICAgIG9uU2lnbmFsU3RyZW5ndGhSZXN1bHQoQXN5bmNSZXN1bHQgYXIpIHsKQEAgLTEwNjAsMTUgKzExNDYsMTUgQEAKICAgICAgICAgICAgIGludFtdIGludHMgPSAoaW50W10pYXIucmVzdWx0OwogICAgICAgICAgICAgaW50IG9mZnNldCA9IDI7CiAKLSAgICAgICAgICAgIGludCBjZG1hRGJtID0gKGludHNbb2Zmc2V0XSA+IDApID8gLWludHNbb2Zmc2V0XSA6IC0xOwotICAgICAgICAgICAgaW50IGNkbWFFY2lvID0gKGludHNbb2Zmc2V0KzFdID4gMCkgPyAtaW50c1tvZmZzZXQrMV0gOiAtMTsKKyAgICAgICAgICAgIGludCBjZG1hRGJtID0gKGludHNbb2Zmc2V0XSA+IDApID8gLWludHNbb2Zmc2V0XSA6IC0xMjA7CisgICAgICAgICAgICBpbnQgY2RtYUVjaW8gPSAoaW50c1tvZmZzZXQrMV0gPiAwKSA/IC1pbnRzW29mZnNldCsxXSA6IC0xNjA7CiAKICAgICAgICAgICAgIGludCBldmRvUnNzaSA9IC0xOwogICAgICAgICAgICAgaW50IGV2ZG9FY2lvID0gLTE7CiAgICAgICAgICAgICBpbnQgZXZkb1NuciA9IC0xOwogICAgICAgICAgICAgaWYgKChuZXR3b3JrVHlwZSA9PSBTZXJ2aWNlU3RhdGUuUkFESU9fVEVDSE5PTE9HWV9FVkRPXzApCiAgICAgICAgICAgICAgICAgICAgIHx8IChuZXR3b3JrVHlwZSA9PSBTZXJ2aWNlU3RhdGUuUkFESU9fVEVDSE5PTE9HWV9FVkRPX0EpKSB7Ci0gICAgICAgICAgICAgICAgZXZkb1Jzc2kgPSAoaW50c1tvZmZzZXQrMl0gPiAwKSA/IC1pbnRzW29mZnNldCsyXSA6IC0xOworICAgICAgICAgICAgICAgIGV2ZG9Sc3NpID0gKGludHNbb2Zmc2V0KzJdID4gMCkgPyAtaW50c1tvZmZzZXQrMl0gOiAtMTIwOwogICAgICAgICAgICAgICAgIGV2ZG9FY2lvID0gKGludHNbb2Zmc2V0KzNdID4gMCkgPyAtaW50c1tvZmZzZXQrM10gOiAtMTsKICAgICAgICAgICAgICAgICBldmRvU25yICA9ICgoaW50c1tvZmZzZXQrNF0gPiAwKSAmJiAoaW50c1tvZmZzZXQrNF0gPD0gOCkpID8gaW50c1tvZmZzZXQrNF0gOiAtMTsKICAgICAgICAgICAgIH0KQEAgLTExNTIsNiArMTIzOCwzMyBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIERldGVybWluZSB3aGV0aGVyIGEgcm9hbWluZyBpbmRpY2F0b3IgaXMgaW4gdGhlIGNhcnJpZXItc3BlY2lmaWVkIGxpc3Qgb2YgRVJJcyBmb3IKKyAgICAgKiBob21lIHN5c3RlbQorICAgICAqCisgICAgICogQHBhcmFtIHJvYW1JbmQgcm9hbWluZyBpbmRpY2F0b3IgaW4gU3RyaW5nCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSByb2FtSW5kIGlzIGluIHRoZSBjYXJyaWVyLXNwZWNpZmllZCBsaXN0IG9mIEVSSXMgZm9yIGhvbWUgbmV0d29yaworICAgICAqLworICAgIH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b3BlcnRpZXMuZ2V0KFRlbGVwaG9ueVByb3BlcnRpZXMuUFJPUEVSVFlfT1BFUkFUT1JfSVNPX0NPVU5UUlkpOwogCiAgICAgICAgICAgICBpZiAoem9uZSA9PSBudWxsKSB7CiAKQEAgLTEzOTYsMTIgKzE1MDksMzYgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByaXZhdGUgYm9vbGVhbiBpc1NpZHNBbGxaZXJvcygpIHsKKyAgICAgICAgaWYgKG1Ib21lU3lzdGVtSWQgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpIDwgbUhvbWVTeXN0ZW1JZC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChtSG9tZVN5c3RlbUlkW2ldICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDaGVjayB3aGV0aGVyIGEgc3BlY2lmaWVkIHN5c3RlbSBJRCB0aGF0IG1hdGNoZXMgb25lIG9mIHRoZSBob21lIHN5c3RlbSBJRHMuCisgICAgICovCisgICAgcHJpdmF0ZSBib29sZWFuIGlzSG9tZVNpZChpbnQgc2lkKSB7CisgICAgICAgIGlmIChtSG9tZVN5c3RlbUlkICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaSA8IG1Ib21lU3lzdGVtSWQubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICBpZiAoc2lkID09IG1Ib21lU3lzdGVtSWRbaV0pIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBAcmV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T01QTEVURTsKLSAgICAgICAgICAgICAgICBtZXNzYWdlID0gY29udGV4dC5nZXRUZXh0KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmZjQ29tcGxldGUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcGhvbmUub25GZWF0dXJlQ29kZURvbmUodGhpcyk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgLy8qKioqKiBQcml2YXRlIGluc3RhbmNlIG1ldGhvZHMKLQotICAgIHByaXZhdGUgQ2hhclNlcXVlbmNlIGdldFNjU3RyaW5nKCkgewotICAgICAgICBpZiAoc2MgIT0gbnVsbCkgewotICAgICAgICAgICAgaWYgKGlzU2VydmljZUNvZGVDYWxsRm9yd2FyZGluZyhzYykpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dC5nZXRUZXh0KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLkNmTW1pKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNTZXJ2aWNlQ29kZUNhbGxXYWl0aW5nKHNjKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBjb250ZXh0LmdldFRleHQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuQ3dNbWkpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChzYy5lcXVhbHMoRkNfQ05JUCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dC5nZXRUZXh0KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLkNuaXBNbWkpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChzYy5lcXVhbHMoRkNfQ05JUikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dC5nZXRUZXh0KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLkNuaXJNbWkpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChpc1NlcnZpY2VDb2RlVGhyZWVXYXlDYWxsaW5nKHNjKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBjb250ZXh0LmdldFRleHQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuVGhyZWVXQ01taSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGlzU2VydmljZUNvZGVBbm5veWluZ0NhbGxzKHNjKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBjb250ZXh0LmdldFRleHQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuUnVhY01taSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGlzU2VydmljZUNvZGVDYWxsaW5nTnVtYmVyRGVsaXZlcnkoc2MpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRleHQuZ2V0VGV4dChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5DbmRNbWkpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChpc1NlcnZpY2VDb2RlRG9Ob3REaXN0dXJiKHNjKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBjb250ZXh0LmdldFRleHQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuRG5kTW1pKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAiIjsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgb25TZXRDb21wbGV0ZShBc3luY1Jlc3VsdCBhcil7Ci0gICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcihnZXRTY1N0cmluZygpKTsKLSAgICAgICAgc2IuYXBwZW5kKCJcbiIpOwotCi0gICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgc3RhdGUgPSBTdGF0ZS5GQUlMRUQ7Ci0gICAgICAgICAgICBzYi5hcHBlbmQoY29udGV4dC5nZXRUZXh0KGNvbS5hbmRyb2lkLmludGVybmFsL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gICAgICAgICAgICAgIGNhc2UgUkFESU9fT0ZGOgotICAgICAgICAgICAgICAgIGNhc2UgUkFESU9fVU5BVkFJTEFCTEU6Ci0gICAgICAgICAgICAgICAgY2FzZSBSVUlNX05PVF9SRUFEWToKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLlVOS05PV047Ci0gICAgICAgICAgICAgICAgY2FzZSBSVUlNX0xPQ0tFRF9PUl9BQlNFTlQ6Ci0gICAgICAgICAgICAgICAgICAgIC8vdGhpcyBzaG91bGQgYmUgdHJhbnNpZW50LW9ubHkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLlVOS05PV047Ci0gICAgICAgICAgICAgICAgY2FzZSBSVUlNX1JFQURZOgotICAgICAgICAgICAgICAgICAgICByZXR1cm4gU3RhdGUuUkVBRFk7Ci0gICAgICAgICAgICAgICAgY2FzZSBOVl9SRUFEWToKLSAgICAgICAgICAgICAgICBjYXNlIE5WX05PVF9SRUFEWToKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLkFCU0VOVDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHN3aXRjaCAoc3RhdHVzKSB7Ci0gICAgICAgICAgICAgICAgY2FzZSBJQ0NfQUJTRU5UOiAgICAgICAgICAgIHJldHVybiBTdGF0ZS5BQlNFTlQ7Ci0gICAgICAgICAgICAgICAgY2FzZSBJQ0NfTk9UX1JFQURZOiAgICAgICAgIHJldHVybiBTdGF0ZS5VTktOT1dOOwotICAgICAgICAgICAgICAgIGNhc2UgSUNDX1JFQURZOiAgICAgICAgICAgICByZXR1cm4gU3RhdGUuUkVBRFk7Ci0gICAgICAgICAgICAgICAgY2FzZSBJQ0NfUElOOiAgICAgICAgICAgICAgIHJldHVybiBTdGF0ZS5QSU5fUkVRVUlSRUQ7Ci0gICAgICAgICAgICAgICAgY2FzZSBJQ0NfUFVLOiAgICAgICAgICAgICAgIHJldHVybi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gY29tcGxldGVkLiBhci51c2VyT2JqIGlzIHRoZSByZXNwb25zZSBNZXNzYWdlCi0gICAgICAgICAgICAgICAgLy8gUmVwb2xsIGJlZm9yZSByZXR1cm5pbmcKLSAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgIC8vIFRPRE8gc2hvdWxkIGFic3RyYWN0IHRoZXNlIGV4Y2VwdGlvbnMKLSAgICAgICAgICAgICAgICBBc3luY1Jlc3VsdC5mb3JNZXNzYWdlKCgoTWVzc2FnZSlhci51c2VyT2JqKSkuZXhjZXB0aW9uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBhci5leGNlcHRpb247Ci0gICAgICAgICAgICAgICAgcGhvbmUubUNNLmdldEljY1N0YXR1cygKLSAgICAgICAgICAgICAgICAgICAgb2J0YWluTWVzc2FnZShFVkVOVF9SRVBPTExfU1RBVFVTX0RPTkUsIGFyLnVzZXJPYmopKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfUkVQT0xMX1NUQVRVU19ET05FOgotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFdmVudCBFVkVOVF9SRVBPTExfU1RBVFVTX0RPTkUgUmVjZWl2ZWQiKTsKLSAgICAgICAgICAgICAgICAvLyBGaW5pc2hlZCByZXBvbGxpbmcgc3RhdHVzIGFmdGVyIFBJTiBvcGVyYXRpb24KLSAgICAgICAgICAgICAgICAvLyBhci51c2VyT2JqIGlzIHRoZSByZXNwb25zZSBtZXNzYWVnCi0gICAgICAgICAgICAgICAgLy8gYXIudXNlck9iai5vYmogaXMgYWxyZWFkeSBhbiBBc3luY1Jlc3VsdCB3aXRoIGFuCi0gICAgICAgICAgICAgICAgLy8gYXBwcm9wcmlhdGUgZXhjZXB0aW9uIGZpbGxlZCBpbiBpZiBhcHBsaWNhYmxlCi0KLSAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgIGdldFJ1aW1TdGF0dXNEb25lKGFyKTsKLSAgICAgICAgICAgICAgICAoKE1lc3NhZ2UpYXIudXNlck9iaikuc2VuZFRvVGFyZ2V0KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEVWRU5UX1FVRVJZX0ZBQ0lMSVRZX0xPQ0tfRE9ORToKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRXZlbnQgRVZFTlRfUVVFUllfRkFDSUxJVFlfTE9DS19ET05FIFJlY2VpdmVkIik7Ci0gICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKLSAgICAgICAgICAgICAgICBvblF1ZXJ5RmFjaWxpdHlMb2NrKGFyKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfUVVFUllfRkFDSUxJVFlfRkROX0RPTkU6Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkV2ZW50IEVWRU5UX1FVRVJZX0ZBQ0lMSVRZX0ZETl9ET05FIFJlY2VpdmVkIik7Ci0gICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKLSAgICAgICAgICAgICAgICBvblF1ZXJ5RmRuRW5hYmxlZChhcik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEVWRU5UX0NIQU5HRV9GQUNJTElUWV9MT0NLX0RPTkU6Ci0gICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkV2ZW50IEVWRU5UX0NIQU5HRV9GQUNJTElUWV9MT0NLX0RPTkUgUmVjZWl2ZWQiKTsKLSAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtUnVpbVBpbkxvY2tlZCA9IG1EZXNpcmVkUGluTG9ja2VkOwotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coICJFVkVOVF9DSEFOR0VfRkFDSUxJVFlfTE9DS19ET05FOiAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAibVJ1aW1QaW5Mb2NrZWQ9ICIgKyBtUnVpbVBpbkxvY2tlZCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yIGNoYW5nZSBmYWNpbGl0eSBsb2NrIHdpdGggZXhjZXB0aW9uICIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgYXIuZXhjZXB0aW9uKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZSgoKE1lc3NhZ2UpYXIudXNlck9iaikpLmV4Y2VwdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gYXIuZXhjZXB0aW9uOwotICAgICAgICAgICAgICAgICgoTWVzc2FnZSlhci51c2VyT2JqKS5zZW5kVG9UYXJnZXQoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0hBTkdFX0ZBQ0lMSVRZX0ZETl9ET05FOgotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFdmVudCBFVkVOVF9DSEFOR0VfRkFDSUxJVFlfRkROX0RPTkUgUmVjZWl2ZWQiKTsKLSAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotCi0gICAgICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1SdWltRmRuRW5hYmxlZCA9IG1EZXNpcmVkRmRuRW5hYmxlZDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgbG9nKCJFVkVOVF9DSEFOR0VfRkFDSUxJVFlfRkROX0RPTkU6ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJtUnVpbUZkbkVuYWJsZWQ9IiArIG1SdWltRmRuRW5hYmxlZCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yIGNoYW5nZSBmYWNpbGl0eSBmZG4gd2l0aCBleGNlcHRpb24gIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYXIuZXhjZXB0aW9uKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZSgoKE1lc3NhZ2UpYXIudXNlck9iaikpLmV4Y2VwdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gYXIuZXhjZXB0aW9uOwotICAgICAgICAgICAgICAgICgoTWVzc2FnZSlhci51c2VyT2JqKS5zZW5kVG9UYXJnZXQoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0hBTkdFX1JVSU1fUEFTU1dPUkRfRE9ORToKLSAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRXZlbnQgRVZFTlRfQ0hBTkdFX1JVSU1fUEFTU1dPUkRfRE9ORSBSZWNlaXZlZCIpOwotICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgaWYoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yIGluIGNoYW5nZSBzaW0gcGFzc3dvcmQgd2l0aCBleGNlcHRpb24iCi0gICAgICAgICAgICAgICAgICA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RFeHRyYShQaG9uZS5QSE9ORV9OQU1FX0tFWSwgcGhvbmUuZ2V0UGhvbmVOYW1lKCkpOwotICAgICAgICBpbnRlbnQucHV0RXh0cmEoUnVpbUNhcmQuSU5URU5UX0tFWV9JQ0NfU1RBVEUsIHZhbHVlKTsKLSAgICAgICAgaW50ZW50LnB1dEV4dHJhKFJ1aW1DYXJkLklOVEVOVF9LRVlfTE9DS0VEX1JFQVNPTiwgcmVhc29uKTsKLSAgICAgICAgaWYoREJHKSBsb2coIkJyb2FkY2FzdGluZyBpbnRlbnQgU0lNX1NUQVRFX0NIQU5HRURfQUNUSU9OICIgKyAgdmFsdWUKLSAgICAgICAgICAgICAgICArICIgcmVhc29uICIgKyByZWFzb24pOwotICAgICAgICBBY3Rpdml0eU1hbmFnZXJOYXRpdmUuYnJvYWRjYXN0U3RpY2t5SW50ZW50KGludGVudCwgUkVBRF9QSE9ORV9TVEFURSk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdXBkYXRlSW1zaUNvbmZpZ3VyYXRpb24oU3RyaW5nIGltc2kpIHsKLSAgICAgICAgaWYgKGltc2kubGVuZ3RoKCkgPj0gNikgewotICAgICAgICAgICAgQ29uZmlndXJhdGlvbiBjb25maWcgPSBuZXcgQ29uZmlndXJhdGlvbigpOwotICAgICAgICAgICAgY29uZmlnLm1jYyA9ICgoaW1zaS5jaGFyQXQoMCktJzAnKSoxMDApCi0gICAgICAgICAgICAgICAgICAgICsgKChpbXNpLmNoYXJBdCgxKS0nMCcpKjEwKQotICAgICAgICAgICAgICAgICAgICArIChpbXNpLmNoYXJBdCgyKS0nMCcpOwotICAgICAgICAgICAgY29uZmlnLm1uYyA9ICgoaW1zaS5jaGFyQXQoMyktJzAnKSoxMDApCi0gICAgICAgICAgICAgICAgICAgICsgKChpbXNpLmNoYXJBdCg0KS0nMCcpKjEwKQotICAgICAgICAgICAgICAgICAgICArIChpbXNpLmNoYXJBdCg1KS0nMCcpOwotICAgICAgICAgICAgdHJ5IH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TnZSZWFkeSgpOwotICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fT0ZGX09SX05PVF9BVkFJTEFCTEU6CiAgICAgICAgICAgICAgICAgb25SYWRpb09mZk9yTm90QXZhaWxhYmxlKCk7CiAgICAgICAgICAgICBicmVhazsKQEAgLTIyMSwxNSArMjEwLDcgQEAKICAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChtX290YV9jb21taXRlZCkgewotICAgICAgICAgICAgICAgICAgICBpZiAobU15TW9iaWxlTnVtYmVyICE9IGxvY2FsVGVtcFswXSkgewotICAgICAgICAgICAgICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoVGVsZXBob255SW50ZW50cy5BQ1RJT05fQ0RNQV9PVEFfTUROX0NIQU5HRUQpOwotICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJtZG4iLCBsb2NhbFRlbXBbMF0pOwotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywiQnJvYWRjYXN0aW5nIGludGVudCBNRE4gQ2hhbmdlIGluIE9UQSAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5icm9hZGNhc3RTdGlja3lJbnRlbnQoaW50ZW50LCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtX290YV9jb21taXRlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICAgIG1NeU1vYmlsZU51bWJlciA9IGxvY2FsVGVtcFswXTsKICAgICAgICAgICAgICAgICBtTWluMk1pbjEgPSBsb2NhbFRlbXBbM107CiAgICAgICAgICAgICAgICAgbVBybFZlcnNpb24gPSBsb2NhbFRlbXBbNF07CkBAIC0yODEsMjEgKzI2Miw2IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBjYXNlIEVWRU5UX09UQV9QUk9WSVNJT05fU1RBVFVTX0NIQU5HRToKLSAgICAgICAgICAgICAgICBtX290YV9jb21taXRlZD1mYWxzZTsKLSAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpbnRbXSBpbnRzID0gKGludFtdKSBhci5yZXN1bHQ7Ci0gICAgICAgICAgICAgICAgICAgIGludCBvdGFTdGF0dXMgPSBpbnRzWzBdOwotICAgICAgICAgICAgICAgICAgICBpZiAob3RhU3RhdHVzID09IHBob25lLkNETUFfT1RBX1BST1ZJU0lPTl9TVEFUVVNfQ09NTUlUVEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtX290YV9jb21taXRlZD10cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmUubUNNLmdldENETUFTdWJzY3JpcHRpb24ob2J0YWluTWVzc2FnZShFVkVOVF9HRVRfQ0RNQV9TVUJTQ1JJUFRJT05fRE9ORSkpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG90YVN0YXR1cyA9PSBwaG9uZS5DRE1BX09UQV9QUk9WSVNJT05fU1RBVFVTX09UQVBBX1NUT1BQRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBob25lLm1DTS5nZXRDRE1BU3Vic2NyaXB0aW9uKG9idGFpbk1lc3NhZ2UoRVZFTlRfR0VUX0NETUFfU1VCU0NSSVBUSU9OX0RPTkUpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgIGJyZWFrOwotCiAgICAgICAgIH19Y2F0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W1iZXIgb2YgbWVzc2FnZXMgd2FpdGluZworICAgICAgICBpZiAobUVudmVsb3BlLnRlbGVTZXJ2aWNlID09IFNtc0VudmVsb3BlLlRFTEVTRVJWSUNFX01XSSkgeworICAgICAgICAgICAgbUJlYXJlckRhdGEgPSBuZXcgQmVhcmVyRGF0YSgpOworICAgICAgICAgICAgaWYgKG1FbnZlbG9wZS5iZWFyZXJEYXRhICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQmVhcmVyRGF0YS5udW1iZXJPZk1lc3NhZ2VzID0gMHgwMDAwMDBGRiAmIG1FbnZlbG9wZS5iZWFyZXJEYXRhWzBdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKENvbmZpZy5ERUJVRykgeworICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJwYXJzZVNtczogZ2V0IE1XSSAiICsKKyAgICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyLnRvU3RyaW5nKG1CZWFyZXJEYXRhLm51bWJlck9mTWVzc2FnZXMpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQogICAgICAgICBtQmVhcmVyRGF0YSA9IEJlYXJlckRhdGEuZGVjb2RlKG1FbnZlbG9wZS5iZWFyZXJEYXRhKTsKKyAgICAgICAgaWYgKERCR19TTVMpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJNVCByYXcgQmVhcmVyRGF0YSA9ICciICsKKyAgICAgICAgICAgICAgICAgICAgICBIZXhEdW1wLnRvSGV4U3RyaW5nKG1FbnZlbG9wZS5iZWFyZXJEYXRhKSArICInIik7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiTVQgKGRlY29kZWQpIEJlYXJlckRhdGEgPSAiICsgbUJlYXJlckRhdGEpOworICAgICAgICB9CiAgICAgICAgIG1lc3NhZ2VSZWYgPSBtQmVhcmVyRGF0YS5tZXNzYWdlSWQ7CiAgICAgICAgIGlmIChtQmVhcmVyR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YXRhWzFdKTsKKyAgICAgICAgICAgIGludCBtb250aCA9IEljY1V0aWxzLmNkbWFCY2RCeXRlVG9JbnQoZGF0YVsxXSk7CiAgICAgICAgICAgICBpZiAobW9udGggPCAxIHx8IG1vbnRoID4gMTIpIHJldHVybiBudWxsOwogICAgICAgICAgICAgdHMubW9udGggPSBtb250aCAtIDE7Ci0gICAgICAgICAgICBpbnQgZGF5ID0gSWNjVXRpbHMuYmVCY2RCeXRlVG9JbnQoZGF0YVsyXSk7CisgICAgICAgICAgICBpbnQgZGF5ID0gSWNjVXRpbHMuY2RtYUJjZEJ5dGVUb0ludChkYXRhWzJdKTsKICAgICAgICAgICAgIGlmIChkYXkgPCAxIHx8IGRheSA+IDMxKSByZXR1cm4gbnVsbDsKICAgICAgICAgICAgIHRzLm1vbnRoRGF5ID0gZGF5OwotICAgICAgICAgICAgaW50IGhvdXIgPSBJY2NVdGlscy5iZUJjZEJ5dGVUb0ludChkYXRhWzNdKTsKKyAgICAgICAgICAgIGludCBob3VyID0gSWNjVXRpbHMuY2RtYUJjZEJ5dGVUb0ludChkYXRhWzNdKTsKICAgICAgICAgICAgIGlmIChob3VyIDwgMCB8fCBob3VyID4gMjMpIHJldHVybiBudWxsOwogICAgICAgICAgICAgdHMuaG91ciA9IGhvdXI7Ci0gICAgICAgICAgICBpbnQgbWludXRlID0gSWNjVXRpbHMuYmVCY2RCeXRlVG9JbnQoZGF0YVs0XSk7CisgICAgICAgICAgICBpbnQgbWludXRlID0gSWNjVXRpbHMuY2RtYUJjZEJ5dGVUb0ludChkYXRhWzRdKTsKICAgICAgICAgICAgIGlmIChtaW51dGUgPCAwIHx8IG1pbnV0ZSA+IDU5KSByZXR1cm4gbnVsbDsKICAgICAgICAgICAgIHRzLm1pbnV0ZSA9IG1pbnV0ZTsKLSAgICAgICAgICAgIGludCBzZWNvbmQgPSBJY2NVdGlscy5iZUJjZEJ5dGVUb0ludChkYXRhWzVdKTsKKyAgICAgICAgICAgIGludCBzZWNvbmQgP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ZXQgcHJvdmlkZWQKICAgICAgICAgICAgICAqIGFuIG9wdGlvbiB0byBwcm9kdWNlIGp1c3QgdGhlIGRhdGEgd2l0aG91dCBwcmVwZW5kaW5nCi0gICAgICAgICAgICAgKiB0aGUgbGVuZ3RoLgorICAgICAgICAgICAgICogdGhlIHNlcHRldCBjb3VudCwgYXMgdGhpcyBmdW5jdGlvbiBpcyByZWFsbHkganVzdCBhCisgICAgICAgICAgICAgKiB3cmFwcGVyIHRvIHN0cmlwIHRoYXQgb2ZmLiAgTm90IHRvIG1lbnRpb24gdGhhdCB0aGUKKyAgICAgICAgICAgICAqIHNlcHRldCBjb3VudCBpcyBnZW5lcmFsbHkga25vd24gcHJpb3IgdG8gaW52b2NhdGlvbiBvZgorICAgICAgICAgICAgICogdGhlIGVuY29kZXIuICBOb3RlIHRoYXQgaXQgY2Fubm90IGJlIGRlcml2ZWQgZnJvbSB0aGUKKyAgICAgICAgICAgICAqIHJlc3VsdGluZyBhcnJheSBsZW5ndGgsIHNpbmNlIHRoYXQgY2Fubm90IGRpc3Rpbmd1aXNoCisgICAgICAgICAgICAgKiBpZiB0aGUgbGFzdCBjb250YWlucyBlaXRoZXIgMSBvciA4IHZhbGlkIGJpdHMuCisgICAgICAgICAgICAgKgorICAgICAgICAgICAgICogVE9ETyhjbGVhbnVwKTogVGhlIEJpdHdpc2VYU3RyZWFtcyBjb3VsZCBhbHNvIGJlCisgICAgICAgICAgICAgKiBleHRlbmRlZCB3aXRoIGJ5dGUtd2lzZSByZXZlcnNlZCBlbmRpYW5uZXNzIHJlYWQvd3JpdGUKKyAgICAgICAgICAgICAqIHJvdXRpbmVzIHRvIGFsbG93IGEgY29ycmVzcG9uZGluZyBpbXBsZW1lbnRhdGlvbiBvZgorICAgICAgICAgICAgICogc3RyaW5nVG9Hc203Qml0UGFja2VkLCBhbmQgcG90ZW50aWFsbHkgZGlyZWN0bHkgc3VwcG9ydAorICAgICAgICAgICAgICogYWNjZXNzIHRvIHRoZSBtYWluIGJ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cik7CisgICAgICAgIGlmICh1RGF0YS5tc2dFbmNvZGluZ1NldCkgeworICAgICAgICAgICAgaWYgKHVEYXRhLm1zZ0VuY29kaW5nID09IFVzZXJEYXRhLkVOQ09ESU5HX0dTTV83QklUX0FMUEhBQkVUKSB7CisgICAgICAgICAgICAgICAgZW5jb2RlN2JpdEVtcyh1RGF0YSwgaGVhZGVyRGF0YSwgdHJ1ZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHVEYXRhLm1zZ0VuY29kaW5nID09IFVzZXJEYXRhLkVOQ09ESU5HX1VOSUNPREVfMTYpIHsKKyAgICAgICAgICAgICAgICBlbmNvZGUxNmJpdEVtcyh1RGF0YSwgaGVhZGVyRGF0YSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBDb2RpbmdFeGNlcHRpb24oInVuc3VwcG9ydGVkIEVNUyB1c2VyIGRhdGEgZW5jb2RpbmcgKCIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdURhdGEubXNnRW5jb2RpbmcgKyAiKSIpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBlbmNvZGU3Yml0RW1zKHVEYXRhLCBoZWFkZXJEYXRhLCBmYWxzZSk7CisgICAgICAgICAgICB9IGNhdGNoIChDb2RpbmdFeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgICAgICBlbmNvZGUxNmJpdEVtcyh1RGF0YSwgaGVhZGVyRGF0YSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGVuY29kZVVzZXJEYXRhUGF5bG9hZChVc2VyRGF0YSB1RGF0YSkKICAgICAgICAgdGhyb3dzIENvZGluZ0V4Y2VwdGlvbgogICAgIHsKLSAgICAgICAgLy8gVE9ETyhjbGVhbnVwKTogVURIIGNhbiBvbmx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GF0YS5tc2dFbmNvZGluZyA9PSBVc2VyRGF0YS5FTkNPRElOR19PQ1RFVCkgewogICAgICAgICAgICAgICAgIGlmICh1RGF0YS5wYXlsb2FkID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgInVzZXIgZGF0YSB3aXRoIG9jdGV0IGVuY29kaW5nIGJ1dCBudWxsIHBheWxvYWQiKTsKLSAgICAgICAgICAgICAgICAgICAgcGF5bG9hZERhdGEgPSBuZXcgYnl0ZVswXTsKLSAgICAgICAgICAgICAgICAgICAgY29kZVVuaXRDb3VudCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHVEYXRhLnBheWxvYWQgPSBuZXcgYnl0ZVswXTsKKyAgICAgICAgICAgICAgICAgICAgdURhdGEubnVtRmllbGRzID0gMDsKICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBwYXlsb2FkRGF0YSA9IHVEYXRhLnBheWxvYWQ7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGVVbml0Q291bnQgPSB1RGF0YS5wYXlsb2FkLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgdURhdGEucGF5bG9hZCA9IHVEYXRhLnBheWxvYWQ7CisgICAgICAgICAgICAgICAgICAgIHVEYXRhLm51bUZpZWxkcyA9IHVEYXRhLnBheWxvYWQubGVuZ3RoOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgaWYgKHVEYXRhLnBheWxvYWRTdHIgPT0gbnVsbCkgewpAQCAtNTA5LDY3ICs1NzMsNTIgQEAKICAgICAgICAgICAgICAgICAgICAgdURhdGEucGF5bG9hZFN0ciA9ICIiOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAodURhdGEubXNnRW5jb2RpbmcgPT0gVXNlckRhdGEuRU5DT0RJTkdfR1NNXzdCSVRfQUxQSEFCRVQpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IHBhZGRpbmdCaXRzID0gY2FsY1VkaFNlcHRldFBhZGRpbmcoaGVhZGVyRGF0YUxlbik7Ci0gICAgICAgICAgICAgICAgICAgIHBheWxvYWREYXRhID0gZW5jb2RlN2JpdEdzbSh1RGF0YS5wYXlsb2FkU3RyLCBwYWRkaW5nQml0cyk7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGVVbml0Q291bnQgPSAoKHBheWxvYWREYXRhLmxlbmd0aCArIGhlYWRlckRhdGFMZW4pICogOCkgLyA3OworICAgICAgICAgICAgICAgICAgICBHc203Yml0Q29kaW5nUmVzdWx0IGdjciA9IGVuY29kZTdiaXRHc20odURhdGEucGF5bG9hZFN0ciwgMCwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHVEYXRhLnBheWxvYWQgPSBnY3IuZGF0YTsKKyAgICAgICAgICAgICAgICAgICAgdURhdGEubnVtRmllbGRzID0gZ2NyLnNlcHRldHM7CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1RGF0YS5tc2dFbmNvZGluZyA9PSBVc2VyRGF0YS5FTkNPRElOR183QklUX0FTQ0lJKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBheWxvYWREYXRhID0gZW5jb2RlN2JpdEFzY2lpKHVEYXRhLnBheWxvYWRTdHIsIHRydWUpOwotICAgICAgICAgICAgICAgICAgICBjb2RlVW5pdENvdW50ID0gdURhdGEucGF5bG9hZFN0ci5sZW5ndGgoKTsKKyAgICAgICAgICAgICAgICAgICAgdURhdGEucGF5bG9hZCA9IGVuY29kZTdiaXRBc2NpaSh1RGF0YS5wYXlsb2FkU3RyLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgdURhdGEubnVtRmllbGRzID0gdURhdGEucGF5bG9hZFN0ci5sZW5ndGgoKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVEYXRhLm1zZ0VuY29kaW5nID09IFVzZXJEYXRhLkVOQ09ESU5HX1VOSUNPREVfMTYpIHsKLSAgICAgICAgICAgICAgICAgICAgcGF5bG9hZERhdGEgPSBlbmNvZGVVdGYxNih1RGF0YS5wYXlsb2FkU3RyKTsKLSAgICAgICAgICAgICAgICAgICAgY29kZVVuaXRDb3VudCA9IHVEYXRhLnBheWxvYWRTdHIubGVuZ3RoKCk7CisgICAgICAgICAgICAgICAgICAgIHVEYXRhLnBheWxvYWQgPSBlbmNvZGVVdGYxNih1RGF0YS5wYXlsb2FkU3RyKTsKKyAgICAgICAgICAgICAgICAgICAgdURhdGEubnVtRmllbGRzID0gdURhdGEucGF5bG9hZFN0ci5sZW5ndGgoKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQ29kaW5nRXhjZXB0aW9uKCJ1bnN1cHBvcnRlZCB1c2VyIGRhdGEgZW5jb2RpbmcgKCIgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVEYXRhLm1zZ0VuY29kaW5nICsgIikiKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAodURhdGEucGF5bG9hZFN0ciA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgInVzZXIgZGF0YSB3aXRoIG51bGwgcGF5bG9hZFN0ciIpOwotICAgICAgICAgICAgICAgIHVEYXRhLnBheWxvYWRTdHIgPSAiIjsKLSAgICAgICAgICAgIH0KICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgaWYgKGhlYWRlckRhdGEgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBwYXlsb2FkRGF0YSA9IGVuY29kZTdiaXRBc2NpaSh1RGF0YS5wYXlsb2FkU3RyLCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGVVbml0Q291bnQgPSB1RGF0YS5wYXlsb2FkU3RyLmxlbmd0aCgpOwotICAgICAgICAgICAgICAgICAgICB1RGF0YS5tc2dFbmNvZGluZyA9IFVzZXJEYXRhLkVOQ09ESU5HXzdCSVRfQVNDSUk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUgaXMgYSBoZWFkZXIsIHdlIGFyZSBpbiBFTVMgbW9kZSwgaW4KLSAgICAgICAgICAgICAgICAgICAgLy8gd2hpY2ggY2FzZSB3ZSB1c2UgR1NNIGVuY29kaW5ncy4KLSAgICAgICAgICAgICAgICAgICAgaW50IHBhZGRpbmdCaXRzID0gY2FsY1VkaFNlcHRldFBhZGRpbmcoaGVhZGVyRGF0YUxlbik7Ci0gICAgICAgICAgICAgICAgICAgIHBheWxvYWREYXRhID0gZW5jb2RlN2JpdEdzbSh1RGF0YS5wYXlsb2FkU3RyLCBwYWRkaW5nQml0cyk7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGVVbml0Q291bnQgPSAoKHBheWxvYWREYXRhLmxlbmd0aCArIGhlYWRlckRhdGFMZW4pICogOCkgLyA3OwotICAgICAgICAgICAgICAgICAgICB1RGF0YS5tc2dFbmNvZGluZyA9IFVzZXJEYXRhLkVOQ09ESU5HX0dTTV83QklUX0FMUEhBQkVUOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB1RGF0YS5wYXlsb2FkID0gZW5jb2RlN2JpdEFzY2lpKHVEYXRhLnBheWxvYWRTdHIsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICB1RGF0YS5tc2dFbmNvZGluZyA9IFVzZXJEYXRhLkVOQ09ESU5HXzdCSVRfQVNDSUk7CiAgICAgICAgICAgICB9IGNhdGNoIChDb2RpbmdFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICBwYXlsb2FkRGF0YSA9IGVuY29kZVV0ZjE2KHVEYXRhLnBheWxvYWRTdHIpOwotICAgICAgICAgICAgICAgIGNvZGVVbml0Q291bnQgP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ICAgYkRhdGEubWVzc2FnZVR5cGUgPSBpblN0cmVhbS5yZWFkKDQpOworICAgICAgICAgICAgYkRhdGEubWVzc2FnZUlkID0gaW5TdHJlYW0ucmVhZCg4KSA8PCA4OworICAgICAgICAgICAgYkRhdGEubWVzc2FnZUlkIHw9IGluU3RyZWFtLnJlYWQoOCk7CisgICAgICAgICAgICBiRGF0YS5oYXNVc2VyRGF0YUhlYWRlciA9IChpblN0cmVhbS5yZWFkKDEpID09IDEpOworICAgICAgICAgICAgaW5TdHJlYW0uc2tpcCgzKTsKICAgICAgICAgfQotICAgICAgICBiRGF0YS5tZXNzYWdlVHlwZSA9IGluU3RyZWFtLnJlYWQoNCk7Ci0gICAgICAgIGJEYXRhLm1lc3NhZ2VJZCA9IGluU3RyZWFtLnJlYWQoOCkgPDwgODsKLSAgICAgICAgYkRhdGEubWVzc2FnZUlkIHw9IGluU3RyZWFtLnJlYWQoOCk7Ci0gICAgICAgIGJEYXRhLmhhc1VzZXJEYXRhSGVhZGVyID0gKGluU3RyZWFtLnJlYWQoMSkgPT0gMSk7Ci0gICAgICAgIGluU3RyZWFtLnNraXAoMyk7CisgICAgICAgIGlmICgoISBkZWNvZGVTdWNjZXNzKSB8fCAocGFyYW1CaXRzID4gMCkpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJNRVNTQUdFX0lERU5USUZJRVIgZGVjb2RlICIgKworICAgICAgICAgICAgICAgICAgICAgIChkZWNvZGVTdWNjZXNzID8gInN1Y2NlZWRlZCIgOiAiZmFpbGVkIikgKworICAgICAgICAgICAgICAgICAgICAgICIgKGV4dHJhIGJpdHMgPSAiICsgcGFyYW1CaXRzICsgIikiKTsKKyAgICAgICAgfQorICAgICAgICBpblN0cmVhbS5za2lwKHBhcmFtQml0cyk7CisgICAgICAgIHJldHVybiBkZWNvZGVTdWNjZXNzOwogICAgIH0KIAotICAgIHByaXZhdGUgc3RhdGljIHZvaWQgZGVjb2RlVXNlckRhdGEoQmVhcmVyRGF0YS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0V4Y2VwdGlvbgogICAgIHsKKyAgICAgICAgLy8gU3RhcnQgcmVhZGluZyBmcm9tIHRoZSBuZXh0IDE2LWJpdCBhbGlnbmVkIGJvdW5kcnkgYWZ0ZXIgb2Zmc2V0LgorICAgICAgICBpbnQgcGFkZGluZyA9IG9mZnNldCAlIDI7CisgICAgICAgIG51bUZpZWxkcyAtPSAob2Zmc2V0ICsgcGFkZGluZykgLyAyOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcoZGF0YSwgb2Zmc2V0LCBudW1GaWVsZHMgKiAyLCAidXRmLTE2YmUiKTsKICAgICAgICAgfSBjYXRjaCAoamF2YS5pby5VbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIGV4KSB7CkBAIC04MzUsNyArOTA1LDcgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyBkZWNvZGVJYTUoYnl0ZVtdIGRhdGEsIGludCBvZmZzZXQsIGludCBudW1GaWVsZHMpCisgICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIGRlY29kZTdiaXRBc2NpaShieXRlW10gZGF0YSwgaW50IG9mZnNldCwgaW50IG51bUZpZWxkcykKICAgICAgICAgdGhyb3dzIENvZGluZ0V4Y2VwdGlvbgogICAgIHsKICAgICAgICAgdHJ5IHsKQEAgLTg1MCwzOCArOTIwLDIwIEBACiAgICAgICAgICAgICBpblN0cmVhbS5za2lwKG9mZnNldCk7CiAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUZpZWxkczsgaSsrKSB7CiAgICAgICAgICAgICAgICAgaW50IGNoYXJDb2RlID0gaW5TdHJlYW0ucmVhZCg3KTsKLSAgICAgICAgICAgICAgICBpZiAoKGNoYXJDb2RlIDwgVXNlckRhdGEuSUE1X01BUF9CQVNFX0lOREVYKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgKGNoYXJDb2RlID4gVXNlckRhdGEuSUE1X01BUF9NQVhfSU5ERVgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBDb2RpbmdFeGNlcHRpb24oInVuc3VwcG9ydGVkIEFJNSBjaGFyYWN0ZXIgY29kZSAoIiArIGNoYXJDb2RlICsgIikiKTsKKyAgICAgICAgICAgICAgICBpZiAoKGNoYXJDb2RlID49IFVzZXJEYXRhLkFTQ0lJX01BUF9CQVNFX0lOREVYKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKGNoYXJDb2RlIDw9IFVzZXJEYXRhLkFTQ0lJX01BUF9NQVhfSU5ERVgpKSB7CisgICAgICAgICAgICAgICAgICAgIHN0ckJ1Zi5hcHBlbmQoVXNlckRhdGEuQVNDSUlfTUFQW2NoYXJDb2RlIC0gVXNlckRhdGEuQVNDSUlfTUFQX0JBU0VfSU5ERVhdKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoYXJDb2RlID09IFVzZXJEYXRhLkFTQ0lJX05MX0lOREVYKSB7CisgICAgICAgICAgICAgICAgICAgIHN0ckJ1Zi5hcHBlbmQoJ1xuJyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFyQ29kZSA9PSBVc2VyRGF0YS5BU0NJSV9DUl9JTkRFWCkgeworICAgICAgICAgICAgICAgICAgICBzdHJCdWYuYXBwZW5kKCdccicpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8qIEZvciBvdGhlciBjaGFyQ29kZXMsIHRoZXkgYXJlIHVucHJpbnRhYmxlLCBhbmQgc28gc2ltcGx5IHVzZSBTUEFDRS4gKi8KKyAgICAgICAgICAgICAgICAgICAgc3RyQnVmLmFwcGVuZCgnICcpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBzdHJCdWYuYXBwZW5kKFVzZXJEYXRhLklBNV9NQVBbY2hhckNvZGUgLSBVc2VyRGF0YS5JQTVfTUFQX0JBU0VfSU5ERVhd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5bG9hZCA9IG5ldyBieXRlW3VzZXJEYXRhLm51bUZpZWxkc107CisgICAgICAgICAgICBpbnQgY29weUxlbiA9IHVzZXJEYXRhLm51bUZpZWxkcyA8IHVzZXJEYXRhLnBheWxvYWQubGVuZ3RoCisgICAgICAgICAgICAgICAgICAgID8gdXNlckRhdGEubnVtRmllbGRzIDogdXNlckRhdGEucGF5bG9hZC5sZW5ndGg7CisKKyAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkodXNlckRhdGEucGF5bG9hZCwgMCwgcGF5bG9hZCwgMCwgY29weUxlbik7CisgICAgICAgICAgICB1c2VyRGF0YS5wYXlsb2FkID0gcGF5bG9hZDsKKworICAgICAgICAgICAgLy8gVGhlcmUgYXJlIG1hbnkgZGV2aWNlcyBpbiB0aGUgbWFya2V0IHRoYXQgc2VuZCA4Yml0IHRleHQgc21zIChsYXRpbiBlbmNvZGVkKSBhcworICAgICAgICAgICAgLy8gb2N0ZXQgZW5jb2RlZC4KKyAgICAgICAgICAgIHVzZXJEYXRhLnBheWxvYWRTdHIgPSBkZWNvZGVMYXRpbih1c2VyRGF0YS5wYXlsb2FkLCBvZmZzZXQsIHVzZXJEYXRhLm51bUZpZWxkcyk7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgY2FzZSBVc2VyRGF0YS5FTkNPRElOR19JQTU6Ci0gICAgICAgICAgICB1c2VyRGF0YS5wYXlsb2FkU3RyID0gZGVjb2RlSWE1KHVzZXJEYXRhLnBheWxvYWQsIG9mZnNldCwgdXNlckRhdGEubnVtRmllbGRzKTsKKyAgICAgICAgY2FzZSBVc2VyRGF0YS5FTkNPRElOR183QklUX0FTQ0lJOgorICAgICAgICAgICAgdXNlckRhdGEucGF5bG9hZFN0ciA9IGRlY29kZTdiaXRBc2NpaSh1c2VyRGF0YS5wYXlsb2FkLCBvZmZzZXQsIHVzZXJEYXRhLm51bUZpZWxkcyk7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgY2FzZSBVc2VyRGF0YS5FTkNPRElOR19VTklDT0RFXzE2OgogICAgICAgICAgICAgdXNlckRhdGEucGF5bG9hZFN0ciA9IGRlY29kZVV0ZjE2KHVzZXJEYXRhLnBheWxvYWQsIG9mZnNldCwgdXNlckRhdGEubnVtRmllbGRzKTsKQEAgLTkyNyw2ICsxMDAwLDkgQEAKICAgICAgICAgY2FzZSBVc2VyRGF0YS5FTkNPRElOR19HU01fN0JJVF9BTFBIQUJFVDoKICAgICAgICAgICAgIHVzZXJEYXRhLnBheWxvYWRTdHIgPSBkZWNvZGU3Yml0R3NtKHVzZXJEYXRhLnBheWxvYWQsIG9mZnNldCwgdXNlckRhdGEubnVtRmllbGRzKTsKICAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFVzZXJEYXRhLkVOQ09ESU5HX0xBVElOOgorICAgICAgICAgICAgdXNlckRhdGEucGF5bG9hZFN0ciA9IGRlY29kZUxhdGluKHVzZXJEYXRhLnBheWxvYWQsIG9mZnNldCwgdXNlckRhdGEubnVtRmllbGRzKTsKKyAgICAgICAgICAgIGJyZWFrOwogICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgdGhyb3cgbmV3IENvZGluZ0V4Y2VwdGlvbigidW5zdXBwb3J0ZWQgdXNlciBkYXRhIGVuY29kaW5nICgiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdXNlckRhdGEubXNnRW5jb2RpbmcgKyAiKSIpOwpAQCAtOTU5LDcgKzEwMzUsNyBAQAogICAgICAgICB0cnkgewogICAgICAgICAgICAgU3RyaW5nQnVmZmVyIHN0cmJ1ZiA9IG5ldyBTdHJpbmdCdWZmZXIoZGF0YUxlbik7CiAgICAgICAgICAgICB3aGlsZSAoaW5TdHJlYW0uYXZhaWxhYmxlKCkgPj0gNikgewotICAgICAgICAgICAgICAgIHN0cmJ1Zi5hcHBlbmQoVXNlckRhdGEuSUE1X01BUFtpblN0cmVhbS5yZWFkKDYpXSk7CisgICAgICAgICAgICAgICAgc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iAgICAgewotICAgICAgICBpbnQgcGFyYW1CeXRlcyA9IGluU3RyZWFtLnJlYWQoOCk7Ci0gICAgICAgIGlmIChwYXJhbUJ5dGVzICE9IDEpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBDb2RpbmdFeGNlcHRpb24oIlJFUExZX09QVElPTiBzdWJwYXJhbSBzaXplIGluY29ycmVjdCIpOworICAgICAgICBmaW5hbCBpbnQgRVhQRUNURURfUEFSQU1fU0laRSA9IDEgKiA4OworICAgICAgICBib29sZWFuIGRlY29kZVN1Y2Nlc3MgPSBmYWxzZTsKKyAgICAgICAgaW50IHBhcmFtQml0cyA9IGluU3RyZWFtLnJlYWQoOCkgKiA4OworICAgICAgICBpZiAocGFyYW1CaXRzID49IEVYUEVDVEVEX1BBUkFNX1NJWkUpIHsKKyAgICAgICAgICAgIHBhcmFtQml0cyAtPSBFWFBFQ1RFRF9QQVJBTV9TSVpFOworICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IHRydWU7CisgICAgICAgICAgICBiRGF0YS51c2VyQWNrUmVxICAgICA9IChpblN0cmVhbS5yZWFkKDEpID09IDEpOworICAgICAgICAgICAgYkRhdGEuZGVsaXZlcnlBY2tSZXEgPSAoaW5TdHJlYW0ucmVhZCgxKSA9PSAxKTsKKyAgICAgICAgICAgIGJEYXRhLnJlYWRBY2tSZXEgICAgID0gKGluU3RyZWFtLnJlYWQoMSkgPT0gMSk7CisgICAgICAgICAgICBiRGF0YS5yZXBvcnRSZXEgICAgICA9IChpblN0cmVhbS5yZWFkKDEpID09IDEpOworICAgICAgICAgICAgaW5TdHJlYW0uc2tpcCg0KTsKICAgICAgICAgfQotICAgICAgICBiRGF0YS51c2VyQWNrUmVxICAgICA9IChpblN0cmVhbS5yZWFkKDEpID09IDEpOwotICAgICAgICBiRGF0YS5kZWxpdmVyeUFja1JlcSA9IChpblN0cmVhbS5yZWFkKDEpID09IDEpOwotICAgICAgICBiRGF0YS5yZWFkQWNrUmVxICAgICA9IChpblN0cmVhbS5yZWFkKDEpID09IDEpOwotICAgICAgICBiRGF0YS5yZXBvcnRSZXEgICAgICA9IChpblN0cmVhbS5yZWFkKDEpID09IDEpOwotICAgICAgICBpblN0cmVhbS5za2lwKDQpOworICAgICAgICBpZiAoKCEgZGVjb2RlU3VjY2VzcykgfHwgKHBhcmFtQml0cyA+IDApKSB7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiUkVQTFlfT1BUSU9OIGRlY29kZSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAoZGVjb2RlU3VjY2VzcyA/ICJzdWNjZWVkZWQiIDogImZhaWxlZCIpICsKKyAgICAgICAgICAgICAgICAgICAgICAiIChleHRyYSBiaXRzID0gIiArIHBhcmFtQml0cyArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgaW5TdHJlYW0uc2tpcChwYXJhbUJpdHMpOworICAgICAgICByZXR1cm4gZGVjb2RlU3VjY2VzczsKICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGRlY29kZU1zZ0NvdW50KEJlYXJlckRhdGEgYkRhdGEsIEJpdHdpc2VJbnB1dFN0cmVhbSBpblN0cmVhbSkKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGRlY29kZU1zZ0NvdW50KEJlYXJlckRhdGEgYkRhdGEsIEJpdHdpc2VJbnB1dFN0cmVhbSBpblN0cmVhbSkKICAgICAgICAgdGhyb3dzIEJpdHdpc2VJbnB1dFN0cmVhbS5BY2Nlc3NFeGNlcHRpb24sIENvZGluZ0V4Y2VwdGlvbgogICAgIHsKLSAgICAgICAgaWYgKGluU3RyZWFtLnJlYWQoOCkgIT0gMSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IENvZGluZ0V4Y2VwdGlvbigiTlVNQkVSX09GX01FU1NBR0VTIHN1YnBhcmFtIHNpemUgaW5jb3JyZWN0Iik7CisgICAgICAgIGZpbmFsIGludCBFWFBFQ1RFRF9QQVJBTV9TSVpFID0gMSAqIDg7CisgICAgICAgIGJvb2xlYW4gZGVjb2RlU3VjY2VzcyA9IGZhbHNlOworICAgICAgICBpbnQgcGFyYW1CaXRzID0gaW5TdHJlYW0ucmVhZCg4KSAqIDg7CisgICAgICAgIGlmIChwYXJhbUJpdHMgPj0gRVhQRUNURURfUEFSQU1fU0laRSkgeworICAgICAgICAgICAgcGFyYW1CaXRzIC09IEVYUEVDVEVEX1BBUkFNX1NJWkU7CisgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gdHJ1ZTsKKyAgICAgICAgICAgIGJEYXRhLm51bWJlck9mTWVzc2FnZXMgPSBJY2NVdGlscy5jZG1hQmNkQnl0ZVRvSW50KChieXRlKWluU3RyZWFtLnJlYWQoOCkpOwogICAgICAgICB9Ci0gICAgICAgIGJEYXRhLm51bWJlck9mTWVzc2FnZXMgPSBpblN0cmVhbS5yZWFkKDgpOworICAgICAgICBpZiAoKCEgZGVjb2RlU3VjY2VzcykgfHwgKHBhcmFtQml0cyA+IDApKSB7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiTlVNQkVSX09GX01FU1NBR0VTIGRlY29kZSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAoZGVjb2RlU3VjY2VzcyA/ICJzdWNjZWVkZWQiIDogImZhaWxlZCIpICsKKyAgICAgICAgICAgICAgICAgICAgICAiIChleHRyYSBiaXRzID0gIiArIHBhcmFtQml0cyArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgaW5TdHJlYW0uc2tpcChwYXJhbUJpdHMpOworICAgICAgICByZXR1cm4gZGVjb2RlU3VjY2VzczsKICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGRlY29kZURlcG9zaXRJbmRleChCZWFyZXJEYXRhIGJEYXRhLCBCaXR3aXNlSW5wdXRTdHJlYW0gaW5TdHJlYW0pCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBkZWNvZGVEZXBvc2l0SW5kZXgoQmVhcmVyRGF0YSBiRGF0YSwgQ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9IGluU3RyZWFtLnJlYWQoOCk7CiAgICAgICAgIGNvbnN1bWVkQml0cyArPSA4OwotICAgICAgICBpbnQgcmVtYWluaW5nQml0cyA9IChwYXJhbUJ5dGVzICogOCkgLSBjb25zdW1lZEJpdHM7CisgICAgICAgIGludCByZW1haW5pbmdCaXRzID0gcGFyYW1CaXRzIC0gY29uc3VtZWRCaXRzOwogICAgICAgICBpbnQgZGF0YUJpdHMgPSBhZGRyLm51bWJlck9mRGlnaXRzICogZmllbGRCaXRzOwogICAgICAgICBpbnQgcGFkZGluZ0JpdHMgPSByZW1haW5pbmdCaXRzIC0gZGF0YUJpdHM7CiAgICAgICAgIGlmIChyZW1haW5pbmdCaXRzIDwgZGF0YUJpdHMpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBDb2RpbmdFeGNlcHRpb24oIkNBTExCQUNLX05VTUJFUiBzdWJwYXJhbSBlbmNvZGluZyBzaXplIGVycm9yICgiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlbWFpbmluZ0JpdHMgIiArIHJlbWFpbmluZ0JpdHMgKyAiLCBkYXRhQml0cyAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUJpdHMgKyAiLCBwYWRkaW5nQml0cyAiICsgcGFkZGluZ0JpdHMgKyAiKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVtYWluaW5nQml0cyArICIgKyByZW1haW5pbmdCaXRzICsgIiwgZGF0YUJpdHMgKyAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUJpdHMgKyAiLCBwYWRkaW5nQml0cyArICIgKyBwYWRkaW5nQml0cyArICIpIik7CiAgICAgICAgIH0KICAgICAgICAgYWRkci5vcmlnQnl0ZXMgPSBpblN0cmVhbS5yZWFkQnl0ZUFycmF5KGRhdGFCaXRzKTsKICAgICAgICAgaW5TdHJlYW0uc2tpcChwYWRkaW5nQml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yZWN0Iik7CisgICAgICAgIGZpbmFsIGludCBFWFBFQ1RFRF9QQVJBTV9TSVpFID0gNiAqIDg7CisgICAgICAgIGJvb2xlYW4gZGVjb2RlU3VjY2VzcyA9IGZhbHNlOworICAgICAgICBpbnQgcGFyYW1CaXRzID0gaW5TdHJlYW0ucmVhZCg4KSAqIDg7CisgICAgICAgIGlmIChwYXJhbUJpdHMgPj0gRVhQRUNURURfUEFSQU1fU0laRSkgeworICAgICAgICAgICAgcGFyYW1CaXRzIC09IEVYUEVDVEVEX1BBUkFNX1NJWkU7CisgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gdHJ1ZTsKKyAgICAgICAgICAgIGJEYXRhLmRlZmVycmVkRGVsaXZlcnlUaW1lQWJzb2x1dGUgPSBUaW1lU3RhbXAuZnJvbUJ5dGVBcnJheSgKKyAgICAgICAgICAgICAgICAgICAgaW5TdHJlYW0ucmVhZEJ5dGVBcnJheSg2ICogOCkpOwogICAgICAgICB9Ci0gICAgICAgIGJEYXRhLmRlZmVycmVkRGVsaXZlcnlUaW1lQWJzb2x1dGUgPSBUaW1lU3RhbXAuZnJvbUJ5dGVBcnJheShpblN0cmVhbS5yZWFkQnl0ZUFycmF5KDYgKiA4KSk7CisgICAgICAgIGlmICgoISBkZWNvZGVTdWNjZXNzKSB8fCAocGFyYW1CaXRzID4gMCkpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJERUZFUlJFRF9ERUxJVkVSWV9USU1FX0FCU09MVVRFIGRlY29kZSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAoZGVjb2RlU3VjY2VzcyA/ICJzdWNjZWVkZWQiIDogImZhaWxlZCIpICsKKyAgICAgICAgICAgICAgICAgICAgICAiIChleHRyYSBiaXRzID0gIiArIHBhcmFtQml0cyArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgaW5TdHJlYW0uc2tpcChwYXJhbUJpdHMpOworICAgICAgICByZXR1cm4gZGVjb2RlU3VjY2VzczsKICAgICB9C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CIpOworICAgICAgICBmaW5hbCBpbnQgRVhQRUNURURfUEFSQU1fU0laRSA9IDEgKiA4OworICAgICAgICBib29sZWFuIGRlY29kZVN1Y2Nlc3MgPSBmYWxzZTsKKyAgICAgICAgaW50IHBhcmFtQml0cyA9IGluU3RyZWFtLnJlYWQoOCkgKiA4OworICAgICAgICBpZiAocGFyYW1CaXRzID49IEVYUEVDVEVEX1BBUkFNX1NJWkUpIHsKKyAgICAgICAgICAgIHBhcmFtQml0cyAtPSBFWFBFQ1RFRF9QQVJBTV9TSVpFOworICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IHRydWU7CisgICAgICAgICAgICBiRGF0YS52YWxpZGl0eVBlcmlvZFJlbGF0aXZlID0gaW5TdHJlYW0ucmVhZCg4KTsKICAgICAgICAgfQotICAgICAgICBiRGF0YS52YWxpZGl0eVBlcmlvZFJlbGF0aXZlID0gaW5TdHJlYW0ucmVhZCg4KTsKLSAgICAgICAgYkRhdGEudmFsaWRpdHlQZXJpb2RSZWxhdGl2ZVNldCA9IHRydWU7CisgICAgICAgIGlmICgoISBkZWNvZGVTdWNjZXNzKSB8fCAocGFyYW1CaXRzID4gMCkpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJERUZFUlJFRF9ERUxJVkVSWV9USU1FX1JFTEFUSVZFIGRlY29kZSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAoZGVjb2RlU3VjY2VzcyA/ICJzdWNjZWVkZWQiIDogImZhaWxlZCIpICsKKyAgICAgICAgICAgICAgICAgICAgICAiIChleHRyYSBiaXRzID0gIiArIHBhcmFtQml0cyArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgaW5TdHJlYW0uc2tpcChwYXJhbUJpdHMpOworICAgICAgICBiRGF0YS52YWxpZGl0eVBlcmlvZFJlbGF0aXZlU2V0ID0gZGVjb2RlU3VjY2VzczsKKyAgICAgICAgcmV0dXJuIGRlY29kZVN1Y2Nlc3M7CiAgICAgfQogCi0gICAgcHJpdm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gICAgICAgICAgIHBhcmFtQml0cyAtPSBFWFBFQ1RFRF9QQVJBTV9TSVpFOworICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IHRydWU7CisgICAgICAgICAgICBiRGF0YS5wcmlvcml0eSA9IGluU3RyZWFtLnJlYWQoMik7CisgICAgICAgICAgICBpblN0cmVhbS5za2lwKDYpOwogICAgICAgICB9Ci0gICAgICAgIGJEYXRhLnByaW9yaXR5ID0gaW5TdHJlYW0ucmVhZCgyKTsKLSAgICAgICAgaW5TdHJlYW0uc2tpcCg2KTsKLSAgICAgICAgYkRhdGEucHJpb3JpdHlJbmRpY2F0b3JTZXQgPSB0cnVlOworICAgICAgICBpZiAoKCEgZGVjb2RlU3VjY2VzcykgfHwgKHBhcmFtQml0cyA+IDApKSB7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiUFJJT1JJVFlfSU5ESUNBVE9SIGRlY29kZSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAoZGVjb2RlU3VjY2VzcyA/ICJzdWNjZWVkZWQiIDogImZhaWxlZCIpICsKKyAgICAgICAgICAgICAgICAgICAgICAiIChleHRyYSBiaXRzID0gIiArIHBhcmFtQml0cyArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgaW5TdHJlYW0uc2tpcChwYXJhbUJpdHMpOworICAgICAgICBiRGF0YS5wcmlvcml0eUluZGljYXRvclNldCA9IGRlY29kZVN1Y2Nlc3M7CisgICAgICAgIHJldHVybiBkZWNvZGVTdWNjZXNzOwogICAgIH0KIAotICAgIHByaXZhdGUgc3RhdGljIHZvaWQgZGVjb2RlTXNnRGVsaXZlcnlBbGVydChCZWFyZXJEYXRhIGJEYXRhLCBCaXR3aXNlSW5wdXRTdHJlYW0gaW5TdHJlYW0pCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBkZWNvZGVNc2dEZWxpdmVyeUFsZXJ0KEJlYXJlckRhdGEgYkRhdGEsIEJpdHdpc2VJbnB1dFN0cmVhbSBpblN0cmVhbSkKICAgICAgICAgdGhyb3dzIEJpdHdpc2VJbnB1dFN0cmVhbS5BY2Nlc3NFeGNlcHRpb24sIENvZGluZ0V4Y2VwdGlvbgogICAgIHsKLSAgICAgICAgaWYgKGluU3RyZWFtLnJlYWQoOCkgIT0gMSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IENvZGluZ0V4Y2VwdGlvbigiQUxFUlRfT05fTUVTU0FHRV9ERUxJVkVSWSBzdWJwYXJhbSBzaXplIGluY29ycmVjdCIpOworICAgICAgICBmaW5hbCBpbnQgRVhQRUNURURfUEFSQU1fU0laRSA9IDEgKiA4OworICAgICAgICBib29sZWFuIGRlY29kZVN1Y2Nlc3MgPSBmYWxzZTsKKyAgICAgICAgaW50IHBhcmFtQml0cyA9IGluU3RyZWFtLnJlYWQoOCkgKiA4OworICAgICAgICBpZiAocGFyYW1CaXRzID49IEVYUEVDVEVEX1BBUkFNX1NJWkUpIHsKKyAgICAgICAgICAgIHBhcmFtQml0cyAtPSBFWFBFQ1RFRF9QQVJBTV9TSVpFOworICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IHRydWU7CisgICAgICAgICAgICBiRGF0YS5hbGVydCA9IGluU3RyZWFtLnJlYWQoMik7CisgICAgICAgICAgICBpblN0cmVhbS5za2lwKDYpOwogICAgICAgICB9Ci0gICAgICAgIGJEYXRhLmFsZXJ0ID0gaW5TdHJlYW0ucmVhZCgyKTsKLSAgICAgICAgaW5TdHJlYW0uc2tpcCg2KTsKLSAgICAgICAgYkRhdGEuYWxlcnRJbmRpY2F0b3JTZXQgPSB0cnVlOworICAgICAgICBpZiAoKCEgZGVjb2RlU3VjY2VzcykgfHwgKHBhcmFtQml0cyA+IDApKSB7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiQUxFUlRfT05fTUVTU0FHRV9ERUxJVkVSWSBkZWNvZGUgIiArCisgICAgICAgICAgICAgICAgICAgICAgKGRlY29kZVN1Y2Nlc3MgPyAic3VjY2VlZGVkI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gICAgICAgICBkZWNvZGVTdWNjZXNzID0gdHJ1ZTsKKyAgICAgICAgICAgIGJEYXRhLnVzZXJSZXNwb25zZUNvZGUgPSBpblN0cmVhbS5yZWFkKDgpOwogICAgICAgICB9Ci0gICAgICAgIGJEYXRhLnVzZXJSZXNwb25zZUNvZGUgPSBpblN0cmVhbS5yZWFkKDgpOwotICAgICAgICBiRGF0YS51c2VyUmVzcG9uc2VDb2RlU2V0ID0gdHJ1ZTsKKyAgICAgICAgaWYgKCghIGRlY29kZVN1Y2Nlc3MpIHx8IChwYXJhbUJpdHMgPiAwKSkgeworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIlVTRVJfUkVQT05TRV9DT0RFIGRlY29kZSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAoZGVjb2RlU3VjY2VzcyA/ICJzdWNjZWVkZWQiIDogImZhaWxlZCIpICsKKyAgICAgICAgICAgICAgICAgICAgICAiIChleHRyYSBiaXRzID0gIiArIHBhcmFtQml0cyArICIpIik7CisgICAgICAgIH0KKyAgICAgICAgaW5TdHJlYW0uc2tpcChwYXJhbUJpdHMpOworICAgICAgICBiRGF0YS51c2VyUmVzcG9uc2VDb2RlU2V0ID0gZGVjb2RlU3VjY2VzczsKKyAgICAgICAgcmV0dXJuIGRlY29kZVN1Y2Nlc3M7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xMjc4LDcyICsxNTIwLDczIEBACiAgICAgICAgICAgICBCZWFyZXJEYXRhIGJEYXRhID0gbmV3IEJlYXJlckRhdGEoKTsKICAgICAgICAgICAgIGludCBmb3VuZFN1YnBhcmFtTWFzayA9IDA7CiAgICAgICAgICAgICB3aGlsZSAoaW5TdHJlYW0uYXZhaWxhYmxlKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBkZWNvZGVTdWNjZXNzID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgaW50IHN1YnBhcmFtSWQgPSBpblN0cmVhbS5yZWFkKDgpOwogICAgICAgICAgICAgICAgIGludCBzdWJwYXJhbUlkQml0ID0gMSA8PCBzdWJwYXJhbUlkOwogICAgICAgICAgICAgICAgIGlmICgoZm91bmRTdWJwYXJhbU1hc2sgJiBzdWJwYXJhbUlkQml0KSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBDb2RpbmdFeGNlcHRpb24oImlsbGVnYWwgZHVwbGljYXRlIHN1YnBhcmFtZXRlciAoIiArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VicGFyYW1JZCArICIpIik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGZvdW5kU3VicGFyYW1NYXNrIHw9IHN1YnBhcmFtSWRCaXQ7CiAgICAgICAgICAgICAgICAgc3dpdGNoIChzdWJwYXJhbUlkKSB7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9NRVNTQUdFX0lERU5USUZJRVI6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZU1lc3NhZ2VJZChiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlTWVzc2FnZUlkKGJEYXRhLCBpblN0cmVhbSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgU1VCUEFSQU1fVVNFUl9EQVRBOgotICAgICAgICAgICAgICAgICAgICBkZWNvZGVVc2VyRGF0YShiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlVXNlckRhdGEoYkRhdGEsIGluU3RyZWFtKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9VU0VSX1JFUE9OU0VfQ09ERToKLSAgICAgICAgICAgICAgICAgICAgZGVjb2RlVXNlclJlc3BvbnNlQ29kZShiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlVXNlclJlc3BvbnNlQ29kZShiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX1JFUExZX09QVElPTjoKLSAgICAgICAgICAgICAgICAgICAgZGVjb2RlUmVwbHlPcHRpb24oYkRhdGEsIGluU3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IGRlY29kZVJlcGx5T3B0aW9uKGJEYXRhLCBpblN0cmVhbSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgU1VCUEFSQU1fTlVNQkVSX09GX01FU1NBR0VTOgotICAgICAgICAgICAgICAgICAgICBkZWNvZGVNc2dDb3VudChiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlTXNnQ291bnQoYkRhdGEsIGluU3RyZWFtKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9DQUxMQkFDS19OVU1CRVI6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZUNhbGxiYWNrTnVtYmVyKGJEYXRhLCBpblN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgIGRlY29kZVN1Y2Nlc3MgPSBkZWNvZGVDYWxsYmFja051bWJlcihiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX01FU1NBR0VfU1RBVFVTOgotICAgICAgICAgICAgICAgICAgICBkZWNvZGVNc2dTdGF0dXMoYkRhdGEsIGluU3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IGRlY29kZU1zZ1N0YXR1cyhiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX01FU1NBR0VfQ0VOVEVSX1RJTUVfU1RBTVA6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZU1zZ0NlbnRlclRpbWVTdGFtcChiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlTXNnQ2VudGVyVGltZVN0YW1wKGJEYXRhLCBpblN0cmVhbSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgU1VCUEFSQU1fVkFMSURJVFlfUEVSSU9EX0FCU09MVVRFOgotICAgICAgICAgICAgICAgICAgICBkZWNvZGVWYWxpZGl0eUFicyhiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlVmFsaWRpdHlBYnMoYkRhdGEsIGluU3RyZWFtKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9WQUxJRElUWV9QRVJJT0RfUkVMQVRJVkU6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZVZhbGlkaXR5UmVsKGJEYXRhLCBpblN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgIGRlY29kZVN1Y2Nlc3MgPSBkZWNvZGVWYWxpZGl0eVJlbChiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX0RFRkVSUkVEX0RFTElWRVJZX1RJTUVfQUJTT0xVVEU6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZURlZmVycmVkRGVsaXZlcnlBYnMoYkRhdGEsIGluU3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IGRlY29kZURlZmVycmVkRGVsaXZlcnlBYnMoYkRhdGEsIGluU3RyZWFtKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9ERUZFUlJFRF9ERUxJVkVSWV9USU1FX1JFTEFUSVZFOgotICAgICAgICAgICAgICAgICAgICBkZWNvZGVEZWZlcnJlZERlbGl2ZXJ5UmVsKGJEYXRhLCBpblN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgIGRlY29kZVN1Y2Nlc3MgPSBkZWNvZGVEZWZlcnJlZERlbGl2ZXJ5UmVsKGJEYXRhLCBpblN0cmVhbSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgU1VCUEFSQU1fUFJJVkFDWV9JTkRJQ0FUT1I6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZVByaXZhY3lJbmRpY2F0b3IoYkRhdGEsIGluU3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IGRlY29kZVByaXZhY3lJbmRpY2F0b3IoYkRhdGEsIGluU3RyZWFtKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9MQU5HVUFHRV9JTkRJQ0FUT1I6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZUxhbmd1YWdlSW5kaWNhdG9yKGJEYXRhLCBpblN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgIGRlY29kZVN1Y2Nlc3MgPSBkZWNvZGVMYW5ndWFnZUluZGljYXRvcihiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX01FU1NBR0VfRElTUExBWV9NT0RFOgotICAgICAgICAgICAgICAgICAgICBkZWNvZGVEaXNwbGF5TW9kZShiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlRGlzcGxheU1vZGUoYkRhdGEsIGluU3RyZWFtKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9QUklPUklUWV9JTkRJQ0FUT1I6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZVByaW9yaXR5SW5kaWNhdG9yKGJEYXRhLCBpblN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgIGRlY29kZVN1Y2Nlc3MgPSBkZWNvZGVQcmlvcml0eUluZGljYXRvcihiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX0FMRVJUX09OX01FU1NBR0VfREVMSVZFUlk6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZU1zZ0RlbGl2ZXJ5QWxlcnQoYkRhdGEsIGluU3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgZGVjb2RlU3VjY2VzcyA9IGRlY29kZU1zZ0RlbGl2ZXJ5QWxlcnQoYkRhdGEsIGluU3RyZWFtKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9NRVNTQUdFX0RFUE9TSVRfSU5ERVg6Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZURlcG9zaXRJbmRleChiRGF0YSwgaW5TdHJlYW0pOworICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlRGVwb3NpdEluZGV4KGJEYXRhLCBpblN0cmVhbSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBDb2RpbmdFeGNlcHRpb24oInVuc3VwcG9ydGVkIGJlYXJlciBkYXRhIHN1YnBhcmFtZXRlciAoIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc3VicGFyYW1JZCArICIpIik7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChkZWNvZGVTdWNjZXNzKSBmb3VuZFN1YnBhcmFtTWFzayB8PSBzdWJwYXJhbUlkQml0OwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKChmb3VuZFN1YnBhcmFtTWFzayAmICgxIDw8IFNVQlBBUkFNX01FU1NBR0VfSURFTlRJRklFUikpID09IDApIHsKICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQ29kaW5nRXhjZXB0aW9uKCJtaXNzaW5nIE1FU1NBR0VfSURFTlRJRklFUiBzdWJwYXJhbSIpOwpkaWZmIC0tZ2l0IGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L2NkbWEvc21zL0NkbWFTbXNBZGRyZXNzLmphdmEgYi90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvY2RtYS9zbXMvQ2RtYVNtc0FkZHJlc3MuamF2YQppbmRleCA0ZDc5OTY2NS4uZDljYzJjNiAxMDA2NDQKLS0tIGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L2NkbWEvc21zL0NkbWFTbXNBZGRyZXNzLmphdmEKKysrIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L2NkbWEvc21zL0NkbWFTbXNBZGRyZXNzLmphdmEKQEAgLTE2LDcgKzE2LDEwIEBACiAKIHBhY2thZ2UgY29tLmFuZHJvaWQuaW50ZXJuYWwudGVsZXBob255LmNkbWEuc21zOwogCitpbXBvcnQgYW5kcm9pZC51dGlsLlNwYXJzZUJvb2xlYW5BcnJheTsKKwoga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ICAgIGJ1aWxkZXIuYXBwZW5kKCIsIGFkZHJlc3M9XCIiICsgYWRkcmVzcyArICJcIiIpOwogICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCBvcmlnQnl0ZXM9IiArIEhleER1bXAudG9IZXhTdHJpbmcob3JpZ0J5dGVzKSk7CiAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgfSIpOwogICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwogICAgIH0KIAorICAgIC8qCisgICAgICogVE9ETyhjbGVhbnVwKTogUmVmYWN0b3IgdGhlIHBhcnNpbmcgZm9yIGFkZHJlc3NlcyB0byBiZXR0ZXIKKyAgICAgKiBzaGFyZSBjb2RlIGFuZCBsb2dpYyB3aXRoIEdTTS4gIEFsc28sIGdhdGhlciBhbGwgRFRNRi9CQ0QKKyAgICAgKiBwcm9jZXNzaW5nIGNvZGUgaW4gb25lIHBsYWNlLgorICAgICAqLworCisgICAgcHJpdmF0ZSBzdGF0aWMgYnl0ZVtdIHBhcnNlVG9EdG1mKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIGludCBkaWdpdHMgPSBhZGRyZXNzLmxlbmd0aCgpOworICAgICAgICBieXRlW10gcmVzdWx0ID0gbmV3IGJ5dGVbZGlnaXRzXTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaWdpdHM7IGkrKykgeworICAgICAgICAgICAgY2hhciBjID0gYWRkcmVzcy5jaGFyQXQoaSk7CisgICAgICAgICAgICBpbnQgdmFsID0gMDsKKyAgICAgICAgICAgIGlmICgoYyA+PSAnMScpICYmIChjIDw9ICc5JykpIHZhbCA9IGMgLSAnMCc7CisgICAgICAgICAgICBlbHNlIGlmIChjID09ICcwJykgdmFsID0gMTA7CisgICAgICAgICAgICBlbHNlIGlmIChjID09ICcqJykgdmFsID0gMTE7CisgICAgICAgICAgICBlbHNlIGlmIChjID09ICcjJykgdmFsID0gMTI7CisgICAgICAgICAgICBlbHNlIHJldHVybiBudWxsOworICAgICAgICAgICAgcmVzdWx0W2ldID0gKGJ5dGUpdmFsOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgY2hhcltdIG51bWVyaWNDaGFyc0RpYWxhYmxlID0geworICAgICAgICAnMCcsICcxJywgJzInLCAnMycsICc0JywgJzUnLCAnNicsICc3JywgJzgnLCAnOScsICcqJywgJyMnCisgICAgfTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNoYXJbXSBudW1lcmljQ2hhcnNTdWdhciA9IHsKKyAgICAgICAgJygnLCAnKScsICcgJywgJy0nLCAnKycKKyAgICB9OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3BhcnNlQm9vbGVhbkFycmF5IG51bWVyaWNDaGFyRGlhbGFibGVNYXAgPSBuZXcgU3BhcnNlQm9vbGVhbkFycmF5ICgKKyAgICAgICAgICAgIG51bWVyaWNDaGFyc0RpYWxhYmxlLmxlbmd0aCArIG51bWVyaWNDaGFyc1N1Z2FyLmxlbmd0aCk7CisgICAgc3RhdGljIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1lcmljQ2hhcnNEaWFsYWJsZS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgbnVtZXJpY0NoYXJEaWFsYWJsZU1hcC5wdXQobnVtZXJpY0NoYXJzRGlhbGFibGVbaV0sIHRydWUpOworICAgICAgICB9CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtZXJpY0NoYXJzU3VnYXIubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIG51bWVyaWNDaGFyRGlhbGFibGVNYXAucHV0KG51bWVyaWNDaGFyc1N1Z2FyW2ldLCBmYWxzZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHaXZlbiBhIG51bWVyaWMgYWRkcmVzcyBzdHJpbmcsIHJldHVybiB0aGUgc3RyaW5nIHdpdGhvdXQKKyAgICAgKiBzeW50YWN0aWMgc3VnYXIsIG1lYW5pbmcgcGFyZW5zLCBzcGFjZXMsIGh5cGhlbnMvbWludXNlcywgb3IKKyAgICAgKiBwbHVzIHNpZ25zLiAgSWYgdGhlIGlucHV0IHN0cmluZyBjb250YWlucyBub24tbnVtZXJpYworICAgICAqIG5vbi1wdW5jdHVhdGlvbiBjaGFyYWN0ZXJzLCByZXR1cm4gbnVsbC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgZmlsdGVyTnVtZXJpY1N1Z2FyKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGludCBsZW4gPSBhZGRyZXNzLmxlbmd0aCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisgICAgICAgICAgICBjaGFyIGMgPSBhZGRyZXNzLmNoYXJBdChpKTsKKyAgICAgICAgICAgIGludCBtYXBJbmRleCA9IG51bWVyaWNDaGFyRGlhbGFibGVNYXAuaW5kZXhPZktleShjKTsKKyAgICAgICAgICAgIGlmIChtYXBJbmRleCA8IDApIHJldHVybiBudWxsOworICAgICAgICAgICAgaWYgKCEgbnVtZXJpY0NoYXJEaWFsYWJsZU1hcC52YWx1ZUF0KG1hcEluZGV4KSkgY29udGludWU7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdpdmVuIGEgc3RyaW5nLCByZXR1cm4gdGhlIHN0cmluZyB3aXRob3V0IHdoaXRlc3BhY2UsCisgICAgICogaW5jbHVkaW5nIENSL0xGLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyBmaWx0ZXJXaGl0ZXNwYWNlKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIGludCBsZW4gPSBhZGRyZXNzLmxlbmd0aCgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisgICAgICAgICAgICBjaGFyIGMgPSBhZGRyZXNzLmNoYXJBdChpKTsKKyAgICAgICAgICAgIGlmICgoYyA9PSAnICcpIHx8IChjID09ICdccicpIHx8IChjID09ICdcbicpIHx8IChjID09ICdcdCcpKSBjb250aW51ZTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGMpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2l2ZW4gYSBzdHJpbmcsIGNyZWF0ZSBhIGNvcnJlc3BvbmRpbmcgQ2RtYVNtc0FkZHJlc3Mgb2JqZWN0LgorICAgICAqCisgICAgICogVGhlIHJlc3VsdCB3aWxsIGJlIG51bGwgaWYgdGhlIGlucHV0IHN0cmluZyBpcyBub3QKKyAgICAgKiByZXByZXNlbnRhYmxlIHVzaW5nIHByaW50YWJsZSBBU0NJSS4KKyAgICAgKgorICAgICAqIEZvciBudW1lcmljIGFkZHJlc3NlcywgdGhlIHN0cmluZyBpcyBjbGVhbmVkIHVwIGJ5IHJlbW92aW5nCisgICAgICogY29tbW9uIHB1bmN0dWF0aW9uLiAgRm9yIGFscGhhIGFkZHJlc3NlcywgdGhlIHN0cmluZyBpcyBjbGVhbmVkCisgICAgICogdXAgYnkgcmVtb3Zpbmcgd2hpdGVzcGFjZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIENkbWFTbXNBZGRyZXNzIHBhcnNlKFN0cmluZyBhZGRyZXNzKSB7CisgICAgICAgIENkbWFTbXNBZGRyZXNzIGFkZHIgPSBuZXcgQ2RtYVNtc0FkZHJlc3MoKTsKKyAgICAgICAgYWRkci5hZGRyZXNzID0gYWRkcmVzczsKKyAgICAgICAgYWRkci50b24gPSBDZG1hU21zQWRkcmVzcy5UT05fVU5LTk9XTjsKKyAgICAgICAgYnl0ZVtdIG9yaWdCeXRlcyA9IG51bGw7CisgICAgICAgIFN0cmluZyBmaWx0ZXJlZEFkZHIgPSBmaWx0ZXJOdW1lcmljU3VnYXIoYWRkcmVzcyk7CisgICAgICAgIGlmIChmaWx0ZXJlZEFkZHIgIT0gbnVsbCkgeworICAgICAgICAgICAgb3JpZ0J5dGVzID0gcGFyc2VUb0R0bWYoZmlsdGVyZWRBZGRyKTsKKyAgICAgICAgfQorICAgICAgICBpZiAob3JpZ0J5dGVzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGFkZHIuZGlnaXRNb2RlID0gRElHSVRfTU9ERV80QklUX0RUTUY7CisgICAgICAgICAgICBhZGRyLm51bWJlck1vZGUgPSBOVU1CRVJfTU9ERV9OT1RfREFUQV9ORVRXT1JLOworICAgICAgICAgICAgaWYgKGFkZHJlc3MuaW5kZXhPZignKycpICE9IC0xKSB7CisgICAgICAgICAgICAgICAgYWRkci50b24gPSBUT05fSU5URVJOQVRJT05BTF9PUl9JUDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGZpbHRlcmVkQWRkciA9IGZpbHRlcldoaXRlc3BhY2UoYWRkcmVzcyk7CisgICAgICAgICAgICBvcmlnQnl0ZXMgPSBVc2VyRGF0YS5zdHJpbmdUb0FzY2lpKGZpbHRlcmVkQWRkcik7CisgICAgICAgICAgICBpZiAob3JpZ0J5dGVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGFkZHIuZGlnaXRNb2RlID0gRElHSVRfTU9ERV84QklUX0NIQVI7CisgICAgICAgICAgICBhZGRyLm51bWJlck1vZGUgPS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hCisrKyBiL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9jZG1hL3Ntcy9Vc2VyRGF0YS5qYXZhCkBAIC0zNSw3ICszNSw3IEBACiAgICAgLy9wdWJsaWMgc3RhdGljIGZpbmFsIGludCBFTkNPRElOR19TSElGVF9KSVMgICAgICAgICAgICAgICAgICA9IDB4MDU7CiAgICAgLy9wdWJsaWMgc3RhdGljIGZpbmFsIGludCBFTkNPRElOR19LT1JFQU4gICAgICAgICAgICAgICAgICAgICA9IDB4MDY7CiAgICAgLy9wdWJsaWMgc3RhdGljIGZpbmFsIGludCBFTkNPRElOR19MQVRJTl9IRUJSRVcgICAgICAgICAgICAgICA9IDB4MDc7Ci0gICAgLy9wdWJsaWMgc3RhdGljIGZpbmFsIGludCBFTkNPRElOR19MQVRJTiAgICAgICAgICAgICAgICAgICAgICA9IDB4MDg7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRU5DT0RJTkdfTEFUSU4gICAgICAgICAgICAgICAgICAgICAgPSAweDA4OwogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEVOQ09ESU5HX0dTTV83QklUX0FMUEhBQkVUICAgICAgICAgID0gMHgwOTsKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBFTkNPRElOR19HU01fRENTICAgICAgICAgICAgICAgICAgICA9IDB4MEE7CiAKQEAgLTQ5LDE5ICs0OSwyMCBAQAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IElTOTFfTVNHX1RZUEVfU0hPUlRfTUVTU0FHRSAgICAgID0gMHg4NTsKIAogICAgIC8qKgotICAgICAqIElBNSBkYXRhIGVuY29kaW5nIGNoYXJhY3RlciBtYXBwaW5ncy4KLSAgICAgKiAoU2VlIENDSVRUIFJlYy4gVC41MCBUYWJsZXMgMSBhbmQgMykKKyAgICAgKiBVUyBBU0NJSSBjaGFyYWN0ZXIgbWFwcGluZyB0YWJsZS4K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C4xLTEgLS0gYW5kIG5vdGUgdGhlIGVuY29kaW5nIHVzZXMgb25seSA2IGJpdHMsCisgICAgICogYW5kIGhlbmNlIG9ubHkgbWFwcyBlbnRyaWVzIHVwIHRvIHRoZSAnXycgY2hhcmFjdGVyLgogICAgICAqCiAgICAgICovCi0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBjaGFyW10gSUE1X01BUCA9IHsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNoYXJbXSBBU0NJSV9NQVAgPSB7CiAgICAgICAgICcgJywgJyEnLCAnIicsICcjJywgJyQnLCAnJScsICcmJywgJ1wnJywgJygnLCAnKScsICcqJywgJysnLCAnLCcsICctJywgJy4nLCAnLycsCiAgICAgICAgICcwJywgJzEnLCAnMicsICczJywgJzQnLCAnNScsICc2JywgJzcnLCAnOCcsICc5JywgJzonLCAnOycsICc8JywgJz0nLCAnPicsICc/JywKICAgICAgICAgJ0AnLCAnQScsICdCJywgJ0MnLCAnRCcsICdFJywgJ0YnLCAnRycsICdIJywgJ0knLCAnSicsICdLJywgJ0wnLCAnTScsICdOJywgJ08nLApAQCAtODEsMjMgKzgyLDQzIEBACiAgICAgICogT25seSBlbGVtZW50cyBiZXR3ZWVuIHRoZXNlIGluZGljZXMgaW4gdGhlIEFTQ0lJIHRhYmxlIGFyZSBwcmludGFibGUuCiAgICAgICovCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJJTlRBQkxFX0FTQ0lJX01JTl9JTkRFWCA9IDB4MjA7Ci0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQVNDSUlfTEZfSU5ERVggPSAweDBBOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFTQ0lJX05MX0lOREVYID0gMHgwQTsKICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBBU0NJSV9DUl9JTkRFWCA9IDB4MEQ7CiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTcGFyc2VJbnRBcnJheSB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CisgICAgcHVibGljIHN0YXRpYyBieXRlW10gc3RyaW5nVG9Bc2NpaShTdHJpbmcgc3RyKSB7CisgICAgICAgIGludCBsZW4gPSBzdHIubGVuZ3RoKCk7CisgICAgICAgIGJ5dGVbXSByZXN1bHQgPSBuZXcgYnl0ZVtsZW5dOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisgICAgICAgICAgICBpbnQgY2hhckNvZGUgPSBjaGFyVG9Bc2NpaS5nZXQoc3RyLmNoYXJBdChpKSwgLTEpOworICAgICAgICAgICAgaWYgKGNoYXJDb2RlID09IC0xKSByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIHJlc3VsdFtpXSA9IChieXRlKWNoYXJDb2RlOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogTWFwcGluZyBmb3IgSUE1IHZhbHVlcyBsZXNzIHRoYW4gMzIgYXJlIGZsb3cgY29udHJvbCBzaWduYWxzCisgICAgICogTWFwcGluZyBmb3IgQVNDSUkgdmFsdWVzIGxlc3MgdGhhbiAzMiBhcmUgZmxvdyBjb250cm9sIHNpZ25hbHMKICAgICAgKiBhbmQgbm90IHVzZWQgaGVyZS4KICAgICAgKi8KLSAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBJQTVfTUFQX0JBU0VfSU5ERVggPSAweDIwOwotICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IElBNV9NQVBfTUFYX0lOREVYID0gSUE1X01BUF9CQVNFX0lOREVYICsgSUE1X01BUC5sZW5ndGggLSAxOworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEFTQ0lJX01BUF9CQVNFX0lOREVYID0gMHgyMDsKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBBU0NJSV9NQVBfTUFYX0lOREVYID0gQVNDSUlfTUFQX0JBU0VfSU5ERVggKyBBU0NJSV9NQVAubGVuZ3RoIC0gM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YmxlKHRoaXMpOyAvL0VWRU5UX1JBRElPX0FWQUlMQUJMRQorICAgICAgICAgICAgbVNJTVJlY29yZHMudW5yZWdpc3RlckZvclJlY29yZHNMb2FkZWQodGhpcyk7IC8vRVZFTlRfU0lNX1JFQ09SRFNfTE9BREVECisgICAgICAgICAgICBtQ00udW5yZWdpc3RlckZvck9mZk9yTm90QXZhaWxhYmxlKHRoaXMpOyAvL0VWRU5UX1JBRElPX09GRl9PUl9OT1RfQVZBSUxBQkxFCisgICAgICAgICAgICBtQ00udW5yZWdpc3RlckZvck9uKHRoaXMpOyAvL0VWRU5UX1JBRElPX09OCisgICAgICAgICAgICBtU1NULnVucmVnaXN0ZXJGb3JOZXR3b3JrQXR0YWNoKHRoaXMpOyAvL0VWRU5UX1JFR0lTVEVSRURfVE9fTkVUV09SSworICAgICAgICAgICAgbUNNLnVuU2V0T25VU1NEKHRoaXMpOworICAgICAgICAgICAgbUNNLnVuU2V0T25TdXBwU2VydmljZU5vdGlmaWNhdGlvbih0aGlzKTsKIAogICAgICAgICAgICAgbVBlbmRpbmdNTUlzLmNsZWFyKCk7CiAKQEAgLTI1OCw4ICsyNTMsNiBAQAogICAgIH0KIAogCi0gICAgLy8qKioqKiBPdmVycmlkZGVuIGZyb20gUGhvbmUKLQogICAgIHB1YmxpYyBTZXJ2aWNlU3RhdGUKICAgICBnZXRTZXJ2aWNlU3RhdGUoKSB7CiAgICAgICAgIHJldHVybiBtU1NULnNzOwpAQCAtMjc5LDE0ICsyNzIsNiBAQAogICAgICAgICByZXR1cm4gIkdTTSI7CiAgICAgfQogCi0gICAgcHVibGljIFN0cmluZ1tdIGdldEFjdGl2ZUFwblR5cGVzKCkgewotICAgICAgICByZXR1cm4gbURhdGFDb25uZWN0aW9uLmdldEFjdGl2ZUFwblR5cGVzKCk7Ci0gICAgfQotCi0gICAgcHVibGljIFN0cmluZyBnZXRBY3RpdmVBcG4oKSB7Ci0gICAgICAgIHJldHVybiBtRGF0YUNvbm5lY3Rpb24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xldGUpOworICAgICAgICByZXNwID0gb2J0YWluTWVzc2FnZShFVkVOVF9TRVRfVk1fTlVNQkVSX0RPTkUsIDAsIDAsIG9uQ29tcGxldGUpOwogICAgICAgICBtU0lNUmVjb3Jkcy5zZXRWb2ljZU1haWxOdW1iZXIoYWxwaGFUYWcsIG1WbU51bWJlciwgcmVzcCk7CiAgICAgfQogCkBAIC05NjUsNyArOTQxLDcgQEAKICAgICAgICAgICAgIGlmIChMT0NBTF9ERUJVRykgTG9nLmQoTE9HX1RBRywgInJlcXVlc3RpbmcgY2FsbCBmb3J3YXJkaW5nIHF1ZXJ5LiIpOwogICAgICAgICAgICAgTWVzc2FnZSByZXNwOwogICAgICAgICAgICAgaWYgKGNvbW1hbmRJbnRlcmZhY2VDRlJlYXNvbiA9PSBDRl9SRUFTT05fVU5DT05ESVRJT05BTCkgewotICAgICAgICAgICAgICAgIHJlc3AgPSBoLm9idGFpbk1lc3NhZ2UoRVZFTlRfR0VUX0NBTExfRk9SV0FSRF9ET05FLCBvbkNvbXBsZXRlKTsKKyAgICAgICAgICAgICAgICByZXNwID0gb2J0YWluTWVzc2FnZShFVkVOVF9HRVRfQ0FMTF9GT1JXQVJEX0RPTkUsIG9uQ29tcGxldGUpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICByZXNwID0gb25Db21wbGV0ZTsKICAgICAgICAgICAgIH0KQEAgLTk4Myw3ICs5NTksNyBAQAogCiAgICAgICAgICAgICBNZXNzYWdlIHJlc3A7CiAgICAgICAgICAgICBpZiAoY29tbWFuZEludGVyZmFjZUNGUmVhc29uID09IENGX1JFQVNPTl9VTkNPTkRJVElPTkFMKSB7Ci0gICAgICAgICAgICAgICAgcmVzcCA9IGgub2J0YWluTWVzc2FnZShFVkVOVF9TRVRfQ0FMTF9GT1JXQVJEX0RPTkUsCisgICAgICAgICAgICAgICAgcmVzcCA9IG9idGFpbk1lc3NhZ2UoRVZFTlRfU0VUX0NBTExfRk9SV0FSRF9ET05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sZXIoTG9vcGVyIGwpIHsKLSAgICAgICAgICAgIHN1cGVyKGwpOwotICAgICAgICB9CisgICAgICAgICAgICAgICAgbUNNLmdldElNRUkob2J0YWluTWVzc2FnZShFVkVOVF9HRVRfSU1FSV9ET05FKSk7CisgICAgICAgICAgICAgICAgbUNNLmdldElNRUlTVihvYnRhaW5NZXNzYWdlKEVWRU5UX0dFVF9JTUVJU1ZfRE9ORSkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgcHVibGljIHZvaWQKLSAgICAgICAgaGFuZGxlTWVzc2FnZSAoTWVzc2FnZSBtc2cpIHsKLSAgICAgICAgICAgIEFzeW5jUmVzdWx0IGFyOwotICAgICAgICAgICAgTWVzc2FnZSBvbkNvbXBsZXRlOworICAgICAgICAgICAgY2FzZSBFVkVOVF9SQURJT19PTjoKKyAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7Ci0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9SQURJT19BVkFJTEFCTEU6IHsKLSAgICAgICAgICAgICAgICAgICAgbUNNLmdldEJhc2ViYW5kVmVyc2lvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYnRhaW5NZXNzYWdlKEVWRU5UX0dFVF9CQVNFQkFORF9WRVJTSU9OX0RPTkUpKTsKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfUkVHSVNURVJFRF9UT19ORVRXT1JLOgorICAgICAgICAgICAgICAgIHN5bmNDbGlyU2V0dGluZygpOworICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgICAgIG1DTS5nZXRJTUVJKG9idGFpbk1lc3NhZ2UoRVZFTlRfR0VUX0lNRUlfRE9ORSkpOwotICAgICAgICAgICAgICAgICAgICBtQ00uZ2V0SU1FSVNWKG9idGFpbk1lc3NhZ2UoRVZFTlRfR0VUX0lNRUlTVl9ET05FKSk7CisgICAgICAgICAgICBjYXNlIEVWRU5UX1NJTV9SRUNPUkRTX0xPQURFRDoKKyAgICAgICAgICAgICAgICB1cGRhdGVDdXJyZW50Q2FycmllckluUHJvdmlkZXIoKTsKKworICAgICAgICAgICAgICAgIC8vIENoZWNrIGlmIHRoaXMgaXMgYSBkaWZmZXJlbnQgU0lNIHRoYW4gdGhlIHByZXZpb3VzIG9uZS4gSWYgc28gdW5zZXQgdGhlCisgICAgICAgICAgICAgICAgLy8gdm9pY2UgbWFpbCBudW1iZXIuCisgICAgICAgICAgICAgICAgU3RyaW5nIGltc2kgPSBnZXRWbVNpbUltc2koKTsKKyAgICAgICAgICAgICAgICBpZiAoaW1zaSAhPSBudWxsICYmICFnZXRTdWJzY3JpYmVySWQoKS5lcXVhbHMoaW1zaSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RvcmVWb2ljZU1haWxOdW1iZXIobnVsbCk7CisgICAgICAgICAgICAgICAgICAgIHNldFZtU2ltSW1zaShudWxsKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEVWRU5UX0dFVF9CQVNFQkFORF9WRVJTSU9OX0RPTkU6CisgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKKworICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoTE9DQUxfREVCVUcpIExvZy5kKExPR19UQUcsICJCYXNlYmFuZCB2ZXJzaW9uOiAiICsgYXIucmVzdWx0KTsKKyAgICAgICAgICAgICAgICBzZXRTeXN0ZW1Qcm9wZXJ0eShQUk9QRVJUWV9CQVNFQkFORF9WRVJTSU9OLCAoU3RyaW5nKWFyLnJlc3VsdCk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfSU1FSV9ET05FOgorICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7CisKKyAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbUltZWkgPSAoU3RyaW5nKWFyLnJlc3VsdDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEVWRU5UX0dFVF9JTUVJU1ZfRE9ORToKKyAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworCisgICAgICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIG1JbWVpU3YgPSAoU3RyaW5nKWFyLnJlc3VsdDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEVWRU5UX1VTU0Q6CisgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKKworICAgICAgICAgICAgICAgIFN0cmluZ1tdIHVzc2RSZXN1bHQgPSAoU3RyaW5nW10pIGFyLnJlc3VsdDsKKworICAgICAgICAgICAgICAgIGlmICh1c3NkUmVzdWx0Lmxlbmd0aCA+IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uSW5jb21pbmdVU1NEKEludGVnZXIucGFyc2VJbnQodXNzZFJlc3VsdFswXSksIHVzc2RSZXN1bHRbMV0pOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgImVycm9yIHBhcnNpbmcgVVNTRCIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fT0ZGX09SX05PVF9BVkFJTEFCTEU6CisgICAgICAgICAgICAgICAgLy8gU29tZSBNTUkgcmVxdWVzdHMgKGVnIFVTU0QpIGFyZSBub3QgY29tcGxldGVkCisgICAgICAgICAgICAgICAgLy8gd2l0aGluIHRoZSBjb3Vyc2Ugb2YgYSBDb21tYW5kc0ludGVyZmFjZSByZXF1ZXN0CisgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHJhZGlvIHNodXRzIG9mZiBvciByZXNldHMgd2hpbGUgb25lIG9mIHRoZXNlCisgICAgICAgICAgICAgICAgLy8gaXMgcGVuZGluZywgd2UgbmVlZCB0byBjbGVhbiB1cC4KKworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwLCBzID0gbVBlbmRpbmdNTUlzLnNpemUoKSA7IGkgPCBzOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1QZW5kaW5nTU1Jcy5nZXQoaSkuaXNQZW5kaW5nVVNTRCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUGVuZGluZ01NSXMuZ2V0KGkpLm9uVXNzZEZpbmlzaGVkRXJyb3IoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEVWRU5UX1NTTjoKKyAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgICAgIFN1cHBTZXJ2aWNlTm90aWZpY2F0aW9uIG5vdCA9IChTdXBwU2VydmljZU5vdGlmaWNhdGlvbikgYXIucmVzdWx0OworICAgICAgICAgICAgICAgIG1Tc25SZWdpc3RyYW50cy5ub3RpZnlSZWdpc3RyYW50cyhhcik7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBFVkVOVF9TRVRfQ0FMTF9GT1JXQVJEX0RPTkU6CisgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKKyAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVNJTVJlY29yZHMuc2V0Vm9pY2VDYWxsRm9yd2FyZGluZ0ZsYWcoMSwgbXNnLmFyZzEgPT0gMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG9uQ29tcGxldGUgPSAoTWVzc2FnZSkgYXIudXNlck9iajsKKyAgICAgICAgICAgICAgICBpZiAob25Db21wbGV0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2Uob25Db21wbGV0ZSwgYXIucmVzdWx0LCBhci5leGNlcHRpb24pOworICAgICAgICAgICAgICAgICAgICBvbkNvbXBsZXRlLnNlbmRUb1RhcmdldCgpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fT046CisgICAgICAgICAgICBjYXNlIEVWRU5UX1NFVF9WTV9OVU1CRVJfRE9ORToKKyAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgICAgIGlmIChJY2NWbU5vdFN1cHBvcnRlZEV4Y2VwdGlvbi5jbGFzcy5pc0luc3RhbmNlKGFyLmV4Y2VwdGlvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RvcmVWb2ljZU1haWxOdW1iZXIobVZtTnVtYmVyKTsKKyAgICAgICAgICAgICAgICAgICAgYXIuZXhjZXB0aW9uID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgb25Db21wbGV0ZSA9IChNZXNzYWdlKSBhci51c2VyT2JqOworICAgICAgICAgICAgICAgIGlmIChvbkNvbXBsZXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZShvbkNvbXBsZXRlLCBhci5yZXN1bHQsIGFyLmV4Y2VwdGlvbik7CisgICAgICAgICAgICAgICAgICAgIG9uQ29tcGxldGUuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9SRUdJU1RFUkVEX1RPX05FVFdPUks6Ci0gICAgICAgICAgICAgICAgICAgIHN5bmNDbGlyU2V0dGluZygpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfU0lNX1JFQ09SRFNfTE9BREVEOgotICAgICAgICAgICAgICAgICAgICB1cGRhdGVDdXJyZW50Q2FycmllckluUHJvdmlkZXIoKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayBpZiB0aGlzIGlzIGEgZGlmZmVyZW50IFNJTSB0aGFuIHRoZSBwcmV2aW91cyBvbmUuIElmIHNvIHVuc2V0IHRoZQotICAgICAgICAgICAgICAgICAgICAvLyB2b2ljZSBtYWlsIG51bWJlci4KLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGltc2kgPSBnZXRWbVNpbUltc2koKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGltc2kgIT0gbnVsbCAmJiAhZ2V0U3Vic2NyaWJlcklkKCkuZXF1YWxzKGltc2kpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdG9yZVZvaWNlTWFpbE51bWJlcihudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldFZtU2ltSW1zaShudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCisgICAgICAgICAgICBjYXNlIEVWRU5UX0dFVF9DQUxMX0ZPUldBUkRfRE9ORToKKyAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBoYW5kbGVDZnVRdWVyeVJlc3VsdCgoQ2FsbEZvcndhcmRJbmZvW10pYXIucmVzdWx0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgb25Db21wbGV0ZSA9IChNZXNzYWdlKSBhci51c2VyT2JqOworICAgICAgICAgICAgICAgIGlmIChvbkNvbXBsZXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZShvbkNvbXBsZXRlLCBhci5yZXN1bHQsIGFyLmV4Y2VwdGlvbik7CisgICAgICAgICAgICAgICAgICAgIG9uQ29tcGxldGUuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfQkFTRUJBTkRfVkVSU0lPTl9ET05FOgotICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfREVCVUcpIExvZy5kKExPR19UQUcsICJCYXNlYmFuZCB2ZXJzaW9uOiAiICsgYXIucmVzdWx0KTsKLSAgICAgICAgICAgICAgICAgICAgc2V0U3lzdGVtUHJvcGVydHkoUFJPUEVSVFlfQkFTRUJBTkRfVkVSU0lPTiwgKFN0cmluZylhci5yZXN1bHQpOworICAgICAgICAgICAgLy8gaGFuZGxlIHRoZSBzZWxlY3QgbmV0d29yayBjb21wbGV0aW9uIGNhbGxiYWNrcy4KKyAgICAgICAgICAgIGNhc2UgRVZFTlRfU0VUX05FVFdPUktfTUFOVUFMX0NPTVBMRVRFOgorICAgICAgICAgICAgY2FzZSBFVkVOVF9TRVRfTkVUV09SS19BVVRPTUFUSUNfQ09NUExFVEU6CisgICAgICAgICAgICAgICAgaGFuZGxlU2V0U2VsZWN0TmV0d29yaygoQXN5bmNSZXN1bHQpIG1zZy5vYmopOwogICAgICAgICAgICAgICAgIGJyZWFrOwogCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfSU1FSV9ET05FOgotICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBtSW1laSA9IChTdHJpbmcpYXIucmVzdWx0OworICAgICAgICAgICAgY2FzZSBFVkVOVF9TRVRfQ0xJUl9DT01QTEVURToKKyAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzYXZlQ2xpclNldHRpbmcobXNnLmFyZzEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvbkNvbXBsZXRlID0gKE1lc3NhZ2UpIGFyLnVzZXJPYmo7CisgICAgICAgICAgICAgICAgaWYgKG9uQ29tcGxldGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBBc3luY1Jlc3VsdC5mb3JNZXNzYWdlKG9uQ29tcGxldGUsIGFyLnJlc3VsdCwgYXIuZXhjZXB0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgb25Db21wbGV0ZS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX0dFVF9JTUVJU1ZfRE9ORToKLSAgICAgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgbUltZWlTdiA9IChTdHJpbmcpYXIucmVzdWx0OwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9VU1NEOgotICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotCi0gICAgICAgICAgICAgICAgICAgIFN0cmluZ1tdIHVzc2RSZXN1bHQgPSAoU3RyaW5nW10pIGFyLnJlc3VsdDsKLQotICAgICAgICAgICAgICAgICAgICBpZiAodXNzZFJlc3VsdC5sZW5ndGggPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uSW5jb21pbmdVU1NEKEludGVnZXIucGFyc2VJbnQodXNzZFJlc3VsdFswXSksIHVzc2RSZXN1bHRbMV0pOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiZXJyb3IgcGFyc2luZyBVU1NEIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUkFESU9fT0ZGX09SX05PVF9BVkFJTEFCTEU6Ci0gICAgICAgICAgICAgICAgICAgIC8vIFNvbWUgTU1JIHJlcXVlc3RzIChlZyBVU1NEKSBhcmUgbm90IGNvbXBsZXRlZAotICAgICAgICAgICAgICAgICAgICAvLyB3aXRoaW4gdGhlIGNvdXJzZSBvZiBhIENvbW1hbmRzSW50ZXJmYWNlIHJlcXVlc3QKLSAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHJhZGlvIHNodXRzIG9mZiBvciByZXNldHMgd2hpbGUgb25lIG9mIHRoZXNlCi0gICAgICAgICAgICAgICAgICAgIC8vIGlzIHBlbmRpbmcsIHdlIG5lZWQgdG8gY2xlYW4gdXAuCi0KLSAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDAsIHMgPSBtUGVuZGluZ01NSXMuc2l6ZSgpIDsgaSA8IHM7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1QZW5kaW5nTU1Jcy5nZXQoaSkuaXNQZW5kaW5nVVNTRCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdNTUlzLmdldChpKS5vblVzc2RGaW5pc2hlZEVycm9yKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfU1NOOgotICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgICAgICBTdXBwU2VydmljZU5vdGlmaWNhdGlvbiBub3QgPSAoU3VwcFNlcnZpY2VOb3RpZmljYXRpb24pIGFyLnJlc3VsdDsKLSAgICAgICAgICAgICAgICAgICAgbVNzblJlZ2lzdHJhbnRzLm5vdGlmeVJlZ2lzdHJhbnRzKGFyKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfU0VUX0NBTExfRk9SV0FSRF9ET05FOgotICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TSU1SZWNvcmRzLnNldFZvaWNlQ2FsbEZvcndhcmRpbmdGbGFnKDEsIG1zZy5hcmcxID09IDEpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG9uQ29tcGxldGUgPSAoTWVzc2FnZSkgYXIudXNlck9iajsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG9uQ29tcGxldGUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZShvbkNvbXBsZXRlLCBhci5yZXN1bHQsIGFyLmV4Y2VwdGlvbik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvbkNvbXBsZXRlLnNlbmRUb1RhcmdldCgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9TRVRfVk1fTlVNQkVSX0RPTkU6Ci0gICAgICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChJY2NWbU5vdFN1cHBvcnRlZEV4Y2VwdGlvbi5jbGFzcy5pc0luc3RhbmNlKGFyLmV4Y2VwdGlvbikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlVm9pY2VNYWlsTnVtYmVyKG1WbU51bWJlcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhci5leGNlcHRpb24gPSBudWxsOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG9uQ29tcGxldGUgPSAoTWVzc2FnZSkgYXIudXNlck9iajsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG9uQ29tcGxldGUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZShvbkNvbXBsZXRlLCBhci5yZXN1bHQsIGFyLmV4Y2VwdGlvbik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvbkNvbXBsZXRlLnNlbmRUb1RhcmdldCgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0KLSAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX0dFVF9DQUxMX0ZPUldBUkRfRE9ORToKLSAgICAgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVDZnVRdWVyeVJlc3VsdCgoQ2FsbEZvcndhcmRJbmZvW10pYXIucmVzdWx0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBvbkNvbXBsZXRlID0gKE1lc3NhZ2UpIGFyLnVzZXJPYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChvbkNvbXBsZXRlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2Uob25Db21wbGV0ZSwgYXIucmVzdWx0LCBhci5leGNlcHRpb24pOwotICAgICAgICAgICAgICAgICAgICAgICAgb25Db21wbGV0ZS5zZW5kVG9UYXJnZXQoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0FMTF9SSU5HOgotICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeUluY29taW5nUmluZygpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgLy8gaGFuZGxlIHRoZSBzZWxlY3QgbmV0d29yayBjb21wbGV0aW9uIGNhbGxiYWNrcy4KLSAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX1NFVF9ORVRXT1JLX01BTlVBTF9DT01QTEVURToKLSAgICAgICAgICAgICAgICBjYXNlIEVWRU5UX1NFVF9ORVRXT1JLX0FVVE9NQVRJQ19DT01QTEVURToKLSAgICAgICAgICAgICAgICAgICAgaGFuZGxlU2V0U2VsZWN0TmV0d29yaygoQXN5bmNSZXN1bHQpIG1zZy5vYmopOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfU0VUX0NMSVJfQ09NUExFVEU6Ci0gICAgICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUNsaXJTZXR0aW5nKG1zZy5hcmcxKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBvbkNvbXBsZXRlID0gKE1lc3NhZ2UpIGFyLnVzZXJPYmo7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChvbkNvbXBsZXRlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2Uob25Db21wbGV0ZSwgYXIucmVzdWx0LCBhci5leGNlcHRpb24pOwotICAgICAgICAgICAgICAgICAgICAgICAgb25Db21wbGV0ZS5zZW5kVG9UYXJnZXQoKTs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Tik7Ci0gICAgICAgICAgICAgICAgICAgIG1zZy5hcmcxID0gMTsgLy8gdGVhckRvd24gaXMgdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgbXNnLm9iaiA9IFBob25lLlJFQVNPTl9EQVRBX0RJU0FCTEVEOwotICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShtc2cpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfU1RBUlRFRDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogTm90ZSB0aGF0IGlmIGRlZmF1bHQgZGF0YSBpcyBkaXNhYmxlZCwgdGhlIGZvbGxvd2luZwotICAgICAgICAgICAgICAgICAqIGhhcyB0aGUgZWZmZWN0IG9mIGRpc2FibGluZyB0aGUgTU1TIEFQTiwgYW5kIHRoZW4KLSAgICAgICAgICAgICAgICAgKiBpZ25vcmluZyB0aGUgcmVxdWVzdCB0byBlbmFibGUgdGhlIGRlZmF1bHQgQVBOLgotICAgICAgICAgICAgICAgICAqIFRoZSBuZXQgcmVzdWx0IGlzIHRoYXQgZGF0YSBpcyBjb21wbGV0ZWx5IGRpc2FibGVkLgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlKG9idGFpbk1lc3NhZ2UoRVZFTlRfUkVTVE9SRV9ERUZBVUxUX0FQTikpOwotICAgICAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fUkVRVUVTVF9TVEFSVEVEOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIFBob25lLkFQTl9SRVFVRVNUX0ZBSUxFRDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgogICAgICAqIFRoZSBkYXRhIGNvbm5lY3Rpb24gaXMgZXhwZWN0ZWQgdG8gYmUgc2V0dXAgd2h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ogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgbG9nICgiU2V0dXAgd2F0aW5nQXBucyA6ICIgKyBhcG5MaXN0VG9TdHJpbmcod2FpdGluZ0FwbnMpKTsKKyAgICAgICAgICAgICAgICBsb2cgKCJTZXR1cCB3YWl0bmdBcG5zIDogIiArIGFwbkxpc3RUb1N0cmluZyh3YWl0aW5nQXBucykpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIHNldHVwRGF0YShyZWFzb24pOwogICAgICAgICB9IGVsc2UgewpAQCAtNjE4LDYgKzQ1Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgICIgc2ltPSIgKyBtR3NtUGhvbmUubVNJTVJlY29yZHMuZ2V0UmVjb3Jkc0xvYWRlZCgpICsKICAgICAgICAgICAgICAgICAgICAgIiBVTVRTPSIgKyBtR3NtUGhvbmUubVNTVC5pc0NvbmN1cnJlbnRWb2ljZUFuZERhdGEoKSArCiAgICAgICAgICAgICAgICAgICAgICIgcGhvbmVTdGF0ZT0iICsgcGhvbmUuZ2V0U3RhdGUoKSArCisgICAgICAgICAgICAgICAgICAgICIgaXNEYXRhQWxsb3dlZD0iICsgaXNEYXRhQWxsb3dlZCgpICsKICAgICAgICAgICAgICAgICAgICAgIiBkYXRhRW5hYmxlZD0iICsgZ2V0QW55RGF0YUVuYWJsZWQoKSArCiAgICAgICAgICAgICAgICAgICAgICIgcm9hbWluZz0iICsgcm9hbWluZyArCiAgICAgICAgICAgICAgICAgICAgICIgZGF0YU9uUm9hbWluZ0VuYWJsZT0iICsgZ2V0RGF0YU9uUm9hbWluZ0VuYWJsZWQoKSArCkBAIC03NDIsNyArNTgyLDcgQEAKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCi0gICAgU3RyaW5nIGdldEludGVyZmFjZU5hbWUoU3RyaW5nIGFwblR5cGUpIHsKKyAgICBwcm90ZWN0ZWQgU3RyaW5nIGdldEludG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ZBSUxFRCkgewotICAgICAgICAgICAgaWYgKG5leHRSZWNvbm5lY3REZWxheSA+IFJFQ09OTkVDVF9ERUxBWV9NQVhfTUlMTElTKSB7CisgICAgICAgICAgICBpZiAoIW1SZXRyeU1nci5pc1JldHJ5TmVlZGVkKCkpIHsKICAgICAgICAgICAgICAgICBpZiAobVJlcmVnaXN0ZXJPblJlY29ubmVjdEZhaWx1cmUpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2UgaGF2ZSBhbHJlYWR5IHRyaWVkIHRvIHJlLXJlZ2lzdGVyIHRvIHRoZSBuZXR3b3JrLgotICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIG1pZ2h0IGJlIGEgcHJvYmxlbSB3aXRoIHRoZSBkYXRhIG5ldHdvcmsuCi0gICAgICAgICAgICAgICAgICAgIG5leHRSZWNvbm5lY3REZWxheSA9IFJFQ09OTkVDVF9ERUxBWV9NQVhfTUlMTElTOworICAgICAgICAgICAgICAgICAgICAvLyBXZSd2ZSByZS1yZWdpc3RlcmQgb25jZSBub3cganVzdCByZXRyeSBmb3JldmVyLgorICAgICAgICAgICAgICAgICAgICBtUmV0cnlNZ3IucmV0cnlGb3JldmVyVXNpbmdMYXN0VGltZW91dCgpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFRyeSB0byBSZS1yZWdpc3RlciB0byB0aGUgbmV0d29yay4KKyAgICAgICAgICAgICAgICAgICAgLy8gVHJ5IHRvIHJlLXJlZ2lzdGVyIHRvIHRoZSBuZXR3b3JrLgogICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiUERQIGFjdGl2YXRlIGZhaWxlZCwgUmVyZWdpc3RlcmluZyB0byB0aGUgbmV0d29yayIpOwogICAgICAgICAgICAgICAgICAgICBtUmVyZWdpc3Rlck9uUmVjb25uZWN0RmFpbHVyZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIG1Hc21QaG9uZS5tU1NULnJlUmVnaXN0ZXJOZXR3b3JrKG51bGwpOwotICAgICAgICAgICAgICAgICAgICBuZXh0UmVjb25uZWN0RGVsYXkgPSBSRUNPTk5FQ1RfREVMQVlfSU5JVElBTF9NSUxMSVM7CisgICAgICAgICAgICAgICAgICAgIG1SZXRyeU1nci5yZXNldFJldHJ5Q291bnQoKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IG5leHRSZWNvbm5lY3REZWxheSA9IG1SZXRyeU1nci5nZXRSZXRyeVRpbWVyKCk7CiAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiUERQIGFjdGl2YXRlIGZhaWxlZC4gU2NoZWR1bGluZyBuZXh0IGF0dGVtcHQgZm9yICIKICAgICAgICAgICAgICAgICAgICAgKyAobmV4dFJlY29ubmVjdERlbGF5IC8gMTAwMCkgKyAicyIpOwogCkBAIC0xMjA2LDggKzEwNDYsNyBAQAogICAgICAgICAgICAgICAgICAgICBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKSArIG5leHRSZWNvbm5lY3REZWxheSwKICAgICAgICAgICAgICAgICAgICAgbVJlY29ubmVjdEludGVudCk7CiAKLSAgICAgICAgICAgIC8vIGRvdWJsZSBpdCBmb3IgbmV4dCB0aW1lCi0gICAgICAgICAgICBuZXh0UmVjb25uZWN0RGVsYXkgKj0gMjsKKyAgICAgICAgICAgIG1SZXRyeU1nci5pbmNyZWFzZVJldHJ5Q291bnQoKTsKIAogICAgICAgICAgICAgaWYgKCFzaG91bGRQb3N0Tm90aWZpY2F0aW9uKGxhc3RGYWlsQ2F1c2VDb2RlKSkgewogICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsIk5PVCBQb3N0aW5nIEdQUlMgVW5hdmFpbGFibGUgbm90aWZpY2F0aW9uICIKQEAgLTEyMzYsMTcgKzEwNzUsOCBAQAogICAgICAgICBjbGVhblVwQ29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ICAqLwotICAgICAgICAgICAgaWYgKGRhdGFFbmFibGVkW0FQTl9NTVNfSURdIHx8IGRhdGFFbmFibGVkW0FQTl9TVVBMX0lEXSkgewotICAgICAgICAgICAgICAgIHJlbW92ZU1lc3NhZ2VzKEVWRU5UX1JFU1RPUkVfREVGQVVMVF9BUE4pOwotICAgICAgICAgICAgICAgIHNlbmRNZXNzYWdlRGVsYXllZChvYnRhaW5NZXNzYWdlKEVWRU5UX1JFU1RPUkVfREVGQVVMVF9BUE4pLAotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0UmVzdG9yZURlZmF1bHRBcG5EZWxheSgpKTsKLSAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChpc0FwblR5cGVBY3RpdmUoUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkpIHsKICAgICAgICAgICAgICAgICBTeXN0ZW1Qcm9wZXJ0aWVzLnNldCgiZ3NtLmRlZmF1bHRwZHBjb250ZXh0LmFjdGl2ZSIsICJ0cnVlIik7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FuU2V0UHJlZmVyQXBuICYmIHByZWZlcnJlZEFwbiA9PSBudWxsKSB7CkBAIC0xMzg3LDggKzEyMDEsNyBAQAogICAgICAgICAgICAgICAgIHNldFN0YXRlKFN0YXRlLlNDQU5OSU5HKTsKICAgICAgICAgICAgICAgICAvLyBXYWl0IGEgYml0IGJlZm9yZSB0cnlpbmcgdGhlIG5leHQgQVBOLCBzbyB0aGF0CiAgICAgICAgICAgICAgICAgLy8gd2UncmUgbm90IHR5aW5nIHVwIHRoZSBSSUwgY29tbWFuZCBjaGFubmVsCi0gICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2VEZWxheWVkKG9idGFpbk1lc3NhZ2UoRVZFTlRfVFJZX1NFVFVQX0RBVEEsIHJlYXNvbiksCi0gICAgICAgICAgICAgICAgICAgICAgICBSRUNPTk5FQ1RfREVMQVlfSU5JVElBTF9NSUxMSVMpOworICAgICAgICAgICAgICAgIHN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RGF0YUNvbm5UcmFjayBoYW5kbGVNZXNzYWdlICIrbXNnKTsKICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgewogICAgICAgICAgICAgY2FzZSBFVkVOVF9SRUNPUkRTX0xPQURFRDoKICAgICAgICAgICAgICAgICBvblJlY29yZHNMb2FkZWQoKTsKQEAgLTE2NDgsMTAgKzE0NDYsNiBAQAogICAgICAgICAgICAgICAgIG9uRW5hYmxlTmV3QXBuKCk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfUkVTVE9SRV9ERUZBVUxUX0FQTjoKLSAgICAgICAgICAgICAgICBvblJlc3RvcmVEZWZhdWx0QXBuKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KICAgICAgICAgICAgIGNhc2UgRVZFTlRfR1BSU19ERVRBQ0hFRDoKICAgICAgICAgICAgICAgICBvbkdwcnNEZXRhY2hlZCgpOwogICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTcxMCw3ICsxNTA0LDcgQEAKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gU3RhdGUuRkFJTEVEKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhblVwQ29ubmVjdGlvbihmYWxzZSwgUGhvbmUuUkVBU09OX1BTX1JFU1RSSUNUX0VOQUJMRUQpOwotICAgICAgICAgICAgICAgICAgICAgICAgbmV4dFJlY29ubmVjdERlbGF5ID0gUkVDT05ORUNUX0RFTEFZX0lOSVRJQUxfTUlMTElTOworICAgICAgICAgICAgICAgICAgICAgICAgbVJldHJ5TWdyLnJlc2V0UmV0cnlDb3VudCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgbVJlcmVnaXN0ZXJPblJlY29ubmVjdEZhaWx1cmUgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB0cnlTZXR1cERhdGEoU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G9sbFN0YXRlUmVzdWx0IChpbnQgd2hhdCwgQXN5bmNSZXN1bHQgYXIpIHsKKyAgICBwcm90ZWN0ZWQgdm9pZCBoYW5kbGVQb2xsU3RhdGVSZXN1bHQgKGludCB3aGF0LCBBc3luY1Jlc3VsdCBhcikgewogICAgICAgICBpbnQgaW50c1tdOwogICAgICAgICBTdHJpbmcgc3RhdGVzW107CiAKQEAgLTY3NSw2ICs2NjMsNyBAQAogICAgICAgICAgICAgICAgICAgICBuZXdHUFJTU3RhdGUgPSByZWdDb2RlVG9TZXJ2aWNlU3RhdGUocmVnU3RhdGUpOwogICAgICAgICAgICAgICAgICAgICBuZXdEYXRhUm9hbWluZyA9IHJlZ0NvZGVJc1JvYW1pbmcocmVnU3RhdGUpOwogICAgICAgICAgICAgICAgICAgICBuZXdOZXR3b3JrVHlwZSA9IHR5cGU7CisgICAgICAgICAgICAgICAgICAgIG5ld1NTLnNldFJhZGlvVGVjaG5vbG9neSh0eXBlKTsKICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfUE9MTF9TVEFURV9PUEVSQVRPUjoKQEAgLTcyMyw5ICs3MTIsNyBAQAogICAgICAqIGFuZCBzdGFydCBvdmVyIGFnYWluIGlmIHRoZSByYWRpbyBub3RpZmllcyB1cyB0aGF0IHNvbWUKICAgICAgKiBldmVudCBoYXMgY2hhbmdlZAogICAgICAqLwotCi0gICAgcHJpdmF0ZSB2b2lkCi0gICAgcG9sbFN0YXRlKCkgeworICAgIHByaXZhdGUgdm9pZCBwb2xsU3RhdGUoKSB7CiAgICAgICAgIHBvbGxpbmdDb250ZXh0ID0gbmV3IGludFsxXTsKICAgICAgICAgcG9sbGluZ0NvbnRleHRbMF0gPSAwOwogCkBAIC04MDgsNiArNzk1LDE1IEBACiAgICAgICAgICAgICBjYXNlIERBVEFfQUNDRVNTX1VNVFM6CiAgICAgICAgICAgICAgICAgcmV0ID0gIlVNVFMiOwogICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBEQVRBX0FDQ0VTU19IU0RQQToKKyAgICAgICAgICAgICAgICByZXQgPSAiSFNEUEEiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBEQVRBX0FDQ0VTU19IU1VQQToKKyAgICAgICAgICAgICAgICByZXQgPSAiSFNVUEEiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBEQVRBX0FDQ0VTU19IU1BBOgorICAgICAgICAgICAgICAgIHJldCA9ICJIU1BBIjsKKyAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIldyb25nIG5ldHdvcmsgdHlwZTogIiArIEludGVnZXIudG9TdHJpbmcodHlwZSkpOwogICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtODE2LDggKzgxMiw3IEBACiAgICAgICAgIHJldHVybiByZXQ7CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkCi0gICAgcG9sbFN0YXRlRG9uZSgpIHsKKyAgICBwcml2YXRlIHZvaWQgcG9sbFN0YXRlRG9uZSgpIHsKICAgICAgICAgaWYgKERCRykgewogICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIlBvbGwgU2VydmljZVN0YXRlIGRvbmU6ICIgKwogICAgICAgICAgICAgICAgICIgb2xkU1M9WyIgKyBzcyArICJdIG5ld1NTPVsiICsgbmV3U1MgKwpAQCAtODcwLDcgKzg2NSw3IEBACiAgICAgICAgIG5ld1NTLnNldFN0YXRlT3V0T2ZTZXJ2aWNlKCk7IC8vIGNsZWFuIHNsYXRlIGZvciBuZXh0IHRpbWUKIAogICAgICAgICBpZiAoaGFzTmV0d29ya1R5cGVDaGFuZ2VkKSB7Ci0gICAgICAgICAgICBwaG9uZS5zZXRTeXN0ZW1Qcm9wZXJ0eShQUk9QRVJUWV9EQVRBX05FVFdPUktfVFl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XBob255UHJvcGVydGllcy5QUk9QRVJUWV9PUEVSQVRPUl9JU09fQ09VTlRSWSwgIiIpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBTdHJpbmcgaXNvID0gIiI7CiAgICAgICAgICAgICAgICAgdHJ5ewpAQCAtOTAyLDcgKzg5Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJjb3VudHJ5Q29kZUZvck1jYyBlcnJvciIgKyBleCk7CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgcGhvbmUuc2V0U3lzdGVtUHJvcGVydHkoUFJPUEVSVFlfT1BFUkFUT1JfSVNPX0NPVU5UUlksIGlzbyk7CisgICAgICAgICAgICAgICAgcGhvbmUuc2V0U3lzdGVtUHJvcGVydHkoVGVsZXBob255UHJvcGVydGllcy5QUk9QRVJUWV9PUEVSQVRPUl9JU09fQ09VTlRSWSwgaXNvKTsKICAgICAgICAgICAgICAgICBtR290Q291bnRyeUNvZGUgPSB0cnVlOwogCiAgICAgICAgICAgICAgICAgaWYgKG1OZWVkRml4Wm9uZSkgewpAQCAtOTQ1LDcgKzk0MCw3IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBwaG9uZS5zZXRTeXN0ZW1Qcm9wZXJ0eShQUk9QRVJUWV9PUEVSQVRPUl9JU1JPQU1JTkcsCisgICAgICAgICAgICBwaG9uZS5zZXRTeXN0ZW1Qcm9wZXJ0eShUZWxlcGhvbnlQcm9wZXJ0aWVzLlBST1BFUlRZX09QRVJBVE9SX0lTUk9BTUlORywKICAgICAgICAgICAgICAgICBzcy5nZXRSb2FtaW5nKCkgPyAidHJ1ZSIgOiAiZmFsc2UiKTsKIAogICAgICAgICAgICAgdXBkYXRlU3BuRGlzcGxheSgpOwpAQCAtMTA0MCw4ICsxMDM1LDcgQEAKICAgICAgICAgcmV0dXJuIGd1ZXNzOwogICAgIH0KIAotICAgIHBy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QotICAgIHsKKyAgICBwcml2YXRlIHZvaWQgb25SZXN0cmljdGVkU3RhdGVDaGFuZ2VkKEFzeW5jUmVzdWx0IGFyKSB7CiAgICAgICAgIExvZy5kKExPR19UQUcsICJbRFNBQyBERUJdICIgKyAib25SZXN0cmljdGVkU3RhdGVDaGFuZ2VkIik7CiAgICAgICAgIFJlc3RyaWN0ZWRTdGF0ZSBuZXdScyA9IG5ldyBSZXN0cmljdGVkU3RhdGUoKTsKIApAQCAtMTE5NSw4ICsxMTg3LDcgQEAKICAgICB9CiAKICAgICAvKiogY29kZSBpcyByZWdpc3RyYXRpb24gc3RhdGUgMC01IGZyb20gVFMgMjcuMDA3IDcuMiAqLwotICAgIHByaXZhdGUgaW50Ci0gICAgcmVnQ29kZVRvU2VydmljZVN0YXRlKGludCBjb2RlKSB7CisgICAgcHJpdmF0ZSBpbnQgcmVnQ29kZVRvU2VydmljZVN0YXRlKGludCBjb2RlKSB7CiAgICAgICAgIHN3aXRjaCAoY29kZSkgewogICAgICAgICAgICAgY2FzZSAwOgogICAgICAgICAgICAgY2FzZSAyOiAvLyAyIGlzICJzZWFyY2hpbmciCkBAIC0xMjIyLDggKzEyMTMsNyBAQAogICAgICAqIGNvZGUgaXMgcmVnaXN0cmF0aW9uIHN0YXRlIDAtNSBmcm9tIFRTIDI3LjAwNyA3LjIKICAgICAgKiByZXR1cm5zIHRydWUgaWYgcmVnaXN0ZXJlZCByb2FtLCBmYWxzZSBvdGhlcndpc2UKICAgICAgKi8KLSAgICBwcml2YXRlIGJvb2xlYW4KLSAgICByZWdDb2RlSXNSb2FtaW5nIChpbnQgY29kZSkgeworICAgIHByaXZhdGUgYm9vbGVhbiByZWdDb2RlSXNSb2FtaW5nIChpbnQgY29kZSkgewogICAgICAgICAvLyA1IGlzICAiaW4gc2VydmljZSAtLSByb2FtIgogICAgICAgICByZXR1cm4gNSA9PSBjb2RlOwogICAgIH0KQEAgLTEyMzUsOSArMTIyNSw4IEBACiAgICAgICogQHBhcmFt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VsbCk7Ci0gICAgICAgIH0KLQotICAgICAgICBNY2NFbnRyeShpbnQgbW5jLCBTdHJpbmcgaXNvLCBpbnQgc21hbGxlc3REaWdpdHNNQ0MsIFN0cmluZyB0aW1lem9uZSwgU3RyaW5nIGxhbmd1YWdlKSB7Ci0gICAgICAgICAgICB0aGlzLm1jYyA9IG1uYzsKLSAgICAgICAgICAgIHRoaXMuaXNvID0gaXNvOwotICAgICAgICAgICAgdGhpcy5zbWFsbGVzdERpZ2l0c01uYyA9IHNtYWxsZXN0RGlnaXRzTUNDOwotICAgICAgICAgICAgdGhpcy50aW1lem9uZSA9IHRpbWV6b25lOwotICAgICAgICAgICAgdGhpcy5sYW5ndWFnZSA9IGxhbmd1YWdlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGludCBjb21wYXJlVG8oTWNjRW50cnkgbykKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIG1jYyAtIG8ubWNjOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBzdGF0aWMgTWNjRW50cnkKLSAgICBlbnRyeUZvck1jYyhpbnQgbWNjKQotICAgIHsKLSAgICAgICAgaW50IGluZGV4OwotCi0gICAgICAgIE1jY0VudHJ5IG07Ci0KLSAgICAgICAgbSA9IG5ldyBNY2NFbnRyeShtY2MsIG51bGwsIDApOwotCi0gICAgICAgIGluZGV4ID0gQ29sbGVjdGlvbnMuYmluYXJ5U2VhcmNoKHRhYmxlLCBtKTsKLQotICAgICAgICBpZiAoaW5kZXggPCAwKSB7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiB0YWJsZS5nZXQoaW5kZXgpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogUmV0dXJucyBhIGRlZmF1bHQgdGltZSB6b25lIElEIGZvciB0aGUgZ2l2ZW4gTUNDLgotICAgICAqIEBwYXJhbSBtY2MgTW9iaWxlIENvdW50cnkgQ29kZQotICAgICAqIEByZXR1cm4gZGVmYXVsdCBUaW1lWm9uZSBJRCwgb3IgbnVsbCBpZiBub3Qgc3BlY2lmaWVkCi0gICAgICovCi0gICAgLyogcGFja2FnZSAqLyBzdGF0aWMgU3RyaW5nIGRlZmF1bHRUaW1lWm9uZUZvck1jYyhpbnQgbWNjKSB7Ci0gICAgICAgIE1jY0VudHJ5IGVudHJ5OwotCi0gICAgICAgIGVudHJ5ID0gZW50cnlGb3JNY2MobWNjKTsKLQotICAgICAgICBpZiAoZW50cnkgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gZW50cnkudGltZXpvbmU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBHaXZlbiBhIEdTTSBNb2JpbGUgQ291bnRyeSBDb2RlLCByZXR1cm5zCi0gICAgICogYW4gSVNPIHR3by1jaGFyYWN0ZXIgY291bnRyeSBjb2RlIGlmIGF2YWlsYWJsZS4KLSAgICAgKiBSZXR1cm5zICIiIGlmIHVuYXZhaWxhYmxlLgotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nCi0gICAgY291bnRyeUNvZGVGb3JNY2MoaW50IG1jYykKLSAgICB7Ci0gICAgICAgIE1jY0VudHJ5IGVudHJ5OwotCi0gICAgICAgIGVudHJ5ID0gZW50cnlGb3JNY2MobWNjKTsKLQotICAgICAgICBpZiAoZW50cnkgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIGVudHJ5LmlzbzsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIEdpdmVuIGEgR1NNIE1vYmlsZSBDb3VudHJ5IENvZGUsIHJldHVybnMKLSAgICAgKiBhbiBJU08gMi0zIGNoYXJhY3RlciBsYW5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1TSSwgbnVsbCk7CiAKLSAgICAgICAgICAgICAgICBpbnQgbWNjID0gSW50ZWdlci5wYXJzZUludChpbXNpLnN1YnN0cmluZygwLCAzKSk7Ci0gICAgICAgICAgICAgICAgc2V0VGltZXpvbmVGcm9tTWNjSWZOZWVkZWQobWNjKTsKLSAgICAgICAgICAgICAgICBzZXRMb2NhbGVGcm9tTWNjSWZOZWVkZWQobWNjKTsKKyAgICAgICAgICAgICAgICBpZiAobW5jTGVuZ3RoID09IFVOS05PV04pIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlIFNJTSBoYXMgdG9sZCB1cyBhbGwgaXQga25vd3MsIGJ1dCBpdCBkaWRuJ3Qga25vdyB0aGUgbW5jIGxlbmd0aC4KKyAgICAgICAgICAgICAgICAgICAgLy8gZ3Vlc3MgdXNpbmcgdGhlIG1jYworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IG1jYyA9IEludGVnZXIucGFyc2VJbnQoaW1zaS5zdWJzdHJpbmcoMCwzKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtbmNMZW5ndGggPSBNY2NUYWJsZS5zbWFsbGVzdERpZ2l0c01jY0Zvck1uYyhtY2MpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbW5jTGVuZ3RoID0gVU5LTk9XTjsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJTSU1SZWNvcmRzOiBDb3JydXB0IElNU0khIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobW5jTGVuZ3RoICE9IFVOS05PV04gJiYgbW5jTGVuZ3RoICE9IFVOSU5JVElBTElaRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gZmluYWxseSBoYXZlIGJvdGggdGhlIGltc2kgYW5kIHRoZSBtbmNMZW5ndGggYW5kIGNhbiBwYXJzZSB0aGUgaW1zaSBwcm9wZXJseQorICAgICAgICAgICAgICAgICAgICBNY2NUYWJsZS51cGRhdGVNY2NNbmNDb25maWd1cmF0aW9uKHBob25lLCBpbXNpLnN1YnN0cmluZygwLCAzICsgbW5jTGVuZ3RoKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICgoR1NNUGhvbmUpIHBob25lKS5tU2ltQ2FyZC5icm9hZGNhc3RJY2NTdGF0ZUNoYW5nZWRJbnRlbnQoCisgICAgICAgICAgICAgICAgICAgICAgICBTaW1DYXJkLklOVEVOVF9WQUxVRV9JQ0NfSU1TSSwgbnVsbCk7CiAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgY2FzZSBFVkVOVF9HRVRfTUJJX0RPTkU6CkBAIC03NTUsMzkgKzcxMyw1OCBAQAogCiAKICAgICAgICAgICAgIGNhc2UgRVZFTlRfR0VUX0FEX0RPTkU6Ci0gICAgICAgICAgICAgICAgaXNSZWNvcmRMb2FkUmVzcG9uc2UgPSB0cnVlOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlzUmVjb3JkTG9hZFJlc3BvbnNlID0gdHJ1ZTsKIAotICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgZGF0YSA9IChieXRlW10pYXIucmVzdWx0OworICAgICAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOworICAgICAgICAgICAgICAgICAgICBkYXRhID0gKGJ5dGVbXSlhci5yZXN1bHQ7CiAKLSAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiRUZfQUQ6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEljY1V0aWxzLmJ5dGVzVG9IZXhTdHJpbmcoZGF0YSkpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChkYXRhLmxlbmd0aCA8IDMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJTSU1SZWNvcmRzOiBDb3JydXB0IEFEIGRhdGEgb24gU0lNIik7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChkYXRhLmxlbmd0aCA9PSAzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiU0lNUmVjb3JkczogTU5DIGxlbmd0aCBub3QgcHJlc2VudCBpbiBFRl9BRCIpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBtbmNMZW5ndGggPSAoaW50KWRhdGFbM10gJiAweGY7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1uY0xlbmd0aCA9PSAweGYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1uY0xlbmd0aCA9IFVOS05PV047CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICBpZiAobW5jTGVuZ3RoID09IFVOS05PV04gfHwgbW5jTGVuZ3RoID09IFVOSU5JVElBTElaRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbXNpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbWNjID0gSW50ZWdlci5wYXJzZUludChpbXNpLnN1YnN0cmluZygwLDMpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbmNMZW5ndGggPSBNY2NUYWJsZS5zbWFsbGVzdERpZ2l0c01jY0Zvck1uYyhtY2MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1uY0xlbmd0aCA9IFVOS05PV047CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJTSU1SZWNvcmRzOiBDb3JydXB0IElNU0khIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbmRpY2F0ZSB3ZSBnb3QgdGhpcyBpbmZvLCBidXQgaXQgZGlkbid0IGNvbnRhaW4gdGhlIGxlbmd0aC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbmNMZW5ndGggPSBVTktOT1dOOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIlNJTVJlY29yZHM6IE1OQyBsZW5ndGggbm90IHByZXNlbnQgaW4gRUZfQUQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoaW1zaSAhPSBudWxsICYmIG1uY0xlbmd0aCAhPSBVTktOT1dOKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBmaW5hbGx5IGhhdmUgYm90aCBpbXNpIGFuZCB0aGUgbGVuZ3RoIG9mIHRoZSBtbmMgYW5kIGNhbiBwYXJzZQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGltc2kgcHJvcGVybHkKKyAgICAgICAgICAgICAgICAgICAgICAgIE1jY1RhYmxlLnVwZGF0ZU1jY01uY0NvbmZpZ3VyYXRpb24ocGhvbmUsIGltc2kuc3Vic3RyaW5nKDAsIDMgKyBtbmNMZW5ndGgpKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFRl9BRDogIiArCi0gICAgICAgICAgICAgICAgICAgIEljY1V0aWxzLmJ5dGVzVG9IZXhTdHJpbmcoZGF0YSkpOwotCi0gICAgICAgICAgICAgICAgaWYgKGRhdGEubGVuZ3RoIDwgMykgewotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiU0lNUmVjb3JkczogQ29ycnVwdCBBRCBkYXRhIG9uIFNJTSIpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoZGF0YS5sZW5ndGggPT0gMykgewotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiU0lNUmVjb3JkczogTU5DIGxlbmd0aCBub3QgcHJlc2VudCBpbiBFRl9BRCIpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtbmNMZW5ndGggPSAoaW50KWRhdGFbM10gJiAweGY7Ci0KLSAgICAgICAgICAgICAgICBpZiAobW5jTGVuZ3RoID09IDB4ZikgewotICAgICAgICAgICAgICAgICAgICAvLyBSZXNldHRpbmcgbW5jTGVuZ3RoIHRvIDAgdG8gaW5kaWNhdGUgdGhhdCBpdCBpcyBub3QKLSAgICAgICAgICAgICAgICAgICAgLy8gaW5pdGlhbGlzZWQKLSAgICAgICAgICAgICAgICAgICAgbW5jTGVuZ3RoID0gMDsKLQotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiU0lNUmVjb3JkczogTU5DIGxlbmd0aCBub3QgcHJlc2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7CisgICAgICAgIG1QaG9uZS5tQ00ucmVnaXN0ZXJGb3JTSU1SZWFkeShtSGFuZGxlciwgRVZFTlRfSUNDX1JFQURZLCBudWxsKTsKICAgICAgICAgdXBkYXRlU3RhdGVQcm9wZXJ0eSgpOwogICAgIH0KIAorICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIGRpc3Bvc2UoKSB7CiAgICAgICAgIC8vVW5yZWdpc3RlciBmb3IgYWxsIGV2ZW50cwotICAgICAgICBwaG9uZS5tQ00udW5yZWdpc3RlckZvclNJTUxvY2tlZE9yQWJzZW50KHRoaXMpOwotICAgICAgICBwaG9uZS5tQ00udW5yZWdpc3RlckZvck9mZk9yTm90QXZhaWxhYmxlKHRoaXMpOwotICAgICAgICBwaG9uZS5tQ00udW5yZWdpc3RlckZvclNJTVJlYWR5KHRoaXMpOworICAgICAgICBtUGhvbmUubUNNLnVucmVnaXN0ZXJGb3JTSU1Mb2NrZWRPckFic2VudChtSGFuZGxlcik7CisgICAgICAgIG1QaG9uZS5tQ00udW5yZWdpc3RlckZvck9mZk9yTm90QXZhaWxhYmxlKG1IYW5kbGVyKTsKKyAgICAgICAgbVBob25lLm1DTS51bnJlZ2lzdGVyRm9yU0lNUmVhZHkobUhhbmRsZXIpOwogICAgIH0KIAotICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgewotICAgICAgICBpZihEQkcpIExvZy5kKExPR19UQUcsICJTaW1DYXJkIGZpbmFsaXplZCIpOwotICAgIH0KLQotICAgIC8vKioqKiogU2ltQ2FyZCBpbXBsZW1lbnRhdGlvbgotCi0gICAgcHVibGljIFN0YXRlCi0gICAgZ2V0U3RhdGUoKSB7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gbnVsbCkgewotICAgICAgICAgICAgc3dpdGNoKHBob25lLm1DTS5nZXRSYWRpb1N0YXRlKCkpIHsKLSAgICAgICAgICAgICAgICAvKiBUaGlzIHN3aXRjaCBibG9jayBtdXN0IG5vdCByZXR1cm4gYW55dGhpbmcgaW4KLSAgICAgICAgICAgICAgICAgKiBTdGF0ZS5pc0xvY2tlZCgpIG9yIFN0YXRlLkFCU0VOVC4KLSAgICAgICAgICAgICAgICAgKiBJZiBpdCBkb2VzLCBoYW5kbGVTaW1TdGF0dXMoKSBtYXkgYnJlYWsKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBjYXNlIFJBRElPX09GRjoKLSAgICAgICAgICAgICAgICBjYXNlIFJBRElPX1VOQVZBSUxBQkxFOgotICAgICAgICAgICAgICAgIGNhc2UgU0lNX05PVF9SRUFEWToKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLlVOS05PV047Ci0gICAgICAgICAgICAgICAgY2FzZSBTSU1fTE9DS0VEX09SX0FCU0VOVDoKLSAgICAgICAgICAgICAgICAgICAgLy90aGlzIHNob3VsZCBiZSB0cmFuc2llbnQtb25seQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gU3RhdGUuVU5LTk9XTjsKLSAgICAgICAgICAgICAgICBjYXNlIFNJTV9SRUFEWToKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLlJFQURZOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgc3dpdGNoIChzdGF0dXMpIHsKLSAgICAgICAgICAgICAgICBjYXNlIElDQ19BQlNFTlQ6ICAgICAgICAgICAgcmV0dXJuIFN0YXRlLkFCU0VOVDsKLSAgICAgICAgICAgICAgICBjYXNlIElDQ19OT1RfUkVBRFk6ICAgICAgICAgcmV0dXJuIFN0YXRlLlVOS05PV047Ci0gICAgICAgICAgICAgICAgY2FzZSBJQ0NfUkVBRFk6ICAgICAgICAgICAgIHJldHVybiBTdGF0ZS5SRUFEWTsKLSAgICAgICAgICAgICAgICBjYXNlIElDQ19QSU46ICAgICAgICAgICAgICAgcmV0dXJuIFN0YXRlLlBJTl9SRVFVSVJFRDsKLSAgICAgICAgICAgICAgICBjYXNlIEl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sgUGVyc29uYWxpemF0aW9uCi0gICAgICAgICAgICAgICAgLy8gcmVxdWVzdCBoYXMgY29tcGxldGVkLiBhci51c2VyT2JqIGlzIHRoZSByZXNwb25zZSBNZXNzYWdlCi0gICAgICAgICAgICAgICAgLy8gUmVwb2xsIGJlZm9yZSByZXR1cm5pbmcKLSAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotICAgICAgICAgICAgICAgIC8vIFRPRE8gc2hvdWxkIGFic3RyYWN0IHRoZXNlIGV4Y2VwdGlvbnMKLSAgICAgICAgICAgICAgICBBc3luY1Jlc3VsdC5mb3JNZXNzYWdlKCgoTWVzc2FnZSlhci51c2VyT2JqKSkuZXhjZXB0aW9uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBhci5leGNlcHRpb247Ci0gICAgICAgICAgICAgICAgcGhvbmUubUNNLmdldEljY1N0YXR1cygKLSAgICAgICAgICAgICAgICAgICAgb2J0YWluTWVzc2FnZShFVkVOVF9SRVBPTExfU1RBVFVTX0RPTkUsIGFyLnVzZXJPYmopKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfUkVQT0xMX1NUQVRVU19ET05FOgotICAgICAgICAgICAgICAgIC8vIEZpbmlzaGVkIHJlcG9sbGluZyBzdGF0dXMgYWZ0ZXIgUElOIG9wZXJhdGlvbgotICAgICAgICAgICAgICAgIC8vIGFyLnVzZXJPYmogaXMgdGhlIHJlc3BvbnNlIG1lc3NhZWcKLSAgICAgICAgICAgICAgICAvLyBhci51c2VyT2JqLm9iaiBpcyBhbHJlYWR5IGFuIEFzeW5jUmVzdWx0IHdpdGggYW4KLSAgICAgICAgICAgICAgICAvLyBhcHByb3ByaWF0ZSBleGNlcHRpb24gZmlsbGVkIGluIGlmIGFwcGxpY2FibGUKLQotICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgZ2V0U2ltU3RhdHVzRG9uZShhcik7Ci0gICAgICAgICAgICAgICAgKChNZXNzYWdlKWFyLnVzZXJPYmopLnNlbmRUb1RhcmdldCgpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBFVkVOVF9RVUVSWV9GQUNJTElUWV9MT0NLX0RPTkU6Ci0gICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKLSAgICAgICAgICAgICAgICBvblF1ZXJ5RmFjaWxpdHlMb2NrKGFyKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfUVVFUllfRkFDSUxJVFlfRkROX0RPTkU6Ci0gICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKLSAgICAgICAgICAgICAgICBvblF1ZXJ5RmRuRW5hYmxlZChhcik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEVWRU5UX0NIQU5HRV9GQUNJTElUWV9MT0NLX0RPTkU6Ci0gICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKLSAgICAgICAgICAgICAgICBpZiAoYXIuZXhjZXB0aW9uID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbVNpbVBpbkxvY2tlZCA9IG1EZXNpcmVkUGluTG9ja2VkOwotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coICJFVkVOVF9DSEFOR0VfRkFDSUxJVFlfTE9DS19ET05FOiAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAibVNpbVBpbkxvY2tlZD0gIiArIG1TaW1QaW5Mb2NrZWQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJFcnJvciBjaGFuZ2UgZmFjaWxpdHkgbG9jayB3aXRoIGV4Y2VwdGlvbiAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIGFyLmV4Y2VwdGlvbik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2UoKChNZXNzYWdlKWFyLnVzZXJPYmopKS5leGNlcHRpb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGFyLmV4Y2VwdGlvbjsKLSAgICAgICAgICAgICAgICAoKE1lc3NhZ2UpYXIudXNlck9iaikuc2VuZFRvVGFyZ2V0KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEVWRU5UX0NIQU5HRV9GQUNJTElUWV9GRE5fRE9ORToKLSAgICAgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCltc2cub2JqOwotCi0gICAgICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1TaW1GZG5FbmFibGVkID0gbURlc2lyZWRGZG5FbmFibGVkOwotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2coIkVWRU5UX0NIQU5HRV9GQUNJTElUWV9GRE5fRE9ORTogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIm1TaW1GZG5FbmFibGVkPSIgKyBtU2ltRmRuRW5hYmxlZCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yIGNoYW5nZSBmYWNpbGl0eSBmZG4gd2l0aCBleGNlcHRpb24gIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYXIuZXhjZXB0aW9uKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgQXN5bmNSZXN1bHQuZm9yTWVzc2FnZSgoKE1lc3NhZ2UpYXIudXNlck9iaikpLmV4Y2VwdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gYXIuZXhjZXB0aW9uOwotICAgICAgICAgICAgICAgICgoTWVzc2FnZSlhci51c2VyT2JqKS5zZW5kVG9UYXJnZXQoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0hBTkdFX1NJTV9QQVNTV09SRF9ET05FOgotICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgaWYoYXIuZXhjZXB0aW9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yIGluIGNoYW5nZSBzaW0gcGFzc3dvcmQgd2l0aCBleGNlcHRpb24iCi0gICAgICAgICAgICAgICAgICAgICAgICArIGFyLmV4Y2VwdGlvbik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIEFzeW5jUmVzdWx0LmZvck1lc3NhZ2UoKChNZXNzYWdlKWFyLnVzZXJPYmopKS5leGNlcHRpb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGFyLmV4Y2VwdGlvbjsKLSAgICAgICAgICAgICAgICAoKE1lc3NhZ2UpYXIudXNlck9iaikuc2VuZFRvVGFyZ2V0KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJbR3NtU2ltQ2FyZF0gVW5rbm93biBFdmVudCAiICsgbXNnLndoYXQpOwotICAgICAgICB9CisgICAgcHVibGljIFN0cmluZyBnZXRTZXJ2aWNlUHJvdmlkZXJOYW1lICgpIHsKKyAgICAgICAgcmV0dXJuICgoR1NNUGhvbmUpbVBob25lKS5tU0lNUmVjb3Jkcy5nZXRTZXJ2aWN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vblF1ZXJ5RmRuRW5hYmxlZChBc3luY1Jlc3VsdCBhcikgewotICAgICAgICBpZihhci5leGNlcHRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgaWYoREJHKSBsb2coIkVycm9yIGluIHF1ZXJ5aW5nIGZhY2lsaXR5IGxvY2s6IiArIGFyLmV4Y2VwdGlvbik7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBpbnRbXSBpbnRzID0gKGludFtdKWFyLnJlc3VsdDsKLSAgICAgICAgaWYoaW50cy5sZW5ndGggIT0gMCkgewotICAgICAgICAgICAgbVNpbUZkbkVuYWJsZWQgPSAoMCE9aW50c1swXSk7Ci0gICAgICAgICAgICBpZihEQkcpIGxvZygiUXVlcnkgZmFjaWxpdHkgbG9jayA6ICIgICsgbVNpbUZkbkVuYWJsZWQpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIltHc21TaW1DYXJkXSBCb2d1cyBmYWNpbGl0eSBsb2NrIHJlc3BvbnNlIik7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQKLSAgICBnZXRTaW1TdGF0dXNEb25lKEFzeW5jUmVzdWx0IGFyKSB7Ci0gICAgICAgIGlmIChhci5leGNlcHRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywiRXJyb3IgZ2V0dGluZyBJQ0Mgc3RhdHVzLiAiCi0gICAgICAgICAgICAgICAgICAgICsgIlJJTF9SRVFVRVNUX0dFVF9JQ0NfU1RBVFVTIHNob3VsZCAiCi0gICAgICAgICAgICAgICAgICAgICsgIm5ldmVyIHJldHVybiBhbiBlcnJvciIsIGFyLmV4Y2VwdGlvbik7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBDb21tYW5kc0ludGVyZmFjZS5JY2NTdGF0dXMgbmV3U3RhdHVzCi0gICAgICAgICAgICA9IChDb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A+PSA2KSB7Ci0gICAgICAgICAgICBDb25maWd1cmF0aW9uIGNvbmZpZyA9IG5ldyBDb25maWd1cmF0aW9uKCk7Ci0gICAgICAgICAgICBjb25maWcubWNjID0gKChpbXNpLmNoYXJBdCgwKS0nMCcpKjEwMCkKLSAgICAgICAgICAgICAgICAgICAgKyAoKGltc2kuY2hhckF0KDEpLScwJykqMTApCi0gICAgICAgICAgICAgICAgICAgICsgKGltc2kuY2hhckF0KDIpLScwJyk7Ci0gICAgICAgICAgICBjb25maWcubW5jID0gKChpbXNpLmNoYXJBdCgzKS0nMCcpKjEwMCkKLSAgICAgICAgICAgICAgICAgICAgKyAoKGltc2kuY2hhckF0KDQpLScwJykqMTApCi0gICAgICAgICAgICAgICAgICAgICsgKGltc2kuY2hhckF0KDUpLScwJyk7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkudXBkYXRlQ29uZmlndXJhdGlvbihjb25maWcpOwotICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZAotICAgIHVwZGF0ZVN0YXRlUHJvcGVydHkoKSB7Ci0gICAgICAgIHBob25lLnNldFN5c3RlbVByb3BlcnR5KAotICAgICAgICAgICAgVGVsZXBob255UHJvcGVydGllcy5QUk9QRVJUWV9TSU1fU1RBVEUsCi0gICAgICAgICAgICBnZXRTdGF0ZSgpLnRvU3RyaW5nKCkpOwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCBsb2coU3RyaW5nIG1zZykgewotICAgICAgICBMb2cuZChMT0dfVEFHLCAiW0dzbVNpbUNhcmRdICIgKyBtc2cpOwotICAgIH0KIH0KLQpkaWZmIC0tZ2l0IGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L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AgICAgYm9vbGVhbiBzdGF0dXNSZXBvcnRSZXF1ZXN0ZWQpIHsKIAogICAgICAgICBTbXNIZWFkZXIuUG9ydEFkZHJzIHBvcnRBZGRycyA9IG5ldyBTbXNIZWFkZXIuUG9ydEFkZHJzKCk7CkBAIC01MTksMTIgKzUxOSwxMiBAQAogCiAgICAgICAgIGxvbmcgZ2V0U0NUaW1lc3RhbXBNaWxsaXMoKSB7CiAgICAgICAgICAgICAvLyBUUC1TZXJ2aWNlLUNlbnRyZS1UaW1lLVN0YW1wCi0gICAgICAgICAgICBpbnQgeWVhciA9IEljY1V0aWxzLmJjZEJ5dGVUb0ludChwZHVbY3VyKytdKTsKLSAgICAgICAgICAgIGludCBtb250aCA9IEljY1V0aWxzLmJjZEJ5dGVUb0ludChwZHVbY3VyKytdKTsKLSAgICAgICAgICAgIGludCBkYXkgPSBJY2NVdGlscy5iY2RCeXRlVG9JbnQocGR1W2N1cisrXSk7Ci0gICAgICAgICAgICBpbnQgaG91ciA9IEljY1V0aWxzLmJjZEJ5dGVUb0ludChwZHVbY3VyKytdKTsKLSAgICAgICAgICAgIGludCBtaW51dGUgPSBJY2NVdGlscy5iY2RCeXRlVG9JbnQocGR1W2N1cisrXSk7Ci0gICAgICAgICAgICBpbnQgc2Vjb25kID0gSWNjVXRpbHMuYmNkQnl0ZVRvSW50KHBkdVtjdXIrK10pOworICAgICAgICAgICAgaW50IHllYXIgPSBJY2NVdGlscy5nc21CY2RCeXRlVG9JbnQocGR1W2N1cisrXSk7CisgICAgICAgICAgICBpbnQgbW9udGggPSBJY2NVdGlscy5nc21CY2RCeXRlVG9JbnQocGR1W2N1cisrXSk7CisgICAgICAgICAgICBpbnQgZGF5ID0gSWNjVXRpbHMuZ3NtQmNkQnl0ZVRvSW50KHBkdVtjdXIrK10pOworICAgICAgICAgICAgaW50IGhvdXIgPSBJY2NVdGlscy5nc21CY2RCeXRlVG9JbnQocGR1W2N1cisrXSk7CisgICAgICAgICAgICBpbnQgbWludXRlID0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nQgVVNJTV9FRkNDUDFfVEFHICA9IDB4Q0I7CisKKyAgICBwdWJsaWMgVXNpbVBob25lQm9va01hbmFnZXIoUGhvbmVCYXNlIHBob25lLCBBZG5SZWNvcmRDYWNoZSBjYWNoZSkgeworICAgICAgICBtUGhvbmUgPSBwaG9uZTsKKyAgICAgICAgbVBob25lQm9va1JlY29yZHMgPSBuZXcgQXJyYXlMaXN0PEFkblJlY29yZD4oKTsKKyAgICAgICAgbVBickZpbGUgPSBudWxsOworICAgICAgICAvLyBXZSBhc3N1bWUgaXRzIHByZXNlbnQsIGFmdGVyIHRoZSBmaXJzdCByZWFkIHRoaXMgaXMgdXBkYXRlZC4KKyAgICAgICAgLy8gU28gd2UgZG9uJ3QgaGF2ZSB0byByZWFkIGZyb20gVUlDQyBpZiBpdHMgbm90IHByZXNlbnQgb24gc3Vic2VxdWVudCByZWFkcy4KKyAgICAgICAgbUlzUGJyUHJlc2VudCA9IHRydWU7CisgICAgICAgIG1BZG5DYWNoZSA9IGNhY2hlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlc2V0KCkgeworICAgICAgICBtUGhvbmVCb29rUmVjb3Jkcy5jbGVhcigpOworICAgICAgICBtSWFwRmlsZVJlY29yZCA9IG51bGw7CisgICAgICAgIG1FbWFpbEZpbGVSZWNvcmQgPSBudWxsOworICAgICAgICBtUGJyRmlsZSA9IG51bGw7CisgICAgICAgIG1Jc1BiclByZXNlbnQgPSB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyBBcnJheUxpc3Q8QWRuUmVjb3JkPiBsb2FkRWZGaWxlc0Zyb21Vc2ltKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICBpZiAoIW1QaG9uZUJvb2tSZWNvcmRzLmlzRW1wdHkoKSkgcmV0dXJuIG1QaG9uZUJvb2tSZWNvcmRzOworICAgICAgICAgICAgaWYgKCFtSXNQYnJQcmVzZW50KSByZXR1cm4gbnVsbDsKKworICAgICAgICAgICAgLy8gQ2hlY2sgaWYgdGhlIFBCUiBmaWxlIGlzIHByZXNlbnQgaW4gdGhlIGNhY2hlLCBpZiBub3QgcmVhZCBpdAorICAgICAgICAgICAgLy8gZnJvbSB0aGUgVVNJTS4KKyAgICAgICAgICAgIGlmIChtUGJyRmlsZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmVhZFBickZpbGVBbmRXYWl0KCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtUGJyRmlsZSA9PSBudWxsKSByZXR1cm4gbnVsbDsKKworICAgICAgICAgICAgaW50IG51bVJlY3MgPSBtUGJyRmlsZS5tRmlsZUlkcy5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bVJlY3M7IGkrKykgeworICAgICAgICAgICAgICAgIHJlYWRBZG5GaWxlQW5kV2FpdChpKTsKKyAgICAgICAgICAgICAgICByZWFkRW1haWxGaWxlQW5kV2FpdChpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEFsbCBFRiBmaWxlcyBhcmUgbG9hZGVkLCBwb3N0IHRoZSByZXNwb25zZS4KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbVBob25lQm9va1JlY29yZHM7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlYWRQYnJGaWxlQW5kV2FpdCgpIHsKKyAgICAgICAgbVBob25lLmdldEljY0ZpbGVIYW5kbGVyKCkubG9hZEVGTGluZWFyRml4ZWRBbGwoRUZfUEJSLCBvYnRhaW5NZXNzYWdlKEVWRU5UX1BCUl9MT0FEX0RPTkUpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1Mb2NrLndhaXQoKTsKKyAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkludGVycnVwdGVkIEV4Y2VwdGlvbiBpbiByZWFkQWRuRmlsZUFuZFdhaXQiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWFkRW1haWxGaWxlQW5kV2FpdChpbnQgcmVjTnVtKSB7CisgICAgICAgIE1hcCA8SW50ZWdlcixJbnRlZ2VyPiBmaWxlSWRzOworICAgICAgICBmaWxlSWRzID0gbVBickZpbGUubUZpbGVJZHMuZ2V0KHJlY051bSk7CisgICAgICAgIGlmIChmaWxlSWRzID09IG51bGwpIHJldHVybjsKKworICAgICAgICBpZiAoZmlsZUlkcy5jb250YWluc0tleShVU0lNX0VGRU1BSUxfVEFHKSkgeworICAgICAgICAgICAgaW50IGVmaWQgPSBmaWxlSWRzLmdldChVU0lNX0VGRU1BSUxfVEFHKTsKKyAgICAgICAgICAgIC8vIENoZWNrIGlmIHRoZSBFRkVtYWlsIGlzIGEgVHlwZSAxIGZpbGUgb3IgYSB0eXBlIDIgZmlsZS4KKyAgICAgICAgICAgIC8vIElmIG1FbWFpbFByZXNlbnRJbklhcCBpcyB0cnVlLCBpdHMgYSB0eXBlIDIgZmlsZS4KKyAgICAgICAgICAgIC8vIFNvIHdlIHJlYWQgdGhlIElBUCBmaWxlIGFuZCB0aGVuIHJlYWQgdGhlIGVtYWlsIHJlY29yZHMuCisgICAgICAgICAgICAvLyBpbnN0ZWFkIG9mIHJlYWRpbmcgZGlyZWN0bHkuCisgICAgICAgICAgICBpZiAobUVtYWlsUHJlc2VudEluSWFwKSB7CisgICAgICAgICAgICAgICAgcmVhZElhcEZpbGVBbmRXYWl0KGZpbGVJZHMuZ2V0KFVTSU1fRUZJQVBfVEFHKSk7CisgICAgICAgICAgICAgICAgaWYgKG1JYXBGaWxlUmVjb3JkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yOiBJQVAgZmlsZSBpcyBlbXB0eSIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gUmVhZCB0aGUgRUZFbWFpbCBmaWxlLgorICAgICAgICAgICAgbVBob25lLmdldEljY0ZpbGVIYW5kbGVyKCkubG9hZEVGTGluZWFyRml4ZWRBbGwoZmlsZUlkcy5nZXQoVVNJTV9FRkVNQUlMX1RBRyksCisgICAgICAgICAgICAgICAgICAgIG9idGFpbk1lc3NhZ2UoRVZFTlRfRU1BSUxfTE9BRF9ET05FKSk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1Mb2NrLndhaXQoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSW50ZXJydXB0ZWQgRXhjZXB0aW9uIGluIHJlYWRFbWFpbEZpbGVBbmRXYWl0Iik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtRW1haWxGaWxlUmVjb3JkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRXJyb3I6IEVtYWlsIGZpbGUgaXMgZW1wdHkiKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICB1cGRhdGVQaG9uZUFkblJlY29yZCgpOworICAgICAgICB9CisKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVhZElhcEZpbGVBbmRXYWl0KGludCBlZmlkKSB7CisgICAgICAgIG1QaG9uZS5nZXRJY2NGaWxlSGFuZGxlcigpLmxvYWRFRkxpbmVhckZpeGVkQWxsKGVmaWQsIG9idGFpbk1lc3NhZ2UoRVZFTlRfSUFQX0xPQURfRE9ORSkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUxvY2sud2FpdCgpOworICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSW50ZXJydXB0ZWQgRXhjZXB0aW9uIGluIHJlYWRJYXBGaWxlQW5kV2FpdCIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVBob25lQWRuUmVjb3JkKCkgeworICAgICAgICBpZiAobUVtYWlsRmlsZVJlY29yZCA9PSBudWxsKSByZXR1cm47CisgICAgICAgIGludCBudW1BZG5SZWNzID0gbVBob25lQm9va1JlY29yZHMuc2l6ZSgpOworICAgICAgICBpZiAobUlhcEZpbGVSZWNvcmQgIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gVGhlIG51bWJlciBvZiByZWNvcmRzIGluIHRoZSBJQVAgZmlsZSBpcyBzYW1lIGFzIHRoZSBudW1iZXIgb2YgcmVjb3JkcyBpbiBBRE4gZmlsZS4KKyAgICAgICAgICAgIC8vIFRoZSBvcmRlciBvZiB0aGUgcG9pbnRlcnMgaW4gYW4gRUZJQVAgc2hhbGwgYmUgdGhlIHNhbWUgYXMgdGhlIG9yZGVyIG9mIGZpbGUgSURzCisgICAgICAgICAgICAvLyB0aGF0IGFwcGVhciBpbiB0aGUgVExWIG9iamVjdCBpbmRpY2F0ZWQgYnkgVGFnICdBOScgaW4gdGhlIHJlZmVyZW5jZSBmaWxlIHJlY29yZC4KKyAgICAgICAgICAgIC8vIGkuZSB2YWx1ZSBvZiBtRW1haWxUYWdOdW1iZXJJbklhcAorCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUFkblJlY3M7IGkrKykgeworICAgICAgICAgICAgICAgIGJ5dGVbXSByZWNvcmQgPSBudWxsOworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHJlY29yZCA9IG1JYXBGaWxlUmVjb3JkLmdldChpKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkVycm9yOiBJbXByb3BlciBJQ0MgY2FyZDogTm8gSUFQIHJlY29yZCBmb3IgQUROLCBjb250aW51aW5nIik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgcmVjTnVtID0gcmVjb3JkW21FbWFpbFRhZ051bWJlckluSWFwXTsKKworICAgICAgICAgICAgICAgIGlmIChyZWNOdW0gIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gZW1haWxzID0gbmV3IFN0cmluZ1sxXTsKKyAgICAgICAgICAgICAgICAgICAgLy8gU0lNIHJlY29yZCBudW1iZXJzIGFyZSAxIGJhc2VkCisgICAgICAgICAgICAgICAgICAgIGVtYWlsc1swXSA9IHJlYWRFbWFpbFJlY29yZChyZWNOdW0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgQWRuUmVjb3JkIHJlYyA9IG1QaG9uZUJvb2tSZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlYyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZWMuc2V0RW1haWxzKGVtYWlscyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBtaWdodCBiZSBhIHJlY29yZCB3aXRoIG9ubHkgZW1haWwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlYyA9IG5ldyBBZG5SZWNvcmQoIiIsICIiLCBlbWFpbHMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1QaG9uZUJvb2tSZWNvcmRzLnNldChpLCByZWMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIElDQyBjYXJkcyBjYW4gYmUgbWFkZSBzdWNoIHRoYXQgdGhleSBoYXZlIGFuIElBUCBmaWxlIGJ1dCBhbGwKKyAgICAgICAgLy8gcmVjb3JkcyBhcmUgZW1wdHkuIFNvIHdlIHJlYWQgYm90aCB0eXBlIDEgYW5kIHR5cGUgMiBmaWxlCisgICAgICAgIC8vIGVtYWlsIHJlY29yZHMsIGp1c3QgdG8gYmUgc3VyZS4KKworICAgICAgICBpbnQgbGVuID0gbVBob25lQm9va1JlY29yZHMuc2l6ZSgpOworICAgICAgICAvLyBUeXBlIDEgZmlsZSwgdGhlIG51bWJlciBvZiByZWNvcmRzIGlzIHRoZSBzYW1lIGFzIHRoZSBudW1iZXIgb2YKKyAgICAgICAgLy8gcmVjb3JkcyBpbiB0aGUgQUROIGZpbGUuCisgICAgICAgIGlmIChtRW1haWxzRm9yQWRuUmVjID09IG51bGwpIHsKKyAgICAgICAgICAgIHBhcnNlVHlwZTFFbWFpbEZpbGUobGVuKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUFkblJlY3M7IGkrKykgeworICAgICAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gZW1haWxMaXN0ID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZW1haWxMaXN0ID0gbUVtYWlsc0ZvckFkblJlYy5nZXQoaSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChlbWFpbExpc3QgPT0gbnVsbCkgY29udGludWU7CisKKyAgICAgICAgICAgIEFkblJlY29yZCByZWMgPSBtUGhvbmVCb29rUmVjb3Jkcy5nZXQoaSk7CisKKyAgICAgICAgICAgIFN0cmluZ1tdIGVtYWlscyA9IG5ldyBTdHJpbmdbZW1haWxMaXN0LnNpemUoKV07CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGVtYWlsTGlzdC50b0FycmF5KCksIDAsIGVtYWlscywgMCwgZW1haWxMaXN0LnNpemUoKSk7CisgICAgICAgICAgICByZWMuc2V0RW1haWxzKGVtYWlscyk7CisgICAgICAgICAgICBtUGhvbmVCb29rUmVjb3Jkcy5zZXQoaSwgcmVjKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZvaWQgcGFyc2VUeXBlMUVtYWlsRmlsZShpbnQgbnVtUmVjcykgeworICAgICAgICBtRW1haWxzRm9yQWRuUmVjID0gbmV3IEhhc2hNYXA8SW50ZWdlciwgQXJyYXlMaXN0PFN0cmluZz4+KCk7CisgICAgICAgIGJ5dGVbXSBlbWFpbFJlYyA9IG51bGw7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtUmVjczsgaSsrKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGVtYWlsUmVjID0gbUVtYWlsRmlsZVJlY29yZC5nZXQoaSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRXJyb3I6IEltcHJvcGVyIElDQyBjYXJkOiBObyBlbWFpbCByZWNvcmQgZm9yIEFETiwgY29udGludWluZyIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50IGFkblJlY051bSA9IGVtYWlsUmVjW2VtYWlsUmVjLmxlbmd0aCAtIDFdOworCisgICAgICAgICAgICBpZiAoYWRuUmVjTnVtID09IC0xKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZyBlbWFpbCA9IHJlYWRFbWFpbFJlY29yZChpKTsKKworICAgICAgICAgICAgaWYgKGVtYWlsID09IG51bGwgfHwgZW1haWwuZXF1YWxzKCIiKSkgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBTSU0gcmVjb3JkIG51bWJlcnMgYXJlIDEgYmFzZWQuCisgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiB2YWwgPSBtRW1haWxzRm9yQWRuUmVjLmdldChhZG5SZWNOdW0gLSAxKTsKKyAgICAgICAgICAgIGlmICh2YWwgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHZhbCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdmFsLmFkZChlbWFpbCk7CisgICAgICAgICAgICAvLyBTSU0gcmVjb3JkIG51bWJlcnMgYXJlIDEgYmFzZWQuCisgICAgICAgICAgICBtRW1haWxzRm9yQWRuUmVjLnB1dChhZG5SZWNOdW0gLSAxLCB2YWwpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBTdHJpbmcgcmVhZEVtYWlsUmVjb3JkKGludCByZWNOdW0pIHsKKyAgICAgICAgYnl0ZVtdIGVtYWlsUmVjID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGVtYWlsUmVjID0gbUVtYWlsRmlsZVJlY29yZC5nZXQocmVjTnVtKTsKKyAgICAgICAgfSBjYXRjaCAoSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFRoZSBsZW5ndGggb2YgdGhlIHJlY29yZCBpcyBYKzIgYnl0ZSwgd2hlcmUgWCBieXRlcyBpcyB0aGUgZW1haWwgYWRkcmVzcworICAgICAgICBTdHJpbmcgZW1haWwgPSBJY2NVdGlscy5hZG5TdHJpbmdGaWVsZFRvU3RyaW5nKGVtYWlsUmVjLCAwLCBlbWFpbFJlYy5sZW5ndGggLSAyKTsKKyAgICAgICAgcmV0dXJuIGVtYWlsOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWFkQWRuRmlsZUFuZFdhaXQoaW50IHJlY051bSkgeworICAgICAgICBNYXAgPEludGVnZXIsSW50ZWdlcj4gZmlsZUlkczsKKyAgICAgICAgZmlsZUlkcyA9IG1QYnJGaWxlLm1GaWxlSWRzLmdldChyZWNOdW0pOworICAgICAgICBpZiAoZmlsZUlkcyA9PSBudWxsKSByZXR1cm47CisKKyAgICAgICAgbUFkbkNhY2hlLnJlcXVlc3RMb2FkQWxsQWRuTGlrZShmaWxlSWRzLmdldChVU0lNX0VGQUROX1RBRyksCisgICAgICAgICAgICBmaWxlSWRzLmdldChVU0lNX0VGRVhUMV9UQUcpLCBvYnRhaW5NZXNzYWdlKEVWRU5UX1VTSU1fQUROX0xPQURfRE9ORSkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUxvY2sud2FpdCgpOworICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSW50ZXJydXB0ZWQgRXhjZXB0aW9uIGluIHJlYWRBZG5GaWxlQW5kV2FpdCIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGNyZWF0ZVBickZpbGUoQXJyYXlMaXN0PGJ5dGVbXT4gcmVjb3JkcykgeworICAgICAgICBpZiAocmVjb3JkcyA9PSBudWxsKSB7CisgICAgICAgICAgICBtUGJyRmlsZSA9IG51bGw7CisgICAgICAgICAgICBtSXNQYnJQcmVzZW50ID0gZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgbVBickZpbGUgPSBuZXcgUGJyRmlsZShyZWNvcmRzKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgIEFzeW5jUmVzdWx0IGFyOworCisgICAgICAgIHN3aXRjaChtc2cud2hhdCkgeworICAgICAgICBjYXNlIEVWRU5UX1BCUl9MT0FEX0RPTkU6CisgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCkgbXNnLm9iajsKKyAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGNyZWF0ZVBickZpbGUoKEFycmF5TGlzdDxieXRlW10+KWFyLnJlc3VsdCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1Mb2NrKSB7CisgICAgICAgICAgICAgICAgbUxvY2subm90aWZ5KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBFVkVOVF9VU0lNX0FETl9MT0FEX0RPTkU6CisgICAgICAgICAgICBsb2coIkxvYWRpbmcgVVNJTSBBRE4gcmVjb3JkcyBkb25lIik7CisgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCkgbXNnLm9iajsKKyAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1QaG9uZUJvb2tSZWNvcmRzLmFkZEFsbCgoQXJyYXlMaXN0PEFkblJlY29yZD4pYXIucmVzdWx0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgICAgICBtTG9jay5ub3RpZnkoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEVWRU5UX0lBUF9MT0FEX0RPTkU6CisgICAgICAgICAgICBsb2coIkxvYWRpbmcgVVNJTSBJQVAgcmVjb3JkcyBkb25lIik7CisgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCkgbXNnLm9iajsKKyAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1JYXBGaWxlUmVjb3JkID0gKChBcnJheUxpc3Q8Ynl0ZVtdPilhci5yZXN1bHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgICAgIG1Mb2NrLm5vdGlmeSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgRVZFTlRfRU1BSUxfTE9BRF9ET05FOgorICAgICAgICAgICAgbG9nKCJMb2FkaW5nIFVTSU0gRW1haWwgcmVjb3JkcyBkb25lIik7CisgICAgICAgICAgICBhciA9IChBc3luY1Jlc3VsdCkgbXNnLm9iajsKKyAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1FbWFpbEZpbGVSZWNvcmQgPSAoKEFycmF5TGlzdDxieXRlW10+KWFyLnJlc3VsdCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKKyAgICAgICAgICAgICAgICBtTG9jay5ub3RpZnkoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBQYnJGaWxlIHsKKyAgICAgICAgLy8gUmVjTnVtIDxFRiBUYWcsIGVmaWQ+CisgICAgICAgIEhhc2hNYXA8SW50ZWdlcixNYXA8SW50ZWdlcixJbnRlZ2VyPj4gbUZpbGVJZHM7CisKKyAgICAgICAgUGJyRmlsZShBcnJheUxpc3Q8Ynl0ZVtdPiByZWNvcmRzKSB7CisgICAgICAgICAgICBtRmlsZUlkcyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIE1hcDxJbnRlZ2VyLCBJbnRlZ2VyPj4oKTsKKyAgICAgICAgICAgIFNpbVRsdiByZWNUbHY7CisgICAgICAgICAgICBpbnQgcmVjTnVtID0gMDsKKyAgICAgICAgICAgIGZvciAoYnl0ZVtdIHJlY29yZDogcmVjb3JkcykgeworICAgICAgICAgICAgICAgIHJlY1RsdiA9IG5ldyBTaW1UbHYocmVjb3JkLCAwLCByZWNvcmQubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBwYXJzZVRhZyhyZWNUbHYsIHJlY051bSk7CisgICAgICAgICAgICAgICAgcmVjTnVtICsrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgdm9pZCBwYXJzZVRhZyhTaW1UbHYgdGx2LCBpbnQgcmVjTnVtKSB7CisgICAgICAgICAgICBTaW1UbHYgdGx2RWY7CisgICAgICAgICAgICBpbnQgdGFnOworICAgICAgICAgICAgYnl0ZVtdIGRhdGE7CisgICAgICAgICAgICBNYXA8SW50ZWdlciwgSW50ZWdlcj4gdmFsID0gbmV3IEhhc2hNYXA8SW50ZWdlciwgSW50ZWdlcj4oKTsKKyAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICB0YWcgPSB0bHYuZ2V0VGFnKCk7CisgICAgICAgICAgICAgICAgc3dpdGNoKHRhZykgeworICAgICAgICAgICAgICAgIGNhc2UgVVNJTV9UWVBFMV9UQUc6IC8vIEE4CisgICAgICAgICAgICAgICAgY2FzZSBVU0lNX1RZUEUzX1RBRzogLy8gQUEKKyAgICAgICAgICAgICAgICBjYXNlIFVTSU1fVFlQRTJfVEFHOiAvLyBBOQorICAgICAgICAgICAgICAgICAgICBkYXRhID0gdGx2LmdldERhdGEoKTsKKyAgICAgICAgICAgICAgICAgICAgdGx2RWYgPSBuZXcgU2ltVGx2KGRhdGEsIDAsIGRhdGEubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgcGFyc2VFZih0bHZFZiwgdmFsLCB0YWcpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IHdoaWxlICh0bHYubmV4dE9iamVjdCgpKTsKKyAgICAgICAgICAgIG1GaWxlSWRzLnB1dChyZWNOdW0sIHZhbCk7CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHBhcnNlRWYoU2ltVGx2IHRsdiwgTWFwPEludGVnZXIsIEludGVnZXI+IHZhbCwgaW50IHBhcmVudFRhZykgeworICAgICAgICAgICAgaW50IHRhZzsKKyAgICAgICAgICAgIGJ5dGVbXSBkYXRhOworICAgICAgICAgICAgaW50IHRhZ051bWJlcldpdGhpblBhcmVudFRhZyA9IDA7CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgdGFnID0gdGx2LmdldFRhZygpOworICAgICAgICAgICAgICAgIGlmIChwYXJlbnRUYWcgPT0gVVNJTV9UWVBFMl9UQUcgJiYgdGFnID09IFVTSU1fRUZFTUFJTF9UQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgbUVtYWlsUHJlc2VudEluSWFwID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgbUVtYWlsVGFnTnVtYmVySW5JYXAgPSB0YWdOdW1iZXJXaXRoaW5QYXJlbnRUYWc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHN3aXRjaCh0YWcpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGRU1BSUxfVEFHOgorICAgICAgICAgICAgICAgICAgICBjYXNlIFVTSU1fRUZBRE5fVEFHOgorICAgICAgICAgICAgICAgICAgICBjYXNlIFVTSU1fRUZFWFQxX1RBRzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGQU5SX1RBRzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGUEJDX1RBRzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGR1JQX1RBRzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGQUFTX1RBRzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGR1NEX1RBRzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGVUlEX1RBRzoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBVU0lNX0VGQ0NQMV9UQUc6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgVVNJTV9FRklBUF9UQUc6CisgICAgICAgICAgICAgICAgICAgIGNhc2UgVVNJTV9FRlNORV9UQUc6CisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gdGx2LmdldERhdGEoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBlZmlkID0gZGF0YVswXSA8PCA4IHwgZGF0YVsxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbC5wdXQodGFnLCBlZmlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0YWdOdW1iZXJXaXRoaW5QYXJlbnRUYWcgKys7CisgICAgICAgICAgICB9IHdoaWxlKHRsdi5uZXh0T2JqZWN0KCkpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGxvZyhTdHJpbmcgbXNnKSB7CisgICAgICAgIGlmKERCRykgTG9nLmQoTE9HX1RBRywgbXNnKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvdGVzdC9TaW11bGF0ZWRDb21tYW5kcy5qYXZhIGIvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L3Rlc3QvU2ltdWxhdGVkQ29tbWFuZHMuamF2YQppbmRleCBmNzFlYTQ4Li4xMWIzZmQ2IDEwMDY0NAotLS0gYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvdGVzdC9TaW11bGF0ZWRDb21tYW5kcy5qYXZhCisrKyBiL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS90ZXN0L1NpbXVsYXRlZENvbW1hbmRzLmphdmEKQEAgLTI3LDEwICsyNywxMSBAQAogaW1wb3J0IGNvbS5hbmRyb2lkLmludGVybmFsLnRlbGVwaG9ueS5Db21tYW5kRXhjZX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cyhyZXN1bHQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIHJlc3VsdFN1Y2Nlc3MocmVzdWx0LCBJY2NTdGF0dXMuSUNDX05PVF9SRUFEWSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgcmV0dXJuU2ltTG9ja2VkU3RhdHVzKE1lc3NhZ2UgcmVzdWx0KSB7Ci0gICAgICAgIHN3aXRjaCAobVNpbUxvY2tlZFN0YXRlKSB7Ci0gICAgICAgICAgICBjYXNlIFJFUVVJUkVfUElOOgotICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJbU2ltQ21kXSByZXR1cm5TaW1Mb2NrZWRTdGF0dXM6IElDQ19QSU4iKTsKLSAgICAgICAgICAgICAgICByZXN1bHRTdWNjZXNzKHJlc3VsdCwgSWNjU3RhdHVzLklDQ19QSU4pOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIFJFUVVJUkVfUFVLOgotICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICJbU2ltQ21kXSByZXR1cm5TaW1Mb2NrZWRTdGF0dXM6IElDQ19QVUsiKTsKLSAgICAgICAgICAgICAgICByZXN1bHRTdWNjZXNzKHJlc3VsdCwgSWNjU3RhdHVzLklDQ19QVUspOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIExvZy5pKExPR19UQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAiW1NpbUNtZF0gcmV0dXJuU2ltTG9ja2VkU3RhdHVzOiBtU2ltTG9ja2VkU3RhdGU9PU5PTkUgIT8iKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQorICAgIHB1YmxpYyB2b2lkIGdldEljY0NhcmRTdGF0dXMoTW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gICAgICBUZXN0IHRlc3QsIEluc3RydW1lbnRhdGlvbiBpbnN0cnVtZW50YXRpb24pIHsKICAgICAgICAgaWYgKEluc3RydW1lbnRhdGlvblRlc3RDYXNlLmNsYXNzLmlzQXNzaWduYWJsZUZyb20odGVzdC5nZXRDbGFzcygpKSkgewotICAgICAgICAgICAgKChJbnN0cnVtZW50YXRpb25UZXN0Q2FzZSkgdGVzdCkuaW5qZWN0SW5zcnVtZW50YXRpb24oaW5zdHJ1bWVudGF0aW9uKTsKKyAgICAgICAgICAgICgoSW5zdHJ1bWVudGF0aW9uVGVzdENhc2UpIHRlc3QpLmluamVjdEluc3RydW1lbnRhdGlvbihpbnN0cnVtZW50YXRpb24pOwogICAgICAgICB9CiAgICAgfQogCi0gICAgcHVibGljIHZvaWQgc2V0SW5zdHJ1bWVudGFpdG9uKEluc3RydW1lbnRhdGlvbiBpbnN0cnVtZW50YXRpb24pIHsKKyAgICBwdWJsaWMgdm9pZCBzZXRJbnN0cnVtZW50YXRpb24oSW5zdHJ1bWVudGF0aW9uIGluc3RydW1lbnRhdGlvbikgewogICAgICAgICBtSW5zdHJ1bWVudGF0aW9uID0gaW5zdHJ1bWVudGF0aW9uOwogICAgIH0KIAorICAgIC8qKgorICAgICAqIEBkZXByZWNhdGVkIEluY29ycmVjdCBzcGVsbGluZywKKyAgICAgKiB1c2Uge0BsaW5rICNzZXRJbnN0cnVtZW50YXRpb24oYW5kcm9pZC5hcHAuSW5zdHJ1bWVudGF0aW9uKX0gaW5zdGVhZC4KKyAgICAgKi8KKyAgICBARGVwcmVjYXRlZAorICAgIHB1YmxpYyB2b2lkIHNldEluc3RydW1lbnRhaXRvbihJbnN0cnVtZW50YXRpb24gaW5zdHJ1bWVudGF0aW9uKSB7CisgICAgICAgIHNldEluc3RydW1lbnRhdGlvbihpbnN0cnVtZW50YXRpb24pOworICAgIH0KKwogICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCBDbGFzcyBsb2FkU3VpdGVDbGFzcyh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UpIGFuZCByZXR1cm4gaXQgaW5zdGVhZC4gIFRoaXMgY29kZSBpcyBiYXNpY2FsbHkgZ2V0Q2FjaGVEaXIoKSwgZXhjZXB0IGl0IHVzZXMgdGhlIHJlYWwKKyAgICAgKiBjYWNoZSBkaXIgYXMgdGhlIHBhcmVudCBkaXJlY3RvcnkgYW5kIGNyZWF0ZXMgYSB0ZXN0IGNhY2hlIGRpciBpbnNpZGUgdGhhdC4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRmlsZSBnZXRDYWNoZURpcigpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgeworICAgICAgICAgICAgaWYgKG1DYWNoZURpciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUNhY2hlRGlyID0gbmV3IEZpbGUobUZpbGVDb250ZXh0LmdldENhY2hlRGlyKCksIHJlbmFtZWRGaWxlTmFtZSgiY2FjaGUiKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIW1DYWNoZURpci5leGlzdHMoKSkgeworICAgICAgICAgICAgICAgIGlmKCFtQ2FjaGVEaXIubWtkaXJzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLncoIlJlbmFtaW5nRGVsZWdhdGluZ0NvbnRleHQiLCAiVW5hYmxlIHRvIGNyZWF0ZSBjYWNoZSBkaXJlY3RvcnkiKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIEZpbGVVdGlscy5zZXRQZXJtaXNzaW9ucygKKyAgICAgICAgICAgICAgICAgICAgICAgIG1DYWNoZURpci5nZXRQYXRoKCksCisgICAgICAgICAgICAgICAgICAgICAgICBGaWxlVXRpbHMuU19JUldYVXxGaWxlVXRpbHMuU19JUldYR3xGaWxlVXRpbHMuU19JWE9USCwKKyAgICAgICAgICAgICAgICAgICAgICAgIC0xLCAtMSk7CisgICAgICAgICAgICB9CisgICA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DcgQEAKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKGlzU3luY0FjdGl2ZShhY2NvdW50LCBhdXRob3JpdHkpKSB7CisgICAgICAgICAgICBpZiAoQ29udGVudFJlc29sdmVyLmlzU3luY0FjdGl2ZShhY2NvdW50LCBhdXRob3JpdHkpKSB7CiAgICAgICAgICAgICAgICAgY291bnRlciA9IDA7CiAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICB9CkBAIC03MywyNCArNzMsNyBAQAogICAgIH0KIAogICAgIHByb3RlY3RlZCB2b2lkIGNhbmNlbFN5bmNzYW5kRGlzYWJsZUF1dG9TeW5jKCkgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgQ29udGVudFJlc29sdmVyLmdldENvbnRlbnRTZXJ2aWNlKCkuc2V0TGlzdGVuRm9yTmV0d29ya1RpY2tsZXMoZmFsc2UpOwotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICB9Ci0gICAgICAgIG1Db250ZW50UmVzb2x2ZXIuY2FuY2VsU3luYyhudWxsKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBUaGlzIG1ldGhvZCB0ZXN0cyBpZiBhbnkgc3luYyBpcyBhY3RpdmUgb3Igbm90LiBTeW5jIGlzIGNvbnNpZGVyZWQgdG8gYmUgYWN0aXZlIGlmIHRoZQotICAgICAqIGVudHJ5IGlzIGluIGVpdGhlciB0aGUgUGVuZGluZyBvciBBY3RpdmUgdGFibGVzLgotICAgICAqIEByZXR1cm4KLSAgICAgKi8KLSAgICBwcml2YXRlIGJvb2xlYW4gaXNTeW5jQWN0aXZlKFN0cmluZyBhY2NvdW50LCBTdHJpbmcgYXV0aG9yaXR5KSB7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gQ29udGVudFJlc29sdmVyLmdldENvbnRlbnRTZXJ2aWNlKCkuaXNTeW5jQW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cm1hbmNlVGVzdENhc2UuSW50ZXJtZWRpYXRlcyB7CkBAIC04NCw2ICs4NCw3IEBACiAgICAgICAgICAgICBzdXBlcigpOwogICAgICAgICB9CiAKKyAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bihUZXN0UmVzdWx0IHJlc3VsdCkgewogICAgICAgICAgICAgcmVzdWx0LmFkZExpc3RlbmVyKHRoaXMpOwogICAgICAgICAgICAgc3VwZXIucnVuKHJlc3VsdCk7CkBAIC0zMDEsNyArMzAyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKG1Nb2RlID09IFBFUkZPUk1BTkNFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBydW5JblBlcmZvcm1hbmNlTW9kZSh0ZXN0LCBjbGFzc05hbWUsIGZhbHNlLCBjbGFzc05hbWUpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1Nb2RlID09IFBST0ZJTElORykgewotICAgICAgICAgICAgICAgICAgICAgICAgLy9OZWVkIGEgd2F5IHRvIG1hcmsgYSB0ZXN0IHRvIGJlIHJ1biBpbiBwcm9maWxpbmcgbW9kZSBvciBub3QuIAorICAgICAgICAgICAgICAgICAgICAgICAgLy9OZWVkIGEgd2F5IHRvIG1hcmsgYSB0ZXN0IHRvIGJlIHJ1biBpbiBwcm9maWxpbmcgbW9kZSBvciBub3QuCiAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydFByb2ZpbGluZygpOwogICAgICAgICAgICAgICAgICAgICAgICAgdGVzdC5ydW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmlzaFByb2ZpbGluZygpOwpAQCAtMzM3LDYgKzMzOCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBBbmRyb2lkVGVzdENhc2UgdGVzdGNhc2UgPSAoQW5kcm9pZFRlc3RDYXNlKSB0ZXN0OwogICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAg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ZHUoSGV4RHVtcC5oZXhTdHJpbmdUb0J5dGVBcnJheShwZHUpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKHNtcy5nZXRNZXNzYWdlQm9keSgpLAorICAgICAgICAgICAgICAgICIxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExIgorICAgICAgICAgICAgICAgICsgIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCisgICAgICAgICAgICAgICAgKyAiMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIKKyAgICAgICAgICAgICAgICArICIxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiKTsKKworICAgICAgICBwZHUgPSAiMDc5MTYxNjM4Mzg0MDhGNjQ0MEI4MTYxMDUyMjQ0MzFGNzAwMDA3MDYwMjE3MTg1MDAwQTIzMDUwMDAzIgorICAgICAgICAgICAgICAgICsgIjAwMDIwMjYyQjE1ODJDMTY4QkM5NjQzMjk5NEMyNjkzQzk2NDMyOTk0QzI2OTNDOTY0MzI5OTBDIjsKKyAgICAgICAgc21zID0gU21zTWVzc2FnZS5jcmVhdGVGcm9tUGR1KEhleER1bXAuaGV4U3RyaW5nVG9CeXRlQXJyYXkocGR1KSk7CisgICAgICAgIGFzc2VydEVxdWFscygiMTExMTExMTIyMjIyMjIyMjIyMjIyMjIyMjIyMiIsIHNtcy5nZXRNZXNzYWdlQm9keSgpKTsKKyAgICB9CisKKyAgICBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdENQSFNWb2ljZU1haWwoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgLy8gInNldCBNV0kgZmxhZyIKKworICAgICAgICBTdHJpbmcgcGR1ID0gIjA3OTEyMTYwMTMwMzEwRjIwNDA0RDAxMTAwNDEwMDYwNjA2MjcxNzExMThBMDEyMCI7CisKKyAgICAgICAgU21zTWVzc2FnZSBzbXMgPSBTbXNNZXNzYWdlLmNyZWF0ZU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zBFMiIgKworICAgICAgICAgICAgICAgICJBRTNFOTY1MzdCOTRDMDY4REQxNjE3OTc4NEMyRkNCNDFGNEIwOTg1RDA2Qjk1OEFERDAwRkIwRTk0NTM2QUY5NzQ5IiArCisgICAgICAgICAgICAgICAgIjc0REE2RDI4MUJBMDBFOTVFMjZENTA5Qjk0NkZDM0RCRjg3QTI1RDU2QTA0IjsKKworICAgICAgICBTbXNNZXNzYWdlIHNtcyA9IFNtc01lc3NhZ2UuY3JlYXRlRnJvbVBkdShIZXhEdW1wLmhleFN0cmluZ1RvQnl0ZUFycmF5KHBkdSkpOworCisgICAgICAgIGFzc2VydEVxdWFscygiKzE0MTU1NTUxMjEyIiwgc21zLmdldFNlcnZpY2VDZW50ZXJBZGRyZXNzKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoIisxNjUwNTU1MTExMSIsIHNtcy5nZXRPcmlnaW5hdGluZ0FkZHJlc3MoKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiVGVzdCBleHRlbmRlZCBjaGFyYWN0ZXIgdGFibGUgLiwtIT9Afl9cXC8mXCInO158OigpPHt9PltdPSUqKyMiLAorICAgICAgICAgICAgICAgIHNtcy5nZXRNZXNzYWdlQm9keSgpKTsKKyAgICB9CisKKyAgICBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdERlY29kZSgpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBieXRlW10gc2VwdGV0cyA9IG5ldyBieXRlWyg3ICogMTI4ICsgNykgLyA4XTsKKworICAgICAgICBpbnQgYml0T2Zmc2V0ID0gMDsKKworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDEyODsgaSsrKSB7CisgICAgICAgICAgICBpbnQgdjsKKyAgICAgICAgICAgIGlmIChpID09IDB4MWIpIHsKKyAgICAgICAgICAgICAgICAvLyBleHRlbmRlZCBlc2NhcGUgY2hhcgorICAgICAgICAgICAgICAgIHYgPSAwOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAg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ICAgKyAiMTY4QkM1NjJCMTU4MkMxNjhCQzU2MkIxNTgyQzE2OEJDNTYyQjE1ODJDMTY4QkM1NjJCMTU4MkMiCi0gICAgICAgICAgICAgICAgKyAiMTY4QkM1NjJCMTU4MkMxNjhCQzU2MkIxNTgyQzE2OEJDNTYyQjE1ODJDMTY4QkM1NjJCMTU4MkMiCi0gICAgICAgICAgICAgICAgKyAiMTY4QkM1NjJCMTU4MkMxNjhCQzU2MkIxNTgyQzE2OEJDNTYyQjE1ODJDMTY4QkM1NjJCMTU4MkMiCi0gICAgICAgICAgICAgICAgKyAiMTY4QkM1NjJCMTU4MkMxNjhCQzU2MkIxNTgyQzE2OEJDNTYyQjE1ODJDMTY4QkM1NjIiOwotICAgICAgICBzbXMgPSBTbXNNZXNzYWdlLmNyZWF0ZUZyb21QZHUoSGV4RHVtcC5oZXhTdHJpbmdUb0J5dGVBcnJheShwZHUpKTsKLSAgICAgICAgYXNzZXJ0RXF1YWxzKHNtcy5nZXRNZXNzYWdlQm9keSgpLAotICAgICAgICAgICAgICAgICIxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExIgotICAgICAgICAgICAgICAgICAgICAgICAgKyAiMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCi0gICAgICAgICAgICAgICAgICAgICAgICArICIxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiKTsKLQotICAgICAgICBwZHUgPSAiMDc5MTYxNjM4Mzg0MDhGNjQ0MEI4MTYxMDUyMjQ0MzFGNzAwMDA3MDYwMjE3MTg1MDAwQTIzMDUwMDAzIgotICAgICAgICAgICAgICAgICsgIjAwMDIwMjYyQjE1ODJDMTY4QkM5NjQzMjk5NEMyNjkzQzk2NDMyOTk0QzI2OTNDOTY0MzI5OTBDIjsKLSAgICAgICAgc21zID0gU21zTWVz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GVydHlOb2RlPj4oKTsKLSAgICAgICAgICAgIGZvciAoUHJvcGVydHlOb2RlIHByb3BlcnR5Tm9kZSA6IG5vZGVzKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHByb3BOYW1lID0gcHJvcGVydHlOb2RlLnByb3BOYW1lOwotICAgICAgICAgICAgICAgIFZlY3RvcjxQcm9wZXJ0eU5vZGU+IGV4cGVjdGVkTm9kZXMgPQotICAgICAgICAgICAgICAgICAgICBtUHJvcGVydHlOb2RlTWFwLmdldChwcm9wTmFtZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkTm9kZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBleHBlY3RlZE5vZGVzID0gbmV3IFZlY3RvcjxQcm9wZXJ0eU5vZGU+KCk7Ci0gICAgICAgICAgICAgICAgICAgIG1Qcm9wZXJ0eU5vZGVNYXAucHV0KHByb3BOYW1lLCBleHBlY3RlZE5vZGVzKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZXhwZWN0ZWROb2Rlcy5hZGQocHJvcGVydHlOb2RlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgcHVibGljIHZvaWQgdmVyaWZ5KFZOb2RlIHZub2RlKSB7Ci0gICAgICAgICAgICBmb3IgKFByb3BlcnR5Tm9kZSBwcm9wZXJ0eU5vZGUgOiB2bm9kZS5wcm9wTGlzdCkgewotICAgICAgICAgICAgICAgIFN0cmluZyBwcm9wTmFtZSA9IHByb3BlcnR5Tm9kZS5wcm9wTmFtZTsKLSAgICAgICAgICAgICAgICBWZWN0b3I8UHJvcGVydHlOb2RlPiBub2RlcyA9IG1Qcm9wZXJ0eU5vZGVNYXAuZ2V0KHByb3BOYW1lKTsKLSAgICAgICAgICAgICAgICBpZiAobm9kZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBmYWlsKCJVbmV4cGVjdGVkIHByb3BOYW1lIFwiIiArIHByb3BOYW1lICsgIlwiIGV4aXN0cy4iKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBzdWNjZXNzZnVsID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaW50IHNpemUgPSBub2Rlcy5zaXplKCk7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgUHJvcGVydHlOb2RlIGV4cGVjdGVkTm9kZSA9IG5vZGVzLmdldChpKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkTm9kZS5wcm9wTmFtZS5lcXVhbHMocHJvcE5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXhwZWN0ZWROb2RlLmVxdWFscyhwcm9wZXJ0eU5vZGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2Vzc2Z1bCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZXMucmVtb3ZlKGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChub2Rlcy5zaXplKCkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJvcGVydHlOb2RlTWFwLnJlbW92ZShwcm9wTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKCJQcm9wZXJ0eSBcIiIgKyBwcm9wTmFtZSArICJcIiBoYXMgd3JvbmcgdmFsdWUuXG4iIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiZXhwZWN0ZWQ6ICIgKyBleHBlY3RlZE5vZGUudG9TdHJpbmcoKSAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIlxuICBhY3R1YWw6ICIgKyBwcm9wZXJ0eU5vZGUudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzZnVsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZhaWwoIlVuZXhwZWN0ZWQgcHJvcGVydHkgXCIiICsgcHJvcE5hbWUgKyAiXCIgZXhpc3RzLiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtUHJvcGVydHlOb2RlTWFwLnNpemUoKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgVmVjdG9yPFN0cmluZz4gZXhwZWN0ZWRQcm9wcyA9IG5ldyBWZWN0b3I8U3RyaW5nPigpOwotICAgICAgICAgICAgICAgIGZvciAoVmVjdG9yPFByb3BlcnR5Tm9kZT4gbm9kZXMgOiBtUHJvcGVydHlOb2RlTWFwLnZhbHVlcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoUHJvcGVydHlOb2RlIG5vZGUgOiBub2RlcykgewotICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRQcm9wcy5hZGQobm9kZS5wcm9wTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmFpbCgiZXhwZWN0ZWQgcHJvcHMgIiArIEFycmF5cy50b1N0cmluZyhleHBlY3RlZFByb3BzLnRvQXJyYXkoKSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgIiB3YXMgbm90IGZvdW5kIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgCi0gICAgcHVibGljIHZvaWQgdGVzdFYyMVNpbXBsZUNhc2UoKSB0aHJvd3MgSU9Fe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KLSAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LCAweDA3LAotICAgICAgICAgICAgICAgIDB4MDgsIDB4MDksIDB4MGEsIDB4MGIsIDB4MTAsIDB4MDAsIDB4MDIsIDB4MDEsIDB4MDMsIDB4MDMsIDB4MDIsCi0gICAgICAgICAgICAgICAgMHgwNCwgMHgwMywgMHgwNSwgMHgwNSwgMHgwNCwgMHgwNCwgMHgwMCwgMHgwMCwgMHgwMSwgMHg3ZCwgMHgwMSwKLSAgICAgICAgICAgICAgICAweDAyLCAweDAzLCAweDAwLCAweDA0LCAweDExLCAweDA1LCAweDEyLCAweDIxLCAweDMxLCAweDQxLCAweDA2LAotICAgICAgICAgICAgICAgIDB4MTMsIDB4NTEsIDB4NjEsIDB4MDcsIDB4MjIsIDB4NzEsIDB4MTQsIDB4MzIsIDB4ODEsIDB4OTEsIDB4YTEsCi0gICAgICAgICAgICAgICAgMHgwOCwgMHgyMywgMHg0MiwgMHhiMSwgMHhjMSwgMHgxNSwgMHg1MiwgMHhkMSwgMHhmMCwgMHgyNCwgMHgzMywKLSAgICAgICAgICAgICAgICAweDYyLCAweDcyLCAweDgyLCAweDA5LCAweDBhLCAweDE2LCAweDE3LCAweDE4LCAweDE5LCAweDFhLCAweDI1LAotICAgICAgICAgICAgICAgIDB4MjYsIDB4MjcsIDB4MjgsIDB4MjksIDB4MmEsIDB4MzQsIDB4MzUsIDB4MzYsIDB4MzcsIDB4MzgsIDB4MzksCi0gICAgICAgICAgICAgICAgMHgzYSwgMHg0MywgMHg0NCwgMHg0NSwgMHg0NiwgMHg0NywgMHg0OCwgMHg0OSwgMHg0YSwgMHg1MywgMHg1NCwKLSAgICAgICAgICAgICAgICAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LCAweDY2LCAweDY3LAotICAgICAgICAgICAgICAgIDB4Njg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ICBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJGTiIsICJKb2UgRHVlIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk9SRyIsIAotICAgICAgICAgICAgICAgICAgICAgICAgIkd1bXAgU2hyaW1wIENvLjtTYWxlcyBEZXB0LjtNYW5hZ2VyO0Zpc2gga2VlcGVyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIkd1bXAgU2hyaW1wIENvLiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTYWxlcyBEZXB0LjtNYW5hZ2VyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpc2gga2VlcGVyIiksCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJST0xFIiwgIkZpc2ggQ2FrZSBLZWVwZXIhIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRJVExFIiwgIlNocmltcCBNYW4iLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiWC1DTEFTUyIsICJQVUJMSUMiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIigxMTEpIDU1NS0xMjEyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIldPUksiLCAiVk9JQ0UiKSksIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIoNDA0KSA1NTUtMTIxMiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJIT01FIiwgIlZPSUNFIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMDMxMTExMTExMSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJDRUxMIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMDMyMjIyMjIyMiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJWSURFTyIpKSwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjAzMzMzMzMzMzMiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiVk9JQ0UiKSksIG51bGwpLCAgICAgCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiQURSIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI7OzEwMCBXYXRlcnMgRWRnZTtCYXl0b3duO0xBOzMwMzE0O1VuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCIiLCAiIiwgIjEwMCBXYXRlcnMgRWRnZSIsICJCYXl0b3duIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkxBIiwgIjMwMzE0IiwgIlVuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiV09SSyIpKSwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiTEFCRUwiLAotICAgICAgICAgICAgICAgICAgICAgICAgIjEwMCBXYXRlcnMgRWRnZVxyXG5CYXl0b3duLCBMQSAzMDMxNFxyXG5Vbml0ZWQgIFN0YXRlcyBvZiBBbWVyaWNhIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIGNvbnRlbnRWYWx1ZXNGb3JRUCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiV09SSyIpKSwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiQURSIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI7OzQyIFBsYW50YXRpb24gU3QuO0JheXRvd247TEE7MzAzMTQ7VW5pdGVkIFN0YXRlcyBvZiBBbWVyaWNhIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIiIsICIiLCAiNDIgUGxhbnRhdGlvbiBTdC4iLCAiQmF5dG93biIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJMQSIsICIzMDMxNCIsICJVbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2EiKSwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiSE9NRSIpKSwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiTEFCRUwiLAotICAgICAgICAgICAgICAgICAgICAgICAgIjQyIFBsYW50YXRpb24gU3QuXHJcbkJheXRvd24sIExBIDMwMzE0XHJcblVuaXRlZCAgU3RhdGVzIG9mIEFtZXJpY2EiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclFQLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJIT01FIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJFTUFJTCIsICJmb3JyZXN0Z3VtcEB3YWxsYWRhbGxhLmNvbSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJQUkVGIiwgIklOVEVSTkVUIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJFTUFJTCIsICJjZWxsQGV4YW1wbGUuY29tIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIkNFTEwiKSksIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk5PVEUiLCAiVGhlIGZvbGxvd2luZyBub3RlIGlzIHRoZSBleGFtcGxlIGZyb20gUkZDIDIwNDUuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk5PVEUiLAotICAgICAgICAgICAgICAgICAgICAgICAgIk5vdydzIHRoZSB0aW1lIGZvciBhbGwgZm9sayB0byBjb21lIHRvIHRoZSBhaWQgb2YgdGhlaXIgY291bnRyeS4iLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclFQLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJQSE9UTyIsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBwaG90b0J5dGVBcnJheSwgY29udGVudFZhbHVlc0ZvclBob3RvLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJKUEVHIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJYLUFUVFJJQlVURSIsICJTb21lIFN0cmluZyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJCREFZIiwgIjE5ODAwMTAxIiwgCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJHRU8iLCAiMzUuNjU2Mzg1NCwxMzkuNjk5NDIzMyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJVUk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m9yU2hpZnRKaXMsIG51bGwsIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIkZOIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTVCODlcdTg1RTRcdTAwMjBcdTMwRURcdTMwQTRcdTMwQzlcdTAwMjBcdTAwMzEiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJTT1VORCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAoIlx1RkY3MVx1RkY5RFx1RkY4NFx1RkY5RVx1RkY3MyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIjtcdUZGOUJcdUZGNzJcdUZGODRcdUZGOUVcdTAwMzE7OzsiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIGNvbnRlbnRWYWx1ZXNGb3JTaGlmdEppcywKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1JUk1DLU4iKSksIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIkFEUiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAoIjtcdTY3NzFcdTRFQUNcdTkwRkRcdTZFMEJcdThDMzdcdTUzM0FcdTY4NUMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTMwRUJcdTMwRUFcdTMwQTJcdTMwRjNcdTMwQkZcdTMwRUZcdTMwRkNcdTAwMzYiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTk2OEU7Ozs7MTUwLTg1MTI7IiksCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHU2NzcxXHU0RUFDXHU5MEZEXHU2RTBCXHU4QzM3XHU1MzNBXHU2ODVDIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlx1MzBFQlx1MzBFQVx1MzBBMlx1MzBGM1x1MzBCRlx1MzBFRlx1MzBGQyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHUwMDM2XHU5NjhFIiwgIiIsICIiLCAiIiwgIjE1MC04NTEyIiwgIiIpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgY29udGVudFZhbHVlc0ZvclFQLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJIT01FIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJOT1RFIiwgIlx1MzBFMVx1MzBFMiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBjb250ZW50VmFsdWVzRm9yUVAsIG51bGwsIG51bGwpKTsKLSAgICAgICAgdmVyaWZpZXIudmVyaWZ5KGJ1aWxkZXIudk5vZGVMaXN0LmdldCgwKSk7Ci0gICAgfQotICAgIAotICAgIHB1YmxpYyB2b2lkIHRlc3RWMjFNdWx0aXBsZUVudHJ5Q2FzZSgpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBWQ2FyZFBhcnNlcl9WMjEgcGFyc2VyID0gbmV3IFZDYXJkUGFyc2VyX1YyMSgpOwotICAgICAgICBWRGF0YUJ1aWxkZXIgYnVpbGRlciA9IG5ldyBWRGF0YUJ1aWxkZXIoKT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tm9kZSgiU09VTkQiLAotICAgICAgICAgICAgICAgICAgICAgICAgIlx1RkY3MVx1RkY5RFx1RkY4NFx1RkY5RVx1RkY3M1x1RkY5Qlx1RkY3Mlx1RkY4NFx1RkY5RVx1MDAzMzs7OzsiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJYLUlSTUMtTiIpKSwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjkiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtU0VDUkVUIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIxMCIsCi0gICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtSE9URUwiKSksIG51bGwpLAotICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjExIiwKLSAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJYLU5FQy1TQ0hPT0wiKSksIG51bGwpLAotICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjEyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJGQVgiLCAiSE9NRSIpKSwgbnVsbCkpOwotICAgICAgICB2ZXJpZmllci52ZXJpZnkoYnVpbGRlci52Tm9kZUxpc3QuZ2V0KDApKTsKLSAgICAgICAgCi0gICAgICAgIHZlcmlmaWVyID0gbmV3IFByb3BlcnR5Tm9kZXNWZXJpZmllcigKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJWRVJTSU9OIiwgIjIuMSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJOIiwgIlx1NUI4OVx1ODVFNFx1MzBFRFx1MzBBNFx1MzBDOVx1MDAzNDs7OzsiLAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiXHU1Qjg5XHU4NUU0XHUzMEVEXHUzMEE0XHUzMEM5XHUwMDM0IiwgIiIsICIiLCAiIiwgIiIpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJTT1VORCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjcxXHVGRjlEXHVGRjg0XHVGRjlFXHVGRjczXHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDM0Ozs7OyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBjb250ZW50VmFsdWVzRm9yU2hpZnRKaXMsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtSVJNQy1OIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTMiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiTU9ERU0iKSksIG51bGwpLAotICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjE0IiwKLSAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJQQUdFUiIpKSwgbnVsbCksCi0gICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTUiLAotICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtTkVDLUZBTUlMWSIpKSwgbnVsbCksCi0gICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTYiLAotICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtTkVDLUdJUkwiKSksIG51bGwpKTsKLSAgICAgICAgdmVyaWZpZXIudmVyaWZ5KGJ1aWxkZXIudk5vZGVMaXN0LmdldCgxKSk7Ci0gICAgICAgIHZlcmlmaWVyID0gbmV3IFByb3BlcnR5Tm9kZXNWZXJpZmllcigKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJWRVJTSU9OIiwgIjIuMSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJOIiwgIlx1NUI4OVx1ODVFNFx1MzBFRFx1MzBBNFx1MzBDOVx1MDAzNTs7OzsiLAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiXHU1Qjg5XHU4NUU0XHUzMEVEXHUzMEE0XHUzMEM5XHUwMDM1IiwgIiIsICIiLCAiIiwgIiIpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLCBudWxsLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJTT1VORCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjcxXHVGRjlEXHVGRjg0XHVGRjlFXHVGRjczXHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDM1Ozs7OyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBjb250ZW50VmFsdWVzRm9yU2hpZnRKaXMsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtSVJNQy1OIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTciLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtQk9ZIikpLCBudWxsKSwKLSAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIxOCIsCi0gICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtRlJJRU5EIikpLCBudWxsKSwK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AgICAgIFByb3BlcnR5Tm9kZXNWZXJpZmllciB2ZXJpZmllciA9IG5ldyBQcm9wZXJ0eU5vZGVzVmVyaWZpZXIoCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVkVSU0lPTiIsICIzLjAiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiRk4iLCAiQW5kIFJvaWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiTiIsICJBbmQ7Um9pZDs7OyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCJBbmQiLCAiUm9pZCIsICIiLCAiIiwgIiIpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiT1JHIiwgIk9wZW47SGFuZHNldDsgQWxsaWFuY2UiLAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiT3BlbiIsICJIYW5kc2V0IiwgIiBBbGxpYW5jZSIpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCi0gICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiU09SVC1TVFJJTkciLCAiYW5kcm9pZCIsIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAotICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIwMzAwMDAwMDAwIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcg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ICAgZ2V0Q29udGV4dCgpLCAvLyBUaGUgY29udGV4dCB0aGF0IGZpbGUgbWV0aG9kcyBhcmUgZGVsZWdhdGVkIHRvCisgICAgICAgICAgICAgICAgZmlsZW5hbWVQcmVmaXgpOworICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBuZXcgSXNvbGF0ZWRDb250ZXh0KHJlc29sdmVyLCB0YXJnZXRDb250ZXh0V3JhcHBlcik7CisgICAgICAgIHNldENvbnRleHQoY29udGV4dCk7CisgICAgfQorCisgICAgcHVibGljIGNsYXNzIEFjY291bnRTb3J0ZXIgaW1wbGVtZW50cyBDb21wYXJhdG9yPEFjY291bnQ+IHsKKyAgICAgICAgcHVibGljIGludCBjb21wYXJlKEFjY291bnQgb2JqZWN0MSwgQWNjb3VudCBvYmplY3QyKSB7CisgICAgICAgICAgICBpZiAob2JqZWN0MSA9PSBvYmplY3QyKSByZXR1cm4gMDsKKyAgICAgICAgICAgIGlmIChvYmplY3QxID09IG51bGwpIHJldHVybiAxOworICAgICAgICAgICAgaWYgKG9iamVjdDIgPT0gbnVsbCkgcmV0dXJuIC0xOworICAgICAgICAgICAgaW50IHJlc3VsdCA9IG9iamVjdDEudHlwZS5jb21wYXJlVG8ob2JqZWN0Mi50eXBlKTsKKyAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gMCkgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgICAgIHJldHVybiBvYmplY3QxLm5hbWUuY29tcGFyZVRvKG9iamVjdDIubmFtZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0Q2hlY2tBZGRBY2NvdW50KCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgIEFjY291bnRNYW5hZ2VyU2VydmljZSBhbXMgPSBuZXcgQWNjb3VudE1hbmFnZXJTZXJ2aWNlKGdldENvbnRleHQoKSk7CisgICAgICAgIEFjY291bnQgYTExID0gbmV3IEFjY291bnQoImFjY291bnQxIiwgInR5cGUxIik7CisgICAgICAgIEFjY291bnQgYTIxID0gbmV3IEFjY291bnQoImFjY291bnQyIiwgInR5cGUxIik7CisgICAgICAgIEFjY291bnQgYTMxID0gbmV3IEFjY291bnQoImFjY291bnQzIiwgInR5cGUxIik7CisgICAgICAgIEFjY291bnQgYTEyID0gbmV3IEFjY291bnQoImFjY291bnQxIiwgInR5cGUyIik7CisgICAgICAgIEFjY291bnQgYTIyID0gbmV3IEFjY291bnQoImFjY291bnQyIiwgInR5cGUyIik7CisgICAgICAgIEFjY291bnQgYTMyID0gbmV3IEFjY291bnQoImFjY291bnQzIiwgInR5cGUyIik7CisgICAgICAgIGFtcy5hZGRBY2NvdW50KGExMSwgInAxMSIsIG51bGwpOworICAgICAgICBhbXMuYWRkQWNjb3VudChhMTIsICJwMTIiLCBudWxsKTsKKyAgICAgICAgYW1zLmFkZEFjY291bnQoYTIxLCAicDIxIiwgbnVsbCk7CisgICAgICAgIGFtcy5hZGRBY2NvdW50KGEyMiwgInAyMiIsIG51bGwpOworICAgICAgICBhbXMuYWRkQWNjb3VudChhMzEsICJwMzEiLCBudWxsKTsKKyAgICAgICAgYW1zLmFkZEFjY291bnQoYTMyLCAicDMyIiwgbnVsbCk7CisKKyAgICAgICAgQWNjb3VudFtdIGFjY291bnRzID0gYW1zLmdldEFjY291bnRzKG51bGwpOworICAgICAgICBBcnJheXMuc29ydChhY2NvdW50cywgbmV3IEFjY291bnRTb3J0ZXIoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyg2LCBhY2NvdW50cy5sZW5ndGgpOworICAgICAgICBhc3NlcnRFcXVhbHMoYTExLCBhY2NvdW50c1swXSk7CisgICAgICAgIGFzc2VydEVxdWFscyhhMjEsIGFjY291bnRzWzFdKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKGEzMSwgYWNjb3VudHNbMl0pOworICAgICAgICBhc3NlcnRFcXVhbHMoYTEyLCBhY2NvdW50c1szXSk7CisgICAgICAgIGFzc2VydEVxdWFscyhhMjIsIGFjY291bnRzWzRdKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKGEzMiwgYWNjb3VudHNbNV0pOworCisgICAgICAgIGFjY291bnRzID0gYW1zLmdldEFjY291bnRzQnlUeXBlKCJ0eXBlMSIgKTsKKyAgICAgICAgQXJyYXlzLnNvcnQoYWNjb3VudHMsIG5ldyBBY2NvdW50U29ydGVyKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMywgYWNjb3VudHMubGVuZ3RoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKGExMSwgYWNjb3VudHNbMF0pOworICAgICAgICBhc3NlcnRFcXVhbHMoYTIxLCBhY2NvdW50c1sxXSk7CisgICAgICAgIGFzc2VydEVxdWFscyhhMzEsIGFjY291bnRzWzJdKTsKKworICAgICAgICBhbXMucmVtb3ZlQWNjb3VudChudWxsLCBhMjEpOworCisgICAgICAgIGFjY291bnRzID0gYW1zLmdldEFjY291bnRzQnlUeXBlKCJ0eXBlMSIgKTsKKyAgICAgICAgQXJyYXlzLnNvcnQoYWNjb3VudHMsIG5ldyBBY2NvdW50U29ydGVyKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMiwgYWNjb3VudHMubGVuZ3RoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKGExMSwgYWNjb3VudHNbMF0pOworICAgICAgICBhc3NlcnRFcXVhbHMoYTMxLCBhY2NvdW50c1sxXSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdFBhc3N3b3JkcygpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBBY2NvdW50TWFuYWdlclNlcnZpY2UgYW1zID0gbmV3IEFjY291bnRNYW5hZ2VyU2VydmljZShnZXRDb250ZXh0KCkpOworICAgICAgICBBY2NvdW50IGExMSA9IG5ldyBBY2NvdW50KCJhY2NvdW50MSIsICJ0eXBlMSIpOworICAgICAgICBBY2NvdW50IGExMiA9IG5ldyBBY2NvdW50KCJhY2NvdW50MSIsICJ0eXBlMiIpOworICAgICAgICB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0RXF1YWxzKCJjX2ExMiIsIGFtcy5nZXRVc2VyRGF0YShhMTIsICJjIikpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RBdXRodG9rZW5zKCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgICAgIEFjY291bnRNYW5hZ2VyU2VydmljZSBhbXMgPSBuZXcgQWNjb3VudE1hbmFnZXJTZXJ2aWNlKGdldENvbnRleHQoKSk7CisgICAgICAgIEFjY291bnQgYTExID0gbmV3IEFjY291bnQoImFjY291bnQxIiwgInR5cGUxIik7CisgICAgICAgIEFjY291bnQgYTEyID0gbmV3IEFjY291bnQoImFjY291bnQxIiwgInR5cGUyIik7CisgICAgICAgIGFtcy5hZGRBY2NvdW50KGExMSwgInAxMSIsIG51bGwpOworICAgICAgICBhbXMuYWRkQWNjb3VudChhMTIsICJwMTIiLCBudWxsKTsKKworICAgICAgICBhbXMuc2V0QXV0aFRva2VuKGExMSwgImF0dDEiLCAiYTExX2F0dDEiKTsKKyAgICAgICAgYW1zLnNldEF1dGhUb2tlbihhMTEsICJhdHQyIiwgImExMV9hdHQyIik7CisgICAgICAgIGFtcy5zZXRBdXRoVG9rZW4oYTExLCAiYXR0MyIsICJhMTFfYXR0MyIpOworICAgICAgICBhbXMuc2V0QXV0aFRva2VuKGExMiwgImF0dDEiLCAiYTEyX2F0dDEiKTsKKyAgICAgICAgYW1zLnNldEF1dGhUb2tlbihhMTIsICJhdHQyIiwgImExMl9hdHQyIik7CisgICAgICAgIGFtcy5zZXRBdXRoVG9rZW4oYTEyLCAiYXR0MyIsICJhMTJfYXR0MyIpOworCisgICAgICAgIGFzc2VydEVxdWFscygiYTExX2F0dDEiLCBhbXMucGVla0F1dGhUb2tlbihhMTEsICJhdHQxIikpOworICAgICAgICBhc3NlcnRFcXVhbHMoImExMV9hdHQyIiwgYW1zLnBlZWtBdXRoVG9rZW4oYTExLCAiYXR0MiIpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJhMTFfYXR0MyIsIGFtcy5wZWVrQXV0aFRva2VuKGExMSwgImF0dDMiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiYTEyX2F0dDEiLCBhbXMucGVla0F1dGhUb2tlbihhMTIsICJhdHQxIikpOworICAgICAgICBhc3NlcnRFcXVhbHMoImExMl9hdHQyIiwgYW1zLnBlZWtBdXRoVG9rZW4oYTEyLCAiYXR0MiIpKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJhMTJfYXR0MyIsIGFtcy5wZWVrQXV0aFRva2VuKGExMiwgImF0dDMiKSk7CisKKyAgICAgICAgYW1zLnNldEF1dGhUb2tlbihhMTEsICJhdHQzIiwgImExMV9hdHQzYiIpOworICAgICAgICBhbXMuaW52YWxpZGF0ZUF1dGhUb2tlbihhMTIudHlwZSwgImExMl9hdHQyIik7CisKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJhMTFfYXR0MSIsIGFtcy5wZWVrQXV0aFRva2VuKGExMSwgImF0dDEiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiYTExX2F0dDIiLCBhbXMucGVla0F1dGhUb2tlbihhMTEsICJhdHQyIikpOworICAgICAgICBhc3NlcnRFcXVhbHMoImExMV9hdHQzYiIsIGFtcy5wZWVrQXV0aFRva2VuKGExMSwgImF0dDMiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiYTEyX2F0dDEiLCBhbXMucGVla0F1dGhUb2tlbihhMTIsICJhdHQxIikpOworICAgICAgICBhc3NlcnROdWxsKGFtcy5wZWVrQXV0aFRva2VuKGExMiwgImF0dDIiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiYTEyX2F0dDMiLCBhbXMucGVla0F1dGhUb2tlbihhMTIsICJhdHQzIikpOworCisgICAgICAgIGFzc2VydE51bGwoYW1zLnJlYWRBdXRoVG9rZW5Gcm9tRGF0YWJhc2UoYTEyLCAiYXR0MiIpKTsKKyAgICB9Cit9ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpka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GVydHlOb2RlKAorICAgICAgICAgICAgU3RyaW5nIHByb3BOYW1lLCBTdHJpbmcgcHJvcFZhbHVlLCBMaXN0PFN0cmluZz4gcHJvcFZhbHVlX3ZlY3RvciwKKyAgICAgICAgICAgIGJ5dGVbXSBwcm9wVmFsdWVfYnl0ZXMsIENvbnRlbnRWYWx1ZXMgcGFyYW1NYXAsIFNldDxTdHJpbmc+IHBhcmFtTWFwX1RZUEUsCisgICAgICAgICAgICBTZXQ8U3RyaW5nPiBwcm9wR3JvdXBTZXQpIHsKKyAgICAgICAgaWYgKHByb3BOYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRoaXMucHJvcE5hbWUgPSBwcm9wTmFtZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRoaXMucHJvcE5hbWUgPSAiIjsKKyAgICAgICAgfQorICAgICAgICBpZiAocHJvcFZhbHVlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRoaXMucHJvcFZhbHVlID0gcHJvcFZhbHVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhpcy5wcm9wVmFsdWUgPSAiIjsKKyAgICAgICAgfQorICAgICAgICBpZiAocHJvcFZhbHVlX3ZlY3RvciAhPSBudWxsKSB7CisgICAgICAgICAgICB0aGlzLnByb3BWYWx1ZV92ZWN0b3IgPSBwcm9wVmFsdWVfdmVjdG9yOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhpcy5wcm9wVmFsdWVfdmVjdG9yID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7CisgICAgICAgIH0KKyAgICAgICAgdGhpcy5wcm9wVmFsdWVfYnl0ZXMgPSBwcm9wVmFsdWVfYnl0ZXM7CisgICAgICAgIGlmIChwYXJhbU1hcCAhPSBudWxsKSB7CisgICAgICAgICAgICB0aGlzLnBhcmFtTWFwID0gcGFyYW1NYXA7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB0aGlzLnBhcmFtTWFwID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocGFyYW1NYXBfVFlQRSAhPSBudWxsKSB7CisgICAgICAgICAgICB0aGlzLnBhcmFtTWFwX1RZUEUgPSBwYXJhbU1hcF9UWVBFOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhpcy5wYXJhbU1hcF9UWVBFID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOworICAgICAgICB9CisgICAgICAgIGlmIChwcm9wR3JvdXBTZXQgIT0gbnVsbCkgeworICAgICAgICAgICAgdGhpcy5wcm9wR3JvdXBTZXQgPSBwcm9wR3JvdXBTZXQ7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB0aGlzLnByb3BHcm91cFNldCA9IG5ldyBIYXNoU2V0PFN0cmluZz4oKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgeworICAgICAgICBpZiAoIShvYmogaW5zdGFuY2VvZiBQcm9wZXJ0eU5vZGUpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIFByb3BlcnR5Tm9kZSBub2RlID0gKFByb3BlcnR5Tm9kZSlvYmo7CisgICAgICAgIAorICAgICAgICBpZiAocHJvcE5hbWUgPT0gbnVsbCB8fCAhcHJvcE5hbWUuZXF1YWxzKG5vZGUucHJvcE5hbWUpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0gZWxzZSBpZiAoIXBhcmFtTWFwLmVxdWFscyhub2RlLnBhcmFtTWFwKSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9IGVsc2UgaWYgKCFwYXJhbU1hcF9UWVBFLmVxdWFscyhub2RlLnBhcmFtTWFwX1RZUEUpKSB7CisgICAgICAgICAgICByZXR1cm4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gICAgICAgICAgICAgbm9kZS5wcm9wVmFsdWVfdmVjdG9yLnNpemUoKSA9PSAxKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICBidWlsZGVyLmFwcGVuZCgicHJvcE5hbWU6ICIpOworICAgICAgICBidWlsZGVyLmFwcGVuZChwcm9wTmFtZSk7CisgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIHBhcmFtTWFwOiAiKTsKKyAgICAgICAgYnVpbGRlci5hcHBlbmQocGFyYW1NYXAudG9TdHJpbmcoKSk7CisgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIHByb3BtTWFwX1RZUEU6ICIpOworICAgICAgICBidWlsZGVyLmFwcGVuZChwYXJhbU1hcF9UWVBFLnRvU3RyaW5nKCkpOworICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCBwcm9wR3JvdXBTZXQ6ICIpOworICAgICAgICBidWlsZGVyLmFwcGVuZChwcm9wR3JvdXBTZXQudG9TdHJpbmcoKSk7CisgICAgICAgIGlmIChwcm9wVmFsdWVfdmVjdG9yICE9IG51bGwgJiYgcHJvcFZhbHVlX3ZlY3Rvci5zaXplKCkgPiAxKSB7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCBwcm9wVmFsdWVfdmVjdG9yIHNpemU6ICIpOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQocHJvcFZhbHVlX3ZlY3Rvci5zaXplKCkpOworICAgICAgICB9CisgICAgICAgIGlmIChwcm9wVmFsdWVfYnl0ZXMgIT0gbnVsbCkgeworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgcHJvcFZhbHVlX2J5dGVzIHNpemU6ICIpOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQocHJvcFZhbHVlX2J5dGVzLmxlbmd0aCk7CisgICAgICAgIH0KKyAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgcHJvcFZhbHVlOiAiKTsKKyAgICAgICAgYnVpbGRlci5hcHBlbmQocHJvcFZhbHVlKTsKKyAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogRW5jb2RlIHRoaXMgb2JqZWN0IGludG8gYSBzdHJpbmcgd2hpY2ggY2FuIGJlIGRlY29kZWQuIAorICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgZW5jb2RlKCkgeworICAgICAgICAvLyBQcm9wZXJ0eU5vZGUjdG9TdHJpbmcoKSBpcyBmb3IgcmVhZGluZywgbm90IGZvciBwYXJzaW5nIGluIHRoZSBmdXR1cmUuCisgICAgICAgIC8vIFdlIGNvbnN0cnVjdCBhcHByb3ByaWF0ZSBTdHJpbmcgaGVyZS4KKyAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgaWYgKHByb3BOYW1lLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoInByb3BOYW1lOlsiKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKHByb3BOYW1lKTsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJdLCIpOworICAgICAgICB9CisgICAgICAgIGludCBzaXplID0gcHJvcEdyb3VwU2V0LnNpemUoKTsKKyAgICAgICAgaWYgKHNpemUgPiAwKSB7CisgICAgICAgICAgICBTZXQ8U3RyaW5nPiBzZXQgPSBwcm9wR3JvdXBTZXQ7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgicHJvcEdyb3VwOlsiKTsKKyAgICAgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIGdyb3VwIDogc2V0KSB7CisgICAgICAgICAgICAgICAgLy8gV2UgZG8gbm90IG5lZWQgdG8gZG91YmxlIHF1b3RlIGdyb3Vwcy4KKyAgICAgICAgICAgICAgICAvLyBncm91cCAgICAgICAgPSAxKihBTFBIQSAvIERJR0lUIC8gIi0iKQorICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGdyb3VwKTsKKyAgICAgICAgICAgICAgICBpZiAoaSA8IHNpemUgLSAxKSB7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJdLCIpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBhcmFtTWFwLnNpemUoKSA+IDAgfHwgcGFyYW1NYXBfVFlQRS5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IHBhcmFtTWFwOworICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoInBhcmFtTWFwOlsiKTsKKyAgICAgICAgICAgIHNpemUgPSBwYXJhbU1hcC5zaXplKCk7IAorICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgZm9yIChFbnRyeTxTdHJpbmcsIE9iamVjdD4gZW50cnkgOiB2YWx1ZXMudmFsdWVTZXQoKSkgeworICAgICAgICAgICAgICAgIC8vIEFzc3VtaW5nIHBhcmFtLWtleSBkb2VzIG5vdCBjb250YWluIE5PTi1BU0NJSSBub3Igc3ltYm9scy4KKyAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgIC8vIEFjY29yZGluZyB0byB2Q2FyZCAzLjA6CisgICAgICAgICAgICAgICAgLy8gcGFyYW0tbmFtZSAgID0gaWFuYS10b2tlbiAvIHgtbmFtZQorICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVudHJ5LmdldEtleSgpKTsKKworICAgICAgICAgICAgICAgIC8vIHBhcmFtLXZhbHVlIG1heSBjb250YWluIGFueSB2YWx1ZSBpbmNsdWRpbmcgTk9OLUFTQ0lJcy4KKyAgICAgICAgICAgICAgICAvLyBXZSB1c2UgdGhlIGZvbGxvd2luZyByZXBsYWNpbmcgcnVsZS4KKyAgICAgICAgICAgICAgICAvLyBcIC0+IFxcCisgICAgICAgICAgICAgICAgLy8gLCAtPiBcLAorICAgICAgICAgICAgICAgIC8vIEluIFN0cmluZyNyZXBsYWNlQWxsKCksICJcXFxcIiBtZWFucyBhIHNpbmdsZSBiYWNrc2xhc2guCisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIj0iKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChlbnRyeS5nZXRWYWx1ZSgpLnRvU3RyaW5nKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKCJcXFxcIiwgIlxcXFxcXFxcIikKKyAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKCIsIiwgIlxcXFwsIikpOworICAgICAgICAgICAgICAgIGlmIChpIDwgc2l6ZSAtMSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFNldDxTdHJpbmc+IHNldCA9IHBhcmFtTWFwX1RZUEU7CisgICAgICAgICAgICBzaXplID0gcGFyYW1NYXBfVFlQRS5zaXplKCk7CisgICAgICAgICAgICBpZiAoaSA+IDAgJiYgc2l6ZSA+IDApIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaSA9IDA7CisgICAgICAgICAgICBmb3IgKFN0cmluZyB0eXBlIDogc2V0KSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlRZUEU9Iik7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQodHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VBbGwoIlxcXFwiLCAiXFxcXFxcXFwiKQorICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VBbGwoIiwiLCAiXFxcXCwiKSk7CisgICAgICAgICAgICAgICAgaWYgKGkgPCBzaXplIC0gMSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXSwiKTsKKyAgICAgICAgfQorCisgICAgICAgIHNpemUgPSBwcm9wVmFsdWVfdmVjdG9yLnNpemUoKTsKKyAgICAgICAgaWYgKHNpemUgPiAwKSB7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgicHJvcFZhbHVlOlsiKTsKKyAgICAgICAgICAgIExpc3Q8U3RyaW5nPiBsaXN0ID0gcHJvcFZhbHVlX3ZlY3RvcjsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGlzdC5nZXQoaSkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKCJcXFxcIiwgIlxcXFxcXFxcIikKKyAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKCIsIiwgIlxcXFwsIikpOworICAgICAgICAgICAgICAgIGlmIChpIDwgc2l6ZSAtMSkgeworICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJdLCIpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFByb3BlcnR5Tm9kZSBkZWNvZGUoU3RyaW5nIGVuY29kZWRTdHJpbmcpIHsKKyAgICAgICAgUHJvcGVydHlOb2RlIHByb3BlcnR5Tm9kZSA9IG5ldyBQcm9wZXJ0eU5vZGUoKTsKKyAgICAgICAgU3RyaW5nIHRyaW1lZCA9IGVuY29kZWRTdHJpbmcudHJpbSgpOworICAgICAgICBpZiAodHJpbWVkLmxlbmd0aCgpID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBwcm9wZXJ0eU5vZGU7CisgICAgICAgIH0KKyAgICAgICAgU3RyaW5nW10gZWxlbXMgPSB0cmltZWQuc3BsaXQoIl0sIik7CisgICAgICAgIAorICAgICAgICBmb3IgKFN0cmluZyBlbGVtIDogZWxlbXMpIHsKKyAgICAgICAgICAgIGludCBpbmRleCA9IGVsZW0uaW5kZXhPZignWycpOworICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBlbGVtLnN1YnN0cmluZygwLCBpbmRleCAtIDEpOworICAgICAgICAgICAgUGF0dGVybiBwYXR0ZXJuID0gUGF0dGVybi5jb21waWxlKCIoPzwhXFxcXCksIik7CisgICAgICAgICAgICBTdHJpbmdbXSB2YWx1ZXMgPSBwYXR0ZXJuLnNwbGl0KGVsZW0uc3Vic3RyaW5nKGluZGV4ICsgMSksIC0xKTsKKyAgICAgICAgICAgIGlmIChuYW1lLmVxdWFscygicHJvcE5hbWUiKSkgeworICAgICAgICAgICAgICAgIHByb3BlcnR5Tm9kZS5wcm9wTmFtZSA9IHZhbHVlc1swXTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoInByb3BHcm91cFNldCIpKSB7CisgICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgdmFsdWUgOiB2YWx1ZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOb2RlLnByb3BHcm91cFNldC5hZGQodmFsdWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoInBhcmFtTWFwIikpIHsKKyAgICAgICAgICAgICAgICBDb250ZW50VmFsdWVzIHBhcmFtTWFwID0gcHJvcGVydHlOb2RlLnBhcmFtTWFwOworICAgICAgICAgICAgICAgIFNldDxTdHJpbmc+IHBhcmFtTWFwX1RZUEUgPSBwcm9wZXJ0eU5vZGUucGFyYW1NYXBfVFlQRTsKKyAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB2YWx1ZSA6IHZhbHVlcykgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSB0bXAgPSB2YWx1ZS5zcGxpdCgiPSIsIDIpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbWFwS2V5ID0gdG1wWzBdOworICAgICAgICAgICAgICAgICAgICAvLyBcLCAtPiAsCisgICAgICAgICAgICAgICAgICAgIC8vIFxcIC0+IFwKKyAgICAgICAgICAgICAgICAgICAgLy8gSW4gU3RyaW5nI3JlcGxhY2VBbGwoKSwgIlxcXFwiIG1lYW5zIGEgc2luZ2xlIGJhY2tzbGFzaC4KKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG1hcFZhbHVlID0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRtcFsxXS5yZXBsYWNlQWxsKCJcXFxcLCIsICIsIikucmVwbGFjZUFsbCgiXFxcXFxcXFwiLCAiXFxcXCIpOworICAgICAgICAgICAgICAgICAgICBpZiAobWFwS2V5LmVxdWFsc0lnbm9yZUNhc2UoIlRZUEUiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1NYXBfVFlQRS5hZGQobWFwVmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1NYXAucHV0KG1hcEtleSwgbWFwVmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygicHJvcFZhbHVlIikpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgIExpc3Q8U3RyaW5nPiBsaXN0ID0gcHJvcGVydHlOb2RlLnByb3BWYWx1ZV92ZWN0b3I7CisgICAgICAgICAgICAgICAgaW50IGxlbmd0aCA9IHZhbHVlcy5sZW5ndGg7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbm9ybVZhbHVlID0gdmFsdWVzW2ldCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VBbGwoIlxcXFwsIiwgIiwiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKCJcXFxcXFxcXCIsICJcXFxcIik7CisgICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKG5vcm1WYWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG5vcm1WYWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChpIDwgbGVuZ3RoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIjsiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwcm9wZXJ0eU5vZGUucHJvcFZhbHVlID0gYnVpbGRlci50b1N0cmluZygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBBdCB0aGlzIHRpbWUsIFFVT1RFRC1QUklOVEFCTEUgaXMgYWxyZWFkeSBkZWNvZGVkIHRvIEphdmEgU3RyaW5nLgorICA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bnVsbCA/IDAgOiBhY3R1YWxNYXAuc2l6ZSgpKSwgImV4dGVuc2lvbnMiKSA+IDApIHsKKyAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBrZXkgOiBleHBlY3RlZE1hcC5rZXlTZXQoKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWFjdHVhbE1hcC5jb250YWluc0tleShrZXkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJBY3R1YWwgZG9lcyBub3QgaGF2ZSAlcyBleHRlbnNpb24gd2hpbGUgZXhwZWN0ZWQgaGFzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5KSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZmluYWwgTGlzdDxTdHJpbmc+IGV4cGVjdGVkTGlzdCA9IGV4cGVjdGVkTWFwLmdldChrZXkpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gYWN0dWFsTGlzdCA9IGFjdHVhbE1hcC5nZXQoa2V5KTsKKyAgICAgICAgICAgICAgICAgICAgdmVyaWZ5SW50ZXJuYWwoZXhwZWN0ZWRMaXN0LCBhY3R1YWxMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZy5mb3JtYXQoImV4dGVuc2lvbiBcIiVzXCIiLCBrZXkpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBlcXVhbHNTdHJpbmcoU3RyaW5nIGEsIFN0cmluZyBiKSB7CisgICAgICAgIGlmIChhID09IG51bGwgfHwgYS5sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gYiA9PSBudWxsIHx8IGIubGVuZ3RoKCkgPT0gMDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBhLmVxdWFscyhiKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgdmVyaWZ5U2l6ZShpbnQgZXhwZWN0ZWRTaXplLCBpbnQgYWN0dWFsU2l6ZSwgU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgaWYgKGV4cGVjdGVkU2l6ZSAhPSBhY3R1YWxTaXplKSB7CisgICAgICAgICAgICBmYWlsKFN0cmluZy5mb3JtYXQoIlNpemUgb2YgJXMgaXMgZGlmZmVyZW50OiAlZCAhPSAlZCIsIAorICAgICAgICAgICAgICAgICAgICBuYW1lLCBleHBlY3RlZFNpemUsIGFjdHVhbFNpemUpKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZXhwZWN0ZWRTaXplOworICAgIH0KKyAgICAgICAgCisgICAgcHJpdmF0ZSBzdGF0aWMgPFQ+IHZvaWQgdmVyaWZ5SW50ZXJuYWwoZmluYWwgTGlzdDxUPiBleHBlY3RlZCwgZmluYWwgTGlzdDxUPiBhY3R1YWwsCisgICAgICAgICAgICBTdHJpbmcgbmFtZSkgeworICAgICAgICBpZih2ZXJpZnlTaXplKChleHBlY3RlZCA9PSBudWxsID8gMCA6IGV4cGVjdGVkLnNpemUoKSksCisgICAgICAgICAgICAgICAgKGFjdHVhbCA9PSBudWxsID8gMCA6IGFjdHVhbC5zaXplKCkpLCBuYW1lKSA+IDApIHsKKyAgICAgICAgICAgIGludCBzaXplID0gZXhwZWN0ZWQuc2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBUIGV4cGVjdGVkT2JqID0gZXhwZWN0ZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGZpbmFsIFQgYWN0dWFsT2JqID0gYWN0dWFsLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoIWV4cGVjdGVkLmVxdWFscyhhY3R1YWwpKSB7CisgICAgICAgICAgICAgICAgICAgIGZhaWwoU3RyaW5nLmZvcm1hdCgiVGhlICVpICVzIGFyZSBkaWZmZXJlbnQ6ICVzICE9ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLCBuYW1lLCBleHBlY3RlZE9iaiwgYWN0dWFsT2JqKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfSovCisKKyAgICBwcml2YXRlIGNsYXNzIFByb3BlcnR5Tm9kZXNWZXJpZmllciB7CisgICAgICAgIHByaXZhdGUgSGFzaE1hcDxTdHJpbmcsIEFycmF5TGlzdDxQcm9wZXJ0eU5vZGU+PiBtUHJvcGVydHlOb2RlTWFwOworICAgICAgICBwdWJsaWMgUHJvcGVydHlOb2Rlc1ZlcmlmaWVyKFByb3BlcnR5Tm9kZS4uLiBub2RlcykgeworICAgICAgICAgICAgbVByb3BlcnR5Tm9kZU1hcCA9IG5ldyBIYXNoTWFwPFN0cmluZywgQXJyYXlMaXN0PFByb3BlcnR5Tm9kZT4+KCk7CisgICAgICAgICAgICBmb3IgKFByb3BlcnR5Tm9kZSBwcm9wZXJ0eU5vZGUgOiBub2RlcykgeworICAgICAgICAgICAgICAgIFN0cmluZyBwcm9wTmFtZSA9IHByb3BlcnR5Tm9kZS5wcm9wTmFtZTsKKyAgICAgICAgICAgICAgICBBcnJheUxpc3Q8UHJvcGVydHlOb2RlPiBleHBlY3RlZE5vZGVzID0KKyAgICAgICAgICAgICAgICAgICAgbVByb3BlcnR5Tm9kZU1hcC5nZXQocHJvcE5hbWUpOworICAgICAgICAgICAgICAgIGlmIChleHBlY3RlZE5vZGVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWROb2RlcyA9IG5ldyBBcnJheUxpc3Q8UHJvcGVydHlOb2RlPigpOworICAgICAgICAgICAgICAgICAgICBtUHJvcGVydHlOb2RlTWFwLnB1dChwcm9wTmFtZSwgZXhwZWN0ZWROb2Rlcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGV4cGVjdGVkTm9kZXMuYWRkKHByb3BlcnR5Tm9kZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIHZlcmlmeShWTm9kZSB2bm9kZSkgeworICAgICAgICAgICAgZm9yIChQcm9wZXJ0eU5vZGUgcHJvcGVydHlOb2RlIDogdm5vZGUucHJvcExpc3QpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgcHJvcE5hbWUgPSBwcm9wZXJ0eU5vZGUucHJvcE5hbWU7CisgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFByb3BlcnR5Tm9kZT4gbm9kZXMgPSBtUHJvcGVydHlOb2RlTWFwLmdldChwcm9wTmFtZSk7CisgICAgICAgICAgICAgICAgaWYgKG5vZGVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZmFpbCgiVW5leHBlY3RlZCBwcm9wTmFtZSBcIiIgKyBwcm9wTmFtZSArICJcIiBleGlzdHMuIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJvb2xlYW4gc3VjY2Vzc2Z1bCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGludCBzaXplID0gbm9kZXMuc2l6ZSgpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIFByb3BlcnR5Tm9kZSBleHBlY3RlZE5vZGUgPSBub2Rlcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChleHBlY3RlZE5vZGUucHJvcE5hbWUuZXF1YWxzKHByb3BOYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkTm9kZS5lcXVhbHMocHJvcGVydHlOb2RlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3NmdWwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVzLnJlbW92ZShpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobm9kZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByb3BlcnR5Tm9kZU1hcC5yZW1vdmUocHJvcE5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbCgiUHJvcGVydHkgXCIiICsgcHJvcE5hbWUgKyAiXCIgaGFzIHdyb25nIHZhbHVlLlxuIiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgImV4cGVjdGVkOiAiICsgZXhwZWN0ZWROb2RlLnRvU3RyaW5nKCkgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJcbiAgYWN0dWFsOiAiICsgcHJvcGVydHlOb2RlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzc2Z1bCkgeworICAgICAgICAgICAgICAgICAgICBmYWlsKCJVbmV4cGVjdGVkIHByb3BlcnR5IFwiIiArIHByb3BOYW1lICsgIlwiIGV4aXN0cy4iKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVByb3BlcnR5Tm9kZU1hcC5zaXplKCkgIT0gMCkgeworICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IGV4cGVjdGVkUHJvcHMgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKKyAgICAgICAgICAgICAgICBmb3IgKEFycmF5TGlzdDxQcm9wZXJ0eU5vZGU+IG5vZGVzIDogbVByb3BlcnR5Tm9kZU1hcC52YWx1ZXMoKSkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKFByb3BlcnR5Tm9kZSBub2RlIDogbm9kZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkUHJvcHMuYWRkKG5vZGUucHJvcE5hbWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZhaWwoImV4cGVjdGVkIHByb3BzICIgKyBBcnJheXMudG9TdHJpbmcoZXhwZWN0ZWRQcm9wcy50b0FycmF5KCkpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICIgd2FzIG5vdCBmb3VuZCIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qCisgICAgcHVibGljIHZvaWQgdGVzdFYyMVNpbXBsZUNhc2UxXzEoKSB0aHJvd3MgSU9FeGNlcHRpb24sIFZDYXJkRXhjZXB0aW9uIHsKKyAgICAgICAgVkNhcmRQYXJzZXIgcGFyc2VyID0gbmV3IFZDYXJkUGFyc2VyX1YyMSgpOworICAgICAgICBWQ2FyZERhdGFCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgVkNhcmREYXRhQnVpbGRlcihWQ2FyZENvbmZpZy5OQU1FX09SREVSX1RZUEVfRU5HTElTSCk7CisgICAgICAgIEVudHJ5SG9sZGVyIGhvbGRlciA9IG5ldyBFbnRyeUhvbGRlcigpOworICAgICAgICBidWlsZGVyLmFkZEVudHJ5SGFuZGxlcihob2xkZXIpOworICAgICAgICBJbnB1dFN0cmVhbSBpcyA9IGdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKS5vcGVuUmF3UmVzb3VyY2UoUi5yYXcudjIxX3NpbXBsZV8xKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKHRydWUsIHBhcnNlci5wYXJzZShpcywiSVNPLTg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CgiQW5kbyBSb2lkIiwgbnVsbCwKKyAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBob2xkZXIuY29udGFjdHMuZ2V0KDApKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgdGVzdFYyMVNpbXBsZUNhc2UyKCkgdGhyb3dzIElPRXhjZXB0aW9uLCBWQ2FyZEV4Y2VwdGlvbiB7CisgICAgICAgIFZDYXJkUGFyc2VyIHBhcnNlciA9IG5ldyBWQ2FyZFBhcnNlcl9WMjEoKTsKKyAgICAgICAgVkNhcmREYXRhQnVpbGRlciBidWlsZGVyID0gbmV3IFZDYXJkRGF0YUJ1aWxkZXIoVkNhcmRDb25maWcuTkFNRV9PUkRFUl9UWVBFX0VOR0xJU0gpOworICAgICAgICBFbnRyeUhvbGRlciBob2xkZXIgPSBuZXcgRW50cnlIb2xkZXIoKTsKKyAgICAgICAgYnVpbGRlci5hZGRFbnRyeUhhbmRsZXIoaG9sZGVyKTsKKyAgICAgICAgSW5wdXRTdHJlYW0gaXMgPSBnZXRDb250ZXh0KCkuZ2V0UmVzb3VyY2VzKCkub3BlblJhd1Jlc291cmNlKFIucmF3LnYyMV9zaW1wbGVfMik7CisgICAgICAgIGFzc2VydEVxdWFscyh0cnVlLCBwYXJzZXIucGFyc2UoaXMsIklTTy04ODU5LTEiLCBidWlsZGVyKSk7CisgICAgICAgIGlzLmNsb3NlKCk7CisgICAgICAgIGFzc2VydEVxdWFscygxLCBob2xkZXIuY29udGFjdHMuc2l6ZSgpKTsKKyAgICAgICAgdmVyaWZ5KG5ldyBDb250YWN0U3RydWN0KCJBbmRvIFJvaWQiLCBudWxsLAorICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIGhvbGRlci5jb250YWN0cy5nZXQoMCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2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BQcm9wZXJ0eU5vZGVzVmVyaWZpZXIgdmVyaWZpZXIgPSBuZXcgUHJvcGVydHlOb2Rlc1ZlcmlmaWVyKAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk4iLCAiQW5kbztSb2lkOyIsCisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCJBbmRvIiwgIlJvaWQiLCAiIiksCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJGTiIsICJBbmRvIFJvaWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCkpOworICAgICAgICB2ZXJpZmllci52ZXJpZnkodm5vZGUpOworICAgICAgICAKKyAgICAgICAgLy8gRk4gaXMgcHJlZmVyZWQuCisgICAgICAgIGFzc2VydEVxdWFscygxLCBob2xkZXIuY29udGFjdHMuc2l6ZSgpKTsKKyAgICAgICAgQ29udGFjdFN0cnVjdCBhY3R1YWwgPSBob2xkZXIuY29udGFjdHMuZ2V0KDApOyAKKyAgICAgICAgdmVyaWZ5KG5ldyBDb250YWN0U3RydWN0KCJBbmRvIFJvaWQiLCBudWxsLAorICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIGFjdHVhbCk7CisgICAgfSovCisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0VjIxQmFja3NsYXNoQ2FzZSgpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24geworICAgICAgICBWQ2FyZFBhcnNlcl9WMjEgcGFyc2VyID0gbmV3IFZDYXJkUGFyc2VyX1YyMSgpOworICAgICAgICBWTm9kZUJ1aWxkZXIgYnVpbGRlciA9IG5ldyBWTm9kZUJ1aWxkZXIoKTsKKyAgICAgICAgSW5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wNSwgMHgwMCwgMHgwNCwgMHgwMCwKKyAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDA0LCAweDAwLCAweGEyLCAweDBlLCAweDAwLCAweDA1LAorICAgICAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDEsIDB4MDAsIDB4MDAsIDB4MDMsIDB4ZTgsIDB4YTIsIDB4MGYsIDB4MDAsCisgICAgICAgICAgICAgICAgMHgwNSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMSwgMHgwMCwgMHgwMCwgMHgwMywgMHhmMCwgMHhhMiwgMHgxMCwKKyAgICAgICAgICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweGEyLAorICAgICAgICAgICAgICAgIDB4MTcsIDB4MDAsIDB4MDMsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDEsIDB4MDAsIDB4MDIsIDB4MDAsIDB4MDAsCisgICAgICAgICAgICAgICAgMHhhMywgMHgwMCwgMHgwMCwgMHgwNywgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMSwgMHgwMywgMHgwMCwgMHgwMCwKKyAgICAgICAgICAgICAgICAweDAwLCAweGEzLCAweDAxLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAxLCAweDAwLAorICAgICAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4YTQsIDB4MDEsIDB4MDAsIDB4MDMsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDEsIDB4MDAsCisgICAgICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHhhNCwgMHgwMiwgMHgwMCwgMHgwMywgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMSwKKyAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLC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AgICAgICAweDM4LCAweDMxLCAweDMwLCAweDMyLCAweDM5LCAweDMxLCAweDMzLCAweDM1LCAweDM1LCAweDMzLCAweDMxLAorICAgICAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MjAsIDB4MmEsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MGEsIDB4MDAsIDB4MDAsIDB4MmEsCisgICAgICAgICAgICAgICAgMHhlMiwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwYSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwKKyAgICAgICAgICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLAorICAgICAgICAgICAgICAgIDB4MDQsIDB4NTIsIDB4MzksIDB4MzgsIDB4MDAsIDB4MDAsIDB4MDIsIDB4MDAsIDB4MDcsIDB4MDAsIDB4MDAsCisgICAgICAgICAgICAgICAgMHgwMCwgMHgwNCwgMHgzMCwgMHgzMSwgMHgzMCwgMHgzMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwKKyAgICAgICAgICAgICAgICAweDA2LCAweDAxLCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDA2LAorICAgICAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDEsIDB4MWEsIDB4MDAsIDB4MDUsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDEsIDB4MDAsCisgICAgICAgICAgICAgICAgMHgwMCwgMHgwNCwgMHg2YywgMHgwMSwgMHgxYiwgMHgwMCwgMHgwNSwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMSwKKyAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAweDA0LCAweDc0LCAweDAxLCAweDI4LCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLAorICAgICAgICAgICAgICAgIDB4MDEsIDB4MDA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LCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LAorICAgICAgICAgICAgICAgIDB4MDYsIDB4MDcsIDB4MDgsIDB4MDksIDB4MGEsIDB4MGIsIDB4MTAsIDB4MDAsIDB4MDIsIDB4MDEsIDB4MDMsCisgICAgICAgICAgICAgICAgMHgwMywgMHgwMiwgMHgwNCwgMHgwMywgMHgwNSwgMHgwNSwgMHgwNCwgMHgwNCwgMHgwMCwgMHgwMCwgMHgwMSwKKyAgICAgICAgICAgICAgICAweDdkLCAweDAxLCAweDAyLCAweDAzLCAweDAwLCAweDA0LCAweDExLCAweDA1LCAweDEyLCAweDIxLCAweDMxLAorICAgICAgICAgICAgICAgIDB4NDEsIDB4MDYsIDB4MTMsIDB4NTEsIDB4NjEsIDB4MDcsIDB4MjIsIDB4NzEsIDB4MTQsIDB4MzIsIDB4ODEsCisgICAgICAgICAgICAgICAgMHg5MSwgMHhhMSwgMHgwOCwgMHgyMywgMHg0MiwgMHhiMSwgMHhjMSwgMHgxNSwgMHg1MiwgMHhkMSwgMHhmMCwKKyAgICAgICAgICAgICAgICAweDI0LCAweDMzLCAweDYyLCAweDcyLCAweDgyLCAweDA5LCAweDBhLCAweDE2LCAweDE3LCAweDE4LCAweDE5LAorICAgICAgICAgICAgICAgIDB4MWEsIDB4MjUsIDB4MjYsIDB4MjcsIDB4MjgsIDB4MjksIDB4MmEsIDB4MzQsIDB4MzUsIDB4MzYsIDB4MzcsCisgICAgICAgICAgICAgICAgMHgzOCwgMHgzOSwgMHgzYSwgMHg0MywgMHg0NCwgMHg0NSwgMHg0NiwgMHg0NywgMHg0OCwgMHg0OSwgMHg0YSwKKyAgICAgICAgICAgICAgICAweDUzLCAweDU0LCAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LAorICAgICAgICAgICAgICAgIDB4NjYsIDB4NjcsIDB4NjgsIDB4NjksIDB4NmEsIDB4NzMsIDB4Nz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SwKKyAgICAgICAgICAgICAgICAweDhkLCAweGE5LCAweDAxLCAweDEzLCAweDU0LCAweDRkLCAweDQwLCAweDEzLCAweGE1LCAweDRhLCAweDI4LAorICAgICAgICAgICAgICAgIDB4MDIsIDB4NDUsIDB4MzUsIDB4MmEsIDB4OWEsIDB4MDAsIDB4NzgsIDB4MzQsIDB4ZjAsIDB4NjksIDB4ODAsCisgICAgICAgICAgICAgICAgMHgzNCwgMHg4MSwgMHg0NSwgMHg0MCwgMHhjZSwgMHg1OCwgMHhlNiwgMHhhMiwgMHg0YywgMHgwNiwgMHhlNCwKKyAgICAgICAgICAgICAgICAweGZhLCAweGQxLCAweDkzLCAweDUwLCAweDIxLCAweGNhLCAweGU0LCAweDU1LCAweDg0LCAweDkwLCAweDMwLAorICAgICAgICAgICAgICAgIDB4YWIsIDB4OGIsIDB4MTgsIDB4YTYsIDB4OWEsIDB4NmEsIDB4YzQsIDB4MzEsIDB4YWEsIDB4MjYsIDB4YTAsCisgICAgICAgICAgICAgICAgMHg2NCwgMHg0ZCwgMHg1MSwgMHhiNSwgMHgyMCwgMHgyMywgMHg2YSwgMHg4OSwgMHhhOCwgMHgwMiwgMHg0NCwKKyAgICAgICAgICAgICAgICAweDM1LCAweDJhLCAweDlhLCAweDAwLCAweDk1LCAweDRkLCAweDQ4LCAweGE2LCAweDgwLCAweDI0LCAweDUzLAorICAgICAgICAgICAgICAgIDB4NGUsIDB4Y2UsIDB4MDUsIDB4MzAsIDB4MmIsIDB4M2IsIDB4ZWUsIDB4NmEsIDB4OTEsIDB4NWQsIDB4NzYsCisgICAgICAgICAgICAgICAgMHg2MywgMHhiZCwgMHg2NSwgMHg3ZCwgMHg0MCwgMHg2NiwgMHg2OCwgMHhhOSwgMHgwMiwgMHg0NSwgMHgyYiwKKyAgICAgICAgICAgICAgICAweGIzLCAweDllLCAweGI0LCAweGM1LCAweDZkLCAweGFkLCAweDlhLCAweGEwLCAweDJjLCAweDA2LCAweGM4LAorICAgICAgICAgICAgIC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3ZCwgMHgwMSwKKyAgICAgICAgICAgICAgICAweDAyLCAweDAzLCAweDAwLCAweDA0LCAweDExLCAweDA1LCAweDEyLCAweDIxLCAweDMxLCAweDQxLCAweDA2LAorICAgICAgICAgICAgICAgIDB4MTMsIDB4NTEsIDB4NjEsIDB4MDcsIDB4MjIsIDB4NzEsIDB4MTQsIDB4MzIsIDB4ODEsIDB4OTEsIDB4YTEsCisgICAgICAgICAgICAgICAgMHgwOCwgMHgyMywgMHg0MiwgMHhiMSwgMHhjMSwgMHgxNSwgMHg1MiwgMHhkMSwgMHhmMCwgMHgyNCwgMHgzMywKKyAgICAgICAgICAgICAgICAweDYyLCAweDcyLCAweDgyLCAweDA5LCAweDBhLCAweDE2LCAweDE3LCAweDE4LCAweDE5LCAweDFhLCAweDI1LAorICAgICAgICAgICAgICAgIDB4MjYsIDB4MjcsIDB4MjgsIDB4MjksIDB4MmEsIDB4MzQsIDB4MzUsIDB4MzYsIDB4MzcsIDB4MzgsIDB4MzksCisgICAgICAgICAgICAgICAgMHgzYSwgMHg0MywgMHg0NCwgMHg0NSwgMHg0NiwgMHg0NywgMHg0OCwgMHg0OSwgMHg0YSwgMHg1MywgMHg1NCwKKyAgICAgICAgICAgICAgICAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LCAweDY2LCAweDY3LAorICAgICAgICAgICAgICAgIDB4NjgsIDB4NjksIDB4NmEsIDB4NzMsIDB4NzQsIDB4NzUsIDB4NzYsIDB4NzcsIDB4NzgsIDB4NzksIDB4N2EsCisgICAgICAgICAgICAgICAgMHg4MywgMHg4NCwgMHg4NSwgMHg4NiwgMHg4NywgMHg4OCwgMHg4OSwgMHg4YSwgMHg5MiwgMHg5MywgMHg5NCwKKyAgICAgICAgICAgICAgICAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLCAweGE0LCAweGE1LCAweGE2LAorICAgICAgICAgICAgICAgI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bGVuZ3RoID0gcGhvdG9JbnRBcnJheS5sZW5ndGg7CisgICAgICAgIGJ5dGVbXSBwaG90b0J5dGVBcnJheSA9IG5ldyBieXRlW2xlbmd0aF07CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIHBob3RvQnl0ZUFycmF5W2ldID0gKGJ5dGUpcGhvdG9JbnRBcnJheVtpXTsKKyAgICAgICAgfQorICAgICAgICBQcm9wZXJ0eU5vZGVzVmVyaWZpZXIgdmVyaWZpZXIgPSBuZXcgUHJvcGVydHlOb2Rlc1ZlcmlmaWVyKAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlZFUlNJT04iLCAiMi4xIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk4iLCAiR3VtcDtGb3JyZXN0O0hvZ2U7UG9zO1RhbyIsCisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCJHdW1wIiwgIkZvcnJlc3QiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSG9nZSIsICJQb3MiLCAiVGFvIiksCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJGTiIsICJKb2UgRHVlIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk9SRyIsIAorICAgICAgICAgICAgICAgICAgICAgICAgIkd1bXAgU2hyaW1wIENvLjtTYWxlcyBEZXB0LjtNYW5hZ2VyO0Zpc2gga2VlcGVyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIkd1bXAgU2hyaW1wIENvLiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTYWxlcyBEZXB0LjtNYW5hZ2VyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpc2gga2VlcGVyIiksCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJST0xFIiwgIkZpc2ggQ2FrZSBLZWVwZXIhIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRJVExFIiwgIlNocmltcCBNYW4iLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiWC1DTEFTUyIsICJQVUJMSUMiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIigxMTEpIDU1NS0xMjEyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIldPUksiLCAiVk9JQ0UiKSksIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIoNDA0KSA1NTUtMTIxMiIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJIT01FIiwgIlZPSUNFIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMDMxMTExMTExMSIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJDRUxMIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMDMyMjIyMjIyMiIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJWSURFTyIpKSwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjAzMzMzMzMzMzMiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiVk9JQ0UiKSksIG51bGwpLCAgICAgCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiQURSIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICI7OzEwMCBXYXRlcnMgRWRnZTtCYXl0b3duO0xBOzMwMzE0O1VuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIsCisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCIiLCAiIiwgIjEwMCBXYXRlcnMgRWRnZSIsICJCYXl0b3duIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkxBIiwgIjMwMzE0IiwgIlVuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiV09SSyIpKSwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiTEFCRUwiLAorICAgICAgICAgICAgICAgICAgICAgICAgIjEwMCBXYXRlcnMgRWRnZVxyXG5CYXl0b3duLCBMQSAzMDMxNFxyXG5Vbml0ZWQgIFN0YXRlcyBvZiBBbWVyaWNhIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIGNvbnRlbnRWYWx1ZXNGb3JRUCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiV09SSyIpKSwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiQURSIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICI7OzQyIFBsYW50YXRpb24gU3QuO0JheXRvd247TEE7MzAzMTQ7VW5pdGVkIFN0YXRlcyBvZiBBbWVyaWNhIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIiIsICIiLCAiNDIgUGxhbnRhdGlvbiBTdC4iLCAiQmF5dG93biIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJMQSIsICIzMDMxNCIsICJVbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2EiKSwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiSE9NRSIpKSwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiTEFCRUwiLAorICAgICAgICAgICAgICAgICAgICAgICAgIjQyIFBsYW50YXRpb24gU3QuXHJcbkJheXRvd24sIExBIDMwMzE0XHJcblVuaXRlZCAgU3RhdGVzIG9mIEFtZXJpY2EiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclFQLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJIT01FIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJFTUFJTCIsICJmb3JyZXN0Z3VtcEB3YWxsYWRhbGxhLmNvbSIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJQUkVGIiwgIklOVEVSTkVUIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJFTUFJTCIsICJjZWxsQGV4YW1wbGUuY29tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIkNFTEwiKSksIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk5PVEUiLCAiVGhlIGZvbGxvd2luZyBub3RlIGlzIHRoZSBleGFtcGxlIGZyb20gUkZDIDIwNDUuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk5PVEUiLAorICAgICAgICAgICAgICAgICAgICAgICAgIk5vdydzIHRoZSB0aW1lIGZvciBhbGwgZm9sayB0byBjb21lIHRvIHRoZSBhaWQgb2YgdGhlaXIgY291bnRyeS4iLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclFQLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJQSE9UTyIsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBwaG90b0J5dGVBcnJheSwgY29udGVudFZhbHVlc0ZvclBob3RvLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJKUEVHIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJYLUFUVFJJQlVURSIsICJTb21lIFN0cmluZyIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJCREFZIiwgIjE5ODAwMTAxIiwgCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJHRU8iLCAiMzUuNjU2Mzg1NCwxMzkuNjk5NDIzMyIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJVUkwiLCAiaHR0cDovL3d3dy5leGFtcGxlLmNvbS8iLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlJFViIsICIyMDA4MDQyNFQxOTUyNDNaIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpKTsKKyAgICAgICAgdmVyaWZpZXIudmVyaWZ5KGJ1aWxkZXIudk5vZGVMaXN0LmdldCgwKSk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHRlc3RWMjFK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1dCgiRU5DT0RJTkciLCAiUVVPVEVELVBSSU5UQUJMRSIpOworICAgICAgICBjb250ZW50VmFsdWVzRm9yUVAucHV0KCJDSEFSU0VUIiwgIlNISUZUX0pJUyIpOworICAgICAgICBQcm9wZXJ0eU5vZGVzVmVyaWZpZXIgdmVyaWZpZXIgPSBuZXcgUHJvcGVydHlOb2Rlc1ZlcmlmaWVyKAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlZFUlNJT04iLCAiMi4xIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIk4iLCAiXHU1Qjg5XHU4NUU0O1x1MzBFRFx1MzBBNFx1MzBDOVx1MDAzMTs7OyIsCisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCJcdTVCODlcdTg1RTQiLCAiXHUzMEVEXHUzMEE0XHUzMEM5XHUwMDMxIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiIsICIiLCAiIiksCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBjb250ZW50VmFsdWVzRm9yU2hpZnRKaXMsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIkZOIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJcdTVCODlcdTg1RTRcdTAwMjBcdTMwRURcdTMwQTRcdTMwQzlcdTAwMjBcdTAwMzEiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJTT1VORCIsCisgICAgICAgICAgICAgICAgICAgICAgICAoIlx1RkY3MVx1RkY5RFx1RkY4NFx1RkY5RVx1RkY3MyIgKworICAgICAgICAgICAgICAgICAgICAgICAgIjtcdUZGOUJcdUZGNzJcdUZGODRcdUZGOUVcdTAwMzE7OzsiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIGNvbnRlbnRWYWx1ZXNGb3JTaGlmdEppcywKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1JUk1DLU4iKSksIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIkFEUiIsCisgICAgICAgICAgICAgICAgICAgICAgICAoIjtcdTY3NzFcdTRFQUNcdTkwRkRcdTZFMEJcdThDMzdcdTUzM0FcdTY4NUMiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICJcdTMwRUJcdTMwRUFcdTMwQTJcdTMwRjNcdTMwQkZcdTMwRUZcdTMwRkNcdTAwMzYiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICJcdTk2OEU7Ozs7MTUwLTg1MTI7IiksCisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHU2NzcxXHU0RUFDXHU5MEZEXHU2RTBCXHU4QzM3XHU1MzNBXHU2ODVDIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlx1MzBFQlx1MzBFQVx1MzBBMlx1MzBGM1x1MzBCRlx1MzBFRlx1MzBGQyIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHUwMDM2XHU5NjhFIiwgIiIsICIiLCAiIiwgIjE1MC04NTEyIiwgIiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgY29udGVudFZhbHVlc0ZvclFQLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJIT01FIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJOT1RFIiwgIlx1MzBFMVx1MzBFMiIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBjb250ZW50VmFsdWVzRm9yUVAsIG51bGwsIG51bGwpKTsKKyAgICAgICAgdmVyaWZpZXIudmVyaWZ5KGJ1aWxkZXIudk5vZGVMaXN0LmdldCgwKSk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHRlc3RWMjFNdWx0aXBsZUVudHJ5Q2FzZSgpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24geworICAgICAgICBWQ2FyZFBhcnNlcl9WMjEgcGFyc2VyID0gbmV3IFZDYXJkUGFyc2VyX1YyMSgpOworICAgICAgICBWTm9kZUJ1aWxkZXIgYnVpbGRlciA9IG5ldyBWTm9kZUJ1aWxkZXIoKTsKKyAgICAgICAgSW5wdXRTdHJlYW0gaXMgPSBnZXRDb250ZXh0KCkuZ2V0UmVzb3VyY2VzKCkub3BlblJhd1Jlc291cmNlKFIucmF3LnYyMV9tdWx0aXBsZV9lbnRyeSk7CisgICAgICAgIGFzc2VydEVxdWFscyh0cnVlLCBwYXJzZXIucGFyc2UoaXMsIklTTy04ODU5LTEiLCBidWlsZGVyKSk7CisgICAgICAgIGlzLmNsb3NlKCk7CisgICAgICAgIGFzc2VydEVxdWFscygzLCBidWlsZGVyLnZOb2RlTGlzdC5zaXplKCkpOworICAgICAgICBDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXNGb3JTaGlmdEppcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgIGNvbnRlbnRWYWx1ZXNGb3JTaGlmdEppcy5wdXQoIkNIQVJTRVQiLCAiU0hJRlRfSklTIik7CisgICAgICAgIFByb3BlcnR5Tm9kZXNWZXJpZmllciB2ZXJpZmllciA9IG5ldyBQcm9wZXJ0eU5vZGVzVmVyaWZpZXIoCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVkVSU0lPTiIsICIyLjEiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiTiIsICJcdTVCODlcdTg1RTRcdTMwRURcdTMwQTRcdTMwQzlcdTAwMzM7Ozs7IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIlx1NUI4OVx1ODVFNFx1MzBFRFx1MzBBNFx1MzBDOVx1MDAzMyIsICIiLCAiIiwgIiIsICIiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIGNvbnRlbnRWYWx1ZXNGb3JTaGlmdEppcywgbnVsbCwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiU09VTkQiLAorICAgICAgICAgICAgICAgICAgICAgICAgIlx1RkY3MVx1RkY5RFx1RkY4NFx1RkY5RVx1RkY3M1x1RkY5Qlx1RkY3Mlx1RkY4NFx1RkY5RVx1MDAzMzs7OzsiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJYLUlSTUMtTiIpKSwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjkiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtU0VDUkVUIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIxMCIsCisgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtSE9URUwiKSksIG51bGwpLAorICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjExIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJYLU5FQy1TQ0hPT0wiKSksIG51bGwpLAorICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjEyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJGQVgiLCAiSE9NRSIpKSwgbnVsbCkpOworICAgICAgICB2ZXJpZmllci52ZXJpZnkoYnVpbGRlci52Tm9kZUxpc3QuZ2V0KDApKTsKKyAgICAgICAgCisgICAgICAgIHZlcmlmaWVyID0gbmV3IFByb3BlcnR5Tm9kZXNWZXJpZmllcigKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJWRVJTSU9OIiwgIjIuMSIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJOIiwgIlx1NUI4OVx1ODVFNFx1MzBFRFx1MzBBNFx1MzBDOVx1MDAzNDs7OzsiLAorICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiXHU1Qjg5XHU4NUU0XHUzMEVEXHUzMEE0XHUzMEM5XHUwMDM0IiwgIiIsICIiLCAiIiwgIiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJTT1VORCIsCisgICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjcxXHVGRjlEXHVGRjg0XHVGRjlFXHVGRjczXHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDM0Ozs7OyIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBjb250ZW50VmFsdWVzRm9yU2hpZnRKaXMsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtSVJNQy1OIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTMiLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiTU9ERU0iKSksIG51bGwpLAorICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiVEVMIiwgIjE0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8U3RyaW5nPihBcnJheXMuYXNMaXN0KCJQQUdFUiIpKSwgbnVsbCksCisgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTUiLAorICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtTkVDLUZBTUlMWSIpKSwgbnVsbCksCisgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTYiLAorICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtTkVDLUdJUkwiKSksIG51bGwpKTsKKyAgICAgICAgdmVyaWZpZXIudmVyaWZ5KGJ1aWxkZXIudk5vZGVMaXN0LmdldCgxKSk7CisgICAgICAgIHZlcmlmaWVyID0gbmV3IFByb3BlcnR5Tm9kZXNWZXJpZmllcigKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJWRVJTSU9OIiwgIjIuMSIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJOIiwgIlx1NUI4OVx1ODVFNFx1MzBFRFx1MzBBNFx1MzBDOVx1MDAzNTs7OzsiLAorICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiXHU1Qjg5XHU4NUU0XHUzMEVEXHUzMEE0XHUzMEM5XHUwMDM1IiwgIiIsICIiLCAiIiwgIiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgY29udGVudFZhbHVlc0ZvclNoaWZ0SmlzLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJTT1VORCIsCisgICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjcxXHVGRjlEXHVGRjg0XHVGRjlFXHVGRjczXHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDM1Ozs7OyIsCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBjb250ZW50VmFsdWVzRm9yU2hpZnRKaXMsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlgtSVJNQy1OIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJURUwiLCAiMTciLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtQk9ZIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIxOCIsCisgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtRlJJRU5EIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIxOSIsCisgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtUEhTIikpLCBudWxsKSwKKyAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIyMCIsCisgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoU2V0PFN0cmluZz4oQXJyYXlzLmFzTGlzdCgiWC1ORUMtUkVTVEFVUkFOVCIpKSwgbnVsbCkpOworICAgICAgICB2ZXJpZmllci52ZXJpZnkoY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BbmQiLCAiUm9pZCIsICIiLCAiIiwgIiIpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiT1JHIiwgIk9wZW47SGFuZHNldDsgQWxsaWFuY2UiLAorICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiT3BlbiIsICJIYW5kc2V0IiwgIiBBbGxpYW5jZSIpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCksCisgICAgICAgICAgICAgICAgbmV3IFByb3BlcnR5Tm9kZSgiU09SVC1TVFJJTkciLCAiYW5kcm9pZCIsIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlRFTCIsICIwMzAwMDAwMDAwIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxTdHJpbmc+KEFycmF5cy5hc0xpc3QoIlBSRUYiLCAiVk9JQ0UiKSksIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIkNMQVNTIiwgIlBVQkxJQyIsIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlgtR05PIiwgIjAiLCBudWxsLCBudWxsLCBudWxsLCBudWxsLCBudWxsKSwKKyAgICAgICAgICAgICAgICBuZXcgUHJvcGVydHlOb2RlKCJYLUdOIiwgImdyb3VwMCIsIG51bGwsIG51bGwsIG51bGwsIG51bGwsIG51bGwpLAorICAgICAgICAgICAgICAgIG5ldyBQcm9wZXJ0eU5vZGUoIlgtUkVEVUNUSU9OIiwgIjAiLAorICAgICAgICAgICAgICAgICAgICAgIC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PSAxOworICAgICAgICB2bm9kZS5WTmFtZSA9IHR5cGU7CisgICAgICAgIC8vIEkgZmVlbCB0aGlzIHNob3VsZCBiZSBkb25lIGluIGVuZFJlY29yZCgpLCBidXQgaXQgY2Fubm90IGJlIGRvbmUgYmVjYXVzZSBvZgorICAgICAgICAvLyB0aGUgcmVhc29uIGFib3ZlLgorICAgICAgICB2Tm9kZUxpc3QuYWRkKHZub2RlKTsKKyAgICAgICAgbU5vZGVMaXN0UG9zID0gdk5vZGVMaXN0LnNpemUoKSAtIDE7CisgICAgICAgIG1DdXJyZW50Vk5vZGUgPSB2Tm9kZUxpc3QuZ2V0KG1Ob2RlTGlzdFBvcyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZW5kUmVjb3JkKCkgeworICAgICAgICBWTm9kZSBlbmROb2RlID0gdk5vZGVMaXN0LmdldChtTm9kZUxpc3RQb3MpOworICAgICAgICBlbmROb2RlLnBhcnNlU3RhdHVzID0gMDsKKyAgICAgICAgd2hpbGUobU5vZGVMaXN0UG9zID4gMCl7CisgICAgICAgICAgICBtTm9kZUxpc3RQb3MtLTsKKyAgICAgICAgICAgIGlmKCh2Tm9kZUxpc3QuZ2V0KG1Ob2RlTGlzdFBvcykpLnBhcnNlU3RhdHVzID09IDEpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgbUN1cnJlbnRWTm9kZSA9IHZOb2RlTGlzdC5nZXQobU5vZGVMaXN0UG9zKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdGFydFByb3BlcnR5KCkgeworICAgICAgICBtQ3VycmVudFByb3BOb2RlID0gbmV3IFByb3BlcnR5Tm9kZSgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGVuZFByb3BlcnR5KCkgeworICAgICAgICBtQ3VycmVudFZOb2RlLnByb3BMaXN0LmFkZChtQ3VycmVudFByb3BOb2RlKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgcHJvcGVydHlOYW1lKFN0cmluZyBuYW1lKSB7CisgICAgICAgIG1DdXJyZW50UHJvcE5vZGUucHJvcE5hbWUgPSBuYW1lOworICAgIH0KKworICAgIC8vIFVzZWQgb25seSBpbiBWQ2FyZC4KKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eUdyb3VwKFN0cmluZyBncm91cCkgeworICAgICAgICBtQ3VycmVudFByb3BOb2RlLnByb3BHcm91cFNldC5hZGQoZ3JvdXApOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eVBhcmFtVHlwZShTdHJpbmcgdHlwZSkgeworICAgICAgICBtQ3VycmVudFBhcmFtVHlwZSA9IHR5cGU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcHJvcGVydHlQYXJhbVZhbHVlKFN0cmluZyB2YWx1ZSkgeworICAgICAgICBpZiAobUN1cnJlbnRQYXJhbVR5cGUgPT0gbnVsbCB8fAorICAgICAgICAgICAgICAgIG1DdXJyZW50UGFyYW1UeXBlLmVxdWFsc0lnbm9yZUNhc2UoIlRZUEUiKSkgeworICAgICAgICAgICAgbUN1cnJlbnRQcm9wTm9kZS5wYXJhbU1hcF9UWVBFLmFkZCh2YWx1ZSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtQ3VycmVudFByb3BOb2RlLnBhcmFtTWFwLnB1dChtQ3VycmVudFBhcmFtVHlwZSwgdmFsdWUpOworICAgICAgICB9CisKKyAgICAgICAgbUN1cnJlbnRQYXJhbVR5cGUgPSBudWxsOworICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIGVuY29kZVN0cmluZyhTdHJpbmcgb3JpZ2luYWxTdHJpbmcsIFN0cmluZyB0YXJnZXRDaGFyc2V0KSB7CisgICAgICAgIGlmIChtU291cmNlQ2hhcnNldC5lcXVhbHNJZ25vcmVDYXNlKHRhcmdldENoYXJzZXQpKSB7CisgICAgICAgICAgICByZXR1cm4gb3JpZ2luYWxTdHJpbmc7CisgICAgICA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0IGlzIHVzZWQgb25seSB3aGVuIHRoZSBudW1iZXIgb2YgdmFsdWVzIGlzIDEuCisgICAgICAgICAgICAgICAgbUN1cnJlbnRQcm9wTm9kZS5wcm9wVmFsdWVfYnl0ZXMgPQorICAgICAgICAgICAgICAgICAgICBCYXNlNjQuZGVjb2RlQmFzZTY0KHZhbHVlLmdldEJ5dGVzKCkpOworICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoZW5jb2RpbmcuZXF1YWxzKCJRVU9URUQtUFJJTlRBQkxFIikpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgcXVvdGVkUHJpbnRhYmxlID0gdmFsdWUKKyAgICAgICAgICAgICAgICAucmVwbGFjZUFsbCgiPSAiLCAiICIpLnJlcGxhY2VBbGwoIj1cdCIsICJcdCIpOworICAgICAgICAgICAgICAgIFN0cmluZ1tdIGxpbmVzOworICAgICAgICAgICAgICAgIGlmIChtU3RyaWN0TGluZUJyZWFrUGFyc2luZykgeworICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IHF1b3RlZFByaW50YWJsZS5zcGxpdCgiXHJcbiIpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGggPSBxdW90ZWRQcmludGFibGUubGVuZ3RoKCk7CisgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBjaCA9IHF1b3RlZFByaW50YWJsZS5jaGFyQXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJ1xuJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICdccicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChidWlsZGVyLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpIDwgbGVuZ3RoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIG5leHRDaCA9IHF1b3RlZFByaW50YWJsZS5jaGFyQXQoaSArIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dENoID09ICdcbicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBmaW5hbExpbmUgPSBidWlsZGVyLnRvU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChmaW5hbExpbmUubGVuZ3RoKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChmaW5hbExpbmUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGxpbmVzID0gbGlzdC50b0FycmF5KG5ldyBTdHJpbmdbMF0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGxpbmUgOiBsaW5lcykgeworICAgICAgICAgICAgICAgICAgICBpZiAobGluZS5lbmRzV2l0aCgiPSIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZS5zdWJzdHJpbmcoMCwgbGluZS5sZW5ndGgoKSAtIDEpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBieXRlW10gYnl0ZXM7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZXMgPSBidWlsZGVyLnRvU3RyaW5nKCkuZ2V0Qnl0ZXMobVNvdXJjZUNoYXJzZXQpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkRW5jb2RpbmdFeGNlcHRpb24gZTEpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBlbmNvZGU6IGNoYXJzZXQ9IiArIG1Tb3VyY2VDaGFyc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZXMgPSBidWlsZGVyLnRvU3RyaW5nKCkuZ2V0Qnl0ZXMoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgYnl0ZXMgPSBRdW90ZWRQcmludGFibGVDb2RlYy5kZWNvZGVRdW90ZWRQcmludGFibGUoYnl0ZXMpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKERlY29kZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRmFpbGVkIHRvIGRlY29kZSBxdW90ZWQtcHJpbnRhYmxlOiAiICsgZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAiIjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0cmluZyhieXRlcywgdGFyZ2V0Q2hhcnNldCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gZW5jb2RlOiBjaGFyc2V0PSIgKyB0YXJnZXRDaGFyc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcoYnl0ZXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIFVua25vd24gZW5jb2RpbmcuIEZhbGwgYmFjayB0byBkZWZhdWx0LgorICAgICAgICB9CisgICAgICAgIHJldHVybiBlbmNvZGVTdHJpbmcodmFsdWUsIHRhcmdldENoYXJzZXQpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBwcm9wZXJ0eVZhbHVlcyhMaXN0PFN0cmluZz4gdmFsdWVzKSB7CisgICAgICAgIGlmICh2YWx1ZXMgPT0gbnVsbCB8fCB2YWx1ZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgIG1DdXJyZW50UHJvcE5vZGUucHJvcFZhbHVlX2J5dGVzID0gbnVsbDsKKyAgICAgICAgICAgIG1DdXJyZW50UHJvcE5vZGUucHJvcFZhbHVlX3ZlY3Rvci5jbGVhcigpOworICAgICAgICAgICAgbUN1cnJlbnRQcm9wTm9kZS5wcm9wVmFsdWVfdmVjdG9yLm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ZiAoc2l6ZSA+IDEpIHsKKyAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgdHlwZUxpc3RCID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGUgOiBsaXN0KSB7CisgICAgICAgICAgICAgICAgdHlwZUxpc3RCLmFwcGVuZCh0eXBlKS5hcHBlbmQoIjsiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBsZW4gPSB0eXBlTGlzdEIubGVuZ3RoKCk7CisgICAgICAgICAgICBpZiAobGVuID4gMCAmJiB0eXBlTGlzdEIuY2hhckF0KGxlbiAtIDEpID09ICc7JykgeworICAgICAgICAgICAgICAgIHJldHVybiB0eXBlTGlzdEIuc3Vic3RyaW5nKDAsIGxlbiAtIDEpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHR5cGVMaXN0Qi50b1N0cmluZygpOworICAgICAgICB9IGVsc2UgaWYgKHNpemUgPT0gMSkgeworICAgICAgICAgICAgcmV0dXJuIGxpc3QuZ2V0KDApOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBTdHJpbmcgZ2V0UmVzdWx0KCl7CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KK30KZGlmZiAtLWdpdCBhL3Rlc3RzL0Jyb3dzZXJQb3dlclRlc3QvQW5kcm9pZC5tayBiL3Rlc3RzL0Jyb3dzZXJQb3dlclRlc3QvQW5kcm9pZC5tawpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mMmMwN2IzCi0tLSAvZGV2L251bGwKKysrIGIvdGVzdHMvQnJvd3NlclBvd2VyVGVzdC9BbmRyb2lkLm1rCkBAIC0wLDAgKzEsMzAgQEAKKyMgQ29weXJpZ2h0IDIwMDgsIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QK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AgIHByaXZhdGUgSGFuZGxlciBoYW5kbGVyOworICAgIHByaXZhdGUgYm9vbGVhbiB0aW1lb3V0RmxhZzsKKyAgICBwcml2YXRlIGJvb2xlYW4gbG9nVGltZTsKKyAgICBwcml2YXRlIGJvb2xlYW4gcGFnZURvbmU7CisgICAgcHJpdmF0ZSBPYmplY3QgcGFnZURvbmVMb2NrOworICAgIHByaXZhdGUgaW50IHBhZ2VTdGFydENvdW50OworICAgIHByaXZhdGUgaW50IG1hbnVhbERlbGF5OworICAgIHByaXZhdGUgbG9uZyBzdGFydFRpbWU7CisgICAgcHJpdmF0ZSBsb25nIHBhZ2VMb2FkVGltZTsKKyAgICBwcml2YXRlIFBhZ2VEb25lUnVubmVyIHBhZ2VEb25lUnVubmVyID0gbmV3IFBhZ2VEb25lUnVubmVyKCk7CisKKyAgICBwdWJsaWMgUG93ZXJUZXN0QWN0aXZpdHkoKSB7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25DcmVhdGUoQnVuZGxlIHNhdmVkSW5zdGFuY2VTdGF0ZSkgeworICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpOworCisgICAgICAgIExvZy52KExPR1RBRywgIm9uQ3JlYXRlLCBpbnN0PSIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGhhc2hDb2RlKCkpKTsKKworICAgICAgICBMaW5lYXJMYXlvdXQgY29udGVudFZpZXcgPSBuZXcgTGluZWFyTGF5b3V0KHRoaXMpOworICAgICAgICBjb250ZW50Vmlldy5zZXRPcmllbnRhdGlvbihMaW5lYXJMYXlvdXQuVkVSVElDQUwpOworICAgICAgICBzZXRDb250ZW50Vmlldyhjb250ZW50Vmlldyk7CisgICAgICAgIHNldFRpdGxlKCJJZGxlIik7CisKKyAgICAgICAgd2ViVmlldyA9IG5ldyBXZWJWaWV3KHRoaXMpOworICAgICAgICB3ZWJWaWV3LmdldFNldHRpbmdzKCkuc2V0SmF2YVNjcmlwdEVuYWJsZWQodHJ1ZSk7CisgICAgICAgIHdlYlZpZXcuZ2V0U2V0dGluZ3MoKS5zZXRKYXZhU2NyaXB0Q2FuT3BlbldpbmRvd3NBdXRvbWF0aWNhbGx5KGZhbHNlKTsKKyAgICAgICAgd2ViVmlldy5nZXRTZXR0aW5ncygpLnNldExheW91dEFsZ29yaXRobShMYXlvdXRBbGdvcml0aG0uTk9STUFMKTsKKworICAgICAgICB3ZWJWaWV3Q2xpZW50ID0gbmV3IFNpbXBsZVdlYlZpZXdDbGllbnQoKTsKKyAgICAgICAgY2hyb21lQ2xpZW50ID0gbmV3IFNpbXBsZUNocm9tZUNsaWVudCgpOworICAgICAgICB3ZWJWaWV3LnNldFdlYlZpZXdDbGllbnQod2ViVmlld0NsaWVudCk7CisgICAgICAgIHdlYlZpZXcuc2V0V2ViQ2hyb21lQ2xpZW50KGNocm9tZUNsaWVudCk7CisKKyAgICAgICAgY29udGVudFZpZXcuYWRkVmlldyh3ZWJWaWV3LCBuZXcgTGF5b3V0UGFyYW1zKAorICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuRklMTF9QQVJFTlQsCisgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5GSUxMX1BBUkVOVCwgMC4wZikpOworCisgICAgICAgIGhhbmRsZXIgPSBuZXcgSGFuZGxlcigpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBNU0dfVElNRU9VVDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVRpbWVvdXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBNU0dfTkFWSUdBVEU6CisgICAgICAgICAgICAgICAgICAgICAgICBtYW51YWxEZWxheSA9IG1zZy5hcmcyOworICAgICAgICAgICAgICAgICAgICAgICAgbmF2aWdhdGUobXNnLmdldERhdGEoKS5nZXRTdHJpbmcoTVNHX05BVl9VUkwpLCBtc2cuYXJnMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2dUaW1lID0gbXNnLmdldERhdGEoKS5nZXRCb29sZWFuKE1TR19OQVZfTE9HVElNRSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIHBhZ2VEb25lTG9jayA9IG5ldyBPYmplY3QoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZXNldCgpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChwYWdlRG9uZUxvY2spIHsKKyAgICAgICAgICAgIHBhZ2VEb25lID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgdGltZW91dEZsYWcgPSBmYWxzZTsKKyAgICAgICAgcGFnZVN0YXJ0Q291bnQgPSAwOworICAgICAgICBjaHJvbWVDbGllbnQucmVzZXRKc1RpbWVvdXQoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgbmF2aWdhdGUoU3RyaW5nIHVybCwgaW50IHRpbWVvdXQpIHsKKyAgICAgICAgaWYodXJsID09IG51bGwpIHsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgIlVSTCBpcyBudWxsLCBjYW5jZWxsaW5nLi4uIik7CisgICAgICAgICAgICBmaW5pc2goKTsKKyAgICAgICAgfQorICAgICAgICB3ZWJWaWV3LnN0b3BMb2FkaW5nKCk7CisgICAgICAgIGlmKGxvZ1RpbWUpIHsKKyAgICAgICAgICAgIHdlYlZpZXcuY2xlYXJDYWNoZSh0cnVlKTsKKyAgICAgICAgfQorICAgICAgICBzdGFydFRpbWUgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKKyAgICAgICAgTG9nLnYoTE9HVEFHLCAiTmF2aWdhdGluZyB0byBVUkw6ICIgKyB1cmwpOworICAgICAgICB3ZWJWaWV3LmxvYWRVcmwodXJsKTsKKworICAgICAgICBpZih0aW1lb3V0ICE9IDApIHsKKyAgICAgICAgICAgIC8vc2V0IGEgdGltZXIgd2l0aCBzcGVjaWZpZWQgdGltZW91dCAoaW4gbXMpCisgICAgICAgICAgICBoYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChoYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX1RJTUVPVVQpLAorICAgICAgICAgICAgICAgICAgICB0aW1lb3V0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uRGVzdHJveSgpIHsKKyAgICAgICAgc3VwZXIub25EZXN0cm95KCk7CisgICAgICAgIExvZy52KExPR1RBRywgIm9uRGVzdHJveSwgaW5zdD0iICsgSW50ZWdlci50b0hleFN0cmluZyhoYXNoQ29kZSgpKSk7CisgICAgICAgIHdlYlZpZXcuY2xlYXJDYWNoZSh0cnVlKTsKKyAgICAgICAgd2ViVmlldy5kZXN0cm95KCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGlzUGFnZURvbmUoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAocGFnZURvbmVMb2NrKSB7CisgICAgICAgICAgICByZXR1cm4gcGFnZURvbmU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2V0UGFnZURvbmUoYm9vbGVhbiBwYWdlRG9uZSkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHBhZ2VEb25lTG9jaykgeworICAgICAgICAgICAgdGhpcy5wYWdlRG9uZSA9IHBhZ2VEb25lOworICAgICAgICAgICAgcGFnZURvbmVMb2NrLm5vdGlmeUFsbCgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZVRpbWVvdXQoKSB7CisgICAgICAgIGludCBwcm9ncmVzcyA9IHdlYlZpZXcuZ2V0UHJvZ3Jlc3MoKTsKKyAgICAgICAgd2ViVmlldy5zdG9wTG9hZGluZygpOworICAgICAgICBMb2cudihMT0dUQUcsICJQYWdlIHRpbWVvdXQgdHJpZ2dlcmVkLCBwcm9ncmVzcyA9ICIgKyBwcm9ncmVzcyk7CisgICAgICAgIHRpbWVvdXRGbGFnID0gdHJ1ZTsKKyAgICAgICAgaGFuZGxlci5wb3N0RGVsYXllZChwYWdlRG9uZVJ1bm5lciwgbWFudWFsRGVsYXkpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIHdhaXRVbnRpbERvbmUoKSB7CisgICAgICAgIHZhbGlkYXRlTm90QXBwVGhyZWFkKCk7CisgICAgICAgIHN5bmNocm9uaXplZCAocGFnZURvbmVMb2NrKSB7CisgICAgICAgICAgICB3aGlsZSghaXNQYWdlRG9uZSgpKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgcGFnZURvbmVMb2NrLndhaXQoKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBpZSkgeworICAgICAgICAgICAgICAgICAgICAvL25vLW9wCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0aW1lb3V0RmxhZzsKKyAgICB9CisKKyAgICBwdWJsaWMgSGFuZGxlciBnZXRIYW5kbGVyKCkgeworICAgICAgICByZXR1cm4gaGFuZGxlcjsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHZvaWQgdmFsaWRhdGVOb3RBcHBUaHJlYWQoKSB7CisgICAgICAgIGlmIChBY3Rpdml0eVRocmVhZC5jdXJyZW50QWN0aXZpdHlUaHJlYWQoKSAhPSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAiVGhpcyBtZXRob2QgY2FuIG5vdCBiZSBjYWxsZWQgZnJvbSB0aGUgbWFpbiBhcHBsaWNhdGlvbiB0aHJlYWQiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBsb25nIGdldFBhZ2VMb2FkVGltZSgpIHsKKyAgICAgICAgcmV0dXJuIHBhZ2VMb2FkVGltZTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBnZXRQYWdlRXJyb3IoKSB7CisgICAgICAgIHJldHVybiB3ZWJWaWV3Q2xpZW50LmdldFBhZ2VFcnJvckZsYWcoKTsKKyAgICB9CisKKyAgICBjbGFzcyBTaW1wbGVXZWJWaWV3Q2xpZW50IGV4dGVuZHMgV2ViVmlld0NsaWVudCB7CisKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIHBhZ2VFcnJvckZsYWcgPSBmYWxzZTsKKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlZEVycm9yKFdlYlZpZXcgdmlldywgaW50IGVycm9yQ29kZSwgU3RyaW5nIGRlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgIFN0cmluZyBmYWlsaW5nVXJsKSB7CisgICAgICAgICAgICBwYWdlRXJyb3JGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgIldlYkNvcmUgZXJyb3I6IGNvZGU9IiArIGVycm9yQ29kZQorICAgICAgICAgICAgICAgICAgICArICIsIGRlc2NyaXB0aW9uPSIgKyBkZXNjcmlwdGlvbgorICAgICAgICAgICAgICAgICAgICArICIsIHVybD0iICsgZmFpbGluZ1VybCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25QYWdlU3RhcnRlZChXZWJWaWV3IHZpZXcsIFN0cmluZyB1cmwsIEJpdG1hcCBmYXZpY29uKSB7CisgICAgICAgICAgICBwYWdlU3RhcnRDb3VudCsrOworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAib25QYWdlU3RhcnRlZDogIiArIHVybCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25QYWdlRmluaXNoZWQoV2ViVmlldyB2aWV3LCBTdHJpbmcgdXJsKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblBhZ2VGaW5pc2hlZDogIiArIHVybCk7CisgICAgICAgICAgICAvLyBsZXQgaGFuZGxlVGltZW91dCB0YWtlIGNhcmUgb2YgZmluaXNoaW5nIHRoZSBwYWdlCisgICAgICAgICAgICBpZighdGltZW91dEZsYWcpCisgICAgICAgICAgICAgICAgaGFuZGxlci5wb3N0RGVsYXllZChuZXcgV2ViVmlld1N0YXR1c0NoZWNrZXIoKSwgNTAwKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHJldHVybiB0cnVlIGlmIHRoZSBVUkwgaXMgbm90IGF2YWlsYWJsZSBvciB0aGUgcGFnZSBpcyBkb3duCisgICAgICAgIHB1YmxpYyBib29sZWFuIGdldFBhZ2VFcnJvckZsYWcoKSB7CisgICAgICAgICAgICByZXR1cm4gcGFnZUVycm9yRmxhZzsKKyAgICAgICAgfQorICAgIH0KKworICAgIGNsYXNzIFNpbXBsZUNocm9tZUNsaWVudCBleHRlbmRzIFdlYkNocm9tZUNsaWVudCB7CisKKyAgICAgICAgcHJpdmF0ZSBpbnQgdGltZW91dENvdW50ZXIgPSAwOworCisgICAgICAgIHB1YmxpYyB2b2lkIHJlc2V0SnNUaW1lb3V0KCkgeworICAgICAgICAgICAgdGltZW91dENvdW50ZXIgPSAwOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZWRUaXRsZShXZWJWaWV3IHZpZXcsIFN0cmluZyB0aXRsZSkgeworICAgICAgICAgICAgUG93ZXJUZXN0QWN0aXZpdHkudGhpcy5zZXRUaXRsZSh0aXRsZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbGFzcyBXZWJWaWV3U3RhdHVzQ2hlY2tlciBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKKworICAgICAgICBwcml2YXRlIGludCBpbml0aWFsU3RhcnRDb3VudDsKKworICAgICAgICBwdWJsaWMgV2ViVmlld1N0YXR1c0NoZWNrZXIoKSB7CisgICAgICAgICAgICBpbml0aWFsU3RhcnRDb3VudCA9IHBhZ2VTdGFydENvdW50OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgaWYgKGluaXRpYWxTdGFydENvdW50ID09IHBhZ2VTdGFydENvdW50ICYmICFpc1BhZ2VEb25lKCkpIHsKKyAgICAgICAgICAgICAgICBoYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKE1TR19USU1FT1VUKTsKKyAgICAgICAgICAgICAgICB3ZWJWaWV3LnN0b3BMb2FkaW5nKCk7CisgICAgICAgICAgICAgICAgaGFuZGxlci5wb3N0RGVsYXllZChwYWdlRG9uZVJ1bm5lciwgbWFudWFsRGVsYXkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgY2xhc3MgUGFnZURvbmVSdW5uZXIgaW1wbGVtZW50cyBSdW5uYWJsZSB7CisKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiRmluaXNoaW5nIFVSTDogIiArIHdlYlZpZXcuZ2V0VXJsKCkpOworICAgICAgICAgICAgcGFnZUxvYWRUaW1lID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzdGFydFRpbWU7CisgICAgICAgICAgICBzZXRQYWdlRG9uZSh0cnVlKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL3Rlc3RzL0Jyb3dzZXJQb3dlclRlc3Qvc3JjL2NvbS9hb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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFwYWNoZSBMaWNlbnNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICBWZXJzaW9uIDIuMCwgSmFudWFyeSAyMDA0CisgICAgICAgICAgICAgICAgICAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvCisKKyAgIFRFUk1TIEFORCBDT05ESVRJT05TIEZPUiBVU0UsIFJFUFJPRFVDVElPTiwgQU5EIERJU1RSSUJVVElPTgorCisgICAxLiBEZWZpbml0aW9ucy4KKworICAgICAgIkxpY2Vuc2UiIHNoYWxsIG1lYW4gdGhlIHRlcm1zIGFuZCBjb25kaXRpb25zIGZvciB1c2UsIHJlcHJvZHVjdGlvbiwKKyAgICAgIGFuZCBkaXN0cmlidXRpb24gYXMgZGVmaW5lZCBieSBTZWN0aW9ucyAxIHRocm91Z2ggOSBvZiB0aGlzIGRvY3VtZW50LgorCisgICAgICAiTGljZW5zb3IiIHNoYWxsIG1lYW4gdGhlIGNvcHlyaWdodCBvd25lciBvciBlbnRpdHkgYXV0aG9yaXplZCBieQorICAgICAgdGhlIGNvcHlyaWdodCBvd25lciB0aGF0IGlzIGdyYW50aW5nIHRoZSBMaWNlbnNlLgorCisgICAgICAiTGVnYWwgRW50aXR5IiBzaGFsbCBtZWFuIHRoZSB1bmlvbiBvZiB0aGUgYWN0aW5nIGVudGl0eSBhbmQgYWxsCisgICAgICBvdGhlciBlbnRpdGllcyB0aGF0IGNvbnRyb2wsIGFyZSBjb250cm9sbGVkIGJ5LCBvciBhcmUgdW5kZXIgY29tbW9uCisgICAgICBjb250cm9sIHdpdGggdGhhdCBlbnRpdHkuIEZvciB0aGUgcHVycG9zZXMgb2YgdGhpcyBkZWZpbml0aW9uLAorICAgICAgImNvbnRyb2wiIG1lYW5zIChpKSB0aGUgcG93ZXIsIGRpcmVjdCBvciBpbmRpcmVjdCwgdG8gY2F1c2UgdGhlCisgICAgICBkaXJlY3Rpb24gb3IgbWFuYW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ZX0lERU5USUZJRVJTXTsKK3N0YXRpYyBjb25zdCBOUFVURjggKnBsdWdpblByb3BlcnR5SWRlbnRpZmllck5hbWVzW05VTV9QUk9QRVJUWV9JREVOVElGSUVSU10gPSB7CisgICAgInRlc3RmaWxlIgorfTsKKworI2RlZmluZSBJRF9HRVRURVNURklMRV9NRVRIT0QgICAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBOVU1fTUVUSE9EX0lERU5USUZJRVJTICAgICAgICAgICAgICAgICAgMQorCitzdGF0aWMgTlBJZGVudGlmaWVyIHBsdWdpbk1ldGhvZElkZW50aWZpZXJzW05VTV9NRVRIT0RfSURFTlRJRklFUlNdOworc3RhdGljIGNvbnN0IE5QVVRGOCAqcGx1Z2luTWV0aG9kSWRlbnRpZmllck5hbWVzW05VTV9NRVRIT0RfSURFTlRJRklFUlNdID0geworICAgICJnZXRUZXN0RmlsZSIKK307CisKK3N0YXRpYyB2b2lkIGluaXRpYWxpemVJZGVudGlmaWVycyh2b2lkKQoreworICAgIGJyb3dzZXItPmdldHN0cmluZ2lkZW50aWZpZXJzKHBsdWdpblByb3BlcnR5SWRlbnRpZmllck5hbWVzLCBOVU1fUFJPUEVSVFlfSURFTlRJRklFUlMsIHBsdWdpblByb3BlcnR5SWRlbnRpZmllcnMpOworICAgIGJyb3dzZXItPmdldHN0cmluZ2lkZW50aWZpZXJzKHBsdWdpbk1ldGhvZElkZW50aWZpZXJOYW1lcywgTlVNX01FVEhPRF9JREVOVElGSUVSUywgcGx1Z2luTWV0aG9kSWRlbnRpZmllcnMpOworfQorCitzdGF0aWMgYm9vbCBwbHVnaW5IYXNQcm9wZXJ0eShOUE9iamVjdCAqb2JqLCBOUElkZW50aWZpZXIgbmFtZSkKK3sKKyAgICBpbnQgaTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgTlVNX1BST1BFUlRZX0lERU5USUZJRVJTOyBpKyspCisgICAgICAgIGlmIChuYW1lID09IHBsdWdpblByb3BlcnR5SWRlbnRpZmllcnN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AgICAgICAgICBjYXNlIGtEZXN0cm95ZWRfQU5QU3VyZmFjZUFjdGlvbjoKKyAgICAgICAgICAgICAgICAgICAgbV9zdXJmYWNlUmVhZHkgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICAgICAgY2FzZSBrQ2hhbmdlZF9BTlBTdXJmYWNlQWN0aW9uOgorICAgICAgICAgICAgICAgICAgICBkcmF3UGx1Z2luKGV2dC0+ZGF0YS5zdXJmYWNlLmRhdGEuY2hhbmdlZC53aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldnQtPmRhdGEuc3VyZmFjZS5kYXRhLmNoYW5nZWQuaGVpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBrTGlmZWN5Y2xlX0FOUEV2ZW50VHlwZToKKyAgICAgICAgICAgIHN3aXRjaCAoZXZ0LT5kYXRhLmxpZmVjeWNsZS5hY3Rpb24pIHsKKyAgICAgICAgICAgICAgICBjYXNlIGtPbkxvYWRfQU5QTGlmZWN5Y2xlQWN0aW9uOiB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgbXNnW10gPSAibGlmZWN5Y2xlLW9uTG9hZCI7CisgICAgICAgICAgICAgICAgICAgIHByaW50VG9EaXYobXNnLCBzdHJsZW4obXNnKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIGtHYWluRm9jdXNfQU5QTGlmZWN5Y2xlQWN0aW9uOiB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgbXNnW10gPSAibGlmZWN5Y2xlLWdhaW5Gb2N1cyI7CisgICAgICAgICAgICAgICAgICAgIHByaW50VG9EaXYobXNnLCBzdHJsZW4obXNnKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIGtMb3NlRm9jdXNfQU5QTGlmZWN5Y2xlQWN0aW9uOiB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgbXNnW10gPSAibGlmZWN5Y2xlLWxvc2VGb2N1cyI7CisgICAgICAgICAgICAgICAgICAgIHByaW50VG9EaXYobXNnLCBzdHJsZW4obXNnKSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICBjYXNlIGtUb3VjaF9BTlBFdmVudFR5cGU6CisgICAgICAgICAgICBnTG9nSS5sb2coaW5zdCgpLCBrRXJyb3JfQU5QTG9nVHlwZSwgIiAtLS0tLS0gJXAgdGhlIHBsdWdpbiBkaWQgbm90IHJlcXVlc3QgdG91Y2ggZXZlbnRzIiwgaW5zdCgpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIGtLZXlfQU5QRXZlbnRUeXBlOgorICAgICAgICAgICAgZ0xvZ0kubG9nKGluc3QoKSwga0Vycm9yX0FOUExvZ1R5cGUsICIgLS0tLS0tICVwIHRoZSBwbHVnaW4gZGlkIG5vdCByZXF1ZXN0IGtleSBldmVudHMiLCBpbnN0KCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisgICAgcmV0dXJuIDA7ICAgLy8gdW5rbm93biBvciB1bmhhbmRsZWQgZXZlbnQKK30KZGlmZiAtLWdpdCBhL3Rlc3RzL0Jyb3dzZXJUZXN0UGx1Z2luL2puaS9ldmVudC9FdmVudFBsdWdpbi5oIGIvdGVzdHMvQnJvd3NlclRlc3RQbHVnaW4vam5pL2V2ZW50L0V2ZW50UGx1Z2luLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNzNkZDZlYQotLS0g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F9BTlBTZXRWYWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PHZvaWQqPihtb2RlbCkpOworICAgIGlmIChlcnIpIHsKKyAgICAgICAgZ0xvZ0kubG9nKGluc3RhbmNlLCBrRXJyb3JfQU5QTG9nVHlwZSwgInJlcXVlc3QgbW9kZWwgJWQgZXJyICVkIiwgbW9kZWwsIGVycik7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgLy8gY3JlYXRlIHRoZSBzdWItcGx1Z2luCisgICAgb2JqLT5zdWJQbHVnaW4gPSBuZXcgRXZlbnRQbHVnaW4oaW5zdGFuY2UpOworCisgICAgcmV0dXJuIE5QRVJSX05PX0VSUk9SOworfQorCitOUEVycm9yIE5QUF9EZXN0cm95KE5QUCBpbnN0YW5jZSwgTlBTYXZlZERhdGEqKiBzYXZlKQoreworICAgIFBsdWdpbk9iamVjdCAqb2JqID0gKFBsdWdpbk9iamVjdCopIGluc3RhbmNlLT5wZGF0YTsKKyAgICBkZWxldGUgb2JqLT5zdWJQbHVnaW47CisKKyAgICByZXR1cm4gTlBFUlJfTk9fRVJST1I7Cit9CisKK05QRXJyb3IgTlBQX1NldFdpbmRvdyhOUFAgaW5zdGFuY2UsIE5QV2luZG93KiB3aW5kb3cpCit7CisgICAgUGx1Z2luT2JqZWN0ICpvYmogPSAoUGx1Z2luT2JqZWN0KikgaW5zdGFuY2UtPnBkYXRhOworCisgICAgLy8gRG8gbm90aGluZyBpZiBicm93c2VyIGRpZG4ndCBzdXBwb3J0IE5QTl9DcmVhdGVPYmplY3Qgd2hpY2ggd291bGQgaGF2ZSBjcmVhdGVkIHRoZSBQbHVnaW5PYmplY3QuCisgICAgaWYgKG9iaiAhPSBOVUxMKSB7CisgICAgICAgIG9iai0+d2luZG93ID0gd2luZG93OworICAgIH0KKworICAgIHJldHVybiBOUEVSUl9OT19FUlJPUjsKK30KKworTlBFcnJvciBOUFBfTmV3U3RyZWFtKE5QU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ICAgUGhvbmVOdW1iZXJVdGlscy5mb3JtYXROYW5wTnVtYmVyKG51bWJlcik7CisgICAgICAgIGFzc2VydEVxdWFscygiNDY2NDUiLCBudW1iZXIudG9TdHJpbmcoKSk7CiAgICAgfQogCiAgICAgQFNtYWxsVGVzdApAQCAtMzMwLDQgKzMzNSw3NiBAQAogICAgICAgICBhc3NlcnRFcXVhbHMoIig4MDApIDIyMi0zMzM0IiwKICAgICAgICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuY29udmVydEtleXBhZExldHRlcnNUb0RpZ2l0cygiKDgwMCkgQUJDLURFRkciKSk7CiAgICAgfQorCisgICAgQFNtYWxsVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RDaGVja0FuZFByb2Nlc3NQbHVzQ29kZSgpIHsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCIwMTE4NDc1Nzk3MDAwIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmNkbWFDaGVja0FuZFByb2Nlc3NQbHVzQ29kZSgiKzg0NzU3OTcwMDAiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiMTg0NzU3OTcwMDAiLAorICAgICAgICAgICAgICAgIFBob25lTnVtYmVyVXRpbHMuY2RtYUNoZWNrQW5kUHJvY2Vzc1BsdXNDb2RlKCIrMTg0NzU3OTcwMDAiKSk7CisgICAgICAgIGFzc2VydEVxdWFscygiMDExMTIzNDU2NyIsCisgICAgICAgICAgICAgICAgUGhvbmVOdW1iZXJVdGlscy5jZG1hQ2hlY2tBbmRQcm9jZXNzUGx1c0NvZGUoIisxMjM0NTY3IikpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjAxMTIzNDU2NzAwMDAwIiwKKyAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmNkbWFDaGVja0FuZFByb2Nlc3NQbHVzQ29kZSgiKzIzNDU2NzAwMDAwIikpOworICAgICAgICBhc3NlcnRFcXVhbHMoIjAxMTExODc1NzY3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KTsKKworICAgICAgICBhc3NlcnRUcnVlKHJtLmNvbmZpZ3VyZSgxLCA1MDAsIDEwKSk7CisgICAgICAgIGludCBsb29wcyA9IDEwOworICAgICAgICBpbnQgY291bnQgPSAwOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxvb3BzOyBpKyspIHsKKyAgICAgICAgICAgIGFzc2VydFRydWUocm0uaXNSZXRyeU5lZWRlZCgpKTsKKyAgICAgICAgICAgIGludCB0aW1lID0gcm0uZ2V0UmV0cnlUaW1lcigpOworICAgICAgICAgICAgYXNzZXJ0VHJ1ZSgodGltZSA+PSA1MDApICYmICh0aW1lIDwgNjAwKSk7CisgICAgICAgICAgICBpZiAodGltZSA9PSA1MDApIHsKKyAgICAgICAgICAgICAgICBjb3VudCsrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGFzc2VydEZhbHNlKGNvdW50ID09IGxvb3BzKTsKKyAgICAgICAgcm0uaW5jcmVhc2VSZXRyeUNvdW50KCk7CisgICAgICAgIGFzc2VydEZhbHNlKHJtLmlzUmV0cnlOZWVkZWQoKSk7CisgICAgICAgIHJtLnNldFJldHJ5Q291bnQoMCk7CisgICAgICAgIGFzc2VydFRydWUocm0uaXNSZXRyeU5lZWRlZCgpKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUZXN0IG11bHRpcGxlIHZhbHVlcyB1c2luZyBzaW1wbGUgY29uZmlndXJhdGlvbi4KKyAgICAgKi8KKyAgICBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFJldHJ5TWFuYWdlclNpbXBsZSgpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBSZXRyeU1hbmFnZXIgcm0gPSBuZXcgUmV0cnlNYW5hZ2VyKCk7CisKKyAgICAgICAgYXNzZXJ0VHJ1ZShybS5jb25maWd1cmUoMywgMTAwMCwgMCkpOworICAgICAgICBhc3NlcnRUcnVlKHJtLmlzUmV0cnlOZWVkZWQoKSk7CisgICAgICAgIGFz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YWxzZShybS5pc1JldHJ5TmVlZGVkKCkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFRlc3QgaW5maW5pdGUgcmV0aXJlcworICAgICAqLworICAgIEBTbWFsbFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0UmV0cnlNYW5hZ2VJbmZpbml0ZSgpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBSZXRyeU1hbmFnZXIgcm0gPSBuZXcgUmV0cnlNYW5hZ2VyKCk7CisKKyAgICAgICAgYXNzZXJ0VHJ1ZShybS5jb25maWd1cmUoIjEwMDAsMjAwMCwzMDAwLG1heF9yZXRyaWVzPWluZmluaXRlIikpOworICAgICAgICBhc3NlcnRUcnVlKHJtLmlzUmV0cnlOZWVkZWQoKSk7CisgICAgICAgIGFzc2VydEVxdWFscygxMDAwLCBybS5nZXRSZXRyeVRpbWVyKCkpOworICAgICAgICBybS5pbmNyZWFzZVJldHJ5Q291bnQoKTsKKyAgICAgICAgYXNzZXJ0VHJ1ZShybS5pc1JldHJ5TmVlZGVkKCkpOworICAgICAgICBhc3NlcnRFcXVhbHMoMjAwMCwgcm0uZ2V0UmV0cnlUaW1lcigpKTsKKyAgICAgICAgcm0uaW5jcmVhc2VSZXRyeUNvdW50KCk7CisgICAgICAgIGFzc2VydFRydWUocm0uaXNSZXRyeU5lZWRlZCgpKTsKKyAgICAgICAgLy8gQWxsIG90aGVycyBhcmUgMzAwMCBhbmQgaXNSZXRyeU5lZWRlZCBpcyBhbHdheXMgdHJ1ZQorICAgICAgICBmb3IgKGludCBpPTA7IGkgPCAxMDA7IGkrKykgeworICAgICAgICAgICAgYXNzZXJ0RXF1YWxzKDMwMDAsIHJtLmdldFJldHJ5VGltZXIoKSk7CisgICAgICAgICAgICBybS5pbmNyZWFzZVJldHJ5Q291bnQoKTsKKyAgICAgICAgICAgIGFzc2VydFRydWUocm0uaXNSZXRyeU5lZWRlZCgpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRlc3Qgc3RyaW5nIGNvbmZpZ3VyYXRpb24gdXNpbmcgYWxsIG9wdGlvbnMuCisgICAgICovCisgICAgQFNtYWxsVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RSZXRyeU1hbmFnZVN0cmluZygpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBSZXRyeU1hbmFnZXIgcm0gPSBuZXcgUmV0cnlNYW5hZ2VyKCk7CisgICAgICAgIGludCB0aW1lOworCisgICAgICAgIGFzc2VydFRydWUocm0uY29uZmlndXJlKCJtYXhfcmV0cmllcz00LCIKKyAgICAgICAgICAgICAgICAgICsgImRlZmF1bHRfcmFuZG9taXphdGlvbj0xMDAsMTAwMCwgMjAwMCA6MjAwICwgMzAwMCIpKTsKKyAgICAgICAgYXNzZXJ0VHJ1ZShybS5pc1JldHJ5TmVlZGVkKCkpOworICAgICAgICB0aW1lID0gcm0uZ2V0UmV0cnlUaW1lcigpOworICAgICAgICBhc3NlcnRUcnVlKCh0aW1lID49IDEwMDApICYmICh0aW1lIDwgMTEwMCkpOworCisgICAgICAgIHJtLmluY3JlYXNlUmV0cnlDb3VudCgpOworICAgICAgICBhc3NlcnRUcnVlKHJtLmlzUmV0cnlOZWVkZWQoKSk7CisgICAgICAgIHRpbWUgPSBybS5nZXRSZXRyeVRpbWVyKCk7CisgICAgICAgIGFzc2VydFRydWUoKHRpbWUgPj0gMjAwMCkgJiYgKHRpbWUgPCAyMjAwKSk7CisKKyAgICAgICAgcm0uaW5jcmVhc2VSZXRyeUNvdW50KCk7CisgICAgICAgIGFzc2VydFRydWUocm0uaXNSZXRyeU5lZWRlZCgpKTsKKyAgICAgICAgdGltZSA9IHJtLmdldFJldHJ5VGltZXIoKTsKKyAgICAgICAgYXNzZXJ0VHJ1ZSgodGltZSA+PSAzMDAwKSAmJiAodGltZSA8IDMxMDApKTsKKworICAgICAgICBybS5pbmNyZWFzZVJldHJ5Q291bnQoKTsKKyAgICAgICAgYXNzZXJ0VHJ1ZShybS5pc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QVlPVVRfV0FJVF9VTlRJTF9ET05FOgogICAgICAgICAgICAgbUxheW91dFRlc3RDb250cm9sbGVyLndhaXRVbnRpbERvbmUoKTsKICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgTEFZT1VUX0RVTVBfREFUQUJBU0VfQ0FMTEJBQ0tTOgorICAgICAgICAgICAgbUxheW91dFRlc3RDb250cm9sbGVyLmR1bXBEYXRhYmFzZUNhbGxiYWNrcygpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBMQVlPVVRfU0VUX0NBTl9PUEVOX1dJTkRPV1M6CisgICAgICAgICAgICBtTGF5b3V0VGVzdENvbnRyb2xsZXIuc2V0Q2FuT3BlbldpbmRvd3MoKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgU0VUX0dFT0xPQ0FUSU9OX1BFUk1JU1NJT046CisgICAgICAgICAgICBtTGF5b3V0VGVzdENvbnRyb2xsZXIuc2V0R2VvbG9jYXRpb25QZXJtaXNzaW9uKAorICAgICAgICAgICAgICAgICAgICBtc2cuYXJnMSA9PSAxID8gdHJ1ZSA6IGZhbHNlKTsKKyAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAgICAgfQogCkBAIC0zMTQsNyArMzMyLDcgQEAKICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCBzZXRXaW5kb3dJc0tleShib29sZWFuIGIpIHsKLSAgICAgICAgb2J0YWluTWVzc2FnZShMQVlPVVRfU0VUX1dJTkRPV19LRVksYiA/IDEgOiAwLCAwKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgb2J0YWluTWVzc2FnZShMQVlPVVRfU0VUX1dJTkRPV19LRVksIGIgPyAxIDogMCwgMCkuc2VuZFRvVGFyZ2V0KCk7CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgdGVzdFJlcGFpbnQoKSB7CkBAIC0zMjUsNCArMzQzLDM1IEBACiAgICAgICAgIG9idGFpbk1lc3NhZ2UoTEFZT1VUX1dBSVRfVU5USUxfRE9ORSkuc2VuZFRvVGFyZ2V0KCk7CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgZHVtcERhdGFiYXNlQ2FsbGJhY2tzKCkgeworICAgICAgICBvYnRhaW5NZXNzYWdlKExBWU9VVF9EVU1QX0RBVEFCQVNFX0NBTExCQUNLUykuc2VuZFRvVGFyZ2V0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY2xlYXJBbGxEYXRhYmFzZXMoKSB7CisgICAgICAgIFdlYlN0b3JhZ2UuZ2V0SW5zdGFuY2UoKS5kZWxldGVBbGxEYXRhKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGF0YWJhc2VRdW90YShsb25nIHF1b3RhKSB7CisgICAgICAgIFdlYlN0b3JhZ2UuZ2V0SW5zdGFuY2UoKS5zZXRRdW90YUZvck9yaWdpbigiZmlsZTovLyIsIHF1b3RhKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRDYW5PcGVuV2luZG93cygpIHsKKyAgICAgICAgb2J0YWluTWVzc2FnZShMQVlPVVRfU0VUX0NBTl9PUEVOX1dJTkRPV1MpLnNlbmRUb1RhcmdldCgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE1vY2tHZW9sb2NhdGlvblBvc2l0aW9uKGRvdWJsZSBsYXRpdHVkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VibGUgbG9uZ2l0dWRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdWJsZSBhY2N1cmFjeSkgeworICAgICAgICBNb2NrR2VvbG9jYXRpb24uZ2V0SW5zdGFuY2UoKS5zZXRQb3NpdGlvbihsYXRpdHVkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ2l0dWRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICA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nVmZmVyZWRPdXRwdXRQYXNzZWRTdHJlYW0ud3JpdGUobGF5b3V0X2ZpbGUuZ2V0Qnl0ZXMoKSk7CkBAIC01Miw3ICs1Niw3IEBACiAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgZmFpbGVkKFN0cmluZyBsYXlvdXRfZmlsZSkgewogICAgICAgICB0cnkgewogICAgICAgICAgICAgbUJ1ZmZlcmVkT3V0cHV0RmFpbGVkU3RyZWFtLndyaXRlKGxheW91dF9maWxlLmdldEJ5dGVzKCkpOwpAQCAtNjIsNyArNjYsNyBAQAogICAgICAgICAgICAgZS5wcmludFN0YWNrVHJhY2UoKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIG5vcmVzdWx0KFN0cmluZyBsYXlvdXRfZmlsZSkgewogICAgICAgICB0cnkgewogICAgICAgICAgICAgbUJ1ZmZlcmVkT3V0cHV0Tm9yZXN1bHRTdHJlYW0ud3JpdGUobGF5b3V0X2ZpbGUuZ2V0Qnl0ZXMoKSk7CkBAIC03Miw3ICs3Niw3IEBACiAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgdGltZWRvdXQoU3RyaW5nIHVybCkgewogICAgICAgICB0cnkgewogICAgICAgICAgICAgbUJ1ZmZlcmVkT3V0cHV0VGltZWRvdXRTdHJlYW0ud3JpdGUodXJsLmdldEJ5dGVzKCkpOwpAQCAtODIsMTQgKzg2LDE0IEBACiAgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIE15VGVzdFJlY29yZGVyKGJvb2xlYW4gcmVzdW1lKSB7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBGaWxlIHJlc3VsdHNQYXNz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Zlcig4MDgwLCBhZGRyLCA4MDgwKTsKKyAgICAgICAgICBmczg0NDMgPSBuZXcgRm9yd2FyZFNlcnZlcig4NDQzLCBhZGRyLCA4NDQzKTsKKyAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGludCBnZXRGb3J3YXJkSG9zdEFkZHIoKSB7CisgICAgICAgIGludCBhZGRyID0gLTE7CisgICAgICAgIFN0cmluZyBob3N0ID0gbnVsbDsKKyAgICAgICAgRmlsZSBmb3J3YXJkSG9zdENvbmYgPSBuZXcgRmlsZShGT1JXQVJEX0hPU1RfQ09ORik7CisgICAgICAgIGlmIChmb3J3YXJkSG9zdENvbmYuaXNGaWxlKCkpIHsKKyAgICAgICAgICAgIEJ1ZmZlcmVkUmVhZGVyIGhvc3RSZWFkZXIgPSBudWxsOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBob3N0UmVhZGVyID0gbmV3IEJ1ZmZlcmVkUmVhZGVyKG5ldyBGaWxlUmVhZGVyKGZvcndhcmRIb3N0Q29uZikpOworICAgICAgICAgICAgICAgIGhvc3QgPSBob3N0UmVhZGVyLnJlYWRMaW5lKCk7CisgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAicmVhZCBmb3J3YXJkIGhvc3QgZnJvbSBmaWxlOiAiICsgaG9zdCk7CisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJjYW5ub3QgcmVhZCBmb3J3YXJkIGhvc3QgZnJvbSBmaWxlIiwgaW9lKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgaWYgKGhvc3RSZWFkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgaG9zdFJlYWRlci5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJ1cm4hISEKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoaG9zdCA9PSBudWxsIHx8IGhvc3QubGVuZ3RoKCkgPT0gMCkKKyAgICAgICAgICAgIGhvc3QgPSBERUZBVUxUX1RFU1RfSE9TVDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGFkZHIgPSBBZGJVdGlscy5yZXNvbHZlKGhvc3QpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgIExvZy5lKExPR1RBRywgImZhaWxlZCB0byByZXNvbHZlIHNlcnZlciBhZGRyZXNzIiwgaW9lKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYWRkcjsKICAgICB9CiAKICAgICAvLyBUaGlzIGZ1bmN0aW9uIHdyaXRlcyB0aGUgcmVzdWx0IG9mIHRoZSBsYXlvdXQgdGVzdCB0bwpAQCAtMTU3LDcgKzIxMSw3IEBACiAgICAgICBidW5kbGUucHV0Qm9vbGVhbihmaWxlLCByZXN1bHQpOwogICAgICAgaW5zdC5zZW5kU3RhdHVzKDAsIGJ1bmRsZSk7CiAgICAgfQotICAgIAorCiAgICAgcHJpdmF0ZSB2b2lkIGdldFRlc3RMaXN0KCkgewogICAgICAgICAvLyBSZWFkIHRlc3QgbGlzdC4KICAgICAgICAgdHJ5IHsKQEAgLTE3NCw3ICsyMjgsNyBAQAogICAgICAgICAgICAgTG9nLmUoTE9HVEFHLCAiRXJyb3Igd2hpbGUgcmVhZGluZyB0ZXN0IGxpc3QgOiAiICsgZS5nZXRNZXNzYWdlKCkpOwogICAgICAgICB9CiAgICAgfQotICAKKwogICAgIHByaXZhdGUgdm9pZCByZXN1bWVUZXN0TGlzdCgpIHsKICAgICAgICAgLy8gcmVhZCBvdXQgdGhlIH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4LDcgQEAKICAgICAvLyBXcmFwIHVwCiAgICAgcHJpdmF0ZSB2b2lkIGZhaWxlZENhc2UoU3RyaW5nIGZpbGUpIHsKICAgICAgICAgTG9nLncoIkxheW91dCB0ZXN0OiAiLCBmaWxlICsgIiBmYWlsZWQiKTsKLSAgICAgICAgbVJlc3VsdFJlY29yZGVyLmZhaWxlZChmaWxlKTsgICAgCisgICAgICAgIG1SZXN1bHRSZWNvcmRlci5mYWlsZWQoZmlsZSk7CiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIHBhc3NlZENhc2UoU3RyaW5nIGZpbGUpIHsKQEAgLTIzNiw3ICsyOTAsNyBAQAogICAgICAgICBMb2cudigiTGF5b3V0IHRlc3Q6IiwgZmlsZSArICIgbm8gZXhwZWN0ZWQgcmVzdWx0Iik7CiAgICAgICAgIG1SZXN1bHRSZWNvcmRlci5ub3Jlc3VsdChmaWxlKTsKICAgICB9Ci0gICAgIAorCiAgICAgcHJpdmF0ZSB2b2lkIHByb2Nlc3NSZXN1bHQoU3RyaW5nIHRlc3RGaWxlLCBTdHJpbmcgYWN0dWFsUmVzdWx0RmlsZSwgU3RyaW5nIGV4cGVjdGVkUmVzdWx0RmlsZSkgewogICAgICAgICBMb2cudihMT0dUQUcsICIgIFByb2Nlc3NpbmcgcmVzdWx0OiAiICsgdGVzdEZpbGUpOwogCkBAIC0yNTcsMTMgKzMxMSwxMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBpZiAocGFzc2luZykgewogICAgICAgICAgICAgICAgICAgICBwYXNzZWRDYXNlKHRlc3RGaWxlKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBmYWlsZWRDYXNlKHRlc3RGaWxlKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBmZS5jbG9zZSgpOwogICAgICAgICAgICAgICAgIGZyLmNsb3NlKCk7CiAgICAgICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZXgpIHsKQEAgLTI3OCw3ICszMzIsNyBAQAogICAgICAgICAgICAgbm9yZXN1bHRDYXNlKHRlc3RGaWxlKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgdm9pZCBydW5UZXN0QW5kV2FpdFVudGlsRG9uZShUZXN0U2hlbGxBY3Rpdml0eSBhY3Rpdml0eSwgU3RyaW5nIHRlc3QsIGludCB0aW1lb3V0KSB7CiAgICAgICAgIGFjdGl2aXR5LnNldENhbGxiYWNrKG5ldyBUZXN0U2hlbGxDYWxsYmFjaygpIHsKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGZpbmlzaGVkKCkgewpAQCAtMjg3LDggKzM0MSw5IEBACiAgICAgICAgICAgICAgICAgICAgIExheW91dFRlc3RzQXV0b1Rlc3QudGhpcy5ub3RpZnlBbGwoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcHVibGljIHZvaWQgdGltZWRPdXQoU3RyaW5nIHVybCkgeworICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgImxheW91dCB0aW1lb3V0OiAiICsgdXJsKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSk7CiAKQEAgLTMwNiwxNiArMzYxLDE2IEBACiAKICAgICAgICAgICAgIHJlc3VsdEZpbGUgPSBnZXRBbmRyb2lkRXhwZWN0ZWRSZXN1bHRGaWxlKGV4cGVjdGVkUmVzdWx0RmlsZSk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgbUZpbmlzaGVkID0gZmFsc2U7CiAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KEludGVudC5BQ1RJT05fVklFVyk7CiAgICAgIC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dHMgPSBydW5uZXIubVJlYmFzZWxpbmU7Ci0gICAgICAgIAorCiAgICAgICAgIGludCB0aW1lb3V0ID0gcnVubmVyLm1UaW1lb3V0SW5NaWxsaXM7CiAgICAgICAgIGlmICh0aW1lb3V0IDw9IDApIHsKICAgICAgICAgICAgIHRpbWVvdXQgPSBERUZBVUxUX1RJTUVPVVRfSU5fTUlMTElTOwogICAgICAgICB9Ci0gICAgICAgICAgCisKICAgICAgICAgdGhpcy5tUmVzdWx0UmVjb3JkZXIgPSBuZXcgTXlUZXN0UmVjb3JkZXIocmVzdW1lKTsKLSAgICAgICAgICAKKwogICAgICAgICBpZiAoIXJlc3VtZSkKICAgICAgICAgICAgIGNsZWFyVGVzdFN0YXR1cygpOwotICAgICAgICAgIAorCiAgICAgICAgIGdldFRlc3RMaXN0KCk7CiAgICAgICAgIGlmIChyZXN1bWUpCiAgICAgICAgICAgICByZXN1bWVUZXN0TGlzdCgpOwogCi0gICAgICAgIFRlc3RTaGVsbEFjdGl2aXR5IGFjdGl2aXR5ID0gKFRlc3RTaGVsbEFjdGl2aXR5KSBnZXRBY3Rpdml0eSgpOworICAgICAgICBUZXN0U2hlbGxBY3Rpdml0eSBhY3Rpdml0eSA9IGdldEFjdGl2aXR5KCk7CisgICAgICAgIGFjdGl2aXR5LnNldERlZmF1bHREdW1wRGF0YVR5cGUoRHVtcERhdGFUeXBlLkRVTVBfQVNfVEVYVCk7CiAKICAgICAgICAgLy8gUnVuIHRlc3RzLgorICAgICAgICBpbnQgYWRkciA9IC0xOworICAgICAgICB0cnl7CisgICAgICAgICAgICBhZGRyID0gQWRiVXRpbHMucmVzb2x2ZSgiYW5kcm9pZC1icm93c2VyLXRlc3QubXR2LmNvcnAuZ29vZ2xlLmNvbSIpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgIExvZy53KExPR1RBRywgImVycm9yIHdoaWxlIHJlc29sdmluZyB0ZXN0IGhvc3QgbmFtZSIsIGlvZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYoYWRkciA9PSAtMSkgeworICAgICAgICAgICAgTG9nLncoTE9HVEFHLCAiZmFpbGVkIHRvIHJlc29sdmUgdGVzdCBob3N0LiBodHRwIHRlc3RzIHdpbGwgZmFpbC4iKTsKKyAgICAgICAgfQogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1UZXN0TGlzdC5zaXplKCk7IGkrKykgewogICAgICAgICAgICAgU3RyaW5nIHMgPSBtVGVzdExpc3QuZWxlbWVudEF0KGkpOwogICAgICAgICAgICAgRnNVdGlscy51cGRhdGVUZXN0U3RhdHVzKFRFU1RfU1RBVFVTX0ZJTEUsIHMpOwpAQCAtMzg1LDEwICs0NTAsNDggQEAKICAgICAgICAgfQogCiAgICAgICAgIEZzVXRpbHMudXBkYXRlVGVzdFN0YXR1cyhURVNUX1NUQVRVU19GSUxFLCAiI0RPTkUiKTsKLSAgICAgICAgCisgICAgICAgIGlmKGZzODAwMCAhPSBudWxsKQorICAgICAgICAgICAgZnM4MDAwLnN0b3AoKTsKKyAgICAgICAgaWYoZnM4MDgwICE9IG51bGwpCisgICAgICAgICAgICBmczgwODAuc3RvcCgpOworICAgICAgICBpZihmczg0NDMgIT0gbnVsbCkKKyAgICAgICAgICAgIGZzODQ0My5zdG9wKCk7CisKICAgICAgICAgYWN0aXZpdHkuZmluaXNoKCk7CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIHN0YXJ0Rm9yd2FyZFNlcnZlcklmTmVlZGVkKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYoZnM4MDAwICE9IG51bGwpCisgICAgICAgICAgICAgICAgZnM4MDAwLnN0YXJ0KCk7CisgICAgICAgICAgICBpZihmczgwODAgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICBmczgwODAuc3RhcnQoKTsKKyAgICAgICAgICAgIGlmKGZzODQ0MyAhPSBudWxsKQorICAgICAgICAgICAgICAgIGZzODQ0My5zdGFydCgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgIExvZy53KExPR1RBRywgImZhaWxlZCB0byBzdGFydCBmb3J3YXJkZXIuIGh0dHAgdGVzdHMgd2lsbCBmYWlsLiIsIGlvZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIFN0cmluZyBnZXRUZXN0VXJsKFN0cmluZyBwYXRoKSB7CisgICAgICAgIFN0cmluZyB1cmwgPSBudWxsOworICAgICAgICBpZiAoIXBhdGguc3RhcnRzV2l0aChIVFRQX1RFU1RTX1BSRUZJWCkpIHsKKyAgICAgICAgICAgIHVybCA9ICJmaWxlOi8vIiArIHBhdGg7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzdGFydEZvcndhcmRTZXJ2ZXJJZk5lZWRlZCgpOworICAgICAgICAgICAgaWYgKHBhdGguc3RhcnRzV2l0aChIVFRQU19URVNUU19QUkVGSVgpKSB7CisgICAgICAgICAgICAgICAgLy8gc3RpbGwgY3V0IHRoZSBVUkwgYWZ0ZXIgImh0dHAvdGVzdHMvIgorICAgICAgICAgICAgICAgIHVybCA9ICJodHRwczovLzEyNy4wLjAuMTo4NDQzLyIgKyBwYXRoLnN1YnN0cmluZyhIVFRQX1RFU1RTX1BSRUZJWC5sZW5ndGgoKSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKCFwYXRoLnN0YXJ0c1dpdGgoSFRUUF9MT0NBTF9URVNUU19QUkVGSVgpCisgICAgICAgICAgICAgICAgICAgICYmICFwYXRoLnN0YXJ0c1dpdGgoSFRUUF9NRURJQV9URVNUU19QUkVGSVgpCisgICAgICAgICAgICAgICAgICAgICYmICFwYXRoLnN0YXJ0c1dpdGgoSFRUUF9XTUxfVEVTVFNfUFJFRklYKSkgeworICAgICAgICAgICAgICAgIHVybCA9ICJodHRwOi8vMTI3LjAuMC4xOjgwMDAvIiArIHBhdGguc3Vic3RyaW5nKEhUVFBfVEVTVFNfU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G1XZWJWaWV3ID0gbmV3IFdlYlZpZXcodGhpcyk7Ci0gICAgICAgIG1XZWJWaWV3LmdldFNldHRpbmdzKCkuc2V0SmF2YVNjcmlwdEVuYWJsZWQodHJ1ZSk7Ci0gICAgICAgIG1XZWJWaWV3LnNldFdlYkNocm9tZUNsaWVudChtQ2hyb21lQ2xpZW50KTsKLSAgICAgICAgbVdlYlZpZXcuc2V0V2ViVmlld0NsaWVudChuZXcgV2ViVmlld0NsaWVudCgpewotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUGFnZUZpbmlzaGVkKFdlYlZpZXcgdmlldywgU3RyaW5nIHVybCkgewotICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm9uUGFnZUZpbmlzaGVkLCB1cmw9IiArIHVybCk7Ci0gICAgICAgICAgICAgICAgc3VwZXIub25QYWdlRmluaXNoZWQodmlldywgdXJsKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgICAgICBwdWJsaWMgdm9pZCBvblBhZ2VTdGFydGVkKFdlYlZpZXcgdmlldywgU3RyaW5nIHVybCwgQml0bWFwIGZhdmljb24pIHsKLSAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblBhZ2VTdGFydGVkLCB1cmw9IiArIHVybCk7Ci0gICAgICAgICAgICAgICAgc3VwZXIub25QYWdlU3RhcnRlZCh2aWV3LCB1cmwsIGZhdmljb24pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZWRFcnJvcihXZWJWaWV3IHZpZXcsIGludCBlcnJvckNvZGUsIFN0cmluZyBkZXNjcmlwdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGZhaWxpbmdVcmwpIHsKLSAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblJlY2VpdmVkRXJyb3IsIGVycm9yQ29kZT0iICsgZXJyb3JDb2RlCi0gICAgICAgICAgICAgICAgICAgICAgICArICIsIGRlc2M9IiArIGRlc2NyaXB0aW9uICsgIiwgdXJsPSIgKyBmYWlsaW5nVXJsKTsKLSAgICAgICAgICAgICAgICBzdXBlci5vblJlY2VpdmVkRXJyb3IodmlldywgZXJyb3JDb2RlLCBkZXNjcmlwdGlvbiwgZmFpbGluZ1VybCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEBPdmVycmlkZQotICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlZEh0dHBBdXRoUmVxdWVzdChXZWJWaWV3IHZpZXcsIEh0dHBBdXRoSGFuZGxlciBoYW5kbGVyLAotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgaG9zdCwgU3RyaW5nIHJlYWxtKSB7Ci0gICAgICAgICAgICAgICAgaGFuZGxlci5jYW5jZWwoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgICAgICBwdWJsaWMgdm9pZCBvblJlY2VpdmVkU3NsRXJyb3IoV2ViVmlldyB2aWV3LCBTc2xFcnJvckhhbmRsZXIgaGFuZGxlciwKLSAgICAgICAgICAgICAgICAgICAgU3NsRXJyb3IgZXJyb3IpIHsKLSAgICAgICAgICAgICAgICBoYW5kbGVyLnByb2NlZWQoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9KTsKICAgICAgICAgbUV2ZW50U2VuZGVyID0gbmV3IFdlYlZpZXdFdmVudFNlbmRlcihtV2ViVmlldyk7CiAgICAgICAgIG1DYWxsYmFja1Byb3h5ID0gbmV3IENhbGxiYWNrUHJveHkobUV2ZW50U2VuZGVyLCB0aGlzKTsKIAogICAgICAgICBtV2ViVmlldy5hZGRKYXZhc2NyaXB0SW50ZXJmYWNlKG1DYWxsYmFja1Byb3h5LCAibGF5b3V0VGVzdENvbnRyb2xsZXIiKTsKICAgICAgICAg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2VDYWxsYmFja3MoKSB7CisgICAgICAgIExvZy52KExPR1RBRywgImR1bXBEYXRhYmFzZUNhbGxiYWNrcyBjYWxsZWQuIik7CisgICAgICAgIG1EdW1wRGF0YWJhc2VDYWxsYmFja3MgPSB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENhbk9wZW5XaW5kb3dzKCkgeworICAgICAgICBMb2cudihMT0dUQUcsICJzZXRDYW5PcGVuV2luZG93cyBjYWxsZWQuIik7CisgICAgICAgIG1DYW5PcGVuV2luZG93cyA9IHRydWU7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgR2VvbG9jYXRpb24gcGVybWlzc2lvbiBzdGF0ZSB0byBiZSB1c2VkIGZvciBhbGwgZnV0dXJlIHJlcXVlc3RzLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEdlb2xvY2F0aW9uUGVybWlzc2lvbihib29sZWFuIGFsbG93KSB7CisgICAgICAgIG1HZW9sb2NhdGlvblBlcm1pc3Npb25TZXQgPSB0cnVlOworICAgICAgICBtR2VvbG9jYXRpb25QZXJtaXNzaW9uID0gYWxsb3c7CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCBXZWJWaWV3Q2xpZW50IG1WaWV3Q2xpZW50ID0gbmV3IFdlYlZpZXdDbGllbnQoKXsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uUGFnZUZpbmlzaGVkKFdlYlZpZXcgdmlldywgU3RyaW5nIHVybCkgeworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAib25QYWdlRmluaXNoZWQsIHVybD0iICsgdXJsKTsKKyAgICAgICAgICAgIHN1cGVyLm9uUGFnZUZpbmlzaGVkKHZpZXcsIHVybCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25QYWdlU3RhcnRlZChXZWJWaWV3IHZpZXcsIFN0cmluZyB1cmwsIEJpdG1hcCBmYXZpY29uKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblBhZ2VTdGFydGVkLCB1cmw9IiArIHVybCk7CisgICAgICAgICAgICBzdXBlci5vblBhZ2VTdGFydGVkKHZpZXcsIHVybCwgZmF2aWNvbik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlZEVycm9yKFdlYlZpZXcgdmlldywgaW50IGVycm9yQ29kZSwgU3RyaW5nIGRlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgIFN0cmluZyBmYWlsaW5nVXJsKSB7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJvblJlY2VpdmVkRXJyb3IsIGVycm9yQ29kZT0iICsgZXJyb3JDb2RlCisgICAgICAgICAgICAgICAgICAgICsgIiwgZGVzYz0iICsgZGVzY3JpcHRpb24gKyAiLCB1cmw9IiArIGZhaWxpbmdVcmwpOworICAgICAgICAgICAgc3VwZXIub25SZWNlaXZlZEVycm9yKHZpZXcsIGVycm9yQ29kZSwgZGVzY3JpcHRpb24sIGZhaWxpbmdVcmwpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZWRIdHRwQXV0aFJlcXVlc3QoV2ViVmlldyB2aWV3LCBIdHRwQXV0aEhhbmRsZXIgaGFuZGxlciwKKyAgICAgICAgICAgICAgICBTdHJpbmcgaG9zdCwgU3RyaW5nIHJlYWxtKSB7CisgICAgICAgICAgICBoYW5kbGVyLmNhbmNlbCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZWRTc2xFcnJvcihXZWJWaWV3IHZpZXcsIFNzbEVycm9ySGFuZGxlciBoYW5kbGVyLAorICAgICAgICAgICAgICAgIFNzbEVycm9yIGVycm9yKSB7CisgICAgICAgICAgICBoYW5kbGVyLnByb2NlZWQoKTsKKyAgICAgICAgfQorICAgIH07CisKKwogICAgIHByaXZhdGUgZmluYWwgV2ViQ2hyb21lQ2xpZW50IG1DaHJvbWVDbGllbnQgPSBuZXcgV2ViQ2hyb21lQ2xpZW50KCkgewogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIHZvaWQgb25Qcm9ncmVzc0NoYW5nZWQoV2ViVmlldyB2aWV3LCBpbnQgbmV3UHJvZ3Jlc3MpIHsKQEAgLTUxMiwxNyArNTQ4LDEzNSBAQAogICAgICAgICAgICAgcmVzdWx0LmNvbmZpcm0oKTsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uSnNUaW1lb3V0KCkgeworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiSmF2YVNjcmlwdCB0aW1lb3V0Iik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25FeGNlZWRlZERhdGFiYXNlUXVvdGEoU3RyaW5nIHVybF9zdHIsCisgICAgICAgICAgICAgICAgU3RyaW5nIGRhdGFiYXNlSWRlbnRpZmllciwgbG9uZyBjdXJyZW50UXVvdGEsCisgICAgICAgICAgICAgICAgbG9uZyBlc3RpbWF0ZWRTaXplLCBsb25nIHRvdGFsVXNlZFF1b3RhLAorICAgICAgICAgICAgICAgIFdlYlN0b3JhZ2UuUXVvdGFVcGRhdGVyIGNhbGxiYWNrKSB7CisgICAgICAgICAgICBpZiAobUR1bXBEYXRhYmFzZUNhbGxiYWNrcykgeworICAgICAgICAgICAgICAgIGlmIChtRGF0YWJhc2VDYWxsYmFja1N0cmluZ3MgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2VDYWxsYmFja1N0cmluZ3MgPSBuZXcgU3RyaW5nQnVmZmVyKCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgU3RyaW5nIHByb3RvY29sID0gIiI7CisgICAgICAgICAgICAgICAgU3RyaW5nIGhvc3QgPSAiIjsKKyAgICAgICAgICAgICAgICBpbnQgcG9ydCA9IDA7CisKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBVUkwgdXJsID0gbmV3IFVSTCh1cmxfc3RyKTsKKyAgICAgICAgICAgICAgICAgICAgcHJvdG9jb2wgPSB1cmwuZ2V0UHJvdG9jb2woKTsKKyAgICAgICAgICAgICAgICAgICAgaG9zdCA9IHVybC5nZXRIb3N0KCk7CisgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuZ2V0UG9ydCgpID4gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQgPSB1cmwuZ2V0UG9ydCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoTWFsZm9ybWVkVVJMRXhjZXB0aW9uIGUpIHt9CisKKyAgICAgICAgICAgICAgICBTdHJpbmcgZGF0YWJhc2VDYWxsYmFja1N0cmluZyA9CisgICAgICAgICAgICAgICAgICAgICAgICAiVUkgREVMRUdBVEUgREFUQUJBU0UgQ0FMTEJBQ0s6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgImV4Y2VlZGVkRGF0YWJhc2VRdW90YUZvclNlY3VyaXR5T3JpZ2luOnsiICsgcHJvdG9jb2wgKworICAgICAgICAgICAgICAgICAgICAgICAgIiwgIiArIGhvc3QgKyAiLCAiICsgcG9ydCArICJ9IGRhdGFiYXNlOiIgKworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YWJhc2VJZGVudGlmaWVyICsgIlxuIjsKKyAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJMT0c6ICIrZGF0YWJhc2VDYWxsYmFja1N0cmluZyk7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlQ2FsbGJhY2tTdHJpbmdzLmFwcGVuZChkYXRhYmFzZUNhbGxiYWNrU3RyaW5nKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEdpdmUgNU1CIG1vcmUgcXVvdGEuCisgICAgICAgICAgICBjYWxsYmFjay51cGRhdGVRdW90YShjdXJyZW50UXVvdGEgKyAxMDI0ICogMTAyNCAqIDUpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEluc3RydWN0cyB0aGUgY2xpZW50IHRvIHNob3cgYSBwcm9tcHQgdG8gYXNrIHRoZSB1c2VyIHRvIHNldCB0aGUKKyAgICAgICAgICogR2VvbG9jYXRpb24gcGVybWlzc2lvbiBzdGF0ZSBmb3IgdGhlIHNwZWNpZmllZCBvcmlnaW4uCisgICAgICAgICAqLworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25HZW9sb2NhdGlvblBlcm1pc3Npb25zU2hvd1Byb21wdChTdHJpbmcgb3JpZ2luLAorICAgICAgICAgICAgICAgIEdlb2xvY2F0aW9uUGVybWlzc2lvbnMuQ2FsbGJhY2sgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIGlmIChtR2VvbG9jYXRpb25QZXJtaXNzaW9uU2V0KSB7CisgICAgICAgICAgICAgICAgY2FsbGJhY2suaW52b2tlKG9yaWdpbiwgbUdlb2xvY2F0aW9uUGVybWlzc2lvbiwgZmFsc2UpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGFkZE1lc3NhZ2VUb0NvbnNvbGUoU3RyaW5nIG1lc3NhZ2UsIGludCBsaW5lTnVtYmVyLAorICAgICAgICAgICAgICAgIFN0cmluZyBzb3VyY2VJRCkgeworICAgICAgICAgICAgaWYgKG1Db25zb2xlTWVzc2FnZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Db25zb2xlTWVzc2FnZXMgPSBuZXcgU3RyaW5nQnVmZmVyKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdHJpbmcgY29uc29sZU1lc3NhZ2UgPSAiQ09OU09MRSBNRVNTQUdFOiBsaW5lICIKKyAgICAgICAgICAgICAgICAgICAgKyBsaW5lTnVtYmVyICsiOiAiKyBtZXNzYWdlICsiXG4iOworICAgICAgICAgICAgbUNvbnNvbGVNZXNzYWdlcy5hcHBlbmQoY29uc29sZU1lc3NhZ2UpOworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiTE9HOiAiK2NvbnNvbGVNZXNzYWdlKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkNyZWF0ZVdpbmRvdyhXZWJWaWV3IHZpZXcsIGJvb2xlYW4gZGlhbG9nLAorICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNlckdlc3R1cmUsIE1lc3NhZ2UgcmVzdWx0TXNnKSB7CisgICAgICAgICAgICBpZiAoIW1DYW5PcGVuV2luZG93cykgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gV2UgbmV2ZXIgZGlzcGxheSB0aGUgbmV3IHdpbmRvdywganVzdCBjcmVhdGUgdGhlIHZpZXcgYW5kCisgICAgICAgICAgICAvLyBhbGxvdyBpdCdzIGNvbnRlbnQgdG8gZXhlY3V0ZSBhbmQgYmUgcmVjb3JkZWQgYnkgdGhlIHRlc3QKKyAgICAgICAgICAgIC8vIHJ1bm5lci4KKworICAgICAgICAgICAgSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4ganNJZmFjZXMgPSBuZXcgSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4oKTsKKyAgICAgICAgICAgIGpzSWZhY2VzLnB1dCgibGF5b3V0VGVzdENvbnRyb2xsZXIiLCBtQ2FsbGJhY2tQcm94eSk7CisgICAgICAgICAgICBqc0lmYWNlcy5wdXQoImV2ZW50U2VuZGVyIiwgbUNhbGxiYWNrUHJveHkpOworICAgICAgICAgICAgV2ViVmlldyBuZXdXaW5kb3dWaWV3ID0gbmV3IE5ld1dpbmRvd1dlYlZpZXcoVGVzdFNoZWxsQWN0aXZpdHkudGhpcywganNJZmFjZXMpOworICAgICAgICAgICAgc2V0dXBXZWJWaWV3Rm9yTGF5b3V0VGVzdHMobmV3V2luZG93VmlldywgbUNhbGxiYWNrUHJveHkpOworICAgICAgICAgICAgV2ViVmlldy5XZWJWaWV3VHJhbnNwb3J0IHRyYW5zcG9ydCA9CisgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3LldlYlZpZXdUcmFuc3BvcnQpIHJlc3VsdE1zZy5vYmo7CisgICAgICAgICAgICB0cmFuc3BvcnQuc2V0V2ViVmlldyhuZXdXaW5kb3dWaWV3KTsKKyAgICAgICAgICAgIHJlc3VsdE1zZy5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CiAgICAgfTsKIAorICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIE5ld1dpbmRvd1dlYlZpZXcgZXh0ZW5kcyBXZWJWaWV3IHsKKyAgICAgICAgcHVibGljIE5ld1dpbmRvd1dlYlZpZXcoQ29udGV4dCBjb250ZXh0LCBNYXA8U3RyaW5nLCBPYmplY3Q+IGpzSWZhY2VzKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBudWxsLCAwLCBqc0lmYWNlcyk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQgcmVzZXRUZXN0U3RhdHVzKCkgewogICAgICAgICBtV2FpdFVudGlsRG9uZSA9IGZhbHNlOwogICAgICAgICBtRHVtcERhdGFUeXBlID0gbURlZmF1bHREdW1wRGF0YVR5cGU7CiAgICAgICAgIG1UaW1lZE91dCA9IGZhbHNlOwogICAgICAgICBtRHVtcFRpdGxlQ2hhbmdlcyA9IGZhbHNlOwogICAgICAgICB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dGljIGZpbmFsIFN0cmluZyBBREJfT0sgPSAiT0tBWSI7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEFEQl9QT1JUID0gNTAzNzsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgQURCX0hPU1QgPSAiMTI3LjAuMC4xIjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQURCX1JFU1BPTlNFX1NJWkUgPSA0OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIExPR1RBRyA9ICJBZGJVdGlscyI7CisKKyAgICAvKioKKyAgICAgKgorICAgICAqIENvbnZlcnQgaW50ZWdlciBmb3JtYXQgSVAgaW50byB4eHgueHh4Lnh4eC54eHggZm9ybWF0CisgICAgICoKKyAgICAgKiBAcGFyYW0gaG9zdCBJUCBhZGRyZXNzIGluIGludGVnZXIgZm9ybWF0CisgICAgICogQHJldHVybiBodW1hbiByZWFkYWJsZSBmb3JtYXQKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBjb252ZXJ0KGludCBob3N0KSB7CisgICAgICAgIHJldHVybiAoKGhvc3QgPj4gMjQpICYgMHhGRikgKyAiLiIKKyAgICAgICAgKyAoKGhvc3QgPj4gMTYpICYgMHhGRikgKyAiLiIKKyAgICAgICAgKyAoKGhvc3QgPj4gOCkgJiAweEZGKSArICIuIgorICAgICAgICArIChob3N0ICYgMHhGRik7CisgICAgfQorCisgICAgLyoqCisgICAgICoKKyAgICAgKiBSZXNvbHZlIEROUyBuYW1lIGludG8gSVAgYWRkcmVzcworICAgICAqCisgICAgICogQHBhcmFtIGhvc3QgRE5TIG5hbWUKKyAgICAgKiBAcmV0dXJuIElQIGFkZHJlc3MgaW4gaW50ZWdlciBmb3JtYXQKKyAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBpbnQgcmVzb2x2ZShTdHJpbmcgaG9zdCkgIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIFNvY2tldCBsb2NhbFNvY2tldCA9IG5ldyBTb2NrZXQoQURCX0hPU1QsIEFEQl9QT1JUKTsKKyAgICAgICAgRGF0YUlucHV0U3RyZWFtIGRpcyA9IG5ldyBEYXRhSW5wdXRTdHJlYW0obG9jYWxTb2NrZXQuZ2V0SW5wdXRTdHJlYW0oKSk7CisgICAgICAgIE91dHB1dFN0cmVhbSBvcyA9IGxvY2FsU29ja2V0LmdldE91dHB1dFN0cmVhbSgpOworICAgICAgICBpbnQgY291bnRfcmVhZCA9IDA7CisgICAgICAgIGJ5dGVbXSBidWYgPSBuZXcgYnl0ZVsxMjhdOworCisgICAgICAgIGlmIChsb2NhbFNvY2tldCA9PSBudWxsIHx8IGRpcyA9PSBudWxsIHx8IG9zID09IG51bGwpCisgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIFN0cmluZyBjbWQgPSAiZG5zOiIgKyBob3N0OworCisgICAgICAgIGlmKCFzZW5kQWRiQ21kKGRpcywgb3MsIGNtZCkpCisgICAgICAgICAgICByZXR1cm4gLTE7CisKKyAgICAgICAgY291bnRfcmVhZCA9IGRpcy5yZWFkSW50KCk7CisgICAgICAgIGxvY2FsU29ja2V0LmNsb3NlKCk7CisgICAgICAgIHJldHVybiBjb3VudF9yZWFkOworICAgIH0KKworICAgIC8qKgorICAgICAqCisgICAgICogU2VuZCBhbiBBREIgY29tbWFuZCB1c2luZyBleGlzdGluZyBzb2NrZXQgY29ubmVjdGlvbgorICAgICAqCisgICAgICogdGhlIHN0cmVhbXMgcHJvdmlkZWQgbXVzdCBiZSBmcm9tIGEgc29ja2V0IGNvbm5lY3RlZCB0byBhZGJkIGFscmVhZHkKKyAgICAgKgorICAgICAqIEBwYXJhbSBpcyBpbnB1dCBzdHJlYW0gb2YgdGhlIHNvY2tldCBjb25uZWN0aW9uCisgICAgICogQHBhcmFtIG9zIG91dHB1dCBzdHJlYW0gb2YgdGhl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AgICB9CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHN0b3AoKSB7CisgICAgICAgIGlmKHN0YXJ0ZWQpIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAoZm9yd2FyZGVycykgeworICAgICAgICAgICAgICAgIGZvcihGb3J3YXJkZXIgZm9yd2FyZGVyIDogZm9yd2FyZGVycykKKyAgICAgICAgICAgICAgICAgICAgZm9yd2FyZGVyLnN0b3AoKTsKKyAgICAgICAgICAgICAgICBmb3J3YXJkZXJzLmNsZWFyKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHNlcnZlclNvY2tldC5jbG9zZSgpOworICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gaW9lKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiZXhjZXB0aW9uIHdoaWxlIGNsb3NpbmciLCBpb2UpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBzdGFydGVkID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gaXNSdW5uaW5nKCkgeworICAgICAgICByZXR1cm4gc3RhcnRlZDsKKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFNlcnZlclJ1bm5lciBpbXBsZW1lbnRzIFJ1bm5hYmxlIHsKKworICAgICAgICBwcml2YXRlIFNlcnZlclNvY2tldCBzb2NrZXQ7CisKKyAgICAgICAgcHVibGljIFNlcnZlclJ1bm5lcihTZXJ2ZXJTb2NrZXQgc29ja2V0KSB7CisgICAgICAgICAgICB0aGlzLnNvY2tldCA9IHNvY2tldDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgU29ja2V0IGxvY2FsU29ja2V0ID0gc29ja2V0LmFjY2VwdCgpOworICAgICAgICAgICAgICAgICAgICBTb2NrZXQgcmVtb3RlU29ja2V0ID0gQWRiVXRpbHMuZ2V0Rm9yd2FyZGVkU29ja2V0KHJlbW90ZUFkZHJlc3MsIHJlbW90ZVBvcnQpOworICAgICAgICAgICAgICAgICAgICBpZihyZW1vdGVTb2NrZXQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbFNvY2tldC5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gaW9lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HVEFHLCAiZXJyb3Igd2hpbGUgY2xvc2luZyBzb2NrZXQiLCBpb2UpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJmYWlsZWQgdG8gc3RhcnQgZm9yd2FyZGluZyBmcm9tICIgKyBsb2NhbFNvY2tldCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBGb3J3YXJkZXIgZm9yd2FyZGVyID0gbmV3IEZvcndhcmRlcihsb2NhbFNvY2tldCwgcmVtb3RlU29ja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3J3YXJkU2VydmVyLnRoaXMpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yd2FyZGVyLnN0YXJ0KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZWdpc3RlcihGb3J3YXJkZXIgZm9yd2FyZGVyKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAoZm9yd2FyZGVycykgeworICAgICAgICAgICAgaWYoIWZvcndhcmRlcnMuY29udGFpbnMoZm9yd2FyZGVyKSkgeworICAgICAgICAgICAgICAgIGZvcndhcmRlcnMuYWRkKGZvcndhcmRlcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1bnJlZ2lzdGVyKEZvcndhcmRlciByZWN5Y2xhYmxlKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAoZm9yd2FyZGVycykgeworICAgICAgICAgICAgaWYoZm9yd2FyZGVycy5jb250YWlucyhyZWN5Y2xhYmxlKSkgeworICAgICAgICAgICAgICAgIHJlY3ljbGFibGUuc3RvcCgpOworICAgICAgICAgICAgICAgIGZvcndhcmRlcnMucmVtb3ZlKHJlY3ljbGFibGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQpcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL3Rlc3RzL0R1bXBSZW5kZXJUcmVlL3NyYy9jb20vYW5kcm9pZC9kdW1wcmVuZGVydHJlZS9mb3J3YXJkZXIvRm9yd2FyZGVyLmphdmEgYi90ZXN0cy9EdW1wUmVuZGVyVHJlZS9zcmMvY29tL2FuZHJvaWQvZHVtcHJlbmRlcnRyZWUvZm9yd2FyZGVyL0ZvcndhcmRlci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmUxZTA0YTcKLS0tIC9kZXYvbnVsbAorKysgYi90ZXN0cy9EdW1wUmVuZGVyVHJlZS9zcmMvY29tL2FuZHJvaWQvZHVtcHJlbmRlcnRyZWUvZm9yd2FyZGVyL0Zvcndhc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Z2lzdGVyKHRoaXMpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN0YXJ0KCkgeworICAgICAgICBUaHJlYWQgb3V0Z29pbmcgPSBuZXcgVGhyZWFkKG5ldyBTb2NrZXRQaXBlKGZyb20sIHRvKSk7CisgICAgICAgIFRocmVhZCBpbmNvbWluZyA9IG5ldyBUaHJlYWQobmV3IFNvY2tldFBpcGUodG8sIGZyb20pKTsKKyAgICAgICAgb3V0Z29pbmcuc2V0TmFtZShMT0dUQUcpOworICAgICAgICBpbmNvbWluZy5zZXROYW1lKExPR1RBRyk7CisgICAgICAgIG91dGdvaW5nLnN0YXJ0KCk7CisgICAgICAgIGluY29taW5nLnN0YXJ0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgc2h1dGRvd24oZnJvbSk7CisgICAgICAgIHNodXRkb3duKHRvKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2h1dGRvd24oU29ja2V0IHNvY2tldCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgc29ja2V0LnNodXRkb3duSW5wdXQoKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiU29ja2V0I3NodXRkb3duSW5wdXQiLCBlKTsKKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgc29ja2V0LnNodXRkb3duT3V0cHV0KCk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgIlNvY2tldCNzaHV0ZG93bk91dHB1dCIsIGUpOworICAgICAgICB9CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBzb2NrZXQuY2xvc2UoKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiU29ja2V0I2Nsb3NlIiwgZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFNvY2tldFBpcGUgaW1wbGVtZW50cyBSdW5uYWJsZSB7CisKKyAgICAgICAgcHJpdmF0ZSBTb2NrZXQgaW4sIG91dDsKKworICAgICAgICBwdWJsaWMgU29ja2V0UGlwZShTb2NrZXQgaW4sIFNvY2tldCBvdXQpIHsKKyAgICAgICAgICAgIHRoaXMuaW4gPSBpbjsKKyAgICAgICAgICAgIHRoaXMub3V0ID0gb3V0OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoOworICAgICAgICAgICAgICAgIElucHV0U3RyZWFtIGlzID0gaW4uZ2V0SW5wdXRTdHJlYW0oKTsKKyAgICAgICAgICAgICAgICBPdXRwdXRTdHJlYW0gb3MgPSBvdXQuZ2V0T3V0cHV0U3RyZWFtKCk7CisgICAgICAgICAgICAgICAgYnl0ZVtdIGJ1ZmZlciA9IG5ldyBieXRlWzQwOTZdOworICAgICAgICAgICAgICAgIHdoaWxlICgobGVuZ3RoID0gaXMucmVhZChidWZmZXIpKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgb3Mud3JpdGUoYnVmZmVyLCAwLCBsZW5ndGgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGlvZSkgeworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBzZXJ2ZXIudW5yZWdpc3RlcihGb3J3YXJkZXIudGhpcyk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgICAgIHJldHVybiAiU29ja2V0UGlwZXsiICsgaW4gKyAiPT4iICsgb3V0ICArICJ9IjsKKyAgICAgIC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NMb2NhbElkKTsKICAgICAgICAgcmV0dXJuIHZhbHVlczsKICAgICB9CkBAIC0zODAsNiArMzg3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgKyAiX3N5bmNfbG9jYWxfaWQgSU5URUdFUiwgIgogICAgICAgICAgICAgICAgICAgICArICJfc3luY19kaXJ0eSBJTlRFR0VSIE5PVCBOVUxMIERFRkFVTFQgMCwgIgogICAgICAgICAgICAgICAgICAgICArICJfc3luY19hY2NvdW50IFRFWFQsICIKKyAgICAgICAgICAgICAgICAgICAgKyAiX3N5bmNfYWNjb3VudF90eXBlIFRFWFQsICIKICAgICAgICAgICAgICAgICAgICAgKyAiX3N5bmNfbWFyayBJTlRFR0VSKSIpOwogCiAgICAgICAgICAgICBtRGIuZXhlY1NRTCgiQ1JFQVRFIFRBQkxFIGRlbGV0ZWRfaXRlbXMgKCIKQEAgLTM4OCw2ICszOTYsNyBAQAogICAgICAgICAgICAgICAgICAgICArICJfc3luY19pZCBURVhULCAiCiAgICAgICAgICAgICAgICAgICAgICsgIl9zeW5jX2xvY2FsX2lkIElOVEVHRVIsICIKICAgICAgICAgICAgICAgICAgICAgKyAiX3N5bmNfYWNjb3VudCBURVhULCAiCisgICAgICAgICAgICAgICAgICAgICsgIl9zeW5jX2FjY291bnRfdHlwZSBURVhULCAiCiAgICAgICAgICAgICAgICAgICAgICsgIl9zeW5jX21hcmsgSU5URUdFUikiKTsKICAgICAgICAgfQogCkBAIC01MDEsNyArNTEwLDcgQEAKICAgICAgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOwogICAgICAgICB9CiAKLSAgICAgICAgcHVibGljIHZvaWQgb25TeW5jU3RhcnQoU3luY0NvbnRleHQgY29udGV4dCwgU3RyaW5nIGFjY291bnQpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25TeW5jU3RhcnQoU3luY0NvbnRleHQgY29udGV4dCwgQWNjb3VudCBhY2NvdW50KSB7CiAgICAg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b1N0cmluZygpLCB2YWx1ZXMudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHVyaS5idWlsZFVwb24oKS5hcHBlbmRQYXRoKCIxOSIpLmJ1aWxkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0sIG51bGwsIDApOworICAgICAgICBhc3NlcnRFcXVhbHMoc1Rlc3RVcmkxLmJ1aWxkVXBvbigpLmFwcGVuZFBhdGgoIjE5IikudG9TdHJpbmcoKSwgcmVzdWx0LnVyaS50b1N0cmluZygpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0SW5zZXJ0Tm9WYWx1ZXMoKSB0aHJvd3MgT3BlcmF0aW9uQXBwbGljYXRpb25FeGNlcHRpb24geworICAgICAgICBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24gb3AxID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChzVGVzdFVyaTEpCisgICAgICAgICAgICAgICAgLmJ1aWxkKCk7CisgICAgICAgIENvbnRlbnRQcm92aWRlclJlc3VsdCByZXN1bHQgPSBvcDEuYXBwbHkobmV3IFRlc3RDb250ZW50UHJvdmlkZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgVXJpIGluc2VydChVcmkgdXJpLCBDb250ZW50VmFsdWVzIHZhbHVlcykgeworICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFVyaTEudG9TdHJpbmcoKSwgdXJpLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIGFzc2VydE51bGwodmFsdWVzKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdXJpLmJ1aWxkVXBvbigpLmFwcGVuZFBhdGgoIjE5IikuYnVpbGQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwgbnVsbCwgMCk7CisgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFVyaTEuYnVpbGRVcG9uKCkuYXBwZW5kUGF0aCgiMTkiKS50b1N0cmluZygpLCByZXN1bHQudXJpLnRvU3RyaW5nKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RJbnNlcnRGYWlsZWQoKSB7CisgICAgICAgIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiBvcDEgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KHNUZXN0VXJpMSkKKyAgICAgICAgICAgICAgICAud2l0aFZhbHVlcyhzVGVzdFZhbHVlczEpCisgICAgICAgICAgICAgICAgLmJ1aWxkKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBvcDEuYXBwbHkobmV3IFRlc3RDb250ZW50UHJvdmlkZXIoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIFVyaSBpbnNlcnQoVXJpIHVyaSwgQ29udGVudFZhbHVlcyB2YWx1ZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgYXNzZXJ0RXF1YWxzKHNUZXN0VXJpMS50b1N0cmluZygpLCB1cmkudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFZhbHVlczEudG9TdHJpbmcoKSwgdmFsdWVzLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LCBudWxsLCAwKTsKKyAgICAgICAgICAgIGZhaWwoInRoZSBhcHBseSBzaG91bGQgaGF2ZSB0aHJvd24gYW4gT3BlcmF0aW9uQXBwbGljYXRpb25FeGNlcHRpb24iKTsKKyAgICAgICAgfSBjYXRjaCAoT3BlcmF0aW9uQXBwbGljYXRpb25FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gdGhpcyBpcyB0aGUgZXhwZWN0ZWQgY2FzZQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdEluc2VydFdpdGhCYWNrUmVmcygpIHRocm93cyBPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbiB7CisgICAgICAgIENvbnRlbnRQcm92aWRlclJlc3VsdFtdIHByZXZpb3VzUmVzdWx0cyA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHRbNF07CisgICAgICAgIHByZXZpb3VzUmVzdWx0c1swXSA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQoMTAwKTsKKyAgICAgICAgcHJldmlvdXNSZXN1bHRzWzFdID0gbmV3IENvbnRlbnRQcm92aWRlclJlc3VsdCgxMDEpOworICAgICAgICBwcmV2aW91c1Jlc3VsdHNbMl0gPSBuZXcgQ29udGVudFByb3ZpZGVyUmVzdWx0KDEwMik7CisgICAgICAgIHByZXZpb3VzUmVzdWx0c1szXSA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQoMTAzKTsKKyAgICAgICAgQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uIG9wMSA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoc1Rlc3RVcmkxKQorICAgICAgICAgICAgICAgIC53aXRoVmFsdWVzKHNUZXN0VmFsdWVzMSkKKyAgICAgICAgICAgICAgICAud2l0aFZhbHVlQmFja1JlZmVyZW5jZSgiYTEiLCAzKQorICAgICAgICAgICAgICAgIC53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKCJhMiIsIDEpCisgICAgICAgICAgICAgICAgLmJ1aWxkKCk7CisgICAgICAgIENvbnRlbnRQcm92aWRlclJlc3VsdCByZXN1bHQgPSBvcDEuYXBwbHkobmV3IFRlc3RDb250ZW50UHJvdmlkZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgVXJpIGluc2VydChVcmkgdXJpLCBDb250ZW50VmFsdWVzIHZhbHVlcykgeworICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFVyaTEudG9TdHJpbmcoKSwgdXJpLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgZXhwZWN0ZWQgPSBuZXcgQ29udGVudFZhbHVlcyhzVGVzdFZhbHVlczEpOworICAgICAgICAgICAgICAgIGV4cGVjdGVkLnB1dCgiYTEiLCAxMDMpOworICAgICAgICAgICAgICAgIGV4cGVjdGVkLnB1dCgiYTIiLCAxMDEpOworICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhleHBlY3RlZC50b1N0cmluZygpLCB2YWx1ZXMudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHVyaS5idWlsZFVwb24oKS5hcHBlbmRQYXRoKCIxOSIpLmJ1aWxkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0sIHByZXZpb3VzUmVzdWx0cywgcHJldmlvdXNSZXN1bHRzLmxlbmd0aCk7CisgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFVyaTEuYnVpbGRVcG9uKCkuYXBwZW5kUGF0aCgiMTkiKS50b1N0cmluZygpLCByZXN1bHQudXJpLnRvU3RyaW5nKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RVcGRhdGUoKSB0aHJvd3MgT3BlcmF0aW9uQXBwbGljYXRpb25FeGNlcHRpb24geworICAgICAgICBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24gb3AxID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChzVGVzdFVyaTEpCisgICAgICAgICAgICAgICAgLndpdGhWYWx1ZXMoc1Rlc3RWYWx1ZXMxKQorICAgICAgICAgICAgICAgIC5idWlsZCgpOworICAgICAgICBDb250ZW50UHJvdmlkZXJSZXN1bHRbXSBiYWNrUmVmcyA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHRbMl07CisgICAgICAgIENvbnRlbnRQcm92aWRlclJlc3VsdCByZXN1bHQgPSBvcDEuYXBwbHkobmV3IFRlc3RDb250ZW50UHJvdmlkZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgVXJpIGluc2VydChVcmkgdXJpLCBDb250ZW50VmFsdWVzIHZhbHVlcykgeworICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFVyaTEudG9TdHJpbmcoKSwgdXJpLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFZhbHVlczEudG9TdHJpbmcoKSwgdmFsdWVzLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIHJldHVybiB1cmkuYnVpbGRVcG9uKCkuYXBwZW5kUGF0aCgiMTkiKS5idWlsZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9LCBiYWNrUmVmcywgMSk7CisgICAgICAgIGFzc2VydEVxdWFscyhzVGVzdFVyaTEuYnVpbGRVcG9uKCkuYXBwZW5kUGF0aCgiMTkiKS50b1N0cmluZygpLCByZXN1bHQudXJpLnRvU3RyaW5nKCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RBc3NlcnQoKSB7CisgICAgICAgIC8vIEJ1aWxkIGFuIG9wZXJhdGlvbiB0byBhc3NlcnQgdmFsdWVzIG1hdGNoIHByb3ZpZGVyCisgICAgICAgIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiBvcDEgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3QXNzZXJ0UXVlcnkoc1Rlc3RVcmkxKQorICAgICAgICAgICAgICAgIC53aXRoVmFsdWVzKHNUZXN0VmFsdWVzMSkuYnVpbGQoKTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgLy8gQXNzZXJ0IHRoYXQgdmFsdWVzIG1hdGNoIGZyb20gY3Vyc29yCisgICAgICAgICAgICBDb250ZW50UHJvdmlkZXJSZXN1bHQgcmVzdWx0ID0gb3AxLmFwcGx5KG5ldyBUZXN0Q29udGVudFByb3ZpZGVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyBDdXJzb3IgcXVlcnkoVXJpIHVyaSwgU3RyaW5nW10gcHJvamVjdGlvbiwgU3RyaW5nIHNlbGVjdGlvbiwKKyA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gICAgIGtleXNbaV0gPSBlbnRyeS5nZXRLZXkoKTsKKyAgICAgICAgICAgIHZhbHVlc1tpXSA9IGVudHJ5LmdldFZhbHVlKCk7CisgICAgICAgICAgICBpKys7CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBNYXRyaXhDdXJzb3IgY3Vyc29yID0gbmV3IE1hdHJpeEN1cnNvcihrZXlzKTsKKyAgICAgICAgY3Vyc29yLmFkZFJvdyh2YWx1ZXMpOworICAgICAgICByZXR1cm4gY3Vyc29yOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RWYWx1ZUJhY2tSZWZzKCkgeworICAgICAgICBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgIHZhbHVlcy5wdXQoImEiLCAiaW4xIik7CisgICAgICAgIHZhbHVlcy5wdXQoImEyIiwgImluMiIpOworICAgICAgICB2YWx1ZXMucHV0KCJiIiwgImluMyIpOworICAgICAgICB2YWx1ZXMucHV0KCJjIiwgImluNCIpOworCisgICAgICAgIENvbnRlbnRQcm92aWRlclJlc3VsdFtdIHByZXZpb3VzUmVzdWx0cyA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHRbNF07CisgICAgICAgIHByZXZpb3VzUmVzdWx0c1swXSA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQoMTAwKTsKKyAgICAgICAgcHJldmlvdXNSZXN1bHRzWzFdID0gbmV3IENvbnRlbnRQcm92aWRlclJlc3VsdCgxMDEpOworICAgICAgICBwcmV2aW91c1Jlc3VsdHNbMl0gPSBuZXcgQ29udGVudFByb3ZpZGVyUmVzdWx0KDEwMik7CisgICAgICAgIHByZXZpb3VzUmVzdWx0c1szXSA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQoMTAzKTsKKworICAgICAgICBDb250ZW50VmFsdWVzIGV4cGVjdGVkVmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXModmFsdWVzKTsKKyAgICAgICAgZXhwZWN0ZWRWYWx1ZXMucHV0KCJhMSIsICIxMDMiKTsKKyAgICAgICAgZXhwZWN0ZWRWYWx1ZXMucHV0KCJhMiIsICIxMDEiKTsKKyAgICAgICAgZXhwZWN0ZWRWYWx1ZXMucHV0KCJhMyIsICIxMDIiKTsKKworICAgICAgICBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24gb3AxID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChzVGVzdFVyaTEpCisgICAgICAgICAgICAgICAgLndpdGhWYWx1ZXModmFsdWVzKQorICAgICAgICAgICAgICAgIC53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKCJhMSIsIDMpCisgICAgICAgICAgICAgICAgLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoImEyIiwgMSkKKyAgICAgICAgICAgICAgICAud2l0aFZhbHVlQmFja1JlZmVyZW5jZSgiYTMiLCAyKQorICAgICAgICAgICAgICAgIC5idWlsZCgpOworICAgICAgICBDb250ZW50VmFsdWVzIHYyID0gb3AxLnJlc29sdmVWYWx1ZUJhY2tSZWZlcmVuY2VzKHByZXZpb3VzUmVzdWx0cywgcHJldmlvdXNSZXN1bHRzLmxlbmd0aCk7CisgICAgICAgIGFzc2VydEVxdWFscyhleHBlY3RlZFZhbHVlcywgdjIpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RTZWxlY3Rpb25CYWNrUmVmcygpIHsKKyAgICAgICAgQ29udGVudFByb3ZpZGVyUmVzdWx0W10gcHJldmlvdXNSZXN1bHRzID0gbmV3IENvbnRlbnRQcm92aWRlclJlc3VsdFs0XTsKKyAgICAgICAgcHJldmlvdXNSZXN1bHRzWzBdID0gbmV3IENvbnRlbnRQcm92aWRlclJlc3VsdCgxMDApOworICAgICAgICBwcmV2aW91c1Jlc3VsdHNbMV0gPSBuZXcgQ29udGVudFByb3ZpZGVyUmVzdWx0KDEwMSk7CisgICAgICAgIHByZXZpb3VzUmVzdWx0c1syXSA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQoMTAyKTsKKyAgICAgICAgcHJldmlvdXNSZXN1bHRzWzNdID0gbmV3IENvbnRlbnRQcm92aWRlclJlc3VsdCgxMDMpOworCisgICAgICAgIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MgPSBuZXcgU3RyaW5nW117ImEiLCBudWxsLCBudWxsLCAiYiIsIG51bGx9OworCisgICAgICAgIGZpbmFsIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKKyAgICAgICAgdmFsdWVzLnB1dCgidW51c2VkIiwgInVudXNlZCIpOworCisgICAgICAgIENvbnRlbnRQcm92aWRlck9wZXJhdGlvbiBvcDEgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3VXBkYXRlKHNUZXN0VXJpMSkKKyAgICAgICAgICAgICAgICAud2l0aFNlbGVjdGlvbkJhY2tSZWZlcmVuY2UoMSwgMykKKyAgICAgICAgICAgICAgICAud2l0aFNlbGVjdGlvbkJhY2tSZWZlcmVuY2UoMiwgMSkKKyAgICAgICAgICAgICAgICAud2l0aFNlbGVjdGlvbkJhY2tSZWZlcmVuY2UoNCwgMikKKyAgICAgICAgICAgICAgICAud2l0aFNlbGVjdGlvbigidW51c2VkIiwgc2VsZWN0aW9uQXJncykKKyAgICAgICAgICAgICAgICAud2l0aFZhbHVlcyh2YWx1ZXMpCisgICAgICAgICAgICAgICAgLmJ1aWxkKCk7CisgICAgICAgIFN0cmluZ1tdIHMyID0gb3AxLnJlc29sdmVTZWxlY3Rpb25BcmdzQmFja1JlZmVyZW5jZXMoCisgICAgICAgICAgICAgICAgcHJldmlvdXNSZXN1bHRzLCBwcmV2aW91c1Jlc3VsdHMubGVuZ3RoKTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKCJhLDEwMywxMDEsYiwxMDIiLCBUZXh0VXRpbHMuam9pbigiLCIsIHMyKSk7CisgICAgfQorCisgICAgc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nRlbnRQcm92aWRlck9wZXJhdGlvbi5CdWlsZGVyIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3VXBkYXRlKAorICAgICAgICAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9nb28vYmFyIikpOworCisgICAgICAgICAgICBidWlsZGVyU2V0U2VsZWN0aW9uQXJnc0JhY2tSZWZlcmVuY2VzKGJ1aWxkZXIsIHNlbEFyZ3NCYWNrUmVmKTsKKworICAgICAgICAgICAgb3AxID0gbmV3T3BlcmF0aW9uRnJvbUJ1aWxkZXIoYnVpbGRlcik7CisgICAgICAgICAgICBvcDEud3JpdGVUb1BhcmNlbChwYXJjZWwsIDApOworICAgICAgICAgICAgcGFyY2VsLnNldERhdGFQb3NpdGlvbigwKTsKKyAgICAgICAgICAgIG9wMiA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwocGFyY2VsKTsKKyAgICAgICAgICAgIGFzc2VydEVxdWFscyhDb250ZW50UHJvdmlkZXJPcGVyYXRpb24uVFlQRV9VUERBVEUsIG9wZXJhdGlvbkdldFR5cGUob3AyKSk7CisgICAgICAgICAgICBhc3NlcnRFcXVhbHMoImNvbnRlbnQ6Ly9nb28vYmFyIiwgb3BlcmF0aW9uR2V0VXJpKG9wMikudG9TdHJpbmcoKSk7CisgICAgICAgICAgICBhc3NlcnROdWxsKG9wZXJhdGlvbkdldEV4cGVjdGVkQ291bnQob3AyKSk7CisgICAgICAgICAgICBhc3NlcnROdWxsKG9wZXJhdGlvbkdldFNlbGVjdGlvbihvcDIpKTsKKyAgICAgICAgICAgIGFzc2VydE51bGwob3BlcmF0aW9uR2V0U2VsZWN0aW9uQXJncyhvcDIpKTsKKyAgICAgICAgICAgIGFzc2VydE51bGwob3BlcmF0aW9uR2V0VmFsdWVzKG9wMikpOworICAgICAgICAgICAgYXNzZXJ0TnVsbChvcGVyYXRpb25HZXRW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gICAgICAgICAgIGFzc2VydEVxdWFscygiY29udGVudDovL2dvby9iYXIiLCBvcGVyYXRpb25HZXRVcmkob3AyKS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIGFzc2VydE51bGwob3BlcmF0aW9uR2V0RXhwZWN0ZWRDb3VudChvcDIpKTsKKyAgICAgICAgICAgIGFzc2VydE51bGwob3BlcmF0aW9uR2V0U2VsZWN0aW9uKG9wMikpOworICAgICAgICAgICAgYXNzZXJ0TnVsbChvcGVyYXRpb25HZXRTZWxlY3Rpb25BcmdzKG9wMikpOworICAgICAgICAgICAgYXNzZXJ0TnVsbChvcGVyYXRpb25HZXRWYWx1ZXMob3AyKSk7CisgICAgICAgICAgICBhc3NlcnROdWxsKG9wZXJhdGlvbkdldFZhbHVlc0JhY2tSZWZlcmVuY2VzKG9wMikpOworICAgICAgICAgICAgYXNzZXJ0TnVsbChvcGVyYXRpb25HZXRTZWxlY3Rpb25BcmdzQmFja1JlZmVyZW5jZXMob3AyKSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBwYXJjZWwucmVjeWNsZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uIG5ld09wZXJhdGlvbkZyb21CdWlsZGVyKAorICAgICAgICAgICAgQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLkJ1aWxkZXIgYnVpbGRlcikKKyAgICAgICAgICAgIHRocm93cyBOb1N1Y2hNZXRob2RFeGNlcHRpb24sIEluc3RhbnRpYXRpb25FeGNlcHRpb24sIElsbGVnYWxBY2Nlc3NFeGNlcHRpb24sCisgICAgICAgICAgICBJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIHsKKyAgICAgICAgZmluYWwgQ29uc3RydWN0b3IgY29uc3RydWN0b3IgPSBDTEFTU19PUEVSQVRJT04uZ2V0RGVjbGFyZWRDb25zdHJ1Y3RvcihDTEFTU19CVUlMREVSKTs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wdWJsaWMgdm9pZCB0ZXN0UGFyY2VsaW5nUmVzdWx0KCkgeworICAgICAgICBQYXJjZWwgcGFyY2VsID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICBDb250ZW50UHJvdmlkZXJSZXN1bHQgcmVzdWx0MTsKKyAgICAgICAgQ29udGVudFByb3ZpZGVyUmVzdWx0IHJlc3VsdDI7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXN1bHQxID0gbmV3IENvbnRlbnRQcm92aWRlclJlc3VsdChVcmkucGFyc2UoImNvbnRlbnQ6Ly9nb28vYmFyIikpOworICAgICAgICAgICAgcmVzdWx0MS53cml0ZVRvUGFyY2VsKHBhcmNlbCwgMCk7CisgICAgICAgICAgICBwYXJjZWwuc2V0RGF0YVBvc2l0aW9uKDApOworICAgICAgICAgICAgcmVzdWx0MiA9IENvbnRlbnRQcm92aWRlclJlc3VsdC5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwocGFyY2VsKTsKKyAgICAgICAgICAgIGFzc2VydEVxdWFscygiY29udGVudDovL2dvby9iYXIiLCByZXN1bHQyLnVyaS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIGFzc2VydE51bGwocmVzdWx0Mi5jb3VudCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBwYXJjZWwucmVjeWNsZSgpOworICAgICAgICB9CisKKyAgICAgICAgcGFyY2VsID0gUGFyY2VsLm9idGFpbigpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmVzdWx0MSA9IG5ldyBDb250ZW50UHJvdmlkZXJSZXN1bHQoNDIpOworICAgICAgICAgICAgcmVzdWx0MS53cml0ZVRvUGFyY2VsKHBhcmNlbCwgMCk7CisgICAgICAgICAgICBwYXJjZWwuc2V0RGF0YVBvc2l0aW9uKDApOworICAgICAgICAgICAgcmVzdWx0MiA9IENvbnRlbnRQcm92aWRlclJlc3VsdC5DUkVBVE9SLmNyZWF0ZUZyb21QYXJjZWwocGFyY2VsKTsKKyA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isgICAgICAgIG5ldyBUaHJlYWQoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAvLyBGaWxsIHVwIGFsbCB0aGUgbWVtb3J5CisgICAgICAgICAgICAgICAgICAgIEZpbGUgcGF0aCA9IEVudmlyb25tZW50LmdldERhdGFEaXJlY3RvcnkoKTsKKyAgICAgICAgICAgICAgICAgICAgU3RhdEZzIHN0YXQgPSBuZXcgU3RhdEZzKHBhdGguZ2V0UGF0aCgpKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHRvdGFsQmxvY2tzID0gc3RhdC5nZXRCbG9ja0NvdW50KCk7CisgICAgICAgICAgICAgICAgICAgIGludCBub09mQmxvY2tUb0ZpbGwgPSBzdGF0LmdldEF2YWlsYWJsZUJsb2NrcygpOworICAgICAgICAgICAgICAgICAgICBGaWxlT3V0cHV0U3RyZWFtIGZzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0ZmlsbC5vcGVuRmlsZU91dHB1dCgidGVzdGRhdGEiLCBDb250ZXh0Lk1PREVfQVBQRU5EKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAobm9PZkJsb2NrVG9GaWxsIC8gTk9fT0ZfQkxPQ0tTX1RPX0ZJTEwpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGUgYnVmW10gPSBuZXcgYnl0ZVttQmxvY2tTaXplICogTk9fT0ZfQkxPQ0tTX1RPX0ZJTExdOworICAgICAgICAgICAgICAgICAgICAgICAgZnMud3JpdGUoYnVmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZzLmZsdXNoKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBGaWxsIHVwIHRoZSBsYXN0IGZldyBibG9jaworICAgICAgICAgICAgICAgICAgICBieXRlIGJ1ZltdID0gbmV3IGJ5dGVbKG5vT2ZCbG9ja1RvRmlsbCAlIE5PX09GX0JMT0NLU19UT19GSUxMKSAqIG1CbG9ja1NpemVdOworICAgICAgICAgICAgICAgICAgICBmcy53cml0ZShidWYpOworICAgICAgICAgICAgICAgICAgICBmcy5mbHVzaCgpOworICAgICAgICAgICAgICAgICAgICBmcy5jbG9zZSgpOworCisgICAgICAgICAgICAgICAgICAgIC8vIEZpbmlzaGVkLCB1cGRhdGUgdGhlIGluZm8KKyAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChmaWxsVXBEb25lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaWxsVXBEb25lLm5vdGlmeSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCBlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfS5zdGFydCgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZUluZm8oQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGZpbGx1cGRpc2sodGhpcyk7CisgICAgICAgIHN5bmNocm9uaXplZCAoZmlsbFVwRG9uZSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBmaWxsVXBEb25lLndhaXQoV0FJVF9GT1JfRklOSVNIKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAid2FpdCB3YXMgaW50ZXJydXB0ZWQuIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIC8vIFRoZSBzdGF0IGRpZG4ndCByZWxlY3QgdGhlIGNvcnJlY3QgZGF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Zjb21wb25lbnROYW1lKSB7CkBAIC01MDEsOCArNTA1LDI1IEBACiAgICAgICAgICAgICBib29sIHdpdGhpbkFjdGl2aXR5ID0gZmFsc2U7CiAgICAgICAgICAgICBib29sIGlzTWFpbkFjdGl2aXR5ID0gZmFsc2U7CiAgICAgICAgICAgICBib29sIGlzTGF1bmNoZXJBY3Rpdml0eSA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCBpc1NlYXJjaGFibGUgPSBmYWxzZTsKICAgICAgICAgICAgIGJvb2wgd2l0aGluQXBwbGljYXRpb24gPSBmYWxzZTsKICAgICAgICAgICAgIGJvb2wgd2l0aGluUmVjZWl2ZXIgPSBmYWxzZTsKKyAgICAgICAgICAgIGJvb2wgd2l0aGluU2VydmljZSA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCB3aXRoaW5JbnRlbnRGaWx0ZXIgPSBmYWxzZTsKKyAgICAgICAgICAgIGJvb2wgaGFzTWFpbkFjdGl2aXR5ID0gZmFsc2U7CisgICAgICAgICAgICBib29sIGhhc090aGVyQWN0aXZpdGllcyA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCBoYXNPdGhlclJlY2VpdmVycyA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCBoYXNPdGhlclNlcnZpY2VzID0gZmFsc2U7CisgICAgICAgICAgICBib29sIGhhc1dhbGxwYXBlclNlcnZpY2UgPSBmYWxzZTsKKyAgICAgICAgICAgIGJvb2wgaGFzSW1lU2VydmljZSA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCBoYXNXaWRnZXRSZWNlaXZlcnMgPSBmYWxzZTsKKyAgICAgICAgICAgIGJvb2wgaGFzSW50ZW50RmlsdGVyID0gZmFsc2U7CisgICAgICAgICAgICBib29sIGFjdE1haW5BY3Rpdml0eSA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCBhY3RXaWRnZXRSZWNlaXZlcnMgPSBmYWxzZTsKKyAgICAgICAgICAgIGJvb2wgYWN0SW1lU2VydmljZSA9IGZhbHNlOworICAgICAgICAgICAgYm9vbCBhY3RXYWxscGFwZXJTZXJ2aWNlID0gZmFsc2U7CisgICAgICAgICAgICBib29sIHNwZWNDYW1lcmFGZWF0dXJlID0gZmFsc2U7CisgICAgICAgICAgICBib29sIGhhc0NhbWVyYVBlcm1pc3Npb24gPSBmYWxzZTsKICAgICAgICAgICAgIGludCB0YXJnZXRTZGsgPSAwOwogICAgICAgICAgICAgaW50IHNtYWxsU2NyZWVuID0gMTsKICAgICAgICAgICAgIGludCBub3JtYWxTY3JlZW4gPSAxOwpAQCAtNTEyLDkgKzUzMyw0OCBAQAogICAgICAgICAgICAgU3RyaW5nOCBhY3Rpdml0eUxhYmVsOwogICAgICAgICAgICAgU3RyaW5nOCBhY3Rpdml0eUljb247CiAgICAgICAgICAgICBTdHJpbmc4IHJlY2VpdmVyTmFtZTsKKyAgICAgICAgICAgIFN0cmluZzggc2VydmljZU5hbWU7CiAgICAgICAgICAgICB3aGlsZSAoKGNvZGU9dHJlZS5uZXh0KCkpICE9IFJlc1hNTFRyZWU6OkVORF9ET0NVTUVOVCAmJiBjb2RlICE9IFJlc1hNTFRyZWU6OkJBRF9ET0NVTUVOVCkgewogICAgICAgICAgICAgICAgIGlmIChjb2RlID09IFJlc1hNTFRyZWU6OkVORF9UQUcpIHsKICAgICAgICAgICAgICAgICAgICAgZGVwdGgtLTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlcHRoIDwgMikgeworICAgICAgICAgICAgICAgICAgICAgICAgd2l0aGluQXBwbGljYXRpb24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkZXB0aCA8IDMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3aXRoaW5BY3Rpdml0eSAmJiBpc01haW5BY3Rpdml0eSAmJiBpc0xhdW5jaGVyQWN0aXZpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICphTmFtZSA9IGdldENvbXBvbmVudE5hbWUocGtnLCBhY3Rpdml0eU5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhTmFtZSAhPSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigibGF1bmNoYWJsZSBhY3Rpdml0eSBuYW1lPSclcyciLCBhTmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigibGFiZWw9JyVzJyBpY29uPSclcydcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpdml0eUxhYmVsLnN0cmluZygpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZpdHlJY29uLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaGFzSW50ZW50RmlsdGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzT3RoZXJBY3Rpdml0aWVzIHw9IHdpdGhpbkFjdGl2aXR5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc090aGVyUmVjZWl2ZXJzIHw9IHdpdGhpblJlY2VpdmVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc090aGVyU2VydmljZXMgfD0gd2l0aGluU2VydmljZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhpbkFjdGl2aXR5ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB3aXRoaW5TZXJ2aWNlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB3aXRoaW5SZWNlaXZlciA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaGFzSW50ZW50RmlsdGVyID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBpc01haW5BY3Rpdml0eSA9IGlzTGF1bmNoZXJBY3Rpdml0eSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRlcHRoIDwgNCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpdGhpbkludGVudEZpbHRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3aXRoaW5BY3Rpdml0eSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNNYWluQWN0aXZpdHkgfD0gYWN0TWFpbkFjdGl2aXR5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNPdGhlckFjdGl2aXRpZXMgfD0gIWFjdE1haW5BY3Rpdml0eTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdpdGhpblJlY2VpdmVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc1dpZGdldFJlY2VpdmVycyB8PSBhY3RXaWRnZXRSZWNlaXZlcnM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc090aGVyUmVjZWl2ZXJzIHw9ICFhY3RXaWRnZXRSZWNlaXZlcnM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aXRoaW5TZXJ2aWNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc0ltZVNlcnZpY2UgfD0gYWN0SW1lU2VydmljZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzV2FsbHBhcGVyU2VydmljZSB8PSBhY3RXYWxscGFwZXJTZXJ2aWNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNPdGhlclNlcnZpY2VzIHw9ICghYWN0SW1lU2VydmljZSAmJiAhYWN0V2FsbHBhcGVyU2VydmljZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgd2l0aGluSW50ZW50RmlsdGVyID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmIChjb2RlICE9IFJlc1hNTFRyZWU6OlNUQVJUX1RBRykgewpAQCAtNTIyLDcgKzU4Miw3IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGRlcHRoKys7CiAgICAgICAgICAgICAgICAgU3RyaW5nOCB0YWcodHJlZS5nZXRFbGVtZW50TmFtZSgmbGVuKSk7Ci0gICAgICAgICAgICAgICAgLy9wcmludGYoIkRlcHRoICVkIHRhZyAlc1xuIiwgZGVwdGgsIHRhZy5zdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgLy9wcmludGYoIkRlcHRoICVkLCAgJXNcbiIsIGRlcHRoLCB0YWcuc3RyaW5nKCkpOwogICAgICAgICAgICAgICAgIGlmIChkZXB0aCA9PSAxKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmICh0YWcgIT0gIm1hbmlmZXN0IikgewogICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJFUlJPUjogbWFuaWZlc3QgZG9lcyBub3Qgc3RhcnQgd2l0aCA8bWFuaWZlc3Q+IHRhZ1xuIik7CkBAIC02NTAsMTAgKzcxMCw0MSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOT1JNQUxfU0NSRUVOX0FUVFIsIE5VTEwsIDEpOwogICAgICAgICAgICAgICAgICAgICAgICAgbGFyZ2VTY3JlZW4gPSBnZXRJbnRlZ2VyQXR0cmlidXRlKHRyZWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExBUkdFX1NDUkVFTl9BVFRSLCBOVUxMLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0YWcgPT0gInVzZXMtZmVhdHVyZSIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzggbmFtZSA9IGdldEF0dHJpYnV0ZSh0cmVlLCBOQU1FX0FUVFIsICZlcnJvcik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgPT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcmVxID0gZ2V0SW50ZWdlckF0dHJpYnV0ZSh0cmVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVRVUlSRURfQVRUUiwgTlVMTCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWUgPT0gImFuZHJvaWQuaGFyZHdhcmUuY2FtZXJhIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjQ2FtZXJhRmVhdHVyZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigidXNlcy1mZWF0dXJlJXM6JyVzJ1xuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcSA/ICIiIDogIi1ub3QtcmVxdWlyZWQiLCBuYW1lLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZlcnMgPSBnZXRJbnRlZ2VyQXR0cmlidXRlKHRyZWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTF9FU19WRVJTSU9OX0FUVFIsICZlcnJvcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yID09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigidXNlcy1nbC1lczonMHgleCdcbiIsIHZlcnMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0YWcgPT0gInVzZXMtcGVybWlzc2lvbiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzggbmFtZSA9IGdldEF0dHJpYnV0ZSh0cmVlLCBOQU1FX0FUVFIsICZlcnJvcik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgPT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmFtZSA9PSAiYW5kcm9pZC5wZXJtaXNzaW9uLkNBTUVSQSIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzQ2FtZXJhUGVybWlzc2lvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigidXNlcy1wZXJtaXNzaW9uOiclcydcbiIsIG5hbWUuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkVSUk9SIGdldHRpbmcgJ2FuZHJvaWQ6bmFtZScgYXR0cmlidXRlOiAlc1xuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRlcHRoID09IDMgJiYgd2l0aGluQXBwbGljYXRpb24pIHsKICAgICAgICAgICAgICAgICAgICAgd2l0aGluQWN0aXZpdHkgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgd2l0aGluUmVjZWl2ZXIgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgd2l0aGluU2VydmljZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBoYXNJbnRlbnRGaWx0ZXIgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgaWYodGFnID09ICJhY3Rpdml0eSIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhpbkFjdGl2aXR5ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2aXR5TmFtZSA9IGdldEF0dHJpYnV0ZSh0cmVlLCBOQU1FX0FUVFIsICZlcnJvcik7CkBAIC02NzksNyArNzcwLDEwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJFUlJPUiBnZXR0aW5nICdhbmRyb2lkOm5hbWUnIGF0dHJpYnV0ZSBmb3IgdXNlcy1saWJyYXJ5OiAlc1xuIiwgZXJyb3Iuc3RyaW5nKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gYmFpbDsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigidXNlcy1saWJyYXJ5OiclcydcbiIsIGxpYnJhcnlOYW1lLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCByZXEgPSBnZXRJbnRlZ2VyQXR0cmlidXRlKHRyZWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFUVVJUkVEX0FUVFIsIE5VTEwsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJ1c2VzLWxpYnJhcnklczonJXMnXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXEgPyAiIiA6ICItbm90LXJlcXVpcmVkIiwgbGlicmFyeU5hbWUuc3RyaW5nKCkpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRhZyA9PSAicmVjZWl2ZXIiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoaW5SZWNlaXZlciA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlck5hbWUgPSBnZXRBdHRyaWJ1dGUodHJlZSwgTkFNRV9BVFRSLCAmZXJyb3IpOwpAQCAtNjg4LDc2ICs3ODIsOTcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkVSUk9SIGdldHRpbmcgJ2FuZHJvaWQ6bmFtZScgYXR0cmlidXRlIGZvciByZWNlaXZlcjogJXNcbiIsIGVycm9yLnN0cmluZygpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGJhaWw7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGFnID09ICJzZXJ2aWNlIikgeworICAgICAgICAgICAgICAgICAgICAgICAgd2l0aGluU2VydmljZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlTmFtZSA9IGdldEF0dHJpYnV0ZSh0cmVlLCBOQU1FX0FUVFIsICZlcnJvcik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciAhPSAiIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiRVJST1IgZ2V0dGluZyAnYW5kcm9pZDpuYW1lJyBhdHRyaWJ1dGUgZm9yIHNlcnZpY2U6ICVzXG4iLCBlcnJvci5zdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBiYWlsOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkZXB0aCA9PSA1KSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh3aXRoaW5BY3Rpdml0eSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhZyA9PSAiYWN0aW9uIikgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcHJpbnRmKCJMT0c6IGFjdGlvbiB0YWdcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzggYWN0aW9uID0gZ2V0QXR0cmlidXRlKHRyZWUsIE5BTUVfQVRUUiwgJmVycm9yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gIiIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJFUlJPUiBnZXR0aW5nICdhbmRyb2lkOm5hbWUnIGF0dHJpYnV0ZTogJXNcbiIsIGVycm9yLnN0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBiYWlsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChkZXB0aCA9PSA0KSAmJiAodGFnID09ICJpbnRlbnQtZmlsdGVyIikpIHsKKyAgICAgICAgICAgICAgICAgICAgaGFzSW50ZW50RmlsdGVyID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgd2l0aGluSW50ZW50RmlsdGVyID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYWN0TWFpbkFjdGl2aXR5ID0gYWN0V2lkZ2V0UmVjZWl2ZXJzID0gYWN0SW1lU2VydmljZSA9IGFjdFdhbGxwYXBlclNlcnZpY2UgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChkZXB0aCA9PSA1KSAmJiB3aXRoaW5JbnRlbnRGaWx0ZXIpeworICAgICAgICAgICAgICAgICAgICBTdHJpbmc4IGFjdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRhZyA9PSAiYWN0aW9uIikgeworICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gZ2V0QXR0cmlidXRlKHRyZWUsIE5BTUVfQVRUUiwgJmVycm9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciAhPSAiIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiRVJST1IgZ2V0dGluZyAnYW5kcm9pZDpuYW1lJyBhdHRyaWJ1dGU6ICVzXG4iLCBlcnJvci5zdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBiYWlsOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpdGhpbkFjdGl2aXR5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSAiYW5kcm9pZC5pbnRlbnQuYWN0aW9uLk1BSU4iKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTWFpbkFjdGl2aXR5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9wcmludGYoIkxPRzogaXNNYWluQWN0aXZpdHk9PXRydWVcbiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RNYWluQWN0aXZpdHkgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGFnID09ICJjYXRlZ29yeSIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmc4IGNhdGVnb3J5ID0gZ2V0QXR0cmlidXRlKHRyZWUsIE5BTUVfQVRUUiwgJmVycm9yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gIiIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJFUlJPUiBnZXR0aW5nICduYW1lJyBhdHRyaWJ1dGU6ICVzXG4iLCBlcnJvci5zdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gYmFpbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2l0aGluUmVjZWl2ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aW9uID09ICJhbmRyb2lkLmFwcHdpZGdldC5hY3Rpb24uQVBQV0lER0VUX1VQREFURSIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0V2lkZ2V0UmVjZWl2ZXJzID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdpdGhpblNlcnZpY2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aW9uID09ICJhbmRyb2lkLnZpZXcuSW5wdXRNZXRob2QiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdEltZVNlcnZpY2UgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09ICJhbmRyb2lkLnNlcnZpY2Uud2FsbHBhcGVyLldhbGxwYXBlclNlcnZpY2UiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdFdhbGxwYXBlclNlcnZpY2UgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhY3Rpb24gPT0gImFuZHJvaWQuaW50ZW50LmFjdGlvbi5TRUFSQ0giKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTZWFyY2hhYmxlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICh0YWcgPT0gImNhdGVnb3J5IikgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOCBjYXRlZ29yeSA9IGdldEF0dHJpYnV0ZSh0cmVlLCBOQU1FX0FUVFIsICZlcnJvcik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkVSUk9SIGdldHRpbmcgJ25hbWUnIGF0dHJpYnV0ZTogJXNcbiIsIGVycm9yLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2l0aGluQWN0aXZpdHkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2F0ZWdvcnkgPT0gImFuZHJvaWQuaW50ZW50LmNhdGVnb3J5LkxBVU5DSEVSIikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0xhdW5jaGVyQWN0aXZpdHkgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ByaW50ZigiTE9HOiBpc0xhdW5jaGVyQWN0aXZpdHk9PXRydWVcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aXRoaW5SZWNlaXZlcikgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhZyA9PSAiYWN0aW9uIikgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzggYWN0aW9uID0gZ2V0QXR0cmlidXRlKHRyZWUsIE5BTUVfQVRUUiwgJmVycm9yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gIiIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJFUlJPUiBnZXR0aW5nICdhbmRyb2lkOm5hbWUnIGF0dHJpYnV0ZSBmb3IgcmVjZWl2ZXI6ICVzXG4iLCBlcnJvci5zdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gYmFpbDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSAiYW5kcm9pZC5hcHB3aWRnZXQuYWN0aW9uLkFQUFdJREdFVF9VUERBVEUiKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKnJOYW1lID0gZ2V0Q29tcG9uZW50TmFtZShwa2csIHJlY2VpdmVyTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyTmFtZSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoImdhZGdldC1yZWNlaXZlcjonJXMvJXMnXG4iLCBwa2cuc3RyaW5nKCksIHJOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChkZXB0aCA8IDIpIHsKLSAgICAgICAgICAgICAgICAgICAgd2l0aGluQXBwbGljYXRpb24gPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGRlcHRoIDwgMykgewotICAgICAgICAgICAgICAgICAgICAvL2lmICh3aXRoaW5BY3Rpdml0eSkgcHJpbnRmKCJMT0c6IHdpdGhpbkFjdGl2aXR5PT1mYWxzZVxuIik7Ci0gICAgICAgICAgICAgICAgICAgIHdpdGhpbkFjdGl2aXR5ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIHdpdGhpblJlY2VpdmVyID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGRlcHRoIDwgNSkgewotICAgICAgICAgICAgICAgICAgICAvL2lmIChpc01haW5BY3Rpdml0eSkgcHJpbnRmKCJMT0c6IGlzTWFpbkFjdGl2aXR5PT1mYWxzZVxuIik7Ci0gICAgICAgICAgICAgICAgICAgIC8vaWYgKGlzTGF1bmNoZXJBY3Rpdml0eSkgcHJpbnRmKCJMT0c6IGlzTGF1bmNoZXJBY3Rpdml0eT09ZmFsc2VcbiIpOwotICAgICAgICAgICAgICAgICAgICBpc01haW5BY3Rpdml0eSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBpc0xhdW5jaGVyQWN0aXZpdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAod2l0aGluQWN0aXZpdHkgJiYgaXNNYWluQWN0aXZpdHkgJiYgaXNMYXVuY2hlckFjdGl2aXR5KSB7Ci0gICAgICAgICAgICAgICAgICAgIHByaW50ZigibGF1bmNoYWJsZSBhY3Rpdml0eToiKTsKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqYU5hbWUgPSBnZXRDb21wb25lbnROYW1lKHBrZywgYWN0aXZpdHlOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGFOYW1lICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiIG5hbWU9JyVzJyIsIGFOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwcmludGYoImxhYmVsPSclcycgaWNvbj0nJXMnXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZpdHlMYWJlbC5zdHJpbmcoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2aXR5SWNvbi5zdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIXNwZWNDYW1lcmFGZWF0dXJlICYmIGhhc0NhbWVyYVBlcm1pc3Npb24pIHsKKyAgICAgICAgICAgICAgICAvLyBGb3IgYXBwbGljYXRpb25zIHRoYXQgaGF2ZSBub3QgZXhwbGljaXRseSBzdGF0ZWQgdGhlaXIKKyAgICAgICAgICAgICAgICAvLyBjYW1lcmEgZmVhdHVyZSByZXF1aXJlbWVudHMsIGJ1dCBoYXZlIHJlcXVlc3RlZCB0aGUgY2FtZXJhCisgICAgICAgICAgICAgICAgLy8gcGVybWlzc2lvbiwgd2UgYXJlIGdvaW5nIHRvIGdpdmUgdGhlbSBjb21wYXRpYmlsaXR5IHRyZWF0bWVudAorICAgICAgICAgICAgICAgIC8vIG9mIHJlcXVpcmluZyB0aGUgZXF1aXZhbGVudCB0byBvcmlnaW5hbCBhbmRyb2lkIGRldmljZXMuCisgICAgICAgICAgICAgICAgcHJpbnRmKCJ1c2VzLWZlYXR1cmU6J2FuZHJvaWQuaGFyZHdhcmUuY2FtZXJhJ1xuIik7CisgICAgICAgICAgICAgICAgcHJpbnRmKCJ1c2VzLWZlYXR1cmU6J2FuZHJvaWQuaGFyZHdhcmUuY2FtZXJhLmF1dG9mb2N1cydcbiIpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoaGFzTWFpbkFjdGl2aXR5KSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCJtYWluXG4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChoYXNXaWRnZXRSZWNlaXZlcnMpIHsKKyAgICAgICAgICAgICAgICBwcmludGYoImFwcC13aWRnZXRcbiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGhhc0ltZVNlcnZpY2UpIHsKKyAgICAgICAgICAgICAgICBwcmludGYoImltZVxuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoaGFzV2FsbHBhcGVyU2VydmljZSkgeworICAgICAgICAgICAgICAgIHByaW50Zigid2FsbHBhcGVyXG4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChoYXNPdGhlckFjdGl2aXRpZXMpIHsKKyAgICAgICAgICAgICAgICBwcmludGYoIm90aGVyLWFjdGl2aXRpZXNcbiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGlzU2VhcmNoYWJsZSkgeworICAgICAgICAgICAgICAgIHByaW50Zigic2VhcmNoXG4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChoYXNPdGhlclJlY2VpdmVycykgeworICAgICAgICAgICAgICAgIHByaW50Zigib3RoZXItcmVjZWl2ZXJzXG4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChoYXNPdGhlclNlcnZpY2VzKSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCJvdGhlci1zZXJ2aWNlc1xuIik7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIC8vIERldGVybWluZSBkZWZhdWx0IHZhbHVlcyBmb3IgYW55IHVuc3BlY2lmaWVkIHNjcmVlbiBzaXplcywKICAgICAgICAgICAgIC8vIGJhc2VkIG9uIHRoZSB0YXJnZXQgU0RLIG9mIHRoZSBwYWNrYWdlLiAgQXMgb2YgNCAoZG9udXQpCiAgICAgICAgICAgICAvLyB0aGUgc2NyZWVuIHNpemUgc3VwcG9ydCB3YXMgaW50cm9kdWNlZCwgc28gYWxsIGRlZmF1bHQgdG8KQEAgLTc3Niw3ICs4OTEsNyBAQAogICAgICAgICAgICAgaWYgKG5vcm1hbFNjcmVlbiAhPSAwKSBwcmludGYoIiAnbm9ybWFsJyIpOwogICAgICAgICAgICAgaWYgKGxhcmdlU2NyZWVuICE9IDApIHByaW50ZigiICdsYXJnZSciKTsKICAgICAgICAgICAgIHByaW50ZigiXG4iKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBwcmludGYoImxvY2FsZXM6Iik7CiAgICAgICAgICAgICBWZWN0b3I8U3RyaW5nOD4gbG9jYWxlczsKICAgICAgICAgICAgIHJlcy5nZXRMb2NhbGVzKCZsb2NhbGVzKTsKQEAgLTc4OSw3ICs5MDQsNyBAQAogICAgICAgICAgICAgICAgIHByaW50ZigiICclcyciLCBsb2NhbGVTdHIpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgcHJpbnRmKCJcbiIpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIFZlY3RvcjxSZXNUYWJsZV9jb25maWc+IGNvbmZpZ3M7CiAgICAgICAgICAgICByZXMuZ2V0Q29uZmlndXJhdGlvbnMoJmNvbmZpZ3MpOwogICAgICAgICAgICAgU29ydGVkVmVjdG9yPGludD4gZGVuc2l0aWVzOwpAQCAtNzk5LDE0ICs5MTQsMTQgQEAKICAgICAgICAgICAgICAgICBpZiAoZGVucyA9PSAwKSBkZW5zID0gMTYwOwogICAgICAgICAgICAgICAgIGRlbnNpdGllcy5hZGQoZGVucyk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcHJpbnRmKCJkZW5zaXRpZXM6Iik7CiAgICAgICAgICAgICBjb25zdCBzaXplX3QgTkQgPSBkZW5zaXRpZXMuc2l6ZSgpOwogICAgICAgICAgICAgZm9yIChzaXplX3QgaT0wOyBpPE5EOyBpKyspIHsKICAgICAgICAgICAgICAgICBwcmludGYoIiAnJWQnIiwgZGVuc2l0aWVzW2ldKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHByaW50ZigiXG4iKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBBc3NldERpciogZGlyID0gYXNzZXRzLm9wZW5Ob25Bc3NldERpcihhc3NldHNDb29raWUsICJsaWIiKTsKICAgICAgICAgICAgIGlmIChkaXIgIT0gTlVMTCkgewogICAgICAgICAgICAgICAgIGlmIChkaXItPmdldEZpbGVDb3VudCgpID4gMCkgewpAQCAtMTA0Myw2ICsxMTU4LDEyIEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICAvLyBXcml0ZSBvdXQgdGhlIFByb0d1YXJkIGZpbGUKKyAgICBlcnIgPSB3cml0ZVByb2d1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BwYWNrYWdlIHRvIGJhc2UgaW5jbHVkZSBzZXRcbiIKICAgICAgICAgIiAgIC1KICBzcGVjaWZ5IHdoZXJlIHRvIG91dHB1dCBSLmphdmEgcmVzb3VyY2UgY29uc3RhbnQgZGVmaW5pdGlvbnNcbiIKQEAgLTI3Miw2ICsyNzUsMTcgQEAKICAgICAgICAgICAgICAgICBjb252ZXJ0UGF0aChhcmd2WzBdKTsKICAgICAgICAgICAgICAgICBidW5kbGUuc2V0QXNzZXRTb3VyY2VEaXIoYXJndlswXSk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlICdHJzoKKyAgICAgICAgICAgICAgICBhcmdjLS07CisgICAgICAgICAgICAgICAgYXJndisrOworICAgICAgICAgICAgICAgIGlmICghYXJnYykgeworICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIkVSUk9SOiBObyBhcmd1bWVudCBzdXBwbGllZCBmb3IgJy1HJyBvcHRpb25cbiIpOworICAgICAgICAgICAgICAgICAgICB3YW50VXNhZ2UgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNvbnZlcnRQYXRoKGFyZ3ZbMF0pOworICAgICAgICAgICAgICAgIGJ1bmRsZS5zZXRQcm9ndWFyZEZpbGUoYXJndlswXSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlICdJJzoKICAgICAgICAgICAgICAgICBhcmdjLS07CiAgICAgICAgICAgICAgICAgYXJndisrOwpkaWZmIC0tZ2l0IGEvdG9vbHMvYWFwdC9NYWluLmggYi90b29scy9hYXB0L01haW4uaAppbmRleCA2NWMwYThhLi4zYmE0ZjM5IDEwMDY0NAotLS0gYS90b29scy9hYXB0L01haW4uaAorKysgYi90b29scy9hYXB0L01haW4uaApAQCAtNiwxMCArNiwxMyBAQAogI2lmbmRlZiBfX01BSU5fSAogI2RlZmlu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cnIsICJ3YXJuaW5nOiBjb3VsZCBub3QgdW5saW5rICclcydcbiIsIG91dHB1dEZpbGUuc3RyaW5nKCkpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0xNzksNyArMTgxLDcgQEAKICAgICAgICAgICAgIHByaW50ZigiUmVtb3ZpbmcgJXMgZHVlIHRvIGVhcmxpZXIgZmFpbHVyZXNcbiIsIG91dHB1dEZpbGUuc3RyaW5nKCkpOwogICAgICAgICB9CiAgICAgICAgIGlmICh1bmxpbmsob3V0cHV0RmlsZS5zdHJpbmcoKSkgIT0gMCkgewotICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJXQVJOSU5HOiBjb3VsZCBub3QgdW5saW5rICclcydcbiIsIG91dHB1dEZpbGUuc3RyaW5nKCkpOworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJ3YXJuaW5nOiBjb3VsZCBub3QgdW5saW5rICclcydcbiIsIG91dHB1dEZpbGUuc3RyaW5nKCkpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0yODEsNyArMjgzLDcgQEAKICAgICBpZiAoZmlsZU5hbWVMZW4gPiBleGNsdWRlRXh0ZW5zaW9uTGVuCiAgICAgICAgICAgICAmJiAoMCA9PSBzdHJjbXAoc3RvcmFnZU5hbWUuc3RyaW5nKCkgKyAoZmlsZU5hbWVMZW4gLSBleGNsdWRlRXh0ZW5zaW9uTGVuKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrRXhjbHVkZUV4dGVuc2lvbikpKSB7Ci0gICAgICAgIGZwcmludGYoc3RkZXJyLCAiV0FSTklORzogJyVzJyBub3QgYWRkZWQgdG8gWmlwXG4iLCBzdG9yYWdlTmFtZS5zdHJpbmcoKSk7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAid2FybmluZzogJyVzJyBub3QgYWRkZWQgdG8gWmlwXG4iLCBzdG9yYWdlTmFtZS5zdHJpbmcoKSk7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIApkaWZmIC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7IG92ZXJsYXlJbmRleCsrKSB7CisgICAgICAgICAgICAgICAgaWYgKGJ1bmRsZS0+Z2V0VmVyYm9zZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIHByaW50ZigidHJ5aW5nIG92ZXJsYXlTZXQgS2V5PSVzXG4iLG92ZXJsYXlTZXQtPmtleUF0KG92ZXJsYXlJbmRleCkuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBzaXplX3QgYmFzZUluZGV4ID0gYmFzZVNldC0+aW5kZXhPZktleShvdmVybGF5U2V0LT5rZXlBdChvdmVybGF5SW5kZXgpKTsKICAgICAgICAgICAgICAgICBpZiAoYmFzZUluZGV4IDwgVU5LTk9XTl9FUlJPUikgewogICAgICAgICAgICAgICAgICAgICAvLyBsb29rIGZvciBzYW1lIGZsYXZvci4gIEZvciBhIGdpdmVuIGZpbGUgKHN0cmluZ3MueG1sLCBmb3IgZXhhbXBsZSkKQEAgLTQ2MiwzMCArNDY1LDU3IEBACiAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzYW1lIGZsYXZvci4KICAgICAgICAgICAgICAgICAgICAgc3A8QWFwdEdyb3VwPiBvdmVybGF5R3JvdXAgPSBvdmVybGF5U2V0LT52YWx1ZUF0KG92ZXJsYXlJbmRleCk7CiAgICAgICAgICAgICAgICAgICAgIHNwPEFhcHRHcm91cD4gYmFzZUdyb3VwID0gYmFzZVNldC0+dmFsdWVBdChiYXNlSW5kZXgpOwotICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8QWFwdEdyb3VwRW50cnksIHNwPEFhcHRGaWxlPiA+IGJhc2VGaWxlcyA9IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VHcm91cC0+Z2V0RmlsZXMoKTsKLSAgICAgICAgICAgICAgICAgICAgRGVmYXVsdEtleWVkVmVjdG9yPEFhcHRHcm91cEVudHJ5LCBzcDxBYXB0RmlsZT4gPiBvdmVybGF5RmlsZXMgPSAKKworICAgICAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8QWFwdEdyb3VwRW50cnksIHNwPEFhcHRGaWxlPiA+IG92ZXJsYXlGaWxlcyA9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUdyb3VwLT5nZXRGaWxlcygpOworICAgICAgICAgICAgICAgICAgICBpZiAoYnVuZGxlLT5nZXRWZXJib3NlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIERlZmF1bHRLZXllZFZlY3RvcjxBYXB0R3JvdXBFbnRyeSwgc3A8QWFwdEZpbGU+ID4gYmFzZUZpbGVzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFzZUdyb3VwLT5nZXRGaWxlcygpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaT0wOyBpIDwgYmFzZUZpbGVzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJiYXNlRmlsZSAlZCBoYXMgZmxhdm9yICVzXG4iLCBpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFzZUZpbGVzLmtleUF0KGkpLnRvU3RyaW5nKCkuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaT0wOyBpIDwgb3ZlcmxheUZpbGVzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJvdmVybGF5RmlsZSAlZCBoYXMgZmxhdm9yICVzXG4iLCBpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUZpbGVzLmtleUF0KGkpLnRvU3RyaW5nKCkuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IG92ZXJsYXlHcm91cFNpemUgPSBvdmVybGF5RmlsZXMuc2l6ZSgpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBvdmVybGF5R3JvdXBJbmRleCA9IDA7IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJsYXlHcm91cEluZGV4PG92ZXJsYXlHcm91cFNpemU7IAorICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBvdmVybGF5R3JvdXBJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUdyb3VwSW5kZXg8b3ZlcmxheUdyb3VwU2l6ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVybGF5R3JvdXBJbmRleCsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgYmFzZUZpbGVJbmRleCA9IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlRmlsZXMuaW5kZXhPZktleShvdmVybGF5RmlsZXMua2V5QXQob3ZlcmxheUdyb3VwSW5kZXgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBiYXNlRmlsZUluZGV4ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFzZUdyb3VwLT5nZXRGaWxlcygpLmluZGV4T2ZLZXkob3ZlcmxheUZpbGVzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlBdChvdmVybGF5R3JvdXBJbmRleCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYoYmFzZUZpbGVJbmRleCA8IFVOS05PV05fRVJST1IpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnVuZGxlLT5nZXRWZXJib3NlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJmb3VuZCBhIG1hdGNoICglZCkgZm9yIG92ZXJsYXkgZmlsZSAlcywgZm9yIGZsYXZvciAlc1xuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlRmlsZUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJsYXlHcm91cC0+Z2V0TGVhZigpLnN0cmluZygpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJsYXlGaWxlcy5rZXlBdChvdmVybGF5R3JvdXBJbmRleCkudG9TdHJpbmcoKS5zdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VHcm91cC0+cmVtb3ZlRmlsZShiYXNlRmlsZUluZGV4KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGlkbid0IGZpbmQgYSBtYXRjaCBmYWxsIHRocm91Z2ggYW5kIGFkZCBpdC4uCiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlR3JvdXAtPmFkZEZpbGUob3ZlcmxheUZpbGVzLnZhbHVlQXQob3ZlcmxheUdyb3VwSW5kZXgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFzc2V0cy0+YWRkR3JvdXBFbnRyeShvdmVybGF5RmlsZXMua2V5QXQob3ZlcmxheUdyb3VwSW5kZXgpKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgZ3JvdXAgZG9lc24ndCBleGlzdCAoYSBmaWxlIHRoYXQncyBvbmx5IGluIHRoZSBvdmVybGF5KQotICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImFhcHQ6IGVycm9yOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIioqKiBSZXNvdXJjZSBmaWxlICclcycgZXhpc3RzIG9ubHkgaW4gYW4gb3ZlcmxheVxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVybGF5U2V0LT5rZXlBdChvdmVybGF5SW5kZXgpLnN0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICBiYXNlU2V0LT5hZGQob3ZlcmxheVNldC0+a2V5QXQob3ZlcmxheUluZGV4KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVybGF5U2V0LT52YWx1ZUF0KG92ZXJsYXlJbmRleCkpOworICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgYWxsIGZsYXZvcnMgYXJlIGRlZmluZWQgaW4gdGhlIHJlc291cmNlcy4KKyAgICAgICAgICAgICAgICAgICAgc3A8QWFwdEdyb3VwPiBvdmVybGF5R3JvdXAgPSBvdmVybGF5U2V0LT52YWx1ZUF0KG92ZXJsYXlJbmRleCk7CisgICAgICAgICAgICAgICAgICAgIERlZmF1bHRLZXllZFZlY3RvcjxBYXB0R3JvdXBFbnRyeSwgc3A8QWFwdEZpbGU+ID4gb3ZlcmxheUZpbGVzID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVybGF5R3JvdXAtPmdldEZpbGVzKCk7CisgICAgICAgICAgICAgICAgICAgIHNpemVfdCBvdmVybGF5R3JvdXBTaXplID0gb3ZlcmxheUZpbGVzLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChzaXplX3Qgb3ZlcmxheUdyb3VwSW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJsYXlHcm91cEluZGV4PG92ZXJsYXlHcm91cFNpemU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUdyb3VwSW5kZXgrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgYXNzZXRzLT5hZGRHcm91cEVudHJ5KG92ZXJsYXlGaWxlcy5rZXlBdChvdmVybGF5R3JvdXBJbmRleCkpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gdGhpcyBvdmVybGF5IGRpZG4ndCBoYXZlIHJlc291cmNlcyBmb3IgdGhpcyB0eXBlCkBAIC02MTksMTMgKzY0OSwxMyBAQAogICAgICAgICBjdXJyZW50ID0gY3VycmVudC0+Z2V0T3ZlcmxheSgpOwogICAgIH0KICAgICAvLyBhcHBseSB0aGUgb3ZlcmxheSBmaWxlcyB0byB0aGUgYmFzZSBzZXQKLSAgICBpZiAoIWFwcGx5RmlsZU92ZXJsYXkoYXNzZXRzLCBkcmF3YWJsZXMsICJkcmF3YWJsZSIpIHx8Ci0gICAgICAgICAgICAhYXBwbHlGaWxlT3ZlcmxheShhc3NldHMsIGxheW91dHMsICJsYXlvdXQiKSB8fAotICAgICAgICAgICAgIWFwcGx5RmlsZU92ZXJsYXkoYXNzZXRzLCBhbmltcywgImFuaW0iKSB8fAotICAgICAgICAgICAgIWFwcGx5RmlsZU92ZXJsYXkoYXNzZXRzLCB4bWxzLCAieG1sIikgfHwKLSAgICAgICAgICAgICFhcHBseUZpbGVPdmVybGF5KGFzc2V0cywgcmF3cywgInJhdyIpIHx8Ci0gICAgICAgICAgICAhYXBwbHlGaWxlT3ZlcmxheShhc3NldHMsIGNvbG9ycywgImNvbG9yIikgfHwKLSAgICAgICAgICAgICFhcHBseUZpbGVPdmVybGF5KGFzc2V0cywgbWVudXMsICJtZW51IikpIHsKKyAgICBpZiAoIWFwcGx5RmlsZU92ZXJsYXkoYnVuZGxlLCBhc3NldHMsIGRyYXdhYmxlcywgImRyYXdhYmxlIikgfHwKKyAgICAgICAgICAgICFhcHBseUZpbGVPdmVybGF5KGJ1bmRsZSwgYXNzZXRzLCBsYXlvdXRzLCAibGF5b3V0IikgfHwKKyAgICAgICAgICAgICFhcHBseUZpbGVPdmVybGF5KGJ1bmRsZSwgYXNzZXRzLCBhbmltcywgImFuaW0iKSB8fAorICAgICAgICAgICAgIWFwcGx5RmlsZU92ZXJsYXkoYnVuZGxlLCBhc3NldHMsIHhtbHMsICJ4bWwiKSB8fAorICAgICAgICAgICAgIWFwcGx5RmlsZU92ZXJsYXkoYnVuZGxlLCBhc3NldHMsIHJhd3MsICJyYXciKSB8fAorICAgICAgICAgICAgIWFwcGx5RmlsZU92ZXJsYXkoYnVuZGxlLCBhc3NldHMsIGNvbG9ycywgImNvbG9yIikgfHwKKyAgICAgICAgICAgICFhcHBseUZpbGVPdmVybGF5KGJ1bmRsZSwgYXNzZXRzLCBtZW51cywgIm1lbnUiKSkgewogICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKICAgICB9CiAKQEAgLTExMTgsNiArMTE0OCw3IEBACiAgICAgICAgICAgICAgICAgcHJpbnRmKCIgIFdyaXRpbmcgcHVibGljIGRlZmluaXRpb25zIHRvICVzLlxuIiwgYnVuZGxlLT5nZXRQdWJsaWNPdXRwdXRGaWxlKCkpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgdGFibGUud3JpdGVQdWJsaWNEZWZpbml0aW9ucyhTdHJpbmcxNihhc3NldHMtPmdldFBhY2thZ2UoKSksIGZwKTsKKyAgICAgICAgICAgIGZjbG9zZShmcCk7CiAgICAgICAgIH0KIAogICAgICAgICBOT0lTWSgKQEAgLTExMzUsNyArMTE2Niw2IEBACiAgICAgICAgICAgICByZXR1cm4gZXJyOwogICAgICAgICB9CiAgICAgfQotCiAgICAgcmV0dXJuIGVycjsKIH0KIApAQCAtMTIzNCwxMCArMTI2NCwxNiBAQAogCiAgICAgICAgIE5BID0gaWRlbnRzLnNpemUoKTsKIAorICAgICAgICBib29sIGRlcHJlY2F0ZWQgPSBmYWxzZTsKKyAgICAgICAgCiAgICAgICAgIFN0cmluZzE2IGNvbW1lbnQgPSBzeW1ib2xzLT5nZXRDb21tZW50KHJlYWxDbGFzc05hbWUpOwogICAgICAgICBmcHJpbnRmKGZwLCAiJXMvKiogIiwgaW5kZW50U3RyKTsKICAgICAgICAgaWYgKGNvbW1lbnQuc2l6ZSgpID4gMCkgewotICAgICAgICAgICAgZnByaW50ZihmcCwgIiVzXG4iLCBTdHJpbmc4KGNvbW1lbnQpLnN0cmluZygpKTsKKyAgICAgICAgICAgIFN0cmluZzggY210KGNvbW1lbnQpOworICAgICAgICAgICAgZnByaW50ZihmcCwgIiVzXG4iLCBjbXQuc3RyaW5nKCkpOworICAgICAgICAgICAgaWYgKHN0cnN0cihjbXQuc3RyaW5nKCksICJAZGVwcmVjYXRlZCIpICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBkZXByZWNhdGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIGZwcmludGYoZnAsICJBdHRyaWJ1dGVzIHRoYXQgY2FuIGJlIHVzZWQgd2l0aCBhICVzLlxuIiwgbmNsYXNzTmFtZS5zdHJpbmcoKSk7CiAgICAgICAgIH0KQEAgLTEzMTMsNiArMTM0OSwxMCBAQAogICAgICAgICB9CiAgICAgICAgIGZwcmludGYoZnAsICIlcyAqL1xuIiwgZ2V0SW5kZW50U3BhY2UoaW5kZW50KSk7CiAKKyAgICAgICAgaWYgKGRlcHJlY2F0ZWQpIHsKKyAgICAgICAgICAgIGZwcmludGYoZnAsICIlc0BEZXByZWNhdGVkXG4iLCBpbmRlbnRTdHIpOworICAgICAgICB9CisgICAgICAgIAogICAgICAgICBmcHJpbnRmKGZwLAogICAgICAgICAgICAgICAgICIlc3B1YmxpYyBzdGF0aWMgZmluYWwgaW50W10gJXMgPSB7XG4iCiAgICAgICAgICAgICAgICAgIiVzIiwKQEAgLTEzNjEsMTEgKzE0MDEsMTcgQEAKICAgICAgICAgICAgICAgICAvL3ByaW50ZigiJXM6JXMvJXM6IDB4JTA4eFxuIiwgU3RyaW5nOChwYWNrYWdlMTYpLnN0cmluZygpLAogICAgICAgICAgICAgICAgIC8vICAgIFN0cmluZzgoYXR0cjE2KS5zdHJpbmcoKSwgU3RyaW5nOChuYW1lMTYpLnN0cmluZygpLCB0eXBlU3BlY0ZsYWdzKTsKICAgICAgICAgICAgICAgICBjb25zdCBib29sIHB1YiA9ICh0eXBlU3BlY0ZsYWdzJlJlc1RhYmxlX3R5cGVTcGVjOjpTUEVDX1BVQkxJQykgIT0gMDsKLSAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgYm9vbCBkZXByZWNhdGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgZnByaW50ZihmcCwgIiVzLyoqXG4iLCBpbmRlbnRTdHIpOwogICAgICAgICAgICAgICAgIGlmIChjb21tZW50LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nOCBjbXQoY29tbWVudCk7CiAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoZnAsICIlcyAgPHA+XG4lcyAgQGF0dHIgZGVzY3JpcHRpb25cbiIsIGluZGVudFN0ciwgaW5kZW50U3RyKTsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmcCwgIiVzICAlc1xuIiwgaW5kZW50U3RyLCBTdHJpbmc4KGNvbW1lbnQpLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmcCwgIiVzICAlc1xuIiwgaW5kZW50U3RyLCBjbXQuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICBpZiAoc3Ryc3RyKGNtdC5zdHJpbmcoKSwgIkBkZXByZWNhdGVkIikgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVwcmVjYXRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICIlcyAgPHA+VGhpcyBzeW1ib2wgaXMgdGhlIG9mZnNldCB3aGVyZSB0aGUge0BsaW5rICVzLlIuYXR0ciMlc31cbiIKQEAgLTEzNzcsNyArMTQyMywxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGVudFN0ciwgbmNsYXNzTmFtZS5zdHJpbmcoKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmICh0eXBlQ29tbWVudC5zaXplKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZnAsICJcblxuJXMgICVzXG4iLCBpbmRlbnRTdHIsIFN0cmluZzgodHlwZUNvbW1lbnQpLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nOCBjbXQodHlwZUNvbW1lbnQpOworICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwLCAiXG5cbiVzICAlc1xuIiwgaW5kZW50U3RyLCBjbXQuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICBpZiAoc3Ryc3RyKGNtdC5zdHJpbmcoKSwgIkBkZXByZWNhdGVkIikgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVwcmVjYXRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKGNvbW1lbnQuc2l6ZSgpID4gMCkgewogICAgICAgICAgICAgICAgICAgICBpZiAocHViKSB7CkBAIC0xMzk1LDYgKzE0NDUsOSBAQAogICAgICAgICAgICAgICAgIGZwcmludGYoZnAsICIlcyAgQGF0dHIgbmFtZSAlczolc1xuIiwgaW5kZW50U3RyLAogICAgICAgICAgICAgICAgICAgICAgICAgImFuZHJvaWQiLCBTdHJpbmc4KG5hbWUpLnN0cmluZygpKTsKICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwLCAiJXMqL1xuIiwgaW5kZW50U3RyKTsKKyAgICAgICAgICAgICAgICBpZiAoZGVwcmVjYXRlZCkgeworICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwLCAiJXNARGVwcmVjYXRlZFxuIiwgaW5kZW50U3RyKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgZnByaW50ZihmcCwKICAgICAgICAgICAgICAgICAgICAgICAgICIlc3B1YmxpYyBzdGF0aWMgZmluYWwgaW50ICVzXyVzID0gJWQ7XG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgaW5kZW50U3RyLCBuY2xhc3NOYW1lLnN0cmluZygpLApAQCAtMTQzNiwxMSArMTQ4OSwxNiBAQAogICAgICAgICB9CiAgICAgICAgIFN0cmluZzE2IGNvbW1lbnQoc3ltLmNvbW1lbnQpOwogICAgICAgICBib29sIGhhdmVDb21tZW50ID0gZmFsc2U7CisgICAgICAgIGJvb2wgZGVwcmVjYXRlZCA9IGZhbHNlOwogICAgICAgICBpZiAoY29tbWVudC5zaXplKCkgPiAwKSB7CiAgICAgICAgICAgICBoYXZlQ29tbWVudCA9IHRydWU7CisgICAgICAgICAgICBTdHJpbmc4IGNtdChjb21tZW50KTsKICAgICAgICAgICAgIGZwcmludGYoZnAsCiAgICAgICAgICAgICAgICAgICAgICIlcy8qKiAlc1xuIiwKLSAgICAgICAgICAgICAgICAgICAgZ2V0SW5kZW50U3BhY2UoaW5kZW50KSwgU3RyaW5nOChjb21tZW50KS5zdHJpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgIGdldEluZGVudFNwYWNlKGluZGVudCksIGNtdC5zdHJpbmcoKSk7CisgICAgICAgICAgICBpZiAoc3Ryc3RyKGNtdC5zdHJpbmcoKSwgIkBkZXByZWNhdGVkIikgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgIGRlcHJlY2F0ZWQgPSB0cnVlOworICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgaWYgKHN5bS5pc1B1YmxpYyAmJiAhaW5jbHVkZVByaXZhdGUpIHsKICAgICAgICAgICAgIHN5bS5zb3VyY2VQb3Mud2FybmluZygiTm8gY29tbWVudCBmb3IgcHVibGljIHN5bWJvbCAlczolcy8lcyIsCiAgICAgICAgICAgICAgICAgYXNzZXRzLT5nZXRQYWNrYWdlKCkuc3RyaW5nKCksIGNsYXNzTmFtZS5zdHJpbmcoKSwKQEAgLTE0NDgsMjAgKzE1MDYsMjUgQEAKICAgICAgICAgfQogICAgICAgICBTdHJpbmcxNiB0eXBlQ29tbWVudChzeW0udHlwZUNvbW1lbnQpOwogICAgICAgICBpZiAodHlwZUNvbW1lbnQuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgU3RyaW5nOCBjbXQodHlwZUNvbW1lbnQpOwogICAgICAgICAgICAgaWYgKCFoYXZlQ29tbWVudCkgewogICAgICAgICAgICAgICAgIGhhdmVDb21tZW50ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwLAotICAgICAgICAgICAgICAgICAgICAgICAgIiVzLyoqICVzXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SW5kZW50U3BhY2UoaW5kZW50KSwgU3RyaW5nOCh0eXBlQ29tbWVudCkuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgIiVzLyoqICVzXG4iLCBnZXRJbmRlbnRTcGFjZShpbmRlbnQpLCBjbXQuc3RyaW5nKCkpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwLAotICAgICAgICAgICAgICAgICAgICAgICAgIiVzICVzXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SW5kZW50U3BhY2UoaW5kZW50KSwgU3RyaW5nOCh0eXBlQ29tbWVudCkuc3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgIiVzICVzXG4iLCBnZXRJbmRlbnRTcGFjZShpbmRlbnQpLCBjbXQuc3RyaW5nKCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHN0cnN0cihjbXQuc3RyaW5nKCksICJAZGVwcmVjYXRlZCIpICE9IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBkZXByZWNhdGVkID0gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBpZiAoaGF2ZUNvbW1lbnQpIHsKICAgICAgICAgICAgIGZwcmludGYoZnAsIiVzICovXG4iLCBnZXRJbmRlbnRTcGFjZShpbmRlbnQpKTsKICAgICAgICAgfQorICAgICAgICBpZiAoZGVwcmVjYXRlZCkgeworICAgICAgICAgICAgZnByaW50ZihmcCwgIiVzQERlcHJlY2F0ZWRcbiIsIGdldEluZGVudFNwYWNlKGluZGVudCkpOworICAgICAgICB9CiAgICAgICAgIGZwcmludGYoZnAsICIlc3B1YmxpYyBzdGF0aWMgZmluYWwgaW50ICVzPTB4JTA4eDtcbiIsCiAgICAgICAgICAgICAgICAgZ2V0SW5kZW50U3BhY2UoaW5kZW50KSwKICAgICAgICAgICAgICAgICBTdHJpbmc4KG5hbWUpLnN0cmluZygpLCAoaW50KXN5bS5pbnQzMlZhbCk7CkBAIC0xNDgwLDE3ICsxNTQzLDI1IEBACiAgICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKICAgICAgICAgfQogICAgICAgICBTdHJpbmcxNiBjb21tZW50KHN5bS5jb21tZW50KTsKKyAgICAgICAgYm9vbCBkZXByZWNhdGVkID0gZmFsc2U7CiAgICAgICAgIGlmIChjb21tZW50LnNpemUoKSA+IDApIHsKKyAgICAgICAgICAgIFN0cmluZzggY210KGNvbW1lbnQpOwogICAgICAgICAgICAgZnByaW50ZihmcCwKICAgICAgICAgICAgICAgICAgICAgIiVzLyoqICVzXG4iCiAgICAgICAgICAgICAgICAgICAgICAiJXMgKi9cbiIsCi0gICAgICAgICAgICAgICAgICAgIGdldEluZGVudFNwYWNlKGluZGVudCksIFN0cmluZzgoY29tbWVudCkuc3RyaW5nKCksCisgICAgICAgICAgICAgICAgICAgIGdldEluZGVudFNwYWNlKGluZGVudCksIGNtdC5zdHJpbmcoKSwKICAgICAgICAgICAgICAgICAgICAgZ2V0SW5kZW50U3BhY2UoaW5kZW50KSk7CisgICAgICAgICAgICBpZiAoc3Ryc3RyKGNtdC5zdHJpbmcoKSwgIkBkZXByZWNhdGVkIikgIT0gTlVMTCkgeworICAgICAgICAgICAgICAgIGRlcHJlY2F0ZWQgPSB0cnVlOworICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgaWYgKHN5bS5pc1B1YmxpYyAmJiAhaW5jbHVkZVByaXZhdGUpIHsKICAgICAgICAgICAgIHN5bS5zb3VyY2VQb3Mud2FybmluZygiTm8gY29tbWVudCBmb3IgcHVibGljIHN5bWJvbCAlczolcy8lcyIsCiAgICAgICAgICAgICAgICAgYXNzZXRzLT5nZXRQYWNrYWdlKCkuc3RyaW5nKCksIGNsYXNzTmFtZS5zdHJpbmcoKSwKICAgICAgICAgICAgICAgICBTdHJpbmc4KHN5bS5uYW1lKS5zdHJpbmcoKSk7CiAgICAgICAgIH0KKyAgICAgICAgaWYgKGRlcHJlY2F0ZWQpIHsKKyAgICAgICAgICAgIGZwcmludGYoZnAsICIlc0BEZXByZWNhdGVkXG4iLCBnZXRJbmRlbnRTcGFjZShpbmRlbnQpKTsKKyAgICAgICAgfQogICAgICAgICBmcHJpbnRmKGZwLCAiJXNwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyAlcz1cIiVzXCI7XG4iLAogICAgICAgICAgICAgICAgIGdldEluZGVudFNwYWNlKGluZGVudCksCiAgICAgICAgICAgICAgICAgU3RyaW5nOChuYW1lKS5zdHJpbmcoKSwgc3ltLnN0cmluZ1ZhbC5zdHJpbmcoKSk7CkBAIC0xNTg1LDMgKzE2NTYsMjMwIEBACiAKICAgICByZXR1cm4gTk9fRVJST1I7CiB9CisKKworCitjbGFzcyBQcm9ndWFyZEtlZXBTZXQKK3sKK3B1YmxpYzoKKyAgICAvLyB7IHJ1bGUgLS0+IHsgZmlsZSBsb2NhdGlvbnMgfSB9CisgICAgS2V5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aWNhdGlvbiA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGVwdGgtLTsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICAgIGlmIChjb2RlICE9IFJlc1hNTFRyZWU6OlNUQVJUX1RBRykgeworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgICAgZGVwdGgrKzsKKyAgICAgICAgU3RyaW5nOCB0YWcodHJlZS5nZXRFbGVtZW50TmFtZSgmbGVuKSk7CisgICAgICAgIC8vIHByaW50ZigiRGVwdGggJWQgdGFnICVzXG4iLCBkZXB0aCwgdGFnLnN0cmluZygpKTsKKyAgICAgICAgaWYgKGRlcHRoID09IDEpIHsKKyAgICAgICAgICAgIGlmICh0YWcgIT0gIm1hbmlmZXN0IikgeworICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiRVJST1I6IG1hbmlmZXN0IGRvZXMgbm90IHN0YXJ0IHdpdGggPG1hbmlmZXN0PiB0YWdcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBrZyA9IGdldEF0dHJpYnV0ZSh0cmVlLCBOVUxMLCAicGFja2FnZSIsIE5VTEwpOworICAgICAgICB9IGVsc2UgaWYgKGRlcHRoID09IDIgJiYgdGFnID09ICJhcHBsaWNhdGlvbiIpIHsKKyAgICAgICAgICAgIGluQXBwbGljYXRpb24gPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmIChpbkFwcGxpY2F0aW9uKSB7CisgICAgICAgICAgICBpZiAodGFnID09ICJhcHBsaWNhdGlvbiIgfHwgdGFnID09ICJhY3Rpdml0eSIgfHwgdGFnID09ICJzZXJ2aWNlIiB8fCB0YWcgPT0gInJlY2VpdmVyIgorICAgICAgICAgICAgICAgICAgICB8fCB0YWcgPT0gInByb3ZpZGVyIikgeworICAgICAgICAgICAgICAgIFN0cmluZzggbmFtZSA9IGdldEF0dHJpYnV0ZSh0cmVlLCAiaHR0cDovL3NjaGVtYXMuYW5kcm9pZC5jb20vYXBrL3Jlcy9hbmRyb2lkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJuYW1lIiwgJmVycm9yKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJFUlJPUjogJXNcbiIsIGVycm9yLnN0cmluZygpKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBhc2RmICAgICAtLT4gcGFja2FnZS5hc2RmCisgICAgICAgICAgICAgICAgLy8gLmFzZGYgIC5hLmIgIC0tPiBwYWNrYWdlLmFzZGYgcGFja2FnZS5hLmIKKyAgICAgICAgICAgICAgICAvLyBhc2RmLmFkc2YgLS0+IGFzZGYuYXNkZgorICAgICAgICAgICAgICAgIFN0cmluZzggcnVsZSgiLWtlZXAgY2xhc3MgIik7CisgICAgICAgICAgICAgICAgY29uc3QgY2hhciogcCA9IG5hbWUuc3RyaW5nKCk7CisgICAgICAgICAgICAgICAgY29uc3QgY2hhciogcSA9IHN0cmNocihwLCAnLicpOworICAgICAgICAgICAgICAgIGlmIChwID09IHEpIHsKKyAgICAgICAgICAgICAgICAgICAgcnVsZSArPSBwa2c7CisgICAgICAgICAgICAgICAgICAgIHJ1bGUgKz0gbmFtZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHEgPT0gTlVMTCkgeworICAgICAgICAgICAgICAgICAgICBydWxlICs9IHBrZzsKKyAgICAgICAgICAgICAgICAgICAgcnVsZSArPSAiLiI7CisgICAgICAgICAgICAgICAgICAgIHJ1bGUgKz0gbmFtZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBydWxlICs9IG5hbWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgU3RyaW5nOCBsb2NhdGlvbiA9IHRhZzsKKyAgICAgICAgICAgICAgICBsb2NhdGlvbiArPSAiICI7CisgICAgICAgICAgICAgICAgbG9jYXRpb24gKz0gYXNzRmlsZS0+Z2V0U291cmNlRmlsZSgpOworICAgICAgICAgICAgICAgIGNoYXIgbGluZW5vWzIwXTsKKyAgICAgICAgICAgICAgICBzcHJpbnRmKGxpbmVubywgIjolZCIsIHRyZWUuZ2V0TGluZU51bWJlcigpKTsKKyAgICAgICAgICAgICAgICBsb2NhdGlvbiArPSBsaW5lbm87CisKKyAgICAgICAgICAgICAgICBrZWVwLT5hZGQocnVsZSwgbG9jYXRpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIE5PX0VSUk9SOworfQorCitzdGF0dXNfdAord3JpdGVQcm9ndWFyZEZvckxheW91dChQcm9ndWFyZEtlZXBTZXQqIGtlZXAsIGNvbnN0IHNwPEFhcHRGaWxlPiYgbGF5b3V0RmlsZSkKK3sKKyAgICBzdGF0dXNfdCBlcnI7CisgICAgUmVzWE1MVHJlZSB0cmVlOworICAgIHNpemVfdCBsZW47CisgICAgUmVzWE1MVHJlZTo6ZXZlbnRfY29kZV90IGNvZGU7CisKKyAgICBlcnIgPSBwYXJzZVhNTFJlc291cmNlKGxheW91dEZpbGUsICZ0cmVlKTsKKyAgICBpZiAoZXJyICE9IE5PX0VSUk9SKSB7CisgICAgICAgIHJldHVybiBlcnI7CisgICAgfQorCisgICAgdHJlZS5yZXN0YXJ0KCk7CisKKyAgICB3aGlsZSAoKGNvZGU9dHJlZS5uZXh0KCkpICE9IFJlc1hNTFRyZWU6OkVORF9ET0NVTUVOVCAmJiBjb2RlICE9IFJlc1hNTFRyZWU6OkJBRF9ET0NVTUVOVCkgeworICAgICAgICBpZiAoY29kZSAhPSBSZXNYTUxUcmVlOjpTVEFSVF9UQUcpIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICAgIFN0cmluZzggdGFnKHRyZWUuZ2V0RWxlbWVudE5hbWUoJmxlbikpOworCisgICAgICAgIC8vIElmIHRoZXJlIGlzIG5vICcuJywgd2UnbGwgYXNzdW1lIHRoYXQgaXQncyBvbmUgb2YgdGhlIGJ1aWx0IGluIG5hbWVzLgorICAgICAgICBpZiAoc3RyY2hyKHRhZy5zdHJpbmcoKSwgJy4nKSkgeworICAgICAgICAgICAgU3RyaW5nOCBydWxlKCIta2VlcCBjbGFzcyAiKTsKKyAgICAgICAgICAgIHJ1bGUgKz0gdGFnOworICAgICAgICAgICAgcnVsZSArPSAiIHsgPGluaXQ+KC4uLik7IH0iOworCisgICAgICAgICAgICBTdHJpbmc4IGxvY2F0aW9uKCJ2aWV3ICIpOworICAgICAgICAgICAgbG9jYXRpb24gKz0gbGF5b3V0RmlsZS0+Z2V0U291cmNlRmlsZSgpOworICAgICAgICAgICAgY2hhciBsaW5lbm9bMjBdOworICAgICAgICAgICAgc3ByaW50ZihsaW5lbm8sICI6JWQiLCB0cmVlLmdldExpbmVOdW1iZXIoKSk7CisgICAgICAgICAgICBsb2NhdGlvbiArPSBsaW5lbm87CisKKyAgICAgICAgICAgIGtlZXAtPmFkZChydWxlLCBsb2NhdGlvbik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKK3N0YXR1c190Cit3cml0ZVByb2d1YXJkRm9yTGF5b3V0cyhQcm9ndWFyZEtlZXBTZXQqIGtlZXAsIGNvbnN0IHNwPEFhcHRBc3NldHM+JiBhc3NldHMpCit7CisgICAgc3RhdHVzX3QgZXJyOworICAgIHNwPEFhcHREaXI+IGxheW91dCA9IGFzc2V0cy0+cmVzRGlyKFN0cmluZzgoImxheW91dCIpKTsKKworICAgIGlmIChsYXlvdXQgIT0gTlVMTCkgeworICAgICAgICBjb25zdCBLZXllZFZlY3RvcjxTdHJpbmc4LHNwPEFhcHRHcm91cD4gPiBncm91cHMgPSBsYXlvdXQtPmdldEZpbGVzKCk7CisgICAgICAgIGNvbnN0IHNpemVfdCBOID0gZ3JvdXBzLnNpemUoKTsKKyAgICAgICAgZm9yIChzaXplX3QgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgY29uc3Qgc3A8QWFwdEdyb3VwPiYgZ3JvdXAgPSBncm91cHMudmFsdWVBdChpKTsKKyAgICAgICAgICAgIGNvbnN0IERlZmF1bHRLZXllZFZlY3RvcjxBYXB0R3JvdXBFbnRyeSwgc3A8QWFwdEZpbGU+ID4mIGZpbGVzID0gZ3JvdXAtPmdldEZpbGVzKCk7CisgICAgICAgICAgICBjb25zdCBzaXplX3QgTSA9IGZpbGVzLnNpemUoKTsKKyAgICAgICAgICAgIGZvciAoc2l6ZV90IGo9MDsgajxNOyBqKyspIHsKKyAgICAgICAgICAgICAgICBlcnIgPSB3cml0ZVByb2d1YXJkRm9yTGF5b3V0KGtlZXAsIGZpbGVzLnZhbHVlQXQoaikpOworICAgICAgICAgICAgICAgIGlmIChlcnIgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBOT19FUlJPUjsKK30KKworc3RhdHVzX3QKK3dyaXRlUHJvZ3VhcmRGaWxlKEJ1bmRsZSogYnVuZGxlLCBjb25zdCBzcDxBYXB0QXNzZXRzPiYgYXNzZXRzKQoreworICAgIHN0YXR1c190IGVyciA9IC0xOworCisgICAgaWYgKCFidW5kbGUtPmdldFByb2d1YXJkRmlsZSgpKSB7CisgICAgICAgIHJldHVybiBOT19FUlJPUjsKKyAgICB9CisKKyAgICBQcm9ndWFyZEtlZXBTZXQga2VlcDsKKworICAgIGVyciA9IHdyaXRlUHJvZ3VhcmRGb3JBbmRyb2lkTWFuaWZlc3QoJmtlZXAsIGFzc2V0cyk7CisgICAgaWYgKGVyciA8IDApIHsKKyAgICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgICBlcnI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ICAgICAgICAgICAgICBpZiAodHlwZUlkeCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc3JjUG9zLmVycm9yKCJBICd0eXBlJyBhdHRyaWJ1dGUgaXMgcmVxdWlyZWQgZm9yIDxhZGQtcmVzb3VyY2U+XG4iKTsKKyAgICAgICAgICAgICAgICAgICAgaGFzRXJyb3JzID0gbG9jYWxIYXNFcnJvcnMgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0eXBlTmFtZSA9IFN0cmluZzE2KGJsb2NrLmdldEF0dHJpYnV0ZVN0cmluZ1ZhbHVlKHR5cGVJZHgsICZsZW4pKTsKKworICAgICAgICAgICAgICAgIFN0cmluZzE2IG5hbWU7CisgICAgICAgICAgICAgICAgc3NpemVfdCBuYW1lSWR4ID0gYmxvY2suaW5kZXhPZkF0dHJpYnV0ZShOVUxMLCAibmFtZSIpOworICAgICAgICAgICAgICAgIGlmIChuYW1lSWR4IDwgMCkgeworICAgICAgICAgICAgICAgICAgICBzcmNQb3MuZXJyb3IoIkEgJ25hbWUnIGF0dHJpYnV0ZSBpcyByZXF1aXJlZCBmb3IgPGFkZC1yZXNvdXJjZT5cbiIpOworICAgICAgICAgICAgICAgICAgICBoYXNFcnJvcnMgPSBsb2NhbEhhc0Vycm9ycyA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG5hbWUgPSBTdHJpbmcxNihibG9jay5nZXRBdHRyaWJ1dGVTdHJpbmdWYWx1ZShuYW1lSWR4LCAmbGVuKSk7CisKKyAgICAgICAgICAgICAgICBvdXRUYWJsZS0+Y2FuQWRkRW50cnkoc3JjUG9zLCBteVBhY2thZ2UsIHR5cGVOYW1lLCBuYW1lKTsKKworICAgICAgICAgICAgICAgIHdoaWxlICgoY29kZT1ibG9jay5uZXh0KCkpICE9IFJlc1hNTFRyZWU6OkVORF9ET0NVTUVOVCAmJiBjb2RlICE9IFJlc1hNTFRyZWU6OkJBRF9ET0NVTUVOVCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoY29kZSA9PSBSZXNYTUxUcmVlOjpFTkRfVEFHKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyY21wMTYoYmxvY2suZ2V0RWxlbWVudE5hbWUoJmxlbiksIGFkZF9yZXNvdXJjZTE2LnN0cmluZygpKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0cmNtcDE2KGJsb2NrLmdldEVsZW1lbnROYW1lKCZsZW4pLCBkZWNsYXJlX3N0eWxlYWJsZTE2LnN0cmluZygpKSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgU291cmNlUG9zIHNyY1Bvcyhpbi0+Z2V0UHJpbnRhYmxlU291cmNlKCksIGJsb2NrLmdldExpbmVOdW1iZXIoKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIApAQCAtMTU1Nyw5ICsxNTg4LDIxIEBACiAgICAgfQogI2VuZGlmCiAgICAgaWYgKG92ZXJsYXkgJiYgIWhhc0JhZ09yRW50cnkocGFja2FnZSwgdHlwZSwgbmFtZSkpIHsKLSAgICAgICAgc291cmNlUG9zLmVycm9yKCJDYW4ndCBhZGQgbmV3IGJhZ3MgaW4gYW4gb3ZlcmxheS4gIFNlZSAnJXMnXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOChuYW1lKS5zdHJpbmcoKSk7Ci0gICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgICAgICBib29sIGNhbkFkZCA9IGZhbHNlOworICAgICAgICBzcDxQYWNrYWdlPiBwID0gbVBhY2thZ2VzLnZhbHVlRm9yKHBhY2thZ2UpOworICAgICAgIC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B7CisgICAgICAgIHQtPmNhbkFkZEVudHJ5KG5hbWUpOworICAgIH0KK30KKwogc2l6ZV90IFJlc291cmNlVGFibGU6OnNpemUoKSBjb25zdCB7CiAgICAgcmV0dXJuIG1QYWNrYWdlcy5zaXplKCk7CiB9CkBAIC0yMzEyLDEzICsyMzY0LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmc4IHJlZ2lvbihjb25maWcuc3RyaW5nKCksIDIpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZ1NldC5maW5kKHJlZ2lvbikgPT0gY29uZmlnU2V0LmVuZCgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZ1NldC5jb3VudChkZWZhdWx0TG9jYWxlKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoc3Rkb3V0LCAiYWFwdDogZXJyb3I6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRvdXQsICJhYXB0OiB3YXJuaW5nOiAiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIioqKiBzdHJpbmcgJyVzJyBoYXMgbm8gZGVmYXVsdCBvciByZXF1aXJlZCBsb2NhbGl6YXRpb24gIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJmb3IgJyVzJyBpbiAlc1xuIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmc4KG5hbWVJdGVyLT5maXJzdCkuc3RyaW5nKCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLnN0cmluZygpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1CdW5kbGUtPmdldFJlc291cmNlU291cmNlRGlycygpWzBdKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyID0gVU5LTk9XTl9FUlJPUjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTMyMTUsNiArMzI2NiwxMSBAQAogICAgIHJldHVybiBOT19FUlJPUjsKIH0KIAordm9pZCBSZXNvdXJjZVRhYmxlOjpUeXBlOjpjYW5BZGRFbnRyeShjb25zdCBTdHJpbmcxNiYgbmFtZSkKK3sKKyAgICBtQ2FuQWRkRW50cmllcy5hZGQobmFtZSk7Cit9CisKIHNwPFJlc291cmNlVGFibGU6OkVudHJ5PiBSZXNvdXJjZVRhYmxlOjpUeXBlOjpnZXRFbnRyeShjb25zdCBTdHJpbmcxNiYgZW50cnksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgU291cmNlUG9zJiBzb3VyY2VQb3MsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUmVzVGFibGVfY29uZmlnKiBjb25maWcsCkBAIC0zMjI0LDkgKzMyODAsMTAgQEAKICAgICBpbnQgcG9zID0gLTE7CiAgICAgc3A8Q29uZmlnTGlzdD4gYyA9IG1Db25maWdzLnZhbHVlRm9yKGVudHJ5KTsKICAgICBpZiAoYyA9PSBOVUxMKSB7Ci0gICAgICAgIGlmIChvdmVybGF5ID09IHRydWUpIHsKLSAgICAgICAgICAgIHNvdXJjZVBvcy5lcnJvcigiUmVzb3VyY2UgJXMgYXBwZWFycyBpbiBvdmVybGF5IGJ1dCBub3QiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBpbiB0aGUgYmFzZSBwYWNrYWdlLlxuIiwgU3RyaW5nOChlbnRyeSkuc3RyaW5nKCkpOworICAgICAgICBpZiAob3ZlcmxheSA9PSB0cnVlICYmIG1DYW5BZGRFbnRyaWVzLmluZGV4T2YoZW50cnkpIDwgMCkgeworICAgICAgICAgICAgc291cmNlUG9zLmVycm9yKCJSZXNvdXJjZSBhdCAlcyBhcHBlYXJzIGluIG92ZXJsYXkgYnV0IG5vdCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGluIHRoZSBiYXNlIHBhY2thZ2U7IHVzZSA8YWRkLXJlc291cmNlPiB0byBhZGQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzgoZW50cnkpLnN0cmluZygpKTsKICAgICAgICAgICAgIHJldHVybiBOVUxMOwogICAgICAgICB9CiAgICAgICAgIGMgPSBuZXcgQ29uZmlnTGlzdChlbnRyeSwgc291cmNlUG9zKTsKQEAgLTM1NTQsMjYgKzM2MTEsMjYgQEAKIAogICAgIH0KICAgICBpZiAocCA9PSBOVUxMKSB7Ci0gICAgICAgIGZwcmludGYoc3RkZXJyLCAiV0FSTklORzogUGFja2FnZSBub3QgZm91bmQgZm9yIHJlc291cmNlICMlMDh4XG4iLCByZXNJRCk7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAid2FybmluZzogUGFja2FnZSBub3QgZm91bmQgZm9yIHJlc291cmNlICMlMDh4XG4iLCByZXNJRCk7CiAgICAgICAgIHJldHVybiBOVUxMOwogICAgIH0KIAogICAgIGludCB0aWQgPSBSZXNfR0VUVFlQRShyZXNJRCk7CiAgICAgaWYgKHRpZCA8IDAgfHwgdGlkID49IChpbnQpcC0+Z2V0T3JkZXJlZFR5cGVzKCkuc2l6ZSgpKSB7Ci0gICAgICAgIGZwcmludGYoc3RkZXJyLCAiV0FSTklORzogVHlwZSBub3QgZm91bmQgZm9yIHJlc291cmNlICMlMDh4XG4iLCByZXNJRCk7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAid2FybmluZzogVHlwZSBub3QgZm91bmQgZm9yIHJlc291cmNlICMlMDh4XG4iLCByZXNJRCk7CiAgICAgICAgIHJldHVybiBOVUxMOwogICAgIH0KICAgICBzcDxUeXBlPiB0ID0gcC0+Z2V0T3JkZXJlZFR5c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J3YXJuaW5nOiBFbnRyeSBjb25maWd1cmF0aW9uIG5vdCBmb3VuZCBmb3IgcmVzb3VyY2UgIyUwOHhcbiIsIHJlc0lEKTsKICAgICAgICAgcmV0dXJuIE5VTEw7CiAgICAgfQogICAgIApAQCAtMzU5OSw3ICszNjU2LDcgQEAKICAgICBmb3IgKHNpemVfdCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgIGNvbnN0IEl0ZW0mIGl0ID0gZS0+Z2V0QmFnKCkudmFsdWVBdChpKTsKICAgICAgICAgaWYgKGl0LmJhZ0tleUlkID09IDApIHsKLSAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiV0FSTklORzogSUQgbm90IHlldCBhc3NpZ25lZCB0byAnJXMnIGluIGJhZyAnJXMnXG4iLAorICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJ3YXJuaW5nOiBJRCBub3QgeWV0IGFzc2lnbmVkIHRvICclcycgaW4gYmFnICclcydcbiIsCiAgICAgICAgICAgICAgICAgICAgIFN0cmluZzgoZS0+Z2V0TmFtZSgpKS5zdHJpbmcoKSwKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nOChlLT5nZXRCYWcoKS5rZXlBdChpKSkuc3RyaW5nKCkpOwogICAgICAgICB9CkBAIC0zNjI3LDcgKzM2ODQsNyBAQAogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIldBUk5JTkc6IENpcmN1bGFyIHJlZmVyZW5jZSBkZXRlY3RlZCBpbiBrZXkgJyVzJyBvZiBiYWcgJyVzJ1xuIiwKKyAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAid2FybmluZzogQ2lyY3VsYXIgcmVmZXJlbmNlIGRldGVjdGVkIGluIGtleSAnJXMnIG9mIGJhZyAnJXMnXG4iLAogICAgICAgICAgICAgICAgICAgICBTdHJpbmc4KGUtPmdldE5hbWUoKSkuc3RyaW5nKCksCiAgICAgICAgICAgICAgICAgICAgIFN0cmluZzgoZS0+Z2V0QmFnKCkua2V5QXQoaSkpLnN0cmluZygpKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKZGlmZiAtLWdpdCBhL3Rvb2xzL2FhcHQvUmVzb3VyY2VUYWJsZS5oIGIvdG9vbHMvYWFwdC9SZXNvdXJjZVRhYmxlLmgKaW5kZXggZWM0MzMxYS4uY2FhMDFiMyAxMDA2NDQKLS0tIGEvdG9vbHMvYWFwdC9SZXNvdXJjZVRhYmxlLmgKKysrIGIvdG9vbHMvYWFwdC9SZXNvdXJjZVRhYmxlLmgKQEAgLTEzMiw2ICsxMzIsOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgU3RyaW5nMTYmIG5hbWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBTdHJpbmcxNiYgY29tbWVudCk7CiAgICAgCisgICAgdm9pZCBjYW5BZGRFbnRyeShjb25zdCBTb3VyY2VQb3MmIHBvcywKKyAgICAgICAgY29uc3QgU3RyaW5nMTYmIHBhY2thZ2UsIGNvbnN0IFN0cmluZzE2JiB0eXBlLCBjb25zdCBTdHJpbmcxNiYgbmFtZSk7CisgICAgICAgIAogICAgIHNpemVfdCBzaXplKCkgY29uc3Q7CiAgICAgc2l6ZV90IG51bUxvY2FsUmVzb3VyY2VzKCkgY29uc3Q7CiAgICAgYm9vbCBoYXNSZXNvdXJjZXMoKSBjb25zdDsKQEAgLTQxMyw3ICs0MTYsOSBAQAogICAgICAgICBzdGF0dXNfdCBhZGRQdWJsaWMoY29uc3QgU291cmNlUG9zJiBwb3MsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBTdHJpbmcxNiYgbmFtZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90IGlkZW50KTsKLQorICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgIHZvaWQgY2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gICAgICBtQ0RFLm1Mb2NhbEhlYWRlclJlbE9mZnNldCk7CisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgIH0KKworICAgIHJlc3VsdCA9IG1MRkgucmVhZChmcCk7CisgICAgaWYgKHJlc3VsdCAhPSBOT19FUlJPUikgeworICAgICAgICBMT0dEKCJtTEZILnJlYWQgZmFpbGVkXG4iKTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBpZiAoZnNlZWsoZnAsIHBvc24sIFNFRUtfU0VUKSAhPSAwKQorICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKworICAgIC8vbUxGSC5kdW1wKCk7CisKKyAgICAvKgorICAgICAqIFdlICptaWdodCogbmVlZCB0byByZWFkIHRoZSBEYXRhIERlc2NyaXB0b3IgYXQgdGhpcyBwb2ludCBhbmQKKyAgICAgKiBpbnRlZ3JhdGUgaXQgaW50byB0aGUgTEZILiAgSWYgdGhpcyBiaXQgaXMgc2V0LCB0aGUgQ1JDLTMyLAorICAgICAqIGNvbXByZXNzZWQgc2l6ZSwgYW5kIHVuY29tcHJlc3NlZCBzaXplIHdpbGwgYmUgemVyby4gIEluIHByYWN0aWNlCisgICAgICogdGhlc2Ugc2VlbSB0byBiZSByYXJlLgorICAgICAqLworICAgIGhhc0REID0gKG1MRkgubUdQQml0RmxhZyAmIGtVc2VzRGF0YURlc2NyKSAhPSAwOworICAgIGlmIChoYXNERCkgeworICAgICAgICAvLyBkbyBzb21ldGhpbmcgY2xldmVyCisgICAgICAgIC8vTE9HRCgiKysrIGhhcyBkYXRhIGRlc2NyaXB0b3JcbiIpOworICAgIH0KKworICAgIC8qCisgICAgICogU2FuaXR5LWNoZWNrIHRoZSBMRkguICBOb3RlIHRoYXQgdGhpcyB3aWxsIGZhaWwgaWYgdGhlICJrVXNlc0RhdGFEZXNjciIKKyAgICAgKiBmbGFnIGlzIHNldCwgYmVjYXVzZSB0aGUgTEZIIGlzIGluY29tc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50CisgKiBhcmNoaXZlLgorICoKKyAqIEluaXRpYWxpemVzIHRoZSBDREUgYW5kIHRoZSBMRkguCisgKi8KK3N0YXR1c190IFppcEVudHJ5Ojppbml0RnJvbUV4dGVybmFsKGNvbnN0IFppcEZpbGUqIHBaaXBGaWxlLAorICAgIGNvbnN0IFppcEVudHJ5KiBwRW50cnkpCit7CisgICAgLyoKKyAgICAgKiBDb3B5IGV2ZXJ5dGhpbmcgaW4gdGhlIENERSBvdmVyLCB0aGVuIGZpeCB1cCB0aGUgaGFpcnkgYml0cy4KKyAgICAgKi8KKyAgICBtZW1jcHkoJm1DREUsICZwRW50cnktPm1DREUsIHNpemVvZihtQ0RFKSk7CisKKyAgICBpZiAobUNERS5tRmlsZU5hbWVMZW5ndGggPiAwKSB7CisgICAgICAgIG1DREUubUZpbGVOYW1lID0gbmV3IHVuc2lnbmVkIGNoYXJbbUNERS5tRmlsZU5hbWVMZW5ndGgrMV07CisgICAgICAgIGlmIChtQ0RFLm1GaWxlTmFtZSA9PSBOVUxMKQorICAgICAgICAgICAgcmV0dXJuIE5PX01FTU9SWTsKKyAgICAgICAgc3RyY3B5KChjaGFyKikgbUNERS5tRmlsZU5hbWUsIChjaGFyKilwRW50cnktPm1DREUubUZpbGVOYW1lKTsKKyAgICB9CisgICAgaWYgKG1DREUubUZpbGVDb21tZW50TGVuZ3RoID4gMCkgeworICAgICAgICBtQ0RFLm1GaWxlQ29tbWVudCA9IG5ldyB1bnNpZ25lZCBjaGFyW21DREUubUZpbGVDb21tZW50TGVuZ3RoKzFdOworICAgICAgICBpZiAobUNERS5tRmlsZUNvbW1lbnQgPT0gTlVMTCkKKyAgICAgICAgICAgIHJldHVybiBOT19NRU1PUlk7CisgICAgICAgIHN0cmNweSgoY2hhciopIG1DREUubUZpbGVDb21tZW50LCAoY2hhciopcEVudHJ5LT5tQ0RFLm1GaWxlQ29tbWVudCk7CisgICAgfQorICAgIGlmIChtQ0RFLm1FeHRyYUZpZWxkTGVuZ3RoID4gMCkgeworICAgICAgICAvKiB3ZSBudWxsLXRlcm1pbmF0ZSB0aGlzLCB0aG91Z2ggaXQgbWF5IG5vdCBiZSBhIHN0cmluZyAqLworICAgICAgICBtQ0RFLm1FeHRyYUZpZWxkID0gbmV3IHVuc2lnbmVkIGNoYXJbbUNERS5tRXh0cmFGaWVsZExlbmd0aCsxXTsKKyAgICAgICAgaWYgKG1DREUubUV4dHJhRmllbGQgPT0gTlVMTCkKKyAgICAgICAgICAgIHJldHVybiBOT19NRU1PUlk7CisgICAgICAgIG1lbWNweShtQ0RFLm1FeHRyYUZpZWxkLCBwRW50cnktPm1DREUubUV4dHJhRmllbGQsCisgICAgICAgICAgICBtQ0RFLm1FeHRyYUZpZWxkTGVuZ3RoKzEpOworICAgIH0KKworICAgIC8qIGNvbnN0cnVjdCB0aGUgTEZIIGZyb20gdGhlIENERSAqLworICAgIGNvcHlDREV0b0xGSCgpOworCisgICAgLyoKKyAgICAgKiBUaGUgTEZIICJleHRyYSIgZmllbGQgaXMgaW5kZXBlbmRlbnQgb2YgdGhlIENERSAiZXh0cmEiLCBzbyB3ZQorICAgICAqIGhhbmRsZSBpdCBoZXJlLgorICAgICAqLworICAgIGFzc2VydChtTEZILm1FeHRyYUZpZWxkID09IE5VTEwpOworICAgIG1MRkgubUV4dHJhRmllbGRMZW5ndGggPSBwRW50cnktPm1MRkgubUV4dHJhRmllbGRMZW5ndGg7CisgICAgaWYgKG1MRkgubUV4dHJhRmllbGRMZW5ndGggPiAwKSB7CisgICAgICAgIG1MRkgubUV4dHJhRmllbGQgPSBuZXcgdW5zaWduZWQgY2hhclttTEZILm1FeHRyYUZpZWxkTGVuZ3RoKzFdOworICAgICAgICBpZiAobUxGSC5tRXh0cmFGaWVsZCA9PSBOVUxMKQorICAgICAgICAgICAgcmV0dXJuIE5PX01FTU9SWTsKKyAgICAgICAgbWVtY3B5KG1MRkgubUV4dHJhRmllbGQsIHBFbnRyeS0+bUxGSC5tRXh0cmFGaWVsZCwKKyAgICA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ZTsKKyAgICBtTEZILm1DUkMzMiAgICAgICAgICAgICA9IG1DREUubUNSQzMyOworICAgIG1MRkgubUNvbXByZXNzZWRTaXplICAgID0gbUNERS5tQ29tcHJlc3NlZFNpemU7CisgICAgbUxGSC5tVW5jb21wcmVzc2VkU2l6ZSAgPSBtQ0RFLm1VbmNvbXByZXNzZWRTaXplOworICAgIG1MRkgubUZpbGVOYW1lTGVuZ3RoICAgID0gbUNERS5tRmlsZU5hbWVMZW5ndGg7CisgICAgLy8gdGhlICJleHRyYSBmaWVsZCIgaXMgaW5kZXBlbmRlbnQKKworICAgIGRlbGV0ZVtdIG1MRkgubUZpbGVOYW1lOworICAgIGlmIChtTEZILm1GaWxlTmFtZUxlbmd0aCA+IDApIHsKKyAgICAgICAgbUxGSC5tRmlsZU5hbWUgPSBuZXcgdW5zaWduZWQgY2hhclttTEZILm1GaWxlTmFtZUxlbmd0aCsxXTsKKyAgICAgICAgc3RyY3B5KChjaGFyKikgbUxGSC5tRmlsZU5hbWUsIChjb25zdCBjaGFyKikgbUNERS5tRmlsZU5hbWUpOworICAgIH0gZWxzZSB7CisgICAgICAgIG1MRkgubUZpbGVOYW1lID0gTlVMTDsKKyAgICB9Cit9CisKKy8qCisgKiBTZXQgc29tZSBpbmZvcm1hdGlvbiBhYm91dCBhIGZpbGUgYWZ0ZXIgd2UgYWRkIGl0LgorICovCit2b2lkIFppcEVudHJ5OjpzZXREYXRhSW5mbyhsb25nIHVuY29tcExlbiwgbG9uZyBjb21wTGVuLCB1bnNpZ25lZCBsb25nIGNyYzMyLAorICAgIGludCBjb21wcmVzc2lvbk1ldGhvZCkKK3sKKyAgICBtQ0RFLm1Db21wcmVzc2lvbk1ldGhvZCA9IGNvbXByZXNzaW9uTWV0aG9kOworICAgIG1DREUubUNSQzMyID0gY3JjMzI7CisgICAgbUNERS5tQ29tcHJlc3NlZFNpemUgPSBjb21wTGVuOworICAgIG1DREUubVVuY29tcHJlc3NlZFNpemUgPSB1bmNvbXBMZW47Cis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gIH0KKyAgICBpZiAobUNERS5tTGFzdE1vZEZpbGVUaW1lICE9IG1MRkgubUxhc3RNb2RGaWxlVGltZSkgeworICAgICAgICBMT0dWKCJjbXA6IExhc3RNb2RGaWxlVGltZVxuIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgaWYgKG1DREUubUxhc3RNb2RGaWxlRGF0ZSAhPSBtTEZILm1MYXN0TW9kRmlsZURhdGUpIHsKKyAgICAgICAgTE9HVigiY21wOiBMYXN0TW9kRmlsZURhdGVcbiIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGlmIChtQ0RFLm1DUkMzMiAhPSBtTEZILm1DUkMzMikgeworICAgICAgICBMT0dWKCJjbXA6IENSQzMyXG4iKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBpZiAobUNERS5tQ29tcHJlc3NlZFNpemUgIT0gbUxGSC5tQ29tcHJlc3NlZFNpemUpIHsKKyAgICAgICAgTE9HVigiY21wOiBDb21wcmVzc2VkU2l6ZVxuIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgaWYgKG1DREUubVVuY29tcHJlc3NlZFNpemUgIT0gbUxGSC5tVW5jb21wcmVzc2VkU2l6ZSkgeworICAgICAgICBMT0dWKCJjbXA6IFVuY29tcHJlc3NlZFNpemVcbiIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGlmIChtQ0RFLm1GaWxlTmFtZUxlbmd0aCAhPSBtTEZILm1GaWxlTmFtZUxlbmd0aCkgeworICAgICAgICBMT0dWKCJjbXA6IEZpbGVOYW1lTGVuZ3RoXG4iKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyNpZiAwICAgICAgIC8vIHRoaXMgc2VlbXMgdG8gYmUgdXNlZCBmb3IgcGFkZGluZywgbm90IHJlYWwgZGF0YQorICAgIGlmIChtQ0RFLm1FeHRyYUZpZWxkTGVuZ3RoICE9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KKworICAgIG1DREUubUxhc3RNb2RGaWxlVGltZSA9IG1MRkgubUxhc3RNb2RGaWxlVGltZSA9IHp0aW1lOworICAgIG1DREUubUxhc3RNb2RGaWxlRGF0ZSA9IG1MRkgubUxhc3RNb2RGaWxlRGF0ZSA9IHpkYXRlOworfQorCisKKy8qCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICAgICAgWmlwRW50cnk6OkxvY2FsRmlsZUhlYWRlcgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KKworLyoKKyAqIFJlYWQgYSBsb2NhbCBmaWxlIGhlYWRlci4KKyAqCisgKiBPbiBlbnRyeSwgImZwIiBwb2ludHMgdG8gdGhlIHNpZ25hdHVyZSBhdCB0aGUgc3RhcnQgb2YgdGhlIGhlYWRlci4KKyAqIE9uIGV4aXQsICJmcCIgcG9pbnRzIHRvIHRoZSBzdGFydCBvZiBkYXRhLgorICovCitzdGF0dXNfdCBaaXBFbnRyeTo6TG9jYWxGaWxlSGVhZGVyOjpyZWFkKEZJTEUqIGZwKQoreworICAgIHN0YXR1c190IHJlc3VsdCA9IE5PX0VSUk9SOworICAgIHVuc2lnbmVkIGNoYXIgYnVmW2tMRkhMZW5dOworCisgICAgYXNzZXJ0KG1GaWxlTmFtZSA9PSBOVUxMKTsKKyAgICBhc3NlcnQobUV4dHJhRmllbGQgPT0gTlVMTCk7CisKKyAgICBpZiAoZnJlYWQoYnVmLCAxLCBrTEZITGVuLCBmcCkgIT0ga0xGSExlbikgeworICAgICAgICByZXN1bHQgPSBVTktOT1dOX0VSUk9SOworICAgICAgICBnb3RvIGJhaWw7CisgICAgfQorCisgICAgaWYgKFppcEVudHJ5OjpnZXRMb25nTEUoJmJ1ZlsweDAwXSkgIT0ga1NpZ25hdHVyZSkgeworICAgICA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xlbmd0aCsxXTsKKyAgICAgICAgaWYgKG1GaWxlTmFtZSA9PSBOVUxMKSB7CisgICAgICAgICAgICByZXN1bHQgPSBOT19NRU1PUlk7CisgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZyZWFkKG1GaWxlTmFtZSwgMSwgbUZpbGVOYW1lTGVuZ3RoLCBmcCkgIT0gbUZpbGVOYW1lTGVuZ3RoKSB7CisgICAgICAgICAgICByZXN1bHQgPSBVTktOT1dOX0VSUk9SOworICAgICAgICAgICAgZ290byBiYWlsOworICAgICAgICB9CisgICAgICAgIG1GaWxlTmFtZVttRmlsZU5hbWVMZW5ndGhdID0gJ1wwJzsKKyAgICB9CisKKyAgICAvKiBncmFiIGV4dHJhIGZpZWxkICovCisgICAgaWYgKG1FeHRyYUZpZWxkTGVuZ3RoICE9IDApIHsKKyAgICAgICAgbUV4dHJhRmllbGQgPSBuZXcgdW5zaWduZWQgY2hhclttRXh0cmFGaWVsZExlbmd0aCsxXTsKKyAgICAgICAgaWYgKG1FeHRyYUZpZWxkID09IE5VTEwpIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IE5PX01FTU9SWTsKKyAgICAgICAgICAgIGdvdG8gYmFpbDsKKyAgICAgICAgfQorICAgICAgICBpZiAoZnJlYWQobUV4dHJhRmllbGQsIDEsIG1FeHRyYUZpZWxkTGVuZ3RoLCBmcCkgIT0gbUV4dHJhRmllbGRMZW5ndGgpIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IFVOS05PV05fRVJST1I7CisgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgIH0KKyAgICAgICAgbUV4dHJhRmllbGRbbUV4dHJhRmllbGRMZW5ndGhdID0gJ1wwJzsKKyAgICB9CisKK2JhaWw6CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworLyoKKyAqIFdyaXRlIGEgbG9jYWwgZmlsZSBoZWFkZXIuCisgKi8KK3N0YXR1c190IFppcEVudHJ5Ojp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KTsKKyAgICBMT0dEKCIgIGZpbGVuYW1lTGVuPSV1IGV4dHJhTGVuPSV1XG4iLAorICAgICAgICBtRmlsZU5hbWVMZW5ndGgsIG1FeHRyYUZpZWxkTGVuZ3RoKTsKKyAgICBpZiAobUZpbGVOYW1lICE9IE5VTEwpCisgICAgICAgIExPR0QoIiAgZmlsZW5hbWU6ICclcydcbiIsIG1GaWxlTmFtZSk7Cit9CisKKworLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogICAgICBaaXBFbnRyeTo6Q2VudHJhbERpckVudHJ5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworCisvKgorICogUmVhZCB0aGUgY2VudHJhbCBkaXIgZW50cnkgdGhhdCBhcHBlYXJzIG5leHQgaW4gdGhlIGZpbGUuCisgKgorICogT24gZW50cnksICJmcCIgc2hvdWxkIGJlIHBvc2l0aW9uZWQgb24gdGhlIHNpZ25hdHVyZSBieXRlcyBmb3IgdGhlCisgKiBlbnRyeS4gIE9uIGV4aXQsICJmcCIgd2lsbCBwb2ludCBhdCB0aGUgc2lnbmF0dXJlIHdvcmQgZm9yIHRoZSBuZXh0CisgKiBlbnRyeSBvciBmb3IgdGhlIEVPQ0QuCisgKi8KK3N0YXR1c190IFppcEVudHJ5OjpDZW50cmFsRGlyRW50cnk6OnJlYWQoRklMRSogZnApCit7CisgICAgc3RhdHVzX3QgcmVzdWx0ID0gTk9fRVJST1I7CisgICAgdW5zaWduZWQgY2hhciBidWZba0NERUxlbl07CisKKyAgICAvKiBubyByZS11c2UgKi8KKyAgICBhc3NlcnQobUZpbGVOYW1lID09IE5VTEwpOworICAgIGFzc2VydChtRXh0cmFGaWVsZCA9PSBOVUxMKTsKKyAgICBhc3NlcnQobUZpbGVDb21tZW50ID09IE5VTEwpO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dID0gJ1wwJzsKKyAgICB9CisKKyAgICAvKiByZWFkICJleHRyYSBmaWVsZCIgKi8KKyAgICBpZiAobUV4dHJhRmllbGRMZW5ndGggIT0gMCkgeworICAgICAgICBtRXh0cmFGaWVsZCA9IG5ldyB1bnNpZ25lZCBjaGFyW21FeHRyYUZpZWxkTGVuZ3RoKzFdOworICAgICAgICBpZiAobUV4dHJhRmllbGQgPT0gTlVMTCkgeworICAgICAgICAgICAgcmVzdWx0ID0gTk9fTUVNT1JZOworICAgICAgICAgICAgZ290byBiYWlsOworICAgICAgICB9CisgICAgICAgIGlmIChmcmVhZChtRXh0cmFGaWVsZCwgMSwgbUV4dHJhRmllbGRMZW5ndGgsIGZwKSAhPSBtRXh0cmFGaWVsZExlbmd0aCkgeworICAgICAgICAgICAgcmVzdWx0ID0gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgICAgIGdvdG8gYmFpbDsKKyAgICAgICAgfQorICAgICAgICBtRXh0cmFGaWVsZFttRXh0cmFGaWVsZExlbmd0aF0gPSAnXDAnOworICAgIH0KKworCisgICAgLyogZ3JhYiBjb21tZW50LCBpZiBhbnkgKi8KKyAgICBpZiAobUZpbGVDb21tZW50TGVuZ3RoICE9IDApIHsKKyAgICAgICAgbUZpbGVDb21tZW50ID0gbmV3IHVuc2lnbmVkIGNoYXJbbUZpbGVDb21tZW50TGVuZ3RoKzFdOworICAgICAgICBpZiAobUZpbGVDb21tZW50ID09IE5VTEwpIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IE5PX01FTU9SWTsKKyAgICAgICAgICAgIGdvdG8gYmFpbDsKKyAgICAgICAgfQorICAgICAgICBpZiAoZnJlYWQobUZpbGVDb21tZW50LCAxLCBtRmlsZUNvbW1lbnRMZW5ndGgsIGZwKSAhPSBtRmlsZUNvbW1lbnRMZW5ndGgpCisgICAgICAgIHsKKyAgICAgICAgICAgIHJlc3VsdCA9IFVOS05PV05fRVJST1I7CisgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAg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CBsZW5ndGguCisgICAgICovCisgICAgb2ZmX3QgZ2V0VW5jb21wcmVzc2VkTGVuKHZvaWQpIGNvbnN0IHsgcmV0dXJuIG1DREUubVVuY29tcHJlc3NlZFNpemU7IH0KKworICAgIC8qCisgICAgICogUmV0dXJuIHRoZSBjb21wcmVzc2VkIGxlbmd0aC4gIEZvciB1bmNvbXByZXNzZWQgZGF0YSwgdGhpcyByZXR1cm5zCisgICAgICogdGhlIHNhbWUgdGhpbmcgYXMgZ2V0VW5jb21wcmVzZXNkTGVuKCkuCisgICAgICovCisgICAgb2ZmX3QgZ2V0Q29tcHJlc3NlZExlbih2b2lkKSBjb25zdCB7IHJldHVybiBtQ0RFLm1Db21wcmVzc2VkU2l6ZTsgfQorCisgICAgLyoKKyAgICAgKiBSZXR1cm4gdGhlIGFic29sdXRlIGZpbGUgb2Zmc2V0IG9mIHRoZSBzdGFydCBvZiB0aGUgY29tcHJlc3NlZCBvcgorICAgICAqIHVuY29tcHJlc3NlZCBkYXRhLgorICAgICAqLworICAgIG9mZl90IGdldEZpbGVPZmZzZXQodm9pZCkgY29uc3QgeworICAgICAgICByZXR1cm4gbUNERS5tTG9jYWxIZWFkZXJSZWxPZmZzZXQgKworICAgICAgICAgICAgICAgIExvY2FsRmlsZUhlYWRlcjo6a0xGSExlbiArCisgICAgICAgICAgICAgICAgbUxGSC5tRmlsZU5hbWVMZW5ndGggKworICAgICAgICAgICAgICAgIG1MRkgubUV4dHJhRmllbGRMZW5ndGg7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBSZXR1cm4gdGhlIGRhdGEgQ1JDLgorICAgICAqLworICAgIHVuc2lnbmVkIGxvbmcgZ2V0Q1JDMzIodm9pZCkgY29uc3QgeyByZXR1cm4gbUNERS5tQ1JDMzI7IH0KKworICAgIC8qCisgICAgICogUmV0dXJuIGZpbGUgbW9kaWZpY2F0aW9uIHRpbWUgaW4gVU5JWCBzZWNvbmRzLXNpbmNlLWVwb2NoLgorICAgICAqLworICAgIHRpb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UodW5zaWduZWQgY2hhciogYnVmLCBzaG9ydCB2YWwpIHsKKyAgICAgICAgYnVmWzBdID0gKHVuc2lnbmVkIGNoYXIpIHZhbDsKKyAgICAgICAgYnVmWzFdID0gKHVuc2lnbmVkIGNoYXIpICh2YWwgPj4gOCk7CisgICAgfQorICAgIHN0YXRpYyBpbmxpbmUgdm9pZCBwdXRMb25nTEUodW5zaWduZWQgY2hhciogYnVmLCBsb25nIHZhbCkgeworICAgICAgICBidWZbMF0gPSAodW5zaWduZWQgY2hhcikgdmFsOworICAgICAgICBidWZbMV0gPSAodW5zaWduZWQgY2hhcikgKHZhbCA+PiA4KTsKKyAgICAgICAgYnVmWzJdID0gKHVuc2lnbmVkIGNoYXIpICh2YWwgPj4gMTYpOworICAgICAgICBidWZbM10gPSAodW5zaWduZWQgY2hhcikgKHZhbCA+PiAyNCk7CisgICAgfQorCisgICAgLyogZGVmaW5lZCBmb3IgWmlwIGFyY2hpdmVzICovCisgICAgZW51bSB7CisgICAgICAgIGtDb21wcmVzc1N0b3JlZCAgICAgPSAwLCAgICAgICAgLy8gbm8gY29tcHJlc3Npb24KKyAgICAgICAgLy8gc2hydW5rICAgICAgICAgICA9IDEsCisgICAgICAgIC8vIHJlZHVjZWQgMSAgICAgICAgPSAyLAorICAgICAgICAvLyByZWR1Y2VkIDIgICAgICAgID0gMywKKyAgICAgICAgLy8gcmVkdWNlZCAzICAgICAgICA9IDQsCisgICAgICAgIC8vIHJlZHVjZWQgNCAgICAgICAgPSA1LAorICAgICAgICAvLyBpbXBsb2RlZCAgICAgICAgID0gNiwKKyAgICAgICAgLy8gdG9rZW5pemVkICAgICAgICA9IDcsCisgICAgICAgIGtDb21wcmVzc0RlZmxhdGVkICAgPSA4LCAgICAgICAgLy8gc3RhbmRhcmQgZGVmbGF0ZQorICAgICAgICAvLyBEZWZsYXRlNjQgICAgICAgID0gOSwKKyAgICAgICAgLy8gbGliIGltcGxvZGVkICAgICA9IDEwLAorICAgICAgICAvLyByZXNlcn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ldGlvbjsgdXNlZCBieSBaaXBGaWxlOjpyZW1vdmUoKSAqLworICAgIHZvaWQgc2V0RGVsZXRlZCh2b2lkKSB7IG1EZWxldGVkID0gdHJ1ZTsgfQorCitwcml2YXRlOgorICAgIC8qIHRoZXNlIGFyZSBwcml2YXRlIGFuZCBub3QgZGVmaW5lZCAqLworICAgIFppcEVudHJ5KGNvbnN0IFppcEVudHJ5JiBzcmMpOworICAgIFppcEVudHJ5JiBvcGVyYXRvcj0oY29uc3QgWmlwRW50cnkmIHNyYyk7CisKKyAgICAvKiByZXR1cm5zICJ0cnVlIiBpZiB0aGUgQ0RFIGFuZCB0aGUgTEZIIGFncmVlICovCisgICAgYm9vbCBjb21wYXJlSGVhZGVycyh2b2lkKSBjb25zdDsKKyAgICB2b2lkIGNvcHlDREV0b0xGSCh2b2lkKTsKKworICAgIGJvb2wgICAgICAgIG1EZWxldGVkOyAgICAgICAvLyBzZXQgaWYgZW50cnkgaXMgcGVuZGluZyBkZWxldGlvbgorICAgIGJvb2wgICAgICAgIG1NYXJrZWQ7ICAgICAgICAvLyBhcHAtZGVmaW5lZCBtYXJrZXIKKworICAgIC8qCisgICAgICogRXZlcnkgZW50cnkgaW4gdGhlIFppcCBhcmNoaXZlIHN0YXJ0cyBvZmYgd2l0aCBvbmUgb2YgdGhlc2UuCisgICAgICovCisgICAgY2xhc3MgTG9jYWxGaWxlSGVhZGVyIHsKKyAgICBwdWJsaWM6CisgICAgICAgIExvY2FsRmlsZUhlYWRlcih2b2lkKSA6CisgICAgICAgICAgICBtVmVyc2lvblRvRXh0cmFjdCgwKSwKKyAgICAgICAgICAgIG1HUEJpdEZsYWcoMCksCisgICAgICAgICAgICBtQ29tcHJlc3Npb25NZXRob2QoMCksCisgICAgICAgICAgICBtTGFzdE1vZEZpbGVUaW1lKDApLAorICAgICAgICAgICAgbUxhc3RNb2RGaWxlRGF0ZSgwKSwKKyAgICAgICAgICAgIG1DUkMzMigwKSwKKyAgICAgICAgICAgIG1Db21wcmVzc2VkU2l6ZSgwKSwKKyAgICAgICAgICAgIG1VbmNvbXByZXNzZWRTaXplKDApLAorICAgICAgICAgICAgbUZpbGVOYW1lTGVuZ3RoKDApLAorICAgICAgICAgICAgbUV4dHJhRmllbGRMZW5ndGgoMCksCisgICAgICAgICAgICBtRmlsZU5hbWUoTlVMTCksCisgICAgICAgICAgICBtRXh0cmFGaWVsZChOVUxMKQorICAgICAgICB7fQorICAgICAgICB2aXJ0dWFsIH5Mb2NhbEZpbGVIZWFkZXIodm9pZCkgeworICAgICAgICAgICAgZGVsZXRlW10gbUZpbGVOYW1lOworICAgICAgICAgICAgZGVsZXRlW10gbUV4dHJhRmllbGQ7CisgICAgICAgIH0KKworICAgICAgICBzdGF0dXNfdCByZWFkKEZJTEUqIGZwKTsKKyAgICAgICAgc3RhdHVzX3Qgd3JpdGUoRklMRSogZnApOworCisgICAgICAgIC8vIHVuc2lnbmVkIGxvbmcgbVNpZ25hdHVyZTsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1WZXJzaW9uVG9FeHRyYWN0OworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbUdQQml0RmxhZzsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1Db21wcmVzc2lvbk1ldGhvZDsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1MYXN0TW9kRmlsZVRpbWU7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICBtTGFzdE1vZEZpbGVEYXRlOworICAgICAgICB1bnNpZ25lZCBsb25nICAgbUNSQzMyOworICAgICAgICB1bnNpZ25lZCBsb25nICAgbUNvbXByZXNzZWRTaXplOworICAgICAgICB1bnNpZ25lZCBsb25nICAgbVVuY29tcHJlc3NlZFNpemU7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICBtRmlsZU5hbWVMZW5ndGg7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICBtRXh0cmFGaWVsZExlbmd0aDsKKyAgICAgICAgdW5zaWduZWQgY2hhciogIG1GaWxlTmFtZTsKKyAgICAgICAgdW5zaWduZWQgY2hhciogIG1FeHRyYUZpZWxkOworCisgICAgICAgIGVudW0geworICAgICAgICAgICAga1NpZ25hdHVyZSAgICAgID0gMHgwNDAzNGI1MCwKKyAgICAgICAgICAgIGtMRkhMZW4gICAgICAgICA9IDMwLCAgICAgICAvLyBMb2NhbEZpbGVIZHIgbGVuLCBleGNsLiB2YXIgZmllbGRzCisgICAgICAgIH07CisKKyAgICAgICAgdm9pZCBkdW1wKHZvaWQpIGNvbnN0OworICAgIH07CisKKyAgICAvKgorICAgICAqIEV2ZXJ5IGVudHJ5IGluIHRoZSBaaXAgYXJjaGl2ZSBoYXMgb25lIG9mIHRoZXNlIGluIHRoZSAiY2VudHJhbAorICAgICAqIGRpcmVjdG9yeSIgYXQgdGhlIGVuZCBvZiB0aGUgZmlsZS4KKyAgICAgKi8KKyAgICBjbGFzcyBDZW50cmFsRGlyRW50cnkgeworICAgIHB1YmxpYzoKKyAgICAgICAgQ2VudHJhbERpckVudHJ5KHZvaWQpIDoKKyAgICAgICAgICAgIG1WZXJzaW9uTWFkZUJ5KDApLAorICAgICAgICAgICAgbVZlcnNpb25Ub0V4dHJhY3QoMCksCisgICAgICAgICAgICBtR1BCaXRGbGFnKDApLAorICAgICAgICAgICAgbUNvbXByZXNzaW9uTWV0aG9kKDApLAorICAgICAgICAgICAgbUxhc3RNb2RGaWxlVGltZSgwKSwKKyAgICAgICAgICAgIG1MYXN0TW9kRmlsZURhdGUoMCksCisgICAgICAgICAgICBtQ1JDMzIoMCksCisgICAgICAgICAgICBtQ29tcHJlc3NlZFNpemUoMCksCisgICAgICAgICAgICBtVW5jb21wcmVzc2VkU2l6ZSgwKSwKKyAgICAgICAgICAgIG1GaWxlTmFtZUxlbmd0aCgwKSwKKyAgICAgICAgICAgIG1FeHRyYUZpZWxkTGVuZ3RoKDApLAorICAgICAgICAgICAgbUZpbGVDb21tZW50TGVuZ3RoKDApLAorICAgICAgICAgICAgbURpc2tOdW1iZXJTdGFydCgwKSwKKyAgICAgICAgICAgIG1JbnRlcm5hbEF0dHJzKDApLAorICAgICAgICAgICAgbUV4dGVybmFsQXR0cnMoMCksCisgICAgICAgICAgICBtTG9jYWxIZWFkZXJSZWxPZmZzZXQoMCksCisgICAgICAgICAgICBtRmlsZU5hbWUoTlVMTCksCisgICAgICAgICAgICBtRXh0cmFGaWVsZChOVUxMKSwKKyAgICAgICAgICAgIG1GaWxlQ29tbWVudChOVUxMKQorICAgICAgICB7fQorICAgICAgICB2aXJ0dWFsIH5DZW50cmFsRGlyRW50cnkodm9pZCkgeworICAgICAgICAgICAgZGVsZXRlW10gbUZpbGVOYW1lOworICAgICAgICAgICAgZGVsZXRlW10gbUV4dHJhRmllbGQ7CisgICAgICAgICAgICBkZWxldGVbXSBtRmlsZUNvbW1lbnQ7CisgICAgICAgIH0KKworICAgICAgICBzdGF0dXNfdCByZWFkKEZJTEUqIGZwKTsKKyAgICAgICAgc3RhdHVzX3Qgd3JpdGUoRklMRSogZnApOworCisgICAgICAgIC8vIHVuc2lnbmVkIGxvbmcgbVNpZ25hdHVyZTsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1WZXJzaW9uTWFkZUJ5OworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbVZlcnNpb25Ub0V4dHJhY3Q7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICBtR1BCaXRGbGFnOworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbUNvbXByZXNzaW9uTWV0aG9kOworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbUxhc3RNb2RGaWxlVGltZTsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1MYXN0TW9kRmlsZURhdGU7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgICBtQ1JDMzI7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgICBtQ29tcHJlc3NlZFNpemU7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgICBtVW5jb21wcmVzc2VkU2l6ZTsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1GaWxlTmFtZUxlbmd0aDsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1FeHRyYUZpZWxkTGVuZ3RoOworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbUZpbGVDb21tZW50TGVuZ3RoOworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbURpc2tOdW1iZXJTdGFydDsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgIG1JbnRlcm5hbEF0dHJzOworICAgICAgICB1bnNpZ25lZCBsb25nICAgbUV4dGVybmFsQXR0cnM7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgICBtTG9jYWxIZWFkZXJSZWxPZmZzZXQ7CisgICAgICAgIHVuc2lnbmVkIGNoYXIqICBtRmlsZU5hbWU7CisgICAgICAgIHVuc2lnbmVkIGNoYXIqICBtRXh0cmFGaWVsZDsKKyAgICAgICAgdW5zaWduZWQgY2hhciogIG1GaWxlQ29tbWVudDsKKworICAgICAgICB2b2lkIGR1bXAodm9pZCkgY29uc3Q7CisKKyAgICAgICAgZW51bSB7CisgICAgICAgICAgICBrU2lnbmF0dXJlICAgICAgPSAweDAyMDE0YjUwLAorICAgICAgICAgICAga0NERUxlbiAgICAgICAgID0gNDYsICAgICAgIC8vIENlbnRyYWxEaXJFbnQgbGVuLCBleGNsLiB2YXIgZmllbGRzCisgICAgICAgIH07CisgICAgfTsKKworICAgIGVudW0geworICAgICAgICAvL2tEYXRhRGVzY3JpcHRvclNpZ25hdHVyZSAgPSAweDA4MDc0YjUwLCAgIC8vIGN1cnJlbnRseSB1bnVzZWQKKyAgICAgICAga0RhdGFEZXNjcmlwdG9yTGVuICA9IDE2LCAgICAgICAgICAgLy8gZm91ciAzMi1iaXQgZmllbGRzCisKKyAgICAgICAga0RlZmF1bHRWZXJzaW9uICAgICA9IDIwLCAgICAgICAgICAgLy8gbmVlZCBkZWZsYXRlLCBub3RoaW5nIG11Y2ggZWxzZQorICA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GUKKworICAgIGlmIChmbGFncyAmIGtPcGVuVHJ1bmNhdGUpIHsKKyAgICAgICAgbmV3QXJjaGl2ZSA9IHRydWU7CisgICAgfSBlbHNlIHsKKyAgICAgICAgbmV3QXJjaGl2ZSA9IChhY2Nlc3MoemlwRmlsZU5hbWUsIEZfT0spICE9IDApOworICAgICAgICBpZiAoIShmbGFncyAmIGtPcGVuQ3JlYXRlKSAmJiBuZXdBcmNoaXZlKSB7CisgICAgICAgICAgICAvKiBub3QgY3JlYXRpbmcsIG11c3QgYWxyZWFkeSBleGlzdCAqLworICAgICAgICAgICAgTE9HRCgiRmlsZSAlcyBkb2VzIG5vdCBleGlzdCIsIHppcEZpbGVOYW1lKTsKKyAgICAgICAgICAgIHJldHVybiBOQU1FX05PVF9GT1VORDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIG9wZW4gdGhlIGZpbGUgKi8KKyAgICBjb25zdCBjaGFyKiBvcGVuZmxhZ3M7CisgICAgaWYgKGZsYWdzICYga09wZW5SZWFkV3JpdGUpIHsKKyAgICAgICAgaWYgKG5ld0FyY2hpdmUpCisgICAgICAgICAgICBvcGVuZmxhZ3MgPSBGSUxFX09QRU5fUldfQ1JFQVRFOworICAgICAgICBlbHNlCisgICAgICAgICAgICBvcGVuZmxhZ3MgPSBGSUxFX09QRU5fUlc7CisgICAgfSBlbHNlIHsKKyAgICAgICAgb3BlbmZsYWdzID0gRklMRV9PUEVOX1JPOworICAgIH0KKyAgICBtWmlwRnAgPSBmb3Blbih6aXBGaWxlTmFtZSwgb3BlbmZsYWdzKTsKKyAgICBpZiAobVppcEZwID09IE5VTEwpIHsKKyAgICAgICAgaW50IGVyciA9IGVycm5vOworICAgICAgICBMT0dEKCJmb3BlbiBmYWlsZWQ6ICVkXG4iLCBlcnIpOworICAgICAgICByZXR1cm4gZXJybm9Ub1N0YXR1cyhlcnIpOworICAgIH0KKworICAgIHN0YXR1c190IHJlc3VsdDsKKyAgICBpZiAoIW5ld0FyY2hpdmUpIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogTG9hZCB0aGUgY2VudHJhbCBkaXJlY3RvcnkuICBJZiB0aGF0IGZhaWxzLCB0aGVuIHRoaXMgcHJvYmFibHkKKyAgICAgICAgICogaXNuJ3QgYSBaaXAgYXJjaGl2ZS4KKyAgICAgICAgICovCisgICAgICAgIHJlc3VsdCA9IHJlYWRDZW50cmFsRGlyKCk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogTmV3bHktY3JlYXRlZC4gIFRoZSBFbmRPZkNlbnRyYWxEaXIgY29uc3RydWN0b3IgYWN0dWFsbHkKKyAgICAgICAgICogc2V0cyBldmVyeXRoaW5nIHRvIGJlIHRoZSB3YXkgd2Ugd2FudCBpdCAoYWxsIHplcm9lcykuICBXZQorICAgICAgICAgKiBzZXQgbU5lZWRDRFJld3JpdGUgc28gdGhhdCB3ZSBjcmVhdGUgKnNvbWV0aGluZyogaWYgdGhlCisgICAgICAgICAqIGNhbGxlciBkb2Vzbid0IGFkZCBhbnkgZmlsZXMuICAoV2UgY291bGQgYWxzbyBqdXN0IHVubGluaworICAgICAgICAgKiB0aGUgZmlsZSBpZiBpdCdzIGJyYW5kIG5ldyBhbmQgbm90aGluZyB3YXMgYWRkZWQsIGJ1dCB0aGF0J3MKKyAgICAgICAgICogcHJvYmFibHkgZG9pbmcgbW9yZSB0aGFuIHdlIHJlYWxseSBzaG91bGQgLS0gdGhlIHVzZXIgbWlnaHQKKyAgICAgICAgICogaGF2ZSBhIG5lZWQgZm9yIGVtcHR5IHppcCBmaWxlcy4pCisgICAgICAgICAqLworICAgICAgICBtTmVlZENEUmV3cml0ZSA9IHRydWU7CisgICAgICAgIHJlc3VsdCA9IE5PX0VSUk9SOworICAgIH0KKworICAgIGlmIChmbGFncyAmIGtPcGVuUmVhZE9ubHkpCisgICAgICAgIG1SZWFkT25seSA9IHRydWU7CisgICAgZWxzZQorICAgICAgICBhc3NlcnQoIW1SZWFkT25seSk7CisKKy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AgICAgZ290byBiYWlsOworICAgIH0KKworICAgIC8qIHJlYWQgdGhlIGxhc3QgcGFydCBvZiB0aGUgZmlsZSBpbnRvIHRoZSBidWZmZXIgKi8KKyAgICBpZiAoZnJlYWQoYnVmLCAxLCByZWFkQW1vdW50LCBtWmlwRnApICE9IChzaXplX3QpIHJlYWRBbW91bnQpIHsKKyAgICAgICAgTE9HRCgic2hvcnQgZmlsZT8gd2FudGVkICVsZFxuIiwgcmVhZEFtb3VudCk7CisgICAgICAgIHJlc3VsdCA9IFVOS05PV05fRVJST1I7CisgICAgICAgIGdvdG8gYmFpbDsKKyAgICB9CisKKyAgICAvKiBmaW5kIHRoZSBlbmQtb2YtY2VudHJhbC1kaXIgbWFnaWMgKi8KKyAgICBmb3IgKGkgPSByZWFkQW1vdW50IC0gNDsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgaWYgKGJ1ZltpXSA9PSAweDUwICYmCisgICAgICAgICAgICBaaXBFbnRyeTo6Z2V0TG9uZ0xFKCZidWZbaV0pID09IEVuZE9mQ2VudHJhbERpcjo6a1NpZ25hdHVyZSkKKyAgICAgICAgeworICAgICAgICAgICAgTE9HVigiKysrIEZvdW5kIEVPQ0QgYXQgYnVmKyVkXG4iLCBpKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIGlmIChpIDwgMCkgeworICAgICAgICBMT0dEKCJFT0NEIG5vdCBmb3VuZCwgbm90IFppcFxuIik7CisgICAgICAgIHJlc3VsdCA9IElOVkFMSURfT1BFUkFUSU9OOworICAgICAgICBnb3RvIGJhaWw7CisgICAgfQorCisgICAgLyogZXh0cmFjdCBlb2NkIHZhbHVlcyAqLworICAgIHJlc3VsdCA9IG1FT0NELnJlYWRCdWYoYnVmICsgaSwgcmVhZEFtb3VudCAtIGkpOworICAgIGlmIChyZXN1bHQgIT0gTk9fRVJST1IpIHsKKyAgICAgICAgTE9HRCgiRmFpbHVyZSByZWFkaW5nICVsZCBieXRlcyBvZiB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dvb2RpZXMuCisgICAgICoKKyAgICAgKiBUaGUgb25seSB0aGluZyB3ZSByZWFsbHkgbmVlZCByaWdodCBub3cgaXMgdGhlIGZpbGUgY29tbWVudCwgd2hpY2gKKyAgICAgKiB3ZSdyZSBob3BpbmcgdG8gcHJlc2VydmUuCisgICAgICovCisgICAgaWYgKGZzZWVrKG1aaXBGcCwgbUVPQ0QubUNlbnRyYWxEaXJPZmZzZXQsIFNFRUtfU0VUKSAhPSAwKSB7CisgICAgICAgIExPR0QoIkZhaWx1cmUgc2Vla2luZyB0byBjZW50cmFsIGRpciBvZmZzZXQgJWxkXG4iLAorICAgICAgICAgICAgIG1FT0NELm1DZW50cmFsRGlyT2Zmc2V0KTsKKyAgICAgICAgcmVzdWx0ID0gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgZ290byBiYWlsOworICAgIH0KKworICAgIC8qCisgICAgICogTG9vcCB0aHJvdWdoIGFuZCByZWFkIHRoZSBjZW50cmFsIGRpciBlbnRyaWVzLgorICAgICAqLworICAgIExPR1YoIlNjYW5uaW5nICVkIGVudHJpZXMuLi5cbiIsIG1FT0NELm1Ub3RhbE51bUVudHJpZXMpOworICAgIGludCBlbnRyeTsKKyAgICBmb3IgKGVudHJ5ID0gMDsgZW50cnkgPCBtRU9DRC5tVG90YWxOdW1FbnRyaWVzOyBlbnRyeSsrKSB7CisgICAgICAgIFppcEVudHJ5KiBwRW50cnkgPSBuZXcgWmlwRW50cnk7CisKKyAgICAgICAgcmVzdWx0ID0gcEVudHJ5LT5pbml0RnJvbUNERShtWmlwRnApOworICAgICAgICBpZiAocmVzdWx0ICE9IE5PX0VSUk9SKSB7CisgICAgICAgICAgICBMT0dEKCJpbml0RnJvbUNERSBmYWlsZWRcbiIpOworICAgICAgICAgICAgZGVsZXRlIHBFbnRyeTsKKyAgICAgICAgICAgIGdvdG8gYmFpbDsKKyAgICAgICAgfQorCisgICAgICAgIG1FbnRyaWVzLmFkZChwRW50cnkpOworICAgIH0KKworCisgICAgLyoKKyAgICAgKiBJZiBhbGwgd2VudCB3ZWxsLCB3ZSBzaG91bGQgbm93IGJlIGJhY2sgYXQgdGhlIEVPQ0QuCisgICAgICovCisgICAgeworICAgICAgICB1bnNpZ25lZCBjaGFyIGNoZWNrQnVmWzRdOworICAgICAgICBpZiAoZnJlYWQoY2hlY2tCdWYsIDEsIDQsIG1aaXBGcCkgIT0gNCkgeworICAgICAgICAgICAgTE9HRCgiRU9DRCBjaGVjayByZWFkIGZhaWxlZFxuIik7CisgICAgICAgICAgICByZXN1bHQgPSBJTlZBTElEX09QRVJBVElPTjsKKyAgICAgICAgICAgIGdvdG8gYmFpbDsKKyAgICAgICAgfQorICAgICAgICBpZiAoWmlwRW50cnk6OmdldExvbmdMRShjaGVja0J1ZikgIT0gRW5kT2ZDZW50cmFsRGlyOjprU2lnbmF0dXJlKSB7CisgICAgICAgICAgICBMT0dEKCJFT0NEIHJlYWQgY2hlY2sgZmFpbGVkXG4iKTsKKyAgICAgICAgICAgIHJlc3VsdCA9IFVOS05PV05fRVJST1I7CisgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgIH0KKyAgICAgICAgTE9HVigiKysrIEVPQ0QgcmVhZCBjaGVjayBwYXNzZWRcbiIpOworICAgIH0KKworYmFpbDoKKyAgICBkZWxldGVbXSBidWY7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworCisvKgorICogQWRkIGEgbmV3IGZpbGUgdG8gdGhlIGFyY2hpdmUuCisgKgorICogVGhpcyByZXF1aXJlcyBjcmVhdGluZyBhbmQgcG9wdWxhdGluZyBhIFppcEVudHJ5IHN0cnVjdHVyZSwgYW5kIGNvcHlpbmcKKyAqIHRoZSBkYXRhIGludG8gdGhlIGZpbGUgYXQgdGhlIGFwcHJvcHJpYXRlIHBvc2l0aW9uLiAgVGhlICJhcHByb3ByaWF0ZQorICogcG9zaXRpb24iIGlzIHRoZSBjdXJyZW50IGxvY2F0aW9uIG9mIHRoZSBjZW50cmFsIGRpcmVjdG9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yeSwgYnV0IGluCisgICAgICogcHJhY3RpY2Ugc29tZSB1dGlsaXRpZXMgZGVtYW5kIGl0LgorICAgICAqLworICAgIGxmaFBvc24gPSBmdGVsbChtWmlwRnApOworICAgIHBFbnRyeS0+bUxGSC53cml0ZShtWmlwRnApOworICAgIHN0YXJ0UG9zbiA9IGZ0ZWxsKG1aaXBGcCk7CisKKyAgICAvKgorICAgICAqIENvcHkgdGhlIGRhdGEgaW4sIHBvc3NpYmx5IGNvbXByZXNzaW5nIGl0IGFzIHdlIGdvLgorICAgICAqLworICAgIGlmIChzb3VyY2VUeXBlID09IFppcEVudHJ5OjprQ29tcHJlc3NTdG9yZWQpIHsKKyAgICAgICAgaWYgKGNvbXByZXNzaW9uTWV0aG9kID09IFppcEVudHJ5OjprQ29tcHJlc3NEZWZsYXRlZCkgeworICAgICAgICAgICAgYm9vbCBmYWlsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHJlc3VsdCA9IGNvbXByZXNzRnBUb0ZwKG1aaXBGcCwgaW5wdXRGcCwgZGF0YSwgc2l6ZSwgJmNyYyk7CisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgTE9HRCgiY29tcHJlc3Npb24gZmFpbGVkLCBzdG9yaW5nXG4iKTsKKyAgICAgICAgICAgICAgICBmYWlsZWQgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIE1ha2Ugc3VyZSBpdCBoYXMgY29tcHJlc3NlZCAiZW5vdWdoIi4gIFRoaXMgcHJvYmFibHkgb3VnaHQKKyAgICAgICAgICAgICAgICAgKiB0byBiZSBzZXQgdGhyb3VnaCBhbiBBUEkgY2FsbCwgYnV0IEkgZG9uJ3QgZXhwZWN0IG91cgorICAgICAgICAgICAgICAgICAqIGNyaXRlcmlhIHRvIGNoYW5nZSBvdmVyIHRpbWUuCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgbG9uZyBzcmMgPSBpbnB1dEZwID8gZnRlbGwoaW5wdXRGcCkgOiBzaXplOworICAgICAgICAgICAgICAgIGxvbmcgZHN0ID0gZnRlbGwobVppcEZwKSAtIHN0YXJ0UG9zbjsKKyAgICAgICAgICAgICAgICBpZiAoZHN0ICsgKGRzdCAvIDEwKSA+IHNyYykgeworICAgICAgICAgICAgICAgICAgICBMT0dEKCJpbnN1ZmZpY2llbnQgY29tcHJlc3Npb24gKHNyYz0lbGQgZHN0PSVsZCksIHN0b3JpbmdcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICBzcmMsIGRzdCk7CisgICAgICAgICAgICAgICAgICAgIGZhaWxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZmFpbGVkKSB7CisgICAgICAgICAgICAgICAgY29tcHJlc3Npb25NZXRob2QgPSBaaXBFbnRyeTo6a0NvbXByZXNzU3RvcmVkOworICAgICAgICAgICAgICAgIGlmIChpbnB1dEZwKSByZXdpbmQoaW5wdXRGcCk7CisgICAgICAgICAgICAgICAgZnNlZWsobVppcEZwLCBzdGFydFBvc24sIFNFRUtfU0VUKTsKKyAgICAgICAgICAgICAgICAvKiBmYWxsIHRocm91Z2ggdG8ga0NvbXByZXNzU3RvcmVkIGNhc2UgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvKiBoYW5kbGUgIm5vIGNvbXByZXNzaW9uIiByZXF1ZXN0LCBvciBmYWlsZWQgY29tcHJlc3Npb24gZnJvbSBhYm92ZSAqLworICAgICAgICBpZiAoY29tcHJlc3Npb25NZXRob2QgPT0gWmlwRW50cnk6OmtDb21wcmVzc1N0b3JlZCkgeworICAgICAgICAgICAgaWYgKGlucHV0RnApIHsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBjb3B5RnBUb0ZwKG1aaXBGcCwgaW5wdXRGcCwgJmNyYyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNvcHlEYXRhVG9GcChtWmlwRnAsIGRhdGEsIHNpemUsICZjcmMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBOT19FUlJPUikgeworICAgICAgICAgICAgICAgIC8vIGRvbid0IG5lZWQgdG8gdHJ1bmNhdGU7IGhhcHBlbnMgaW4gQ0RFIHJld3JpdGUKKyAgICAgICAgICAgICAgICBMT0dEKCJmYWlsZWQgY29weWluZyBkYXRhIGluXG4iKTsKKyAgICAgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBjdXJyZW50bHkgc2Vla2VkIHRvIGVuZCBvZiBmaWxlCisgICAgICAgIHVuY29tcHJlc3NlZExlbiA9IGlucHV0RnAgPyBmdGVsbChpbnB1dEZwKSA6IHNpemU7CisgICAgfSBlbHNlIGlmIChzb3VyY2VUeXBlID09IFppcEVudHJ5OjprQ29tcHJlc3NEZWZsYXRlZCkgeworICAgICAgICAvKiB3ZSBzaG91bGQgc3VwcG9ydCB1bmNvbXByZXNzZWQtZnJvbS1jb21wcmVzc2VkLCBidXQgaXQncyBub3QKKyAgICAgICAgICogaW1wb3J0YW50IHJpZ2h0IG5vdyAqLworICAgICAgICBhc3NlcnQoY29tcHJlc3Npb25NZXRob2QgPT0gWmlwRW50cnk6OmtDb21wcmVzc0RlZmxhdGVkKTsKKworICAgICAgICBib29sIHNjYW5SZXN1bHQ7CisgICAgICAgIGludCBtZXRob2Q7CisgICAgICAgIGxvbmcgY29tcHJlc3NlZExlbjsKKworICAgICAgICBzY2FuUmVzdWx0ID0gWmlwVXRpbHM6OmV4YW1pbmVHemlwKGlucHV0RnAsICZtZXRob2QsICZ1bmNvbXByZXNzZWRMZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAmY29tcHJlc3NlZExlbiwgJmNyYyk7CisgICAgICAgIGlmICghc2NhblJl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zZWRMZW4sIGVuZFBvc24gLSBzdGFydFBvc24sIGNyYywKKyAgICAgICAgY29tcHJlc3Npb25NZXRob2QpOworICAgIG1vZFdoZW4gPSBnZXRNb2RUaW1lKGlucHV0RnAgPyBmaWxlbm8oaW5wdXRGcCkgOiBmaWxlbm8obVppcEZwKSk7CisgICAgcEVudHJ5LT5zZXRNb2RXaGVuKG1vZFdoZW4pOworICAgIHBFbnRyeS0+c2V0TEZIT2Zmc2V0KGxmaFBvc24pOworICAgIG1FT0NELm1OdW1FbnRyaWVzKys7CisgICAgbUVPQ0QubVRvdGFsTnVtRW50cmllcysrOworICAgIG1FT0NELm1DZW50cmFsRGlyU2l6ZSA9IDA7ICAgICAgLy8gbWFyayBpbnZhbGlkOyBzZXQgYnkgZmx1c2goKQorICAgIG1FT0NELm1DZW50cmFsRGlyT2Zmc2V0ID0gZW5kUG9zbjsKKworICAgIC8qCisgICAgICogR28gYmFjayBhbmQgd3JpdGUgdGhlIExGSC4KKyAgICAgKi8KKyAgICBpZiAoZnNlZWsobVppcEZwLCBsZmhQb3NuLCBTRUVLX1NFVCkgIT0gMCkgeworICAgICAgICByZXN1bHQgPSBVTktOT1dOX0VSUk9SOworICAgICAgICBnb3RvIGJhaWw7CisgICAgfQorICAgIHBFbnRyeS0+bUxGSC53cml0ZShtWmlwRnApOworCisgICAgLyoKKyAgICAgKiBBZGQgcEVudHJ5IHRvIHRoZSBsaXN0LgorICAgICAqLworICAgIG1FbnRyaWVzLmFkZChwRW50cnkpOworICAgIGlmIChwcEVudHJ5ICE9IE5VTEwpCisgICAgICAgICpwcEVudHJ5ID0gcEVudHJ5OworICAgIHBFbnRyeSA9IE5VTEw7CisKK2JhaWw6CisgICAgaWYgKGlucHV0RnAgIT0gTlVMTCkKKyAgICAgICAgZmNsb3NlKGlucHV0RnApOworICAgIGRlbGV0ZSBwRW50cnk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworLyoKKyAqIEFkZCBhbiBlbnRyeSBieSBjb3B5aW5nIGl0IGZyb20gYW5vdGhlciB6aXAgZmlsZS4gIElmICJwYWRkaW5nIiBpcworICogbm9uemVybywgdGhlIHNwZWNpZmllZCBudW1iZXIgb2YgYnl0ZXMgd2lsbCBiZSBhZGRlZCB0byB0aGUgImV4dHJhIgorICogZmllbGQgaW4gdGhlIGhlYWRlci4KKyAqCisgKiBJZiAicHBFbnRyeSIgaXMgbm9uLU5VTEwsIGEgcG9pbnRlciB0byB0aGUgbmV3IGVudHJ5IHdpbGwgYmUgcmV0dXJuZWQuCisgKi8KK3N0YXR1c190IFppcEZpbGU6OmFkZChjb25zdCBaaXBGaWxlKiBwU291cmNlWmlwLCBjb25zdCBaaXBFbnRyeSogcFNvdXJjZUVudHJ5LAorICAgIGludCBwYWRkaW5nLCBaaXBFbnRyeSoqIHBwRW50cnkpCit7CisgICAgWmlwRW50cnkqIHBFbnRyeSA9IE5VTEw7CisgICAgc3RhdHVzX3QgcmVzdWx0OworICAgIGxvbmcgbGZoUG9zbiwgZW5kUG9zbjsKKworICAgIGlmIChtUmVhZE9ubHkpCisgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKKworICAgIC8qIG1ha2Ugc3VyZSB3ZSdyZSBpbiBhIHJlYXNvbmFibGUgc3RhdGUgKi8KKyAgICBhc3NlcnQobVppcEZwICE9IE5VTEwpOworICAgIGFzc2VydChtRW50cmllcy5zaXplKCkgPT0gbUVPQ0QubVRvdGFsTnVtRW50cmllcyk7CisKKyAgICBpZiAoZnNlZWsobVppcEZwLCBtRU9DRC5tQ2VudHJhbERpck9mZnNldCwgU0VFS19TRVQpICE9IDApIHsKKyAgICAgICAgcmVzdWx0ID0gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgZ290byBiYWlsOworICAgIH0KKworICAgIHBFbnRyeSA9IG5ldyBaaXBFbnRyeTsKKyAgICBpZiAocEVudHJ5ID09IE5VTEwpIHsKKyAgICAgICAgcmVzdWx0ID0gTk9fTUVNT1JZOworICAgICAgICBnb3Rv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xlT2Zmc2V0KCksIFNFRUtfU0VUKSAhPSAwKQorICAgIHsKKyAgICAgICAgcmVzdWx0ID0gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgZ290byBiYWlsOworICAgIH0KKworICAgIG9mZl90IGNvcHlMZW47CisgICAgY29weUxlbiA9IHBTb3VyY2VFbnRyeS0+Z2V0Q29tcHJlc3NlZExlbigpOworICAgIGlmICgocFNvdXJjZUVudHJ5LT5tTEZILm1HUEJpdEZsYWcgJiBaaXBFbnRyeTo6a1VzZXNEYXRhRGVzY3IpICE9IDApCisgICAgICAgIGNvcHlMZW4gKz0gWmlwRW50cnk6OmtEYXRhRGVzY3JpcHRvckxlbjsKKworICAgIGlmIChjb3B5UGFydGlhbEZwVG9GcChtWmlwRnAsIHBTb3VyY2VaaXAtPm1aaXBGcCwgY29weUxlbiwgTlVMTCkKKyAgICAgICAgIT0gTk9fRVJST1IpCisgICAgeworICAgICAgICBMT0dXKCJjb3B5IG9mICclcycgZmFpbGVkXG4iLCBwRW50cnktPm1DREUubUZpbGVOYW1lKTsKKyAgICAgICAgcmVzdWx0ID0gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgZ290byBiYWlsOworICAgIH0KKworICAgIC8qCisgICAgICogVXBkYXRlIGZpbGUgb2Zmc2V0cy4KKyAgICAgKi8KKyAgICBlbmRQb3NuID0gZnRlbGwobVppcEZwKTsKKworICAgIC8qCisgICAgICogU3VjY2VzcyEgIEZpbGwgb3V0IG5ldyB2YWx1ZXMuCisgICAgICovCisgICAgcEVudHJ5LT5zZXRMRkhPZmZzZXQobGZoUG9zbik7ICAgICAgLy8gc2V0cyBtQ0RFLm1Mb2NhbEhlYWRlclJlbE9mZnNldAorICAgIG1FT0NELm1OdW1FbnRyaWVzKys7CisgICAgbUVPQ0QubVRvdGFsTnVtRW50cmllcysrOworICAgIG1FT0NELm1DZW50cmFsRGlyU2l6ZSA9IDA7ICAgICAgLy8gbWFyayBpbnZhbGlkOyBzZXQgYnkgZmx1c2goKQorICAgIG1FT0NELm1DZW50cmFsRGlyT2Zmc2V0ID0gZW5kUG9zbjsKKworICAgIC8qCisgICAgICogQWRkIHBFbnRyeSB0byB0aGUgbGlzdC4KKyAgICAgKi8KKyAgICBtRW50cmllcy5hZGQocEVudHJ5KTsKKyAgICBpZiAocHBFbnRyeSAhPSBOVUxMKQorICAgICAgICAqcHBFbnRyeSA9IHBFbnRyeTsKKyAgICBwRW50cnkgPSBOVUxMOworCisgICAgcmVzdWx0ID0gTk9fRVJST1I7CisKK2JhaWw6CisgICAgZGVsZXRlIHBFbnRyeTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCisvKgorICogQ29weSBhbGwgb2YgdGhlIGJ5dGVzIGluICJzcmMiIHRvICJkc3QiLgorICoKKyAqIE9uIGV4aXQsICJzcmNGcCIgd2lsbCBiZSBzZWVrZWQgdG8gdGhlIGVuZCBvZiB0aGUgZmlsZSwgYW5kICJkc3RGcCIKKyAqIHdpbGwgYmUgc2Vla2VkIGltbWVkaWF0ZWx5IHBhc3QgdGhlIGRhdGEuCisgKi8KK3N0YXR1c190IFppcEZpbGU6OmNvcHlGcFRvRnAoRklMRSogZHN0RnAsIEZJTEUqIHNyY0ZwLCB1bnNpZ25lZCBsb25nKiBwQ1JDMzIpCit7CisgICAgdW5zaWduZWQgY2hhciB0bXBCdWZbMzI3NjhdOworICAgIHNpemVfdCBjb3VudDsKKworICAgICpwQ1JDMzIgPSBjcmMzMigwTCwgWl9OVUxMLCAwKTsKKworICAgIHdoaWxlICgxKSB7CisgICAgICAgIGNvdW50ID0gZnJlYWQodG1wQnVmLCAxLCBzaXplb2YodG1wQnVmKSwgc3JjRnApOworICAgICAgICBpZiAoZmVycm9yKHNyY0ZwKSB8fCBmZXJyb3IoZHN0RnApKQorICAgICAgICAgICAgcmV0dXJuIGVycm5vVG9TdGF0dXMoZXJybm8pOworICAgICAgICBpZiAoY291bnQgPT0gMCkKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICpwQ1JDMzIgPSBjcmMzMigqcENSQzMyLCB0bXBCdWYsIGNvdW50KTsKKworICAgICAgICBpZiAoZndyaXRlKHRtcEJ1ZiwgMSwgY291bnQsIGRzdEZwKSAhPSBjb3VudCkgeworICAgICAgICAgICAgTE9HRCgiZndyaXRlICVkIGJ5dGVzIGZhaWxlZFxuIiwgKGludCkgY291bnQpOworICAgICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKKy8qCisgKiBDb3B5IGFsbCBvZiB0aGUgYnl0ZXMgaW4gInNyYyIgdG8gImRzdCIuCisgKgorICogT24gZXhpdCwgImRzdEZwIiB3aWxsIGJlIHNlZWtlZCBpbW1lZGlhdGVseSBwYXN0IHRoZSBkYXRhLgorICovCitzdGF0dXNfdCBaaXBGaWxlOjpjb3B5RGF0YVRvRnAoRklMRSogZHN0RnAsCisgICAgY29uc3Qgdm9pZCogZGF0YSwgc2l6ZV90IHNpemUsIHVuc2lnbmVkIGxvbmcqIHBDUkMzMikKK3sKKyAgICBzaXplX3QgY291bnQ7CisKKyAgICAqcENSQzMyID0gY3JjMzIoMEwsIFpfTlVMTCwgMCk7CisgICAgaWYgKHNpemUgPiAwKSB7CisgICAgICAgICpwQ1JDMzIgPSBjcmMzMigqcENSQzMyLCAoY29uc3QgdW5zaWduZWQgY2hhciopZGF0YSwgc2l6ZSk7CisgICAgICAgIGlmIChmd3JpdGUoZGF0YSwgMSwgc2l6ZSwgZHN0RnApICE9IHNpemUpIHsKKyAgICAgICAgICAgIExPR0QoImZ3cml0ZSAlZCBieXRlcyBmYWlsZWRcbiIsIChpbnQpIHNpemUpOworICAgICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKKy8qCisgKiBDb3B5IHNvbWUgb2YgdGhlIGJ5dGVzIGluICJzcmMiIHRvIC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ICAgICAgaWYgKHplcnIgPT0gWl9WRVJTSU9OX0VSUk9SKSB7CisgICAgICAgICAgICBMT0dFKCJJbnN0YWxsZWQgemxpYiBpcyBub3QgY29tcGF0aWJsZSB3aXRoIGxpbmtlZCB2ZXJzaW9uICglcylcbiIsCisgICAgICAgICAgICAgICAgWkxJQl9WRVJTSU9OKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIExPR0QoIkNhbGwgdG8gZGVmbGF0ZUluaXQyIGZhaWxlZCAoemVycj0lZClcbiIsIHplcnIpOworICAgICAgICB9CisgICAgICAgIGdvdG8gYmFpbDsKKyAgICB9CisKKyAgICBjcmMgPSBjcmMzMigwTCwgWl9OVUxMLCAwKTsKKworICAgIC8qCisgICAgICogTG9vcCB3aGlsZSB3ZSBoYXZlIGRhdGEuCisgICAgICovCisgICAgZG8geworICAgICAgICBzaXplX3QgZ2V0U2l6ZTsKKyAgICAgICAgaW50IGZsdXNoOworCisgICAgICAgIC8qIG9ubHkgcmVhZCBpZiB0aGUgaW5wdXQgYnVmZmVyIGlzIGVtcHR5ICovCisgICAgICAgIGlmICh6c3RyZWFtLmF2YWlsX2luID09IDAgJiYgIWF0RW9mKSB7CisgICAgICAgICAgICBMT0dWKCIrKysgcmVhZGluZyAlZCBieXRlc1xuIiwgKGludClrQnVmU2l6ZSk7CisgICAgICAgICAgICBpZiAoZGF0YSkgeworICAgICAgICAgICAgICAgIGdldFNpemUgPSBzaXplID4ga0J1ZlNpemUgPyBrQnVmU2l6ZSA6IHNpemU7CisgICAgICAgICAgICAgICAgbWVtY3B5KGluQnVmLCBkYXRhLCBnZXRTaXplKTsKKyAgICAgICAgICAgICAgICBkYXRhID0gKChjb25zdCBjaGFyKilkYXRhKSArIGdldFNpemU7CisgICAgICAgICAgICAgICAgc2l6ZSAtPSBnZXRTaXplOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBnZXRTaXplID0gZnJlYWQoaW5CdWYsIDEsIGtCdWZTaXplLCBzcmNGcCk7CisgICAgICAgICAgICAgICAgaWYgKGZlcnJvcihzcmNGcCkpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HRCgiZGVmbGF0ZSByZWFkIGZhaWxlZCAoZXJybm89JWQpXG4iLCBlcnJubyk7CisgICAgICAgICAgICAgICAgICAgIGdvdG8gel9iYWlsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChnZXRTaXplIDwga0J1ZlNpemUpIHsKKyAgICAgICAgICAgICAgICBMT0dWKCIrKysgIGdvdCAlZCBieXRlcywgRU9GIHJlYWNoZWRcbiIsCisgICAgICAgICAgICAgICAgICAgIChpbnQpZ2V0U2l6ZSk7CisgICAgICAgICAgICAgICAgYXRFb2YgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjcmMgPSBjcmMzMihjcmMsIGluQnVmLCBnZXRTaXplKTsKKworICAgICAgICAgICAgenN0cmVhbS5uZXh0X2luID0gaW5CdWY7CisgICAgICAgICAgICB6c3RyZWFtLmF2YWlsX2luID0gZ2V0U2l6ZTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhdEVvZikKKyAgICAgICAgICAgIGZsdXNoID0gWl9GSU5JU0g7ICAgICAgIC8qIHRlbGwgemxpYiB0aGF0IHdlJ3JlIGRvbmUgKi8KKyAgICAgICAgZWxzZQorICAgICAgICAgICAgZmx1c2ggPSBaX05PX0ZMVVNIOyAgICAgLyogbW9yZSB0byBjb21lISAqLworCisgICAgICAgIHplcnIgPSBkZWZsYXRlKCZ6c3RyZWFtLCBmbHVzaCk7CisgICAgICAgIGlmICh6ZXJyICE9IFpfT0sgJiYgemVyciAhPSBaX1NUUkVBTV9FTkQpIHsKKyAgICAgICAgICAgIExPR0QoInpsaWIgZGVmbGF0ZSBjYWxsIGZhaWxlZCAoemVycj0lZClcbiIsIHplcnIpOworICAgICAgICAgICAgcmVzdWx0ID0gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgICAgIGdvdG8gel9iYWlsOworICAgICAgICB9CisKKyAgICAgICAgLyogd3JpdGUgd2hlbiB3ZSdyZSBmdWxsIG9yIHdoZW4gd2UncmUgZG9uZSAqLworICAgICAgICBpZiAoenN0cmVhbS5hdmFpbF9vdXQgPT0gMCB8fAorICAgICAgICAgICAgKHplcnIgPT0gWl9TVFJFQU1fRU5EICYmIHpzdHJlYW0uYXZhaWxfb3V0ICE9ICh1SW50KSBrQnVmU2l6ZSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIExPR1YoIisrKyB3cml0aW5nICVkIGJ5dGVzXG4iLCAoaW50KSAoenN0cmVhbS5uZXh0X291dCAtIG91dEJ1ZikpOworICAgICAgICAgICAgaWYgKGZ3cml0ZShvdXRCdWYsIDEsIHpzdHJlYW0ubmV4dF9vdXQgLSBvdXRCdWYsIGRzdEZwKSAhPQorICAgICAgICAgICAgICAgIChzaXplX3QpKHpzdHJlYW0ubmV4dF9vdXQgLSBvdXRCdWYpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIExPR0QoIndyaXRlICVkIGZhaWxlZCBpbiBkZWZsYXRlXG4iLAorICAgICAgICAgICAgICAgICAgICAoaW50KSAoenN0cmVhbS5uZXh0X291dCAtIG91dEJ1ZikpOworICAgICAgICAgICAgICAgIGdvdG8gel9iYWlsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB6c3RyZWFtLm5leHRfb3V0ID0gb3V0QnVmOworICAgICAgICAgICAgenN0cmVhbS5hdmFpbF9vdXQgPSBrQnVmU2l6ZTsKKyAgICAgICAgfQorICAgIH0gd2hpbGUgKHplcnIgPT0gWl9PSyk7CisKKyAgICBhc3NlcnQoemVyciA9PSBaX1NUUkVBTV9FTkQpOyAgICAgICAvKiBvdGhlciBlcnJvcnMgc2hvdWxkJ3ZlIGJlZW4gY2F1Z2h0ICovCisKKyAgICAqcENSQzMyID0gY3JjOworCit6X2JhaWw6CisgICAgZGVmbGF0ZUVuZCgmenN0cmVhb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nRyaWVzLCBhbmQgd3JpdGUgdGhlCisgKiBDZW50cmFsIERpcmVjdG9yeSBhbmQgRU9DRCBpZiB3ZSBoYXZlIHN0b21wZWQgb24gdGhlbS4KKyAqLworc3RhdHVzX3QgWmlwRmlsZTo6Zmx1c2godm9pZCkKK3sKKyAgICBzdGF0dXNfdCByZXN1bHQgPSBOT19FUlJPUjsKKyAgICBsb25nIGVvY2RQb3NuOworICAgIGludCBpLCBjb3VudDsKKworICAgIGlmIChtUmVhZE9ubHkpCisgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKKyAgICBpZiAoIW1OZWVkQ0RSZXdyaXRlKQorICAgICAgICByZXR1cm4gTk9fRVJST1I7CisKKyAgICBhc3NlcnQobVppcEZwICE9IE5VTEwpOworCisgICAgcmVzdWx0ID0gY3J1bmNoQXJjaGl2ZSgpOworICAgIGlmIChyZXN1bHQgIT0gTk9fRVJST1IpCisgICAgICAgIHJldHVybiByZXN1bHQ7CisKKyAgICBpZiAoZnNlZWsobVppcEZwLCBtRU9DRC5tQ2VudHJhbERpck9mZnNldCwgU0VFS19TRVQpICE9IDApCisgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworCisgICAgY291bnQgPSBtRW50cmllcy5zaXplKCk7CisgICAgZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgWmlwRW50cnkqIHBFbnRyeSA9IG1FbnRyaWVzW2ldOworICAgICAgICBwRW50cnktPm1DREUud3JpdGUobVppcEZwKTsKKyAgICB9CisKKyAgICBlb2NkUG9zbiA9IGZ0ZWxsKG1aaXBGcCk7CisgICAgbUVPQ0QubUNlbnRyYWxEaXJTaXplID0gZW9jZFBvc24gLSBtRU9DRC5tQ2VudHJhbERpck9mZnNldDsKKworICAgIG1FT0NELndyaXRlKG1aaXBGcCk7CisKKyAgICAvKgorICAgICAqIElmIHdlIGhhZCBzb21lIHN0dWZmIGJsb2F0IHVwIGR1cmluZyBjb21wcmVzc2lvbiB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ICAgICAgICogb2YgdGhlIG5leHQgZW50cnkuICBEaXJlY3RvcnkgZW50cmllcyBkb24ndCBoYXZlCisgICAgICAgICAgICAgKiBmaWxlIG9mZnNldHMsIHNvIHdlIG5lZWQgdG8gZmluZCB0aGUgbmV4dCBub24tZGlyZWN0b3J5CisgICAgICAgICAgICAgKiBlbnRyeS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbmV4dE9mZnNldCA9IDA7CisgICAgICAgICAgICBmb3IgKGludCBpaSA9IGkrMTsgbmV4dE9mZnNldCA9PSAwICYmIGlpIDwgY291bnQ7IGlpKyspCisgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG1FbnRyaWVzW2lpXS0+Z2V0TEZIT2Zmc2V0KCk7CisgICAgICAgICAgICBpZiAobmV4dE9mZnNldCA9PSAwKQorICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBtRU9DRC5tQ2VudHJhbERpck9mZnNldDsKKyAgICAgICAgICAgIHNwYW4gPSBuZXh0T2Zmc2V0IC0gcEVudHJ5LT5nZXRMRkhPZmZzZXQoKTsKKworICAgICAgICAgICAgYXNzZXJ0KHNwYW4gPj0gWmlwRW50cnk6OkxvY2FsRmlsZUhlYWRlcjo6a0xGSExlbik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvKiBUaGlzIGlzIGEgZGlyZWN0b3J5IGVudHJ5LiAgSXQgZG9lc24ndCBoYXZlCisgICAgICAgICAgICAgKiBhbnkgYWN0dWFsIGZpbGUgY29udGVudHMsIHNvIHRoZXJlJ3Mgbm8gbmVlZCB0bworICAgICAgICAgICAgICogbW92ZSBhbnl0aGluZy4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgc3BhbiA9IDA7CisgICAgICAgIH0KKworICAgICAgICAvL3ByaW50ZigiKysrICVkOiBvZmY9JWxkIHNwYW49JWxkIGRlbD0lZCBbY291bnQ9JWRdXG4iLAorICAgICAgICAvLyAgICBpLCBwRW50cnktPmdldExGSE9mZnNldCgpLCBzcGFuLCBwRW50cnktPmdldERlbGV0ZWQoKSwgY291bnQpOworCisgICAgICAgIGlmIChwRW50cnktPmdldERlbGV0ZWQoKSkgeworICAgICAgICAgICAgYWRqdXN0ICs9IHNwYW47CisgICAgICAgICAgICBkZWxDb3VudCsrOworCisgICAgICAgICAgICBkZWxldGUgcEVudHJ5OworICAgICAgICAgICAgbUVudHJpZXMucmVtb3ZlQXQoaSk7CisKKyAgICAgICAgICAgIC8qIGFkanVzdCBsb29wIGNvbnRyb2wgKi8KKyAgICAgICAgICAgIGNvdW50LS07CisgICAgICAgICAgICBpLS07CisgICAgICAgIH0gZWxzZSBpZiAoc3BhbiAhPSAwICYmIGFkanVzdCA+IDApIHsKKyAgICAgICAgICAgIC8qIHNodWZmbGUgdGhpcyBlbnRyeSBiYWNrICovCisgICAgICAgICAgICAvL3ByaW50ZigiKysrIFNodWZmbGluZyAnJXMnIGJhY2sgJWxkXG4iLAorICAgICAgICAgICAgLy8gICAgcEVudHJ5LT5nZXRGaWxlTmFtZSgpLCBhZGp1c3QpOworICAgICAgICAgICAgcmVzdWx0ID0gZmlsZW1vdmUobVppcEZwLCBwRW50cnktPmdldExGSE9mZnNldCgpIC0gYWRqdXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgcEVudHJ5LT5nZXRMRkhPZmZzZXQoKSwgc3Bhbik7CisgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE5PX0VSUk9SKSB7CisgICAgICAgICAgICAgICAgLyogdGhpcyBpcyB3aHkgeW91IHVzZSBhIHRlbXAgZmlsZSAqLworICAgICAgICAgICAgICAgIExPR0UoImVycm9yIGR1cmluZyBjcnVuY2ggLSBhcmNoaXZlIGlzIHRvYXN0XG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwRW50cnktPnNldExGSE9mZnNldChwRW50cnktPmdldExGSE9mZnNldCgpIC0gYWRqdXN0KTsKKyAgICAgICA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AhPSAwKSB7CisgICAgICAgICAgICBzaXplX3QgZ2V0U2l6ZSA9IHNpemVvZihyZWFkQnVmKTsKKyAgICAgICAgICAgIGlmIChnZXRTaXplID4gbikKKyAgICAgICAgICAgICAgICBnZXRTaXplID0gbjsKKworICAgICAgICAgICAgaWYgKGZzZWVrKGZwLCAobG9uZykgc3JjLCBTRUVLX1NFVCkgIT0gMCkgeworICAgICAgICAgICAgICAgIExPR0QoImZpbGVtb3ZlIHNyYyBzZWVrICVsZCBmYWlsZWRcbiIsIChsb25nKSBzcmMpOworICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZnJlYWQocmVhZEJ1ZiwgMSwgZ2V0U2l6ZSwgZnApICE9IGdldFNpemUpIHsKKyAgICAgICAgICAgICAgICBMT0dEKCJmaWxlbW92ZSByZWFkICVsZCBvZmY9JWxkIGZhaWxlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgKGxvbmcpIGdldFNpemUsIChsb25nKSBzcmMpOworICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZnNlZWsoZnAsIChsb25nKSBkc3QsIFNFRUtfU0VUKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgTE9HRCgiZmlsZW1vdmUgZHN0IHNlZWsgJWxkIGZhaWxlZFxuIiwgKGxvbmcpIGRzdCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmd3JpdGUocmVhZEJ1ZiwgMSwgZ2V0U2l6ZSwgZnApICE9IGdldFNpemUpIHsKKyAgICAgICAgICAgICAgICBMT0dEKCJmaWxlbW92ZSB3cml0ZSAlbGQgb2ZmPSVsZCBmYWlsZWRcbiIsCisgICAgICAgICAgICAgICAgICAgIChsb25nKSBnZXRTaXplLCAobG9uZykgZHN0KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3JjICs9IGdldFNpemU7CisgICAgICAgICAgICBkc3QgKz0gZ2V0U2l6ZTsKKyAgICAgICAgICAgIG4gLT0gZ2V0U2l6ZTsKKyAgICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICAgIC8qIHNoaWZ0IHN0dWZmIHRvd2FyZCBlbmQgb2YgZmlsZTsgbXVzdCByZWFkIGZyb20gZW5kICovCisgICAgICAgIGFzc2VydChmYWxzZSk7ICAgICAgLy8gd3JpdGUgdGhpcyBzb21lZGF5LCBtYXliZQorICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKKyAgICB9CisKKyAgICByZXR1cm4gTk9fRVJST1I7Cit9CisKKworLyoKKyAqIEdldCB0aGUgbW9kaWZpY2F0aW9uIHRpbWUgZnJvbSBhIGZpbGUgZGVzY3JpcHRvci4KKyAqLwordGltZV90IFppcEZpbGU6OmdldE1vZFRpbWUoaW50IGZkKQoreworICAgIHN0cnVjdCBzdGF0IHNiOworCisgICAgaWYgKGZzdGF0KGZkLCAmc2IpIDwgMCkgeworICAgICAgICBMT0dEKCJIRVk6IGZzdGF0IG9uIGZkICVkIGZhaWxlZFxuIiwgZmQpOworICAgICAgICByZXR1cm4gKHRpbWVfdCkgLTE7CisgICAgfQorCisgICAgcmV0dXJuIHNiLnN0X210aW1lOworfQorCisKKyNpZiAwICAgICAgIC8qIHRoaXMgaXMgYSBiYWQgaWRlYSAqLworLyoKKyAqIEdldCBhIGNvcHkgb2YgdGhlIFppcCBmaWxlIGRlc2NyaXB0b3IuCisgKgorICogV2UgZG9uJ3QgYWxsb3cgdGhpcyBpZiB0aGUgZmlsZSB3YXMgb3BlbmVkIHJlYWQtd3JpdGUgYmVjYXVzZSB3ZSB0ZW5kCisgKiB0byBsZWF2ZSB0aGUgZmlsZSBjb250ZW50cyBpbiBhbiB1bmNlcnRhaW4gc3RhdGUgYmV0d2VlbiBjYWxscyB0bworICogZmx1c2goKS4gIFRoZSBkdXBsaWNhdGVkIGZpbGUgZGVzY3JpcHRvciBzaG91bGQgb25seSBiZSB2YWxpZCBmb3IgcmVhZHMuCisgKi8KK2ludCBaaXBGaWxlOjpnZXRaaXBGZCh2b2lkKSBjb25zdAoreworICAgIGlmICghbVJlYWRPbmx5KQorICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047CisgICAgYXNzZXJ0KG1aaXBGcCAhPSBOVUxMKTsKKworICAgIGludCBmZDsKKyAgICBmZCA9IGR1cChmaWxlbm8obVppcEZwKSk7CisgICAgaWYgKGZkIDwgMCkgeworICAgICAgICBMT0dEKCJkaWRuJ3Qgd29yaywgZXJybm89JWRcbiIsIGVycm5vKTsKKyAgICB9CisKKyAgICByZXR1cm4gZmQ7Cit9CisjZW5kaWYKKworCisjaWYgMAorLyoKKyAqIEV4cGFuZCBkYXRhLgorICovCitib29sIFppcEZpbGU6OnVuY29tcHJlc3MoY29uc3QgWmlwRW50cnkqIHBFbnRyeSwgdm9pZCogYnVmKSBjb25zdAoreworICAgIHJldHVybiBmYWxzZTsKK30KKyNlbmRpZgorCisvLyBmcmVlIHRoZSBtZW1vcnkgd2hlbiB5b3UncmUgZG9uZQordm9pZCogWmlwRmlsZTo6dW5jb21wcmVzcyhjb25zdCBaaXBFbnRyeSogZW50cnkpCit7CisgICAgc2l6ZV90IHVubGVuID0gZW50cnktPmdldFVuY29tcHJlc3NlZExlbigpOworICAgIHNpemVfdCBjbGVuID0gZW50cnktPmdldENvbXByZXNzZWRMZW4oKTsKKworICAgIHZvaWQqIGJ1ZiA9IG1hbGxvYyh1bmxlbik7CisgICAgaWYgKGJ1ZiA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGZzZWVrKG1aaXBGcCwgMCwgU0VFS19TRVQpOworCisgICAgb2ZmX3Qgb2Zmc2V0ID0gZW50cnktPmdldEZpbGVPZmZzZXQoKTsKKyAgICBpZiAoZnNlZWsobVppcEZwLCBvZmZzZXQsIFNFRUtfU0VUKSAhPSAwKSB7CisgICAgICAgIGdvdG8gYmFpbDsKKyAgICB9CisKKyAgICBzd2l0Y2ggKGVudHJ5LT5nZXRDb21wcmVzc2lvbk1ldGhvZCgpKQorICAgIHsKKyAgICAgICAgY2FzZSBaaXBFbnRyeTo6a0NvbXByZXNzU3RvcmVkOiB7CisgICAgICAgICAgICBzc2l6ZV90IGFtdCA9IGZyZWFkKGJ1ZiwgMSwgdW5sZW4sIG1aaXBGcCk7CisgICAgICAgICAgICBpZiAoYW10ICE9IChzc2l6ZV90KXVubGVuKSB7CisgICAgICAgICAgICAgICAgZ290byBiYWlsOworICAgICAgICAgICAgfQorI2lmIDAKKyAgICAgICAgICAgIHByaW50ZigiZGF0YS4uLlxuIik7CisgICAgICAgICAgICBjb25zdCB1bnNpZ25lZCBjaGFyKiBwID0gKHVuc2lnbmVkIGNoYXIqKWJ1ZjsKKyAgICAgICAgICAgIGNvbnN0IHVuc2lnbmVkIGNoYXIqIGVuZCA9IHArdW5sZW47CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8MzIgJiYgcCA8IGVuZDsgaSsrKSB7CisgICAgICAgICAgICAgICAgcHJpbnRmKCIweCUwOHggIiwgKGludCkob2Zmc2V0KyhpKjB4MTApKSk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaj0wOyBqPDB4MTAgJiYgcCA8IGVuZDsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICUwMngiLCAqcCk7CisgICAgICAgICAgICAgICAgICAgIHArKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcHJpbnRmKCJcbiIpOworICAgICAgICAgICAgfQorI2VuZGlmCisKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFppcEVudHJ5OjprQ29tcHJlc3NEZWZsYXRlZDogeworICAgICAgICAgICAgaWYgKCFaaXBVdGlsczo6aW5mbGF0ZVRvQnVmZmVyKG1aaXBGcCwgYnVmLCB1bmxlbiwgY2xlbikpIHsKKyAgICAgICAgICAgICAgICBnb3RvIGJhaWw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGdvdG8gYmFpbDsKKyAgICB9CisgICAgcmV0dXJuIGJ1ZjsKKworYmFpbDoKKyAgICBmcmVlKGJ1Zik7CisgICAgcmV0dXJuIE5VTEw7Cit9CisKKworLyoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogICAgICBaaXBGaWxlOjpFbmRPZkNlbnRyYWxEaXIKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCisKKy8qCisgKiBSZWFkIHRoZSBlbmQtb2YtY2VudHJhbC1kaXIgZmllbGRzLgorICoKKyAqICJidWYiIHNob3VsZCBiZSBwb3NpdGlvbmVkIGF0IHRoZSBFT0NEIHNpZ25hdHVyZSwgYW5kIHNob3VsZCBjb250YWluCisgKiB0aGUgZW50aXJlIEVPQ0QgYXJlYSBpbmNsdWRpbmcgdGhlIGNvbW1lbnQuCisgKi8KK3N0YXR1c190IFppcEZpbGU6OkVuZE9mQ2VudHJhbERpcjo6cmVhZEJ1Zihjb25zdCB1bnNpZ25lZCBjaGFyKiBidWYsIGludCBsZW4pCit7CisgICAgLyogZG9uJ3QgYWxsb3cgcmUtdXNlICovCisgICAgYXNzZXJ0KG1Db21tZW50ID09IE5VTEwpOworCisgICAgaWYgKGxlbiA8IGtFT0NETGVuKSB7CisgICAgICAgIC8qIGxvb2tzIGxpa2UgWklQIGZpbGUgZ290IHRydW5jYXRlZCAqLworICAgICAgICB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odm9pZCkgeworICAgICAgICBpZiAoIW1SZWFkT25seSkKKyAgICAgICAgICAgIGZsdXNoKCk7CisgICAgICAgIGlmIChtWmlwRnAgIT0gTlVMTCkKKyAgICAgICAgICAgIGZjbG9zZShtWmlwRnApOworICAgICAgICBkaXNjYXJkRW50cmllcygpOworICAgIH0KKworICAgIC8qCisgICAgICogT3BlbiBhIG5ldyBvciBleGlzdGluZyBhcmNoaXZlLgorICAgICAqLworICAgIHR5cGVkZWYgZW51bSB7CisgICAgICAgIGtPcGVuUmVhZE9ubHkgICA9IDB4MDEsCisgICAgICAgIGtPcGVuUmVhZFdyaXRlICA9IDB4MDIsCisgICAgICAgIGtPcGVuQ3JlYXRlICAgICA9IDB4MDQsICAgICAvLyBjcmVhdGUgaWYgaXQgZG9lc24ndCBleGlzdAorICAgICAgICBrT3BlblRydW5jYXRlICAgPSAweDA4LCAgICAgLy8gaWYgaXQgZXhpc3RzLCBlbXB0eSBpdAorICAgIH07CisgICAgc3RhdHVzX3Qgb3Blbihjb25zdCBjaGFyKiB6aXBGaWxlTmFtZSwgaW50IGZsYWdzKTsKKworICAgIC8qCisgICAgICogQWRkIGEgZmlsZSB0byB0aGUgZW5kIG9mIHRoZSBhcmNoaXZlLiAgU3BlY2lmeSB3aGV0aGVyIHlvdSB3YW50IHRoZQorICAgICAqIGxpYnJhcnkgdG8gdHJ5IHRvIHN0b3JlIGl0IGNvbXByZXNzZWQuCisgICAgICoKKyAgICAgKiBJZiAic3RvcmFnZU5hbWUiIGlzIHNwZWNpZmllZCwgdGhlIGFyY2hpdmUgd2lsbCB1c2UgdGhhdCBpbnN0ZWFkCisgICAgICogb2YgImZpbGVOYW1lIi4KKyAgICAgKgorICAgICAqIElmIHRoZXJlIGlzIGFscmVhZHkgYW4gZW50cnkgd2l0aCB0aGUgc2FtZSBuYW1lLCB0aGUgY2FsbCBmYWlscy4KKyAgICAgKiBFeGlzdGluZyBlbnRyaWVzIHdpdGggdGhlIHNhbWUgbmFtZSBtdXN0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EVudHJ5KQorICAgIHsKKyAgICAgICAgcmV0dXJuIGFkZENvbW1vbihmaWxlTmFtZSwgTlVMTCwgMCwgc3RvcmFnZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgWmlwRW50cnk6OmtDb21wcmVzc0RlZmxhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgIFppcEVudHJ5OjprQ29tcHJlc3NEZWZsYXRlZCwgcHBFbnRyeSk7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBBZGQgYSBmaWxlIGZyb20gYW4gaW4tbWVtb3J5IGRhdGEgYnVmZmVyLgorICAgICAqCisgICAgICogSWYgInBwRW50cnkiIGlzIG5vbi1OVUxMLCBhIHBvaW50ZXIgdG8gdGhlIG5ldyBlbnRyeSB3aWxsIGJlIHJldHVybmVkLgorICAgICAqLworICAgIHN0YXR1c190IGFkZChjb25zdCB2b2lkKiBkYXRhLCBzaXplX3Qgc2l6ZSwgY29uc3QgY2hhciogc3RvcmFnZU5hbWUsCisgICAgICAgIGludCBjb21wcmVzc2lvbk1ldGhvZCwgWmlwRW50cnkqKiBwcEVudHJ5KQorICAgIHsKKyAgICAgICAgcmV0dXJuIGFkZENvbW1vbihOVUxMLCBkYXRhLCBzaXplLCBzdG9yYWdlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBaaXBFbnRyeTo6a0NvbXByZXNzU3RvcmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXByZXNzaW9uTWV0aG9kLCBwcEVudHJ5KTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIEFkZCBhbiBlbnRyeSBieSBjb3B5aW5nIGl0IGZyb20gYW5vdGhlciB6aXAgZmlsZS4gIElmICJwYWRkaW5nIiBpcworICAgICAqIG5vbnplcm8sIHRoZSBzcGVjaWZpZWQgbnVtYmVyIG9mIGJ5dGVzIHdpbGwgYmUgYWRkZWQgdG8gdGhlICJleHRyYSIKKyAgICAgKiBmaWVsZCBpbiB0aGUgaGVhZGVyLg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uY29tcHJlc3MoY29uc3QgWmlwRW50cnkqIHBFbnRyeSwgdm9pZCogYnVmKSBjb25zdDsKKyAgICAvL2Jvb2wgdW5jb21wcmVzcyhjb25zdCBaaXBFbnRyeSogcEVudHJ5LCBGSUxFKiBmcCkgY29uc3Q7CisgICAgdm9pZCogdW5jb21wcmVzcyhjb25zdCBaaXBFbnRyeSogcEVudHJ5KTsKKworICAgIC8qCisgICAgICogR2V0IGFuIGVudHJ5LCBieSBuYW1lLiAgUmV0dXJucyBOVUxMIGlmIG5vdCBmb3VuZC4KKyAgICAgKgorICAgICAqIERvZXMgbm90IHJldHVybiBlbnRyaWVzIHBlbmRpbmcgZGVsZXRpb24uCisgICAgICovCisgICAgWmlwRW50cnkqIGdldEVudHJ5QnlOYW1lKGNvbnN0IGNoYXIqIGZpbGVOYW1lKSBjb25zdDsKKworICAgIC8qCisgICAgICogR2V0IHRoZSBOdGggZW50cnkgaW4gdGhlIGFyY2hpdmUuCisgICAgICoKKyAgICAgKiBUaGlzIHdpbGwgcmV0dXJuIGFuIGVudHJ5IHRoYXQgaXMgcGVuZGluZyBkZWxldGlvbi4KKyAgICAgKi8KKyAgICBpbnQgZ2V0TnVtRW50cmllcyh2b2lkKSBjb25zdCB7IHJldHVybiBtRW50cmllcy5zaXplKCk7IH0KKyAgICBaaXBFbnRyeSogZ2V0RW50cnlCeUluZGV4KGludCBpZHgpIGNvbnN0OworCitwcml2YXRlOgorICAgIC8qIHRoZXNlIGFyZSBwcml2YXRlIGFuZCBub3QgZGVmaW5lZCAqLworICAgIFppcEZpbGUoY29uc3QgWmlwRmlsZSYgc3JjKTsKKyAgICBaaXBGaWxlJiBvcGVyYXRvcj0oY29uc3QgWmlwRmlsZSYgc3JjKTsKKworICAgIGNsYXNzIEVuZE9mQ2VudHJhbERpciB7CisgICAgcHVibGljOgorICAgICAgICBFbmRPZkNlbnRyYWxEaXIodm9pZCkgOgorICAgICAgICAgICAgbURpc2tOdW1iZXIoMCksCisgICAgICAgICAgICBtRGlza1dpdGhDZW50cmFsRGlyKDApLAorICAgICAgICAgICAgbU51bUVudHJpZXMoMCksCisgICAgICAgICAgICBtVG90YWxOdW1FbnRyaWVzKDApLAorICAgICAgICAgICAgbUNlbnRyYWxEaXJTaXplKDApLAorICAgICAgICAgICAgbUNlbnRyYWxEaXJPZmZzZXQoMCksCisgICAgICAgICAgICBtQ29tbWVudExlbigwKSwKKyAgICAgICAgICAgIG1Db21tZW50KE5VTEwpCisgICAgICAgICAgICB7fQorICAgICAgICB2aXJ0dWFsIH5FbmRPZkNlbnRyYWxEaXIodm9pZCkgeworICAgICAgICAgICAgZGVsZXRlW10gbUNvbW1lbnQ7CisgICAgICAgIH0KKworICAgICAgICBzdGF0dXNfdCByZWFkQnVmKGNvbnN0IHVuc2lnbmVkIGNoYXIqIGJ1ZiwgaW50IGxlbik7CisgICAgICAgIHN0YXR1c190IHdyaXRlKEZJTEUqIGZwKTsKKworICAgICAgICAvL3Vuc2lnbmVkIGxvbmcgICBtU2lnbmF0dXJlOworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbURpc2tOdW1iZXI7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICBtRGlza1dpdGhDZW50cmFsRGlyOworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbU51bUVudHJpZXM7CisgICAgICAgIHVuc2lnbmVkIHNob3J0ICBtVG90YWxOdW1FbnRyaWVzOworICAgICAgICB1bnNpZ25lZCBsb25nICAgbUNlbnRyYWxEaXJTaXplOworICAgICAgICB1bnNpZ25lZCBsb25nICAgbUNlbnRyYWxEaXJPZmZzZXQ7ICAgICAgLy8gb2Zmc2V0IGZyb20gZmlyc3QgZGlzaworICAgICAgICB1bnNpZ25lZCBzaG9ydCAgbUNvbW1lbnRMZW47CisgICAgICAgIHVuc2lnbmVkIGNoYXIqICBtQ29tbWVudDsKKworICAgICAgICBlbnVtIHsKKyAgICAgICAgICAgIGtTaWduYXR1cmUgICAgICA9IDB4MDYwNTRiNTAsCisgICAgICAgICAgICBrRU9DRExlbiAgICAgICAgPSAyMiwgICAgICAgLy8gRW5kT2ZDZW50cmFsRGlyIGxlbiwgZXhjbC4gY29tbWVudAorCisgICAgICAgICAgICBrTWF4Q29tbWVudExlbiAgPSA2NTUzNSwgICAgLy8gbG9uZ2VzdCBwb3NzaWJsZSBpbiB1c2hvcnQKKyAgICAgICAgICAgIGtNYXhFT0NEU2VhcmNoICA9IGtNYXhDb21tZW50TGVuICsgRW5kT2ZDZW50cmFsRGlyOjprRU9DRExlbiwKKworICAgICAgICB9OworCisgICAgICAgIHZvaWQgZHVtcCh2b2lkKSBjb25zdDsKKyAgICB9OworCisKKyAgICAvKiByZWFkIGFsbCBlbnRyaWVzIGluIHRoZSBjZW50cmFsIGRpciAqLworICAgIHN0YXR1c190IHJlYWRDZW50cmFsRGlyKHZvaWQpOworCisgICAgLyogY3J1bmNoIGRlbGV0ZWQgZW50cmllcyBvdXQgKi8KKyAgICBzdGF0dXNfdCBjcnVuY2hBcmNoaXZlKHZvaWQpOworCisgICAgLyogY2xlYW4gdXAgbUVudHJpZXMgKi8KKyAgICB2b2lkIGRpc2NhcmRFbnRyaWVzKHZvaWQpOworCisgICAgLyogY29tbW9uIGhhbmRsZXIgZm9yIGFsbCAiYWRkIiBmdW5jdGlvbnMgKi8KKyAgICBzdGF0dXNfdCBhZGRDb21tb24oY29uc3QgY2hhciogZmlsZU5hbWUsIGNvbnN0IHZvaWQqIGRhdGEsIHNpemVfdCBzaXplLAorICAgICAgICBjb25zdCBjaGFyKiBzdG9yYWdlTmFtZSwgaW50IHNvdXJjZVR5cGUsIGludCBjb21wcmVzc2lvbk1ldGhvZCwKKyAgICAgICAgWmlwRW50cnkqKiBwcEVudHJ5KTsKKworICAgIC8qIGNvcHkgYWxsIG9mICJzcmNGcCIgaW50byAiZHN0RnAiICovCisgICAgc3RhdHVzX3QgY29weUZwVG9GcChGSUxFKiBkc3RGcCwgRklMRSogc3JjRnAsIHVuc2lnbmVkIGxvbmcqIHB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yc2VyLCBqYXZhLmxhbmcuT2JqZWN0LCBpbnQsIGludCwgaW50LCBmbG9hdCwgZmxvYXQsIGphdmEubGFuZy5TdHJpbmcsIGJvb2xlYW4sIGphdmEudXRpbC5NYXAsIGphdmEudXRpbC5NYXAsIGNvbS5hbmRyb2lkLmxheW91dGxpYi5hcGkuSVByb2plY3RDYWxsYmFjaywgY29tLmFuZHJvaWQubGF5b3V0bGliLmFwaS5JTGF5b3V0TG9nKQogICAgICAqLwpAQCAtMzIxLDYgKzMyMiwyMyBAQAogICAgICAgICAgICAgTWFwPFN0cmluZywgTWFwPFN0cmluZywgSVJlc291cmNlVmFsdWU+PiBwcm9qZWN0UmVzb3VyY2VzLAogICAgICAgICAgICAgTWFwPFN0cmluZywgTWFwPFN0cmluZywgSVJlc291cmNlVmFsdWU+PiBmcmFtZXdvcmtSZXNvdXJjZXMsCiAgICAgICAgICAgICBJUHJvamVjdENhbGxiYWNrIGN1c3RvbVZpZXdMb2FkZXIsIElMYXlvdXRMb2cgbG9nZ2VyKSB7CisgICAgICAgIHJldHVybiBjb21wdXRlTGF5b3V0KGxheW91dERlc2NyaXB0aW9uLCBwcm9qZWN0S2V5LAorICAgICAgICAgICAgICAgIHNjcmVlbldpZHRoLCBzY3JlZW5IZWlnaHQsIGZhbHNlIC8qIHJlbmRlckZ1bGxTaXplICovLAorICAgICAgICAgICAgICAgIGRlbnNpdHksIHhkcGksIHlkcGksIHRoZW1lTmFtZSwgaXNQcm9qZWN0VGhlbWUsCisgICAgICAgICAgICAgICAgcHJvamVjdFJlc291cmNlcywgZnJhbWV3b3JrUmVzb3VyY2VzLCBjdXN0b21WaWV3TG9hZGVyLCBsb2dnZXIpOworICAgIH0KKworICAgIC8qCisgICAgICogKG5vbi1KYXZhZG9jKQorICAgICAqIEBzZWUgY29tLmFuZHJvaWQubGF5b3V0bGliLmFwaS5JTGF5b3V0QnJpZGdlI2NvbXB1dGVMYXlvdXQoY29tLmFuZHJvaWQubGF5b3V0bGliLmFwa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dpZHRoID0gcm9vdC5nZXRDaGlsZEF0KDApLmdldE1lYXN1cmVkV2lkdGgoKTsKKyAgICAgICAgICAgICAgICBpZiAobmVlZGVkV2lkdGggPiBzY3JlZW5XaWR0aCkgeworICAgICAgICAgICAgICAgICAgICBzY3JlZW5XaWR0aCA9IG5lZWRlZFdpZHRoOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGludCBuZWVkZWRIZWlnaHQgPSByb290LmdldENoaWxkQXQoMCkuZ2V0TWVhc3VyZWRIZWlnaHQoKTsKKyAgICAgICAgICAgICAgICBpZiAobmVlZGVkSGVpZ2h0ID4gc2NyZWVuSGVpZ2h0IC0gc2NyZWVuT2Zmc2V0KSB7CisgICAgICAgICAgICAgICAgICAgIHNjcmVlbkhlaWdodCA9IG5lZWRlZEhlaWdodCArIHNjcmVlbk9mZnNldDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIHJlbWVhc3VyZSB3aXRoIG9ubHkgdGhlIHNpemUgd2UgbmVlZAorICAgICAgICAgICAgLy8gVGhpcyBtdXN0IGFsd2F5cyBiZSBkb25lIGJlZm9yZSB0aGUgY2FsbCB0byBsYXlvdXQKKyAgICAgICAgICAgIHdfc3BlYyA9IE1lYXN1cmVTcGVjLm1ha2VNZWFzdXJlU3BlYyhzY3JlZW5XaWR0aCwgTWVhc3VyZVNwZWMuRVhBQ1RMWSk7CisgICAgICAgICAgICBoX3NwZWMgPSBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoc2NyZWVuSGVpZ2h0IC0gc2NyZWVuT2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICBNZWFzdXJlU3BlYy5FWEFDVExZKTsKICAgICAgICAgICAgIHZpZXcubWVhc3VyZSh3X3NwZWMsIGhfc3BlYyk7CisKKyAgICAgICAgICAgIC8vIG5vdyBkbyB0aGUgbGF5b3V0LgogICAgICAgICAgICAgdmlldy5sYXlvdXQoMCwgc2NyZWVuT2Zmc2V0LCBzY3JlZW5XaWR0aCwgc2NyZWVuSGVpZ2h0KTsKIAotICAgICAgICAgICAgLy8gZHJhdyB0aGVtCisgICAgICAgICAgICAvLyBkcmF3IHRoZSB2aWV3cwogICAgICAgICAgICAgQ2FudmFzIGNhbnZhcyA9IG5ldyBDYW52YXMoc2NyZWVuV2lkdGgsIHNjcmVlbkhlaWdodCAtIHNjcmVlbk9mZnNldCwgbG9nZ2VyKTsKIAogICAgICAgICAgICAgcm9vdC5kcmF3KGNhbnZhcyk7CkBAIC0xMDE0LDYgKzEwNTYsMTAgQEAKICAgICAgICAgICAgIC8vIHBhc3MgZm9yIG5vdy4KICAgICAgICAgfQogCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFdhbGxwYXBlclBvc2l0aW9uKElCaW5kZXIgd2luZG93LCBmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgICAgICAvLyBwYXNzIGZvciBub3cuCisgICAgICAgIH0KKwogICAgICAgICBwdWJsaWMgSUJpbmRlciBhc0JpbmRlcigpIHsKICAgICAgICAgICAgIC8vIHBhc3MgZm9yIG5vdy4KICAgICAgICAgICAgIHJldHVybiBudWxsOwpAQCAtMTA0MSwxMiArMTA4NywxMiBAQAogICAgICAgICB9CiAKICAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIpCi0gICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoUG9pbnRlcihNb3Rpb25FdmVudCBhcmcwLCBsb25nIGFyZzEpIHRocm93cyBSZW1vdGVFeGNlcHRpb24geworICAgICAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaFBvaW50ZXIoTW90aW9uRXZlbnQgYXJnMCwgbG9uZyBhcmcxLCBib29sZWFuIGFyZzIpIHRocm93cyBSZW1vdGVFeGNlcHRpb24gewogICAgICAgICAgICAgLy8gcGFzcyBmb3Igbm93LgogICAgICAgICB9CiAKICAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoInVudXNlZCIp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dWV0b290aEEyZHAubGlzdENvbm5lY3RlZFNpbmtzKCk7CisgICAgICAgIFNldDxCbHVldG9vdGhEZXZpY2U+IGNvbm5lY3RlZCA9IG1CbHVldG9vdGhBMmRwLmdldENvbm5lY3RlZFNpbmtzKCk7CiAKLSAgICAgICAgZm9yIChTdHJpbmcgYWRkcmVzcyA6IGNvbm5lY3RlZCkgewotICAgICAgICAgICAgaWYgKG1CbHVldG9vdGhBMmRwLmdldFNpbmtTdGF0ZShhZGRyZXNzKSA9PSBCbHVldG9vdGhBMmRwLlNUQVRFX1BMQVlJTkcpIHsKKyAgICAgICAgZm9yIChCbHVldG9vdGhEZXZpY2UgZGV2aWNlIDogY29ubmVjdGVkKSB7CisgICAgICAgICAgICBpZiAobUJsdWV0b290aEEyZHAuZ2V0U2lua1N0YXRlKGRldmljZSkgPT0gQmx1ZXRvb3RoQTJkcC5TVEFURV9QTEFZSU5HKSB7CiAgICAgICAgICAgICAgICAgaXNCbHVldG9vdGhQbGF5aW5nID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KQEAgLTc5MCw3ICs4MDYsNyBAQAogICAgICAgICAgICAgICAgICAgICBXaWZpTmF0aXZlLmNsb3NlU3VwcGxpY2FudENvbm5lY3Rpb24oKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKGRpZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVzZXRJbnRlcmZhY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgcmVzZXRJbnRlcmZhY2UoZmFsc2UpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBXaGVuIHN1cHBsaWNhbnQgZGllcywga2lsbCB0aGUgREhDUCB0aHJlYWQKICAgICAgICAgICAgICAgICBpZiAobURoY3BUYXJnZXQgIT0gbnVsbCkgewpAQCAtMTAyMywxNyArMTAzOSwxMiBAQAogICAgICAgICAgICAgICAgICAqIE9uIHJlY2VpdmluZyB0aGUgZmlyc3Qgc2NhbiByZXN1bHRzIGFmdGVyIGNvbm5lY3RpbmcgdG8KICAgICAgICAgICAgICAgICAgKiB0aGUgc3VwcGxpY2FudCwgc3dpdGNoIHNjYW4gbW9kZSBvdmVyIHRvIHBhc3NpdmUuCiAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKCFtSXNTY2FuTW9kZVNldER1ZVRvQUhpZGRlbk5ldHdvcmspIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyB0aGUgb25seSBwbGFjZSBhdCB0aGUgbW9tZW50IHdoZXJlIHdlIHNldAotICAgICAgICAgICAgICAgICAgICAvLyB0aGUgc2NhbiBtb2RlIE5PVCBkdWUgdG8gYSBoaWRkZW4gbmV0d29yay4gVGhpcyBpcwotICAgICAgICAgICAgICAgICAgICAvLyB3aGF0IHRoZSBzZWNvbmQgcGFyYW1ldGVyIHZhbHVlIChmYWxzZSkgc3RhbmRzIGZvci4KLSAgICAgICAgICAgICAgICAgICAgc2V0U2Nhbk1vZGUoZmFsc2UsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2V0U2Nhbk1vZGUoZmFsc2UpOwogICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICBjYXNlIEVWRU5UX1BPTExfSU5URVJWQUw6CiAgICAgICAgICAgICAgICAgaWYgKG1XaWZpSW5mby5nZXRTdXBwbGljYW50U3RhdGUoKSAhPSBTdXBwbGljYW50U3RhdGUuVU5JTklUSUFMSVpFRCkgewotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0UG9sbGVkSW5mbyhtV2lmaUluZm8pOworICAgICAgICAgICAgICAgICAgICByZXF1ZXN0UG9sbGVkSW5mbyhtV2lmaUluZm8sIHRydWUpOwogICAgICAgICAgICAgICAgICAgICBjaGVja1BvbGxUaW1lcigpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKQEAg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pbmcgYW55IHNvY2tldHMKICAgICAgKiB1c2luZyB0aGUgaW50ZXJmYWNlLCBzdG9wcGluZyBESENQLCBhbmQgZGlzYWJsaW5nIHRoZSBpbnRlcmZhY2UuCiAgICAgICovCi0gICAgcHVibGljIHZvaWQgcmVzZXRJbnRlcmZhY2UoKSB7CisgICAgcHVibGljIHZvaWQgcmVzZXRJbnRlcmZhY2UoYm9vbGVhbiByZWVuYWJsZSkgewogICAgICAgICBtSGF2ZUlwQWRkcmVzcyA9IGZhbHNlOwogICAgICAgICBtT2J0YWluaW5nSXBBZGRyZXNzID0gZmFsc2U7CiAgICAgICAgIG1XaWZpSW5mby5zZXRJcEFkZHJlc3MoMCk7CkBAIC0xMjQwLDYgKzEyNDksOSBAQAogICAgICAgICB9CiAgICAgICAgIAogICAgICAgICBOZXR3b3JrVXRpbHMuZGlzYWJsZUludGVyZmFjZShtSW50ZXJmYWNlTmFtZSk7CisgICAgICAgIGlmIChyZWVuYWJsZSkgeworICAgICAgICAgICAgTmV0d29ya1V0aWxzLmVuYWJsZUludGVyZmFjZShtSW50ZXJmYWNlTmFtZSk7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTEyNzgsNyArMTI5MCw3IEBACiAgICAgICovCiAgICAgcHVibGljIFdpZmlJbmZvIHJlcXVlc3RDb25uZWN0aW9uSW5mbygpIHsKICAgICAgICAgcmVxdWVzdENvbm5lY3Rpb25TdGF0dXMobVdpZmlJbmZvKTsKLSAgICAgICAgcmVxdWVzdFBvbGxlZEluZm8obVdpZmlJbmZvKTsKKyAgICAgICAgcmVxdWVzdFBvbGxlZEluZm8obVdpZmlJbmZvLCBmYWxzZSk7CiAgICAgICAgIHJldHVybiBtV2lmaUluZm87CiAgICAgfQogCkBAIC0xMzMzLDEwICsxMzQ1LDE0IEBACiAgICAgICogR2V0IHRoZSBkeW5hbWljIGluZm9ybWF0aW9uIHRoYXQgaXMgbm90IHJlcG9ydGVkIHZpYSBldmVudHMuCiAgICAgICogQH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bGVhbiByZXN0YXJ0KCkgewogICAgICAgICBpZiAobVJ1blN0YXRlID09IFJVTl9TVEFURV9TVE9QUEVEKSB7CiAgICAgICAgICAgICBtUnVuU3RhdGUgPSBSVU5fU1RBVEVfU1RBUlRJTkc7CisgICAgICAgICAgICByZXNldEludGVyZmFjZSh0cnVlKTsKICAgICAgICAgICAgIHJldHVybiBXaWZpTmF0aXZlLnN0YXJ0RHJpdmVyQ29tbWFuZCgpOwogICAgICAgICB9IGVsc2UgaWYgKG1SdW5TdGF0ZSA9PSBSVU5fU1RBVEVfU1RPUFBJTkcpIHsKICAgICAgICAgICAgIG1SdW5TdGF0ZSA9IFJVTl9TVEFURV9TVEFSVElORzsKQEAgLTE4NzksNyArMTg5Niw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBvRG5zMiAhPSBtRGhjcEluZm8uZG5zMikpOwogCiAgICAgICAgICAgICBpZiAoY2hhbmdlZCkgewotICAgICAgICAgICAgICAgIHJlc2V0SW50ZXJmYWNlKCk7CisgICAgICAgICAgICAgICAgcmVzZXRJbnRlcmZhY2UodHJ1ZSk7CiAgICAgICAgICAgICAgICAgY29uZmlndXJlSW50ZXJmYWNlKCk7CiAgICAgICAgICAgICAgICAgaWYgKG1Vc2VTdGF0aWNJcCkgewogICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0LnNlbmRFbXB0eU1lc3NhZ2UoRVZFTlRfQ09ORklHVVJBVElPTl9DSEFOR0VEKTsK